[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - cui/source cui/uiconfig include/svtools officecfg/registry sc/inc sc/source svtools/source
Szymon Kłos
szymon.klos at collabora.com
Tue Mar 27 12:50:14 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 ++
sc/inc/global.hxx | 2
sc/source/core/data/global.cxx | 4
sc/source/ui/view/output.cxx | 23 +
svtools/source/config/colorcfg.cxx | 8
9 files changed, 280 insertions(+), 61 deletions(-)
New commits:
commit a99998525242d7d3ee48bece6ea699814fd4433f
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>
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 0faed9b36374..3969868336d3 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 da09eac04d12..cfd1ba406cd3 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,
More information about the Libreoffice-commits
mailing list