[Libreoffice-commits] core.git: Branch 'libreoffice-4-0-1' - sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Feb 26 06:18:49 PST 2013


 sc/source/filter/inc/worksheethelper.hxx  |    2 ++
 sc/source/filter/oox/workbookfragment.cxx |   13 +++++++++++++
 sc/source/filter/oox/worksheethelper.cxx  |   14 ++++++++++++--
 3 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit ab82ad7b1c5c9e0567319e60aacd6e960668ad2d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Feb 21 02:23:13 2013 +0100

    delay importing all drawing elements until content is loaded, fdo#60488
    
    Otherwise charts with data ranges on other sheets will not be painted
    correctly as the data is missing when the chart is rendered for the
    first time. This was not a problem before the cached value import
    because the hard recalc would have forced a repaint anyway.
    
    The new way should also be a bit quicker.
    
    Change-Id: Ieeee6a010a4dffad6ebe2264b8312f93b16d9c87
    Reviewed-on: https://gerrit.libreoffice.org/2412
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
    Reviewed-on: https://gerrit.libreoffice.org/2418
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Reviewed-by: Petr Mladek <pmladek at suse.cz>
    Tested-by: Petr Mladek <pmladek at suse.cz>

diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx
index 32db180..2efa6e4 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -303,6 +303,8 @@ public:
     void                initializeWorksheetImport();
     /** Final conversion after importing the worksheet. */
     void                finalizeWorksheetImport();
+    /** Final import of drawing objects. Has to be called after all content has been imported */
+    void finalizeDrawingImport();
 
     void                setCellFormula( const ::com::sun::star::table::CellAddress& rTokenAddress, const rtl::OUString&  );
     void                setCellFormula( const ::com::sun::star::table::CellAddress& rTokenAddress, sal_Int32  );
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index ba0c2fd..41a6ce7 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -231,6 +231,7 @@ void WorkbookFragment::finalizeImport()
     typedef ::std::pair< WorksheetGlobalsRef, FragmentHandlerRef > SheetFragmentHandler;
     typedef ::std::vector< SheetFragmentHandler > SheetFragmentVector;
     SheetFragmentVector aSheetFragments;
+    std::vector<WorksheetHelper*> maHelpers;
     WorksheetBuffer& rWorksheets = getWorksheets();
     sal_Int32 nWorksheetCount = rWorksheets.getWorksheetCount();
     for( sal_Int32 nWorksheet = 0; nWorksheet < nWorksheetCount; ++nWorksheet )
@@ -286,7 +287,10 @@ void WorkbookFragment::finalizeImport()
 
                         // insert the fragment into the map
                         if( xFragment.is() )
+                        {
                             aSheetFragments.push_back( SheetFragmentHandler( xSheetGlob, xFragment.get() ) );
+                            maHelpers.push_back(xFragment.get());
+                        }
                     }
                 }
             }
@@ -301,6 +305,15 @@ void WorkbookFragment::finalizeImport()
     {
         // import the sheet fragment
         importOoxFragment( aIt->second );
+    }
+
+    for( std::vector<WorksheetHelper*>::iterator aIt = maHelpers.begin(), aEnd = maHelpers.end(); aIt != aEnd; ++aIt )
+    {
+        (*aIt)->finalizeDrawingImport();
+    }
+
+    for( SheetFragmentVector::iterator aIt = aSheetFragments.begin(), aEnd = aSheetFragments.end(); aIt != aEnd; ++aIt )
+    {
         // delete fragment object and WorkbookGlobals object, will free all allocated sheet buffers
         aIt->second.clear();
         aIt->first.reset();
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index fbb4dd2..4d29ad3 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -339,6 +339,8 @@ public:
     /** Final conversion after importing the worksheet. */
     void                finalizeWorksheetImport();
 
+    void finalizeDrawingImport();
+
 private:
     typedef ::std::vector< sal_Int32 >                  OutlineLevelVec;
     typedef ::std::pair< ColumnModel, sal_Int32 >       ColumnModelRange;
@@ -953,9 +955,12 @@ void WorksheetGlobals::finalizeWorksheetImport()
     lclUpdateProgressBar( mxFinalProgress, 0.5 );
     convertColumns();
     convertRows();
-    lclUpdateProgressBar( mxFinalProgress, 0.75 );
-    finalizeDrawings();
     lclUpdateProgressBar( mxFinalProgress, 1.0 );
+}
+
+void WorksheetGlobals::finalizeDrawingImport()
+{
+    finalizeDrawings();
 
     // forget current sheet index in global data
     setCurrentSheetIndex( -1 );
@@ -1575,6 +1580,11 @@ void WorksheetHelper::finalizeWorksheetImport()
     mrSheetGlob.finalizeWorksheetImport();
 }
 
+void WorksheetHelper::finalizeDrawingImport()
+{
+    mrSheetGlob.finalizeDrawingImport();
+}
+
 void WorksheetHelper::setCellFormula( const ::com::sun::star::table::CellAddress& rTokenAddress, const rtl::OUString& rTokenStr )
 {
     getFormulaBuffer().setCellFormula( rTokenAddress,  rTokenStr );


More information about the Libreoffice-commits mailing list