[Libreoffice-commits] .: oox/inc oox/source unusedcode.easy

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Sat Feb 11 06:59:20 PST 2012


 oox/inc/oox/xls/formulabase.hxx  |   38 --------------------------------------
 oox/source/xls/formulabase.cxx   |   39 ---------------------------------------
 oox/source/xls/formulaparser.cxx |   13 -------------
 unusedcode.easy                  |    5 -----
 4 files changed, 95 deletions(-)

New commits:
commit 731a8d7d5bd47bc17f21065f195170da711f3277
Author: Elton Chung <elton at layerjet.com>
Date:   Fri Feb 10 22:16:49 2012 +0800

    Remove unused code

diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx
index b3e403a..0a3b35a 100644
--- a/oox/inc/oox/xls/formulabase.hxx
+++ b/oox/inc/oox/xls/formulabase.hxx
@@ -705,14 +705,6 @@ public:
 
     // ------------------------------------------------------------------------
 
-    /** Generates a cell address string in Calc's absolute $Sheet.$A$1 notation
-        from the passed cell address.
-
-        @param rAddress  The cell address to be converted to a string.
-     */
-    ::rtl::OUString     generateApiAddressString(
-                            const ::com::sun::star::table::CellAddress& rAddress ) const;
-
     /** Generates a cell range string in Calc's absolute $Sheet.$A$1:$A$
         notation from the passed cell range address.
 
@@ -721,13 +713,6 @@ public:
     ::rtl::OUString     generateApiRangeString(
                             const ::com::sun::star::table::CellRangeAddress& rRange ) const;
 
-    /** Generates a cell range list string in Calc's absolute $Sheet.$A$1:$A$1
-        notation from the passed cell range addresses.
-
-        @param rRanges  The list of cell ranges to be converted to a string.
-     */
-    ::rtl::OUString     generateApiRangeListString( const ApiCellRangeList& rRanges ) const;
-
     /** Generates a string in Calc formula notation from the passed string.
 
         @param rString  The string value.
@@ -760,29 +745,6 @@ public:
     ::com::sun::star::uno::Any
                         extractReference( const ApiTokenSequence& rTokens ) const;
 
-    /** Tries to extract a single cell address from a formula token sequence.
-
-        @param orAddress  (output parameter) If the token sequence is valid,
-            this parameter will contain the extracted cell address. If the
-            token sequence contains unexpected tokens, nothing meaningful is
-            inserted, and the function returns false.
-
-        @param rTokens  The token sequence to be parsed. Should contain exactly
-            one cell address token. The token sequence may contain whitespace
-            tokens.
-
-        @param bAllowRelative  True = it is allowed that rTokens contains
-            relative references (based on cell A1 of the current sheet).
-            False = only real absolute references will be accepted.
-
-        @return  True, if the token sequence contains a valid cell address
-            which has been extracted to orAddress, false otherwise.
-     */
-    bool                extractCellAddress(
-                            ::com::sun::star::table::CellAddress& orAddress,
-                            const ApiTokenSequence& rTokens,
-                            bool bAllowRelative ) const;
-
     /** Tries to extract a cell range address from a formula token sequence.
 
         @param orAddress  (output parameter) If the token sequence is valid,
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx
index 477a8f9..e9ffa95 100644
--- a/oox/source/xls/formulabase.cxx
+++ b/oox/source/xls/formulabase.cxx
@@ -1494,15 +1494,6 @@ OUString FormulaProcessorBase::generateRangeList2dString( const ApiCellRangeList
 
 // ----------------------------------------------------------------------------
 
-OUString FormulaProcessorBase::generateApiAddressString( const CellAddress& rAddress ) const
-{
-    OUString aCellName;
-    PropertySet aCellProp( getCellFromDoc( rAddress ) );
-    aCellProp.getProperty( aCellName, PROP_AbsoluteName );
-    OSL_ENSURE( !aCellName.isEmpty(), "FormulaProcessorBase::generateApiAddressString - cannot create cell address string" );
-    return aCellName;
-}
-
 OUString FormulaProcessorBase::generateApiRangeString( const CellRangeAddress& rRange ) const
 {
     OUString aRangeName;
@@ -1512,22 +1503,6 @@ OUString FormulaProcessorBase::generateApiRangeString( const CellRangeAddress& r
     return aRangeName;
 }
 
-OUString FormulaProcessorBase::generateApiRangeListString( const ApiCellRangeList& rRanges ) const
-{
-    OUStringBuffer aBuffer;
-    for( ApiCellRangeList::const_iterator aIt = rRanges.begin(), aEnd = rRanges.end(); aIt != aEnd; ++aIt )
-    {
-        OUString aRangeName = generateApiRangeString( *aIt );
-        if( !aRangeName.isEmpty() )
-        {
-            if( aBuffer.getLength() > 0 )
-                aBuffer.append( API_TOKEN_SEP );
-            aBuffer.append( aRangeName );
-        }
-    }
-    return aBuffer.makeStringAndClear();
-}
-
 OUString FormulaProcessorBase::generateApiString( const OUString& rString )
 {
     OUString aRetString = rString;
@@ -1578,20 +1553,6 @@ Any FormulaProcessorBase::extractReference( const ApiTokenSequence& rTokens ) co
     return Any();
 }
 
-bool FormulaProcessorBase::extractCellAddress( CellAddress& orAddress,
-        const ApiTokenSequence& rTokens, bool bAllowRelative ) const
-{
-    CellRangeAddress aRange;
-    if( extractCellRange( aRange, rTokens, bAllowRelative ) && (aRange.StartColumn == aRange.EndColumn) && (aRange.StartRow == aRange.EndRow) )
-    {
-        orAddress.Sheet = aRange.Sheet;
-        orAddress.Column = aRange.StartColumn;
-        orAddress.Row = aRange.StartRow;
-        return true;
-    }
-    return false;
-}
-
 bool FormulaProcessorBase::extractCellRange( CellRangeAddress& orRange,
         const ApiTokenSequence& rTokens, bool bAllowRelative ) const
 {
diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index b7f7ddc..a5ffd49 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -491,7 +491,6 @@ protected:
 
     ApiToken&           getOperandToken( size_t nOpCountFromEnd, size_t nOpIndex, size_t nTokenIndex );
     void                removeOperand( size_t nOpCountFromEnd, size_t nOpIndex );
-    void                removeLastOperands( size_t nOpCountFromEnd );
 
     bool                pushOperandToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = 0 );
     bool                pushAnyOperandToken( const Any& rAny, sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces = 0 );
@@ -519,7 +518,6 @@ protected:
     bool                pushErrorOperand( double fEncodedError );
     bool                pushBiffBoolOperand( sal_uInt8 nValue );
     bool                pushBiffErrorOperand( sal_uInt8 nErrorCode );
-    bool                pushParenthesesOperand();
     bool                pushReferenceOperand( const BinSingleRef2d& rRef, bool bDeleted, bool bRelativeAsOffset );
     bool                pushReferenceOperand( const BinComplexRef2d& rRef, bool bDeleted, bool bRelativeAsOffset );
     template< typename Type >
@@ -788,12 +786,6 @@ void FormulaParserImpl::removeOperand( size_t nOpCountFromEnd, size_t nOpIndex )
     maOperandSizeStack.erase( aSizeIt );
 }
 
-void FormulaParserImpl::removeLastOperands( size_t nOpCountFromEnd )
-{
-    for( size_t nOpIndex = 0; nOpIndex < nOpCountFromEnd; ++nOpIndex )
-        removeOperand( 1, 0 );
-}
-
 bool FormulaParserImpl::pushOperandToken( sal_Int32 nOpCode, const WhiteSpaceVec* pSpaces )
 {
     size_t nSpacesSize = appendWhiteSpaceTokens( pSpaces );
@@ -964,11 +956,6 @@ bool FormulaParserImpl::pushBiffErrorOperand( sal_uInt8 nErrorCode )
     return pushErrorOperand( BiffHelper::calcDoubleFromError( nErrorCode ) );
 }
 
-bool FormulaParserImpl::pushParenthesesOperand()
-{
-    return pushParenthesesOperandToken( &maOpeningSpaces, &maClosingSpaces ) && resetSpaces();
-}
-
 bool FormulaParserImpl::pushReferenceOperand( const BinSingleRef2d& rRef, bool bDeleted, bool bRelativeAsOffset )
 {
     SingleReference aApiRef;
diff --git a/unusedcode.easy b/unusedcode.easy
index 799faab..0b128a6 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1366,11 +1366,6 @@ oox::xls::Dxf::importProtection(oox::AttributeList const&)
 oox::xls::ExternalLinkBuffer::importExternalName(oox::xls::BiffInputStream&)
 oox::xls::FormulaParser::convertNumberToHyperlink(rtl::OUString const&, double) const
 oox::xls::FormulaParser::importOleTargetLink(oox::xls::BiffInputStream&, unsigned short const*) const
-oox::xls::FormulaParserImpl::pushParenthesesOperand()
-oox::xls::FormulaParserImpl::removeLastOperands(unsigned long)
-oox::xls::FormulaProcessorBase::extractCellAddress(com::sun::star::table::CellAddress&, com::sun::star::uno::Sequence<com::sun::star::sheet::FormulaToken> const&, bool) const
-oox::xls::FormulaProcessorBase::generateApiAddressString(com::sun::star::table::CellAddress const&) const
-oox::xls::FormulaProcessorBase::generateApiRangeListString(oox::xls::ApiCellRangeList const&) const
 oox::xls::FunctionParamInfoIterator::getParamInfo() const
 oox::xls::FunctionProvider::getFuncInfoFromOdfFuncName(rtl::OUString const&) const
 oox::xls::ShapeAnchor::getToCell() const


More information about the Libreoffice-commits mailing list