]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbranch.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / insetbranch.C
index ceadb3234668935adfe8ac2b4b6e9ee10087e0bf..21d77944c04a70afb9d52706dc37599d7379b633 100644 (file)
@@ -26,6 +26,9 @@
 
 #include <sstream>
 
+
+namespace lyx {
+
 using std::string;
 using std::auto_ptr;
 using std::istringstream;
@@ -35,7 +38,7 @@ using std::ostringstream;
 
 void InsetBranch::init()
 {
-       setInsetName("Branch");
+       setInsetName(from_utf8("Branch"));
        setButtonLabel();
 }
 
@@ -67,7 +70,7 @@ auto_ptr<InsetBase> InsetBranch::doClone() const
 }
 
 
-string const InsetBranch::editMessage() const
+docstring const InsetBranch::editMessage() const
 {
        return _("Opened Branch Inset");
 }
@@ -94,10 +97,11 @@ void InsetBranch::setButtonLabel()
        font.decSize();
        font.decSize();
 
-       string s = _("Branch: ") + params_.branch;
+       docstring s = _("Branch: ") + params_.branch;
        font.setColor(LColor::foreground);
        if (!params_.branch.empty()) {
-               LColor_color c = lcolor.getFromLyXName(params_.branch);
+               // FIXME UNICODE
+               LColor_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
                if (c == LColor::none) {
                        c = LColor::error;
                        s = _("Undef: ") + s;
@@ -122,7 +126,7 @@ void InsetBranch::doDispatch(LCursor & cur, FuncRequest & cmd)
        switch (cmd.action) {
        case LFUN_INSET_MODIFY: {
                InsetBranchParams params;
-               InsetBranchMailer::string2params(lyx::to_utf8(cmd.argument()), params);
+               InsetBranchMailer::string2params(to_utf8(cmd.argument()), params);
                params_.branch = params.branch;
                setButtonLabel();
                break;
@@ -217,7 +221,7 @@ bool InsetBranch::isBranchSelected(Buffer const & buffer) const
 }
 
 
-int InsetBranch::latex(Buffer const & buf, ostream & os,
+int InsetBranch::latex(Buffer const & buf, odocstream & os,
                       OutputParams const & runparams) const
 {
        return isBranchSelected(buf) ?
@@ -225,7 +229,7 @@ int InsetBranch::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetBranch::docbook(Buffer const & buf, std::ostream & os,
+int InsetBranch::docbook(Buffer const & buf, odocstream & os,
                         OutputParams const & runparams) const
 {
        return isBranchSelected(buf) ?
@@ -233,7 +237,7 @@ int InsetBranch::docbook(Buffer const & buf, std::ostream & os,
 }
 
 
-int InsetBranch::plaintext(Buffer const & buf, std::ostream & os,
+int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
                           OutputParams const & runparams) const
 {
        return isBranchSelected(buf) ?
@@ -299,7 +303,7 @@ void InsetBranchMailer::string2params(string const & in,
 
 void InsetBranchParams::write(ostream & os) const
 {
-       os << "Branch " << branch << '\n';
+       os << "Branch " << to_utf8(branch) << '\n';
 }
 
 
@@ -307,3 +311,5 @@ void InsetBranchParams::read(LyXLex & lex)
 {
        lex >> branch;
 }
+
+} // namespace lyx