[Libreoffice-commits] core.git: include/svx sc/inc sc/source svx/source

Armin Le Grand alg at apache.org
Thu Jun 27 08:09:54 PDT 2013


 include/svx/svdmodel.hxx           |    4 ++++
 sc/inc/drwlayer.hxx                |    2 +-
 sc/source/core/data/documen9.cxx   |    2 +-
 sc/source/core/data/drwlayer.cxx   |    4 +++-
 sc/source/ui/docshell/dbdocfun.cxx |    2 +-
 sc/source/ui/docshell/docfunc.cxx  |   18 +++++++++---------
 sc/source/ui/drawfunc/futext3.cxx  |   12 ++++++++----
 sc/source/ui/view/drawview.cxx     |    2 +-
 sc/source/ui/view/viewfun6.cxx     |    2 +-
 svx/source/svdraw/svdedxv.cxx      |    4 ++--
 svx/source/svdraw/svdmodel.cxx     |    2 ++
 svx/source/svdraw/svdundo.cxx      |    1 +
 12 files changed, 34 insertions(+), 21 deletions(-)

New commits:
commit ecccfa73b9c69a5d9645a2647f20a37588a63a8e
Author: Armin Le Grand <alg at apache.org>
Date:   Thu Jun 27 10:23:24 2013 +0000

    Resolves: #i121008# corrected calc cell comment stuff
    
    (cherry picked from commit fb1dc1d963e192e588731cce3a3ba20996c4e589)
    
    Conflicts:
    	sc/source/core/data/drwlayer.cxx
    	svx/inc/svx/svdmodel.hxx
    	svx/source/svdraw/svdmodel.cxx
    	svx/source/svdraw/svdundo.cxx
    
    Change-Id: I10b644aa44ae8c1eb0a027aeeaf27790ec455fa2

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 3a078bf..97471b6 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -209,6 +209,7 @@ protected:
     bool            bSaveOLEPreview:1;      // save preview metafile of OLE objects
     bool            bSaveNative:1;
     bool            bStarDrawPreviewMode:1;
+    bool            mbDisableTextEditUsesCommonUndoManager:1;
     sal_uInt16          nStreamCompressMode;  // Komprimiert schreiben?
     sal_uInt16          nStreamNumberFormat;
     sal_uInt16          nDefaultTabulator;
@@ -630,6 +631,9 @@ public:
     void    SetStarDrawPreviewMode(sal_Bool bPreview);
     sal_Bool    IsStarDrawPreviewMode() { return bStarDrawPreviewMode; }
 
+    bool GetDisableTextEditUsesCommonUndoManager() const { return mbDisableTextEditUsesCommonUndoManager; }
+    void SetDisableTextEditUsesCommonUndoManager(bool bNew) { mbDisableTextEditUsesCommonUndoManager = bNew; }
+
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoModel();
     void setUnoModel( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xModel );
 
diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx
index 7392a05..bd4191a 100644
--- a/sc/inc/drwlayer.hxx
+++ b/sc/inc/drwlayer.hxx
@@ -125,7 +125,7 @@ public:
 
     void            EnableAdjust( sal_Bool bSet = sal_True )    { bAdjustEnabled = bSet; }
 
-    void            BeginCalcUndo();
+    void            BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager);
     SdrUndoGroup*   GetCalcUndo();
     sal_Bool            IsRecording() const         { return bRecording; }
     void            AddCalcUndo( SdrUndoAction* pUndo );
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 525f12d..2938009 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -67,7 +67,7 @@ SfxBroadcaster* ScDocument::GetDrawBroadcaster()
 void ScDocument::BeginDrawUndo()
 {
     if (pDrawLayer)
-        pDrawLayer->BeginCalcUndo();
+        pDrawLayer->BeginCalcUndo(false);
 }
 
 rtl::Reference<XColorList> ScDocument::GetColorList()
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index fccbbda..363969c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1025,8 +1025,9 @@ void ScDrawLayer::AddCalcUndo( SdrUndoAction* pUndo )
         delete pUndo;
 }
 
-void ScDrawLayer::BeginCalcUndo()
+void ScDrawLayer::BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager)
 {
+    SetDisableTextEditUsesCommonUndoManager(bDisableTextEditUsesCommonUndoManager);
     DELETEZ(pUndoGroup);
     bRecording = sal_True;
 }
@@ -1036,6 +1037,7 @@ SdrUndoGroup* ScDrawLayer::GetCalcUndo()
     SdrUndoGroup* pRet = pUndoGroup;
     pUndoGroup = NULL;
     bRecording = false;
+    SetDisableTextEditUsesCommonUndoManager(false);
     return pRet;
 }
 
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 5a4b6fd..1c35fd6 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -556,7 +556,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
 
         // #i59745# collect all drawing undo actions affecting cell note captions
         if( pDrawLayer )
-            pDrawLayer->BeginCalcUndo();
+            pDrawLayer->BeginCalcUndo(false);
     }
 
     if ( bCopy )
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 6e8cd1c..2f1f0e2 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -182,7 +182,7 @@ sal_Bool ScDocFunc::DetectiveAddPred(const ScAddress& rPos)
     SCTAB nTab = rPos.Tab();
 
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowPred( nCol, nRow );
     SdrUndoGroup* pUndo = NULL;
     if (bUndo)
@@ -223,7 +223,7 @@ sal_Bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos)
     SCTAB nTab = rPos.Tab();
 
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).DeletePred( nCol, nRow );
     SdrUndoGroup* pUndo = NULL;
     if (bUndo)
@@ -262,7 +262,7 @@ sal_Bool ScDocFunc::DetectiveAddSucc(const ScAddress& rPos)
     SCTAB nTab = rPos.Tab();
 
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowSucc( nCol, nRow );
     SdrUndoGroup* pUndo = NULL;
     if (bUndo)
@@ -303,7 +303,7 @@ sal_Bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos)
     SCTAB nTab = rPos.Tab();
 
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).DeleteSucc( nCol, nRow );
     SdrUndoGroup* pUndo = NULL;
     if (bUndo)
@@ -342,7 +342,7 @@ sal_Bool ScDocFunc::DetectiveAddError(const ScAddress& rPos)
     SCTAB nTab = rPos.Tab();
 
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).ShowError( nCol, nRow );
     SdrUndoGroup* pUndo = NULL;
     if (bUndo)
@@ -381,7 +381,7 @@ sal_Bool ScDocFunc::DetectiveMarkInvalid(SCTAB nTab)
     if (pWaitWin)
         pWaitWin->EnterWait();
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bOverflow;
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).MarkInvalid( bOverflow );
     SdrUndoGroup* pUndo = NULL;
@@ -421,7 +421,7 @@ sal_Bool ScDocFunc::DetectiveDelAll(SCTAB nTab)
     ScDocShellModificator aModificator( rDocShell );
 
     if (bUndo)
-        pModel->BeginCalcUndo();
+        pModel->BeginCalcUndo(false);
     sal_Bool bDone = ScDetectiveFunc( pDoc,nTab ).DeleteAll( SC_DET_DETECTIVE );
     SdrUndoGroup* pUndo = NULL;
     if (bUndo)
@@ -463,7 +463,7 @@ sal_Bool ScDocFunc::DetectiveRefresh( sal_Bool bAutomatic )
         rDocShell.MakeDrawLayer();
         ScDrawLayer* pModel = pDoc->GetDrawLayer();
         if (bUndo)
-            pModel->BeginCalcUndo();
+            pModel->BeginCalcUndo(false);
 
         //  Loeschen auf allen Tabellen
 
@@ -1219,7 +1219,7 @@ bool ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c
 
         // collect drawing undo actions for deleting/inserting caption obejcts
         if( pUndoMgr )
-            pDrawLayer->BeginCalcUndo();
+            pDrawLayer->BeginCalcUndo(false);
 
         // delete the note (creates drawing undo action for the caption object)
         delete pOldNote;
diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx
index 137188a..0a42f79 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -81,14 +81,18 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
     {
         /*  Put all undo actions already collected (e.g. create caption object)
             and all following undo actions (text changed) together into a ListAction. */
-        String aUndoStr = ScGlobal::GetRscString( STR_UNDO_EDITNOTE );
-        pUndoMgr->EnterListAction( aUndoStr, aUndoStr );
-        if( SdrUndoGroup* pCalcUndo = pDrawLayer->GetCalcUndo() )
+        SdrUndoGroup* pCalcUndo = pDrawLayer->GetCalcUndo();
+
+        if(pCalcUndo)
         {
+            const String aUndoStr = ScGlobal::GetRscString( STR_UNDO_EDITNOTE );
+            pUndoMgr->EnterListAction( aUndoStr, aUndoStr );
+
             /*  Note has been created before editing, if first undo action is
                 an insert action. Needed below to decide whether to drop the
                 undo if editing a new note has been cancelled. */
             bNewNote = (pCalcUndo->GetActionCount() > 0) && pCalcUndo->GetAction( 0 )->ISA( SdrUndoNewObj );
+
             // create a "insert note" undo action if needed
             if( bNewNote )
                 pUndoMgr->AddUndoAction( new ScUndoReplaceNote( *pDocShell, aNotePos, pNote->GetNoteData(), true, pCalcUndo ) );
@@ -134,7 +138,7 @@ void FuText::StopEditMode(sal_Bool /*bTextDirection*/)
             if( pUndoMgr )
             {
                 // collect the "remove object" drawing undo action created by DeleteNote()
-                pDrawLayer->BeginCalcUndo();
+                pDrawLayer->BeginCalcUndo(false);
                 // rescue note data before deletion
                 ScNoteData aNoteData( pNote->GetNoteData() );
                 // delete note from document (removes caption, but does not delete it)
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 88395f4..8bd69d3 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -758,7 +758,7 @@ void ScDrawView::DeleteMarked()
             OSL_ENSURE( aNoteData.mpCaption == pCaptObj, "ScDrawView::DeleteMarked - caption object does not match" );
             // collect the drawing undo action created while deleting the note
             if( bUndo )
-                pDrawLayer->BeginCalcUndo();
+                pDrawLayer->BeginCalcUndo(false);
             // delete the note (already removed from document above)
             delete pNote;
             // add the undo action for the note
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index b61c9ff..9927e86 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -290,7 +290,7 @@ void ScViewFunc::EditNote()
     // start drawing undo to catch undo action for insertion of the caption object
     pDocSh->MakeDrawLayer();
     ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
-    pDrawLayer->BeginCalcUndo();
+    pDrawLayer->BeginCalcUndo(true);
     // generated undo action is processed in FuText::StopEditMode
 
     // get existing note or create a new note (including caption drawing object)
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 150cc25..8ed8c24 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -745,7 +745,7 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
             if( mxSelectionController.is() )
                 mxSelectionController->onSelectionHasChanged();
 
-            if(IsUndoEnabled())
+            if(IsUndoEnabled() && GetModel() && !GetModel()->GetDisableTextEditUsesCommonUndoManager())
             {
                 SdrUndoManager* pSdrUndoManager = getSdrUndoManagerForEnhancedTextEdit();
 
@@ -827,7 +827,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
     SdrUndoManager* pUndoEditUndoManager = 0;
     bool bNeedToUndoSavedRedoTextEdit(false);
 
-    if(IsUndoEnabled() && GetModel() && pTEObj && pTEOutliner)
+    if(IsUndoEnabled() && GetModel() && pTEObj && pTEOutliner && !GetModel()->GetDisableTextEditUsesCommonUndoManager())
     {
         // change back the UndoManager to the remembered original one
         ::svl::IUndoManager* pOriginal = pTEOutliner->SetUndoManager(mpOldTextEditUndoManager);
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 886064c..06119bb 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -167,6 +167,8 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
     mbAddExtLeading = sal_False;
     mnHandoutPageCount = 0;
 
+    mbDisableTextEditUsesCommonUndoManager = false;
+
     mnCharCompressType =
         officecfg::Office::Common::AsianLayout::CompressCharacterDistance::
         get();
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index e211122..4ff6730 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -1167,6 +1167,7 @@ void SdrUndoObjSetText::Undo()
         // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
         OutlinerParaObject* pText1 = pOldText ? new OutlinerParaObject(*pOldText) : NULL;
         pText->SetOutlinerParaObject(pText1);
+        static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText );
     }
 
     pObj->SetEmptyPresObj( bEmptyPresObj );


More information about the Libreoffice-commits mailing list