summaryrefslogtreecommitdiff
path: root/embeddedobj/source/msole
diff options
context:
space:
mode:
Diffstat (limited to 'embeddedobj/source/msole')
-rw-r--r--embeddedobj/source/msole/olecomponent.cxx16
-rw-r--r--embeddedobj/source/msole/oleembed.cxx10
-rw-r--r--embeddedobj/source/msole/olepersist.cxx32
-rw-r--r--embeddedobj/source/msole/ownview.cxx12
-rw-r--r--embeddedobj/source/msole/xolefactory.cxx6
5 files changed, 38 insertions, 38 deletions
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index 0a532befb6e2..7e8cfdb1809e 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -358,9 +358,9 @@ bool OleComponentNative_Impl::ConvertDataForFlavor( const STGMEDIUM& aMedium,
if ( pBuf && !bAnyIsReady )
{
- for ( sal_Int32 nInd = 0; nInd < m_aSupportedGraphFormats.getLength(); nInd++ )
- if ( aFlavor.MimeType.match( m_aSupportedGraphFormats[nInd].MimeType )
- && aFlavor.DataType == m_aSupportedGraphFormats[nInd].DataType
+ for ( auto const & supportedFormat : std::as_const(m_aSupportedGraphFormats) )
+ if ( aFlavor.MimeType.match( supportedFormat.MimeType )
+ && aFlavor.DataType == supportedFormat.DataType
&& aFlavor.DataType == cppu::UnoType<uno::Sequence< sal_Int8 >>::get() )
{
bAnyIsReady = ConvertBufferToFormat( pBuf.get(), nBufSize, aFormat, aResult );
@@ -376,9 +376,9 @@ bool OleComponentNative_Impl::ConvertDataForFlavor( const STGMEDIUM& aMedium,
bool OleComponentNative_Impl::GraphicalFlavor( const datatransfer::DataFlavor& aFlavor )
{
// Actually all the required graphical formats must be supported
- for ( sal_Int32 nInd = 0; nInd < m_aSupportedGraphFormats.getLength(); nInd++ )
- if ( aFlavor.MimeType.match( m_aSupportedGraphFormats[nInd].MimeType )
- && aFlavor.DataType == m_aSupportedGraphFormats[nInd].DataType )
+ for ( auto const & supportedFormat : std::as_const(m_aSupportedGraphFormats) )
+ if ( aFlavor.MimeType.match( supportedFormat.MimeType )
+ && aFlavor.DataType == supportedFormat.DataType )
return true;
return false;
@@ -1628,8 +1628,8 @@ sal_Bool SAL_CALL OleComponent::isDataFlavorSupported( const datatransfer::DataF
RetrieveObjectDataFlavors_Impl();
}
- for ( sal_Int32 nInd = 0; nInd < m_aDataFlavors.getLength(); nInd++ )
- if ( m_aDataFlavors[nInd].MimeType.equals( aFlavor.MimeType ) && m_aDataFlavors[nInd].DataType == aFlavor.DataType )
+ for ( auto const & supportedFormat : std::as_const(m_aDataFlavors) )
+ if ( supportedFormat.MimeType.equals( aFlavor.MimeType ) && supportedFormat.DataType == aFlavor.DataType )
return true;
return false;
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index faf23cf585c9..5997fba7ca22 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -91,8 +91,8 @@ uno::Sequence< sal_Int32 > OleEmbeddedObject::GetReachableStatesList_Impl(
uno::Sequence< sal_Int32 > aStates(2);
aStates[0] = embed::EmbedStates::LOADED;
aStates[1] = embed::EmbedStates::RUNNING;
- for ( sal_Int32 nInd = 0; nInd < aVerbList.getLength(); nInd++ )
- if ( aVerbList[nInd].VerbID == embed::EmbedVerbs::MS_OLEVERB_OPEN )
+ for ( embed::VerbDescriptor const & vd : aVerbList )
+ if ( vd.VerbID == embed::EmbedVerbs::MS_OLEVERB_OPEN )
{
aStates.realloc(3);
aStates[2] = embed::EmbedStates::ACTIVE;
@@ -275,9 +275,9 @@ bool OleEmbeddedObject::TryToConvertToOOo( const uno::Reference< io::XStream >&
uno::Sequence< beans::PropertyValue > aFilterData;
if ( aFilterAnyData >>= aFilterData )
{
- for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ )
- if ( aFilterData[nInd].Name == "DocumentService" )
- aFilterData[nInd].Value >>= aDocServiceName;
+ for ( beans::PropertyValue const & prop : std::as_const(aFilterData) )
+ if ( prop.Name == "DocumentService" )
+ prop.Value >>= aDocServiceName;
}
if ( !aDocServiceName.isEmpty() )
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 36a6a84b4614..c4c8760b549b 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -1058,14 +1058,14 @@ void OleEmbeddedObject::StoreToLocation_Impl(
bool bTryOptimization = false;
bool bStoreVis = m_bStoreVisRepl;
uno::Reference< io::XStream > xCachedVisualRepresentation;
- for ( sal_Int32 nInd = 0; nInd < lObjArgs.getLength(); nInd++ )
+ for ( beans::PropertyValue const & prop : lObjArgs )
{
- if ( lObjArgs[nInd].Name == "StoreVisualReplacement" )
- lObjArgs[nInd].Value >>= bStoreVis;
- else if ( lObjArgs[nInd].Name == "VisualReplacement" )
- lObjArgs[nInd].Value >>= xCachedVisualRepresentation;
- else if ( lObjArgs[nInd].Name == "CanTryOptimization" )
- lObjArgs[nInd].Value >>= bTryOptimization;
+ if ( prop.Name == "StoreVisualReplacement" )
+ prop.Value >>= bStoreVis;
+ else if ( prop.Name == "VisualReplacement" )
+ prop.Value >>= xCachedVisualRepresentation;
+ else if ( prop.Name == "CanTryOptimization" )
+ prop.Value >>= bTryOptimization;
}
// ignore visual representation provided from outside if it should not be stored
@@ -1310,9 +1310,9 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
bool bElExists = xNameAccess->hasByName( sEntName );
m_bReadOnly = false;
- for ( sal_Int32 nInd = 0; nInd < lArguments.getLength(); nInd++ )
- if ( lArguments[nInd].Name == "ReadOnly" )
- lArguments[nInd].Value >>= m_bReadOnly;
+ for ( beans::PropertyValue const & prop : lArguments )
+ if ( prop.Name == "ReadOnly" )
+ prop.Value >>= m_bReadOnly;
#ifdef _WIN32
sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE;
@@ -1320,9 +1320,9 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
SwitchOwnPersistence( xStorage, sEntName );
- for ( sal_Int32 nInd = 0; nInd < lObjArgs.getLength(); nInd++ )
- if ( lObjArgs[nInd].Name == "StoreVisualReplacement" )
- lObjArgs[nInd].Value >>= m_bStoreVisRepl;
+ for ( beans::PropertyValue const & prop : lObjArgs )
+ if ( prop.Name == "StoreVisualReplacement" )
+ prop.Value >>= m_bStoreVisRepl;
#ifdef _WIN32
if ( nEntryConnectionMode == embed::EntryInitModes::DEFAULT_INIT )
@@ -1388,9 +1388,9 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
{
// use URL ( may be content or stream later ) from MediaDescriptor to initialize object
OUString aURL;
- for ( sal_Int32 nInd = 0; nInd < lArguments.getLength(); nInd++ )
- if ( lArguments[nInd].Name == "URL" )
- lArguments[nInd].Value >>= aURL;
+ for ( beans::PropertyValue const & prop : lArguments )
+ if ( prop.Name == "URL" )
+ prop.Value >>= aURL;
if ( aURL.isEmpty() )
throw lang::IllegalArgumentException(
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index 9750798c6388..474439194dee 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -212,9 +212,9 @@ OUString OwnView_Impl::GetFilterNameFromExtentionAndInStream(
aTypeName = xTypeDetection->queryTypeByDescriptor( aArgs, true );
OUString aFilterName;
- for ( sal_Int32 nInd = 0; nInd < aArgs.getLength(); nInd++ )
- if ( aArgs[nInd].Name == "FilterName" )
- aArgs[nInd].Value >>= aFilterName;
+ for ( beans::PropertyValue const & prop : std::as_const(aArgs) )
+ if ( prop.Name == "FilterName" )
+ prop.Value >>= aFilterName;
if ( aFilterName.isEmpty() && !aTypeName.isEmpty() )
{
@@ -224,11 +224,11 @@ OUString OwnView_Impl::GetFilterNameFromExtentionAndInStream(
if ( xNameAccess.is() && ( xNameAccess->getByName( aTypeName ) >>= aTypes ) )
{
- for ( sal_Int32 nInd = 0; nInd < aTypes.getLength(); nInd++ )
+ for ( beans::PropertyValue const & prop : std::as_const(aTypes) )
{
- if ( aTypes[nInd].Name == "PreferredFilter" && ( aTypes[nInd].Value >>= aFilterName ) )
+ if ( prop.Name == "PreferredFilter" && ( prop.Value >>= aFilterName ) )
{
- aTypes[nInd].Value >>= aFilterName;
+ prop.Value >>= aFilterName;
break;
}
}
diff --git a/embeddedobj/source/msole/xolefactory.cxx b/embeddedobj/source/msole/xolefactory.cxx
index 341afdd3e003..f162af865c05 100644
--- a/embeddedobj/source/msole/xolefactory.cxx
+++ b/embeddedobj/source/msole/xolefactory.cxx
@@ -95,15 +95,15 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta
aMedDescr,
lObjArgs );
- for ( sal_Int32 nInd = 0; nInd < lObjArgs.getLength(); nInd++ )
+ for ( beans::PropertyValue const & prop : lObjArgs )
{
- if ( lObjArgs[nInd].Name == "CloneFrom" )
+ if ( prop.Name == "CloneFrom" )
{
try
{
uno::Reference < embed::XEmbeddedObject > xObj;
uno::Reference < embed::XEmbeddedObject > xNew( xResult, uno::UNO_QUERY );
- lObjArgs[nInd].Value >>= xObj;
+ prop.Value >>= xObj;
if ( xObj.is() )
xNew->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, xObj->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ) );
}