tdf#118296 Grid line color cannot be reverted
Use same approach as in Tools > Options... > LibreOffice >
Application Colors.
Change-Id: I5061709222cde2591e2937cdd67bbb5b6ad7f3f8
Reviewed-on: https://gerrit.libreoffice.org/56344
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
(cherry picked from commit 364c828e6ea9e78a145a4ec32a677c7539a913a9)
Reviewed-on: https://gerrit.libreoffice.org/56383
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index d33be62..326c9f0 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -239,7 +239,6 @@
#define STR_LONG_ERR_NO_CONV NC_("STR_LONG_ERR_NO_CONV", "Error: Calculation does not converge")
/* END error constants and error strings. */
#define STR_GRIDCOLOR NC_("STR_GRIDCOLOR", "Grid color")
#define STR_CELL_FILTER NC_("STR_CELL_FILTER", "Filter")
#define STR_TARGETNOTFOUND NC_("STR_TARGETNOTFOUND", "The target database range does not exist.")
#define STR_INVALID_EPS NC_("STR_INVALID_EPS", "Invalid increment")
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 920e05f..909dd81 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -130,7 +130,6 @@ void ScViewOptions::SetDefaults()
aModeArr[VOBJ_TYPE_DRAW ] = VOBJ_MODE_SHOW;
aGridCol = SC_STD_GRIDCOLOR;
aGridColName = ScResId( STR_GRIDCOLOR );
aGridOpt.SetDefaults();
}
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 4c533b7..94d6f9b 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -92,6 +92,8 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent,
pGuideLineCB->SetClickHdl(aCBHdl);
pRowColHeaderCB->SetClickHdl(aCBHdl);
pColorLB->SetSlotId(SID_ATTR_CHAR_COLOR);
pColorLB->SetAutoDisplayColor(SC_STD_GRIDCOLOR);
}
ScTpContentOptions::~ScTpContentOptions()
@@ -155,6 +157,11 @@ bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
pGuideLineCB ->IsValueChangedFromSaved())
{
NamedColor aNamedColor = pColorLB->GetSelectedEntry();
if (aNamedColor.first == COL_AUTO)
{
aNamedColor.first = SC_STD_GRIDCOLOR;
aNamedColor.second.clear();
}
pLocalOptions->SetGridColor(aNamedColor.first, aNamedColor.second);
rCoreSet->Put(ScTpViewItem(*pLocalOptions));
bRet = true;
@@ -310,7 +317,7 @@ void ScTpContentOptions::InitGridOpt()
Color aCol = pLocalOptions->GetGridColor( &aName );
if (aName.trim().isEmpty() && aCol == SC_STD_GRIDCOLOR)
aName = ScResId(STR_GRIDCOLOR);
aCol = COL_AUTO;
pColorLB->SelectEntry(std::make_pair(aCol, aName));
}