vcl/source/gdi/pdfobjectcopier.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 9aaf70675c0fc80641f6da6f821c2180be1ca608
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Mon Dec 19 08:49:57 2022 +0100
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Tue Dec 20 04:39:59 2022 +0000

    vcl: avoid unused variable warning
    
    vcl/source/gdi/pdfobjectcopier.cxx: In member function ‘rtl::OString 
vcl::PDFObjectCopier::copyExternalResources(vcl::filter::PDFObjectElement&, 
const rtl::OString&, std::__debug::map<int, int>&)’:
    vcl/source/gdi/pdfobjectcopier.cxx:240:27: error: unused variable ‘pDict’ 
[-Werror=unused-variable]
      240 |                 if (auto* pDict = 
dynamic_cast<filter::PDFDictionaryElement*>(rItem.second))
          |                           ^~~~~
    
    Change-Id: I864210144e6154eb79a42e6cd5ceb3d5dbd39a76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144449
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/vcl/source/gdi/pdfobjectcopier.cxx 
b/vcl/source/gdi/pdfobjectcopier.cxx
index cbf3dc308c3b..fddacc2a65fd 100644
--- a/vcl/source/gdi/pdfobjectcopier.cxx
+++ b/vcl/source/gdi/pdfobjectcopier.cxx
@@ -235,13 +235,10 @@ OString 
PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
         auto pReference = 
dynamic_cast<filter::PDFReferenceElement*>(rItem.second);
         if (!pReference)
         {
-            if (pKindObject)
+            if (pKindObject && 
dynamic_cast<filter::PDFDictionaryElement*>(rItem.second) != nullptr)
             {
-                if (auto* pDict = 
dynamic_cast<filter::PDFDictionaryElement*>(rItem.second))
-                {
-                    bHasDictValue = true;
-                    break;
-                }
+                bHasDictValue = true;
+                break;
             }
 
             continue;

Reply via email to