Author: leiw Date: Fri Sep 28 08:36:51 2012 New Revision: 1391359 URL: http://svn.apache.org/viewvc?rev=1391359&view=rev Log: #i121136 Improve Spreadsheet performance in some area (Patch 1)
Patch by: Wang Lei Review by: Wang Lei Modified: incubator/ooo/trunk/main/sc/inc/document.hxx incubator/ooo/trunk/main/sc/inc/table.hxx incubator/ooo/trunk/main/sc/source/core/data/document.cxx incubator/ooo/trunk/main/sc/source/core/data/table2.cxx incubator/ooo/trunk/main/sc/source/filter/excel/colrowst.cxx incubator/ooo/trunk/main/sc/source/ui/unoobj/shapeuno.cxx incubator/ooo/trunk/main/sc/source/ui/view/printfun.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=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/inc/document.hxx (original) +++ incubator/ooo/trunk/main/sc/inc/document.hxx Fri Sep 28 08:36:51 2012 @@ -1298,6 +1298,7 @@ public: void DeleteSelectionTab( SCTAB nTab, sal_uInt16 nDelFlag, const ScMarkData& rMark ); SC_DLLPUBLIC void SetColWidth( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth ); + SC_DLLPUBLIC void SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth ); SC_DLLPUBLIC void SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight ); SC_DLLPUBLIC void SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight ); Modified: incubator/ooo/trunk/main/sc/inc/table.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/inc/table.hxx?rev=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/inc/table.hxx (original) +++ incubator/ooo/trunk/main/sc/inc/table.hxx Fri Sep 28 08:36:51 2012 @@ -628,6 +628,7 @@ public: const Fraction& rZoomX, const Fraction& rZoomY, sal_Bool bWidth, sal_Bool bTotalSize ); void SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth ); + void SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth ); void SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight ); sal_Bool SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight, double nPPTX, double nPPTY ); Modified: incubator/ooo/trunk/main/sc/source/core/data/document.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/core/data/document.cxx?rev=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/source/core/data/document.cxx (original) +++ incubator/ooo/trunk/main/sc/source/core/data/document.cxx Fri Sep 28 08:36:51 2012 @@ -3165,6 +3165,11 @@ void ScDocument::SetColWidth( SCCOL nCol pTab[nTab]->SetColWidth( nCol, nNewWidth ); } +void ScDocument::SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth ) +{ + if ( ValidTab(nTab) && pTab[nTab] ) + pTab[nTab]->SetColWidthOnly( nCol, nNewWidth ); +} void ScDocument::SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight ) { Modified: incubator/ooo/trunk/main/sc/source/core/data/table2.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/core/data/table2.cxx?rev=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/source/core/data/table2.cxx (original) +++ incubator/ooo/trunk/main/sc/source/core/data/table2.cxx Fri Sep 28 08:36:51 2012 @@ -2340,6 +2340,16 @@ void ScTable::SetRowHeightOnly( SCROW nS mpRowHeights->setValue(nStartRow, nEndRow, nNewHeight); } +void ScTable::SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth ) +{ + if (!VALIDCOL(nCol) || !pColWidth) + return; + + if (!nNewWidth) + nNewWidth = STD_COL_WIDTH; + + pColWidth[nCol] = nNewWidth; +} void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool bManual ) { if (VALIDROW(nStartRow) && VALIDROW(nEndRow) && pRowFlags) Modified: incubator/ooo/trunk/main/sc/source/filter/excel/colrowst.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/colrowst.cxx?rev=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/source/filter/excel/colrowst.cxx (original) +++ incubator/ooo/trunk/main/sc/source/filter/excel/colrowst.cxx Fri Sep 28 08:36:51 2012 @@ -199,7 +199,7 @@ void XclImpColRowSettings::Convert( SCTA ::set_flag( maColFlags[ nScCol ], EXC_COLROW_HIDDEN ); nWidth = mnDefWidth; } - rDoc.SetColWidth( nScCol, nScTab, nWidth ); + rDoc.SetColWidthOnly( nScCol, nScTab, nWidth ); } // row heights ------------------------------------------------------------ Modified: incubator/ooo/trunk/main/sc/source/ui/unoobj/shapeuno.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/unoobj/shapeuno.cxx?rev=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/source/ui/unoobj/shapeuno.cxx (original) +++ incubator/ooo/trunk/main/sc/source/ui/unoobj/shapeuno.cxx Fri Sep 28 08:36:51 2012 @@ -819,7 +819,7 @@ uno::Any SAL_CALL ScShapeObj::getPropert } else { - GetShapePropertySet(); + if(!pShapePropertySet) GetShapePropertySet(); //performance consideration if (pShapePropertySet) aAny = pShapePropertySet->getPropertyValue( aPropertyName ); } Modified: incubator/ooo/trunk/main/sc/source/ui/view/printfun.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/view/printfun.cxx?rev=1391359&r1=1391358&r2=1391359&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/source/ui/view/printfun.cxx (original) +++ incubator/ooo/trunk/main/sc/source/ui/view/printfun.cxx Fri Sep 28 08:36:51 2012 @@ -2991,8 +2991,9 @@ void lcl_SetHidden( ScDocument* pDoc, SC void ScPrintFunc::CalcPages() // berechnet aPageRect und Seiten aus nZoom { if (!pPageEndX) pPageEndX = new SCCOL[MAXCOL+1]; - if (!pPageEndY) pPageEndY = new SCROW[MAXROW+1]; - if (!pPageRows) pPageRows = new ScPageRowEntry[MAXROW+1]; //! vorher zaehlen !!!! + //performance impact +// if (!pPageEndY) pPageEndY = new SCROW[MAXROW+1]; +// if (!pPageRows) pPageRows = new ScPageRowEntry[MAXROW+1]; //! vorher zaehlen !!!! pDoc->SetPageSize( nPrintTab, GetDocPageSize() ); if (aAreaParam.bPrintArea) @@ -3002,7 +3003,9 @@ void ScPrintFunc::CalcPages() } else pDoc->UpdatePageBreaks( nPrintTab, NULL ); // sonst wird das Ende markiert - + SCROW nRealCnt = nEndRow-nStartRow+1; + if (!pPageEndY) pPageEndY = new SCROW[nRealCnt+1]; + if (!pPageRows) pPageRows = new ScPageRowEntry[nRealCnt+1]; //! vorher zaehlen !!!! // // Seiteneinteilung nach Umbruechen in Col/RowFlags // Von mehreren Umbruechen in einem ausgeblendeten Bereich zaehlt nur einer.