diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-13 21:34:28 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-13 23:32:16 +0200 |
commit | 3e6e2f8db74a699699767344236f043b87ae5dd7 (patch) | |
tree | 61919462e966b114c51e65d97d7f7aefd11064d8 /sc | |
parent | 5e9178f765b327a8aba17476d135ba3b1f881bf7 (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>
Diffstat (limited to 'sc')
-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 29f8af4d849d..2c0f1318fc63 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -817,6 +817,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 bExternalDocument = false ); bool MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress = nullptr ); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 4e6df253e358..79ee0a96fb63 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -773,6 +773,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 f96fb9f3373f..b7a68d40a711 100644 --- a/sc/source/filter/orcus/orcusfiltersimpl.cxx +++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx @@ -102,6 +102,7 @@ bool ScOrcusFiltersImpl::importGnumeric(ScDocument& rDoc, SfxMedium& rMedium) co try { + rDoc.ClearTabs(); orcus::orcus_gnumeric filter(&aFactory); filter.read_stream(aBuffer.getStr(), aBuffer.getLength()); } |