summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@collabora.com>2020-09-10 15:23:26 +0300
committerAndras Timar <andras.timar@collabora.com>2020-10-13 14:56:44 +0200
commit037b3c3cdb069600d5b97cf221682c144cf5b533 (patch)
tree3985add4046215d8df00d8f1f200fae91666681c /sw
parentd90a404a078b9fc1baa98ec0eb3d6a90f869b336 (diff)
leaflet: User may continue writing a comment after it loses focus/core part.
This path enables Online users to continue writing their comment after they click somewhere else in the document. Online side will remember original position of comment and it will send the cursor position when needed. When there is no cursor position, default behaviour will work. Change-Id: Ided951481af6e0ec6c930e125bec7fdf687614d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102377 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/sdi/swriter.sdi2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx13
2 files changed, 14 insertions, 1 deletions
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 6a394660c04f..199dc6dba55f 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2485,7 +2485,7 @@ SfxVoidItem IndexMarkToIndex FN_IDX_MARK_TO_IDX
]
SfxVoidItem InsertAnnotation FN_POSTIT
-(SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,SvxPostItDateItem Date SID_ATTR_POSTIT_DATE)
+(SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,SvxPostItDateItem Date SID_ATTR_POSTIT_DATE,SvxPostItTextItem pointX SID_ATTR_POSTIT_X, SvxPostItTextItem pointY SID_ATTR_POSTIT_Y)
[
AutoUpdate = FALSE,
FastCall = FALSE,
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 9eb00d361b9a..045ea5ceed7b 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1927,6 +1927,19 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq)
sText = GetView().GetPostItMgr()->GetAnswerText();
GetView().GetPostItMgr()->RegisterAnswerText(OUString());
}
+ else
+ {
+ const SvxPostItTextItem* pXItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_X);
+ const SvxPostItTextItem* pYItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_Y);
+ // We allow Online users to begin a comment, click somewhere else and save comment. When comment is saved, its initial position is sent.
+ if (pXItem && pYItem)
+ {
+ sal_Int32 pointX = (*pXItem).GetValue().toInt32();
+ sal_Int32 pointY = (*pYItem).GetValue().toInt32();
+ Point point(pointX, pointY);
+ SwCursorShell::SetCursor(point);
+ }
+ }
if ( HasSelection() && !IsTableMode() )
{