diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-04-07 13:47:22 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-04-07 13:47:22 +0200 |
commit | 732c19b8f39c9bf3c5a23affa27895e3dd3dccbf (patch) | |
tree | 23c32c72b36ebd5957547dcae3714df373f2ef6c | |
parent | 2addd7f17a9d799042ef18992ad29b582de3d6d6 (diff) |
Clean up unused functions
Change-Id: Ic1ba88f99c3e0de0761a28b8ff0ca2e9416aecec
-rw-r--r-- | unotools/source/config/cmdoptions.cxx | 33 | ||||
-rw-r--r-- | unotools/source/config/configvaluecontainer.cxx | 1 | ||||
-rw-r--r-- | unotools/source/config/dynamicmenuoptions.cxx | 66 | ||||
-rw-r--r-- | unotools/source/config/extendedsecurityoptions.cxx | 13 | ||||
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 9 | ||||
-rw-r--r-- | unotools/source/config/moduleoptions.cxx | 11 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 19 | ||||
-rw-r--r-- | unotools/source/config/printwarningoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/searchopt.cxx | 9 | ||||
-rw-r--r-- | unotools/source/config/syslocaleoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/viewoptions.cxx | 169 | ||||
-rw-r--r-- | unotools/source/misc/componentresmodule.cxx | 8 | ||||
-rw-r--r-- | unotools/source/misc/sharedunocomponent.cxx | 11 |
13 files changed, 31 insertions, 322 deletions
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx index 0a2c869f7745..5051c9d41cea 100644 --- a/unotools/source/config/cmdoptions.cxx +++ b/unotools/source/config/cmdoptions.cxx @@ -75,38 +75,9 @@ class SvtCmdOptions m_aCommandHashMap.insert( CommandHashMap::value_type( aCmd, 0 ) ); } - // convert internal list to external format - // for using it on right menus really - // Notice: We build a property list with 4 entries and set it on result list then. - // The while-loop starts with pointer on internal member list lSetupEntries, change to - // lUserEntries then and stop after that with NULL! - // Separator entries will be packed in another way then normal entries! We define - // special strings "sEmpty" and "sSeparator" to perform too ... - Sequence< OUString > GetList() const - { - sal_Int32 nCount = (sal_Int32)m_aCommandHashMap.size(); - sal_Int32 nIndex = 0; - Sequence< OUString > aList( nCount ); - - CommandHashMap::const_iterator pEntry = m_aCommandHashMap.begin(); - while ( pEntry != m_aCommandHashMap.end() ) - aList[nIndex++] = pEntry->first; - - return aList; - } - private: - class CommandHashMap : public ::boost::unordered_map< OUString , - sal_Int32 , - OUStringHash , - ::std::equal_to< OUString > > - { - public: - inline void free() - { - CommandHashMap().swap( *this ); - } - }; + typedef boost::unordered_map<OUString, sal_Int32, OUStringHash> + CommandHashMap; CommandHashMap m_aCommandHashMap; }; diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx index 8f5bf6d81a6f..99a2e9710759 100644 --- a/unotools/source/config/configvaluecontainer.cxx +++ b/unotools/source/config/configvaluecontainer.cxx @@ -64,7 +64,6 @@ namespace utl const Type& getDataType( ) const { return aDataType; } bool operator == ( const NodeValueAccessor& rhs ) const; - bool operator != ( const NodeValueAccessor& rhs ) const { return !operator == ( rhs ); } }; NodeValueAccessor::NodeValueAccessor( const OUString& _rNodePath ) diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx index 6763595bbfa5..9ada991bb141 100644 --- a/unotools/source/config/dynamicmenuoptions.cxx +++ b/unotools/source/config/dynamicmenuoptions.cxx @@ -58,28 +58,12 @@ using namespace ::com::sun::star::beans; #define OFFSET_TARGETNAME 3 #define PATHPREFIX_SETUP OUString("m") -#define PATHPREFIX_USER OUString("u") /*-**************************************************************************************************************** @descr struct to hold information about one menu entry. ****************************************************************************************************************-*/ struct SvtDynMenuEntry { - public: - SvtDynMenuEntry() {}; - - SvtDynMenuEntry( const OUString& sNewURL , - const OUString& sNewTitle , - const OUString& sNewImageIdentifier , - const OUString& sNewTargetName ) - { - sURL = sNewURL; - sTitle = sNewTitle; - sImageIdentifier = sNewImageIdentifier; - sTargetName = sNewTargetName; - } - - public: OUString sName; OUString sURL; OUString sTitle; @@ -107,30 +91,6 @@ class SvtDynMenu } } - // append user specific menu entry - // We must find unique name for it by using special prefix - // and next count of user setted entries! - // Look for double menu entries here too ... may be some separator items are supeflous ... - void AppendUserEntry( SvtDynMenuEntry& rEntry ) - { - if( - ( lUserEntries.size() < 1 ) || - ( lUserEntries.rbegin()->sURL != rEntry.sURL ) - ) - { - rEntry.sName = PATHPREFIX_USER; - rEntry.sName += OUString::number( impl_getNextUserEntryNr() ); - lUserEntries.push_back( rEntry ); - } - } - - // the only way to free memory! - void Clear() - { - lSetupEntries.clear(); - lUserEntries.clear(); - } - // convert internal list to external format // for using it on right menus really // Notice: We build a property list with 4 entries and set it on result list then. @@ -186,32 +146,6 @@ class SvtDynMenu } private: - - // search for an entry named "ux" with x=[0..i] inside our menu - // which has set highest number x. So we can add another user entry. - sal_Int32 impl_getNextUserEntryNr() const - { - sal_Int32 nNr = 0; - for( vector< SvtDynMenuEntry >::const_iterator pItem =lUserEntries.begin(); - pItem!=lUserEntries.end(); - ++pItem ) - { - if( pItem->sName.startsWith( PATHPREFIX_USER ) ) - { - OUString sNr = pItem->sName.copy( 1, pItem->sName.getLength()-1 ); - sal_Int32 nCheckNr = sNr.toInt32(); - if( nCheckNr > nNr ) - nNr = nCheckNr; - } - } - // Attention: Code isn't prepared for recyling of unused fragmented numbers! - // If we reach end of sal_Int32 range ... we must stop further working ... - // But I think nobody expand a menu to more then 1000 ... 100000 ... entries ... or? - DBG_ASSERT( !(nNr>0x7fffffff), "Menu::impl_getNextUserEntryNr()\nUser count can be out of range next time ...\n" ); - return nNr; - } - - private: vector< SvtDynMenuEntry > lSetupEntries; vector< SvtDynMenuEntry > lUserEntries; }; diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx index 06f6445a4106..2610eeb0eda1 100644 --- a/unotools/source/config/extendedsecurityoptions.cxx +++ b/unotools/source/config/extendedsecurityoptions.cxx @@ -47,17 +47,8 @@ using namespace ::com::sun::star::uno; #define PROPERTYCOUNT 1 -class ExtensionHashMap : public ::boost::unordered_map< OUString, - sal_Int32, - OUStringHash, - ::std::equal_to< OUString > > -{ - public: - inline void free() - { - ExtensionHashMap().swap( *this ); - } -}; +typedef boost::unordered_map<OUString, sal_Int32, OUStringHash> + ExtensionHashMap; class SvtExtendedSecurityOptions_Impl : public ConfigItem { diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 1715e3ff8634..d84a6c5ee761 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <boost/noncopyable.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> @@ -132,14 +135,10 @@ SvtLinguOptions::SvtLinguOptions() } -class SvtLinguConfigItem : public utl::ConfigItem +class SvtLinguConfigItem: public utl::ConfigItem, private boost::noncopyable { SvtLinguOptions aOpt; - // disallow copy-constructor and assignment-operator for now - SvtLinguConfigItem( const SvtLinguConfigItem & ); - SvtLinguConfigItem & operator = ( const SvtLinguConfigItem & ); - static bool GetHdlByName( sal_Int32 &rnHdl, const OUString &rPropertyName, bool bFullPropName = false ); static const uno::Sequence< OUString > GetPropertyNames(); bool LoadOptions( const uno::Sequence< OUString > &rProperyNames ); diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx index 8e2e3c1059d0..7856e2ebf550 100644 --- a/unotools/source/config/moduleoptions.cxx +++ b/unotools/source/config/moduleoptions.cxx @@ -186,9 +186,7 @@ struct FactoryInfo // to control access on it! bool getInstalled () const { return bInstalled; }; OUString getFactory () const { return sFactory; }; - OUString getShortName () const { return sShortName; }; OUString getTemplateFile () const { return sTemplateFile; }; - OUString getWindowAttributes () const { return sWindowAttributes; }; OUString getDefaultFilter () const { return sDefaultFilter; }; bool isDefaultFilterReadonly() const { return bDefaultFilterReadonly; } sal_Int32 getIcon () const { return nIcon; }; @@ -227,15 +225,6 @@ struct FactoryInfo } }; - void setWindowAttributes( const OUString& sNewWindowAttributes ) - { - if( sWindowAttributes != sNewWindowAttributes ) - { - sWindowAttributes = sNewWindowAttributes; - bChangedWindowAttributes = true; - } - }; - void setDefaultFilter( const OUString& sNewDefaultFilter ) { if( sDefaultFilter != sNewDefaultFilter ) diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index e76bede72052..63a3fbce3394 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -72,23 +72,12 @@ enum VarNameProperty VAR_NEEDS_FILEURL }; -class NameToHandleMap : public ::boost::unordered_map< OUString, sal_Int32, OUStringHash, ::std::equal_to< OUString > > -{ - public: - inline void free() { NameToHandleMap().swap( *this ); } -}; +typedef boost::unordered_map<OUString, sal_Int32, OUStringHash> NameToHandleMap; -class EnumToHandleMap : public ::boost::unordered_map< sal_Int32, sal_Int32, boost::hash< sal_Int32 >, std::equal_to< sal_Int32 > > -{ - public: - inline void free() { EnumToHandleMap().swap( *this ); } -}; +typedef boost::unordered_map<sal_Int32, sal_Int32> EnumToHandleMap; -class VarNameToEnumMap : public ::boost::unordered_map< OUString, VarNameProperty, OUStringHash, ::std::equal_to< OUString > > -{ - public: - inline void free() { VarNameToEnumMap().swap( *this ); } -}; +typedef boost::unordered_map<OUString, VarNameProperty, OUStringHash> + VarNameToEnumMap; // class SvtPathOptions_Impl --------------------------------------------- class SvtPathOptions_Impl diff --git a/unotools/source/config/printwarningoptions.cxx b/unotools/source/config/printwarningoptions.cxx index 40faa76f5f42..8f7bfc5fcc2a 100644 --- a/unotools/source/config/printwarningoptions.cxx +++ b/unotools/source/config/printwarningoptions.cxx @@ -67,13 +67,11 @@ public: bool IsPaperSize() const { return m_bPaperSize; } bool IsPaperOrientation() const { return m_bPaperOrientation; } - bool IsNotFound() const { return m_bNotFound; } bool IsTransparency() const { return m_bTransparency; } bool IsModifyDocumentOnPrintingAllowed() const { return m_bModifyDocumentOnPrintingAllowed; } void SetPaperSize( bool bState ) { m_bPaperSize = bState; SetModified(); } void SetPaperOrientation( bool bState ) { m_bPaperOrientation = bState; SetModified(); } - void SetNotFound( bool bState ) { m_bNotFound = bState; SetModified(); } void SetTransparency( bool bState ) { m_bTransparency = bState; SetModified(); } void SetModifyDocumentOnPrintingAllowed( bool bState ) { m_bModifyDocumentOnPrintingAllowed = bState; SetModified(); } diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx index 638708221353..8f11a851edac 100644 --- a/unotools/source/config/searchopt.cxx +++ b/unotools/source/config/searchopt.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <boost/noncopyable.hpp> #include <unotools/searchopt.hxx> #include <tools/debug.hxx> #include <unotools/configitem.hxx> @@ -32,15 +35,11 @@ using namespace com::sun::star::i18n; #define MAX_FLAGS_OFFSET 26 -class SvtSearchOptions_Impl : public ConfigItem +class SvtSearchOptions_Impl: public ConfigItem, private boost::noncopyable { sal_Int32 nFlags; bool bModified; - // disallow copy-constructor and assignment-operator for now - SvtSearchOptions_Impl( const SvtSearchOptions_Impl & ); - SvtSearchOptions_Impl & operator = ( const SvtSearchOptions_Impl & ); - protected: bool IsModified() const { return bModified; } using ConfigItem::SetModified; diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 5179bab87fe1..c2fa6d515474 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -78,8 +78,6 @@ public: { return m_aLocaleString; } void SetLocaleString( const OUString& rStr ); - const OUString& GetUILocaleString() const - { return m_aUILocaleString; } void SetUILocaleString( const OUString& rStr ); const OUString& GetCurrencyString() const diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index 8f5e116384b8..fbc5e37a49fc 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -44,11 +44,6 @@ #define PROPERTY_VISIBLE "Visible" #define PROPERTY_USERDATA "UserData" -#define DEFAULT_WINDOWSTATE OUString() -#define DEFAULT_USERDATA css::uno::Sequence< css::beans::NamedValue >() -#define DEFAULT_PAGEID 0 -#define DEFAULT_VISIBLE false - //#define DEBUG_VIEWOPTIONS #ifdef DEBUG_VIEWOPTIONS @@ -70,162 +65,14 @@ // initialization! -SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_Dialogs = NULL; -sal_Int32 SvtViewOptions::m_nRefCount_Dialogs = 0; -SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_TabDialogs = NULL; -sal_Int32 SvtViewOptions::m_nRefCount_TabDialogs = 0; -SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_TabPages = NULL; -sal_Int32 SvtViewOptions::m_nRefCount_TabPages = 0; -SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_Windows = NULL; -sal_Int32 SvtViewOptions::m_nRefCount_Windows = 0; - -// private declarations! - -/*-************************************************************************************************************ - @descr declare one configuration item - These struct hold information about one view item. But not all member are used for all entries! - User must decide which information are useful and which not. We are a container iztem only and doesn't - know anything about the context. - But; we support a feature: - decision between items with default values (should not really exist in configuration!) - and items with real values - changed by user. So user can suppress saving of really unused items - to disk - because; defaulted items could be restored on runtime without reading from disk!!! - And if only items with valid information was written to cfg - we mustn't read so much and save time. - So we start with an member m_bDefault=True and reset it to False after first set-call. - Deficiencies of these solution - we cant allow direct read/write access to our member. We must - support it by set/get-methods ... -*//*-*************************************************************************************************************/ -class IMPL_TViewData -{ - public: - - // create "default" item - IMPL_TViewData() - { - m_sWindowState = DEFAULT_WINDOWSTATE; - m_lUserData = DEFAULT_USERDATA; - m_nPageID = DEFAULT_PAGEID; - m_bVisible = DEFAULT_VISIBLE; - - m_bDefault = true; - } - - // write access - with reseting of default state - void setWindowState( const OUString& sValue ) - { - m_bDefault = ( - m_bDefault && - ( sValue == DEFAULT_WINDOWSTATE ) - ); - m_sWindowState = sValue; - } - - void setUserData( const css::uno::Sequence< css::beans::NamedValue >& lValue ) - { - m_bDefault = ( - m_bDefault && - ( lValue == DEFAULT_USERDATA ) - ); - m_lUserData = lValue; - } - - void setPageID( sal_Int32 nValue ) - { - m_bDefault = ( - m_bDefault && - ( nValue == DEFAULT_PAGEID ) - ); - m_nPageID = nValue; - } - - void setVisible( bool bValue ) - { - m_bDefault = ( - m_bDefault && - ( bValue == DEFAULT_VISIBLE ) - ); - m_bVisible = bValue; - } - - // read access - OUString getWindowState() { return m_sWindowState; } - css::uno::Sequence< css::beans::NamedValue > getUserData () { return m_lUserData; } - sal_Int32 getPageID () { return m_nPageID; } - bool getVisible () { return m_bVisible; } - - // special operation for easy access on user data - void setUserItem( const OUString& sName , - const css::uno::Any& aValue ) - { - // we change UserData in every case! - // a) we change already existing item - // or b) we add a new one - m_bDefault = false; - - bool bExist = false; - sal_Int32 nCount = m_lUserData.getLength(); - - // change it, if it already exist ... - for( sal_Int32 nStep=0; nStep<nCount; ++nStep ) - { - if( m_lUserData[nStep].Name == sName ) - { - m_lUserData[nStep].Value = aValue; - bExist = true; - break; - } - } - - // ... or create new list item - if( !bExist ) - { - m_lUserData.realloc( nCount+1 ); - m_lUserData[nCount].Name = sName; - m_lUserData[nCount].Value = aValue; - } - } - - css::uno::Any getUserItem( const OUString& sName ) - { - // default value - if item not exist! - css::uno::Any aValue; - - sal_Int32 nCount = m_lUserData.getLength(); - for( sal_Int32 nStep=0; nStep<nCount; ++nStep ) - { - if( m_lUserData[nStep].Name == sName ) - { - aValue = m_lUserData[nStep].Value; - break; - } - } - return aValue; - } - - // check for default items - bool isDefault() { return m_bDefault; } - - private: - OUString m_sWindowState; - css::uno::Sequence< css::beans::NamedValue > m_lUserData; - sal_Int32 m_nPageID; - bool m_bVisible; - - bool m_bDefault; -}; - -struct IMPL_TStringHashCode -{ - size_t operator()(const OUString& sString) const - { - return sString.hashCode(); - } -}; - -typedef ::boost::unordered_map< OUString , - IMPL_TViewData , - IMPL_TStringHashCode , - ::std::equal_to< OUString > > IMPL_TViewHash; +SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_Dialogs = NULL ; +sal_Int32 SvtViewOptions::m_nRefCount_Dialogs = 0 ; +SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_TabDialogs = NULL ; +sal_Int32 SvtViewOptions::m_nRefCount_TabDialogs = 0 ; +SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_TabPages = NULL ; +sal_Int32 SvtViewOptions::m_nRefCount_TabPages = 0 ; +SvtViewOptionsBase_Impl* SvtViewOptions::m_pDataContainer_Windows = NULL ; +sal_Int32 SvtViewOptions::m_nRefCount_Windows = 0 ; /*-************************************************************************************************************ @descr Implement base data container for view options elements. diff --git a/unotools/source/misc/componentresmodule.cxx b/unotools/source/misc/componentresmodule.cxx index 99292a9205d3..5d6fc7644ee0 100644 --- a/unotools/source/misc/componentresmodule.cxx +++ b/unotools/source/misc/componentresmodule.cxx @@ -19,6 +19,7 @@ #include <unotools/componentresmodule.hxx> +#include <boost/noncopyable.hpp> #include <tools/resmgr.hxx> #include <osl/diagnose.h> #include <rtl/strbuf.hxx> @@ -32,7 +33,7 @@ namespace utl not threadsafe! */ - class OComponentResModuleImpl + class OComponentResModuleImpl: private boost::noncopyable { private: ResMgr* m_pResources; @@ -59,11 +60,6 @@ namespace utl /** retrieves our resource manager */ ResMgr* getResManager(); - - private: - OComponentResModuleImpl(); // never implemented - OComponentResModuleImpl( const OComponentResModuleImpl& ); // never implemented - OComponentResModuleImpl& operator=( const OComponentResModuleImpl& ); // never implemented }; void OComponentResModuleImpl::freeResManager() diff --git a/unotools/source/misc/sharedunocomponent.cxx b/unotools/source/misc/sharedunocomponent.cxx index e4c19a5a944a..6c4595c3aa39 100644 --- a/unotools/source/misc/sharedunocomponent.cxx +++ b/unotools/source/misc/sharedunocomponent.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <boost/noncopyable.hpp> #include <unotools/sharedunocomponent.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/util/XCloseable.hpp> @@ -63,7 +66,8 @@ namespace utl typedef ::cppu::WeakImplHelper1 < XCloseListener > CloseableComponentImpl_Base; - class CloseableComponentImpl : public CloseableComponentImpl_Base + class CloseableComponentImpl: + public CloseableComponentImpl_Base, private boost::noncopyable { private: Reference< XCloseable > m_xCloseable; @@ -96,11 +100,6 @@ namespace utl @nofail */ void impl_nf_switchListening( bool _bListen ); - - private: - CloseableComponentImpl(); // never implemented - CloseableComponentImpl( const CloseableComponentImpl& ); // never implemented - CloseableComponentImpl& operator=( const CloseableComponentImpl& ); // never implemented }; CloseableComponentImpl::CloseableComponentImpl( const Reference< XInterface >& _rxComponent ) |