sc/source/filter/inc/sheetdatacontext.hxx | 3 ++ sc/source/filter/oox/sheetdatacontext.cxx | 31 +++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-)
New commits: commit 8b9f0660028790c47c10d06a2fefd1fc568dadc0 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed May 29 21:58:29 2013 +0200 r is an optional attribute in c and r, fdo#65059 Change-Id: Ic954cc5692ddc899f8a6fa99466bc0c8a83da352 diff --git a/sc/source/filter/inc/sheetdatacontext.hxx b/sc/source/filter/inc/sheetdatacontext.hxx index 9054f5b..b492d2a 100644 --- a/sc/source/filter/inc/sheetdatacontext.hxx +++ b/sc/source/filter/inc/sheetdatacontext.hxx @@ -117,6 +117,9 @@ private: BinAddress maCurrPos; /// Current cell position (BIFF12 only). bool mbHasFormula; /// True = current cell has formula data (OOXML only). bool mbValidRange; /// True = maFmlaData.maFormulaRef is valid (OOXML only). + + sal_Int32 mnRow; + sal_Int32 mnCol; }; // ============================================================================ diff --git a/sc/source/filter/oox/sheetdatacontext.cxx b/sc/source/filter/oox/sheetdatacontext.cxx index 5403bc4..e1efe16 100644 --- a/sc/source/filter/oox/sheetdatacontext.cxx +++ b/sc/source/filter/oox/sheetdatacontext.cxx @@ -110,7 +110,9 @@ SheetDataContext::SheetDataContext( WorksheetFragmentBase& rFragment ) : WorksheetContextBase( rFragment ), SheetDataContextBase( rFragment ), mbHasFormula( false ), - mbValidRange( false ) + mbValidRange( false ), + mnRow( -1 ), + mnCol( -1 ) { } @@ -293,7 +295,13 @@ ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, Seq void SheetDataContext::importRow( const AttributeList& rAttribs ) { RowModel aModel; - aModel.mnRow = rAttribs.getInteger( XML_r, -1 ); + sal_Int32 nRow = rAttribs.getInteger( XML_r, -1 ); + if(nRow != -1) + aModel.mnRow = nRow; + else + aModel.mnRow = ++mnRow; + mnCol = -1; + aModel.mfHeight = rAttribs.getDouble( XML_ht, -1.0 ); aModel.mnXfId = rAttribs.getInteger( XML_s, -1 ); aModel.mnLevel = rAttribs.getInteger( XML_outlineLevel, 0 ); @@ -327,8 +335,21 @@ void SheetDataContext::importRow( const AttributeList& rAttribs ) bool SheetDataContext::importCell( const AttributeList& rAttribs ) { - bool bValidAddr = mrAddressConv.convertToCellAddress( maCellData.maCellAddr, rAttribs.getString( XML_r, OUString() ), mnSheet, true ); - if( bValidAddr ) + OUString aCellAddrStr = rAttribs.getString( XML_r, OUString() ); + bool bValid = true; + if(aCellAddrStr.isEmpty()) + { + ++mnCol; + maCellData.maCellAddr = CellAddress( mnSheet, mnCol, mnRow ); + } + else + { + bValid = mrAddressConv.convertToCellAddress( maCellData.maCellAddr, aCellAddrStr, mnSheet, true ); + + mnCol = maCellData.maCellAddr.Column; + } + + if( bValid ) { maCellData.mnCellType = rAttribs.getToken( XML_t, XML_n ); maCellData.mnXfId = rAttribs.getInteger( XML_s, -1 ); @@ -342,7 +363,7 @@ bool SheetDataContext::importCell( const AttributeList& rAttribs ) // update used area of the sheet extendUsedArea( maCellData.maCellAddr ); } - return bValidAddr; + return bValid; } void SheetDataContext::importFormula( const AttributeList& rAttribs ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits