diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-10 01:10:57 +0000 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-06-15 16:02:59 +0200 |
commit | c503655664218218b55c9bdc727eb0bf23741241 (patch) | |
tree | ad0f753be8c3d768b3792d2c603cd5136439a9c2 /sc | |
parent | 1252376ec587419b2dc80e9f6a221185926ed778 (diff) |
set correct range as title + update for (not) between
Change-Id: I4b819920417c1b2c67b27295170c7a56108fef64
Signed-off-by: Jan Holesovsky <kendy@suse.cz>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/condformat/condformatdlg.cxx | 23 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 1 |
3 files changed, 24 insertions, 2 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 0f27399959da..1f102f61be18 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -217,6 +217,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm maLbStyle.SelectEntry(aStyleName); ScConditionMode eMode = pEntry->GetOperation(); maLbType.SelectEntryPos(1); + maEdVal1.SetText(pEntry->GetExpression(maPos, 0)); switch(eMode) { case SC_COND_EQUAL: @@ -238,9 +239,11 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm maLbCondType.SelectEntryPos(5); break; case SC_COND_BETWEEN: + maEdVal2.SetText(pEntry->GetExpression(maPos, 1)); maLbCondType.SelectEntryPos(6); break; case SC_COND_NOTBETWEEN: + maEdVal2.SetText(pEntry->GetExpression(maPos, 1)); maLbCondType.SelectEntryPos(7); break; case SC_COND_DUPLICATE: @@ -374,6 +377,7 @@ void ScCondFrmtEntry::Init() maBtOptions.SetClickHdl( LINK( this, ScCondFrmtEntry, OptionBtnHdl ) ); maLbDataBarMinType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) ); maLbDataBarMaxType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) ); + maLbCondType.SetSelectHdl( LINK( this, ScCondFrmtEntry, ConditionTypeSelectHdl ) ); mpDataBarData.reset(new ScDataBarFormatData()); mpDataBarData->mpUpperLimit.reset(new ScColorScaleEntry()); @@ -860,6 +864,23 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, OptionBtnHdl ) return 0; } +IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl ) +{ + if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7) + { + std::cout << "OldSize: " << maEdVal1.GetSizePixel().Width() << " " << maEdVal1.GetSizePixel().Height() << std::endl; + maEdVal1.SetSizePixel(maEdVal2.GetSizePixel()); + maEdVal2.Show(); + } + else + { + maEdVal2.Hide(); + Size aSize(193, 30); + maEdVal1.SetSizePixel(aSize); + } + return 0; +} + ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc): Control(pParent, rResId), mbHasScrollBar(false), @@ -981,7 +1002,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond rtl::OUStringBuffer aTitle( GetText() ); aTitle.append(rtl::OUString(" ")); rtl::OUString aRangeString; - rRange.Format(aRangeString, 0, pDoc); + rRange.Format(aRangeString, SCA_VALID, pDoc, pDoc->GetAddressConvention()); aTitle.append(aRangeString); SetText(aTitle.makeStringAndClear()); maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index b40a0af7e544..1414fce81fff 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5080,7 +5080,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor ScMarkData aMarkData; aMarkData.MarkFromRangeList(rRanges, true); pDoc->ApplySelectionPattern( aPattern , aMarkData ); - size_t n = rRanges.size() + size_t n = rRanges.size(); for(size_t i = 0; i < n; ++i) pFormat->DoRepaint(rRanges[i]); } diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 70fef9691062..e66c090a2295 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -126,6 +126,7 @@ private: DECL_LINK( StyleSelectHdl, void* ); DECL_LINK( OptionBtnHdl, void* ); DECL_LINK( DataBarTypeSelectHdl, void* ); + DECL_LINK( ConditionTypeSelectHdl, void* ); public: ScCondFrmtEntry( Window* pParent, ScDocument* pDoc ); |