diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 15:55:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 20:23:59 +0200 |
commit | 7841194ed70385627b9f8f88315fb1d0b5b8147c (patch) | |
tree | 9649156e3d7907c112a2bbd3e776fd6f502d3831 /vcl | |
parent | 2dfb192edfd1ab10e9d39e265e26ac6db93ac755 (diff) |
loplugin:sequenceloop in unoxml..vcl
Change-Id: Ic3c48ec4d86252b62d3dd25bbc198f7d7fb75e90
Reviewed-on: https://gerrit.libreoffice.org/77533
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5FilePicker.cxx | 2 | ||||
-rw-r--r-- | vcl/qt5/Qt5Transferable.cxx | 2 | ||||
-rw-r--r-- | vcl/source/bitmap/BitmapTools.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/FilterConfigCache.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/configsettings.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 2 | ||||
-rw-r--r-- | vcl/source/graphic/GraphicObject.cxx | 3 | ||||
-rw-r--r-- | vcl/source/graphic/UnoGraphicProvider.cxx | 4 | ||||
-rw-r--r-- | vcl/source/uitest/uno/uiobject_uno.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/config.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/a11y/atktextattributes.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk/salprn-gtk.cxx | 4 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 2 |
16 files changed, 22 insertions, 21 deletions
diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx index f499c2db53dd..602ee21569ee 100644 --- a/vcl/qt5/Qt5FilePicker.cxx +++ b/vcl/qt5/Qt5FilePicker.cxx @@ -415,7 +415,7 @@ void Qt5FilePicker::handleSetListValue(QComboBox* pWidget, sal_Int16 nControlAct { Sequence<OUString> aStringList; rValue >>= aStringList; - for (auto const& sItem : aStringList) + for (auto const& sItem : std::as_const(aStringList)) pWidget->addItem(toQString(sItem)); break; } diff --git a/vcl/qt5/Qt5Transferable.cxx b/vcl/qt5/Qt5Transferable.cxx index 10a139093041..e3c5bfa42a1a 100644 --- a/vcl/qt5/Qt5Transferable.cxx +++ b/vcl/qt5/Qt5Transferable.cxx @@ -249,7 +249,7 @@ QStringList Qt5MimeData::formats() const if (!m_aMimeTypeList.isEmpty()) return m_aMimeTypeList; - css::uno::Sequence<css::datatransfer::DataFlavor> aFormats + const css::uno::Sequence<css::datatransfer::DataFlavor> aFormats = m_aContents->getTransferDataFlavors(); QStringList aList; bool bHaveUTF16 = false; diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index 4fbecf3fc47e..24f202e3e636 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -71,7 +71,7 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, uno::Sequence<sal_Int8> aData(aBuffer.data(), nSize + 1); uno::Reference<io::XInputStream> aInputStream(new comphelper::SequenceInputStream(aData)); - Primitive2DSequence aPrimitiveSequence = xSvgParser->getDecomposition(aInputStream, sPath); + const Primitive2DSequence aPrimitiveSequence = xSvgParser->getDecomposition(aInputStream, sPath); if (!aPrimitiveSequence.hasElements()) return; diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index e2cf35d510c7..0ed0a431e235 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -158,7 +158,7 @@ void FilterConfigCache::ImplInit() if ( xTypeAccess.is() && xFilterAccess.is() ) { - Sequence< OUString > lAllFilter = xFilterAccess->getElementNames(); + const Sequence< OUString > lAllFilter = xFilterAccess->getElementNames(); for ( const OUString& sInternalFilterName : lAllFilter ) { diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index cb9b5768f047..901c9407e36f 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1440,7 +1440,7 @@ void GraphicFilter::preload() ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream, sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags, - css::uno::Sequence< css::beans::PropertyValue >* pFilterData, + const css::uno::Sequence< css::beans::PropertyValue >* pFilterData, WmfExternal const *pExtHeader ) { OUString aFilterName; @@ -2077,7 +2077,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r css::uno::Sequence< css::beans::PropertyValue > aAdditionalChunkSequence; if ( rPropVal.Value >>= aAdditionalChunkSequence ) { - for ( const auto& rAdditionalChunk : aAdditionalChunkSequence ) + for ( const auto& rAdditionalChunk : std::as_const(aAdditionalChunkSequence) ) { if ( rAdditionalChunk.Name.getLength() == 4 ) { diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx index f04ddd0ffa37..f8b9edb7c50c 100644 --- a/vcl/source/gdi/configsettings.cxx +++ b/vcl/source/gdi/configsettings.cxx @@ -86,7 +86,7 @@ void SettingsConfigItem::getValues() { m_aSettings.clear(); - Sequence< OUString > aNames( GetNodeNames( OUString() ) ); + const Sequence< OUString > aNames( GetNodeNames( OUString() ) ); for( const auto& aKeyName : aNames ) { diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index eefe65573270..b3c3f9ead130 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1516,7 +1516,7 @@ void PrinterController::setUIOptions( const css::uno::Sequence< css::beans::Prop OUString aPropName; vcl::ImplPrinterControllerData::ControlDependency aDep; css::uno::Sequence< sal_Bool > aChoicesDisabled; - for( const css::beans::PropertyValue& rEntry : aOptProp ) + for( const css::beans::PropertyValue& rEntry : std::as_const(aOptProp) ) { if ( rEntry.Name == "Property" ) { diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index 49334eb51837..7f6a343b0050 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -83,7 +83,8 @@ void SearchForGraphics(uno::Reference<uno::XInterface> const & xInterface, Reference<XNameContainer> xContainer(xInterface, UNO_QUERY); if (xContainer.is()) { - for (OUString const & rName : xContainer->getElementNames()) + const css::uno::Sequence<OUString> aElementNames = xContainer->getElementNames(); + for (OUString const & rName : aElementNames) { uno::Reference<XInterface> xInnerInterface; xContainer->getByName(rName) >>= xInnerInterface; diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index 2ab3b2f38b99..c5919770402c 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -341,7 +341,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co sal_uInt16 nExtWidth = 0; sal_uInt16 nExtHeight = 0; sal_uInt16 nExtMapMode = 0; - for( const auto& rProp : aFilterData ) + for( const auto& rProp : std::as_const(aFilterData) ) { const OUString aName( rProp.Name ); const uno::Any aValue( rProp.Value ); @@ -562,7 +562,7 @@ void ImplApplyBitmapResolution( ::Graphic& rGraphic, sal_Int32 nImageResolution, ImplApplyBitmapScaling( rGraphic, nDestPixelWidth, nDestPixelHeight ); } -void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyValue >& rFilterData ) +void ImplApplyFilterData( ::Graphic& rGraphic, const uno::Sequence< beans::PropertyValue >& rFilterData ) { /* this method applies following attributes to the graphic, in the first step the cropping area (logical size in 100thmm) is applied, in the second step the resolution diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index d4a88f7513f6..714f16a72dbc 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -115,7 +115,7 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css:: SolarMutexGuard aGuard; StringMap aMap; - for (const auto& rPropVal : mPropValues) + for (const auto& rPropVal : std::as_const(mPropValues)) { OUString aVal; if (!(rPropVal.Value >>= aVal)) diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index df1a8c7bac8c..fda6c7bbbd2d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1364,7 +1364,7 @@ void PrintDialog::setupOptionalUI() sal_Int64 nMinValue = 0, nMaxValue = 0; OUString aGroupingHint; - for( const beans::PropertyValue& rEntry : aOptProp ) + for( const beans::PropertyValue& rEntry : std::as_const(aOptProp) ) { if ( rEntry.Name == "ID" ) { @@ -1586,7 +1586,7 @@ void PrintDialog::setupOptionalUI() continue; // iterate options - for( const auto& rChoice : aChoices ) + for( const auto& rChoice : std::as_const(aChoices) ) { pList->InsertEntry( rChoice ); } diff --git a/vcl/unx/generic/dtrans/config.cxx b/vcl/unx/generic/dtrans/config.cxx index 2e65e4f42d64..f2926ef9ec78 100644 --- a/vcl/unx/generic/dtrans/config.cxx +++ b/vcl/unx/generic/dtrans/config.cxx @@ -71,7 +71,7 @@ DtransX11ConfigItem::DtransX11ConfigItem() : m_nSelectionTimeout( 3 ) { Sequence<OUString> aKeys { SELECTION_PROPERTY }; - Sequence< Any > aValues = GetProperties( aKeys ); + const Sequence< Any > aValues = GetProperties( aKeys ); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "found %" SAL_PRIdINT32 " properties for %s\n", aValues.getLength(), SELECTION_PROPERTY ); #endif diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx index 6f3a7c5075e0..0ba7fd561862 100644 --- a/vcl/unx/gtk/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk/a11y/atktextattributes.cxx @@ -925,7 +925,7 @@ TabStopList2String( const uno::Any& rAny, bool default_tabs ) { sal_Unicode lastFillChar = ' '; - for( const auto& rTabStop : theTabStops ) + for( const auto& rTabStop : std::as_const(theTabStops) ) { bool is_default_tab = (style::TabAlign_DEFAULT == rTabStop.Alignment); diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index a6d8ab7d1e76..e9b16217882b 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -1150,7 +1150,7 @@ void SalGtkFilePicker::HandleSetListValue(GtkComboBox *pWidget, sal_Int16 nContr { Sequence< OUString > aStringList; rValue >>= aStringList; - for (const auto& rString : aStringList) + for (const auto& rString : std::as_const(aStringList)) { ComboBoxAppendText(pWidget, rString); if (!bVersionWidthUnset) @@ -1920,7 +1920,7 @@ void SalGtkFilePicker::SetFilters() { // it's a filter group css::uno::Sequence< css::beans::StringPair > aSubFilters; filter.getSubFilters( aSubFilters ); - for( const auto& rSubFilter : aSubFilters ) + for( const auto& rSubFilter : std::as_const(aSubFilters) ) aAllFormats.insert(rSubFilter.Second); } else diff --git a/vcl/unx/gtk/salprn-gtk.cxx b/vcl/unx/gtk/salprn-gtk.cxx index 695b778b59ad..e5e17a5ec9e1 100644 --- a/vcl/unx/gtk/salprn-gtk.cxx +++ b/vcl/unx/gtk/salprn-gtk.cxx @@ -432,7 +432,7 @@ GtkPrintDialog::impl_initCustomTab() if (!aOptProp.hasElements()) continue; - for (const beans::PropertyValue& rEntry : aOptProp) + for (const beans::PropertyValue& rEntry : std::as_const(aOptProp)) { if ( rEntry.Name == "Text" ) { @@ -608,7 +608,7 @@ GtkPrintDialog::impl_initCustomTab() { pWidget = lcl_combo_box_text_new(); - for (const auto& rChoice : aChoices) + for (const auto& rChoice : std::as_const(aChoices)) { lcl_combo_box_text_append(pWidget, OUStringToOString(rChoice, RTL_TEXTENCODING_UTF8).getStr()); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index f9d0fb965914..78381da7c155 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1220,7 +1220,7 @@ public: bHasLoadedAll = true; css::uno::Reference<css::container::XNameAccess> xRef(ImageTree::get().getNameAccess()); - css::uno::Sequence< OUString > aAllIcons = xRef->getElementNames(); + const css::uno::Sequence< OUString > aAllIcons = xRef->getElementNames(); for (const auto& rIcon : aAllIcons) { |