sc/inc/document.hxx                       |    2 -
 sc/qa/unit/data/ods/row-height-import.ods |binary
 sc/qa/unit/subsequent_filters-test.cxx    |   56 ++++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+), 1 deletion(-)

New commits:
commit 4a11267d8140143dce0bdb51791f5e703187a7e9
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Fri Jan 4 15:28:49 2013 -0500

    New ods test document to check the import of row height values.
    
    Test disabled as it currently fails.
    
    Change-Id: I33ea3c95357fd7fdb9deaba30372567cfb69ebd6

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 41afbf2..5b5a472 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1357,7 +1357,7 @@ public:
     SCROW                       LastNonFilteredRow(SCROW nStartRow, SCROW 
nEndRow, SCTAB nTab);
     SCROW                       CountNonFilteredRows(SCROW nStartRow, SCROW 
nEndRow, SCTAB nTab);
 
-    bool IsManualRowHeight(SCROW nRow, SCTAB nTab) const;
+    SC_DLLPUBLIC bool IsManualRowHeight(SCROW nRow, SCTAB nTab) const;
 
     /**
      * Write all column row flags to table's flag data, because not all column
diff --git a/sc/qa/unit/data/ods/row-height-import.ods 
b/sc/qa/unit/data/ods/row-height-import.ods
new file mode 100644
index 0000000..2deb104
Binary files /dev/null and b/sc/qa/unit/data/ods/row-height-import.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index d31bd8d..c283508 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -169,6 +169,8 @@ public:
 
     void testPivotTableBasicODS();
 
+    void testRowHeight();
+
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testRangeNameXLS);
     CPPUNIT_TEST(testRangeNameXLSX);
@@ -210,6 +212,7 @@ public:
     CPPUNIT_TEST(testCellAnchoredShapesODS);
 
     CPPUNIT_TEST(testPivotTableBasicODS);
+//  CPPUNIT_TEST(testRowHeight);
 
     //disable testPassword on MacOSX due to problems with libsqlite3
     //also crashes on DragonFly due to problems with nss/nspr headers
@@ -1569,6 +1572,59 @@ void ScFiltersTest::testPivotTableBasicODS()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testRowHeight()
+{
+    OUString aFileNameBase("row-height-import.");
+    OUString aFileExt = OUString::createFromAscii(aFileFormats[ODS].pName);
+    OUString aFilterName = 
OUString::createFromAscii(aFileFormats[ODS].pFilterName);
+    OUString aFilterType = 
OUString::createFromAscii(aFileFormats[ODS].pTypeName);
+
+    rtl::OUString aFileName;
+    createFileURL(aFileNameBase, aFileExt, aFileName);
+
+    unsigned int nFormatType = aFileFormats[ODS].nFormatType;
+    unsigned int nClipboardId = nFormatType ? SFX_FILTER_IMPORT | 
SFX_FILTER_USESOPTIONS : 0;
+    ScDocShellRef xDocSh = load(aFilterName, aFileName, rtl::OUString(), 
aFilterType,
+        nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);
+
+    SCTAB nTab = 0;
+    SCROW nRow = 0;
+    ScDocument* pDoc = xDocSh->GetDocument();
+
+    // The first 3 rows have manual heights.
+    int nHeight = pDoc->GetRowHeight(nRow, nTab, false);
+    bool bManual = pDoc->IsManualRowHeight(nRow, nTab);
+    CPPUNIT_ASSERT_EQUAL(600, nHeight);
+    CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", 
bManual);
+    nHeight = pDoc->GetRowHeight(++nRow, nTab, false);
+    bManual = pDoc->IsManualRowHeight(nRow, nTab);
+    CPPUNIT_ASSERT_EQUAL(1200, nHeight);
+    CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", 
bManual);
+    nHeight = pDoc->GetRowHeight(++nRow, nTab, false);
+    bManual = pDoc->IsManualRowHeight(nRow, nTab);
+    CPPUNIT_ASSERT_EQUAL(1800, nHeight);
+    CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", 
bManual);
+
+    // This one should have an automatic row height.
+    bManual = pDoc->IsManualRowHeight(++nRow, nTab);
+    CPPUNIT_ASSERT_MESSAGE("Row should have an automatic height.", !bManual);
+
+    // Followed by a row with manual height.
+    nHeight = pDoc->GetRowHeight(++nRow, nTab, false);
+    bManual = pDoc->IsManualRowHeight(nRow, nTab);
+    CPPUNIT_ASSERT_EQUAL(2400, nHeight);
+    CPPUNIT_ASSERT_MESSAGE("this row should have a manual row height.", 
bManual);
+
+    // And all the rest should have automatic heights.
+    bManual = pDoc->IsManualRowHeight(++nRow, nTab);
+    CPPUNIT_ASSERT_MESSAGE("Row should have an automatic height.", !bManual);
+
+    bManual = pDoc->IsManualRowHeight(MAXROW, nTab);
+    CPPUNIT_ASSERT_MESSAGE("Row should have an automatic height.", !bManual);
+
+    xDocSh->DoClose();
+}
+
 namespace {
 
 void testColorScaleFormat_Impl(const rtl::OUString& rFilePath, const 
ScConditionalFormat* pFormat)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to