From 7da765dde1800aa607f96e7a5807582ad2894acb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 27 Oct 2016 10:21:42 +0200 Subject: loplugin:expandablemethods in svtools Change-Id: I126cc87c890867c3e762f86969a20d64aef63108 Reviewed-on: https://gerrit.libreoffice.org/30314 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/brwbox/brwbox2.cxx | 2 +- svtools/source/config/extcolorcfg.cxx | 8 +---- svtools/source/contnr/fileview.cxx | 24 ++++++-------- svtools/source/contnr/imivctl.hxx | 3 -- svtools/source/contnr/imivctl1.cxx | 11 ++----- svtools/source/contnr/simptabl.cxx | 20 +++++------- svtools/source/contnr/svimpbox.cxx | 7 +---- svtools/source/contnr/treelistbox.cxx | 22 ++----------- svtools/source/control/accessibleruler.cxx | 2 +- svtools/source/control/calendar.cxx | 7 +---- svtools/source/control/filectrl.cxx | 7 +---- svtools/source/control/toolbarmenu.cxx | 8 +---- svtools/source/control/toolbarmenuacc.cxx | 19 ++++------- svtools/source/control/toolbarmenuimp.hxx | 3 -- svtools/source/dialogs/PlaceEditDialog.cxx | 49 +++++++++++++---------------- svtools/source/dialogs/addresstemplate.cxx | 9 +----- svtools/source/dialogs/wizdlg.cxx | 7 +---- svtools/source/graphic/descriptor.cxx | 19 ++--------- svtools/source/graphic/descriptor.hxx | 3 -- svtools/source/graphic/graphic.cxx | 17 ++-------- svtools/source/graphic/graphic.hxx | 2 -- svtools/source/graphic/grfmgr.cxx | 18 +++++------ svtools/source/inc/svimpbox.hxx | 3 -- svtools/source/inc/unoiface.hxx | 3 +- svtools/source/misc/dialogcontrolling.cxx | 11 ++----- svtools/source/misc/templatefoldercache.cxx | 9 +----- svtools/source/table/tabledatawindow.cxx | 5 --- svtools/source/table/tabledatawindow.hxx | 2 -- svtools/source/uno/unoevent.cxx | 13 ++------ svtools/source/uno/unoiface.cxx | 2 +- 30 files changed, 80 insertions(+), 235 deletions(-) (limited to 'svtools') diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index cfc4ab9b6320..e1f12bc91b38 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1600,7 +1600,7 @@ void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt ) SelectAll(); } else - SelectColumnId( rEvt.GetColumnId(), true, false ); + SelectColumnPos( GetColumnPos(rEvt.GetColumnId()), true, false); } // turn cursor on again, if necessary diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 96e61e566572..3fd760171bc1 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -125,7 +125,6 @@ public: static void DisableBroadcast(); static void EnableBroadcast(); - static bool IsEnableBroadcast(); static void LockBroadcast(); static void UnlockBroadcast(); @@ -224,11 +223,6 @@ void ExtendedColorConfig_Impl::EnableBroadcast() ExtendedColorConfig::m_pImpl->m_bIsBroadcastEnabled = true; } -bool ExtendedColorConfig_Impl::IsEnableBroadcast() -{ - return ExtendedColorConfig::m_pImpl && ExtendedColorConfig::m_pImpl->m_bIsBroadcastEnabled; -} - void lcl_addString(uno::Sequence < OUString >& _rSeq,const OUString& _sAdd) { OUString* pIter = _rSeq.getArray(); @@ -516,7 +510,7 @@ void ExtendedColorConfig_Impl::UnlockBroadcast() m_bBroadcastWhenUnlocked = ExtendedColorConfig::m_pImpl != nullptr; if ( m_bBroadcastWhenUnlocked ) { - if ( ExtendedColorConfig_Impl::IsEnableBroadcast() ) + if ( ExtendedColorConfig::m_pImpl && ExtendedColorConfig::m_pImpl->m_bIsBroadcastEnabled ) { m_bBroadcastWhenUnlocked = false; ExtendedColorConfig::m_pImpl->Broadcast(SfxHint(SFX_HINT_COLORS_CHANGED)); diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 6343ae7b57ce..76f1ea59a7ce 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -219,7 +219,6 @@ protected: private: std::unordered_map m_Translation; const OUString maTransFileName; - void Init(); // reads the translation file and fills the (internal) list public: explicit NameTranslationList( const INetURLObject& rBaseURL ); @@ -239,13 +238,17 @@ inline const OUString& NameTranslationList::GetTransTableFileName() const return maTransFileName; } -void NameTranslationList::Init() +NameTranslationList::NameTranslationList( const INetURLObject& rBaseURL ): + maTransFile( rBaseURL ), + m_HashedURL(rBaseURL.GetMainURL(INetURLObject::NO_DECODE)), + maTransFileName( OUString(".nametranslation.table") ) { -// Tries to read the file ".nametranslation.table" in the base folder. Complete path/name is in maTransFile. -// Further on, the found entries in the section "TRANSLATIONNAMES" are used to replace names in the -// base folder by translated ones. The translation must be given in UTF8 -// See examples of such a files in the samples-folder of an Office installation + maTransFile.insertName( maTransFileName ); + // Tries to read the file ".nametranslation.table" in the base folder. Complete path/name is in maTransFile. + // Further on, the found entries in the section "TRANSLATIONNAMES" are used to replace names in the + // base folder by translated ones. The translation must be given in UTF8 + // See examples of such a files in the samples-folder of an Office installation try { ::ucbhelper::Content aTestContent( maTransFile.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() ); @@ -272,15 +275,6 @@ void NameTranslationList::Init() catch( Exception const & ) {} } -NameTranslationList::NameTranslationList( const INetURLObject& rBaseURL ): - maTransFile( rBaseURL ), - m_HashedURL(rBaseURL.GetMainURL(INetURLObject::NO_DECODE)), - maTransFileName( OUString(".nametranslation.table") ) -{ - maTransFile.insertName( maTransFileName ); - Init(); -} - const OUString* NameTranslationList::Translate( const OUString& rName ) const { auto const iter(m_Translation.find(rName)); diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 4bac273fcddd..85ea19ac93bf 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -247,7 +247,6 @@ class SvxIconChoiceCtrl_Impl void Center( SvxIconChoiceCtrlEntry* pEntry ) const; void StopEditTimer() { aEditIdle.Stop(); } void StartEditTimer() { aEditIdle.Start(); } - void ImpHideDDIcon(); void CallSelectHandler( SvxIconChoiceCtrlEntry* ); void SelectRect( SvxIconChoiceCtrlEntry* pEntry1, @@ -478,8 +477,6 @@ public: void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& ); const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const; - Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); } - void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry, bool bKeepHighlightFlags diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 82b8af5d4368..a07194f177b3 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -2016,24 +2016,19 @@ void SvxIconChoiceCtrl_Impl::ShowCursor( bool bShow ) void SvxIconChoiceCtrl_Impl::HideDDIcon() { pView->Update(); - ImpHideDDIcon(); - pDDBufDev = pDDDev; - pDDDev = nullptr; -} - -void SvxIconChoiceCtrl_Impl::ImpHideDDIcon() -{ if( pDDDev ) { Size aSize( pDDDev->GetOutputSizePixel() ); // restore pView pView->DrawOutDev( aDDLastRectPos, aSize, Point(), aSize, *pDDDev ); } + pDDBufDev = pDDDev; + pDDDev = nullptr; } bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) { - Rectangle aDocRect( GetDocumentRect() ); + Rectangle aDocRect( Point(), aVirtOutputSize ); Rectangle aVisRect( GetOutputRect() ); if( aVisRect.IsInside( aDocRect )) return false; diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx index 0652388e3679..966596f6e218 100644 --- a/svtools/source/contnr/simptabl.cxx +++ b/svtools/source/contnr/simptabl.cxx @@ -344,17 +344,6 @@ void SvSimpleTable::HBarClick() } } -void SvSimpleTable::HBarStartDrag() -{ - if(!aHeaderBar->IsItemMode()) - { - Rectangle aSizeRect(Point(0,0), - SvHeaderTabListBox::GetOutputSizePixel()); - aSizeRect.Left()=-GetXOffset()+aHeaderBar->GetDragPos(); - aSizeRect.Right()=-GetXOffset()+aHeaderBar->GetDragPos(); - ShowTracking( aSizeRect, ShowTrackFlags::Split ); - } -} void SvSimpleTable::HBarDrag() { HideTracking(); @@ -403,7 +392,14 @@ IMPL_LINK( SvSimpleTable, StartDragHdl, HeaderBar*, pCtr, void) { if(pCtr==aHeaderBar.get()) { - HBarStartDrag(); + if(!aHeaderBar->IsItemMode()) + { + Rectangle aSizeRect(Point(0,0), + SvHeaderTabListBox::GetOutputSizePixel()); + aSizeRect.Left()=-GetXOffset()+aHeaderBar->GetDragPos(); + aSizeRect.Right()=-GetXOffset()+aHeaderBar->GetDragPos(); + ShowTracking( aSizeRect, ShowTrackFlags::Split ); + } } } diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 605d227997f5..6cd671b9f5f6 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -2194,7 +2194,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) { // only try to expand if sublist is expandable, // otherwise ignore the key press - if( IsNowExpandable() ) + if( IsExpandable() && !pView->IsExpanded( pCursor ) ) pView->Expand( pCursor ); } else if ( bIsCellFocusEnabled && pCursor ) @@ -3306,11 +3306,6 @@ bool SvImpLBox::IsExpandable() const return pCursor->HasChildren() || pCursor->HasChildrenOnDemand(); } -bool SvImpLBox::IsNowExpandable() const -{ - return IsExpandable() && !pView->IsExpanded( pCursor ); -} - IMPL_LINK(SvImpLBox, MyUserEvent, void*, pArg, void ) { nCurUserEvent = nullptr; diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index d025ee62344b..6ab4ab76bf98 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -602,11 +602,6 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar } // return: all entries were moved -bool SvTreeListBox::MoveSelection( SvTreeListBox* pSource, SvTreeListEntry* pTarget ) -{ - return MoveSelectionCopyFallbackPossible( pSource, pTarget, false ); -} - bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, SvTreeListEntry* pTarget, bool bAllowCopyFallback ) { nCurEntrySelPos = 0; // selection counter for NotifyMoving/Copying @@ -917,7 +912,7 @@ IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl, SvInplaceEdit2&, void) aStr = pEdCtrl->GetText(); else aStr = pEdCtrl->GetSavedValue(); - if ( IsEmptyTextAllowed() || !aStr.isEmpty() ) + if ( mpImpl->m_bIsEmptyTextAllowed || !aStr.isEmpty() ) EditedText( aStr ); // Hide may only be called after the new text was put into the entry, so // that we don't call the selection handler in the GetFocus of the listbox @@ -942,11 +937,6 @@ void SvTreeListBox::EndEditing( bool bCancel ) } -bool SvTreeListBox::IsEmptyTextAllowed() const -{ - return mpImpl->m_bIsEmptyTextAllowed; -} - void SvTreeListBox::ForbidEmptyText() { mpImpl->m_bIsEmptyTextAllowed = false; @@ -1141,7 +1131,7 @@ sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox } else if( DND_ACTION_MOVE == rEvt.mnAction ) { - if (MoveSelection(g_pDDSource, pTarget)) + if (MoveSelectionCopyFallbackPossible( g_pDDSource, pTarget, false )) nRet = rEvt.mnAction; } else if( DND_ACTION_COPYMOVE == rEvt.mnAction ) @@ -2156,11 +2146,6 @@ short SvTreeListBox::GetHeightOffset(const Image& rBmp, Size& aSizeLogic ) return nOffset; } -void SvTreeListBox::GetHeightOffset(Size& aSizeLogic ) -{ - aSizeLogic = Size(GetTextWidth(OUString('X')), GetTextHeight()); -} - void SvTreeListBox::SetEntryHeight( SvTreeListEntry* pEntry ) { short nHeightMax=0; @@ -2215,8 +2200,7 @@ void SvTreeListBox::AdjustEntryHeight( const Image& rBmp ) void SvTreeListBox::AdjustEntryHeight() { - Size aSize; - GetHeightOffset( aSize ); + Size aSize( GetTextWidth(OUString('X')), GetTextHeight() ); if( aSize.Height() > nEntryHeight ) { nEntryHeight = (short)aSize.Height() + nEntryHeightOffs; diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx index 3753d4580d5c..bd71793865f4 100644 --- a/svtools/source/control/accessibleruler.cxx +++ b/svtools/source/control/accessibleruler.cxx @@ -373,7 +373,7 @@ Rectangle SvtRulerAccessible::GetBoundingBox() throw( RuntimeException ) void SvtRulerAccessible::ThrowExceptionIfNotAlive() throw( lang::DisposedException ) { - if( IsNotAlive() ) + if( rBHelper.bDisposed || rBHelper.bInDispose ) throw lang::DisposedException(); } diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 464a74843a3d..d51b05f4fff3 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -2275,18 +2275,13 @@ bool CalendarField::ShowDropDown( bool bShow ) return true; } -VclPtr CalendarField::CreateCalendar( vcl::Window* pParent ) -{ - return VclPtr::Create( pParent, mnCalendarStyle | WB_TABSTOP ); -} - Calendar* CalendarField::GetCalendar() { if ( !mpFloatWin ) { mpFloatWin = VclPtr::Create( this ); mpFloatWin->SetPopupModeEndHdl( LINK( this, CalendarField, ImplPopupModeEndHdl ) ); - mpCalendar = CreateCalendar( mpFloatWin ); + mpCalendar = VclPtr::Create( mpFloatWin, mnCalendarStyle | WB_TABSTOP ); mpCalendar->SetPosPixel( Point() ); mpCalendar->SetSelectHdl( LINK( this, CalendarField, ImplSelectHdl ) ); } diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx index 9164832a321b..e0ccea2978bc 100644 --- a/svtools/source/control/filectrl.cxx +++ b/svtools/source/control/filectrl.cxx @@ -172,11 +172,6 @@ void FileControl::Resize() } -IMPL_LINK_NOARG(FileControl, ButtonHdl, Button*, void) -{ - ImplBrowseFile( ); -} - void FileControl::GetFocus() { maEdit->GrabFocus(); @@ -199,7 +194,7 @@ void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize GetEdit().SetStyle( nOldEditStyle ); } -void FileControl::ImplBrowseFile( ) +IMPL_LINK_NOARG(FileControl, ButtonHdl, Button*, void) { try { diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 00eec207ad5f..ad4eaef311b7 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -219,12 +219,6 @@ void ToolbarMenu_Impl::fireAccessibleEvent( short nEventId, const css::uno::Any& } -bool ToolbarMenu_Impl::hasAccessibleListeners() -{ - return( mxAccessible.is() && mxAccessible->HasAccessibleListeners() ); -} - - sal_Int32 ToolbarMenu_Impl::getAccessibleChildCount() throw (RuntimeException) { sal_Int32 nCount = 0; @@ -355,7 +349,7 @@ void ToolbarMenu_Impl::clearAccessibleSelection() void ToolbarMenu_Impl::notifyHighlightedEntry() { - if( hasAccessibleListeners() ) + if( mxAccessible.is() && mxAccessible->HasAccessibleListeners() ) { ToolbarMenuEntry* pEntry = implGetEntry( mnHighlightedEntry ); if( pEntry && pEntry->mbEnabled && (pEntry->mnEntryId != TITLE_ID) ) diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 30484f470437..2fda0afe2e7d 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -62,20 +62,13 @@ IMPL_LINK( ToolbarMenuAcc, WindowEventListener, VclWindowEvent&, rEvent, void ) * might have been destroyed by the previous VCLEventListener (if no AT tool * is running), e.g. sub-toolbars in impress. */ - if ( mpParent && (rEvent.GetId() != VCLEVENT_WINDOW_ENDPOPUPMODE) ) - { - DBG_ASSERT( rEvent.GetWindow(), "Window???" ); - if( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() || ( rEvent.GetId() == VCLEVENT_OBJECT_DYING ) ) - { - ProcessWindowEvent( rEvent ); - } - } -} - + if ( !mpParent || (rEvent.GetId() == VCLEVENT_WINDOW_ENDPOPUPMODE) ) + return; + DBG_ASSERT( rEvent.GetWindow(), "Window???" ); + if( rEvent.GetWindow()->IsAccessibilityEventsSuppressed() && ( rEvent.GetId() != VCLEVENT_OBJECT_DYING ) ) + return; -void ToolbarMenuAcc::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) -{ - switch ( rVclWindowEvent.GetId() ) + switch ( rEvent.GetId() ) { case VCLEVENT_OBJECT_DYING: { diff --git a/svtools/source/control/toolbarmenuimp.hxx b/svtools/source/control/toolbarmenuimp.hxx index 6943fba54814..af4ac490053e 100644 --- a/svtools/source/control/toolbarmenuimp.hxx +++ b/svtools/source/control/toolbarmenuimp.hxx @@ -165,8 +165,6 @@ private: /// The current FOCUSED state. bool mbIsFocused; - void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); - /** Tell all listeners that the object is dying. This callback is usually called from the WeakComponentImplHelper class. */ @@ -262,7 +260,6 @@ struct ToolbarMenu_Impl void setAccessible( ToolbarMenuAcc* pAccessible ); void fireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue ); - bool hasAccessibleListeners(); sal_Int32 getAccessibleChildCount() throw (css::uno::RuntimeException); css::uno::Reference< css::accessibility::XAccessible > getAccessibleChild( sal_Int32 index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index 893ccb7b7252..33e1f20cbd38 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -221,32 +221,6 @@ void PlaceEditDialog::InitDetails( ) SelectTypeHdl( *m_pLBServerType ); } -void PlaceEditDialog::UpdateLabel( ) -{ - if( !bLabelChanged ) - { - if( !m_pEDUsername->GetText().isEmpty( ) ) - { - OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL ); - OUString sUser = m_pEDUsername->GetText(); - - int nLength = sUser.indexOf( '@' ); - if( nLength < 0 ) - nLength = sUser.getLength(); - - sLabel = sLabel.replaceFirst( "$user$", sUser.copy( 0, nLength ) ); - sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() ); - - m_pEDServerName->SetText( sLabel ); - bLabelChanged = false; - } - else - { - m_pEDServerName->SetText( m_pLBServerType->GetSelectEntry( ) ); - } - } -} - IMPL_LINK( PlaceEditDialog, OKHdl, Button*, /*pBtn*/, void) { if ( m_xCurrentDetails.get() ) @@ -290,7 +264,28 @@ IMPL_LINK( PlaceEditDialog, DelHdl, Button*, /*pButton*/, void) IMPL_LINK_NOARG( PlaceEditDialog, EditHdl, DetailsContainer*, void ) { - UpdateLabel( ); + if( !bLabelChanged ) + { + if( !m_pEDUsername->GetText().isEmpty( ) ) + { + OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL ); + OUString sUser = m_pEDUsername->GetText(); + + int nLength = sUser.indexOf( '@' ); + if( nLength < 0 ) + nLength = sUser.getLength(); + + sLabel = sLabel.replaceFirst( "$user$", sUser.copy( 0, nLength ) ); + sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() ); + + m_pEDServerName->SetText( sLabel ); + bLabelChanged = false; + } + else + { + m_pEDServerName->SetText( m_pLBServerType->GetSelectEntry( ) ); + } + } OUString sUrl = GetServerUrl( ); OUString sName = m_pEDServerName->GetText().trim( ); diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 3fea7251a1a3..2dd42da2aa76 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -248,7 +248,6 @@ namespace svt protected: css::uno::Any getProperty(const OUString& _rLocalName) const; - css::uno::Any getProperty(const sal_Char* _pLocalName) const; OUString getStringProperty(const sal_Char* _pLocalName) const; OUString getStringProperty(const OUString& _rLocalName) const; @@ -322,12 +321,6 @@ void AssignmentPersistentData::ImplCommit() } - Any AssignmentPersistentData::getProperty(const sal_Char* _pLocalName) const - { - return getProperty(OUString::createFromAscii(_pLocalName)); - } - - Any AssignmentPersistentData::getProperty(const OUString& _rLocalName) const { Sequence< OUString > aProperties(&_rLocalName, 1); @@ -348,7 +341,7 @@ void AssignmentPersistentData::ImplCommit() OUString AssignmentPersistentData::getStringProperty(const sal_Char* _pLocalName) const { OUString sReturn; - getProperty( _pLocalName ) >>= sReturn; + getProperty(OUString::createFromAscii(_pLocalName)) >>= sReturn; return sReturn; } diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index e7e7508fbb08..2829ce2044ae 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -105,14 +105,9 @@ void WizardDialog::ImplCalcSize( Size& rSize ) } } -bool WizardDialog::hasWizardPendingLayout() const -{ - return maWizardLayoutIdle.IsActive(); -} - void WizardDialog::queue_resize(StateChangedType /*eReason*/) { - if (hasWizardPendingLayout()) + if (maWizardLayoutIdle.IsActive()) return; if (IsInClose()) return; diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index e25d870f0f3b..ca4b4346c5db 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -153,21 +153,6 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL ) } -OUString GraphicDescriptor::getImplementationName_Static() - throw() -{ - return OUString( "com.sun.star.comp.graphic.GraphicDescriptor" ); -} - - -uno::Sequence< OUString > GraphicDescriptor::getSupportedServiceNames_Static() - throw( ) -{ - uno::Sequence< OUString > aSeq { "com.sun.star.graphic.GraphicDescriptor" }; - return aSeq; -} - - uno::Any SAL_CALL GraphicDescriptor::queryAggregation( const uno::Type & rType ) throw( uno::RuntimeException, std::exception ) { @@ -214,7 +199,7 @@ void SAL_CALL GraphicDescriptor::release() OUString SAL_CALL GraphicDescriptor::getImplementationName() throw( uno::RuntimeException, std::exception ) { - return getImplementationName_Static(); + return OUString( "com.sun.star.comp.graphic.GraphicDescriptor" ); } sal_Bool SAL_CALL GraphicDescriptor::supportsService( const OUString& ServiceName ) @@ -227,7 +212,7 @@ sal_Bool SAL_CALL GraphicDescriptor::supportsService( const OUString& ServiceNam uno::Sequence< OUString > SAL_CALL GraphicDescriptor::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - return getSupportedServiceNames_Static(); + return { "com.sun.star.graphic.GraphicDescriptor" }; } diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx index 4fbf441193bb..029a1d8520f5 100644 --- a/svtools/source/graphic/descriptor.hxx +++ b/svtools/source/graphic/descriptor.hxx @@ -74,9 +74,6 @@ public: void init( const OUString& rURL ); void init( const css::uno::Reference< css::io::XInputStream >& rxIStm, const OUString& rURL ); - static OUString getImplementationName_Static() throw(); - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); - protected: static ::comphelper::PropertySetInfo* createPropertySetInfo(); diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx index 2d188043472b..91d784775d24 100644 --- a/svtools/source/graphic/graphic.cxx +++ b/svtools/source/graphic/graphic.cxx @@ -88,23 +88,10 @@ void SAL_CALL Graphic::release() throw() unographic::GraphicDescriptor::release(); } -OUString Graphic::getImplementationName_Static() throw() -{ - return OUString( "com.sun.star.comp.graphic.Graphic" ); -} - - -uno::Sequence< OUString > Graphic::getSupportedServiceNames_Static() - throw() -{ - uno::Sequence< OUString > aSeq { "com.sun.star.graphic.Graphic" }; - return aSeq; -} - OUString SAL_CALL Graphic::getImplementationName() throw( uno::RuntimeException, std::exception ) { - return getImplementationName_Static(); + return OUString( "com.sun.star.comp.graphic.Graphic" ); } sal_Bool SAL_CALL Graphic::supportsService( const OUString& rServiceName ) @@ -117,7 +104,7 @@ uno::Sequence< OUString > SAL_CALL Graphic::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { uno::Sequence< OUString > aRet( ::unographic::GraphicDescriptor::getSupportedServiceNames() ); - uno::Sequence< OUString > aNew( getSupportedServiceNames_Static() ); + uno::Sequence< OUString > aNew { "com.sun.star.graphic.Graphic" }; sal_Int32 nOldCount = aRet.getLength(); aRet.realloc( nOldCount + aNew.getLength() ); diff --git a/svtools/source/graphic/graphic.hxx b/svtools/source/graphic/graphic.hxx index ee34096bd063..e097c5a8fe24 100644 --- a/svtools/source/graphic/graphic.hxx +++ b/svtools/source/graphic/graphic.hxx @@ -47,8 +47,6 @@ public: void init( const ::Graphic& rGraphic ) throw(); static const ::Graphic* getImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw(); - static OUString getImplementationName_Static() throw(); - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); protected: diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 214f37814fb0..a588edf61dd6 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -650,7 +650,7 @@ bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const delete mpSimpleCache; mpSimpleCache = new GrfSimpleCacheObj( GetTransformedGraphic( &aAttr ), aAttr ); - mpSimpleCache->maGraphic.SetAnimationNotifyHdl( GetAnimationNotifyHdl() ); + mpSimpleCache->maGraphic.SetAnimationNotifyHdl( GetGraphic().GetAnimationNotifyHdl() ); } mpSimpleCache->maGraphic.StartAnimation( pOut, aPt, aSz, nExtraData, pFirstFrameOutDev ); @@ -681,7 +681,12 @@ const Graphic& GraphicObject::GetGraphic() const //fdo#50697 If we've been asked to provide the graphic, then reset //the cache timeout to start from now and not remain at the //time of creation - pThis->restartSwapOutTimer(); + // restart SwapOut timer; this is like touching in a cache to reset to the full timeout value + if( pThis->mpSwapOutTimer && pThis->mpSwapOutTimer->IsActive() ) + { + pThis->mpSwapOutTimer->Stop(); + pThis->mpSwapOutTimer->Start(); + } return maGraphic; } @@ -1183,14 +1188,5 @@ basegfx::B2DVector GraphicObject::calculateCropScaling( return basegfx::B2DVector(fFactorX,fFactorY); } -// restart SwapOut timer -void GraphicObject::restartSwapOutTimer() const -{ - if( mpSwapOutTimer && mpSwapOutTimer->IsActive() ) - { - mpSwapOutTimer->Stop(); - mpSwapOutTimer->Start(); - } -} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index b29b49d13756..4a892cf87c1a 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -189,9 +189,6 @@ private: // if element at cursor can be expanded in general bool IsExpandable() const; - // if element at cursor can be expanded at this moment - bool IsNowExpandable() const; - static void implInitDefaultNodeImages(); void UpdateStringSorter(); diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index adb0485f8c3a..fbf987aa11cd 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -314,8 +314,7 @@ public: void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(css::uno::RuntimeException, std::exception) override; sal_Bool SAL_CALL isStrictFormat( ) throw(css::uno::RuntimeException, std::exception) override; - static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); - virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } + virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override; }; diff --git a/svtools/source/misc/dialogcontrolling.cxx b/svtools/source/misc/dialogcontrolling.cxx index ea5e81845f6d..11e6d50bfac6 100644 --- a/svtools/source/misc/dialogcontrolling.cxx +++ b/svtools/source/misc/dialogcontrolling.cxx @@ -104,18 +104,13 @@ namespace svt IMPL_LINK( DialogController, OnWindowEvent, VclWindowEvent&, _rEvent, void ) { - if ( m_pImpl->pEventFilter->payAttentionTo( _rEvent ) ) - impl_updateAll( _rEvent ); - } - - - void DialogController::impl_updateAll( const VclWindowEvent& _rTriggerEvent ) - { + if ( !m_pImpl->pEventFilter->payAttentionTo( _rEvent ) ) + return; for ( auto loop = m_pImpl->aConcernedWindows.begin(); loop != m_pImpl->aConcernedWindows.end(); ++loop ) - impl_update( _rTriggerEvent, *(*loop) ); + impl_update( _rEvent, *(*loop) ); } diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index d2e1be5712d7..6979be1adad5 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -420,7 +420,6 @@ namespace svt bool implReadFolder( const ::rtl::Reference< TemplateContent >& _rxRoot ); - static OUString getCacheFileName(); static sal_Int32 getMagicNumber(); static void normalize( TemplateFolderContent& _rState ); @@ -463,12 +462,6 @@ namespace svt } - OUString TemplateFolderCacheImpl::getCacheFileName() - { - return OUString(".templdir.cache"); - } - - void TemplateFolderCacheImpl::normalize( TemplateFolderContent& _rState ) { SubContentSort()( _rState ); @@ -723,7 +716,7 @@ namespace svt } // append our name - aStorageURL.Append( getCacheFileName() ); + aStorageURL.Append( ".templdir.cache" ); // open the stream m_pCacheStream = UcbStreamHelper::CreateStream( aStorageURL.GetMainURL( INetURLObject::DECODE_TO_IURI ), diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 8240f5fdae45..d4fd7cd3becd 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -56,11 +56,6 @@ namespace svt { namespace table m_rTableControl.doPaintContent(rRenderContext, rUpdateRect); } - void TableDataWindow::SetBackground( const Wallpaper& rColor ) - { - Window::SetBackground( rColor ); - } - void TableDataWindow::RequestHelp( const HelpEvent& rHEvt ) { HelpEventMode const nHelpMode = rHEvt.GetMode(); diff --git a/svtools/source/table/tabledatawindow.hxx b/svtools/source/table/tabledatawindow.hxx index ee1300e5e438..a3e2273e3985 100644 --- a/svtools/source/table/tabledatawindow.hxx +++ b/svtools/source/table/tabledatawindow.hxx @@ -57,8 +57,6 @@ namespace svt { namespace table virtual bool Notify(NotifyEvent& rNEvt) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - void SetBackground(const Wallpaper& rColor); - private: static void impl_hideTipWindow(); }; diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 7cc356abd861..ce3ab34dc636 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -512,16 +512,6 @@ SvMacroTableEventDescriptor::SvMacroTableEventDescriptor( const SvxMacroTableDtor& rMacroTable, const SvEventDescription* pSupportedMacroItems) : SvDetachedEventDescriptor(pSupportedMacroItems) -{ - copyMacrosFromTable(rMacroTable); -} - -SvMacroTableEventDescriptor::~SvMacroTableEventDescriptor() -{ -} - -void SvMacroTableEventDescriptor::copyMacrosFromTable( - const SvxMacroTableDtor& rMacroTable) { for(sal_Int16 i = 0; mpSupportedMacroItems[i].mnEvent != 0; i++) { @@ -530,7 +520,10 @@ void SvMacroTableEventDescriptor::copyMacrosFromTable( if (nullptr != pMacro) replaceByName(nEvent, *pMacro); } +} +SvMacroTableEventDescriptor::~SvMacroTableEventDescriptor() +{ } void SvMacroTableEventDescriptor::copyMacrosIntoTable( diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index f1df7df38195..f0a914abf26e 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -1796,7 +1796,7 @@ sal_Bool SVTXNumericField::isStrictFormat() throw(css::uno::RuntimeException, st return pField && pField->IsStrictFormat(); } -void SVTXNumericField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) +void SVTXNumericField::GetPropertyIds( std::vector< sal_uInt16 > &rIds ) { SVTXFormattedField::ImplGetPropertyIds( rIds ); } -- cgit