[Libreoffice-commits] core.git: sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Aug 29 15:37:21 PDT 2014


 sc/source/filter/excel/xepivot.cxx |  214 -------------------------------------
 sc/source/filter/inc/xepivot.hxx   |    3 
 2 files changed, 1 insertion(+), 216 deletions(-)

New commits:
commit fcc6e8ae56d539ef92bfb917a52ac0638b3db25f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Aug 29 18:35:44 2014 -0400

    Remove the old xlsx pivot table export code.
    
    Change-Id: I6725cbc331b51f66025a8294612c6a5918c07adf

diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 5878af8..34937da 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -724,38 +724,10 @@ void XclExpPivotCache::Save( XclExpStream& rStrm )
     WriteCacheStream();
 }
 
-void XclExpPivotCache::SaveXml( XclExpXmlStream&
-#ifdef XLSX_PIVOT_CACHE
-                                                 rStrm
-#endif
-)
+void XclExpPivotCache::SaveXml( XclExpXmlStream& /*rStrm*/ )
 {
-    OSL_ENSURE( mbValid, "XclExpPivotCache::Save - invalid pivot cache" );
-#ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream
-                           results in a broken .xlsx */
-    sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
-    OUString sId = OUStringBuffer()
-        .appendAscii("rId")
-        .append( rStrm.GetUniqueIdOUString() )
-        .makeStringAndClear();
-    rWorkbook->startElement( XML_pivotCache,
-            XML_cacheId, OString::number( maPCInfo.mnStrmId ).getStr(),
-            FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(),
-            FSEND );
-    // SXIDSTM
-    XclExpUInt16Record( EXC_ID_SXIDSTM, maPCInfo.mnStrmId ).SaveXml( rStrm );
-    // SXVS
-    XclExpUInt16Record( EXC_ID_SXVS, EXC_SXVS_SHEET ).SaveXml( rStrm );
-    // DCONREF
-    // OOXTODO: WriteDconref( rStrm );
-    // create the pivot cache storage stream
-    // OOXTODO: WriteCacheStream();
-    rWorkbook->endElement( XML_pivotCache );
-#endif /* XLSX_PIVOT_CACHE */
 }
 
-// private --------------------------------------------------------------------
-
 XclExpPCField* XclExpPivotCache::GetFieldAcc( sal_uInt16 nFieldIdx )
 {
     return maFieldList.GetRecord( nFieldIdx ).get();
@@ -1317,152 +1289,6 @@ void XclExpPivotTable::Save( XclExpStream& rStrm )
     }
 }
 
-void XclExpPivotTable::SaveXml( XclExpXmlStream& rStrm )
-{
-    if( !mbValid )
-        return;
-    sax_fastparser::FSHelperPtr aPivotTableDefinition = rStrm.CreateOutputStream(
-            XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnId + 1),
-            XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnId + 1),
-            rStrm.GetCurrentStream()->getOutputStream(),
-            "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable");
-    rStrm.PushStream( aPivotTableDefinition );
-
-    aPivotTableDefinition->startElement( XML_pivotTableDefinition,
-            XML_xmlns,                      "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
-            XML_name,                       XclXmlUtils::ToOString( maPTInfo.maTableName ).getStr(),
-            XML_cacheId,                    OString::number(  maPTInfo.mnCacheIdx ).getStr(),
-            XML_dataOnRows,                 XclXmlUtils::ToPsz( maPTInfo.mnDataAxis == EXC_SXVD_AXIS_COL ),
-            XML_dataPosition,               OString::number(  maPTInfo.mnDataPos ).getStr(),
-            XML_autoFormatId,               OString::number(  maPTInfo.mnAutoFmtIdx ).getStr(),
-            // OOXTODO: XML_applyNumberFormats,         [ SXVIEW fAtrNum (maPTInfo.mnFlags) ]
-            // OOXTODO: XML_applyBorderFormats,         [ SXVIEW fAtrBdr (maPTInfo.mnFlags) ]
-            // OOXTODO: XML_applyFontFormats,           [ SXVIEW fAtrFnt (maPTInfo.mnFlags) ]
-            // OOXTODO: XML_applyPatternFormats,        [ SXVIEW fAtrPat (maPTInfo.mnFlags) ]
-            // OOXTODO: XML_applyAlignmentFormats,      [ SXVIEW fAtrAlc (maPTInfo.mnFlags) ]
-            // OOXTODO: XML_applyWidthHeightFormats,    [ SXVIEW fAtrProc (maPTInfo.mnFlags) ]
-            XML_dataCaption,                XclXmlUtils::ToOString( maPTInfo.maDataName ).getStr(),
-            // OOXTODO: XML_grandTotalCaption,          [ SxViewEx9 chGrand ]
-            // OOXTODO: XML_errorCaption,               [ SXEx stError ]
-            // OOXTODO: XML_showError,                  [ SXEx fDisplayErrorString ]
-            // OOXTODO: XML_missingCaption,             [ SXEx stDisplayNull ]
-            // OOXTODO: XML_showMissing,                [ SXEx fDisplayNullString ]
-            // OOXTODO: XML_pageStyle,                  [ SXEx stPageFieldStyle ]
-            // OOXTODO: XML_pivotTableStyle,            [ SXEx stTableStyle ]
-            // OOXTODO: XML_vacatedStyle,               [ SXEx stVacateStyle ]
-            // OOXTODO: XML_tag,                        [ SXEx stTag ]
-            // OOXTODO: XML_updatedVersion,             [ app-dependent ]
-            // OOXTODO: XML_minRefreshableVersion,      [ app-dependent ]
-            // OOXTODO: XML_asteriskTotals,             [ QsiSXTag/SXView9Save fHideTotAnnotation ]
-            // OOXTODO: XML_showItems,                  [ ??? ]
-            // OOXTODO: XML_editData,                   [ ??? ]
-            // OOXTODO: XML_disableFieldList,           [ SXEx fEnableFieldDialog? ]
-            // OOXTODO: XML_showCalcMbrs,               [ ??? ]
-            // OOXTODO: XML_visualTotals,               [ ??? ]
-            // OOXTODO: XML_showMultipleLabel,          [ SXEx fMergeLabels? ]
-            // OOXTODO: XML_showDataDropDown,           [ SXEx fEnableDrillDown? ]
-            // OOXTODO: XML_showDrill,                  [ ??? ]
-            // OOXTODO: XML_printDrill,                 [ ??? ]
-            // OOXTODO: XML_showMemberPropertyTips,
-            // OOXTODO: XML_showDataTips,
-            // OOXTODO: XML_enableWizard,
-            XML_enableDrill,                XclXmlUtils::ToPsz( (maPTExtInfo.mnFlags & EXC_SXEX_DRILLDOWN) != 0 ), // ???
-            // OOXTODO: XML_enableFieldProperties,      [ SXEx fEnableFieldDialog (maPTExtInfo.mnFlags) ]
-            // OOXTODO: XML_preserveFormatting,         [ SXEx fPreserveFormatting (maPTExtInfo.mnFlags) ]
-            // OOXTODO: XML_pageWrap,                   [ SXEx cWrapPage (maPTExtInfo.mnFlags) ]
-            // OOXTODO: XML_pageOverThenDown,           [ SXEx fAcrossPageLay (maPTExtInfo.mnFlags) ]
-            // OOXTODO: XML_subtotalHiddenItems,        [ SXEx fSubtotalHiddenPageItems (maPTExtInfo.mnFlags) ]
-            XML_rowGrandTotals,             XclXmlUtils::ToPsz( (maPTInfo.mnFlags & EXC_SXVIEW_ROWGRAND) != 0 ),
-            XML_colGrandTotals,             XclXmlUtils::ToPsz( (maPTInfo.mnFlags & EXC_SXVIEW_COLGRAND) != 0 ),
-            // OOXTODO: XML_fieldPrintTitles,
-            // OOXTODO: XML_itemPrintTitles,
-            // OOXTODO: XML_mergeItem,
-            // OOXTODO: XML_showDropZones,
-            // OOXTODO: XML_createdVersion,
-            // OOXTODO: XML_indent,
-            // OOXTODO: XML_showEmptyRow,
-            // OOXTODO: XML_showEmptyCol,
-            // OOXTODO: XML_showHeaders,
-            // OOXTODO: XML_compact,
-            // OOXTODO: XML_outline,
-            // OOXTODO: XML_outlineData,
-            // OOXTODO: XML_compactData,
-            // OOXTODO: XML_published,
-            // OOXTODO: XML_gridDropZones,
-            // OOXTODO: XML_immersive,
-            // OOXTODO: XML_multipleFieldFilters,
-            // OOXTODO: XML_chartFormat,
-            // OOXTODO: XML_rowHeaderCaption,
-            // OOXTODO: XML_colHeaderCaption,
-            // OOXTODO: XML_fieldListSortAscending,
-            // OOXTODO: XML_mdxSubqueries,
-            // OOXTODO: XML_customListSort,
-            FSEND );
-
-    aPivotTableDefinition->singleElement( XML_location,
-            XML_ref,            XclXmlUtils::ToOString( maPTInfo.maOutXclRange ).getStr(),
-            XML_firstHeaderRow, OString::number(  maPTInfo.mnFirstHeadRow ).getStr(),
-            XML_firstDataRow,   OString::number(  maPTInfo.maDataXclPos.mnRow ).getStr(),
-            XML_firstDataCol,   OString::number(  maPTInfo.maDataXclPos.mnCol ).getStr(),
-            XML_rowPageCount,   OString::number(  maPTInfo.mnDataRows ).getStr(),   // OOXTODO?
-            XML_colPageCount,   OString::number(  maPTInfo.mnDataCols ).getStr(),   // OOXTODO?
-            FSEND );
-
-    // OOXTODO: XML_pivotFields
-
-    // Until we figure out how to fill these elements don't export them. It makes
-    // our documents invalid. The code below is correct so don't remove it!!!
-#if 0
-    // maPTInfo.mnFields?
-    if( maPTInfo.mnRowFields )
-    {
-        aPivotTableDefinition->startElement( XML_rowFields,
-                XML_count,  OString::number(  maPTInfo.mnRowFields ).getStr(),
-                FSEND );
-        aPivotTableDefinition->endElement( XML_rowFields );
-    }
-
-    // OOXTODO: XML_rowItems
-
-    if( maPTInfo.mnColFields )
-    {
-        aPivotTableDefinition->startElement( XML_colFields,
-                XML_count,  OString::number(  maPTInfo.mnColFields ).getStr(),
-                FSEND );
-        aPivotTableDefinition->endElement( XML_colFields );
-    }
-
-    // OOXTODO: XML_colItems
-
-    if( maPTInfo.mnPageFields )
-    {
-        aPivotTableDefinition->startElement( XML_pageFields,
-                XML_count,  OString::number(  maPTInfo.mnPageFields ).getStr(),
-                FSEND );
-        aPivotTableDefinition->endElement( XML_pageFields );
-    }
-
-    if( maPTInfo.mnDataFields )
-    {
-        aPivotTableDefinition->startElement( XML_dataFields,
-                XML_count,  OString::number(  maPTInfo.mnDataFields ).getStr(),
-                FSEND );
-        aPivotTableDefinition->endElement( XML_dataFields );
-    }
-#endif
-
-    // OOXTODO: XML_formats, XML_conditionalFormats, XML_chartFormats,
-    //          XML_pivotHierarchies, XML_pivotTableStyleInfo, XML_filters,
-    //          XML_rowHierarchiesUsage, XML_colHierarchiesUsage, XML_ext
-
-    aPivotTableDefinition->endElement( XML_pivotTableDefinition );
-
-    rStrm.PopStream();
-}
-
-// private --------------------------------------------------------------------
-
 XclExpPTField* XclExpPivotTable::GetFieldAcc( const OUString& rName )
 {
     XclExpPTField* pField = 0;
@@ -1784,7 +1610,6 @@ class XclExpPivotRecWrapper : public XclExpRecordBase
 public:
     explicit            XclExpPivotRecWrapper( XclExpPivotTableManager& rPTMgr, SCTAB nScTab );
     virtual void        Save( XclExpStream& rStrm ) SAL_OVERRIDE;
-    virtual void        SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE;
 private:
     XclExpPivotTableManager& mrPTMgr;
     SCTAB               mnScTab;
@@ -1804,14 +1629,6 @@ void XclExpPivotRecWrapper::Save( XclExpStream& rStrm )
         mrPTMgr.WritePivotTables( rStrm, mnScTab );
 }
 
-void XclExpPivotRecWrapper::SaveXml( XclExpXmlStream& rStrm )
-{
-    if( mnScTab == EXC_PTMGR_PIVOTCACHES )
-        mrPTMgr.WritePivotCachesXml( rStrm );
-    else
-        mrPTMgr.WritePivotTablesXml( rStrm, mnScTab );
-}
-
 } // namespace
 
 XclExpPivotTableManager::XclExpPivotTableManager( const XclExpRoot& rRoot ) :
@@ -1844,23 +1661,6 @@ void XclExpPivotTableManager::WritePivotCaches( XclExpStream& rStrm )
     maPCacheList.Save( rStrm );
 }
 
-void XclExpPivotTableManager::WritePivotCachesXml( XclExpXmlStream&
-#ifdef XLSX_PIVOT_CACHE
-                                                                    rStrm
-#endif
-)
-{
-#ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream
-                           results in a broken .xlsx */
-    if( maPCacheList.IsEmpty() )
-        return;
-    sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
-    rWorkbook->startElement( XML_pivotCaches, FSEND );
-    maPCacheList.SaveXml( rStrm );
-    rWorkbook->endElement( XML_pivotCaches );
-#endif /* XLSX_PIVOT_CACHE */
-}
-
 void XclExpPivotTableManager::WritePivotTables( XclExpStream& rStrm, SCTAB nScTab )
 {
     for( size_t nPos = 0, nSize = maPTableList.GetSize(); nPos < nSize; ++nPos )
@@ -1871,18 +1671,6 @@ void XclExpPivotTableManager::WritePivotTables( XclExpStream& rStrm, SCTAB nScTa
     }
 }
 
-void XclExpPivotTableManager::WritePivotTablesXml( XclExpXmlStream& rStrm, SCTAB nScTab )
-{
-    for( size_t nPos = 0, nSize = maPTableList.GetSize(); nPos < nSize; ++nPos )
-    {
-        XclExpPivotTableRef xPTable = maPTableList.GetRecord( nPos );
-        if( xPTable->GetScTab() == nScTab )
-            xPTable->SaveXml( rStrm );
-    }
-}
-
-// private --------------------------------------------------------------------
-
 const XclExpPivotCache* XclExpPivotTableManager::CreatePivotCache( const ScDPObject& rDPObj )
 {
     // try to find a pivot cache with the same data source
diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx
index 2be764f..bf12728 100644
--- a/sc/source/filter/inc/xepivot.hxx
+++ b/sc/source/filter/inc/xepivot.hxx
@@ -350,7 +350,6 @@ public:
 
     /** Writes the entire pivot table. */
     virtual void        Save( XclExpStream& rStrm ) SAL_OVERRIDE;
-    virtual void        SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE;
 
 private:
     /** Returns a pivot table field by its name. */
@@ -432,10 +431,8 @@ public:
 
     /** Writes all pivot caches (all Workbook records and cache streams). */
     void                WritePivotCaches( XclExpStream& rStrm );
-    void                WritePivotCachesXml( XclExpXmlStream& rStrm );
     /** Writes all pivot tables of the specified Calc sheet. */
     void                WritePivotTables( XclExpStream& rStrm, SCTAB nScTab );
-    void                WritePivotTablesXml( XclExpXmlStream& rStrm, SCTAB nScTab );
 
 private:
     /** Finds an existing (if enabled in mbShareCaches) or creates a new pivot cache.


More information about the Libreoffice-commits mailing list