Kaydet (Commit) 5cdb0821 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

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: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst e9b6eb49
...@@ -594,15 +594,26 @@ void ImplImageTree::parseLinkFile(std::shared_ptr<SvStream> const & xStream) ...@@ -594,15 +594,26 @@ void ImplImageTree::parseLinkFile(std::shared_ptr<SvStream> const & xStream)
} }
} }
OUString const & ImplImageTree::getRealImageName(OUString const & name) OUString const & ImplImageTree::getRealImageName(OUString const & rIconName)
{ {
IconLinkHash & rLinkHash = maIconSets[maCurrentStyle].maLinkHash; IconLinkHash & rLinkHash = maIconSets[maCurrentStyle].maLinkHash;
IconLinkHash::iterator it(rLinkHash.find(name)); OUString sNameWithNoExtension = getNameNoExtension(rIconName);
if (it == rLinkHash.end())
return name;
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() bool ImplImageTree::checkPathAccess()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment