diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-11-30 14:13:15 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 01:01:44 +0100 |
commit | db15f1c9415908b10801b7bdfb0879ef834a1220 (patch) | |
tree | f407b021de2e43ea9085981569a6347bb1caed9c /desktop | |
parent | caa9f9e35837f13608ae4b89b9214bb3b07468be (diff) |
LOK - Calc: Increase the row limit to 10.000 rows.
Change-Id: Ie91e4caf33d3b31df4c3de8dc6e78e223dc1e4b3
Reviewed-on: https://gerrit.libreoffice.org/34216
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
(cherry picked from commit eb399d69aa5ad0c04affb830a522c5c1f130813f)
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 76 |
1 files changed, 57 insertions, 19 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index d193c4add0b1..99ae560d3533 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -598,46 +598,79 @@ void DesktopLOKTest::testRowColumnHeaders() pDocument->pClass->initializeForRendering(pDocument, nullptr); + long nWidth = 0; + long nHeight = 0; + pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight); + long nX = rtl::math::round(nWidth / 4.0); + long nY = rtl::math::round(nHeight / 4.0); + nWidth = rtl::math::round(nWidth / 2.0); + nHeight = rtl::math::round(nHeight / 2.0); + + std::stringstream aPayload; + aPayload << ".uno:ViewRowColumnHeaders?x=" << nX << "&y=" << nY << "&width=" << nWidth << "&height=" << nHeight; + boost::property_tree::ptree aTree; - char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:ViewRowColumnHeaders"); + char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aPayload.str().c_str()); std::stringstream aStream(pJSON); free(pJSON); + CPPUNIT_ASSERT(!aStream.str().empty()); boost::property_tree::read_json(aStream, aTree); sal_Int32 nPrevious = 0; + bool bFirstHeader = true; + bool bNotEnoughHeaders = true; for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows")) { sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32(); - CPPUNIT_ASSERT(nSize > 0); OString aText(rValue.second.get<std::string>("text").c_str()); - if (!nPrevious) - // This failed, as the first item did not contain the text of the first row. - CPPUNIT_ASSERT_EQUAL(OString("1"), aText); + + if (bFirstHeader) + { + CPPUNIT_ASSERT(nSize <= nY); + CPPUNIT_ASSERT_EQUAL(OString("11"), aText); + bFirstHeader = false; + } else { - // Make sure that size is absolute: the first two items have the same relative size. + CPPUNIT_ASSERT(nSize > 0); CPPUNIT_ASSERT(nPrevious < nSize); - break; + if (nSize > nY + nHeight) + { + bNotEnoughHeaders = false; + break; + } } nPrevious = nSize; } + CPPUNIT_ASSERT(!bNotEnoughHeaders); nPrevious = 0; + bFirstHeader = true; + bNotEnoughHeaders = true; for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("columns")) { sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32(); - CPPUNIT_ASSERT(nSize > 0); OString aText(rValue.second.get<std::string>("text").c_str()); - if (!nPrevious) - CPPUNIT_ASSERT_EQUAL(OString("A"), aText); + if (bFirstHeader) + { + CPPUNIT_ASSERT(nSize <= nX); + CPPUNIT_ASSERT_EQUAL(OString("4"), aText); + bFirstHeader = false; + } else { + CPPUNIT_ASSERT(nSize > 0); CPPUNIT_ASSERT(nPrevious < nSize); - break; + if (nSize > nX + nWidth) + { + bNotEnoughHeaders = false; + break; + } } nPrevious = nSize; } + CPPUNIT_ASSERT(!bNotEnoughHeaders); } void DesktopLOKTest::testHiddenRowHeaders() @@ -646,29 +679,34 @@ void DesktopLOKTest::testHiddenRowHeaders() pDocument->pClass->initializeForRendering(pDocument, nullptr); + long nX = 0; + long nY = 0; + long nWidth = 0; + long nHeight = 0; + pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight); + + std::stringstream aPayload; + aPayload << ".uno:ViewRowColumnHeaders?x=" << nX << "&y=" << nY << "&width=" << nWidth << "&height=" << nHeight; + boost::property_tree::ptree aTree; - char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:ViewRowColumnHeaders"); + char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aPayload.str().c_str()); std::stringstream aStream(pJSON); free(pJSON); CPPUNIT_ASSERT(!aStream.str().empty()); boost::property_tree::read_json(aStream, aTree); sal_Int32 nPrevious = 0; - bool bFirst = true; + sal_Int32 nIndex = 0; for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("rows")) { sal_Int32 nSize = OString(rValue.second.get<std::string>("size").c_str()).toInt32(); - CPPUNIT_ASSERT(nSize > 0); - if (bFirst) - bFirst = false; - else + if (nIndex++ == 2) { - // nSize was 509, nPrevious was 254, i.e. hidden row wasn't reported as 0 height. + // nSize was 510, nPrevious was 255, i.e. hidden row wasn't reported as 0 height. CPPUNIT_ASSERT_EQUAL(nPrevious, nSize); break; } - nPrevious = nSize; } } |