diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-09-04 10:41:59 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-09-04 11:42:01 +0000 |
commit | e8e6475617257054cd0fd5ddb704c1115b165c97 (patch) | |
tree | a70a011c2cfde968b6b3646a1e4850dbce3c06dd | |
parent | ed7ea6885400d62c84304917493ded4ba376c361 (diff) |
tdf#91501: Add data bar colour to the list if not there yet
Change-Id: I18dd5b8dc49bd9f4dc9c27556782fa5f2b3c4f58
Reviewed-on: https://gerrit.libreoffice.org/18334
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/inc/colorformat.hxx | 1 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/databaroptions.ui | 11 |
3 files changed, 25 insertions, 2 deletions
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 348ea068c4eb..0306546ba0b1 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -66,6 +66,16 @@ void SetValue( ScDocument* pDoc, ScColorScaleEntry* pEntry, Edit& aEdit) aEdit.Disable(); } +void SelectColor(const Color& aColor, const OUString aCustomName, ColorListBox& rLstBox) +{ + rLstBox.SelectEntry( aColor ); + if ( rLstBox.GetSelectEntryColor() != aColor ) + { + rLstBox.InsertEntry( aColor, aCustomName ); + rLstBox.SelectEntry( aColor ); + } +} + } ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos): @@ -90,13 +100,14 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar get( mpCbOnlyBar, "only_bar"); maStrWarnSameValue = get<FixedText>("str_same_value")->GetText(); + maCustomColor = get<FixedText>("custom_color")->GetText(); Init(); - mpLbPos->SelectEntry( rData.maPositiveColor ); + ::SelectColor( rData.maPositiveColor, maCustomColor, *mpLbPos); mpLbFillType->SelectEntryPos( rData.mbGradient ? 1 : 0 ); if(rData.mpNegativeColor) - mpLbNeg->SelectEntry( *rData.mpNegativeColor ); + ::SelectColor( *rData.mpNegativeColor, maCustomColor, *mpLbNeg ); switch (rData.meAxisPosition) { diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx index 4c125f9689f2..ed694ad38cd8 100644 --- a/sc/source/ui/inc/colorformat.hxx +++ b/sc/source/ui/inc/colorformat.hxx @@ -43,6 +43,7 @@ private: VclPtr<CheckBox> mpCbOnlyBar; OUString maStrWarnSameValue; + OUString maCustomColor; SvNumberFormatter* mpNumberFormatter; ScDocument* mpDoc; diff --git a/sc/uiconfig/scalc/ui/databaroptions.ui b/sc/uiconfig/scalc/ui/databaroptions.ui index 26860d610676..c2a4ae233281 100644 --- a/sc/uiconfig/scalc/ui/databaroptions.ui +++ b/sc/uiconfig/scalc/ui/databaroptions.ui @@ -523,6 +523,17 @@ <property name="position">5</property> </packing> </child> + <child> + <object class="GtkLabel" id="custom_color"> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Custom</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> |