package/source/zipapi/ZipFile.cxx | 1 sc/source/filter/inc/sheetdatacontext.hxx | 3 ++ sc/source/filter/oox/sheetdatacontext.cxx | 31 +++++++++++++++++++++++++----- 3 files changed, 29 insertions(+), 6 deletions(-)
New commits: commit f2c01f91e51241434459b4d1659bad268131092c Author: Markus Mohrhard <[email protected]> Date: Wed May 29 21:58:29 2013 +0200 r is an optional attribute in c and r, fdo#65059 Change-Id: Ic954cc5692ddc899f8a6fa99466bc0c8a83da352 Reviewed-on: https://gerrit.libreoffice.org/4088 Reviewed-by: David Tardon <[email protected]> Tested-by: David Tardon <[email protected]> diff --git a/sc/source/filter/inc/sheetdatacontext.hxx b/sc/source/filter/inc/sheetdatacontext.hxx index 52d20da..72da911 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 bd5b146..11047f0 100644 --- a/sc/source/filter/oox/sheetdatacontext.cxx +++ b/sc/source/filter/oox/sheetdatacontext.cxx @@ -111,7 +111,9 @@ SheetDataContext::SheetDataContext( WorksheetFragmentBase& rFragment ) : WorksheetContextBase( rFragment ), SheetDataContextBase( rFragment ), mbHasFormula( false ), - mbValidRange( false ) + mbValidRange( false ), + mnRow( -1 ), + mnCol( -1 ) { } @@ -294,7 +296,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 ); @@ -328,8 +336,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 ); @@ -343,7 +364,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 ) commit 4ce2a9dc9fbd78d5ad7acc0a6f3cdad70715cdca Author: Fridrich Å trba <[email protected]> Date: Thu May 30 12:30:08 2013 +0200 Accept even more corrupted zip documents as long as we can read them Change-Id: I8d039664d6c33d978b9addc3f35cbeae86d6c710 (cherry picked from commit 1b049bd2dae52dc154ea6bee075a254a9b6cc318) (cherry picked from commit d360333f83e3115219c3928525060c6c2a8711db) Reviewed-on: https://gerrit.libreoffice.org/4094 Reviewed-by: Michael Meeks <[email protected]> Tested-by: Michael Meeks <[email protected]> diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 0da4c33..23d33c0 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -694,7 +694,6 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry ) // with timestamp difference in the central directory entry and local // file header. bBroken = rEntry.nVersion != nVersion - || (rEntry.nFlag & ~6L) != (nFlag & ~6L) || rEntry.nPathLen != nPathLen || !rEntry.sPath.equals( sLOCPath ); }
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
