diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-27 22:40:18 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-07-27 23:10:14 +0200 |
commit | 06b5dfff3aa3005093d427e368ae5eeb5f2ad948 (patch) | |
tree | 9eb73f4d7df6e248d9234482759eabd1cd4c1481 | |
parent | 0705b9f75d31c433b9ff263a0f1af06035664219 (diff) |
use correct cursor pos for cond format formulas, fdo#52565
Change-Id: I4e270a8c8ee60a6ab9a3d3b717db2c1243a34e1d
-rw-r--r-- | sc/source/ui/condformat/condformatdlg.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index f77fe37ef27d..641b02e9eb8e 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -113,7 +113,7 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed } -ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): +ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScAddress& rPos): Control(pParent, ScResId( RID_COND_ENTRY ) ), mbActive(false), meType(CONDITION), @@ -144,6 +144,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): maEdDataBarMax( this, ScResId( ED_COL_SCALE ) ), maBtOptions( this, ScResId( BTN_OPTIONS ) ), mpDoc(pDoc), + maPos(rPos), mnIndex(0), maStrCondition(ScResId( STR_CONDITION ).toString()) { @@ -179,7 +180,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): EntryTypeHdl(&maLbEntryTypeMax); } -ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry): +ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry, const ScAddress& rPos): Control(pParent, ScResId( RID_COND_ENTRY ) ), mbActive(false), meType(CONDITION), @@ -209,7 +210,8 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm maEdDataBarMin( this, ScResId( ED_COL_SCALE ) ), maEdDataBarMax( this, ScResId( ED_COL_SCALE ) ), maBtOptions( this, ScResId( BTN_OPTIONS ) ), - mpDoc(pDoc) + mpDoc(pDoc), + maPos(rPos) { SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); FreeResource(); @@ -966,7 +968,7 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum size_t nCount = pFormat->size(); for (size_t nIndex = 0; nIndex < nCount; ++nIndex) { - maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex))); + maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex), maPos )); } } @@ -1050,7 +1052,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond maBtnRemove( this, ScResId( BTN_REMOVE ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), - maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, maPos ), + maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos ), mpDoc(pDoc), mpFormat(pFormat), maPos(rPos) @@ -1074,7 +1076,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) { - ScCondFrmtEntry* pNewEntry = new ScCondFrmtEntry(this, mpDoc); + ScCondFrmtEntry* pNewEntry = new ScCondFrmtEntry(this, mpDoc, maPos); maEntries.push_back( pNewEntry ); for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 46938b9544b7..3100d9b6fa60 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -127,8 +127,8 @@ private: DECL_LINK( EntryTypeHdl, ListBox* ); public: - ScCondFrmtEntry( Window* pParent, ScDocument* pDoc ); - ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry ); + ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos ); + ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry, const ScAddress& rPos ); virtual ~ScCondFrmtEntry(); virtual long Notify( NotifyEvent& rNEvt ); |