summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-17 15:03:34 +0100
committerAndras Timar <andras.timar@collabora.com>2014-11-23 14:30:27 +0100
commit3c6dc4e5bd99b5b32d4c2f4509682e8ada991f47 (patch)
treea416df02912b7cefd70b50e036972e4d65cdd692 /svx
parentf897304f8237f6b9060ffb953d19d0d5857270cd (diff)
Resolves: fdo#62682 crash on second export of svg
because the first export has left "dangling" CalcFieldValueHdl Links in Outliners that got created based on the Drawing Outliner while it had a temporary CalcFieldValueHdl installed, and didn't get the old CalcFieldValueHdl installed when the old Drawing Outliner one was re-installed. (cherry picked from commit 5bdfa8c12472eb9ff6ca054c2ada7150b1869fff) Change-Id: I064a154ece488c9a4c3467b753451df7e73ae883 Reviewed-on: https://gerrit.libreoffice.org/12009 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/inc/svdoutlinercache.hxx7
-rw-r--r--svx/source/svdraw/svdmodel.cxx11
-rw-r--r--svx/source/svdraw/svdoutlinercache.cxx2
3 files changed, 20 insertions, 0 deletions
diff --git a/svx/source/inc/svdoutlinercache.hxx b/svx/source/inc/svdoutlinercache.hxx
index 6dbf7286c817..03572fc29389 100644
--- a/svx/source/inc/svdoutlinercache.hxx
+++ b/svx/source/inc/svdoutlinercache.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_SOURCE_INC_SVDOUTLINERCACHE_HXX
#include <sal/types.h>
+#include <vector>
class SdrModel;
class SdrOutliner;
@@ -33,12 +34,18 @@ private:
SdrOutliner* mpModeOutline;
SdrOutliner* mpModeText;
+
+ std::vector<SdrOutliner*> maActiveOutliners;
public:
SdrOutlinerCache( SdrModel* pModel );
~SdrOutlinerCache();
SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode );
void disposeOutliner( SdrOutliner* pOutliner );
+ std::vector<SdrOutliner*> GetActiveOutliners() const
+ {
+ return maActiveOutliners;
+ }
};
#endif
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index f3fc337673ea..0735d1449257 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1929,6 +1929,17 @@ SdrOutliner* SdrModel::createOutliner( sal_uInt16 nOutlinerMode )
return mpOutlinerCache->createOutliner( nOutlinerMode );
}
+std::vector<SdrOutliner*> SdrModel::GetActiveOutliners() const
+{
+ std::vector<SdrOutliner*> aRet(mpOutlinerCache ?
+ mpOutlinerCache->GetActiveOutliners() : std::vector<SdrOutliner*>());
+
+ aRet.push_back(pDrawOutliner);
+ aRet.push_back(pHitTestOutliner);
+
+ return aRet;
+}
+
void SdrModel::disposeOutliner( SdrOutliner* pOutliner )
{
if( mpOutlinerCache )
diff --git a/svx/source/svdraw/svdoutlinercache.cxx b/svx/source/svdraw/svdoutlinercache.cxx
index 8f9eba82e52a..810034a55e20 100644
--- a/svx/source/svdraw/svdoutlinercache.cxx
+++ b/svx/source/svdraw/svdoutlinercache.cxx
@@ -49,6 +49,7 @@ SdrOutliner* SdrOutlinerCache::createOutliner( sal_uInt16 nOutlinerMode )
pOutliner = SdrMakeOutliner( nOutlinerMode, mpModel );
Outliner& aDrawOutliner = mpModel->GetDrawOutliner();
pOutliner->SetCalcFieldValueHdl( aDrawOutliner.GetCalcFieldValueHdl() );
+ maActiveOutliners.push_back(pOutliner);
}
return pOutliner;
@@ -95,6 +96,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner )
}
else
{
+ maActiveOutliners.erase(std::remove(maActiveOutliners.begin(), maActiveOutliners.end(), pOutliner), maActiveOutliners.end());
delete pOutliner;
}
}