summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-06-04 16:21:29 +0000
committerKurt Zenker <kz@openoffice.org>2009-06-04 16:21:29 +0000
commit7470d7bd81ab783f5d46cfc8391a9b8c301d6aff (patch)
tree815505fbcf555f3062427a5d5942c9ab24b73bdb
parenta3acf41195f4c39cba7950c389dc817b824f76ed (diff)
CWS-TOOLING: integrate CWS clnoundo
2009-05-18 09:40:22 +0200 wg r271998 : i102011 2009-04-28 12:20:24 +0200 cl r271318 : CWS-TOOLING: rebase CWS clnoundo to trunk@270723 (milestone: DEV300:m46) 2009-04-02 11:37:14 +0200 cl r270388 : #i100371# check valid positions all the time to avoid crashes during model lock 2009-03-30 13:02:27 +0200 cl r270219 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:59:41 +0200 cl r270218 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:55:06 +0200 cl r270217 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:53:27 +0200 cl r270216 : #i100371# do not create undo actions in drawing layer during load 2009-03-30 12:49:28 +0200 cl r270215 : #i100371# added EnableUndo() and IsUndoEnabled()
-rw-r--r--sc/inc/document.hxx11
-rw-r--r--sc/source/core/data/documen2.cxx3
-rw-r--r--sc/source/core/data/document.cxx13
-rw-r--r--sc/source/ui/docshell/docsh.cxx8
-rw-r--r--sc/source/ui/inc/docsh.hxx1
5 files changed, 26 insertions, 10 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index e21b0af336f0..66f52fa5c2a8 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -136,6 +136,7 @@ class ScAutoNameCache;
class ScTemporaryChartLock;
class ScLookupCache;
struct ScLookupCacheMapImpl;
+class SfxUndoManager;
namespace com { namespace sun { namespace star {
namespace lang {
@@ -232,6 +233,7 @@ friend class ScHorizontalCellIterator;
friend class ScHorizontalAttrIterator;
friend class ScDocAttrIterator;
friend class ScAttrRectIterator;
+friend class ScDocShell;
#if OLD_PIVOT_IMPLEMENTATION
friend class ScPivot;
#endif
@@ -241,6 +243,7 @@ private:
vos::ORef<ScPoolHelper> xPoolHelper;
+ SfxUndoManager* mpUndoManager;
ScFieldEditEngine* pEditEngine; // uses pEditPool from xPoolHelper
ScNoteEditEngine* pNoteEngine; // uses pEditPool from xPoolHelper
SfxItemPool* pNoteItemPool; // SfxItemPool to be used if pDrawLayer not created.
@@ -407,7 +410,7 @@ private:
mutable BOOL bStyleSheetUsageInvalid;
- BOOL bUndoEnabled;
+ bool mbUndoEnabled;
bool mbAdjustHeightEnabled;
bool mbExecuteLinkEnabled;
bool mbChangeReadOnlyEnabled; // allow changes in read-only document (for API import filters)
@@ -914,8 +917,9 @@ public:
BOOL IsClipOrUndo() const { return bIsClip || bIsUndo; }
BOOL IsUndo() const { return bIsUndo; }
BOOL IsClipboard() const { return bIsClip; }
- BOOL IsUndoEnabled() const { return bUndoEnabled; }
- void EnableUndo( BOOL bVal ) { bUndoEnabled = bVal; }
+ bool IsUndoEnabled() const { return mbUndoEnabled; }
+ void EnableUndo( bool bVal );
+
bool IsAdjustHeightEnabled() const { return mbAdjustHeightEnabled; }
void EnableAdjustHeight( bool bVal ) { mbAdjustHeightEnabled = bVal; }
bool IsExecuteLinkEnabled() const { return mbExecuteLinkEnabled; }
@@ -1678,6 +1682,7 @@ public:
formula::FormulaGrammar::Grammar GetStorageGrammar() const
{ return eStorageGrammar; }
+ SfxUndoManager* GetUndoManager();
private: // CLOOK-Impl-Methoden
void ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen?
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 1ef50cf30fd7..f5dbb14e9ff9 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -124,6 +124,7 @@ private:
ScDocument::ScDocument( ScDocumentMode eMode,
SfxObjectShell* pDocShell ) :
xServiceManager( ::comphelper::getProcessServiceFactory() ),
+ mpUndoManager( NULL ),
pEditEngine( NULL ),
pNoteEngine( NULL ),
pNoteItemPool( NULL ),
@@ -211,7 +212,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
bInUnoListenerCall( FALSE ),
eGrammar( formula::FormulaGrammar::GRAM_NATIVE ),
bStyleSheetUsageInvalid( TRUE ),
- bUndoEnabled( TRUE ),
+ mbUndoEnabled( true ),
mbAdjustHeightEnabled( true ),
mbExecuteLinkEnabled( true ),
mbChangeReadOnlyEnabled( false ),
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8353c0cee8c3..bdca03b861c1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4475,5 +4475,18 @@ BOOL ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const
return FALSE; // sonst nicht
}
+SfxUndoManager* ScDocument::GetUndoManager()
+{
+ if (!mpUndoManager)
+ mpUndoManager = new SfxUndoManager;
+ return mpUndoManager;
+}
+
+
+void ScDocument::EnableUndo( bool bVal )
+{
+ GetUndoManager()->EnableUndo(bVal);
+ mbUndoEnabled = bVal;
+}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a702e6763374..af68160ebae8 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2167,7 +2167,6 @@ BOOL ScDocShell::HasAutomaticTableName( const String& rFilter ) // static
aDdeTextFmt(String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TEXT"))), \
nPrtToScreenFactor( 1.0 ), \
pImpl ( new DocShell_Impl ), \
- pUndoManager ( NULL ), \
bHeaderOn ( TRUE ), \
bFooterOn ( TRUE ), \
bNoInformLost ( TRUE ), \
@@ -2267,7 +2266,8 @@ __EXPORT ScDocShell::~ScDocShell()
pSfxApp->RemoveDdeTopic( this );
delete pDocFunc;
- delete pUndoManager;
+ delete aDocument.mpUndoManager;
+ aDocument.mpUndoManager = 0;
delete pImpl;
delete pPaintLockData;
@@ -2288,9 +2288,7 @@ __EXPORT ScDocShell::~ScDocShell()
SfxUndoManager* __EXPORT ScDocShell::GetUndoManager()
{
- if (!pUndoManager)
- pUndoManager = new SfxUndoManager;
- return pUndoManager;
+ return aDocument.GetUndoManager();
}
void ScDocShell::SetModified( BOOL bModified )
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index f8bfc53ddf44..df102a54f355 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -103,7 +103,6 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
double nPrtToScreenFactor;
//! FontList* pFontList;
DocShell_Impl* pImpl;
- SfxUndoManager* pUndoManager;
ScDocFunc* pDocFunc;
//SfxObjectCreateMode eShellMode;