include/svx/svxids.hrc | 8 ++++++-- sw/sdi/swriter.sdi | 2 +- sw/source/uibase/wrtsh/wrtsh1.cxx | 13 +++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-)
New commits: commit 02229783378c2f7ba495f7062620b5726872fcb7 Author: gokaysatir <[email protected]> AuthorDate: Thu Sep 10 15:23:26 2020 +0300 Commit: Andras Timar <[email protected]> CommitDate: Wed Apr 7 23:21:58 2021 +0200 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 <[email protected]> Reviewed-by: Henry Castro <[email protected]> Reviewed-by: Andras Timar <[email protected]> diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index c057e16d81d7..fbb961c9c4cd 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -207,7 +207,6 @@ class SvxSetItem; #define SID_ATTR_POSTIT_DATE TypedWhichId<SvxPostItDateItem>( SID_SVX_START + 45 ) #define SID_ATTR_POSTIT_TEXT TypedWhichId<SvxPostItTextItem>( SID_SVX_START + 46 ) #define SID_ATTR_POSTIT_ID TypedWhichId<SvxPostItIdItem>( SID_SVX_START + 47 ) -// free // CAUTION! Range <48 .. 49> used by EditEngine (!) @@ -251,7 +250,7 @@ class SvxSetItem; #define SID_ATTR_TRANSFORM_ROT_Y TypedWhichId<SfxInt32Item>( SID_SVX_START + 94 ) #define SID_ATTR_TRANSFORM_ANGLE TypedWhichId<SfxInt32Item>( SID_SVX_START + 95 ) #define SID_ATTR_TRANSFORM_DELTA_ANGLE TypedWhichId<SfxInt32Item>( SID_SVX_START + 96 ) -// CAUTION! Range <96..100> used by SFX2 (!) +// CAUTION! Range <96..100> used by SFX2 (!) // 96 is used above? #define SID_SIZE_ALL ( SID_SVX_START + 101 ) #define SID_DRAW_LINE ( SID_SVX_START + 102 ) #define SID_DRAW_XLINE ( SID_SVX_START + 103 ) @@ -437,6 +436,11 @@ class SvxSetItem; //#define SID_SIDEBAR ( SID_SVX_START + 336 ) -> sfxsids.hrc +#define SID_ATTR_POSTIT_X TypedWhichId<SvxPostItTextItem>( SID_SVX_START + 337 ) +#define SID_ATTR_POSTIT_Y TypedWhichId<SvxPostItTextItem>( SID_SVX_START + 338 ) + +// free? + #define SID_SB_CONNECTIONPOOLING ( SID_SVX_START + 348 ) #define SID_SB_DBREGISTEROPTIONS ( SID_SVX_START + 349 ) #define SID_BMPMASK ( SID_SVX_START + 350 ) diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index f8445e8eba6d..a049ae6b96ef 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -2500,7 +2500,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 8251a9978142..08849e28a3f6 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1916,6 +1916,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() ) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
