diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-16 10:11:04 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-18 10:03:44 +0000 |
commit | 2c8fe2e737b84ecd3dbac36a4fe6bd061bbd3bae (patch) | |
tree | 66ba7ff0b95cf5ceeda5e53294a71c6786460eb3 /svtools/source | |
parent | 4e59eecc077d27dd9762e7c890b2aaf92a212959 (diff) |
update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.
Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/config/accessibilityoptions.cxx | 175 | ||||
-rw-r--r-- | svtools/source/config/menuoptions.cxx | 31 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 14 | ||||
-rw-r--r-- | svtools/source/control/stdmenu.cxx | 219 | ||||
-rw-r--r-- | svtools/source/dialogs/ServerDetailsControls.cxx | 5 |
5 files changed, 0 insertions, 444 deletions
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx index 67ab1606198d..553b6fd244ee 100644 --- a/svtools/source/config/accessibilityoptions.cxx +++ b/svtools/source/config/accessibilityoptions.cxx @@ -46,7 +46,6 @@ using namespace com::sun::star::uno; namespace { const char s_sAccessibility[] = "org.openoffice.Office.Common/Accessibility"; - const char s_sAutoDetectSystemHC[] = "AutoDetectSystemHC"; const char s_sIsForPagePreviews[] = "IsForPagePreviews"; const char s_sIsHelpTipsDisappear[] = "IsHelpTipsDisappear"; const char s_sHelpTipSeconds[] = "HelpTipSeconds"; @@ -73,7 +72,6 @@ public: ~SvtAccessibilityOptions_Impl(); void SetVCLSettings(); - bool GetAutoDetectSystemHC(); bool GetIsForPagePreviews() const; bool GetIsHelpTipsDisappear() const; bool GetIsAllowAnimatedGraphics() const; @@ -85,13 +83,6 @@ public: sal_Int16 GetListBoxMaximumLineCount() const; sal_Int16 GetColorValueSetColumnCount() const; bool GetPreviewUsesCheckeredBackground() const; - - void SetAutoDetectSystemHC(bool bSet); - void SetIsForPagePreviews(bool bSet); - void SetIsAllowAnimatedGraphics(bool bSet); - void SetIsAllowAnimatedText(bool bSet); - void SetIsAutomaticFontColor(bool bSet); - void SetSelectionInReadonly(bool bSet); }; // initialization of static members -------------------------------------- @@ -133,24 +124,6 @@ SvtAccessibilityOptions_Impl::~SvtAccessibilityOptions_Impl() } -bool SvtAccessibilityOptions_Impl::GetAutoDetectSystemHC() -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - bool bRet = true; - - try - { - if(xNode.is()) - xNode->getPropertyValue(s_sAutoDetectSystemHC) >>= bRet; - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } - - return bRet; -} - bool SvtAccessibilityOptions_Impl::GetIsForPagePreviews() const { css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); @@ -348,126 +321,6 @@ bool SvtAccessibilityOptions_Impl::GetPreviewUsesCheckeredBackground() const return bRet; } -void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(bool bSet) -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - - try - { - if(xNode.is() && xNode->getPropertyValue(s_sAutoDetectSystemHC)!=bSet) - { - xNode->setPropertyValue(s_sAutoDetectSystemHC, css::uno::makeAny(bSet)); - ::comphelper::ConfigurationHelper::flush(m_xCfg); - svtools::ColorConfig().Reload(); - bIsModified = true; - } - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } -} - -void SvtAccessibilityOptions_Impl::SetIsForPagePreviews(bool bSet) -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - - try - { - if(xNode.is() && xNode->getPropertyValue(s_sIsForPagePreviews)!=bSet) - { - xNode->setPropertyValue(s_sIsForPagePreviews, css::uno::makeAny(bSet)); - ::comphelper::ConfigurationHelper::flush(m_xCfg); - - bIsModified = true; - } - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } -} - -void SvtAccessibilityOptions_Impl::SetIsAllowAnimatedGraphics(bool bSet) -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - - try - { - if(xNode.is() && xNode->getPropertyValue(s_sIsAllowAnimatedGraphics)!=bSet) - { - xNode->setPropertyValue(s_sIsAllowAnimatedGraphics, css::uno::makeAny(bSet)); - ::comphelper::ConfigurationHelper::flush(m_xCfg); - - bIsModified = true; - } - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } -} - -void SvtAccessibilityOptions_Impl::SetIsAllowAnimatedText(bool bSet) -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - - try - { - if(xNode.is() && xNode->getPropertyValue(s_sIsAllowAnimatedText)!=bSet) - { - xNode->setPropertyValue(s_sIsAllowAnimatedText, css::uno::makeAny(bSet)); - ::comphelper::ConfigurationHelper::flush(m_xCfg); - - bIsModified = true; - } - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } -} - -void SvtAccessibilityOptions_Impl::SetIsAutomaticFontColor(bool bSet) -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - - try - { - if(xNode.is() && xNode->getPropertyValue(s_sIsAutomaticFontColor)!=bSet) - { - xNode->setPropertyValue(s_sIsAutomaticFontColor, css::uno::makeAny(bSet)); - ::comphelper::ConfigurationHelper::flush(m_xCfg); - - bIsModified = true; - } - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } -} - -void SvtAccessibilityOptions_Impl::SetSelectionInReadonly(bool bSet) -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - - try - { - if(xNode.is() && xNode->getPropertyValue(s_sIsSelectionInReadonly)!=bSet) - { - xNode->setPropertyValue(s_sIsSelectionInReadonly, css::uno::makeAny(bSet)); - ::comphelper::ConfigurationHelper::flush(m_xCfg); - - bIsModified = true; - } - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex.Message); - } -} - void SvtAccessibilityOptions_Impl::SetVCLSettings() { AllSettings aAllSettings(Application::GetSettings()); @@ -566,10 +419,6 @@ void SvtAccessibilityOptions::Notify( SfxBroadcaster&, const SfxHint& rHint ) } -bool SvtAccessibilityOptions::GetAutoDetectSystemHC() const -{ - return sm_pSingleImplConfig->GetAutoDetectSystemHC(); -} bool SvtAccessibilityOptions::GetIsForPagePreviews() const { return sm_pSingleImplConfig->GetIsForPagePreviews(); @@ -592,30 +441,6 @@ bool SvtAccessibilityOptions::IsSelectionInReadonly() const } -void SvtAccessibilityOptions::SetAutoDetectSystemHC(bool bSet) -{ - sm_pSingleImplConfig->SetAutoDetectSystemHC(bSet); -} -void SvtAccessibilityOptions::SetIsForPagePreviews(bool bSet) -{ - sm_pSingleImplConfig->SetIsForPagePreviews(bSet); -} -void SvtAccessibilityOptions::SetIsAllowAnimatedGraphics(bool bSet) -{ - sm_pSingleImplConfig->SetIsAllowAnimatedGraphics(bSet); -} -void SvtAccessibilityOptions::SetIsAllowAnimatedText(bool bSet) -{ - sm_pSingleImplConfig->SetIsAllowAnimatedText(bSet); -} -void SvtAccessibilityOptions::SetIsAutomaticFontColor(bool bSet) -{ - sm_pSingleImplConfig->SetIsAutomaticFontColor(bSet); -} -void SvtAccessibilityOptions::SetSelectionInReadonly(bool bSet) -{ - sm_pSingleImplConfig->SetSelectionInReadonly(bSet); -} void SvtAccessibilityOptions::SetVCLSettings() { sm_pSingleImplConfig->SetVCLSettings(); diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 7146b230f66e..fc64447642a2 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -69,7 +69,6 @@ class SvtMenuOptions_Impl : public ConfigItem private: - ::std::list<Link<LinkParamNone*,void>> aList; bool m_bDontHideDisabledEntries ; /// cache "DontHideDisabledEntries" of Menu section bool m_bFollowMouse ; /// cache "FollowMouse" of Menu section TriState m_eMenuIcons ; /// cache "MenuIcons" of Menu section @@ -87,10 +86,6 @@ class SvtMenuOptions_Impl : public ConfigItem SvtMenuOptions_Impl(); virtual ~SvtMenuOptions_Impl(); - void AddListenerLink( const Link<LinkParamNone*,void>& rLink ); - void RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ); - - // override methods of baseclass @@ -126,8 +121,6 @@ class SvtMenuOptions_Impl : public ConfigItem { m_eMenuIcons = eState; SetModified(); - for ( ::std::list<Link<LinkParamNone*,void>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter ) - iter->Call( nullptr ); // tdf#93451: don't Commit() here, it's too early } @@ -281,9 +274,6 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) if ( bMenuSettingsChanged ) m_eMenuIcons = bSystemMenuIcons ? TRISTATE_INDET : static_cast<TriState>(bMenuIcons); - - for ( ::std::list<Link<LinkParamNone*,void>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter ) - iter->Call( nullptr ); } @@ -344,17 +334,6 @@ Sequence< OUString > SvtMenuOptions_Impl::impl_GetPropertyNames() return seqPropertyNames; } -void SvtMenuOptions_Impl::AddListenerLink( const Link<LinkParamNone*,void>& rLink ) -{ - aList.push_back( rLink ); -} - -void SvtMenuOptions_Impl::RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ) -{ - aList.erase(std::remove(aList.begin(), aList.end(), rLink), aList.end()); -} - - // initialize static member // DON'T DO IT IN YOUR HEADER! // see definition for further information @@ -450,14 +429,4 @@ Mutex& SvtMenuOptions::GetOwnStaticMutex() return *pMutex; } -void SvtMenuOptions::AddListenerLink( const Link<LinkParamNone*,void>& rLink ) -{ - m_pDataContainer->AddListenerLink( rLink ); -} - -void SvtMenuOptions::RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ) -{ - m_pDataContainer->RemoveListenerLink( rLink ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 98555b7b0db1..a3a0d1ec9d11 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -859,20 +859,6 @@ VCL_BUILDER_DECL_FACTORY(SvtURLBox) } -SvtURLBox::SvtURLBox( vcl::Window* pParent, const ResId& _rResId, INetProtocol eSmart, - bool bSetDefaultHelpID ) - : ComboBox( pParent , _rResId ), - eSmartProtocol( eSmart ), - bAutoCompleteMode( false ), - bOnlyDirectories( false ), - bCtrlClick( false ), - bHistoryDisabled( false ), - bNoSelection( false ), - bIsAutoCompleteEnabled( true ) -{ - Init(bSetDefaultHelpID); -} - void SvtURLBox::Init(bool bSetDefaultHelpID) { pImp = new SvtURLBox_Impl(); diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx deleted file mode 100644 index d2e972e2eec0..000000000000 --- a/svtools/source/control/stdmenu.cxx +++ /dev/null @@ -1,219 +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 <string.h> -#include <vcl/svapp.hxx> -#include <vcl/settings.hxx> -#include <vcl/i18nhelp.hxx> -#include <svtools/ctrltool.hxx> -#include <svtools/stdmenu.hxx> - -FontNameMenu::FontNameMenu() -{ - SetMenuFlags( GetMenuFlags() | MenuFlags::NoAutoMnemonics ); -} - -FontNameMenu::~FontNameMenu() -{ -} - -void FontNameMenu::Select() -{ - maCurName = GetItemText( GetCurItemId() ); - maSelectHdl.Call( this ); -} - -void FontNameMenu::Highlight() -{ -} - -void FontNameMenu::Fill( const FontList* pList ) -{ - // clear menu - Clear(); - - // add fonts - if (pList) - { - const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - // more than 100 fonts reduces the speed of opening the menu. - // So only the first 100 fonts will be displayed. - size_t nFontCount = ::std::min<size_t>(pList->GetFontNameCount(), 100); - for (size_t i = 0; i < nFontCount; ++i) - { - const OUString& rName = pList->GetFontName( i ).GetFamilyName(); - - // sort with the I18nHelper - sal_uInt16 j = GetItemCount(); - while ( j ) - { - OUString aText = GetItemText( GetItemId( j-1 ) ); - if ( rI18nHelper.CompareString( rName, aText ) > 0 ) - break; - j--; - } - InsertItem( i+1, rName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK, OString(), j ); - } - } - - SetCurName( maCurName ); -} - -void FontNameMenu::SetCurName(const OUString& rName) -{ - maCurName = rName; - - // check menu entry - sal_uInt16 nChecked = 0; - sal_uInt16 nItemCount = GetItemCount(); - for( sal_uInt16 i = 0; i < nItemCount; i++ ) - { - sal_uInt16 nItemId = GetItemId( i ); - - if ( IsItemChecked( nItemId ) ) - nChecked = nItemId; - - OUString aText = GetItemText( nItemId ); - if ( aText == maCurName ) - { - CheckItem( nItemId ); - return; - } - } - - if ( nChecked ) - CheckItem( nChecked, false ); -} - -FontSizeMenu::FontSizeMenu() -: mpHeightAry( nullptr ) -, mnCurHeight( 100 ) -{ - SetMenuFlags( GetMenuFlags() | MenuFlags::NoAutoMnemonics ); -} - -FontSizeMenu::~FontSizeMenu() -{ - if ( mpHeightAry ) - delete[] mpHeightAry; -} - -void FontSizeMenu::Select() -{ - const sal_uInt16 nCurItemId = GetCurItemId(); - mnCurHeight = mpHeightAry[ nCurItemId - 1 ]; - maSelectHdl.Call( this ); -} - -void FontSizeMenu::Highlight() -{ -} - -void FontSizeMenu::Fill( const FontMetric& rFontMetric, const FontList* pList ) -{ - Clear(); - - // setup font size array - if ( mpHeightAry ) - delete[] mpHeightAry; - - const sal_IntPtr* pTempAry; - const sal_IntPtr* pAry = pList->GetSizeAry( rFontMetric ); - sal_uInt16 nSizeCount = 0; - while ( pAry[nSizeCount] ) - nSizeCount++; - - sal_uInt16 nPos = 0; - - // first insert font size names (for simplified/traditional chinese) - FontSizeNames aFontSizeNames( Application::GetSettings().GetUILanguageTag().getLanguageType() ); - mpHeightAry = new long[nSizeCount+aFontSizeNames.Count()]; - if ( !aFontSizeNames.IsEmpty() ) - { - if ( pAry == FontList::GetStdSizeAry() ) - { - // for scalable fonts all font size names - sal_uLong nCount = aFontSizeNames.Count(); - for( sal_uLong i = 0; i < nCount; i++ ) - { - OUString aSizeName = aFontSizeNames.GetIndexName( i ); - long nSize = aFontSizeNames.GetIndexSize( i ); - mpHeightAry[nPos] = nSize; - nPos++; // Id is nPos+1 - InsertItem( nPos, aSizeName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK ); - } - } - else - { - // for fixed size fonts only selectable font size names - pTempAry = pAry; - while ( *pTempAry ) - { - OUString aSizeName = aFontSizeNames.Size2Name( *pTempAry ); - if ( !aSizeName.isEmpty() ) - { - mpHeightAry[nPos] = *pTempAry; - nPos++; // Id is nPos+1 - InsertItem( nPos, aSizeName, MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK ); - } - pTempAry++; - } - } - } - - // then insert numerical font size values - const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - pTempAry = pAry; - while ( *pTempAry ) - { - mpHeightAry[nPos] = *pTempAry; - nPos++; // Id is nPos+1 - InsertItem( nPos, rI18nHelper.GetNum( *pTempAry, 1, true, false ), MenuItemBits::RADIOCHECK | MenuItemBits::AUTOCHECK ); - pTempAry++; - } - - SetCurHeight( mnCurHeight ); -} - -void FontSizeMenu::SetCurHeight( long nHeight ) -{ - mnCurHeight = nHeight; - - // check menu item - sal_uInt16 nChecked = 0; - sal_uInt16 nItemCount = GetItemCount(); - for( sal_uInt16 i = 0; i < nItemCount; i++ ) - { - sal_uInt16 nItemId = GetItemId( i ); - - if ( mpHeightAry[i] == nHeight ) - { - CheckItem( nItemId ); - return; - } - - if ( IsItemChecked( nItemId ) ) - nChecked = nItemId; - } - - if ( nChecked ) - CheckItem( nChecked, false ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 99eb2f54e81c..be071d5c52f4 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -76,11 +76,6 @@ void DetailsContainer::notifyChange( ) m_aChangeHdl.Call( this ); } -void DetailsContainer::setActive( bool bActive ) -{ - m_bIsActive = bActive; -} - IMPL_LINK_NOARG_TYPED( DetailsContainer, ValueChangeHdl, Edit&, void ) { notifyChange( ); |