#include "support/convert.h"
#include "support/lassert.h"
+#include "support/lyxlib.h"
#include <QByteArray>
tl.beginLayout();
QTextLine line = tl.createLine();
tl.endLayout();
- w = int(line.naturalTextWidth());
+#if QT_VERSION >= 0x040700
+ w = iround(line.horizontalAdvance());
+#else
+ w = iround(line.naturalTextWidth());
+#endif
}
strwidth_cache_.insert(s, w, s.size() * sizeof(char_type));
return w;
line.setLineWidth(x);
tl.createLine();
tl.endLayout();
- if ((force && line.textLength() == offset) || int(line.naturalTextWidth()) > x)
+#if QT_VERSION >= 0x040700
+ int const line_wid = iround(line.horizontalAdvance());
+#else
+ int const line_wid = iround(line.naturalTextWidth());
+#endif
+ if ((force && line.textLength() == offset) || line_wid > x)
return make_pair(-1, -1);
/* Since QString is UTF-16 and docstring is UCS-4, the offsets may
* not be the same when there are high-plan unicode characters
--len;
LASSERT(len > 0 || qlen == 0, /**/);
#endif
- // The -1 is here to account for the leading zerow_nbsp.
- return make_pair(len, int(line.naturalTextWidth()));
+ return make_pair(len, line_wid);
}
- Fix crash when closing master document with dirty child while Document
Settings dialog is open (bug 9979).
-
+
- Fix random crash when dissolving inset (bug 10667).
- Fix potential crash when cursor enters an inset (bug 10691).
- Fix hole in selection for some zoom and justification values (bug
8883).
+- Fix some rare cases of bad on-screen line breaking (bug #10700).
+
- Fix cursor state after double/triple click in mathed (bug #10686).
- Avoid a case of stuck cursor after entering an inset (bug 10630).