X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbranch.C;h=d39d69c718adfa5716e679c9fdecbfba235e1e53;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=ef9875585d28d09c8b3b55339e2f94a3b57ce0b6;hpb=0d449056ef9ace3ef737e4b9aba8d3994615dc18;p=lyx.git diff --git a/src/insets/insetbranch.C b/src/insets/insetbranch.C index ef9875585d..d39d69c718 100644 --- a/src/insets/insetbranch.C +++ b/src/insets/insetbranch.C @@ -26,8 +26,8 @@ #include -using lyx::docstring; -using lyx::odocstream; + +namespace lyx { using std::string; using std::auto_ptr; @@ -38,7 +38,7 @@ using std::ostringstream; void InsetBranch::init() { - setInsetName("Branch"); + setInsetName(from_utf8("Branch")); setButtonLabel(); } @@ -97,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; @@ -126,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; @@ -245,6 +245,13 @@ int InsetBranch::plaintext(Buffer const & buf, odocstream & 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); @@ -303,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'; } @@ -311,3 +318,5 @@ void InsetBranchParams::read(LyXLex & lex) { lex >> branch; } + +} // namespace lyx