[Libreoffice-commits] .: Branch 'feature/gsoc-calc-perf2' - 2 commits - sc/qa sc/source

Daniel Bankston dbank at kemper.freedesktop.org
Sun Jun 24 23:24:55 PDT 2012


 sc/qa/unit/subsequent_filters-test.cxx |    6 +++-
 sc/source/filter/xml/xmlimprt.cxx      |    3 --
 sc/source/filter/xml/xmlsubti.cxx      |   42 ---------------------------------
 sc/source/filter/xml/xmlsubti.hxx      |    1 
 4 files changed, 5 insertions(+), 47 deletions(-)

New commits:
commit a2abf16d605b9e4b4437124a08fc312e81ae33af
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Mon Jun 25 01:21:26 2012 -0500

    Stop calculating row heights and instead use imported row heights only
    
    Change-Id: I1a5e33c292fb915e61511efbdb9ce4a0cfd7265f

diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 5d1d99a..093c3bc 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2807,6 +2807,7 @@ throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::R
     uno::Reference<document::XActionLockable> xActionLockable(xDoc, uno::UNO_QUERY);
     if (xActionLockable.is())
         xActionLockable->addActionLock();
+    pDoc->EnableAdjustHeight(false);
 }
 
 // XServiceInfo
@@ -3100,8 +3101,6 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE
                 if (!pSheetData->IsSheetBlocked( nTab ))
                     pDoc->SetStreamValid( nTab, true );
         }
-
-        aTables.UpdateRowHeights();
         aTables.FixupOLEs();
     }
     if (GetModel().is())
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index 662f278..7825bbf 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -200,48 +200,6 @@ void ScMyTables::AddColumn(bool bIsCovered)
         rImport.GetStylesImportHelper()->InsertCol(maCurrentCellPos.Col(), maCurrentCellPos.Tab(), rImport.GetDocument());
 }
 
-void ScMyTables::UpdateRowHeights()
-{
-    if (rImport.GetModel().is())
-    {
-        ScXMLImport::MutexGuard aGuard(rImport);
-
-        // update automatic row heights
-
-        // For sheets with any kind of shapes (including notes),
-        // update row heights immediately (before setting the positions).
-        // For sheets without shapes, set "pending" flag
-        // and update row heights when a sheet is shown.
-        // The current sheet (from view settings) is always updated immediately.
-
-        ScDocument* pDoc = ScXMLConverter::GetScDocument(rImport.GetModel());
-        if (pDoc)
-        {
-            SCTAB nCount = pDoc->GetTableCount();
-            ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
-
-            SCTAB nVisible = rImport.GetVisibleSheet();
-
-            ScMarkData aUpdateSheets;
-            for (SCTAB nTab=0; nTab<nCount; ++nTab)
-            {
-                const SdrPage* pPage = pDrawLayer ? pDrawLayer->GetPage(nTab) : NULL;
-                if ( nTab == nVisible || ( pPage && pPage->GetObjCount() != 0 ) )
-                    aUpdateSheets.SelectTable( nTab, true );
-                else
-                    pDoc->SetPendingRowHeights( nTab, true );
-            }
-
-            if (aUpdateSheets.GetSelectCount())
-            {
-                pDoc->LockStreamValid( true );      // ignore draw page size (but not formula results)
-                ScModelObj::getImplementation(rImport.GetModel())->UpdateAllRowHeights(&aUpdateSheets);
-                pDoc->LockStreamValid( false );
-            }
-        }
-    }
-}
-
 void ScMyTables::DeleteTable()
 {
     ScXMLImport::MutexGuard aGuard(rImport);
diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx
index 971cb69..3f98af9 100644
--- a/sc/source/filter/xml/xmlsubti.hxx
+++ b/sc/source/filter/xml/xmlsubti.hxx
@@ -107,7 +107,6 @@ public:
     void                                AddRow();
     void                                SetRowStyle(const rtl::OUString& rCellStyleName);
     void                                AddColumn(bool bIsCovered);
-    void                                UpdateRowHeights();
     void                                FixupOLEs() { aFixupOLEs.FixupOLEs(); }
     bool                                IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const
                                             { return ScMyOLEFixer::IsOLE(rShape); }
commit 44cf1f0db7860b2193a663809678d2056c2cb5ff
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Fri Jun 22 23:53:25 2012 -0500

    Add unit test for ODS row height import
    
    Change-Id: If8535f80d2f2cd57132d9d694d6bb2535df31c80

diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index b9e4a52..1f29ae7 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -450,8 +450,10 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
         pPattern = pDoc->GetPattern(1,3,1);
         pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
         CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be underlined with a dotted line", UNDERLINE_DOTTED, aFont.GetUnderline());
-        //test case for proper import height of first row with styles and text (related to i53253)
-        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(253), pDoc->GetRowHeight(0,1) );
+        //check row height import
+        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(256), pDoc->GetRowHeight(0,1) ); //0.178in
+        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(304), pDoc->GetRowHeight(1,1) ); //0.211in
+        CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(477), pDoc->GetRowHeight(5,1) ); //0.3311in
         //test case for i53253 where a cell has text with different styles and space between the text.
         rtl::OUString aTestStr;
         pDoc->GetString(3,0,1, aTestStr);


More information about the Libreoffice-commits mailing list