diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2016-10-30 16:33:25 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-10-30 18:00:20 +0000 |
commit | 3d531da5ac08d5da5d7177306dba0f8a38696002 (patch) | |
tree | bd4380d755dac66e418feb7667c7b0c292a8f187 /vcl/source/image | |
parent | b1426b5b502fd591402d666994e3f1fb3a8ad959 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/image')
-rw-r--r-- | vcl/source/image/ImplImageTree.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index 00efad6e18c5..87bb8cbd6c5b 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; } } |