diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-03-20 16:40:35 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2018-03-21 17:54:47 +0100 |
commit | fb29b8262488d045a926504725669a362bacb5bb (patch) | |
tree | c8cb6e160267b46742e0051a8eded6206fb5c1f1 /sc/source/ui/optdlg | |
parent | fc3f43b6fe3df5e46ca869d5934d4c3333444881 (diff) |
tdf#116241 Customizing value highlighting colors
Change-Id: I5d77e6207d1e29326282d7184c9348e59292977a
Reviewed-on: https://gerrit.libreoffice.org/51653
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc/source/ui/optdlg')
-rw-r--r-- | sc/source/ui/optdlg/tpview.cxx | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index a7151bded5e7..d1811ca6dec9 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -49,6 +49,10 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent, get(pBreakCB,"break"); get(pGuideLineCB,"guideline"); + get(pValueColorLB, "value_color"); + get(pFormulaColorLB, "formula_color"); + get(pTextColorLB, "text_color"); + get(pFormulaCB,"formula"); get(pNilCB,"nil"); get(pAnnotCB,"annot"); @@ -107,6 +111,9 @@ void ScTpContentOptions::dispose() pColorLB.clear(); pBreakCB.clear(); pGuideLineCB.clear(); + pValueColorLB.clear(); + pFormulaColorLB.clear(); + pTextColorLB.clear(); pFormulaCB.clear(); pNilCB.clear(); pAnnotCB.clear(); @@ -152,10 +159,16 @@ bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet ) pOutlineCB ->IsValueChangedFromSaved() || pColorLB ->IsValueChangedFromSaved() || pBreakCB ->IsValueChangedFromSaved() || - pGuideLineCB ->IsValueChangedFromSaved()) + pGuideLineCB ->IsValueChangedFromSaved() || + pValueColorLB ->IsValueChangedFromSaved() || + pFormulaColorLB->IsValueChangedFromSaved() || + pTextColorLB ->IsValueChangedFromSaved() ) { NamedColor aNamedColor = pColorLB->GetSelectedEntry(); pLocalOptions->SetGridColor(aNamedColor.first, aNamedColor.second); + pLocalOptions->SetValueColor(pValueColorLB->GetSelectedEntry().first); + pLocalOptions->SetFormulaColor(pFormulaColorLB->GetSelectedEntry().first); + pLocalOptions->SetTextColor(pTextColorLB->GetSelectedEntry().first); rCoreSet->Put(ScTpViewItem(*pLocalOptions)); bRet = true; } @@ -199,6 +212,7 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet ) pOutlineCB->Check( pLocalOptions->GetOption(VOPT_OUTLINER) ); InitGridOpt(); + InitColors(); pBreakCB->Check( pLocalOptions->GetOption(VOPT_PAGEBREAKS) ); pGuideLineCB->Check( pLocalOptions->GetOption(VOPT_HELPLINES) ); @@ -229,6 +243,9 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet ) pColorLB->SaveValue(); pBreakCB->SaveValue(); pGuideLineCB->SaveValue(); + pValueColorLB->SaveValue(); + pFormulaColorLB->SaveValue(); + pTextColorLB->SaveValue(); } void ScTpContentOptions::ActivatePage( const SfxItemSet& rSet) @@ -315,6 +332,18 @@ void ScTpContentOptions::InitGridOpt() pColorLB->SelectEntry(std::make_pair(aCol, aName)); } +void ScTpContentOptions::InitColors() +{ + Color aCol = pLocalOptions->GetValueColor(); + pValueColorLB->SelectEntry(aCol); + + aCol = pLocalOptions->GetFormulaColor(); + pFormulaColorLB->SelectEntry(aCol); + + aCol = pLocalOptions->GetTextColor(); + pTextColorLB->SelectEntry(aCol); +} + IMPL_LINK( ScTpContentOptions, GridHdl, ListBox&, rLb, void ) { sal_Int32 nSelPos = rLb.GetSelectedEntryPos(); |