desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 ++- include/LibreOfficeKit/LibreOfficeKitEnums.h | 5 +++++ sc/source/ui/view/gridwin.cxx | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-)
New commits: commit 4cc87255525d24c7abc34f0d7c05c4dfac67227d Author: Marco Cecchetti <[email protected]> Date: Sat Dec 16 11:30:10 2017 +0100 lok: sc: fix DesktopLOKTest::testCellCursor unit test failure Change-Id: Iba645a53abdd4fc550e7bec5189669eee065035b diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 83c5f3544e37..d35faff93900 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -738,7 +738,8 @@ void DesktopLOKTest::testCellCursor() boost::property_tree::read_json(aStream, aTree); OString aRectangle(aTree.get<std::string>("commandValues").c_str()); - CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1279, 255"), aRectangle); + // cell cursor geometry + col + row + CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1279, 255, 0, 0"), aRectangle); } void DesktopLOKTest::testCommandResult() diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index f14ce4d36a7a..9cf635bb4c40 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -267,6 +267,11 @@ typedef enum /** * The size and/or the position of the cell cursor changed. * + * Payload format: "x, y, width, height, column, row", where the first + * 4 numbers are document coordinates, in twips, and the last 2 are table + * coordinates starting from 0. + * When the cursor is not shown the payload format is the "EMPTY" string. + * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ LOK_CALLBACK_CELL_CURSOR = 17, diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 104872b4b57d..e26a1c5f2d1f 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5766,8 +5766,9 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo long nPosXTw = rtl::math::round(aScrPos.getX() / fPPTX); long nPosYTw = rtl::math::round(aScrPos.getY() / fPPTY); - long nSizeXTw = rtl::math::round(nSizeXPix / fPPTX); - long nSizeYTw = rtl::math::round(nSizeYPix / fPPTY); + // look at Rectangle( const Point& rLT, const Size& rSize ) for the '- 1' + long nSizeXTw = rtl::math::round(nSizeXPix / fPPTX) - 1; + long nSizeYTw = rtl::math::round(nSizeYPix / fPPTY) - 1; std::stringstream ss; ss << nPosXTw << ", " << nPosYTw << ", " << nSizeXTw << ", " << nSizeYTw << ", " _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
