]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathHull.C
Fix command-line export
[lyx.git] / src / mathed / InsetMathHull.C
index 1a3a85fe51e9f570c7cf3c3b4bec41e6ff729e36..ac27c50a4802190f922fbafca1df87f16d29d000 100644 (file)
@@ -463,11 +463,12 @@ bool InsetMathHull::display() const
 }
 
 
-void InsetMathHull::getLabelList(Buffer const &, vector<string> & labels) const
+void InsetMathHull::getLabelList(Buffer const &, vector<docstring> & labels) const
 {
        for (row_type row = 0; row < nrows(); ++row)
                if (!label_[row].empty() && nonum_[row] != 1)
-                       labels.push_back(label_[row]);
+                       // FIXME UNICODE
+                       labels.push_back(lyx::from_utf8(label_[row]));
 }
 
 
@@ -1121,7 +1122,8 @@ void InsetMathHull::doDispatch(LCursor & cur, FuncRequest & cmd)
                                numbered(r, true);
                        string old = label(r);
                        if (str != old) {
-                               cur.bv().buffer()->changeRefsIfUnique(old, str);
+                               cur.bv().buffer()->changeRefsIfUnique(old, str,
+                                                       InsetBase::REF_CODE);
                                label(r, str);
                        }
                        break;
@@ -1274,7 +1276,7 @@ void InsetMathHull::mutateToText()
                view_->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
 
        // remove ourselves
-       //theApp->lyxFunc().dispatch(LFUN_ESCAPE);
+       //lyx::dispatch(LFUN_ESCAPE);
 #endif
 }
 
@@ -1424,7 +1426,7 @@ void InsetMathHull::read(Buffer const &, LyXLex & lex)
 }
 
 
-int InsetMathHull::plaintext(Buffer const &, ostream & os,
+int InsetMathHull::plaintext(Buffer const &, lyx::odocstream & os,
                        OutputParams const &) const
 {
        if (0 && display()) {
@@ -1438,8 +1440,11 @@ int InsetMathHull::plaintext(Buffer const &, ostream & os,
                //metrics();
                return tpain.textheight();
        } else {
-               WriteStream wi(os, false, true);
+               std::ostringstream oss;
+               WriteStream wi(oss, false, true);
                wi << cell(0);
+               // FIXME UNICODE
+               os << lyx::from_utf8(oss.str());
                return wi.line();
        }
 }
@@ -1497,7 +1502,7 @@ int InsetMathHull::docbook(Buffer const & buf, ostream & os,
 }
 
 
-int InsetMathHull::textString(Buffer const & buf, ostream & os,
+int InsetMathHull::textString(Buffer const & buf, lyx::odocstream & os,
                       OutputParams const & op) const
 {
        return plaintext(buf, os, op);