if (layout->margintype == MARGIN_MANUAL) {
if (par.params().labelWidthString().empty())
- // FIXME UNICODE
- par.setLabelWidthString(lyx::from_ascii(layout->labelstring()));
+ par.setLabelWidthString(layout->labelstring());
} else {
par.setLabelWidthString(docstring());
}
if (layout->toclevel <= buf.params().secnumdepth
&& (layout->latextype != LATEX_ENVIRONMENT
|| isFirstInSequence(it.pit(), it.plist()))) {
- // FIXME UNICODE
- counters.step(lyx::from_ascii(layout->counter));
+ counters.step(layout->counter);
docstring label = expandLabel(buf, layout,
par.params().appendix());
par.params().labelString(label);
int number = counters.value(lyx::from_ascii("bibitem"));
if (par.bibitem())
par.bibitem()->setCounter(number);
- par.params().labelString(buf.B_(layout->labelstring()));
+ // FIXME UNICODE
+ par.params().labelString(buf.B_(lyx::to_ascii(layout->labelstring())));
// In biblio should't be following counters but...
} else if (layout->labeltype == LABEL_SENSITIVE) {
// Search for the first float or wrap inset in the iterator
s = bformat(_("%1$s #:"), buf.B_(fl.name()));
} else {
// par->SetLayout(0);
- s = buf.B_(layout->labelstring());
+ // FIXME UNICODE
+ s = buf.B_(lyx::to_ascii(layout->labelstring()));
}
par.params().labelString(s);
} else if (layout->labeltype == LABEL_NO_LABEL)
par.params().labelString(docstring());
else
- par.params().labelString(buf.B_(layout->labelstring()));
+ // FIXME UNICODE
+ par.params().labelString(buf.B_(lyx::to_ascii(layout->labelstring())));
}
} // anon namespace
{
LyXTextClass const & tclass = buf.params().getLyXTextClass();
- docstring fmt = buf.B_(appendix ? layout->labelstring_appendix()
- : layout->labelstring());
+ // FIXME UNICODE
+ docstring fmt = buf.B_(lyx::to_ascii(appendix ? layout->labelstring_appendix()
+ : layout->labelstring()));
// handle 'inherited level parts' in 'fmt',
// i.e. the stuff between '@' in '@Section@.\arabic{subsection}'
case LT_LABELSTRING: // label string definition
if (lexrc.next())
- labelstring_ = trim(lexrc.getString());
+ labelstring_ = lyx::from_ascii(trim(lexrc.getString()));
break;
case LT_ENDLABELSTRING: // endlabel string definition
if (lexrc.next())
- endlabelstring_ = trim(lexrc.getString());
+ endlabelstring_ = lyx::from_ascii(trim(lexrc.getString()));
break;
case LT_LABELSTRING_APPENDIX: // label string appendix definition
if (lexrc.next())
- labelstring_appendix_ = trim(lexrc.getString());
+ labelstring_appendix_ = lyx::from_ascii(trim(lexrc.getString()));
break;
case LT_LABELCOUNTER: // name of counter to use
if (lexrc.next())
- counter = trim(lexrc.getString());
+ counter = lyx::from_ascii(trim(lexrc.getString()));
break;
case LT_FREE_SPACING: // Allow for free spacing.
#include "lyxfont.h"
#include "layout.h"
#include "Spacing.h"
+#include "support/docstring.h"
#include <string>
///
std::string const & latexname() const { return latexname_; }
///
- std::string const & labelstring() const { return labelstring_; }
+ lyx::docstring const & labelstring() const { return labelstring_; }
///
- std::string const & endlabelstring() const { return endlabelstring_; }
+ lyx::docstring const & endlabelstring() const { return endlabelstring_; }
///
std::string const & preamble() const { return preamble_; }
///
///
std::string const & itemtag() const { return itemtag_; }
///
- std::string const & labelstring_appendix() const {
+ lyx::docstring const & labelstring_appendix() const {
return labelstring_appendix_;
}
/** Default font for this layout/environment.
/// Does this layout allow for an optional parameter?
int optionalargs;
/// Which counter to step
- std::string counter;
+ lyx::docstring counter;
/// Depth of XML command
int commanddepth;
/// LaTeX name for environment
std::string latexname_;
/// Label string. "Abstract", "Reference", "Caption"...
- std::string labelstring_;
+ lyx::docstring labelstring_;
///
- std::string endlabelstring_;
+ lyx::docstring endlabelstring_;
/// Label string inside appendix. "Appendix", ...
- std::string labelstring_appendix_;
+ lyx::docstring labelstring_appendix_;
/// LaTeX parameter for environment
std::string latexparam_;
/// Internal tag to use (e.g., <title></title> for sect header)
lexrc.pushTable(counterTags, CT_END);
- string name;
- string within;
+ docstring name;
+ docstring within;
bool getout = false;
while (!getout && lexrc.isOK()) {
switch (static_cast<CounterTags>(le)) {
case CT_NAME:
lexrc.next();
- name = lexrc.getString();
+ name = lyx::from_ascii(lexrc.getString());
break;
case CT_WITHIN:
lexrc.next();
- within = lexrc.getString();
- if (within == "none")
+ within = lyx::from_ascii(lexrc.getString());
+ if (within == lyx::from_ascii("none"))
within.erase();
break;
case CT_END:
// Here if have a full counter if getout == true
if (getout) {
- // FIXME UNICODE
if (within.empty()) {
- ctrs_->newCounter(lyx::from_ascii(name));
+ ctrs_->newCounter(name);
} else {
- ctrs_->newCounter(lyx::from_ascii(name),
- lyx::from_ascii(within));
+ ctrs_->newCounter(name, within);
}
}
LyXLayout_ptr const & operator[](std::string const & vname) const;
/// Sees to that the textclass structure has been loaded
- bool load(std::string const & path=std::string()) const;
+ bool load(std::string const & path = std::string()) const;
/// Has this layout file been loaded yet?
bool loaded() const { return loaded_; }
}
-bool Paragraph::Pimpl::erase(pos_type pos, bool trackChanges)
+bool Paragraph::Pimpl::erase(pos_type pos, bool /*trackChanges*/)
{
// FIXME: change tracking (MG)
BOOST_ASSERT(pos <= size());
case END_LABEL_STATIC: {
LyXFont font = getLabelFont();
FontMetrics const & fm = theFontMetrics(font);
- // FIXME UNICODE
- docstring const & str = lyx::from_utf8(par_.layout()->endlabelstring());
+ docstring const & str = par_.layout()->endlabelstring();
double const x = is_rtl ?
x_ - fm.width(str)
: - text_.rightMargin(par_) - row_.width();
if (param.find('#') != string::npos) {
// FIXME UNICODE
if(!style->counter.empty())
- counters.step(lyx::from_ascii(style->counter));
+ counters.step(style->counter);
else
- counters.step(lyx::from_ascii(style->latexname()));
+ counters.step(lyx::from_ascii(name));
int i = counters.value(lyx::from_ascii(name));
attribute = subst(param, "#", convert<string>(i));
} else {
for (pit_type pit = start; pit != end; ++pit) {
pars_[pit].applyLayout(lyxlayout);
if (lyxlayout->margintype == MARGIN_MANUAL)
- // FIXME UNICODE
- pars_[pit].setLabelWidthString(lyx::from_ascii(lyxlayout->labelstring()));
+ pars_[pit].setLabelWidthString(lyxlayout->labelstring());
}
}