[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/svx sw/sdi sw/source

gokaysatir (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 29 12:26:36 UTC 2020


 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 a7e6864fe97121a0a172063baff992fd7178b3e7
Author:     gokaysatir <gokaysatir at collabora.com>
AuthorDate: Thu Sep 10 15:23:26 2020 +0300
Commit:     Gökay ŞATIR <gokaysatir at collabora.com>
CommitDate: Thu Oct 29 13:26:02 2020 +0100

    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 at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104995
    Reviewed-by: Gökay ŞATIR <gokaysatir at collabora.com>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 7ab0eb4bab45..ba043ae4752c 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -200,7 +200,6 @@ class SfxStringItem;
 #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 (!)
 
@@ -241,7 +240,7 @@ class SfxStringItem;
 #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 )
@@ -422,6 +421,11 @@ class SfxStringItem;
 
 //#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 fc7b2903512b..ea8a885d1f16 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2503,7 +2503,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 a3b61a8a3d20..677dafaa30d1 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1882,6 +1882,19 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, 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() )
         {


More information about the Libreoffice-commits mailing list