diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 13:45:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 08:48:26 +0200 |
commit | 89340fcb6509afd1bffea7b6060d5ff5a444b3f1 (patch) | |
tree | d5ae1feaeed8b67afb89b71e642b6306dd4ebc37 /filter | |
parent | vcl: change bitmap::loadFromName to be like BitmapEx const. (diff) | |
download | core-89340fcb6509afd1bffea7b6060d5ff5a444b3f1.tar.gz core-89340fcb6509afd1bffea7b6060d5ff5a444b3f1.zip |
use for-range on Sequence in f*
Change-Id: I820255001c1b96d1f4b76a203f3c0f76fa09fe66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94567
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/config/cache/filtercache.cxx | 10 | ||||
-rw-r--r-- | filter/source/graphic/GraphicExportFilter.cxx | 14 | ||||
-rw-r--r-- | filter/source/msfilter/eschesdo.cxx | 6 | ||||
-rw-r--r-- | filter/source/pdf/pdfdecomposer.cxx | 5 | ||||
-rw-r--r-- | filter/source/pdf/pdfdialog.cxx | 6 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 266 | ||||
-rw-r--r-- | filter/source/pdf/pdffilter.cxx | 6 | ||||
-rw-r--r-- | filter/source/svg/svgfilter.cxx | 30 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltertestdialog.cxx | 9 | ||||
-rw-r--r-- | filter/source/xsltfilter/LibXSLTTransformer.cxx | 4 |
10 files changed, 174 insertions, 182 deletions
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index bb928a784c37..b3ac1594fade 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -2061,9 +2061,8 @@ void FilterCache::impl_readOldFormat() css::uno::Reference< css::container::XNameAccess > xSet; xCfg->getByName(TYPES_SET) >>= xSet; const css::uno::Sequence< OUString > lItems = xSet->getElementNames(); - const OUString* pItems = lItems.getConstArray(); - for (sal_Int32 i=0; i<lItems.getLength(); ++i) - m_lTypes[pItems[i]] = impl_readOldItem(xSet, E_TYPE, pItems[i]); + for (const OUString& rName : lItems) + m_lTypes[rName] = impl_readOldItem(xSet, E_TYPE, rName); } OUString FILTER_SET("Filters"); @@ -2073,9 +2072,8 @@ void FilterCache::impl_readOldFormat() css::uno::Reference< css::container::XNameAccess > xSet; xCfg->getByName(FILTER_SET) >>= xSet; const css::uno::Sequence< OUString > lItems = xSet->getElementNames(); - const OUString* pItems = lItems.getConstArray(); - for (sal_Int32 i=0; i<lItems.getLength(); ++i) - m_lFilters[pItems[i]] = impl_readOldItem(xSet, E_FILTER, pItems[i]); + for (const OUString& rName : lItems) + m_lFilters[rName] = impl_readOldItem(xSet, E_FILTER, rName); } } /* corrupt filter addon? Because it's external (optional) code... we can ignore it. Addon won't work then... diff --git a/filter/source/graphic/GraphicExportFilter.cxx b/filter/source/graphic/GraphicExportFilter.cxx index 457949ab770d..548a2c4e1407 100644 --- a/filter/source/graphic/GraphicExportFilter.cxx +++ b/filter/source/graphic/GraphicExportFilter.cxx @@ -44,10 +44,8 @@ void GraphicExportFilter::gatherProperties( const uno::Sequence< beans::Property { OUString aInternalFilterName; - for ( sal_Int32 i = 0; i < rProperties.getLength(); i++ ) + for ( const beans::PropertyValue& rProperty : rProperties ) { - const beans::PropertyValue& rProperty = rProperties[i]; - if ( rProperty.Name == "FilterName" ) { rProperty.Value >>= aInternalFilterName; @@ -76,15 +74,15 @@ void GraphicExportFilter::gatherProperties( const uno::Sequence< beans::Property } } - for ( sal_Int32 i = 0; i < maFilterDataSequence.getLength(); i++ ) + for ( const beans::PropertyValue& rProp : std::as_const(maFilterDataSequence) ) { - if ( maFilterDataSequence[i].Name == "PixelWidth" ) + if ( rProp.Name == "PixelWidth" ) { - maFilterDataSequence[i].Value >>= mnTargetWidth; + rProp.Value >>= mnTargetWidth; } - else if ( maFilterDataSequence[i].Name == "PixelHeight" ) + else if ( rProp.Name == "PixelHeight" ) { - maFilterDataSequence[i].Value >>= mnTargetHeight; + rProp.Value >>= mnTargetHeight; } } diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index af78b7be323e..22f47daa15af 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -166,12 +166,12 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, if ( xPropInfo.is() && xPropInfo->hasPropertyByName( "InteropGrabBag" ) ) { xPropertySet->getPropertyValue( "InteropGrabBag" ) >>= aGrabBag; - for (int i=0; i< aGrabBag.getLength(); i++) + for (const beans::PropertyValue& rProp : std::as_const(aGrabBag)) { - if (aGrabBag[i].Name == "mso-edit-as") + if (rProp.Name == "mso-edit-as") { OUString rEditAs; - aGrabBag[i].Value >>= rEditAs; + rProp.Value >>= rEditAs; mpEscherEx->SetEditAs(rEditAs); break; } diff --git a/filter/source/pdf/pdfdecomposer.cxx b/filter/source/pdf/pdfdecomposer.cxx index 15e500343f8f..e053fd215369 100644 --- a/filter/source/pdf/pdfdecomposer.cxx +++ b/filter/source/pdf/pdfdecomposer.cxx @@ -57,13 +57,12 @@ uno::Sequence<uno::Reference<graphic::XPrimitive2D>> SAL_CALL XPdfDecomposer::ge { sal_Int32 nPageIndex = -1; - for (sal_Int32 index = 0; index < xParameters.getLength(); index++) + for (const beans::PropertyValue& rProperty : xParameters) { - const beans::PropertyValue& rProperty = xParameters[index]; - if (rProperty.Name == "PageIndex") { rProperty.Value >>= nPageIndex; + break; } } diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx index 7380a3ec0894..5a9fc177dc2c 100644 --- a/filter/source/pdf/pdfdialog.cxx +++ b/filter/source/pdf/pdfdialog.cxx @@ -138,11 +138,11 @@ void SAL_CALL PDFDialog::setPropertyValues( const Sequence< PropertyValue >& rPr { maMediaDescriptor = rProps; - for( sal_Int32 i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) + for( const PropertyValue& rProp : std::as_const(maMediaDescriptor) ) { - if ( maMediaDescriptor[ i ].Name == "FilterData" ) + if ( rProp.Name == "FilterData" ) { - maMediaDescriptor[ i ].Value >>= maFilterData; + rProp.Value >>= maFilterData; break; } } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 787bcab4398b..169b78bfea75 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -179,14 +179,14 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, StringRangeEnumerator::Iterator aEnd = rRangeEnum.end(); while ( aIter != aEnd ) { - Sequence< PropertyValue > aRenderer( rRenderable->getRenderer( *aIter, rSelection, rRenderOptions ) ); + const Sequence< PropertyValue > aRenderer( rRenderable->getRenderer( *aIter, rSelection, rRenderOptions ) ); awt::Size aPageSize; - for( sal_Int32 nProperty = 0, nPropertyCount = aRenderer.getLength(); nProperty < nPropertyCount; ++nProperty ) + for( const PropertyValue& rProp : aRenderer ) { - if ( aRenderer[ nProperty ].Name == "PageSize" ) + if ( rProp.Name == "PageSize" ) { - aRenderer[ nProperty].Value >>= aPageSize; + rProp.Value >>= aPageSize; break; } } @@ -359,9 +359,9 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC Sequence< beans::PropertyValue > aFilterData; xFilterFactory->getByName( aFilterName ) >>= aFilterData; - for ( sal_Int32 nInd = 0; nInd < aFilterData.getLength(); nInd++ ) - if ( aFilterData[nInd].Name == "Type" ) - aFilterData[nInd].Value >>= aTypeName; + for ( const beans::PropertyValue& rProp : std::as_const(aFilterData) ) + if ( rProp.Name == "Type" ) + rProp.Value >>= aTypeName; if ( !aTypeName.isEmpty() ) { @@ -372,9 +372,9 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC Sequence< beans::PropertyValue > aTypeData; xTypeDetection->getByName( aTypeName ) >>= aTypeData; - for ( sal_Int32 nInd = 0; nInd < aTypeData.getLength(); nInd++ ) - if ( aTypeData[nInd].Name == "MediaType" ) - aTypeData[nInd].Value >>= aDocMimetype; + for ( const beans::PropertyValue& rProp : std::as_const(aTypeData) ) + if ( rProp.Name == "MediaType" ) + rProp.Value >>= aDocMimetype; } } } @@ -454,134 +454,134 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& utl::ConfigManager::getProductVersion(); aContext.DocumentInfo.Creator = aCreator; - for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData ) + for ( const beans::PropertyValue& rProp : rFilterData ) { - if ( rFilterData[ nData ].Name == "PageRange" ) - rFilterData[ nData ].Value >>= aPageRange; - else if ( rFilterData[ nData ].Name == "Selection" ) - aSelection = rFilterData[ nData ].Value; - else if ( rFilterData[ nData ].Name == "UseLosslessCompression" ) - rFilterData[ nData ].Value >>= mbUseLosslessCompression; - else if ( rFilterData[ nData ].Name == "Quality" ) - rFilterData[ nData ].Value >>= mnQuality; - else if ( rFilterData[ nData ].Name == "ReduceImageResolution" ) - rFilterData[ nData ].Value >>= mbReduceImageResolution; - else if ( rFilterData[ nData ].Name == "IsSkipEmptyPages" ) - rFilterData[ nData ].Value >>= mbSkipEmptyPages; - else if ( rFilterData[ nData ].Name == "MaxImageResolution" ) - rFilterData[ nData ].Value >>= mnMaxImageResolution; - else if ( rFilterData[ nData ].Name == "UseTaggedPDF" ) - rFilterData[ nData ].Value >>= mbUseTaggedPDF; - else if ( rFilterData[ nData ].Name == "SelectPdfVersion" ) - rFilterData[ nData ].Value >>= mnPDFTypeSelection; - else if ( rFilterData[ nData ].Name == "PDFUACompliance" ) - rFilterData[ nData ].Value >>= mbPDFUACompliance; - else if ( rFilterData[ nData ].Name == "ExportNotes" ) - rFilterData[ nData ].Value >>= mbExportNotes; - else if ( rFilterData[ nData ].Name == "ExportNotesPages" ) - rFilterData[ nData ].Value >>= mbExportNotesPages; - else if ( rFilterData[ nData ].Name == "ExportOnlyNotesPages" ) - rFilterData[ nData ].Value >>= mbExportOnlyNotesPages; - else if ( rFilterData[ nData ].Name == "UseTransitionEffects" ) - rFilterData[ nData ].Value >>= mbUseTransitionEffects; - else if ( rFilterData[ nData ].Name == "ExportFormFields" ) - rFilterData[ nData ].Value >>= mbExportFormFields; - else if ( rFilterData[ nData ].Name == "FormsType" ) - rFilterData[ nData ].Value >>= mnFormsFormat; - else if ( rFilterData[ nData ].Name == "AllowDuplicateFieldNames" ) - rFilterData[ nData ].Value >>= mbAllowDuplicateFieldNames; + if ( rProp.Name == "PageRange" ) + rProp.Value >>= aPageRange; + else if ( rProp.Name == "Selection" ) + aSelection = rProp.Value; + else if ( rProp.Name == "UseLosslessCompression" ) + rProp.Value >>= mbUseLosslessCompression; + else if ( rProp.Name == "Quality" ) + rProp.Value >>= mnQuality; + else if ( rProp.Name == "ReduceImageResolution" ) + rProp.Value >>= mbReduceImageResolution; + else if ( rProp.Name == "IsSkipEmptyPages" ) + rProp.Value >>= mbSkipEmptyPages; + else if ( rProp.Name == "MaxImageResolution" ) + rProp.Value >>= mnMaxImageResolution; + else if ( rProp.Name == "UseTaggedPDF" ) + rProp.Value >>= mbUseTaggedPDF; + else if ( rProp.Name == "SelectPdfVersion" ) + rProp.Value >>= mnPDFTypeSelection; + else if ( rProp.Name == "PDFUACompliance" ) + rProp.Value >>= mbPDFUACompliance; + else if ( rProp.Name == "ExportNotes" ) + rProp.Value >>= mbExportNotes; + else if ( rProp.Name == "ExportNotesPages" ) + rProp.Value >>= mbExportNotesPages; + else if ( rProp.Name == "ExportOnlyNotesPages" ) + rProp.Value >>= mbExportOnlyNotesPages; + else if ( rProp.Name == "UseTransitionEffects" ) + rProp.Value >>= mbUseTransitionEffects; + else if ( rProp.Name == "ExportFormFields" ) + rProp.Value >>= mbExportFormFields; + else if ( rProp.Name == "FormsType" ) + rProp.Value >>= mnFormsFormat; + else if ( rProp.Name == "AllowDuplicateFieldNames" ) + rProp.Value >>= mbAllowDuplicateFieldNames; // viewer properties - else if ( rFilterData[ nData ].Name == "HideViewerToolbar" ) - rFilterData[ nData ].Value >>= mbHideViewerToolbar; - else if ( rFilterData[ nData ].Name == "HideViewerMenubar" ) - rFilterData[ nData ].Value >>= mbHideViewerMenubar; - else if ( rFilterData[ nData ].Name == "HideViewerWindowControls" ) - rFilterData[ nData ].Value >>= mbHideViewerWindowControls; - else if ( rFilterData[ nData ].Name == "ResizeWindowToInitialPage" ) - rFilterData[ nData ].Value >>= mbFitWindow; - else if ( rFilterData[ nData ].Name == "CenterWindow" ) - rFilterData[ nData ].Value >>= mbCenterWindow; - else if ( rFilterData[ nData ].Name == "OpenInFullScreenMode" ) - rFilterData[ nData ].Value >>= mbOpenInFullScreenMode; - else if ( rFilterData[ nData ].Name == "DisplayPDFDocumentTitle" ) - rFilterData[ nData ].Value >>= mbDisplayPDFDocumentTitle; - else if ( rFilterData[ nData ].Name == "InitialView" ) - rFilterData[ nData ].Value >>= mnPDFDocumentMode; - else if ( rFilterData[ nData ].Name == "Magnification" ) - rFilterData[ nData ].Value >>= mnPDFDocumentAction; - else if ( rFilterData[ nData ].Name == "Zoom" ) - rFilterData[ nData ].Value >>= mnZoom; - else if ( rFilterData[ nData ].Name == "InitialPage" ) - rFilterData[ nData ].Value >>= mnInitialPage; - else if ( rFilterData[ nData ].Name == "PageLayout" ) - rFilterData[ nData ].Value >>= mnPDFPageLayout; - else if ( rFilterData[ nData ].Name == "FirstPageOnLeft" ) - rFilterData[ nData ].Value >>= aContext.FirstPageLeft; - else if ( rFilterData[ nData ].Name == "IsAddStream" ) - rFilterData[ nData ].Value >>= mbAddStream; - else if ( rFilterData[ nData ].Name == "Watermark" ) - rFilterData[ nData ].Value >>= msWatermark; - else if ( rFilterData[ nData ].Name == "TiledWatermark" ) - rFilterData[ nData ].Value >>= msTiledWatermark; + else if ( rProp.Name == "HideViewerToolbar" ) + rProp.Value >>= mbHideViewerToolbar; + else if ( rProp.Name == "HideViewerMenubar" ) + rProp.Value >>= mbHideViewerMenubar; + else if ( rProp.Name == "HideViewerWindowControls" ) + rProp.Value >>= mbHideViewerWindowControls; + else if ( rProp.Name == "ResizeWindowToInitialPage" ) + rProp.Value >>= mbFitWindow; + else if ( rProp.Name == "CenterWindow" ) + rProp.Value >>= mbCenterWindow; + else if ( rProp.Name == "OpenInFullScreenMode" ) + rProp.Value >>= mbOpenInFullScreenMode; + else if ( rProp.Name == "DisplayPDFDocumentTitle" ) + rProp.Value >>= mbDisplayPDFDocumentTitle; + else if ( rProp.Name == "InitialView" ) + rProp.Value >>= mnPDFDocumentMode; + else if ( rProp.Name == "Magnification" ) + rProp.Value >>= mnPDFDocumentAction; + else if ( rProp.Name == "Zoom" ) + rProp.Value >>= mnZoom; + else if ( rProp.Name == "InitialPage" ) + rProp.Value >>= mnInitialPage; + else if ( rProp.Name == "PageLayout" ) + rProp.Value >>= mnPDFPageLayout; + else if ( rProp.Name == "FirstPageOnLeft" ) + rProp.Value >>= aContext.FirstPageLeft; + else if ( rProp.Name == "IsAddStream" ) + rProp.Value >>= mbAddStream; + else if ( rProp.Name == "Watermark" ) + rProp.Value >>= msWatermark; + else if ( rProp.Name == "TiledWatermark" ) + rProp.Value >>= msTiledWatermark; // now all the security related properties... - else if ( rFilterData[ nData ].Name == "EncryptFile" ) - rFilterData[ nData ].Value >>= mbEncrypt; - else if ( rFilterData[ nData ].Name == "DocumentOpenPassword" ) - rFilterData[ nData ].Value >>= aOpenPassword; - else if ( rFilterData[ nData ].Name == "RestrictPermissions" ) - rFilterData[ nData ].Value >>= mbRestrictPermissions; - else if ( rFilterData[ nData ].Name == "PermissionPassword" ) - rFilterData[ nData ].Value >>= aPermissionPassword; - else if ( rFilterData[ nData ].Name == "PreparedPasswords" ) - rFilterData[ nData ].Value >>= xEnc; - else if ( rFilterData[ nData ].Name == "PreparedPermissionPassword" ) - rFilterData[ nData ].Value >>= aPreparedPermissionPassword; - else if ( rFilterData[ nData ].Name == "Printing" ) - rFilterData[ nData ].Value >>= mnPrintAllowed; - else if ( rFilterData[ nData ].Name == "Changes" ) - rFilterData[ nData ].Value >>= mnChangesAllowed; - else if ( rFilterData[ nData ].Name == "EnableCopyingOfContent" ) - rFilterData[ nData ].Value >>= mbCanCopyOrExtract; - else if ( rFilterData[ nData ].Name == "EnableTextAccessForAccessibilityTools" ) - rFilterData[ nData ].Value >>= mbCanExtractForAccessibility; + else if ( rProp.Name == "EncryptFile" ) + rProp.Value >>= mbEncrypt; + else if ( rProp.Name == "DocumentOpenPassword" ) + rProp.Value >>= aOpenPassword; + else if ( rProp.Name == "RestrictPermissions" ) + rProp.Value >>= mbRestrictPermissions; + else if ( rProp.Name == "PermissionPassword" ) + rProp.Value >>= aPermissionPassword; + else if ( rProp.Name == "PreparedPasswords" ) + rProp.Value >>= xEnc; + else if ( rProp.Name == "PreparedPermissionPassword" ) + rProp.Value >>= aPreparedPermissionPassword; + else if ( rProp.Name == "Printing" ) + rProp.Value >>= mnPrintAllowed; + else if ( rProp.Name == "Changes" ) + rProp.Value >>= mnChangesAllowed; + else if ( rProp.Name == "EnableCopyingOfContent" ) + rProp.Value >>= mbCanCopyOrExtract; + else if ( rProp.Name == "EnableTextAccessForAccessibilityTools" ) + rProp.Value >>= mbCanExtractForAccessibility; // i56629 links extra (relative links and other related stuff) - else if ( rFilterData[ nData ].Name == "ExportLinksRelativeFsys" ) - rFilterData[ nData ].Value >>= mbExportRelativeFsysLinks; - else if ( rFilterData[ nData ].Name == "PDFViewSelection" ) - rFilterData[ nData ].Value >>= mnDefaultLinkAction; - else if ( rFilterData[ nData ].Name == "ConvertOOoTargetToPDFTarget" ) - rFilterData[ nData ].Value >>= mbConvertOOoTargetToPDFTarget; - else if ( rFilterData[ nData ].Name == "ExportBookmarksToPDFDestination" ) - rFilterData[ nData ].Value >>= mbExportBmkToDest; - else if ( rFilterData[ nData ].Name == "ExportBookmarks" ) - rFilterData[ nData ].Value >>= mbExportBookmarks; - else if ( rFilterData[ nData ].Name == "ExportHiddenSlides" ) - rFilterData[ nData ].Value >>= mbExportHiddenSlides; - else if ( rFilterData[ nData ].Name == "SinglePageSheets" ) - rFilterData[ nData ].Value >>= mbSinglePageSheets; - else if ( rFilterData[ nData ].Name == "OpenBookmarkLevels" ) - rFilterData[ nData ].Value >>= mnOpenBookmarkLevels; - else if ( rFilterData[ nData ].Name == "SignPDF" ) - rFilterData[ nData ].Value >>= mbSignPDF; - else if ( rFilterData[ nData ].Name == "SignatureLocation" ) - rFilterData[ nData ].Value >>= msSignLocation; - else if ( rFilterData[ nData ].Name == "SignatureReason" ) - rFilterData[ nData ].Value >>= msSignReason; - else if ( rFilterData[ nData ].Name == "SignatureContactInfo" ) - rFilterData[ nData ].Value >>= msSignContact; - else if ( rFilterData[ nData ].Name == "SignaturePassword" ) - rFilterData[ nData ].Value >>= msSignPassword; - else if ( rFilterData[ nData ].Name == "SignatureCertificate" ) - rFilterData[ nData ].Value >>= maSignCertificate; - else if ( rFilterData[ nData ].Name == "SignatureTSA" ) - rFilterData[ nData ].Value >>= msSignTSA; - else if ( rFilterData[ nData ].Name == "ExportPlaceholders" ) - rFilterData[ nData ].Value >>= mbExportPlaceholders; - else if ( rFilterData[ nData ].Name == "UseReferenceXObject" ) - rFilterData[ nData ].Value >>= mbUseReferenceXObject; + else if ( rProp.Name == "ExportLinksRelativeFsys" ) + rProp.Value >>= mbExportRelativeFsysLinks; + else if ( rProp.Name == "PDFViewSelection" ) + rProp.Value >>= mnDefaultLinkAction; + else if ( rProp.Name == "ConvertOOoTargetToPDFTarget" ) + rProp.Value >>= mbConvertOOoTargetToPDFTarget; + else if ( rProp.Name == "ExportBookmarksToPDFDestination" ) + rProp.Value >>= mbExportBmkToDest; + else if ( rProp.Name == "ExportBookmarks" ) + rProp.Value >>= mbExportBookmarks; + else if ( rProp.Name == "ExportHiddenSlides" ) + rProp.Value >>= mbExportHiddenSlides; + else if ( rProp.Name == "SinglePageSheets" ) + rProp.Value >>= mbSinglePageSheets; + else if ( rProp.Name == "OpenBookmarkLevels" ) + rProp.Value >>= mnOpenBookmarkLevels; + else if ( rProp.Name == "SignPDF" ) + rProp.Value >>= mbSignPDF; + else if ( rProp.Name == "SignatureLocation" ) + rProp.Value >>= msSignLocation; + else if ( rProp.Name == "SignatureReason" ) + rProp.Value >>= msSignReason; + else if ( rProp.Name == "SignatureContactInfo" ) + rProp.Value >>= msSignContact; + else if ( rProp.Name == "SignaturePassword" ) + rProp.Value >>= msSignPassword; + else if ( rProp.Name == "SignatureCertificate" ) + rProp.Value >>= maSignCertificate; + else if ( rProp.Name == "SignatureTSA" ) + rProp.Value >>= msSignTSA; + else if ( rProp.Name == "ExportPlaceholders" ) + rProp.Value >>= mbExportPlaceholders; + else if ( rProp.Name == "UseReferenceXObject" ) + rProp.Value >>= mbUseReferenceXObject; // Redaction & bitmap related stuff - else if ( rFilterData[ nData ].Name == "IsRedactMode" ) - rFilterData[ nData ].Value >>= mbIsRedactMode; + else if ( rProp.Name == "IsRedactMode" ) + rProp.Value >>= mbIsRedactMode; } aContext.URL = aURL.GetMainURL(INetURLObject::DecodeMechanism::ToIUri); diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index 175604d8a99c..fdbdae95784b 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -133,11 +133,11 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) { bool bFound = false; - for (int i = 0; i < aFilterData.getLength(); ++i) + for (PropertyValue& rProp : aFilterData) { - if (aFilterData[i].Name == "IsRedactMode") + if (rProp.Name == "IsRedactMode") { - aFilterData[i].Value <<= bIsRedactMode; + rProp.Value <<= bIsRedactMode; bFound = true; break; } diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 0440ac94e1c9..7808b633b74e 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -112,12 +112,12 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto if(mxSrcDoc.is()) { - for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++) + for (const PropertyValue& rProp : rDescriptor) { - if (rDescriptor[nInd].Name == "FilterName") + if (rProp.Name == "FilterName") { OUString sFilterName; - rDescriptor[nInd].Value >>= sFilterName; + rProp.Value >>= sFilterName; if(sFilterName == "impress_svg_Export") { mbImpressFilter = true; @@ -374,17 +374,17 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto bool bPageProvided = comphelper::LibreOfficeKit::isActive(); sal_Int32 nPageToExport = -1; - for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++) + for( const PropertyValue& rProp : rDescriptor ) { - if (rDescriptor[nInd].Name == "SelectionOnly") + if (rProp.Name == "SelectionOnly") { // #i124608# extract single selection wanted from dialog return values - rDescriptor[nInd].Value >>= bSelectionOnly; + rProp.Value >>= bSelectionOnly; bPageProvided = false; } - else if (rDescriptor[nInd].Name == "PagePos") + else if (rProp.Name == "PagePos") { - rDescriptor[nInd].Value >>= nPageToExport; + rProp.Value >>= nPageToExport; bPageProvided = true; } } @@ -404,20 +404,20 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto // * traverse Impress resources to find slide preview pane, grab selection from there // * otherwise, fallback to current slide // - uno::Sequence<uno::Reference<drawing::framework::XResourceId> > aResIds( + const uno::Sequence<uno::Reference<drawing::framework::XResourceId> > aResIds( xConfigController->getCurrentConfiguration()->getResources( uno::Reference<drawing::framework::XResourceId>(), "", drawing::framework::AnchorBindingMode_INDIRECT)); - for( sal_Int32 i=0; i<aResIds.getLength(); ++i ) + for( const uno::Reference<drawing::framework::XResourceId>& rResId : aResIds ) { // can we somehow obtain the slidesorter from the Impress framework? - if( aResIds[i]->getResourceURL() == "private:resource/view/SlideSorter" ) + if( rResId->getResourceURL() == "private:resource/view/SlideSorter" ) { // got it, grab current selection from there uno::Reference<drawing::framework::XResource> xRes( - xConfigController->getResource(aResIds[i])); + xConfigController->getResource(rResId)); uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xRes, @@ -548,11 +548,11 @@ bool SVGFilter::filterWriterOrCalc( const Sequence< PropertyValue >& rDescriptor { bool bSelectionOnly = false; - for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++) + for (const PropertyValue& rProp : rDescriptor) { - if (rDescriptor[nInd].Name == "SelectionOnly") + if (rProp.Name == "SelectionOnly") { - rDescriptor[nInd].Value >>= bSelectionOnly; + rProp.Value >>= bSelectionOnly; break; } } diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index e4a659a3653c..0499e0a5e615 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -345,16 +345,13 @@ void XMLFilterTestDialog::onExportBrowse() if( aAny >>= aValues2 ) { - PropertyValue* pValues2 = aValues2.getArray(); - sal_Int32 nValue; - OUString aExtension; - for( nValue = 0; nValue < aValues2.getLength(); nValue++, pValues2++ ) + for( const PropertyValue& rProp : std::as_const(aValues2) ) { - if ( pValues2->Name == "Extensions" ) + if ( rProp.Name == "Extensions" ) { Sequence< OUString > aExtensions; - if( pValues2->Value >>= aExtensions ) + if( rProp.Value >>= aExtensions ) { const sal_Int32 nCount( aExtensions.getLength() ); OUString* pExtensions = aExtensions.getArray(); diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx index 2d1c148a8c0f..1403664d4331 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.cxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx @@ -473,10 +473,10 @@ namespace XSLT } xmlSubstituteEntitiesDefault(0); m_parameters.clear(); - for (int i = 0; i < params.getLength(); i++) + for (const Any& p : std::as_const(params)) { NamedValue nv; - params[i] >>= nv; + p >>= nv; OString nameUTF8 = OUStringToOString(nv.Name, RTL_TEXTENCODING_UTF8); OUString value; |