summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdoole2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdoole2.cxx')
-rw-r--r--svx/source/svdraw/svdoole2.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index f68f5d795623..f1f27a833371 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/embed/XEmbedPersist2.hpp>
#include <com/sun/star/embed/XInplaceClient.hpp>
#include <com/sun/star/embed/XInplaceObject.hpp>
#include <com/sun/star/embed/XLinkageSupport.hpp>
@@ -1926,6 +1927,14 @@ void SdrOle2Obj::NbcMove(const Size& rSize)
sal_Bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
{
+ uno::Reference<embed::XEmbedPersist2> xPersist(xObj, uno::UNO_QUERY);
+ if (xPersist.is())
+ {
+ if (!xPersist->isStored())
+ // It doesn't have persistent storage. We can't unload this.
+ return false;
+ }
+
sal_Bool bResult = sal_False;
sal_Int32 nState = xObj->getCurrentState();
@@ -2159,13 +2168,6 @@ sal_Bool SdrOle2Obj::IsCalc() const
return sal_False;
}
-bool SdrOle2Obj::IsUnloadable() const
-{
- // Right now, chart OLE objects are the only ones exempt from automatic
- // unloading.
- return !IsChart();
-}
-
uno::Reference< frame::XModel > SdrOle2Obj::GetParentXModel() const
{
uno::Reference< frame::XModel > xDoc;