summaryrefslogtreecommitdiff
path: root/embedserv
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-20 08:43:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-20 12:11:11 +0200
commit1553d3787cbe0cdababf31382bf3376a3640d8cf (patch)
treeb829cc1f97dac33abdf1e592a636d6fb24497f13 /embedserv
parentc2ead5a142be19cb74127294641ec35da9e0f5c5 (diff)
use for-range on Sequence in d*
and fix bug in GenericClipboard::initialize, where it was looping through the arguments, but always reading the first one. I'm guessing it was never an issue because it is always called with only one argument Change-Id: I8f72b6bce8c77a69c7d75115e34630e2c308261e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94553 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embedserv')
-rw-r--r--embedserv/source/embed/docholder.cxx32
1 files changed, 15 insertions, 17 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 72327def556d..a4b5462199d9 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -161,11 +161,11 @@ void DocumentHolder::LoadDocInFrame( bool bPluginMode )
0,
aSeq);
- uno::Sequence< beans::PropertyValue > aResArgs = m_xDocument->getArgs();
- for ( int nInd = 0; nInd < aResArgs.getLength(); nInd++ )
- if ( aResArgs[nInd].Name == "MacroExecutionMode" )
+ const uno::Sequence< beans::PropertyValue > aResArgs = m_xDocument->getArgs();
+ for ( beans::PropertyValue const & prop : aResArgs )
+ if ( prop.Name == "MacroExecutionMode" )
{
- aResArgs[nInd].Value >>= m_nMacroExecMode;
+ prop.Value >>= m_nMacroExecMode;
break;
}
}
@@ -918,13 +918,12 @@ void DocumentHolder::setTitle(const OUString& aDocumentName)
uno::Sequence<beans::PropertyValue> aSeq;
if(m_xDocument.is())
{
- aSeq =
- m_xDocument->getArgs();
- for(sal_Int32 j = 0; j < aSeq.getLength(); ++j)
+ aSeq = m_xDocument->getArgs();
+ for(beans::PropertyValue const & prop : std::as_const(aSeq))
{
- if(aSeq[j].Name == "FilterName")
+ if(prop.Name == "FilterName")
{
- aSeq[j].Value >>= aFilterName;
+ prop.Value >>= aFilterName;
break;
}
}
@@ -939,11 +938,10 @@ void DocumentHolder::setTitle(const OUString& aDocumentName)
if(xNameAccess.is() &&
(xNameAccess->getByName(aFilterName) >>= aSeq))
{
- for(sal_Int32 j = 0; j < aSeq.getLength(); ++j)
- if(aSeq[j].Name ==
- "UIName")
+ for(beans::PropertyValue const & prop : std::as_const(aSeq))
+ if(prop.Name == "UIName")
{
- aSeq[j].Value >>= m_aFilterName;
+ prop.Value >>= m_aFilterName;
break;
}
}
@@ -1045,12 +1043,12 @@ HRESULT DocumentHolder::GetDocumentBorder( RECT *pRect )
{
if ( pRect && m_xDocument.is() )
{
- uno::Sequence< beans::PropertyValue > aArgs = m_xDocument->getArgs();
- for ( sal_Int32 nInd = 0; nInd < aArgs.getLength(); nInd++ )
- if ( aArgs[nInd].Name == "DocumentBorder" )
+ const uno::Sequence< beans::PropertyValue > aArgs = m_xDocument->getArgs();
+ for ( beans::PropertyValue const & prop : aArgs )
+ if ( prop.Name == "DocumentBorder" )
{
uno::Sequence< sal_Int32 > aRect;
- if ( ( aArgs[nInd].Value >>= aRect ) && aRect.getLength() == 4 )
+ if ( ( prop.Value >>= aRect ) && aRect.getLength() == 4 )
{
pRect->left = aRect[0];
pRect->top = aRect[1];