]> git.lyx.org Git - features.git/blobdiff - src/text.C
use more unicode in math
[features.git] / src / text.C
index e0bd609b05e2561aa793266d2e442826475cf750..8d1b5187acdadadedd3cb78e1627dfc2c06972ed 100644 (file)
@@ -2448,13 +2448,11 @@ string LyXText::getPossibleLabel(LCursor & cur) const
        // for captions, we want the abbreviation of the float type
        if (layout->labeltype == LABEL_SENSITIVE) {
                // Search for the first float or wrap inset in the iterator
-               size_t i = cur.depth();
-               while (i > 0) {
-                       --i;
+               for (int i = cur.depth(); --i >= 0; ) {
                        InsetBase * const in = &cur[i].inset();
                        if (in->lyxCode() == InsetBase::FLOAT_CODE
                            || in->lyxCode() == InsetBase::WRAP_CODE) {
-                               name = in->getInsetName();
+                               name = to_utf8(in->getInsetName());
                                break;
                        }
                }