[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - sc/source

Fridrich Strba fridrich at kemper.freedesktop.org
Mon Jul 16 01:43:45 PDT 2012


 sc/source/ui/condformat/colorformat.cxx   |    2 -
 sc/source/ui/condformat/condformatdlg.cxx |   40 ++++++++++++++++++++++++++++++
 sc/source/ui/inc/condformatdlg.hxx        |    1 
 3 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit 1f6bf7bc65e9b88679bab6b46da3089ac9812c48
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jul 16 04:02:23 2012 +0200

    use correct value to check for min and max, fdo#51831
    
    Change-Id: I8a5412bc9c22048dd8f6618b38e5a522b7ea02c2
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 867f29f..daa14a8 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -288,7 +288,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
             mpNumberFormatter->IsNumberFormat(aMinString, nIndex, nMinValue);
             nIndex = 0;
             double nMaxValue = 0;
-            mpNumberFormatter->IsNumberFormat(aMaxString, nIndex, nMinValue);
+            mpNumberFormatter->IsNumberFormat(aMaxString, nIndex, nMaxValue);
             if(rtl::math::approxEqual(nMinValue, nMaxValue) || nMinValue > nMaxValue)
                 bWarn = true;
         }
commit ffdee69b8e653085e4681c264682cfb71761f8db
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jul 16 04:21:40 2012 +0200

    disable edit field for min and max type, fdo#51834
    
    Change-Id: Id77c58f333bfab5446cf96d24cd9ccfc18802862
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 9ba146d..643efdb 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -173,6 +173,10 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc):
     SwitchToType(COLLAPSED);
     SetHeight();
     SetCondType();
+
+    EntryTypeHdl(&maLbEntryTypeMin);
+    EntryTypeHdl(&maLbEntryTypeMiddle);
+    EntryTypeHdl(&maLbEntryTypeMax);
 }
 
 ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry):
@@ -297,6 +301,10 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm
     maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
     SwitchToType(COLLAPSED);
     SetHeight();
+
+    EntryTypeHdl(&maLbEntryTypeMin);
+    EntryTypeHdl(&maLbEntryTypeMiddle);
+    EntryTypeHdl(&maLbEntryTypeMax);
 }
 
 ScCondFrmtEntry::~ScCondFrmtEntry()
@@ -307,6 +315,12 @@ void ScCondFrmtEntry::Init()
 {
     maLbType.SetSelectHdl( LINK( this, ScCondFrmtEntry, TypeListHdl ) );
     maLbColorFormat.SetSelectHdl( LINK( this, ScCondFrmtEntry, ColFormatTypeHdl ) );
+    maLbEntryTypeMin.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) );
+    maLbEntryTypeMax.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) );
+    maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) );
+
+
+
     SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA );
     for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() )
     {
@@ -813,6 +827,31 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl)
     return 0;
 }
 
+IMPL_LINK( ScCondFrmtEntry, EntryTypeHdl, ListBox*, pBox )
+{
+    bool bEnableEdit = true;
+    sal_Int32 nPos = pBox->GetSelectEntryPos();
+    if(nPos == 0 || nPos == 1)
+    {
+        bEnableEdit = false;
+    }
+
+    Edit* pEd = NULL;
+    if(pBox == &maLbEntryTypeMin)
+        pEd = &maEdMin;
+    else if(pBox == &maLbEntryTypeMiddle)
+        pEd = &maEdMiddle;
+    else if(pBox == &maLbEntryTypeMax)
+        pEd = &maEdMax;
+
+    if(bEnableEdit)
+        pEd->Enable();
+    else
+        pEd->Disable();
+
+    return 0;
+}
+
 IMPL_LINK_NOARG(ScCondFrmtEntry, StyleSelectHdl)
 {
     if(maLbStyle.GetSelectEntryPos() == 0)
@@ -906,6 +945,7 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl )
     {
         maEdVal2.Hide();
     }
+
     return 0;
 }
 
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index 35e24da..298b357 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -124,6 +124,7 @@ private:
     DECL_LINK( OptionBtnHdl, void* );
     DECL_LINK( DataBarTypeSelectHdl, void* );
     DECL_LINK( ConditionTypeSelectHdl, void* );
+    DECL_LINK( EntryTypeHdl, ListBox* );
 
 public:
     ScCondFrmtEntry( Window* pParent, ScDocument* pDoc );


More information about the Libreoffice-commits mailing list