diff options
author | Armin Le Grand <alg@apache.org> | 2012-08-09 08:42:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-28 15:55:23 +0100 |
commit | 12a4200e8ff7f045efcc7e9d15a24b15b248c437 (patch) | |
tree | 00363aedf07713ec9ff931d933b86a6b35e20267 /include | |
parent | 64b07d99aa0b31b3d04519afe6afe0cdf36bcd6f (diff) |
Related: #i120498# Enhanced Undo/Redo and user experience...
when editing texts in graphic objects and/or tables
(cherry picked from commit a096725779b210c7a2706e72596fd7c80e049fdd)
Conflicts:
editeng/inc/editeng/editeng.hxx
editeng/inc/editeng/editund2.hxx
editeng/inc/editeng/outliner.hxx
editeng/source/editeng/editundo.cxx
editeng/source/editeng/impedit.hxx
editeng/source/outliner/outliner.cxx
sd/source/core/undo/undomanager.cxx
sd/source/ui/view/drviewse.cxx
svx/Library_svxcore.mk
svx/Package_inc.mk
svx/inc/svx/svdedxv.hxx
svx/source/svdraw/svdedxv.cxx
Change-Id: I40e3ef2dff681f9b6f2f6b5d35507071f8110533
Comment unused variable pNewEditUndoManager to silence the compiler
(cherry picked from commit 568655083af7830e7b9edf56ef862ddf9a99003b)
Change-Id: Ib7179ee6c34ce03a75942978831c3a55968f161f
Removed unused variable
(cherry picked from commit 0bbde4414badfd40234de4a4c9f750194f5d1d5e)
Change-Id: I39e7f25426e8e7d1367102d603b0f6c84d96622f
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editeng.hxx | 4 | ||||
-rw-r--r-- | include/editeng/editund2.hxx | 6 | ||||
-rw-r--r-- | include/editeng/outliner.hxx | 4 | ||||
-rw-r--r-- | include/svx/sdrundomanager.hxx | 55 | ||||
-rw-r--r-- | include/svx/svdedxv.hxx | 8 |
5 files changed, 70 insertions, 7 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index e55dbacb9ff6..a3ba78d93e40 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -303,8 +303,8 @@ public: void ShowParagraph( sal_Int32 nParagraph, sal_Bool bShow = sal_True ); - ::svl::IUndoManager& - GetUndoManager(); + ::svl::IUndoManager& GetUndoManager(); + ::svl::IUndoManager* SetUndoManager(::svl::IUndoManager* pNew); void UndoActionStart( sal_uInt16 nId ); void UndoActionStart(sal_uInt16 nId, const ESelection& rSel); void UndoActionEnd( sal_uInt16 nId ); diff --git a/include/editeng/editund2.hxx b/include/editeng/editund2.hxx index 2312aee93c79..b8106288f97e 100644 --- a/include/editeng/editund2.hxx +++ b/include/editeng/editund2.hxx @@ -25,14 +25,16 @@ class EditEngine; -class EDITENG_DLLPRIVATE EditUndoManager : public SfxUndoManager +class EDITENG_DLLPUBLIC EditUndoManager : public SfxUndoManager { using SfxUndoManager::Undo; using SfxUndoManager::Redo; + friend class ImpEditEngine; EditEngine* mpEditEngine; + void SetEditEngine(EditEngine* pNew); public: - EditUndoManager(EditEngine* pEE); + EditUndoManager(sal_uInt16 nMaxUndoActionCount = 20); virtual sal_Bool Undo(); virtual sal_Bool Redo(); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 9848b6af6cc1..8b4b92e32550 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -891,8 +891,8 @@ public: sal_uLong Read( SvStream& rInput, const String& rBaseURL, sal_uInt16, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); - ::svl::IUndoManager& - GetUndoManager(); + ::svl::IUndoManager& GetUndoManager(); + ::svl::IUndoManager* SetUndoManager(::svl::IUndoManager* pNew); void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ); void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ); diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx new file mode 100644 index 000000000000..0d899f647aa9 --- /dev/null +++ b/include/svx/sdrundomanager.hxx @@ -0,0 +1,55 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SDR_UNDOMANAGER_HXX +#define _SDR_UNDOMANAGER_HXX + +#include "svx/svxdllapi.h" +#include <sal/types.h> +#include <editeng/editund2.hxx> +#include <tools/link.hxx> + +////////////////////////////////////////////////////////////////////////////// + +class SVX_DLLPUBLIC SdrUndoManager : public EditUndoManager +{ +private: + using EditUndoManager::Undo; + using EditUndoManager::Redo; + + Link maEndTextEditHdl; + SfxUndoAction* mpLastUndoActionBeforeTextEdit; + +public: + SdrUndoManager(sal_uInt16 nMaxUndoActionCount = 20); + virtual ~SdrUndoManager(); + + /// react depending on edit mode and if no more undo is possible + virtual sal_Bool Undo(); + virtual sal_Bool Redo(); + + // Call for the view which starts the interactive text edit. Use link to + // activate (start text edit) and empty link to reset (end text edit). On + // reset all text edit actions will be removed from this undo manager to + // restore the state before activation + void SetEndTextEditHdl(const Link& rLink); +}; + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_UNDOMANAGER_HXX +// eof diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index f1ec6296b3f2..c0d8a2a2eaac 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -38,6 +38,7 @@ class EditStatus; class EditFieldInfo; class ImpSdrEditPara; struct PasteOrDropInfos; +class SdrUndoManager; namespace com { namespace sun { namespace star { namespace uno { class Any; @@ -97,7 +98,7 @@ protected: Link aOldCalcFieldValueLink; // Zum rufen des alten Handlers Point aMacroDownPos; - sal_uInt16 nMacroTol; + sal_uInt16 nMacroTol; unsigned bTextEditDontDelete : 1; // Outliner und View bei SdrEndTextEdit nicht deleten (f. Rechtschreibpruefung) unsigned bTextEditOnlyOneView : 1; // Nur eine OutlinerView (f. Rechtschreibpruefung) @@ -110,6 +111,8 @@ protected: rtl::Reference< sdr::SelectionController > mxLastSelectionController; private: + ::svl::IUndoManager* mpOldTextEditUndoManager; + SVX_DLLPRIVATE void ImpClearVars(); protected: @@ -130,6 +133,9 @@ protected: DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*); DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*); + // link for EndTextEditHdl + DECL_LINK(EndTextEditHdl, SdrUndoManager*); + void ImpMacroUp(const Point& rUpPos); void ImpMacroDown(const Point& rDownPos); |