diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-10 03:10:57 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-11 08:01:26 +0200 |
commit | 7b5ded5e33723230c7dee49394039f324ea819fa (patch) | |
tree | c2a37824e92a1131e8c397033007dfe9c268672f /sc | |
parent | fix repainting of conditional formats (diff) | |
download | core-7b5ded5e33723230c7dee49394039f324ea819fa.tar.gz core-7b5ded5e33723230c7dee49394039f324ea819fa.zip |
set correct range as title + update for (not) between
Change-Id: I4b819920417c1b2c67b27295170c7a56108fef64
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 9ffa87219956..2a4a89b5b89c 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5075,7 +5075,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 ); |