sc/source/core/data/documen2.cxx | 6 ++++++ sc/source/ui/condformat/condformatdlg.cxx | 14 ++++++++------ sc/source/ui/inc/condformatdlg.hxx | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-)
New commits: commit cbd98c547af4fac641204fb56149e9d7af9ec075 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jul 27 23:03:22 2012 +0200 copy conditional formats with sheets, fdo#52457 Change-Id: Ic7a337e8a6b36fecbd3aad0e3366fd6f0ccc99c6 diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index d537c35..1a49d63 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -871,6 +871,12 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM SetNoListening( false ); maTabs[nOldPos]->StartAllListeners(); maTabs[nNewPos]->StartAllListeners(); + + ScConditionalFormatList* pNewList = new ScConditionalFormatList(*maTabs[nOldPos]->GetCondFormList()); + pNewList->UpdateReference(URM_COPY, ScRange( 0, 0, nNewPos , MAXCOL, MAXROW, + nNewPos), 0, 0, nDz); + maTabs[nNewPos]->SetCondFormList( pNewList ); + SetDirty(); SetAutoCalc( bOldAutoCalc ); commit 06b5dfff3aa3005093d427e368ae5eeb5f2ad948 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jul 27 22:40:18 2012 +0200 use correct cursor pos for cond format formulas, fdo#52565 Change-Id: I4e270a8c8ee60a6ab9a3d3b717db2c1243a34e1d diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index f77fe37..641b02e 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 46938b9..3100d9b 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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits