]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiApplication.cpp
Fix broken Apple speller interface
[features.git] / src / frontends / qt / GuiApplication.cpp
index 3e707ac878914b4d2da2f2d6e95057987a6e677f..ff33065fe34fe313fd051ef1d21227d614f02ec2 100644 (file)
@@ -527,6 +527,16 @@ QString themeIconName(QString const & action)
 
 namespace {
 
+/* Get aliases for icon name. This allows to avoid duplication of
+ * icons when new versions of functions are introduced for the
+ * toolbar. A good example is the introduction of layout-toggle in
+ * #9864.
+ * The file is parsed by Lexer. Each line is of the form
+ *     <original substring> <replacement substring>
+ *
+ * The return value is another icon file name that can be queried.
+ */
+// FIXME: consider using regular expressions.
 QString getAlias(QString name) {
        static bool has_aliases = false;
        static vector <pair<QString,QString>> aliases;
@@ -546,7 +556,7 @@ QString getAlias(QString name) {
                has_aliases = true;
        }
        // check for the following aliases
-       for (auto alias : aliases) {
+       for (auto const & alias : aliases) {
                if (name.contains(alias.first))
                        name.replace(alias.first, alias.second);
        }