diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-26 09:36:26 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-02-26 08:24:32 +0000 |
commit | 911ae0aeca443fb4b5e400ae0f939567b580e443 (patch) | |
tree | 1b7ef72f8f4c50c9ab7a552743a95b329912a0bc /vcl/source/window | |
parent | 63e2aec922ec8c0a9011b98dbfd3dac295f473af (diff) |
loplugin:unuseddefaultparams in /include/vcl
Change-Id: I36daccd90bfa6ba0ee8b9e76bff2bd8494155a04
Reviewed-on: https://gerrit.libreoffice.org/22710
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/menu.cxx | 26 | ||||
-rw-r--r-- | vcl/source/window/paint.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/splitwin.cxx | 21 | ||||
-rw-r--r-- | vcl/source/window/syschild.cxx | 89 | ||||
-rw-r--r-- | vcl/source/window/taskpanelist.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 48 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 4 |
8 files changed, 55 insertions, 158 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index baa40292afef..d218675f23aa 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -421,7 +421,7 @@ void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, SetItemImage( nItemId, rImage ); } -void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos ) +void Menu::InsertItem( const ResId& rResId ) { ResMgr* pMgr = rResId.GetResMgr(); if( ! pMgr ) @@ -456,16 +456,16 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos ) Bitmap aBmp( ResId( static_cast<RSHEADER_TYPE*>(GetClassRes()), *pMgr ) ); Image const aImg(aBmp); if ( !aText.isEmpty() ) - InsertItem( nItemId, aText, aImg, nStatus, OString(), nPos ); + InsertItem( nItemId, aText, aImg, nStatus, OString() ); else - InsertItem( nItemId, aImg, nStatus, OString(), nPos ); + InsertItem( nItemId, aImg, nStatus, OString() ); } IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE*>(GetClassRes()) ) ); } else if ( !bSep ) - InsertItem(nItemId, aText, nStatus, OString(), nPos); + InsertItem(nItemId, aText, nStatus, OString()); if ( bSep ) - InsertSeparator(OString(), nPos); + InsertSeparator(OString()); OUString aHelpText; if ( nObjMask & RSC_MENUITEM_HELPTEXT ) @@ -528,7 +528,7 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos ) } void Menu::InsertItem(const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& rFrame, - MenuItemBits nBits, const OString &rIdent, sal_uInt16 nPos) + MenuItemBits nBits, const OString &rIdent) { OUString aLabel(CommandInfoProvider::Instance().GetPopupLabelForCommand(rCommand, rFrame)); OUString aTooltip(CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame)); @@ -536,7 +536,7 @@ void Menu::InsertItem(const OUString& rCommand, const css::uno::Reference<css::f sal_uInt16 nItemId = GetItemCount() + 1; - InsertItem(nItemId, aLabel, aImage, nBits, rIdent, nPos); + InsertItem(nItemId, aLabel, aImage, nBits, rIdent); SetItemCommand(nItemId, rCommand); SetHelpText(nItemId, aTooltip); } @@ -649,9 +649,9 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n } } -void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) +void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos ) { - ImplCopyItem( this, rMenu, nPos, nNewPos ); + ImplCopyItem( this, rMenu, nPos, MENU_APPEND ); } void Menu::Clear() @@ -2297,7 +2297,7 @@ void Menu::RemoveDisabledEntries( bool bCheckPopups, bool bRemoveEmptyPopups ) mpLayoutData = nullptr; } -bool Menu::HasValidEntries( bool bCheckPopups ) +bool Menu::HasValidEntries() { bool bValidEntries = false; sal_uInt16 nCount = GetItemCount(); @@ -2306,7 +2306,7 @@ bool Menu::HasValidEntries( bool bCheckPopups ) MenuItemData* pItem = pItemList->GetDataFromPos( n ); if ( pItem->bEnabled && ( pItem->eType != MenuItemType::SEPARATOR ) ) { - if ( bCheckPopups && pItem->pSubMenu ) + if ( pItem->pSubMenu ) bValidEntries = pItem->pSubMenu->HasValidEntries(); else bValidEntries = true; @@ -2849,10 +2849,10 @@ PopupMenu* PopupMenu::GetActivePopupMenu() return pSVData->maAppData.mpActivePopupMenu; } -void PopupMenu::EndExecute( sal_uInt16 nSelectId ) +void PopupMenu::EndExecute() { if ( ImplGetWindow() ) - ImplGetFloatingWindow()->EndExecute( nSelectId ); + ImplGetFloatingWindow()->EndExecute( 0 ); } void PopupMenu::SelectItem(sal_uInt16 nId) diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 1b4f76f10a91..0c49837cdf4f 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -984,7 +984,7 @@ void Window::ImplValidate( const vcl::Region* pRegion, ValidateFlags nFlags ) } } -void Window::ImplUpdateAll( bool bOverlapWindows ) +void Window::ImplUpdateAll() { if ( !mpWindowImpl->mbReallyVisible ) return; @@ -1002,13 +1002,7 @@ void Window::ImplUpdateAll( bool bOverlapWindows ) // an update changes the OverlapWindow, such that for later paints // not too much has to be drawn, if ALLCHILDREN etc. is set vcl::Window* pWindow = ImplGetFirstOverlapWindow(); - if ( bOverlapWindows ) - pWindow->ImplCallOverlapPaint(); - else - { - if (pWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTCHILDREN)) - pWindow->ImplCallPaint(nullptr, pWindow->mpWindowImpl->mnPaintFlags); - } + pWindow->ImplCallOverlapPaint(); if ( bFlush ) Flush(); @@ -1226,12 +1220,12 @@ void Window::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags ) } } -void Window::Validate( ValidateFlags nFlags ) +void Window::Validate() { if ( !comphelper::LibreOfficeKit::isActive() && (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; - ImplValidate( nullptr, nFlags ); + ImplValidate( nullptr, ValidateFlags::NONE ); } bool Window::HasPaintEvent() const diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 5b644826b5ef..2d88d511453f 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -2722,7 +2722,7 @@ void SplitWindow::InsertItem( sal_uInt16 nId, long nSize, InsertItem( nId, nullptr, nSize, nPos, nIntoSetId, nBits ); } -void SplitWindow::RemoveItem( sal_uInt16 nId, bool bHide ) +void SplitWindow::RemoveItem( sal_uInt16 nId ) { #ifdef DBG_UTIL sal_uInt16 nDbgDummy; @@ -2756,11 +2756,8 @@ void SplitWindow::RemoveItem( sal_uInt16 nId, bool bHide ) if ( pWindow ) { // restore window - if ( bHide || (pOrgParent != this) ) - { - pWindow->Hide(); - pWindow->SetParent( pOrgParent ); - } + pWindow->Hide(); + pWindow->SetParent( pOrgParent ); } // Clear and delete @@ -3159,9 +3156,9 @@ sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const return nPos; } -sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId ) const +sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos ) const { - ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId ); + ImplSplitSet* pSet = ImplFindSet( mpBaseSet, 0/*nSetId*/ ); if ( pSet && (nPos < pSet->mpItems.size()) ) return pSet->mpItems[nPos]->mnId; else @@ -3233,15 +3230,15 @@ void SplitWindow::ShowAutoHideButton( bool bShow ) ImplUpdate(); } -void SplitWindow::ShowFadeInHideButton( bool bShow ) +void SplitWindow::ShowFadeInHideButton() { - mbFadeIn = bShow; + mbFadeIn = true; ImplUpdate(); } -void SplitWindow::ShowFadeOutButton( bool bShow ) +void SplitWindow::ShowFadeOutButton() { - mbFadeOut = bShow; + mbFadeOut = true; ImplUpdate(); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 4bbe7fafe5f5..3bf1271acd44 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -199,11 +199,10 @@ void SystemChildWindow::SetForwardKey( bool bEnable ) mpWindowImpl->mpSysObj->SetForwardKey( bEnable ); } -sal_IntPtr SystemChildWindow::GetParentWindowHandle( bool bUseJava ) +sal_IntPtr SystemChildWindow::GetParentWindowHandle() { sal_IntPtr nRet = 0; - (void)bUseJava; #if defined(_WIN32) nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd ); #elif defined MACOSX @@ -214,91 +213,7 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( bool bUseJava ) #elif defined IOS // Nothing #elif defined UNX - if( !bUseJava ) - { - nRet = (sal_IntPtr) GetSystemData()->aWindow; - } -#if HAVE_FEATURE_JAVA - else - { - uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); - - if( GetSystemData()->aWindow > 0 ) - { - try - { - ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM; - uno::Reference< java::XJavaVM > xJavaVM = java::JavaVirtualMachine::create(xContext); - uno::Sequence< sal_Int8 > aProcessID( 17 ); - - rtl_getGlobalProcessId( reinterpret_cast<sal_uInt8*>(aProcessID.getArray()) ); - aProcessID[ 16 ] = 0; - OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64"); - sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(nullptr)); - xJavaVM->getJavaVM(aProcessID) >>= nPointer; - xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); - - if( xVM.is() ) - { - try - { - ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM ); - JNIEnv* pEnv = aVMAttachGuard.getEnvironment(); - - jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit"); - ImplTestJavaException(pEnv); - - jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" ); - ImplTestJavaException(pEnv); - - pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit); - ImplTestJavaException(pEnv); - - jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer"); - if( pEnv->ExceptionOccurred() ) - { - pEnv->ExceptionClear(); - - jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext"); - ImplTestJavaException(pEnv); - } - - jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader"); - ImplTestJavaException(pEnv); - - jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V"); - ImplTestJavaException(pEnv); - - jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni"); - ImplTestJavaException(pEnv); - - pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE); - ImplTestJavaException(pEnv); - - jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" ); - ImplTestJavaException(pEnv); - - const Size aSize( GetOutputSizePixel() ); - jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget, - GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() ); - ImplTestJavaException(pEnv); - - nRet = static_cast< sal_IntPtr >( ji_widget ); - } - catch( uno::RuntimeException& ) - { - } - - if( !nRet ) - nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow ); - } - } - catch( ... ) - { - } - } - } -#endif // HAVE_FEATURE_JAVA + nRet = (sal_IntPtr) GetSystemData()->aWindow; #endif return nRet; diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index e12f8d4ba418..238f8fa739d0 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -227,12 +227,9 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent) } // returns next splitter -vcl::Window* TaskPaneList::FindNextSplitter( vcl::Window *pWindow, bool bForward ) +vcl::Window* TaskPaneList::FindNextSplitter( vcl::Window *pWindow ) { - if( bForward ) - ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); - else - ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSortBackward() ); + ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); auto p = mTaskPanes.begin(); while( p != mTaskPanes.end() ) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 048ef506be10..df0919243ad3 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4981,14 +4981,12 @@ void ToolBox::LoseFocus() } // performs the action associated with an item, ie simulates clicking the item -void ToolBox::TriggerItem( sal_uInt16 nItemId, bool bShift, bool bCtrl ) +void ToolBox::TriggerItem( sal_uInt16 nItemId, bool bShift ) { mnHighItemId = nItemId; sal_uInt16 nModifier = 0; if( bShift ) nModifier |= KEY_SHIFT; - if( bCtrl ) - nModifier |= KEY_MOD1; vcl::KeyCode aKeyCode( 0, nModifier ); ImplActivateItem( aKeyCode ); } diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index d2364c18644d..7f904ffd0faa 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -446,7 +446,7 @@ void ToolBox::Select() pWrapper->GetFloatingWindow()->EndPopupMode(); } -void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos ) +void ToolBox::InsertItem( const ResId& rResId ) { sal_uLong nObjMask; bool bImage = false; // has image @@ -524,14 +524,14 @@ void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos ) } // create item and add to list - mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); + mpData->m_aItems.push_back( aItem ); mpData->ImplClearLayoutData(); // recalculate ToolBox and redraw ImplInvalidate( bNewCalc ); // Notify - sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(mpData->m_aItems.size() - 1); CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } @@ -637,19 +637,19 @@ void ToolBox::InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow, CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } -void ToolBox::InsertSpace( sal_uInt16 nPos ) +void ToolBox::InsertSpace() { // create item and add to list ImplToolItem aItem; aItem.meType = ToolBoxItemType::SPACE; aItem.mbEnabled = false; - mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); + mpData->m_aItems.push_back( aItem ); mpData->ImplClearLayoutData(); ImplInvalidate(); // Notify - sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(mpData->m_aItems.size() - 1); CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } @@ -719,8 +719,7 @@ void ToolBox::RemoveItem( sal_uInt16 nPos ) } } -void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, - sal_uInt16 nNewPos ) +void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId ) { DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::CopyItem(): ItemId already exists" ); @@ -736,13 +735,13 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, aNewItem.mpWindow = nullptr; aNewItem.mbShowWindow = false; - mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aNewItem ); + mpData->m_aItems.push_back( aNewItem ); mpData->ImplClearLayoutData(); // redraw ToolBox ImplInvalidate(); // Notify - sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); + sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(mpData->m_aItems.size() - 1); CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) ); } } @@ -1355,7 +1354,7 @@ void ToolBox::EndSelection() mnMouseModifier = 0; } -void ToolBox::SetItemDown( sal_uInt16 nItemId, bool bDown, bool bRelease ) +void ToolBox::SetItemDown( sal_uInt16 nItemId, bool bDown ) { sal_uInt16 nPos = GetItemPos( nItemId ); @@ -1380,23 +1379,20 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, bool bDown, bool bRelease ) } } - if ( bRelease ) + if ( mbDrag || mbSelection ) { - if ( mbDrag || mbSelection ) - { - mbDrag = false; - mbSelection = false; - EndTracking(); - if (IsMouseCaptured()) - ReleaseMouse(); - Deactivate(); - } - - mnCurItemId = 0; - mnDownItemId = 0; - mnMouseClicks = 0; - mnMouseModifier = 0; + mbDrag = false; + mbSelection = false; + EndTracking(); + if (IsMouseCaptured()) + ReleaseMouse(); + Deactivate(); } + + mnCurItemId = 0; + mnDownItemId = 0; + mnMouseClicks = 0; + mnMouseModifier = 0; } } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 88344cf74e63..9f988fd4cb3e 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1090,9 +1090,9 @@ bool Window::IsToolbarFloatingWindow() const return mpWindowImpl && mpWindowImpl->mbToolbarFloatingWindow; } -void Window::EnableAllResize( bool bEnable ) +void Window::EnableAllResize() { - mpWindowImpl->mbAllResize = bEnable; + mpWindowImpl->mbAllResize = true; } void Window::EnableChildTransparentMode( bool bEnable ) |