[Libreoffice-commits] core.git: 2 commits - desktop/qa libreofficekit/qa sc/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Mar 1 11:25:12 UTC 2016
desktop/qa/data/hidden-row.ods |binary
desktop/qa/desktop_lib/test_desktop_lib.cxx | 35 ++++++++++++++++++++
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 1
sc/source/ui/view/tabview.cxx | 3 +
4 files changed, 38 insertions(+), 1 deletion(-)
New commits:
commit 20ad023a918204da922c4c262b50a411f2e2dace
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Mar 1 11:38:19 2016 +0100
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
diff --git a/desktop/qa/data/hidden-row.ods b/desktop/qa/data/hidden-row.ods
new file mode 100644
index 0000000..25fe898
Binary files /dev/null and b/desktop/qa/data/hidden-row.ods differ
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index a562ab2..51b9272 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");
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 7918516..9f5d699 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2326,7 +2326,8 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle)
long nTotalPixels = 0;
for (SCROW nRow = 0; nRow <= nEndRow; ++nRow)
{
- sal_uInt16 nSize = pDoc->GetOriginalHeight(nRow, aViewData.GetTabNo());
+ // nSize will be 0 for hidden rows.
+ sal_uInt16 nSize = pDoc->GetRowHeight(nRow, aViewData.GetTabNo());
long nSizePixels = ScViewData::ToPixel(nSize, aViewData.GetPPTY());
OUString aText = pRowBar[SC_SPLIT_BOTTOM]->GetEntryText(nRow);
commit a531af237d21a9a6597b2766893c909e1ac5cc25
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Mar 1 11:36:25 2016 +0100
gtktiledviewer: log .uno:ViewRowColumnHeaders command result
Change-Id: I6d71071371ef54f70613246162c893daa56b7bb9
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 7ec2b78..c0d4ac7 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -292,6 +292,7 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfi
ss << "lok::Document::getCommandValues(" << aCommand.str() << ")";
g_info("%s", ss.str().c_str());
char* pValues = pDocument->pClass->getCommandValues(pDocument, aCommand.str().c_str());
+ g_info("lok::Document::getCommandValues() returned '%s'", pValues);
std::stringstream aStream(pValues);
free(pValues);
assert(!aStream.str().empty());
More information about the Libreoffice-commits
mailing list