summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-10-31 13:28:26 +0100
committerTomaž Vajngerl <quikee@gmail.com>2016-10-31 14:49:57 +0000
commitc3043a3072465c489d3b20991b17d222771305eb (patch)
tree8981124cc9435802c72e1123d5e16a404e4d239f
parent7de287ba422107f54018f2ba0f054d642c86c966 (diff)
tdf#103591 icon theme name resolving, ui fixes, prioritize png
- Prefer "png" over "svg" because for Tango theme we include both "png" and "svg" icon, but rendering of "svg" crashes - We save the choice of which icons to use into the profile. When 32px icons were added the values have shifted - "auto" had value 2 has became "32px" choice and "auto" has the new value 3. In the case of the default "auto", we now always showed 32px icons. This commit reverts the "auto" value 2 and puts "32px" choice to 3. - Name resolving now always removes the icon file extension and adds the ".png" and ".svg" extension before resolving. This makes it possible to define the name of the icon without the file extension. Change-Id: I05e3913aaee0037692609ced246954b14a13828a Reviewed-on: https://gerrit.libreoffice.org/30440 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--include/svtools/imgdef.hxx8
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs4
-rw-r--r--vcl/source/image/ImplImageTree.cxx44
3 files changed, 28 insertions, 28 deletions
diff --git a/include/svtools/imgdef.hxx b/include/svtools/imgdef.hxx
index 7f291897acbe..308fd27225a1 100644
--- a/include/svtools/imgdef.hxx
+++ b/include/svtools/imgdef.hxx
@@ -22,10 +22,10 @@
enum SfxSymbolsSize
{
- SFX_SYMBOLS_SIZE_SMALL,
- SFX_SYMBOLS_SIZE_LARGE,
- SFX_SYMBOLS_SIZE_32,
- SFX_SYMBOLS_SIZE_AUTO
+ SFX_SYMBOLS_SIZE_SMALL = 0,
+ SFX_SYMBOLS_SIZE_LARGE = 1,
+ SFX_SYMBOLS_SIZE_32 = 3, // keep the numbers as they are written into the profile
+ SFX_SYMBOLS_SIZE_AUTO = 2,
};
#endif // INCLUDED_SVTOOLS_IMGDEF_HXX
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index c2dd5ca454ee..e8a9fae680a5 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5707,10 +5707,10 @@
</enumeration>
<enumeration oor:value="1">
<info>
- <desc>larger icons</desc>
+ <desc>26x26 pixel icons</desc>
</info>
</enumeration>
- <enumeration oor:value="2">
+ <enumeration oor:value="3">
<info>
<desc>32x32 pixel icons</desc>
</info>
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 87bb8cbd6c5b..bd36080633e2 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -52,6 +52,22 @@
namespace
{
+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;
+}
+
OUString createPath(OUString const & name, sal_Int32 pos, OUString const & locale)
{
return name.copy(0, pos + 1) + locale + name.copy(pos);
@@ -177,15 +193,15 @@ std::vector<OUString> ImplImageTree::getPaths(OUString const & name, LanguageTag
{
for (OUString& rFallback : rLanguageTag.getFallbackStrings(true))
{
- OUString aFallbackName = getRealImageName(createPath(name, pos, rFallback));
- sPaths.push_back(getNameNoExtension(aFallbackName) + ".svg");
- sPaths.push_back(aFallbackName);
+ OUString aFallbackName = getNameNoExtension(getRealImageName(createPath(name, pos, rFallback)));
+ sPaths.push_back(aFallbackName + ".png");
+ sPaths.push_back(aFallbackName + ".svg");
}
}
- OUString aRealName = getRealImageName(name);
- sPaths.push_back(getNameNoExtension(aRealName) + ".svg");
- sPaths.push_back(aRealName);
+ OUString aRealName = getNameNoExtension(getRealImageName(name));
+ sPaths.push_back(aRealName + ".png");
+ sPaths.push_back(aRealName + ".svg");
return sPaths;
}
@@ -458,22 +474,6 @@ 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;