framework/inc/helper/mischelper.hxx | 4 framework/source/fwe/helper/configimporter.cxx | 8 framework/source/fwe/xml/menudocumenthandler.cxx | 9 - framework/source/jobs/jobdata.cxx | 3 framework/source/jobs/jobexecutor.cxx | 12 - framework/source/jobs/shelljob.cxx | 25 -- framework/source/layoutmanager/layoutmanager.cxx | 3 framework/source/loadenv/loadenv.cxx | 10 - framework/source/uiconfiguration/globalsettings.cxx | 17 -- framework/source/uiconfiguration/imagemanagerimpl.cxx | 4 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 5 framework/source/uiconfiguration/uicategorydescription.cxx | 14 - framework/source/uielement/addonstoolbarmanager.cxx | 4 framework/source/uielement/recentfilesmenucontroller.cxx | 9 - framework/source/uielement/statusbarmanager.cxx | 20 -- framework/source/uielement/statusbarmerger.cxx | 39 +--- framework/source/uielement/toolbarmanager.cxx | 23 -- framework/source/uielement/toolbarsmenucontroller.cxx | 24 -- framework/source/uielement/uicommanddescription.cxx | 52 +----- sc/inc/attarray.hxx | 1 sc/inc/cellsuno.hxx | 3 sc/inc/chgtrack.hxx | 10 - sc/inc/column.hxx | 1 sc/inc/dociter.hxx | 1 sc/inc/document.hxx | 4 sc/inc/dptabsrc.hxx | 4 sc/inc/edittextiterator.hxx | 4 sc/inc/filtopt.hxx | 2 sc/source/core/data/attarray.cxx | 10 - sc/source/core/data/column.cxx | 23 -- sc/source/core/data/column2.cxx | 5 sc/source/core/data/dociter.cxx | 7 sc/source/core/data/documen2.cxx | 5 sc/source/core/data/documen3.cxx | 7 sc/source/core/data/documen9.cxx | 34 +--- sc/source/core/data/dptabsrc.cxx | 28 --- sc/source/core/data/edittextiterator.cxx | 17 -- sc/source/core/data/poolhelp.cxx | 10 - sc/source/core/inc/poolhelp.hxx | 2 sc/source/core/tool/chgtrack.cxx | 23 -- sc/source/core/tool/filtopt.cxx | 11 - sc/source/filter/excel/excimp8.cxx | 27 --- sc/source/filter/excel/xepivot.cxx | 7 sc/source/filter/excel/xestyle.cxx | 12 - sc/source/filter/excel/xichart.cxx | 12 - sc/source/filter/excel/xihelper.cxx | 7 sc/source/filter/excel/xipivot.cxx | 23 -- sc/source/filter/excel/xistream.cxx | 9 - sc/source/filter/excel/xistring.cxx | 2 sc/source/filter/excel/xistyle.cxx | 7 sc/source/filter/html/htmlimp.cxx | 2 sc/source/filter/inc/XclImpChangeTrack.hxx | 12 - sc/source/filter/inc/excimp8.hxx | 4 sc/source/filter/inc/htmlimp.hxx | 1 sc/source/filter/inc/sheetdatabuffer.hxx | 4 sc/source/filter/inc/viewsettings.hxx | 2 sc/source/filter/inc/xepivot.hxx | 3 sc/source/filter/inc/xestyle.hxx | 11 - sc/source/filter/inc/xichart.hxx | 10 - sc/source/filter/inc/xihelper.hxx | 2 sc/source/filter/inc/xipivot.hxx | 4 sc/source/filter/inc/xistream.hxx | 6 sc/source/filter/inc/xistring.hxx | 2 sc/source/filter/inc/xistyle.hxx | 2 sc/source/filter/oox/pagesettings.cxx | 9 - sc/source/filter/oox/sheetdatabuffer.cxx | 28 +-- sc/source/filter/oox/viewsettings.cxx | 7 sc/source/filter/xcl97/XclImpChangeTrack.cxx | 4 sc/source/filter/xml/XMLColumnRowGroupExport.cxx | 7 sc/source/filter/xml/XMLColumnRowGroupExport.hxx | 1 sc/source/filter/xml/xmlcelli.cxx | 23 -- sc/source/filter/xml/xmlcelli.hxx | 2 sc/source/filter/xml/xmlexprt.cxx | 16 - sc/source/filter/xml/xmlexprt.hxx | 2 sc/source/ui/Accessibility/AccessibleDocument.cxx | 39 ++-- sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 7 sc/source/ui/dbgui/csvruler.cxx | 12 - sc/source/ui/docshell/docsh6.cxx | 7 sc/source/ui/docshell/editable.cxx | 22 -- sc/source/ui/inc/AccessibleSpreadsheet.hxx | 1 sc/source/ui/inc/acredlin.hxx | 1 sc/source/ui/inc/autofmt.hxx | 1 sc/source/ui/inc/colrowba.hxx | 2 sc/source/ui/inc/csvruler.hxx | 2 sc/source/ui/inc/docsh.hxx | 1 sc/source/ui/inc/editable.hxx | 1 sc/source/ui/inc/mvtabdlg.hxx | 1 sc/source/ui/miscdlgs/acredlin.cxx | 48 ++--- sc/source/ui/miscdlgs/autofmt.cxx | 11 - sc/source/ui/miscdlgs/mvtabdlg.cxx | 7 sc/source/ui/unoobj/cellsuno.cxx | 85 ++++------ sc/source/ui/view/colrowba.cxx | 7 92 files changed, 281 insertions(+), 741 deletions(-)
New commits: commit 27513d4df50f6d18b585f4cbec6a4dd3f9b432cc Author: Noel Grandin <[email protected]> Date: Fri Nov 4 13:37:06 2016 +0200 loplugin:expandablemethods in sc Change-Id: Ib417c5e978fca563f8c0ef0dbe6b9d50fead9828 Reviewed-on: https://gerrit.libreoffice.org/30566 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index f22bc34..2b44040 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -169,7 +169,6 @@ public: void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); bool IsStyleSheetUsed( const ScStyleSheet& rStyle ) const; - void DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow); void SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pWantedPattern, bool bDefault ); void CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttrArray& rAttrArray ); diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 4b8072b..3dcbc82 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -1484,9 +1484,6 @@ private: ScRange aTotalRange; ScMyRangeLists aRangeLists; -private: - void GetObjects_Impl(); - public: ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rR); virtual ~ScUniqueCellFormatsObj() override; diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index 2102dce..aea3fe6 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -263,18 +263,10 @@ protected: pLnk->SetLink( pL ); } - void RemoveAllAnyLinks(); - virtual ScChangeActionLinkEntry* GetDeletedIn() const { return pLinkDeletedIn; } virtual ScChangeActionLinkEntry** GetDeletedInAddress() { return &pLinkDeletedIn; } - ScChangeActionLinkEntry* AddDeletedIn( ScChangeAction* p ) - { - return new ScChangeActionLinkEntry( - GetDeletedInAddress(), p ); - } - bool RemoveDeletedIn( const ScChangeAction* ); void SetDeletedIn( ScChangeAction* ); @@ -283,8 +275,6 @@ protected: return new ScChangeActionLinkEntry(&pLinkDeleted, p); } - void RemoveAllDeleted(); - ScChangeActionLinkEntry* AddDependent( ScChangeAction* p ) { return new ScChangeActionLinkEntry(&pLinkDependent, p); diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 5ae6bb4..345dea2 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -221,7 +221,6 @@ public: bool IsEmptyData() const; bool IsEmptyAttr() const; - bool IsEmpty() const; // data only: bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const; diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index cb24ad1..0f48bae 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -71,7 +71,6 @@ class ScValueIterator // walk through all values in an area SCROW GetRow() const; void IncBlock(); void IncPos(); - void SetPos(size_t nPos); /** * See if the cell at the current position is a non-empty cell. If not, diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 4e4e8c4..fac198f 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -504,7 +504,6 @@ public: void GetDocStat( ScDocStat& rDocStat ); SC_DLLPUBLIC void InitDrawLayer( SfxObjectShell* pDocShell = nullptr ); - rtl::Reference<XColorList> GetColorList(); SC_DLLPUBLIC sfx2::LinkManager* GetLinkManager(); SC_DLLPUBLIC const sfx2::LinkManager* GetLinkManager() const; @@ -541,7 +540,6 @@ public: */ SC_DLLPUBLIC void GetAllTabRangeNames(ScRangeName::TabNameCopyMap& rRangeNames) const; SC_DLLPUBLIC void SetAllRangeNames(const std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap); - SC_DLLPUBLIC void GetTabRangeNameMap(std::map<OUString, ScRangeName*>& rRangeName); SC_DLLPUBLIC void GetRangeNameMap(std::map<OUString, ScRangeName*>& rRangeName); SC_DLLPUBLIC ScRangeName* GetRangeName(SCTAB nTab) const; SC_DLLPUBLIC ScRangeName* GetRangeName() const; @@ -2327,8 +2325,6 @@ private: void DeleteDrawLayer(); SC_DLLPUBLIC bool DrawGetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer ) const; - void DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ); - void DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ); void UpdateDrawPrinter(); void UpdateDrawLanguages(); diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 035aa1b..99c23f8 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -161,7 +161,6 @@ public: OUString GetDataDimName(long nIndex); const ScDPCache* GetCache(); const ScDPItemData* GetItemDataById( long nDim, long nId ); - SCROW GetMemberId( long nDim, const ScDPItemData& rData ); bool IsDataLayoutDimension(long nDim); sal_uInt16 GetDataLayoutOrientation(); @@ -395,8 +394,6 @@ public: throw(css::uno::RuntimeException, std::exception) override; sal_uInt16 getOrientation() const; - void setOrientation(sal_uInt16 nNew); - long getPosition() const; bool getIsDataLayoutDimension() const; sal_uInt16 getFunction() const { return nFunction;} void setFunction(sal_uInt16 nNew); // for data dimension @@ -709,7 +706,6 @@ public: sal_Int32 GetIndexFromName( const OUString& rName ) const; // <0 if not found const ScDPItemData* GetSrcItemDataByIndex( SCROW nIndex); - SCROW GetSrcItemsCount(); private: css::uno::Sequence< OUString > getElementNames( bool bLocaleIndependent ) const diff --git a/sc/inc/edittextiterator.hxx b/sc/inc/edittextiterator.hxx index f64b7f4..4f5ba73 100644 --- a/sc/inc/edittextiterator.hxx +++ b/sc/inc/edittextiterator.hxx @@ -39,10 +39,6 @@ class EditTextIterator */ const EditTextObject* seek(); - /** - * Increment current position by one. - */ - void incPos(); void incBlock(); /** * Initialize members w.r.t the dynamic column container in the given table. diff --git a/sc/inc/filtopt.hxx b/sc/inc/filtopt.hxx index 6a4bb2e..b1c48c6 100644 --- a/sc/inc/filtopt.hxx +++ b/sc/inc/filtopt.hxx @@ -32,8 +32,6 @@ private: double fExcelColScale; double fExcelRowScale; - static css::uno::Sequence<OUString> GetPropertyNames(); - virtual void ImplCommit() override; public: diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 012c94b..2afe4c3 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1458,14 +1458,6 @@ void ScAttrArray::RemoveAreaMerge(SCROW nStartRow, SCROW nEndRow) } } -/** - * Remove field, but leave MergeFlags - */ -void ScAttrArray::DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow) -{ - SetPatternAreaSafe( nStartRow, nEndRow, pDocument->GetDefPattern(), true ); -} - void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pWantedPattern, bool bDefault ) { @@ -2120,7 +2112,7 @@ void ScAttrArray::DeleteArea(SCROW nStartRow, SCROW nEndRow) if ( !HasAttrib( nStartRow, nEndRow, HasAttrFlags::Overlapped | HasAttrFlags::AutoFilter) ) SetPatternArea( nStartRow, nEndRow, pDocument->GetDefPattern() ); else - DeleteAreaSafe( nStartRow, nEndRow ); // leave merge flags + SetPatternAreaSafe( nStartRow, nEndRow, pDocument->GetDefPattern(), true ); // leave merge flags } void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow) diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 7ec45b0..e8a537a 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -783,7 +783,7 @@ const sc::CellTextAttr* ScColumn::GetCellTextAttr( sc::ColumnBlockConstPosition& bool ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const { - if (IsEmpty()) + if (IsEmptyData() && IsEmptyAttr()) return true; // Return false if we have any non-empty cells between nStartRow and nEndRow inclusive. @@ -872,11 +872,6 @@ class CopyToClipHandler maDestPos.miCellTextAttrPos, nRow, aAttrs.begin(), aAttrs.end()); } - void duplicateNotes(SCROW nStartRow, size_t nDataSize ) - { - mrSrcCol.DuplicateNotes(nStartRow, nDataSize, mrDestCol, maDestPos, false); - } - public: CopyToClipHandler(const ScColumn& rSrcCol, ScColumn& rDestCol, sc::ColumnBlockPosition* pDestPos, bool bCopyNotes) : mrSrcCol(rSrcCol), mrDestCol(rDestCol), mpDestPos(pDestPos), mbCopyNotes(bCopyNotes) @@ -984,7 +979,7 @@ public: setDefaultAttrsToDest(nTopRow, nDataSize); if (mbCopyNotes) - duplicateNotes(nTopRow, nDataSize); + mrSrcCol.DuplicateNotes(nTopRow, nDataSize, mrDestCol, maDestPos, false); } }; @@ -1283,11 +1278,6 @@ class CopyAsLinkHandler setDefaultAttrsToDest(nTopRow, nDataSize); } - void duplicateNotes(SCROW nStartRow, size_t nDataSize, bool bCloneCaption ) - { - mrSrcCol.DuplicateNotes(nStartRow, nDataSize, mrDestCol, maDestPos, bCloneCaption); - } - public: CopyAsLinkHandler(const ScColumn& rSrcCol, ScColumn& rDestCol, sc::ColumnBlockPosition* pDestPos, InsertDeleteFlags nCopyFlags) : mrSrcCol(rSrcCol), @@ -1327,7 +1317,7 @@ public: if (mnCopyFlags & (InsertDeleteFlags::NOTE|InsertDeleteFlags::ADDNOTES)) { bool bCloneCaption = (mnCopyFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE; - duplicateNotes(nRow, nDataSize, bCloneCaption ); + mrSrcCol.DuplicateNotes(nRow, nDataSize, mrDestCol, maDestPos, bCloneCaption); } switch (aNode.type) @@ -1493,11 +1483,6 @@ class CopyByCloneHandler } } - void duplicateNotes(SCROW nStartRow, size_t nDataSize, bool bCloneCaption ) - { - mrSrcCol.DuplicateNotes(nStartRow, nDataSize, mrDestCol, maDestPos, bCloneCaption); - } - public: CopyByCloneHandler(const ScColumn& rSrcCol, ScColumn& rDestCol, sc::ColumnBlockPosition* pDestPos, InsertDeleteFlags nCopyFlags, svl::SharedStringPool* pSharedStringPool, bool bGlobalNamesToLocal) : @@ -1551,7 +1536,7 @@ public: if (mnCopyFlags & (InsertDeleteFlags::NOTE|InsertDeleteFlags::ADDNOTES)) { bool bCloneCaption = (mnCopyFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE; - duplicateNotes(nRow, nDataSize, bCloneCaption ); + mrSrcCol.DuplicateNotes(nRow, nDataSize, mrDestCol, maDestPos, bCloneCaption); } switch (aNode.type) diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index f86d23e..c5e136b 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1206,11 +1206,6 @@ bool ScColumn::IsEmptyAttr() const return true; } -bool ScColumn::IsEmpty() const -{ - return (IsEmptyData() && IsEmptyAttr()); -} - bool ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const { std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nStartRow); diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 325145a..a682a5e 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -146,11 +146,6 @@ void ScValueIterator::IncPos() IncBlock(); } -void ScValueIterator::SetPos(size_t nPos) -{ - maCurPos = mpCells->position(maCurPos.first, nPos); -} - bool ScValueIterator::GetThis(double& rValue, FormulaError& rErr) { while (true) @@ -195,7 +190,7 @@ bool ScValueIterator::GetThis(double& rValue, FormulaError& rErr) ( ( mnSubTotalFlags & SubtotalFlags::IgnoreHidden ) && pDoc->RowHidden( nCurRow, mnTab, nullptr, &nLastRow ) ) ) { - SetPos(nLastRow+1); + maCurPos = mpCells->position(maCurPos.first, nLastRow+1); continue; } diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 389611d..4e60404 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -793,7 +793,7 @@ bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress ) SetAllFormulasDirty(aFormulaDirtyCxt); if (pDrawLayer) - DrawMovePage( static_cast<sal_uInt16>(nOldPos), static_cast<sal_uInt16>(nNewPos) ); + pDrawLayer->ScMovePage( static_cast<sal_uInt16>(nOldPos), static_cast<sal_uInt16>(nNewPos) ); bValid = true; } @@ -923,7 +923,8 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM SetAllFormulasDirty(aFormulaDirtyCxt); if (pDrawLayer) // Skip cloning Note caption object - DrawCopyPage( static_cast<sal_uInt16>(nOldPos), static_cast<sal_uInt16>(nNewPos) ); + // page is already created in ScTable ctor + pDrawLayer->ScCopyPage( static_cast<sal_uInt16>(nOldPos), static_cast<sal_uInt16>(nNewPos) ); if (pDPCollection) pDPCollection->CopyToTab(nOldPos, nNewPos); diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index eab54ac..7a5376e 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -152,7 +152,7 @@ void ScDocument::SetAllRangeNames(const std::map<OUString, std::unique_ptr<ScRan } } -void ScDocument::GetTabRangeNameMap(std::map<OUString, ScRangeName*>& aRangeNameMap) +void ScDocument::GetRangeNameMap(std::map<OUString, ScRangeName*>& aRangeNameMap) { for (SCTAB i = 0; i < static_cast<SCTAB>(maTabs.size()); ++i) { @@ -168,11 +168,6 @@ void ScDocument::GetTabRangeNameMap(std::map<OUString, ScRangeName*>& aRangeName maTabs[i]->GetName(aTableName); aRangeNameMap.insert(std::pair<OUString, ScRangeName*>(aTableName,p)); } -} - -void ScDocument::GetRangeNameMap(std::map<OUString, ScRangeName*>& aRangeNameMap) -{ - GetTabRangeNameMap(aRangeNameMap); if (!pRangeName) { pRangeName = new ScRangeName(); diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 8cdf00e..96fd241 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -70,18 +70,6 @@ void ScDocument::BeginDrawUndo() pDrawLayer->BeginCalcUndo(false); } -rtl::Reference<XColorList> ScDocument::GetColorList() -{ - if (pDrawLayer) - return pDrawLayer->GetColorList(); - else - { - if (!pColorList.is()) - pColorList = XColorList::CreateStdColorList(); - return pColorList; - } -} - void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos) { if (pDrawLayer && pSrcDoc->pDrawLayer) @@ -232,7 +220,16 @@ bool ScDocument::IsChart( const SdrObject* pObject ) IMPL_LINK( ScDocument, GetUserDefinedColor, sal_uInt16, nColorIndex, Color* ) { - return const_cast<Color*>(&(GetColorList()->GetColor(nColorIndex)->GetColor())); + rtl::Reference<XColorList> xColorList; + if (pDrawLayer) + xColorList = pDrawLayer->GetColorList(); + else + { + if (!pColorList.is()) + pColorList = XColorList::CreateStdColorList(); + xColorList = pColorList; + } + return const_cast<Color*>(&(xColorList->GetColor(nColorIndex)->GetColor())); } void ScDocument::DeleteDrawLayer() @@ -257,17 +254,6 @@ bool ScDocument::DrawGetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer ) return pDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer ); } -void ScDocument::DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) -{ - pDrawLayer->ScMovePage(nOldPos,nNewPos); -} - -void ScDocument::DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) -{ - // page is already created in ScTable ctor - pDrawLayer->ScCopyPage( nOldPos, nNewPos ); -} - void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark ) { diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 390bc0e..a0e145e 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -867,7 +867,7 @@ void ScDPSource::CreateRes_Impl() { ScDPDimension* pDim = GetDimensionsObject()->getByIndex(*it); if ( pDim->HasSelectedPage() ) - aInitState.AddMember(*it, GetMemberId(*it, pDim->GetSelectedData())); + aInitState.AddMember(*it, GetCache()->GetIdByItemData(*it, pDim->GetSelectedData())); } // Show grand total columns only when the option is set *and* there is at @@ -1384,16 +1384,6 @@ sal_uInt16 ScDPDimension::getOrientation() const return pSource->GetOrientation( nDim ); } -void ScDPDimension::setOrientation(sal_uInt16 nNew) -{ - pSource->SetOrientation( nDim, nNew ); -} - -long ScDPDimension::getPosition() const -{ - return pSource->GetPosition( nDim ); -} - bool ScDPDimension::getIsDataLayoutDimension() const { return pSource->GetData()->getIsDataLayoutDimension( nDim ); @@ -1503,7 +1493,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const OUString& aPropertyName, co { sheet::DataPilotFieldOrientation eEnum; if (aValue >>= eEnum) - setOrientation( sal::static_int_cast<sal_uInt16>(eEnum) ); + pSource->SetOrientation( nDim, sal::static_int_cast<sal_uInt16>(eEnum) ); } else if ( aPropertyName == SC_UNO_DP_FUNCTION ) { @@ -1575,7 +1565,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const OUString& aPropertyName { uno::Any aRet; if ( aPropertyName == SC_UNO_DP_POSITION ) - aRet <<= (sal_Int32) getPosition(); + aRet <<= (sal_Int32) pSource->GetPosition( nDim ); else if ( aPropertyName == SC_UNO_DP_USEDHIERARCHY ) aRet <<= (sal_Int32) getUsedHierarchy(); else if ( aPropertyName == SC_UNO_DP_ORIENTATION ) @@ -2253,7 +2243,7 @@ ScDPMembers::ScDPMembers( ScDPSource* pSrc, long nD, long nH, long nL ) : case SC_DAPI_LEVEL_YEAR: { const ScDPItemData* pLastNumData = nullptr; - for ( SCROW n = 0 ;n <GetSrcItemsCount() ; n-- ) + for ( SCROW n = 0; n < (SCROW) pSource->GetData()->GetColumnEntries(nDim).size(); n-- ) { const ScDPItemData* pData = GetSrcItemDataByIndex( n ); if ( pData && pData->HasStringData() ) @@ -2693,11 +2683,6 @@ const ScDPItemData* ScDPSource::GetItemDataById(long nDim, long nId) return GetData()->GetMemberById(nDim, nId); } -SCROW ScDPSource::GetMemberId(long nDim, const ScDPItemData& rData) -{ - return GetCache()->GetIdByItemData(nDim, rData); -} - const ScDPItemData* ScDPMembers::GetSrcItemDataByIndex(SCROW nIndex) { const std::vector< SCROW >& memberIds = pSource->GetData()->GetColumnEntries( nDim ); @@ -2707,9 +2692,4 @@ const ScDPItemData* ScDPMembers::GetSrcItemDataByIndex(SCROW nIndex) return pSource->GetItemDataById( nDim, nId ); } -SCROW ScDPMembers::GetSrcItemsCount() -{ - return pSource->GetData()->GetColumnEntries(nDim).size(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/edittextiterator.cxx b/sc/source/core/data/edittextiterator.cxx index c689ebc..e225f14 100644 --- a/sc/source/core/data/edittextiterator.cxx +++ b/sc/source/core/data/edittextiterator.cxx @@ -61,15 +61,6 @@ const EditTextObject* EditTextIterator::seek() return sc::edittext_block::at(*maPos.first->data, maPos.second); } -void EditTextIterator::incPos() -{ - if (maPos.second + 1 < maPos.first->size) - // Increment within the block. - ++maPos.second; - else - incBlock(); -} - void EditTextIterator::incBlock() { ++maPos.first; @@ -92,7 +83,13 @@ const EditTextObject* EditTextIterator::next() if (maPos.first == miEnd) return nullptr; - incPos(); + // increment position by one + if (maPos.second + 1 < maPos.first->size) + // Increment within the block. + ++maPos.second; + else + incBlock(); + return seek(); } diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index 28b5ae0..32b0bd2 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -74,8 +74,10 @@ SvNumberFormatter* ScPoolHelper::GetFormTable() const return pFormTable; } -void ScPoolHelper::UseDocOptions() const +void ScPoolHelper::SetFormTableOpt(const ScDocOptions& rOpt) { + aOpt = rOpt; + // #i105512# if the number formatter exists, update its settings if (pFormTable) { sal_uInt16 d,m; @@ -87,12 +89,6 @@ void ScPoolHelper::UseDocOptions() const } } -void ScPoolHelper::SetFormTableOpt(const ScDocOptions& rOpt) -{ - aOpt = rOpt; - UseDocOptions(); // #i105512# if the number formatter exists, update its settings -} - SvNumberFormatter* ScPoolHelper::CreateNumberFormatter() const { SvNumberFormatter* p = nullptr; diff --git a/sc/source/core/inc/poolhelp.hxx b/sc/source/core/inc/poolhelp.hxx index ff5d68b..22da03c 100644 --- a/sc/source/core/inc/poolhelp.hxx +++ b/sc/source/core/inc/poolhelp.hxx @@ -43,8 +43,6 @@ private: mutable SfxItemPool* pEnginePool; // EditEnginePool ScDocument* m_pSourceDoc; - void UseDocOptions() const; - public: ScPoolHelper( ScDocument* pSourceDoc ); virtual ~ScPoolHelper() override; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index b8da399..c39fdfe 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -284,16 +284,15 @@ bool ScChangeAction::IsMasterDelete() const void ScChangeAction::RemoveAllLinks() { - RemoveAllAnyLinks(); - RemoveAllDeletedIn(); - RemoveAllDeleted(); - RemoveAllDependent(); -} - -void ScChangeAction::RemoveAllAnyLinks() -{ while ( pLinkAny ) delete pLinkAny; // Moves up by itself + + RemoveAllDeletedIn(); + + while ( pLinkDeleted ) + delete pLinkDeleted; // Moves up by itself + + RemoveAllDependent(); } bool ScChangeAction::RemoveDeletedIn( const ScChangeAction* p ) @@ -382,7 +381,7 @@ bool ScChangeAction::HasDeleted() const void ScChangeAction::SetDeletedIn( ScChangeAction* p ) { - ScChangeActionLinkEntry* pLink1 = AddDeletedIn( p ); + ScChangeActionLinkEntry* pLink1 = new ScChangeActionLinkEntry( GetDeletedInAddress(), p ); ScChangeActionLinkEntry* pLink2; if ( GetType() == SC_CAT_CONTENT ) pLink2 = p->AddDeleted( static_cast<ScChangeActionContent*>(this)->GetTopContent() ); @@ -391,12 +390,6 @@ void ScChangeAction::SetDeletedIn( ScChangeAction* p ) pLink1->SetLink( pLink2 ); } -void ScChangeAction::RemoveAllDeleted() -{ - while ( pLinkDeleted ) - delete pLinkDeleted; // Moves up by itself -} - void ScChangeAction::RemoveAllDependent() { while ( pLinkDependent ) diff --git a/sc/source/core/tool/filtopt.cxx b/sc/source/core/tool/filtopt.cxx index 24a28ea..06ab901 100644 --- a/sc/source/core/tool/filtopt.cxx +++ b/sc/source/core/tool/filtopt.cxx @@ -33,20 +33,15 @@ using namespace css::uno; #define SCFILTOPT_ROWSCALE 1 #define SCFILTOPT_WK3 2 -Sequence<OUString> ScFilterOptions::GetPropertyNames() -{ - return {"MS_Excel/ColScale", // SCFILTOPT_COLSCALE - "MS_Excel/RowScale", // SCFILTOPT_ROWSCALE - "Lotus123/WK3"}; // SCFILTOPT_WK3 -} - ScFilterOptions::ScFilterOptions() : ConfigItem( OUString( CFGPATH_FILTER ) ), bWK3Flag( false ), fExcelColScale( 0 ), fExcelRowScale( 0 ) { - Sequence<OUString> aNames = GetPropertyNames(); + Sequence<OUString> aNames { "MS_Excel/ColScale", // SCFILTOPT_COLSCALE + "MS_Excel/RowScale", // SCFILTOPT_ROWSCALE + "Lotus123/WK3" }; // SCFILTOPT_WK3 Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed"); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index c83ecc7..4619146 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -446,15 +446,6 @@ void ImportExcel8::PostDocLoad() } // read doc info (no docshell while pasting from clipboard) - LoadDocumentProperties(); - - // #i45843# Pivot tables are now handled outside of PostDocLoad, so they are available - // when formula cells are calculated, for the GETPIVOTDATA function. -} - -void ImportExcel8::LoadDocumentProperties() -{ - // no docshell while pasting from clipboard if( SfxObjectShell* pShell = GetDocShell() ) { // BIFF5+ without storage is possible @@ -469,6 +460,9 @@ void ImportExcel8::LoadDocumentProperties() { } } + + // #i45843# Pivot tables are now handled outside of PostDocLoad, so they are available + // when formula cells are calculated, for the GETPIVOTDATA function. } // autofilter @@ -788,17 +782,6 @@ void XclImpAutoFilterData::SetExtractPos( const ScAddress& rAddr ) void XclImpAutoFilterData::Apply() { - CreateScDBData(); - - if( bActive ) - { - InsertQueryParam(); - } -} - -void XclImpAutoFilterData::CreateScDBData() -{ - // Create the ScDBData() object if the AutoFilter is activated // or if we need to create the Advanced Filter. if( bActive || bCriteria) @@ -819,6 +802,10 @@ void XclImpAutoFilterData::CreateScDBData() rDoc.SetAnonymousDBData(Tab(), pCurrDBData); } + if( bActive ) + { + InsertQueryParam(); + } } void XclImpAutoFilterData::EnableRemoveFilter() diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 928a55e..62f84eb 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -723,11 +723,6 @@ void XclExpPivotCache::SaveXml( XclExpXmlStream& /*rStrm*/ ) { } -XclExpPCField* XclExpPivotCache::GetFieldAcc( sal_uInt16 nFieldIdx ) -{ - return maFieldList.GetRecord( nFieldIdx ).get(); -} - void XclExpPivotCache::AddFields( const ScDPObject& rDPObj ) { AddStdFields( rDPObj ); @@ -760,7 +755,7 @@ void XclExpPivotCache::AddGroupFields( const ScDPObject& rDPObj ) // loop over all existing standard fields to find their group fields for( sal_uInt16 nFieldIdx = 0; nFieldIdx < maPCInfo.mnStdFields; ++nFieldIdx ) { - if( XclExpPCField* pCurrStdField = GetFieldAcc( nFieldIdx ) ) + if( XclExpPCField* pCurrStdField = maFieldList.GetRecord( nFieldIdx ).get() ) { const ScDPSaveGroupDimension* pGroupDim = pSaveDimData->GetGroupDimForBase( pCurrStdField->GetFieldName() ); XclExpPCField* pLastGroupField = pCurrStdField; diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 6204c24..f5944d5 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -791,9 +791,9 @@ void XclExpPalette::GetMixedColors( return mxImpl->GetMixedColors( rnXclForeIx, rnXclBackIx, rnXclPattern, nForeColorId, nBackColorId ); } -ColorData XclExpPalette::GetColorData( sal_uInt16 nXclIndex ) const +Color XclExpPalette::GetColor( sal_uInt16 nXclIndex ) const { - return mxImpl->GetColorData( nXclIndex ); + return Color(mxImpl->GetColorData( nXclIndex )); } void XclExpPalette::Save( XclExpStream& rStrm ) @@ -1234,12 +1234,6 @@ sal_uInt16 XclExpFontBuffer::Insert( } sal_uInt16 XclExpFontBuffer::Insert( - const vcl::Font& rFont, XclExpColorType eColorType, bool bAppFont ) -{ - return Insert( XclFontData( rFont ), eColorType, bAppFont ); -} - -sal_uInt16 XclExpFontBuffer::Insert( const SvxFont& rFont, XclExpColorType eColorType ) { return Insert( XclFontData( rFont ), eColorType ); @@ -1250,7 +1244,7 @@ sal_uInt16 XclExpFontBuffer::Insert( const SfxItemSet& rItemSet, { // #i17050# script type now provided by caller vcl::Font aFont = XclExpFontHelper::GetFontFromItemSet( GetRoot(), rItemSet, nScript ); - return Insert( aFont, eColorType, bAppFont ); + return Insert( XclFontData( aFont ), eColorType, bAppFont ); } void XclExpFontBuffer::Save( XclExpStream& rStrm ) diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index ac12021..1dcde34 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2683,7 +2683,7 @@ void XclImpChTypeGroup::Finalize() bool bStockChart = (maType.GetRecId() == EXC_ID_CHLINE) && // must be a line chart !mxChart3d && // must be a 2d chart - HasHiLoLine() && // must contain hi-lo lines + m_ChartLines.find(EXC_CHCHARTLINE_HILO) != m_ChartLines.end() && // must contain hi-lo lines (maSeries.size() == static_cast<XclImpChSeriesVec::size_type>(HasDropBars() ? 4 : 3)); // correct series count maType.Finalize( bStockChart ); @@ -3293,7 +3293,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup { ScfPropertySet aAxisProp( xAxis ); // #i58688# axis enabled - aAxisProp.SetBoolProperty( EXC_CHPROP_SHOW, IsActivated() ); + aAxisProp.SetBoolProperty( EXC_CHPROP_SHOW, !mxAxisLine || mxAxisLine->IsShowAxis() ); // axis line properties if( mxAxisLine ) @@ -3305,8 +3305,8 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup // axis caption text -------------------------------------------------- // radar charts disable their category labels via chart type, not via axis - bool bHasLabels = HasLabels() && - ((GetAxisType() != EXC_CHAXIS_X) || rTypeGroup.HasCategoryLabels()); + bool bHasLabels = (!mxTick || mxTick->HasLabels()) && + ((GetAxisType() != EXC_CHAXIS_X) || rTypeGroup.HasCategoryLabels()); aAxisProp.SetBoolProperty( EXC_CHPROP_DISPLAYLABELS, bHasLabels ); if( bHasLabels ) { @@ -3377,7 +3377,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup // main grid ScfPropertySet aGridProp( xAxis->getGridProperties() ); - aGridProp.SetBoolProperty( EXC_CHPROP_SHOW, HasMajorGrid() ); + aGridProp.SetBoolProperty( EXC_CHPROP_SHOW, (bool)mxMajorGrid ); if( mxMajorGrid ) mxMajorGrid->Convert( GetChRoot(), aGridProp, EXC_CHOBJTYPE_GRIDLINE ); // sub grid @@ -3385,7 +3385,7 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup if( aSubGridPropSeq.hasElements() ) { ScfPropertySet aSubGridProp( aSubGridPropSeq[ 0 ] ); - aSubGridProp.SetBoolProperty( EXC_CHPROP_SHOW, HasMinorGrid() ); + aSubGridProp.SetBoolProperty( EXC_CHPROP_SHOW, (bool)mxMinorGrid ); if( mxMinorGrid ) mxMinorGrid->Convert( GetChRoot(), aSubGridProp, EXC_CHOBJTYPE_GRIDLINE ); } diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 24fd6bb..c20dd53 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -497,11 +497,6 @@ sal_uInt16 XclImpHFConverter::GetMaxLineHeight( XclImpHFPortion ePortion ) const return (nMaxHt == 0) ? mxFontData->mnHeight : nMaxHt; } -sal_uInt16 XclImpHFConverter::GetCurrMaxLineHeight() const -{ - return GetMaxLineHeight( meCurrObj ); -} - void XclImpHFConverter::UpdateMaxLineHeight( XclImpHFPortion ePortion ) { sal_uInt16& rnMaxHt = maInfos[ ePortion ].mnMaxLineHt; @@ -564,7 +559,7 @@ void XclImpHFConverter::InsertLineBreak() mrEE.QuickInsertText( OUString('\n'), ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); ++rSel.nEndPara; rSel.nEndPos = 0; - GetCurrInfo().mnHeight += GetCurrMaxLineHeight(); + GetCurrInfo().mnHeight += GetMaxLineHeight( meCurrObj ); GetCurrInfo().mnMaxLineHt = 0; } diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 11fe5a1..d8844fe 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -596,11 +596,6 @@ XclImpPivotCache::~XclImpPivotCache() // data access ---------------------------------------------------------------- -sal_uInt16 XclImpPivotCache::GetFieldCount() const -{ - return static_cast< sal_uInt16 >( maFields.size() ); -} - const XclImpPCField* XclImpPivotCache::GetField( sal_uInt16 nFieldIdx ) const { return (nFieldIdx < maFields.size()) ? maFields[ nFieldIdx ].get() : nullptr; @@ -744,7 +739,7 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) case EXC_ID_SXFIELD: { xCurrField.reset(); - sal_uInt16 nNewFieldIdx = GetFieldCount(); + sal_uInt16 nNewFieldIdx = static_cast< sal_uInt16 >( maFields.size() ); if( nNewFieldIdx < EXC_PC_MAXFIELDCOUNT ) { xCurrField.reset( new XclImpPCField( GetRoot(), *this, nNewFieldIdx ) ); @@ -841,7 +836,7 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) OSL_ENSURE( maPCInfo.mnTotalFields == maFields.size(), "XclImpPivotCache::ReadPivotCacheStream - field count mismatch" ); - if (HasCacheRecords()) + if (static_cast<bool>(maPCInfo.mnFlags & EXC_SXDB_SAVEDATA)) { SCROW nNewEnd = maSrcRange.aStart.Row() + maPCInfo.mnSrcRecs; maSrcRange.aEnd.SetRow(nNewEnd); @@ -859,11 +854,6 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) } } -bool XclImpPivotCache::HasCacheRecords() const -{ - return static_cast<bool>(maPCInfo.mnFlags & EXC_SXDB_SAVEDATA); -} - bool XclImpPivotCache::IsRefreshOnLoad() const { return static_cast<bool>(maPCInfo.mnFlags & EXC_SXDB_REFRESH_LOAD); @@ -1141,7 +1131,8 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con void XclImpPTField::ConvertFieldInfo( ScDPSaveDimension& rSaveDim ) const { rSaveDim.SetShowEmpty( ::get_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL ) ); - ConvertItems( rSaveDim ); + for( XclImpPTItemVec::const_iterator aIt = maItems.begin(), aEnd = maItems.end(); aIt != aEnd; ++aIt ) + (*aIt)->ConvertItem( rSaveDim ); } void XclImpPTField::ConvertDataField( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const @@ -1184,12 +1175,6 @@ void XclImpPTField::ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const Xcl rSaveDim.SetReferenceValue(&aFieldRef); } -void XclImpPTField::ConvertItems( ScDPSaveDimension& rSaveDim ) const -{ - for( XclImpPTItemVec::const_iterator aIt = maItems.begin(), aEnd = maItems.end(); aIt != aEnd; ++aIt ) - (*aIt)->ConvertItem( rSaveDim ); -} - XclImpPivotTable::XclImpPivotTable( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ), maDataOrientField( *this, EXC_SXIVD_DATA ), diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index 4f28d9c..c690970 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -512,14 +512,9 @@ void XclImpStream::CopyDecrypterFrom( const XclImpStream& rStrm ) SetDecrypter( xNewDecr ); } -bool XclImpStream::HasValidDecrypter() const -{ - return mxDecrypter && mxDecrypter->IsValid(); -} - void XclImpStream::EnableDecryption( bool bEnable ) { - mbUseDecr = bEnable && HasValidDecrypter(); + mbUseDecr = bEnable && mxDecrypter && mxDecrypter->IsValid(); } void XclImpStream::PushPosition() @@ -950,7 +945,7 @@ OUString XclImpStream::ReadRawByteString( sal_uInt16 nChars ) OUString XclImpStream::ReadByteString( bool b16BitLen ) { - return ReadRawByteString( ReadByteStrLen( b16BitLen ) ); + return ReadRawByteString( b16BitLen ? ReaduInt16() : ReaduInt8() ); } // private -------------------------------------------------------------------- diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index 6475619..959db49 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -79,7 +79,7 @@ void XclImpString::Read( XclImpStream& rStrm, XclStrFlags nFlags ) // --- formatting --- if( nRunCount > 0 ) - ReadFormats( rStrm, nRunCount ); + ReadFormats( rStrm, maFormats, nRunCount ); // --- extended (FarEast) information --- rStrm.Ignore( nExtInf ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index c0a4bb5..6c7287a 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1910,7 +1910,7 @@ void XclImpXFRangeBuffer::SetXF( const ScAddress& rScPos, sal_uInt16 nXFIndex, X if (pRange && (pRange->aEnd.Row() == nScRow) && (pRange->aEnd.Col() + 1 == nScCol) && (eMode == xlXFModeBlank)) pRange->aEnd.IncCol(); else if( eMode != xlXFModeBlank ) // do not merge empty cells - SetMerge( nScCol, nScRow ); + maMergeList.Append( ScRange( nScCol, nScRow, 0 ) ); } } } @@ -1968,11 +1968,6 @@ void XclImpXFRangeBuffer::SetHyperlink( const XclRange& rXclRange, const OUStrin maHyperlinks.push_back( XclImpHyperlinkRange( rXclRange, rUrl ) ); } -void XclImpXFRangeBuffer::SetMerge( SCCOL nScCol, SCROW nScRow ) -{ - maMergeList.Append( ScRange( nScCol, nScRow, 0 ) ); -} - void XclImpXFRangeBuffer::SetMerge( SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2 ) { if( (nScCol1 < nScCol2) || (nScRow1 < nScRow2) ) diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 7af6d8f..1edc926 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -120,7 +120,7 @@ void ScHTMLImport::WriteToDocument( { ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor, pFormatter, bConvertDate ); - const ScHTMLParser* pParser = GetParser(); + const ScHTMLParser* pParser = static_cast<ScHTMLParser*>(mpParser); const ScHTMLTable* pGlobTable = pParser->GetGlobalTable(); if( !pGlobTable ) return; diff --git a/sc/source/filter/inc/XclImpChangeTrack.hxx b/sc/source/filter/inc/XclImpChangeTrack.hxx index ac296e3..f38e53e 100644 --- a/sc/source/filter/inc/XclImpChangeTrack.hxx +++ b/sc/source/filter/inc/XclImpChangeTrack.hxx @@ -72,8 +72,6 @@ private: void DoDeleteRange( const ScRange& rRange ); inline sal_uInt8 LookAtuInt8(); - inline double ReadRK(); - inline bool ReadBool(); inline void Read2DAddress( ScAddress& rAddress ); inline void Read2DRange( ScRange& rRange ); SCTAB ReadTabNum(); @@ -118,16 +116,6 @@ inline sal_uInt8 XclImpChangeTrack::LookAtuInt8() return nValue; } -inline double XclImpChangeTrack::ReadRK() -{ - return XclTools::GetDoubleFromRK( pStrm->ReadInt32() ); -} - -inline bool XclImpChangeTrack::ReadBool() -{ - return (pStrm->ReaduInt16() != 0); -} - inline void XclImpChangeTrack::Read2DAddress( ScAddress& rAddress ) { rAddress.SetRow( static_cast<SCROW>(pStrm->ReaduInt16()) ); diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx index be0c7d8..4677de7 100644 --- a/sc/source/filter/inc/excimp8.hxx +++ b/sc/source/filter/inc/excimp8.hxx @@ -60,9 +60,6 @@ public: virtual void PostDocLoad() override; private: - void LoadDocumentProperties(); - -private: // represents codename ( and associated modules ) // not speficied directly in the binary format std::vector<OUString> maAutoGeneratedCodeNames; @@ -105,7 +102,6 @@ public: void SetExtractPos( const ScAddress& rAddr ); inline void SetAutoOrAdvanced() { bAutoOrAdvanced = true; } void Apply(); - void CreateScDBData(); void EnableRemoveFilter(); }; diff --git a/sc/source/filter/inc/htmlimp.hxx b/sc/source/filter/inc/htmlimp.hxx index e67c0b2c..ff36053 100644 --- a/sc/source/filter/inc/htmlimp.hxx +++ b/sc/source/filter/inc/htmlimp.hxx @@ -31,7 +31,6 @@ private: public: ScHTMLImport( ScDocument* pDoc, const OUString& rBaseURL, const ScRange& rRange, bool bCalcWidthHeight ); virtual ~ScHTMLImport() override; - const ScHTMLParser* GetParser() const { return static_cast<ScHTMLParser*>(mpParser); } virtual void WriteToDocument( bool bSizeColsRows = false, double nOutputFactor = 1.0, SvNumberFormatter* pFormatter = nullptr, bool bConvertDate = true ) override; diff --git a/sc/source/filter/inc/sheetdatabuffer.hxx b/sc/source/filter/inc/sheetdatabuffer.hxx index 9d5c54e..9da32e6 100644 --- a/sc/source/filter/inc/sheetdatabuffer.hxx +++ b/sc/source/filter/inc/sheetdatabuffer.hxx @@ -140,10 +140,6 @@ public: void setRowFormat( sal_Int32 nRow, sal_Int32 nXfId, bool bCustomFormat ); /** Merges the cells in the passed cell range. */ void setMergedRange( const css::table::CellRangeAddress& rRange ); - /** Sets a standard number format (constant from com.sun.star.util.NumberFormat) to the specified cell. */ - void setStandardNumFmt( - const ScAddress& rCellAddr, - sal_Int16 nStdNumFmt ); /** Processes the cell formatting data of the passed cell. */ void setCellFormat( const CellModel& rModel ); diff --git a/sc/source/filter/inc/viewsettings.hxx b/sc/source/filter/inc/viewsettings.hxx index 7cbbf1a..951e0e2 100644 --- a/sc/source/filter/inc/viewsettings.hxx +++ b/sc/source/filter/inc/viewsettings.hxx @@ -79,8 +79,6 @@ struct SheetViewModel /** Returns the grid color as RGB value. */ sal_Int32 getGridColor( const ::oox::core::FilterBase& rFilter ) const; - /** Returns the selection data, if available, otherwise 0. */ - const PaneSelectionModel* getPaneSelection( sal_Int32 nPaneId ) const; /** Returns the selection data of the active pane. */ const PaneSelectionModel* getActiveSelection() const; /** Returns read/write access to the selection data of the specified pane. */ diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index c8c1fbb..8d9cd54 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -186,9 +186,6 @@ public: static void SaveXml( XclExpXmlStream& rStrm ); private: - /** Returns read/write access to a pivot cache field. */ - XclExpPCField* GetFieldAcc( sal_uInt16 nFieldIdx ); - /** Adds all pivot cache fields. */ void AddFields( const ScDPObject& rDPObj ); diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx index 364f372..544b128 100644 --- a/sc/source/filter/inc/xestyle.hxx +++ b/sc/source/filter/inc/xestyle.hxx @@ -101,13 +101,9 @@ public: sal_uInt16& rnXclForeIx, sal_uInt16& rnXclBackIx, sal_uInt8& rnXclPattern, sal_uInt32 nForeColorId, sal_uInt32 nBackColorId ) const; - /** Returns the RGB color data for a (non-zero-based) Excel palette entry. - @return The color from current or default palette or COL_AUTO, if nothing else found. */ - ColorData GetColorData( sal_uInt16 nXclIndex ) const; /** Returns the color for a (non-zero-based) Excel palette entry. @return The color from current or default palette or COL_AUTO, if nothing else found. */ - inline Color GetColor( sal_uInt16 nXclIndex ) const - { return Color( GetColorData( nXclIndex ) ); } + Color GetColor( sal_uInt16 nXclIndex ) const; /** Saves the PALETTE record, if it differs from the default palette. */ virtual void Save( XclExpStream& rStrm ) override; @@ -228,11 +224,6 @@ public: @return The resulting Excel font index. */ sal_uInt16 Insert( const XclFontData& rFontData, XclExpColorType eColorType, bool bAppFont = false ); - /** Inserts the font into the buffer if not present. - @param bAppFont true = Sets the application font; false = Inserts a new font. - @return The resulting Excel font index. */ - sal_uInt16 Insert( const vcl::Font& rFont, - XclExpColorType eColorType, bool bAppFont ); /** Inserts the SvxFont into the buffer if not present, e.g. where escapements are used. @return The resulting Excel font index. */ sal_uInt16 Insert( const SvxFont& rFont, diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index d97c722..3a5272d 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -1021,8 +1021,6 @@ private: /** Reads a CHDATAFORMAT record group (default series format). */ void ReadChDataFormat( XclImpStream& rStrm ); - /** Returns true, if the chart type group contains a hi-lo line format. */ - inline bool HasHiLoLine() const { return m_ChartLines.find(EXC_CHCHARTLINE_HILO) != m_ChartLines.end(); } /** Returns true, if the chart type group contains drop bar formats. */ inline bool HasDropBars() const { return !m_DropBars.empty(); } @@ -1149,14 +1147,6 @@ public: inline sal_uInt16 GetAxisType() const { return maData.mnType; } /** Returns the axis dimension index used by the chart API. */ inline sal_Int32 GetApiAxisDimension() const { return maData.GetApiAxisDimension(); } - /** Returns true, if the axis is active. */ - inline bool IsActivated() const { return !mxAxisLine || mxAxisLine->IsShowAxis(); } - /** Returns true, if the axis contains caption labels. */ - inline bool HasLabels() const { return !mxTick || mxTick->HasLabels(); } - /** Returns true, if the axis shows its major grid lines. */ - inline bool HasMajorGrid() const { return static_cast< bool >(mxMajorGrid); } - /** Returns true, if the axis shows its minor grid lines. */ - inline bool HasMinorGrid() const { return static_cast< bool >(mxMinorGrid); } /** Creates an API axis object. */ css::uno::Reference< css::chart2::XAxis > diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx index 6677eeb..a523231 100644 --- a/sc/source/filter/inc/xihelper.hxx +++ b/sc/source/filter/inc/xihelper.hxx @@ -209,8 +209,6 @@ private: /** Returns the maximum line height of the specified portion. */ sal_uInt16 GetMaxLineHeight( XclImpHFPortion ePortion ) const; - /** Returns the current maximum line height. */ - sal_uInt16 GetCurrMaxLineHeight() const; /** Updates the maximum line height of the specified portion, using the current font size. */ void UpdateMaxLineHeight( XclImpHFPortion ePortion ); diff --git a/sc/source/filter/inc/xipivot.hxx b/sc/source/filter/inc/xipivot.hxx index bfdb553..8bf4305 100644 --- a/sc/source/filter/inc/xipivot.hxx +++ b/sc/source/filter/inc/xipivot.hxx @@ -153,8 +153,6 @@ public: const OUString& GetSourceRangeName() const { return maSrcRangeName; } - /** Returns the number of pivot cache fields. */ - sal_uInt16 GetFieldCount() const; /** Returns read-only access to a pivot cache field. */ const XclImpPCField* GetField( sal_uInt16 nFieldIdx ) const; @@ -174,7 +172,6 @@ public: /** Reads the entire pivot cache stream. Uses decrypter from passed stream. */ void ReadPivotCacheStream( XclImpStream& rStrm ); - bool HasCacheRecords() const; bool IsRefreshOnLoad() const; bool IsValid() const; @@ -277,7 +274,6 @@ private: void ConvertDataField( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const; void ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const; - void ConvertItems( ScDPSaveDimension& rSaveDim ) const; private: typedef ::std::list< XclPTDataFieldInfo > XclPTDataFieldInfoList; diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index 3a53643..8c55675 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -323,8 +323,6 @@ public: void SetDecrypter( XclImpDecrypterRef const & xDecrypter ); /** Sets decrypter from another stream. */ void CopyDecrypterFrom( const XclImpStream& rStrm ); - /** Returns true, if a valid decrypter is set at the stream. */ - bool HasValidDecrypter() const; /** Switches usage of current decryption algorithm on/off. @descr Encryption is re-enabled automatically, if a new record is started using the function StartNextRecord(). */ @@ -510,10 +508,6 @@ private: @return Count of bytes really read. */ sal_uInt16 ReadRawData( void* pData, sal_uInt16 nBytes ); - /** Reads 8 bit/16 bit string length. */ - inline sal_uInt16 ReadByteStrLen( bool b16BitLen ) - { return b16BitLen ? ReaduInt16() : ReaduInt8(); } - private: typedef ::std::vector< XclImpStreamPos > XclImpStreamPosStack; diff --git a/sc/source/filter/inc/xistring.hxx b/sc/source/filter/inc/xistring.hxx index 9105dbb..0cf90c0 100644 --- a/sc/source/filter/inc/xistring.hxx +++ b/sc/source/filter/inc/xistring.hxx @@ -46,8 +46,6 @@ public: inline void SetFormats( const XclFormatRunVec& rFormats ) { maFormats = rFormats; } /** Reads and appends the formatting information (run count and runs) from stream. */ inline void ReadFormats( XclImpStream& rStrm ) { ReadFormats( rStrm, maFormats ); } - /** Reads and appends nRunCount formatting runs from stream. */ - inline void ReadFormats( XclImpStream& rStrm, sal_uInt16 nRunCount ) { ReadFormats( rStrm, maFormats, nRunCount ); } /** Reads and appends formatting runs from an OBJ or TXO record. */ inline void ReadObjFormats( XclImpStream& rStrm, sal_uInt16 nFormatSize ) { ReadObjFormats( rStrm, maFormats, nFormatSize ); } diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index f537b49..eb4c0c5 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -638,8 +638,6 @@ public: /** Inserts a range of hyperlink cells. */ void SetHyperlink( const XclRange& rXclRange, const OUString& rUrl ); - /** Inserts the first cell of a merged cell range. */ - void SetMerge( SCCOL nScCol, SCROW nScRow ); /** Inserts a complete merged cell range. */ void SetMerge( SCCOL nScCol1, SCROW nScRow1, SCCOL nScCol2, SCROW nScRow2 ); diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index ee4cf26..b5bd39b 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -393,8 +393,6 @@ private: /** Returns the current line height of the specified portion. */ double getCurrHeight( HFPortionId ePortion ) const; - /** Returns the current line height. */ - double getCurrHeight() const; /** Updates the current line height of the specified portion, using the current font size. */ void updateCurrHeight( HFPortionId ePortion ); @@ -736,11 +734,6 @@ double HeaderFooterParser::getCurrHeight( HFPortionId ePortion ) const return (fMaxHt == 0.0) ? maFontModel.mfHeight : fMaxHt; } -double HeaderFooterParser::getCurrHeight() const -{ - return getCurrHeight( meCurrPortion ); -} - void HeaderFooterParser::updateCurrHeight( HFPortionId ePortion ) { double& rfMaxHt = maPortions[ ePortion ].mfCurrHeight; @@ -782,7 +775,7 @@ void HeaderFooterParser::appendLineBreak() { getEndPos()->gotoEnd( false ); getEndPos()->setString( OUString( '\n' ) ); - getPortion().mfTotalHeight += getCurrHeight(); + getPortion().mfTotalHeight += getCurrHeight( meCurrPortion ); // add the current line height. getPortion().mfCurrHeight = 0; } diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index ba0ff4b..fd4c9f1 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -179,7 +179,18 @@ void SheetDataBuffer::setDateTimeCell( const CellModel& rModel, const css::util: // set appropriate number format using namespace ::com::sun::star::util::NumberFormat; sal_Int16 nStdFmt = (fSerial < 1.0) ? TIME : (((rDateTime.Hours > 0) || (rDateTime.Minutes > 0) || (rDateTime.Seconds > 0)) ? DATETIME : DATE); - setStandardNumFmt( rModel.maCellAddr, nStdFmt ); + // set number format + try + { + Reference< XNumberFormatsSupplier > xNumFmtsSupp( getDocument(), UNO_QUERY_THROW ); + Reference< XNumberFormatTypes > xNumFmtTypes( xNumFmtsSupp->getNumberFormats(), UNO_QUERY_THROW ); + sal_Int32 nIndex = xNumFmtTypes->getStandardFormat( nStdFmt, Locale() ); + PropertySet aPropSet( getCell( rModel.maCellAddr ) ); + aPropSet.setProperty( PROP_NumberFormat, nIndex ); + } + catch( Exception& ) + { + } } void SheetDataBuffer::setBooleanCell( const CellModel& rModel, bool bValue ) @@ -315,21 +326,6 @@ void SheetDataBuffer::setMergedRange( const CellRangeAddress& rRange ) maMergedRanges.push_back( MergedRange( rRange ) ); } -void SheetDataBuffer::setStandardNumFmt( const ScAddress& rCellAddr, sal_Int16 nStdNumFmt ) -{ - try - { - Reference< XNumberFormatsSupplier > xNumFmtsSupp( getDocument(), UNO_QUERY_THROW ); - Reference< XNumberFormatTypes > xNumFmtTypes( xNumFmtsSupp->getNumberFormats(), UNO_QUERY_THROW ); - sal_Int32 nIndex = xNumFmtTypes->getStandardFormat( nStdNumFmt, Locale() ); - PropertySet aPropSet( getCell( rCellAddr ) ); - aPropSet.setProperty( PROP_NumberFormat, nIndex ); - } - catch( Exception& ) - { - } -} - typedef std::pair<sal_Int32, sal_Int32> FormatKeyPair; void addIfNotInMyMap( StylesBuffer& rStyles, std::map< FormatKeyPair, ApiCellRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ApiCellRangeList& rRangeList ) diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx index b8d7cdb..8a4dcaa 100644 --- a/sc/source/filter/oox/viewsettings.cxx +++ b/sc/source/filter/oox/viewsettings.cxx @@ -160,14 +160,9 @@ sal_Int32 SheetViewModel::getGridColor( const FilterBase& rFilter ) const return mbDefGridColor ? API_RGB_TRANSPARENT : maGridColor.getColor( rFilter.getGraphicHelper() ); } -const PaneSelectionModel* SheetViewModel::getPaneSelection( sal_Int32 nPaneId ) const -{ - return maPaneSelMap.get( nPaneId ).get(); -} - const PaneSelectionModel* SheetViewModel::getActiveSelection() const { - return getPaneSelection( mnActivePaneId ); + return maPaneSelMap.get( mnActivePaneId ).get(); } PaneSelectionModel& SheetViewModel::createPaneSelection( sal_Int32 nPaneId ) diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index 86ba23c..6b1b40e 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -227,7 +227,7 @@ void XclImpChangeTrack::ReadCell( break; case EXC_CHTR_TYPE_RK: { - double fValue = ReadRK(); + double fValue = XclTools::GetDoubleFromRK( pStrm->ReadInt32() ); if( pStrm->IsValid() ) { rCell.meType = CELLTYPE_VALUE; @@ -257,7 +257,7 @@ void XclImpChangeTrack::ReadCell( break; case EXC_CHTR_TYPE_BOOL: { - double fValue = (double) ReadBool(); + double fValue = (double) (pStrm->ReaduInt16() != 0); if( pStrm->IsValid() ) { rCell.meType = CELLTYPE_VALUE; diff --git a/sc/source/filter/xml/XMLColumnRowGroupExport.cxx b/sc/source/filter/xml/XMLColumnRowGroupExport.cxx index c5bc808..6ccf3ca 100644 --- a/sc/source/filter/xml/XMLColumnRowGroupExport.cxx +++ b/sc/source/filter/xml/XMLColumnRowGroupExport.cxx @@ -132,11 +132,6 @@ bool ScMyOpenCloseColumnRowGroup::IsGroupEnd(const sal_Int32 nField) return bGroupEnd; } -void ScMyOpenCloseColumnRowGroup::CloseGroup() -{ - rExport.EndElement( rName, true ); -} - void ScMyOpenCloseColumnRowGroup::CloseGroups(const sal_Int32 nField) { ScMyFieldGroupVec::iterator aItr(aTableEnd.begin()); @@ -145,7 +140,7 @@ void ScMyOpenCloseColumnRowGroup::CloseGroups(const sal_Int32 nField) { if (*aItr == nField) { - CloseGroup(); + rExport.EndElement( rName, true ); aItr = aTableEnd.erase(aItr); } else diff --git a/sc/source/filter/xml/XMLColumnRowGroupExport.hxx b/sc/source/filter/xml/XMLColumnRowGroupExport.hxx index 007e8a6..103843f 100644 --- a/sc/source/filter/xml/XMLColumnRowGroupExport.hxx +++ b/sc/source/filter/xml/XMLColumnRowGroupExport.hxx @@ -47,7 +47,6 @@ class ScMyOpenCloseColumnRowGroup ScMyFieldGroupVec aTableEnd; void OpenGroup(const ScMyColumnRowGroup& rGroup); - void CloseGroup(); public: ScMyOpenCloseColumnRowGroup(ScXMLExport& rExport, sal_uInt32 nToken); ~ScMyOpenCloseColumnRowGroup(); diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 4633eb7..42780fd 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -331,15 +331,6 @@ void ScXMLTableRowCellContext::LockSolarMutex() } } -void ScXMLTableRowCellContext::UnlockSolarMutex() -{ - if (bSolarMutexLocked) - { - GetScImport().UnlockSolarMutex(); - bSolarMutexLocked = false; - } -} - namespace { bool cellExists( const ScAddress& rCellPos ) @@ -1278,11 +1269,6 @@ void ScXMLTableRowCellContext::AddTextAndValueCell( const ScAddress& rCellPos, } } -bool ScXMLTableRowCellContext::HasSpecialContent() const -{ - return (mxAnnotationData.get() || pDetectiveObjVec || pCellRangeSource); -} - bool ScXMLTableRowCellContext::CellsAreRepeated() const { return ( (nColsRepeated > 1) || (nRepeatedRows > 1) ); @@ -1340,7 +1326,7 @@ void ScXMLTableRowCellContext::AddNonFormulaCell( const ScAddress& rCellPos ) } ScAddress aCurrentPos( rCellPos ); - if( HasSpecialContent() ) + if( mxAnnotationData.get() || pDetectiveObjVec || pCellRangeSource ) // has special content bIsEmpty = false; AddTextAndValueCell( rCellPos, pOUText, aCurrentPos ); @@ -1526,7 +1512,12 @@ void ScXMLTableRowCellContext::EndElement() else AddNonFormulaCell(aCellPos); - UnlockSolarMutex(); //if LockSolarMutex got used, we presumably need to ensure an UnlockSolarMutex + //if LockSolarMutex got used, we presumably need to ensure an UnlockSolarMutex + if (bSolarMutexLocked) + { + GetScImport().UnlockSolarMutex(); + bSolarMutexLocked = false; + } bIsMerged = false; nMergedCols = 1; diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx index 21a9f21..b84be0a 100644 --- a/sc/source/filter/xml/xmlcelli.hxx +++ b/sc/source/filter/xml/xmlcelli.hxx @@ -103,9 +103,7 @@ class ScXMLTableRowCellContext : public ScXMLImportContext void SetContentValidation( const ScAddress& rScCellPos ); void LockSolarMutex(); - void UnlockSolarMutex(); - bool HasSpecialContent() const; bool CellsAreRepeated() const; void SetFormulaCell ( ScFormulaCell* pFCell ) const; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 77d0364..2e33e84 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -508,7 +508,7 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) nTableCount = xIndex->getCount(); if (!pSharedData) - CreateSharedData(nTableCount); + pSharedData = new ScMySharedData(nTableCount); pCellStyles->AddNewTable(nTableCount - 1); @@ -3742,11 +3742,6 @@ void ScXMLExport::SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgres } } -bool ScXMLExport::IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) -{ - return (aCell1.nType == aCell2.nType); -} - bool ScXMLExport::IsEditCell(ScMyCell& rCell) { return rCell.maBaseCell.meType == CELLTYPE_EDIT; @@ -3774,8 +3769,8 @@ bool ScXMLExport::IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2) { if ((((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.bIsAutoStyle == aCell2.bIsAutoStyle)) || ((aCell1.nStyleIndex == aCell2.nStyleIndex) && (aCell1.nStyleIndex == -1))) && - (aCell1.nValidationIndex == aCell2.nValidationIndex) && - IsCellTypeEqual(aCell1, aCell2)) + aCell1.nValidationIndex == aCell2.nValidationIndex && + aCell1.nType == aCell2.nType) { switch ( aCell1.nType ) { @@ -4941,11 +4936,6 @@ XMLShapeExport* ScXMLExport::CreateShapeExport() return new ScXMLShapeExport(*this); } -void ScXMLExport::CreateSharedData(const sal_Int32 nTableCount) -{ - pSharedData = new ScMySharedData(nTableCount); -} - XMLNumberFormatAttributesExportHelper* ScXMLExport::GetNumberFormatAttributesExportHelper() { if (!pNumberFormatAttributesExportHelper) diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index 0e3392d..7c56d4e 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -189,7 +189,6 @@ class ScXMLExport : public SvXMLExport void WriteTableShapes(); void SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgress); - static bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2); static bool IsEditCell(ScMyCell& rCell); bool IsCellEqual(ScMyCell& aCell1, ScMyCell& aCell2); @@ -253,7 +252,6 @@ public: virtual void exportAnnotationMeta( const css::uno::Reference < css::drawing::XShape >& xShape) override; - void CreateSharedData(const sal_Int32 nTableCount); void SetSharedData(ScMySharedData* pTemp) { pSharedData = pTemp; } ScMySharedData* GetSharedData() { return pSharedData; } XMLNumberFormatAttributesExportHelper* GetNumberFormatAttributesExportHelper(); diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 8fdbd07..f919af43 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -316,7 +316,6 @@ private: void FillShapes(std::vector < uno::Reference < drawing::XShape > >& rShapes) const; bool FindSelectedShapesChanges(const css::uno::Reference<css::drawing::XShapes>& xShapes, bool bCommitChange) const; - void FillSelectionSupplier() const; ScAddress* GetAnchor(const uno::Reference<drawing::XShape>& xShape) const; uno::Reference<XAccessibleRelationSet> GetRelationSet(const ScAccessibleShapeData* pData) const; @@ -338,7 +337,23 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc mpAccessibleDocument(pAccessibleDocument), meSplitPos(eSplitPos) { - FillSelectionSupplier(); + if (mpViewShell) + { + SfxViewFrame* pViewFrame = mpViewShell->GetViewFrame(); + if (pViewFrame) + { + xSelectionSupplier = uno::Reference<view::XSelectionSupplier>(pViewFrame->GetFrame().GetController(), uno::UNO_QUERY); + if (xSelectionSupplier.is()) + { + if (mpAccessibleDocument) + xSelectionSupplier->addSelectionChangeListener(mpAccessibleDocument); + uno::Reference<drawing::XShapes> xShapes (xSelectionSupplier->getSelection(), uno::UNO_QUERY); + if (xShapes.is()) + mnShapesSelected = xShapes->getCount(); + } + } + } + maZOrderedShapes.push_back(nullptr); // add an element which represents the table GetCount(); // fill list with filtered shapes (no internal shapes) @@ -1147,26 +1162,6 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X return bResult; } -void ScChildrenShapes::FillSelectionSupplier() const -{ - if (!xSelectionSupplier.is() && mpViewShell) - { - SfxViewFrame* pViewFrame = mpViewShell->GetViewFrame(); - if (pViewFrame) - { - xSelectionSupplier = uno::Reference<view::XSelectionSupplier>(pViewFrame->GetFrame().GetController(), uno::UNO_QUERY); - if (xSelectionSupplier.is()) - { - if (mpAccessibleDocument) - xSelectionSupplier->addSelectionChangeListener(mpAccessibleDocument); - uno::Reference<drawing::XShapes> xShapes (xSelectionSupplier->getSelection(), uno::UNO_QUERY); - if (xShapes.is()) - mnShapesSelected = xShapes->getCount(); - } - } - } -} - ScAddress* ScChildrenShapes::GetAnchor(const uno::Reference<drawing::XShape>& xShape) const { ScAddress* pAddress = nullptr; diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 1b5a0c9..b0053a3 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -616,7 +616,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint if ( (!bIsDel || aMarkRange != aDelRange) && bNewMarked && nNewMarkCount > 0 && - !IsSameMarkCell() ) + m_LastMarkedRanges != *mpMarkedRanges ) { RemoveSelection(refScMarkData); if(bNewPosCellFocus) @@ -764,11 +764,6 @@ void ScAccessibleSpreadsheet::CommitFocusCell(const ScAddress &aNewCell) CommitChange(aEvent); } -bool ScAccessibleSpreadsheet::IsSameMarkCell() -{ - return m_LastMarkedRanges == *mpMarkedRanges; -} - //===== XAccessibleTable ================================================ uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessibleRowHeaders( ) diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index 3c53c12..c0b5b19 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -530,7 +530,10 @@ void ScCsvRuler::ImplRedraw() ImplDrawRulerDev(); } DrawOutDev( Point(), maWinSize, Point(), maWinSize, *maRulerDev.get() ); - ImplDrawTrackingRect(); + /* Draws directly tracking rectangle to the column with the specified index. */ + if( HasFocus() ) + InvertTracking( Rectangle( 0, 0, GetWidth() - 1, GetHeight() - 2 ), + ShowTrackFlags::Small | ShowTrackFlags::TrackWindow ); } } @@ -636,13 +639,6 @@ void ScCsvRuler::ImplInvertCursor( sal_Int32 nPos ) } } -void ScCsvRuler::ImplDrawTrackingRect() -{ - if( HasFocus() ) - InvertTracking( Rectangle( 0, 0, GetWidth() - 1, GetHeight() - 2 ), - ShowTrackFlags::Small | ShowTrackFlags::TrackWindow ); -} - void ScCsvRuler::ImplSetMousePointer( sal_Int32 nPos ) { SetPointer( Pointer( HasSplit( nPos ) ? PointerStyle::HSplit : PointerStyle::Arrow ) ); diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index a33c47d..9bddf66 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -465,12 +465,7 @@ void ScDocShell::SetFormulaOptions( const ScFormulaOptions& rOpt, bool bForLoadi } // Per document interpreter settings. - SetCalcConfig( rOpt.GetCalcConfig()); -} - -void ScDocShell::SetCalcConfig( const ScCalcConfig& rConfig ) -{ - aDocument.SetCalcConfig( rConfig); + aDocument.SetCalcConfig( rOpt.GetCalcConfig() ); } void ScDocShell::CheckConfigOptions() diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx index aab817d..05d4f19 100644 --- a/sc/source/ui/docshell/editable.cxx +++ b/sc/source/ui/docshell/editable.cxx @@ -64,7 +64,13 @@ ScEditableTester::ScEditableTester( ScViewFunc* pView ) : mbIsEditable(true), mbOnlyMatrix(true) { - TestView( pView ); + bool bThisMatrix; + if ( !pView->SelectionEditable( &bThisMatrix ) ) + { + mbIsEditable = false; + if ( !bThisMatrix ) + mbOnlyMatrix = false; + } } void ScEditableTester::TestBlock( ScDocument* pDoc, SCTAB nTab, @@ -118,20 +124,6 @@ void ScEditableTester::TestSelection( ScDocument* pDoc, const ScMarkData& rMark } } -void ScEditableTester::TestView( ScViewFunc* pView ) -{ - if (mbIsEditable || mbOnlyMatrix) - { - bool bThisMatrix; - if ( !pView->SelectionEditable( &bThisMatrix ) ) - { - mbIsEditable = false; - if ( !bThisMatrix ) - mbOnlyMatrix = false; - } - } -} - sal_uInt16 ScEditableTester::GetMessageId() const { if (mbIsEditable) diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx b/sc/source/ui/inc/AccessibleSpreadsheet.hxx index 96aa87a..210d7df 100644 --- a/sc/source/ui/inc/AccessibleSpreadsheet.hxx +++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx @@ -290,7 +290,6 @@ private: MAP_ADDR_XACC; MAP_ADDR_XACC m_mapSelectionSend; void RemoveSelection(ScMarkData &refScMarkData); - bool IsSameMarkCell(); void CommitFocusCell(const ScAddress &aNewCell); public: void FireFirstCellFocus(); diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx index c12f316..eff8461 100644 --- a/sc/source/ui/inc/acredlin.hxx +++ b/sc/source/ui/inc/acredlin.hxx @@ -93,7 +93,6 @@ private: bool bUseColor:1; void Init(); - void InitFilter(); DECL_LINK( FilterHandle, SvxTPFilter*, void ); DECL_LINK( RefHandle, SvxTPFilter*, void ); diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx index 62ee238..c274eef 100644 --- a/sc/source/ui/inc/autofmt.hxx +++ b/sc/source/ui/inc/autofmt.hxx @@ -90,7 +90,6 @@ private: SAL_DLLPRIVATE const SvxLineItem& GetDiagItem( size_t nCol, size_t nRow, bool bTLBR ) const; SAL_DLLPRIVATE void DrawString(vcl::RenderContext& rRenderContext, size_t nCol, size_t nRow); - SAL_DLLPRIVATE void DrawStrings(vcl::RenderContext& rRenderContext); SAL_DLLPRIVATE void DrawBackground(vcl::RenderContext& rRenderContext); SAL_DLLPRIVATE void MakeFonts(sal_uInt16 nIndex, vcl::Font& rFont, diff --git a/sc/source/ui/inc/colrowba.hxx b/sc/source/ui/inc/colrowba.hxx index acff8a1..b5f793f 100644 --- a/sc/source/ui/inc/colrowba.hxx +++ b/sc/source/ui/inc/colrowba.hxx @@ -55,8 +55,6 @@ public: virtual void DrawInvert( long nDragPos ) override; virtual OUString GetDragHelp( long nVal ) override; - - bool UseNumericHeader() const; }; class ScRowBar : public ScHeaderControl diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx index 68be359..a4885f4 100644 --- a/sc/source/ui/inc/csvruler.hxx +++ b/sc/source/ui/inc/csvruler.hxx @@ -167,8 +167,6 @@ private: /** Inverts the cursor bar at the specified position in maRulerDev. */ SAL_DLLPRIVATE void ImplInvertCursor( sal_Int32 nPos ); - /** Draws directly tracking rectangle to the column with the specified index. */ - SAL_DLLPRIVATE void ImplDrawTrackingRect(); /** Sets arrow or horizontal split pointer. */ SAL_DLLPRIVATE void ImplSetMousePointer( sal_Int32 nPos ); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 2fde362..7f42e33 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -310,7 +310,6 @@ public: void ReloadTabLinks(); void SetFormulaOptions( const ScFormulaOptions& rOpt, bool bForLoading = false ); - void SetCalcConfig( const ScCalcConfig& rConfig ); virtual void CheckConfigOptions() override; void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos ); diff --git a/sc/source/ui/inc/editable.hxx b/sc/source/ui/inc/editable.hxx index 6ea8e39..10a0303 100644 --- a/sc/source/ui/inc/editable.hxx +++ b/sc/source/ui/inc/editable.hxx @@ -62,7 +62,6 @@ public: const ScMarkData& rMark ); void TestRange( ScDocument* pDoc, const ScRange& rRange ); void TestSelection( ScDocument* pDoc, const ScMarkData& rMark ); - void TestView( ScViewFunc* pView ); bool IsEditable() const { return mbIsEditable; } bool IsFormatEditable() const { return mbIsEditable || mbOnlyMatrix; } diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx index 0b77c8d..f4129c8 100644 --- a/sc/source/ui/inc/mvtabdlg.hxx +++ b/sc/source/ui/inc/mvtabdlg.hxx @@ -46,7 +46,6 @@ private: void ResetRenameInput(); void CheckNewTabName(); ScDocument* GetSelectedDoc(); - bool IsCurrentDocSelected() const; private: VclPtr<RadioButton> pBtnMove; diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 0a4923d..4aa805c 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -255,7 +255,28 @@ void ScAcceptChgDlg::Init() pTPFilter->SetRange(aRefStr); } - InitFilter(); + // init filter + if(pTPFilter->IsDate()||pTPFilter->IsRange()|| + pTPFilter->IsAuthor()||pTPFilter->IsComment()) + { + pTheView->SetFilterDate(pTPFilter->IsDate()); + pTheView->SetDateTimeMode(pTPFilter->GetDateMode()); + pTheView->SetFirstDate(pTPFilter->GetFirstDate()); + pTheView->SetLastDate(pTPFilter->GetLastDate()); + pTheView->SetFirstTime(pTPFilter->GetFirstTime()); + pTheView->SetLastTime(pTPFilter->GetLastTime()); + pTheView->SetFilterAuthor(pTPFilter->IsAuthor()); + pTheView->SetAuthor(pTPFilter->GetSelectedAuthor()); + + pTheView->SetFilterComment(pTPFilter->IsComment()); + + utl::SearchParam aSearchParam( pTPFilter->GetComment(), + utl::SearchParam::SRCH_REGEXP,false ); + + pTheView->SetCommentParams(&aSearchParam); + + pTheView->UpdateFilterTest(); + } } void ScAcceptChgDlg::ClearView() @@ -1789,31 +1810,6 @@ void ScAcceptChgDlg::FillInfo(SfxChildWinInfo& rInfo) const rInfo.aExtraString += ")"; } -void ScAcceptChgDlg::InitFilter() -{ - if(pTPFilter->IsDate()||pTPFilter->IsRange()|| - pTPFilter->IsAuthor()||pTPFilter->IsComment()) - { - pTheView->SetFilterDate(pTPFilter->IsDate()); - pTheView->SetDateTimeMode(pTPFilter->GetDateMode()); - pTheView->SetFirstDate(pTPFilter->GetFirstDate()); - pTheView->SetLastDate(pTPFilter->GetLastDate()); - pTheView->SetFirstTime(pTPFilter->GetFirstTime()); - pTheView->SetLastTime(pTPFilter->GetLastTime()); - pTheView->SetFilterAuthor(pTPFilter->IsAuthor()); - pTheView->SetAuthor(pTPFilter->GetSelectedAuthor()); - - pTheView->SetFilterComment(pTPFilter->IsComment()); - - utl::SearchParam aSearchParam( pTPFilter->GetComment(), - utl::SearchParam::SRCH_REGEXP,false ); - - pTheView->SetCommentParams(&aSearchParam); - - pTheView->UpdateFilterTest(); - } -} - #define CALC_DATE 3 #define CALC_POS 1 diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index b5b4931..976c79e 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -359,13 +359,6 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo #undef FRAME_OFFSET -void ScAutoFmtPreview::DrawStrings(vcl::RenderContext& rRenderContext) -{ - for(size_t nRow = 0; nRow < 5; ++nRow) - for(size_t nCol = 0; nCol < 5; ++nCol) - DrawString(rRenderContext, nCol, nRow); -} - void ScAutoFmtPreview::DrawBackground(vcl::RenderContext& rRenderContext) { if (pCurData) @@ -396,7 +389,9 @@ void ScAutoFmtPreview::PaintCells(vcl::RenderContext& rRenderContext) DrawBackground(rRenderContext); // 2) values - DrawStrings(rRenderContext); + for(size_t nRow = 0; nRow < 5; ++nRow) + for(size_t nCol = 0; nCol < 5; ++nCol) + DrawString(rRenderContext, nCol, nRow); // 3) border if (pCurData->GetIncludeFrame()) diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index 1fc7669..4459386 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -160,7 +160,7 @@ void ScMoveTableDlg::CheckNewTabName() return; } - bool bMoveInCurrentDoc = (pBtnMove->IsChecked() && IsCurrentDocSelected()); + bool bMoveInCurrentDoc = pBtnMove->IsChecked() && pLbDoc->GetSelectEntryPos() == mnCurrentDocPos; bool bFound = false; const sal_Int32 nLast = pLbTable->GetEntryCount(); for ( sal_uInt16 i=0; i<nLast && !bFound; ++i ) @@ -195,11 +195,6 @@ ScDocument* ScMoveTableDlg::GetSelectedDoc() return static_cast<ScDocument*>(pLbDoc->GetEntryData(nPos)); } -bool ScMoveTableDlg::IsCurrentDocSelected() const -{ - return pLbDoc->GetSelectEntryPos() == mnCurrentDocPos; -} - void ScMoveTableDlg::Init() { pBtnOk->SetClickHdl ( LINK( this, ScMoveTableDlg, OkHdl ) ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 7268c1f..49ac5e2 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -9427,18 +9427,6 @@ uno::Any SAL_CALL ScCellFormatsEnumeration::nextElement() throw(container::NoSuc return uno::makeAny(uno::Reference<table::XCellRange> (NextObject_Impl())); } -ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) : - pDocShell( pDocSh ), - aTotalRange( rRange ), - aRangeLists() -{ - pDocShell->GetDocument().AddUnoObject(*this); - - OSL_ENSURE( aTotalRange.aStart.Tab() == aTotalRange.aEnd.Tab(), "unterschiedliche Tabellen" ); - - GetObjects_Impl(); -} - ScUniqueCellFormatsObj::~ScUniqueCellFormatsObj() { SolarMutexGuard g; @@ -9600,50 +9588,55 @@ struct ScUniqueFormatsOrder } }; -void ScUniqueCellFormatsObj::GetObjects_Impl() +ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) : + pDocShell( pDocSh ), + aTotalRange( rRange ), + aRangeLists() { - if (pDocShell) - { - ScDocument& rDoc = pDocShell->GetDocument(); - SCTAB nTab = aTotalRange.aStart.Tab(); - ScAttrRectIterator aIter( &rDoc, nTab, - aTotalRange.aStart.Col(), aTotalRange.aStart.Row(), - aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() ); - SCCOL nCol1, nCol2; - SCROW nRow1, nRow2; + pDocShell->GetDocument().AddUnoObject(*this); - // Collect the ranges for each format in a hash map, to avoid nested loops + OSL_ENSURE( aTotalRange.aStart.Tab() == aTotalRange.aEnd.Tab(), "unterschiedliche Tabellen" ); - ScUniqueFormatsHashMap aHashMap; - while (aIter.GetNext( nCol1, nCol2, nRow1, nRow2 ) ) - { - ScRange aRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab ); - const ScPatternAttr* pPattern = rDoc.GetPattern(nCol1, nRow1, nTab); - aHashMap[pPattern].Join( aRange ); - } + ScDocument& rDoc = pDocShell->GetDocument(); + SCTAB nTab = aTotalRange.aStart.Tab(); + ScAttrRectIterator aIter( &rDoc, nTab, + aTotalRange.aStart.Col(), aTotalRange.aStart.Row(), + aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() ); + SCCOL nCol1, nCol2; + SCROW nRow1, nRow2; - // Fill the vector aRangeLists with the range lists from the hash map + // Collect the ranges for each format in a hash map, to avoid nested loops - aRangeLists.reserve( aHashMap.size() ); - ScUniqueFormatsHashMap::iterator aMapIter( aHashMap.begin() ); - ScUniqueFormatsHashMap::iterator aMapEnd( aHashMap.end() ); - while ( aMapIter != aMapEnd ) - { - ScUniqueFormatsEntry& rEntry = aMapIter->second; - const ScRangeList& rRanges = rEntry.GetRanges(); - aRangeLists.push_back( rRanges ); // copy ScRangeList - rEntry.Clear(); // free memory, don't hold both copies of all ranges - ++aMapIter; - } + ScUniqueFormatsHashMap aHashMap; + while (aIter.GetNext( nCol1, nCol2, nRow1, nRow2 ) ) + { + ScRange aRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab ); + const ScPatternAttr* pPattern = rDoc.GetPattern(nCol1, nRow1, nTab); + aHashMap[pPattern].Join( aRange ); + } - // Sort the vector by first range's start position, to avoid random shuffling - // due to using the ScPatterAttr pointers + // Fill the vector aRangeLists with the range lists from the hash map - ScUniqueFormatsOrder aComp; - ::std::sort( aRangeLists.begin(), aRangeLists.end(), aComp ); + aRangeLists.reserve( aHashMap.size() ); + ScUniqueFormatsHashMap::iterator aMapIter( aHashMap.begin() ); + ScUniqueFormatsHashMap::iterator aMapEnd( aHashMap.end() ); + while ( aMapIter != aMapEnd ) + { + ScUniqueFormatsEntry& rEntry = aMapIter->second; + const ScRangeList& rRanges = rEntry.GetRanges(); + aRangeLists.push_back( rRanges ); // copy ScRangeList + rEntry.Clear(); // free memory, don't hold both copies of all ranges + ++aMapIter; } + + // Sort the vector by first range's start position, to avoid random shuffling + // due to using the ScPatterAttr pointers + + ScUniqueFormatsOrder aComp; + ::std::sort( aRangeLists.begin(), aRangeLists.end(), aComp ); } + // XIndexAccess sal_Int32 SAL_CALL ScUniqueCellFormatsObj::getCount() throw(uno::RuntimeException, std::exception) diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index 105771e..8ab6a41 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -64,11 +64,6 @@ ScColBar::~ScColBar() { } -inline bool ScColBar::UseNumericHeader() const -{ - return pTabView->GetViewData().GetDocument()->GetAddressConvention() == formula::FormulaGrammar::CONV_XL_R1C1; -} - SCCOLROW ScColBar::GetPos() const { return pTabView->GetViewData().GetPosX(meWhich); @@ -87,7 +82,7 @@ sal_uInt16 ScColBar::GetEntrySize( SCCOLROW nEntryNo ) const OUString ScColBar::GetEntryText( SCCOLROW nEntryNo ) const { - return UseNumericHeader() + return pTabView->GetViewData().GetDocument()->GetAddressConvention() == formula::FormulaGrammar::CONV_XL_R1C1 ? OUString::number(nEntryNo + 1) : ScColToAlpha( static_cast<SCCOL>(nEntryNo) ); } commit 7f509501e9b042aeae0cdcc8e267550a45ab43c2 Author: Noel Grandin <[email protected]> Date: Thu Nov 3 14:15:50 2016 +0200 loplugin:oncevar in framework Change-Id: I7528a4afd59a19b069bcad2106ca80f429ef12e0 Reviewed-on: https://gerrit.libreoffice.org/30525 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx index 49fd219..de70443 100644 --- a/framework/inc/helper/mischelper.hxx +++ b/framework/inc/helper/mischelper.hxx @@ -83,8 +83,8 @@ inline bool IsScriptTypeMatchingToLanguage( SvtScriptType nScriptType, LanguageT inline void RetrieveTypeNameFromResourceURL( const OUString& aResourceURL, OUString& aType, OUString& aName ) { - const sal_Int32 RESOURCEURL_PREFIX_SIZE = 17; - const char RESOURCEURL_PREFIX[] = "private:resource/"; + static const char RESOURCEURL_PREFIX[] = "private:resource/"; + static const sal_Int32 RESOURCEURL_PREFIX_SIZE = strlen(RESOURCEURL_PREFIX); if (( aResourceURL.startsWith( RESOURCEURL_PREFIX ) ) && ( aResourceURL.getLength() > RESOURCEURL_PREFIX_SIZE )) diff --git a/framework/source/fwe/helper/configimporter.cxx b/framework/source/fwe/helper/configimporter.cxx index 27c9849..48eee08 100644 --- a/framework/source/fwe/helper/configimporter.cxx +++ b/framework/source/fwe/helper/configimporter.cxx @@ -34,8 +34,6 @@ bool UIConfigurationImporterOOo1x::ImportCustomToolbars( const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< embed::XStorage >& rToolbarStorage ) { - const char USERDEFTOOLBOX[] = "userdeftoolbox0.xml"; - bool bResult ( false ); if ( rToolbarStorage.is() && rContainerFactory.is() ) { @@ -43,11 +41,7 @@ bool UIConfigurationImporterOOo1x::ImportCustomToolbars( { for ( sal_uInt16 i = 1; i <= 4; i++ ) { - OUStringBuffer aCustomTbxName( 20 ); - aCustomTbxName.append( USERDEFTOOLBOX ); - aCustomTbxName[14] = aCustomTbxName[14] + i; - - OUString aTbxStreamName( aCustomTbxName.makeStringAndClear() ); + OUString aTbxStreamName = "userdeftoolbox" + OUString::number(i) + ".xml"; uno::Reference< io::XStream > xStream = rToolbarStorage->openStreamElement( aTbxStreamName, embed::ElementModes::READ ); if ( xStream.is() ) { diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index 8055034..2733337 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -79,10 +79,6 @@ static const char ITEM_DESCRIPTOR_LABEL[] = "Label"; static const char ITEM_DESCRIPTOR_TYPE[] = "Type"; static const char ITEM_DESCRIPTOR_STYLE[] = "Style"; -// special popup menus (filled during runtime) must be saved as an empty popup menu or menuitem!!! -static const char ADDDIRECT_CMD[] = ".uno:AddDirect"; -static const char AUTOPILOTMENU_CMD[] = ".uno:AutoPilotMenu"; - // using namespaces using namespace ::com::sun::star::uno; @@ -819,8 +815,9 @@ throw ( SAXException, RuntimeException ) ExtractMenuParameters( aProps, aCommandURL, aLabel, aHelpURL, xSubMenu, nType, nItemBits ); if ( xSubMenu.is() ) { - if ( aCommandURL == ADDDIRECT_CMD || - aCommandURL == AUTOPILOTMENU_CMD ) + // special popup menus (filled during runtime) must be saved as an empty popup menu or menuitem!!! + if ( aCommandURL == ".uno:AddDirect" || + aCommandURL == ".uno:AutoPilotMenu" ) { WriteMenuItem( aCommandURL, aLabel, aHelpURL, nItemBits ); bSeparator = false; diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx index c1807a4..662afb0 100644 --- a/framework/source/jobs/jobdata.cxx +++ b/framework/source/jobs/jobdata.cxx @@ -451,8 +451,7 @@ bool isEnabled( const OUString& sAdminTime , we have to encode all '?' signs. Otherwhise e.g. "??-" will be translated to "~" ... */ - static const char PATTERN_ISO8601[] = "\?\?\?\?-\?\?-\?\?*"; - WildCard aISOPattern(PATTERN_ISO8601); + WildCard aISOPattern("\?\?\?\?-\?\?-\?\?*"); bool bValidAdmin = aISOPattern.Matches(sAdminTime); bool bValidUser = aISOPattern.Matches(sUserTime ); diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx index d439407..462f47c 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -249,10 +249,6 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) throw(css::uno::Run void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent ) throw(css::uno::RuntimeException, std::exception) { - const char EVENT_ON_NEW[] = "OnNew"; // Doc UI event - const char EVENT_ON_LOAD[] = "OnLoad"; // Doc UI event - const char EVENT_ON_CREATE[] = "OnCreate"; // Doc API event - const char EVENT_ON_LOAD_FINISHED[] = "OnLoadFinished"; // Doc API event OUString EVENT_ON_DOCUMENT_OPENED("onDocumentOpened"); // Job UI event : OnNew or OnLoad OUString EVENT_ON_DOCUMENT_ADDED("onDocumentAdded"); // Job API event : OnCreate or OnLoadFinished @@ -277,8 +273,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent // Special feature: If the events "OnNew" or "OnLoad" occurs - we generate our own event "onDocumentOpened". if ( - (aEvent.EventName == EVENT_ON_NEW) || - (aEvent.EventName == EVENT_ON_LOAD) + (aEvent.EventName == "OnNew") || + (aEvent.EventName == "OnLoad") ) { if (std::find(m_lEvents.begin(), m_lEvents.end(), EVENT_ON_DOCUMENT_OPENED) != m_lEvents.end()) @@ -287,8 +283,8 @@ void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent // Special feature: If the events "OnCreate" or "OnLoadFinished" occurs - we generate our own event "onDocumentAdded". if ( - (aEvent.EventName == EVENT_ON_CREATE) || - (aEvent.EventName == EVENT_ON_LOAD_FINISHED) + (aEvent.EventName == "OnCreate") || + (aEvent.EventName == "OnLoadFinished") ) { if (std::find(m_lEvents.begin(), m_lEvents.end(), EVENT_ON_DOCUMENT_ADDED) != m_lEvents.end()) diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx index a3394e0..ebad3a5 100644 --- a/framework/source/jobs/shelljob.cxx +++ b/framework/source/jobs/shelljob.cxx @@ -39,20 +39,6 @@ namespace framework{ -/** address job configuration inside argument set provided on method execute(). */ -static const char PROP_JOBCONFIG[] = "JobConfig"; - -/** address job configuration property "Command". */ -static const char PROP_COMMAND[] = "Command"; - -/** address job configuration property "Arguments". */ -static const char PROP_ARGUMENTS[] = "Arguments"; - -/** address job configuration property "DeactivateJobIfDone". */ -static const char PROP_DEACTIVATEJOBIFDONE[] = "DeactivateJobIfDone"; - -/** address job configuration property "CheckExitCode". */ -static const char PROP_CHECKEXITCODE[] = "CheckExitCode"; DEFINE_XSERVICEINFO_MULTISERVICE_2(ShellJob , ::cppu::OWeakObject , @@ -84,12 +70,13 @@ css::uno::Any SAL_CALL ShellJob::execute(const css::uno::Sequence< css::beans::N css::uno::RuntimeException, std::exception ) { ::comphelper::SequenceAsHashMap lArgs (lJobArguments); - ::comphelper::SequenceAsHashMap lOwnCfg(lArgs.getUnpackedValueOrDefault(PROP_JOBCONFIG, css::uno::Sequence< css::beans::NamedValue >())); + /** address job configuration inside argument set provided on method execute(). */ + ::comphelper::SequenceAsHashMap lOwnCfg(lArgs.getUnpackedValueOrDefault("JobConfig", css::uno::Sequence< css::beans::NamedValue >())); - const OUString sCommand = lOwnCfg.getUnpackedValueOrDefault(PROP_COMMAND , OUString()); - const css::uno::Sequence< OUString > lCommandArguments = lOwnCfg.getUnpackedValueOrDefault(PROP_ARGUMENTS , css::uno::Sequence< OUString >()); - const bool bDeactivateJobIfDone = lOwnCfg.getUnpackedValueOrDefault(PROP_DEACTIVATEJOBIFDONE , true ); - const bool bCheckExitCode = lOwnCfg.getUnpackedValueOrDefault(PROP_CHECKEXITCODE , true ); + const OUString sCommand = lOwnCfg.getUnpackedValueOrDefault("Command" , OUString()); + const css::uno::Sequence< OUString > lCommandArguments = lOwnCfg.getUnpackedValueOrDefault("Arguments" , css::uno::Sequence< OUString >()); + const bool bDeactivateJobIfDone = lOwnCfg.getUnpackedValueOrDefault("DeactivateJobIfDone" , true ); + const bool bCheckExitCode = lOwnCfg.getUnpackedValueOrDefault("CheckExitCode" , true ); // replace all might existing place holder. OUString sRealCommand = impl_substituteCommandVariables(sCommand); diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 2b011bc..c43ba89 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -92,7 +92,6 @@ using namespace ::com::sun::star::ui; using namespace ::com::sun::star::frame; static const char STATUS_BAR_ALIAS[] = "private:resource/statusbar/statusbar"; -static const char PROGRESS_BAR_ALIAS[] = "private:resource/progressbar/progressbar"; namespace framework { @@ -2493,7 +2492,7 @@ throw (uno::RuntimeException, std::exception) { SolarMutexClearableGuard aReadLock; bool bStatusBarVisible( isElementVisible( STATUS_BAR_ALIAS )); - bool bProgressBarVisible( isElementVisible( PROGRESS_BAR_ALIAS )); + bool bProgressBarVisible( isElementVisible( "private:resource/progressbar/progressbar" )); bool bVisible( m_bVisible ); Reference< XUIElement > xStatusBar( m_aStatusBarElement.m_xUIElement ); Reference< XUIElement > xProgressBar( m_aProgressBarElement.m_xUIElement ); diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 7610c5f..c225542 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -726,8 +726,6 @@ bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>&, OUStrin void LoadEnv::impl_detectTypeAndFilter() throw(LoadEnvException, css::uno::RuntimeException, std::exception) { - static const char TYPEPROP_PREFERREDFILTER[] = "PreferredFilter"; - static const char FILTERPROP_FLAGS [] = "Flags"; static sal_Int32 FILTERFLAG_TEMPLATEPATH = 16; // SAFE -> @@ -799,7 +797,7 @@ void LoadEnv::impl_detectTypeAndFilter() try { ::comphelper::SequenceAsHashMap lTypeProps(xTypeCont->getByName(sType)); - sFilter = lTypeProps.getUnpackedValueOrDefault(TYPEPROP_PREFERREDFILTER, OUString()); + sFilter = lTypeProps.getUnpackedValueOrDefault("PreferredFilter", OUString()); if (!sFilter.isEmpty()) { // SAFE -> @@ -828,7 +826,7 @@ void LoadEnv::impl_detectTypeAndFilter() try { ::comphelper::SequenceAsHashMap lFilterProps(xFilterCont->getByName(sFilter)); - sal_Int32 nFlags = lFilterProps.getUnpackedValueOrDefault(FILTERPROP_FLAGS, (sal_Int32)0); + sal_Int32 nFlags = lFilterProps.getUnpackedValueOrDefault("Flags", (sal_Int32)0); bIsOwnTemplate = ((nFlags & FILTERFLAG_TEMPLATEPATH) == FILTERFLAG_TEMPLATEPATH); } catch(const css::container::NoSuchElementException&) @@ -1657,8 +1655,6 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::awt::XWindow >& xWindow) { - static const char PACKAGE_SETUP_MODULES[] = "/org.openoffice.Setup/Office/Factories"; - // no window -> action not possible if (!xWindow.is()) return; @@ -1720,7 +1716,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw // get access to the configuration of this office module css::uno::Reference< css::container::XNameAccess > xModuleCfg(::comphelper::ConfigurationHelper::openConfig( xContext, - PACKAGE_SETUP_MODULES, + "/org.openoffice.Setup/Office/Factories", ::comphelper::EConfigurationModes::ReadOnly), css::uno::UNO_QUERY_THROW); diff --git a/framework/source/uiconfiguration/globalsettings.cxx b/framework/source/uiconfiguration/globalsettings.cxx index aa8a15a..8701c83 100644 --- a/framework/source/uiconfiguration/globalsettings.cxx +++ b/framework/source/uiconfiguration/globalsettings.cxx @@ -39,13 +39,6 @@ using namespace ::com::sun::star; // Namespace -static const char GLOBALSETTINGS_ROOT_ACCESS[] = "/org.openoffice.Office.UI.GlobalSettings/Toolbars"; - -static const char GLOBALSETTINGS_NODEREF_STATES[] = "States"; -static const char GLOBALSETTINGS_PROPERTY_LOCKED[] = "Locked"; -static const char GLOBALSETTINGS_PROPERTY_DOCKED[] = "Docked"; -static const char GLOBALSETTINGS_PROPERTY_STATESENABLED[] = "StatesEnabled"; - namespace framework { @@ -88,10 +81,10 @@ class GlobalSettings_Access : public ::cppu::WeakImplHelper< GlobalSettings_Access::GlobalSettings_Access( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : m_bDisposed( false ), m_bConfigRead( false ), - m_aNodeRefStates( GLOBALSETTINGS_NODEREF_STATES ), - m_aPropStatesEnabled( GLOBALSETTINGS_PROPERTY_STATESENABLED ), - m_aPropLocked( GLOBALSETTINGS_PROPERTY_LOCKED ), - m_aPropDocked( GLOBALSETTINGS_PROPERTY_DOCKED ), + m_aNodeRefStates( "States" ), + m_aPropStatesEnabled( "StatesEnabled" ), ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
