summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-01 11:38:19 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-03-01 12:20:16 +0100
commit20ad023a918204da922c4c262b50a411f2e2dace (patch)
treece7391383d2979c8adf5e3ce0ddaad6eaa9f3eac /desktop/qa
parenta531af237d21a9a6597b2766893c909e1ac5cc25 (diff)
ccu#1573 sc lok: fix reporting of hidden row height
For columns we use ScDocument::GetColWidth(), which returns 0 for hidden columsn. Do the same for rows: so instead of using GetOriginalHeight(), use GetRowHeight(), and then 0 size will be reported for hidden rows as well. Change-Id: Ic23b6af744bbc8e194e1906614adebe5ba0c7ced
Diffstat (limited to 'desktop/qa')
-rw-r--r--desktop/qa/data/hidden-row.odsbin0 -> 7684 bytes
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx35
2 files changed, 35 insertions, 0 deletions
diff --git a/desktop/qa/data/hidden-row.ods b/desktop/qa/data/hidden-row.ods
new file mode 100644
index 000000000000..25fe89865d9e
--- /dev/null
+++ b/desktop/qa/data/hidden-row.ods
Binary files differ
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index a562ab2f8b21..51b927223081 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -80,6 +80,7 @@ public:
void testPasteWriter();
void testPasteWriterJPEG();
void testRowColumnHeaders();
+ void testHiddenRowHeaders();
void testCellCursor();
void testCommandResult();
void testWriterComments();
@@ -101,6 +102,7 @@ public:
CPPUNIT_TEST(testPasteWriter);
CPPUNIT_TEST(testPasteWriterJPEG);
CPPUNIT_TEST(testRowColumnHeaders);
+ CPPUNIT_TEST(testHiddenRowHeaders);
CPPUNIT_TEST(testCellCursor);
CPPUNIT_TEST(testCommandResult);
CPPUNIT_TEST(testWriterComments);
@@ -548,6 +550,39 @@ void DesktopLOKTest::testRowColumnHeaders()
}
}
+void DesktopLOKTest::testHiddenRowHeaders()
+{
+ LibLODocument_Impl* pDocument = loadDoc("hidden-row.ods");
+
+ pDocument->pClass->initializeForRendering(pDocument, nullptr);
+
+ boost::property_tree::ptree aTree;
+ char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:ViewRowColumnHeaders");
+ 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;
+ 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
+ {
+ // nSize was 509, nPrevious was 254, i.e. hidden row wasn't reported as 0 height.
+ CPPUNIT_ASSERT_EQUAL(nPrevious, nSize);
+ break;
+ }
+
+ nPrevious = nSize;
+ }
+}
+
void DesktopLOKTest::testCellCursor()
{
LibLODocument_Impl* pDocument = loadDoc("search.ods");