summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter')
-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
-rw-r--r--sc/source/filter/inc/ftools.hxx5
-rw-r--r--sc/source/filter/inc/imp_op.hxx8
-rw-r--r--sc/source/filter/inc/xichart.hxx16
-rw-r--r--sc/source/filter/inc/xistream.hxx11
-rw-r--r--sc/source/filter/inc/xistyle.hxx5
-rwxr-xr-xsc/source/filter/inc/xlchart.hxx15
-rw-r--r--sc/source/filter/xml/XMLConverter.cxx2
-rw-r--r--sc/source/filter/xml/XMLExportDataPilot.cxx2
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx7
-rw-r--r--sc/source/filter/xml/xmldpimp.hxx1
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx20
-rw-r--r--sc/source/filter/xml/xmlexprt.hxx4
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx24
-rw-r--r--sc/source/filter/xml/xmlimprt.hxx1
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx36
31 files changed, 339 insertions, 216 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 )
{
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index 2860290cc169..f2e7967a0448 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -41,11 +41,6 @@
// Common macros ==============================================================
-/** Expands to the size of a STATIC data array. */
-#define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
-/** Expands to a pointer behind the last element of a STATIC data array (like STL end()). */
-#define STATIC_TABLE_END( array ) ((array)+STATIC_TABLE_SIZE(array))
-
/** Expands to a temporary String, created from an ASCII character array. */
#define CREATE_STRING( ascii ) String( RTL_CONSTASCII_USTRINGPARAM( ascii ) )
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 046c338c042d..0e1315fdb311 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -110,8 +110,10 @@ protected:
XclImpOutlineListBuffer* pOutlineListBuffer;
sal_Int16 mnLastRefIdx;
- sal_uInt16 nIxfeIndex; // merkt sich Angabe im IXFE-Record
- sal_uInt16 nLastXF; // letzter XF in Formula-Record
+ sal_uInt16 mnIxfeIndex; /// Current XF identifier from IXFE record.
+ bool mbBiff2HasXfs; /// Select XF formatting or direct formatting in BIFF2.
+ bool mbBiff2HasXfsValid; /// False = mbBiff2HasXfs is undetermined yet.
+
SCTAB nBdshtTab; // Counter fuer Boundsheet
ScFormulaCell* pLastFormCell; // fuer String-Records
@@ -121,7 +123,7 @@ protected:
// Record-Funktionen
void ReadFileSharing();
- sal_uInt16 ReadXFIndex( bool bBiff2 );
+ sal_uInt16 ReadXFIndex( const ScAddress& rScPos, bool bBiff2 );
void ReadDimensions();
void ReadBlank();
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 097ce1801896..c986544da0cf 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -158,7 +158,8 @@ public:
void ConvertEscherFormat(
ScfPropertySet& rPropSet,
const XclChEscherFormat& rEscherFmt,
- const XclChPicFormat& rPicFmt,
+ const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType,
XclChPropertyMode ePropMode ) const;
/** Writes font properties to the passed property set. */
void ConvertFont(
@@ -299,12 +300,13 @@ public:
virtual void ReadSubRecord( XclImpStream& rStrm );
/** Converts and writes the contained data to the passed property set. */
- void Convert( const XclImpChRoot& rRoot,
- ScfPropertySet& rPropSet, XclChObjectType eObjType ) const;
+ void Convert( const XclImpChRoot& rRoot, ScfPropertySet& rPropSet,
+ XclChObjectType eObjType, bool bUsePicFmt ) const;
private:
XclChEscherFormat maData; /// Fill properties for complex areas (CHESCHERFORMAT record).
XclChPicFormat maPicFmt; /// Image options, e.g. stretched, stacked (CHPICFORMAT record).
+ sal_uInt32 mnDffFillType; /// Fill type imported from the DFF property set.
};
typedef ScfRef< XclImpChEscherFormat > XclImpChEscherFormatRef;
@@ -348,11 +350,11 @@ protected:
/** Converts and writes the contained area formatting to the passed property set. */
void ConvertAreaBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType,
- sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN ) const;
+ sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN, bool bUsePicFmt = false ) const;
/** Converts and writes the contained data to the passed property set. */
void ConvertFrameBase( const XclImpChRoot& rRoot,
ScfPropertySet& rPropSet, XclChObjectType eObjType,
- sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN ) const;
+ sal_uInt16 nFormatIdx = EXC_CHDATAFORMAT_UNKNOWN, bool bUsePicFmt = false ) const;
protected:
XclImpChLineFormatRef mxLineFmt; /// Line format (CHLINEFORMAT record).
@@ -382,7 +384,7 @@ public:
void UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData );
/** Converts and writes the contained data to the passed property set. */
- void Convert( ScfPropertySet& rPropSet ) const;
+ void Convert( ScfPropertySet& rPropSet, bool bUsePicFmt = false ) const;
private:
XclChFrame maData; /// Contents of the CHFRAME record.
@@ -705,7 +707,7 @@ public:
/** Writes the line format only, e.g. for trend lines or error bars. */
void ConvertLine( ScfPropertySet& rPropSet, XclChObjectType eObjType ) const;
/** Writes the area format only for the series or a data point. */
- void ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx ) const;
+ void ConvertArea( ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx, bool bUsePicFmt ) const;
private:
/** Removes unused formatting (e.g. pie distance in a bar chart). */
diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx
index 4aec7c337a32..28916eba37dc 100644
--- a/sc/source/filter/inc/xistream.hxx
+++ b/sc/source/filter/inc/xistream.hxx
@@ -188,6 +188,9 @@ public:
sal_uInt16& rnRawRecId, sal_uInt16& rnRawRecSize, sal_uInt16& rnRawRecLeft,
bool& rbValid ) const;
+ /** Returns the stored stream position. */
+ inline sal_Size GetPos() const { return mnPos; }
+
private:
sal_Size mnPos; /// Absolute position of the stream.
sal_Size mnNextPos; /// Absolute position of next record.
@@ -286,6 +289,14 @@ public:
started with StartNextRecord(). */
void ResetRecord( bool bContLookup,
sal_uInt16 nAltContId = EXC_ID_UNKNOWN );
+ /** Sets stream pointer before current record and invalidates stream.
+ @descr The next call to StartNextRecord() will start again the current
+ record. This can be used in situations where a loop or a function
+ leaves on a specific record, but the parent context expects to start
+ this record by itself. The stream is invalid as long as the first
+ record has not been started (it is not allowed to call any other stream
+ operation then). */
+ void RewindRecord();
/** Enables decryption of record contents for the rest of the stream. */
void SetDecrypter( XclImpDecrypterRef xDecrypter );
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index abe08c9eb945..2ada794eb216 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -418,6 +418,11 @@ public:
SCTAB nScTab,
sal_uLong nForceScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND );
+ /** Converts formatting information from BIFF2 cell record data directly. */
+ static void ApplyPatternForBiff2CellFormat(
+ const XclImpRoot& rRoot, const ScAddress& rScPos,
+ sal_uInt8 nFlags1, sal_uInt8 nFlags2, sal_uInt8 nFlags3 );
+
private:
void ReadXF2( XclImpStream& rStrm );
void ReadXF3( XclImpStream& rStrm );
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 925b1d14e805..211f375351a5 100755
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -569,14 +569,9 @@ const sal_uInt16 EXC_CHPICFORMAT_STRETCH = 1; /// Bitmap stretched
const sal_uInt16 EXC_CHPICFORMAT_STACK = 2; /// Bitmap stacked.
const sal_uInt16 EXC_CHPICFORMAT_SCALE = 3; /// Bitmap scaled to axis scale.
-const sal_uInt16 EXC_CHPICFORMAT_WMF = 2;
-const sal_uInt16 EXC_CHPICFORMAT_BMP = 9;
-const sal_uInt16 EXC_CHPICFORMAT_DEFAULT = 19;
-
-const sal_uInt16 EXC_CHPICFORMAT_WINDOWS = 0x0001;
-const sal_uInt16 EXC_CHPICFORMAT_MACOS = 0x0002;
-const sal_uInt16 EXC_CHPICFORMAT_FORMATONLY = 0x0100;
-const sal_uInt16 EXC_CHPICFORMAT_DEFAULTFLAGS = 0x0E00; /// Default flags for export.
+const sal_uInt16 EXC_CHPICFORMAT_TOPBOTTOM = 0x0200;
+const sal_uInt16 EXC_CHPICFORMAT_FRONTBACK = 0x0400;
+const sal_uInt16 EXC_CHPICFORMAT_LEFTRIGHT = 0x0800;
// (0x103D) CHDROPBAR ---------------------------------------------------------
@@ -856,7 +851,6 @@ struct XclChEscherFormat
struct XclChPicFormat
{
sal_uInt16 mnBmpMode; /// Bitmap mode, e.g. stretched, stacked.
- sal_uInt16 mnFormat; /// Image data format (WMF, BMP).
sal_uInt16 mnFlags; /// Additional flags.
double mfScale; /// Picture scaling (units).
@@ -1440,7 +1434,8 @@ public:
XclChObjectTable& rHatchTable,
XclChObjectTable& rBitmapTable,
const XclChEscherFormat& rEscherFmt,
- const XclChPicFormat& rPicFmt,
+ const XclChPicFormat* pPicFmt,
+ sal_uInt32 nDffFillType,
XclChPropertyMode ePropMode );
/** Writes all marker properties to the passed property set. */
void WriteMarkerProperties(
diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx
index 4de6246f4f28..a23a80c9d9ac 100644
--- a/sc/source/filter/xml/XMLConverter.cxx
+++ b/sc/source/filter/xml/XMLConverter.cxx
@@ -436,7 +436,7 @@ const ScXMLConditionInfo* lclGetConditionInfo( const sal_Unicode*& rpcString, co
// search the table for an entry
if( nLength > 0 )
- for( const ScXMLConditionInfo* pInfo = spConditionInfos; pInfo < STATIC_TABLE_END( spConditionInfos ); ++pInfo )
+ for( const ScXMLConditionInfo* pInfo = spConditionInfos; pInfo < STATIC_ARRAY_END( spConditionInfos ); ++pInfo )
if( (nLength == pInfo->mnIdentLength) && (::rtl_ustr_ascii_shortenedCompare_WithLength( pcIdStart, nLength, pInfo->mpcIdentifier, nLength ) == 0) )
return pInfo;
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index f8cba5ecf6c3..07d1250a76aa 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -743,7 +743,7 @@ void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient
if (pGrandTotal)
rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal);
- SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True);
+ SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE_EXT, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True);
}
void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreadsheetDocument>& /* xSpreadDoc */)
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 09d8a25fa86d..c9506edbfdf9 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -128,7 +128,6 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
pDPDimSaveData(NULL),
sDataPilotTableName(),
sApplicationData(),
- sGrandTotal(GetXMLToken(XML_BOTH)),
mnRowFieldCount(0),
mnColFieldCount(0),
mnPageFieldCount(0),
@@ -165,7 +164,6 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
break;
case XML_TOK_DATA_PILOT_TABLE_ATTR_GRAND_TOTAL :
{
- sGrandTotal = sValue;
if (IsXMLToken(sValue, XML_BOTH))
{
maRowGrandTotal.mbVisible = true;
@@ -266,6 +264,7 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( sal_uInt16 n
}
break;
case XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL:
+ case XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT:
{
pContext = new ScXMLDataPilotGrandTotalContext(GetScImport(), nPrefix, rLName, xAttrList, this);
}
@@ -794,9 +793,9 @@ ScXMLDataPilotGrandTotalContext::~ScXMLDataPilotGrandTotalContext()
}
SvXMLImportContext* ScXMLDataPilotGrandTotalContext::CreateChildContext(
- sal_uInt16 /*nPrefix*/, const ::rtl::OUString& /*rLocalName*/, const Reference<XAttributeList>& /*xAttrList*/ )
+ sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const Reference<XAttributeList>& /*xAttrList*/ )
{
- return NULL;
+ return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
void ScXMLDataPilotGrandTotalContext::EndElement()
diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx
index 5ff84c587b54..702e42a0916b 100644
--- a/sc/source/filter/xml/xmldpimp.hxx
+++ b/sc/source/filter/xml/xmldpimp.hxx
@@ -96,7 +96,6 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext
GrandTotalItem maColGrandTotal;
rtl::OUString sDataPilotTableName;
rtl::OUString sApplicationData;
- rtl::OUString sGrandTotal;
rtl::OUString sDatabaseName;
rtl::OUString sSourceObject;
rtl::OUString sServiceName;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index f8769cc95ffb..ead8067ee23e 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1814,16 +1814,14 @@ void ScXMLExport::_ExportContent()
++nEqualCells;
else
{
- SetRepeatAttribute(nEqualCells);
- WriteCell(aPrevCell);
+ WriteCell(aPrevCell, nEqualCells);
nEqualCells = 0;
aPrevCell = aCell;
}
}
else
{
- SetRepeatAttribute(nEqualCells);
- WriteCell(aPrevCell);
+ WriteCell(aPrevCell, nEqualCells);
ExportFormatRanges(aPrevCell.aCellAddress.Column + nEqualCells + 1, aPrevCell.aCellAddress.Row,
aCell.aCellAddress.Column - 1, aCell.aCellAddress.Row, nTable);
nEqualCells = 0;
@@ -1833,8 +1831,7 @@ void ScXMLExport::_ExportContent()
}
if (!bIsFirst)
{
- SetRepeatAttribute(nEqualCells);
- WriteCell(aPrevCell);
+ WriteCell(aPrevCell, nEqualCells);
ExportFormatRanges(aPrevCell.aCellAddress.Column + nEqualCells + 1, aPrevCell.aCellAddress.Row,
pSharedData->GetLastColumn(nTable), pSharedData->GetLastRow(nTable), nTable);
}
@@ -2898,8 +2895,11 @@ sal_Bool ScXMLExport::GetCellText (ScMyCell& rMyCell, const ScAddress& aPos) con
}
}
-void ScXMLExport::WriteCell (ScMyCell& aCell)
+void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount)
{
+ // nEqualCellCount is the number of additional cells
+ SetRepeatAttribute(nEqualCellCount, (aCell.nType != table::CellContentType_EMPTY));
+
ScAddress aCellPos;
ScUnoConversion::FillScAddress( aCellPos, aCell.aCellAddress );
if (aCell.nStyleIndex != -1)
@@ -3470,14 +3470,16 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell )
}
}
-void ScXMLExport::SetRepeatAttribute (const sal_Int32 nEqualCellCount)
+void ScXMLExport::SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgress)
{
+ // nEqualCellCount is additional cells, so the attribute value is nEqualCellCount+1
if (nEqualCellCount > 0)
{
sal_Int32 nTemp(nEqualCellCount + 1);
OUString sOUEqualCellCount(OUString::valueOf(nTemp));
AddAttribute(sAttrColumnsRepeated, sOUEqualCellCount);
- IncrementProgressBar(sal_False, nEqualCellCount);
+ if (bIncProgress)
+ IncrementProgressBar(sal_False, nEqualCellCount);
}
}
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index e024fc6a0de0..ec273dea8db1 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -182,14 +182,14 @@ class ScXMLExport : public SvXMLExport
sal_Bool GetCellText (ScMyCell& rMyCell, const ScAddress& aPos) const;
- void WriteCell (ScMyCell& aCell);
+ void WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount);
void WriteAreaLink(const ScMyCell& rMyCell);
void WriteAnnotation(ScMyCell& rMyCell);
void WriteDetective(const ScMyCell& rMyCell);
void ExportShape(const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape, com::sun::star::awt::Point* pPoint);
void WriteShapes(const ScMyCell& rMyCell);
void WriteTableShapes();
- void SetRepeatAttribute (const sal_Int32 nEqualCellCount);
+ void SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgress);
sal_Bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell = NULL) const;
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index d840c39f5939..d4133686d2c8 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1347,6 +1347,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableElemTokenMap()
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL },
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE },
{ XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL },
+ { XML_NAMESPACE_TABLE_EXT, XML_DATA_PILOT_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT },
{ XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY },
{ XML_NAMESPACE_TABLE, XML_SOURCE_SERVICE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE },
{ XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE },
@@ -1911,7 +1912,7 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
{
SvXMLImportContext *pContext(0);
- if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
+ if (getImportFlags() & IMPORT_META)
{
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
@@ -1919,9 +1920,11 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ (IsStylesOnlyMode()) ? 0 : xDPS->getDocumentProperties());
pContext = new SvXMLMetaDocumentContext(*this,
XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
+ xDocProps, xDocBuilder);
}
if( !pContext )
@@ -2635,6 +2638,23 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE
}
}
+ uno::Reference< beans::XPropertySet > const xImportInfo( getImportInfo() );
+ uno::Reference< beans::XPropertySetInfo > const xPropertySetInfo(
+ xImportInfo.is() ? xImportInfo->getPropertySetInfo() : 0);
+ if (xPropertySetInfo.is())
+ {
+ ::rtl::OUString const sOrganizerMode(
+ RTL_CONSTASCII_USTRINGPARAM("OrganizerMode"));
+ if (xPropertySetInfo->hasPropertyByName(sOrganizerMode))
+ {
+ sal_Bool bStyleOnly(sal_False);
+ if (xImportInfo->getPropertyValue(sOrganizerMode) >>= bStyleOnly)
+ {
+ bLoadDoc = !bStyleOnly;
+ }
+ }
+ }
+
UnlockSolarMutex();
}
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index d11a5bc0e76a..c96c614756bd 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -489,6 +489,7 @@ enum ScXMLDataPilotTableElemTokens
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE,
XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL,
+ XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE,
XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE,
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 9e721b7e9b1a..f3270ff12ade 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -429,6 +429,8 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
{ MAP_LEN( "BuildId" ), 0, &::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "VBACompatibilityMode" ), 0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "ScriptConfiguration" ), 0, &::getCppuType((uno::Reference<container::XNameAccess> *)0), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
+ { MAP_LEN( "OrganizerMode" ), 0, &::getBooleanCppuType(),
+ ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ NULL, 0, 0, NULL, 0, 0 }
};
@@ -488,26 +490,32 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
}
}
+ if (bStylesOnly)
+ {
+ ::rtl::OUString const sOrganizerMode(
+ RTL_CONSTASCII_USTRINGPARAM("OrganizerMode"));
+ xInfoSet->setPropertyValue(sOrganizerMode, uno::makeAny(sal_True));
+ }
+
sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
+ // #i103539#: always read meta.xml for generator
sal_uInt32 nMetaRetval(0);
- if(!bStylesOnly)
- {
- uno::Sequence<uno::Any> aMetaArgs(1);
- uno::Any* pMetaArgs = aMetaArgs.getArray();
- pMetaArgs[0] <<= xInfoSet;
+ uno::Sequence<uno::Any> aMetaArgs(1);
+ uno::Any* pMetaArgs = aMetaArgs.getArray();
+ pMetaArgs[0] <<= xInfoSet;
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import start" );
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import start" );
- nMetaRetval = ImportFromComponent(xServiceFactory, xModel, xXMLParser, aParserInput,
- bOasis ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaImporter"))
- : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaImporter")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Meta.xml")), aMetaArgs,
- sal_False);
+ nMetaRetval = ImportFromComponent(
+ xServiceFactory, xModel, xXMLParser, aParserInput,
+ bOasis ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaImporter"))
+ : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaImporter")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Meta.xml")), aMetaArgs,
+ sal_False);
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import end" );
- }
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import end" );
SvXMLGraphicHelper* pGraphicHelper = NULL;
uno::Reference< document::XGraphicObjectResolver > xGrfContainer;