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

Michael Meeks michael at kemper.freedesktop.org
Mon Feb 13 07:57:35 PST 2012


 oox/inc/oox/xls/addressconverter.hxx               |    2 
 oox/inc/oox/xls/formulabase.hxx                    |    4 -
 oox/inc/oox/xls/unitconverter.hxx                  |    2 
 oox/source/xls/addressconverter.cxx                |   18 -----
 oox/source/xls/formulabase.cxx                     |   11 ---
 oox/source/xls/unitconverter.cxx                   |    6 -
 unusedcode.easy                                    |   16 -----
 xmloff/inc/xmloff/txtimp.hxx                       |    7 --
 xmloff/source/text/txtimp.cxx                      |   36 -----------
 xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx |   11 ---
 xmlsecurity/source/helper/xmlsignaturehelper.cxx   |   47 ---------------
 xmlsecurity/source/helper/xsecctl.cxx              |   64 ---------------------
 xmlsecurity/source/helper/xsecctl.hxx              |   10 ---
 xmlsecurity/source/helper/xsecsign.cxx             |   30 ---------
 14 files changed, 264 deletions(-)

New commits:
commit f1c162967f032fcc5e4859f67c5b614c5dd19642
Author: Elton Chung <elton at layerjet.com>
Date:   Mon Feb 13 15:54:26 2012 +0000

    Remove unused code

diff --git a/oox/inc/oox/xls/addressconverter.hxx b/oox/inc/oox/xls/addressconverter.hxx
index ce2c876..681c2bb 100644
--- a/oox/inc/oox/xls/addressconverter.hxx
+++ b/oox/inc/oox/xls/addressconverter.hxx
@@ -178,8 +178,6 @@ class BinRangeList : public ::std::vector< BinRange >
 public:
     inline explicit     BinRangeList() {}
 
-    BinRange            getEnclosingRange() const;
-
     void                read( SequenceInputStream& rStrm );
     void                read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
     void                write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx
index 0a3b35a..610b227 100644
--- a/oox/inc/oox/xls/formulabase.hxx
+++ b/oox/inc/oox/xls/formulabase.hxx
@@ -532,7 +532,6 @@ class FunctionParamInfoIterator
 public:
     explicit            FunctionParamInfoIterator( const FunctionInfo& rFuncInfo );
 
-    const FunctionParamInfo& getParamInfo() const;
     bool                isCalcOnlyParam() const;
     bool                isExcelOnlyParam() const;
     FunctionParamInfoIterator& operator++();
@@ -555,9 +554,6 @@ public:
     explicit            FunctionProvider( FilterType eFilter, BiffType eBiff, bool bImportFilter );
     virtual             ~FunctionProvider();
 
-    /** Returns the function info for an ODF function name, or 0 on error. */
-    const FunctionInfo* getFuncInfoFromOdfFuncName( const ::rtl::OUString& rFuncName ) const;
-
     /** Returns the function info for an OOXML function name, or 0 on error. */
     const FunctionInfo* getFuncInfoFromOoxFuncName( const ::rtl::OUString& rFuncName ) const;
 
diff --git a/oox/inc/oox/xls/unitconverter.hxx b/oox/inc/oox/xls/unitconverter.hxx
index fe14e0f..a6ae756 100644
--- a/oox/inc/oox/xls/unitconverter.hxx
+++ b/oox/inc/oox/xls/unitconverter.hxx
@@ -94,8 +94,6 @@ public:
     /** Returns the datetime of the passed serial value, based on current nulldate. */
     ::com::sun::star::util::DateTime calcDateTimeFromSerial( double fSerial ) const;
 
-    /** Returns an error string from the passed BIFF error code. */
-    ::rtl::OUString     calcOoxErrorCode( sal_uInt8 nErrorCode ) const;
     /** Returns a BIFF error code from the passed error string. */
     sal_uInt8           calcBiffErrorCode( const ::rtl::OUString& rErrorCode ) const;
 
diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx
index 8a5a670..9fd9c38 100644
--- a/oox/source/xls/addressconverter.cxx
+++ b/oox/source/xls/addressconverter.cxx
@@ -181,24 +181,6 @@ void BinRange::write( BiffOutputStream& rStrm, bool bCol16Bit, bool bRow32Bit )
 
 // ============================================================================
 
-BinRange BinRangeList::getEnclosingRange() const
-{
-    BinRange aRange;
-    if( !empty() )
-    {
-        const_iterator aIt = begin(), aEnd = end();
-        aRange = *aIt;
-        for( ++aIt; aIt != aEnd; ++aIt )
-        {
-            aRange.maFirst.mnCol = ::std::min( aRange.maFirst.mnCol, aIt->maFirst.mnCol );
-            aRange.maFirst.mnRow = ::std::min( aRange.maFirst.mnRow, aIt->maFirst.mnRow );
-            aRange.maLast.mnCol  = ::std::max( aRange.maLast.mnCol, aIt->maLast.mnCol );
-            aRange.maLast.mnRow  = ::std::max( aRange.maLast.mnRow, aIt->maLast.mnRow );
-        }
-    }
-    return aRange;
-}
-
 void BinRangeList::read( SequenceInputStream& rStrm )
 {
     sal_Int32 nCount = rStrm.readInt32();
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx
index e9ffa95..0b10950 100644
--- a/oox/source/xls/formulabase.cxx
+++ b/oox/source/xls/formulabase.cxx
@@ -797,12 +797,6 @@ FunctionParamInfoIterator::FunctionParamInfoIterator( const FunctionInfo& rFuncI
         "FunctionParamInfoIterator::FunctionParamInfoIterator - expecting at least 2 infos for paired parameters" );
 }
 
-const FunctionParamInfo& FunctionParamInfoIterator::getParamInfo() const
-{
-    static const FunctionParamInfo saInvalidInfo = { FUNC_PARAM_NONE, FUNC_PARAMCONV_ORG, false };
-    return mpParamInfo ? *mpParamInfo : saInvalidInfo;
-}
-
 bool FunctionParamInfoIterator::isCalcOnlyParam() const
 {
     return mpParamInfo && (mpParamInfo->meValid == FUNC_PARAM_CALCONLY);
@@ -967,11 +961,6 @@ FunctionProvider::~FunctionProvider()
 {
 }
 
-const FunctionInfo* FunctionProvider::getFuncInfoFromOdfFuncName( const OUString& rFuncName ) const
-{
-    return mxFuncImpl->maOdfFuncs.get( rFuncName ).get();
-}
-
 const FunctionInfo* FunctionProvider::getFuncInfoFromOoxFuncName( const OUString& rFuncName ) const
 {
     return mxFuncImpl->maOoxFuncs.get( rFuncName ).get();
diff --git a/oox/source/xls/unitconverter.cxx b/oox/source/xls/unitconverter.cxx
index 194c51d..2438023 100644
--- a/oox/source/xls/unitconverter.cxx
+++ b/oox/source/xls/unitconverter.cxx
@@ -230,12 +230,6 @@ DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const
     return aDateTime;
 }
 
-OUString UnitConverter::calcOoxErrorCode( sal_uInt8 nErrorCode ) const
-{
-    BiffErrorCodeMap::const_iterator aIt = maBiffErrCodes.find( nErrorCode );
-    return (aIt == maBiffErrCodes.end()) ? CREATE_OUSTRING( "#N/A" ) : aIt->second;
-}
-
 sal_uInt8 UnitConverter::calcBiffErrorCode( const OUString& rErrorCode ) const
 {
     OoxErrorCodeMap::const_iterator aIt = maOoxErrCodes.find( rErrorCode );
diff --git a/unusedcode.easy b/unusedcode.easy
index 5143e82..540da7c 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1372,7 +1372,6 @@ oox::xls::BiffOutputStream::startRecord(unsigned short)
 oox::xls::BiffOutputStream::tellBase() const
 oox::xls::BinAddress::write(oox::xls::BiffOutputStream&, bool, bool) const
 oox::xls::BinRange::contains(oox::xls::BinAddress const&) const
-oox::xls::BinRangeList::getEnclosingRange() const
 oox::xls::BinRangeList::write(oox::xls::BiffOutputStream&, bool, bool) const
 oox::xls::CellBlock::CellBlock(oox::xls::WorksheetHelper const&, oox::ValueRange const&, int)
 oox::xls::CellBlock::isBefore(oox::ValueRange const&) const
@@ -1387,8 +1386,6 @@ oox::xls::FormulaParser::convertNumberToHyperlink(rtl::OUString const&, double)
 oox::xls::FormulaParser::importOleTargetLink(oox::xls::BiffInputStream&, unsigned short const*) const
 oox::xls::FormulaParserImpl::removeOperand(unsigned long, unsigned long)
 oox::xls::FormulaProcessorBase::generateApiRangeString(com::sun::star::table::CellRangeAddress const&) const
-oox::xls::FunctionParamInfoIterator::getParamInfo() const
-oox::xls::FunctionProvider::getFuncInfoFromOdfFuncName(rtl::OUString const&) const
 oox::xls::ShapeAnchor::getToCell() const
 oox::xls::SheetDataBuffer::XfIdRange::set(com::sun::star::table::CellAddress const&, int, int)
 oox::xls::SheetDataBuffer::XfIdRange::tryExpand(com::sun::star::table::CellAddress const&, int, int)
@@ -1396,7 +1393,6 @@ oox::xls::SheetDataBuffer::XfIdRange::tryMerge(oox::xls::SheetDataBuffer::XfIdRa
 oox::xls::SheetDataBuffer::XfIdRowRange::intersects(com::sun::star::table::CellRangeAddress const&) const
 oox::xls::StylesBuffer::getDxf(int) const
 oox::xls::StylesBuffer::writeStyleXfToPropertyMap(oox::PropertyMap&, int) const
-oox::xls::UnitConverter::calcOoxErrorCode(unsigned char) const
 oox::xls::WorkbookHelper::getBiffFilter() const
 oox::xls::WorkbookHelper::getCellFromDoc(com::sun::star::table::CellAddress const&) const
 oox::xls::WorkbookHelper::setTextEncoding(unsigned short)
commit 4f82f1e07607711f1c6b8c07ffb446a6dbaafc88
Author: Catalin Iacob <iacobcatalin at gmail.com>
Date:   Fri Feb 10 23:10:44 2012 +0100

    Remove unused code in XMLTextImportHelper

diff --git a/unusedcode.easy b/unusedcode.easy
index 5a6dc42..5143e82 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -641,9 +641,6 @@ XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(char const*)
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(char const*, char const*, unsigned char, short)
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(rtl::OUString const&, rtl::OUString const&, unsigned char, short)
 XMLTextFieldExport::ProcessDate(xmloff::token::XMLTokenEnum, com::sun::star::util::Date const&, unsigned short)
-XMLTextImportHelper::GetRangeFor(rtl::OUString&)
-XMLTextImportHelper::HasDrawNameAttribute(com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, SvXMLNamespaceMap&)
-XMLTextImportHelper::getCurrentFieldName()
 XMLTextListAutoStylePool::HasName(rtl::OUString const&) const
 XMLTextListAutoStylePoolNames_Impl::GetPos(rtl::OUString const*) const
 XMLTextListAutoStylePoolNames_Impl::Remove(rtl::OUString*)
diff --git a/xmloff/inc/xmloff/txtimp.hxx b/xmloff/inc/xmloff/txtimp.hxx
index 7a863e4..93a8ba2 100644
--- a/xmloff/inc/xmloff/txtimp.hxx
+++ b/xmloff/inc/xmloff/txtimp.hxx
@@ -570,11 +570,6 @@ public:
     static SvXMLImportPropertyMapper* CreateTableDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
     static SvXMLImportPropertyMapper* CreateTableRowDefaultExtPropMapper(SvXMLImport&, XMLFontStylesContext* pFontDecls = NULL);
 
-    static sal_Bool HasDrawNameAttribute(
-        const ::com::sun::star::uno::Reference<
-            ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
-        SvXMLNamespaceMap& rNamespaceMap );
-
     SvI18NMap& GetRenameMap();
 
     /// save the start of a range reference
@@ -596,13 +591,11 @@ public:
             o_rpRDFaAttributes);
 
     ::rtl::OUString FindActiveBookmarkName();
-    ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetRangeFor(::rtl::OUString &sName);
 
     void pushFieldCtx( ::rtl::OUString name, ::rtl::OUString type );
     void popFieldCtx();
     void addFieldParam( ::rtl::OUString name, ::rtl::OUString value );
     void setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField);
-    ::rtl::OUString getCurrentFieldName();
     ::rtl::OUString getCurrentFieldType();
     bool hasCurrentFieldCtx();
 
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 276baaf..7d210ca 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2226,28 +2226,6 @@ const XMLFontStylesContext *XMLTextImportHelper::GetFontDecls() const
     return (XMLFontStylesContext *)&m_pImpl->m_xFontDecls;
 }
 
-sal_Bool XMLTextImportHelper::HasDrawNameAttribute(
-        const Reference< XAttributeList > & xAttrList,
-        SvXMLNamespaceMap& rNamespaceMap )
-{
-    sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-    for( sal_Int16 i=0; i < nAttrCount; i++ )
-    {
-        const OUString& rAttrName = xAttrList->getNameByIndex( i );
-
-        OUString aLocalName;
-        sal_uInt16 nPrefix =
-            rNamespaceMap.GetKeyByAttrName( rAttrName, &aLocalName );
-        if( XML_NAMESPACE_DRAW == nPrefix &&
-            IsXMLToken( aLocalName, XML_NAME ) )
-        {
-            return !xAttrList->getValueByIndex(i).isEmpty();
-        }
-    }
-
-    return sal_False;
-}
-
 SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
         SvXMLImport& rImport,
         sal_uInt16 nPrefix, const OUString& rLocalName,
@@ -2646,12 +2624,6 @@ sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
     } else return ::rtl::OUString(); // return the empty string on error...
 }
 
-::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > XMLTextImportHelper::GetRangeFor(::rtl::OUString &sName)
-{
-    return m_pImpl->m_BookmarkStartRanges[sName].get<0>();
-}
-
-
 void XMLTextImportHelper::pushFieldCtx( ::rtl::OUString name, ::rtl::OUString type )
 {
     m_pImpl->m_FieldStack.push(Impl::field_stack_item_t(
@@ -2673,14 +2645,6 @@ void XMLTextImportHelper::addFieldParam( ::rtl::OUString name, ::rtl::OUString v
         FieldStackItem.second.push_back(Impl::field_param_t( name, value ));
     }
 }
-::rtl::OUString XMLTextImportHelper::getCurrentFieldName()
-{
-    DBG_ASSERT(!m_pImpl->m_FieldStack.empty(),
-        "stack is empty: not good! Do a pushFieldCtx before...");
-    if (!m_pImpl->m_FieldStack.empty()) {
-        return m_pImpl->m_FieldStack.top().first.first;
-    } else  return ::rtl::OUString();
-}
 
 ::rtl::OUString XMLTextImportHelper::getCurrentFieldType()
 {
commit 08ae56de57a9bcc49582769fa3b05b6b6fb62dbd
Author: Catalin Iacob <iacobcatalin at gmail.com>
Date:   Fri Feb 10 23:10:43 2012 +0100

    Remove unused code in XSecController

diff --git a/unusedcode.easy b/unusedcode.easy
index 00124c9..5a6dc42 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -651,9 +651,6 @@ XMLTextListAutoStylePool_Impl::GetPos(XMLTextListAutoStylePoolEntry_Impl const*)
 XMLTextListAutoStylePool_Impl::Remove(XMLTextListAutoStylePoolEntry_Impl*)
 XMLVisAreaContext::XMLVisAreaContext(SvXMLImport&, unsigned short, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, Rectangle&, short)
 XPropertyList::Clear()
-XSecController::collectToSign(int, rtl::OUString const&)
-XSecController::getErrorMessage()
-XSecController::setSAXChainConnector(com::sun::star::uno::Reference<com::sun::star::xml::sax::XParser> const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> const&, com::sun::star::uno::Reference<com::sun::star::xml::crypto::sax::XElementStackKeeper> const&)
 XWindowItem::XWindowItem(unsigned short, Window*)
 XWindowItem::XWindowItem(unsigned short, com::sun::star::uno::Reference<com::sun::star::awt::XWindow>&)
 XclExpFontBuffer::Insert(ScPatternAttr const&, short, XclExpColorType, bool)
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index fdec39e..b84fc2a 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -782,44 +782,6 @@ void XSecController::setSAXChainConnector(
     initializeSAXChain( );
 }
 
-void XSecController::setSAXChainConnector(
-    const cssu::Reference< cssxs::XParser >& xParser,
-    const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler,
-    const cssu::Reference< cssxc::sax::XElementStackKeeper >& xElementStackKeeper)
-/****** XSecController/setSAXChainConnector ***********************************
- *
- *   NAME
- *  setSAXChainConnector -- configures the components which will
- *  collaborate with the SAXEventKeeper on the SAX chain.
- *
- *   SYNOPSIS
- *  setSAXChainConnector( xParser, xDocumentHandler, xElementStackKeeper );
- *
- *   FUNCTION
- *  See NAME.
- *
- *   INPUTS
- *  xParser             - the previous node on the SAX chain
- *  xDocumentHandler    - the next node on the SAX chain
- *  xElementStackKeeper -the ElementStackKeeper component which reserves
- *                        missed key SAX events for the SAXEventKeeper
- *
- *   RESULT
- *  empty
- *
- *   AUTHOR
- *  Michael Mi
- *  Email: michael.mi at sun.com
- ******************************************************************************/
-{
-    m_bIsPreviousNodeInitializable = false;
-    m_xPreviousNodeOnSAXChain = xParser;
-    m_xNextNodeOnSAXChain = xDocumentHandler;
-    m_xElementStackKeeper = xElementStackKeeper;
-
-    initializeSAXChain( );
-}
-
 void XSecController::clearSAXChainConnector()
 /****** XSecController/clearSAXChainConnector *********************************
  *
@@ -920,32 +882,6 @@ void XSecController::endMission()
     }
 }
 
-const char* XSecController::getErrorMessage()
-/****** XSecController/getErrorMessage ****************************************
- *
- *   NAME
- *  getErrorMessage -- get the last error message
- *
- *   SYNOPSIS
- *  pErrorMessage = getErrorMessage( );
- *
- *   FUNCTION
- *  see NAME.
- *
- *   INPUTS
- *  empty
- *
- *   RESULT
- *  empty
- *
- *   AUTHOR
- *  Michael Mi
- *  Email: michael.mi at sun.com
- ******************************************************************************/
-{
-    return m_pErrorMessage;
-}
-
 void XSecController::exportSignature(
     const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler,
     const SignatureInformation& signatureInfo )
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 37ab6d3..b500ef7 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -425,17 +425,8 @@ public:
         const com::sun::star::uno::Reference<
             com::sun::star::xml::crypto::sax::XElementStackKeeper >& xElementStackKeeper);
 
-    void setSAXChainConnector(
-        const com::sun::star::uno::Reference<
-            com::sun::star::xml::sax::XParser >& xParser,
-        const com::sun::star::uno::Reference<
-            com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler,
-        const com::sun::star::uno::Reference<
-            com::sun::star::xml::crypto::sax::XElementStackKeeper >& xElementStackKeeper);
-
     void clearSAXChainConnector();
     void endMission();
-    const char* getErrorMessage();
 
     SignatureInformation    getSignatureInformation( sal_Int32 nSecurityId ) const;
     SignatureInformations   getSignatureInformations() const;
@@ -449,7 +440,6 @@ public:
     /*
      * For signature generation
      */
-    void collectToSign( sal_Int32 securityId, const rtl::OUString& referenceId );
     void signAStream( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool isBinary);
 
 
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index 7e9a93c..de609f1 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -192,36 +192,6 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
     return xReferenceResolvedListener;
 }
 
-/* public: for signature generation */
-void XSecController::collectToSign( sal_Int32 securityId, const rtl::OUString& referenceId )
-{
-    /* DBG_ASSERT( m_xSAXEventKeeper.is(), "the SAXEventKeeper is NULL" ); */
-
-    chainOn(true);
-
-    if ( m_nStatusOfSecurityComponents == INITIALIZED )
-    /*
-     * if all security components are ready, add a signature.
-     */
-    {
-        sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
-            cssxc::sax::ElementMarkPriority_AFTERMODIFY, sal_False);
-
-        int index = findSignatureInfor( securityId );
-
-        if ( index == -1 )
-        {
-            InternalSignatureInformation isi(securityId, NULL);
-            isi.addReference(TYPE_SAMEDOCUMENT_REFERENCE, referenceId, nKeeperId );
-            m_vInternalSignatureInformations.push_back( isi );
-        }
-        else
-        {
-            m_vInternalSignatureInformations[index].addReference(TYPE_SAMEDOCUMENT_REFERENCE, referenceId, nKeeperId );
-        }
-    }
-}
-
 void XSecController::signAStream( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& /*objectURL*/, sal_Bool isBinary)
 {
         sal_Int32 type = ((isBinary==sal_True)?TYPE_BINARYSTREAM_REFERENCE:TYPE_XMLSTREAM_REFERENCE);
commit b05ace90d30d90d09a5521ca6aff47226d619204
Author: Catalin Iacob <iacobcatalin at gmail.com>
Date:   Fri Feb 10 23:10:42 2012 +0100

    Remove unused code in XMLSignatureHelper

diff --git a/unusedcode.easy b/unusedcode.easy
index b28ead7..00124c9 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -640,12 +640,6 @@ XMLPropertyBackpatcher<rtl::OUString>::XMLPropertyBackpatcher(rtl::OUString cons
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(char const*)
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(char const*, char const*, unsigned char, short)
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(rtl::OUString const&, rtl::OUString const&, unsigned char, short)
-XMLSignatureHelper::CreateAndWriteSignature(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&)
-XMLSignatureHelper::GetSecurityEnvironmentByIndex(int)
-XMLSignatureHelper::GetSecurityEnvironmentNumber()
-XMLSignatureHelper::GetUriBinding() const
-XMLSignatureHelper::SetUriBinding(com::sun::star::uno::Reference<com::sun::star::xml::crypto::XUriBinding>&)
-XMLSignatureHelper::SetX509Certificate(int, int, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&)
 XMLTextFieldExport::ProcessDate(xmloff::token::XMLTokenEnum, com::sun::star::util::Date const&, unsigned short)
 XMLTextImportHelper::GetRangeFor(rtl::OUString&)
 XMLTextImportHelper::HasDrawNameAttribute(com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, SvXMLNamespaceMap&)
diff --git a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
index d0d3bbe..c83444a 100644
--- a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
+++ b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
@@ -137,11 +137,6 @@ public:
     // Returns true for success.
     bool        Init();
 
-                // Set UriBinding to create input streams to open files.
-                // Default implementation is capable to open files from disk.
-    void        SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding );
-    com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > GetUriBinding() const;
-
     // Set the storage which should be used by the default UriBinding
     // Must be set before StatrtMission().
     //sODFVersion indicates  the ODF version
@@ -154,8 +149,6 @@ public:
 
                 // Get the security environment
     ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironment();
-    ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironmentByIndex(sal_Int32 nId);
-    sal_Int32 GetSecurityEnvironmentNumber();
 
                 // After signing/veryfieng, get information about signatures
     SignatureInformation  GetSignatureInformation( sal_Int32 nSecurityId ) const;
@@ -186,14 +179,10 @@ public:
     void SetX509Certificate(sal_Int32 nSecurityId, const rtl::OUString& ouX509IssuerName,
         const rtl::OUString& ouX509SerialNumber, const rtl::OUString& ouX509Cert);
 
-    void SetX509Certificate(sal_Int32 nSecurityId, sal_Int32 nSecurityEnvironmentIndex,
-        const rtl::OUString& ouX509IssuerName,  const rtl::OUString& ouX509SerialNumber,
-        const rtl::OUString& ouX509Cert);
     void        SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime );
 
     void        AddForSigning( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool bBinary );
     bool        CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler );
-    bool        CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
     bool        ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream );
 
     // MT: ??? I think only for adding/removing, not for new signatures...
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 203d3f2..c05ba8e 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -91,16 +91,6 @@ void XMLSignatureHelper::ImplCreateSEInitializer()
         xMCF->createInstanceWithContext( sSEInitializer,  mxCtx ), uno::UNO_QUERY );
 }
 
-void XMLSignatureHelper::SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding )
-{
-    mxUriBinding = rxUriBinding;
-}
-
-com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > XMLSignatureHelper::GetUriBinding() const
-{
-    return mxUriBinding;
-}
-
 void XMLSignatureHelper::SetStorage(
     const Reference < css::embed::XStorage >& rxStorage,
     ::rtl::OUString sODFVersion)
@@ -149,21 +139,6 @@ void XMLSignatureHelper::SetX509Certificate(
         ouX509Cert);
 }
 
-void XMLSignatureHelper::SetX509Certificate(
-        sal_Int32 nSecurityId,
-        sal_Int32 nSecurityEnvironmentIndex,
-        const rtl::OUString& ouX509IssuerName,
-        const rtl::OUString& ouX509SerialNumber,
-        const rtl::OUString& ouX509Cert)
-{
-    mpXSecController->setX509Certificate(
-        nSecurityId,
-        nSecurityEnvironmentIndex,
-        ouX509IssuerName,
-        ouX509SerialNumber,
-        ouX509Cert);
-}
-
 void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime )
 {
     ::com::sun::star::util::DateTime stDateTime;
@@ -272,18 +247,6 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax
     return !mbError;
 }
 
-bool XMLSignatureHelper::CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream )
-{
-    uno::Reference<xml::sax::XDocumentHandler> xDocHandler
-        = CreateDocumentHandlerWithHeader(xOutputStream);
-
-    bool rc = CreateAndWriteSignature( xDocHandler );
-
-    CloseDocumentHandler(xDocHandler);
-
-    return rc;
-}
-
 bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream )
 {
     mbError = false;
@@ -388,16 +351,6 @@ uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatu
     return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironment()): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >());
 }
 
-uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatureHelper::GetSecurityEnvironmentByIndex(sal_Int32 nId)
-{
-    return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironmentByIndex(nId)): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >());
-}
-
-sal_Int32 XMLSignatureHelper::GetSecurityEnvironmentNumber()
-{
-    return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironmentNumber()): 0);
-}
-
 IMPL_LINK( XMLSignatureHelper, SignatureCreationResultListener, XMLSignatureCreationResult*, pResult )
 {
     maCreationResults.insert( maCreationResults.begin() + maCreationResults.size(), *pResult );


More information about the Libreoffice-commits mailing list