[Libreoffice-commits] core.git: 2 commits - desktop/qa sc/source

Marco Cecchetti marco.cecchetti at collabora.com
Sat Feb 4 00:12:31 UTC 2017


 desktop/qa/desktop_lib/test_desktop_lib.cxx |    2 +-
 sc/source/core/data/global.cxx              |    6 +++---
 sc/source/ui/view/gridwin.cxx               |    5 +++--
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 9ba5eb228d714d1e5454049cac987a673bfce1e1
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Thu Feb 2 20:07:55 2017 +0100

    sc rowlimit: Make the cursor better fit the rendering.
    
    Change-Id: If4d02161bd8a37100d7403c05ea0840a3d2d0cf8

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 175947b..5ea5632 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -682,7 +682,7 @@ void DesktopLOKTest::testCellCursor()
     boost::property_tree::read_json(aStream, aTree);
 
     OString aRectangle(aTree.get<std::string>("commandValues").c_str());
-    CPPUNIT_ASSERT_EQUAL(aRectangle, OString("0, 0, 1278, 254"));
+    CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1279, 255"), aRectangle);
 }
 
 void DesktopLOKTest::testCommandResult()
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3ac3af0..278aa5d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5721,8 +5721,9 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo
 
     double fPPTX = pViewData->GetPPTX();
     double fPPTY = pViewData->GetPPTY();
-    Rectangle aRect(Point(aScrPos.getX() / fPPTX, aScrPos.getY() / fPPTY),
-                    Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY));
+
+    Rectangle aRect(Point(rtl::math::round(aScrPos.getX() / fPPTX), rtl::math::round(aScrPos.getY() / fPPTY)),
+                    Size(rtl::math::round(nSizeXPix / fPPTX), rtl::math::round(nSizeYPix / fPPTY)));
 
     pViewData->SetZoom(defaultZoomX, defaultZoomY, true);
 
commit 221e83653b5f7c409083b711fb9dd722770dd205
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Feb 2 19:53:16 2017 +0100

    sc tiled rendering: We keep increasing the precision here...
    
    ... so let's finally do it right, and count in double precision directly.
    
    Change-Id: Ic49cc42d9e61a1b9fa9853bfe93d2681a6be88b2

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 3b5e848..0e175d1 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -519,9 +519,9 @@ void ScGlobal::Init()
 void ScGlobal::InitPPT()
 {
     OutputDevice* pDev = Application::GetDefaultDevice();
-    Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MapUnit::MapTwip );
-    nScreenPPTX = aPix1000.X() / 100000.0;
-    nScreenPPTY = aPix1000.Y() / 100000.0;
+
+    nScreenPPTX = double(pDev->GetDPIX()) / double(TWIPS_PER_INCH);
+    nScreenPPTY = double(pDev->GetDPIY()) / double(TWIPS_PER_INCH);
 }
 
 const OUString& ScGlobal::GetClipDocName()


More information about the Libreoffice-commits mailing list