vcl/source/image/ImplImageTree.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
New commits: commit 3d531da5ac08d5da5d7177306dba0f8a38696002 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> Date: Sun Oct 30 16:33:25 2016 +0100 vcl: use links to "large" (26px) icons also for 32px icons This adds links to "large" icons (prefixed with "lc_") also for 32px icons automatically so that we don't need to duplicate the links.txt files. Change-Id: I5fc3a769aa795060b6ae2d554cadd81938e4d4ec Reviewed-on: https://gerrit.libreoffice.org/30399 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index 00efad6..87bb8cb 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -458,6 +458,22 @@ void ImplImageTree::loadImageLinks() } } +OUString convertLcTo32Path(OUString const & rPath) +{ + OUString aResult; + if (rPath.lastIndexOf('/') != -1) + { + sal_Int32 nCopyFrom = rPath.lastIndexOf('/') + 1; + OUString sFile = rPath.copy(nCopyFrom); + OUString sDir = rPath.copy(0, rPath.lastIndexOf('/')); + if (!sFile.isEmpty() && sFile.startsWith("lc_")) + { + aResult = sDir + "/32/" + sFile.copy(3); + } + } + return aResult; +} + void ImplImageTree::parseLinkFile(std::shared_ptr<SvStream> const & xStream) { OString aLine; @@ -482,6 +498,12 @@ void ImplImageTree::parseLinkFile(std::shared_ptr<SvStream> const & xStream) } getCurrentIconSet().maLinkHash[aLink] = aOriginal; + + OUString aOriginal32 = convertLcTo32Path(aOriginal); + OUString aLink32 = convertLcTo32Path(aLink); + + if (!aOriginal32.isEmpty() && !aLink32.isEmpty()) + getCurrentIconSet().maLinkHash[aLink32] = aOriginal32; } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits