[Libreoffice-commits] core.git: 2 commits - svx/source

merttumer (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 20 02:33:28 UTC 2021


 svx/source/sdr/contact/objectcontactofpageview.cxx |    3 +-
 svx/source/svdraw/svdmrkv.cxx                      |   25 ++++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 836afbb007e7f34e3587de34fdf1fbb2371fd60b
Author:     merttumer <mert.tumer at collabora.com>
AuthorDate: Thu Mar 11 09:52:00 2021 +0300
Commit:     Mert Tumer <mert.tumer at collabora.com>
CommitDate: Tue Apr 20 04:32:58 2021 +0200

    Hide GluePoints in LOK
    
    Change-Id: Ibf6bba4cdc69bd8479ccc08b5d9695253ef81890
    Signed-off-by: merttumer <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112314
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114028
    Tested-by: Jenkins

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 364b0d90bfea..41717d276381 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -340,7 +340,8 @@ namespace sdr::contact
         // Get info about the need to visualize GluePoints
         bool ObjectContactOfPageView::AreGluePointsVisible() const
         {
-            return GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
+            bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+            return !bTiledRendering && GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
         }
 
         // check if text animation is allowed.
commit fa8991840e122303bf9fa43d36864dd29529b0d2
Author:     merttumer <mert.tumer at collabora.com>
AuthorDate: Thu Mar 25 12:44:17 2021 +0300
Commit:     Mert Tumer <mert.tumer at collabora.com>
CommitDate: Tue Apr 20 04:32:43 2021 +0200

    lok: Send gridOffset of the shape
    
    In core, the gridOffset is calculated based on the LogicRect's TopLeft coordinate
    In online, we have the SnapRect and we calculate it based on its TopLeft coordinate
    SnapRect's TopLeft and LogicRect's TopLeft match when there is no rotation
    but the rotation is not applied to the LogicRect. Therefore,
    what we calculate in online does not match in case of the rotated shape.
    Here we can send the correct gridOffset in the selection callback.
    whether the shape is rotated or not, we will always have the correct gridOffset
    Note that the gridOffset is always calculated from the first selected obj
    
    Change-Id: Icc62a94879367f9b55ad05887945393452021777
    Signed-off-by: merttumer <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113078
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114027
    Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 5f1d65ef185b..f42214daf8ad 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -692,6 +692,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
     tools::Rectangle aSelection(rRect);
     bool bIsChart = false;
     Point addLogicOffset(0, 0);
+    bool convertMapMode = false;
     if (!rRect.IsEmpty())
     {
         sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
@@ -721,7 +722,10 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
             if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
             {
                 if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+                {
                     aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+                    convertMapMode = true;
+                }
             }
         }
 
@@ -757,6 +761,26 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
             aExtraInfo.append("\",\"type\":");
             aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
 
+            // In core, the gridOffset is calculated based on the LogicRect's TopLeft coordinate
+            // In online, we have the SnapRect and we calculate it based on its TopLeft coordinate
+            // SnapRect's TopLeft and LogicRect's TopLeft match unless there is rotation
+            // but the rotation is not applied to the LogicRect. Therefore,
+            // what we calculate in online does not match with the core in case of the rotation.
+            // Here we can send the correct gridOffset in the selection callback, this way
+            // whether the shape is rotated or not, we will always have the correct gridOffset
+            // Note that the gridOffset is calculated from the first selected obj
+            basegfx::B2DVector aGridOffset(0.0, 0.0);
+            if(getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), GetSdrPageView()))
+            {
+                Point p(aGridOffset.getX(), aGridOffset.getY());
+                if (convertMapMode)
+                    p = OutputDevice::LogicToLogic(p, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+                aExtraInfo.append(",\"gridOffsetX\":");
+                aExtraInfo.append(OString::number(p.getX()));
+                aExtraInfo.append(",\"gridOffsetY\":");
+                aExtraInfo.append(OString::number(p.getY()));
+            }
+
             if (bWriterGraphic)
             {
                 aExtraInfo.append(", \"isWriterGraphic\": true");
@@ -893,7 +917,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
                 boost::property_tree::ptree poly;
                 boost::property_tree::ptree custom;
                 boost::property_tree::ptree nodes;
-                const bool convertMapMode = mpMarkedPV->GetView().GetFirstOutputDevice()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM;
                 for (size_t i = 0; i < maHdlList.GetHdlCount(); i++)
                 {
                     SdrHdl *pHdl = maHdlList.GetHdl(i);


More information about the Libreoffice-commits mailing list