[Libreoffice-commits] core.git: Branch 'libreoffice-7-0-0' - sw/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 29 18:25:40 UTC 2020
sw/source/filter/ww8/docxexport.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 2e6a8db9a51e5bf0d5056e8ff9af21f7827dd1d9
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Jul 20 14:10:51 2020 +0300
Commit: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Wed Jul 29 20:25:07 2020 +0200
tdf#134973: restore unmodified status of chart on export
Upon first save, the chart model may get modified during export when
accessing subtitle which gets created when not yet existing. That
modified state hadn't been reset previously, when the save was done
in the DocxAttributeOutput::WritePostponedChart.
Prior to 129f55097f926661f00919329fb28c6a85ecebbb, because of double
insertion of the same object, EmbeddedObjectContainer::StoreChildren
stored the duplicate of the chart again (after the "modification"
happened in DocxAttributeOutput::WritePostponedChart), and reset the
status in ChartModel::impl_store. The mentioned commit made the old
problem manifest itself.
Change-Id: Ib6b11bf85fcef93c6d86f7ab5c0e4b0d6508860c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99044
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 346bc3661bfde0c4e000716601a26f91e0bd523f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99051
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
(cherry picked from commit f533b6f9764e96be14aafe4ed125c8ed44a281bc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99063
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 1b8f95f48115..5e9dcc6718e3 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
@@ -385,7 +386,13 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel > const & xModel,
"application/vnd.openxmlformats-officedocument.drawingml.chart+xml" );
oox::drawingml::ChartExport aChartExport(XML_w, pChartFS, xModel, m_pFilter, oox::drawingml::DOCUMENT_DOCX);
+ css::uno::Reference<css::util::XModifiable> xModifiable(xModel, css::uno::UNO_QUERY);
+ const bool bOldModified = xModifiable && xModifiable->isModified();
aChartExport.ExportContent();
+ if (!bOldModified && xModifiable && xModifiable->isModified())
+ // tdf#134973: the model could get modified: e.g., calling XChartDocument::getSubTitle(),
+ // which creates the object if absent, and sets the modified state.
+ xModifiable->setModified(bOldModified);
return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 );
}
More information about the Libreoffice-commits
mailing list