diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-27 17:39:10 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 00:51:02 +0100 |
commit | 7870e90da5bf4de44cfa82209ba06cd4d1cfb1a2 (patch) | |
tree | 1379702d5660c33c5e6460d4e6bb12cc8d379bd3 /sw | |
parent | a3dccb818902756dd1dcd818c153345a0b48abf6 (diff) |
lok: Allow to edit comment by postit id
Change-Id: Ice1d40b7813226fe99c423047392b3416d763dd4
Reviewed-on: https://gerrit.libreoffice.org/33614
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 8a7c459f6afb7b8f1f622a61230a0a4411a417ac)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/AnnotationWin.hxx | 1 | ||||
-rw-r--r-- | sw/sdi/_textsh.sdi | 5 | ||||
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 16 |
4 files changed, 29 insertions, 0 deletions
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx index 0062f96481e5..6186576813f2 100644 --- a/sw/inc/AnnotationWin.hxx +++ b/sw/inc/AnnotationWin.hxx @@ -45,6 +45,7 @@ class SwAnnotationWin : public sw::sidebarwindows::SwSidebarWin virtual void Delete() override; virtual void GotoPos() override; inline const SwPostItField* GetPostItField() { return mpField; } + void UpdateText(const OUString& aText); virtual OUString GetAuthor() override; virtual Date GetDate() override; diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 388690dfa3cc..eec76a38ed58 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -924,6 +924,11 @@ interface BaseText ExecMethod = ExecField; StateMethod = StateField; ] + SID_EDIT_POSTIT + [ + ExecMethod = ExecField; + StateMethod = StateField; + ] FN_DELETE_COMMENT [ ExecMethod = ExecField ; diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 5ecc03a0d930..b606cee379cf 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -300,6 +300,13 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText) Engine()->GetUndoManager().Clear(); } +void SwAnnotationWin::UpdateText(const OUString& aText) +{ + Engine()->Clear(); + GetOutlinerView()->InsertText(aText); + UpdateData(); +} + SvxLanguageItem SwAnnotationWin::GetLanguage() { // set initial language for outliner diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 096cd8dbe98d..8b5b8e33c833 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -478,6 +478,22 @@ void SwTextShell::ExecField(SfxRequest &rReq) } } break; + case SID_EDIT_POSTIT: + { + const SvxPostItIdItem* pIdItem = rReq.GetArg<SvxPostItIdItem>(SID_ATTR_POSTIT_ID); + if (pIdItem && pIdItem->GetValue()) + { + const SvxPostItTextItem* pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT); + OUString sText; + if ( pTextItem ) + sText = pTextItem->GetValue(); + + sw::annotation::SwAnnotationWin* pAnnotationWin = GetView().GetPostItMgr()->GetAnnotationWin(pIdItem->GetValue()); + if (pAnnotationWin) + pAnnotationWin->UpdateText(sText); + } + } + break; case FN_REDLINE_COMMENT: { /* this code can be used once we want redline comments in the margin, all other stuff can |