From 2858a6c127557636592487a4c62d2ce56b06f13e89ff4a74b94f50622a871545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 16 Jun 2020 05:56:14 +0000 Subject: [PATCH] Accepting request 814780 from LibreOffice:6.4 - Fix bsc#1172053 - LO-L3: Image disappears during roundtrip 365->Impress->365 * bsc1172053.diff OBS-URL: https://build.opensuse.org/request/show/814780 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=888 --- bsc1172053.diff | 65 +++++++++++++++++++++++++++++++++++++++++++++ libreoffice.changes | 6 +++++ libreoffice.spec | 3 +++ 3 files changed, 74 insertions(+) create mode 100644 bsc1172053.diff diff --git a/bsc1172053.diff b/bsc1172053.diff new file mode 100644 index 0000000..2a66a55 --- /dev/null +++ b/bsc1172053.diff @@ -0,0 +1,65 @@ +From 73e9e4145ba53585a1a3dcdfbc333c36e6bc1ffc Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Wed, 10 Jun 2020 14:51:04 +0200 +Subject: [PATCH] bsc1172053.diff + +PPTX export, custom shape, bitmap fill: fix source vs fill rect confusion + +Commit 682ab832522b1349f1714bcb16f6e83468ea2920 (drawingML +export\import: cropping of shape's fill texture, 2014-02-12) improved +the DOCX filter, so the fill rectangle of a custom shape with bitmap +fill is handled. + +The problem is drawingML has a source rectangle (similar to our crop +rect) to limit the usage of the bitmap, and also it has a fill rectangle +in case some margin is wanted around a stretched bitmap. We don't have a +mapping for the later. + +Fix the problem by limiting the above work for DOCX, this way PPTX's +source rectangle won't be turned into a stretch's fill rectangle. + +This way no unwanted margins will appear around the image -- those +margins can be large enough that the image effectively disappears on +export. + +(cherry picked from commit b00e43fa5848be0cc7ba81b185021511d94cdc00) + +Change-Id: Ic35063545a56eec9eaf885bbd397a854705d134f +--- + oox/source/export/drawingml.cxx | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx +index 468c89ad7b7e..05cd97946341 100644 +--- a/oox/source/export/drawingml.cxx ++++ b/oox/source/export/drawingml.cxx +@@ -1455,6 +1455,12 @@ void DrawingML::WriteXGraphicBlipFill(uno::Reference const + + WriteXGraphicBlip(rXPropSet, rxGraphic, bRelPathToMedia); + ++ if (GetDocumentType() != DOCUMENT_DOCX) ++ { ++ // Write the crop rectangle of Impress as a source rectangle. ++ WriteSrcRectXGraphic(rXPropSet, rxGraphic); ++ } ++ + if (bWriteMode) + { + WriteXGraphicBlipMode(rXPropSet, rxGraphic); +@@ -1550,6 +1556,13 @@ void DrawingML::WriteSrcRectXGraphic(uno::Reference const & + void DrawingML::WriteXGraphicStretch(uno::Reference const & rXPropSet, + uno::Reference const & rxGraphic) + { ++ if (GetDocumentType() != DOCUMENT_DOCX) ++ { ++ // Limiting the area used for stretching is not supported in Impress. ++ mpFS->singleElementNS(XML_a, XML_stretch); ++ return; ++ } ++ + mpFS->startElementNS(XML_a, XML_stretch); + + bool bCrop = false; +-- +2.26.2 + diff --git a/libreoffice.changes b/libreoffice.changes index 47e5f6a..516f9a3 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 15 15:05:08 UTC 2020 - Andras Timar + +- Fix bsc#1172053 - LO-L3: Image disappears during roundtrip 365->Impress->365 + * bsc1172053.diff + ------------------------------------------------------------------- Wed Jun 10 19:18:41 UTC 2020 - Andras Timar diff --git a/libreoffice.spec b/libreoffice.spec index cea9bb5..e0987a1 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -121,6 +121,8 @@ Patch21: bsc1146025.diff Patch22: bsc1157627.diff # Bug 1172189 - LO-L3: Impress crashes midway opening a PPTX document Patch23: bsc1172189.diff +# Bug 1172053 - LO-L3: Image disappears during roundtrip 365->Impress->365 +Patch24: bsc1172053.diff # try to save space by using hardlinks Patch990: install-with-hardlinks.diff # save time by relying on rpm check rather than doing stupid find+grep @@ -993,6 +995,7 @@ Provides %{langname} translations and additional resources (help files, etc.) fo %patch21 -p1 %patch22 -p1 %patch23 -p1 +%patch24 -p1 %patch990 -p1 %patch991 -p1