[Libreoffice-commits] .: 2 commits - sc/qa sc/source
Daniel Bankston
dbank at kemper.freedesktop.org
Thu Jul 12 21:06:14 PDT 2012
sc/qa/unit/data/ods/formats.ods |binary
sc/qa/unit/subsequent_filters-test.cxx | 14 +++++++++-----
sc/source/filter/xml/xmlcoli.cxx | 10 +++++-----
sc/source/filter/xml/xmlsubti.cxx | 8 ++++----
sc/source/filter/xml/xmlsubti.hxx | 4 ++--
5 files changed, 20 insertions(+), 16 deletions(-)
New commits:
commit 68eb65f19d4f3fb564ac993e8b2f37fb33d685c3
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date: Thu Jul 12 22:37:39 2012 -0500
Fix broken ODS column width import fdo#51446
Change-Id: I43b6558de6e92b0fe40a38b5f2417bebad2b7f8b
diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx
index 624fa1d..81d0b6a 100644
--- a/sc/source/filter/xml/xmlcoli.cxx
+++ b/sc/source/filter/xml/xmlcoli.cxx
@@ -118,7 +118,7 @@ void ScXMLTableColContext::EndElement()
{
ScXMLImport& rXMLImport = GetScImport();
SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
- sal_Int32 nCurrentColumn = rXMLImport.GetTables().GetCurrentColumn();
+ sal_Int32 nCurrentColumn = rXMLImport.GetTables().GetCurrentColCount();
uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
if(xSheet.is())
{
@@ -187,10 +187,10 @@ ScXMLTableColsContext::ScXMLTableColsContext( ScXMLImport& rImport,
{
// don't have any attributes
if (bHeader)
- nHeaderStartCol = rImport.GetTables().GetCurrentColumn();
+ nHeaderStartCol = rImport.GetTables().GetCurrentColCount();
else if (bGroup)
{
- nGroupStartCol = rImport.GetTables().GetCurrentColumn();
+ nGroupStartCol = rImport.GetTables().GetCurrentColCount();
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; ++i )
{
@@ -257,7 +257,7 @@ void ScXMLTableColsContext::EndElement()
ScXMLImport& rXMLImport = GetScImport();
if (bHeader)
{
- nHeaderEndCol = rXMLImport.GetTables().GetCurrentColumn();
+ nHeaderEndCol = rXMLImport.GetTables().GetCurrentColCount();
nHeaderEndCol--;
if (nHeaderStartCol <= nHeaderEndCol)
{
@@ -284,7 +284,7 @@ void ScXMLTableColsContext::EndElement()
else if (bGroup)
{
SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
- nGroupEndCol = rXMLImport.GetTables().GetCurrentColumn();
+ nGroupEndCol = rXMLImport.GetTables().GetCurrentColCount();
nGroupEndCol--;
if (nGroupStartCol <= nGroupEndCol)
{
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index c5a5eeb..87cd34e 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -75,7 +75,7 @@ ScMyTables::ScMyTables(ScXMLImport& rTempImport)
: rImport(rTempImport),
aFixupOLEs(rTempImport),
maCurrentCellPos(ScAddress::INITIALIZE_INVALID),
- nCurrentColStylePos(0),
+ nCurrentColCount(0),
nCurrentDrawPage( -1 ),
nCurrentXShapes( -1 )
{
@@ -113,7 +113,7 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString&
{
if (rImport.GetModel().is())
{
- nCurrentColStylePos = 0;
+ nCurrentColCount = 0;
sCurrentSheetName = sTableName;
//reset cols and rows for new sheet, but increment tab
maCurrentCellPos.SetCol(-1);
@@ -227,8 +227,8 @@ void ScMyTables::DeleteTable()
void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName)
{
- rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColStylePos, nRepeat);
- nCurrentColStylePos += nRepeat;
+ rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColCount, nRepeat);
+ nCurrentColCount += nRepeat;
}
uno::Reference< drawing::XDrawPage > ScMyTables::GetCurrentXDrawPage()
diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx
index e080cfd..b57f682 100644
--- a/sc/source/filter/xml/xmlsubti.hxx
+++ b/sc/source/filter/xml/xmlsubti.hxx
@@ -71,7 +71,7 @@ private:
ScAddress maCurrentCellPos;
ScRangeList maMatrixRangeList;
ScXMLTabProtectionData maProtectionData;
- sal_Int32 nCurrentColStylePos;
+ sal_Int32 nCurrentColCount;
sal_Int16 nCurrentDrawPage;
sal_Int16 nCurrentXShapes;
@@ -96,7 +96,7 @@ public:
ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; }
rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; }
SCTAB GetCurrentSheet() const { return (maCurrentCellPos.Tab() >= 0) ? maCurrentCellPos.Tab() : 0; }
- SCCOL GetCurrentColumn() const { return (maCurrentCellPos.Col() >= 0) ? maCurrentCellPos.Col() : 0; }
+ SCCOL GetCurrentColCount() const { return nCurrentColCount; }
SCROW GetCurrentRow() const { return (maCurrentCellPos.Row() >= 0) ? maCurrentCellPos.Row() : 0; }
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
GetCurrentXSheet() const { return xCurrentSheet; }
commit f4e82885dce18d6ae663b16a1f979c5a01910c34
Author: Daniel Bankston <daniel.e.bankston at gmail.com>
Date: Thu Jul 12 22:33:48 2012 -0500
Add test case for ODS column width import
-This also re-enables ScFiltersTest::testFormatsODS, but disables checks
for row height import which was causing win tinderbox failures.
-If checks for column width cause win tinderbox failures,
we may need to temporarily disable them too until we find out
cause of failures.
Change-Id: Ibfef98d412cf0a25b98d739ad53308dac09ed370
diff --git a/sc/qa/unit/data/ods/formats.ods b/sc/qa/unit/data/ods/formats.ods
index 5ce8d0f..f944e34 100644
Binary files a/sc/qa/unit/data/ods/formats.ods and b/sc/qa/unit/data/ods/formats.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index b57757d..9a3c5dd 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -151,8 +151,7 @@ public:
CPPUNIT_TEST(testDatabaseRangesODS);
CPPUNIT_TEST(testDatabaseRangesXLS);
CPPUNIT_TEST(testDatabaseRangesXLSX);
- // auto row height calculation makes this impossible right now
- //CPPUNIT_TEST(testFormatsODS);
+ CPPUNIT_TEST(testFormatsODS);
CPPUNIT_TEST(testFormatsXLS);
CPPUNIT_TEST(testFormatsXLSX);
CPPUNIT_TEST(testMatrixODS);
@@ -553,9 +552,14 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
pPattern->GetFont(aFont, SC_AUTOCOL_RAW);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be underlined with a dotted line", UNDERLINE_DOTTED, aFont.GetUnderline());
//check row height import
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(256), pDoc->GetRowHeight(0,1) ); //0.178in
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(304), pDoc->GetRowHeight(1,1) ); //0.211in
- CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(477), pDoc->GetRowHeight(5,1) ); //0.3311in
+ //disable for now until we figure out cause of win tinderboxes test failures
+ //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(256), pDoc->GetRowHeight(0,1) ); //0.178in
+ //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(304), pDoc->GetRowHeight(1,1) ); //0.211in
+ //CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(477), pDoc->GetRowHeight(5,1) ); //0.3311in
+ //check column width import
+ CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(555), pDoc->GetColWidth(4,1) ); //0.3854in
+ CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1280), pDoc->GetColWidth(5,1) ); //0.889in
+ CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(4153), pDoc->GetColWidth(6,1) ); //2.8839in
//test case for i53253 where a cell has text with different styles and space between the text.
rtl::OUString aTestStr;
pDoc->GetString(3,0,1, aTestStr);
More information about the Libreoffice-commits
mailing list