summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/colorpicker.cxx10
-rw-r--r--cui/source/dialogs/cuicharmap.cxx24
-rw-r--r--cui/source/dialogs/hldocntp.cxx12
-rw-r--r--cui/source/dialogs/insdlg.cxx12
-rw-r--r--cui/source/dialogs/scriptdlg.cxx38
5 files changed, 47 insertions, 49 deletions
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index fbba1abd1e90..65f03fb3a046 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -1302,15 +1302,15 @@ Sequence< PropertyValue > SAL_CALL ColorPicker::getPropertyValues( )
void SAL_CALL ColorPicker::setPropertyValues( const Sequence< PropertyValue >& aProps )
{
- for( sal_Int32 n = 0; n < aProps.getLength(); n++ )
+ for ( const PropertyValue& rProp : aProps )
{
- if( aProps[n].Name == gsColorKey )
+ if( rProp.Name == gsColorKey )
{
- aProps[n].Value >>= mnColor;
+ rProp.Value >>= mnColor;
}
- else if( aProps[n].Name == gsModeKey )
+ else if( rProp.Name == gsModeKey )
{
- aProps[n].Value >>= mnMode;
+ rProp.Value >>= mnMode;
}
}
}
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 22450f6722e6..3f3651bce366 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -222,17 +222,17 @@ void SvxCharacterMap::DisableFontSelection()
void SvxCharacterMap::getRecentCharacterList()
{
//retrieve recent character list
- css::uno::Sequence< OUString > rRecentCharList( officecfg::Office::Common::RecentCharacters::RecentCharacterList::get() );
- for (int i = 0; i < rRecentCharList.getLength(); ++i)
+ const css::uno::Sequence< OUString > rRecentCharList( officecfg::Office::Common::RecentCharacters::RecentCharacterList::get() );
+ for (OUString const & s : rRecentCharList)
{
- maRecentCharList.push_back(rRecentCharList[i]);
+ maRecentCharList.push_back(s);
}
//retrieve recent character font list
- css::uno::Sequence< OUString > rRecentCharFontList( officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::get() );
- for (int i = 0; i < rRecentCharFontList.getLength(); ++i)
+ const css::uno::Sequence< OUString > rRecentCharFontList( officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::get() );
+ for (OUString const & s : rRecentCharFontList)
{
- maRecentCharFontList.push_back(rRecentCharFontList[i]);
+ maRecentCharFontList.push_back(s);
}
}
@@ -242,17 +242,17 @@ void SvxCharacterMap::getFavCharacterList()
maFavCharList.clear();
maFavCharFontList.clear();
//retrieve recent character list
- css::uno::Sequence< OUString > rFavCharList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::get() );
- for (int i = 0; i < rFavCharList.getLength(); ++i)
+ const css::uno::Sequence< OUString > rFavCharList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::get() );
+ for (const OUString& s : rFavCharList)
{
- maFavCharList.push_back(rFavCharList[i]);
+ maFavCharList.push_back(s);
}
//retrieve recent character font list
- css::uno::Sequence< OUString > rFavCharFontList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::get() );
- for (int i = 0; i < rFavCharFontList.getLength(); ++i)
+ const css::uno::Sequence< OUString > rFavCharFontList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::get() );
+ for (const OUString& s : rFavCharFontList)
{
- maFavCharFontList.push_back(rFavCharFontList[i]);
+ maFavCharFontList.push_back(s);
}
}
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index fa4529735185..50d7131ad8fa 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -163,16 +163,16 @@ void SvxHyperlinkNewDocTp::FillDocumentList()
sal_uInt32 i, nCount = aDynamicMenuEntries.getLength();
for ( i = 0; i < nCount; i++ )
{
- uno::Sequence< beans::PropertyValue >& rDynamicMenuEntry = aDynamicMenuEntries[ i ];
+ const uno::Sequence< beans::PropertyValue >& rDynamicMenuEntry = aDynamicMenuEntries[ i ];
OUString aDocumentUrl, aTitle;
- for ( int e = 0; e < rDynamicMenuEntry.getLength(); e++ )
+ for ( const beans::PropertyValue& e : rDynamicMenuEntry )
{
- if ( rDynamicMenuEntry[ e ].Name == DYNAMICMENU_PROPERTYNAME_URL )
- rDynamicMenuEntry[ e ].Value >>= aDocumentUrl;
- else if ( rDynamicMenuEntry[e].Name == DYNAMICMENU_PROPERTYNAME_TITLE )
- rDynamicMenuEntry[e].Value >>= aTitle;
+ if ( e.Name == DYNAMICMENU_PROPERTYNAME_URL )
+ e.Value >>= aDocumentUrl;
+ else if ( e.Name == DYNAMICMENU_PROPERTYNAME_TITLE )
+ e.Value >>= aTitle;
}
//#i96822# business cards, labels and database should not be inserted here
if( aDocumentUrl == "private:factory/swriter?slot=21051" ||
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 1df80452d056..4f34b461eba5 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -185,22 +185,22 @@ short SvInsertOleDlg::run()
if ( xDialogCreator.is() )
{
aName = aCnt.CreateUniqueObjectName();
- embed::InsertedObjectInfo aNewInf = xDialogCreator->createInstanceByDialog(
+ const embed::InsertedObjectInfo aNewInf = xDialogCreator->createInstanceByDialog(
m_xStorage,
aName,
uno::Sequence < beans::PropertyValue >() );
OSL_ENSURE( aNewInf.Object.is(), "The object must be created or an exception must be thrown!" );
m_xObj = aNewInf.Object;
- for ( sal_Int32 nInd = 0; nInd < aNewInf.Options.getLength(); nInd++ )
- if ( aNewInf.Options[nInd].Name == "Icon" )
+ for ( const auto& opt : aNewInf.Options )
+ if ( opt.Name == "Icon" )
{
- aNewInf.Options[nInd].Value >>= m_aIconMetaFile;
+ opt.Value >>= m_aIconMetaFile;
}
- else if ( aNewInf.Options[nInd].Name == "IconFormat" )
+ else if ( opt.Name == "IconFormat" )
{
datatransfer::DataFlavor aFlavor;
- if ( aNewInf.Options[nInd].Value >>= aFlavor )
+ if ( opt.Value >>= aFlavor )
m_aIconMediaType = aFlavor.MimeType;
}
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 1716316fb32f..7f32f6343b7c 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -153,10 +153,10 @@ void SvxScriptOrgDialog::Init( const OUString& language )
}
Reference<XModel> xDocumentModel;
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
+ for ( const Reference< browse::XBrowseNode >& childNode : std::as_const(children) )
{
bool app = false;
- OUString uiName = children[ n ]->getName();
+ OUString uiName = childNode->getName();
OUString factoryURL;
if ( uiName == userStr || uiName == shareStr )
{
@@ -186,13 +186,11 @@ void SvxScriptOrgDialog::Init( const OUString& language )
} catch(const uno::Exception&)
{}
- beans::PropertyValue const * pmoduleDescr =
- moduleDescr.getConstArray();
- for ( sal_Int32 pos = moduleDescr.getLength(); pos--; )
+ for ( const beans::PropertyValue& prop : std::as_const(moduleDescr))
{
- if ( pmoduleDescr[ pos ].Name == "ooSetupFactoryEmptyDocumentURL" )
+ if ( prop.Name == "ooSetupFactoryEmptyDocumentURL" )
{
- pmoduleDescr[ pos ].Value >>= factoryURL;
+ prop.Value >>= factoryURL;
break;
}
}
@@ -200,7 +198,7 @@ void SvxScriptOrgDialog::Init( const OUString& language )
}
Reference< browse::XBrowseNode > langEntries =
- getLangNodeFromRootNode( children[ n ], language );
+ getLangNodeFromRootNode( childNode, language );
insertEntry( uiName, app ? OUStringLiteral(RID_CUIBMP_HARDDISK) : OUStringLiteral(RID_CUIBMP_DOC),
nullptr, true, std::make_unique< SFEntry >( langEntries, xDocumentModel ), factoryURL, false );
@@ -288,16 +286,16 @@ void SvxScriptOrgDialog::RequestSubEntries(const weld::TreeIter& rRootEntry, Ref
// if we catch an exception in getChildNodes then no entries are added
}
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
+ for ( const Reference< browse::XBrowseNode >& childNode : std::as_const(children) )
{
- OUString name( children[ n ]->getName() );
- if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT)
+ OUString name( childNode->getName() );
+ if ( childNode->getType() != browse::BrowseNodeTypes::SCRIPT)
{
- insertEntry(name, RID_CUIBMP_LIB, &rRootEntry, true, std::make_unique<SFEntry>(children[n], model), false);
+ insertEntry(name, RID_CUIBMP_LIB, &rRootEntry, true, std::make_unique<SFEntry>(childNode, model), false);
}
else
{
- insertEntry(name, RID_CUIBMP_MACRO, &rRootEntry, false, std::make_unique<SFEntry>(children[n], model), false);
+ insertEntry(name, RID_CUIBMP_MACRO, &rRootEntry, false, std::make_unique<SFEntry>(childNode, model), false);
}
}
}
@@ -761,9 +759,9 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry)
if(extnPos>0)
extn = nodeName.copy(extnPos);
}
- for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
+ for( const Reference< browse::XBrowseNode >& n : std::as_const(childNodes) )
{
- if (aNewName+extn == childNodes[index]->getName())
+ if (aNewName+extn == n->getName())
{
bFound = true;
break;
@@ -788,9 +786,9 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry)
{
OUString aUserSuppliedName = aNewDlg.GetObjectName();
bValid = true;
- for( sal_Int32 index = 0; index < childNodes.getLength(); index++ )
+ for( const Reference< browse::XBrowseNode >& n : std::as_const(childNodes) )
{
- if (aUserSuppliedName+extn == childNodes[index]->getName())
+ if (aUserSuppliedName+extn == n->getName())
{
bValid = false;
OUString aError = m_createErrStr + m_createDupStr;
@@ -1009,11 +1007,11 @@ OUString SvxScriptOrgDialog::getListOfChildren( const Reference< browse::XBrowse
{
if ( node->hasChildNodes() )
{
- Sequence< Reference< browse::XBrowseNode > > children
+ const Sequence< Reference< browse::XBrowseNode > > children
= node->getChildNodes();
- for ( sal_Int32 n = 0; n < children.getLength(); n++ )
+ for( const Reference< browse::XBrowseNode >& n : children )
{
- result.append( getListOfChildren( children[ n ] , depth+1 ) );
+ result.append( getListOfChildren( n , depth+1 ) );
}
}
}