]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.cpp
Fix reloading of local layout file (bug #11120)
[lyx.git] / src / frontends / qt4 / qt_helpers.cpp
index f7ec99b13169432163956b37b3e4402031e27710..d23ae9c2f93147560af88f42fb798cf11d2dec52 100644 (file)
@@ -91,7 +91,7 @@ double locstringToDouble(QString const & str)
        return res;
 }
 
-} // namespace anon
+} // namespace
 
 
 namespace frontend {
@@ -214,6 +214,12 @@ QString formatLocFPNumber(double d)
 }
 
 
+bool SortLocaleAware(QString const & lhs, QString const & rhs)
+{
+       return QString::localeAwareCompare(lhs, rhs) < 0;
+}
+
+
 bool ColorSorter(ColorCode lhs, ColorCode rhs)
 {
        return compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
@@ -315,7 +321,7 @@ QStringList texFileList(QString const & filename)
                return list;
 
        // FIXME Unicode.
-       vector<docstring> doclist = 
+       vector<docstring> doclist =
                getVectorFromString(file.fileContents("UTF-8"), from_ascii("\n"));
 
        // Normalise paths like /foo//bar ==> /foo/bar
@@ -349,7 +355,7 @@ QString const externalLineEnding(docstring const & str)
 
 docstring const internalLineEnding(QString const & str)
 {
-       docstring const s = subst(qstring_to_ucs4(str), 
+       docstring const s = subst(qstring_to_ucs4(str),
                                  from_ascii("\r\n"), from_ascii("\n"));
        return subst(s, '\r', '\n');
 }
@@ -548,7 +554,7 @@ FileFilterList::FileFilterList(docstring const & qt_style_filter)
        string const filter = to_utf8(qt_style_filter)
                + (qt_style_filter.empty() ? string() : ";;")
                + to_utf8(_("All Files "))
-#if defined(_WIN32)            
+#if defined(_WIN32)
                + ("(*.*)");
 #else
                + ("(*)");
@@ -639,6 +645,7 @@ QString formatToolTip(QString text, int em)
        QTextDocument td("");
        td.setHtml(text);
        td.setDefaultFont(QToolTip::font());
+       td.setDocumentMargin(0);
        td.setTextWidth(px_width);
        double best_width = td.idealWidth();
        // Set the line wrapping with appropriate width