sc/qa/unit/data/ods/print-range.ods |binary sc/qa/unit/helper/qahelper.hxx | 30 ++++++++++++++++++++++++++++++ sc/qa/unit/subsequent_filters-test.cxx | 16 ++++++++++++++++ sc/source/filter/excel/xestyle.cxx | 2 +- sc/source/filter/xml/xmlrowi.cxx | 8 +++++--- sc/source/filter/xml/xmlrowi.hxx | 2 +- sc/source/filter/xml/xmltabi.cxx | 6 +++--- 7 files changed, 56 insertions(+), 8 deletions(-)
New commits: commit 63ad78e0c0c5b8ba2897576ae7bbece22b5cd849 Author: Markus Mohrhard <[email protected]> Date: Mon Jun 3 04:27:17 2013 +0200 this was commited accidentally Change-Id: I2bdbf566d3443a98d3abf967512fc5b53bd25a78 diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index c5cb5a3..0623ae5 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1552,7 +1552,7 @@ void lclGetBorderLine( rnXclLine = EXC_LINE_NONE; if( pLine ) { - sal_uInt16 nOuterWidth = pLine->GetWidth(); + sal_uInt16 nOuterWidth = pLine->GetOutWidth(); sal_uInt16 nDistance = pLine->GetDistance(); if( nDistance > 0 ) rnXclLine = EXC_LINE_DOUBLE; commit a719841d02fb93ddfc80956c5e6e417f551e8a9f Author: Markus Mohrhard <[email protected]> Date: Mon Jun 3 04:26:43 2013 +0200 add test case for fdo#62938 Change-Id: Ib15ff9d40b01dee2102ec6137d8b6394f7957ab8 diff --git a/sc/qa/unit/data/ods/print-range.ods b/sc/qa/unit/data/ods/print-range.ods new file mode 100644 index 0000000..d7207e1 Binary files /dev/null and b/sc/qa/unit/data/ods/print-range.ods differ diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index a0168c4..ad25b74 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -115,6 +115,36 @@ void loadFile(const OUString& aFileName, std::string& aContent) aContent = aOStream.str(); } +std::string print(const ScAddress& rAddr) +{ + std::stringstream str; + str << "Col: " << rAddr.Col(); + str << " Row: " << rAddr.Row(); + str << " Tab: " << rAddr.Tab(); + return str.str(); +} + +namespace CppUnit { + +template<> +struct assertion_traits<ScRange> +{ + static bool equal( const ScRange& x, const ScRange& y ) + { + return x == y; + } + + static std::string toString( const ScRange& x ) + { + std::stringstream str; + str << "Start: " << print(x.aStart); + str << "\nEnd: " << print(x.aEnd); + return str.str(); + } +}; + +} + class ScBootstrapFixture : public test::BootstrapFixture { protected: diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 82bbbb4..ad5466a 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -136,6 +136,8 @@ public: void testMiscRowHeights(); void testOptimalHeightReset(); + void testPrintRangeODS(); + CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testBasicCellContentODS); CPPUNIT_TEST(testRangeNameXLS); @@ -198,6 +200,7 @@ public: #endif CPPUNIT_TEST(testMiscRowHeights); CPPUNIT_TEST(testOptimalHeightReset); + CPPUNIT_TEST(testPrintRangeODS); CPPUNIT_TEST_SUITE_END(); private: @@ -1925,6 +1928,19 @@ void ScFiltersTest::testOptimalHeightReset() xDocSh->DoClose(); } +void ScFiltersTest::testPrintRangeODS() +{ + ScDocShellRef xDocSh = loadDoc("print-range.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + const ScRange* pRange = pDoc->GetRepeatRowRange(0); + CPPUNIT_ASSERT(pRange); + CPPUNIT_ASSERT_EQUAL(ScRange(0,0,0,0,1,0), *pRange); + + pRange = pDoc->GetRepeatRowRange(0); + CPPUNIT_ASSERT(pRange); + CPPUNIT_ASSERT_EQUAL(ScRange(0,2,1,0,4,1), *pRange); +} + ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { commit e1c70f2f046ab6c5bb808666b4f5466902b9fcf8 Author: Markus Mohrhard <[email protected]> Date: Mon Jun 3 04:21:13 2013 +0200 the print range can start in row 0, fdo#62938 Change-Id: I8569e4e120a6fd2b626db0bdaadf5d9234d09a36 diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index 3fa6142..bbe2c92 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -218,7 +218,7 @@ ScXMLTableRowsContext::ScXMLTableRowsContext( ScXMLImport& rImport, const OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, - const bool bTempHeader, const bool bTempGroup ) : + const bool bTempHeader, const bool bTempGroup, bool bFirstRow ) : SvXMLImportContext( rImport, nPrfx, rLName ), nHeaderStartRow(0), nHeaderEndRow(0), @@ -232,12 +232,14 @@ ScXMLTableRowsContext::ScXMLTableRowsContext( ScXMLImport& rImport, if (bHeader) { nHeaderStartRow = rImport.GetTables().GetCurrentRow(); - ++nHeaderStartRow; + if(!bFirstRow) + ++nHeaderStartRow; } else if (bGroup) { nGroupStartRow = rImport.GetTables().GetCurrentRow(); - ++nGroupStartRow; + if(!bFirstRow) + ++nGroupStartRow; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; ++i ) { diff --git a/sc/source/filter/xml/xmlrowi.hxx b/sc/source/filter/xml/xmlrowi.hxx index c24a103..1651287 100644 --- a/sc/source/filter/xml/xmlrowi.hxx +++ b/sc/source/filter/xml/xmlrowi.hxx @@ -70,7 +70,7 @@ public: const OUString& rLName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList>& xAttrList, - const bool bHeader, const bool bGroup); + const bool bHeader, const bool bGroup, bool bFirstRow = false); virtual ~ScXMLTableRowsContext(); diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index a7f014c..d33cf22 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -291,17 +291,17 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix, case XML_TOK_TABLE_ROW_GROUP: pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix, rLName, xAttrList, - false, true ); + false, true, true ); break; case XML_TOK_TABLE_HEADER_ROWS: pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix, rLName, xAttrList, - true, false ); + true, false, true ); break; case XML_TOK_TABLE_ROWS: pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix, rLName, xAttrList, - false, false ); + false, false, true ); break; case XML_TOK_TABLE_ROW: pContext = new ScXMLTableRowContext( GetScImport(), nPrefix, _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
