summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-06-27 10:23:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-27 16:09:32 +0100
commitecccfa73b9c69a5d9645a2647f20a37588a63a8e (patch)
tree7fa7ae50294316c343a4694d8fc41e75f5f0aca9 /sc
parent21eeeccfa64a4c03554c1fe3715d38c1695245ab (diff)
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
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/drwlayer.hxx2
-rw-r--r--sc/source/core/data/documen9.cxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx4
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx18
-rw-r--r--sc/source/ui/drawfunc/futext3.cxx12
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--sc/source/ui/view/viewfun6.cxx2
8 files changed, 25 insertions, 19 deletions
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)