From f9d8fe959d88011d63fc047a8cc00ded1dd2fda1 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 18 Dec 2017 00:48:36 +0100 Subject: clear the data provider cache after import, tdf#111960 This might also fix some problems with normal ODS files and not just with FODS files when we recompile formulas after the whole import. Change-Id: Iec05d2052ca5ce3bdf03abf02d502e4537fd3082 Reviewed-on: https://gerrit.libreoffice.org/46672 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- include/svl/hint.hxx | 1 + sc/source/filter/xml/xmlimprt.cxx | 5 +++++ sc/source/ui/unoobj/chart2uno.cxx | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index 4cee3ba569a9..223151362e6d 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -90,6 +90,7 @@ enum class SfxHintId { ScKillEditViewNoPaint, ScHiddenRowsChanged, ScSelectionChanged, + ScClearCache, // SC accessibility hints ScAccTableChanged, diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 91ebc28bd1cb..0a7f0a44efa8 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1870,6 +1870,11 @@ void SAL_CALL ScXMLImport::endDocument() } SvXMLImport::endDocument(); + if (pDoc) + { + pDoc->BroadcastUno(SfxHint(SfxHintId::ScClearCache)); + } + if(pDoc && bSelfImportingXMLSet) ScModelObj::getImplementation(GetModel())->AfterXMLLoading(); } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 41e248971911..020326a268f7 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2850,6 +2850,11 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint if ( !m_aValueListeners.empty() ) m_bGotDataChangedHint = true; } + else if (nId == SfxHintId::ScClearCache) + { + // necessary after import + m_aDataArray.clear(); + } } } -- cgit