summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/arealink.cxx
diff options
context:
space:
mode:
authorSascha Ballach <sab@openoffice.org>2001-02-14 14:34:08 +0000
committerSascha Ballach <sab@openoffice.org>2001-02-14 14:34:08 +0000
commit5c273292934d3fbb579cf3b7c5e9a0cc65a61eb1 (patch)
treed86c14fd1e00388aef45a3750a3c3100f5fcd5dd /sc/source/ui/docshell/arealink.cxx
parent2959e73ee1acaa3cd416f483a9e3129978aa992d (diff)
only create undos if ScDocument::IsUndoEnabled
Diffstat (limited to 'sc/source/ui/docshell/arealink.cxx')
-rw-r--r--sc/source/ui/docshell/arealink.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 51886fb1bc2a..36bf4ab1be91 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: arealink.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: nn $ $Date: 2000-12-11 11:30:49 $
+ * last change: $Author: sab $ $Date: 2001-02-14 15:31:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,7 +174,9 @@ void __EXPORT ScAreaLink::Closed()
{
// Verknuepfung loeschen: Undo
- if (bAddUndo)
+ ScDocument* pDoc = pDocShell->GetDocument();
+ BOOL bUndo (pDoc->IsUndoEnabled());
+ if (bAddUndo && bUndo)
{
pDocShell->GetUndoManager()->AddUndoAction( new ScUndoRemoveAreaLink( pDocShell,
aFileName, aFilterName, aOptions,
@@ -225,6 +227,8 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
return FALSE;
ScDocument* pDoc = pDocShell->GetDocument();
+
+ BOOL bUndo (pDoc->IsUndoEnabled());
pDoc->SetInLinkUpdate( TRUE );
// wenn neuer Filter ausgewaehlt wurde, Optionen vergessen
@@ -309,7 +313,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
ScDocument* pUndoDoc = NULL;
ScDocument* pRedoDoc = NULL;
- if ( bAddUndo )
+ if ( bAddUndo && bUndo )
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
if ( bDoInsert )
@@ -379,7 +383,7 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
// Undo eintragen
- if ( bAddUndo )
+ if ( bAddUndo && bUndo)
{
pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, nDestTab, nDestTab );