[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - 6 commits - cui/source cui/uiconfig include/svtools officecfg/registry oox/source sc/inc sc/source sd/qa sd/source svtools/source
Szymon Kłos
szymon.klos at collabora.com
Tue Mar 27 13:04:12 UTC 2018
cui/source/options/optcolor.cxx | 4
cui/uiconfig/ui/colorconfigwin.ui | 236 ++++++++++++----
include/svtools/colorcfg.hxx | 4
officecfg/registry/data/org/openoffice/Office/UI.xcu | 20 +
officecfg/registry/schema/org/openoffice/Office/UI.xcs | 40 ++
oox/source/ppt/animationspersist.cxx | 10
sc/inc/global.hxx | 2
sc/source/core/data/global.cxx | 4
sc/source/ui/view/output.cxx | 23 +
sd/qa/unit/data/odp/tdf90627.odp |binary
sd/qa/unit/data/pptx/tdf104786.pptx |binary
sd/qa/unit/data/pptx/tdf104789.pptx |binary
sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx |binary
sd/qa/unit/data/pptx/tdf84205.pptx |binary
sd/qa/unit/export-tests-ooxml2.cxx | 75 +++++
sd/source/filter/eppt/epptooxml.hxx | 6
sd/source/filter/eppt/pptx-epptooxml.cxx | 157 +++++-----
svtools/source/config/colorcfg.cxx | 8
18 files changed, 445 insertions(+), 144 deletions(-)
New commits:
commit 1cf9fcc723041ceb97dc637de658f3486a755edf
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Fri Mar 23 18:43:54 2018 +0100
tdf#116241 Customizing value highlighting colors
Available in: Tools->Options->Application colors
Change-Id: I6e4f7a0dcad9a6ee222275019596853f0cbd3ab0
Reviewed-on: https://gerrit.libreoffice.org/51791
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51943
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit a99998525242d7d3ee48bece6ea699814fd4433f)
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 1d962bddbd3b..8b9e0a5d6d1b 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -141,6 +141,10 @@ const vEntryInfo[] =
{ Group_Calc, IDS(deterror) },
{ Group_Calc, IDS(ref) },
{ Group_Calc, IDS(notes) },
+ { Group_Calc, IDS(values) },
+ { Group_Calc, IDS(formulas) },
+ { Group_Calc, IDS(text) },
+ { Group_Calc, IDS(protectedcells) },
{ Group_Draw, IDS(drawgrid) },
diff --git a/cui/uiconfig/ui/colorconfigwin.ui b/cui/uiconfig/ui/colorconfigwin.ui
index 6c8dd3f6aedb..da4c64715967 100644
--- a/cui/uiconfig/ui/colorconfigwin.ui
+++ b/cui/uiconfig/ui/colorconfigwin.ui
@@ -1138,6 +1138,146 @@
</packing>
</child>
<child>
+ <object class="svxcorelo-SvxColorListBox" id="values_lb">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">35</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="values">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Values</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">35</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="values_wn:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">6</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">35</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svxcorelo-SvxColorListBox" id="formulas_lb">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">36</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="formulas">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Formulas</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">36</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="formulas_wn:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">6</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">36</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svxcorelo-SvxColorListBox" id="text_lb">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">37</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="text">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Text</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">37</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="text_wn:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">6</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">37</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svxcorelo-SvxColorListBox" id="protectedcells_lb">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">38</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="protectedcells">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Protected cells background</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">38</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkDrawingArea" id="protectedcells_wn:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">6</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">38</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="draw">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -1149,7 +1289,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">35</property>
+ <property name="top_attach">39</property>
<property name="width">3</property>
</packing>
</child>
@@ -1160,7 +1300,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">36</property>
+ <property name="top_attach">40</property>
</packing>
</child>
<child>
@@ -1173,7 +1313,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">36</property>
+ <property name="top_attach">40</property>
</packing>
</child>
<child>
@@ -1185,7 +1325,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">36</property>
+ <property name="top_attach">40</property>
</packing>
</child>
<child>
@@ -1200,7 +1340,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">37</property>
+ <property name="top_attach">41</property>
<property name="width">3</property>
</packing>
</child>
@@ -1211,7 +1351,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">38</property>
+ <property name="top_attach">42</property>
</packing>
</child>
<child>
@@ -1224,7 +1364,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">38</property>
+ <property name="top_attach">42</property>
</packing>
</child>
<child>
@@ -1236,7 +1376,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">38</property>
+ <property name="top_attach">42</property>
</packing>
</child>
<child>
@@ -1246,7 +1386,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">39</property>
+ <property name="top_attach">43</property>
</packing>
</child>
<child>
@@ -1259,7 +1399,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">39</property>
+ <property name="top_attach">43</property>
</packing>
</child>
<child>
@@ -1271,7 +1411,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">39</property>
+ <property name="top_attach">43</property>
</packing>
</child>
<child>
@@ -1281,7 +1421,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">40</property>
+ <property name="top_attach">44</property>
</packing>
</child>
<child>
@@ -1294,7 +1434,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">40</property>
+ <property name="top_attach">44</property>
</packing>
</child>
<child>
@@ -1306,7 +1446,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">40</property>
+ <property name="top_attach">44</property>
</packing>
</child>
<child>
@@ -1316,7 +1456,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">41</property>
+ <property name="top_attach">45</property>
</packing>
</child>
<child>
@@ -1329,7 +1469,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">41</property>
+ <property name="top_attach">45</property>
</packing>
</child>
<child>
@@ -1341,7 +1481,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">41</property>
+ <property name="top_attach">45</property>
</packing>
</child>
<child>
@@ -1351,7 +1491,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">42</property>
+ <property name="top_attach">46</property>
</packing>
</child>
<child>
@@ -1364,7 +1504,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">42</property>
+ <property name="top_attach">46</property>
</packing>
</child>
<child>
@@ -1376,7 +1516,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">42</property>
+ <property name="top_attach">46</property>
</packing>
</child>
<child>
@@ -1386,7 +1526,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">43</property>
+ <property name="top_attach">47</property>
</packing>
</child>
<child>
@@ -1399,7 +1539,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">43</property>
+ <property name="top_attach">47</property>
</packing>
</child>
<child>
@@ -1411,7 +1551,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">43</property>
+ <property name="top_attach">47</property>
</packing>
</child>
<child>
@@ -1421,7 +1561,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">44</property>
+ <property name="top_attach">48</property>
</packing>
</child>
<child>
@@ -1434,7 +1574,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">44</property>
+ <property name="top_attach">48</property>
</packing>
</child>
<child>
@@ -1446,7 +1586,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">44</property>
+ <property name="top_attach">48</property>
</packing>
</child>
<child>
@@ -1461,7 +1601,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">45</property>
+ <property name="top_attach">49</property>
<property name="width">3</property>
</packing>
</child>
@@ -1472,7 +1612,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">46</property>
+ <property name="top_attach">50</property>
</packing>
</child>
<child>
@@ -1485,7 +1625,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">46</property>
+ <property name="top_attach">50</property>
</packing>
</child>
<child>
@@ -1497,7 +1637,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">46</property>
+ <property name="top_attach">50</property>
</packing>
</child>
<child>
@@ -1507,7 +1647,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">47</property>
+ <property name="top_attach">51</property>
</packing>
</child>
<child>
@@ -1520,7 +1660,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">47</property>
+ <property name="top_attach">51</property>
</packing>
</child>
<child>
@@ -1532,7 +1672,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">47</property>
+ <property name="top_attach">51</property>
</packing>
</child>
<child>
@@ -1542,7 +1682,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">48</property>
+ <property name="top_attach">52</property>
</packing>
</child>
<child>
@@ -1555,7 +1695,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">48</property>
+ <property name="top_attach">52</property>
</packing>
</child>
<child>
@@ -1567,7 +1707,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">48</property>
+ <property name="top_attach">52</property>
</packing>
</child>
<child>
@@ -1577,7 +1717,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">49</property>
+ <property name="top_attach">53</property>
</packing>
</child>
<child>
@@ -1590,7 +1730,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">49</property>
+ <property name="top_attach">53</property>
</packing>
</child>
<child>
@@ -1602,7 +1742,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">49</property>
+ <property name="top_attach">53</property>
</packing>
</child>
<child>
@@ -1612,7 +1752,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">50</property>
+ <property name="top_attach">54</property>
</packing>
</child>
<child>
@@ -1625,7 +1765,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">50</property>
+ <property name="top_attach">54</property>
</packing>
</child>
<child>
@@ -1637,7 +1777,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">50</property>
+ <property name="top_attach">54</property>
</packing>
</child>
<child>
@@ -1647,7 +1787,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">51</property>
+ <property name="top_attach">55</property>
</packing>
</child>
<child>
@@ -1660,7 +1800,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">51</property>
+ <property name="top_attach">55</property>
</packing>
</child>
<child>
@@ -1672,7 +1812,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">51</property>
+ <property name="top_attach">55</property>
</packing>
</child>
<child>
@@ -1682,7 +1822,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">52</property>
+ <property name="top_attach">56</property>
</packing>
</child>
<child>
@@ -1695,7 +1835,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">52</property>
+ <property name="top_attach">56</property>
</packing>
</child>
<child>
@@ -1707,7 +1847,7 @@
</object>
<packing>
<property name="left_attach">2</property>
- <property name="top_attach">52</property>
+ <property name="top_attach">56</property>
</packing>
</child>
<child>
diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
index ad3672d7b83b..083c27cdafa8 100644
--- a/include/svtools/colorcfg.hxx
+++ b/include/svtools/colorcfg.hxx
@@ -61,6 +61,10 @@ enum ColorConfigEntry
CALCDETECTIVEERROR ,
CALCREFERENCE ,
CALCNOTESBACKGROUND ,
+ CALCVALUE,
+ CALCFORMULA,
+ CALCTEXT,
+ CALCPROTECTEDBACKGROUND,
DRAWGRID ,
BASICIDENTIFIER,
BASICCOMMENT ,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI.xcu b/officecfg/registry/data/org/openoffice/Office/UI.xcu
index 64891ace70df..bd18173a1ec8 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI.xcu
@@ -323,6 +323,26 @@
<value xsi:nil="true"/>
</prop>
</node>
+ <node oor:name="CalcValue">
+ <prop oor:name="Color">
+ <value xsi:nil="true"/>
+ </prop>
+ </node>
+ <node oor:name="CalcFormula">
+ <prop oor:name="Color">
+ <value xsi:nil="true"/>
+ </prop>
+ </node>
+ <node oor:name="CalcText">
+ <prop oor:name="Color">
+ <value xsi:nil="true"/>
+ </prop>
+ </node>
+ <node oor:name="CalcProtectedBackground">
+ <prop oor:name="Color">
+ <value xsi:nil="true"/>
+ </prop>
+ </node>
<node oor:name="DrawGrid">
<prop oor:name="IsVisible">
<value>true</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI.xcs b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
index bb3d53ca5266..64c0188ada5b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI.xcs
@@ -410,6 +410,46 @@
</info>
</prop>
</group>
+ <group oor:name="CalcValue">
+ <info>
+ <desc>Specifies the settings used for values in Calc.</desc>
+ </info>
+ <prop oor:name="Color" oor:type="xs:int">
+ <info>
+ <desc>Specifies the color used for values.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="CalcFormula">
+ <info>
+ <desc>Specifies the settings used for formulas in Calc.</desc>
+ </info>
+ <prop oor:name="Color" oor:type="xs:int">
+ <info>
+ <desc>Specifies the color used for formulas.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="CalcText">
+ <info>
+ <desc>Specifies the settings used for the text in Calc.</desc>
+ </info>
+ <prop oor:name="Color" oor:type="xs:int">
+ <info>
+ <desc>Specifies the color used for the text.</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="CalcProtectedBackground">
+ <info>
+ <desc>Specifies the settings used for the background of protected cells in Calc.</desc>
+ </info>
+ <prop oor:name="Color" oor:type="xs:int">
+ <info>
+ <desc>Specifies the color used for the background of protected cells.</desc>
+ </info>
+ </prop>
+ </group>
<group oor:name="DrawGrid">
<info>
<desc>Specifies the settings used for the grid in Draw/Impress.</desc>
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 78ea62923445..77907e730713 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -518,7 +518,6 @@ class ScGlobal
static SvxBrushItem* pEmptyBrushItem;
static SvxBrushItem* pButtonBrushItem;
static SvxBrushItem* pEmbeddedBrushItem;
- static SvxBrushItem* pProtectedBrushItem;
static ImageList* pOutlineBitmaps;
@@ -601,7 +600,6 @@ public:
static void InitTextHeight(SfxItemPool* pPool);
static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; }
static SvxBrushItem* GetButtonBrushItem();
- static SvxBrushItem* GetProtectedBrushItem() { return pProtectedBrushItem; }
SC_DLLPUBLIC static const OUString& GetEmptyOUString();
/** Returns the specified image list with outline symbols. */
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index b16a656981ab..fc434c0a97a4 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -45,6 +45,7 @@
#include <ctype.h>
#include <numeric>
#include <svx/svdmodel.hxx>
+#include <svtools/colorcfg.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <com/sun/star/lang/Locale.hpp>
@@ -109,7 +110,6 @@ OUString* ScGlobal::pStrClipDocName = nullptr;
SvxBrushItem* ScGlobal::pEmptyBrushItem = nullptr;
SvxBrushItem* ScGlobal::pButtonBrushItem = nullptr;
SvxBrushItem* ScGlobal::pEmbeddedBrushItem = nullptr;
-SvxBrushItem* ScGlobal::pProtectedBrushItem = nullptr;
ImageList* ScGlobal::pOutlineBitmaps = nullptr;
@@ -509,7 +509,6 @@ void ScGlobal::Init()
pEmptyBrushItem = new SvxBrushItem( Color( COL_TRANSPARENT ), ATTR_BACKGROUND );
pButtonBrushItem = new SvxBrushItem( Color(), ATTR_BACKGROUND );
pEmbeddedBrushItem = new SvxBrushItem( Color( COL_LIGHTCYAN ), ATTR_BACKGROUND );
- pProtectedBrushItem = new SvxBrushItem( Color( COL_LIGHTGRAY ), ATTR_BACKGROUND );
InitPPT();
//ScCompiler::InitSymbolsNative();
@@ -609,7 +608,6 @@ void ScGlobal::Clear()
DELETEZ(pEmptyBrushItem);
DELETEZ(pButtonBrushItem);
DELETEZ(pEmbeddedBrushItem);
- DELETEZ(pProtectedBrushItem);
DELETEZ(pOutlineBitmaps);
DELETEZ(pEnglishFormatter);
DELETEZ(pCaseTransliteration);
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 78d351ba3a51..56cdf6b4a2d6 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -298,12 +298,13 @@ void ScOutputData::SetSingleGrid( bool bNewMode )
void ScOutputData::SetSyntaxMode( bool bNewMode )
{
mbSyntaxMode = bNewMode;
- if (bNewMode)
- if (!pValueColor)
+ if ( bNewMode )
+ if ( !pValueColor )
{
- pValueColor = new Color( COL_LIGHTBLUE );
- pTextColor = new Color( COL_BLACK );
- pFormulaColor = new Color( COL_GREEN );
+ const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
+ pValueColor = new Color( rColorCfg.GetColorValue( svtools::CALCVALUE ).nColor );
+ pTextColor = new Color( rColorCfg.GetColorValue( svtools::CALCTEXT ).nColor );
+ pFormulaColor = new Color( rColorCfg.GetColorValue( svtools::CALCFORMULA ).nColor );
}
}
@@ -1001,6 +1002,12 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
Application::GetSettings().GetStyleSettings().GetHighContrastMode();
long nPosY = nScrY;
+
+ const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
+ Color aProtectedColor( rColorCfg.GetColorValue( svtools::CALCPROTECTEDBACKGROUND ).nColor );
+ std::shared_ptr<SvxBrushItem> pProtectedBackground( new SvxBrushItem( aProtectedColor, ATTR_BACKGROUND ) );
+
+ // iterate through the rows to show
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
@@ -1034,7 +1041,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
aRect = rRenderContext.PixelToLogic(aRect); // internal data in pixels, but we'll be drawing in logic units
const SvxBrushItem* pOldBackground = nullptr;
- const SvxBrushItem* pBackground;
+ const SvxBrushItem* pBackground = nullptr;
const Color* pOldColor = nullptr;
const ScDataBarInfo* pOldDataBarInfo = nullptr;
const ScIconSetInfo* pOldIconSetInfo = nullptr;
@@ -1060,7 +1067,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
const ScProtectionAttr& rProt = static_cast<const ScProtectionAttr&>(
pP->GetItem(ATTR_PROTECTION));
if (rProt.GetProtection() || rProt.GetHideCell())
- pBackground = ScGlobal::GetProtectedBrushItem();
+ pBackground = pProtectedBackground.get();
else
pBackground = ScGlobal::GetEmptyBrushItem();
}
@@ -1071,7 +1078,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
pBackground = pInfo->pBackground;
if ( bPagebreakMode && !pInfo->bPrinted )
- pBackground = ScGlobal::GetProtectedBrushItem();
+ pBackground = pProtectedBackground.get();
if ( pInfo->nRotateDir > ScRotateDir::Standard &&
pBackground->GetColor().GetTransparency() != 255 &&
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx
index d48f7cca6eee..ac21cf793613 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -146,6 +146,10 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
{ RTL_CONSTASCII_USTRINGPARAM("/CalcDetectiveError") ,false },
{ RTL_CONSTASCII_USTRINGPARAM("/CalcReference") ,false },
{ RTL_CONSTASCII_USTRINGPARAM("/CalcNotesBackground") ,false },
+ { RTL_CONSTASCII_USTRINGPARAM("/CalcValue") ,false },
+ { RTL_CONSTASCII_USTRINGPARAM("/CalcFormula") ,false },
+ { RTL_CONSTASCII_USTRINGPARAM("/CalcText") ,false },
+ { RTL_CONSTASCII_USTRINGPARAM("/CalcProtectedBackground") ,false },
{ RTL_CONSTASCII_USTRINGPARAM("/DrawGrid") ,true },
{ RTL_CONSTASCII_USTRINGPARAM("/BASICIdentifier"), false },
{ RTL_CONSTASCII_USTRINGPARAM("/BASICComment") , false },
@@ -434,6 +438,10 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
COL_LIGHTRED, // CALCDETECTIVEERROR
0xef0fff, // CALCREFERENCE
0xffffc0, // CALCNOTESBACKGROUND
+ COL_LIGHTBLUE, // CALCVALUE
+ COL_GREEN, // CALCFORMULA
+ COL_BLACK, // CALCTEXT
+ COL_LIGHTGRAY, // CALCPROTECTEDBACKGROUND
COL_LIGHTGRAY, // DRAWGRID
COL_GREEN, // BASICIDENTIFIER,
COL_GRAY, // BASICCOMMENT,
commit 0ddb4d18079fa6ceb60e0b8a35125b0b811a877d
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Fri Mar 16 21:35:01 2018 +0100
tdf#84205 If theme not found, use first
Not a complete fix, workaround.
Change-Id: If4d765eaeae3419f4f1deb4e1cfbe0113a71da94
Reviewed-on: https://gerrit.libreoffice.org/51440
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51458
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 586d56208861135e6548a4d73961e64cd3df5d68)
diff --git a/sd/qa/unit/data/pptx/tdf84205.pptx b/sd/qa/unit/data/pptx/tdf84205.pptx
new file mode 100644
index 000000000000..211cea6d0251
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf84205.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 288b0fe192bd..5315f3558001 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -124,6 +124,7 @@ public:
void testGroupsPosition();
void testGroupsRotatedPosition();
void testAccentColor();
+ void testThemeColors();
void testTdf114848();
void testFontScale();
void testTdf115394();
@@ -178,6 +179,7 @@ public:
CPPUNIT_TEST(testGroupsPosition);
CPPUNIT_TEST(testGroupsRotatedPosition);
CPPUNIT_TEST(testAccentColor);
+ CPPUNIT_TEST(testThemeColors);
CPPUNIT_TEST(testTdf114848);
CPPUNIT_TEST(testFontScale);
CPPUNIT_TEST(testTdf115394);
@@ -1119,6 +1121,18 @@ void SdOOXMLExportTest2::testAccentColor()
assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", "deb340");
}
+void SdOOXMLExportTest2::testThemeColors()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf84205.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xDocShRef->DoClose();
+
+ xmlDocPtr pXmlDocTheme2 = parseExport(tempFile, "ppt/theme/theme2.xml");
+ assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a");
+ assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", "a5a5a5");
+}
+
void SdOOXMLExportTest2::testTdf114848()
{
::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf114848.pptx"), PPTX);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 76de6d0d9bfb..af973f30738b 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2652,8 +2652,12 @@ void PowerPointExport::WriteTheme( sal_Int32 nThemeNum )
if (!WriteColorSchemes(pFS, sThemePath))
{
- // color schemes are required - use default values
- WriteDefaultColorSchemes(pFS);
+ // if style is not defined, try to use first one
+ if (!WriteColorSchemes(pFS, "ppt/theme/theme1.xml"))
+ {
+ // color schemes are required - use default values
+ WriteDefaultColorSchemes(pFS);
+ }
}
pFS->endElementNS(XML_a, XML_clrScheme);
commit 26d2c0c3117d565f2b8b6e634bf683a3acc64650
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Thu Mar 15 19:23:20 2018 +0100
tdf#104789 Export opacity attribute name
Change-Id: Id47ab6b3cb20fbcebb2d7fa589f3b0d7552e2cce
Reviewed-on: https://gerrit.libreoffice.org/51369
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51457
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 63f6174b67a7e731389d477e0856b64478e6511d)
diff --git a/sd/qa/unit/data/pptx/tdf104789.pptx b/sd/qa/unit/data/pptx/tdf104789.pptx
new file mode 100644
index 000000000000..d5ead6a931a7
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104789.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 16c0e55c43be..288b0fe192bd 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -132,6 +132,7 @@ public:
void testTdf104792();
void testTdf90627();
void testTdf104786();
+ void testTdf104789();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -184,6 +185,7 @@ public:
CPPUNIT_TEST(testTdf104792);
CPPUNIT_TEST(testTdf90627);
CPPUNIT_TEST(testTdf104786);
+ CPPUNIT_TEST(testTdf104789);
CPPUNIT_TEST_SUITE_END();
@@ -1245,6 +1247,19 @@ void SdOOXMLExportTest2::testTdf104786()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf104789()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104789.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+ OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:set/p:cBhvr/p:attrNameLst/p:attrName");
+ CPPUNIT_ASSERT_EQUAL(OUString("style.opacity"), sAttributeName);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 12e0b83b5421..76de6d0d9bfb 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -991,23 +991,19 @@ void PowerPointExport::WriteAnimationAttributeName( const FSHelperPtr& pFS, cons
SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
+ const char* pAttribute = nullptr;
+
if (rAttributeName == "Visibility")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("style.visibility");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "style.visibility";
}
else if (rAttributeName == "X")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("ppt_x");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "ppt_x";
}
else if (rAttributeName == "Y")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("ppt_y");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "ppt_y";
}
else if (rAttributeName == "X;Y")
{
@@ -1021,58 +1017,53 @@ void PowerPointExport::WriteAnimationAttributeName( const FSHelperPtr& pFS, cons
}
else if (rAttributeName == "Width")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("ppt_w");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "ppt_w";
}
else if (rAttributeName == "Height")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("ppt_h");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "ppt_h";
}
else if (rAttributeName == "Rotate")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("r");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "r";
}
else if (rAttributeName == "FillStyle")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("fill.type");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "fill.type";
}
else if (rAttributeName == "FillOn")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("fill.on");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "fill.on";
}
else if (rAttributeName == "FillColor")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("fillcolor");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "fillcolor";
}
else if (rAttributeName == "CharColor")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("style.color");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "style.color";
}
- if (rAttributeName == "SkewX")
+ else if (rAttributeName == "Opacity")
{
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped("xshear");
- pFS->endElementNS(XML_p, XML_attrName);
+ pAttribute = "style.opacity";
+ }
+ else if (rAttributeName == "SkewX")
+ {
+ pAttribute = "xshear";
}
else
{
SAL_INFO("sd.eppt", "unhandled animation attribute name: " << rAttributeName);
}
- pFS->endElementNS( XML_p, XML_attrNameLst );
+ if (pAttribute)
+ {
+ pFS->startElementNS(XML_p, XML_attrName, FSEND);
+ pFS->writeEscaped(pAttribute);
+ pFS->endElementNS(XML_p, XML_attrName);
+ }
+
+ pFS->endElementNS(XML_p, XML_attrNameLst);
}
void PowerPointExport::WriteAnimationTarget( const FSHelperPtr& pFS, const Any& rTarget )
commit f4b16752b99d30dc08df8fe75274afda77efc891
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Thu Mar 15 17:17:21 2018 +0100
tdf#104786 Don't export empty 'to'
Change-Id: I16b573fd6455813c6be5c2f5a0f0a820360a239f
Reviewed-on: https://gerrit.libreoffice.org/51359
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51456
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 16d316c912ef0ebbab30c66f2df898a407ca5c86)
diff --git a/sd/qa/unit/data/pptx/tdf104786.pptx b/sd/qa/unit/data/pptx/tdf104786.pptx
new file mode 100644
index 000000000000..165b5676e400
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104786.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index ed1076fe1f0e..16c0e55c43be 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -131,6 +131,7 @@ public:
/// SmartArt animated elements
void testTdf104792();
void testTdf90627();
+ void testTdf104786();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -182,6 +183,7 @@ public:
CPPUNIT_TEST(testTdf115394Zero);
CPPUNIT_TEST(testTdf104792);
CPPUNIT_TEST(testTdf90627);
+ CPPUNIT_TEST(testTdf104786);
CPPUNIT_TEST_SUITE_END();
@@ -1230,6 +1232,19 @@ void SdOOXMLExportTest2::testTdf90627()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf104786()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104786.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide2.xml");
+ // Don't export empty 'to'
+ assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst/p:set[2]/p:to", 0);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index fb8617491936..8987fddbdb8f 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -114,7 +114,7 @@ protected:
void WriteAnimationNodeEffect( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild );
void WriteAnimationNodeCommand(const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild );
void WriteAnimationNodeCommonPropsStart( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool bSingle, bool bMainSeqChild );
- static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rAny );
+ static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rAny, sal_Int32 nToken = 0 );
void WriteAnimationTarget( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rTarget );
bool WriteComments( sal_uInt32 nPageNum );
void ImplWriteBackground( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::beans::XPropertySet >& aXBackgroundPropSet );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a661fda0dd80..12e0b83b5421 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -885,7 +885,7 @@ void PowerPointExport::WriteTransition( const FSHelperPtr& pFS )
}
}
-void PowerPointExport::WriteAnimationProperty( const FSHelperPtr& pFS, const Any& rAny )
+void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 nToken)
{
if( !rAny.hasValue() )
return;
@@ -893,7 +893,17 @@ void PowerPointExport::WriteAnimationProperty( const FSHelperPtr& pFS, const Any
sal_uInt32 nRgb;
double fDouble;
- switch( rAny.getValueType().getTypeClass() ) {
+ uno::TypeClass aClass = rAny.getValueType().getTypeClass();
+ bool bWriteToken = nToken &&
+ ( aClass == TypeClass_LONG
+ || aClass == TypeClass_DOUBLE
+ || aClass == TypeClass_STRING );
+
+ if (bWriteToken)
+ pFS->startElementNS(XML_p, XML_to, FSEND);
+
+ switch (rAny.getValueType().getTypeClass())
+ {
case TypeClass_LONG:
rAny >>= nRgb;
pFS->singleElementNS(XML_a, XML_srgbClr,
@@ -914,6 +924,9 @@ void PowerPointExport::WriteAnimationProperty( const FSHelperPtr& pFS, const Any
default:
break;
}
+
+ if (bWriteToken)
+ pFS->endElementNS(XML_p, nToken);
}
void PowerPointExport::WriteAnimateValues( const FSHelperPtr& pFS, const Reference< XAnimate >& rXAnimate )
@@ -959,18 +972,14 @@ void PowerPointExport::WriteAnimateTo( const FSHelperPtr& pFS, const Any& rValue
SAL_INFO("sd.eppt", "to attribute name: " << USS(rAttributeName));
- pFS->startElementNS( XML_p, XML_to, FSEND );
-
sal_uInt32 nColor;
if (rValue >>= nColor)
{
// RGB color
- WriteAnimationProperty(pFS, rValue);
+ WriteAnimationProperty(pFS, rValue, XML_to);
}
else
- WriteAnimationProperty(pFS, AnimationExporter::convertAnimateValue(rValue, rAttributeName));
-
- pFS->endElementNS( XML_p, XML_to );
+ WriteAnimationProperty(pFS, AnimationExporter::convertAnimateValue(rValue, rAttributeName), XML_to);
}
void PowerPointExport::WriteAnimationAttributeName( const FSHelperPtr& pFS, const OUString& rAttributeName )
commit 1f61b9bca25c4a1ce03f88e4408f2716865a8f86
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Wed Mar 14 18:59:49 2018 +0100
tdf#90627 Don't save empty conditions
Change-Id: I5a953c1b0fff7bf41a59360a8f52596264ddf266
Reviewed-on: https://gerrit.libreoffice.org/51293
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51455
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit a21204ec1cf0b5f311f581ecce437785005d0456)
diff --git a/sd/qa/unit/data/odp/tdf90627.odp b/sd/qa/unit/data/odp/tdf90627.odp
new file mode 100644
index 000000000000..dfa28c9b09a3
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf90627.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 9818801662aa..ed1076fe1f0e 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -130,6 +130,7 @@ public:
void testTdf115394Zero();
/// SmartArt animated elements
void testTdf104792();
+ void testTdf90627();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -180,6 +181,7 @@ public:
CPPUNIT_TEST(testTdf115394);
CPPUNIT_TEST(testTdf115394Zero);
CPPUNIT_TEST(testTdf104792);
+ CPPUNIT_TEST(testTdf90627);
CPPUNIT_TEST_SUITE_END();
@@ -1215,6 +1217,19 @@ void SdOOXMLExportTest2::testTdf104792()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf90627()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf90627.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+ // Don't export empty conditions
+ assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[2]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:endCondLst", 0);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index 7c4ab7a9580a..fb8617491936 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -103,8 +103,8 @@ protected:
static void WriteAnimateTo( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rValue, const OUString& rAttributeName );
static void WriteAnimateValues( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimate >& rXAnimate );
- static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& pFS, css::uno::Any& rAny, bool bWriteEvent, bool bMainSeqChild );
- static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& pFS, const char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay );
+ static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& pFS, css::uno::Any const & rAny, bool bWriteEvent, bool bMainSeqChild, sal_Int32 nToken );
+ static void WriteAnimationCondition( const ::sax_fastparser::FSHelperPtr& pFS, const char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay, sal_Int32 nToken );
void WriteAnimations( const ::sax_fastparser::FSHelperPtr& pFS );
static void WriteAnimationAttributeName( const ::sax_fastparser::FSHelperPtr& pFS, const OUString& rAttributeName );
void WriteAnimationNode( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool bMainSeqChild );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 9d6f3066b7e9..a661fda0dd80 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1250,29 +1250,35 @@ void PowerPointExport::WriteAnimationNodeAnimateInside( const FSHelperPtr& pFS,
WriteAnimateTo( pFS, rXAnimate->getTo(), rXAnimate->getAttributeName() );
}
-void PowerPointExport::WriteAnimationCondition( const FSHelperPtr& pFS, const char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay )
+void PowerPointExport::WriteAnimationCondition(const FSHelperPtr& pFS, const char* pDelay, const char* pEvent, double fDelay, bool bHasFDelay, sal_Int32 nToken)
{
- if( bHasFDelay || pDelay || pEvent ) {
- if( !pEvent )
- pFS->singleElementNS( XML_p, XML_cond,
- XML_delay, bHasFDelay ? I64S( (sal_uInt32) (fDelay*1000.0) ) : pDelay,
- FSEND );
- else {
- pFS->startElementNS( XML_p, XML_cond,
- XML_delay, bHasFDelay ? I64S( (sal_uInt32) (fDelay*1000.0) ) : pDelay,
- XML_evt, pEvent,
- FSEND );
+ if (bHasFDelay || pDelay || pEvent)
+ {
+ pFS->startElementNS(XML_p, nToken, FSEND);
+
+ if (!pEvent)
+ pFS->singleElementNS(XML_p, XML_cond,
+ XML_delay, bHasFDelay ? I64S(static_cast<sal_uInt32>(fDelay*1000.0)) : pDelay,
+ FSEND);
+ else
+ {
+ pFS->startElementNS(XML_p, XML_cond,
+ XML_delay, bHasFDelay ? I64S(static_cast<sal_uInt32>(fDelay*1000.0)) : pDelay,
+ XML_evt, pEvent,
+ FSEND);
- pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
- pFS->singleElementNS( XML_p, XML_sldTgt, FSEND );
- pFS->endElementNS( XML_p, XML_tgtEl );
+ pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
+ pFS->singleElementNS( XML_p, XML_sldTgt, FSEND );
+ pFS->endElementNS( XML_p, XML_tgtEl );
- pFS->endElementNS( XML_p, XML_cond );
- }
+ pFS->endElementNS(XML_p, XML_cond);
+ }
+
+ pFS->endElementNS(XML_p, nToken);
}
}
-void PowerPointExport::WriteAnimationCondition( const FSHelperPtr& pFS, Any& rAny, bool bWriteEvent, bool bMainSeqChild )
+void PowerPointExport::WriteAnimationCondition(const FSHelperPtr& pFS, Any const& rAny, bool bWriteEvent, bool bMainSeqChild, sal_Int32 nToken)
{
bool bHasFDelay = false;
double fDelay = 0;
@@ -1355,7 +1361,7 @@ void PowerPointExport::WriteAnimationCondition( const FSHelperPtr& pFS, Any& rAn
}
}
- WriteAnimationCondition( pFS, pDelay, pEvent, fDelay, bHasFDelay );
+ WriteAnimationCondition(pFS, pDelay, pEvent, fDelay, bHasFDelay, nToken);
}
void PowerPointExport::WriteAnimationNodeCommonPropsStart( const FSHelperPtr& pFS, const Reference< XAnimationNode >& rXNode, bool bSingle, bool bMainSeqChild )
@@ -1501,26 +1507,22 @@ void PowerPointExport::WriteAnimationNodeCommonPropsStart( const FSHelperPtr& pF
if( aAny.hasValue() ) {
Sequence< Any > aCondSeq;
- pFS->startElementNS( XML_p, XML_stCondLst, FSEND );
if( aAny >>= aCondSeq ) {
for( int i = 0; i < aCondSeq.getLength(); i ++ )
- WriteAnimationCondition( pFS, aCondSeq[ i ], false, bMainSeqChild );
+ WriteAnimationCondition( pFS, aCondSeq[ i ], false, bMainSeqChild, XML_stCondLst );
} else
- WriteAnimationCondition( pFS, aAny, false, bMainSeqChild );
- pFS->endElementNS( XML_p, XML_stCondLst );
+ WriteAnimationCondition( pFS, aAny, false, bMainSeqChild, XML_stCondLst );
}
aAny = rXNode->getEnd();
if( aAny.hasValue() ) {
Sequence< Any > aCondSeq;
- pFS->startElementNS( XML_p, XML_endCondLst, FSEND );
if( aAny >>= aCondSeq ) {
for( int i = 0; i < aCondSeq.getLength(); i ++ )
- WriteAnimationCondition( pFS, aCondSeq[ i ], false, bMainSeqChild );
+ WriteAnimationCondition( pFS, aCondSeq[ i ], false, bMainSeqChild, XML_endCondLst );
} else
- WriteAnimationCondition( pFS, aAny, false, bMainSeqChild );
- pFS->endElementNS( XML_p, XML_endCondLst );
+ WriteAnimationCondition( pFS, aAny, false, bMainSeqChild, XML_endCondLst );
}
Reference< XEnumerationAccess > xEnumerationAccess( rXNode, UNO_QUERY );
@@ -1556,13 +1558,8 @@ void PowerPointExport::WriteAnimationNodeSeq( const FSHelperPtr& pFS, const Refe
WriteAnimationNodeCommonPropsStart( pFS, rXNode, true, bMainSeqChild );
- pFS->startElementNS( XML_p, XML_prevCondLst, FSEND );
- WriteAnimationCondition( pFS, nullptr, "onPrev", 0, true );
- pFS->endElementNS( XML_p, XML_prevCondLst );
-
- pFS->startElementNS( XML_p, XML_nextCondLst, FSEND );
- WriteAnimationCondition( pFS, nullptr, "onNext", 0, true );
- pFS->endElementNS( XML_p, XML_nextCondLst );
+ WriteAnimationCondition(pFS, nullptr, "onPrev", 0, true, XML_prevCondLst);
+ WriteAnimationCondition(pFS, nullptr, "onNext", 0, true, XML_nextCondLst);
pFS->endElementNS( XML_p, XML_seq );
}
commit 4a1257e2745beadb91ff98a222255ad37ce7fa5d
Author: Szymon Kłos <szymon.klos at collabora.com>
Date: Tue Mar 13 20:57:52 2018 +0100
tdf#104792 Double check for target shape
Change-Id: Ibe23377c7752d9ce97c7b100af4b2759b3ce946f
Reviewed-on: https://gerrit.libreoffice.org/51241
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51454
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 03a5a78a78808e1ec0c1cd4ee41c05cfa49143bd)
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx
index 0173d3794105..8a2a2bff6521 100644
--- a/oox/source/ppt/animationspersist.cxx
+++ b/oox/source/ppt/animationspersist.cxx
@@ -141,8 +141,14 @@ namespace oox { namespace ppt {
sShapeName = maShapeTarget.msSubShapeId;
Any rTarget;
- ::oox::drawingml::ShapePtr pShape = pSlide->getShape(sShapeName);
- SAL_WARN_IF( !pShape, "oox.ppt", "failed to locate Shape");
+ ::oox::drawingml::ShapePtr pShape = pSlide->getShape( sShapeName );
+ SAL_WARN_IF( !pShape, "oox.ppt", "failed to locate Shape" );
+
+ if( !pShape && maShapeTarget.mnType == XML_dgm )
+ {
+ pShape = pSlide->getShape( msValue );
+ }
+
if( pShape )
{
Reference< XShape > xShape( pShape->getXShape() );
diff --git a/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx b/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx
new file mode 100644
index 000000000000..ac72639efd77
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 7cfb05b3228a..9818801662aa 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -128,6 +128,8 @@ public:
void testFontScale();
void testTdf115394();
void testTdf115394Zero();
+ /// SmartArt animated elements
+ void testTdf104792();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -177,6 +179,7 @@ public:
CPPUNIT_TEST(testFontScale);
CPPUNIT_TEST(testTdf115394);
CPPUNIT_TEST(testTdf115394Zero);
+ CPPUNIT_TEST(testTdf104792);
CPPUNIT_TEST_SUITE_END();
@@ -1199,6 +1202,19 @@ void SdOOXMLExportTest2::testTdf115394Zero()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf104792()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(
+ m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104792-smart-art-animation.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+ assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst[1]/p:seq/p:cTn/p:childTnLst[1]/p:par[1]/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:par/p:cTn/p:childTnLst[1]/p:set/p:cBhvr/p:tgtEl/p:spTgt", 1);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
More information about the Libreoffice-commits
mailing list