From 18f513145477d4621290253d936dad7a40ee4c05 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 20 Jun 2017 19:54:23 +0200 Subject: loplugin:unusedfields store..svl Change-Id: I6070a683e5128271b84a10caccb548d07c950927 Reviewed-on: https://gerrit.libreoffice.org/39021 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/store/types.h | 6 ------ include/svl/ondemand.hxx | 6 ------ soltools/mkdepend/cppsetup.c | 12 +----------- soltools/mkdepend/def.h | 4 +--- soltools/mkdepend/ifparser.h | 1 - soltools/mkdepend/main.c | 1 - soltools/mkdepend/parse.c | 20 +++++++++----------- sot/source/sdstor/stgdir.cxx | 5 ----- sot/source/sdstor/stgdir.hxx | 6 ++---- sot/source/sdstor/stgio.cxx | 1 - sot/source/sdstor/stgio.hxx | 1 - sot/source/sdstor/ucbstorage.cxx | 10 ---------- store/source/stordir.cxx | 1 - svgio/inc/svgstyleattributes.hxx | 4 ---- svgio/inc/svgtextpathnode.hxx | 9 --------- svgio/source/svgreader/svgstyleattributes.cxx | 12 ------------ svgio/source/svgreader/svgtextpathnode.cxx | 26 +------------------------- svl/source/undo/undo.cxx | 3 --- 18 files changed, 14 insertions(+), 114 deletions(-) diff --git a/include/store/types.h b/include/store/types.h index 48a6b0ee6b19..da2c0fea2630 100644 --- a/include/store/types.h +++ b/include/store/types.h @@ -120,12 +120,6 @@ typedef struct */ sal_uInt32 m_nAttrib; - /** Size. - @see store_getStreamSize() - @see store_setStreamSize() - */ - sal_uInt32 m_nSize; - /** Reserved for internal use. */ sal_uInt32 m_nReserved; diff --git a/include/svl/ondemand.hxx b/include/svl/ondemand.hxx index b48523cd594d..d1c0815dc16c 100644 --- a/include/svl/ondemand.hxx +++ b/include/svl/ondemand.hxx @@ -141,13 +141,11 @@ class OnDemandCalendarWrapper mutable std::unique_ptr pPtr; mutable bool bValid; - bool bInitialized; public: OnDemandCalendarWrapper() : pPtr(nullptr) , bValid(false) - , bInitialized(false) {} void init( @@ -158,7 +156,6 @@ public: m_xContext = rxContext; changeLocale( rLocale ); pPtr.reset(); - bInitialized = true; } void changeLocale( const css::lang::Locale& rLocale ) @@ -252,12 +249,10 @@ class OnDemandNativeNumberWrapper css::uno::Reference< css::uno::XComponentContext > m_xContext; mutable std::unique_ptr pPtr; - bool bInitialized; public: OnDemandNativeNumberWrapper() : pPtr(nullptr) - , bInitialized(false) {} void init( @@ -266,7 +261,6 @@ public: { m_xContext = rxContext; pPtr.reset(); - bInitialized = true; } NativeNumberWrapper* get() const diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c index acbdcc6377eb..12b7d12ef55d 100644 --- a/soltools/mkdepend/cppsetup.c +++ b/soltools/mkdepend/cppsetup.c @@ -114,11 +114,6 @@ yyerror(s) #else /* not CPP */ #include "ifparser.h" -struct parse_data { - struct filepointer *filep; - struct inclist *inc; - const char *line; -}; static const char * my_if_errors (IfParser *ip, const char *cp, const char *expecting) @@ -199,19 +194,14 @@ my_eval_variable (IfParser *ip, const char *var, size_t len) } -int cppsetup(char *line, struct filepointer *filep, struct inclist *inc) +int cppsetup(char *line) { IfParser ip; - struct parse_data pd; int val = 0; - pd.filep = filep; - pd.inc = inc; - pd.line = line; ip.funcs.handle_error = my_if_errors; ip.funcs.eval_defined = my_eval_defined; ip.funcs.eval_variable = my_eval_variable; - ip.data = (char *) &pd; (void) ParseIfExpression (&ip, line, &val); if (val) diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h index fd3f34691128..4c3649cb8369 100644 --- a/soltools/mkdepend/def.h +++ b/soltools/mkdepend/def.h @@ -138,7 +138,6 @@ struct filepointer { char *f_p; char *f_base; char *f_end; - long f_len; long f_line; }; @@ -172,8 +171,7 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct IncludesCollection* incCollection, struct symhash *symbols); void included_by(struct inclist *ip, struct inclist * newfile); -int cppsetup(char *line, - struct filepointer *filep, struct inclist *inc); +int cppsetup(char *line); void add_include(struct filepointer *filep, struct inclist *file, struct inclist *file_red, char *include, boolean dot, boolean failOK, struct IncludesCollection* incCollection, struct symhash *symbols); diff --git a/soltools/mkdepend/ifparser.h b/soltools/mkdepend/ifparser.h index 490ba513b0bc..5c3c0dbb6b79 100644 --- a/soltools/mkdepend/ifparser.h +++ b/soltools/mkdepend/ifparser.h @@ -68,7 +68,6 @@ typedef struct if_parser { int (*eval_variable) (struct if_parser *, const char *, size_t); int (*eval_defined) (struct if_parser *, const char *, size_t); } funcs; - char *data; } IfParser; const char *ParseIfExpression (IfParser *, const char *, int *); diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index 438db70f8e3e..80aad85f5274 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -512,7 +512,6 @@ struct filepointer *getfile(char *file) fatalerr("makedepend: Failed to read file \"%s\"\n", file); close(fd); - content->f_len = bytes_read+1; content->f_p = content->f_base; content->f_end = content->f_base + bytes_read; *content->f_end = '\0'; diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c index 01d34dcc1c14..1da6448a253a 100644 --- a/soltools/mkdepend/parse.c +++ b/soltools/mkdepend/parse.c @@ -34,11 +34,9 @@ char *hash_lookup( char *symbol, struct symhash *symbols ); void hash_undefine( char *symbol, struct symhash *symbols ); int gobble( struct filepointer *filep, struct inclist *file, struct inclist *file_red, struct symhash *symbols ); -int deftype ( char *line, struct filepointer *filep, - struct inclist *file_red, struct inclist *file, +int deftype ( char *line, struct inclist *file, int parse_it, struct symhash *symbols); -int zero_value(char *exp, struct filepointer *filep, - struct inclist *file_red, struct symhash *symbols); +int zero_value(char *exp, struct symhash *symbols); extern struct symhash *maininclist; @@ -49,7 +47,7 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis boolean recfailOK; while ((line = get_line(filep))) { - switch(type = deftype(line, filep, file_red, file, TRUE, symbols)) { + switch(type = deftype(line, file, TRUE, symbols)) { case IF: doif: type = find_includes(filep, file, @@ -172,7 +170,7 @@ int gobble(struct filepointer *filep, int type; while ((line = get_line(filep))) { - switch(type = deftype(line, filep, file_red, file, FALSE, symbols)) { + switch(type = deftype(line, file, FALSE, symbols)) { case IF: case IFFALSE: case IFGUESSFALSE: @@ -217,7 +215,7 @@ int gobble(struct filepointer *filep, /* * Decide what type of # directive this line is. */ -int deftype (char *line, struct filepointer *filep, struct inclist *file_red, struct inclist *file, int parse_it, struct symhash *symbols) +int deftype (char *line, struct inclist *file, int parse_it, struct symhash *symbols) { char *p; char *directive, savechar; @@ -253,7 +251,7 @@ int deftype (char *line, struct filepointer *filep, struct inclist *file_red, st */ debug(0,("%s, line %d: #elif %s ", file->i_file, filep->f_line, p)); - ret = zero_value(p, filep, file_red, symbols); + ret = zero_value(p, symbols); if (ret != IF) { debug(0,("false...\n")); @@ -282,7 +280,7 @@ int deftype (char *line, struct filepointer *filep, struct inclist *file_red, st /* * parse an expression. */ - ret = zero_value(p, filep, file_red, symbols); + ret = zero_value(p, symbols); debug(0,("%s, line %d: %s #if %s\n", file->i_file, filep->f_line, ret?"false":"true", p)); break; @@ -372,10 +370,10 @@ char * isdefined( char *symbol ) /* * Return type based on if the #if expression evaluates to 0 */ -int zero_value(char *exp, struct filepointer *filep, struct inclist *file_red, struct symhash *symbols) +int zero_value(char *exp, struct symhash *symbols) { global_symbols = symbols; /* HACK! see above */ - if (cppsetup(exp, filep, file_red)) + if (cppsetup(exp)) return IFFALSE; else return IF; diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index bc0d042065ef..ffc6d38ce76b 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -67,7 +67,6 @@ void StgDirEntry::InitMembers() m_aSave = m_aEntry; m_pUp = m_pDown = nullptr; - m_ppRoot = nullptr; m_pStgStrm = nullptr; m_pCurStrm = m_pTmpStrm = nullptr; @@ -727,11 +726,9 @@ void StgDirEntry::Invalidate( bool bDel ) StgDirStrm::StgDirStrm( StgIo& r ) : StgDataStrm( r, r.m_aHdr.GetTOCStart(), -1 ) , m_pRoot( nullptr ) - , m_nEntries( 0 ) { if( r.GetError() ) return; - m_nEntries = m_nPageSize / STGENTRY_SIZE; if( m_nStart == STG_EOF ) { StgEntry aRoot; @@ -817,7 +814,6 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper ) ( reinterpret_cast( pUpper ? &pUpper->m_pDown : &m_pRoot ), pCur ) ) { pCur->m_pUp = pUpper; - pCur->m_ppRoot = &m_pRoot; } else { @@ -972,7 +968,6 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn if( StgAvlNode::Insert( reinterpret_cast(&rStg.m_pDown), pRes ) ) { pRes->m_pUp = &rStg; - pRes->m_ppRoot = &m_pRoot; pRes->m_bCreated = pRes->m_bDirty = true; } diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx index ca80ab6f3ffa..5809703602dd 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -35,9 +35,8 @@ class StgDirEntry : public StgAvlNode friend class StgIterator; friend class StgDirStrm; StgEntry m_aSave; // original dir entry - StgDirEntry* m_pUp; // parent directory - StgDirEntry* m_pDown; // child directory for storages - StgDirEntry** m_ppRoot; // root of TOC tree + StgDirEntry* m_pUp; // parent directory + StgDirEntry* m_pDown; // child directory for storages StgStrm* m_pStgStrm; // storage stream StgTmpStrm* m_pTmpStrm; // temporary stream StgTmpStrm* m_pCurStrm; // temp stream after commit @@ -92,7 +91,6 @@ class StgDirStrm : public StgDataStrm { friend class StgIterator; StgDirEntry* m_pRoot; // root of dir tree - short m_nEntries; // entries per page void SetupEntry( sal_Int32, StgDirEntry* ); public: explicit StgDirStrm( StgIo& ); diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index c5d92be67590..1ac21705ad03 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -383,7 +383,6 @@ FatError StgIo::ValidateFATs() { StgLinkArg aArg; aArg.aFile = pFileStrm->GetFileName(); - aArg.nErr = nErr; ErrorLink::get().Call( aArg ); m_bCopied = true; } diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index 7b7948645ff3..3474b2829849 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -44,7 +44,6 @@ enum class FatError struct StgLinkArg { OUString aFile; - FatError nErr; }; class StgIo : public StgCache { diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 14675908d142..67c7582a3b05 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -424,7 +424,6 @@ public: SvStream* m_pStream; // the stream worked on; for readonly streams it is the original stream of the content // for read/write streams it's a copy into a temporary file OUString m_aTempURL; // URL of this temporary stream - RepresentMode m_nRepresentMode; // should it be used as XInputStream or as SvStream ErrCode m_nError; StreamMode m_nMode; // open mode ( read/write/trunc/nocreate/sharing ) bool m_bSourceRead; // Source still contains useful information @@ -484,7 +483,6 @@ public: // this means that the root storage does an autocommit when its external // reference is destroyed bool m_bIsRoot; // marks this storage as root storages that manages all commits and reverts - bool m_bDirty; // ??? bool m_bIsLinked; bool m_bListCreated; SotClipboardFormatId m_nFormat; @@ -638,7 +636,6 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const OUString& rName, StreamMode , m_aURL( rName ) , m_pContent( nullptr ) , m_pStream( nullptr ) - , m_nRepresentMode( RepresentMode::NONE ) , m_nError( ERRCODE_NONE ) , m_nMode( nMode ) , m_bSourceRead( !( nMode & StreamMode::TRUNC ) ) @@ -698,8 +695,6 @@ bool UCBStorageStream_Impl::Init() // no temporary stream was created // create one - m_nRepresentMode = RepresentMode::svstream; // can not be used as XInputStream - if ( m_aTempURL.isEmpty() ) m_aTempURL = ::utl::TempFile().GetURL(); @@ -1186,7 +1181,6 @@ void UCBStorageStream_Impl::Free() } #endif - m_nRepresentMode = RepresentMode::NONE; m_rSource.clear(); DELETEZ( m_pStream ); } @@ -1475,7 +1469,6 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const OU , m_bCommited( false ) , m_bDirect( bDirect ) , m_bIsRoot( bIsRoot ) - , m_bDirty( false ) , m_bIsLinked( true ) , m_bListCreated( false ) , m_nFormat( SotClipboardFormatId::NONE ) @@ -1507,7 +1500,6 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt , m_bCommited( false ) , m_bDirect( bDirect ) , m_bIsRoot( bIsRoot ) - , m_bDirty( false ) , m_bIsLinked( false ) , m_bListCreated( false ) , m_nFormat( SotClipboardFormatId::NONE ) @@ -1557,7 +1549,6 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool , m_bCommited( false ) , m_bDirect( bDirect ) , m_bIsRoot( true ) - , m_bDirty( false ) , m_bIsLinked( false ) , m_bListCreated( false ) , m_nFormat( SotClipboardFormatId::NONE ) @@ -2353,7 +2344,6 @@ bool UCBStorage::IsRoot() const void UCBStorage::SetDirty() { - pImp->m_bDirty = true; } void UCBStorage::SetClass( const SvGlobalName & rClass, SotClipboardFormatId nOriginalClipFormat, const OUString & rUserTypeName ) diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx index a4847cbc719e..ec18b81176a3 100644 --- a/store/source/stordir.cxx +++ b/store/source/stordir.cxx @@ -193,7 +193,6 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData) rFindData.m_nLength = static_cast(n); rFindData.m_nAttrib |= aPage.attrib(); - rFindData.m_nSize = aPage.dataLength(); // Leave. rFindData.m_nReserved = store::ntohl(aKey.m_nLow); diff --git a/svgio/inc/svgstyleattributes.hxx b/svgio/inc/svgstyleattributes.hxx index b9f655eba3d2..ab9b0479bf13 100644 --- a/svgio/inc/svgstyleattributes.hxx +++ b/svgio/inc/svgstyleattributes.hxx @@ -204,7 +204,6 @@ namespace svgio SvgNumber maFontSizeNumber; FontStretch maFontStretch; FontStyle maFontStyle; - FontVariant maFontVariant; FontWeight maFontWeight; TextAlign maTextAlign; TextDecoration maTextDecoration; @@ -381,9 +380,6 @@ namespace svgio FontStyle getFontStyle() const; void setFontStyle(const FontStyle aFontStyle) { maFontStyle = aFontStyle; } - /// FontVariant content - void setFontVariant(const FontVariant aFontVariant) { maFontVariant = aFontVariant; } - /// FontWeight content FontWeight getFontWeight() const; void setFontWeight(const FontWeight aFontWeight) { maFontWeight = aFontWeight; } diff --git a/svgio/inc/svgtextpathnode.hxx b/svgio/inc/svgtextpathnode.hxx index 39876511ec99..a0aa9b05270b 100644 --- a/svgio/inc/svgtextpathnode.hxx +++ b/svgio/inc/svgtextpathnode.hxx @@ -41,9 +41,6 @@ namespace svgio /// variable scan values, dependent of given XAttributeList SvgNumber maStartOffset; - bool mbMethod : 1; // true = align, false = stretch - bool mbSpacing : 1; // true = auto, false = exact - public: SvgTextPathNode( SvgDocument& rDocument, @@ -60,12 +57,6 @@ namespace svgio /// StartOffset content const SvgNumber& getStartOffset() const { return maStartOffset; } - - /// Method content - void setMethod(bool bNew) { mbMethod = bNew; } - - /// Spacing content - void setSpacing(bool bNew) { mbSpacing = bNew; } }; } // end of namespace svgreader } // end of namespace svgio diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 15abeb022ff1..19e2bfd9bb91 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -1230,7 +1230,6 @@ namespace svgio maFontSizeNumber(), maFontStretch(FontStretch_notset), maFontStyle(FontStyle_notset), - maFontVariant(FontVariant_notset), maFontWeight(FontWeight_notset), maTextAlign(TextAlign_notset), maTextDecoration(TextDecoration_notset), @@ -1651,17 +1650,6 @@ namespace svgio } case SVGTokenFontVariant: { - if(!aContent.isEmpty()) - { - if(aContent.startsWith("normal")) - { - setFontVariant(FontVariant_normal); - } - else if(aContent.startsWith("small-caps")) - { - setFontVariant(FontVariant_small_caps); - } - } break; } case SVGTokenFontWeight: diff --git a/svgio/source/svgreader/svgtextpathnode.cxx b/svgio/source/svgreader/svgtextpathnode.cxx index 0ac0457a174b..e9b00eb2ddec 100644 --- a/svgio/source/svgreader/svgtextpathnode.cxx +++ b/svgio/source/svgreader/svgtextpathnode.cxx @@ -251,9 +251,7 @@ namespace svgio : SvgNode(SVGTokenTextPath, rDocument, pParent), maSvgStyleAttributes(*this), maXLink(), - maStartOffset(), - mbMethod(true), - mbSpacing(false) + maStartOffset() { } @@ -297,32 +295,10 @@ namespace svgio } case SVGTokenMethod: { - if(!aContent.isEmpty()) - { - if(aContent.startsWith("align")) - { - setMethod(true); - } - else if(aContent.startsWith("stretch")) - { - setMethod(false); - } - } break; } case SVGTokenSpacing: { - if(!aContent.isEmpty()) - { - if(aContent.startsWith("auto")) - { - setSpacing(true); - } - else if(aContent.startsWith("exact")) - { - setSpacing(false); - } - } break; } case SVGTokenXlinkHref: diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index db6be7846ef8..cb227fc5a2d3 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -223,7 +223,6 @@ struct SfxUndoManager_Data std::unique_ptr pUndoArray; SfxUndoArray* pActUndoArray; - SfxUndoArray* pFatherUndoArray; sal_Int32 mnMarks; sal_Int32 mnEmptyMark; @@ -236,7 +235,6 @@ struct SfxUndoManager_Data explicit SfxUndoManager_Data( size_t i_nMaxUndoActionCount ) :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) ) ,pActUndoArray( nullptr ) - ,pFatherUndoArray( nullptr ) ,mnMarks( 0 ) ,mnEmptyMark(MARK_INVALID) ,mbUndoEnabled( true ) @@ -1000,7 +998,6 @@ void SfxUndoManager::EnterListAction( const OUString& rComment, if ( !m_xData->pUndoArray->nMaxUndoActions ) return; - m_xData->pFatherUndoArray = m_xData->pActUndoArray; SfxListUndoAction* pAction = new SfxListUndoAction( rComment, rRepeatComment, nId, nViewShellId, m_xData->pActUndoArray ); OSL_VERIFY( ImplAddUndoAction_NoNotify( pAction, false, false, aGuard ) ); // expected to succeed: all conditions under which it could fail should have been checked already -- cgit