Accepting request 863038 from LibreOffice:7.0

- Fix bsc#1179025 - LO-L3: LibreOffice crashes opening a PPTX
  * bsc1179025.diff

OBS-URL: https://build.opensuse.org/request/show/863038
OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=933
This commit is contained in:
Fridrich Strba 2021-01-14 12:32:36 +00:00 committed by Git OBS Bridge
parent 8aef9d8529
commit 340f468dd9
3 changed files with 52 additions and 0 deletions

43
bsc1179025.diff Normal file
View File

@ -0,0 +1,43 @@
From 9a10330ff8fb0499ed8b0a91563b3c7f62b94096 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.com>
Date: Tue, 12 Jan 2021 10:13:14 +0100
Subject: [PATCH] bsc1179025.diff
oox smartart: fix crash in pyra algorithm with a single child shape
Regression from commit 14a56533ff2c9c859d22cd3039ada75b99e94bc0
(SmartArt Pyramid: Now lays out shapes, 2018-07-10), the added pyramid
algorithm by first centering the topmost children, then decrementing the
horizontal postion of each additional shape, with the end goal of having
0 horizontal position of the last children.
This means that simply avoiding the division in the 1-child case leads
to correct results, because in this case the only child is also the last
child at the sane time.
(cherry picked from commit f2e04fe98e313cffa3f98d55eae641415142a431)
Change-Id: Ifd0027e9616b0909dbfde43e1555427b50de4dad
---
oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 7f926cc9a5e8..24acaf176491 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -1286,7 +1286,10 @@ void AlgAtom::layoutShape(const ShapePtr& rShape, const std::vector<Constraint>&
for (auto & aCurrShape : rShape->getChildren())
{
aCurrShape->setPosition(aCurrPos);
- aCurrPos.X -= aChildSize.Height/(nCount-1);
+ if (nCount > 1)
+ {
+ aCurrPos.X -= aChildSize.Height / (nCount - 1);
+ }
aChildSize.Width += aChildSize.Height;
aCurrShape->setSize(aChildSize);
aCurrShape->setChildSize(aChildSize);
--
2.26.2

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 14 08:44:52 UTC 2021 - Andras Timar <andras.timar@collabora.com>
- Fix bsc#1179025 - LO-L3: LibreOffice crashes opening a PPTX
* bsc1179025.diff
-------------------------------------------------------------------
Tue Jan 12 10:32:53 UTC 2021 - Andras Timar <andras.timar@collabora.com>

View File

@ -106,6 +106,8 @@ Patch6: bsc1178943.diff
Patch7: icu68.patch
# Bug 1178807 - LO-L3: Text box from PowerPoint renders vertically instead of horizontally
Patch8: bsc1178807.diff
# Bug 1179025 - LO-L3: LibreOffice crashes opening a PPTX
Patch9: bsc1179025.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
@ -968,6 +970,7 @@ Provides %{langname} translations and additional resources (help files, etc.) fo
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch990 -p1
%patch991 -p1