From 5e0e9132262ed674d6af185cb2b36c3ebc0d9ec9 Mon Sep 17 00:00:00 2001
From: santi <santi@tartessos.(none)>
Date: Mon, 16 Apr 2012 20:05:42 +0200
Subject: [PATCH] Remove unused code in sc.

---
 sc/source/filter/inc/condformatbuffer.hxx   |    3 -
 sc/source/filter/inc/defnamesbuffer.hxx     |    3 -
 sc/source/filter/inc/externallinkbuffer.hxx |    5 --
 sc/source/filter/oox/condformatbuffer.cxx   |   34 ----------------
 sc/source/filter/oox/defnamesbuffer.cxx     |    6 ---
 sc/source/filter/oox/externallinkbuffer.cxx |   58 ---------------------------
 unusedcode.easy                             |    5 --
 7 files changed, 0 insertions(+), 114 deletions(-)

diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index 3dd17b1..3f21fcc 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -89,9 +89,6 @@ public:
     /** Imports rule settings from a CFRULE record. */
     void                importCfRule( SequenceInputStream& rStrm );
 
-    /** Imports rule settings from a CFRULE record. */
-    void                importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority );
-
     /** Creates a conditional formatting rule in the Calc document. */
     void                finalizeImport(
                             const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetConditionalEntries >& rxEntries );
diff --git a/sc/source/filter/inc/defnamesbuffer.hxx b/sc/source/filter/inc/defnamesbuffer.hxx
index 6704f19..61803b1 100644
--- a/sc/source/filter/inc/defnamesbuffer.hxx
+++ b/sc/source/filter/inc/defnamesbuffer.hxx
@@ -101,9 +101,6 @@ protected:
     /** Imports the BIFF formula from the passed stream. */
     ApiTokenSequence    importBiffFormula( sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 );
 
-    /** Tries to convert the passed token sequence to a SingleReference or ComplexReference. */
-    void                extractReference( const ApiTokenSequence& rTokens );
-
 protected:
     DefinedNameModel    maModel;            /// Model data for this defined name.
     mutable ::rtl::OUString maUpModelName;  /// Model name converted to uppercase ASCII.
diff --git a/sc/source/filter/inc/externallinkbuffer.hxx b/sc/source/filter/inc/externallinkbuffer.hxx
index 2ea0e6b..72c3297 100644
--- a/sc/source/filter/inc/externallinkbuffer.hxx
+++ b/sc/source/filter/inc/externallinkbuffer.hxx
@@ -257,9 +257,6 @@ public:
     /** Returns the type of the external library if this is a library link. */
     FunctionLibraryType getFuncLibraryType() const;
 
-    /** Returns the internal Calc sheet index or for the passed sheet. */
-    sal_Int16           getCalcSheetIndex( sal_Int32 nTabId = 0 ) const;
-
     /** Returns the token index of the external document. */
     sal_Int32           getDocumentLinkIndex() const;
     /** Returns the external sheet cache index or for the passed sheet. */
@@ -278,7 +275,6 @@ private:
     void                setExternalTargetUrl( const ::rtl::OUString& rTargetUrl, const ::rtl::OUString& rTargetType );
     void                setDdeOleTargetUrl( const ::rtl::OUString& rClassName, const ::rtl::OUString& rTargetUrl, ExternalLinkType eLinkType );
     void                parseExternalReference( const ::oox::core::Relations& rRelations, const ::rtl::OUString& rRelId );
-    ::rtl::OUString     parseBiffTargetUrl( const ::rtl::OUString& rBiffTargetUrl );
 
     /** Creates an external locument link and the sheet cache for the passed sheet name. */
     void                insertExternalSheet( const ::rtl::OUString& rSheetName );
@@ -322,7 +318,6 @@ struct RefSheetsModel
     explicit            RefSheetsModel();
 
     void                readBiff12Data( SequenceInputStream& rStrm );
-    void                readBiff8Data( BiffInputStream& rStrm );
 };
 
 // ----------------------------------------------------------------------------
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 2aff3e4..e7ec181 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -395,40 +395,6 @@ void CondFormatRule::importCfRule( SequenceInputStream& rStrm )
     }
 }
 
-void CondFormatRule::importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority )
-{
-    sal_uInt8 nType, nOperator;
-    sal_uInt16 nFmla1Size, nFmla2Size;
-    sal_uInt32 nFlags;
-    rStrm >> nType >> nOperator >> nFmla1Size >> nFmla2Size >> nFlags;
-    rStrm.skip( 2 );
-
-    static const sal_Int32 spnTypeIds[] = { XML_TOKEN_INVALID, XML_cellIs, XML_expression };
-    maModel.mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_TOKEN_INVALID );
-
-    maModel.setBiffOperator( nOperator );
-    maModel.mnPriority = nPriority;
-    maModel.mbStopIfTrue = true;
-
-    DxfRef xDxf = getStyles().createDxf( &maModel.mnDxfId );
-    xDxf->importCfRule( rStrm, nFlags );
-    xDxf->finalizeImport();
-
-    // import the formulas
-    OSL_ENSURE( (nFmla1Size > 0) || (nFmla2Size == 0), "CondFormatRule::importCfRule - missing first formula" );
-    if( nFmla1Size > 0 )
-    {
-        CellAddress aBaseAddr = mrCondFormat.getRanges().getBaseAddress();
-        ApiTokenSequence aTokens = getFormulaParser().importFormula( aBaseAddr, FORMULATYPE_CONDFORMAT, rStrm, &nFmla1Size );
-        maModel.maFormulas.push_back( aTokens );
-        if( nFmla2Size > 0 )
-        {
-            aTokens = getFormulaParser().importFormula( aBaseAddr, FORMULATYPE_CONDFORMAT, rStrm, &nFmla2Size );
-            maModel.maFormulas.push_back( aTokens );
-        }
-    }
-}
-
 void CondFormatRule::finalizeImport( const Reference< XSheetConditionalEntries >& rxEntries )
 {
     sal_Int32 eOperator = ::com::sun::star::sheet::ConditionOperator2::NONE;
diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx
index ea767da..8d04f7a 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -288,12 +288,6 @@ ApiTokenSequence DefinedNameBase::importBiffFormula( sal_Int16 nBaseSheet, BiffI
         getFormulaParser().convertErrorToFormula( BIFF_ERR_NAME );
 }
 
-void DefinedNameBase::extractReference( const ApiTokenSequence& rTokens )
-{
-    OSL_ENSURE( (getFilterType() == FILTER_BIFF) && (getBiff() <= BIFF4), "DefinedNameBase::extractReference - unexpected call" );
-    maRefAny = getFormulaParser().extractReference( rTokens );
-}
-
 // ============================================================================
 
 DefinedName::DefinedName( const WorkbookHelper& rHelper ) :
diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index 61d2894..d9cd78c 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -484,14 +484,6 @@ FunctionLibraryType ExternalLink::getFuncLibraryType() const
     return (meLinkType == LINKTYPE_LIBRARY) ? meFuncLibType : FUNCLIB_UNKNOWN;
 }
 
-sal_Int16 ExternalLink::getCalcSheetIndex( sal_Int32 nTabId ) const
-{
-    OSL_ENSURE( meLinkType == LINKTYPE_INTERNAL, "ExternalLink::getCalcSheetIndex - invalid link type" );
-    OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
-        "ExternalLink::getCalcSheetIndex - invalid sheet index" );
-    return ContainerHelper::getVectorElement( maCalcSheets, nTabId, -1 );
-}
-
 sal_Int32 ExternalLink::getDocumentLinkIndex() const
 {
     OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getDocumentLinkIndex - invalid link type" );
@@ -627,49 +619,6 @@ void ExternalLink::parseExternalReference( const Relations& rRelations, const OU
         setExternalTargetUrl( pRelation->maTarget, pRelation->maType );
 }
 
-OUString ExternalLink::parseBiffTargetUrl( const OUString& rBiffTargetUrl )
-{
-    meLinkType = LINKTYPE_UNKNOWN;
-
-    OUString aClassName, aTargetUrl, aSheetName;
-    switch( getAddressConverter().parseBiffTargetUrl( aClassName, aTargetUrl, aSheetName, rBiffTargetUrl ) )
-    {
-        case BIFF_TARGETTYPE_URL:
-            if( aTargetUrl.isEmpty() )
-            {
-                meLinkType = aSheetName.isEmpty() ? LINKTYPE_SELF : LINKTYPE_INTERNAL;
-            }
-            else if( (aTargetUrl.getLength() == 1) && (aTargetUrl[ 0 ] == ':') )
-            {
-                if( getBiff() >= BIFF4 )
-                    meLinkType = LINKTYPE_ANALYSIS;
-            }
-            else if( (aTargetUrl.getLength() > 1) || (aTargetUrl[ 0 ] != ' ') )
-            {
-                setExternalTargetUrl( aTargetUrl, OOX_TARGETTYPE_EXTLINK );
-            }
-        break;
-
-        case BIFF_TARGETTYPE_SAMESHEET:
-            OSL_ENSURE( aTargetUrl.isEmpty() && aSheetName.isEmpty(), "ExternalLink::parseBiffTargetUrl - unexpected target or sheet name" );
-            meLinkType = LINKTYPE_SAME;
-        break;
-
-        case BIFF_TARGETTYPE_LIBRARY:
-            OSL_ENSURE( aSheetName.isEmpty(), "ExternalLink::parseBiffTargetUrl - unexpected sheet name" );
-            setExternalTargetUrl( aTargetUrl, OOX_TARGETTYPE_LIBRARY );
-        break;
-
-        case BIFF_TARGETTYPE_DDE_OLE:
-            setDdeOleTargetUrl( aClassName, aTargetUrl, LINKTYPE_MAYBE_DDE_OLE );
-        break;
-
-        case BIFF_TARGETTYPE_UNKNOWN:
-        break;
-    }
-    return aSheetName;
-}
-
 void ExternalLink::insertExternalSheet( const OUString& rSheetName )
 {
     OSL_ENSURE( !rSheetName.isEmpty(), "ExternalLink::insertExternalSheet - empty sheet name" );
@@ -702,13 +651,6 @@ void RefSheetsModel::readBiff12Data( SequenceInputStream& rStrm )
     rStrm >> mnExtRefId >> mnTabId1 >> mnTabId2;
 }
 
-void RefSheetsModel::readBiff8Data( BiffInputStream& rStrm )
-{
-    mnExtRefId = rStrm.readuInt16();
-    mnTabId1 = rStrm.readInt16();
-    mnTabId2 = rStrm.readInt16();
-}
-
 // ----------------------------------------------------------------------------
 
 ExternalLinkBuffer::ExternalLinkBuffer( const WorkbookHelper& rHelper ) :
diff --git a/unusedcode.easy b/unusedcode.easy
index aee239d..4faad33 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -755,11 +755,6 @@ oox::PropertyMap::dump(com::sun::star::uno::Reference<com::sun::star::beans::XPr
 oox::dump::RecordObjectBase::construct(oox::dump::OutputObjectBase const&, oox::dump::BinaryInputStreamRef const&, oox::dump::BinaryInputStreamRef const&, oox::dump::String const&, oox::dump::String const&)
 oox::xls::BiffGroupObject::BiffGroupObject(oox::xls::WorksheetHelper const&)
 oox::xls::CellBlock::CellBlock(oox::xls::WorksheetHelper const&, oox::ValueRange const&, int)
-oox::xls::CondFormatRule::importCfRule(oox::xls::BiffInputStream&, int)
-oox::xls::DefinedNameBase::extractReference(com::sun::star::uno::Sequence<com::sun::star::sheet::FormulaToken> const&)
-oox::xls::ExternalLink::getCalcSheetIndex(int) const
-oox::xls::ExternalLink::parseBiffTargetUrl(rtl::OUString const&)
-oox::xls::RefSheetsModel::readBiff8Data(oox::xls::BiffInputStream&)
 psp::PrinterGfx::DrawBitmap(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterBmp const&)
 psp::PrinterGfx::DrawMask(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterColor&)
 psp::PrinterGfx::GetGlyphBoundRect(unsigned short, Rectangle&)
-- 
1.7.7.6

