diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 0e666782564c..17002b7b75eb 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -68,6 +68,7 @@ public: void testSaveAsCalc(); void testPasteWriter(); void testRowColumnHeaders(); + void testCellCursor(); void testCommandResult(); CPPUNIT_TEST_SUITE(DesktopLOKTest); @@ -82,6 +83,7 @@ public: CPPUNIT_TEST(testSaveAsCalc); CPPUNIT_TEST(testPasteWriter); CPPUNIT_TEST(testRowColumnHeaders); + CPPUNIT_TEST(testCellCursor); CPPUNIT_TEST(testCommandResult); CPPUNIT_TEST_SUITE_END(); @@ -435,6 +437,24 @@ void DesktopLOKTest::testRowColumnHeaders() } } +void DesktopLOKTest::testCellCursor() +{ + LibLODocument_Impl* pDocument = loadDoc("search.ods"); + + boost::property_tree::ptree aTree; + + char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CellCursor?tileWidth=1&tileHeight=1&outputWidth=1&outputHeight=1"); + + std::stringstream aStream(pJSON); + free(pJSON); + CPPUNIT_ASSERT(!aStream.str().empty()); + + boost::property_tree::read_json(aStream, aTree); + + OString aRectangle(aTree.get("commandValues").c_str()); + CPPUNIT_ASSERT_EQUAL(aRectangle, OString("0, 0, 1278, 254")); +} + void DesktopLOKTest::testCommandResult() { LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 3ab0f7387f69..9d6639b3be99 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5789,13 +5789,10 @@ OString ScGridWindow::getCellCursor( int nOutputWidth, int nOutputHeight, } OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoomY) { - ScDocument* pDoc = pViewData->GetDocument(); - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - - // GridWindows stores a shown cell cursor in mpOOCursors, hence + // GridWindow stores a shown cell cursor in mpOOCursors, hence // we can use that to determine whether we would want to be showing // one (client-side) for tiled rendering too. - if (!pDrawLayer->isTiledRendering() || !mpOOCursors.get()) + if (!mpOOCursors.get()) { return OString("EMPTY"); }