[Libreoffice-commits] core.git: sc/source sc/uiconfig

Katarina Behrens Katarina.Behrens at cib.de
Fri Sep 4 04:42:23 PDT 2015


 sc/source/ui/condformat/colorformat.cxx |   15 +++++++++++++--
 sc/source/ui/inc/colorformat.hxx        |    1 +
 sc/uiconfig/scalc/ui/databaroptions.ui  |   11 +++++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)

New commits:
commit e8e6475617257054cd0fd5ddb704c1115b165c97
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Fri Sep 4 10:41:59 2015 +0200

    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 at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 348ea06..0306546 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 4c125f9..ed694ad 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 26860d6..c2a4ae2 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>


More information about the Libreoffice-commits mailing list