diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-09 21:46:34 -0400 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-07-10 05:04:38 +0000 |
commit | 2ced18a6e90e3c9494e48994af39c5d710188c44 (patch) | |
tree | e91800849311f584d78762d4d0d0ed36c835f74f /svx | |
parent | cd8acfacdc02dc6dbfc6a73ef64c5bec8eefebf4 (diff) |
bnc#883684: Make chart objects exempt from automatic unloading.
The Memory option page contains "Number of objects" setting which controls
how many OLE objects can be loaded at any given time. When the number of
total OLE objects exceeds this number the oldest ones get unloaded. Note
that the total number is across all open documents, not per document.
Technically, chart objects are OLE objects, but unlike other OLE objects
that are embedded Calc, Writer, Draw documents, chart objects normally
"belong" to the host document. It therefore makes no sense to subject
chart objects to this automatic unloading.
In the future we may want to apply this exemption to other types of OLE
objects, like formula objects for example.. Or maybe this setting can be
removed altogether...
(cherry picked from commit b023565d4f064cd0312e8c1fcc23a9f552112935)
Conflicts:
svx/source/svdraw/svdetc.cxx
Change-Id: I7dd92550880efb4db8fc843cf1c915c712166da4
Reviewed-on: https://gerrit.libreoffice.org/10179
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdoole2.cxx | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index a9cb9498998d..3214a329a9d0 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -166,6 +166,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 86379ce7f8fd..889f3ed19ae2 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -2162,6 +2162,12 @@ 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 { |