summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-08-02 17:52:44 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-02 17:33:17 +0000
commitb567278c4aa6e3dee331b60c71eb996babcc9d08 (patch)
treec459be957e7e3146f1854e72e755bcdfdca06743 /editeng
parentdb686815b41c52598f0952613ff8c6be34b2f0e0 (diff)
editeng: implement SfxUndoAction::GetViewShellId() interface in EditUndo
With this, e.g. inserting a character in a Writer shape text remembers its view shell. Change-Id: Ic82a3f45a66cf622496e3131390d365440dffb3b Reviewed-on: https://gerrit.libreoffice.org/27796 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editundo.cxx11
-rw-r--r--editeng/source/editeng/impedit.cxx5
-rw-r--r--editeng/source/editeng/impedit.hxx1
3 files changed, 16 insertions, 1 deletions
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index faea53b4acea..62d7e3fd8808 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -118,8 +118,12 @@ bool EditUndoManager::Redo()
}
EditUndo::EditUndo(sal_uInt16 nI, EditEngine* pEE) :
- nId(nI), mpEditEngine(pEE)
+ nId(nI), mnViewShellId(-1), mpEditEngine(pEE)
{
+ const EditView* pEditView = mpEditEngine ? mpEditEngine->GetActiveView() : nullptr;
+ const OutlinerViewShell* pViewShell = pEditView ? pEditView->GetImpEditView()->GetViewShell() : nullptr;
+ if (pViewShell)
+ mnViewShellId = pViewShell->GetViewShellId();
}
EditUndo::~EditUndo()
@@ -147,6 +151,11 @@ OUString EditUndo::GetComment() const
return aComment;
}
+sal_Int32 EditUndo::GetViewShellId() const
+{
+ return mnViewShellId;
+}
+
EditUndoDelContent::EditUndoDelContent(
EditEngine* pEE, ContentNode* pNode, sal_Int32 nPortion) :
EditUndo(EDITUNDO_DELCONTENT, pEE),
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index b3cf78477bbc..13a53acfc0f7 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -122,6 +122,11 @@ void ImpEditView::RegisterViewShell(OutlinerViewShell* pViewShell)
mpViewShell = pViewShell;
}
+const OutlinerViewShell* ImpEditView::GetViewShell() const
+{
+ return mpViewShell;
+}
+
void ImpEditView::SetEditSelection( const EditSelection& rEditSelection )
{
// set state before notification
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 4dd335634195..cc7362e8e809 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -369,6 +369,7 @@ public:
/// Informs this edit view about which view shell contains it.
void RegisterViewShell(OutlinerViewShell* pViewShell);
+ const OutlinerViewShell* GetViewShell() const;
bool IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong );
OUString SpellIgnoreWord();