X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbranch.C;h=d39d69c718adfa5716e679c9fdecbfba235e1e53;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=0948e52f08037ab8bef3fa5aa54e3b08a20a05f2;hpb=055b0390dc83fe1989f4fcc549f83172f3d78b68;p=lyx.git diff --git a/src/insets/insetbranch.C b/src/insets/insetbranch.C index 0948e52f08..d39d69c718 100644 --- a/src/insets/insetbranch.C +++ b/src/insets/insetbranch.C @@ -26,7 +26,8 @@ #include -using lyx::docstring; + +namespace lyx { using std::string; using std::auto_ptr; @@ -37,7 +38,7 @@ using std::ostringstream; void InsetBranch::init() { - setInsetName("Branch"); + setInsetName(from_utf8("Branch")); setButtonLabel(); } @@ -96,11 +97,11 @@ void InsetBranch::setButtonLabel() font.decSize(); font.decSize(); - // FIXME UNICODE - docstring s = _("Branch: ") + lyx::from_utf8(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; @@ -125,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; @@ -220,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) ? @@ -228,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) ? @@ -236,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) ? @@ -244,6 +245,13 @@ int InsetBranch::plaintext(Buffer const & buf, std::ostream & os, } +void InsetBranch::textString(Buffer const & buf, odocstream & os) const +{ + if (isBranchSelected(buf)) + os << paragraphs().begin()->asString(buf, true); +} + + void InsetBranch::validate(LaTeXFeatures & features) const { InsetText::validate(features); @@ -302,7 +310,7 @@ void InsetBranchMailer::string2params(string const & in, void InsetBranchParams::write(ostream & os) const { - os << "Branch " << branch << '\n'; + os << "Branch " << to_utf8(branch) << '\n'; } @@ -310,3 +318,5 @@ void InsetBranchParams::read(LyXLex & lex) { lex >> branch; } + +} // namespace lyx