]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcite.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetcite.C
index 9e0ce61d95eee99c2e39e91fbbcc5ca36fa17011..e7437b480436623e10b3a651da53316a9ba576fe 100644 (file)
@@ -23,6 +23,8 @@
 
 #include <map>
 
+using namespace lyx::support;
+
 using std::ostream;
 using std::vector;
 using std::map;
@@ -331,7 +333,7 @@ dispatch_result InsetCitation::localDispatch(FuncRequest const & cmd)
                // buffer but doing some real work.
                setLoadingBuffer(cmd.view()->buffer(), false);
                InsetCommandMailer("citation", *this).showDialog(cmd.view());
-               break;
+               return DISPATCHED;
 
        default:
                return InsetCommand::localDispatch(cmd);
@@ -341,14 +343,10 @@ dispatch_result InsetCitation::localDispatch(FuncRequest const & cmd)
 
 int InsetCitation::ascii(Buffer const * buffer, ostream & os, int) const
 {
-       string label;
-
        if (cache.params == params() && cache.style == getStyle(buffer))
-               label = cache.generated_label;
+               os << cache.generated_label;
        else
-               label = generateLabel(buffer);
-
-       os << label;
+               os << generateLabel(buffer);
        return 0;
 }