[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - sc/source

Eike Rathke erack at kemper.freedesktop.org
Mon Jul 30 13:13:26 PDT 2012


 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 71e6a74ca6f77db134cbde5ebea1338cd64439e0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jul 27 23:03:22 2012 +0200

    copy conditional formats with sheets, fdo#52457
    
    Change-Id: Ic7a337e8a6b36fecbd3aad0e3366fd6f0ccc99c6
    (cherry picked from commit cbd98c547af4fac641204fb56149e9d7af9ec075)
    
    Signed-off-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index f072f87..e543173 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -877,6 +877,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 77792fef0f7d199dab5c3bc065410968c7e6680b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jul 27 22:40:18 2012 +0200

    use correct cursor pos for cond format formulas, fdo#52565
    
    Change-Id: I4e270a8c8ee60a6ab9a3d3b717db2c1243a34e1d
    (cherry picked from commit 06b5dfff3aa3005093d427e368ae5eeb5f2ad948)
    
    Signed-off-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 643efdb..5c6d0f2 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();
@@ -980,7 +982,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 ));
         }
     }
 
@@ -1064,7 +1066,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)
@@ -1088,7 +1090,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 298b357..ca96ca1 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 );


More information about the Libreoffice-commits mailing list