]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCompleter.cpp
Remove special code for Qt5 to manage HiDPI. It's not needed anymore and leads to...
[lyx.git] / src / frontends / qt4 / GuiCompleter.cpp
index 7c3c2ff2c81ad83612ff32b21d6870a960df5854..0f974f1d97f9016dca9b6b1652a49d23f76ba7e5 100644 (file)
@@ -26,6 +26,7 @@
 #include "version.h"
 
 #include "support/lassert.h"
+#include "support/lstrings.h"
 #include "support/debug.h"
 
 #include <QApplication>
@@ -394,9 +395,9 @@ void GuiCompleter::updateInline(Cursor const & cur, QString const & completion)
        docstring postfix = qstring_to_ucs4(completion.mid(prefix.length()));
        
        // shorten it if necessary
-       if (lyxrc.completion_inline_dots != -1
-           && postfix.size() > unsigned(lyxrc.completion_inline_dots))
-               postfix = postfix.substr(0, lyxrc.completion_inline_dots - 1) + "...";
+       if (lyxrc.completion_inline_dots != -1)
+               support::truncateWithEllipsis(postfix,
+                                                                         unsigned(lyxrc.completion_inline_dots));
 
        // set inline completion at cursor position
        size_t uniqueTo = max(longestUniqueCompletion().size(), prefix.size());