ooo-build r13932 - in trunk: . patches/dev300



Author: kyoshida
Date: Thu Sep 18 05:31:40 2008
New Revision: 13932
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13932&view=rev

Log:
2008-09-18  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/sc-dp-gridlayout.diff: fixed the bug that causes one
	extra row to be inserted into the header space where it shouldn't.  We
	should insert the extra header row only when no column field is 
	present (n#252037).


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/sc-dp-gridlayout.diff

Modified: trunk/patches/dev300/sc-dp-gridlayout.diff
==============================================================================
--- trunk/patches/dev300/sc-dp-gridlayout.diff	(original)
+++ trunk/patches/dev300/sc-dp-gridlayout.diff	Thu Sep 18 05:31:40 2008
@@ -1,197 +1,209 @@
-diff -rup sc/inc/dpobject.hxx sc/inc/dpobject.hxx
---- sc/inc/dpobject.hxx	2006-10-30 10:45:07.000000000 -0500
-+++ sc/inc/dpobject.hxx	2006-11-01 12:09:52.000000000 -0500
-@@ -119,7 +119,8 @@ private:
- 	ScDPOutput*				pOutput;
- 	BOOL					bSettingsChanged;
- 	BOOL					bAlive;			// FALSE if only used to hold settings
--	USHORT                                  nAutoFormatIndex;
-+	USHORT                  nAutoFormatIndex;
-+	BOOL 			        bHeaderLayout;	// TRUE : grid, FALSE : standard
+diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx
+index b377927..cef08cb 100644
+--- sc/inc/dpobject.hxx
++++ sc/inc/dpobject.hxx
+@@ -112,6 +112,7 @@ private:
  	BOOL					bAllowMove;
  	BOOL					bInfoValid;		// affects: nHeaderRows
  	long					nHeaderRows;	// page fields plus filter button
-@@ -153,6 +154,9 @@ public:
++    bool                    bHeaderLayout;  // TRUE : grid, FALSE : standard
+ 
+ 
+ 	SC_DLLPRIVATE void				CreateObjects();
+@@ -143,6 +144,9 @@ public:
  	void 			SetAutoFormatIndex (const USHORT nIndex);
  	const USHORT		GetAutoFormatIndex ()	{ if (this == NULL) return 65535; else return nAutoFormatIndex; }
  
-+	void 			    SetHeaderLayout (BOOL bUseGrid);
-+	BOOL			    GetHeaderLayout ()	const { return bHeaderLayout; }
++    void                SetHeaderLayout (bool bUseGrid);
++    bool                GetHeaderLayout ()  const { return bHeaderLayout; }
 +
  	void				SetSheetDesc(const ScSheetSourceDesc& rDesc);
  	void				SetImportDesc(const ScImportSourceDesc& rDesc);
  	void				SetServiceData(const ScDPServiceDesc& rDesc);
-diff -rup sc/inc/dpoutput.hxx sc/inc/dpoutput.hxx
---- sc/inc/dpoutput.hxx	2006-10-30 10:45:07.000000000 -0500
-+++ sc/inc/dpoutput.hxx	2006-11-01 12:10:01.000000000 -0500
-@@ -123,6 +123,7 @@ private:
+diff --git sc/inc/dpoutput.hxx sc/inc/dpoutput.hxx
+index 0520a2a..e13debd 100644
+--- sc/inc/dpoutput.hxx
++++ sc/inc/dpoutput.hxx
+@@ -109,6 +109,7 @@ private:
  	long					nColCount;
  	long					nRowCount;
  	long					nHeaderSize;
-+	BOOL 			        bHeaderLayout;	// TRUE : grid, FALSE : standard
++    bool                    bHeaderLayout;  // TRUE : grid, FALSE : standard
  	SCCOL					nTabStartCol;
  	SCROW					nTabStartRow;
  	SCCOL					nMemberStartCol;
-@@ -165,6 +166,9 @@ public:
- 	BOOL			IsFilterButton( const ScAddress& rPos );
+@@ -162,6 +163,9 @@ public:
  
      void            GetMemberResultNames( StrCollection& rNames, long nDimension );
-+
-+	void 			SetHeaderLayout (BOOL bUseGrid);
-+	BOOL			GetHeaderLayout () const 	{ return bHeaderLayout; }
  
++    void            SetHeaderLayout (bool bUseGrid);
++    bool            GetHeaderLayout () const    { return bHeaderLayout; }
++
      static void     GetDataDimensionNames( String& rSourceName, String& rGivenName,
                                             const com::sun::star::uno::Reference<
-diff -rup sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx
---- sc/source/core/data/dpobject.cxx	2006-10-30 10:45:07.000000000 -0500
-+++ sc/source/core/data/dpobject.cxx	2006-11-01 11:02:16.000000000 -0500
-@@ -156,6 +156,7 @@ ScDPObject::ScDPObject( ScDocument* pD )
- 	pServDesc( NULL ),
- 	pOutput( NULL ),
- 	nAutoFormatIndex( 65535 ),
-+	bHeaderLayout( FALSE ),
- 	bSettingsChanged( FALSE ),
+                                                com::sun::star::uno::XInterface>& xDim );
+diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx
+index abf2374..4f49665 100644
+--- sc/source/core/data/dpobject.cxx
++++ sc/source/core/data/dpobject.cxx
+@@ -165,7 +165,8 @@ ScDPObject::ScDPObject( ScDocument* pD ) :
  	bAlive( FALSE ),
  	bAllowMove( FALSE ),
-@@ -171,6 +172,7 @@ ScDPObject::ScDPObject(const ScDPObject&
- 	aTableTag( r.aTableTag ),
- 	aOutRange( r.aOutRange ),
- 	nAutoFormatIndex( r.nAutoFormatIndex ),
-+	bHeaderLayout( r.bHeaderLayout ),
- 	pSheetDesc( NULL ),
- 	pImpDesc( NULL ),
- 	pServDesc( NULL ),
-@@ -228,6 +230,11 @@ void ScDPObject::SetAutoFormatIndex(cons
+ 	bInfoValid( FALSE ),
+-	nHeaderRows( 0 )
++	nHeaderRows( 0 ),
++    bHeaderLayout( false )
+ {
+ }
+ 
+@@ -185,7 +186,8 @@ ScDPObject::ScDPObject(const ScDPObject& r) :
+ 	bAlive( FALSE ),
+ 	bAllowMove( FALSE ),
+ 	bInfoValid( r.bInfoValid ),
+-	nHeaderRows( r.nHeaderRows )
++	nHeaderRows( r.nHeaderRows ),
++    bHeaderLayout( r.bHeaderLayout )
+ {
+ 	if (r.pSaveData)
+ 		pSaveData = new ScDPSaveData(*r.pSaveData);
+@@ -238,6 +240,11 @@ void ScDPObject::SetAutoFormatIndex(const USHORT nIndex)
  	nAutoFormatIndex	= nIndex;
  }
  
-+void ScDPObject::SetHeaderLayout (BOOL bUseGrid)
++void ScDPObject::SetHeaderLayout (bool bUseGrid)
 +{
-+	bHeaderLayout = bUseGrid;
++    bHeaderLayout = bUseGrid;
 +}
 +
  void ScDPObject::SetOutRange(const ScRange& rRange)
  {
  	aOutRange = rRange;
-@@ -335,6 +342,7 @@ void ScDPObject::CreateOutput()
+@@ -345,6 +352,7 @@ void ScDPObject::CreateOutput()
  	{
          BOOL bFilterButton = IsSheetData() && pSaveData && pSaveData->GetFilterButton();
          pOutput = new ScDPOutput( pDoc, xSource, aOutRange.aStart, bFilterButton );
-+		pOutput->SetHeaderLayout ( bHeaderLayout );
++        pOutput->SetHeaderLayout ( bHeaderLayout );
  
  		long nOldRows = nHeaderRows;
  		nHeaderRows = pOutput->GetHeaderRows();
-diff -rup sc/source/core/data/dpoutput.cxx sc/source/core/data/dpoutput.cxx
---- sc/source/core/data/dpoutput.cxx	2006-10-30 10:45:07.000000000 -0500
-+++ sc/source/core/data/dpoutput.cxx	2006-11-01 10:11:45.000000000 -0500
-@@ -362,6 +362,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, 
+diff --git sc/source/core/data/dpoutput.cxx sc/source/core/data/dpoutput.cxx
+index 83f7ce9..6683028 100644
+--- sc/source/core/data/dpoutput.cxx
++++ sc/source/core/data/dpoutput.cxx
+@@ -375,6 +375,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
  	nColFmtCount( 0 ),
  	nRowFmtCount( 0 ),
      nSingleNumFmt( 0 ),
-+	bHeaderLayout( FALSE ),
++    bHeaderLayout( false ),
  	bSizesValid( FALSE ),
  	bSizeOverflow( FALSE )
  {
-@@ -652,7 +653,8 @@ void ScDPOutput::CalcSizes()
+@@ -666,7 +667,11 @@ void ScDPOutput::CalcSizes()
  		nRowCount = aData.getLength();
  		const uno::Sequence<sheet::DataResult>* pRowAry = aData.getConstArray();
  		nColCount = nRowCount ? ( pRowAry[0].getLength() ) : 0;
 -		nHeaderSize = 1;			// one row for field names
 +
-+		nHeaderSize = GetHeaderLayout () ? 2 : 1;
++        nHeaderSize = 1;
++        if (GetHeaderLayout() && nColFieldCount == 0)
++            // Insert an extra header row only when there is no column field.
++            nHeaderSize = 2;
  
  		//	calculate output positions and sizes
  
-@@ -918,6 +920,12 @@ void ScDPOutput::GetMemberResultNames( S
-     }
+@@ -1185,6 +1190,12 @@ bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>&
+     return true;
  }
  
-+void ScDPOutput::SetHeaderLayout (BOOL bLayout)
++void ScDPOutput::SetHeaderLayout (bool bLayout)
 +{
-+	bHeaderLayout = bLayout;
-+	bSizesValid = FALSE;
++    bHeaderLayout = bLayout;
++    bSizesValid = FALSE;
 +}
 +
  //
- //		Methods to find specific parts of the table
+ //  helper functions for ScDPOutput::GetPivotData
  //
-diff -rup sc/source/filter/excel/read.cxx sc/source/filter/excel/read.cxx
---- sc/source/filter/excel/read.cxx	2006-10-30 15:28:16.000000000 -0500
-+++ sc/source/filter/excel/read.cxx	2006-10-30 17:32:24.000000000 -0500
-@@ -1200,6 +1200,7 @@ FltError ImportExcel8::Read( void )
+diff --git sc/source/filter/excel/read.cxx sc/source/filter/excel/read.cxx
+index fb4f22f..a868e17 100644
+--- sc/source/filter/excel/read.cxx
++++ sc/source/filter/excel/read.cxx
+@@ -1152,6 +1152,7 @@ FltError ImportExcel8::Read( void )
                      case EXC_ID_SXDI:           rPTableMgr.ReadSxdi( maStrm );      break;
                      case EXC_ID_SXVDEX:         rPTableMgr.ReadSxvdex( maStrm );    break;
                      case EXC_ID_SXEX:           rPTableMgr.ReadSxex( maStrm );      break;
-+                    case EXC_ID_SX_AUTOFORMAT:  rPTableMgr.ReadSxAutoformat( maStrm ); break;
++                    case EXC_ID_SXVIEWEX9:      rPTableMgr.ReadSxViewEx9( maStrm ); break;
                  }
  			}
              break;
-diff -rup sc/source/filter/excel/xepivot.cxx sc/source/filter/excel/xepivot.cxx
---- sc/source/filter/excel/xepivot.cxx	2006-10-30 10:45:07.000000000 -0500
-+++ sc/source/filter/excel/xepivot.cxx	2006-11-02 09:47:08.000000000 -0500
-@@ -1260,6 +1260,8 @@ XclExpPivotTable::XclExpPivotTable( cons
+diff --git sc/source/filter/excel/xepivot.cxx sc/source/filter/excel/xepivot.cxx
+index 8316f26..2a4994a 100644
+--- sc/source/filter/excel/xepivot.cxx
++++ sc/source/filter/excel/xepivot.cxx
+@@ -1190,6 +1190,8 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r
          maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA );
          maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex();
  
-+		maPTAutoFormat.Init( rDPObj );
++        maPTAutoFormat.Init( rDPObj );
 +
          if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() )
          {
              // additional properties from ScDPSaveData
-@@ -1339,6 +1341,8 @@ void XclExpPivotTable::Save( XclExpStrea
+@@ -1269,6 +1271,8 @@ void XclExpPivotTable::Save( XclExpStream& rStrm )
          WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields );
          // SXEX
          WriteSxex( rStrm );
-+		// SX_AUTOFORMAT
-+		WriteSxAutoformat( rStrm );
++        // SX_AUTOFORMAT
++        WriteSxAutoformat( rStrm );
      }
  }
  
-@@ -1478,6 +1482,8 @@ void XclExpPivotTable::Finalize()
+@@ -1409,6 +1413,8 @@ void XclExpPivotTable::Finalize()
      rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1;
      if( maDataFields.empty() )
          ++rnDataXclRow;
-+    if( 0 == maPTAutoFormat.mbGridLayout )
++    if( 0 == maPTAutoFormat.mnGridLayout )
 +        ++rnDataXclRow;
      rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol );
      rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow );
      maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1;
-@@ -1485,6 +1491,8 @@ void XclExpPivotTable::Finalize()
+@@ -1416,6 +1422,8 @@ void XclExpPivotTable::Finalize()
  
      // first heading
      maPTInfo.mnFirstHeadRow = rnXclRow1 + 1;
-+    if( 0 == maPTAutoFormat.mbGridLayout )
-+		maPTInfo.mnFirstHeadRow++;
++    if( 0 == maPTAutoFormat.mnGridLayout )
++        maPTInfo.mnFirstHeadRow++;
  }
  
  // records ----------------------------------------------------------------
-@@ -1560,6 +1568,18 @@ void XclExpPivotTable::WriteSxex( XclExp
+@@ -1491,6 +1499,18 @@ void XclExpPivotTable::WriteSxex( XclExpStream& rStrm ) const
      rStrm.EndRecord();
  }
  
 +void XclExpPivotTable::WriteSxAutoformat( XclExpStream& rStrm ) const
 +{
-+	// Until we sync the autoformat ids only export if using grid header layout
-+	// That could only have been set via xls import so far.
-+	if( 0 == maPTAutoFormat.mbGridLayout )
-+	{
-+		rStrm.StartRecord( EXC_ID_SX_AUTOFORMAT, 17 );
-+		rStrm << maPTAutoFormat;
-+		rStrm.EndRecord();
-+	}
++    // Until we sync the autoformat ids only export if using grid header layout
++    // That could only have been set via xls import so far.
++    if ( 0 == maPTAutoFormat.mnGridLayout )
++    {
++        rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 );
++        rStrm << maPTAutoFormat;
++        rStrm.EndRecord();
++    }
 +}
 +
  // ============================================================================
  
  namespace {
-diff -rup sc/source/filter/excel/xipivot.cxx sc/source/filter/excel/xipivot.cxx
---- sc/source/filter/excel/xipivot.cxx	2007-02-27 13:27:43.000000000 +0100
-+++ sc/source/filter/excel/xipivot.cxx	2007-11-14 17:15:40.000000000 +0100
-@@ -1340,6 +1340,11 @@ void XclImpPivotTable::ReadSxex( XclImpS
+diff --git sc/source/filter/excel/xipivot.cxx sc/source/filter/excel/xipivot.cxx
+index 9f2f174..6c7c378 100644
+--- sc/source/filter/excel/xipivot.cxx
++++ sc/source/filter/excel/xipivot.cxx
+@@ -1297,6 +1297,11 @@ void XclImpPivotTable::ReadSxex( XclImpStream& rStrm )
      rStrm >> maPTExtInfo;
  }
  
-+void XclImpPivotTable::ReadSxAutoformat( XclImpStream& rStrm )
++void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm )
 +{
 +    rStrm >> maPTAutoFormat;
 +}
@@ -199,92 +211,94 @@
  // ----------------------------------------------------------------------------
  
  void XclImpPivotTable::Convert()
-@@ -1407,6 +1412,7 @@ void XclImpPivotTable::Convert()
+@@ -1364,6 +1369,7 @@ void XclImpPivotTable::Convert()
      pDPObj->SetSheetDesc( aDesc );
      pDPObj->SetOutRange( aOutRange );
      pDPObj->SetAlive( TRUE );
-+	pDPObj->SetHeaderLayout( maPTAutoFormat.mbGridLayout == 0 );
++    pDPObj->SetHeaderLayout( maPTAutoFormat.mnGridLayout == 0 );
      GetDoc().GetDPCollection()->Insert( pDPObj );
  }
  
-@@ -1502,6 +1508,12 @@ void XclImpPivotTableManager::ReadSxex( 
+@@ -1459,6 +1465,12 @@ void XclImpPivotTableManager::ReadSxex( XclImpStream& rStrm )
          maPTables.back()->ReadSxex( rStrm );
  }
  
-+void XclImpPivotTableManager::ReadSxAutoformat( XclImpStream& rStrm )
++void XclImpPivotTableManager::ReadSxViewEx9( XclImpStream& rStrm )
 +{
 +    if( !maPTables.empty() )
-+        maPTables.back()->ReadSxAutoformat( rStrm );
++        maPTables.back()->ReadSxViewEx9( rStrm );
 +}
 +
  // ----------------------------------------------------------------------------
  
  void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm )
-@@ -1518,3 +1530,79 @@ void XclImpPivotTableManager::ConvertPiv
+@@ -1475,3 +1487,84 @@ void XclImpPivotTableManager::ConvertPivotTables()
  
  // ============================================================================
  
 +// Pivot table autoformat settings ============================================
 +
 +/**
-+classic		: 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00
-+default		: 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00
-+report01	: 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00
-+report02	: 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00
-+report03	: 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00
-+report04	: 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00
-+report05	: 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00
-+report06	: 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00
-+report07	: 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00
-+report08	: 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00
-+report09	: 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00
-+report10	: 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00
-+table01		: 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00
-+table02		: 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00
-+table03		: 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00
-+table04		: 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00
-+table05		: 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00
-+table06		: 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00
-+table07		: 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00
-+table08		: 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00
-+table09		: 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00
-+table10		: 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00
-+none		: 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00
++classic     : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00
++default     : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00
++report01    : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00
++report02    : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00
++report03    : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00
++report04    : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00
++report05    : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00
++report06    : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00
++report07    : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00
++report08    : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00
++report09    : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00
++report10    : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00
++table01     : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00
++table02     : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00
++table03     : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00
++table04     : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00
++table05     : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00
++table06     : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00
++table07     : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00
++table08     : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00
++table09     : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00
++table10     : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00
++none        : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00
 +**/
 +
 +XclPTAutoFormat::XclPTAutoFormat() :
 +    mbReport( 0 ),
 +    mnAutoFormat( 0 ),
-+    mbGridLayout( 0x10 )
++    mnGridLayout( 0x10 )
 +{
 +}
 +
 +void XclPTAutoFormat::Init( const ScDPObject& rDPObj )
 +{
-+	if( rDPObj.GetHeaderLayout() )
-+	{
-+		mbReport 	 = 0;
-+		mnAutoFormat = 1;
-+		mbGridLayout = 0;
-+	}
-+	else
-+	{
-+		// Report1 for now
-+		// TODO : sync with autoformat indicies
-+		mbReport 	 = 2;
-+		mnAutoFormat = 1;
-+		mbGridLayout = 0x10;
-+	}
++    if( rDPObj.GetHeaderLayout() )
++    {
++        mbReport     = 0;
++        mnAutoFormat = 1;
++        mnGridLayout = 0;
++    }
++    else
++    {
++        // Report1 for now
++        // TODO : sync with autoformat indicies
++        mbReport     = 2;
++        mnAutoFormat = 1;
++        mnGridLayout = 0x10;
++    }
 +}
 +
 +XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo )
 +{
 +    rStrm.Ignore( 2 );
-+    rStrm >> rInfo.mbReport;     		/// 2 for report* fmts ?
++    rStrm >> rInfo.mbReport;            /// 2 for report* fmts ?
 +    rStrm.Ignore( 6 );
++    sal_uInt8 nDummy;
 +    return rStrm
 +        >> rInfo.mnAutoFormat
-+        >> rInfo.mbGridLayout;
++        >> rInfo.mnGridLayout 
++        >> nDummy >> nDummy >> nDummy;
 +}
 +
 +XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo )
@@ -292,18 +306,22 @@
 +    return rStrm
 +        << EXC_PT_AUTOFMT_HEADER
 +        << rInfo.mbReport
-+		<< EXC_PT_AUTOFMT_ZERO
++        << EXC_PT_AUTOFMT_ZERO
 +        << EXC_PT_AUTOFMT_FLAGS
 +        << rInfo.mnAutoFormat
-+        << rInfo.mbGridLayout;
++        << rInfo.mnGridLayout
++        << static_cast<sal_uInt8>(0x00)
++        << static_cast<sal_uInt8>(0x00)
++        << static_cast<sal_uInt8>(0x00);
 +}
 +
 +// ============================================================================
 +
-diff -rup sc/source/filter/inc/xepivot.hxx sc/source/filter/inc/xepivot.hxx
---- sc/source/filter/inc/xepivot.hxx	2006-07-10 09:55:31.000000000 -0400
-+++ sc/source/filter/inc/xepivot.hxx	2006-11-01 11:26:54.000000000 -0500
-@@ -421,6 +421,8 @@ private:
+diff --git sc/source/filter/inc/xepivot.hxx sc/source/filter/inc/xepivot.hxx
+index 489493d..62a19b5 100644
+--- sc/source/filter/inc/xepivot.hxx
++++ sc/source/filter/inc/xepivot.hxx
+@@ -411,6 +411,8 @@ private:
      void                WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount ) const;
      /** Writes the SXEX records containing additional pivot table info. */
      void                WriteSxex( XclExpStream& rStrm ) const;
@@ -312,27 +330,29 @@
  
      // ------------------------------------------------------------------------
  private:
-@@ -431,6 +433,7 @@ private:
+@@ -421,6 +423,7 @@ private:
      const XclExpPivotCache& mrPCache;       /// The pivot cache this pivot table bases on.
      XclPTInfo           maPTInfo;           /// Info about the pivot table (SXVIEW record).
      XclPTExtInfo        maPTExtInfo;        /// Extended info about the pivot table (SXEX record).
-+	XclPTAutoFormat		maPTAutoFormat;		/// The selected autoformat (SX_AUTOFORMAT)
++    XclPTAutoFormat     maPTAutoFormat;     /// The selected autoformat (SXVIEWEX9)
      XclExpPTFieldList   maFieldList;        /// All fields in pivot cache order.
      ScfUInt16Vec        maRowFields;        /// Row field indexes.
      ScfUInt16Vec        maColFields;        /// Column field indexes.
-diff -rup sc/source/filter/inc/xipivot.hxx sc/source/filter/inc/xipivot.hxx
---- sc/source/filter/inc/xipivot.hxx	2006-07-10 09:59:59.000000000 -0400
-+++ sc/source/filter/inc/xipivot.hxx	2006-10-31 06:50:03.000000000 -0500
-@@ -343,6 +343,8 @@ public:
+diff --git sc/source/filter/inc/xipivot.hxx sc/source/filter/inc/xipivot.hxx
+index fffd4f0..365ea53 100644
+--- sc/source/filter/inc/xipivot.hxx
++++ sc/source/filter/inc/xipivot.hxx
+@@ -350,6 +350,9 @@ public:
      void                ReadSxdi( XclImpStream& rStrm );
      /** Reads an SXEX record containing additional settings for the pivot table. */
      void                ReadSxex( XclImpStream& rStrm );
-+    /** Reads an SX_AUTOFORMAT record that specifies the pivot tables autoformat. */
-+    void                ReadSxAutoformat( XclImpStream& rStrm );
++    /** Reads an SXVIEWEX9 record that specifies the pivot tables
++     *  autoformat. */
++    void                ReadSxViewEx9( XclImpStream& rStrm );
  
      // ------------------------------------------------------------------------
  
-@@ -357,6 +359,7 @@ private:
+@@ -364,6 +367,7 @@ private:
  
      XclPTInfo           maPTInfo;           /// General info about the pivot table (SXVIEW record).
      XclPTExtInfo        maPTExtInfo;        /// Extended info about the pivot table (SXEX record).
@@ -340,19 +360,21 @@
      XclImpPTFieldVec    maFields;           /// Vector containing all fields.
      XclImpPTFieldRef    mxCurrField;        /// Current field for importing additional info.
      ScfStringVec        maVisFieldNames;    /// Vector containing all visible field names.
-@@ -417,6 +420,8 @@ public:
+@@ -422,6 +426,9 @@ public:
      void                ReadSxvi( XclImpStream& rStrm );
      /** Reads an SXEX record containing additional settings for a pivot table. */
      void                ReadSxex( XclImpStream& rStrm );
-+    /** Reads an SX_AUTOFORMAT record that specifies the pivot tables autoformat. */
-+    void                ReadSxAutoformat( XclImpStream& rStrm );
++    /** Reads an SXVIEWEX9 record that specifies the pivot tables
++     *  autoformat. */
++    void                ReadSxViewEx9( XclImpStream& rStrm );
  
      // ------------------------------------------------------------------------
  
-diff -rup sc/source/filter/inc/xlpivot.hxx sc/source/filter/inc/xlpivot.hxx
---- sc/source/filter/inc/xlpivot.hxx	2006-10-18 07:46:00.000000000 -0400
-+++ sc/source/filter/inc/xlpivot.hxx	2006-11-01 12:06:03.000000000 -0500
-@@ -63,6 +63,7 @@
+diff --git sc/source/filter/inc/xlpivot.hxx sc/source/filter/inc/xlpivot.hxx
+index dc59a26..be40dc9 100644
+--- sc/source/filter/inc/xlpivot.hxx
++++ sc/source/filter/inc/xlpivot.hxx
+@@ -41,6 +41,7 @@
  #include <tools/datetime.hxx>
  #include "ftools.hxx"
  #include "xladdress.hxx"
@@ -360,7 +382,7 @@
  
  class XclImpStream;
  class XclExpStream;
-@@ -94,6 +97,10 @@ const sal_uInt16 EXC_PT_MAXDATACOUNT    
+@@ -73,6 +74,10 @@ const sal_uInt16 EXC_PT_MAXDATACOUNT        = 256;
  // pivot table items
  const sal_uInt16 EXC_PT_MAXITEMCOUNT        = 32500;
  
@@ -371,17 +393,17 @@
  /** Data type of a pivot cache item. */
  enum XclPCItemType
  {
-@@ -412,6 +419,9 @@ const double EXC_SXDBEX_CREATION_DATE   
+@@ -396,6 +401,9 @@ const double EXC_SXDBEX_CREATION_DATE       = 51901.029652778;
  const sal_uInt16 EXC_ID_SXFDBTYPE           = 0x01BB;
  const sal_uInt16 EXC_SXFDBTYPE_DEFAULT      = 0x0000;
  
-+// (0x0810) PIVOT_AUTOFORMAT	// 2006/10/17 JEG no docs, but seems to contain the autoformat
-+const sal_uInt16 EXC_ID_SX_AUTOFORMAT       = 0x0810;
++// (0x0810) SXVIEWEX9 ---------------------------------------------------------
++const sal_uInt16 EXC_ID_SXVIEWEX9       = 0x0810;
 +
  // ============================================================================
  // Pivot cache
  // ============================================================================
-@@ -798,5 +808,22 @@ XclExpStream& operator<<( XclExpStream& 
+@@ -784,5 +792,22 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo );
  
  // ============================================================================
  
@@ -390,12 +412,12 @@
 +/** Pivot table autoformat settings (SX_AUTOFORMAT record). */
 +struct XclPTAutoFormat
 +{
-+    sal_uInt32          mbReport;     		/// 2 for report* fmts ?
++    sal_uInt32          mbReport;           /// 2 for report* fmts ?
 +    sal_uInt8           mnAutoFormat;       /// AutoFormat ID
-+    sal_uInt32          mbGridLayout;       /// 0 == gridlayout, 0x10 == modern
++    sal_uInt8           mnGridLayout;       /// 0 == gridlayout, 0x10 == modern
 +
 +    explicit            XclPTAutoFormat();
-+	void				Init( const ScDPObject& rDPObj );
++    void                Init( const ScDPObject& rDPObj );
 +};
 +
 +XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo );
@@ -404,77 +426,82 @@
 +// ============================================================================
  #endif
  
-diff -rup sc/source/filter/xml/XMLExportDataPilot.cxx sc/source/filter/xml/XMLExportDataPilot.cxx
---- sc/source/filter/xml/XMLExportDataPilot.cxx	2006-10-30 10:45:07.000000000 -0500
-+++ sc/source/filter/xml/XMLExportDataPilot.cxx	2006-11-01 16:30:11.000000000 -0500
-@@ -851,6 +851,8 @@ void ScXMLExportDataPilot::WriteDataPilo
+diff --git sc/source/filter/xml/XMLExportDataPilot.cxx sc/source/filter/xml/XMLExportDataPilot.cxx
+index 9723ce9..79c505e 100644
+--- sc/source/filter/xml/XMLExportDataPilot.cxx
++++ sc/source/filter/xml/XMLExportDataPilot.cxx
+@@ -781,6 +781,8 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads
                              rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_FALSE);
                          if (!pDPSave->GetDrillDown())
                              rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE);
-+						if ((*pDPs)[i]->GetHeaderLayout ())
++                        if ((*pDPs)[i]->GetHeaderLayout ())
 +                            rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TRUE);
  						SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True);
  						rExport.CheckAttrList();
  						if ((*pDPs)[i]->IsSheetData())
-diff -rup sc/source/filter/xml/xmldpimp.cxx sc/source/filter/xml/xmldpimp.cxx
---- sc/source/filter/xml/xmldpimp.cxx	2006-07-21 08:52:13.000000000 -0400
-+++ sc/source/filter/xml/xmldpimp.cxx	2006-11-01 16:15:47.000000000 -0500
-@@ -158,7 +158,8 @@ ScXMLDataPilotTableContext::ScXMLDataPil
+diff --git sc/source/filter/xml/xmldpimp.cxx sc/source/filter/xml/xmldpimp.cxx
+index 3747f7a..38bd639 100644
+--- sc/source/filter/xml/xmldpimp.cxx
++++ sc/source/filter/xml/xmldpimp.cxx
+@@ -132,7 +132,8 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
  	bTargetRangeAddress(sal_False),
  	bSourceCellRange(sal_False),
      bShowFilter(sal_True),
 -    bDrillDown(sal_True)
 +    bDrillDown(sal_True),
-+	bHeaderGridLayout(sal_False)
++    bHeaderGridLayout(sal_False)
  {
  	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
  	const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotTableAttrTokenMap();
-@@ -221,6 +222,11 @@ ScXMLDataPilotTableContext::ScXMLDataPil
+@@ -192,6 +193,11 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
                  bDrillDown = IsXMLToken(sValue, XML_TRUE);
              }
              break;
-+			case XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT :
-+			{
-+				bHeaderGridLayout = IsXMLToken(sValue, XML_TRUE);
-+			}
++            case XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT :
++            {
++                bHeaderGridLayout = IsXMLToken(sValue, XML_TRUE);
++            }
 +            break;
  		}
  	}
  
-@@ -342,6 +348,7 @@ void ScXMLDataPilotTableContext::EndElem
+@@ -313,6 +319,7 @@ void ScXMLDataPilotTableContext::EndElement()
  		pDPObject->SetName(sDataPilotTableName);
  		pDPObject->SetTag(sApplicationData);
  		pDPObject->SetOutRange(aTargetRangeAddress);
-+		pDPObject->SetHeaderLayout(bHeaderGridLayout);
++        pDPObject->SetHeaderLayout(bHeaderGridLayout);
  		switch (nSourceType)
  		{
  			case SQL :
-diff -rup sc/source/filter/xml/xmldpimp.hxx sc/source/filter/xml/xmldpimp.hxx
---- sc/source/filter/xml/xmldpimp.hxx	2005-10-25 07:00:50.000000000 -0400
-+++ sc/source/filter/xml/xmldpimp.hxx	2006-11-01 15:37:02.000000000 -0500
-@@ -129,6 +129,7 @@ class ScXMLDataPilotTableContext : publi
+diff --git sc/source/filter/xml/xmldpimp.hxx sc/source/filter/xml/xmldpimp.hxx
+index 64f5d2e..25450c3 100644
+--- sc/source/filter/xml/xmldpimp.hxx
++++ sc/source/filter/xml/xmldpimp.hxx
+@@ -111,6 +111,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext
  	sal_Bool		bSourceCellRange;
      sal_Bool        bShowFilter;
      sal_Bool        bDrillDown;
-+	sal_Bool		bHeaderGridLayout;
++    sal_Bool        bHeaderGridLayout;
  
  	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
  	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
-diff -rup sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
---- sc/source/filter/xml/xmlimprt.cxx	2006-07-21 08:53:26.000000000 -0400
-+++ sc/source/filter/xml/xmlimprt.cxx	2006-11-01 16:17:43.000000000 -0500
-@@ -745,6 +745,7 @@ static __FAR_DATA SvXMLTokenMapEntry aDa
+diff --git sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
+index 6871435..6d4bc86 100644
+--- sc/source/filter/xml/xmlimprt.cxx
++++ sc/source/filter/xml/xmlimprt.cxx
+@@ -678,6 +678,7 @@ static __FAR_DATA SvXMLTokenMapEntry aDataPilotTableAttrTokenMap[] =
  	{ XML_NAMESPACE_TABLE, XML_BUTTONS,				    XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS				},
  	{ XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON,	    XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON	},
  	{ XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN			},
-+	{ XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT,		XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT	},
++    { XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT,      XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT    },
  	XML_TOKEN_MAP_END
  };
  
-diff -rup sc/source/filter/xml/xmlimprt.hxx sc/source/filter/xml/xmlimprt.hxx
---- sc/source/filter/xml/xmlimprt.hxx	2006-04-20 09:26:00.000000000 -0400
-+++ sc/source/filter/xml/xmlimprt.hxx	2006-11-01 15:35:08.000000000 -0500
-@@ -515,7 +515,8 @@ enum ScXMLDataPilotTableAttrTokens
+diff --git sc/source/filter/xml/xmlimprt.hxx sc/source/filter/xml/xmlimprt.hxx
+index ffde1a1..be0bc22 100644
+--- sc/source/filter/xml/xmlimprt.hxx
++++ sc/source/filter/xml/xmlimprt.hxx
+@@ -482,7 +482,8 @@ enum ScXMLDataPilotTableAttrTokens
  	XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS,
  	XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS,
      XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON,
@@ -502,7 +529,7 @@
  
          TOKEN( "show-filter-button",                   XML_SHOW_FILTER_BUTTON ),
          TOKEN( "drill-down-on-double-click",           XML_DRILL_DOWN_ON_DOUBLE_CLICK ),
-+        TOKEN( "header-grid-layout",           		   XML_HEADER_GRID_LAYOUT ),
++        TOKEN( "header-grid-layout",                   XML_HEADER_GRID_LAYOUT ),
          TOKEN( "grouped-by",                           XML_GROUPED_BY ),
          TOKEN( "days",                                 XML_DAYS ),
          TOKEN( "months",                               XML_MONTHS ),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]