Kaydet (Commit) a9999852 authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Andras Timar

tdf#116241 Customizing value highlighting colors

Available in: Tools->Options->Application colors

Change-Id: I6e4f7a0dcad9a6ee222275019596853f0cbd3ab0
Reviewed-on: https://gerrit.libreoffice.org/51791Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSzymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/51943Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 586d5620
...@@ -141,6 +141,10 @@ const vEntryInfo[] = ...@@ -141,6 +141,10 @@ const vEntryInfo[] =
{ Group_Calc, IDS(deterror) }, { Group_Calc, IDS(deterror) },
{ Group_Calc, IDS(ref) }, { Group_Calc, IDS(ref) },
{ Group_Calc, IDS(notes) }, { Group_Calc, IDS(notes) },
{ Group_Calc, IDS(values) },
{ Group_Calc, IDS(formulas) },
{ Group_Calc, IDS(text) },
{ Group_Calc, IDS(protectedcells) },
{ Group_Draw, IDS(drawgrid) }, { Group_Draw, IDS(drawgrid) },
......
...@@ -61,6 +61,10 @@ enum ColorConfigEntry ...@@ -61,6 +61,10 @@ enum ColorConfigEntry
CALCDETECTIVEERROR , CALCDETECTIVEERROR ,
CALCREFERENCE , CALCREFERENCE ,
CALCNOTESBACKGROUND , CALCNOTESBACKGROUND ,
CALCVALUE,
CALCFORMULA,
CALCTEXT,
CALCPROTECTEDBACKGROUND,
DRAWGRID , DRAWGRID ,
BASICIDENTIFIER, BASICIDENTIFIER,
BASICCOMMENT , BASICCOMMENT ,
......
...@@ -323,6 +323,26 @@ ...@@ -323,6 +323,26 @@
<value xsi:nil="true"/> <value xsi:nil="true"/>
</prop> </prop>
</node> </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"> <node oor:name="DrawGrid">
<prop oor:name="IsVisible"> <prop oor:name="IsVisible">
<value>true</value> <value>true</value>
......
...@@ -410,6 +410,46 @@ ...@@ -410,6 +410,46 @@
</info> </info>
</prop> </prop>
</group> </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"> <group oor:name="DrawGrid">
<info> <info>
<desc>Specifies the settings used for the grid in Draw/Impress.</desc> <desc>Specifies the settings used for the grid in Draw/Impress.</desc>
......
...@@ -518,7 +518,6 @@ class ScGlobal ...@@ -518,7 +518,6 @@ class ScGlobal
static SvxBrushItem* pEmptyBrushItem; static SvxBrushItem* pEmptyBrushItem;
static SvxBrushItem* pButtonBrushItem; static SvxBrushItem* pButtonBrushItem;
static SvxBrushItem* pEmbeddedBrushItem; static SvxBrushItem* pEmbeddedBrushItem;
static SvxBrushItem* pProtectedBrushItem;
static ImageList* pOutlineBitmaps; static ImageList* pOutlineBitmaps;
...@@ -601,7 +600,6 @@ public: ...@@ -601,7 +600,6 @@ public:
static void InitTextHeight(SfxItemPool* pPool); static void InitTextHeight(SfxItemPool* pPool);
static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; } static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; }
static SvxBrushItem* GetButtonBrushItem(); static SvxBrushItem* GetButtonBrushItem();
static SvxBrushItem* GetProtectedBrushItem() { return pProtectedBrushItem; }
SC_DLLPUBLIC static const OUString& GetEmptyOUString(); SC_DLLPUBLIC static const OUString& GetEmptyOUString();
/** Returns the specified image list with outline symbols. */ /** Returns the specified image list with outline symbols. */
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <ctype.h> #include <ctype.h>
#include <numeric> #include <numeric>
#include <svx/svdmodel.hxx> #include <svx/svdmodel.hxx>
#include <svtools/colorcfg.hxx>
#include <i18nlangtag/mslangid.hxx> #include <i18nlangtag/mslangid.hxx>
#include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/Locale.hpp>
...@@ -109,7 +110,6 @@ OUString* ScGlobal::pStrClipDocName = nullptr; ...@@ -109,7 +110,6 @@ OUString* ScGlobal::pStrClipDocName = nullptr;
SvxBrushItem* ScGlobal::pEmptyBrushItem = nullptr; SvxBrushItem* ScGlobal::pEmptyBrushItem = nullptr;
SvxBrushItem* ScGlobal::pButtonBrushItem = nullptr; SvxBrushItem* ScGlobal::pButtonBrushItem = nullptr;
SvxBrushItem* ScGlobal::pEmbeddedBrushItem = nullptr; SvxBrushItem* ScGlobal::pEmbeddedBrushItem = nullptr;
SvxBrushItem* ScGlobal::pProtectedBrushItem = nullptr;
ImageList* ScGlobal::pOutlineBitmaps = nullptr; ImageList* ScGlobal::pOutlineBitmaps = nullptr;
...@@ -509,7 +509,6 @@ void ScGlobal::Init() ...@@ -509,7 +509,6 @@ void ScGlobal::Init()
pEmptyBrushItem = new SvxBrushItem( Color( COL_TRANSPARENT ), ATTR_BACKGROUND ); pEmptyBrushItem = new SvxBrushItem( Color( COL_TRANSPARENT ), ATTR_BACKGROUND );
pButtonBrushItem = new SvxBrushItem( Color(), ATTR_BACKGROUND ); pButtonBrushItem = new SvxBrushItem( Color(), ATTR_BACKGROUND );
pEmbeddedBrushItem = new SvxBrushItem( Color( COL_LIGHTCYAN ), ATTR_BACKGROUND ); pEmbeddedBrushItem = new SvxBrushItem( Color( COL_LIGHTCYAN ), ATTR_BACKGROUND );
pProtectedBrushItem = new SvxBrushItem( Color( COL_LIGHTGRAY ), ATTR_BACKGROUND );
InitPPT(); InitPPT();
//ScCompiler::InitSymbolsNative(); //ScCompiler::InitSymbolsNative();
...@@ -609,7 +608,6 @@ void ScGlobal::Clear() ...@@ -609,7 +608,6 @@ void ScGlobal::Clear()
DELETEZ(pEmptyBrushItem); DELETEZ(pEmptyBrushItem);
DELETEZ(pButtonBrushItem); DELETEZ(pButtonBrushItem);
DELETEZ(pEmbeddedBrushItem); DELETEZ(pEmbeddedBrushItem);
DELETEZ(pProtectedBrushItem);
DELETEZ(pOutlineBitmaps); DELETEZ(pOutlineBitmaps);
DELETEZ(pEnglishFormatter); DELETEZ(pEnglishFormatter);
DELETEZ(pCaseTransliteration); DELETEZ(pCaseTransliteration);
......
...@@ -298,12 +298,13 @@ void ScOutputData::SetSingleGrid( bool bNewMode ) ...@@ -298,12 +298,13 @@ void ScOutputData::SetSingleGrid( bool bNewMode )
void ScOutputData::SetSyntaxMode( bool bNewMode ) void ScOutputData::SetSyntaxMode( bool bNewMode )
{ {
mbSyntaxMode = bNewMode; mbSyntaxMode = bNewMode;
if (bNewMode) if ( bNewMode )
if (!pValueColor) if ( !pValueColor )
{ {
pValueColor = new Color( COL_LIGHTBLUE ); const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
pTextColor = new Color( COL_BLACK ); pValueColor = new Color( rColorCfg.GetColorValue( svtools::CALCVALUE ).nColor );
pFormulaColor = new Color( COL_GREEN ); 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) ...@@ -1001,6 +1002,12 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
Application::GetSettings().GetStyleSettings().GetHighContrastMode(); Application::GetSettings().GetStyleSettings().GetHighContrastMode();
long nPosY = nScrY; 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++) for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
{ {
RowInfo* pThisRowInfo = &pRowInfo[nArrY]; RowInfo* pThisRowInfo = &pRowInfo[nArrY];
...@@ -1034,7 +1041,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) ...@@ -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 aRect = rRenderContext.PixelToLogic(aRect); // internal data in pixels, but we'll be drawing in logic units
const SvxBrushItem* pOldBackground = nullptr; const SvxBrushItem* pOldBackground = nullptr;
const SvxBrushItem* pBackground; const SvxBrushItem* pBackground = nullptr;
const Color* pOldColor = nullptr; const Color* pOldColor = nullptr;
const ScDataBarInfo* pOldDataBarInfo = nullptr; const ScDataBarInfo* pOldDataBarInfo = nullptr;
const ScIconSetInfo* pOldIconSetInfo = nullptr; const ScIconSetInfo* pOldIconSetInfo = nullptr;
...@@ -1060,7 +1067,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) ...@@ -1060,7 +1067,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
const ScProtectionAttr& rProt = static_cast<const ScProtectionAttr&>( const ScProtectionAttr& rProt = static_cast<const ScProtectionAttr&>(
pP->GetItem(ATTR_PROTECTION)); pP->GetItem(ATTR_PROTECTION));
if (rProt.GetProtection() || rProt.GetHideCell()) if (rProt.GetProtection() || rProt.GetHideCell())
pBackground = ScGlobal::GetProtectedBrushItem(); pBackground = pProtectedBackground.get();
else else
pBackground = ScGlobal::GetEmptyBrushItem(); pBackground = ScGlobal::GetEmptyBrushItem();
} }
...@@ -1071,7 +1078,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) ...@@ -1071,7 +1078,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
pBackground = pInfo->pBackground; pBackground = pInfo->pBackground;
if ( bPagebreakMode && !pInfo->bPrinted ) if ( bPagebreakMode && !pInfo->bPrinted )
pBackground = ScGlobal::GetProtectedBrushItem(); pBackground = pProtectedBackground.get();
if ( pInfo->nRotateDir > ScRotateDir::Standard && if ( pInfo->nRotateDir > ScRotateDir::Standard &&
pBackground->GetColor().GetTransparency() != 255 && pBackground->GetColor().GetTransparency() != 255 &&
......
...@@ -146,6 +146,10 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme) ...@@ -146,6 +146,10 @@ uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme)
{ RTL_CONSTASCII_USTRINGPARAM("/CalcDetectiveError") ,false }, { RTL_CONSTASCII_USTRINGPARAM("/CalcDetectiveError") ,false },
{ RTL_CONSTASCII_USTRINGPARAM("/CalcReference") ,false }, { RTL_CONSTASCII_USTRINGPARAM("/CalcReference") ,false },
{ RTL_CONSTASCII_USTRINGPARAM("/CalcNotesBackground") ,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("/DrawGrid") ,true },
{ RTL_CONSTASCII_USTRINGPARAM("/BASICIdentifier"), false }, { RTL_CONSTASCII_USTRINGPARAM("/BASICIdentifier"), false },
{ RTL_CONSTASCII_USTRINGPARAM("/BASICComment") , false }, { RTL_CONSTASCII_USTRINGPARAM("/BASICComment") , false },
...@@ -434,6 +438,10 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) ...@@ -434,6 +438,10 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
COL_LIGHTRED, // CALCDETECTIVEERROR COL_LIGHTRED, // CALCDETECTIVEERROR
0xef0fff, // CALCREFERENCE 0xef0fff, // CALCREFERENCE
0xffffc0, // CALCNOTESBACKGROUND 0xffffc0, // CALCNOTESBACKGROUND
COL_LIGHTBLUE, // CALCVALUE
COL_GREEN, // CALCFORMULA
COL_BLACK, // CALCTEXT
COL_LIGHTGRAY, // CALCPROTECTEDBACKGROUND
COL_LIGHTGRAY, // DRAWGRID COL_LIGHTGRAY, // DRAWGRID
COL_GREEN, // BASICIDENTIFIER, COL_GREEN, // BASICIDENTIFIER,
COL_GRAY, // BASICCOMMENT, COL_GRAY, // BASICCOMMENT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment