You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by le...@apache.org on 2012/09/14 11:45:57 UTC

svn commit: r1384699 - in /incubator/ooo/trunk/main/sc: inc/document.hxx source/filter/excel/excimp8.cxx source/filter/excel/impop.cxx source/filter/excel/xiescher.cxx

Author: leiw
Date: Fri Sep 14 09:45:56 2012
New Revision: 1384699

URL: http://svn.apache.org/viewvc?rev=1384699&view=rev
Log:
#i120586 optimize 'updaterowheights' in loading procedure to improve xls loading performance

          Patch by: li zhang (lizh.fee@gmail.com)
          Review by: Wang Lei

Modified:
    incubator/ooo/trunk/main/sc/inc/document.hxx
    incubator/ooo/trunk/main/sc/source/filter/excel/excimp8.cxx
    incubator/ooo/trunk/main/sc/source/filter/excel/impop.cxx
    incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx

Modified: incubator/ooo/trunk/main/sc/inc/document.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/inc/document.hxx?rev=1384699&r1=1384698&r2=1384699&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/inc/document.hxx (original)
+++ incubator/ooo/trunk/main/sc/inc/document.hxx Fri Sep 14 09:45:56 2012
@@ -611,8 +611,8 @@ public:
     void            SetStreamValid( SCTAB nTab, sal_Bool bSet, sal_Bool bIgnoreLock = sal_False );
     void            LockStreamValid( bool bLock );
     bool            IsStreamValidLocked() const                         { return mbStreamValidLocked; }
-    sal_Bool            IsPendingRowHeights( SCTAB nTab ) const;
-    void            SetPendingRowHeights( SCTAB nTab, sal_Bool bSet );
+    SC_DLLPUBLIC sal_Bool        IsPendingRowHeights( SCTAB nTab ) const;
+    SC_DLLPUBLIC void            SetPendingRowHeights( SCTAB nTab, sal_Bool bSet );
 	SC_DLLPUBLIC void			SetLayoutRTL( SCTAB nTab, sal_Bool bRTL );
 	SC_DLLPUBLIC sal_Bool			IsLayoutRTL( SCTAB nTab ) const;
 	sal_Bool			IsNegativePage( SCTAB nTab ) const;

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/excimp8.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/excimp8.cxx?rev=1384699&r1=1384698&r2=1384699&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/excimp8.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/excimp8.cxx Fri Sep 14 09:45:56 2012
@@ -173,6 +173,10 @@ void ImportExcel8::Boundsheet( void )
         pD->MakeTable( nScTab );
 	}
 
+	//assume pending row heights true here. Only optimize the excel8 type for now. i120586
+	//if the sheet contain sdrobject, will set false then.
+	pD->SetPendingRowHeights( nScTab, true );
+	//end i120586
 	if( ( nGrbit & 0x0001 ) || ( nGrbit & 0x0002 ) )
         pD->SetVisible( nScTab, sal_False );
 

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/impop.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/impop.cxx?rev=1384699&r1=1384698&r2=1384699&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/impop.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/impop.cxx Fri Sep 14 09:45:56 2012
@@ -1203,8 +1203,26 @@ void ImportExcel::AdjustRowHeight()
         update row heights (here), last load all charts -> do not any longer
         update inside of ScDocShell::ConvertFrom() (causes update of existing
         charts during each and every change of row height). */
-    if( ScModelObj* pDocObj = GetDocModelObj() )
-        pDocObj->UpdateAllRowHeights();
+    	/*if( ScModelObj* pDocObj = GetDocModelObj() )
+         pDocObj->UpdateAllRowHeights();*/
+
+       //just update row heights for : 1. visible sheet, 2. sheet containing sdrobject. i120586
+	SCTAB nCount = GetDoc().GetTableCount();
+	SCTAB nVisible = GetDocViewSettings().GetDisplScTab();
+
+	GetDoc().SetPendingRowHeights(nVisible, false);
+
+	ScMarkData aUpdateSheets;
+	for (SCTAB nTab=0; nTab<nCount; ++nTab)
+	{
+		if ( false == GetDoc().IsPendingRowHeights(nTab)) 
+			aUpdateSheets.SelectTable( nTab, true );
+	}
+
+	ScModelObj* pDocObj = GetDocModelObj();
+	if (pDocObj && (aUpdateSheets.GetSelectCount()))
+		pDocObj->UpdateAllRowHeights(&aUpdateSheets);	
+     //end i120586
 }
 
 

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx?rev=1384699&r1=1384698&r2=1384699&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx Fri Sep 14 09:45:56 2012
@@ -200,6 +200,9 @@ XclImpDrawObjBase::XclImpDrawObjBase( co
     mbInsertSdr( true ),
     mbCustomDff( false )
 {
+	//  if this sheet(ScTab) have an xclimpdrawobjbase (i.e. it contain sdrobject), 
+	//  then the sheet should be 'updaterowheights' in loading procedure. i120586
+	GetDoc().SetPendingRowHeights( rRoot.GetCurrScTab(), false );
 }
 
 XclImpDrawObjBase::~XclImpDrawObjBase()