[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sc/inc sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Mon May 29 15:14:09 UTC 2017


 sc/inc/document.hxx                         |    1 +
 sc/source/core/data/document.cxx            |    9 +++++++++
 sc/source/filter/orcus/orcusfiltersimpl.cxx |    1 +
 3 files changed, 11 insertions(+)

New commits:
commit a45fedeb9e7ae451b3b719e7830108ee7aff03b9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat May 13 21:34:28 2017 +0200

    use empty document in orcus gnumeric import, tdf#107828
    
    Change-Id: Ia7ee2de6f9b14a132a29c01f8d863889477c0a8d
    Reviewed-on: https://gerrit.libreoffice.org/37579
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-on: https://gerrit.libreoffice.org/37659
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 10ce2e2f750a..f5f9f0387174 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -808,6 +808,7 @@ public:
                                             bool bNamesValid = false );
     SC_DLLPUBLIC bool DeleteTabs( SCTAB nTab, SCTAB nSheets );
     SC_DLLPUBLIC bool DeleteTab( SCTAB nTab );
+    SC_DLLPUBLIC void           ClearTabs();
     SC_DLLPUBLIC bool           RenameTab( SCTAB nTab, const OUString& rName,
                                 bool bUpdateRef = true,
                                 bool bExternalDocument = false );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index ee69a89cc3f8..931d44a550d1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -774,6 +774,15 @@ bool ScDocument::DeleteTab( SCTAB nTab )
     return bValid;
 }
 
+void ScDocument::ClearTabs()
+{
+    for (auto& it: maTabs)
+    {
+        delete it;
+    }
+    maTabs.clear();
+}
+
 bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
 {
     bool bValid = false;
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index 66a9ca29efab..b38926aa7a0d 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -93,6 +93,7 @@ bool ScOrcusFiltersImpl::importGnumeric(ScDocument& rDoc, SfxMedium& rMedium) co
 
     try
     {
+        rDoc.ClearTabs();
         orcus::orcus_gnumeric filter(&aFactory);
         filter.read_file(path);
     }


More information about the Libreoffice-commits mailing list