[Libreoffice-commits] .: 2 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 10 03:02:51 PDT 2012


 sc/source/ui/condformat/colorformat.cxx        |   23 ++++++++++++++---------
 sc/source/ui/condformat/condformatdlgentry.cxx |   15 +--------------
 sc/source/ui/inc/colorformat.hxx               |    8 ++++++--
 sc/source/ui/inc/condformatdlgentry.hxx        |    2 --
 4 files changed, 21 insertions(+), 27 deletions(-)

New commits:
commit 2b44ae0a5b20b7e4392d7f034207ac20a888d5ae
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Oct 10 12:00:33 2012 +0200

    also support formulas in the data bar dialog
    
    Change-Id: Ie86f935280667c8d9b4497fec7d519a212a452b6

diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 532c692..7983591 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -36,7 +36,7 @@
 #include <svx/drawitem.hxx>
 #include <vcl/msgbox.hxx>
 
-ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc):
+ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc, const ScAddress& rPos):
     ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ),
     maBtnOk( this, ScResId( BTN_OK ) ),
     maBtnCancel( this, ScResId( BTN_CANCEL ) ),
@@ -57,7 +57,9 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc):
     maLbAxisPos( this, ScResId( LB_AXIS_POSITION ) ),
     maEdMin( this, ScResId( ED_MIN ) ),
     maEdMax( this, ScResId( ED_MAX ) ),
-    mpNumberFormatter( pDoc->GetFormatTable() )
+    mpNumberFormatter( pDoc->GetFormatTable() ),
+    mpDoc(pDoc),
+    maPos(rPos)
 {
     Init();
     FreeResource();
@@ -74,7 +76,8 @@ void SetType(const ScColorScaleEntry* pEntry, ListBox& rLstBox)
     rLstBox.SelectEntryPos(pEntry->GetType());
 }
 
-void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, SvNumberFormatter* pNumberFormatter )
+void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, SvNumberFormatter* pNumberFormatter,
+        ScDocument* pDoc, const ScAddress& rPos )
 {
     double nVal = 0;
     sal_uInt32 nIndex = 0;
@@ -91,8 +94,8 @@ void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry,
             pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal );
             pEntry->SetValue(nVal);
             break;
-        case 6:
-            //TODO: moggi
+        case COLORSCALE_FORMULA:
+            pEntry->SetFormula(rEd.GetText(), pDoc, rPos);
             break;
     }
 }
@@ -109,7 +112,7 @@ void SetValue( ScColorScaleEntry* pEntry, Edit& aEdit)
 
 }
 
-ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc):
+ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos):
     ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ),
     maBtnOk( this, ScResId( BTN_OK ) ),
     maBtnCancel( this, ScResId( BTN_CANCEL ) ),
@@ -131,7 +134,9 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma
     maEdMin( this, ScResId( ED_MIN ) ),
     maEdMax( this, ScResId( ED_MAX ) ),
     maStrWarnSameValue( SC_RESSTR( STR_WARN_SAME_VALUE ) ),
-    mpNumberFormatter( pDoc->GetFormatTable() )
+    mpNumberFormatter( pDoc->GetFormatTable() ),
+    mpDoc(pDoc),
+    maPos(rPos)
 {
     Init();
     FreeResource();
@@ -240,8 +245,8 @@ ScDataBarFormatData* ScDataBarSettingsDlg::GetData()
     pData->mpLowerLimit.reset(new ScColorScaleEntry());
     pData->maAxisColor = maLbAxisCol.GetSelectEntryColor();
 
-    ::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter);
-    ::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter);
+    ::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter, mpDoc, maPos);
+    ::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter, mpDoc, maPos);
     GetAxesPosition(pData, maLbAxisPos);
 
     return pData;
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 2e1c148..865cfcc 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1041,7 +1041,7 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl )
 {
     SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true);
     SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true);
-    ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc);
+    ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc, maPos);
     if( pDlg->Execute() == RET_OK)
     {
         mpDataBarData.reset(pDlg->GetData());
diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx
index 5f552d8..3c58131 100644
--- a/sc/source/ui/inc/colorformat.hxx
+++ b/sc/source/ui/inc/colorformat.hxx
@@ -34,6 +34,7 @@
 #include "anyrefdg.hxx"
 
 struct ScDataBarFormatData;
+class ScDocument;
 
 class ScDataBarSettingsDlg : public ModalDialog
 {
@@ -65,14 +66,17 @@ private:
     rtl::OUString maStrWarnSameValue;
     SvNumberFormatter* mpNumberFormatter;
 
+    ScDocument* mpDoc;
+    ScAddress   maPos;
+
     DECL_LINK(OkBtnHdl, void*);
     DECL_LINK(TypeSelectHdl, void*);
 
     void Init();
 
 public:
-    ScDataBarSettingsDlg(Window* pParent, ScDocument* pDoc);
-    ScDataBarSettingsDlg(Window* pParent, const ScDataBarFormatData& rData, ScDocument* pDoc);
+    ScDataBarSettingsDlg(Window* pParent, ScDocument* pDoc, const ScAddress& rPos);
+    ScDataBarSettingsDlg(Window* pParent, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos);
 
     ScDataBarFormatData* GetData();
 };
commit fcdd08b46e09fea51c0b43068a27da6cb10a0750
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Oct 10 11:58:03 2012 +0200

    little clean-up
    
    Change-Id: I9530fe96f36bca4808722d22b564cc3e3111a102

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 97706f8..2e1c148 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -42,12 +42,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScAddr
 {
     SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor());
 
-    /*
-    */
-    //disable entries for color formats
-
     maLbType.SetSelectHdl( LINK( pParent, ScCondFormatList, TypeListHdl ) );
-    Init();
     maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
 }
 
@@ -55,13 +50,6 @@ ScCondFrmtEntry::~ScCondFrmtEntry()
 {
 }
 
-void ScCondFrmtEntry::Init()
-{
-    /*
-
-    */
-}
-
 long ScCondFrmtEntry::Notify( NotifyEvent& rNEvt )
 {
     if( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
@@ -104,7 +92,6 @@ void ScCondFrmtEntry::SetHeight()
     }
 }
 
-
 void ScCondFrmtEntry::Select()
 {
     maFtCondition.SetText(rtl::OUString());
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx
index f28a824..c9c61db 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -39,8 +39,6 @@ private:
     FixedText maFtCondNr;
     FixedText maFtCondition;
 
-    void Init();
-
     sal_Int32 mnIndex;
     rtl::OUString maStrCondition;
 protected:


More information about the Libreoffice-commits mailing list