diff options
-rw-r--r-- | include/svx/svdmodel.hxx | 4 | ||||
-rw-r--r-- | sc/inc/drwlayer.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen9.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/futext3.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun6.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 1 |
12 files changed, 34 insertions, 21 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 3a078bffa5c0..97471b6c25b6 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 7392a058b88a..bd4191a9053c 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 525f12d06029..2938009d74c5 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 fccbbdabaa19..363969c9c92d 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 5a4b6fd62c89..1c35fd65f02f 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 6e8cd1c81173..2f1f0e2e8855 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 137188a68edb..0a42f79106a1 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 88395f402f71..8bd69d3e2db3 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 b61c9fffe0a6..9927e8691cb6 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 150cc25ecd77..8ed8c24c9032 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 886064ca105b..06119bb91e52 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 e2111226ef15..4ff6730d8561 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 ); |