diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-18 13:32:09 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-19 06:41:20 +0000 |
commit | 65bfed2bdb92b336ed64ac9d9fb1e7ace047885b (patch) | |
tree | 860e4e007471e92bf0bb227b65b2c879af8ac0c7 /unotools/source | |
parent | 239cba2b06bc7894270aa68e381cc06a9d52773c (diff) |
loplugin:unusedmethods in unotools
Change-Id: I5729c2a20dd5fb310570cb9e4bb0e0874dbc8049
Reviewed-on: https://gerrit.libreoffice.org/25102
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/compatibility.cxx | 7 | ||||
-rw-r--r-- | unotools/source/config/itemholder1.cxx | 1 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/xmlaccelcfg.cxx | 187 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 4 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.hxx | 10 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbstreamhelper.cxx | 10 |
7 files changed, 8 insertions, 217 deletions
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index b7b34fa56e00..8dd58e27ef36 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -274,7 +274,6 @@ class SvtCompatibilityOptions_Impl : public ConfigItem inline bool IsUseOurTextWrapping() const { return m_aDefOptions.bUseOurTextWrapping; } inline bool IsConsiderWrappingStyle() const { return m_aDefOptions.bConsiderWrappingStyle; } inline bool IsExpandWordSpace() const { return m_aDefOptions.bExpandWordSpace; } - inline bool IsProtectForm() const { return m_aDefOptions.bProtectForm; } // private methods @@ -725,12 +724,6 @@ bool SvtCompatibilityOptions::IsExpandWordSpace() const return m_pDataContainer->IsExpandWordSpace(); } -bool SvtCompatibilityOptions::IsProtectForm() const -{ - MutexGuard aGuard( GetOwnStaticMutex() ); - return m_pDataContainer->IsProtectForm(); -} - Sequence< Sequence< PropertyValue > > SvtCompatibilityOptions::GetList() const { MutexGuard aGuard( GetOwnStaticMutex() ); diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx index c2b5d0ed8055..6f69b976ce16 100644 --- a/unotools/source/config/itemholder1.cxx +++ b/unotools/source/config/itemholder1.cxx @@ -44,7 +44,6 @@ #include <unotools/searchopt.hxx> #include <unotools/securityoptions.hxx> #include <unotools/viewoptions.hxx> -#include <unotools/xmlaccelcfg.hxx> #include <unotools/options.hxx> #include <unotools/syslocaleoptions.hxx> diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 13fa33500914..2a2c14bfff14 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -152,7 +152,6 @@ class SvtPathOptions_Impl void SetTemplatePath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_TEMPLATE, rPath ); } void SetUserConfigPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_USERCONFIG, rPath ); } void SetWorkPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_WORK, rPath ); } - void SetClassificationPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_CLASSIFICATION, rPath ); } OUString SubstVar( const OUString& rVar ) const; OUString ExpandMacros( const OUString& rPath ) const; @@ -702,11 +701,6 @@ void SvtPathOptions::SetWorkPath( const OUString& rPath ) pImp->SetWorkPath( rPath ); } -void SvtPathOptions::SetClassificationPath( const OUString& rPath ) -{ - pImp->SetClassificationPath( rPath ); -} - OUString SvtPathOptions::SubstituteVariable( const OUString& rVar ) const { return pImp->SubstVar( rVar ); diff --git a/unotools/source/config/xmlaccelcfg.cxx b/unotools/source/config/xmlaccelcfg.cxx deleted file mode 100644 index f84d93d5f24d..000000000000 --- a/unotools/source/config/xmlaccelcfg.cxx +++ /dev/null @@ -1,187 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <unotools/xmlaccelcfg.hxx> - -#include <vector> -#include <com/sun/star/xml/sax/XAttributeList.hpp> -#include <cppuhelper/queryinterface.hxx> - -using namespace com::sun::star::uno; -using namespace com::sun::star::xml::sax; - -#define ELEMENT_ACCELERATORLIST "acceleratorlist" -#define ELEMENT_ACCELERATORITEM "item" - -#define ATTRIBUTE_KEYCODE "code" -#define ATTRIBUTE_MODIFIER "modifier" -#define ATTRIBUTE_URL "url" - -Any SAL_CALL OReadAccelatorDocumentHandler::queryInterface( const Type & rType ) throw( RuntimeException, std::exception ) -{ - Any a = ::cppu::queryInterface( rType ,(static_cast< XDocumentHandler* >(this))); - if ( a.hasValue() ) - return a; - else - return OWeakObject::queryInterface( rType ); -} - -void SAL_CALL OReadAccelatorDocumentHandler::ignorableWhitespace( - const OUString& ) -throw( SAXException, RuntimeException, std::exception ) -{ -} - -void SAL_CALL OReadAccelatorDocumentHandler::processingInstruction( - const OUString&, const OUString& ) -throw( SAXException, RuntimeException, std::exception ) -{ -} - -void SAL_CALL OReadAccelatorDocumentHandler::setDocumentLocator( - const Reference< XLocator > &xLocator) -throw( SAXException, RuntimeException, std::exception ) -{ - m_xLocator = xLocator; -} - -OUString OReadAccelatorDocumentHandler::getErrorLineString() -{ - if ( m_xLocator.is() ) - { - char buffer[32]; - return OUString::createFromAscii( buffer ); - } - else - return OUString(); -} - -void SAL_CALL OReadAccelatorDocumentHandler::startDocument() - throw ( SAXException, RuntimeException, std::exception ) -{ -} - -void SAL_CALL OReadAccelatorDocumentHandler::endDocument() - throw( SAXException, RuntimeException, std::exception ) -{ - if ( m_nElementDepth > 0 ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "A closing element is missing!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - -void SAL_CALL OReadAccelatorDocumentHandler::startElement( - const OUString& aElementName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException, std::exception ) -{ - m_nElementDepth++; - - if ( aElementName == ELEMENT_ACCELERATORLIST ) - { - // acceleratorlist - if ( m_bAcceleratorMode ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "Accelerator list used twice!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - else - m_bAcceleratorMode = true; - } - else if ( aElementName == ELEMENT_ACCELERATORITEM ) - { - // accelerator item - if ( !m_bAcceleratorMode ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "Accelerator list element has to be used before!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - else - { - // read accelerator item - m_bItemCloseExpected = true; - - SvtAcceleratorConfigItem aItem; - - // read attributes for accelerator - for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - - if ( aName == ATTRIBUTE_URL ) - aItem.aCommand = aValue; - else if ( aName == ATTRIBUTE_MODIFIER ) - aItem.nModifier = (sal_uInt16)aValue.toInt32(); - else if ( aName == ATTRIBUTE_KEYCODE ) - aItem.nCode = (sal_uInt16)aValue.toInt32(); - } - - m_aReadAcceleratorList.push_back( aItem ); - } - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "Unknown element found!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - -void SAL_CALL OReadAccelatorDocumentHandler::characters(const OUString&) -throw( SAXException, RuntimeException, std::exception ) -{ -} - -void SAL_CALL OReadAccelatorDocumentHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException, std::exception ) -{ - m_nElementDepth--; - - if ( aName == ELEMENT_ACCELERATORLIST ) - { - // acceleratorlist - if ( !m_bAcceleratorMode ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "Accelerator list used twice!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else if ( aName == ELEMENT_ACCELERATORITEM ) - { - if ( !m_bItemCloseExpected ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "Closing accelerator item element expected!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += "Unknown closing element found!"; - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index a73b87cf0011..a87ef191e08a 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1392,13 +1392,13 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference< XStream >& xStre } UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xContent, const Sequence < PropertyValue >& rProps, - StreamMode eOpenMode, const Reference < XInteractionHandler >& xInteractionHandler, UcbLockBytesHandler* pHandler ) + StreamMode eOpenMode, const Reference < XInteractionHandler >& xInteractionHandler ) { if( !xContent.is() ) return nullptr; UcbLockBytesRef xLockBytes = new UcbLockBytes; - xLockBytes->SetSynchronMode( !pHandler ); + xLockBytes->SetSynchronMode( true ); Reference< XActiveDataControl > xSink; if ( eOpenMode & StreamMode::WRITE ) xSink = static_cast<XActiveDataControl*>(new UcbStreamer_Impl( xLockBytes )); diff --git a/unotools/source/ucbhelper/ucblockbytes.hxx b/unotools/source/ucbhelper/ucblockbytes.hxx index 1fd6f5afdd37..ae3dbb6c7d21 100644 --- a/unotools/source/ucbhelper/ucblockbytes.hxx +++ b/unotools/source/ucbhelper/ucblockbytes.hxx @@ -67,13 +67,6 @@ namespace utl class UcbLockBytes; typedef tools::SvRef<UcbLockBytes> UcbLockBytesRef; -class UcbLockBytesHandler : public SvRefBase -{ -public: - UcbLockBytesHandler() - {} -}; - class UcbLockBytes : public virtual SvLockBytes { osl::Condition m_aInitialized; @@ -103,8 +96,7 @@ public: static UcbLockBytesRef CreateLockBytes( const css::uno::Reference < css::ucb::XContent >& xContent, const css::uno::Sequence < css::beans::PropertyValue >& rProps, StreamMode eMode, - const css::uno::Reference < css::task::XInteractionHandler >& xInter, - UcbLockBytesHandler* pHandler=nullptr ); + const css::uno::Reference < css::task::XInteractionHandler >& xInter ); static UcbLockBytesRef CreateInputLockBytes( const css::uno::Reference < css::io::XInputStream >& xContent ); static UcbLockBytesRef CreateLockBytes( const css::uno::Reference < css::io::XStream >& xContent ); diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx index fbd7828ef9ed..51d4f65ef1e7 100644 --- a/unotools/source/ucbhelper/ucbstreamhelper.cxx +++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx @@ -42,7 +42,7 @@ namespace utl static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMode, const Reference < XInteractionHandler >& xInteractionHandler, - UcbLockBytesHandler* pHandler, bool bEnsureFileExists ) + bool bEnsureFileExists ) { SvStream* pStream = nullptr; Reference< XUniversalContentBroker > ucb( @@ -117,7 +117,7 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo rFileName, Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() ); xLockBytes = UcbLockBytes::CreateLockBytes( aContent.get(), Sequence < PropertyValue >(), - eOpenMode, xInteractionHandler, pHandler ); + eOpenMode, xInteractionHandler ); if ( xLockBytes.Is() ) { pStream = new SvStream( xLockBytes ); @@ -140,19 +140,19 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode ) { - return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), nullptr, true /* bEnsureFileExists */ ); + return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), true /* bEnsureFileExists */ ); } SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode, const Reference < XInteractionHandler >& xInteractionHandler ) { - return lcl_CreateStream( rFileName, eOpenMode, xInteractionHandler, nullptr, true /* bEnsureFileExists */ ); + return lcl_CreateStream( rFileName, eOpenMode, xInteractionHandler, true /* bEnsureFileExists */ ); } SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode, bool bFileExists ) { - return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), nullptr, !bFileExists ); + return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), !bFileExists ); } SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream ) |