diff options
| -rw-r--r-- | chart2/qa/extras/charttest.hxx | 6 | ||||
| -rw-r--r-- | chart2/source/model/main/ChartModel_Persistence.cxx | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx index 156893cd2cb5..bcd1f101189d 100644 --- a/chart2/qa/extras/charttest.hxx +++ b/chart2/qa/extras/charttest.hxx @@ -29,6 +29,7 @@ #include <unotools/tempfile.hxx> #include <rtl/math.hxx> +#include <svx/charthelper.hxx> #include <com/sun/star/chart2/XAnyDescriptionAccess.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> @@ -204,6 +205,11 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > const & xComponent ) { uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW ); + + // Update the chart view, so that its draw page is updated and ready for the test + css::uno::Reference<css::frame::XModel> xModel(xChartDoc, css::uno::UNO_QUERY_THROW); + ChartHelper::updateChart(xModel); + return xChartDoc; } diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index 313b472be0d7..c505da695e73 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -57,6 +57,7 @@ #include <vcl/svapp.hxx> #include <tools/diagnose_ex.h> #include <sal/log.hxx> +#include <sfx2/objsh.hxx> #include <algorithm> @@ -668,6 +669,12 @@ sal_Bool SAL_CALL ChartModel::isModified() void SAL_CALL ChartModel::setModified( sal_Bool bModified ) { + // tdf#77007: honor parent's IsEnableSetModified + // Check it before LifeTimeGuard, to avoid deadlocking solar mutex and this guard + if (auto pParentShell = SfxObjectShell::GetShellFromComponent(getParent()); + pParentShell && !pParentShell->IsEnableSetModified()) + return; + apphelper::LifeTimeGuard aGuard(m_aLifeTimeManager); if(!aGuard.startApiCall())//@todo ? is this a long lasting call?? return; //behave passive if already disposed or closed or throw exception @todo? |
