tdf#122259 resolve image link as both - png and svg

This is needed to prevent mismatches when we have a image defined
as png and we have a svg available. As we currently support both
png and svg icon themes we need to try both or some resolvable
icons just won't be resolved. Once svg support is in a good shape
that we can get rid of png, we can also possibly get rid of this.

Change-Id: I34e9c24ac1016ef3af46be06330b60aaab730da0
Reviewed-on: https://gerrit.libreoffice.org/66826
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 2b1603d..c24d3e4 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -594,15 +594,26 @@
    }
}

OUString const & ImplImageTree::getRealImageName(OUString const & name)
OUString const & ImplImageTree::getRealImageName(OUString const & rIconName)
{
    IconLinkHash & rLinkHash = maIconSets[maCurrentStyle].maLinkHash;

    IconLinkHash::iterator it(rLinkHash.find(name));
    if (it == rLinkHash.end())
        return name;
    OUString sNameWithNoExtension = getNameNoExtension(rIconName);

    return it->second;
    IconLinkHash::iterator it;

    // PNG is priority
    it = rLinkHash.find(sNameWithNoExtension + ".png");
    if (it != rLinkHash.end())
        return it->second;

    // also check SVG name
    it = rLinkHash.find(sNameWithNoExtension + ".svg");
    if (it != rLinkHash.end())
        return it->second;

    // neither was found so just return the original name
    return rIconName;
}

bool ImplImageTree::checkPathAccess()