diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-27 06:36:44 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-13 15:05:24 +0000 |
commit | 17722af09e527641db7c080013a94ea13f904377 (patch) | |
tree | b32e36a36a5dcfdb922b9fdb5194bb623fb6a9a3 | |
parent | ce2a1922f1159369cd28ee60b2999e0652c6abac (diff) |
loplugin:singlevalfields in sc(part3)
Change-Id: I7309e7e30bd892f0b1bd47c44cdbba79da5e5a9f
Reviewed-on: https://gerrit.libreoffice.org/26686
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/filter/excel/excform.cxx | 32 | ||||
-rw-r--r-- | sc/source/filter/excel/excform8.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/namebuff.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/excel/xepivot.cxx | 26 | ||||
-rw-r--r-- | sc/source/filter/inc/commentsbuffer.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/excform.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/namebuff.hxx | 7 | ||||
-rw-r--r-- | sc/source/filter/inc/xcl97rec.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/xecontent.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/xeescher.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/xepivot.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/lotus/lotfilter.hxx | 5 | ||||
-rw-r--r-- | sc/source/filter/oox/commentsbuffer.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/xcl97/xcl97rec.cxx | 4 |
16 files changed, 19 insertions, 84 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index c3190550a68c..a084fb163ab0 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -184,7 +184,6 @@ void ImportExcel::Formula( ExcelToSc::ExcelToSc( XclImpRoot& rRoot ) : ExcelConverterBase(rRoot.GetDocImport().getDoc().GetSharedStringPool(), 512), XclImpRoot( rRoot ), - bExternName( false ), maFuncProv( rRoot ), meBiff( rRoot.GetBiff() ) { @@ -220,8 +219,6 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s ScComplexRefData aCRD; ExtensionTypeVec aExtensions; - bExternName = false; - if( eStatus != ConvOK ) { aIn.Ignore( nFormulaLen ); @@ -711,25 +708,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s sal_uInt16 nUINT16 = aIn.ReaduInt16(); if( nINT16 >= 0 ) { - const ExtName* pExtName = rR.pExtNameBuff->GetNameByIndex( nINT16, nUINT16 ); - if( pExtName && pExtName->IsDDE() && - rR.pExtSheetBuff->IsLink( ( sal_uInt16 ) nINT16 ) ) - { - OUString aAppl, aExtDoc; - TokenId nPar1, nPar2; - - rR.pExtSheetBuff->GetLink( ( sal_uInt16 ) nINT16 , aAppl, aExtDoc ); - nPar1 = aPool.Store( aAppl ); - nPar2 = aPool.Store( aExtDoc ); - nMerk0 = aPool.Store( pExtName->aName ); - aPool << ocDde << ocOpen << nPar1 << ocSep << nPar2 << ocSep - << nMerk0 << ocClose; - - GetDoc().CreateDdeLink( aAppl, aExtDoc, pExtName->aName, SC_DDE_DEFAULT, ScMatrixRef() ); - } - else - aPool << ocBad; - + aPool << ocBad; aPool >> aStack; } else @@ -898,11 +877,6 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s pErgebnis = aPool[ aStack.Get() ]; eRet = ConvErrCount; } - else if( bExternName ) - { - pErgebnis = aPool[ aStack.Get() ]; - eRet = ConvErrExternal; - } else if( bArrayFormula ) { pErgebnis = nullptr; @@ -939,8 +913,6 @@ ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_ aCRD.Ref1.SetAbsTab(aEingPos.Tab()); aCRD.Ref2.SetAbsTab(aEingPos.Tab()); - bExternName = false; - if( eStatus != ConvOK ) { aIn.Ignore( nFormulaLen ); @@ -1345,8 +1317,6 @@ ConvErr ExcelToSc::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal_ eRet = ConvErrNi; else if( aIn.GetRecPos() != nEndPos ) eRet = ConvErrCount; - else if( bExternName ) - eRet = ConvErrExternal; else eRet = ConvOK; diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index bea8ba395a8c..65007527c71a 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -966,8 +966,6 @@ ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal ScSingleRefData aSRD; ScComplexRefData aCRD; - bExternName = false; - if( eStatus != ConvOK ) { aIn.Ignore( nFormulaLen ); @@ -1291,8 +1289,6 @@ ConvErr ExcelToSc8::Convert( ScRangeListTabs& rRangeList, XclImpStream& aIn, sal eRet = ConvErrNi; else if( aIn.GetRecPos() != nEndPos ) eRet = ConvErrCount; - else if( bExternName ) - eRet = ConvErrExternal; else eRet = ConvOK; diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx index 888e005128ea..3b12910187a3 100644 --- a/sc/source/filter/excel/namebuff.cxx +++ b/sc/source/filter/excel/namebuff.cxx @@ -157,16 +157,6 @@ bool ExtSheetBuffer::GetScTabIndex( sal_uInt16 nExcIndex, sal_uInt16& rScIndex ) return false; } -bool ExtSheetBuffer::IsLink( const sal_uInt16 nExcIndex ) const -{ - OSL_ENSURE( nExcIndex > 0, "*ExtSheetBuffer::IsLink(): Index has to be >0!" ); - - if (!nExcIndex || nExcIndex > maEntries.size() ) - return false; - - return maEntries[ nExcIndex -1 ].bLink; -} - void ExtSheetBuffer::GetLink( const sal_uInt16 nExcIndex, OUString& rAppl, OUString& rDoc ) const { OSL_ENSURE( nExcIndex > 0, "*ExtSheetBuffer::GetLink(): Index has to be >0!" ); diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 8bef80753b5e..86a19f7582af 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -321,8 +321,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU XclExpRecord( EXC_ID_HLINK ), maScPos( rScPos ), mxVarData( new SvMemoryStream ), - mnFlags( 0 ), - mbSetDisplay( true ) + mnFlags( 0 ) { const OUString& rUrl = rUrlField.GetURL(); const OUString& rRepr = rUrlField.GetRepresentation(); @@ -514,9 +513,7 @@ void XclExpHyperlink::SaveXml( XclExpXmlStream& rStrm ) ? XclXmlUtils::ToOString( *mxTextMark ).getStr() : nullptr, // OOXTODO: XML_tooltip, from record HLinkTooltip 800h wzTooltip - XML_display, mbSetDisplay - ? XclXmlUtils::ToOString(m_Repr).getStr() - : nullptr, + XML_display, XclXmlUtils::ToOString(m_Repr).getStr(), FSEND ); } diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 8c538b939463..47334e4751b4 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1199,7 +1199,6 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos, // AutoFill style would change if Postit.cxx object creation values are changed OUString aCol(((XFillColorItem &)GETITEM(aItemSet, XFillColorItem , XATTR_FILLCOLOR)).GetValue()); mbAutoFill = aCol.isEmpty() && (GETITEMVALUE(aItemSet, XFillStyleItem, XATTR_FILLSTYLE, sal_uLong) == drawing::FillStyle_SOLID); - mbAutoLine = true; mbRowHidden = (rRoot.GetDoc().RowHidden(maScPos.Row(),maScPos.Tab())); mbColHidden = (rRoot.GetDoc().ColHidden(maScPos.Col(),maScPos.Tab())); } diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index e496dc224518..897651fe7d4c 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1623,8 +1623,7 @@ void XclExpPivotRecWrapper::Save( XclExpStream& rStrm ) } // namespace XclExpPivotTableManager::XclExpPivotTableManager( const XclExpRoot& rRoot ) : - XclExpRoot( rRoot ), - mbShareCaches( true ) + XclExpRoot( rRoot ) { } @@ -1671,22 +1670,19 @@ const XclExpPivotCache* XclExpPivotTableManager::CreatePivotCache( const ScDPObj (i.e. grouping info, calculated fields). If the passed DataPilot object or the found cache contains this data, do not share the cache with multiple pivot tables. */ - if( mbShareCaches ) + if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) { - if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) + const ScDPDimensionSaveData* pDimSaveData = pSaveData->GetExistingDimensionData(); + // no dimension save data at all or save data does not contain grouping info + if( !pDimSaveData || !pDimSaveData->HasGroupDimensions() ) { - const ScDPDimensionSaveData* pDimSaveData = pSaveData->GetExistingDimensionData(); - // no dimension save data at all or save data does not contain grouping info - if( !pDimSaveData || !pDimSaveData->HasGroupDimensions() ) + // check all existing pivot caches + for( size_t nPos = 0, nSize = maPCacheList.GetSize(); nPos < nSize; ++nPos ) { - // check all existing pivot caches - for( size_t nPos = 0, nSize = maPCacheList.GetSize(); nPos < nSize; ++nPos ) - { - XclExpPivotCacheRef xPCache = maPCacheList.GetRecord( nPos ); - // pivot cache does not have grouping info and source data is equal - if( !xPCache->HasAddFields() && xPCache->HasEqualDataSource( rDPObj ) ) - return xPCache.get(); - } + XclExpPivotCacheRef xPCache = maPCacheList.GetRecord( nPos ); + // pivot cache does not have grouping info and source data is equal + if( !xPCache->HasAddFields() && xPCache->HasEqualDataSource( rDPObj ) ) + return xPCache.get(); } } } diff --git a/sc/source/filter/inc/commentsbuffer.hxx b/sc/source/filter/inc/commentsbuffer.hxx index 2dc570ecbbdf..a4d19a8617f6 100644 --- a/sc/source/filter/inc/commentsbuffer.hxx +++ b/sc/source/filter/inc/commentsbuffer.hxx @@ -41,7 +41,6 @@ struct CommentModel sal_Int32 mnTHA; /// Horizontal Alignment sal_Int32 mnTVA; /// Vertical Alignment css::awt::Rectangle maAnchor; /// Anchor parameters - bool mbVisible; /// True = comment is always shown (BIFF2-BIFF8 only). explicit CommentModel(); }; diff --git a/sc/source/filter/inc/excform.hxx b/sc/source/filter/inc/excform.hxx index 5edda9f767c4..84493a4242a0 100644 --- a/sc/source/filter/inc/excform.hxx +++ b/sc/source/filter/inc/excform.hxx @@ -35,7 +35,6 @@ protected: enum ExtensionType { EXTENSION_ARRAY, EXTENSION_NLR, EXTENSION_MEMAREA }; typedef ::std::vector< ExtensionType > ExtensionTypeVec; - bool bExternName; // external name was found static const sal_uInt16 nRowMask; XclFunctionProvider maFuncProv; diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx index dc770d41d992..c711e977b2ea 100644 --- a/sc/source/filter/inc/namebuff.hxx +++ b/sc/source/filter/inc/namebuff.hxx @@ -184,14 +184,13 @@ class ExtSheetBuffer : public ExcRoot { private: struct Cont - { + { OUString aFile; OUString aTab; sal_uInt16 nTabNum; // 0xFFFF -> not set yet // 0xFFFE -> tried to set, but failed // 0xFFFD -> should be in the same workbook, but not found bool bSWB; - bool bLink; Cont( const OUString& rFilePathAndName, const OUString& rTabName, const bool bSameWB ) : aFile( rFilePathAndName ), @@ -199,9 +198,8 @@ private: { nTabNum = 0xFFFF; // -> table not created yet bSWB = bSameWB; - bLink = false; } - }; + }; std::vector<Cont> maEntries; @@ -212,7 +210,6 @@ public: const OUString& rTabName, const bool bSameWorkbook = false ); bool GetScTabIndex( sal_uInt16 nExcSheetIndex, sal_uInt16& rIn_LastTab_Out_ScIndex ); - bool IsLink( const sal_uInt16 nExcSheetIndex ) const; void GetLink( const sal_uInt16 nExcSheetIndex, OUString &rAppl, OUString &rDoc ) const; void Reset(); diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx index b2a7f5621e2d..3965cbe02536 100644 --- a/sc/source/filter/inc/xcl97rec.hxx +++ b/sc/source/filter/inc/xcl97rec.hxx @@ -271,7 +271,6 @@ private: class ExcBof8_Base : public ExcBof_Base { protected: - sal_uInt32 nFileHistory; // bfh sal_uInt32 nLowestBiffVer; // sfo virtual void SaveCont( XclExpStream& rStrm ) override; diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx index 111aefdddb40..ff2446344066 100644 --- a/sc/source/filter/inc/xecontent.hxx +++ b/sc/source/filter/inc/xecontent.hxx @@ -131,7 +131,6 @@ private: sal_uInt32 mnFlags; /// Option flags. XclExpStringRef mxTextMark; /// Location within m_Repr OUString msTarget; /// Target URL - bool mbSetDisplay; /// True if display attribute it written }; typedef XclExpRecordList< XclExpHyperlink > XclExpHyperlinkList; diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx index bd94a98dbfb2..886aa0ca0b90 100644 --- a/sc/source/filter/inc/xeescher.hxx +++ b/sc/source/filter/inc/xeescher.hxx @@ -355,7 +355,6 @@ private: bool mbAutoScale; /// Auto scale text bool mbLocked; /// Position & Size locked bool mbAutoFill; /// Auto Fill Style - bool mbAutoLine; /// Auto Line Style bool mbColHidden; /// Column containing the comment is hidden bool mbRowHidden; /// Row containing the comment is hidden Rectangle maCommentFrom; /// From and From Offset diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index f959991f4490..4b2f71329cdd 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -439,7 +439,6 @@ private: XclExpPivotCacheList maPCacheList; /// List of all pivot caches. XclExpPivotTableList maPTableList; /// List of all pivot tables. - bool mbShareCaches; /// true = Tries to share caches between tables. }; #endif diff --git a/sc/source/filter/lotus/lotfilter.hxx b/sc/source/filter/lotus/lotfilter.hxx index 7a7f9f9128a0..94aad9117c0f 100644 --- a/sc/source/filter/lotus/lotfilter.hxx +++ b/sc/source/filter/lotus/lotfilter.hxx @@ -33,7 +33,7 @@ class FormCache; struct LotusContext { - const sal_uInt16 nBOF; + static const sal_uInt16 nBOF = 0x0000; WKTYP eTyp; // type of file being processed bool bEOF; // shows end of file rtl_TextEncoding eCharVon; @@ -51,8 +51,7 @@ struct LotusContext FormCache* pValueFormCache; // -> in memory.cxx initialisiert LotusContext() - : nBOF(0x0000) - , eTyp(eWK_UNKNOWN) + : eTyp(eWK_UNKNOWN) , bEOF(false) , eCharVon(RTL_TEXTENCODING_DONTKNOW) , pDoc(nullptr) diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx index a44b2a7996b5..e29a278b6fb3 100644 --- a/sc/source/filter/oox/commentsbuffer.cxx +++ b/sc/source/filter/oox/commentsbuffer.cxx @@ -89,7 +89,6 @@ CommentModel::CommentModel() , mbRowHidden(false) , mnTHA(0) , mnTVA(0) - , mbVisible( false ) { } diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index e242d1c14abc..03666269aa51 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -990,8 +990,6 @@ ExcBof8_Base::ExcBof8_Base() nVers = 0x0600; nRupBuild = 0x0dbb; nRupYear = 0x07cc; -// nFileHistory = 0x00000001; // last edited by Microsoft Excel for Windows - nFileHistory = 0x00000000; nLowestBiffVer = 0x00000006; // Biff8 } void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& rShape, SCTAB nTab ) @@ -1188,7 +1186,7 @@ void ExcBof8_Base::SaveCont( XclExpStream& rStrm ) { rStrm.DisableEncryption(); rStrm << nVers << nDocType << nRupBuild << nRupYear - << nFileHistory << nLowestBiffVer; + << sal_uInt32(0)/*nFileHistory*/ << nLowestBiffVer; } sal_uInt16 ExcBof8_Base::GetNum() const |