chart2/source/view/charttypes/AreaChart.cxx | 2 -- sc/inc/cellsuno.hxx | 3 ++- sc/inc/docuno.hxx | 4 ++++ sc/source/filter/xml/xmlrowi.cxx | 14 +++++++------- sc/source/ui/unoobj/cellsuno.cxx | 4 +--- sc/source/ui/unoobj/docuno.cxx | 13 +++++++++++++ 6 files changed, 27 insertions(+), 13 deletions(-)
New commits: commit eb4977cb6d81b1c15d025435adf25b19e88d3132 Author: Noel Grandin <[email protected]> AuthorDate: Sun Apr 6 14:36:20 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Apr 6 21:33:34 2025 +0200 assigning m_pPosHelper here does nothing useful Change-Id: I46750c9782610b47e5bb64808f12b5691643cba4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183757 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 027fd936ee52..453641ea675b 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -624,8 +624,6 @@ void AreaChart::createShapes() std::map< sal_Int32, double >& rLogicYSumMap = aLogicYSumMapByX[nIndex]; rLogicYSumMap.insert({nAttachedAxisIndex, 0.0}); - m_pPosHelper = &getPlottingPositionHelper(nAttachedAxisIndex); - double fAdd = pSeries->getYValue( nIndex ); if( !std::isnan(fAdd) && !std::isinf(fAdd) ) rLogicYSumMap[nAttachedAxisIndex] += fabs( fAdd ); commit 7881f210b439fcee025daaac56115cb0f868a402 Author: Noel Grandin <[email protected]> AuthorDate: Sun Apr 6 14:27:21 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Apr 6 21:33:22 2025 +0200 tdf#151876 shave some time off chart load (3) reduce the number of times we acquire/release the solarmutex in the hottest part of the load. Change-Id: I840e4b1bdb489319c6b03d9bfa69e761eb448831 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183756 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index c3f627f0bbcd..f82643782dec 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -114,6 +114,7 @@ class SfxItemPropertyMap; class SfxItemPropertySet; struct SfxItemPropertyMapEntry; class ScTableRowsObj; +class SolarMutexGuard; namespace editeng { class SvxBorderLine; } @@ -613,7 +614,7 @@ public: getScCellRangeByPosition( sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ); rtl::Reference< ScTableRowsObj > - getScRowsByPosition( sal_Int32 nLeft, sal_Int32 nTop, + getScRowsByPosition( SolarMutexGuard& rGuard, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ); rtl::Reference< ScTableRowsObj > getScRows(); }; diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index c8dab9647d0c..ec1855a63d64 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -72,6 +72,7 @@ class ScPrintUIOptions; class ScSheetSaveData; struct ScFormatSaveData; class ScTableSheetsObj; +class SolarMutexGuard; class SAL_DLLPUBLIC_RTTI ScModelObj : public SfxBaseModel, public vcl::ITiledRenderable, @@ -640,6 +641,9 @@ public: virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + void setPropertyValueIsFiltered( SolarMutexGuard& rGuard, bool b ); + bool getPropertyValueOHeight( SolarMutexGuard& rGuard ); }; class ScSpreadsheetSettingsObj final : public cppu::WeakImplHelper< diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index aba21021755e..a9c28a796e39 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -42,8 +42,6 @@ #include <comphelper/servicehelper.hxx> #include <osl/diagnose.h> -constexpr OUStringLiteral SC_ISFILTERED = u"IsFiltered"; - using namespace com::sun::star; using namespace xmloff::token; @@ -163,7 +161,11 @@ void SAL_CALL ScXMLTableRowContext::endFastElement(sal_Int32 /*nElement*/) nFirstRow = pDoc->MaxRow(); if (nCurrentRow > pDoc->MaxRow()) nCurrentRow = pDoc->MaxRow(); - rtl::Reference<ScTableRowsObj> xRowProperties(xSheet->getScRowsByPosition(0, nFirstRow, 0, nCurrentRow)); + + // Take the solarmutex here and pass references to places that need the lock - avoids + // the cost of taking and releasing it several times. + SolarMutexGuard aGuard; + rtl::Reference<ScTableRowsObj> xRowProperties(xSheet->getScRowsByPosition(aGuard, 0, nFirstRow, 0, nCurrentRow)); if (!xRowProperties.is()) return; @@ -208,11 +210,9 @@ void SAL_CALL ScXMLTableRowContext::endFastElement(sal_Int32 /*nElement*/) rXMLImport.GetDoc().setRowsVisible(nSheet, nFirstRow, nCurrentRow, false); } if (bFiltered) - xRowProperties->setPropertyValue(SC_ISFILTERED, uno::Any(bFiltered)); + xRowProperties->setPropertyValueIsFiltered(aGuard, bFiltered); - uno::Any any = xRowProperties->getPropertyValue(SC_UNONAME_OHEIGHT); - bool bOptionalHeight = false; - any >>= bOptionalHeight; + bool bOptionalHeight = xRowProperties->getPropertyValueOHeight(aGuard); if (bOptionalHeight) { // Save this row for later height update, only if we have no already optimal row heights diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 38e206502050..a7818ad31b9e 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -4539,11 +4539,9 @@ rtl::Reference<ScCellRangeObj> ScCellRangeObj::getScCellRangeByPosition( throw lang::IndexOutOfBoundsException(); } -rtl::Reference<ScTableRowsObj> ScCellRangeObj::getScRowsByPosition( +rtl::Reference<ScTableRowsObj> ScCellRangeObj::getScRowsByPosition(SolarMutexGuard& /*rGuard*/, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) { - SolarMutexGuard aGuard; - ScDocShell* pDocSh = GetDocShell(); if (!pDocSh) throw uno::RuntimeException(); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index ef0ca28c0732..d8204ff2e729 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -4999,6 +4999,13 @@ void SAL_CALL ScTableRowsObj::setPropertyValue( } } +void ScTableRowsObj::setPropertyValueIsFiltered(SolarMutexGuard& /*rGuard*/, bool b ) +{ + ScDocument& rDoc = pDocShell->GetDocument(); + //! undo etc. + rDoc.SetRowFiltered(nStartRow, nEndRow, nTab, b); +} + uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyName ) { SolarMutexGuard aGuard; @@ -5055,6 +5062,12 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam return aAny; } +bool ScTableRowsObj::getPropertyValueOHeight( SolarMutexGuard& /*rGuard*/ ) +{ + ScDocument& rDoc = pDocShell->GetDocument(); + return !(rDoc.GetRowFlags( nStartRow, nTab ) & CRFlags::ManualSize); +} + SC_IMPL_DUMMY_PROPERTY_LISTENER( ScTableRowsObj ) ScSpreadsheetSettingsObj::~ScSpreadsheetSettingsObj()
