summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cui/source/options/optcolor.cxx4
-rw-r--r--cui/uiconfig/ui/colorconfigwin.ui158
-rw-r--r--include/svtools/colorcfg.hxx4
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI.xcu20
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/UI.xcs40
-rw-r--r--sc/inc/global.hxx2
-rw-r--r--sc/source/core/data/global.cxx4
-rw-r--r--sc/source/ui/view/output.cxx21
-rw-r--r--svtools/source/config/colorcfg.cxx8
9 files changed, 215 insertions, 46 deletions
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 6b1223c4485a..75df31fe1916 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -137,6 +137,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 5b70eb49bf3f..f90006c59c9c 100644
--- a/cui/uiconfig/ui/colorconfigwin.ui
+++ b/cui/uiconfig/ui/colorconfigwin.ui
@@ -790,6 +790,98 @@
</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" context="colorconfigwin|values">Values</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</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" context="colorconfigwin|formulas">Formulas</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</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" context="colorconfigwin|text">Text</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</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" context="colorconfigwin|protectedcells">Protected cells background</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</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>
@@ -801,7 +893,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>
@@ -812,7 +904,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">36</property>
+ <property name="top_attach">40</property>
</packing>
</child>
<child>
@@ -825,7 +917,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">36</property>
+ <property name="top_attach">40</property>
</packing>
</child>
<child>
@@ -840,7 +932,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>
@@ -851,7 +943,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">38</property>
+ <property name="top_attach">42</property>
</packing>
</child>
<child>
@@ -864,7 +956,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">38</property>
+ <property name="top_attach">42</property>
</packing>
</child>
<child>
@@ -874,7 +966,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">39</property>
+ <property name="top_attach">43</property>
</packing>
</child>
<child>
@@ -887,7 +979,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">39</property>
+ <property name="top_attach">43</property>
</packing>
</child>
<child>
@@ -897,7 +989,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">40</property>
+ <property name="top_attach">44</property>
</packing>
</child>
<child>
@@ -910,7 +1002,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">40</property>
+ <property name="top_attach">44</property>
</packing>
</child>
<child>
@@ -920,7 +1012,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">41</property>
+ <property name="top_attach">45</property>
</packing>
</child>
<child>
@@ -933,7 +1025,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">41</property>
+ <property name="top_attach">45</property>
</packing>
</child>
<child>
@@ -943,7 +1035,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">42</property>
+ <property name="top_attach">46</property>
</packing>
</child>
<child>
@@ -956,7 +1048,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">42</property>
+ <property name="top_attach">46</property>
</packing>
</child>
<child>
@@ -966,7 +1058,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">43</property>
+ <property name="top_attach">47</property>
</packing>
</child>
<child>
@@ -979,7 +1071,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">43</property>
+ <property name="top_attach">47</property>
</packing>
</child>
<child>
@@ -989,7 +1081,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">44</property>
+ <property name="top_attach">48</property>
</packing>
</child>
<child>
@@ -1002,7 +1094,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">44</property>
+ <property name="top_attach">48</property>
</packing>
</child>
<child>
@@ -1017,7 +1109,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>
@@ -1028,7 +1120,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">46</property>
+ <property name="top_attach">50</property>
</packing>
</child>
<child>
@@ -1041,7 +1133,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">46</property>
+ <property name="top_attach">50</property>
</packing>
</child>
<child>
@@ -1051,7 +1143,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">47</property>
+ <property name="top_attach">51</property>
</packing>
</child>
<child>
@@ -1064,7 +1156,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">47</property>
+ <property name="top_attach">51</property>
</packing>
</child>
<child>
@@ -1074,7 +1166,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">48</property>
+ <property name="top_attach">52</property>
</packing>
</child>
<child>
@@ -1087,7 +1179,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">48</property>
+ <property name="top_attach">52</property>
</packing>
</child>
<child>
@@ -1097,7 +1189,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">49</property>
+ <property name="top_attach">53</property>
</packing>
</child>
<child>
@@ -1110,7 +1202,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">49</property>
+ <property name="top_attach">53</property>
</packing>
</child>
<child>
@@ -1120,7 +1212,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">50</property>
+ <property name="top_attach">54</property>
</packing>
</child>
<child>
@@ -1133,7 +1225,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">50</property>
+ <property name="top_attach">54</property>
</packing>
</child>
<child>
@@ -1143,7 +1235,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">51</property>
+ <property name="top_attach">55</property>
</packing>
</child>
<child>
@@ -1156,7 +1248,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">51</property>
+ <property name="top_attach">55</property>
</packing>
</child>
<child>
@@ -1166,7 +1258,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">52</property>
+ <property name="top_attach">56</property>
</packing>
</child>
<child>
@@ -1179,7 +1271,7 @@
</object>
<packing>
<property name="left_attach">0</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 879902d5758f..5b52c32047a9 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -516,7 +516,6 @@ class ScGlobal
static SvxBrushItem* pEmptyBrushItem;
static SvxBrushItem* pButtonBrushItem;
static SvxBrushItem* pEmbeddedBrushItem;
- static SvxBrushItem* pProtectedBrushItem;
static ScFunctionList* pStarCalcFunctionList;
static ScFunctionMgr* pStarCalcFunctionMgr;
@@ -596,7 +595,6 @@ public:
static void InitTextHeight(const SfxItemPool* pPool);
static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; }
static SvxBrushItem* GetButtonBrushItem();
- static SvxBrushItem* GetProtectedBrushItem() { return pProtectedBrushItem; }
SC_DLLPUBLIC static const OUString& GetEmptyOUString();
static bool HasStarCalcFunctionList();
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 5fa52755596b..83c95286c0fa 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -43,6 +43,7 @@
#include <time.h>
#include <numeric>
#include <svx/svdmodel.hxx>
+#include <svtools/colorcfg.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <com/sun/star/lang/Locale.hpp>
@@ -104,7 +105,6 @@ OUString* ScGlobal::pStrClipDocName = nullptr;
SvxBrushItem* ScGlobal::pEmptyBrushItem = nullptr;
SvxBrushItem* ScGlobal::pButtonBrushItem = nullptr;
SvxBrushItem* ScGlobal::pEmbeddedBrushItem = nullptr;
-SvxBrushItem* ScGlobal::pProtectedBrushItem = nullptr;
ScFunctionList* ScGlobal::pStarCalcFunctionList = nullptr;
ScFunctionMgr* ScGlobal::pStarCalcFunctionMgr = nullptr;
@@ -467,7 +467,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();
@@ -562,7 +561,6 @@ void ScGlobal::Clear()
DELETEZ(pEmptyBrushItem);
DELETEZ(pButtonBrushItem);
DELETEZ(pEmbeddedBrushItem);
- DELETEZ(pProtectedBrushItem);
DELETEZ(pEnglishFormatter);
DELETEZ(pCaseTransliteration);
DELETEZ(pTransliteration);
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 6e0fa1a77e5c..5093f947eebf 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -292,12 +292,13 @@ void ScOutputData::SetMetaFileMode( 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 );
}
}
@@ -1026,6 +1027,10 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
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++)
{
@@ -1060,7 +1065,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;
@@ -1085,7 +1090,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
{
const ScProtectionAttr& rProt = pP->GetItem(ATTR_PROTECTION);
if (rProt.GetProtection() || rProt.GetHideCell())
- pBackground = ScGlobal::GetProtectedBrushItem();
+ pBackground = pProtectedBackground.get();
else
pBackground = ScGlobal::GetEmptyBrushItem();
}
@@ -1096,7 +1101,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 c7be767896a3..eaed3fb10d15 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -144,6 +144,10 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
{ OUStringLiteral("/CalcDetectiveError") ,false },
{ OUStringLiteral("/CalcReference") ,false },
{ OUStringLiteral("/CalcNotesBackground") ,false },
+ { OUStringLiteral("/CalcValue") ,false },
+ { OUStringLiteral("/CalcFormula") ,false },
+ { OUStringLiteral("/CalcText") ,false },
+ { OUStringLiteral("/CalcProtectedBackground") ,false },
{ OUStringLiteral("/DrawGrid") ,true },
{ OUStringLiteral("/BASICIdentifier"), false },
{ OUStringLiteral("/BASICComment") , false },
@@ -429,6 +433,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,