forms/Library_frm.mk | 1 forms/source/helper/commanddescriptionprovider.cxx | 123 ------ forms/source/inc/commanddescriptionprovider.hxx | 60 --- forms/source/solar/component/navbarcontrol.cxx | 7 forms/source/solar/control/navtoolbar.cxx | 13 forms/source/solar/inc/navtoolbar.hxx | 5 include/vcl/commandinfoprovider.hxx | 2 solenv/gbuild/platform/com_MSC_defs.mk | 4 vcl/source/helper/commandinfoprovider.cxx | 7 vcl/workben/outdevgrind.cxx | 372 +++++---------------- 10 files changed, 127 insertions(+), 467 deletions(-)
New commits: commit 7ae232623a423b078dd54d06e5fe52e89994b391 Author: Samuel Mehrbrodt <[email protected]> Date: Fri Apr 15 13:38:17 2016 +0200 tdf#95845 Use CommandInfoProvider in forms Change-Id: I697f8c442cc4db7b38601c32fb71e0201f145354 Reviewed-on: https://gerrit.libreoffice.org/24106 Tested-by: Jenkins <[email protected]> Reviewed-by: Samuel Mehrbrodt <[email protected]> diff --git a/forms/Library_frm.mk b/forms/Library_frm.mk index 0199d38..494ca4b 100644 --- a/forms/Library_frm.mk +++ b/forms/Library_frm.mk @@ -95,7 +95,6 @@ $(eval $(call gb_Library_add_exception_objects,frm,\ forms/source/component/scrollbar \ forms/source/component/spinbutton \ forms/source/component/Time \ - forms/source/helper/commanddescriptionprovider \ forms/source/helper/commandimageprovider \ forms/source/helper/controlfeatureinterception \ forms/source/helper/formnavigation \ diff --git a/forms/source/helper/commanddescriptionprovider.cxx b/forms/source/helper/commanddescriptionprovider.cxx deleted file mode 100644 index 07b56c3..0000000 --- a/forms/source/helper/commanddescriptionprovider.cxx +++ /dev/null @@ -1,123 +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 "commanddescriptionprovider.hxx" - -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/frame/ModuleManager.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/frame/theUICommandDescription.hpp> - -#include <comphelper/namedvaluecollection.hxx> -#include <tools/diagnose_ex.h> - - -namespace frm -{ - - - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::XInterface; - using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::com::sun::star::uno::Exception; - using ::com::sun::star::uno::RuntimeException; - using ::com::sun::star::uno::XComponentContext; - using ::com::sun::star::frame::XModel; - using ::com::sun::star::container::XNameAccess; - using ::com::sun::star::frame::ModuleManager; - using ::com::sun::star::frame::XModuleManager2; - using ::com::sun::star::beans::PropertyValue; - using ::com::sun::star::frame::theUICommandDescription; - - class DefaultCommandDescriptionProvider : public ICommandDescriptionProvider - { - public: - DefaultCommandDescriptionProvider( const Reference<XComponentContext>& _rxContext, const Reference< XModel >& _rxDocument ) - { - impl_init_nothrow( _rxContext, _rxDocument ); - } - - virtual ~DefaultCommandDescriptionProvider() - { - } - - // ICommandDescriptionProvider - virtual OUString getCommandDescription( const OUString& _rCommandURL ) const override; - - private: - void impl_init_nothrow( const Reference<XComponentContext>& _rxContext, const Reference< XModel >& _rxDocument ); - - private: - Reference< XNameAccess > m_xCommandAccess; - }; - - - void DefaultCommandDescriptionProvider::impl_init_nothrow( const Reference<XComponentContext>& _rxContext, const Reference< XModel >& _rxDocument ) - { - OSL_ENSURE( _rxDocument.is(), "DefaultCommandDescriptionProvider::impl_init_nothrow: no document => no command descriptions!" ); - if ( !_rxDocument.is() ) - return; - - try - { - Reference< XModuleManager2 > xModuleManager( ModuleManager::create(_rxContext) ); - OUString sModuleID = xModuleManager->identify( _rxDocument ); - - Reference< XNameAccess > xUICommandDescriptions( theUICommandDescription::get(_rxContext) ); - m_xCommandAccess.set( xUICommandDescriptions->getByName( sModuleID ), UNO_QUERY_THROW ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - } - - - OUString DefaultCommandDescriptionProvider::getCommandDescription( const OUString& _rCommandURL ) const - { - if ( !m_xCommandAccess.is() ) - return OUString(); - - try - { - ::comphelper::NamedValueCollection aCommandProperties( m_xCommandAccess->getByName( _rCommandURL ) ); - return aCommandProperties.getOrDefault( "Name", OUString() ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - return OUString(); - } - - - PCommandDescriptionProvider createDocumentCommandDescriptionProvider( - const Reference<XComponentContext>& _rxContext, const Reference< XModel >& _rxDocument ) - { - PCommandDescriptionProvider pDescriptionProvider( new DefaultCommandDescriptionProvider( _rxContext, _rxDocument ) ); - return pDescriptionProvider; - } - - -} // namespace frm - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/forms/source/inc/commanddescriptionprovider.hxx b/forms/source/inc/commanddescriptionprovider.hxx deleted file mode 100644 index cff411e..0000000 --- a/forms/source/inc/commanddescriptionprovider.hxx +++ /dev/null @@ -1,60 +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 . - */ - -#ifndef INCLUDED_FORMS_SOURCE_INC_COMMANDDESCRIPTIONPROVIDER_HXX -#define INCLUDED_FORMS_SOURCE_INC_COMMANDDESCRIPTIONPROVIDER_HXX - -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> - -#include <memory> - - -namespace frm -{ - - - //= ICommandDescriptionProvider - - class SAL_NO_VTABLE ICommandDescriptionProvider - { - public: - virtual OUString getCommandDescription( const OUString& _rCommandURL ) const = 0; - - virtual ~ICommandDescriptionProvider() { } - }; - - typedef std::shared_ptr< const ICommandDescriptionProvider > PCommandDescriptionProvider; - - - //= factory - - PCommandDescriptionProvider - createDocumentCommandDescriptionProvider( - const css::uno::Reference< css::uno::XComponentContext >& _rxContext, - const css::uno::Reference< css::frame::XModel >& _rxDocument - ); - - -} // namespace frm - - -#endif // INCLUDED_FORMS_SOURCE_INC_COMMANDDESCRIPTIONPROVIDER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx index cc7be7a..91f6a8a 100644 --- a/forms/source/solar/component/navbarcontrol.cxx +++ b/forms/source/solar/component/navbarcontrol.cxx @@ -24,13 +24,13 @@ #include "componenttools.hxx" #include "navtoolbar.hxx" #include "commandimageprovider.hxx" -#include "commanddescriptionprovider.hxx" #include <com/sun/star/awt/XView.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/form/runtime/FormFeature.hpp> #include <com/sun/star/awt/XControlModel.hpp> #include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/frame/ModuleManager.hpp> #include <comphelper/processfactory.hxx> #include <tools/debug.hxx> @@ -223,11 +223,14 @@ namespace frm // the VCL control for the peer Reference< XModel > xContextDocument( getXModel( _rxModel ) ); + Reference< XModuleManager2 > xModuleManager( ModuleManager::create(_rxORB) ); + OUString sModuleID = xModuleManager->identify( xContextDocument ); + VclPtrInstance<NavigationToolBar> pNavBar( _pParentWindow, lcl_getWinBits_nothrow( _rxModel ), createDocumentCommandImageProvider( _rxORB, xContextDocument ), - createDocumentCommandDescriptionProvider( _rxORB, xContextDocument ) + sModuleID ); // some knittings diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index 79b75ca..6fda36f 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -23,13 +23,13 @@ #include "featuredispatcher.hxx" #include "frm_resource.hrc" #include "commandimageprovider.hxx" -#include "commanddescriptionprovider.hxx" #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/form/runtime/FormFeature.hpp> #include <sfx2/imgmgr.hxx> #include <vcl/fixed.hxx> +#include <vcl/commandinfoprovider.hxx> #include <sal/macros.h> @@ -131,14 +131,15 @@ namespace frm } } - NavigationToolBar::NavigationToolBar( vcl::Window* _pParent, WinBits _nStyle, const PCommandImageProvider& _pImageProvider, - const PCommandDescriptionProvider& _pDescriptionProvider ) + NavigationToolBar::NavigationToolBar( vcl::Window* _pParent, WinBits _nStyle, + const PCommandImageProvider& _pImageProvider, + const OUString sModuleId ) :Window( _pParent, _nStyle ) ,m_pDispatcher( nullptr ) ,m_pImageProvider( _pImageProvider ) - ,m_pDescriptionProvider( _pDescriptionProvider ) ,m_eImageSize( eSmall ) ,m_pToolbar( nullptr ) + ,m_sModuleId( sModuleId ) { implInit( ); } @@ -291,8 +292,8 @@ namespace frm { OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) ); m_pToolbar->SetItemCommand( pSupportedFeatures->nId, sCommandURL ); - if ( m_pDescriptionProvider ) - m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, m_pDescriptionProvider->getCommandDescription( sCommandURL ) ); + m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, + vcl::CommandInfoProvider::Instance().GetCommandPropertyFromModule(sCommandURL, m_sModuleId) ); } if ( pSupportedFeatures->bItemWindow ) diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx index 3d2a191..9112fac 100644 --- a/forms/source/solar/inc/navtoolbar.hxx +++ b/forms/source/solar/inc/navtoolbar.hxx @@ -57,18 +57,17 @@ namespace frm const IFeatureDispatcher* m_pDispatcher; const std::shared_ptr< const ICommandImageProvider > m_pImageProvider; - const std::shared_ptr< const ICommandDescriptionProvider > - m_pDescriptionProvider; ImageSize m_eImageSize; VclPtr<ImplNavToolBar> m_pToolbar; ::std::vector< VclPtr<vcl::Window> > m_aChildWins; + const OUString m_sModuleId; public: NavigationToolBar( vcl::Window* _pParent, WinBits _nStyle, const std::shared_ptr< const ICommandImageProvider >& _pImageProvider, - const std::shared_ptr< const ICommandDescriptionProvider >& _pDescriptionProvider + const OUString sModuleId ); virtual ~NavigationToolBar( ); virtual void dispose() override; diff --git a/include/vcl/commandinfoprovider.hxx b/include/vcl/commandinfoprovider.hxx index 67a7ab3..2560745 100644 --- a/include/vcl/commandinfoprovider.hxx +++ b/include/vcl/commandinfoprovider.hxx @@ -87,7 +87,7 @@ public: OUString GetRealCommandForCommand( const OUString& rCommandName, const css::uno::Reference<css::frame::XFrame>& rxFrame ); - OUString GetCommandPropertyFromModule( const sal_Char* pCommandURL, const OUString& rModuleName ); + OUString GetCommandPropertyFromModule( const OUString& rCommandName, const OUString& rModuleName ); Image GetImageForCommand( const OUString& rsCommandName, diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 77d5ba6..7a03c80 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -480,14 +480,13 @@ OUString CommandInfoProvider::GetCommandProperty(const OUString& rsProperty, con return OUString(); } -OUString CommandInfoProvider::GetCommandPropertyFromModule( const sal_Char* pCommandURL, const OUString& rModuleName ) +OUString CommandInfoProvider::GetCommandPropertyFromModule( const OUString& rCommandName, const OUString& rModuleName ) { OUString sLabel; - if ( !pCommandURL || !*pCommandURL ) + if ( rCommandName.isEmpty() ) return sLabel; Sequence<beans::PropertyValue> aProperties; - OUString sCommandURL = OUString::createFromAscii( pCommandURL ); try { if( rModuleName.getLength() > 0) @@ -495,7 +494,7 @@ OUString CommandInfoProvider::GetCommandPropertyFromModule( const sal_Char* pCom Reference<container::XNameAccess> xNameAccess = frame::theUICommandDescription::get(mxContext); Reference<container::XNameAccess> xUICommandLabels; if (xNameAccess->getByName( rModuleName ) >>= xUICommandLabels ) - xUICommandLabels->getByName(sCommandURL) >>= aProperties; + xUICommandLabels->getByName(rCommandName) >>= aProperties; for (sal_Int32 nIndex=0; nIndex<aProperties.getLength(); ++nIndex) { commit 9a081c5cb56c834e7b63ee1ad5b88f11119891ff Author: Michael Stahl <[email protected]> Date: Fri Apr 15 14:57:26 2016 +0200 disable MSVC warning C4091 With MSVC 2015 it is triggered by odd code in Windows 8.1 SDK DbgHelp.h and imagehlp.h. Change-Id: I8694e4598fa8e3a6d6c6e8a0f94429af16f40c6b diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index 16abf4c..951d859 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -75,6 +75,8 @@ gb_AFLAGS := $(AFLAGS) # cleaning away from the code, to avoid warnings when building with # gcc or Clang and -Wall -Werror. +# C4091: 'typedef ': ignored on left of '' when no variable is declared + # C4100: 'identifier' : unreferenced formal parameter # C4127: conditional expression is constant @@ -149,6 +151,7 @@ gb_CFLAGS := \ $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \ -nologo \ -W4 \ + -wd4091 \ $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \ -wd4127 \ $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \ @@ -190,6 +193,7 @@ gb_CXXFLAGS := \ $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \ -nologo \ -W4 \ + -wd4091 \ $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \ -wd4127 \ $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \ commit 43faf91ee36646af5c13cfc5af649c3ff2f3297b Author: Michael Stahl <[email protected]> Date: Fri Apr 15 14:20:44 2016 +0200 vcl: replace boost::bind with C++11 lambdas Change-Id: I275674edf4fc16fdf7aa1155ae488d96ecc4d643 diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx index f282410..348bce4 100644 --- a/vcl/workben/outdevgrind.cxx +++ b/vcl/workben/outdevgrind.cxx @@ -44,8 +44,6 @@ #include <osl/time.h> -#include <boost/bind.hpp> - #include <functional> #include <stdio.h> @@ -152,10 +150,9 @@ void setupMethodStubs( functor_vector_type& res ) #ifdef FIXME_NEEDS_LOVE add(res, "DrawTextArray", - boost::bind( - &OutputDevice::DrawTextArray, - _1, - aPt1, aString, (const sal_Int32*)0, (sal_uInt16)0, aString.getLength() )); + [&] (OutputDevice * pDev) { + return pDev->DrawTextArray(aPt1, aString, (const sal_Int32*)0, (sal_uInt16)0, aString.getLength()); + }); #endif /* void DrawPixel( const Point& rPt, const Color& rColor ); */ @@ -250,15 +247,10 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawOutDev(foreign source)", - boost::bind( - (void (OutputDevice::*)( const Point&, const Size&, - const Point&, const Size&, - const OutputDevice& ))( - &OutputDevice::DrawOutDev), - _1, - aRect2.TopLeft(), aRect2.GetSize(), - aRect.TopLeft(), aRect.GetSize(), - boost::cref(aVDevBW) )); + [&] (OutputDevice * pDev) { + return pDev->DrawOutDev(aRect2.TopLeft(), aRect2.GetSize(), + aRect.TopLeft(), aRect.GetSize(), aVDevBW); + }); /* void DrawOutDev( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPt, const Size& rSrcSize, @@ -266,15 +258,10 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawOutDev(foreign source, scaled)", - boost::bind( - (void (OutputDevice::*)( const Point&, const Size&, - const Point&, const Size&, - const OutputDevice& ))( - &OutputDevice::DrawOutDev), - _1, - aRect2.TopLeft(), aRect2.GetSize(), - aRect.TopLeft(), aRect.GetSize(), - boost::cref(aVDev) )); + [&] (OutputDevice * pDev) { + return pDev->DrawOutDev(aRect2.TopLeft(), aRect2.GetSize(), + aRect.TopLeft(), aRect.GetSize(), aVDev); + }); #endif /* void CopyArea( const Point& rDestPt, @@ -283,10 +270,7 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "CopyArea", - boost::bind( - &OutputDevice::CopyArea, - _1, - aPt1, aPt3, aRect2.GetSize(), false )); + [&] (OutputDevice * pDev) { return pDev->CopyArea(aPt1, aPt3, aRect2.GetSize(), false); } ); #ifdef NEEDS_QUALIY_PARAMTER /* void DrawBitmap( const Point& rDestPt, @@ -294,50 +278,32 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmap(alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Bitmap& ))( - &OutputDevice::DrawBitmap), - _1, - aPt1,aBitmapAlien )); + [&] (OutputDevice * pDev) { return pDev->DrawBitmap(aPt1, aBitmapAlien); }); /* void DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap ); */ add(res, "DrawBitmap", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Bitmap& ))( - &OutputDevice::DrawBitmap), - _1, - aPt1,aBitmap )); + [&] (OutputDevice * pDev) { return pDev->DrawBitmap(aPt1, aBitmap); }); /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap ); */ add(res, "DrawBitmap(scaled,alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Bitmap& ))( - &OutputDevice::DrawBitmap), - _1, - aPt1,aRect.GetSize(),aBitmapAlien )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmap(aPt1, aRect.GetSize(), aBitmapAlien); + }); /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap ); */ add(res, "DrawBitmap(scaled)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Bitmap& ))( - &OutputDevice::DrawBitmap), - _1, - aPt1,aRect.GetSize(),aBitmap )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmap(aPt1, aRect.GetSize(), aBitmap); + }); #if 0 /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize, @@ -346,15 +312,10 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmap(scaled subset,alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const Bitmap& ))( - &OutputDevice::DrawBitmap), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapAlien )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmap(aPt1, aRect.GetSize(), aPt3, + aRect2.GetSize(), aBitmapAlien); + }); #endif /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize, @@ -363,115 +324,73 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmap(scaled subset)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const Bitmap& ))( - &OutputDevice::DrawBitmap), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmap )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmap(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), aBitmap); + }); /* void DrawBitmapEx( const Point& rDestPt, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aBitmapExAlien )); + [&] (OutputDevice * pDev) { return pDev->DrawBitmapEx(aPt1, aBitmapExAlien); }); /* void DrawBitmapEx( const Point& rDestPt, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx", - boost::bind( - (void (OutputDevice::*)( const Point&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aBitmapEx )); + [&] (OutputDevice * pDev) { return pDev->DrawBitmapEx(aPt1, aBitmapEx); }); /* void DrawBitmapEx( const Point& rDestPt, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(alpha)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aBitmapExAlpha )); + [&] (OutputDevice * pDev) { return pDev->DrawBitmapEx(aPt1, aBitmapExAlpha); }); /* void DrawBitmapEx( const Point& rDestPt, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(alpha, alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aBitmapExAlphaAlien )); + [&] (OutputDevice * pDev) { return pDev->DrawBitmapEx(aPt1, aBitmapExAlphaAlien); }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(scaled,alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aBitmapExAlien )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aBitmapExAlien); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(scaled)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aBitmapEx )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aBitmapEx); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(scaled alpha)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aBitmapExAlpha )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aBitmapExAlpha); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const BitmapEx& rBitmapEx ); */ add(res, "DrawBitmapEx(scaled alpha, alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aBitmapExAlphaAlien )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aBitmapExAlphaAlien); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, @@ -479,15 +398,9 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmapEx(scaled subset,alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapExAlien )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), aBitmapExAlien); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, @@ -495,15 +408,9 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmapEx(scaled subset)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapEx )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), aBitmapEx); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, @@ -511,15 +418,9 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmapEx(scaled subset, alpha)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapExAlpha )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), aBitmapExAlpha); + }); /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, @@ -527,69 +428,45 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawBitmapEx(scaled subset, alpha alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const BitmapEx& ))( - &OutputDevice::DrawBitmapEx), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapExAlphaAlien )); + [&] (OutputDevice * pDev) { + return pDev->DrawBitmapEx(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), aBitmapExAlphaAlien); + }); /* void DrawMask( const Point& rDestPt, const Bitmap& rBitmap, const Color& rMaskColor ); */ add(res, "DrawMask(alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Bitmap&, - const Color& ))( - &OutputDevice::DrawMask), - _1, - aPt1,aBitmapAlien,aBlackColor )); + [&] (OutputDevice * pDev) { + return pDev->DrawMask(aPt1, aBitmapAlien, aBlackColor); + }); /* void DrawMask( const Point& rDestPt, const Bitmap& rBitmap, const Color& rMaskColor ); */ add(res, "DrawMask", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Bitmap&, - const Color& ))( - &OutputDevice::DrawMask), - _1, - aPt1,aBitmap,aBlackColor )); + [&] (OutputDevice * pDev) { + return pDev->DrawMask(aPt1, aBitmap, aBlackColor); + }); /* void DrawMask( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap, const Color& rMaskColor ); */ add(res, "DrawMask(scaled,alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Bitmap&, - const Color& ))( - &OutputDevice::DrawMask), - _1, - aPt1,aRect.GetSize(),aBitmapAlien, aBlackColor )); + [&] (OutputDevice * pDev) { + return pDev->DrawMask(aPt1, aRect.GetSize(), aBitmapAlien, aBlackColor); + }); /* void DrawMask( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap, const Color& rMaskColor ); */ add(res, "DrawMask(scaled)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Bitmap&, - const Color& ))( - &OutputDevice::DrawMask), - _1, - aPt1,aRect.GetSize(),aBitmap,aBlackColor )); + [&] (OutputDevice * pDev) { + return pDev->DrawMask(aPt1, aRect.GetSize(), aBitmap, aBlackColor); + }); /* void DrawMask( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, @@ -597,16 +474,10 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawMask(scaled subset,alien source)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const Bitmap&, - const Color& ))( - &OutputDevice::DrawMask), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmapAlien,aBlackColor )); + [&] (OutputDevice * pDev) { + return pDev->DrawMask(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), + aBitmapAlien, aBlackColor); + }); /* void DrawMask( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, @@ -614,108 +485,82 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawMask(scaled subset)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Point&, - const Size&, - const Bitmap&, - const Color& ))( - &OutputDevice::DrawMask), - _1, - aPt1,aRect.GetSize(),aPt3,aRect2.GetSize(),aBitmap,aBlackColor )); + [&] (OutputDevice * pDev) { + return pDev->DrawMask(aPt1, aRect.GetSize(), aPt3, aRect2.GetSize(), aBitmap, aBlackColor); + }); /* void DrawImage( const Point& rPos, const Image& rImage, sal_uInt16 nStyle = 0 ); */ add(res, "DrawImage", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Image&, - sal_uInt16 nStyle ))( - &OutputDevice::DrawImage), - _1, - aPt1,aImage,(sal_uInt16)0 )); + [&] (OutputDevice * pDev) { + return pDev->DrawImage(aPt1, aImage, static_cast<sal_uInt16>(0)); + }); /* void DrawImage( const Point& rPos, const Size& rSize, const Image& rImage, sal_uInt16 nStyle = 0 ); */ add(res, "DrawImage(scaled)", - boost::bind( - (void (OutputDevice::*)( const Point&, - const Size&, - const Image&, - sal_uInt16 nStyle ))( - &OutputDevice::DrawImage), - _1, - aPt1,aRect.GetSize(),aImage,(sal_uInt16)0 )); + [&] (OutputDevice * pDev) { + return pDev->DrawImage(aPt1, aRect.GetSize(), aImage, static_cast<sal_uInt16>(0))); + }); #endif // NEEDS_QUALITY_PARAMATER /* void DrawGradient( const Rectangle& rRect, const Gradient& rGradient ); */ add(res, "DrawGradient", - boost::bind( - (void (OutputDevice::*)( const Rectangle&, const Gradient& ))( - &OutputDevice::DrawGradient), - _1, - aRect,aGradient )); + [&] (OutputDevice * pDev) { + return pDev->DrawGradient(aRect, aGradient); + }); /* void DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ); */ add(res, "DrawGradient(polygon)", - boost::bind( - (void (OutputDevice::*)( const tools::PolyPolygon&, const Gradient& ))( - &OutputDevice::DrawGradient), - _1, - aPoly3,aGradient )); + [&] (OutputDevice * pDev) { + return pDev->DrawGradient(aPoly3, aGradient); + }); /* void DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch ); */ add(res, "DrawHatch", - boost::bind( - &OutputDevice::DrawHatch, - _1, - aPoly3,aHatch )); + [&] (OutputDevice * pDev) { + return pDev->DrawHatch(aPoly3, aHatch); + }); /* void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper ); */ add(res, "DrawWallpaper", - boost::bind( - &OutputDevice::DrawWallpaper, - _1, - aRect2,aWallpaper )); + [&] (OutputDevice * pDev) { + return pDev->DrawWallpaper(aRect2, aWallpaper); + }); #ifdef FIXME_HAVE_WAVE_NORMAL /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ); */ add(res, "DrawWaveLine", - boost::bind( - &OutputDevice::DrawWaveLine, - _1, - aPt1,aPt2,(sal_uInt16)WAVE_NORMAL )); + [&] (OutputDevice * pDev) { + return pDev->DrawWaveLine(aPt1, aPt2, (sal_uInt16)WAVE_NORMAL); + }); #endif /* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */ add(res, "DrawGrid", - boost::bind( - &OutputDevice::DrawGrid, - _1, - aRect,Size(10,20),DrawGridFlags::HorzLines|DrawGridFlags::VertLines )); + [&] (OutputDevice * pDev) { + return pDev->DrawGrid(aRect, Size(10,20), DrawGridFlags::HorzLines|DrawGridFlags::VertLines); + }); /* void DrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent ); */ add(res, "DrawTransparent", - boost::bind( - (void (OutputDevice::*)( const tools::PolyPolygon&, sal_uInt16 ))( - &OutputDevice::DrawTransparent), - _1, - aPoly3,(sal_uInt16)50 )); + [&] (OutputDevice * pDev) { + return pDev->DrawTransparent(aPoly3, (sal_uInt16)50); + }); /* void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize, @@ -723,21 +568,14 @@ void setupMethodStubs( functor_vector_type& res ) */ add(res, "DrawTransparent(metafile)", - boost::bind( - (void (OutputDevice::*)( const GDIMetaFile&, - const Point&, - const Size&, - const Gradient& ))( - &OutputDevice::DrawTransparent), - _1, - aMtf,aPt1,aRect.GetSize(),aGradient )); + [&] (OutputDevice * pDev) { + return pDev->DrawTransparent(aMtf, aPt1, aRect.GetSize(), aGradient); + }); /* void Erase(); */ add(res, "Erase", - boost::bind( - &OutputDevice::Erase, - _1 )); + [] (OutputDevice * pDev) { return pDev->Erase(); } ); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
