[Libreoffice-commits] .: 5 commits - sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 23 08:50:10 PDT 2012


 sc/inc/datauno.hxx                      |    6 +++---
 sc/source/core/data/cell.cxx            |    3 ++-
 sc/source/filter/oox/workbookhelper.cxx |   27 +++++++++++++++++++++++----
 sc/source/filter/xml/xmlimprt.cxx       |    2 --
 sc/source/ui/docshell/docsh.cxx         |    3 ++-
 5 files changed, 30 insertions(+), 11 deletions(-)

New commits:
commit 2ba43bc1b85471a1b91658c000f9cc268c799157
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Aug 23 11:47:49 2012 -0400

    A little cleanup and avoid exporting all methods from ScDatabaseRangeObj.
    
    Change-Id: I4dc7dc689af5d2e9d49584157171202aef873688

diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx
index 75bd893..2ddeb33 100644
--- a/sc/inc/datauno.hxx
+++ b/sc/inc/datauno.hxx
@@ -494,7 +494,7 @@ public:
 };
 
 
-class SC_DLLPUBLIC ScDatabaseRangeObj : public cppu::WeakImplHelper6<
+class ScDatabaseRangeObj : public cppu::WeakImplHelper6<
                                 com::sun::star::sheet::XDatabaseRange,
                                 com::sun::star::util::XRefreshable,
                                 com::sun::star::container::XNamed,
@@ -516,9 +516,9 @@ private:
     void                    Refreshed_Impl();
 
 public:
-                            ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm);
-                            ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab);
-    virtual                 ~ScDatabaseRangeObj();
+    ScDatabaseRangeObj(ScDocShell* pDocSh, const String& rNm);
+    SC_DLLPUBLIC ScDatabaseRangeObj(ScDocShell* pDocSh, const SCTAB nTab);
+    virtual ~ScDatabaseRangeObj();
 
     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
 
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 7d6aa77..d039498 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -480,8 +480,7 @@ Reference< XDatabaseRange > WorkbookGlobals::createUnnamedDatabaseRangeObject( c
                                        aScRange.aEnd.Col(), aScRange.aEnd.Row() );
         rDoc.SetAnonymousDBData( aScRange.aStart.Tab() , pNewDBData );
         ScDocShell* pDocSh = static_cast< ScDocShell* >(rDoc.GetDocumentShell());
-        ScDatabaseRangeObj* pDBRangeObj = new ScDatabaseRangeObj( pDocSh, aScRange.aStart.Tab() );
-        xDatabaseRange.set( pDBRangeObj );
+        xDatabaseRange.set(new ScDatabaseRangeObj(pDocSh, aScRange.aStart.Tab()));
     }
     catch( Exception& )
     {
commit ccce242c3a8892f1bc5b649ca43a544cdced28d9
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Tue Aug 7 04:21:54 2012 -0500

    Convert xlsx unnamed database range import to direct sc
    
    Will evaluate later if further conversion is useful here
    
    Change-Id: I6af5296b95075066335783e371d87be15f09f112

diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx
index afe59fd..75bd893 100644
--- a/sc/inc/datauno.hxx
+++ b/sc/inc/datauno.hxx
@@ -494,7 +494,7 @@ public:
 };
 
 
-class ScDatabaseRangeObj : public cppu::WeakImplHelper6<
+class SC_DLLPUBLIC ScDatabaseRangeObj : public cppu::WeakImplHelper6<
                                 com::sun::star::sheet::XDatabaseRange,
                                 com::sun::star::util::XRefreshable,
                                 com::sun::star::container::XNamed,
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 701b2b8..7d6aa77 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -76,6 +76,10 @@
 #include "rangenam.hxx"
 #include "tokenarray.hxx"
 #include "tokenuno.hxx"
+#include "convuno.hxx"
+#include "dbdata.hxx"
+#include "datauno.hxx"
+#include "globalnames.hxx"
 
 #include "formulabuffer.hxx"
 namespace oox {
@@ -464,12 +468,20 @@ Reference< XDatabaseRange > WorkbookGlobals::createUnnamedDatabaseRangeObject( c
 
     // create database range and insert it into the Calc document
     Reference< XDatabaseRange > xDatabaseRange;
-    PropertySet aDocProps( mxDoc );
-    Reference< XUnnamedDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_UnnamedDatabaseRanges ), UNO_QUERY_THROW );
     if( bValidRange ) try
     {
-        xDatabaseRanges->setByTable( aDestRange );
-        xDatabaseRange.set( xDatabaseRanges->getByTable( aDestRange.Sheet ), UNO_QUERY );
+        ScDocument& rDoc =  getScDocument();
+        if( rDoc.GetTableCount() <= aDestRange.Sheet )
+            throw ::com::sun::star::lang::IndexOutOfBoundsException();
+        ScRange aScRange;
+        ScUnoConversion::FillScRange(aScRange, aDestRange);
+        ScDBData* pNewDBData = new ScDBData( STR_DB_LOCAL_NONAME, aScRange.aStart.Tab(),
+                                       aScRange.aStart.Col(), aScRange.aStart.Row(),
+                                       aScRange.aEnd.Col(), aScRange.aEnd.Row() );
+        rDoc.SetAnonymousDBData( aScRange.aStart.Tab() , pNewDBData );
+        ScDocShell* pDocSh = static_cast< ScDocShell* >(rDoc.GetDocumentShell());
+        ScDatabaseRangeObj* pDBRangeObj = new ScDatabaseRangeObj( pDocSh, aScRange.aStart.Tab() );
+        xDatabaseRange.set( pDBRangeObj );
     }
     catch( Exception& )
     {
commit 5d906574f2e7a7c7dd3ba166e3b1a58fdba0d5b8
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Tue Jul 31 06:43:06 2012 -0500

    Prevent broadcasts to gain xlsx formula import performance boost
    
    oox import filter was spending a lot of time in ScFormulaCell::Notify()
    because of unnecessary broadcasts.
    Now the oox import filter will use the same approach
    that the xml import filter uses to prevent this from happening which
    results in shorter import time.
    
    Change-Id: I65e86919f352de0b22916a8d57d3166af0a58984

diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index bf7b955..701b2b8 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -553,6 +553,10 @@ void WorkbookGlobals::initialize( bool bWorkbookFile )
         //! TODO: localize progress bar text
         mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), CREATE_OUSTRING( "Loading..." ) ) );
         mxFmlaParser.reset( new FormulaParser( *this ) );
+
+        //prevent unnecessary broadcasts and "half way listeners" as
+        //is done in ScDocShell::BeforeXMLLoading() for ods
+        getScDocument().SetInsertingFromOtherDoc(true);
     }
     else if( mrBaseFilter.isExportFilter() )
     {
@@ -604,6 +608,10 @@ void WorkbookGlobals::finalize()
         aPropSet.setProperty( PROP_IsChangeReadOnlyEnabled, false );
         // #111099# open forms in alive mode (has no effect, if no controls in document)
         aPropSet.setProperty( PROP_ApplyFormDesignMode, false );
+
+        //stop preventing establishment of listeners as is done in
+        //ScDocShell::AfterXMLLoading() for ods
+        getScDocument().SetInsertingFromOtherDoc(false);
     }
 }
 
commit a96998cdd131e715746db83cc3b08823e4318100
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Thu Jul 12 08:48:40 2012 -0500

    Disable adjust height flag once for whole doc instead for each tab
    
    Change-Id: Ib82a72d257772b3dcdf9368c4ee5850a6f411d6e

diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 4f2ff59..90e68ac 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -2809,8 +2809,6 @@ 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
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index eb28806..d59206a 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -443,9 +443,10 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
     else //still need to recalc volatile formula cells
         DoRecalc(false);
 
+    aDocument.EnableAdjustHeight(false);
+
     aDocument.SetXMLFromWrapper( false );
     AfterXMLLoading(bRet);
-    //! row heights...
 
     return bRet;
 }
commit bed0447cefb949fc77cfde7543397d96590082ba
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date:   Thu Jul 12 08:23:54 2012 -0500

    Check for more cases of functions that should always be recalculated
    
    Thanks to Eike Rathke for pointing this out.
    
    Change-Id: Ie2ce2ebe54cd290a7bf1c55d58790e21833b1105

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 0e34b35..4676cc8 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1101,7 +1101,8 @@ void ScFormulaCell::CompileXML( ScProgress& rProgress )
         pDocument->SetHasMacroFunc( true );
 
     //volatile cells must be added here for import
-    if( pCode->IsRecalcModeAlways() )
+    if( pCode->IsRecalcModeAlways() || pCode->IsRecalcModeForced() ||
+        pCode->IsRecalcModeOnLoad() || pCode->IsRecalcModeOnLoadOnce() )
         pDocument->PutInFormulaTree(this);
 }
 


More information about the Libreoffice-commits mailing list