]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInfo.cpp
Improve handling of top and bottom margin
[lyx.git] / src / insets / InsetInfo.cpp
index 2e42ad0e0ad239ab08f3687b84e2ef461233d83f..0847106dc01e3025c0997f13d2f0f0fdac076543 100644 (file)
@@ -168,7 +168,7 @@ set<string> getTexFileList(string const & filename)
        return list;
 }
 
-bool translateString(docstring const in, docstring & out, string const lcode)
+bool translateString(docstring const & in, docstring & out, string const & lcode)
 {
        out = translateIfPossible(in, lcode);
        return in != out;
@@ -176,7 +176,7 @@ bool translateString(docstring const in, docstring & out, string const lcode)
 } // namespace anon
 
 
-docstring InsetInfoParams::getDate(string const iname, QDate const date) const
+docstring InsetInfoParams::getDate(string const iname, QDate const date) const
 {
        QLocale loc;
        if (lang)
@@ -201,7 +201,7 @@ docstring InsetInfoParams::getDate(string const iname, QDate const date) const
 }
 
 
-docstring InsetInfoParams::getTime(string const iname, QTime const time) const
+docstring InsetInfoParams::getTime(string const iname, QTime const time) const
 {
        QLocale loc;
        if (lang)
@@ -743,13 +743,21 @@ void InsetInfo::setText(docstring const & str, Language const * lang)
 }
 
 
-bool InsetInfo::forceLTR() const
+bool InsetInfo::forceLTR(OutputParams const &) const
 {
        return params_.force_ltr;
 }
 
 
-void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
+bool InsetInfo::forceLocalFontSwitch() const
+{
+       return params_.type == InsetInfoParams::MENU_INFO
+               || params_.type == InsetInfoParams::SHORTCUTS_INFO
+               || params_.type == InsetInfoParams::L7N_INFO;
+}
+
+
+void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted) {
        // If the Buffer is a clone, then we neither need nor want to do any
        // of what follows. We want, rather, just to inherit how things were
        // in the original Buffer. This is especially important for VCS.
@@ -1037,14 +1045,6 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
                initialized_ = true;
                FuncRequest func = lyxaction.lookupFunc(params_.name);
                docstring icon_name = frontend::Application::iconName(func, true);
-               // FIXME: We should use the icon directly instead of
-               // going through FileName. The code below won't work
-               // if the icon is embedded in the executable through
-               // the Qt resource system.
-               // This is only a negligible performance problem:
-               // If the installed icon differs from the resource icon the
-               // installed one is preferred anyway, and all icons that are
-               // embedded in the resources are installed as well.
                FileName file(to_utf8(icon_name));
                if (file.onlyFileNameWithoutExt() == "unknown") {
                        string dir = "images";
@@ -1168,7 +1168,7 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype) {
 
        // Just to do something with that string
        LYXERR(Debug::INFO, "info inset text: " << gui);
-       InsetCollapsible::updateBuffer(it, utype);
+       InsetCollapsible::updateBuffer(it, utype, deleted);
 }