summaryrefslogtreecommitdiff
path: root/framework/source/uiconfiguration
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-02-16 19:58:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-01 07:33:45 +0000
commit3f7f497192deb486b1b959996c14f8f094146945 (patch)
treeb830caec984a7ac9fb71ce92663f35c3f5f221a1 /framework/source/uiconfiguration
parentdba6451b2f25b3d8510e0a848977166ee5e6c8e3 (diff)
sequence->vector in framework
Change-Id: I457c3da4f4a31f58d688dcd96a2ccfc36518490d Reviewed-on: https://gerrit.libreoffice.org/23692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx6
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx7
-rw-r--r--framework/source/uiconfiguration/windowstateconfiguration.cxx55
3 files changed, 34 insertions, 34 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 15b26bae1bfb..60246784be71 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -1104,7 +1104,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
if ( m_bDisposed )
throw DisposedException();
- Sequence< Sequence< PropertyValue > > aElementInfoSeq;
+ std::vector< Sequence< PropertyValue > > aElementInfoSeq;
UIElementInfoHashMap aUIElementInfoCollection;
if ( ElementType == css::ui::UIElementType::UNKNOWN )
@@ -1119,7 +1119,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
aUIElementInfo[0].Name = m_aPropResourceURL;
aUIElementInfo[1].Name = m_aPropUIName;
- aElementInfoSeq.realloc( aUIElementInfoCollection.size() );
+ aElementInfoSeq.resize( aUIElementInfoCollection.size() );
UIElementInfoHashMap::const_iterator pIter = aUIElementInfoCollection.begin();
sal_Int32 n = 0;
@@ -1131,7 +1131,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
++pIter;
}
- return aElementInfoSeq;
+ return comphelper::containerToSequence(aElementInfoSeq);
}
Reference< XIndexContainer > SAL_CALL ModuleUIConfigurationManager::createSettings() throw (css::uno::RuntimeException, std::exception)
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 1bcb6ce67449..80e66c3e93f2 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -42,6 +42,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
#include <vcl/svapp.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
@@ -864,7 +865,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
if ( m_bDisposed )
throw DisposedException();
- Sequence< Sequence< PropertyValue > > aElementInfoSeq;
+ std::vector< Sequence< PropertyValue > > aElementInfoSeq;
UIElementInfoHashMap aUIElementInfoCollection;
if ( ElementType == css::ui::UIElementType::UNKNOWN )
@@ -879,7 +880,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
aUIElementInfo[0].Name = m_aPropResourceURL;
aUIElementInfo[1].Name = m_aPropUIName;
- aElementInfoSeq.realloc( aUIElementInfoCollection.size() );
+ aElementInfoSeq.resize( aUIElementInfoCollection.size() );
UIElementInfoHashMap::const_iterator pIter = aUIElementInfoCollection.begin();
sal_Int32 n = 0;
@@ -891,7 +892,7 @@ throw ( IllegalArgumentException, RuntimeException, std::exception )
++pIter;
}
- return aElementInfoSeq;
+ return comphelper::containerToSequence(aElementInfoSeq);
}
Reference< XIndexContainer > SAL_CALL UIConfigurationManager::createSettings() throw (css::uno::RuntimeException, std::exception)
diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index 1fff2d393937..06560ba1fe9a 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -546,58 +546,58 @@ Any ConfigurationAccess_WindowState::impl_getSequenceFromStruct( const WindowSta
{
sal_Int32 i( 0 );
sal_Int32 nCount( m_aPropArray.size() );
- Sequence< PropertyValue > aPropSeq;
+ std::vector< PropertyValue > aPropVec;
for ( i = 0; i < nCount; i++ )
{
if ( rWinStateInfo.nMask & ( 1 << i ))
{
// put value into the return sequence
- sal_Int32 nIndex( aPropSeq.getLength());
- aPropSeq.realloc( nIndex+1 );
- aPropSeq[nIndex].Name = m_aPropArray[i];
+ PropertyValue pv;
+ pv.Name = m_aPropArray[i];
switch ( i )
{
case PROPERTY_LOCKED:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bLocked ); break;
+ pv.Value = makeAny( rWinStateInfo.bLocked ); break;
case PROPERTY_DOCKED:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bDocked ); break;
+ pv.Value = makeAny( rWinStateInfo.bDocked ); break;
case PROPERTY_VISIBLE:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bVisible ); break;
+ pv.Value = makeAny( rWinStateInfo.bVisible ); break;
case PROPERTY_CONTEXT:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bContext ); break;
+ pv.Value = makeAny( rWinStateInfo.bContext ); break;
case PROPERTY_HIDEFROMMENU:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bHideFromMenu ); break;
+ pv.Value = makeAny( rWinStateInfo.bHideFromMenu ); break;
case PROPERTY_NOCLOSE:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bNoClose ); break;
+ pv.Value = makeAny( rWinStateInfo.bNoClose ); break;
case PROPERTY_SOFTCLOSE:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bSoftClose ); break;
+ pv.Value = makeAny( rWinStateInfo.bSoftClose ); break;
case PROPERTY_CONTEXTACTIVE:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.bContextActive ); break;
+ pv.Value = makeAny( rWinStateInfo.bContextActive ); break;
case PROPERTY_DOCKINGAREA:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aDockingArea ); break;
+ pv.Value = makeAny( rWinStateInfo.aDockingArea ); break;
case PROPERTY_POS:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aPos ); break;
+ pv.Value = makeAny( rWinStateInfo.aPos ); break;
case PROPERTY_SIZE:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aSize ); break;
+ pv.Value = makeAny( rWinStateInfo.aSize ); break;
case PROPERTY_UINAME:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aUIName ); break;
+ pv.Value = makeAny( rWinStateInfo.aUIName ); break;
case PROPERTY_INTERNALSTATE:
- aPropSeq[nIndex].Value = makeAny( sal_Int32( rWinStateInfo.nInternalState )); break;
+ pv.Value = makeAny( sal_Int32( rWinStateInfo.nInternalState )); break;
case PROPERTY_STYLE:
- aPropSeq[nIndex].Value = makeAny( sal_Int16( rWinStateInfo.nStyle )); break;
+ pv.Value = makeAny( sal_Int16( rWinStateInfo.nStyle )); break;
case PROPERTY_DOCKPOS:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aDockPos ); break;
+ pv.Value = makeAny( rWinStateInfo.aDockPos ); break;
case PROPERTY_DOCKSIZE:
- aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aDockSize ); break;
+ pv.Value = makeAny( rWinStateInfo.aDockSize ); break;
default:
assert( false && "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
}
+ aPropVec.push_back(pv);
}
}
- return makeAny( aPropSeq );
+ return makeAny( comphelper::containerToSequence(aPropVec) );
}
Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const OUString& rResourceURL, Reference< XNameAccess >& xNameAccess )
@@ -605,8 +605,7 @@ Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const OU
sal_Int32 nMask( 0 );
sal_Int32 nCount( m_aPropArray.size() );
sal_Int32 i( 0 );
- sal_Int32 nIndex( 0 );
- Sequence< PropertyValue > aPropSeq;
+ std::vector< PropertyValue > aPropVec;
WindowStateInfo aWindowStateInfo;
for ( i = 0; i < nCount; i++ )
@@ -778,10 +777,10 @@ Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const OU
if ( bAddToSeq )
{
// put value into the return sequence
- nIndex = aPropSeq.getLength();
- aPropSeq.realloc( nIndex+1 );
- aPropSeq[nIndex].Name = m_aPropArray[i];
- aPropSeq[nIndex].Value = a;
+ PropertyValue pv;
+ pv.Name = m_aPropArray[i];
+ pv.Value = a;
+ aPropVec.push_back(pv);
}
}
catch( const css::container::NoSuchElementException& )
@@ -794,7 +793,7 @@ Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const OU
aWindowStateInfo.nMask = nMask;
m_aResourceURLToInfoCache.insert( ResourceURLToInfoCache::value_type( rResourceURL, aWindowStateInfo ));
- return makeAny( aPropSeq );
+ return makeAny( comphelper::containerToSequence(aPropVec) );
}
ConfigurationAccess_WindowState::WindowStateInfo& ConfigurationAccess_WindowState::impl_insertCacheAndReturnWinState( const OUString& rResourceURL, Reference< XNameAccess >& rNameAccess )