diff options
author | Sascha Ballach <sab@openoffice.org> | 2002-06-05 08:18:09 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2002-06-05 08:18:09 +0000 |
commit | dd810205580cc15c2d612f8a51754daa361e9a33 (patch) | |
tree | edf2c3f249e48ec6e278865137c645de52511e3d /sc | |
parent | bc81a94f9c036f36442ed24351fad6bca83262f2 (diff) |
#99445#; insert rows if there are rows with no cells in it (not valid)
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlrowi.cxx | 19 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlrowi.hxx | 11 |
2 files changed, 22 insertions, 8 deletions
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index c3279ffd91be..d9c6d271e14b 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlrowi.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: sab $ $Date: 2001-10-18 12:15:26 $ + * last change: $Author: sab $ $Date: 2002-06-05 09:18:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -117,7 +117,8 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport, ::com::sun::star::xml::sax::XAttributeList>& xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ), sVisibility(GetXMLToken(XML_VISIBLE)), - nRepeatedRows(1) + nRepeatedRows(1), + bHasCell(sal_False) { rtl::OUString sCellStyleName; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -180,17 +181,23 @@ SvXMLImportContext *ScXMLTableRowContext::CreateChildContext( USHORT nPrefix, { case XML_TOK_TABLE_ROW_CELL: // if( IsInsertCellPossible() ) + { + bHasCell = sal_True; pContext = new ScXMLTableRowCellContext( GetScImport(), nPrefix, rLName, xAttrList, sal_False, nRepeatedRows //this ); + } break; case XML_TOK_TABLE_ROW_COVERED_CELL: // if( IsInsertCellPossible() ) + { + bHasCell = sal_True; pContext = new ScXMLTableRowCellContext( GetScImport(), nPrefix, rLName, xAttrList, sal_True, nRepeatedRows //this ); + } break; } @@ -203,6 +210,12 @@ SvXMLImportContext *ScXMLTableRowContext::CreateChildContext( USHORT nPrefix, void ScXMLTableRowContext::EndElement() { ScXMLImport& rXMLImport = GetScImport(); + if (!bHasCell && nRepeatedRows > 1) + { + for (sal_Int32 i = 0; i < nRepeatedRows - 1; ++i) //one row is always added + GetScImport().GetTables().AddRow(); + DBG_ERRORFILE("it seems here is a nonvalid file; possible missing of table:table-cell element"); + } sal_Int32 nCurrentRow = rXMLImport.GetTables().GetCurrentRow(); uno::Reference<sheet::XSpreadsheet> xSheet = rXMLImport.GetTables().GetCurrentXSheet(); if(xSheet.is()) diff --git a/sc/source/filter/xml/xmlrowi.hxx b/sc/source/filter/xml/xmlrowi.hxx index c67d34a84d7e..427315363222 100644 --- a/sc/source/filter/xml/xmlrowi.hxx +++ b/sc/source/filter/xml/xmlrowi.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlrowi.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: nn $ $Date: 2001-03-16 14:16:31 $ + * last change: $Author: sab $ $Date: 2002-06-05 09:18:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,6 +76,7 @@ class ScXMLTableRowContext : public SvXMLImportContext rtl::OUString sStyleName; rtl::OUString sVisibility; sal_Int32 nRepeatedRows; + sal_Bool bHasCell; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } @@ -103,9 +104,9 @@ class ScXMLTableRowsContext : public SvXMLImportContext sal_Int32 nHeaderEndRow; sal_Int32 nGroupStartRow; sal_Int32 nGroupEndRow; - sal_Bool bHeader : 1; - sal_Bool bGroup : 1; - sal_Bool bGroupDisplay : 1; + sal_Bool bHeader; + sal_Bool bGroup; + sal_Bool bGroupDisplay; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } |