summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2018-06-24 01:15:41 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2018-06-25 15:48:46 +0200
commit56a68f70ec8ddf8a452732e51828f877ed49999c (patch)
tree2d89aaeef5bd332fab784bb74852047172d7896f
parent0b77d890bcbc189ff12cf5dab683c6aed881c177 (diff)
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>
-rw-r--r--sc/inc/globstr.hrc1
-rw-r--r--sc/source/core/tool/viewopti.cxx1
-rw-r--r--sc/source/ui/optdlg/tpview.cxx9
3 files changed, 8 insertions, 3 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index d33be62479dd..326c9f01c455 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 920e05f1e874..909dd81db896 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 4c533b7099ab..94d6f9b07a0e 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));
}