sd/qa/unit/tiledrendering/tiledrendering.cxx |   16 ++--------------
 svx/source/svdraw/svdxcgv.cxx                |    5 ++++-
 2 files changed, 6 insertions(+), 15 deletions(-)

New commits:
commit 548e2d4cabda2300aeda3bbf1c686e51a7f952c5
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Wed Jan 19 14:23:52 2022 +0300
Commit:     Mert Tumer <mert.tu...@collabora.com>
CommitDate: Mon Jan 24 19:19:07 2022 +0100

    lok: Set pasted text rect pos to 0, 0
    
    Rect size change according to the length of the text
    however, this can make the text inserted in the negative coordinates
    and half of it becomes invisible.
    
    Change-Id: Ibd4e6164c21088205efecf024c1888c55ac33f0e
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128603
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128868

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index fae683532057..b39321948e32 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2466,21 +2466,9 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
     SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObject);
     CPPUNIT_ASSERT(pTextObj);
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TEXT), 
pTextObj->GetObjIdentifier());
-    // This test is unreliable: it gives alternating results for the following 
coordinates.
-    // As a compromise, instead of disabling it altogether, we allow for both 
sets of values.
     const Point aPos = pTextObj->GetLastBoundRect().TopLeft();
-    if (aPos.getX() < 10000)
-    {
-        // We get this with 'make CppunitTest_sd_tiledrendering'
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(6739), aPos.getX(), 
100);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(6822), aPos.getY(), 
100);
-    }
-    else
-    {
-        // We get this with 'make check'
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(12990), aPos.getX(), 
100);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(7393), aPos.getY(), 
100);
-    }
+    CPPUNIT_ASSERT_EQUAL(static_cast<long>(0), aPos.getX());
+    CPPUNIT_ASSERT_EQUAL(static_cast<long>(0), aPos.getY());
 }
 
 void SdTiledRenderingTest::testTdf115873()
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 88083f3e93e0..f6f707367768 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -58,6 +58,7 @@
 #include <svx/sdr/contact/displayinfo.hxx>
 #include <svx/svdotable.hxx>
 #include <sal/log.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace com::sun::star;
 
@@ -414,7 +415,9 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, 
SdrObjList& rLst, const Po
     nSizY /= aDstFr.GetNumerator();
     long xs=nSizX;
     long ys=nSizY;
-    Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2);
+    // set the pos to 0, 0 for online case
+    bool isLOK = comphelper::LibreOfficeKit::isActive();
+    Point aPos(isLOK ? 0 : rCenter.X()-xs/2, isLOK ? 0 : rCenter.Y()-ys/2);
     tools::Rectangle aR(aPos.X(),aPos.Y(),aPos.X()+xs,aPos.Y()+ys);
     pObj->SetLogicRect(aR);
     rLst.InsertObject(pObj, SAL_MAX_SIZE);

Reply via email to