[Libreoffice-commits] core.git: toolkit/inc toolkit/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 22 06:59:07 UTC 2021


 toolkit/inc/controls/animatedimages.hxx    |    3 --
 toolkit/source/controls/animatedimages.cxx |   32 +++++++++++------------------
 2 files changed, 14 insertions(+), 21 deletions(-)

New commits:
commit f8c6d90bc5b344e65cf0ae6cdd028956bb31dbe4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 21 11:58:46 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 22 08:58:31 2021 +0200

    remove pimpl in AnimatedImagesControlModel
    
    Change-Id: I34ffaca1c5d109a28b75730bd7634e244b8bf31b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119327
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/toolkit/inc/controls/animatedimages.hxx b/toolkit/inc/controls/animatedimages.hxx
index c1847b35f7b6..0afd921f478a 100644
--- a/toolkit/inc/controls/animatedimages.hxx
+++ b/toolkit/inc/controls/animatedimages.hxx
@@ -31,7 +31,6 @@ namespace toolkit
 {
 
 
-    struct AnimatedImagesControlModel_Data;
     typedef ::cppu::AggImplInheritanceHelper1   <   UnoControlModel
                                                 ,   css::awt::XAnimatedImages
                                                 >   AnimatedImagesControlModel_Base;
@@ -78,7 +77,7 @@ namespace toolkit
         void SAL_CALL                   setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
 
     private:
-        std::unique_ptr< AnimatedImagesControlModel_Data > m_xData;
+        std::vector< css::uno::Sequence< OUString > >    maImageSets;
     };
 
 
diff --git a/toolkit/source/controls/animatedimages.cxx b/toolkit/source/controls/animatedimages.cxx
index c304782e8d1f..9ef3506d122c 100644
--- a/toolkit/source/controls/animatedimages.cxx
+++ b/toolkit/source/controls/animatedimages.cxx
@@ -203,17 +203,12 @@ public:
 
 namespace toolkit {
 
-    struct AnimatedImagesControlModel_Data
-    {
-        ::std::vector< Sequence< OUString > >    aImageSets;
-    };
-
     namespace
     {
-        void lcl_checkIndex( const AnimatedImagesControlModel_Data& i_data, const sal_Int32 i_index, const Reference< XInterface >& i_context,
+        void lcl_checkIndex( std::vector< css::uno::Sequence< OUString > > & rImageSets, const sal_Int32 i_index, const Reference< XInterface >& i_context,
             const bool i_forInsert = false )
         {
-            if ( ( i_index < 0 ) || ( o3tl::make_unsigned( i_index ) > i_data.aImageSets.size() + ( i_forInsert ? 1 : 0 ) ) )
+            if ( ( i_index < 0 ) || ( o3tl::make_unsigned( i_index ) > rImageSets.size() + ( i_forInsert ? 1 : 0 ) ) )
                 throw IndexOutOfBoundsException( OUString(), i_context );
         }
 
@@ -238,7 +233,6 @@ namespace toolkit {
 
     AnimatedImagesControlModel::AnimatedImagesControlModel( Reference< css::uno::XComponentContext > const & i_factory )
         :AnimatedImagesControlModel_Base( i_factory )
-        ,m_xData( new AnimatedImagesControlModel_Data )
     {
         ImplRegisterProperty( BASEPROPERTY_AUTO_REPEAT );
         ImplRegisterProperty( BASEPROPERTY_BORDER );
@@ -255,7 +249,7 @@ namespace toolkit {
 
     AnimatedImagesControlModel::AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource )
         :AnimatedImagesControlModel_Base( i_copySource )
-        ,m_xData( new AnimatedImagesControlModel_Data( *i_copySource.m_xData ) )
+        ,maImageSets( i_copySource.maImageSets )
     {
     }
 
@@ -397,7 +391,7 @@ namespace toolkit {
         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
             throw DisposedException();
 
-        return m_xData->aImageSets.size();
+        return maImageSets.size();
     }
 
 
@@ -407,9 +401,9 @@ namespace toolkit {
         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
             throw DisposedException();
 
-        lcl_checkIndex( *m_xData, i_index, *this );
+        lcl_checkIndex( maImageSets, i_index, *this );
 
-        return m_xData->aImageSets[ i_index ];
+        return maImageSets[ i_index ];
     }
 
 
@@ -420,10 +414,10 @@ namespace toolkit {
         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
             throw DisposedException();
 
-        lcl_checkIndex( *m_xData, i_index, *this, true );
+        lcl_checkIndex( maImageSets, i_index, *this, true );
 
         // actual insertion
-        m_xData->aImageSets.insert( m_xData->aImageSets.begin() + i_index, i_imageURLs );
+        maImageSets.insert( maImageSets.begin() + i_index, i_imageURLs );
 
         // listener notification
         lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementInserted, i_index, i_imageURLs, *this );
@@ -437,10 +431,10 @@ namespace toolkit {
         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
             throw DisposedException();
 
-        lcl_checkIndex( *m_xData, i_index, *this );
+        lcl_checkIndex( maImageSets, i_index, *this );
 
         // actual insertion
-        m_xData->aImageSets[ i_index ] = i_imageURLs;
+        maImageSets[ i_index ] = i_imageURLs;
 
         // listener notification
         lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementReplaced, i_index, i_imageURLs, *this );
@@ -454,12 +448,12 @@ namespace toolkit {
         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
             throw DisposedException();
 
-        lcl_checkIndex( *m_xData, i_index, *this );
+        lcl_checkIndex( maImageSets, i_index, *this );
 
         // actual removal
-        ::std::vector< Sequence< OUString > >::iterator removalPos = m_xData->aImageSets.begin() + i_index;
+        ::std::vector< Sequence< OUString > >::iterator removalPos = maImageSets.begin() + i_index;
         Sequence< OUString > aRemovedElement( *removalPos );
-        m_xData->aImageSets.erase( removalPos );
+        maImageSets.erase( removalPos );
 
         // listener notification
         lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementRemoved, i_index, aRemovedElement, *this );


More information about the Libreoffice-commits mailing list