[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/impbmp.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 7ec5073951cf7b7f71369e0819f82ae2fc6971ac Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Tue Nov 3 12:22:29 2015 -0500 vcl: ImpBitmap optimize GetBitCount Use binary search to find ImpBitmap BitCount in constant time. Change-Id: Ica13d41d1473e01c9198c985d34206267d7910d1 Reviewed-on: https://gerrit.libreoffice.org/19759 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx index b79b0d4..ad1eca9 100644 --- a/vcl/source/gdi/impbmp.cxx +++ b/vcl/source/gdi/impbmp.cxx @@ -76,7 +76,8 @@ Size ImpBitmap::ImplGetSize() const sal_uInt16 ImpBitmap::ImplGetBitCount() const { sal_uInt16 nBitCount = mpSalBitmap->GetBitCount(); -return( ( nBitCount <= 1 ) ? 1 : ( nBitCount <= 4 ) ? 4 : ( nBitCount <= 8 ) ? 8 : 24 ); +return ( nBitCount <= 4 ) ? ( ( nBitCount <= 1 ) ? 1 : 4 ): +( ( nBitCount <= 8 ) ? 8 : 24); } BitmapBuffer* ImpBitmap::ImplAcquireBuffer( BitmapAccessMode nMode ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: Hot tip for vim users: highlight spaces at end of lines
> You could also run that :substitute on :w and never have to worry about > trailing whitespace ever again :) > > autocmd BufWritePre * :%s/\s\+$//e Great tip! Just remember if you place a `autocmd` in your vimrc to place it in a `augroup` and run `autocmd!`. Otherwise vim will create multiple `autocmd`s for this each time vimrc is sourced. If I'm correct something like the following will avoid that. E.g. augroup trailing_whitespace autocmd! autocmd BufWritePre * :%s/\s\+$//e augroup END Also for non-vim users, the git book has an incredible section on configuring git to help with whitespace issues. http://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#Formatting-and-Whitespace - Daniel signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Hot tip for vim users: highlight spaces at end of lines
In light of Norbert's comment maybe add *.cxx *.hxx augroup trailing_whitespace autocmd! autocmd BufWritePre *.cxx :%s/\s\+$//e autocmd BufWritePre *.hxx :%s/\s\+$//e augroup END signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: include/editeng
include/editeng/lrspitem.hxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 7dc6e2cb1778aed68e9bef64a7a196c94a72b7ec Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Wed Nov 4 13:20:59 2015 -0500 Remove unneeded bitfield Remove unecessary bitfield from editeng::SvxLRSpaceItem Change-Id: I255d3cd7d28e470ea59187c9e488d0a4a9350d3d Reviewed-on: https://gerrit.libreoffice.org/19786 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx index 6dd5cc0..191aa4b 100644 --- a/include/editeng/lrspitem.hxx +++ b/include/editeng/lrspitem.hxx @@ -56,9 +56,9 @@ class EDITENG_DLLPUBLIC SvxLRSpaceItem : public SfxPoolItem sal_uInt16 nPropFirstLineOfst, nPropLeftMargin, nPropRightMargin; short nFirstLineOfst; // First-line indent _always_ relative to nTxtLeft -boolbAutoFirst : 1;// Automatic calculation of the first line indent -boolbExplicitZeroMarginValRight : 1; -boolbExplicitZeroMarginValLeft : 1; +boolbAutoFirst;// Automatic calculation of the first line indent +boolbExplicitZeroMarginValRight; +boolbExplicitZeroMarginValLeft; void AdjustLeft();// nLeftMargin and nTxtLeft are being adjusted. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/rtl sal/CppunitTest_sal_rtl_ref.mk sal/Module_sal.mk sal/qa
include/rtl/ref.hxx| 27 + sal/CppunitTest_sal_rtl_ref.mk | 22 sal/Module_sal.mk |1 sal/qa/rtl/ref/rtl_ref.cxx | 112 + 4 files changed, 162 insertions(+) New commits: commit f15d11a9f8d6c783fd8c937256fa3372f8e4fe01 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Tue Nov 3 09:47:36 2015 -0500 rtl::Reference Add move construction/assignment Add move constructor and appropriately overloaded assignment operator to rtl::Reference, and add basic unit tests for the reference counting of rtl::Reference. Change-Id: Ia7ff5d786bdf3b17709cec06608c91e22379746c Reviewed-on: https://gerrit.libreoffice.org/19762 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx index 097584b..82dda83 100644 --- a/include/rtl/ref.hxx +++ b/include/rtl/ref.hxx @@ -72,6 +72,15 @@ public: m_pBody->acquire(); } +#ifdef LIBO_INTERNAL_ONLY +/** Move constructor... + */ +inline Reference (Reference && handle) +: m_pBody (handle.m_pBody) +{ +handle.m_pBody = nullptr; +} +#endif /** Destructor... */ @@ -106,6 +115,24 @@ public: return set( handle.m_pBody ); } +#ifdef LIBO_INTERNAL_ONLY +/** Assignment. + * Unbinds this instance from its body (if bound), + * bind it to the body represented by the handle, and + * set the body represented by the handle to nullptr. + */ +inline Reference & +SAL_CALL operator= (Reference && handle) +{ +// self-movement guts ourself +if (m_pBody) +m_pBody->release(); +m_pBody = handle.m_pBody; +handle.m_pBody = nullptr; +return *this; +} +#endif + /** Assignment... */ inline Reference & diff --git a/sal/CppunitTest_sal_rtl_ref.mk b/sal/CppunitTest_sal_rtl_ref.mk new file mode 100644 index 000..f42bf92 --- /dev/null +++ b/sal/CppunitTest_sal_rtl_ref.mk @@ -0,0 +1,22 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,sal_rtl_ref)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sal_rtl_ref,\ + sal/qa/rtl/ref/rtl_ref \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sal_rtl_ref,\ + sal \ + $(gb_UWINAPI) \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk index 192da93..0b02103 100644 --- a/sal/Module_sal.mk +++ b/sal/Module_sal.mk @@ -54,6 +54,7 @@ $(eval $(call gb_Module_add_check_targets,sal,\ CppunitTest_sal_rtl_oustring \ CppunitTest_sal_rtl_oustringbuffer \ CppunitTest_sal_rtl_process \ + CppunitTest_sal_rtl_ref \ CppunitTest_sal_rtl_strings \ CppunitTest_sal_rtl_textenc \ CppunitTest_sal_rtl_uri \ diff --git a/sal/qa/rtl/ref/rtl_ref.cxx b/sal/qa/rtl/ref/rtl_ref.cxx new file mode 100644 index 000..66d54e6 --- /dev/null +++ b/sal/qa/rtl/ref/rtl_ref.cxx @@ -0,0 +1,112 @@ +/* -*- 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/. + */ + +#include +#include +#include +#include +#include + +namespace rtl_ref +{ + +class MoveTestClass +{ +private: +bool m_bIncFlag; +long m_nRef; +public: +MoveTestClass(): m_bIncFlag(false), m_nRef(0) { } + +// There should never be more than two references to this class as it +// is used as a test class for move functions. One reference being the +// original reference and the second being the test reference +void acquire() +{ +if(m_bIncFlag) +{ +++m_nRef; +m_bIncFlag = false; +} +else +CPPUNIT_FAIL("RC was incremented when in should not have been"); +} + +void release() { --m_nRef; } + +long use_count() { return m_nRef; } + +void set_inc_flag() { m_bIncFlag = true; } +}; + +rtl::Reference< MoveTestClass > get_reference( MoveTestClass* pcTestClass ) +{ +// constructor will increment the reference count +pcTestClass->set_inc_flag(); +rtl::Reference< MoveTestClass > tmp(pcTestClass); +return tmp; +} + +class TestReferenceRefCounting : public CppUnit::TestFixture +{ +void testMove() +{ +MoveTestClass
[Libreoffice-commits] core.git: editeng/source include/editeng
editeng/source/items/frmitems.cxx |4 ++-- include/editeng/lrspitem.hxx |6 +++--- include/editeng/outliner.hxx |4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) New commits: commit f57a6593e21d45008173352fc29ededdbc2c8878 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Tue Nov 3 14:14:08 2015 -0500 editeng: Eliminate unecessary padding in classes Edit the order of SvxLRSpaceItem and PaintFirstLineInfo members to remove unecessary padding due to data alignment. Change-Id: Icf2c92ef86a32384e51d1cb6f1a079b10995dfd5 Reviewed-on: https://gerrit.libreoffice.org/19763 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthieb...@gmail.com> diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 11cbfe2..3aa5888 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -399,13 +399,13 @@ SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) : SfxPoolItem( nId ), -nFirstLineOfst ( 0 ), nTxtLeft( 0 ), nLeftMargin ( 0 ), nRightMargin( 0 ), nPropFirstLineOfst( 100 ), nPropLeftMargin( 100 ), nPropRightMargin( 100 ), +nFirstLineOfst ( 0 ), bAutoFirst ( false ), bExplicitZeroMarginValRight(false), bExplicitZeroMarginValLeft(false) @@ -420,13 +420,13 @@ SvxLRSpaceItem::SvxLRSpaceItem( const long nLeft, const long nRight, SfxPoolItem( nId ), -nFirstLineOfst ( nOfset ), nTxtLeft( nTLeft ), nLeftMargin ( nLeft ), nRightMargin( nRight ), nPropFirstLineOfst( 100 ), nPropLeftMargin( 100 ), nPropRightMargin( 100 ), +nFirstLineOfst ( nOfset ), bAutoFirst ( false ), bExplicitZeroMarginValRight(false), bExplicitZeroMarginValLeft(false) diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx index 40da999..94daed8 100644 --- a/include/editeng/lrspitem.hxx +++ b/include/editeng/lrspitem.hxx @@ -50,15 +50,15 @@ class EDITENG_DLLPUBLIC SvxLRSpaceItem : public SfxPoolItem { -short nFirstLineOfst; // First-line indent _always_ relative to nTxtLeft longnTxtLeft; // We spend a sal_uInt16 longnLeftMargin;// nLeft or the negative first-line indent longnRightMargin; // The unproblematic right edge sal_uInt16 nPropFirstLineOfst, nPropLeftMargin, nPropRightMargin; +short nFirstLineOfst; // First-line indent _always_ relative to nTxtLeft boolbAutoFirst : 1;// Automatic calculation of the first line indent -boolbExplicitZeroMarginValRight; -boolbExplicitZeroMarginValLeft; +boolbExplicitZeroMarginValRight : 1; +boolbExplicitZeroMarginValLeft : 1; void AdjustLeft();// nLeftMargin and nTxtLeft are being adjusted. diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 517c80a..50df0a9 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -479,14 +479,14 @@ public: struct EDITENG_DLLPUBLIC PaintFirstLineInfo { sal_Int32 mnPara; +short mnOrientation; const Point& mrStartPos; long mnBaseLineY; const Point& mrOrigin; -short mnOrientation; VclPtr mpOutDev; PaintFirstLineInfo( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) -: mnPara( nPara ), mrStartPos( rStartPos ), mnBaseLineY( nBaseLineY ), mrOrigin( rOrigin ), mnOrientation( nOrientation ), mpOutDev( pOutDev ) +: mnPara( nPara ), mnOrientation( nOrientation ), mrStartPos( rStartPos ), mnBaseLineY( nBaseLineY ), mrOrigin( rOrigin ), mpOutDev( pOutDev ) {} }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: slideshow/inc slideshow/source slideshow/test
slideshow/inc/pch/precompiled_slideshow.hxx |2 -- slideshow/source/engine/shapes/drawshape.cxx |1 + slideshow/source/inc/wakeupevent.hxx |1 - slideshow/test/testshape.cxx |2 -- 4 files changed, 1 insertion(+), 5 deletions(-) New commits: commit 7e5bada5540662ae5bde0522bacf28da1e856589 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Thu Oct 15 09:05:08 2015 -0400 slideshow: remove unecessary boost/bind includes All of the remaining includes of boost/bind.hpp may be removed from slideshow, as last remaining uses of boost::bind have been removed from the module. There should be no side effects due to this change. Change-Id: I4e1855545fad69d09e594d0be139c09aad561b2d Reviewed-on: https://gerrit.libreoffice.org/19395 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx index 07318fb..43eabbd 100644 --- a/slideshow/inc/pch/precompiled_slideshow.hxx +++ b/slideshow/inc/pch/precompiled_slideshow.hxx @@ -14,7 +14,6 @@ also fixes all possible problems, so it's usually better to use it). */ -#include "boost/bind.hpp" #include "com/sun/star/uno/Reference.hxx" #include "rtl/ref.hxx" #include @@ -38,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index 36271d3..e5329c1 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -46,6 +46,7 @@ #include #include +#include #include #include #include diff --git a/slideshow/source/inc/wakeupevent.hxx b/slideshow/source/inc/wakeupevent.hxx index 853ef58..9a29c61 100644 --- a/slideshow/source/inc/wakeupevent.hxx +++ b/slideshow/source/inc/wakeupevent.hxx @@ -24,7 +24,6 @@ #include "event.hxx" #include "activitiesqueue.hxx" -#include #include namespace slideshow { diff --git a/slideshow/test/testshape.cxx b/slideshow/test/testshape.cxx index 1aa5334..8eaf58e 100644 --- a/slideshow/test/testshape.cxx +++ b/slideshow/test/testshape.cxx @@ -33,8 +33,6 @@ #include "tests.hxx" #include "com/sun/star/presentation/XSlideShowView.hpp" -#include - namespace target = slideshow::internal; using namespace ::com::sun::star; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/eventmultiplexer.cxx | 107 ++- slideshow/source/inc/listenercontainer.hxx |4 - 2 files changed, 43 insertions(+), 68 deletions(-) New commits: commit 39c7826c814fb8043942f5d9e1f1f049641865e8 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Sun Oct 11 19:15:54 2015 -0400 tdf#93243 slideshow: boost::bind -> C++11 lambdas Replace boost::bind with C++11 lambdas. In addition, replace the use of FuncT::result_type in ListenerOperations::notifyAllListeners with a less type specific means of determining the return type of the function to be applied in order to allow for the use of C++11 lambdas. Change-Id: I1035be976e542d8b5bbd451c473a896d91ed66ca Reviewed-on: https://gerrit.libreoffice.org/19314 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 6de09f2..c28fca3 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -44,8 +44,7 @@ #include #include -#include -#include +#include #include #include @@ -118,8 +117,7 @@ typedef cppu::WeakComponentImplHelper< EventQueue indirection, to force the events into the main thread) */ class EventMultiplexerListener : private cppu::BaseMutex, - public Listener_UnoBase, - private ::boost::noncopyable + public Listener_UnoBase { public: EventMultiplexerListener( EventQueue& rEventQueue, @@ -130,6 +128,9 @@ public: { } +EventMultiplexerListener( const EventMultiplexerListener& ) = delete; +EventMultiplexerListener& operator=( const EventMultiplexerListener& ) = delete; + // WeakComponentImplHelperBase::disposing virtual void SAL_CALL disposing() override; @@ -421,8 +422,8 @@ bool EventMultiplexerImpl::notifyAllAnimationHandlers( ImplAnimationHandlers con AnimationNodeSharedPtr const& rNode ) { return rContainer.applyAll( -boost::bind( ::handleAnimationEvent, - _1, boost::cref(rNode) ) ); +[]( const AnimationEventHandlerSharedPtr& pEventHandler ) +{ return pEventHandler->handleAnimationEvent( rNode ); } ); } template @@ -455,10 +456,8 @@ UnoViewSharedPtr EventMultiplexerImpl::findUnoView( const UnoViewVector::const_iterator aEnd ( mrViewContainer.end() ); if( (aIter=std::find_if( mrViewContainer.begin(), aEnd, - boost::bind( - std::equal_to<uno::Reference >(), - boost::cref( xView ), - boost::bind( ::getUnoView, _1 == aEnd ) + []( const UnoViewSharedPtr& pView ) + { return xView == pView->getUnoView(); } )) == aEnd ) { OSL_FAIL("EventMultiplexer::findUnoView(): unexpected message source" ); return UnoViewSharedPtr(); @@ -607,10 +606,8 @@ bool EventMultiplexerImpl::notifyMouseHandlers( if( (aIter=::std::find_if( mrViewContainer.begin(), aEnd, - boost::bind( std::equal_to< uno::Reference< - presentation::XSlideShowView > >(), - boost::cref( xView ), - boost::bind( ::getUnoView, _1 ) ) ) ) == aEnd) + []( const UnoViewSharedPtr& pView ) + { return xView == pView->getUnoView(); } )) == aEnd ) { ENSURE_OR_RETURN_FALSE( false, "EventMultiplexer::notifyHandlers(): " @@ -633,12 +630,8 @@ bool EventMultiplexerImpl::notifyMouseHandlers( // one high-priority handler rejects the event // (i.e. returns false), try next handler. return rQueue.apply( -boost::bind( -pHandlerMethod, -boost::bind( -::container_type::value_type::getHandler, -_1 ), -aEvent )); +[, ]( const ImplMouseHandlerEntry& rMouseHandler ) +{ return ( ( *rMouseHandler.getHandler() ).*pHandlerMethod )( aEvent ); } ); } void EventMultiplexerImpl::mousePressed( const awt::MouseEvent& e ) @@ -705,11 +698,8 @@ bool EventMultiplexerImpl::notifyNextEffect() // high-priority handler rejects the event (i.e. returns false), // try next handler. return maNextEffectHandlers.apply( -boost::bind( -::handleEvent, -boost::bind( - ::container_type::value_type::getHandler, -_1 )) ); +[]( const PrioritizedHandlerEntry<
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/effectrewinder.cxx |8 ++-- slideshow/source/engine/rehearsetimingsactivity.cxx | 32 slideshow/source/engine/transitions/combtransition.cxx |9 +--- slideshow/source/engine/transitions/slidechangebase.cxx | 15 ++- slideshow/source/engine/unoviewcontainer.cxx| 27 +++-- slideshow/source/engine/usereventqueue.cxx | 24 +--- 6 files changed, 44 insertions(+), 71 deletions(-) New commits: commit 4038b27a0be01fbf6eab9b28cfe00f29e8eba1b7 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Mon Oct 12 17:36:14 2015 -0400 tdf#93243 slideshow: boost::bind -> C++11 lambdas Replace boost::bind with C++11 lambdas Change-Id: I37e769c88d997eaecf46c07e510cef6a30fbce8e Reviewed-on: https://gerrit.libreoffice.org/19334 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx index 5fcf1f5..a84b6fd 100644 --- a/slideshow/source/engine/effectrewinder.cxx +++ b/slideshow/source/engine/effectrewinder.cxx @@ -30,7 +30,6 @@ #include #include -#include #include using ::com::sun::star::uno::Reference; @@ -104,17 +103,18 @@ void EffectRewinder::initialize() mpAnimationStartHandler.reset( new RewinderAnimationEventHandler( -::boost::bind(::notifyAnimationStart, this, _1))); +[this]( const AnimationNodeSharedPtr& pNode) +{ return this->notifyAnimationStart( pNode ); } ) ); mrEventMultiplexer.addAnimationStartHandler(mpAnimationStartHandler); mpSlideStartHandler.reset( new RewinderEventHandler( -::boost::bind(::resetEffectCount, this))); +[this]() { return this->resetEffectCount(); } ) ); mrEventMultiplexer.addSlideStartHandler(mpSlideStartHandler); mpSlideEndHandler.reset( new RewinderEventHandler( -::boost::bind(::resetEffectCount, this))); +[this]() { return this->resetEffectCount(); } ) ); mrEventMultiplexer.addSlideEndHandler(mpSlideEndHandler); } diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index adfb7ea..c631a80 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -45,8 +45,6 @@ #include "mouseeventhandler.hxx" #include "rehearsetimingsactivity.hxx" -#include -#include #include using namespace com::sun::star; @@ -55,8 +53,7 @@ using namespace com::sun::star::uno; namespace slideshow { namespace internal { -class RehearseTimingsActivity::WakeupEvent : public Event, - private ::boost::noncopyable +class RehearseTimingsActivity::WakeupEvent : public Event { public: WakeupEvent( std::shared_ptr< ::canvas::tools::ElapsedTime > const& pTimeBase, @@ -69,6 +66,9 @@ public: mrActivityQueue( rActivityQueue ) {} +WakeupEvent( const WakeupEvent& ) = delete; +WakeupEvent& operator=( const WakeupEvent& ) = delete; + virtual void dispose() override {} virtual bool fire() override { @@ -108,12 +108,14 @@ private: ActivitiesQueue&mrActivityQueue; }; -class RehearseTimingsActivity::MouseHandler : public MouseEventHandler, - private boost::noncopyable +class RehearseTimingsActivity::MouseHandler : public MouseEventHandler { public: explicit MouseHandler( RehearseTimingsActivity& rta ); +MouseHandler( const MouseHandler& ) = delete; +MouseHandler& operator=( const MouseHandler& ) = delete; + void reset(); bool hasBeenClicked() const { return mbHasBeenClicked; } @@ -213,7 +215,8 @@ void RehearseTimingsActivity::start() // paint and show all sprites: paintAllSprites(); -for_each_sprite( boost::bind( ::Sprite::show, _1 ) ); +for_each_sprite( []( const ::cppcanvas::CustomSpriteSharedPtr& pSprite ) + { return pSprite->show(); } ); mrActivitiesQueue.addActivity( shared_from_this() ); @@ -231,7 +234,8 @@ double RehearseTimingsActivity::stop() mbActive = false; // will be removed from queue -for_each_sprite( boost::bind( ::Sprite::hide, _1 ) ); +for_each_sprite( []( const ::cppcanvas::CustomSpriteSharedPtr& pSprite ) + { return pSprite->hide(); } ); return maElapsedTime.getElapsedTime(); } @@ -392,10 +396,10 @@ void RehearseTimingsActivity::viewsChanged() // new sprite pos, transformation might have changed: maSpriteRectangle = calcSpriteRectangle( maViews.front().first ); +::basegfx::B2DPoint nMin = maSpri
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/shapes/shapeimporter.cxx |7 slideshow/source/engine/shapes/viewshape.cxx | 10 - slideshow/source/engine/slide/layermanager.cxx | 46 ++ slideshow/source/engine/slide/targetpropertiescreator.cxx | 16 -- slideshow/source/engine/slideshowimpl.cxx | 48 ++ slideshow/source/engine/slideview.cxx | 22 --- slideshow/source/engine/transitions/slidechangebase.cxx| 10 - slideshow/source/engine/transitions/slidetransitionfactory.cxx | 73 +++--- slideshow/source/engine/waitsymbol.cxx | 23 +-- slideshow/source/inc/listenercontainer.hxx | 34 +--- 10 files changed, 94 insertions(+), 195 deletions(-) New commits: commit b6297280853a7325ac0fa226b783652b22daebd0 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Fri Oct 9 09:21:20 2015 -0400 Replace simple while loops with range-based for Replace simple while loops with range-based for-loops when apropriate. There should be no side effects due to this change. Change-Id: I0c39d4c10c991354248e864a09333144974c953c Reviewed-on: https://gerrit.libreoffice.org/19281 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index c92e27a..21322f6 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -490,12 +490,10 @@ void ShapeImporter::importPolygons(uno::Reference const& xP aPoint.setY((*pInnerSequence).Y); aPoly.append( aPoint ); } -UnoViewVector::const_iterator aIter=(mrContext.mrViewContainer).begin(); -UnoViewVector::const_iterator aEnd=(mrContext.mrViewContainer).end(); -while(aIter != aEnd) +for( const auto& pView : mrContext.mrViewContainer ) { ::cppcanvas::PolyPolygonSharedPtr pPolyPoly( -::cppcanvas::BaseGfxFactory::createPolyPolygon( (*aIter)->getCanvas(), +::cppcanvas::BaseGfxFactory::createPolyPolygon( pView->getCanvas(), aPoly ) ); if( pPolyPoly ) { @@ -504,7 +502,6 @@ void ShapeImporter::importPolygons(uno::Reference const& xP pPolyPoly->draw(); maPolygons.push_back(pPolyPoly); } -++aIter; } } diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 9847882..05507e5 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -231,15 +231,11 @@ namespace slideshow bool bRet(true); -VectorOfDocTreeNodes::const_iteratoraIter( rSubsets.begin() ); -const VectorOfDocTreeNodes::const_iterator aEnd ( rSubsets.end() ); -while( aIter != aEnd ) +for( const auto& rSubset : rSubsets ) { -if( !pRenderer->drawSubset( aIter->getStartIndex(), -aIter->getEndIndex() ) ) +if( !pRenderer->drawSubset( rSubset.getStartIndex(), +rSubset.getEndIndex() ) ) bRet = false; - -++aIter; } return bRet; diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index aa555a8..3dbb554 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -53,11 +53,9 @@ namespace slideshow { LayerSharedPtr pCurrLayer; ViewLayerSharedPtr pCurrViewLayer; -LayerShapeMap::const_iterator aIter( maAllShapes.begin() ); -const LayerShapeMap::const_iterator aEnd ( maAllShapes.end() ); -while( aIter != aEnd ) +for( const auto& rShape : maAllShapes ) { -LayerSharedPtr pLayer = aIter->second.lock(); +LayerSharedPtr pLayer = rShape.second.lock(); if( pLayer && pLayer != pCurrLayer ) { pCurrLayer = pLayer; @@ -65,9 +63,7 @@ namespace slideshow } if( pCurrViewLayer ) -shapeFunc(aIter->first,pCurrViewLayer); - -++aIter; +shapeFunc(rShape.first,pCurrViewLayer); } } @@ -470,16 +466,14 @@ namespace slideshow // send update() calls to every shape in the
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/shapes/backgroundshape.cxx | 28 -- slideshow/source/engine/shapes/viewshape.cxx | 11 + slideshow/source/engine/slide/layer.cxx| 33 ++-- slideshow/source/engine/slide/layermanager.cxx | 24 slideshow/source/engine/slide/shapemanagerimpl.cxx |8 +--- slideshow/source/engine/slide/slideimpl.cxx|2 - slideshow/source/engine/slideshowimpl.cxx | 42 + 7 files changed, 52 insertions(+), 96 deletions(-) New commits: commit 91e0161dc5a0de0dcce1696aea318d919d5d04a1 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Sat Oct 10 12:43:34 2015 -0400 tdf#93243 slideshow: replace boost::bind Replace boost::bind with C++11 lambdas Change-Id: I13c500d085e6b8e80b2c067139db4ed0fffb2c71 Reviewed-on: https://gerrit.libreoffice.org/19299 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/source/engine/shapes/backgroundshape.cxx b/slideshow/source/engine/shapes/backgroundshape.cxx index d53105e..dc71e0d 100644 --- a/slideshow/source/engine/shapes/backgroundshape.cxx +++ b/slideshow/source/engine/shapes/backgroundshape.cxx @@ -27,8 +27,6 @@ #include -#include - #include #include #include @@ -169,11 +167,8 @@ namespace slideshow // already added? if( ::std::any_of( maViewShapes.begin(), maViewShapes.end(), - ::boost::bind( -::std::equal_to< ViewLayerSharedPtr >(), -::boost::bind( ::getViewLayer, - _1 ), -::boost::cref( rNewLayer ) ) ) ) + []( const ViewBackgroundShapeSharedPtr& pBgShape ) + { return pBgShape->getViewLayer() == rNewLayer; } ) ) { // yes, nothing to do return; @@ -195,22 +190,16 @@ namespace slideshow OSL_ENSURE( ::std::count_if(maViewShapes.begin(), aEnd, -::boost::bind( -::std::equal_to< ViewLayerSharedPtr >(), -::boost::bind( ::getViewLayer, - _1 ), -::boost::cref( rLayer ) ) ) < 2, +[]( const ViewBackgroundShapeSharedPtr& pBgShape ) +{ return pBgShape->getViewLayer() == rLayer; } ) < 2, "BackgroundShape::removeViewLayer(): Duplicate ViewLayer entries!" ); ViewBackgroundShapeVector::iterator aIter; if( (aIter=::std::remove_if( maViewShapes.begin(), aEnd, - ::boost::bind( - ::std::equal_to< ViewLayerSharedPtr >(), - ::boost::bind( ::getViewLayer, -_1 ), - ::boost::cref( rLayer ) ) )) == aEnd ) + []( const ViewBackgroundShapeSharedPtr& pBgShape ) + { return pBgShape->getViewLayer() == rLayer; } )) == aEnd ) { // view layer seemingly was not added, failed return false; @@ -280,9 +269,8 @@ namespace slideshow // redraw all view shapes, by calling their render() method if( ::std::count_if( maViewShapes.begin(), maViewShapes.end(), - ::boost::bind( ::render, -_1, -::boost::cref( mpMtf ) ) ) + [this]( const ViewBackgroundShapeSharedPtr& pBgShape ) + { return pBgShape->render( this->mpMtf ); } ) != static_cast(maViewShapes.size()) ) { // at least one of the ViewBackgroundShape::render() calls did return diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 05507e5..ed2ac3c 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -44,9 +44,6 @@ #include "viewshape.hxx" #include "tools.hxx" -#include - - using namespace ::com::sun::star; namespace slideshow @@ -742
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/slide/layer.cxx| 64 ++ slideshow/source/engine/slide/layermanager.cxx | 56 ++-- slideshow/source/engine/slide/shapemanagerimpl.cxx | 12 - slideshow/source/engine/slide/slideimpl.cxx| 64 +++--- slideshow/source/engine/slide/userpaintoverlay.cxx |9 - slideshow/source/engine/slideshowimpl.cxx | 21 +-- slideshow/source/engine/transitions/slidechangebase.cxx|7 - slideshow/source/engine/transitions/slidetransitionfactory.cxx |7 - slideshow/source/engine/unoviewcontainer.cxx |5 slideshow/source/engine/usereventqueue.cxx |5 slideshow/source/engine/waitsymbol.cxx |6 11 files changed, 82 insertions(+), 174 deletions(-) New commits: commit 6e8f1a3bd1c9110fe0a1b7978991800377e2908e Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Thu Oct 8 14:48:15 2015 -0400 slideshow: replace for_each with range-based for Replace ::std::for_each for a more readable range-based for loop in cases in which the function object to be applied by for_each is more readable as the body of a for loop. Change-Id: I5798293cdd0d784cc4c95c67e3fc6a0b930db8bb Reviewed-on: https://gerrit.libreoffice.org/19261 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/source/engine/slide/layer.cxx b/slideshow/source/engine/slide/layer.cxx index 61544af..5f6ebfa 100644 --- a/slideshow/source/engine/slide/layer.cxx +++ b/slideshow/source/engine/slide/layer.cxx @@ -129,25 +129,16 @@ namespace slideshow { rShape->clearAllViewLayers(); -std::for_each( maViewEntries.begin(), - maViewEntries.end(), - boost::bind(::addViewLayer, - boost::cref(rShape), - boost::bind(::getViewLayer, - _1), - false )); +for( const auto& rViewEntry : maViewEntries ) +rShape->addViewLayer( rViewEntry.getViewLayer(), false ); } void Layer::setPriority( const ::basegfx::B1DRange& rPrioRange ) { if( !mbBackgroundLayer ) { -std::for_each( maViewEntries.begin(), - maViewEntries.end(), - boost::bind( ::setPriority, -boost::bind( ::getViewLayer, - _1 ), -boost::cref(rPrioRange))); +for( const auto& rViewEntry : maViewEntries ) +rViewEntry.getViewLayer()->setPriority( rPrioRange ); } } @@ -208,13 +199,8 @@ namespace slideshow void Layer::clearContent() { // clear content on all view layers -std::for_each( maViewEntries.begin(), - maViewEntries.end(), - boost::bind( - ::clearAll, - boost::bind( - ::getViewLayer, - _1))); +for( const auto& rViewEntry : maViewEntries ) +rViewEntry.getViewLayer()->clearAll(); // layer content cleared, update areas are not sensible // anymore. @@ -250,24 +236,16 @@ namespace slideshow // resulting clip polygon will be empty. if( aClip.count() ) { -// set clip to all view layers -std::for_each( maViewEntries.begin(), - maViewEntries.end(), - boost::bind( - ::setClip, - boost::bind( - ::getViewLayer, - _1), - boost::cref(aClip))); - -// clear update area on all view layers -std::for_each( maViewEntries.begin(), - maViewEntries.end(), - boost::bind( - ::clear, - boost::bind( - ::getViewLayer, - _1))); +for( const auto& rViewEntry : maViewEntries ) +{ +ViewLa
[Libreoffice-commits] core.git: chart2/source
chart2/source/controller/dialogs/DataBrowser.cxx| 14 +-- chart2/source/controller/inc/ItemPropertyMap.hxx| 35 - chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx | 10 +- chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx | 12 +-- chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx | 13 +-- chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx | 8 +- chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx | 13 +-- chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx | 12 +-- chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx | 13 +-- chart2/source/controller/main/ChartController_Insert.cxx| 38 -- chart2/source/controller/main/ChartController_Tools.cxx | 6 + chart2/source/controller/main/CommandDispatch.cxx | 29 ++- chart2/source/inc/DisposeHelper.hxx | 34 chart2/source/tools/InternalDataProvider.cxx| 4 - 14 files changed, 77 insertions(+), 164 deletions(-) New commits: commit 391f181c9f82fec1988ce2c364c7afd1b0f49719 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Sun Sep 27 19:21:35 2015 -0400 chart2: replace for_each with range-based for Replace complex uses of ::std::for_each with a range-based for-loop. Change-Id: I6f3d8488a63a5bed271ab70ad6f024e9869906cc Reviewed-on: https://gerrit.libreoffice.org/19143 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index d318371..d62e13d 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -401,14 +401,6 @@ Image SeriesHeader::GetChartTypeImage( return aResult; } -struct applyChangesFunctor : public ::std::unary_function< std::shared_ptr< SeriesHeader >, void > -{ -void operator() ( std::shared_ptr< SeriesHeader > spHeader ) -{ -spHeader->applyChanges(); -} -}; - } // namespace impl namespace @@ -541,7 +533,8 @@ bool DataBrowser::MaySwapColumns() const void DataBrowser::clearHeaders() { -::std::for_each( m_aSeriesHeaders.begin(), m_aSeriesHeaders.end(), impl::applyChangesFunctor()); +for( const auto& spHeader : m_aSeriesHeaders ) +spHeader->applyChanges(); m_aSeriesHeaders.clear(); } @@ -1183,7 +1176,8 @@ bool DataBrowser::EndEditing() SaveModified(); // apply changes made to series headers -::std::for_each( m_aSeriesHeaders.begin(), m_aSeriesHeaders.end(), impl::applyChangesFunctor()); +for( const auto& spHeader : m_aSeriesHeaders ) +spHeader->applyChanges(); if( m_bDataValid ) return true; diff --git a/chart2/source/controller/inc/ItemPropertyMap.hxx b/chart2/source/controller/inc/ItemPropertyMap.hxx index d62aa0e..f2fa063 100644 --- a/chart2/source/controller/inc/ItemPropertyMap.hxx +++ b/chart2/source/controller/inc/ItemPropertyMap.hxx @@ -32,41 +32,6 @@ typedef ::std::map< ItemConverter::tWhichIdType, ::std::pair< ItemConverter::tPr typedef ::comphelper::MakeMap< ItemConverter::tWhichIdType, ::std::pair< ItemConverter::tPropertyNameType, ItemConverter::tMemberIdType > > MakeItemPropertyMap; -class FillItemSetFunc : public ::std::unary_function< ItemConverter *, void > -{ -public: -explicit FillItemSetFunc( SfxItemSet & rOutItemSet ) : -m_rOutItemSet( rOutItemSet ) -{} - -void operator() ( ItemConverter * pConv ) -{ -pConv->FillItemSet( m_rOutItemSet ); -} - -private: -SfxItemSet & m_rOutItemSet; -}; - -class ApplyItemSetFunc : public ::std::unary_function< ItemConverter *, void > -{ -public: -explicit ApplyItemSetFunc( const SfxItemSet & rItemSet, - bool & rOutResult ) : -m_rItemSet( rItemSet ), -m_rOutResult( rOutResult ) -{} - -void operator() ( ItemConverter * pConv ) -{ -m_rOutResult = pConv->ApplyItemSet( m_rItemSet ) || m_rOutResult; -} - -private: -const SfxItemSet & m_rItemSet; -bool & m_rOutResult; -}; - }} #endif diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index b155a46..59f0b79 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -30,6
[Libreoffice-commits] core.git: comphelper/CppunitTest_comphelper_variadictemplates_test.mk comphelper/Module_comphelper.mk comphelper/qa desktop/source include/comphelper sc/source
comphelper/CppunitTest_comphelper_variadictemplates_test.mk | 33 + comphelper/Module_comphelper.mk |1 comphelper/qa/unit/variadictemplates.cxx| 234 desktop/source/deployment/dp_services.cxx |1 include/comphelper/servicedecl.hxx | 70 +-- include/comphelper/unwrapargs.hxx | 164 +++- sc/source/ui/vba/vbaworkbook.cxx|1 7 files changed, 370 insertions(+), 134 deletions(-) New commits: commit 6ca355d281133c1e0e54df4e4710a4e99bc38c17 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Fri Sep 25 22:09:56 2015 -0400 tdf#94228 comphelper: replace BOOST_PP Replace BOOST_PP macros in comphelper with variadic templates. The client interface should not change. However, there are a few side effects due to this change. The most important being 1) There is no longer a maximum number of service declarations limmited by default at 12 for unwrapArgs and component_getFactoryHelper. 2) component_getFactoryHelper now terminates early as soon as pRet is not a null pointer. Change-Id: I016fd208d0e80f91d8669fff29d58b6189e946d3 Reviewed-on: https://gerrit.libreoffice.org/18891 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/comphelper/CppunitTest_comphelper_variadictemplates_test.mk b/comphelper/CppunitTest_comphelper_variadictemplates_test.mk new file mode 100644 index 000..21e8753 --- /dev/null +++ b/comphelper/CppunitTest_comphelper_variadictemplates_test.mk @@ -0,0 +1,33 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,comphelper_variadictemplates_test)) + +$(eval $(call gb_CppunitTest_add_exception_objects,comphelper_variadictemplates_test, \ +comphelper/qa/unit/variadictemplates \ +)) + +$(eval $(call gb_CppunitTest_use_api,comphelper_variadictemplates_test, \ + udkapi \ + offapi \ +)) + +$(eval $(call gb_CppunitTest_use_externals,comphelper_variadictemplates_test, \ + boost_headers \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,comphelper_variadictemplates_test, \ +comphelper \ +cppuhelper \ +cppu \ +sal \ +$(gb_UWINAPI) \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/comphelper/Module_comphelper.mk b/comphelper/Module_comphelper.mk index 75d7c2a..acd50c6 100644 --- a/comphelper/Module_comphelper.mk +++ b/comphelper/Module_comphelper.mk @@ -29,6 +29,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,comphelper,\ $(eval $(call gb_Module_add_check_targets,comphelper,\ CppunitTest_comphelper_syntaxhighlight_test \ +CppunitTest_comphelper_variadictemplates_test \ CppunitTest_comphelper_test \ )) diff --git a/comphelper/qa/unit/variadictemplates.cxx b/comphelper/qa/unit/variadictemplates.cxx new file mode 100644 index 000..78f3bd7 --- /dev/null +++ b/comphelper/qa/unit/variadictemplates.cxx @@ -0,0 +1,234 @@ +/* -*- 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/. + */ + +#include +#include +#include +#include +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" + +#include + +class VariadicTemplatesTest : public CppUnit::TestFixture +{ +public: +void testUnwrapArgs(); +void testServiceDecl(); + +CPPUNIT_TEST_SUITE(VariadicTemplatesTest); +CPPUNIT_TEST(testUnwrapArgs); +CPPUNIT_TEST(testServiceDecl); +CPPUNIT_TEST_SUITE_END(); +}; + +namespace { + +namespace detail { + +template +inline void extract( +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> const& seq, +sal_Int32 nArg, T & v, +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> +const& xErrorContext ) +{ +if (nArg >= seq.getLength()) { +throw ::com::sun::star::lang::IllegalArgumentException( +OUString( "No such argument available!"), +xErrorContext, static_cast(nArg) ); +} +if (! (seq[nArg] >>= v)) { +OUStringBuffer buf; +buf.append( "Cannot extract ANY { " ); +buf.append( seq[nArg].getValueType().getTypeName() ); +
[Libreoffice-commits] core.git: vcl/opengl
vcl/opengl/salbmp.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ebfc6b6863fa54abd33ba95130a8434c70e42f58 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Wed Sep 30 22:10:37 2015 -0400 vcl: Fix possible memory leak in OpenGLSalBitmap Fix possible memory leak in OpenGLSalBitmap::CreateTexture Change-Id: Ic2d259569a5e89f60af7065b9d66ef03f82f90e7 Reviewed-on: https://gerrit.libreoffice.org/19049 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 53e4687..a42cbae 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -447,6 +447,7 @@ GLuint OpenGLSalBitmap::CreateTexture() pSrcData += mnBytesPerRow; } +delete pSrcFormat; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/inc desktop/source include/comphelper sfx2/inc sfx2/source sw/inc sw/source unoxml/source vcl/osx
desktop/inc/pch/precompiled_deployment.hxx|1 desktop/inc/pch/precompiled_deploymentmisc.hxx|1 desktop/source/deployment/misc/dp_descriptioninfoset.cxx |5 desktop/source/deployment/registry/package/dp_package.cxx |4 include/comphelper/makesequence.hxx | 80 -- sfx2/inc/pch/precompiled_sfx.hxx |1 sfx2/source/doc/DocumentMetadataAccess.cxx|4 sw/inc/pch/precompiled_sw.hxx |1 sw/source/core/unocore/unocoll.cxx|5 sw/source/core/unocore/unodraw.cxx|3 sw/source/filter/xml/wrtxml.cxx |1 unoxml/source/rdf/librdf_repository.cxx |1 vcl/osx/DragSource.cxx|3 vcl/osx/DropTarget.cxx|3 vcl/osx/clipboard.cxx |3 15 files changed, 10 insertions(+), 106 deletions(-) New commits: commit 8b00ac9b4627d8d7ed13d352ccb8932be6861d97 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Fri Sep 25 12:26:58 2015 -0400 tdf#94228 comphelper: replace BOOST_PP Remove makeSequence. Change-Id: If07dc8702d81fc634c9c7eb4c9a331517ca5 Reviewed-on: https://gerrit.libreoffice.org/18647 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/desktop/inc/pch/precompiled_deployment.hxx b/desktop/inc/pch/precompiled_deployment.hxx index e8b9ba7..2a269e9 100644 --- a/desktop/inc/pch/precompiled_deployment.hxx +++ b/desktop/inc/pch/precompiled_deployment.hxx @@ -106,7 +106,6 @@ #include #include #include -#include #include #include #include diff --git a/desktop/inc/pch/precompiled_deploymentmisc.hxx b/desktop/inc/pch/precompiled_deploymentmisc.hxx index f2fcae9..e6fbc1b 100644 --- a/desktop/inc/pch/precompiled_deploymentmisc.hxx +++ b/desktop/inc/pch/precompiled_deploymentmisc.hxx @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index 8ba5b0a..984e253 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -469,7 +468,7 @@ css::uno::Sequence< OUString > DescriptionInfoset::getSupportedPlaforms() const //When there is no description.xml then we assume that we support all platforms if (! m_element.is()) { -return comphelper::makeSequence( OUString("all") ); +return { OUString("all") }; } //Check if the element was provided. If not the default is "all" platforms @@ -477,7 +476,7 @@ css::uno::Sequence< OUString > DescriptionInfoset::getSupportedPlaforms() const m_xpath->selectSingleNode(m_element, "desc:platform")); if (!nodePlatform.is()) { -return comphelper::makeSequence( OUString("all") ); +return { OUString("all") }; } //There is a platform element. diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index b97c458..4f974ec 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -344,8 +343,7 @@ sal_Bool BackendImpl::supportsService(OUString const & ServiceName) Sequence BackendImpl::getSupportedServiceNames() throw (RuntimeException, std::exception) { -return comphelper::makeSequence( -OUString(BACKEND_SERVICE_NAME) ); +return { OUString(BACKEND_SERVICE_NAME) }; } // XPackageRegistry diff --git a/include/comphelper/makesequence.hxx b/include/comphelper/makesequence.hxx deleted file mode 100644 index 48bb57c..000 --- a/include/comphelper/makesequence.hxx +++ /dev/null @@ -1,80 +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 - * owner
[Libreoffice-commits] core.git: comphelper/source
comphelper/source/container/NamedPropertyValuesContainer.cxx |9 comphelper/source/container/embeddedobjectcontainer.cxx | 86 ++ comphelper/source/container/namecontainer.cxx|7 comphelper/source/eventattachermgr/eventattachermgr.cxx | 150 +++ comphelper/source/misc/accessiblewrapper.cxx | 64 +--- comphelper/source/property/MasterPropertySet.cxx | 36 -- comphelper/source/property/MasterPropertySetInfo.cxx | 18 - comphelper/source/property/propertysetinfo.cxx |7 8 files changed, 137 insertions(+), 240 deletions(-) New commits: commit 96fa0df15b2be95fc3c4dc3df8ad9b77a4baeebd Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Wed Sep 23 08:53:42 2015 -0400 comphelper: replace for_each with range-based for Replace complex uses of ::std::for_each with a range-based for-loop. Change-Id: I57d3d2e830e7700b793e1836777cbe72504c6825 Reviewed-on: https://gerrit.libreoffice.org/18817 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx index 391e050..513813f 100644 --- a/comphelper/source/container/NamedPropertyValuesContainer.cxx +++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx @@ -151,16 +151,11 @@ css::uno::Any SAL_CALL NamedPropertyValuesContainer::getByName( const OUString& css::uno::Sequence< OUString > SAL_CALL NamedPropertyValuesContainer::getElementNames( ) throw(css::uno::RuntimeException, std::exception) { -NamedPropertyValues::iterator aIter = maProperties.begin(); -const NamedPropertyValues::iterator aEnd = maProperties.end(); - uno::Sequence< OUString > aNames( maProperties.size() ); OUString* pNames = aNames.getArray(); -while( aIter != aEnd ) -{ -*pNames++ = (*aIter++).first; -} +for( const auto& rProperty : maProperties ) +*pNames++ = rProperty.first; return aNames; } diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 778b326..2dbbe7a 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -196,11 +196,10 @@ EmbeddedObjectContainer::~EmbeddedObjectContainer() void EmbeddedObjectContainer::CloseEmbeddedObjects() { -EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.begin(); -while ( aIt != pImpl->maObjectContainer.end() ) +for( const auto& rObj : pImpl->maObjectContainer ) { -uno::Reference < util::XCloseable > xClose( (*aIt).second, uno::UNO_QUERY ); -if ( xClose.is() ) +uno::Reference < util::XCloseable > xClose( rObj.second, uno::UNO_QUERY ); +if( xClose.is() ) { try { @@ -210,8 +209,6 @@ void EmbeddedObjectContainer::CloseEmbeddedObjects() { } } - -++aIt; } } @@ -234,10 +231,11 @@ OUString EmbeddedObjectContainer::CreateUniqueObjectName() uno::Sequence < OUString > EmbeddedObjectContainer::GetObjectNames() { uno::Sequence < OUString > aSeq( pImpl->maObjectContainer.size() ); -EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.begin(); -sal_Int32 nIdx=0; -while ( aIt != pImpl->maObjectContainer.end() ) -aSeq[nIdx++] = (*aIt++).first; +OUString* pNames = aSeq.getArray(); + +for( const auto& rObj : pImpl->maObjectContainer ) +*pNames++ = rObj.first; + return aSeq; } @@ -260,15 +258,11 @@ bool EmbeddedObjectContainer::HasEmbeddedObject( const OUString& rName ) bool EmbeddedObjectContainer::HasEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj ) { -EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.begin(); -while ( aIt != pImpl->maObjectContainer.end() ) +for( const auto& rObj : pImpl->maObjectContainer ) { -if ( (*aIt).second == xObj ) +if( rObj.second == xObj ) return true; -else -++aIt; } - return false; } @@ -283,15 +277,11 @@ bool EmbeddedObjectContainer::HasInstantiatedEmbeddedObject( const OUString& rNa OUString EmbeddedObjectContainer::GetEmbeddedObjectName( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj ) { -EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.begin(); -while ( aIt != pImpl->maObjectContainer.end() ) +for( const auto& rObj : pImpl->maObjectContainer ) { -if ( (*aIt).second == xObj ) -return (*aIt).first; -els
[Libreoffice-commits] core.git: compilerplugins/clang
compilerplugins/clang/compat.hxx |6 +++--- compilerplugins/clang/refcounting.cxx |2 +- compilerplugins/clang/staticmethods.cxx |2 +- compilerplugins/clang/unusedvariablecheck.cxx |2 +- compilerplugins/clang/vclwidgets.cxx |2 +- 5 files changed, 7 insertions(+), 7 deletions(-) New commits: commit ef779d339e202dacea30b68ca8014207171e9ce4 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Sun Sep 20 19:37:48 2015 -0400 tdf#94389 compilerplugins: clang 3.7.0 Fix errors that occur in build with clang 3.7.0 Change-Id: I0e8743f2b6a288d10b4e78e884ce34cfca4dd77c Reviewed-on: https://gerrit.libreoffice.org/18738 Reviewed-by: Stephan Bergmann <sberg...@redhat.com> Tested-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index 22ed14b..0ca37fa 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -71,7 +71,7 @@ inline bool forallBases( void* callbackParam, bool AllowShortCircuit) { -#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3 +#if (__clang_major__ == 3 && __clang_minor__ > 7) || __clang_major__ > 3 (void) callbackParam; return decl.forallBases(BaseMatches, AllowShortCircuit); #else @@ -146,7 +146,7 @@ inline clang::QualType getParamType( inline clang::Stmt::const_child_iterator begin( clang::Stmt::const_child_range const & range) { -#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3 +#if (__clang_major__ == 3 && __clang_minor__ > 7) || __clang_major__ > 3 return range.begin(); #else return range.first; @@ -156,7 +156,7 @@ inline clang::Stmt::const_child_iterator begin( inline clang::Stmt::const_child_iterator end( clang::Stmt::const_child_range const & range) { -#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3 +#if (__clang_major__ == 3 && __clang_minor__ > 7) || __clang_major__ > 3 return range.end(); #else return range.second; diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx index 3a6c715..882d686 100644 --- a/compilerplugins/clang/refcounting.cxx +++ b/compilerplugins/clang/refcounting.cxx @@ -83,7 +83,7 @@ bool isDerivedFrom(const CXXRecordDecl *decl, const char *pString) { !decl->hasAnyDependentBases() && !compat::forallBases( *decl, -#if __clang_major__ == 3 && __clang_minor__ < 7 +#if __clang_major__ == 3 && __clang_minor__ <= 7 BaseCheckNotSubclass, #else [pString](const CXXRecordDecl *BaseDefinition) -> bool diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx index a02348f..42c958d 100644 --- a/compilerplugins/clang/staticmethods.cxx +++ b/compilerplugins/clang/staticmethods.cxx @@ -38,7 +38,7 @@ private: bool BaseCheckNotTestFixtureSubclass( const CXXRecordDecl *BaseDefinition -#if __clang_major__ == 3 && __clang_minor__ < 7 +#if __clang_major__ == 3 && __clang_minor__ <= 7 , void * #endif ) diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx index 80e32b8..ce35afe 100644 --- a/compilerplugins/clang/unusedvariablecheck.cxx +++ b/compilerplugins/clang/unusedvariablecheck.cxx @@ -51,7 +51,7 @@ void UnusedVariableCheck::run() bool BaseCheckNotDialogSubclass( const CXXRecordDecl *BaseDefinition -#if __clang_major__ == 3 && __clang_minor__ < 7 +#if __clang_major__ == 3 && __clang_minor__ <= 7 , void * #endif ) diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx index ea0cdff..6873ae2 100644 --- a/compilerplugins/clang/vclwidgets.cxx +++ b/compilerplugins/clang/vclwidgets.cxx @@ -59,7 +59,7 @@ static bool startsWith(const std::string& s, const char* other) bool BaseCheckNotWindowSubclass( const CXXRecordDecl *BaseDefinition -#if __clang_major__ == 3 && __clang_minor__ < 7 +#if __clang_major__ == 3 && __clang_minor__ <= 7 , void * #endif ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svtools/source
include/vcl/checksum.hxx| 19 +-- svtools/source/graphic/grfcache.cxx |2 +- 2 files changed, 10 insertions(+), 11 deletions(-) New commits: commit 54045cc813c79e53abe608cc1a8d35ee7177465e Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Tue Sep 15 14:51:26 2015 -0400 tdf#94228 vcl: replace BOOST_PP with templates Replace BOOST_PP macros in Bitmap Checksum to Bitmap Checksum Octet Array with templates. Change-Id: Ia7cbc20c90b4d99d54760580e3db10afac9020f3 Reviewed-on: https://gerrit.libreoffice.org/18597 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx index 7e1076f..21674a8 100644 --- a/include/vcl/checksum.hxx +++ b/include/vcl/checksum.hxx @@ -26,23 +26,22 @@ #include #include -#include -#include -#include - #define BITMAP_CHECKSUM_SIZE 8 -#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8) typedef sal_uInt64 BitmapChecksum; typedef sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE]; -#define BITMAP_CHECKSUM_SET_OCTET(z, i, unused) \ -p[i] = (sal_uInt8)(n >> BOOST_PP_MUL(8, i)); - +template< sal_uInt8 N = 0 > +inline void BCToBCOA( BitmapChecksum n, BitmapChecksumOctetArray p ) +{ + p[N] = (sal_uInt8)(n >> ( 8 * N )); + return BCToBCOA< N + 1 >( n, p ); +} -inline void BCToBCOA( BitmapChecksum n , BitmapChecksumOctetArray p ) +template<> +inline void BCToBCOA< BITMAP_CHECKSUM_SIZE >( BitmapChecksum, BitmapChecksumOctetArray ) { -BOOST_PP_REPEAT(BITMAP_CHECKSUM_SIZE , BITMAP_CHECKSUM_SET_OCTET, unused) +return; } #ifdef __cplusplus diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index ccc2440..2e29e31 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -134,7 +134,7 @@ OString GraphicID::GetIDString() const for( nShift = 28; nShift >= 0; nShift -= 4 ) aHexStr[nIndex++] = aHexData[ ( mnID3 >> (sal_uInt32) nShift ) & 0xf ]; -for( nShift = BITMAP_CHECKSUM_BITS - 4; nShift >= 0; nShift -= 4 ) +for( nShift = ( 8 * BITMAP_CHECKSUM_SIZE ) - 4; nShift >= 0; nShift -= 4 ) aHexStr[nIndex++] = aHexData[ ( mnID4 >> (sal_uInt32) nShift ) & 0xf ]; return aHexStr.makeStringAndClear(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: editeng/source include/editeng
editeng/source/outliner/outlobj.cxx | 164 +++- include/editeng/outlobj.hxx | 31 +- 2 files changed, 81 insertions(+), 114 deletions(-) New commits: commit e9e5fee720eb72fe789651861f48982d3d87674d Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Mon Sep 7 18:43:31 2015 -0400 tdf#62525 editeng: OutlinerParaObject Convert the pimpled copy-on-write OutlinerParaObject class from editeng to use ::o3tl::cow_wrapper using the default reference counting policy. Change-Id: I7009b9623d5be1bdf806ccaa6781cba82553c302 Reviewed-on: https://gerrit.libreoffice.org/18391 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index cb40988..9b65120 100644 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx @@ -32,169 +32,117 @@ #include #include -#include +#include #include -/** - * This is the guts of OutlinerParaObject, refcounted and shared among - * multiple instances of OutlinerParaObject. - */ -struct OutlinerParaObjData +OutlinerParaObjData::OutlinerParaObjData( EditTextObject* pEditTextObject, const ParagraphDataVector& rParagraphDataVector, bool bIsEditDoc ) : +mpEditTextObject(pEditTextObject), +maParagraphDataVector(rParagraphDataVector), +mbIsEditDoc(bIsEditDoc) { -// data members -EditTextObject* mpEditTextObject; -ParagraphDataVector maParagraphDataVector; -boolmbIsEditDoc; - -// refcounter -mutable size_t mnRefCount; - -// constuctor -OutlinerParaObjData( EditTextObject* pEditTextObject, const ParagraphDataVector& rParagraphDataVector, bool bIsEditDoc ) : -mpEditTextObject(pEditTextObject), -maParagraphDataVector(rParagraphDataVector), -mbIsEditDoc(bIsEditDoc), -mnRefCount(0) -{ -if( maParagraphDataVector.empty() && (pEditTextObject->GetParagraphCount() != 0) ) -maParagraphDataVector.resize(pEditTextObject->GetParagraphCount()); -} - -OutlinerParaObjData( const OutlinerParaObjData& r ) : -mpEditTextObject(r.mpEditTextObject->Clone()), -maParagraphDataVector(r.maParagraphDataVector), -mbIsEditDoc(r.mbIsEditDoc), -mnRefCount(0) -{} - -// destructor -~OutlinerParaObjData() -{ -delete mpEditTextObject; -} - -bool operator==(const OutlinerParaObjData& rCandidate) const -{ -return (*mpEditTextObject == *rCandidate.mpEditTextObject -&& maParagraphDataVector == rCandidate.maParagraphDataVector -&& mbIsEditDoc == rCandidate.mbIsEditDoc); -} - -// #i102062# -bool isWrongListEqual(const OutlinerParaObjData& rCompare) const -{ -return mpEditTextObject->isWrongListEqual(*rCompare.mpEditTextObject); -} -}; +if( maParagraphDataVector.empty() && (pEditTextObject->GetParagraphCount() != 0) ) +maParagraphDataVector.resize(pEditTextObject->GetParagraphCount()); +} -inline void intrusive_ptr_add_ref(const OutlinerParaObjData* p) +OutlinerParaObjData::OutlinerParaObjData( const OutlinerParaObjData& r ): +mpEditTextObject(r.mpEditTextObject->Clone()), +maParagraphDataVector(r.maParagraphDataVector), +mbIsEditDoc(r.mbIsEditDoc) { -++p->mnRefCount; } -inline void intrusive_ptr_release(const OutlinerParaObjData* p) +OutlinerParaObjData::~OutlinerParaObjData() { ---p->mnRefCount; -if (!p->mnRefCount) -delete p; +delete mpEditTextObject; } -struct OutlinerParaObject::Impl +bool OutlinerParaObjData::operator==(const OutlinerParaObjData& rCandidate) const { -typedef boost::intrusive_ptr DataRef; -DataRef mxData; - -Impl( const EditTextObject& rTextObj, const ParagraphDataVector& rParaData, bool bIsEditDoc ) : -mxData(new OutlinerParaObjData(rTextObj.Clone(), rParaData, bIsEditDoc)) {} - -explicit Impl(const EditTextObject& rTextObj) : -mxData(new OutlinerParaObjData(rTextObj.Clone(), ParagraphDataVector(), true)) {} - -Impl( const Impl& r ) : mxData(r.mxData) {} - -~Impl() {} -}; +return (*mpEditTextObject == *rCandidate.mpEditTextObject +&& maParagraphDataVector == rCandidate.maParagraphDataVector +&& mbIsEditDoc == rCandidate.mbIsEditDoc); +} -void OutlinerParaObject::ImplMakeUnique() +bool OutlinerParaObjData::isWrongListEqual(const OutlinerParaObjData& rCompare) const { -mpImpl->mxData.reset(new OutlinerParaObjData(*mpImpl->mxData)); +return mpEditTextObject->isWrongListEqual(*rCompare.mpEditTextObject); } OutlinerParaObject::OutlinerParaObject( const EditTextObject& rTe
[Libreoffice-commits] core.git: canvas/source
canvas/source/tools/pagemanager.cxx | 46 1 file changed, 16 insertions(+), 30 deletions(-) New commits: commit cf9fbdb379e2935677a73ced513d7faf855c299c Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Sat Aug 29 21:19:05 2015 -0400 canvas: simplify PageManager::nakedFragment loops Convert while loops and break statements in PageManager::nakedFragment into for loops Change-Id: I671f4eea140f26c2f451d54911d017325084bd08 Reviewed-on: https://gerrit.libreoffice.org/18138 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/canvas/source/tools/pagemanager.cxx b/canvas/source/tools/pagemanager.cxx index f7faee0..46c5716 100644 --- a/canvas/source/tools/pagemanager.cxx +++ b/canvas/source/tools/pagemanager.cxx @@ -85,46 +85,32 @@ namespace canvas // okay, one last chance is left, we try all available // pages again. maybe some other fragment was deleted // and we can exploit the space. -while(!(relocate(pFragment))) +while( !( relocate( pFragment ) ) ) { // no way, we need to free up some space... // TODO(F1): this is a heuristic, could // be designed as a policy. -const FragmentContainer_t::const_iterator aEnd(maFragments.end()); -FragmentContainer_t::const_iterator candidate(maFragments.begin()); -while(candidate != aEnd) +auto aEnd( maFragments.cend() ); +auto aCurrMax( maFragments.end() ); +sal_uInt32 nCurrMaxArea = 0; +for( auto aCurr = maFragments.begin(); aCurr != aEnd; ++aCurr ) { -if(*candidate && !((*candidate)->isNaked())) -break; -++candidate; -} - -if (candidate != aEnd) -{ -const ::basegfx::B2ISize& rSize((*candidate)->getSize()); -sal_uInt32nMaxArea(rSize.getX()*rSize.getY()); - -FragmentContainer_t::const_iterator it(candidate); -while(it != aEnd) +if( *aCurr && !( ( *aCurr )->isNaked() ) ) { -if (*it && !((*it)->isNaked())) +const ::basegfx::B2ISize& rSize( ( *aCurr )->getSize() ); +sal_uInt32nArea( rSize.getX() * rSize.getY() ); + +if( nCurrMaxArea < nArea ) { -const ::basegfx::B2ISize& rCandidateSize((*it)->getSize()); -const sal_uInt32 nArea(rCandidateSize.getX()*rCandidateSize.getY()); -if(nArea > nMaxArea) -{ -candidate=it; -nMaxArea=nArea; -} +aCurrMax = aCurr; +nCurrMaxArea = nArea; } - -++it; } - -// this does not erase the candidate, -// but makes it 'naked'... -(*candidate)->free(*candidate); } +// this does not erase the candidate, +// but makes it 'naked'... +if( aCurrMax != aEnd ) +( *aCurrMax )->free( *aCurrMax ); else break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: connectivity/source
connectivity/source/drivers/postgresql/pq_xbase.cxx | 33 +-- connectivity/source/drivers/postgresql/pq_xbase.hxx | 17 + connectivity/source/drivers/postgresql/pq_xindex.hxx |8 ++-- connectivity/source/drivers/postgresql/pq_xkey.hxx |8 ++-- connectivity/source/drivers/postgresql/pq_xtable.hxx |8 ++-- connectivity/source/drivers/postgresql/pq_xuser.hxx |4 +- connectivity/source/drivers/postgresql/pq_xview.hxx |4 +- 7 files changed, 36 insertions(+), 46 deletions(-) New commits: commit 87a2c1d5a0b2eeed30461fe39328ccb66359cff0 Author: Daniel Robertson <danlrobertso...@gmail.com> Date: Mon Aug 31 17:35:14 2015 -0400 tdf#88462 connectivity convert manual XInterface Convert postgresql driver ReflectionBase manual XInterface implementation to use ::cppu::WeakComponentImplHelper. Change-Id: I738bd7df33de9c0fe0e3242eb5a4fab6a8dcb3f0 Reviewed-on: https://gerrit.libreoffice.org/18207 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/connectivity/source/drivers/postgresql/pq_xbase.cxx b/connectivity/source/drivers/postgresql/pq_xbase.cxx index 7473bc7..bfee078 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.cxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include "pq_tools.hxx" #include "pq_xbase.hxx" @@ -65,8 +66,8 @@ ReflectionBase::ReflectionBase( const ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > , ConnectionSettings *pSettings, cppu::IPropertyArrayHelper & props /* must survive this object !*/ ) -: OComponentHelper( refMutex->mutex ), - OPropertySetHelper( OComponentHelper::rBHelper ), +: ReflectionBase_BASE( refMutex->mutex ), + OPropertySetHelper( ReflectionBase_BASE::rBHelper ), m_implName( implName ), m_supportedServices( supportedServices ), m_refMutex( refMutex ), @@ -164,15 +165,11 @@ Sequence< com::sun::star::uno::Type > ReflectionBase::getTypes() throw( com::sun::star::uno::RuntimeException, std::exception ) { osl::MutexGuard guard( m_refMutex->mutex ); -static cppu::OTypeCollection collection( -cppu::UnoType::get(), -cppu::UnoType::get(), -cppu::UnoType::get(), -cppu::UnoType::get(), -cppu::UnoType::get(), -cppu::UnoType::get(), -OComponentHelper::getTypes()); -return collection.getTypes(); +static Sequence< ::com::sun::star::uno::Type > collection( +::comphelper::concatSequences( +::cppu::OPropertySetHelper::getTypes(), +ReflectionBase_BASE::getTypes() ) ); +return collection; } @@ -180,18 +177,8 @@ com::sun::star::uno::Any ReflectionBase::queryInterface( const com::sun::star::uno::Type & reqType ) throw (com::sun::star::uno::RuntimeException, std::exception) { -Any ret; -ret = OComponentHelper::queryInterface( reqType ); -if( ! ret.hasValue() ) -ret = ::cppu::queryInterface( -reqType, -static_cast< com::sun::star::beans::XPropertySet * > ( this ), -static_cast< com::sun::star::beans::XMultiPropertySet * > ( this ), -static_cast< com::sun::star::lang::XServiceInfo * > ( this ), -static_cast< com::sun::star::beans::XFastPropertySet * > ( this ) , -static_cast< com::sun::star::sdbcx::XDataDescriptorFactory * > ( this ), -static_cast< com::sun::star::container::XNamed * > ( this ) ); -return ret; +Any ret = ReflectionBase_BASE::queryInterface( reqType ); +return ret.hasValue() ? ret : OPropertySetHelper::queryInterface( reqType ); } diff --git a/connectivity/source/drivers/postgresql/pq_xbase.hxx b/connectivity/source/drivers/postgresql/pq_xbase.hxx index fff7f55..0d4b885 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.hxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.hxx @@ -38,6 +38,7 @@ #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XBASE_HXX #include #include +#include #include #include @@ -47,12 +48,14 @@ namespace pq_sdbc_driver { +typedef ::cppu::WeakComponentImplHelper< ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::sdbcx::XDataDescriptorFactory, + ::com::sun::star::container::XNamed + > ReflectionBase_BASE; + class ReflectionBase : -public cppu::OComponentHelper, -public cppu::OPropertySetHelper, -public com::sun::star::lang::XServiceInfo, -public com::sun::star::sdbcx::XDataDescriptorFactory, -public com::sun::star::container::XNamed +public Reflecti
[Libreoffice-commits] core.git: include/tools tools/source
include/tools/globname.hxx| 60 tools/source/ref/globname.cxx | 90 ++ 2 files changed, 57 insertions(+), 93 deletions(-) New commits: commit c1a9d0139112d7489ca6dd29b18f9418c6da3085 Author: Daniel Robertson danlrobertso...@gmail.com Date: Thu Aug 27 16:27:33 2015 -0400 tdf#62525: use cow_wrapper for SvGlobalName Convert the pimpled copy-on-write SvGlobalName class to use the ::o3tl::cow_wrapper using the default reference counting policy. Change-Id: I7bceb06ddfb31ca5901e5e7d5d93dda494db945f Reviewed-on: https://gerrit.libreoffice.org/18070 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx index 6796c3b..42ff4f4 100644 --- a/include/tools/globname.hxx +++ b/include/tools/globname.hxx @@ -23,6 +23,7 @@ #include tools/toolsdllapi.h #include com/sun/star/uno/Sequence.hxx +#include o3tl/cow_wrapper.hxx struct SvGUID { @@ -35,20 +36,16 @@ struct SvGUID struct ImpSvGlobalName { struct SvGUID szData; -sal_uInt16 nRefCount; -enum Empty { EMPTY }; - -ImpSvGlobalName(const SvGUID rData) -: szData(rData) -, nRefCount(0) -{ -} -ImpSvGlobalName(sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, - sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, - sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15); -ImpSvGlobalName( const ImpSvGlobalName rObj ); -ImpSvGlobalName( Empty ); +ImpSvGlobalName(const SvGUID rData) +: szData(rData) +{ +} +ImpSvGlobalName(sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, + sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, + sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15); +ImpSvGlobalName( const ImpSvGlobalName rObj ); +ImpSvGlobalName(); booloperator == ( const ImpSvGlobalName rObj ) const; }; @@ -57,30 +54,26 @@ class SvStream; class TOOLS_DLLPUBLIC SvGlobalName { -ImpSvGlobalName * pImp; -voidNewImp(); +::o3tl::cow_wrapper ImpSvGlobalName pImp; public: -SvGlobalName(); -SvGlobalName( const SvGlobalName rObj ) -{ -pImp = rObj.pImp; -pImp-nRefCount++; -} -SvGlobalName( ImpSvGlobalName * pImpP ) -{ -pImp = pImpP; -pImp-nRefCount++; -} -SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, - sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, - sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ); - -// create SvGlobalName from a platform independent representation -SvGlobalName( const ::com::sun::star::uno::Sequence sal_Int8 aSeq ); +SvGlobalName(); +SvGlobalName( const SvGlobalName rObj ) : +pImp( rObj.pImp ) +{ +} + +SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, + sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, + sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ); + +// create SvGlobalName from a platform independent representation +SvGlobalName( const ::com::sun::star::uno::Sequence sal_Int8 aSeq ); + +SvGlobalName( const SvGUID rId ); SvGlobalName operator = ( const SvGlobalName rObj ); -~SvGlobalName(); +~SvGlobalName(); TOOLS_DLLPUBLIC friend SvStream operator ( SvStream , SvGlobalName ); TOOLS_DLLPUBLIC friend SvStream WriteSvGlobalName( SvStream , const SvGlobalName ); @@ -97,7 +90,6 @@ public: bool MakeId( const OUString rId ); OUString GetHexName() const; - SvGlobalName( const SvGUID rId ); const SvGUID GetCLSID() const { return pImp-szData; } // platform independent representation of a GlobalName diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index fe96048..b11e21f 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -27,22 +27,19 @@ #include tools/globname.hxx // ImpSvGlobalName -ImpSvGlobalName::ImpSvGlobalName( const ImpSvGlobalName rObj ) -: szData(rObj.szData) -, nRefCount(0) +ImpSvGlobalName::ImpSvGlobalName() { +memset( szData, 0, sizeof( szData ) ); } -ImpSvGlobalName::ImpSvGlobalName( Empty ) -: nRefCount(1) +ImpSvGlobalName::ImpSvGlobalName( const ImpSvGlobalName rObj ) +: szData(rObj.szData) { -memset( szData, 0, sizeof( szData ) ); } ImpSvGlobalName::ImpSvGlobalName
[Libreoffice-commits] core.git: include/vcl vcl/source
include/vcl/gradient.hxx| 10 ++-- vcl/source/gdi/gradient.cxx | 94 +--- 2 files changed, 26 insertions(+), 78 deletions(-) New commits: commit 49cb81b411e1c68cada5d3f4375de713118fce64 Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Aug 28 22:53:28 2015 -0400 tdf#62525 vcl: use cow_wrapper for Gradient Convert the pimpled copy-on-write Gradient class from vcl to use ::o3tl::cow_wrapper using the default reference counting policy. Change-Id: Iadf4d2288669e58a4d5b41f436978c3ab34216f3 Reviewed-on: https://gerrit.libreoffice.org/18124 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/include/vcl/gradient.hxx b/include/vcl/gradient.hxx index 10b16e4..3f2404b 100644 --- a/include/vcl/gradient.hxx +++ b/include/vcl/gradient.hxx @@ -25,6 +25,7 @@ #include tools/color.hxx #include vcl/vclenum.hxx +#include o3tl/cow_wrapper.hxx // - Impl_Gradient - @@ -52,8 +53,10 @@ public: friend SvStream ReadImpl_Gradient( SvStream rIStm, Impl_Gradient rImplGradient ); friend SvStream WriteImpl_Gradient( SvStream rOStm, const Impl_Gradient rImplGradient ); -Impl_Gradient(); -Impl_Gradient( const Impl_Gradient rImplGradient ); +Impl_Gradient(); +Impl_Gradient( const Impl_Gradient rImplGradient ); + +bool operator==( const Impl_Gradient rImpl_Gradient ) const; }; @@ -63,8 +66,7 @@ public: class VCL_DLLPUBLIC Gradient { private: -Impl_Gradient* mpImplGradient; -voidMakeUnique(); +::o3tl::cow_wrapper Impl_Gradient mpImplGradient; public: Gradient(); diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx index b8bca2e..5f2c95f 100644 --- a/vcl/source/gdi/gradient.cxx +++ b/vcl/source/gdi/gradient.cxx @@ -53,37 +53,36 @@ Impl_Gradient::Impl_Gradient( const Impl_Gradient rImplGradient ) : mnStepCount = rImplGradient.mnStepCount; } -void Gradient::MakeUnique() +bool Impl_Gradient::operator==( const Impl_Gradient rImpl_Gradient ) const { -// If there are still other references, copy -if ( mpImplGradient-mnRefCount != 1 ) -{ -if( mpImplGradient-mnRefCount ) -mpImplGradient-mnRefCount--; - -mpImplGradient = new Impl_Gradient( *mpImplGradient ); -} +if ( (meStyle == rImpl_Gradient.meStyle) + (mnAngle == rImpl_Gradient.mnAngle) + (mnBorder == rImpl_Gradient.mnBorder) + (mnOfsX== rImpl_Gradient.mnOfsX) + (mnOfsY== rImpl_Gradient.mnOfsY) + (mnStepCount == rImpl_Gradient.mnStepCount) + (mnIntensityStart == rImpl_Gradient.mnIntensityStart) + (mnIntensityEnd== rImpl_Gradient.mnIntensityEnd) + (maStartColor == rImpl_Gradient.maStartColor) + (maEndColor== rImpl_Gradient.maEndColor) ) + return true; +return false; } -Gradient::Gradient() +Gradient::Gradient() : +mpImplGradient() { - -mpImplGradient = new Impl_Gradient; } -Gradient::Gradient( const Gradient rGradient ) +Gradient::Gradient( const Gradient rGradient ) : +mpImplGradient( rGradient.mpImplGradient ) { - -// Take over instance data and increment refcount -mpImplGradient = rGradient.mpImplGradient; -mpImplGradient-mnRefCount++; } Gradient::Gradient( GradientStyle eStyle, -const Color rStartColor, const Color rEndColor ) +const Color rStartColor, const Color rEndColor ) : +mpImplGradient() { - -mpImplGradient = new Impl_Gradient; mpImplGradient-meStyle = eStyle; mpImplGradient-maStartColor= rStartColor; mpImplGradient-maEndColor = rEndColor; @@ -91,82 +90,55 @@ Gradient::Gradient( GradientStyle eStyle, Gradient::~Gradient() { - -// If it's the last reference, delete it, otherwise -// decrement refcount -if ( mpImplGradient-mnRefCount == 1 ) -delete mpImplGradient; -else -mpImplGradient-mnRefCount--; } void Gradient::SetStyle( GradientStyle eStyle ) { - -MakeUnique(); mpImplGradient-meStyle = eStyle; } void Gradient::SetStartColor( const Color rColor ) { - -MakeUnique(); mpImplGradient-maStartColor = rColor; } void Gradient::SetEndColor( const Color rColor ) { - -MakeUnique(); mpImplGradient-maEndColor = rColor; } void Gradient::SetAngle( sal_uInt16 nAngle ) { - -MakeUnique(); mpImplGradient-mnAngle = nAngle; } void Gradient::SetBorder( sal_uInt16 nBorder ) { - -MakeUnique(); mpImplGradient-mnBorder = nBorder; } void Gradient::SetOfsX( sal_uInt16 nOfsX ) { - -MakeUnique(); mpImplGradient-mnOfsX = nOfsX; } void Gradient
[Libreoffice-commits] core.git: canvas/source
canvas/source/directx/dx_config.cxx |7 -- canvas/source/opengl/ogl_canvashelper.cxx| 54 --- canvas/source/opengl/ogl_texturecache.cxx| 22 +++-- canvas/source/tools/canvascustomspritehelper.cxx |9 +-- canvas/source/tools/page.cxx | 16 +- canvas/source/tools/pagemanager.cxx | 17 +-- canvas/source/tools/spriteredrawmanager.cxx | 33 +- 7 files changed, 54 insertions(+), 104 deletions(-) New commits: commit b7f4940c150b3bdd639afa988573a29774fff1f6 Author: Daniel Robertson danlrobertso...@gmail.com Date: Tue Aug 25 12:24:33 2015 -0400 canvas: replace while loops with range-based for Change-Id: Ide16bee666cf4df41646f9336a585e22a7fe53bd Reviewed-on: https://gerrit.libreoffice.org/18131 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/canvas/source/directx/dx_config.cxx b/canvas/source/directx/dx_config.cxx index e4abde4..be4c3c7 100644 --- a/canvas/source/directx/dx_config.cxx +++ b/canvas/source/directx/dx_config.cxx @@ -102,11 +102,9 @@ namespace dxcanvas uno::Sequence sal_Int32 aValues( sizeof(DeviceInfo)/sizeof(sal_Int32)*maValues.size() ); sal_Int32* pValues = aValues.getArray(); -ValueSet::const_iterator aIter( maValues.begin() ); -const ValueSet::const_iterator aEnd( maValues.end() ); -while( aIter != aEnd ) +for( const auto rValueSet : maValues ) { -const DeviceInfo rInfo( *aIter ); +const DeviceInfo rInfo( rValueSet ); *pValues++ = rInfo.nVendorId; *pValues++ = rInfo.nDeviceId; *pValues++ = rInfo.nDeviceSubSysId; @@ -115,7 +113,6 @@ namespace dxcanvas *pValues++ = rInfo.nDriverVersion; *pValues++ = rInfo.nDriverSubVersion; *pValues++ = rInfo.nDriverBuildId; -++aIter; } uno::Sequence uno::Any aValue(1); diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 1534f7c..61a6773 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -139,10 +139,8 @@ namespace oglcanvas TransformationPreserver aPreserver; setupState(rTransform, eSrcBlend, eDstBlend, rColor); -::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); -const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); -while( aCurr != aEnd ) -renderPolyPolygon(*aCurr++); +for( const auto rPoly : rPolyPolygons ) +renderPolyPolygon( rPoly ); return true; } @@ -157,12 +155,10 @@ namespace oglcanvas TransformationPreserver aPreserver; setupState(rTransform, eSrcBlend, eDstBlend, rColor); -::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); -const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); -while( aCurr != aEnd ) +for( const auto rPoly : rPolyPolygons ) { -glBegin(GL_TRIANGLES); -renderComplexPolyPolygon(*aCurr++); +glBegin( GL_TRIANGLES ); +renderComplexPolyPolygon( rPoly ); glEnd(); } @@ -186,10 +182,8 @@ namespace oglcanvas ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform, rTexture.AffineTransform ); ::basegfx::B2DRange aBounds; -::basegfx::B2DPolyPolygonVector::const_iterator aCurr=rPolyPolygons.begin(); -const ::basegfx::B2DPolyPolygonVector::const_iterator aEnd=rPolyPolygons.end(); -while( aCurr != aEnd ) -aBounds.expand(::basegfx::tools::getRange(*aCurr++)); +for( const auto rPoly : rPolyPolygons ) +aBounds.expand( ::basegfx::tools::getRange( rPoly ) ); aTextureTransform.translate(-aBounds.getMinX(), -aBounds.getMinY()); aTextureTransform.scale(1/aBounds.getWidth(), 1/aBounds.getHeight()); @@ -228,11 +222,10 @@ namespace oglcanvas } -aCurr=rPolyPolygons.begin(); -while( aCurr != aEnd ) +for( const auto rPoly : rPolyPolygons ) { glBegin(GL_TRIANGLES); -renderComplexPolyPolygon(*aCurr++); +renderComplexPolyPolygon( rPoly ); glEnd(); } @@ -333,10 +326,8 @@ namespace oglcanvas ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform
[Libreoffice-commits] core.git: include/o3tl o3tl/qa
include/o3tl/cow_wrapper.hxx| 15 ++- o3tl/qa/cow_wrapper_clients.cxx | 50 +++ o3tl/qa/cow_wrapper_clients.hxx | 56 ++ o3tl/qa/test-cow_wrapper.cxx| 84 4 files changed, 203 insertions(+), 2 deletions(-) New commits: commit 311e77440f11dbe8e49d75b09a4ae0f850ce00c5 Author: Daniel Robertson danlrobertso...@gmail.com Date: Thu Aug 27 17:55:55 2015 -0400 o3tl: add another unit test to cow_wrapper Add unit tests to cow_wrapper for the move ctor and move assignment. Change-Id: I82a5886ca7ae110985c7202125699cf95b6466d8 Reviewed-on: https://gerrit.libreoffice.org/18108 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/include/o3tl/cow_wrapper.hxx b/include/o3tl/cow_wrapper.hxx index 3f117a2b..da822b2 100644 --- a/include/o3tl/cow_wrapper.hxx +++ b/include/o3tl/cow_wrapper.hxx @@ -113,9 +113,11 @@ class cow_wrapper_client public: cow_wrapper_client(); cow_wrapper_client( const cow_wrapper_client ); +cow_wrapper_client( cow_wrapper_client ); ~cow_wrapper_client(); cow_wrapper_client operator=( const cow_wrapper_client ); +cow_wrapper_client operator=( cow_wrapper_client ); void modify( int nVal ); int queryUnmodified() const; @@ -144,6 +146,10 @@ cow_wrapper_client::cow_wrapper_client( const cow_wrapper_client rSrc ) : maImpl( rSrc.maImpl ) { } +cow_wrapper_client::cow_wrapper_client( cow_wrapper_client rSrc ) : +maImpl( std::move( rSrc.maImpl ) ) +{ +} cow_wrapper_client::~cow_wrapper_client() { } @@ -152,6 +158,11 @@ cow_wrapper_client cow_wrapper_client::operator=( const cow_wrapper_client rSr maImpl = rSrc.maImpl; return *this; } +cow_wrapper_client cow_wrapper_client::operator=( cow_wrapper_client rSrc ) +{ +maImpl = std::move( rSrc.maImpl ); +return *this; +} void cow_wrapper_client::modify( int nVal ) { maImpl-setValue( nVal ); @@ -272,13 +283,13 @@ int cow_wrapper_client::queryUnmodified() const /// true, if not shared with any other cow_wrapper instance bool is_unique() const // nothrow { -return m_pimpl-m_ref_count == 1; +return m_pimpl ? m_pimpl-m_ref_count == 1 : true; } /// return number of shared instances (1 for unique object) typename MTPolicy::ref_count_t use_count() const // nothrow { -return m_pimpl-m_ref_count; +return m_pimpl ? m_pimpl-m_ref_count : 0; } void swap(cow_wrapper r) // never throws diff --git a/o3tl/qa/cow_wrapper_clients.cxx b/o3tl/qa/cow_wrapper_clients.cxx index d49dd09..3cea257 100644 --- a/o3tl/qa/cow_wrapper_clients.cxx +++ b/o3tl/qa/cow_wrapper_clients.cxx @@ -219,6 +219,56 @@ bool cow_wrapper_client4::operator( const cow_wrapper_client4 rRHS ) const return maImpl rRHS.maImpl; } +bool BogusRefCountPolicy::s_bShouldIncrement = 0; +bool BogusRefCountPolicy::s_bShouldDecrement = 0; +sal_uInt32 BogusRefCountPolicy::s_nEndOfScope = 0; + +cow_wrapper_client5::cow_wrapper_client5() : +maImpl() +{ +} + +cow_wrapper_client5::cow_wrapper_client5(int nX) : +maImpl(nX) +{ +} + +cow_wrapper_client5::cow_wrapper_client5( const cow_wrapper_client5 rSrc ) : +maImpl( rSrc.maImpl ) +{ +} + +cow_wrapper_client5::cow_wrapper_client5( cow_wrapper_client5 rSrc ) : +maImpl( std::move( rSrc.maImpl ) ) +{ +} + +cow_wrapper_client5::~cow_wrapper_client5() +{ +} + +cow_wrapper_client5 cow_wrapper_client5::operator=( const cow_wrapper_client5 rSrc ) +{ +maImpl = rSrc.maImpl; + +return *this; +} + +cow_wrapper_client5 cow_wrapper_client5::operator=( cow_wrapper_client5 rSrc ) +{ +maImpl = std::move( rSrc.maImpl ); + +return *this; +} + +bool cow_wrapper_client5::operator==( const cow_wrapper_client5 rSrc ) const { +return maImpl == rSrc.maImpl; +} + +bool cow_wrapper_client5::operator!=( const cow_wrapper_client5 rSrc ) const { +return maImpl != rSrc.maImpl; +} + } // namespace o3tltests /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/o3tl/qa/cow_wrapper_clients.hxx b/o3tl/qa/cow_wrapper_clients.hxx index 30dd5e0..f438c06 100644 --- a/o3tl/qa/cow_wrapper_clients.hxx +++ b/o3tl/qa/cow_wrapper_clients.hxx @@ -21,6 +21,7 @@ #define INCLUDED_O3TL_QA_COW_WRAPPER_CLIENTS_HXX #include o3tl/cow_wrapper.hxx +#include cppunit/extensions/HelperMacros.h /* Definition of Cow_Wrapper_Clients classes */ @@ -139,6 +140,61 @@ private: o3tl::cow_wrapper int maImpl; }; +// singleton ref-counting policy used to keep track of when +// incrementing and decrementing occurs +struct BogusRefCountPolicy +{ +static bool s_bShouldIncrement; +static bool s_bShouldDecrement; +static sal_uInt32 s_nEndOfScope; +typedef sal_uInt32 ref_count_t; +static void incrementCount( ref_count_t rCount
[Libreoffice-commits] core.git: accessibility/source basctl/source basic/source canvas/source chart2/source comphelper/source dbaccess/source framework/source include/o3tl include/sfx2 sc/inc sc/sourc
accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx|1 basctl/source/basicide/doceventnotifier.cxx|2 - basic/source/runtime/dllmgr-x64.cxx|1 basic/source/runtime/dllmgr-x86.cxx|1 canvas/source/directx/dx_9rm.cxx |1 canvas/source/vcl/canvas.cxx |1 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx |1 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |1 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |1 comphelper/source/misc/servicedecl.cxx |1 dbaccess/source/core/dataaccess/documentevents.cxx |1 framework/source/uielement/menubarmanager.cxx |1 include/o3tl/cow_wrapper.hxx | 13 ++ include/sfx2/sidebar/Theme.hxx |1 sc/inc/autoform.hxx|1 sc/source/core/inc/bcaslot.hxx |1 sc/source/ui/unoobj/chart2uno.cxx |1 sd/source/ui/presenter/PresenterCanvas.cxx |1 sd/source/ui/slidesorter/view/SlideSorterView.cxx |1 sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx |1 sdext/source/presenter/PresenterScreen.cxx |1 sdext/source/presenter/PresenterSlideSorter.cxx|1 sdext/source/presenter/PresenterToolBar.cxx|1 slideshow/source/engine/animationnodes/basenode.cxx|1 slideshow/source/engine/rehearsetimingsactivity.cxx|1 slideshow/source/engine/slide/layer.cxx|1 svgio/inc/svgio/svgreader/svgnode.hxx |1 svtools/source/uno/unogridcolumnfacade.cxx |1 sw/inc/fmtmeta.hxx |1 sw/inc/redline.hxx |1 sw/source/core/doc/tblafmt.cxx |1 sw/source/core/inc/MarkManager.hxx |1 sw/source/core/inc/unometa.hxx |1 sw/source/filter/xml/xmlimpit.cxx |1 xmloff/source/text/txtimp.cxx |1 35 files changed, 42 insertions(+), 6 deletions(-) New commits: commit 6900bf41e2b7d7840e11ee1847efd671cf9b0921 Author: Daniel Robertson danlrobertso...@gmail.com Date: Sat Aug 29 00:15:59 2015 -0400 o3tl/cow_wrapper: remove boost dependency Remove boost dependencies from ::o3tl::cow_wrapper, and add the necessary includes to files including checked_delete and noncopyable that do not already include the necessary files. Change-Id: Iedae4232002792724226829a5d5cf9d16ffd0686 Reviewed-on: https://gerrit.libreoffice.org/18125 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx index 82c8aaa..34d9e97 100644 --- a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx +++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx @@ -37,6 +37,7 @@ #include vcl/button.hxx #include osl/mutex.hxx #include tools/diagnose_ex.h +#include boost/noncopyable.hpp #include vector diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx index 260e14a..9be5a45 100644 --- a/basctl/source/basicide/doceventnotifier.cxx +++ b/basctl/source/basicide/doceventnotifier.cxx @@ -27,7 +27,7 @@ #include tools/diagnose_ex.h #include comphelper/processfactory.hxx - +#include boost/noncopyable.hpp #include cppuhelper/compbase.hxx #include cppuhelper/basemutex.hxx diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx index 2a38890..5239e54 100644 --- a/basic/source/runtime/dllmgr-x64.cxx +++ b/basic/source/runtime/dllmgr-x64.cxx @@ -38,6 +38,7 @@ #include rtl/string.hxx #include rtl/ustring.hxx #include salhelper/simplereferenceobject.hxx +#include boost/noncopyable.hpp #undef max diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx index ac73fe4..d955b12 100644 --- a/basic/source/runtime/dllmgr-x86.cxx +++ b/basic/source/runtime/dllmgr-x86.cxx @@ -38,6 +38,7 @@ #include rtl/string.hxx #include rtl/ustring.hxx #include salhelper/simplereferenceobject.hxx +#include boost/noncopyable.hpp #undef max diff --git a/canvas
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/slide/layer.cxx| 92 ++--- slideshow/source/engine/slide/layermanager.cxx | 102 +++--- slideshow/source/engine/slide/shapemanagerimpl.cxx | 12 - slideshow/source/engine/slide/slideimpl.cxx| 81 ++- slideshow/source/engine/slide/targetpropertiescreator.cxx | 16 - slideshow/source/engine/slide/userpaintoverlay.cxx |9 slideshow/source/engine/slideshowimpl.cxx | 56 ++--- slideshow/source/engine/slideview.cxx | 18 - slideshow/source/engine/transitions/slidechangebase.cxx| 23 -- slideshow/source/engine/transitions/slidetransitionfactory.cxx |9 slideshow/source/engine/unoviewcontainer.cxx | 32 --- slideshow/source/engine/usereventqueue.cxx |5 slideshow/source/engine/waitsymbol.cxx |6 13 files changed, 146 insertions(+), 315 deletions(-) New commits: commit ead5bc3cfb07a4e96e367e7904dc674ee5f5ccd6 Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Aug 21 21:51:09 2015 -0400 slideshow: replace for_each with range-based loop Replace ::std::for_each for a more readable range-based for loop in cases in which the function object to be applied by for_each is more readable as the body of a for loop. Change-Id: Ib0b488b36ed58c65c56357e04391b85096d043aa Reviewed-on: https://gerrit.libreoffice.org/17930 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/slideshow/source/engine/slide/layer.cxx b/slideshow/source/engine/slide/layer.cxx index 7bda7c23..a5ac852 100644 --- a/slideshow/source/engine/slide/layer.cxx +++ b/slideshow/source/engine/slide/layer.cxx @@ -28,9 +28,6 @@ #include layer.hxx -#include boost/bind.hpp - - using namespace ::com::sun::star; namespace slideshow @@ -68,10 +65,8 @@ namespace slideshow const ViewEntryVector::iterator aEnd( maViewEntries.end() ); if( (aIter=std::find_if( maViewEntries.begin(), aEnd, - boost::bindbool( - std::equal_to ViewSharedPtr (), - boost::bind( ViewEntry::getView, _1 ), - boost::cref( rNewView != aEnd ) + [rNewView]( const ViewEntry rViewEntry ) + { return rNewView == rViewEntry.getView(); } ) ) != aEnd ) { // already added - just return existing layer return aIter-mpViewLayer; @@ -101,10 +96,8 @@ namespace slideshow const ViewEntryVector::iterator aEnd( maViewEntries.end() ); if( (aIter=std::find_if( maViewEntries.begin(), aEnd, - boost::bindbool( - std::equal_to ViewSharedPtr (), - boost::bind( ViewEntry::getView, _1 ), - boost::cref( rView == aEnd ) + [rView]( const ViewEntry rViewEntry ) + { return rView == rViewEntry.getView(); } ) ) == aEnd ) { // View was not added/is already removed return ViewLayerSharedPtr(); @@ -112,10 +105,8 @@ namespace slideshow OSL_ENSURE( std::count_if( maViewEntries.begin(), aEnd, - boost::bindbool( - std::equal_to ViewSharedPtr (), - boost::bind( ViewEntry::getView, _1 ), - boost::cref( rView ))) == 1, + [rView]( const ViewEntry rViewEntry ) + { return rView == rViewEntry.getView(); } ) == 1, Layer::removeView(): view added multiple times ); ViewLayerSharedPtr pRet( aIter-mpViewLayer ); @@ -128,25 +119,16 @@ namespace slideshow { rShape-clearAllViewLayers(); -std::for_each( maViewEntries.begin(), - maViewEntries.end(), - boost::bind(Shape::addViewLayer, - boost::cref(rShape), - boost::bind(ViewEntry::getViewLayer, - _1), - false )); +for( const auto rViewEntry : maViewEntries ) +rShape-addViewLayer( rViewEntry.getViewLayer(), false
[Libreoffice-commits] core.git: include/o3tl
include/o3tl/cow_wrapper.hxx | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) New commits: commit 6038ba92be0a4c821ffa29ed0512905e4b3cd8f8 Author: Daniel Robertson danlrobertso...@gmail.com Date: Tue Aug 18 17:08:48 2015 -0400 o3tl: cow_wrapper add move constructor/assignment Add a move constructor and move assignment operator for o3tl::cow_wrapper. Insubstantial gains for UnsafeRefCountingPolicy, no atomic increment needed for ThreadSafeRefCountingPolicy's move-ctor. Change-Id: Ia2de1ca78b1e0e5a0f30535e752f1dd858fdfef0 Reviewed-on: https://gerrit.libreoffice.org/17848 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/include/o3tl/cow_wrapper.hxx b/include/o3tl/cow_wrapper.hxx index b7659c3..3f117a2b 100644 --- a/include/o3tl/cow_wrapper.hxx +++ b/include/o3tl/cow_wrapper.hxx @@ -121,7 +121,7 @@ public: int queryUnmodified() const; private: -otl::cow_wrapper cow_wrapper_client_impl maImpl; +o3tl::cow_wrapper cow_wrapper_client_impl maImpl; }; /pre and the implementation file would look like this: @@ -187,8 +187,8 @@ int cow_wrapper_client::queryUnmodified() const void release() { -if( !MTPolicy::decrementCount(m_pimpl-m_ref_count) ) -boost::checked_delete(m_pimpl), m_pimpl=0; +if( m_pimpl !MTPolicy::decrementCount(m_pimpl-m_ref_count) ) +boost::checked_delete(m_pimpl), m_pimpl = nullptr; } public: @@ -219,6 +219,14 @@ int cow_wrapper_client::queryUnmodified() const MTPolicy::incrementCount( m_pimpl-m_ref_count ); } +/** Move-construct and steal rSrc shared resource + */ +explicit cow_wrapper( cow_wrapper rSrc ) : +m_pimpl( rSrc.m_pimpl ) +{ +rSrc.m_pimpl = nullptr; +} + ~cow_wrapper() // nothrow, if ~T does not throw { release(); @@ -236,6 +244,18 @@ int cow_wrapper_client::queryUnmodified() const return *this; } +/// stealing rSrc's resource +cow_wrapper operator=( cow_wrapper rSrc ) +{ +// self-movement guts ourself, see also 17.6.4.9 +release(); +m_pimpl = rSrc.m_pimpl; + +rSrc.m_pimpl = nullptr; + +return *this; +} + /// unshare with any other cow_wrapper instance value_type make_unique() { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: slideshow/source
slideshow/source/engine/activitiesqueue.cxx| 26 +-- slideshow/source/engine/animationnodes/basenode.cxx|7 slideshow/source/engine/pointersymbol.cxx | 40 +--- slideshow/source/engine/rehearsetimingsactivity.cxx|7 slideshow/source/engine/screenupdater.cxx | 29 +-- slideshow/source/engine/shapes/appletshape.cxx | 57 ++- slideshow/source/engine/shapes/drawshape.cxx | 137 + slideshow/source/engine/shapes/drawshapesubsetting.cxx |9 - slideshow/source/engine/shapes/mediashape.cxx | 66 ++-- 9 files changed, 135 insertions(+), 243 deletions(-) New commits: commit a811d6efe4e8e995102bb19f7a1d3008fc06be8d Author: Daniel Robertson danlrobertso...@gmail.com Date: Sun Aug 16 13:55:51 2015 -0400 slideshow: replace for_each with range-based for Replace ::std::for_each for a more readable range-based for loop in cases in which the function object to be applied by for_each is more readable as the body of a for loop. In addition, replace while loops with range-based for loops when possible and complex implementations of boost::bind with lambda expressions. Change-Id: I6adfb18197bd1b8627719adfca2e4c36d58a0e05 Reviewed-on: https://gerrit.libreoffice.org/17786 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/slideshow/source/engine/activitiesqueue.cxx b/slideshow/source/engine/activitiesqueue.cxx index 647bffe..5009dbe 100644 --- a/slideshow/source/engine/activitiesqueue.cxx +++ b/slideshow/source/engine/activitiesqueue.cxx @@ -26,7 +26,6 @@ #include activity.hxx #include activitiesqueue.hxx -#include boost/mem_fn.hpp #include boost/shared_ptr.hpp #include algorithm @@ -51,12 +50,10 @@ namespace slideshow // dispose all queue entries try { -std::for_each( maCurrentActivitiesWaiting.begin(), - maCurrentActivitiesWaiting.end(), - boost::mem_fn( Disposable::dispose ) ); -std::for_each( maCurrentActivitiesReinsert.begin(), - maCurrentActivitiesReinsert.end(), - boost::mem_fn( Disposable::dispose ) ); +for( const auto pActivity : maCurrentActivitiesWaiting ) +pActivity-dispose(); +for( const auto pActivity : maCurrentActivitiesReinsert ) +pActivity-dispose(); } catch (uno::Exception ) { @@ -169,9 +166,8 @@ namespace slideshow void ActivitiesQueue::processDequeued() { // notify all dequeued activities from last round -::std::for_each( maDequeuedActivities.begin(), - maDequeuedActivities.end(), - ::boost::mem_fn( Activity::dequeued ) ); +for( const auto pActivity : maDequeuedActivities ) +pActivity-dequeued(); maDequeuedActivities.clear(); } @@ -183,14 +179,12 @@ namespace slideshow void ActivitiesQueue::clear() { // dequeue all entries: -std::for_each( maCurrentActivitiesWaiting.begin(), - maCurrentActivitiesWaiting.end(), - boost::mem_fn( Activity::dequeued ) ); +for( const auto pActivity : maCurrentActivitiesWaiting ) +pActivity-dequeued(); ActivityQueue().swap( maCurrentActivitiesWaiting ); -std::for_each( maCurrentActivitiesReinsert.begin(), - maCurrentActivitiesReinsert.end(), - boost::mem_fn( Activity::dequeued ) ); +for( const auto pActivity : maCurrentActivitiesReinsert ) +pActivity-dequeued(); ActivityQueue().swap( maCurrentActivitiesReinsert ); } } diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index 6b6f62d..f844521 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -34,7 +34,6 @@ #include nodetools.hxx #include generateevent.hxx -#include boost/bind.hpp #include vector #include algorithm #include iterator @@ -624,10 +623,8 @@ void BaseNode::notifyDeactivating( const AnimationNodeSharedPtr rNotifier ) void BaseNode::notifyEndListeners() const { // notify all listeners -std::for_each( maDeactivatingListeners.begin(), - maDeactivatingListeners.end(), - boost::bind( AnimationNode::notifyDeactivating, _1, -boost::cref(mpSelf) ) ); +for( const auto rListner : maDeactivatingListeners ) +rListner-notifyDeactivating( mpSelf
[Libreoffice-commits] core.git: canvas/source
canvas/source/directx/dx_spritecanvashelper.cxx | 69 +-- canvas/source/opengl/ogl_canvashelper.cxx |5 canvas/source/opengl/ogl_spritedevicehelper.cxx |5 canvas/source/vcl/spritecanvashelper.cxx| 146 +++- 4 files changed, 83 insertions(+), 142 deletions(-) New commits: commit 720cea21f352933fa5d36d4b6faff11799c604f2 Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Aug 14 21:35:00 2015 -0400 canvas: replace for_each with range-based for-loop Replace ::std::for_each for a more readable range-based for loop in cases in which the function object to be applied by for_each is more readable as the body of a for loop. Change-Id: I5ea0f6a464855b8cc8af38f211bb784dd91eca0d Reviewed-on: https://gerrit.libreoffice.org/17775 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/canvas/source/directx/dx_spritecanvashelper.cxx b/canvas/source/directx/dx_spritecanvashelper.cxx index 9508fc7..ff2be01 100644 --- a/canvas/source/directx/dx_spritecanvashelper.cxx +++ b/canvas/source/directx/dx_spritecanvashelper.cxx @@ -19,7 +19,6 @@ #include sal/config.h -#include boost/bind.hpp #include boost/cast.hpp #include basegfx/range/b2drectangle.hxx @@ -59,28 +58,6 @@ namespace dxcanvas ::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw(); } - -void spriteRedrawStub( const ::canvas::Sprite::Reference rSprite ) -{ -if( rSprite.is() ) -{ -// downcast to derived dxcanvas::Sprite interface, which -// provides the actual redraw methods. -::boost::polymorphic_downcast Sprite* ( -rSprite.get() )-redraw(); -} -} - -void spriteRedrawStub2( const ::canvas::SpriteRedrawManager::AreaComponent rComponent ) -{ -if( rComponent.second.getSprite().is() ) -{ -// downcast to derived dxcanvas::Sprite interface, which -// provides the actual redraw methods. -::boost::polymorphic_downcast Sprite* ( -rComponent.second.getSprite().get() )-redraw(); -} -} } SpriteCanvasHelper::SpriteCanvasHelper() : @@ -273,9 +250,17 @@ namespace dxcanvas // the full sprite area, anyway. But at least optimized in the // sense that unnecessary background paints behind the sprites // are avoided. -::std::for_each( rUpdateArea.maComponentList.begin(), - rUpdateArea.maComponentList.end(), - spriteRedrawStub2 ); +for( const auto rComponent : rUpdateArea.maComponentList ) +{ +const ::canvas::Sprite::Reference rSprite( rComponent.second.getSprite() ); + +if( rSprite.is() ) +{ +// downcast to derived dxcanvas::Sprite interface, which +// provides the actual redraw methods. +::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw(); +} +} // repaint uncovered areas from backbuffer - take the // _rounded_ rectangles from above, to have the update @@ -284,12 +269,8 @@ namespace dxcanvas ::basegfx::computeSetDifference( aUncoveredAreas, rUpdateArea.maTotalBounds, ::basegfx::B2DRange( rDestRect ) ); -::std::for_each( aUncoveredAreas.begin(), - aUncoveredAreas.end(), - ::boost::bind( repaintBackground, -_1, -::boost::cref(maScrapRect), -::boost::cref(mpBackBuffer) ) ); +for( const auto rUpdateArea : aUncoveredAreas ) +repaintBackground( rUpdateArea, maScrapRect, mpBackBuffer ); // TODO(E1): Use numeric_cast to catch overflow here ::basegfx::B2IRange aActualArea( 0, 0, @@ -311,9 +292,15 @@ namespace dxcanvas // TODO(P2): optimize this by truly rendering to the front // buffer. Currently, we've the 3D device only for the back // buffer. -::std::for_each( rSortedUpdateSprites.begin(), - rSortedUpdateSprites.end(), - spriteRedrawStub ); +for( const auto rSprite : rSortedUpdateSprites ) +{ +if( rSprite.is() ) +{ +// downcast to derived dxcanvas::Sprite interface, which +// provides the actual redraw methods. +::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw(); +} +} // TODO(E1): Use numeric_cast to catch overflow here ::basegfx::B2IRange aActualArea
[Libreoffice-commits] core.git: canvas/source
canvas/source/cairo/cairo_spritecanvashelper.cxx | 103 ++- canvas/source/tools/page.cxx |7 - canvas/source/tools/pagemanager.cxx |7 - canvas/source/tools/spriteredrawmanager.cxx | 17 +-- canvas/source/tools/surfaceproxy.cxx | 35 +-- 5 files changed, 45 insertions(+), 124 deletions(-) New commits: commit 849f1d37d575bc752c8f987c7541dbd4bfd998c1 Author: Daniel Robertson danlrobertso...@gmail.com Date: Sat Aug 15 15:19:18 2015 +0200 canvas: replace for_each with range-based for-loop Replace ::std::for_each for a more readable range-based for loop in cases in which the function object to be applied by for_each is more readable as the body of a for loop. Change-Id: I6f96833d7f251d44e2308278bb92a7d49fd49bcd Reviewed-on: https://gerrit.libreoffice.org/17763 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx index a297810..a1b1643 100644 --- a/canvas/source/cairo/cairo_spritecanvashelper.cxx +++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx @@ -19,7 +19,6 @@ #include sal/config.h -#include boost/bind.hpp #include boost/cast.hpp #include basegfx/range/b2drectangle.hxx @@ -87,47 +86,6 @@ namespace cairocanvas cairo_restore( pCairo.get() ); } - -/** Repaint sprite at original position - -Used for opaque updates, which render directly to the -device buffer. - */ -void spriteRedrawStub( const CairoSharedPtr pCairo, - const ::canvas::Sprite::Reference rSprite ) -{ -if( rSprite.is() ) -{ -::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw( pCairo, false ); -} -} - -/** Repaint sprite at given position - -Used for generic update, which renders into device buffer. - */ -void spriteRedrawStub2( const CairoSharedPtr pCairo, -const ::canvas::Sprite::Reference rSprite ) -{ -if( rSprite.is() ) -{ -::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw( pCairo, true ); -} -} - -/** Repaint sprite at original position - -Used for opaque updates from scrollUpdate(), which render -directly to the front buffer. - */ -void spriteRedrawStub3( const CairoSharedPtr pCairo, -const ::canvas::SpriteRedrawManager::AreaComponent rComponent ) -{ -const ::canvas::Sprite::Reference rSprite( rComponent.second.getSprite() ); - -if( rSprite.is() ) -::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw( pCairo, false ); -} } SpriteCanvasHelper::SpriteCanvasHelper() : @@ -242,10 +200,9 @@ namespace cairocanvas // repaint all active sprites on top of background into // VDev. mpRedrawManager-forEachSprite( -::boost::bind( -spriteRedraw, -boost::cref(pCompositingCairo), -_1 ) ); +[pCompositingCairo]( const Sprite::Reference rSprite ) +{ spriteRedraw( pCompositingCairo, rSprite ); } +); // flush to screen cairo_rectangle( pWindowCairo.get(), 0, 0, rSize.getX(), rSize.getY() ); @@ -328,12 +285,13 @@ namespace cairocanvas // opaque sprite content) // repaint all affected sprites directly to output device -::std::for_each( rUpdateArea.maComponentList.begin(), - rUpdateArea.maComponentList.end(), - ::boost::bind( - spriteRedrawStub3, - boost::cref(pCompositingCairo), - _1 ) ); +for( const auto rComponent : rUpdateArea.maComponentList ) +{ +const ::canvas::Sprite::Reference rSprite( rComponent.second.getSprite() ); +if( rSprite.is() ) +::boost::polymorphic_downcast Sprite* ( rSprite.get() )-redraw( +pCompositingCairo, true ); +} } else { @@ -386,12 +344,9 @@ namespace cairocanvas // repaint uncovered areas from sprite. Need to actually // clip here, since we're only repainting _parts_ of the // sprite -::std::for_each( aUnscrollableAreas.begin(), - aUnscrollableAreas.end(), - ::boost::bind( opaqueUpdateSpriteArea
[Libreoffice-commits] core.git: include/basebmp include/o3tl
include/basebmp/accessortraits.hxx | 14 ++ include/o3tl/compat_functional.hxx |9 - 2 files changed, 10 insertions(+), 13 deletions(-) New commits: commit 3babca3e849e1cb42225ca1c26e8f6156ad153e6 Author: Daniel Robertson danlrobertso...@gmail.com Date: Tue Aug 11 20:31:51 2015 -0400 tdf#92459 basebmp: replace project2nd Replace the use of project2nd in basebmp with a specialized functor similar to what is seen in paletteformats.hxx and pixelformatadapters.hxx. There should be no side effects due to this change. Change-Id: I1bbd723931e41986542e92bac773bbea68cfe5bd Reviewed-on: https://gerrit.libreoffice.org/17660 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: David Tardon dtar...@redhat.com Tested-by: David Tardon dtar...@redhat.com diff --git a/include/basebmp/accessortraits.hxx b/include/basebmp/accessortraits.hxx index eeabae0..d09f805 100644 --- a/include/basebmp/accessortraits.hxx +++ b/include/basebmp/accessortraits.hxx @@ -24,8 +24,6 @@ #include basebmp/accessoradapters.hxx #include basebmp/metafunctions.hxx -#include o3tl/compat_functional.hxx - #include functional namespace basebmp @@ -71,7 +69,15 @@ template class Accessor, type; }; - +/// given an Accessor and its value type return its value_type +template typename Accessor struct ColorPassThrough +{ +typename Accessor::value_type operator()( const Accessor, +const typename Accessor::value_type x ) const +{ +return x; +} +}; /** Traits template for Accessor @@ -84,7 +90,7 @@ template class Accessor struct AccessorTraits typedef typename Accessor::value_type value_type; /// Retrieve stand-alone color lookup function for given Accessor type -typedef o3tl::project2nd Accessor, value_type color_lookup; +typedef ColorPassThrough Accessor color_lookup; /// Retrieve raw pixel data accessor for given Accessor type typedef Accessorraw_accessor; diff --git a/include/o3tl/compat_functional.hxx b/include/o3tl/compat_functional.hxx index fa6fbd5..5220567 100644 --- a/include/o3tl/compat_functional.hxx +++ b/include/o3tl/compat_functional.hxx @@ -37,15 +37,6 @@ namespace o3tl { -// Functor, given two parameters, return the second -templateclass T1, class T2 -struct project2nd : public std::binary_functionT1, T2, T2 -{ -T2 operator()(const T1, const T2 x) const { -return x; -} -}; - /// Select first value of a pair templatetypename P struct select1st ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: canvas/source chart2/source dbaccess/source extensions/source forms/source
canvas/source/factory/cf_service.cxx | 20 +- chart2/source/controller/accessibility/AccessibleBase.cxx |4 +- chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |4 +- chart2/source/controller/dialogs/DialogModel.cxx |2 - chart2/source/inc/CommonFunctors.hxx |2 - chart2/source/inc/ContainerHelper.hxx |7 +-- chart2/source/model/template/ChartTypeManager.cxx |4 +- dbaccess/source/core/dataaccess/documentevents.cxx|4 +- dbaccess/source/ui/browser/genericcontroller.cxx |4 +- dbaccess/source/ui/dlg/DbAdminImpl.cxx|4 +- extensions/source/propctrlr/eformshelper.cxx |3 + extensions/source/propctrlr/eventhandler.cxx |3 + extensions/source/propctrlr/genericpropertyhandler.cxx|4 +- forms/source/xforms/convert.cxx |6 +-- forms/source/xforms/datatyperepository.cxx|4 +- 15 files changed, 38 insertions(+), 37 deletions(-) New commits: commit 87130a4e18347d055331ff53da3b1a79548ff24a Author: Daniel Robertson danlrobertso...@gmail.com Date: Tue Aug 11 14:51:35 2015 -0400 tdf#92459 Cleanup unclear lambdas Replace lambdas used to select the first/second member of a pair with the new simplified select1st/2nd from o3tl/compat_functional. There should be no side effects due to this change. Change-Id: I17f37796e0c4defe96a10aa491d192adb9eebb89 Reviewed-on: https://gerrit.libreoffice.org/17656 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index 677cf42..9d1d2b2 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -38,7 +38,7 @@ #include cppuhelper/supportsservice.hxx #include osl/mutex.hxx #include osl/process.h - +#include o3tl/compat_functional.hxx using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -52,8 +52,10 @@ class CanvasFactory lang::XMultiComponentFactory, lang::XMultiServiceFactory { -typedef std::vectorstd::pairOUString, SequenceOUString AvailVector; -typedef std::vectorstd::pairOUString, OUString CacheVector; +typedef std::pair OUString, Sequence OUString AvailPair; +typedef std::pair OUString, OUString CachePair; +typedef std::vector AvailPair AvailVector; +typedef std::vector CachePair CacheVector; mutable ::osl::Mutex m_mutex; @@ -238,9 +240,7 @@ SequenceOUString CanvasFactory::getAvailableServiceNames() std::transform(m_aAvailableImplementations.begin(), m_aAvailableImplementations.end(), aServiceNames.getArray(), - [](std::pairOUString, SequenceOUString const ap) - { return ap.first; } -); + o3tl::select1st AvailPair ()); return aServiceNames; } @@ -326,7 +326,7 @@ ReferenceXInterface CanvasFactory::lookupAndUse( if( (aMatch=std::find_if( m_aCachedImplementations.begin(), aEnd, -[serviceName](std::pairOUString, OUString const cp) +[serviceName](CachePair const cp) { return serviceName.equals(cp.first); } )) != aEnd) { ReferenceXInterface xCanvas( use( aMatch-second, args, xContext ) ); @@ -340,7 +340,7 @@ ReferenceXInterface CanvasFactory::lookupAndUse( if( (aAvailImplsMatch=std::find_if( m_aAvailableImplementations.begin(), aAvailEnd, -[serviceName](std::pairOUString, SequenceOUString const ap) +[serviceName](AvailPair const ap) { return serviceName.equals(ap.first); } )) == aAvailEnd ) { return ReferenceXInterface(); @@ -351,7 +351,7 @@ ReferenceXInterface CanvasFactory::lookupAndUse( if( (aAAImplsMatch=std::find_if( m_aAAImplementations.begin(), aAAEnd, -[serviceName](std::pairOUString, SequenceOUString const ap) +[serviceName](AvailPair const ap) { return serviceName.equals(ap.first); } )) == aAAEnd) { return ReferenceXInterface(); @@ -362,7 +362,7 @@ ReferenceXInterface CanvasFactory::lookupAndUse( if( (aAccelImplsMatch=std::find_if( m_aAcceleratedImplementations.begin(), aAccelEnd
[Libreoffice-commits] core.git: canvas/source
canvas/source/tools/spriteredrawmanager.cxx | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) New commits: commit 647b5aecd4c3facc302df33386451dda732aab98 Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Aug 7 22:57:07 2015 -0400 tdf#92459 remove compat_functional from canvas Replace all uses of deprecated features from the o3tl in compat_functional.hxx with lambda expressions in canvas. There should be no side effects due to this patch. Change-Id: Ia08ff1642a4f64035441dfdbac03c6fb09fa0443 Reviewed-on: https://gerrit.libreoffice.org/17586 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx index e5c6182..94d3d40 100644 --- a/canvas/source/tools/spriteredrawmanager.cxx +++ b/canvas/source/tools/spriteredrawmanager.cxx @@ -24,13 +24,10 @@ #include basegfx/range/b2drectangle.hxx #include basegfx/tools/canvastools.hxx #include basegfx/vector/b2dsize.hxx -#include boost/bind.hpp -#include o3tl/compat_functional.hxx #include tools/diagnose_ex.h #include canvas/spriteredrawmanager.hxx - namespace canvas { namespace @@ -411,12 +408,8 @@ namespace canvas ::basegfx::B2DRange aTrueArea( rUpdateArea.maComponentList.begin()-second.getUpdateArea() ); ::std::for_each( rUpdateArea.maComponentList.begin(), rUpdateArea.maComponentList.end(), - ::boost::bind( (void (basegfx::B2DRange::*)(const basegfx::B2DRange))( -basegfx::B2DRange::expand), -aTrueArea, -::boost::bind( SpriteInfo::getUpdateArea, - ::boost::bind( ::o3tl::select2ndAreaComponent(), - _1 ) ) ) ); + [aTrueArea]( const ::std::pair ::basegfx::B2DRange, SpriteInfo cp ) + { aTrueArea.expand(cp.second.getUpdateArea()); } ); const SpriteConnectedRanges::ComponentListType::const_iterator aEnd( rUpdateArea.maComponentList.end() ); @@ -425,10 +418,8 @@ namespace canvas // update will not be opaque. return ::std::none_of( rUpdateArea.maComponentList.begin(), aEnd, -::boost::bind( SpriteRedrawManager::isAreaUpdateNotOpaque, - this, - ::boost::cref(aTrueArea), - _1 ) ); +[aTrueArea, this]( const ::std::pair ::basegfx::B2DRange, SpriteInfo cp ) +{ return this-isAreaUpdateNotOpaque(aTrueArea, cp); } ); } bool SpriteRedrawManager::areSpritesChanged( const UpdateArea rUpdateArea ) const @@ -442,10 +433,8 @@ namespace canvas rUpdateArea.maComponentList.end() ); return ::std::any_of( rUpdateArea.maComponentList.begin(), aEnd, -::boost::bind( SpriteInfo::needsUpdate, - ::boost::bind( - ::o3tl::select2ndSpriteConnectedRanges::ComponentType(), - _1 ) ) ); +[]( const ::std::pair ::basegfx::B2DRange, SpriteInfo cp ) +{ return cp.second.needsUpdate(); } ); } SpriteRedrawManager::SpriteRedrawManager() : ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: connectivity/inc connectivity/source reportdesign/inc reportdesign/source
connectivity/inc/pch/precompiled_ado.hxx |1 - connectivity/inc/pch/precompiled_dbtools.hxx |1 - connectivity/inc/pch/precompiled_odbc.hxx |1 - connectivity/source/commontools/TSortIndex.cxx|1 - connectivity/source/commontools/TTableHelper.cxx |2 +- connectivity/source/drivers/ado/AColumn.cxx |2 -- connectivity/source/drivers/ado/AColumns.cxx |2 -- connectivity/source/drivers/ado/AConnection.cxx |2 -- connectivity/source/drivers/hsqldb/HDriver.cxx|2 -- connectivity/source/drivers/hsqldb/HStorageMap.cxx|3 --- connectivity/source/drivers/odbc/OResultSet.cxx |2 -- connectivity/source/manager/mdrivermanager.cxx|2 -- reportdesign/inc/pch/precompiled_rpt.hxx |1 - reportdesign/inc/pch/precompiled_rptui.hxx|1 - reportdesign/source/core/sdr/PropertyForward.cxx |2 -- reportdesign/source/ui/inspection/GeometryHandler.cxx |6 -- reportdesign/source/ui/report/ViewsWindow.cxx |1 - 17 files changed, 5 insertions(+), 27 deletions(-) New commits: commit f6595f0b3389ffeefa10035d915a884b02d26c0e Author: Daniel Robertson danlrobertso...@gmail.com Date: Sat Aug 8 00:06:37 2015 -0400 tdf#92459 remove o3tl/compat_functional.hxx Replace all uses of deprecated features from the o3tl included in compat_functional.hxx with lambda expressions in connectivity and reportdesign. The patch should not cause any side effects. The change is largely cosmetic. Change-Id: I2042b91bf0fa2b47cce9ea11c97fa4ca6734c5e2 Reviewed-on: https://gerrit.libreoffice.org/17588 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/connectivity/inc/pch/precompiled_ado.hxx b/connectivity/inc/pch/precompiled_ado.hxx index be53e17..23e8493 100644 --- a/connectivity/inc/pch/precompiled_ado.hxx +++ b/connectivity/inc/pch/precompiled_ado.hxx @@ -53,7 +53,6 @@ #include cppuhelper/typeprovider.hxx #include limits #include memory -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include osl/file.hxx #include osl/thread.h diff --git a/connectivity/inc/pch/precompiled_dbtools.hxx b/connectivity/inc/pch/precompiled_dbtools.hxx index b6f0895..2bc28f6 100644 --- a/connectivity/inc/pch/precompiled_dbtools.hxx +++ b/connectivity/inc/pch/precompiled_dbtools.hxx @@ -147,7 +147,6 @@ #include i18nlangtag/mslangid.hxx #include iomanip #include iterator -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include rtl/digest.h #include rtl/math.hxx diff --git a/connectivity/inc/pch/precompiled_odbc.hxx b/connectivity/inc/pch/precompiled_odbc.hxx index 3881b9d..3cef9db 100644 --- a/connectivity/inc/pch/precompiled_odbc.hxx +++ b/connectivity/inc/pch/precompiled_odbc.hxx @@ -42,7 +42,6 @@ #include cppuhelper/queryinterface.hxx #include cppuhelper/supportsservice.hxx #include cppuhelper/typeprovider.hxx -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include osl/process.h #include osl/thread.h diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx index ffe258a..9e3632d 100644 --- a/connectivity/source/commontools/TSortIndex.cxx +++ b/connectivity/source/commontools/TSortIndex.cxx @@ -20,7 +20,6 @@ #include TSortIndex.hxx #include algorithm #include iterator - #include o3tl/compat_functional.hxx using namespace connectivity; diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index b77b2de..30c6a1b 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -295,7 +295,7 @@ void OTableHelper::refreshColumns() aSortedColumns.end(), ::std::insert_iterator TStringVector ( aVector, aVector.begin() ), ::o3tl::select2nd ::std::map OrdinalPosition, OUString ::value_type () -); +); } if(m_pColumns) diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index 0e91b49..e1a9803 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -27,8 +27,6 @@ #include comphelper/types.hxx #include ado/ACatalog.hxx -#include o3tl/compat_functional.hxx - using namespace ::comphelper; using namespace connectivity::ado; diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index 56a253c..c19d8a7 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -31,8 +31,6 @@ #include algorithm #include resource/ado_res.hrc -#include o3tl/compat_functional.hxx - using namespace connectivity::ado; using namespace connectivity; using namespace comphelper; diff
[Libreoffice-commits] core.git: include/o3tl
include/o3tl/compat_functional.hxx | 41 ++--- 1 file changed, 16 insertions(+), 25 deletions(-) New commits: commit ae6afadbc0c6ffcdbfd0db6bb3b0166295d5effd Author: Daniel Robertson danlrobertso...@gmail.com Date: Mon Aug 10 10:56:02 2015 -0400 tdf#92459 o3tl: remove unary_function Clean up o3tl/compat_functional.hxx select1st/select2nd. Remove the structs inheritance from the now deprecated unary_function. Remove project1st, as it is not used. Change-Id: I60c0f30c4b87417a331a4b38f62993cc3d1c9a51 Reviewed-on: https://gerrit.libreoffice.org/17625 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/include/o3tl/compat_functional.hxx b/include/o3tl/compat_functional.hxx index 6d04e67..fa6fbd5 100644 --- a/include/o3tl/compat_functional.hxx +++ b/include/o3tl/compat_functional.hxx @@ -32,48 +32,39 @@ #ifndef INCLUDED_O3TL_COMPAT_FUNCTIONAL_HXX #define INCLUDED_O3TL_COMPAT_FUNCTIONAL_HXX +#include utility #include functional namespace o3tl { - -/// Functor, given two parameters, return the first -templateclass T1,class T2 -struct project1st : public std::binary_functionT1, T2, T1 -{ -T1 operator()(const T1 y, const T2) const -{ -return y; -} -}; - -/// Functor, given two parameters, return the second -templateclass T1,class T2 +// Functor, given two parameters, return the second +templateclass T1, class T2 struct project2nd : public std::binary_functionT1, T2, T2 { -T2 operator()(const T1, const T2 x) const -{ +T2 operator()(const T1, const T2 x) const { return x; } }; /// Select first value of a pair -templateclass P -struct select1st : public std::unary_functionP, typename P::first_type +templatetypename P +struct select1st { -const typename P::first_type operator()(const P y) const -{ -return y.first; +typedef P argument_type; +typedef typename P::first_type result_type; +const result_type operator()( const argument_type cp ) const { +return cp.first; } }; /// Select second value of a pair -templateclass P -struct select2nd : public std::unary_functionP, typename P::second_type +templatetypename P +struct select2nd { -const typename P::second_type operator()(const P y) const -{ -return y.second; +typedef P argument_type; +typedef typename P::second_type result_type; +const result_type operator()( const argument_type cp ) const { +return cp.second; } }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: slideshow/inc slideshow/source slideshow/test
slideshow/inc/pch/precompiled_slideshow.hxx |1 slideshow/source/engine/pointersymbol.cxx | 23 ++-- slideshow/source/engine/pointersymbol.hxx |1 slideshow/source/engine/rehearsetimingsactivity.cxx | 21 ++ slideshow/source/engine/slide/layermanager.cxx | 15 + slideshow/source/engine/slide/shapemanagerimpl.cxx | 22 +-- slideshow/source/engine/slide/slideimpl.cxx | 23 ++-- slideshow/source/engine/waitsymbol.cxx | 22 ++- slideshow/source/engine/waitsymbol.hxx |1 slideshow/test/testshape.cxx| 16 + 10 files changed, 49 insertions(+), 96 deletions(-) New commits: commit 717b23ef2765678a5598d652956edd77d2d62fc5 Author: Daniel Robertson danlrobertso...@gmail.com Date: Sat Aug 1 11:27:08 2015 -0400 tdf#92459 replace deprecated o3tl features Replace deprecated features from the o3tl including select1st and select2nd with lambda expressions. Change-Id: I0cb1aedc3e193c52d25e2837a47d9d90c898079e Reviewed-on: https://gerrit.libreoffice.org/17459 Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de Tested-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx index 96a8bb9..e41362e 100644 --- a/slideshow/inc/pch/precompiled_slideshow.hxx +++ b/slideshow/inc/pch/precompiled_slideshow.hxx @@ -189,7 +189,6 @@ #include limits #include map #include math.h -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include osl/diagnose.hxx #include queue diff --git a/slideshow/source/engine/pointersymbol.cxx b/slideshow/source/engine/pointersymbol.cxx index 20dd121..eed4056 100644 --- a/slideshow/source/engine/pointersymbol.cxx +++ b/slideshow/source/engine/pointersymbol.cxx @@ -18,7 +18,6 @@ */ -#include boost/current_function.hpp #include canvas/canvastools.hxx #include comphelper/anytostring.hxx @@ -33,7 +32,6 @@ #include pointersymbol.hxx #include eventmultiplexer.hxx -#include o3tl/compat_functional.hxx #include algorithm @@ -68,9 +66,8 @@ PointerSymbol::PointerSymbol( uno::Referencerendering::XBitmap constxBitm { std::for_each( rViewContainer.begin(), rViewContainer.end(), - boost::bind( PointerSymbol::viewAdded, -this, -_1 )); + []( const UnoViewSharedPtr sp ) + { this-viewAdded(sp); } ); } void PointerSymbol::setVisible( const bool bVisible ) @@ -147,11 +144,9 @@ void PointerSymbol::viewRemoved( const UnoViewSharedPtr rView ) maViews.erase( std::remove_if( maViews.begin(), maViews.end(), -boost::bind( -std::equal_toUnoViewSharedPtr(), -rView, -// select view: -boost::bind( o3tl::select1stViewsVecT::value_type(), _1 ) ) ), +[rView] +( const ::std::pair UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr cp ) +{ return rView == cp.first; } ), maViews.end() ); } @@ -162,11 +157,9 @@ void PointerSymbol::viewChanged( const UnoViewSharedPtr rView ) std::find_if( maViews.begin(), maViews.end(), -boost::bind( -std::equal_toUnoViewSharedPtr(), -rView, -// select view: -boost::bind( o3tl::select1stViewsVecT::value_type(), _1 ; +[rView] +( const ::std::pair UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr cp ) +{ return rView == cp.first; } ) ); OSL_ASSERT( aModifiedEntry != maViews.end() ); if( aModifiedEntry == maViews.end() ) diff --git a/slideshow/source/engine/pointersymbol.hxx b/slideshow/source/engine/pointersymbol.hxx index 4d9a89d..8a7517f 100644 --- a/slideshow/source/engine/pointersymbol.hxx +++ b/slideshow/source/engine/pointersymbol.hxx @@ -22,7 +22,6 @@ #include unoview.hxx #include boost/shared_ptr.hpp -#include boost/bind.hpp #include boost/noncopyable.hpp #include vector diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index a0c271d..966bfc3 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -46,7 +46,6 @@ #include rehearsetimingsactivity.hxx #include boost/bind.hpp -#include o3tl/compat_functional.hxx #include algorithm using namespace com::sun::star; @@ -355,13 +354,10 @@ void RehearseTimingsActivity::viewAdded( const UnoViewSharedPtr rView ) void RehearseTimingsActivity::viewRemoved( const UnoViewSharedPtr rView ) { maViews.erase( -std::remove_if( -maViews.begin
[Libreoffice-commits] core.git: extensions/source
extensions/source/propctrlr/eformshelper.cxx |5 ++--- extensions/source/propctrlr/eventhandler.cxx |3 +-- extensions/source/propctrlr/genericpropertyhandler.cxx |4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) New commits: commit 4ce10ff6ce725212efa91a017a61e1bd781008c1 Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Aug 7 23:09:04 2015 -0400 tdf#92459 remove compat_functional from extensions Replace all uses of deprecated features from the o3tl in compat_functional.hxx with lambda expressions in extensions. There should be no side effects due to this patch. Change-Id: Ib9a217c1d61593eaba82431ab047e5b899c74568 Reviewed-on: https://gerrit.libreoffice.org/17587 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Thorsten Behrens thorsten.behr...@cib.de diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx index db9dec1..14731e1b 100644 --- a/extensions/source/propctrlr/eformshelper.cxx +++ b/extensions/source/propctrlr/eformshelper.cxx @@ -34,8 +34,6 @@ #include functional #include algorithm -#include o3tl/compat_functional.hxx - namespace pcr { @@ -701,7 +699,8 @@ namespace pcr } _rElementNames.resize( rMapUINameToElement.size() ); -::std::transform( rMapUINameToElement.begin(), rMapUINameToElement.end(), _rElementNames.begin(), ::o3tl::select1st MapStringToPropertySet::value_type () ); +::std::transform( rMapUINameToElement.begin(), rMapUINameToElement.end(), _rElementNames.begin(), +[]( const ::std::pair MapStringToPropertySet::key_type, MapStringToPropertySet::mapped_type cp) { return cp.first; } ); } diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index b521709..6a15c56 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -68,7 +68,6 @@ #include map #include algorithm -#include o3tl/compat_functional.hxx extern C void SAL_CALL createRegistryInfo_EventHandler() { @@ -776,7 +775,7 @@ namespace pcr StlSyntaxSequence Property aReturn( aOrderedProperties.size() ); ::std::transform( aOrderedProperties.begin(), aOrderedProperties.end(), aReturn.begin(), -::o3tl::select2nd ::std::map EventId, Property ::value_type () ); +[]( const ::std::pair EventId, Property cp ) { return cp.second; } ); return aReturn; } diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx index de94363..af489cc 100644 --- a/extensions/source/propctrlr/genericpropertyhandler.cxx +++ b/extensions/source/propctrlr/genericpropertyhandler.cxx @@ -41,7 +41,6 @@ #include tools/debug.hxx #include algorithm -#include o3tl/compat_functional.hxx extern C void SAL_CALL createRegistryInfo_GenericPropertyHandler() { @@ -531,7 +530,8 @@ namespace pcr Sequence Property aReturn( m_aProperties.size() ); ::std::transform( m_aProperties.begin(), m_aProperties.end(), -aReturn.getArray(), ::o3tl::select2nd PropertyMap::value_type () ); +aReturn.getArray(), []( const ::std::pair PropertyMap::key_type, PropertyMap::mapped_type cp ) +{ return cp.second; } ); return aReturn; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: dbaccess/inc dbaccess/source
dbaccess/inc/pch/precompiled_dba.hxx|1 - dbaccess/inc/pch/precompiled_dbu.hxx|1 - dbaccess/source/core/dataaccess/definitioncontainer.cxx |1 - dbaccess/source/core/dataaccess/documentevents.cxx |4 ++-- dbaccess/source/ui/browser/genericcontroller.cxx|4 ++-- dbaccess/source/ui/control/tabletree.cxx|1 - dbaccess/source/ui/dlg/DbAdminImpl.cxx |4 ++-- dbaccess/source/ui/misc/DExport.cxx |1 - dbaccess/source/ui/misc/WColumnSelect.cxx |1 - dbaccess/source/ui/misc/WCopyTable.cxx |1 - 10 files changed, 6 insertions(+), 13 deletions(-) New commits: commit 7339c360ef55fdde99907e1e34a231386ebc534e Author: Daniel Robertson danlrobertso...@gmail.com Date: Sun Aug 2 20:12:35 2015 -0400 tdf92459 replace select1st/2nd in dbaccess Replace all uses of deprecated features in the o3tl with lambda expressions in dbaccess. Change-Id: I865bb5db5257e985a0eed0110874d6b29892fcfb Reviewed-on: https://gerrit.libreoffice.org/17483 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Noel Grandin noelgran...@gmail.com diff --git a/dbaccess/inc/pch/precompiled_dba.hxx b/dbaccess/inc/pch/precompiled_dba.hxx index d097d79..0e5c763 100644 --- a/dbaccess/inc/pch/precompiled_dba.hxx +++ b/dbaccess/inc/pch/precompiled_dba.hxx @@ -309,7 +309,6 @@ #include limits #include list #include map -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include osl/file.hxx #include osl/mutex.hxx diff --git a/dbaccess/inc/pch/precompiled_dbu.hxx b/dbaccess/inc/pch/precompiled_dbu.hxx index 89f563b..9a4fa62 100644 --- a/dbaccess/inc/pch/precompiled_dbu.hxx +++ b/dbaccess/inc/pch/precompiled_dbu.hxx @@ -349,7 +349,6 @@ #include map #include math.h #include memory -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include osl/file.hxx #include osl/mutex.hxx diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index e9034ce..6e0c781 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -36,7 +36,6 @@ #include com/sun/star/sdb/ErrorCondition.hpp #include comphelper/types.hxx #include ucbhelper/contentidentifier.hxx -#include o3tl/compat_functional.hxx using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx index 40c0d18..9966a23 100644 --- a/dbaccess/source/core/dataaccess/documentevents.cxx +++ b/dbaccess/source/core/dataaccess/documentevents.cxx @@ -26,7 +26,6 @@ #include algorithm #include functional -#include o3tl/compat_functional.hxx namespace dbaccess { @@ -204,7 +203,8 @@ namespace dbaccess m_pData-rEventsData.begin(), m_pData-rEventsData.end(), aNames.getArray(), -::o3tl::select1st DocumentEventsData::value_type () +[]( const ::std::pair DocumentEventsData::key_type, DocumentEventsData::mapped_type cp ) +{ return cp.first; } ); return aNames; } diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 3f7d765..df4066e 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -58,7 +58,6 @@ #include com/sun/star/util/XModifiable.hpp #include rtl/ustring.hxx #include algorithm -#include o3tl/compat_functional.hxx #include boost/scoped_ptr.hpp #include cppuhelper/implbase1.hxx #include limits @@ -1469,7 +1468,8 @@ Sequence ::sal_Int16 SAL_CALL OGenericUnoController::getSupportedCommandGroup ::std::transform( aCmdHashMap.begin(), aCmdHashMap.end(), aCommandGroups.getArray(), -::o3tl::select1st CommandHashMap::value_type () +[]( const ::std::pair CommandHashMap::key_type, CommandHashMap::mapped_type cp ) +{ return cp.first; } ); return aCommandGroups; diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index d243412..5d5ec4c 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -45,7 +45,6 @@ #include svtools/treelistentry.hxx #include algorithm -#include o3tl/compat_functional.hxx namespace dbaui { diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 97c6452..03c30af 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -70,7 +70,6 @@ #include algorithm #include functional -#include o3tl/compat_functional.hxx namespace dbaui { @@ -773,7 +772,8 @@ void ODbDataSourceAdministrationHelper
[Libreoffice-commits] core.git: chart2/inc chart2/source
chart2/inc/pch/precompiled_chartcontroller.hxx|1 - chart2/inc/pch/precompiled_chartcore.hxx |1 - chart2/source/controller/accessibility/AccessibleBase.cxx |4 ++-- chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |4 ++-- chart2/source/controller/dialogs/DialogModel.cxx |9 - chart2/source/inc/CommonFunctors.hxx |8 +++- chart2/source/inc/ContainerHelper.hxx |7 --- chart2/source/model/template/ChartTypeManager.cxx |4 ++-- 8 files changed, 17 insertions(+), 21 deletions(-) New commits: commit 5916d5866c109b17471a9c8604635612a0aa69ae Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Jul 31 10:24:01 2015 -0400 tdf#92459 replace deprecated o3tl features Replace all uses of deprecated features from o3tl/compat_functional.hxx with lambda expressions. Change-Id: I6370c80dbe675da517904e535e19bf63830c3e2c Reviewed-on: https://gerrit.libreoffice.org/17450 Reviewed-by: David Ostrovsky da...@ostrovsky.org Tested-by: David Ostrovsky da...@ostrovsky.org diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index f6ebf36..2805e0b 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -193,7 +193,6 @@ #include map #include memory #include numeric -#include o3tl/compat_functional.hxx #include osl/diagnose.h #include osl/mutex.hxx #include rtl/instance.hxx diff --git a/chart2/inc/pch/precompiled_chartcore.hxx b/chart2/inc/pch/precompiled_chartcore.hxx index 30ecb46..5bf7c8a 100644 --- a/chart2/inc/pch/precompiled_chartcore.hxx +++ b/chart2/inc/pch/precompiled_chartcore.hxx @@ -248,7 +248,6 @@ #include iterator #include limits #include map -#include o3tl/compat_functional.hxx #include officecfg/Office/Common.hxx #include osl/conditn.hxx #include osl/diagnose.h diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index c272666..dc3832d 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -50,7 +50,6 @@ #include vcl/settings.hxx #include algorithm -#include o3tl/compat_functional.hxx #include ChartElementFactory.hxx @@ -252,7 +251,8 @@ bool AccessibleBase::ImplUpdateChildren() aAccChildren.reserve( aModelChildren.size()); ::std::transform( m_aChildOIDMap.begin(), m_aChildOIDMap.end(), ::std::back_inserter( aAccChildren ), - ::o3tl::select1st ChildOIDMap::value_type ()); + []( const ::std::pairObjectIdentifier, tAccessible cp ) + { return cp.first; } ); ::std::sort( aModelChildren.begin(), aModelChildren.end()); diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index d89abcc..d34d997 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -66,7 +66,6 @@ #include vector #include algorithm #include functional -#include o3tl/compat_functional.hxx using namespace ::com::sun::star; using namespace ::com::sun::star::chart; @@ -1460,7 +1459,8 @@ uno::Sequence OUString SAL_CALL ChartDocumentWrapper::getAvailableServiceName ::std::transform( rMap.begin(), rMap.end(), aResult.getArray(), - ::o3tl::select1st tServiceNameMap::value_type () ); + []( const ::std::pair OUString, eServiceType cp ) + { return cp.first; } ); return aResult; diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 6127ee9..e017ddc 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -47,7 +47,6 @@ #include iterator #include functional #include numeric -#include o3tl/compat_functional.hxx using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; @@ -110,10 +109,10 @@ OUString lcl_ConvertRole( const OUString rRoleString, bool bFromInternalToUI ) { tTranslationMap::const_iterator aIt( ::std::find_if( aTranslationMap.begin(), aTranslationMap.end(), -::o3tl::compose1( ::std::bind2nd( - ::std::equal_to tTranslationMap::mapped_type (), - rRoleString ), - ::o3tl::select2nd tTranslationMap::value_type
[Libreoffice-commits] core.git: canvas/source
canvas/source/factory/cf_service.cxx | 84 ++- 1 file changed, 35 insertions(+), 49 deletions(-) New commits: commit 1a5e176e626d70d19abe4ad6e3b5c8d54a7badd7 Author: Daniel Robertson danlrobertso...@gmail.com Date: Wed Jul 29 23:07:45 2015 -0400 tdf#92459 Replace select1st for lambda expressions Replace all instances of select1st with lambda functions in canvas/source/factory/cf_service.cxx. Change-Id: I935282817fdf6496bd03752b8adb89e827ff28c5 Reviewed-on: https://gerrit.libreoffice.org/17409 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: David Ostrovsky da...@ostrovsky.org diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index 5177989..301001c 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -35,10 +35,8 @@ #include com/sun/star/container/XHierarchicalNameAccess.hpp #include com/sun/star/beans/PropertyValue.hpp -#include boost/bind.hpp #include vector #include utility -#include o3tl/compat_functional.hxx #include algorithm @@ -54,10 +52,8 @@ class CanvasFactory lang::XMultiComponentFactory, lang::XMultiServiceFactory { -typedef std::pairOUString,SequenceOUString AvailPair; -typedef std::pairOUString,OUStringCachePair; -typedef std::vector AvailPair AvailVector; -typedef std::vector CachePair CacheVector; +typedef std::vectorstd::pairOUString, SequenceOUString AvailVector; +typedef std::vectorstd::pairOUString, OUString CacheVector; mutable ::osl::Mutex m_mutex; @@ -242,7 +238,9 @@ SequenceOUString CanvasFactory::getAvailableServiceNames() std::transform(m_aAvailableImplementations.begin(), m_aAvailableImplementations.end(), aServiceNames.getArray(), - o3tl::select1stAvailPair()); + [](std::pairOUString, SequenceOUString const ap) + { return ap.first; } +); return aServiceNames; } @@ -325,14 +323,12 @@ ReferenceXInterface CanvasFactory::lookupAndUse( // try to reuse last working implementation for given service name const CacheVector::iterator aEnd(m_aCachedImplementations.end()); CacheVector::iterator aMatch; -if( (aMatch=std::find_if(m_aCachedImplementations.begin(), - aEnd, - boost::bind(OUString::equals, - boost::cref(serviceName), - boost::bind( - o3tl::select1stCachePair(), - _1 != aEnd ) -{ +if( (aMatch=std::find_if( +m_aCachedImplementations.begin(), +aEnd, +[serviceName](std::pairOUString, OUString const cp) +{ return serviceName.equals(cp.first); } +)) != aEnd) { ReferenceXInterface xCanvas( use( aMatch-second, args, xContext ) ); if(xCanvas.is()) return xCanvas; @@ -341,40 +337,34 @@ ReferenceXInterface CanvasFactory::lookupAndUse( // lookup in available service list const AvailVector::const_iterator aAvailEnd(m_aAvailableImplementations.end()); AvailVector::const_iterator aAvailImplsMatch; -if( (aAvailImplsMatch=std::find_if(m_aAvailableImplementations.begin(), - aAvailEnd, - boost::bind(OUString::equals, - boost::cref(serviceName), - boost::bind( - o3tl::select1stAvailPair(), - _1 == aAvailEnd ) -{ +if( (aAvailImplsMatch=std::find_if( +m_aAvailableImplementations.begin(), +aAvailEnd, +[serviceName](std::pairOUString, SequenceOUString const ap) +{ return serviceName.equals(ap.first); } +)) == aAvailEnd ) { return ReferenceXInterface(); } const AvailVector::const_iterator aAAEnd(m_aAAImplementations.end()); AvailVector::const_iterator aAAImplsMatch; -if( (aAAImplsMatch=std::find_if(m_aAAImplementations.begin(), -aAAEnd, -boost::bind(OUString::equals, -boost::cref(serviceName), -boost::bind( - o3tl::select1stAvailPair(), -_1
[Libreoffice-commits] core.git: filter/source include/vcl vcl/source vcl/win
filter/source/graphicfilter/egif/giflzwc.cxx |2 +- filter/source/graphicfilter/egif/giflzwc.hxx |2 +- include/vcl/salbtype.hxx | 23 +++ vcl/source/filter/igif/decode.cxx|8 vcl/source/filter/igif/decode.hxx| 12 ++-- vcl/source/filter/igif/gifread.cxx | 10 +- vcl/source/filter/igif/gifread.hxx |4 ++-- vcl/win/source/gdi/salbmp.cxx| 10 +- 8 files changed, 35 insertions(+), 36 deletions(-) New commits: commit b97aa3faa03e5944aac8f3c35a8c198fba295e83 Author: Daniel Robertson danlrobertso...@gmail.com Date: Fri Jul 17 12:28:01 2015 -0400 Remove the unnecessary type definition: HPBYTE HPBYTE is a duplicate defintion of Scanline as seen below. include/vcl/salbtype.hxx: 34: typedef sal_uInt8*HPBYTE; 35: typedef HPBYTEScanline; Remove the definition of HPBYTE and inline the definition of Scanline. Replace all instances with sal_uInt8*. Change-Id: I8a79a9d6c45af57fbabf8d3e6a04a1b5eba15a7b Reviewed-on: https://gerrit.libreoffice.org/17175 Reviewed-by: Noel Grandin noelgran...@gmail.com Tested-by: Noel Grandin noelgran...@gmail.com diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx b/filter/source/graphicfilter/egif/giflzwc.cxx index 49d996a..f845c9c 100644 --- a/filter/source/graphicfilter/egif/giflzwc.cxx +++ b/filter/source/graphicfilter/egif/giflzwc.cxx @@ -172,7 +172,7 @@ void GIFLZWCompressor::StartCompression( SvStream rGIF, sal_uInt16 nPixelSize ) -void GIFLZWCompressor::Compress( HPBYTE pSrc, sal_uLong nSize ) +void GIFLZWCompressor::Compress( sal_uInt8* pSrc, sal_uLong nSize ) { if( pIDOS ) { diff --git a/filter/source/graphicfilter/egif/giflzwc.hxx b/filter/source/graphicfilter/egif/giflzwc.hxx index 992e51c..6159e55 100644 --- a/filter/source/graphicfilter/egif/giflzwc.hxx +++ b/filter/source/graphicfilter/egif/giflzwc.hxx @@ -48,7 +48,7 @@ public: ~GIFLZWCompressor(); voidStartCompression( SvStream rGIF, sal_uInt16 nPixelSize ); -voidCompress( HPBYTE pSrc, sal_uLong nSize ); +voidCompress( sal_uInt8* pSrc, sal_uLong nSize ); voidEndCompression(); }; diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index f4ce3cb..673c285 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -31,8 +31,7 @@ // - Memory - -typedef sal_uInt8*HPBYTE; -typedef HPBYTEScanline; +typedef sal_uInt8*Scanline; typedef const sal_uInt8* ConstScanline; @@ -216,19 +215,19 @@ public: inline sal_uLongGetBlueMask() const; inline void GetColorFor8Bit( BitmapColor rColor, const sal_uInt8* pPixel ) const; -inline void SetColorFor8Bit( const BitmapColor rColor, HPBYTE pPixel ) const; +inline void SetColorFor8Bit( const BitmapColor rColor, sal_uInt8* pPixel ) const; inline void GetColorFor16BitMSB( BitmapColor rColor, const sal_uInt8* pPixel ) const; -inline void SetColorFor16BitMSB( const BitmapColor rColor, HPBYTE pPixel ) const; +inline void SetColorFor16BitMSB( const BitmapColor rColor, sal_uInt8* pPixel ) const; inline void GetColorFor16BitLSB( BitmapColor rColor, const sal_uInt8* pPixel ) const; -inline void SetColorFor16BitLSB( const BitmapColor rColor, HPBYTE pPixel ) const; +inline void SetColorFor16BitLSB( const BitmapColor rColor, sal_uInt8* pPixel ) const; inline void GetColorFor24Bit( BitmapColor rColor, const sal_uInt8* pPixel ) const; -inline void SetColorFor24Bit( const BitmapColor rColor, HPBYTE pPixel ) const; +inline void SetColorFor24Bit( const BitmapColor rColor, sal_uInt8* pPixel ) const; inline void GetColorFor32Bit( BitmapColor rColor, const sal_uInt8* pPixel ) const; inline void GetColorAndAlphaFor32Bit( BitmapColor rColor, sal_uInt8 rAlpha, const sal_uInt8* pPixel ) const; -inline void SetColorFor32Bit( const BitmapColor rColor, HPBYTE pPixel ) const; +inline void SetColorFor32Bit( const BitmapColor rColor, sal_uInt8* pPixel ) const; }; // - BitmapBuffer - @@ -651,7 +650,7 @@ inline void ColorMask::GetColorFor8Bit( BitmapColor rColor, const sal_uInt8* pP MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor ); } -inline void ColorMask::SetColorFor8Bit( const BitmapColor rColor, HPBYTE pPixel ) const +inline void ColorMask::SetColorFor8Bit( const BitmapColor rColor, sal_uInt8* pPixel ) const { *pPixel = (sal_uInt8) COLOR_TO_MASK( rColor, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, mnAlphaChannel ); } @@ -663,7 +662,7