diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-02 19:35:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-02 18:57:57 +0000 |
commit | c86e89c5bb040786193f7b8bba8516ffa706a14a (patch) | |
tree | 9ab0b6a314da288d1caa1d80fd4b7baa2c3e06bd /editeng | |
parent | c82a81bbda104ef08dd9e18725a09475b2d65183 (diff) |
editeng: track view shells in SfxListUndoActions
This is needed for e.g. tracking deletions by backspace in Writer shape
text.
Change-Id: I6f873872566313096c2c57f4a13ac2f1db67e77d
Reviewed-on: https://gerrit.libreoffice.org/27807
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index cc7362e8e809..f74d05ab76b0 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -685,6 +685,8 @@ private: void ImplUpdateOverflowingLineNum( sal_uInt32, sal_uInt32, sal_uInt32 ); SpellInfo * CreateSpellInfo( bool bMultipleDocs ); + /// Obtains a view shell ID from the active EditView. + sal_Int32 CreateViewShellId(); ImpEditEngine(EditEngine* pEditEngine, SfxItemPool* pPool); void InitDoc(bool bKeepParaAttribs); diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 4dc34fc855f3..e360c0ad3c00 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -222,11 +222,23 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S return pUndo; } +sal_Int32 ImpEditEngine::CreateViewShellId() +{ + sal_Int32 nRet = -1; + + const EditView* pEditView = pEditEngine ? pEditEngine->GetActiveView() : nullptr; + const OutlinerViewShell* pViewShell = pEditView ? pEditView->GetImpEditView()->GetViewShell() : nullptr; + if (pViewShell) + nRet = pViewShell->GetViewShellId(); + + return nRet; +} + void ImpEditEngine::UndoActionStart( sal_uInt16 nId, const ESelection& aSel ) { if ( IsUndoEnabled() && !IsInUndo() ) { - GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( nId ), OUString(), nId, -1 ); + GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( nId ), OUString(), nId, CreateViewShellId() ); DBG_ASSERT( !pUndoMarkSelection, "UndoAction SelectionMarker?" ); pUndoMarkSelection = new ESelection( aSel ); } @@ -236,7 +248,7 @@ void ImpEditEngine::UndoActionStart( sal_uInt16 nId ) { if ( IsUndoEnabled() && !IsInUndo() ) { - GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( nId ), OUString(), nId, -1 ); + GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( nId ), OUString(), nId, CreateViewShellId() ); DBG_ASSERT( !pUndoMarkSelection, "UndoAction SelectionMarker?" ); } } |