summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdetc.cxx4
-rw-r--r--svx/source/svdraw/svdoole2.cxx8
2 files changed, 11 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 4caca9417a72..afcc792aa992 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -165,6 +165,10 @@ 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 a0f0c33da7d2..4a7ecf00303e 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -2171,7 +2171,13 @@ 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;