[Libreoffice-commits] .: 4 commits - sc/source
Katarina Machalkova
bubli at kemper.freedesktop.org
Wed Mar 23 06:10:28 PDT 2011
sc/source/filter/excel/xeformula.cxx | 21 +++++++++++----------
sc/source/filter/excel/xehelper.cxx | 2 +-
sc/source/filter/excel/xepivot.cxx | 6 +++---
sc/source/filter/excel/xestream.cxx | 10 ++++++++--
sc/source/filter/excel/xetable.cxx | 16 ++++++++--------
sc/source/filter/excel/xeview.cxx | 2 +-
sc/source/filter/excel/xihelper.cxx | 4 ++--
sc/source/filter/excel/xladdress.cxx | 12 +++++++-----
sc/source/filter/excel/xlescher.cxx | 8 ++++----
sc/source/filter/inc/xetable.hxx | 18 +++++++++---------
sc/source/filter/inc/xeview.hxx | 2 +-
sc/source/filter/inc/xladdress.hxx | 14 +++++++-------
sc/source/filter/inc/xlconst.hxx | 4 ++++
sc/source/filter/inc/xlescher.hxx | 24 +++++++++++++++++-------
14 files changed, 83 insertions(+), 60 deletions(-)
New commits:
commit 62efb7d966646c849fd8effc1aafc6f2a8c3006d
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date: Wed Mar 23 14:01:33 2011 +0100
Useless comments--, FIXME--
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index c278cde..834592e 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -564,7 +564,6 @@ XclTokenArrayRef XclExpFmlaCompImpl::CreateSpecialRefFormula( sal_uInt8 nTokenId
{
Init( EXC_FMLATYPE_NAME );
AppendOperandTokenId( nTokenId );
- //Bubli's row limit
Append( static_cast<sal_uInt16>(rXclPos.mnRow) );
Append( rXclPos.mnCol ); // do not use AppendAddress(), we always need 16-bit column here
return CreateTokenArray();
@@ -1850,8 +1849,8 @@ void XclExpFmlaCompImpl::ConvertRefData(
}
else
{
- //FIXME <=EXC_BIFF5
- sal_uInt16& rnRelField = rXclPos.mnCol;
+ sal_uInt16 rnRelRow = rXclPos.mnRow;
+ sal_uInt16& rnRelField = (meBiff <= EXC_BIFF5) ? rnRelRow : rXclPos.mnCol;
::set_flag( rnRelField, EXC_TOK_REF_COLREL, rRefData.IsColRel() );
::set_flag( rnRelField, EXC_TOK_REF_ROWREL, rRefData.IsRowRel() );
}
@@ -2236,7 +2235,6 @@ void XclExpFmlaCompImpl::Append( const String& rString )
void XclExpFmlaCompImpl::AppendAddress( const XclAddress& rXclPos )
{
- //Bubli's row limit
Append( static_cast<sal_uInt16>(rXclPos.mnRow) );
if( meBiff <= EXC_BIFF5 )
Append( static_cast< sal_uInt8 >( rXclPos.mnCol ) );
@@ -2246,7 +2244,6 @@ void XclExpFmlaCompImpl::AppendAddress( const XclAddress& rXclPos )
void XclExpFmlaCompImpl::AppendRange( const XclRange& rXclRange )
{
- //Bubli's row limit
Append( static_cast<sal_uInt16>(rXclRange.maFirst.mnRow) );
Append( static_cast<sal_uInt16>(rXclRange.maLast.mnRow) );
if( meBiff <= EXC_BIFF5 )
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index aac4e57..8841165 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -566,7 +566,6 @@ void XclExpSingleCellBase::Save( XclExpStream& rStrm )
void XclExpSingleCellBase::WriteBody( XclExpStream& rStrm )
{
- //Bubli's row limit
rStrm << static_cast<sal_uInt16> (GetXclRow()) << GetXclCol() << maXFId.mnXFIndex;
WriteContents( rStrm );
}
@@ -1054,7 +1053,6 @@ void XclExpMultiCellBase::Save( XclExpStream& rStrm )
if( bIsMulti ) nTotalSize += 2;
rStrm.StartRecord( bIsMulti ? mnMulRecId : GetRecId(), nTotalSize );
- //Bubli's row limit
rStrm << static_cast<sal_uInt16> (GetXclRow()) << nBegXclCol;
sal_uInt16 nRelCol = nBegXclCol - GetXclCol();
diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx
index 92e3517..23172c2 100644
--- a/sc/source/filter/excel/xladdress.cxx
+++ b/sc/source/filter/excel/xladdress.cxx
@@ -37,8 +37,6 @@
void XclAddress::Read( XclImpStream& rStrm, bool bCol16Bit )
{
- //Bubli's row limit ... uff ???
- //rStrm >> mnRow;
mnRow = rStrm.ReaduInt16();
if( bCol16Bit )
rStrm >> mnCol;
@@ -48,7 +46,6 @@ void XclAddress::Read( XclImpStream& rStrm, bool bCol16Bit )
void XclAddress::Write( XclExpStream& rStrm, bool bCol16Bit ) const
{
- //Bubli's row limit
rStrm << static_cast<sal_uInt16> (mnRow);
if( bCol16Bit )
rStrm << mnCol;
@@ -66,8 +63,6 @@ bool XclRange::Contains( const XclAddress& rPos ) const
void XclRange::Read( XclImpStream& rStrm, bool bCol16Bit )
{
- //Bubli's row limit
- //rStrm >> maFirst.mnRow >> maLast.mnRow;
maFirst.mnRow = rStrm.ReaduInt16();
maLast.mnRow = rStrm.ReaduInt16();
@@ -82,7 +77,6 @@ void XclRange::Read( XclImpStream& rStrm, bool bCol16Bit )
void XclRange::Write( XclExpStream& rStrm, bool bCol16Bit ) const
{
- //Bubli's row limit
rStrm << static_cast<sal_uInt16>(maFirst.mnRow) << static_cast<sal_uInt16>(maLast.mnRow);
if( bCol16Bit )
rStrm << maFirst.mnCol << maLast.mnCol;
commit 26d84b51e73345793312211a3f57570bebd9fc19
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date: Wed Mar 23 13:30:19 2011 +0100
Fixed binary import/export of MSO drawing objects
(related to row limit++ changes - bnc#504623, fdo#32106)
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index fb20688..1e6d05f 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -331,14 +331,24 @@ struct XclObjAnchor : public XclRange
const Rectangle& rRect, MapUnit eMapUnit, bool bDffAnchor );
};
+
template< typename StreamType >
StreamType& operator>>( StreamType& rStrm, XclObjAnchor& rAnchor )
{
- return rStrm
+ sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY;
+
+ rStrm
>> rAnchor.maFirst.mnCol >> rAnchor.mnLX
- >> rAnchor.maFirst.mnRow >> rAnchor.mnTY
+ >> tmpFirstRow >> tmpTY
>> rAnchor.maLast.mnCol >> rAnchor.mnRX
- >> rAnchor.maLast.mnRow >> rAnchor.mnBY;
+ >> tmpLastRow >> tmpBY;
+
+ rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow);
+ rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY);
+ rAnchor.maLast.mnRow = static_cast<sal_uInt32> (tmpLastRow);
+ rAnchor.mnBY = static_cast<sal_uInt32> (tmpBY);
+
+ return rStrm;
}
template< typename StreamType >
@@ -346,9 +356,9 @@ StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor )
{
return rStrm
<< rAnchor.maFirst.mnCol << rAnchor.mnLX
- << rAnchor.maFirst.mnRow << rAnchor.mnTY
+ << static_cast<sal_uInt16>(rAnchor.maFirst.mnRow) << static_cast<sal_uInt16>(rAnchor.mnTY)
<< rAnchor.maLast.mnCol << rAnchor.mnRX
- << rAnchor.maLast.mnRow << rAnchor.mnBY;
+ << static_cast<sal_uInt16>(rAnchor.maLast.mnRow) << static_cast<sal_uInt16>(rAnchor.mnBY);
}
// ----------------------------------------------------------------------------
commit 252d25a16106f9094faab962e3ae9069b229f94b
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date: Wed Mar 23 13:26:45 2011 +0100
Fixed binary import/export of formulas
(related to row limit++ changes - bnc#504623, fdo#32106)
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index f4941f4..c278cde 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -490,7 +490,7 @@ private:
const SCsCOL mnMaxScCol; /// Maximum column index in Calc itself.
const SCsROW mnMaxScRow; /// Maximum row index in Calc itself.
const sal_uInt16 mnMaxColMask; /// Mask to delete invalid bits in column fields.
- const sal_uInt16 mnMaxRowMask; /// Mask to delete invalid bits in row fields.
+ const sal_uInt32 mnMaxRowMask; /// Mask to delete invalid bits in row fields.
};
// ----------------------------------------------------------------------------
@@ -504,7 +504,7 @@ XclExpFmlaCompImpl::XclExpFmlaCompImpl( const XclExpRoot& rRoot ) :
mnMaxScCol( static_cast< SCsCOL >( rRoot.GetScMaxPos().Col() ) ),
mnMaxScRow( static_cast< SCsROW >( rRoot.GetScMaxPos().Row() ) ),
mnMaxColMask( static_cast< sal_uInt16 >( rRoot.GetXclMaxPos().Col() ) ),
- mnMaxRowMask( static_cast< sal_uInt16 >( rRoot.GetXclMaxPos().Row() ) )
+ mnMaxRowMask( static_cast< sal_uInt32 >( rRoot.GetXclMaxPos().Row() ) )
{
// build the configuration map
for( const XclExpCompConfig* pEntry = spConfigTable; pEntry != STATIC_TABLE_END( spConfigTable ); ++pEntry )
@@ -564,7 +564,8 @@ XclTokenArrayRef XclExpFmlaCompImpl::CreateSpecialRefFormula( sal_uInt8 nTokenId
{
Init( EXC_FMLATYPE_NAME );
AppendOperandTokenId( nTokenId );
- Append( rXclPos.mnRow );
+ //Bubli's row limit
+ Append( static_cast<sal_uInt16>(rXclPos.mnRow) );
Append( rXclPos.mnCol ); // do not use AppendAddress(), we always need 16-bit column here
return CreateTokenArray();
}
@@ -1832,7 +1833,7 @@ void XclExpFmlaCompImpl::ConvertRefData(
rXclPos.mnCol = static_cast< sal_uInt16 >( nXclRelCol ) & mnMaxColMask;
// convert row index (2-step-cast ScsROW->sal_Int16->sal_uInt16 to get all bits correctly)
- sal_Int16 nXclRelRow = static_cast< sal_Int16 >( rRefData.IsRowRel() ? rRefData.nRelRow : rRefData.nRow );
+ sal_Int16 nXclRelRow = static_cast< sal_Int32 >( rRefData.IsRowRel() ? rRefData.nRelRow : rRefData.nRow );
rXclPos.mnRow = static_cast< sal_uInt32 >( nXclRelRow ) & mnMaxRowMask;
// resolve relative tab index if possible
@@ -1849,11 +1850,10 @@ void XclExpFmlaCompImpl::ConvertRefData(
}
else
{
-#if 0 // FIXME : doesn't build in xlsx
- sal_uInt16& rnRelField = (meBiff <= EXC_BIFF5) ? rXclPos.mnRow : rXclPos.mnCol;
+ //FIXME <=EXC_BIFF5
+ sal_uInt16& rnRelField = rXclPos.mnCol;
::set_flag( rnRelField, EXC_TOK_REF_COLREL, rRefData.IsColRel() );
::set_flag( rnRelField, EXC_TOK_REF_ROWREL, rRefData.IsRowRel() );
-#endif
}
}
@@ -2236,7 +2236,8 @@ void XclExpFmlaCompImpl::Append( const String& rString )
void XclExpFmlaCompImpl::AppendAddress( const XclAddress& rXclPos )
{
- Append( rXclPos.mnRow );
+ //Bubli's row limit
+ Append( static_cast<sal_uInt16>(rXclPos.mnRow) );
if( meBiff <= EXC_BIFF5 )
Append( static_cast< sal_uInt8 >( rXclPos.mnCol ) );
else
@@ -2245,8 +2246,9 @@ void XclExpFmlaCompImpl::AppendAddress( const XclAddress& rXclPos )
void XclExpFmlaCompImpl::AppendRange( const XclRange& rXclRange )
{
- Append( rXclRange.maFirst.mnRow );
- Append( rXclRange.maLast.mnRow );
+ //Bubli's row limit
+ Append( static_cast<sal_uInt16>(rXclRange.maFirst.mnRow) );
+ Append( static_cast<sal_uInt16>(rXclRange.maLast.mnRow) );
if( meBiff <= EXC_BIFF5 )
{
Append( static_cast< sal_uInt8 >( rXclRange.maFirst.mnCol ) );
commit 2e40464585555490caff8634ce656d8a7aed7645
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date: Wed Mar 23 13:22:51 2011 +0100
Calc xlsx export row limit++ (bnc#504623, fdo#32106)
re-introducing the ability to export sheets with more than 65k rows
which disappeared with shared bin+OOXML filter transition
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 194977a..f4941f4 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1821,7 +1821,7 @@ void XclExpFmlaCompImpl::ConvertRefData(
rnScRow = mnMaxAbsRow;
else if( (rnScRow < 0) || (rnScRow > mnMaxAbsRow) )
rRefData.SetRowDeleted( sal_True );
- rXclPos.mnRow = static_cast< sal_uInt16 >( rnScRow ) & mnMaxRowMask;
+ rXclPos.mnRow = static_cast< sal_uInt32 >( rnScRow ) & mnMaxRowMask;
}
else
{
@@ -1833,7 +1833,7 @@ void XclExpFmlaCompImpl::ConvertRefData(
// convert row index (2-step-cast ScsROW->sal_Int16->sal_uInt16 to get all bits correctly)
sal_Int16 nXclRelRow = static_cast< sal_Int16 >( rRefData.IsRowRel() ? rRefData.nRelRow : rRefData.nRow );
- rXclPos.mnRow = static_cast< sal_uInt16 >( nXclRelRow ) & mnMaxRowMask;
+ rXclPos.mnRow = static_cast< sal_uInt32 >( nXclRelRow ) & mnMaxRowMask;
// resolve relative tab index if possible
if( rRefData.IsTabRel() && !IsInGlobals() && (GetCurrScTab() < GetDoc().GetTableCount()) )
@@ -1849,9 +1849,11 @@ void XclExpFmlaCompImpl::ConvertRefData(
}
else
{
+#if 0 // FIXME : doesn't build in xlsx
sal_uInt16& rnRelField = (meBiff <= EXC_BIFF5) ? rXclPos.mnRow : rXclPos.mnCol;
::set_flag( rnRelField, EXC_TOK_REF_COLREL, rRefData.IsColRel() );
::set_flag( rnRelField, EXC_TOK_REF_ROWREL, rRefData.IsRowRel() );
+#endif
}
}
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index c2b5e8a..0afa63a 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -157,7 +157,7 @@ namespace {
inline void lclFillAddress( XclAddress& rXclPos, SCCOL nScCol, SCROW nScRow )
{
rXclPos.mnCol = static_cast< sal_uInt16 >( nScCol );
- rXclPos.mnRow = static_cast< sal_uInt16 >( nScRow );
+ rXclPos.mnRow = static_cast< sal_uInt32 >( nScRow );
}
} // namespace
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 252af12..f98276f 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -1631,9 +1631,9 @@ void XclExpPivotTable::Finalize()
// update output range (initialized in ctor)
sal_uInt16& rnXclCol1 = maPTInfo.maOutXclRange.maFirst.mnCol;
- sal_uInt16& rnXclRow1 = maPTInfo.maOutXclRange.maFirst.mnRow;
+ sal_uInt32& rnXclRow1 = maPTInfo.maOutXclRange.maFirst.mnRow;
sal_uInt16& rnXclCol2 = maPTInfo.maOutXclRange.maLast.mnCol;
- sal_uInt16& rnXclRow2 = maPTInfo.maOutXclRange.maLast.mnRow;
+ sal_uInt32& rnXclRow2 = maPTInfo.maOutXclRange.maLast.mnRow;
// exclude page fields from output range
rnXclRow1 = rnXclRow1 + maPTInfo.mnPageFields;
// exclude filter button from output range
@@ -1645,7 +1645,7 @@ void XclExpPivotTable::Finalize()
// data area
sal_uInt16& rnDataXclCol = maPTInfo.maDataXclPos.mnCol;
- sal_uInt16& rnDataXclRow = maPTInfo.maDataXclPos.mnRow;
+ sal_uInt32& rnDataXclRow = maPTInfo.maDataXclPos.mnRow;
rnDataXclCol = rnXclCol1 + maPTInfo.mnRowFields;
rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1;
if( maDataFields.empty() )
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 3839475..49c572a 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -810,8 +810,9 @@ static ScAddress lcl_ToAddress( const XclAddress& rAddress )
// For some reason, ScRange::Format() returns omits row numbers if
// the row is >= MAXROW or the column is >= MAXCOL, and Excel doesn't
// like "A:IV" (i.e. no row numbers). Prevent this.
- aAddress.SetRow( std::min<sal_Int32>( rAddress.mnRow, MAXROW-1 ) );
- aAddress.SetCol( static_cast<sal_Int16>(std::min<sal_Int32>( rAddress.mnCol, MAXCOL-1 )) );
+ // KOHEI: Find out if the above comment is still true.
+ aAddress.SetRow( std::min<sal_Int32>( rAddress.mnRow, MAXROW ) );
+ aAddress.SetCol( static_cast<sal_Int16>(std::min<sal_Int32>( rAddress.mnCol, MAXCOL )) );
return aAddress;
}
@@ -1120,6 +1121,11 @@ bool XclExpXmlStream::exportDocument() throw()
XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, *pDoc, RTL_TEXTENCODING_DONTKNOW );
aData.meOutput = EXC_OUTPUT_XML_2007;
+ aData.maXclMaxPos.Set( EXC_MAXCOL_XML_2007, EXC_MAXROW_XML_2007, EXC_MAXTAB_XML_2007 );
+ aData.maMaxPos.SetCol( ::std::min( aData.maScMaxPos.Col(), aData.maXclMaxPos.Col() ) );
+ aData.maMaxPos.SetRow( ::std::min( aData.maScMaxPos.Row(), aData.maXclMaxPos.Row() ) );
+ aData.maMaxPos.SetTab( ::std::min( aData.maScMaxPos.Tab(), aData.maXclMaxPos.Tab() ) );
+
XclExpRoot aRoot( aData );
mpRoot = &aRoot;
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 1df8d12..aac4e57 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -96,7 +96,7 @@ XclExpRangeFmlaBase::XclExpRangeFmlaBase(
maBaseXclPos = maXclRange.maFirst;
}
-bool XclExpRangeFmlaBase::IsBasePos( sal_uInt16 nXclCol, sal_uInt16 nXclRow ) const
+bool XclExpRangeFmlaBase::IsBasePos( sal_uInt16 nXclCol, sal_uInt32 nXclRow ) const
{
return (maBaseXclPos.mnCol == nXclCol) && (maBaseXclPos.mnRow == nXclRow);
}
@@ -104,7 +104,7 @@ bool XclExpRangeFmlaBase::IsBasePos( sal_uInt16 nXclCol, sal_uInt16 nXclRow ) co
void XclExpRangeFmlaBase::Extend( const ScAddress& rScPos )
{
sal_uInt16 nXclCol = static_cast< sal_uInt16 >( rScPos.Col() );
- sal_uInt16 nXclRow = static_cast< sal_uInt16 >( rScPos.Row() );
+ sal_uInt32 nXclRow = static_cast< sal_uInt32 >( rScPos.Row() );
maXclRange.maFirst.mnCol = ::std::min( maXclRange.maFirst.mnCol, nXclCol );
maXclRange.maFirst.mnRow = ::std::min( maXclRange.maFirst.mnRow, nXclRow );
maXclRange.maLast.mnCol = ::std::max( maXclRange.maLast.mnCol, nXclCol );
@@ -566,7 +566,8 @@ void XclExpSingleCellBase::Save( XclExpStream& rStrm )
void XclExpSingleCellBase::WriteBody( XclExpStream& rStrm )
{
- rStrm << GetXclRow() << GetXclCol() << maXFId.mnXFIndex;
+ //Bubli's row limit
+ rStrm << static_cast<sal_uInt16> (GetXclRow()) << GetXclCol() << maXFId.mnXFIndex;
WriteContents( rStrm );
}
@@ -1053,7 +1054,8 @@ void XclExpMultiCellBase::Save( XclExpStream& rStrm )
if( bIsMulti ) nTotalSize += 2;
rStrm.StartRecord( bIsMulti ? mnMulRecId : GetRecId(), nTotalSize );
- rStrm << GetXclRow() << nBegXclCol;
+ //Bubli's row limit
+ rStrm << static_cast<sal_uInt16> (GetXclRow()) << nBegXclCol;
sal_uInt16 nRelCol = nBegXclCol - GetXclCol();
for( XclExpMultiXFIdDeq::const_iterator aIt = aRangeBeg; aIt != aRangeEnd; ++aIt )
@@ -1709,7 +1711,7 @@ void XclExpDefrowheight::WriteBody( XclExpStream& rStrm )
// ----------------------------------------------------------------------------
-XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt16 nXclRow,
+XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty ) :
XclExpRecord( EXC_ID3_ROW, 16 ),
XclExpRoot( rRoot ),
@@ -1960,7 +1962,7 @@ void XclExpRow::InsertCell( XclExpCellRef xCell, size_t nPos, bool bIsMergedBase
void XclExpRow::WriteBody( XclExpStream& rStrm )
{
- rStrm << mnXclRow
+ rStrm << static_cast< sal_uInt16 >(mnXclRow)
<< GetFirstUsedXclCol()
<< GetFirstFreeXclCol()
<< mnHeight
@@ -2148,7 +2150,7 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions()
return &maDimensions;
}
-XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty )
+XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty )
{
RowMap::iterator itr = maRowMap.find(nXclRow);
if (itr == maRowMap.end())
@@ -2237,7 +2239,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
SCCOL nLastScCol = aIt.GetEndCol();
ScAddress aScPos( nScCol, nScRow, nScTab );
- XclAddress aXclPos( static_cast< sal_uInt16 >( nScCol ), static_cast< sal_uInt16 >( nScRow ) );
+ XclAddress aXclPos( static_cast< sal_uInt16 >( nScCol ), static_cast< sal_uInt32 >( nScRow ) );
sal_uInt16 nLastXclCol = static_cast< sal_uInt16 >( nLastScCol );
const ScBaseCell* pScCell = aIt.GetCell();
diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx
index 0108703..92cc65c 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -353,7 +353,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc
maData.mnSplitX = static_cast< sal_uInt16 >( nFreezeScCol ) - maData.maFirstXclPos.mnCol;
SCROW nFreezeScRow = rTabSett.maFreezePos.Row();
if( (0 < nFreezeScRow) && (nFreezeScRow <= GetXclMaxPos().Row()) )
- maData.mnSplitY = static_cast< sal_uInt16 >( nFreezeScRow ) - maData.maFirstXclPos.mnRow;
+ maData.mnSplitY = static_cast< sal_uInt32 >( nFreezeScRow ) - maData.maFirstXclPos.mnRow;
// if both splits are left out (address overflow), remove the frozen flag
maData.mbFrozenPanes = maData.IsSplit();
diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index 34a02e0..7fd1dd1 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -51,7 +51,7 @@
namespace {
/** Fills the passed Calc address with the passed Excel cell coordinates without checking any limits. */
-inline void lclFillAddress( ScAddress& rScPos, sal_uInt16 nXclCol, sal_uInt16 nXclRow, SCTAB nScTab )
+inline void lclFillAddress( ScAddress& rScPos, sal_uInt16 nXclCol, sal_uInt32 nXclRow, SCTAB nScTab )
{
rScPos.SetCol( static_cast< SCCOL >( nXclCol ) );
rScPos.SetRow( static_cast< SCROW >( nXclRow ) );
@@ -119,7 +119,7 @@ bool XclImpAddressConverter::ConvertRange( ScRange& rScRange,
// check & correct end position
sal_uInt16 nXclCol2 = rXclRange.maLast.mnCol;
- sal_uInt16 nXclRow2 = rXclRange.maLast.mnRow;
+ sal_uInt32 nXclRow2 = rXclRange.maLast.mnRow;
if( !CheckAddress( rXclRange.maLast, bWarn ) )
{
nXclCol2 = ::std::min( nXclCol2, mnMaxCol );
diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx
index 461e29c..92e3517 100644
--- a/sc/source/filter/excel/xladdress.cxx
+++ b/sc/source/filter/excel/xladdress.cxx
@@ -37,7 +37,9 @@
void XclAddress::Read( XclImpStream& rStrm, bool bCol16Bit )
{
- rStrm >> mnRow;
+ //Bubli's row limit ... uff ???
+ //rStrm >> mnRow;
+ mnRow = rStrm.ReaduInt16();
if( bCol16Bit )
rStrm >> mnCol;
else
@@ -46,7 +48,8 @@ void XclAddress::Read( XclImpStream& rStrm, bool bCol16Bit )
void XclAddress::Write( XclExpStream& rStrm, bool bCol16Bit ) const
{
- rStrm << mnRow;
+ //Bubli's row limit
+ rStrm << static_cast<sal_uInt16> (mnRow);
if( bCol16Bit )
rStrm << mnCol;
else
@@ -63,7 +66,11 @@ bool XclRange::Contains( const XclAddress& rPos ) const
void XclRange::Read( XclImpStream& rStrm, bool bCol16Bit )
{
- rStrm >> maFirst.mnRow >> maLast.mnRow;
+ //Bubli's row limit
+ //rStrm >> maFirst.mnRow >> maLast.mnRow;
+ maFirst.mnRow = rStrm.ReaduInt16();
+ maLast.mnRow = rStrm.ReaduInt16();
+
if( bCol16Bit )
rStrm >> maFirst.mnCol >> maLast.mnCol;
else
@@ -75,7 +82,8 @@ void XclRange::Read( XclImpStream& rStrm, bool bCol16Bit )
void XclRange::Write( XclExpStream& rStrm, bool bCol16Bit ) const
{
- rStrm << maFirst.mnRow << maLast.mnRow;
+ //Bubli's row limit
+ rStrm << static_cast<sal_uInt16>(maFirst.mnRow) << static_cast<sal_uInt16>(maLast.mnRow);
if( bCol16Bit )
rStrm << maFirst.mnCol << maLast.mnCol;
else
@@ -140,7 +148,7 @@ XclAddressConverterBase::XclAddressConverterBase( XclTracer& rTracer, const ScAd
mbTabTrunc( false )
{
DBG_ASSERT( static_cast< size_t >( rMaxPos.Col() ) <= SAL_MAX_UINT16, "XclAddressConverterBase::XclAddressConverterBase - invalid max column" );
- DBG_ASSERT( static_cast< size_t >( rMaxPos.Row() ) <= SAL_MAX_UINT16, "XclAddressConverterBase::XclAddressConverterBase - invalid max row" );
+ DBG_ASSERT( static_cast< size_t >( rMaxPos.Row() ) <= SAL_MAX_UINT32, "XclAddressConverterBase::XclAddressConverterBase - invalid max row" );
}
XclAddressConverterBase::~XclAddressConverterBase()
diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx
index 2e5ab54..c42fc83 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -130,8 +130,8 @@ void lclGetColFromX(
/** Calculates an object row position from a drawing layer Y position (in twips). */
void lclGetRowFromY(
- ScDocument& rDoc, SCTAB nScTab, sal_uInt16& rnXclRow,
- sal_uInt16& rnOffset, sal_uInt16 nXclStartRow, sal_uInt16 nXclMaxRow,
+ ScDocument& rDoc, SCTAB nScTab, sal_uInt32& rnXclRow,
+ sal_uInt32& rnOffset, sal_uInt32 nXclStartRow, sal_uInt32 nXclMaxRow,
long& rnStartH, long nY, double fScale )
{
// rnStartH in conjunction with nXclStartRow is used as buffer for previously calculated height
@@ -143,7 +143,7 @@ void lclGetRowFromY(
nRowH = rDoc.GetRowHeight( nRow, nScTab );
if( rnStartH + nRowH > nTwipsY )
{
- rnXclRow = static_cast< sal_uInt16 >( nRow );
+ rnXclRow = static_cast< sal_uInt32 >( nRow );
bFound = true;
break;
}
@@ -151,7 +151,7 @@ void lclGetRowFromY(
}
if( !bFound )
rnXclRow = nXclMaxRow;
- rnOffset = static_cast< sal_uInt16 >( nRowH ? ((nTwipsY - rnStartH) * 256.0 / nRowH + 0.5) : 0 );
+ rnOffset = static_cast< sal_uInt32 >( nRowH ? ((nTwipsY - rnStartH) * 256.0 / nRowH + 0.5) : 0 );
}
/** Mirrors a rectangle (from LTR to RTL layout or vice versa). */
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 2ad4c45..7c1ffd5 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -74,7 +74,7 @@ class XclExpRangeFmlaBase : public XclExpRecord
{
public:
/** Returns true, if the passed cell position is equal to own base position. */
- bool IsBasePos( sal_uInt16 nXclCol, sal_uInt16 nXclRow ) const;
+ bool IsBasePos( sal_uInt16 nXclCol, sal_uInt32 nXclRow ) const;
/** Derived classes create the token array for a corresponding FORMULA cell record. */
virtual XclTokenArrayRef CreateCellTokenArray( const XclExpRoot& rRoot ) const = 0;
@@ -241,9 +241,9 @@ private:
SCTAB mnScTab; /// Sheet index of this record.
sal_uInt16 mnLastAppXclCol;/// Column index of last appended cell.
sal_uInt16 mnColInpXclCol; /// Column index of column input cell.
- sal_uInt16 mnColInpXclRow; /// Row index of column input cell.
+ sal_uInt32 mnColInpXclRow; /// Row index of column input cell.
sal_uInt16 mnRowInpXclCol; /// Column index of row input cell.
- sal_uInt16 mnRowInpXclRow; /// Row index of row input cell.
+ sal_uInt32 mnRowInpXclRow; /// Row index of row input cell.
sal_uInt8 mnScMode; /// Type of the multiple operation (Calc constant).
bool mbValid; /// true = Contains valid references.
};
@@ -290,7 +290,7 @@ public:
/** Returns the (first) Excel column index of the cell(s). */
inline sal_uInt16 GetXclCol() const { return maXclPos.mnCol; }
/** Returns the Excel row index of the cell. */
- inline sal_uInt16 GetXclRow() const { return maXclPos.mnRow; }
+ inline sal_uInt32 GetXclRow() const { return maXclPos.mnRow; }
/** Derived classes return the column index of the last contained cell. */
virtual sal_uInt16 GetLastXclCol() const = 0;
@@ -318,7 +318,7 @@ protected:
/** Sets this record to a new column position. */
inline void SetXclCol( sal_uInt16 nXclCol ) { maXclPos.mnCol = nXclCol; }
/** Sets this record to a new row position. */
- inline void SetXclRow( sal_uInt16 nXclRow ) { maXclPos.mnRow = nXclRow; }
+ inline void SetXclRow( sal_uInt32 nXclRow ) { maXclPos.mnRow = nXclRow; }
private:
XclAddress maXclPos; /// Address of the cell.
@@ -879,11 +879,11 @@ public:
/** Constructs the ROW record and converts the Calc row settings.
@param bAlwaysEmpty true = This row will not be filled with blank cells
in the Finalize() function. */
- explicit XclExpRow( const XclExpRoot& rRoot, sal_uInt16 nXclRow,
+ explicit XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty );
/** Returns the excel row index of this ROW record. */
- inline sal_uInt16 GetXclRow() const { return mnXclRow; }
+ inline sal_uInt32 GetXclRow() const { return mnXclRow; }
/** Returns the height of the row in twips. */
inline sal_uInt16 GetHeight() const { return mnHeight; }
/** Returns true, if this row does not contain at least one valid cell. */
@@ -938,7 +938,7 @@ private:
typedef XclExpRecordList< XclExpCellBase > XclExpCellList;
XclExpCellList maCellList; /// List of cell records for this row.
- sal_uInt16 mnXclRow; /// Excel row index of this row.
+ sal_uInt32 mnXclRow; /// Excel row index of this row.
sal_uInt16 mnHeight; /// Row height in twips.
sal_uInt16 mnFlags; /// Flags for the ROW record.
sal_uInt16 mnXFIndex; /// Default row formatting.
@@ -981,7 +981,7 @@ private:
/** Returns access to the specified ROW record. Inserts preceding missing ROW records.
@param bRowAlwaysEmpty true = Created rows will not be filled with blank cells
in the XclExpRow::Finalize() function. */
- XclExpRow& GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty );
+ XclExpRow& GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty );
private:
typedef ::boost::shared_ptr<XclExpRow> RowRef;
diff --git a/sc/source/filter/inc/xeview.hxx b/sc/source/filter/inc/xeview.hxx
index 709b433..d3f356f 100644
--- a/sc/source/filter/inc/xeview.hxx
+++ b/sc/source/filter/inc/xeview.hxx
@@ -109,7 +109,7 @@ private:
private:
sal_uInt16 mnSplitX; /// Split X position, or frozen column.
- sal_uInt16 mnSplitY; /// Split Y position, or frozen row.
+ sal_uInt32 mnSplitY; /// Split Y position, or frozen row.
XclAddress maSecondXclPos; /// First visible cell in additional panes.
sal_uInt8 mnActivePane; /// Active pane (with cell cursor).
};
diff --git a/sc/source/filter/inc/xladdress.hxx b/sc/source/filter/inc/xladdress.hxx
index 9b12fe5..5e971ce 100644
--- a/sc/source/filter/inc/xladdress.hxx
+++ b/sc/source/filter/inc/xladdress.hxx
@@ -42,13 +42,13 @@ class XclExpStream;
struct XclAddress
{
sal_uInt16 mnCol;
- sal_uInt16 mnRow;
+ sal_uInt32 mnRow;
inline explicit XclAddress( ScAddress::Uninitialized ) {}
inline explicit XclAddress() : mnCol( 0 ), mnRow( 0 ) {}
- inline explicit XclAddress( sal_uInt16 nCol, sal_uInt16 nRow ) : mnCol( nCol ), mnRow( nRow ) {}
+ inline explicit XclAddress( sal_uInt16 nCol, sal_uInt32 nRow ) : mnCol( nCol ), mnRow( nRow ) {}
- inline void Set( sal_uInt16 nCol, sal_uInt16 nRow ) { mnCol = nCol; mnRow = nRow; }
+ inline void Set( sal_uInt16 nCol, sal_uInt32 nRow ) { mnCol = nCol; mnRow = nRow; }
void Read( XclImpStream& rStrm, bool bCol16Bit = true );
void Write( XclExpStream& rStrm, bool bCol16Bit = true ) const;
@@ -88,16 +88,16 @@ struct XclRange
inline explicit XclRange() {}
inline explicit XclRange( const XclAddress& rPos ) : maFirst( rPos ), maLast( rPos ) {}
inline explicit XclRange( const XclAddress& rFirst, const XclAddress& rLast ) : maFirst( rFirst ), maLast( rLast ) {}
- inline explicit XclRange( sal_uInt16 nCol1, sal_uInt16 nRow1, sal_uInt16 nCol2, sal_uInt16 nRow2 ) :
+ inline explicit XclRange( sal_uInt16 nCol1, sal_uInt32 nRow1, sal_uInt16 nCol2, sal_uInt32 nRow2 ) :
maFirst( nCol1, nRow1 ), maLast( nCol2, nRow2 ) {}
inline void Set( const XclAddress& rFirst, const XclAddress& rLast )
{ maFirst = rFirst; maLast = rLast; }
- inline void Set( sal_uInt16 nCol1, sal_uInt16 nRow1, sal_uInt16 nCol2, sal_uInt16 nRow2 )
+ inline void Set( sal_uInt16 nCol1, sal_uInt32 nRow1, sal_uInt16 nCol2, sal_uInt32 nRow2 )
{ maFirst.Set( nCol1, nRow1 ); maLast.Set( nCol2, nRow2 ); }
inline sal_uInt16 GetColCount() const { return maLast.mnCol - maFirst.mnCol + 1; }
- inline sal_uInt16 GetRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; }
+ inline sal_uInt32 GetRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; }
bool Contains( const XclAddress& rPos ) const;
void Read( XclImpStream& rStrm, bool bCol16Bit = true );
@@ -186,7 +186,7 @@ protected:
XclTracer& mrTracer; /// Tracer for invalid addresses.
ScAddress maMaxPos; /// Default maximum position.
sal_uInt16 mnMaxCol; /// Maximum column index, as 16-bit value.
- sal_uInt16 mnMaxRow; /// Maximum row index, as 16-bit value.
+ sal_uInt32 mnMaxRow; /// Maximum row index.
bool mbColTrunc; /// Flag for "columns truncated" warning box.
bool mbRowTrunc; /// Flag for "rows truncated" warning box.
bool mbTabTrunc; /// Flag for "tables truncated" warning box.
diff --git a/sc/source/filter/inc/xlconst.hxx b/sc/source/filter/inc/xlconst.hxx
index c507cb2..e2e0a1a 100644
--- a/sc/source/filter/inc/xlconst.hxx
+++ b/sc/source/filter/inc/xlconst.hxx
@@ -75,6 +75,10 @@ const SCCOL EXC_MAXCOL8 = EXC_MAXCOL5;
const SCROW EXC_MAXROW8 = 65535;
const SCTAB EXC_MAXTAB8 = EXC_MAXTAB5;
+const SCCOL EXC_MAXCOL_XML_2007 = 16383;
+const SCROW EXC_MAXROW_XML_2007 = 1048575;
+const SCTAB EXC_MAXTAB_XML_2007 = 1023;
+
const sal_uInt16 EXC_NOTAB = SAL_MAX_UINT16; /// An invalid Excel sheet index, for common use.
const SCTAB SCTAB_INVALID = SCTAB_MAX; /// An invalid Calc sheet index, for common use.
const SCTAB SCTAB_GLOBAL = SCTAB_MAX; /// A Calc sheet index for the workbook globals.
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index d764229..fb20688 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -315,9 +315,9 @@ bool operator<( const XclObjId& rL, const XclObjId& rR );
struct XclObjAnchor : public XclRange
{
sal_uInt16 mnLX; /// X offset in left column (1/1024 of column width).
- sal_uInt16 mnTY; /// Y offset in top row (1/256 of row height).
+ sal_uInt32 mnTY; /// Y offset in top row (1/256 of row height).
sal_uInt16 mnRX; /// X offset in right column (1/1024 of column width).
- sal_uInt16 mnBY; /// Y offset in bottom row (1/256 of row height).
+ sal_uInt32 mnBY; /// Y offset in bottom row (1/256 of row height).
explicit XclObjAnchor();
More information about the Libreoffice-commits
mailing list