summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-29 21:58:29 +0200
committerDavid Tardon <dtardon@redhat.com>2013-05-30 15:17:32 +0000
commitf2c01f91e51241434459b4d1659bad268131092c (patch)
tree9fed3319a1c0176d2d57a2782022fe612e2b258c /sc/source
parent4ce2a9dc9fbd78d5ad7acc0a6f3cdad70715cdca (diff)
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 <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/filter/inc/sheetdatacontext.hxx3
-rw-r--r--sc/source/filter/oox/sheetdatacontext.cxx31
2 files changed, 29 insertions, 5 deletions
diff --git a/sc/source/filter/inc/sheetdatacontext.hxx b/sc/source/filter/inc/sheetdatacontext.hxx
index 52d20da27985..72da911f0f2b 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 bd5b1467d88e..11047f05680d 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 )