chart2/source/tools/ExplicitCategoriesProvider.cxx |   22 ++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 4e559c3b2b4ca1fd2ba8c8ee5a7a5ac8a88893cf
Author:     Noel Grandin <[email protected]>
AuthorDate: Sat Apr 5 12:15:21 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Apr 5 13:38:42 2025 +0200

    tdf#147874 slow sheet switching with large chart2 (3)
    
    in
        commit 8611749d0acbf910a7003131e4419022eb4fe4bc
        tdf#147874 slow sheet switching with large chart2
    
    I didn't get the init order quite right to get the speedup I wanted.
    
    Change-Id: I5c1ce80e5770578079985c02208fb253818c9c86
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183744
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx 
b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 9b21fc42ef95..aab4bb72dc48 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -101,17 +101,6 @@ void ExplicitCategoriesProvider::implInitSplit()
     const bool bHasCategories = false;
     const uno::Sequence< sal_Int32 > aSequenceMapping;
 
-    uno::Reference< data::XDataSource > xRowCategoriesSource( 
xDataProvider->createDataSource(
-                DataSourceHelper::createArguments( aCategoriesRange, 
aSequenceMapping, false /*bUseColumns*/
-                    , bFirstCellAsLabel, bHasCategories ) ) );
-    if( !xRowCategoriesSource )
-        return;
-
-    Sequence< Reference< data::XLabeledDataSequence> > aRows = 
xRowCategoriesSource->getDataSequences();
-    sal_Int32 nRowCount = aRows.getLength();
-    if( nRowCount<=1 )
-        return;
-
     uno::Reference< data::XDataSource > xColumnCategoriesSource( 
xDataProvider->createDataSource(
                 DataSourceHelper::createArguments( aCategoriesRange, 
aSequenceMapping, true /*bUseColumns*/
                     , bFirstCellAsLabel, bHasCategories ) ) );
@@ -123,6 +112,17 @@ void ExplicitCategoriesProvider::implInitSplit()
     if( nColumnCount<=1 )
         return;
 
+    uno::Reference< data::XDataSource > xRowCategoriesSource( 
xDataProvider->createDataSource(
+                DataSourceHelper::createArguments( aCategoriesRange, 
aSequenceMapping, false /*bUseColumns*/
+                    , bFirstCellAsLabel, bHasCategories ) ) );
+    if( !xRowCategoriesSource )
+        return;
+
+    Sequence< Reference< data::XLabeledDataSequence> > aRows = 
xRowCategoriesSource->getDataSequences();
+    sal_Int32 nRowCount = aRows.getLength();
+    if( nRowCount<=1 )
+        return;
+
     //we have complex categories
     //->split them in the direction of the first series
     //detect whether the first series is a row or a column

Reply via email to