diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-04 05:22:00 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-10-06 00:26:39 +0200 |
commit | 76063f78d510a1e3a2396dbfb8cc37d29f7b127d (patch) | |
tree | 404f7c05bbad6648e127a7b8a9ee8a552bb4cd85 | |
parent | a57a183a2b8b613118b1d2a212ef3069f5ae7e90 (diff) |
add range edit box to cond format dialog
Change-Id: I913c844b08f2fd01963c60c4ffa948fc128a5897
-rw-r--r-- | sc/source/ui/condformat/condformatdlg.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hrc | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/src/condformatdlg.src | 16 |
4 files changed, 43 insertions, 5 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 51fc4856dfeb..5d56bec37428 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -1089,10 +1089,12 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond maBtnRemove( this, ScResId( BTN_REMOVE ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), + maFtRange( this, ScResId( FT_RANGE ) ), + maEdRange( this, ScResId( ED_RANGE ) ), maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos ), - maPos(rPos) + maPos(rPos), + mpDoc(pDoc) { - rtl::OUStringBuffer aTitle( GetText() ); aTitle.append(rtl::OUString(" ")); rtl::OUString aRangeString; @@ -1101,12 +1103,23 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond SetText(aTitle.makeStringAndClear()); maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) ); + maEdRange.SetModifyHdl( LINK( &maEdRange, ScCondFormatDlg, EdRangeModifyHdl ) ); FreeResource(); + + maEdRange.SetText(aRangeString); } ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const { - return maCondFormList.GetConditionalFormat(); + rtl::OUString aRangeStr = maEdRange.GetText(); + ScRangeList aRange; + sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention()); + ScConditionalFormat* pFormat = maCondFormList.GetConditionalFormat(); + + if(nFlags & SCA_VALID && !aRange.empty()) + pFormat->AddRange(aRange); + + return pFormat; } IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) @@ -1153,5 +1166,10 @@ IMPL_LINK_NOARG( ScCondFormatList, ScrollHdl ) return 0; } +IMPL_LINK_NOARG( ScCondFormatDlg, EdRangeModifyHdl ) +{ + return 0; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlg.hrc b/sc/source/ui/inc/condformatdlg.hrc index d92e7a7e774b..98bf32a707ef 100644 --- a/sc/source/ui/inc/condformatdlg.hrc +++ b/sc/source/ui/inc/condformatdlg.hrc @@ -55,4 +55,7 @@ #define BTN_OPTIONS 30 #define STR_CONDITION 31 +#define FT_RANGE 32 +#define ED_RANGE 33 + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index c5ea01dff4ea..5ddc027bc366 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -177,10 +177,15 @@ private: PushButton maBtnRemove; OKButton maBtnOk; CancelButton maBtnCancel; + FixedText maFtRange; + Edit maEdRange; ScCondFormatList maCondFormList; ScAddress maPos; + ScDocument* mpDoc; + + DECL_LINK( EdRangeModifyHdl, void* ); public: ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos); diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src index 2800724d2036..9a4977624b55 100644 --- a/sc/source/ui/src/condformatdlg.src +++ b/sc/source/ui/src/condformatdlg.src @@ -50,14 +50,14 @@ ModalDialog RID_SCDLG_CONDFORMAT }; PushButton BTN_ADD { - Pos = MAP_APPFONT( 5, 255 ); + Pos = MAP_APPFONT( 5, 245 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "Add"; TabStop = TRUE; }; PushButton BTN_REMOVE { - Pos = MAP_APPFONT( 60, 255 ); + Pos = MAP_APPFONT( 60, 245 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "Remove"; TabStop = TRUE; @@ -68,6 +68,18 @@ ModalDialog RID_SCDLG_CONDFORMAT Size = MAP_APPFONT( 290, 220 ); Border = TRUE; }; + FixedText FT_RANGE + { + Pos = MAP_APPFONT( 5, 262 ); + Size = MAP_APPFONT( 50, 16 ); + Text [ en-US ] = "Range:"; + }; + Edit ED_RANGE + { + Pos = MAP_APPFONT( 60, 262 ); + Size = MAP_APPFONT( 200, 14 ); + Border = TRUE; + }; }; Control RID_COND_ENTRY |