[Libreoffice-commits] core.git: sw/inc sw/source

Pranav Kant pranavk at collabora.co.uk
Sun Feb 5 17:14:10 UTC 2017


 sw/inc/SidebarWin.hxx                |    1 +
 sw/source/uibase/docvw/PostItMgr.cxx |    8 ++++++--
 sw/source/uibase/uno/unotxdoc.cxx    |    8 ++++++--
 3 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 6d243a10724da6836b7f3e623d2815cc7b0a13c5
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Jan 31 00:57:29 2017 +0530

    lok: Send complete anchor rectangle
    
    ... instead of just sending the X, Y coordinates
    
    Change-Id: Ie87b252ebfd64e806e1e5f66cfc27e77282cbaab
    Reviewed-on: https://gerrit.libreoffice.org/33875
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: pranavk <pranavk at collabora.co.uk>

diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index bb6dab5..4d114b8 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -81,6 +81,7 @@ class SwSidebarWin : public vcl::Window
         void CheckMetaText();
 
         inline Point GetAnchorPos() { return mAnchorRect.Pos(); }
+        inline const SwRect& GetAnchorRect() { return mAnchorRect; }
         inline const std::vector<basegfx::B2DRange>& GetAnnotationTextRanges() { return maAnnotationTextRanges; }
         SwEditWin& EditWin();
 
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 9c4f7d7..80e31d8 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -152,7 +152,11 @@ namespace {
             sw::annotation::SwAnnotationWin* pWin = static_cast<sw::annotation::SwAnnotationWin*>((pItem)->pPostIt.get());
 
             const SwPostItField* pField = pWin->GetPostItField();
-            const OString aAnchorPos = OString::number(pWin->GetAnchorPos().X()) + ", " + OString::number(pWin->GetAnchorPos().Y());
+            const SwRect& aRect = pWin->GetAnchorRect();
+            const Rectangle aSVRect(aRect.Pos().getX(),
+                                    aRect.Pos().getY(),
+                                    aRect.Pos().getX() + aRect.SSize().Width(),
+                                    aRect.Pos().getY() + aRect.SSize().Height());
             std::vector<OString> aRects;
             for (const basegfx::B2DRange& aRange : pWin->GetAnnotationTextRanges())
             {
@@ -166,7 +170,7 @@ namespace {
             aAnnotation.put("author", pField->GetPar1().toUtf8().getStr());
             aAnnotation.put("text", pField->GetPar2().toUtf8().getStr());
             aAnnotation.put("dateTime", utl::toISO8601(pField->GetDateTime().GetUNODateTime()));
-            aAnnotation.put("anchorPos", aAnchorPos.getStr());
+            aAnnotation.put("anchorPos", aSVRect.toString());
             aAnnotation.put("textRange", sRects.getStr());
         }
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index bbe2077..a6aadb5 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3194,7 +3194,11 @@ OUString SwXTextDocument::getPostIts()
         sw::annotation::SwAnnotationWin* pWin = static_cast<sw::annotation::SwAnnotationWin*>((*i)->pPostIt.get());
 
         const SwPostItField* pField = pWin->GetPostItField();
-        const OString aAnchorPos = OString::number(pWin->GetAnchorPos().X()) + ", " + OString::number(pWin->GetAnchorPos().Y());
+        const SwRect& aRect = pWin->GetAnchorRect();
+        const Rectangle aSVRect(aRect.Pos().getX(),
+                                aRect.Pos().getY(),
+                                aRect.Pos().getX() + aRect.SSize().Width(),
+                                aRect.Pos().getY() + aRect.SSize().Height());
         std::vector<OString> aRects;
         for (const basegfx::B2DRange& aRange : pWin->GetAnnotationTextRanges())
         {
@@ -3209,7 +3213,7 @@ OUString SwXTextDocument::getPostIts()
         aAnnotation.put("author", pField->GetPar1().toUtf8().getStr());
         aAnnotation.put("text", pField->GetPar2().toUtf8().getStr());
         aAnnotation.put("dateTime", utl::toISO8601(pField->GetDateTime().GetUNODateTime()));
-        aAnnotation.put("anchorPos", aAnchorPos.getStr());
+        aAnnotation.put("anchorPos", aSVRect.toString());
         aAnnotation.put("textRange", sRects.getStr());
 
         aAnnotations.push_back(std::make_pair("", aAnnotation));


More information about the Libreoffice-commits mailing list