[Libreoffice-commits] core.git: 2 commits - filter/source forms/source

Noel Grandin noelgrandin at gmail.com
Fri Apr 1 07:34:07 UTC 2016


 filter/source/svg/svgexport.cxx            |   22 +++++------
 filter/source/svg/svgfilter.cxx            |   14 +++----
 filter/source/svg/svgfilter.hxx            |    5 +-
 forms/source/component/ComboBox.cxx        |    4 +-
 forms/source/component/FormComponent.cxx   |   27 ++++++++-----
 forms/source/component/ListBox.cxx         |   56 ++++++++++++++++-------------
 forms/source/component/entrylisthelper.cxx |   51 +++++++-------------------
 forms/source/component/entrylisthelper.hxx |    4 +-
 forms/source/inc/FormComponent.hxx         |   16 +++++---
 9 files changed, 97 insertions(+), 102 deletions(-)

New commits:
commit bd66648fc2d361a9a18e62522c244cd245abf198
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sat Feb 13 19:00:13 2016 +0200

    sequence->vector in filter
    
    Change-Id: I2b18a4affed75dfc36d44ba485b2ac44d0e082cb
    Reviewed-on: https://gerrit.libreoffice.org/23690
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 8e06845..17a8828 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -554,7 +554,7 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
 
     if( xOStm.is() )
     {
-        if( mSelectedPages.hasElements() && !mMasterPageTargets.empty() )
+        if( !mSelectedPages.empty() && !mMasterPageTargets.empty() )
         {
             Reference< XDocumentHandler > xDocHandler( implCreateExportDocumentHandler( xOStm ), UNO_QUERY );
 
@@ -571,8 +571,8 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
                 Reference< XInterface > xSVGExport = static_cast< css::document::XFilter* >( mpSVGExport );
 
                 // create an id for each draw page
-                for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
-                    implRegisterInterface( mSelectedPages[i] );
+                for( auto& rPage : mSelectedPages )
+                    implRegisterInterface( rPage );
 
                 // create an id for each master page
                 for( size_t i = 0; i < mMasterPageTargets.size(); ++i )
@@ -658,7 +658,7 @@ Reference< XWriter > SVGFilter::implCreateExportDocumentHandler( const Reference
 
 bool SVGFilter::implLookForFirstVisiblePage()
 {
-    sal_Int32 nCurPage = 0, nLastPage = mSelectedPages.getLength() - 1;
+    sal_Int32 nCurPage = 0, nLastPage = mSelectedPages.size() - 1;
 
     while( ( nCurPage <= nLastPage ) && ( -1 == mnVisiblePage ) )
     {
@@ -692,7 +692,7 @@ bool SVGFilter::implExportDocument()
     sal_Int32        nDocX = 0, nDocY = 0; // #i124608#
     sal_Int32        nDocWidth = 0, nDocHeight = 0;
     bool         bRet = false;
-    sal_Int32        nLastPage = mSelectedPages.getLength() - 1;
+    sal_Int32        nLastPage = mSelectedPages.size() - 1;
 
     mbSinglePage = (nLastPage == 0);
     mnVisiblePage = -1;
@@ -933,7 +933,7 @@ OUString implGenerateFieldId( std::vector< TextField* > & aFieldSet,
 
 void SVGFilter::implGenerateMetaData()
 {
-    sal_Int32 nCount = mSelectedPages.getLength();
+    sal_Int32 nCount = mSelectedPages.size();
     if( nCount != 0 )
     {
         // we wrap all meta presentation info into a svg:defs element
@@ -1160,7 +1160,7 @@ void SVGFilter::implExportAnimations()
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation-animations" );
     SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
 
-    for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+    for( size_t i = 0; i < mSelectedPages.size(); ++i )
     {
         Reference< XPropertySet > xProps( mSelectedPages[i], UNO_QUERY );
 
@@ -1220,7 +1220,7 @@ void SVGFilter::implExportTextShapeIndex()
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "TextShapeIndex" );
     SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
 
-    sal_Int32 nCount = mSelectedPages.getLength();
+    sal_Int32 nCount = mSelectedPages.size();
     for( sal_Int32 i = 0; i < nCount; ++i )
     {
         const Reference< XDrawPage > & xDrawPage = mSelectedPages[i];
@@ -1490,7 +1490,7 @@ bool SVGFilter::implExportMasterPages( const std::vector< Reference< XDrawPage >
 }
 
 
-void SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPages,
+void SVGFilter::implExportDrawPages( const std::vector< Reference< XDrawPage > > & rxPages,
                                            sal_Int32 nFirstPage, sal_Int32 nLastPage )
 {
     DBG_ASSERT( nFirstPage <= nLastPage,
@@ -1881,7 +1881,7 @@ bool SVGFilter::implCreateObjects()
     if (mbExportShapeSelection)
     {
         // #i124608# export a given object selection
-        if (mSelectedPages.getLength() && mSelectedPages[0].is())
+        if (!mSelectedPages.empty() && mSelectedPages[0].is())
         {
             implCreateObjectsFromShapes(mSelectedPages[0], maShapeSelection);
             return true;
@@ -1905,7 +1905,7 @@ bool SVGFilter::implCreateObjects()
         }
     }
 
-    for( i = 0, nCount = mSelectedPages.getLength(); i < nCount; ++i )
+    for( i = 0, nCount = mSelectedPages.size(); i < nCount; ++i )
     {
         const Reference< XDrawPage > & xDrawPage = mSelectedPages[i];
 
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index f993900..503510a 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -168,8 +168,8 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
                         {
                             ObjectSequence aSelectedPageSequence;
                             aSelection >>= aSelectedPageSequence;
-                            mSelectedPages.realloc( aSelectedPageSequence.getLength() );
-                            for( sal_Int32 j=0; j<mSelectedPages.getLength(); ++j )
+                            mSelectedPages.resize( aSelectedPageSequence.getLength() );
+                            for( size_t j=0; j<mSelectedPages.size(); ++j )
                             {
                                 uno::Reference< drawing::XDrawPage > xDrawPage( aSelectedPageSequence[j],
                                                                                 uno::UNO_QUERY );
@@ -183,10 +183,10 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
                 }
             }
 
-            if( !mSelectedPages.hasElements() )
+            if( mSelectedPages.empty() )
             {
                 // apparently failed to clean selection - fallback to current page
-                mSelectedPages.realloc( 1 );
+                mSelectedPages.resize( 1 );
                 mSelectedPages[0] = xDrawView->getCurrentPage();
             }
         }
@@ -194,7 +194,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
         /*
          * Export all slides, or requested "PagePos"
          */
-        if( !mSelectedPages.hasElements() )
+        if( mSelectedPages.empty() )
         {
             uno::Reference< drawing::XMasterPagesSupplier > xMasterPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
             uno::Reference< drawing::XDrawPagesSupplier >   xDrawPagesSupplier( mxSrcDoc, uno::UNO_QUERY );
@@ -208,7 +208,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
                 {
                     sal_Int32 nDPCount = xDrawPages->getCount();
 
-                    mSelectedPages.realloc( nPageToExport != -1 ? 1 : nDPCount );
+                    mSelectedPages.resize( nPageToExport != -1 ? 1 : nDPCount );
                     sal_Int32 i;
                     for( i = 0; i < nDPCount; ++i )
                     {
@@ -258,7 +258,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
              *  The master page are put in an unordered set.
              */
             ObjectSet aMasterPageTargetSet;
-            for( sal_Int32 i = 0; i < mSelectedPages.getLength(); ++i )
+            for( size_t i = 0; i < mSelectedPages.size(); ++i )
             {
                 uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPages[i], uno::UNO_QUERY );
                 if( xMasterPageTarget.is() )
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 0d1921d..fd65969 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -201,7 +201,6 @@ public:
     typedef std::unordered_map< Reference< XInterface >, ObjectRepresentation, HashReferenceXInterface >    ObjectMap;
     typedef std::unordered_set< Reference< XInterface >, HashReferenceXInterface >                          ObjectSet;
     typedef Sequence< Reference< XInterface > >                                                                 ObjectSequence;
-    typedef Sequence< Reference< XDrawPage > >                                                                  XDrawPageSequence;
 
     typedef std::unordered_set< sal_Unicode, HashUChar >                                                    UCharSet;
     typedef std::unordered_map< OUString, UCharSet, OUStringHash >                                          UCharSetMap;
@@ -240,7 +239,7 @@ private:
     // #i124608# explicit ShapeSelection for export when export of the selection is wanted
     Reference< XShapes >                maShapeSelection;
     bool                                mbExportShapeSelection;
-    XDrawPageSequence                   mSelectedPages;
+    std::vector< Reference< XDrawPage > > mSelectedPages;
     std::vector< Reference< XDrawPage > > mMasterPageTargets;
 
     Link<EditFieldInfo*,void>           maOldFieldHdl;
@@ -264,7 +263,7 @@ private:
 
     bool                            implExportMasterPages( const std::vector< Reference< XDrawPage > >& rxPages,
                                                                sal_Int32 nFirstPage, sal_Int32 nLastPage );
-    void                            implExportDrawPages( const XDrawPageSequence& rxPages,
+    void                            implExportDrawPages( const std::vector< Reference< XDrawPage > >& rxPages,
                                                              sal_Int32 nFirstPage, sal_Int32 nLastPage );
     bool                            implExportPage( const OUString & sPageId,
                                                         const Reference< XDrawPage > & rxPage,
commit 929eab216427d9f1c96df8b3ae9dafcad728e04e
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun Feb 14 13:43:04 2016 +0200

    sequence->vector in forms
    
    Change-Id: Iea09367a51af8d0003a3ae58f8e7e0e825906367
    Reviewed-on: https://gerrit.libreoffice.org/23691
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 7103e54..a3b04c7 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -190,7 +190,7 @@ void OComboBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) cons
             break;
 
         case PROPERTY_ID_STRINGITEMLIST:
-            _rValue <<= getStringItemList();
+            _rValue <<= comphelper::containerToSequence(getStringItemList());
             break;
 
         default:
@@ -815,7 +815,7 @@ Any OComboBoxModel::getDefaultForReset() const
 void OComboBoxModel::stringItemListChanged( ControlModelLock& /*_rInstanceLock*/ )
 {
     if ( m_xAggregateSet.is() )
-        m_xAggregateSet->setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( getStringItemList() ) );
+        m_xAggregateSet->setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( comphelper::containerToSequence(getStringItemList()) ) );
 }
 
 
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 4ffc3dd..e042c20 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -78,18 +78,11 @@ void ControlModelLock::impl_notifyAll_nothrow()
 
 void ControlModelLock::addPropertyNotification( const sal_Int32 _nHandle, const Any& _rOldValue, const Any& _rNewValue )
 {
-    sal_Int32 nOldLength = m_aHandles.getLength();
-    if  (   ( nOldLength != m_aOldValues.getLength() )
-        ||  ( nOldLength != m_aNewValues.getLength() )
-        )
-        throw RuntimeException( OUString(), m_rModel );
+    assert( m_aHandles.size() == m_aOldValues.size() && m_aOldValues.size() == m_aNewValues.size() );
 
-    m_aHandles.realloc( nOldLength + 1 );
-    m_aHandles[ nOldLength ] = _nHandle;
-    m_aOldValues.realloc( nOldLength + 1 );
-    m_aOldValues[ nOldLength ] = _rOldValue;
-    m_aNewValues.realloc( nOldLength + 1 );
-    m_aNewValues[ nOldLength ] = _rNewValue;
+    m_aHandles.push_back( _nHandle );
+    m_aOldValues.push_back( _rOldValue );
+    m_aNewValues.push_back( _rNewValue );
 }
 
 class FieldChangeNotifier
@@ -1122,6 +1115,18 @@ void OControlModel::firePropertyChanges( const Sequence< sal_Int32 >& _rHandles,
     );
 }
 
+void OControlModel::firePropertyChanges( const std::vector< sal_Int32 >& _rHandles, const std::vector< Any >& _rOldValues,
+                                        const std::vector< Any >& _rNewValues, LockAccess )
+{
+    OPropertySetHelper::fire(
+        const_cast< std::vector< sal_Int32 >& >( _rHandles ).data(),
+        _rNewValues.data(),
+        _rOldValues.data(),
+        _rHandles.size(),
+        sal_False
+    );
+}
+
 // OBoundControlModel
 Any SAL_CALL OBoundControlModel::queryAggregation( const Type& _rType ) throw (RuntimeException, std::exception)
 {
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 2abf7a8..b616fb7 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -282,7 +282,7 @@ namespace frm
             break;
 
         case PROPERTY_ID_STRINGITEMLIST:
-            _rValue <<= getStringItemList();
+            _rValue <<= comphelper::containerToSequence(getStringItemList());
             break;
 
         default:
@@ -1077,12 +1077,12 @@ namespace frm
             return m_aConvertedBoundValues;
         }
 
-        Sequence< OUString > aStringItems( getStringItemList() );
-        ValueList aValues( aStringItems.getLength() );
+        const std::vector< OUString >& aStringItems( getStringItemList() );
+        ValueList aValues( aStringItems.size() );
         ValueList::iterator dst = aValues.begin();
-        const OUString *src (aStringItems.getConstArray());
-        const OUString * const end = src + aStringItems.getLength();
-        for (; src < end; ++src, ++dst )
+        std::vector< OUString >::const_iterator src(aStringItems.begin());
+        std::vector< OUString >::const_iterator const end = aStringItems.end();
+        for (; src != end; ++src, ++dst )
         {
             *dst = *src;
             dst->setTypeKind(nFieldType);
@@ -1369,7 +1369,7 @@ namespace frm
         {
             sal_Int32 nSelectIndex = -1;
             OSL_VERIFY( _rExternalValue >>= nSelectIndex );
-            if ( ( nSelectIndex >= 0 ) && ( nSelectIndex < getStringItemList().getLength() ) )
+            if ( ( nSelectIndex >= 0 ) && ( nSelectIndex < (sal_Int32)getStringItemList().size() ) )
             {
                 aSelectIndexes.realloc( 1 );
                 aSelectIndexes[ 0 ] = static_cast< sal_Int16 >( nSelectIndex );
@@ -1390,16 +1390,14 @@ namespace frm
             const OUString* pSelectEntriesEnd = pSelectEntries + aSelectEntries.getLength();
             while ( pSelectEntries != pSelectEntriesEnd )
             {
-                // the indexes where the current string appears in our string items
-                Sequence< sal_Int16 > aThisEntryIndexes;
-                aThisEntryIndexes = findValue( getStringItemList(), *pSelectEntries++ );
-
-                // insert all the indexes of this entry into our set
-                ::std::copy(
-                    aThisEntryIndexes.getConstArray(),
-                    aThisEntryIndexes.getConstArray() + aThisEntryIndexes.getLength(),
-                    ::std::insert_iterator< ::std::set< sal_Int16 > >( aSelectionSet, aSelectionSet.begin() )
-                );
+                int idx = 0;
+                for(const OUString& s : getStringItemList())
+                {
+                    if (s==*pSelectEntries)
+                        aSelectionSet.insert(idx);
+                    ++idx;
+                }
+                ++pSelectEntries;
             }
 
             // copy the indexes to the sequence
@@ -1411,8 +1409,16 @@ namespace frm
         {
             OUString sStringToSelect;
             OSL_VERIFY( _rExternalValue >>= sStringToSelect );
+            ::std::set< sal_Int16 > aSelectionSet;
+            int idx = 0;
+            for(const OUString& s : getStringItemList())
+            {
+                if (s==sStringToSelect)
+                    aSelectionSet.insert(idx);
+                ++idx;
+            }
 
-            aSelectIndexes = findValue( getStringItemList(), sStringToSelect );
+            aSelectIndexes = comphelper::containerToSequence<sal_Int16>( aSelectionSet );
         }
         break;
         }
@@ -1427,22 +1433,22 @@ namespace frm
         struct ExtractStringFromSequence_Safe : public ::std::unary_function< sal_Int16, OUString >
         {
         protected:
-            const Sequence< OUString >&  m_rList;
+            const std::vector< OUString >&  m_rList;
 
         public:
-            explicit ExtractStringFromSequence_Safe( const Sequence< OUString >& _rList ) : m_rList( _rList ) { }
+            explicit ExtractStringFromSequence_Safe( const std::vector< OUString >& _rList ) : m_rList( _rList ) { }
 
             OUString operator ()( sal_Int16 _nIndex )
             {
-                OSL_ENSURE( _nIndex < m_rList.getLength(), "ExtractStringFromSequence_Safe: inconsistence!" );
-                if ( _nIndex < m_rList.getLength() )
+                OSL_ENSURE( _nIndex < (sal_Int32)m_rList.size(), "ExtractStringFromSequence_Safe: inconsistence!" );
+                if ( _nIndex < (sal_Int32)m_rList.size() )
                     return m_rList[ _nIndex ];
                 return OUString();
             }
         };
 
 
-        Any lcl_getSingleSelectedEntry( const Sequence< sal_Int16 >& _rSelectSequence, const Sequence< OUString >& _rStringList )
+        Any lcl_getSingleSelectedEntry( const Sequence< sal_Int16 >& _rSelectSequence, const std::vector< OUString >& _rStringList )
         {
             Any aReturn;
 
@@ -1462,7 +1468,7 @@ namespace frm
         }
 
 
-        Any lcl_getMultiSelectedEntries( const Sequence< sal_Int16 >& _rSelectSequence, const Sequence< OUString >& _rStringList )
+        Any lcl_getMultiSelectedEntries( const Sequence< sal_Int16 >& _rSelectSequence, const std::vector< OUString >& _rStringList )
         {
             Sequence< OUString > aSelectedEntriesTexts( _rSelectSequence.getLength() );
             ::std::transform(
@@ -1674,7 +1680,7 @@ namespace frm
         suspendValueListening();
         try
         {
-            m_xAggregateSet->setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( getStringItemList() ) );
+            m_xAggregateSet->setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( comphelper::containerToSequence(getStringItemList()) ) );
         }
         catch( const Exception& )
         {
diff --git a/forms/source/component/entrylisthelper.cxx b/forms/source/component/entrylisthelper.cxx
index b8acb07..3d419b9 100644
--- a/forms/source/component/entrylisthelper.cxx
+++ b/forms/source/component/entrylisthelper.cxx
@@ -81,13 +81,13 @@ namespace frm
 
         OSL_ENSURE( _rEvent.Source == m_xListSource,
             "OEntryListHelper::entryChanged: where did this come from?" );
-        OSL_ENSURE( ( _rEvent.Position >= 0 ) && ( _rEvent.Position < m_aStringItems.getLength() ),
+        OSL_ENSURE( ( _rEvent.Position >= 0 ) && ( _rEvent.Position < (sal_Int32)m_aStringItems.size() ),
             "OEntryListHelper::entryChanged: invalid index!" );
         OSL_ENSURE( _rEvent.Entries.getLength() == 1,
             "OEntryListHelper::entryChanged: invalid string list!" );
 
         if  (   ( _rEvent.Position >= 0 )
-            &&  ( _rEvent.Position < m_aStringItems.getLength() )
+            &&  ( _rEvent.Position < (sal_Int32)m_aStringItems.size() )
             &&  ( _rEvent.Entries.getLength() > 0 )
             )
         {
@@ -103,31 +103,15 @@ namespace frm
 
         OSL_ENSURE( _rEvent.Source == m_xListSource,
             "OEntryListHelper::entryRangeInserted: where did this come from?" );
-        OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Position < m_aStringItems.getLength() ) && ( _rEvent.Entries.getLength() > 0 ),
+        OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Position < (sal_Int32)m_aStringItems.size() ) && ( _rEvent.Entries.getLength() > 0 ),
             "OEntryListHelper::entryRangeRemoved: invalid count and/or position!" );
 
         if  (   ( _rEvent.Position > 0 )
-            &&  ( _rEvent.Position < m_aStringItems.getLength() )
+            &&  ( _rEvent.Position < (sal_Int32)m_aStringItems.size() )
             &&  ( _rEvent.Entries.getLength() > 0 )
             )
         {
-            // the entries *before* the insertion pos
-            Sequence< OUString > aKeepEntries(
-                m_aStringItems.getConstArray(),
-                _rEvent.Position
-            );
-            // the entries *behind* the insertion pos
-            Sequence< OUString > aMovedEntries(
-                m_aStringItems.getConstArray() + _rEvent.Position,
-                m_aStringItems.getLength() - _rEvent.Position
-            );
-
-            // concat all three parts
-            m_aStringItems = ::comphelper::concatSequences(
-                aKeepEntries,
-                _rEvent.Entries,
-                aMovedEntries
-            );
+            m_aStringItems.insert(m_aStringItems.begin() + _rEvent.Position, _rEvent.Entries.begin(), _rEvent.Entries.end());
 
             stringItemListChanged( aLock );
         }
@@ -140,23 +124,16 @@ namespace frm
 
         OSL_ENSURE( _rEvent.Source == m_xListSource,
             "OEntryListHelper::entryRangeRemoved: where did this come from?" );
-        OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Count > 0 ) && ( _rEvent.Position + _rEvent.Count <= m_aStringItems.getLength() ),
+        OSL_ENSURE( ( _rEvent.Position > 0 ) && ( _rEvent.Count > 0 ) && ( _rEvent.Position + _rEvent.Count <= (sal_Int32)m_aStringItems.size() ),
             "OEntryListHelper::entryRangeRemoved: invalid count and/or position!" );
 
         if  (   ( _rEvent.Position > 0 )
             &&  ( _rEvent.Count > 0 )
-            &&  ( _rEvent.Position + _rEvent.Count <= m_aStringItems.getLength() )
+            &&  ( _rEvent.Position + _rEvent.Count <= (sal_Int32)m_aStringItems.size() )
             )
         {
-            // copy all items after the removed ones
-            ::std::copy(
-                m_aStringItems.getConstArray() + _rEvent.Position + _rEvent.Count,
-                m_aStringItems.getConstArray() + m_aStringItems.getLength(),
-                m_aStringItems.getArray( ) + _rEvent.Position
-            );
-            // shrink the array
-            m_aStringItems.realloc( m_aStringItems.getLength() - _rEvent.Count );
-
+            m_aStringItems.erase(m_aStringItems.begin() + _rEvent.Position,
+                                 m_aStringItems.begin() + _rEvent.Position + _rEvent.Count );
             stringItemListChanged( aLock );
         }
     }
@@ -208,7 +185,7 @@ namespace frm
     {
         if ( hasExternalListSource() )
         {
-            m_aStringItems = m_xListSource->getAllListEntries( );
+            comphelper::sequenceToContainer(m_aStringItems, m_xListSource->getAllListEntries());
             stringItemListChanged( _rInstanceLock );
         }
         else
@@ -274,7 +251,7 @@ namespace frm
             // be notified when the list changes ...
             m_xListSource->addListEntryListener( this );
 
-            m_aStringItems = m_xListSource->getAllListEntries( );
+            comphelper::sequenceToContainer( m_aStringItems, m_xListSource->getAllListEntries() );
             stringItemListChanged( _rInstanceLock );
 
             // let derivees react on the new list source
@@ -290,14 +267,16 @@ namespace frm
             throw IllegalArgumentException( );
             // TODO: error message
 
-        return ::comphelper::tryPropertyValue( _rConvertedValue, _rOldValue, _rValue, m_aStringItems );
+        return ::comphelper::tryPropertyValue( _rConvertedValue, _rOldValue, _rValue, comphelper::containerToSequence(m_aStringItems) );
     }
 
 
     void OEntryListHelper::setNewStringItemList( const css::uno::Any& _rValue, ControlModelLock& _rInstanceLock )
     {
         OSL_PRECOND( !hasExternalListSource(), "OEntryListHelper::setNewStringItemList: this should never have survived convertNewListSourceProperty!" );
-        OSL_VERIFY( _rValue >>= m_aStringItems );
+        css::uno::Sequence<OUString> aTmp;
+        OSL_VERIFY( _rValue >>= aTmp );
+        comphelper::sequenceToContainer(m_aStringItems, aTmp);
         stringItemListChanged( _rInstanceLock );
     }
 
diff --git a/forms/source/component/entrylisthelper.hxx b/forms/source/component/entrylisthelper.hxx
index c261e4e..d2f205a 100644
--- a/forms/source/component/entrylisthelper.hxx
+++ b/forms/source/component/entrylisthelper.hxx
@@ -51,7 +51,7 @@ namespace frm
 
         css::uno::Reference< css::form::binding::XListEntrySource >
                         m_xListSource;      /// our external list source
-        css::uno::Sequence< OUString >
+        std::vector< OUString >
                         m_aStringItems;     /// "overridden" StringItemList property value
         ::comphelper::OInterfaceContainerHelper2
                         m_aRefreshListeners;
@@ -63,7 +63,7 @@ namespace frm
         virtual ~OEntryListHelper( );
 
         /// returns the current string item list
-        inline const css::uno::Sequence< OUString >&
+        inline const std::vector< OUString >&
                     getStringItemList() const { return m_aStringItems; }
 
         /// determines whether we actually have an external list source
diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx
index eb5118e..201cf13 100644
--- a/forms/source/inc/FormComponent.hxx
+++ b/forms/source/inc/FormComponent.hxx
@@ -132,11 +132,11 @@ namespace frm
         void    impl_notifyAll_nothrow();
 
     private:
-        OControlModel&                                     m_rModel;
-        bool                                               m_bLocked;
-        css::uno::Sequence< sal_Int32 >                    m_aHandles;
-        css::uno::Sequence< css::uno::Any >                m_aOldValues;
-        css::uno::Sequence< css::uno::Any >                m_aNewValues;
+        OControlModel&                              m_rModel;
+        bool                                        m_bLocked;
+        std::vector< sal_Int32 >                    m_aHandles;
+        std::vector< css::uno::Any >                m_aOldValues;
+        std::vector< css::uno::Any >                m_aNewValues;
 
     private:
         ControlModelLock( const ControlModelLock& ) = delete;
@@ -496,6 +496,12 @@ public:
     oslInterlockedCount unlockInstance( LockAccess );
 
     void                firePropertyChanges(
+                            const std::vector< sal_Int32 >& _rHandles,
+                            const std::vector< css::uno::Any >& _rOldValues,
+                            const std::vector< css::uno::Any >& _rNewValues,
+                            LockAccess
+                        );
+    void                firePropertyChanges(
                             const css::uno::Sequence< sal_Int32 >& _rHandles,
                             const css::uno::Sequence< css::uno::Any >& _rOldValues,
                             const css::uno::Sequence< css::uno::Any >& _rNewValues,


More information about the Libreoffice-commits mailing list