]> git.lyx.org Git - lyx.git/commitdiff
Don't use an uninitialized variable
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 19 Feb 2007 12:38:31 +0000 (12:38 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 19 Feb 2007 12:38:31 +0000 (12:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17255 a592a061-630c-0410-9148-cb99ea01b6c8

src/buffer_funcs.C

index d1b0e76b56fe8f37e86083d04e1939e0f91197cb..5f1b6259b760f567697c1606f2239aa9d3ee9153 100644 (file)
@@ -550,7 +550,7 @@ void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textcla
        } else if (layout->labeltype == LABEL_SENSITIVE) {
                // Search for the first float or wrap inset in the iterator
                size_t i = it.depth();
-               InsetBase * in;
+               InsetBase * in = 0;
                while (i > 0) {
                        --i;
                        in = &it[i].inset();
@@ -558,7 +558,9 @@ void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textcla
                            || in->lyxCode() == InsetBase::WRAP_CODE)
                                break;
                }
-               docstring const & type = in->getInsetName();
+               docstring type;
+               if (in)
+                       type = in->getInsetName();
 
                if (!type.empty()) {
                        Floating const & fl = textclass.floats().getType(to_ascii(type));