filter/source/pdf/pdffilter.cxx |   32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

New commits:
commit ac296a9b21193ac492da17b7510dff9bdd855aad
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Oct 29 10:45:04 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Oct 29 10:17:48 2023 +0100

    Simplify a bit
    
    Change-Id: Ib9e3cb046ac5b3b6af8308cda02f20c3575d15d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158608
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index d28803aa01c9..dcfc918bbdd0 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -54,31 +54,25 @@ bool PDFFilter::implExport( const Sequence< PropertyValue 
>& rDescriptor )
     Reference< XOutputStream >  xOStm;
     Sequence< PropertyValue >   aFilterData;
     OUString aFilterOptions;
-    sal_Int32                   nLength = rDescriptor.getLength();
-    const PropertyValue*        pValue = rDescriptor.getConstArray();
     bool                        bIsRedactMode = false;
     bool                    bRet = false;
     Reference< task::XStatusIndicator > xStatusIndicator;
     Reference< task::XInteractionHandler > xIH;
 
-    for (sal_Int32 i = 0; i < nLength; ++i)
+    for (const auto& rValue : rDescriptor)
     {
-        if ( pValue[ i ].Name == "OutputStream" )
-            pValue[ i ].Value >>= xOStm;
-        else if ( pValue[ i ].Name == "FilterData" )
-            pValue[ i ].Value >>= aFilterData;
-        else if ( pValue[ i ].Name == "FilterOptions" )
-            pValue[ i ].Value >>= aFilterOptions;
-        else if ( pValue[ i ].Name == "StatusIndicator" )
-            pValue[ i ].Value >>= xStatusIndicator;
-        else if ( pValue[i].Name == "InteractionHandler" )
-            pValue[i].Value >>= xIH;
-    }
-
-    for (sal_Int32 i = 0 ; i < nLength; ++i)
-    {
-        if ( pValue[i].Name == "IsRedactMode")
-            pValue[i].Value >>= bIsRedactMode;
+        if (rValue.Name == "OutputStream")
+            rValue.Value >>= xOStm;
+        else if (rValue.Name == "FilterData")
+            rValue.Value >>= aFilterData;
+        else if (rValue.Name == "FilterOptions")
+            rValue.Value >>= aFilterOptions;
+        else if (rValue.Name == "StatusIndicator")
+            rValue.Value >>= xStatusIndicator;
+        else if (rValue.Name == "InteractionHandler")
+            rValue.Value >>= xIH;
+        else if (rValue.Name == "IsRedactMode")
+            rValue.Value >>= bIsRedactMode;
     }
 
     if (!aFilterData.hasElements() && aFilterOptions.startsWith("{"))

Reply via email to