summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-10-16 15:22:17 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-10-16 18:27:49 +0200
commitf26bf09a0e93449ea85269a09a8a073a20903349 (patch)
tree0e7071c1bfd3c5f5fe4adb47a81cdf2b037db28c /xmloff
parent6506279e3bed2284ce0ec9a0957a0201eb0d72ae (diff)
tdf#141892: Set chart view to dirty state after loading
Previously, ChartViewHelper::setViewToDirtyState was only called in ChartModel::impl_notifyModifiedListeners during the load process of inline charts; after commit 574eec9036c5f185b3572ba1e0ca9d111eb361dc, the chart doesn't set its modified state when loading, and thus the view did not get notified about the necessary updates. This change introduces a hidden property in ChartDocumentWrapper, named 'ODFImport_UpdateView', which is set in SchXMLImport dtor to force the notification after the loading. Change-Id: Id9d82f16d233d2172cd6808a8498822e13b21b21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158051 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 945fe62c63e3..52f0ea4207dd 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -253,8 +253,26 @@ SchXMLImport::SchXMLImport(
SchXMLImport::~SchXMLImport() noexcept
{
uno::Reference< chart2::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
- if( xChartDoc.is() && xChartDoc->hasControllersLocked() )
- xChartDoc->unlockControllers();
+ if (xChartDoc.is())
+ {
+ if (xChartDoc->hasControllersLocked())
+ xChartDoc->unlockControllers();
+ if (auto xPropSet = xChartDoc.query<beans::XPropertySet>())
+ {
+ try
+ {
+ // The view of the chart might not received a notification about the updates,
+ // which is only sent when the chart model is set modified; during the load,
+ // setting modified is disabled. So, the view needs an explicit notification.
+ // See ChartDocumentWrapper::setPropertyValue
+ xPropSet->setPropertyValue(u"ODFImport_UpdateView"_ustr, css::uno::Any(xChartDoc));
+ }
+ catch (css::beans::UnknownPropertyException&)
+ {
+ // That's absolutely fine!
+ }
+ }
+ }
}
// create the main context (subcontexts are created