diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-13 21:34:28 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-29 17:13:39 +0200 |
commit | a45fedeb9e7ae451b3b719e7830108ee7aff03b9 (patch) | |
tree | 7a2d0d92e54da8f8c4d2ba6ea757c502b62d2ce9 | |
parent | 75cb0e8e5654b1a82b687c117b940ad49127ad8e (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>
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/orcus/orcusfiltersimpl.cxx | 1 |
3 files changed, 11 insertions, 0 deletions
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); } |