summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/excel')
-rw-r--r--sc/source/filter/excel/excform.cxx4
-rw-r--r--sc/source/filter/excel/impop.cxx59
-rw-r--r--sc/source/filter/excel/read.cxx96
-rw-r--r--sc/source/filter/excel/xechart.cxx2
-rw-r--r--sc/source/filter/excel/xeformula.cxx16
-rw-r--r--sc/source/filter/excel/xepivot.cxx10
-rw-r--r--sc/source/filter/excel/xichart.cxx54
-rw-r--r--sc/source/filter/excel/xiescher.cxx42
-rw-r--r--sc/source/filter/excel/xistream.cxx6
-rw-r--r--sc/source/filter/excel/xistyle.cxx24
-rw-r--r--sc/source/filter/excel/xladdress.cxx2
-rwxr-xr-xsc/source/filter/excel/xlchart.cxx33
-rwxr-xr-xsc/source/filter/excel/xlformula.cxx16
-rw-r--r--sc/source/filter/excel/xlpage.cxx4
-rw-r--r--sc/source/filter/excel/xlstyle.cxx10
-rw-r--r--sc/source/filter/excel/xltools.cxx20
16 files changed, 241 insertions, 157 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 00862032603c..ea2225915026 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -84,8 +84,6 @@ void ImportExcel::Formula25()
bShrFmla = nFlag0 & 0x08; // shared or not shared
}
- nLastXF = nXF;
-
Formula( aXclPos, nXF, nFormLen, fCurVal, bShrFmla );
}
@@ -107,8 +105,6 @@ void ImportExcel::Formula4()
aIn.Ignore( 1 );
aIn >> nFormLen;
- nLastXF = nXF;
-
Formula( aXclPos, nXF, nFormLen, fCurVal, sal_False );
}
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index f55911f3f3fb..b5bb9e6e79ce 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -123,11 +123,13 @@ ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
XclImpRoot( rImpData ),
maStrm( rStrm, GetRoot() ),
aIn( maStrm ),
- maScOleSize( ScAddress::INITIALIZE_INVALID )
+ maScOleSize( ScAddress::INITIALIZE_INVALID ),
+ mnLastRefIdx( 0 ),
+ mnIxfeIndex( 0 ),
+ mbBiff2HasXfs( false ),
+ mbBiff2HasXfsValid( false )
{
- mnLastRefIdx = 0;
nBdshtTab = 0;
- nIxfeIndex = 0; // zur Sicherheit auf 0
// Root-Daten fuellen - nach new's ohne Root als Parameter
pExcRoot = &GetOldRoot();
@@ -193,17 +195,40 @@ void ImportExcel::ReadFileSharing()
}
}
-sal_uInt16 ImportExcel::ReadXFIndex( bool bBiff2 )
+sal_uInt16 ImportExcel::ReadXFIndex( const ScAddress& rScPos, bool bBiff2 )
{
sal_uInt16 nXFIdx = 0;
if( bBiff2 )
{
- sal_uInt8 nXFIdx2;
- maStrm >> nXFIdx2;
- maStrm.Ignore( 2 );
- nXFIdx = nXFIdx2 & 0x3F;
- if( nXFIdx == 63 )
- nXFIdx = nIxfeIndex;
+ /* #i71453# On first call, check if the file contains XF records (by
+ trying to access the first XF with index 0). If there are no XFs,
+ the explicit formatting information contained in each cell record
+ will be used instead. */
+ if( !mbBiff2HasXfsValid )
+ {
+ mbBiff2HasXfsValid = true;
+ mbBiff2HasXfs = GetXFBuffer().GetXF( 0 ) != 0;
+ }
+ // read formatting information (includes the XF identifier)
+ sal_uInt8 nFlags1, nFlags2, nFlags3;
+ maStrm >> nFlags1 >> nFlags2 >> nFlags3;
+ /* If the file contains XFs, extract and set the XF identifier,
+ otherwise get the explicit formatting. */
+ if( mbBiff2HasXfs )
+ {
+ nXFIdx = ::extract_value< sal_uInt16 >( nFlags1, 0, 6 );
+ /* If the identifier is equal to 63, then the real identifier is
+ contained in the preceding IXFE record (stored in mnBiff2XfId). */
+ if( nXFIdx == 63 )
+ nXFIdx = mnIxfeIndex;
+ }
+ else
+ {
+ /* Let the XclImpXF class do the conversion of the imported
+ formatting. The XF buffer is empty, therefore will not do any
+ conversion based on the XF index later on. */
+ XclImpXF::ApplyPatternForBiff2CellFormat( GetRoot(), rScPos, nFlags1, nFlags2, nFlags3 );
+ }
}
else
aIn >> nXFIdx;
@@ -258,7 +283,7 @@ void ImportExcel::ReadBlank()
ScAddress aScPos( ScAddress::UNINITIALIZED );
if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
{
- sal_uInt16 nXFIdx = ReadXFIndex( maStrm.GetRecId() == EXC_ID2_BLANK );
+ sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_BLANK );
GetXFRangeBuffer().SetBlankXF( aScPos, nXFIdx );
}
@@ -272,7 +297,7 @@ void ImportExcel::ReadInteger()
ScAddress aScPos( ScAddress::UNINITIALIZED );
if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
{
- sal_uInt16 nXFIdx = ReadXFIndex( true );
+ sal_uInt16 nXFIdx = ReadXFIndex( aScPos, true );
sal_uInt16 nValue;
maStrm >> nValue;
@@ -289,7 +314,7 @@ void ImportExcel::ReadNumber()
ScAddress aScPos( ScAddress::UNINITIALIZED );
if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
{
- sal_uInt16 nXFIdx = ReadXFIndex( maStrm.GetRecId() == EXC_ID2_NUMBER );
+ sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_NUMBER );
double fValue;
maStrm >> fValue;
@@ -312,7 +337,7 @@ void ImportExcel::ReadLabel()
0x0204 2-7 2 byte 16-bit length, byte string
0x0204 8 2 byte 16-bit length, unicode string */
bool bBiff2 = maStrm.GetRecId() == EXC_ID2_LABEL;
- sal_uInt16 nXFIdx = ReadXFIndex( bBiff2 );
+ sal_uInt16 nXFIdx = ReadXFIndex( aScPos, bBiff2 );
XclStrFlags nFlags = (bBiff2 && (GetBiff() <= EXC_BIFF5)) ? EXC_STR_8BITLENGTH : EXC_STR_DEFAULT;
XclImpString aString;
@@ -337,7 +362,7 @@ void ImportExcel::ReadBoolErr()
ScAddress aScPos( ScAddress::UNINITIALIZED );
if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
{
- sal_uInt16 nXFIdx = ReadXFIndex( maStrm.GetRecId() == EXC_ID2_BOOLERR );
+ sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_BOOLERR );
sal_uInt8 nValue, nType;
maStrm >> nValue >> nType;
@@ -362,7 +387,7 @@ void ImportExcel::ReadRk()
ScAddress aScPos( ScAddress::UNINITIALIZED );
if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) )
{
- sal_uInt16 nXFIdx = ReadXFIndex( false );
+ sal_uInt16 nXFIdx = ReadXFIndex( aScPos, false );
sal_Int32 nRk;
maStrm >> nRk;
@@ -628,7 +653,7 @@ void ImportExcel::Codepage( void )
void ImportExcel::Ixfe( void )
{
- aIn >> nIxfeIndex;
+ maStrm >> mnIxfeIndex;
}
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 55f1f97ceea0..5bbd3ccaa9ec 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -836,11 +836,56 @@ FltError ImportExcel8::Read( void )
if( eAkt == EXC_STATE_BEFORE_SHEET )
{
sal_uInt16 nScTab = GetCurrScTab();
- if( nScTab < maSheetOffsets.size() )
+ if( nScTab < maSheetOffsets.size() )
{
- nProgressBaseSize += (aIn.GetSvStreamPos() - nProgressBasePos);
+ nProgressBaseSize += (maStrm.GetSvStreamPos() - nProgressBasePos);
nProgressBasePos = maSheetOffsets[ nScTab ];
- aIn.StartNextRecord( nProgressBasePos );
+ maStrm.StartNextRecord( nProgressBasePos );
+
+ // #94191# import only 256 sheets
+ if( nScTab > GetScMaxPos().Tab() )
+ {
+ if( maStrm.GetRecId() != EXC_ID_EOF )
+ XclTools::SkipSubStream( maStrm );
+ // #i29930# show warning box
+ GetAddressConverter().CheckScTab( nScTab, true );
+ eAkt = EXC_STATE_END;
+ }
+ else
+ {
+ // #i109800# SHEET record may point to any record inside the sheet substream
+ bool bIsBof = maStrm.GetRecId() == EXC_ID5_BOF;
+ if( bIsBof )
+ Bof5(); // read the BOF record
+ else
+ pExcRoot->eDateiTyp = Biff8; // on missing BOF, assume a standard worksheet
+
+ NeueTabelle();
+ switch( pExcRoot->eDateiTyp )
+ {
+ case Biff8: // worksheet
+ case Biff8M4: // macro sheet
+ eAkt = EXC_STATE_SHEET_PRE; // Shrfmla Prefetch, Row-Prefetch
+ // go to next record
+ if( bIsBof ) maStrm.StartNextRecord();
+ maStrm.StoreGlobalPosition();
+ break;
+ case Biff8C: // chart sheet
+ GetCurrSheetDrawing().ReadTabChart( maStrm );
+ Eof();
+ GetTracer().TraceChartOnlySheet();
+ break;
+ case Biff8W: // workbook
+ DBG_ERRORFILE( "ImportExcel8::Read - double workbook globals" );
+ // run through
+ case Biff8V: // VB module
+ default:
+ // TODO: do not create a sheet in the Calc document
+ pD->SetVisible( GetCurrScTab(), sal_False );
+ XclTools::SkipSubStream( maStrm );
+ IncCurrScTab();
+ }
+ }
}
else
eAkt = EXC_STATE_END;
@@ -1018,51 +1063,6 @@ FltError ImportExcel8::Read( void )
break;
// ----------------------------------------------------------------
- // before worksheet: wait for new worksheet BOF
- case EXC_STATE_BEFORE_SHEET:
- {
- if( nRecId == EXC_ID5_BOF )
- {
- // #94191# import only 256 sheets
- if( GetCurrScTab() > GetScMaxPos().Tab() )
- {
- XclTools::SkipSubStream( maStrm );
- // #i29930# show warning box
- GetAddressConverter().CheckScTab( GetCurrScTab(), true );
- eAkt = EXC_STATE_END;
- }
- else
- {
- Bof5();
- NeueTabelle();
- switch( pExcRoot->eDateiTyp )
- {
- case Biff8: // worksheet
- case Biff8M4: // macro sheet
- eAkt = EXC_STATE_SHEET_PRE; // Shrfmla Prefetch, Row-Prefetch
- aIn.StoreGlobalPosition();
- break;
- case Biff8C: // chart sheet
- GetCurrSheetDrawing().ReadTabChart( maStrm );
- Eof();
- GetTracer().TraceChartOnlySheet();
- break;
- case Biff8W: // workbook
- DBG_ERRORFILE( "ImportExcel8::Read - double workbook globals" );
- // run through
- case Biff8V: // VB module
- default:
- // TODO: do not create a sheet in the Calc document
- pD->SetVisible( GetCurrScTab(), sal_False );
- XclTools::SkipSubStream( maStrm );
- IncCurrScTab();
- }
- }
- }
- }
- break;
-
- // ----------------------------------------------------------------
// prefetch for worksheet
case EXC_STATE_SHEET_PRE:
{
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 07b4a76a9c82..6aab83a050f7 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -718,7 +718,7 @@ bool XclExpChEscherFormat::HasSubRecords() const
void XclExpChEscherFormat::WriteSubRecords( XclExpStream& rStrm )
{
rStrm.StartRecord( EXC_ID_CHPICFORMAT, 14 );
- rStrm << maPicFmt.mnBmpMode << maPicFmt.mnFormat << maPicFmt.mnFlags << maPicFmt.mfScale;
+ rStrm << maPicFmt.mnBmpMode << sal_uInt16( 0 ) << maPicFmt.mnFlags << maPicFmt.mfScale;
rStrm.EndRecord();
}
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 7b3f84c42643..429d15f3dbfa 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -28,11 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-// XXX xelink.hxx MUST be included before xeformula.hxx because of the
-// redifinition of the CREATE_OUSTRING() macro, which is in oox/helper.hxx
-// (indirectly included via xelink.hxx) and ../inc/ftools.hxx (indirectly
-// included via xeformula.hxx) that does an undef first. Ugly.
-#include "xelink.hxx"
#include "xeformula.hxx"
#include <list>
@@ -46,6 +41,7 @@
#include "token.hxx"
#include "tokenarray.hxx"
#include "xehelper.hxx"
+#include "xelink.hxx"
#include "xename.hxx"
#include "xestream.hxx"
@@ -508,7 +504,7 @@ XclExpFmlaCompImpl::XclExpFmlaCompImpl( const XclExpRoot& rRoot ) :
mnMaxRowMask( static_cast< sal_uInt16 >( rRoot.GetXclMaxPos().Row() ) )
{
// build the configuration map
- for( const XclExpCompConfig* pEntry = spConfigTable; pEntry != STATIC_TABLE_END( spConfigTable ); ++pEntry )
+ for( const XclExpCompConfig* pEntry = spConfigTable; pEntry != STATIC_ARRAY_END( spConfigTable ); ++pEntry )
maCfgMap[ pEntry->meType ] = *pEntry;
}
@@ -1439,7 +1435,11 @@ void XclExpFmlaCompImpl::PrepareFunction( XclExpFuncData& rFuncData )
{
switch( rFuncData.GetOpCode() )
{
+ case ocCosecant: // simulate CSC(x) by (1/SIN(x))
+ case ocSecant: // simulate SEC(x) by (1/COS(x))
case ocCot: // simulate COT(x) by (1/TAN(x))
+ case ocCosecantHyp: // simulate CSCH(x) by (1/SINH(x))
+ case ocSecantHyp: // simulate SECH(x) by (1/COSH(x))
case ocCotHyp: // simulate COTH(x) by (1/TANH(x))
AppendIntToken( 1 );
break;
@@ -1489,7 +1489,11 @@ void XclExpFmlaCompImpl::FinishFunction( XclExpFuncData& rFuncData, sal_uInt8 nC
FinishChooseFunction( rFuncData );
break;
+ case ocCosecant: // simulate CSC(x) by (1/SIN(x))
+ case ocSecant: // simulate SEC(x) by (1/COS(x))
case ocCot: // simulate COT(x) by (1/TAN(x))
+ case ocCosecantHyp: // simulate CSCH(x) by (1/SINH(x))
+ case ocSecantHyp: // simulate SECH(x) by (1/COSH(x))
case ocCotHyp: // simulate COTH(x) by (1/TANH(x))
AppendBinaryOperatorToken( EXC_TOKID_DIV, true );
AppendParenToken();
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index b5eb50f7941b..f38b941cdfce 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -976,8 +976,10 @@ const String& XclExpPTItem::GetItemName() const
void XclExpPTItem::SetPropertiesFromMember( const ScDPSaveMember& rSaveMem )
{
- ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.GetIsVisible() );
- ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.GetShowDetails() );
+ // #i115659# GetIsVisible() is not valid if HasIsVisible() returns false, default is 'visible' then
+ ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, rSaveMem.HasIsVisible() && !rSaveMem.GetIsVisible() );
+ // #i115659# GetShowDetails() is not valid if HasShowDetails() returns false, default is 'show detail' then
+ ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, rSaveMem.HasShowDetails() && !rSaveMem.GetShowDetails() );
// visible name
const OUString* pVisName = rSaveMem.GetLayoutName();
@@ -1072,8 +1074,8 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim )
DBG_ASSERT( eOrient != DataPilotFieldOrientation_DATA, "XclExpPTField::SetPropertiesFromDim - called for data field" );
maFieldInfo.AddApiOrient( eOrient );
- // show empty items
- ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.GetShowEmpty() );
+ // show empty items (#i115659# GetShowEmpty() is not valid if HasShowEmpty() returns false, default is false then)
+ ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.HasShowEmpty() && rSaveDim.GetShowEmpty() );
// visible name
const OUString* pLayoutName = rSaveDim.GetLayoutName();
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index dcd9fc5db164..c2d61921c924 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -373,12 +373,12 @@ void XclImpChRoot::ConvertAreaFormat( ScfPropertySet& rPropSet,
}
void XclImpChRoot::ConvertEscherFormat( ScfPropertySet& rPropSet,
- const XclChEscherFormat& rEscherFmt, const XclChPicFormat& rPicFmt,
- XclChPropertyMode ePropMode ) const
+ const XclChEscherFormat& rEscherFmt, const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType, XclChPropertyMode ePropMode ) const
{
GetChartPropSetHelper().WriteEscherProperties( rPropSet,
*mxChData->mxGradientTable, *mxChData->mxHatchTable, *mxChData->mxBitmapTable,
- rEscherFmt, rPicFmt, ePropMode );
+ rEscherFmt, pPicFmt, nDffFillType, ePropMode );
}
void XclImpChRoot::ConvertFont( ScfPropertySet& rPropSet,
@@ -526,7 +526,8 @@ void XclImpChAreaFormat::Convert( const XclImpChRoot& rRoot,
// ----------------------------------------------------------------------------
-XclImpChEscherFormat::XclImpChEscherFormat( const XclImpRoot& rRoot )
+XclImpChEscherFormat::XclImpChEscherFormat( const XclImpRoot& rRoot ) :
+ mnDffFillType( mso_fillSolid )
{
maData.mxItemSet.reset(
new SfxItemSet( rRoot.GetDoc().GetDrawLayer()->GetItemPool() ) );
@@ -540,9 +541,8 @@ void XclImpChEscherFormat::ReadHeaderRecord( XclImpStream& rStrm )
rStrm >> aPropSet;
// get the data
aPropSet.FillToItemSet( *maData.mxItemSet );
- // get bitmap mode from DFF item set
- sal_uInt32 nType = aPropSet.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
- maPicFmt.mnBmpMode = (nType == mso_fillPicture) ? EXC_CHPICFORMAT_STRETCH : EXC_CHPICFORMAT_STACK;
+ // get fill type from DFF property set
+ mnDffFillType = aPropSet.GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
}
void XclImpChEscherFormat::ReadSubRecord( XclImpStream& rStrm )
@@ -550,16 +550,18 @@ void XclImpChEscherFormat::ReadSubRecord( XclImpStream& rStrm )
switch( rStrm.GetRecId() )
{
case EXC_ID_CHPICFORMAT:
- rStrm >> maPicFmt.mnBmpMode >> maPicFmt.mnFormat >> maPicFmt.mnFlags >> maPicFmt.mfScale;
+ rStrm >> maPicFmt.mnBmpMode;
+ rStrm.Ignore( 2 );
+ rStrm >> maPicFmt.mnFlags >> maPicFmt.mfScale;
break;
}
}
void XclImpChEscherFormat::Convert( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType ) const
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, bool bUsePicFmt ) const
{
const XclChFormatInfo& rFmtInfo = rRoot.GetFormatInfo( eObjType );
- rRoot.ConvertEscherFormat( rPropSet, maData, maPicFmt, rFmtInfo.mePropMode );
+ rRoot.ConvertEscherFormat( rPropSet, maData, bUsePicFmt ? &maPicFmt : 0, mnDffFillType, rFmtInfo.mePropMode );
}
// ----------------------------------------------------------------------------
@@ -620,23 +622,23 @@ void XclImpChFrameBase::ConvertLineBase( const XclImpChRoot& rRoot,
}
void XclImpChFrameBase::ConvertAreaBase( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const
{
if( rRoot.GetFormatInfo( eObjType ).mbIsFrame )
{
// CHESCHERFORMAT overrides CHAREAFORMAT (even if it is auto)
if( mxEscherFmt.is() )
- mxEscherFmt->Convert( rRoot, rPropSet, eObjType );
+ mxEscherFmt->Convert( rRoot, rPropSet, eObjType, bUsePicFmt );
else if( mxAreaFmt.is() )
mxAreaFmt->Convert( rRoot, rPropSet, eObjType, nFormatIdx );
}
}
void XclImpChFrameBase::ConvertFrameBase( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx ) const
+ ScfPropertySet& rPropSet, XclChObjectType eObjType, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const
{
ConvertLineBase( rRoot, rPropSet, eObjType, nFormatIdx );
- ConvertAreaBase( rRoot, rPropSet, eObjType, nFormatIdx );
+ ConvertAreaBase( rRoot, rPropSet, eObjType, nFormatIdx, bUsePicFmt );
}
// ----------------------------------------------------------------------------
@@ -699,9 +701,9 @@ void XclImpChFrame::UpdateObjFrame( const XclObjLineData& rLineData, const XclOb
}
}
-void XclImpChFrame::Convert( ScfPropertySet& rPropSet ) const
+void XclImpChFrame::Convert( ScfPropertySet& rPropSet, bool bUsePicFmt ) const
{
- ConvertFrameBase( GetChRoot(), rPropSet, meObjType );
+ ConvertFrameBase( GetChRoot(), rPropSet, meObjType, EXC_CHDATAFORMAT_UNKNOWN, bUsePicFmt );
}
// Source links ===============================================================
@@ -1520,8 +1522,15 @@ void XclImpChDataFormat::UpdateTrendLineFormat()
void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeInfo& rTypeInfo ) const
{
- // line and area format
- ConvertFrameBase( GetChRoot(), rPropSet, rTypeInfo.GetSeriesObjectType(), maData.mnFormatIdx );
+ /* Line and area format.
+ #i71810# If the data points are filled with bitmaps, textures, or
+ patterns, then only bar charts will use the CHPICFORMAT record to
+ determine stacking/streching mode. All other chart types ignore this
+ record and always use the property 'fill-type' from the DFF property
+ set (streched for bitmaps, and stacked for textures and patterns). */
+ bool bUsePicFmt = rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR;
+ ConvertFrameBase( GetChRoot(), rPropSet, rTypeInfo.GetSeriesObjectType(), maData.mnFormatIdx, bUsePicFmt );
+
#if EXC_CHART2_3DBAR_HAIRLINES_ONLY
// #i83151# only hair lines in 3D charts with filled data points
if( rTypeInfo.mb3dChart && rTypeInfo.IsSeriesFrameFormat() && mxLineFmt.is() && mxLineFmt->HasLine() )
@@ -1553,9 +1562,9 @@ void XclImpChDataFormat::ConvertLine( ScfPropertySet& rPropSet, XclChObjectType
ConvertLineBase( GetChRoot(), rPropSet, eObjType );
}
-void XclImpChDataFormat::ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const
+void XclImpChDataFormat::ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const
{
- ConvertAreaBase( GetChRoot(), rPropSet, EXC_CHOBJTYPE_FILLEDSERIES, nFormatIdx );
+ ConvertAreaBase( GetChRoot(), rPropSet, EXC_CHOBJTYPE_FILLEDSERIES, nFormatIdx, bUsePicFmt );
}
void XclImpChDataFormat::RemoveUnusedFormats( const XclChExtTypeInfo& rTypeInfo )
@@ -1999,7 +2008,7 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
for( sal_uInt16 nPointIdx = 0, nPointCount = mxValueLink->GetCellCount(); nPointIdx < nPointCount; ++nPointIdx )
{
ScfPropertySet aPointProp = lclGetPointPropSet( xDataSeries, nPointIdx );
- mxSeriesFmt->ConvertArea( aPointProp, bVarPointFmt ? nPointIdx : mnSeriesIdx );
+ mxSeriesFmt->ConvertArea( aPointProp, bVarPointFmt ? nPointIdx : mnSeriesIdx, false );
}
}
@@ -3338,8 +3347,9 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup
void XclImpChAxis::ConvertWall( ScfPropertySet& rPropSet ) const
{
+ // #i71810# walls and floor in 3D charts use the CHPICFORMAT record for bitmap mode
if( mxWallFrame.is() )
- mxWallFrame->Convert( rPropSet );
+ mxWallFrame->Convert( rPropSet, true );
}
void XclImpChAxis::ConvertAxisPosition( ScfPropertySet& rPropSet, const XclImpChTypeGroup& rTypeGroup ) const
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index dcce436aebdb..60e567a1c408 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -653,7 +653,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillDa
{ 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
{ 0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00 }
};
- const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, STATIC_TABLE_SIZE( sppnPatterns ) ) ];
+ const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, STATIC_ARRAY_SIZE( sppnPatterns ) ) ];
// create 2-colored 8x8 DIB
SvMemoryStream aMemStrm;
aMemStrm << sal_uInt32( 12 ) << sal_Int16( 8 ) << sal_Int16( 8 ) << sal_uInt16( 1 ) << sal_uInt16( 1 );
@@ -1540,23 +1540,39 @@ XclImpChartObj::XclImpChartObj( const XclImpRoot& rRoot, bool bOwnTab ) :
void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm )
{
- if( mbOwnTab ? (rStrm.GetRecId() == EXC_ID5_BOF) : ((rStrm.GetNextRecId() == EXC_ID5_BOF) && rStrm.StartNextRecord()) )
+ /* If chart is read from a chartsheet (mbOwnTab == true), the BOF record
+ has already been read. If chart is embedded as object, the next record
+ has to be the BOF record. */
+ if( mbOwnTab )
{
- sal_uInt16 nBofType;
- rStrm.Seek( 2 );
- rStrm >> nBofType;
- DBG_ASSERT( nBofType == EXC_BOF_CHART, "XclImpChartObj::ReadChartSubStream - no chart BOF record" );
-
- // read chart, even if BOF record contains wrong substream identifier
- mxChart.reset( new XclImpChart( GetRoot(), mbOwnTab ) );
- mxChart->ReadChartSubStream( rStrm );
- if( mbOwnTab )
- FinalizeTabChart();
+ /* #i109800# The input stream may point somewhere inside the chart
+ substream and not exactly to the leading BOF record. To read this
+ record correctly in the following, the stream has to rewind it, so
+ that the next call to StartNextRecord() will find it correctly. */
+ if( rStrm.GetRecId() != EXC_ID5_BOF )
+ rStrm.RewindRecord();
}
else
{
- DBG_ERRORFILE( "XclImpChartObj::ReadChartSubStream - missing chart substream" );
+ if( (rStrm.GetNextRecId() == EXC_ID5_BOF) && rStrm.StartNextRecord() )
+ {
+ sal_uInt16 nBofType;
+ rStrm.Seek( 2 );
+ rStrm >> nBofType;
+ DBG_ASSERT( nBofType == EXC_BOF_CHART, "XclImpChartObj::ReadChartSubStream - no chart BOF record" );
+ }
+ else
+ {
+ DBG_ERRORFILE( "XclImpChartObj::ReadChartSubStream - missing chart substream" );
+ return;
+ }
}
+
+ // read chart, even if BOF record contains wrong substream identifier
+ mxChart.reset( new XclImpChart( GetRoot(), mbOwnTab ) );
+ mxChart->ReadChartSubStream( rStrm );
+ if( mbOwnTab )
+ FinalizeTabChart();
}
void XclImpChartObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize )
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index 534d40fa5cd5..27e6fce237d8 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -495,6 +495,12 @@ void XclImpStream::ResetRecord( bool bContLookup, sal_uInt16 nAltContId )
}
}
+void XclImpStream::RewindRecord()
+{
+ mnNextRecPos = maFirstRec.GetPos();
+ mbValid = mbValidRec = false;
+}
+
void XclImpStream::SetDecrypter( XclImpDecrypterRef xDecrypter )
{
mxDecrypter = xDecrypter;
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 0a57a5970800..e7efb6c096e9 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -846,7 +846,7 @@ bool lclConvertBorderLine( SvxBorderLine& rLine, const XclImpPalette& rPalette,
if( nXclLine == EXC_LINE_NONE )
return false;
- if( nXclLine >= STATIC_TABLE_SIZE( ppnLineParam ) )
+ if( nXclLine >= STATIC_ARRAY_SIZE( ppnLineParam ) )
nXclLine = EXC_LINE_THIN;
rLine.SetColor( rPalette.GetColor( nXclColor ) );
@@ -1217,6 +1217,28 @@ void XclImpXF::ApplyPattern(
}
}
+/*static*/ void XclImpXF::ApplyPatternForBiff2CellFormat( const XclImpRoot& rRoot,
+ const ScAddress& rScPos, sal_uInt8 nFlags1, sal_uInt8 nFlags2, sal_uInt8 nFlags3 )
+{
+ /* Create an XF object and let it do the work. We will have access to its
+ private members here. */
+ XclImpXF aXF( rRoot );
+
+ // no used flags available in BIFF2 (always true)
+ aXF.SetAllUsedFlags( true );
+
+ // set the attributes
+ aXF.maProtection.FillFromXF2( nFlags1 );
+ aXF.maAlignment.FillFromXF2( nFlags3 );
+ aXF.maBorder.FillFromXF2( nFlags3 );
+ aXF.maArea.FillFromXF2( nFlags3 );
+ aXF.mnXclNumFmt = ::extract_value< sal_uInt16 >( nFlags2, 0, 6 );
+ aXF.mnXclFont = ::extract_value< sal_uInt16 >( nFlags2, 6, 2 );
+
+ // write the attributes to the cell
+ aXF.ApplyPattern( rScPos.Col(), rScPos.Row(), rScPos.Col(), rScPos.Row(), rScPos.Tab() );
+}
+
void XclImpXF::SetUsedFlags( sal_uInt8 nUsedFlags )
{
/* Notes about finding the mb***Used flags:
diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx
index d0c1a925f8ab..62addbc1f4ee 100644
--- a/sc/source/filter/excel/xladdress.cxx
+++ b/sc/source/filter/excel/xladdress.cxx
@@ -138,8 +138,6 @@ XclAddressConverterBase::XclAddressConverterBase( XclTracer& rTracer, const ScAd
mbRowTrunc( false ),
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" );
}
XclAddressConverterBase::~XclAddressConverterBase()
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index 584d55021cd8..185f64b2dca4 100755
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -147,8 +147,7 @@ XclChEscherFormat::~XclChEscherFormat()
XclChPicFormat::XclChPicFormat() :
mnBmpMode( EXC_CHPICFORMAT_NONE ),
- mnFormat( EXC_CHPICFORMAT_DEFAULT ),
- mnFlags( EXC_CHPICFORMAT_DEFAULTFLAGS ),
+ mnFlags( EXC_CHPICFORMAT_TOPBOTTOM | EXC_CHPICFORMAT_FRONTBACK | EXC_CHPICFORMAT_LEFTRIGHT ),
mfScale( 0.5 )
{
}
@@ -423,7 +422,7 @@ sal_uInt16 XclChartHelper::GetSeriesLineAutoColorIdx( sal_uInt16 nFormatIdx )
17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 63
};
- return spnLineColors[ nFormatIdx % STATIC_TABLE_SIZE( spnLineColors ) ];
+ return spnLineColors[ nFormatIdx % STATIC_ARRAY_SIZE( spnLineColors ) ];
}
sal_uInt16 XclChartHelper::GetSeriesFillAutoColorIdx( sal_uInt16 nFormatIdx )
@@ -438,13 +437,13 @@ sal_uInt16 XclChartHelper::GetSeriesFillAutoColorIdx( sal_uInt16 nFormatIdx )
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23
};
- return spnFillColors[ nFormatIdx % STATIC_TABLE_SIZE( spnFillColors ) ];
+ return spnFillColors[ nFormatIdx % STATIC_ARRAY_SIZE( spnFillColors ) ];
}
sal_uInt8 XclChartHelper::GetSeriesFillAutoTransp( sal_uInt16 nFormatIdx )
{
static const sal_uInt8 spnTrans[] = { 0x00, 0x40, 0x20, 0x60, 0x70 };
- return spnTrans[ (nFormatIdx / 56) % STATIC_TABLE_SIZE( spnTrans ) ];
+ return spnTrans[ (nFormatIdx / 56) % STATIC_ARRAY_SIZE( spnTrans ) ];
}
sal_uInt16 XclChartHelper::GetAutoMarkerType( sal_uInt16 nFormatIdx )
@@ -453,14 +452,14 @@ sal_uInt16 XclChartHelper::GetAutoMarkerType( sal_uInt16 nFormatIdx )
EXC_CHMARKERFORMAT_DIAMOND, EXC_CHMARKERFORMAT_SQUARE, EXC_CHMARKERFORMAT_TRIANGLE,
EXC_CHMARKERFORMAT_CROSS, EXC_CHMARKERFORMAT_STAR, EXC_CHMARKERFORMAT_CIRCLE,
EXC_CHMARKERFORMAT_PLUS, EXC_CHMARKERFORMAT_DOWJ, EXC_CHMARKERFORMAT_STDDEV };
- return spnSymbols[ nFormatIdx % STATIC_TABLE_SIZE( spnSymbols ) ];
+ return spnSymbols[ nFormatIdx % STATIC_ARRAY_SIZE( spnSymbols ) ];
}
bool XclChartHelper::HasMarkerFillColor( sal_uInt16 nMarkerType )
{
static const bool spbFilled[] = {
false, true, true, true, false, false, false, false, true, false };
- return (nMarkerType < STATIC_TABLE_SIZE( spbFilled )) && spbFilled[ nMarkerType ];
+ return (nMarkerType < STATIC_ARRAY_SIZE( spbFilled )) && spbFilled[ nMarkerType ];
}
OUString XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType )
@@ -507,7 +506,7 @@ static const XclChFormatInfo spFmtInfos[] =
XclChFormatInfoProvider::XclChFormatInfoProvider()
{
- const XclChFormatInfo* pEnd = STATIC_TABLE_END( spFmtInfos );
+ const XclChFormatInfo* pEnd = STATIC_ARRAY_END( spFmtInfos );
for( const XclChFormatInfo* pIt = spFmtInfos; pIt != pEnd; ++pIt )
maInfoMap[ pIt->meObjType ] = pIt;
}
@@ -548,7 +547,7 @@ static const XclChTypeInfo spTypeInfos[] =
{ EXC_CHTYPEID_RADARLINE, EXC_CHTYPECATEG_RADAR, EXC_ID_CHRADARLINE, SERVICE_CHART2_NET, EXC_CHVARPOINT_SINGLE, csscd::TOP, false, false, true, false, true, false, true, false, false, false, false },
{ EXC_CHTYPEID_RADARAREA, EXC_CHTYPECATEG_RADAR, EXC_ID_CHRADARAREA, SERVICE_CHART2_FILLEDNET, EXC_CHVARPOINT_NONE, csscd::TOP, false, false, true, true, true, false, true, false, false, true, false },
{ EXC_CHTYPEID_PIE, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, true, true, false, false, false, false },
- { EXC_CHTYPEID_DONUT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, false, true, false, false, true, false },
+ { EXC_CHTYPEID_DONUT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, false, true, false, false, false, false },
{ EXC_CHTYPEID_PIEEXT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIEEXT, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, false, true, true, true, true, true, false, false, false, false },
{ EXC_CHTYPEID_SCATTER, EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER, SERVICE_CHART2_SCATTER, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, true, false, false, false, true, false, false, false, false, false, false },
{ EXC_CHTYPEID_BUBBLES, EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER, SERVICE_CHART2_BUBBLE, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, false, false, false, true, true, false, false, false, false, false, false },
@@ -576,7 +575,7 @@ void XclChExtTypeInfo::Set( const XclChTypeInfo& rTypeInfo, bool b3dChart, bool
XclChTypeInfoProvider::XclChTypeInfoProvider()
{
- const XclChTypeInfo* pEnd = STATIC_TABLE_END( spTypeInfos );
+ const XclChTypeInfo* pEnd = STATIC_ARRAY_END( spTypeInfos );
for( const XclChTypeInfo* pIt = spTypeInfos; pIt != pEnd; ++pIt )
maInfoMap[ pIt->meTypeId ] = pIt;
}
@@ -590,7 +589,7 @@ const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfo( XclChTypeId eTypeId ) c
const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromRecId( sal_uInt16 nRecId ) const
{
- const XclChTypeInfo* pEnd = STATIC_TABLE_END( spTypeInfos );
+ const XclChTypeInfo* pEnd = STATIC_ARRAY_END( spTypeInfos );
for( const XclChTypeInfo* pIt = spTypeInfos; pIt != pEnd; ++pIt )
if( pIt->mnRecId == nRecId )
return *pIt;
@@ -600,7 +599,7 @@ const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromRecId( sal_uInt16 nRe
const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromService( const OUString& rServiceName ) const
{
- const XclChTypeInfo* pEnd = STATIC_TABLE_END( spTypeInfos );
+ const XclChTypeInfo* pEnd = STATIC_ARRAY_END( spTypeInfos );
for( const XclChTypeInfo* pIt = spTypeInfos; pIt != pEnd; ++pIt )
if( rServiceName.equalsAscii( pIt->mpcServiceName ) )
return *pIt;
@@ -1069,8 +1068,8 @@ void XclChPropSetHelper::WriteAreaProperties( ScfPropertySet& rPropSet,
void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
XclChObjectTable& rGradientTable, XclChObjectTable& /*rHatchTable*/, XclChObjectTable& rBitmapTable,
- const XclChEscherFormat& rEscherFmt, const XclChPicFormat& rPicFmt,
- XclChPropertyMode ePropMode )
+ const XclChEscherFormat& rEscherFmt, const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType, XclChPropertyMode ePropMode )
{
if( rEscherFmt.mxItemSet.is() )
{
@@ -1120,8 +1119,10 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
if( aBmpName.getLength() )
{
namespace cssd = ::com::sun::star::drawing;
- cssd::BitmapMode eApiBmpMode = (rPicFmt.mnBmpMode == EXC_CHPICFORMAT_STRETCH) ?
- cssd::BitmapMode_STRETCH : cssd::BitmapMode_REPEAT;
+ /* #i71810# Caller decides whether to use a CHPICFORMAT record for bitmap mode.
+ If not passed, detect fill mode from the DFF property 'fill-type'. */
+ bool bStretch = pPicFmt ? (pPicFmt->mnBmpMode == EXC_CHPICFORMAT_STRETCH) : (nDffFillType == mso_fillPicture);
+ cssd::BitmapMode eApiBmpMode = bStretch ? cssd::BitmapMode_STRETCH : cssd::BitmapMode_REPEAT;
maBitmapHlp.InitializeWrite();
maBitmapHlp << cssd::FillStyle_BITMAP << aBmpName << eApiBmpMode;
maBitmapHlp.WriteToPropertySet( rPropSet );
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index e6c23bb63689..1f5cc56a0934 100755
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -93,7 +93,9 @@ static const XclFunctionInfo saFuncTable_2[] =
{ ocCurrency, 13, 1, 2, V, { VR }, 0, 0 },
{ ocFixed, 14, 1, 2, V, { VR, VR, C }, 0, 0 },
{ ocSin, 15, 1, 1, V, { VR }, 0, 0 },
+ { ocCosecant, 15, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocCos, 16, 1, 1, V, { VR }, 0, 0 },
+ { ocSecant, 16, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocTan, 17, 1, 1, V, { VR }, 0, 0 },
{ ocCot, 17, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocArcTan, 18, 1, 1, V, { VR }, 0, 0 },
@@ -230,7 +232,9 @@ static const XclFunctionInfo saFuncTable_3[] =
{ ocMedian, 227, 1, MX, V, { RX }, 0, 0 },
{ ocSumProduct, 228, 1, MX, V, { VA }, 0, 0 },
{ ocSinHyp, 229, 1, 1, V, { VR }, 0, 0 },
+ { ocCosecantHyp, 229, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocCosHyp, 230, 1, 1, V, { VR }, 0, 0 },
+ { ocSecantHyp, 230, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocTanHyp, 231, 1, 1, V, { VR }, 0, 0 },
{ ocCotHyp, 231, 1, 1, V, { VR }, EXC_FUNCFLAG_EXPORTONLY, 0 },
{ ocArcSinHyp, 232, 1, 1, V, { VR }, 0, 0 },
@@ -415,16 +419,16 @@ XclFunctionProvider::XclFunctionProvider( const XclRoot& rRoot )
from earlier tables. */
XclBiff eBiff = rRoot.GetBiff();
if( eBiff >= EXC_BIFF2 )
- (this->*pFillFunc)( saFuncTable_2, STATIC_TABLE_END( saFuncTable_2 ) );
+ (this->*pFillFunc)( saFuncTable_2, STATIC_ARRAY_END( saFuncTable_2 ) );
if( eBiff >= EXC_BIFF3 )
- (this->*pFillFunc)( saFuncTable_3, STATIC_TABLE_END( saFuncTable_3 ) );
+ (this->*pFillFunc)( saFuncTable_3, STATIC_ARRAY_END( saFuncTable_3 ) );
if( eBiff >= EXC_BIFF4 )
- (this->*pFillFunc)( saFuncTable_4, STATIC_TABLE_END( saFuncTable_4 ) );
+ (this->*pFillFunc)( saFuncTable_4, STATIC_ARRAY_END( saFuncTable_4 ) );
if( eBiff >= EXC_BIFF5 )
- (this->*pFillFunc)( saFuncTable_5, STATIC_TABLE_END( saFuncTable_5 ) );
+ (this->*pFillFunc)( saFuncTable_5, STATIC_ARRAY_END( saFuncTable_5 ) );
if( eBiff >= EXC_BIFF8 )
- (this->*pFillFunc)( saFuncTable_8, STATIC_TABLE_END( saFuncTable_8 ) );
- (this->*pFillFunc)( saFuncTable_Odf, STATIC_TABLE_END( saFuncTable_Odf ) );
+ (this->*pFillFunc)( saFuncTable_8, STATIC_ARRAY_END( saFuncTable_8 ) );
+ (this->*pFillFunc)( saFuncTable_Odf, STATIC_ARRAY_END( saFuncTable_Odf ) );
}
const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclFunc( sal_uInt16 nXclFunc ) const
diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx
index a59c6f761667..36b451e17f65 100644
--- a/sc/source/filter/excel/xlpage.cxx
+++ b/sc/source/filter/excel/xlpage.cxx
@@ -203,7 +203,7 @@ void XclPageData::SetDefaults()
Size XclPageData::GetScPaperSize() const
{
const XclPaperSize* pEntry = pPaperSizeTable;
- if( mnPaperSize < STATIC_TABLE_SIZE( pPaperSizeTable ) )
+ if( mnPaperSize < STATIC_ARRAY_SIZE( pPaperSizeTable ) )
pEntry += mnPaperSize;
Size aSize;
@@ -230,7 +230,7 @@ void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait )
long nHeight = bPortrait ? rSize.Height() : rSize.Width();
long nMaxWDiff = 80;
long nMaxHDiff = 50;
- for( const XclPaperSize* pEntry = pPaperSizeTable; pEntry != STATIC_TABLE_END( pPaperSizeTable ); ++pEntry )
+ for( const XclPaperSize* pEntry = pPaperSizeTable; pEntry != STATIC_ARRAY_END( pPaperSizeTable ); ++pEntry )
{
long nWDiff = Abs( pEntry->mnWidth - nWidth );
long nHDiff = Abs( pEntry->mnHeight - nHeight );
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index 4a48584da7fa..a6d94e5efc31 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -111,20 +111,20 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot& rRoot ) :
{
case EXC_BIFF2:
mpnColorTable = spnDefColorTable2;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable2 );
+ mnTableSize = STATIC_ARRAY_SIZE( spnDefColorTable2 );
break;
case EXC_BIFF3:
case EXC_BIFF4:
mpnColorTable = spnDefColorTable3;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable3 );
+ mnTableSize = STATIC_ARRAY_SIZE( spnDefColorTable3 );
break;
case EXC_BIFF5:
mpnColorTable = spnDefColorTable5;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable5 );
+ mnTableSize = STATIC_ARRAY_SIZE( spnDefColorTable5 );
break;
case EXC_BIFF8:
mpnColorTable = spnDefColorTable8;
- mnTableSize = STATIC_TABLE_SIZE( spnDefColorTable8 );
+ mnTableSize = STATIC_ARRAY_SIZE( spnDefColorTable8 );
break;
default:
DBG_ERROR_BIFF();
@@ -1513,7 +1513,7 @@ void XclNumFmtBuffer::InsertBuiltinFormats()
typedef ::std::map< LanguageType, const XclBuiltInFormatTable* > XclBuiltInMap;
XclBuiltInMap aBuiltInMap;
for( const XclBuiltInFormatTable* pTable = spBuiltInFormatTables;
- pTable != STATIC_TABLE_END( spBuiltInFormatTables ); ++pTable )
+ pTable != STATIC_ARRAY_END( spBuiltInFormatTables ); ++pTable )
aBuiltInMap[ pTable->meLanguage ] = pTable;
// build a list of table pointers for the current language, with all parent tables
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index d62a51f5388f..70a0fbae7a88 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -53,7 +53,7 @@ using ::rtl::OUString;
XclGuid::XclGuid()
{
- ::std::fill( mpnData, STATIC_TABLE_END( mpnData ), 0 );
+ ::std::fill( mpnData, STATIC_ARRAY_END( mpnData ), 0 );
}
XclGuid::XclGuid(
@@ -77,14 +77,14 @@ XclGuid::XclGuid(
bool operator==( const XclGuid& rCmp1, const XclGuid& rCmp2 )
{
- return ::std::equal( rCmp1.mpnData, STATIC_TABLE_END( rCmp1.mpnData ), rCmp2.mpnData );
+ return ::std::equal( rCmp1.mpnData, STATIC_ARRAY_END( rCmp1.mpnData ), rCmp2.mpnData );
}
bool operator<( const XclGuid& rCmp1, const XclGuid& rCmp2 )
{
return ::std::lexicographical_compare(
- rCmp1.mpnData, STATIC_TABLE_END( rCmp1.mpnData ),
- rCmp2.mpnData, STATIC_TABLE_END( rCmp2.mpnData ) );
+ rCmp1.mpnData, STATIC_ARRAY_END( rCmp1.mpnData ),
+ rCmp2.mpnData, STATIC_ARRAY_END( rCmp2.mpnData ) );
}
XclImpStream& operator>>( XclImpStream& rStrm, XclGuid& rGuid )
@@ -357,7 +357,7 @@ Color XclTools::GetPatternColor( const Color& rPattColor, const Color& rBackColo
0x40, 0x40, 0x20, 0x60, 0x60, 0x60, 0x60, 0x48, // 08 - 15
0x50, 0x70, 0x78 // 16 - 18
};
- return (nXclPattern < STATIC_TABLE_SIZE( pnRatioTable )) ?
+ return (nXclPattern < STATIC_ARRAY_SIZE( pnRatioTable )) ?
ScfTools::GetMixedColor( rPattColor, rBackColor, pnRatioTable[ nXclPattern ] ) : rPattColor;
}
@@ -409,7 +409,7 @@ pCodePageTable[] =
{ 32768, RTL_TEXTENCODING_APPLE_ROMAN }, // Apple Roman
{ 32769, RTL_TEXTENCODING_MS_1252 } // MS Windows Latin I (BIFF2-BIFF3)
};
-const XclCodePageEntry* const pCodePageTableEnd = STATIC_TABLE_END( pCodePageTable );
+const XclCodePageEntry* const pCodePageTableEnd = STATIC_ARRAY_END( pCodePageTable );
struct XclCodePageEntry_CPPred
{
@@ -487,10 +487,10 @@ static const sal_Char* const ppcDefNames[] =
String XclTools::GetXclBuiltInDefName( sal_Unicode cBuiltIn )
{
- DBG_ASSERT( STATIC_TABLE_SIZE( ppcDefNames ) == EXC_BUILTIN_UNKNOWN,
+ DBG_ASSERT( STATIC_ARRAY_SIZE( ppcDefNames ) == EXC_BUILTIN_UNKNOWN,
"XclTools::GetXclBuiltInDefName - built-in defined name list modified" );
String aDefName;
- if( cBuiltIn < STATIC_TABLE_SIZE( ppcDefNames ) )
+ if( cBuiltIn < STATIC_ARRAY_SIZE( ppcDefNames ) )
aDefName.AssignAscii( ppcDefNames[ cBuiltIn ] );
else
aDefName = String::CreateFromInt32( cBuiltIn );
@@ -554,7 +554,7 @@ String XclTools::GetBuiltInStyleName( sal_uInt8 nStyleId, const String& rName, s
else
{
aStyleName = maStyleNamePrefix1;
- if( nStyleId < STATIC_TABLE_SIZE( ppcStyleNames ) )
+ if( nStyleId < STATIC_ARRAY_SIZE( ppcStyleNames ) )
aStyleName.AppendAscii( ppcStyleNames[ nStyleId ] );
else if( rName.Len() > 0 )
aStyleName.Append( rName );
@@ -594,7 +594,7 @@ bool XclTools::IsBuiltInStyleName( const String& rStyleName, sal_uInt8* pnStyleI
if( nPrefixLen > 0 )
{
String aShortName;
- for( sal_uInt8 nId = 0; nId < STATIC_TABLE_SIZE( ppcStyleNames ); ++nId )
+ for( sal_uInt8 nId = 0; nId < STATIC_ARRAY_SIZE( ppcStyleNames ); ++nId )
{
if( nId != EXC_STYLE_NORMAL )
{