[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source sc/uiconfig

Katarina Behrens Katarina.Behrens at cib.de
Fri Sep 4 04:40:45 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 a2dd4653a24d87832e0e8c5cfe7ff60562b37ab7
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

diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index cfae7b7..3518e22 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 dd65562..2a3312e 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