summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-11 10:50:29 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-07-21 08:54:22 +0000
commit65a41146af0c3c86de5c530446719e75f2c5512e (patch)
tree2dc57ff12a66084ebf4ad1f1dd1b6c766c890f7d /svx
parenta68dbdd334f9e653eb7e4db934055d32be506537 (diff)
bnc#883684: Better fix for this.
Instead of making all chart objects exempt from unloading, check each OLE object on whether or not it already has its persistent storage created. If not, don't unload it else it would have nothing to load back from once unloaded. (cherry picked from commit a0bd5587a5ac62974bdb10731d3fd21584521a72) Conflicts: svx/source/svdraw/svdetc.cxx Change-Id: I2312e86c9376d3699ef4aa1e0cf2f4c04f706c1e Reviewed-on: https://gerrit.libreoffice.org/10237 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdetc.cxx4
-rw-r--r--svx/source/svdraw/svdoole2.cxx16
2 files changed, 9 insertions, 11 deletions
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 3214a329a9d0..a9cb9498998d 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -166,10 +166,6 @@ void OLEObjCache::UnloadOnDemand()
void OLEObjCache::InsertObj(SdrOle2Obj* pObj)
{
- if (!pObj->IsUnloadable())
- // This OLE object is exempt from automatic unloading.
- return;
-
if ( !empty() )
{
SdrOle2Obj* pExistingObj = front();
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 889f3ed19ae2..3ef566cd483e 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>
@@ -1929,6 +1930,14 @@ void SdrOle2Obj::NbcMove(const Size& rSize)
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;
+ }
+
bool bResult = false;
sal_Int32 nState = xObj->getCurrentState();
@@ -2162,13 +2171,6 @@ bool SdrOle2Obj::IsCalc() const
return 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;