- Update to 7.1.0.3 * RC3 7.1 series - Update bundled dependencies - New patch use-comphelper.patch to fix build - Rebased patch bsc1177955.diff - Dropped merged patches: * 0001-Upgrade-liborcus-to-0.16.0.patch * bsc1178944.diff * bsc1178943.diff * bsc1178807.diff * bsc1179025.diff OBS-URL: https://build.opensuse.org/request/show/869686 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=941
101 lines
3.3 KiB
Diff
101 lines
3.3 KiB
Diff
From e80fb99133a8edf4c0b03319c7296889b0e52d54 Mon Sep 17 00:00:00 2001
|
|
From: Miklos Vajna <vmiklos@collabora.com>
|
|
Date: Wed, 20 Jan 2021 11:15:34 +0100
|
|
Subject: [PATCH] bsc1177955.diff
|
|
|
|
This is a combination of 2 commits.
|
|
This is the 1st commit message:
|
|
|
|
loplugin:flatten
|
|
|
|
(cherry picked from commit 2d582244680e7f6dec6e4a466e276f93ccb01dc9)
|
|
|
|
This is the commit message #2:
|
|
|
|
oox smartart: composite algo: handle right constraint when left+width is given
|
|
|
|
The bugdoc had this constraint:
|
|
|
|
<dgm:constr type="l" for="ch" forName="text" refType="r" refFor="ch" refForName="img"/>
|
|
|
|
While img has no "r", it has:
|
|
|
|
<dgm:constr type="w" for="ch" forName="img" refType="w" refFor="ch" refForName="box" fact="0.2"/>
|
|
<dgm:constr type="l" for="ch" forName="img" refType="h" refFor="ch" refForName="box" fact="0.1"/>
|
|
|
|
Which is enough to fix the x position of the text to not overlap with
|
|
img.
|
|
|
|
(cherry picked from commit 1359e8c566970fcef860f7ba7f54a07d8e6e0513)
|
|
|
|
Change-Id: I80db290bd1695884ffb7b1eabaffa09462e8883d
|
|
---
|
|
.../drawingml/diagram/diagramlayoutatoms.cxx | 78 ++++++++++++++-----
|
|
1 file changed, 60 insertions(+), 18 deletions(-)
|
|
|
|
Index: libreoffice-7.1.0.3/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
|
|
===================================================================
|
|
--- libreoffice-7.1.0.3.orig/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
|
|
+++ libreoffice-7.1.0.3/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
|
|
@@ -784,6 +784,37 @@ sal_Int32 AlgAtom::getVerticalShapesCoun
|
|
namespace
|
|
{
|
|
/**
|
|
+ * Decides if a certain reference type (e.g. "right") can be inferred from the available properties
|
|
+ * in rMap (e.g. left and width). Returns true if rValue is written to.
|
|
+ */
|
|
+bool InferFromLayoutProperty(const LayoutProperty& rMap, sal_Int32 nRefType, sal_Int32& rValue)
|
|
+{
|
|
+ switch (nRefType)
|
|
+ {
|
|
+ case XML_r:
|
|
+ {
|
|
+ auto it = rMap.find(XML_l);
|
|
+ if (it == rMap.end())
|
|
+ {
|
|
+ return false;
|
|
+ }
|
|
+ sal_Int32 nLeft = it->second;
|
|
+ it = rMap.find(XML_w);
|
|
+ if (it == rMap.end())
|
|
+ {
|
|
+ return false;
|
|
+ }
|
|
+ rValue = nLeft + it->second;
|
|
+ return true;
|
|
+ }
|
|
+ default:
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ return false;
|
|
+}
|
|
+
|
|
+/**
|
|
* Apply rConstraint to the rProperties shared layout state.
|
|
*
|
|
* Note that the order in which constraints are applied matters, given that constraints can refer to
|
|
@@ -803,11 +834,22 @@ void ApplyConstraintToLayout(const Const
|
|
return;
|
|
|
|
const LayoutProperty::const_iterator aRefType = aRef->second.find(rConstraint.mnRefType);
|
|
+ sal_Int32 nInferredValue = 0;
|
|
if (aRefType != aRef->second.end())
|
|
+ {
|
|
+ // Reference is found directly.
|
|
rProperties[rConstraint.msForName][rConstraint.mnType]
|
|
= aRefType->second * rConstraint.mfFactor;
|
|
+ }
|
|
+ else if (InferFromLayoutProperty(aRef->second, rConstraint.mnRefType, nInferredValue))
|
|
+ {
|
|
+ // Reference can be inferred.
|
|
+ rProperties[rConstraint.msForName][rConstraint.mnType]
|
|
+ = nInferredValue * rConstraint.mfFactor;
|
|
+ }
|
|
else
|
|
{
|
|
+ // Reference not found, assume a fixed value.
|
|
// Values are never in EMU, while oox::drawingml::Shape position and size are always in
|
|
// EMU.
|
|
double fUnitFactor = 0;
|