summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/svdoole2.hxx7
-rw-r--r--svx/source/svdraw/svdetc.cxx4
-rw-r--r--svx/source/svdraw/svdoole2.cxx8
3 files changed, 18 insertions, 1 deletions
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index fb95b8df08b9..6ac1ebac1c99 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -171,6 +171,13 @@ public:
sal_Bool IsChart() const;
sal_Bool IsCalc() const;
+ /**
+ * Unloadable OLE objects are subject to automatic unloading per memory
+ * setting. The "Number of objects" setting in the Memory option controls
+ * how many OLE objects can be loaded at any given moment.
+ */
+ bool IsUnloadable() const;
+
sal_Bool UpdateLinkURL_Impl();
void BreakFileLink_Impl();
void DisconnectFileLink_Impl();
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;