summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-13 21:34:28 +0200
committerAndras Timar <andras.timar@collabora.com>2017-05-30 10:19:51 +0200
commit035f9cbb0b7b38c21e3f353cbbe4a7c975384f18 (patch)
tree7ec9713227d1b838c0c6bc62944f483d0b7ff641
parentdb243920bf17263a88005bdfcd4fd35578f7f6c4 (diff)
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@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-on: https://gerrit.libreoffice.org/37659 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit a45fedeb9e7ae451b3b719e7830108ee7aff03b9)
-rw-r--r--sc/inc/document.hxx1
-rw-r--r--sc/source/core/data/document.cxx9
-rw-r--r--sc/source/filter/orcus/orcusfiltersimpl.cxx1
3 files changed, 11 insertions, 0 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6db9ab6d616e..911e441a0d14 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -812,6 +812,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);
}