16 files changed:
break;
case LFUN_FONT_STATE:
break;
case LFUN_FONT_STATE:
- cur.message(from_utf8(cur.currentState()));
+ cur.message(cur.currentState());
break;
case LFUN_BOOKMARK_SAVE:
break;
case LFUN_BOOKMARK_SAVE:
std::ostream & operator<<(std::ostream & os, Author const & a)
{
std::ostream & operator<<(std::ostream & os, Author const & a)
{
- os << "\"" << a.name() << "\" " << a.email();
+ // FIXME UNICODE
+ os << "\"" << to_utf8(a.name()) << "\" " << to_utf8(a.email());
{
string s;
getline(is, s);
{
string s;
getline(is, s);
- a.name_ = trim(token(s, '\"', 1));
- a.email_ = trim(token(s, '\"', 2));
+ // FIXME UNICODE
+ a.name_ = from_utf8(trim(token(s, '\"', 1)));
+ a.email_ = from_utf8(trim(token(s, '\"', 2)));
#ifndef AUTHOR_H
#define AUTHOR_H
#ifndef AUTHOR_H
#define AUTHOR_H
+#include "support/docstring.h"
+
#include <map>
#include <iosfwd>
#include <map>
#include <iosfwd>
- Author(std::string const & name, std::string const & email)
+ Author(docstring const & name, docstring const & email)
: name_(name), email_(email) {}
: name_(name), email_(email) {}
- std::string const name() const {
+ docstring const name() const {
- std::string const email() const {
+ docstring const email() const {
- friend std::istream & operator>>(std::istream & os, Author & a);
+ friend std::istream & operator>>(std::istream & os, Author & a);
-void BufferList::setCurrentAuthor(string const & name, string const & email)
+void BufferList::setCurrentAuthor(docstring const & name, docstring const & email)
{
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
{
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
#ifndef BUFFER_LIST_H
#define BUFFER_LIST_H
#ifndef BUFFER_LIST_H
#define BUFFER_LIST_H
+#include "support/docstring.h"
+
#include <boost/utility.hpp>
#include <boost/utility.hpp>
Buffer * previous(Buffer const *) const;
/// reset current author for all buffers
Buffer * previous(Buffer const *) const;
/// reset current author for all buffers
- void setCurrentAuthor(std::string const & name, std::string const & email);
+ void setCurrentAuthor(docstring const & name, docstring const & email);
private:
/// ask to save a buffer on quit, returns false if should cancel
private:
/// ask to save a buffer on quit, returns false if should cancel
: defskip(VSpace::MEDSKIP)
{
// set initial author
: defskip(VSpace::MEDSKIP)
{
// set initial author
- authorlist.record(Author(lyxrc.user_name, lyxrc.user_email));
+ // FIXME UNICODE
+ authorlist.record(Author(from_utf8(lyxrc.user_name), from_utf8(lyxrc.user_email)));
-string LCursor::currentState()
+docstring LCursor::currentState()
{
if (inMathed()) {
odocstringstream os;
info(os);
{
if (inMathed()) {
odocstringstream os;
info(os);
- return to_utf8(os.str());
}
if (inTexted())
return text()->currentState(*this);
}
if (inTexted())
return text()->currentState(*this);
//
docstring selectionAsString(bool label) const;
///
//
docstring selectionAsString(bool label) const;
///
- std::string currentState();
+ docstring currentState();
/// auto-correct mode
bool autocorrect() const { return autocorrect_; }
/// auto-correct mode
bool autocorrect() const { return autocorrect_; }
Author const & a(kernel().buffer().params().authors().get(c.author));
Author const & a(kernel().buffer().params().authors().get(c.author));
- // FIXME UNICODE in Author class
- docstring author(from_utf8(a.name()));
+ docstring author(a.name());
if (!a.email().empty()) {
author += " (";
if (!a.email().empty()) {
author += " (";
- author += from_utf8(a.email());
-string const ControlCommandBuffer::getCurrentState() const
+docstring const ControlCommandBuffer::getCurrentState() const
{
return lv_.view()->cursor().currentState();
}
{
return lv_.view()->cursor().currentState();
}
#ifndef CONTROLCOMMANDBUFFER_H
#define CONTROLCOMMANDBUFFER_H
#ifndef CONTROLCOMMANDBUFFER_H
#define CONTROLCOMMANDBUFFER_H
+#include "support/docstring.h"
+
std::string const historyDown();
/// return the font and depth in the active BufferView as a message.
std::string const historyDown();
/// return the font and depth in the active BufferView as a message.
- std::string const getCurrentState() const;
+ docstring const getCurrentState() const;
/// return the possible completions
std::vector<std::string> const completions(std::string const & prefix,
/// return the possible completions
std::vector<std::string> const completions(std::string const & prefix,
kernel().dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str()));
// FIXME: these need lfuns
kernel().dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str()));
// FIXME: these need lfuns
- theBufferList().setCurrentAuthor(rc_.user_name, rc_.user_email);
+ // FIXME UNICODE
+ theBufferList().setCurrentAuthor(from_utf8(rc_.user_name), from_utf8(rc_.user_email));
-string const LyXFunc::viewStatusMessage()
+docstring const LyXFunc::viewStatusMessage()
{
// When meta-fake key is pressed, show the key sequence so far + "M-".
if (wasMetaKey())
{
// When meta-fake key is pressed, show the key sequence so far + "M-".
if (wasMetaKey())
- return to_utf8(keyseq->print() + "M-");
+ return keyseq->print() + "M-";
// Else, when a non-complete key sequence is pressed,
// show the available options.
if (keyseq->length() > 0 && !keyseq->deleted())
// Else, when a non-complete key sequence is pressed,
// show the available options.
if (keyseq->length() > 0 && !keyseq->deleted())
- return to_utf8(keyseq->printOptions());
+ return keyseq->printOptions();
- return to_utf8(_("Welcome to LyX!"));
+ return _("Welcome to LyX!");
return view()->cursor().currentState();
}
return view()->cursor().currentState();
}
void initKeySequences(kb_keymap * kb);
/// return the status bar state string
void initKeySequences(kb_keymap * kb);
/// return the status bar state string
- std::string const viewStatusMessage();
+ docstring const viewStatusMessage();
///
void processKeySym(LyXKeySymPtr key, key_modifier::state state);
///
void processKeySym(LyXKeySymPtr key, key_modifier::state state);
/// read-write access to individual paragraph
Paragraph & getPar(pit_type pit) { return pars_[pit]; }
// Returns the current font and depth as a message.
/// read-write access to individual paragraph
Paragraph & getPar(pit_type pit) { return pars_[pit]; }
// Returns the current font and depth as a message.
- std::string currentState(LCursor & cur);
+ docstring currentState(LCursor & cur);
/** returns row near the specified
* y-coordinate in given paragraph (relative to the screen).
/** returns row near the specified
* y-coordinate in given paragraph (relative to the screen).
// Returns the current font and depth as a message.
// Returns the current font and depth as a message.
-string LyXText::currentState(LCursor & cur)
+docstring LyXText::currentState(LCursor & cur)
{
BOOST_ASSERT(this == cur.text());
Buffer & buf = cur.buffer();
Paragraph const & par = cur.paragraph();
{
BOOST_ASSERT(this == cur.text());
Buffer & buf = cur.buffer();
Paragraph const & par = cur.paragraph();
if (buf.params().trackChanges)
os << "[C] ";
if (buf.params().trackChanges)
os << "[C] ";
if (change.type != Change::UNCHANGED) {
Author const & a = buf.params().authors().get(change.author);
if (change.type != Change::UNCHANGED) {
Author const & a = buf.params().authors().get(change.author);
- os << to_utf8(_("Change: ")) << a.name();
+ os << _("Change: ") << a.name();
if (!a.email().empty())
os << " (" << a.email() << ")";
if (!a.email().empty())
os << " (" << a.email() << ")";
- os << to_utf8(_(" at ")) << ctime(&change.changetime);
+ // FIXME ctime is english, we should translate that
+ os << _(" at ") << ctime(&change.changetime);
LyXFont font = real_current_font;
font.reduce(buf.params().getFont());
LyXFont font = real_current_font;
font.reduce(buf.params().getFont());
- // avoid to_utf8(_(...)) re-entrance problem
- string const s = font.stateText(&buf.params());
- os << to_utf8(bformat(_("Font: %1$s"), from_utf8(s)));
-
- // os << to_utf8(bformat(_("Font: %1$s"), font.stateText(&buf.params)));
+ // FIXME UNICODE
+ os << bformat(_("Font: %1$s"), from_utf8(font.stateText(&buf.params())));
// The paragraph depth
int depth = cur.paragraph().getDepth();
if (depth > 0)
// The paragraph depth
int depth = cur.paragraph().getDepth();
if (depth > 0)
- os << to_utf8(bformat(_(", Depth: %1$d"), depth));
+ os << bformat(_(", Depth: %1$d"), depth);
// The paragraph spacing, but only if different from
// buffer spacing.
Spacing const & spacing = par.params().spacing();
if (!spacing.isDefault()) {
// The paragraph spacing, but only if different from
// buffer spacing.
Spacing const & spacing = par.params().spacing();
if (!spacing.isDefault()) {
- os << to_utf8(_(", Spacing: "));
+ os << _(", Spacing: ");
switch (spacing.getSpace()) {
case Spacing::Single:
switch (spacing.getSpace()) {
case Spacing::Single:
- os << to_utf8(_("Single"));
break;
case Spacing::Onehalf:
break;
case Spacing::Onehalf:
- os << to_utf8(_("OneHalf"));
break;
case Spacing::Double:
break;
case Spacing::Double:
- os << to_utf8(_("Double"));
break;
case Spacing::Other:
break;
case Spacing::Other:
- os << to_utf8(_("Other (")) << spacing.getValueAsString() << ')';
+ os << _("Other (") << from_ascii(spacing.getValueAsString()) << ')';
break;
case Spacing::Default:
// should never happen, do nothing
break;
case Spacing::Default:
// should never happen, do nothing
- os << to_utf8(_(", Inset: ")) << &cur.inset();
- os << to_utf8(_(", Paragraph: ")) << cur.pit();
- os << to_utf8(_(", Id: ")) << par.id();
- os << to_utf8(_(", Position: ")) << cur.pos();
- os << to_utf8(_(", Boundary: ")) << cur.boundary();
+ os << _(", Inset: ") << &cur.inset();
+ os << _(", Paragraph: ") << cur.pit();
+ os << _(", Id: ") << par.id();
+ os << _(", Position: ") << cur.pos();
+ os << _(", Boundary: ") << cur.boundary();
// Row & row = cur.textRow();
// os << bformat(_(", Row b:%1$d e:%2$d"), row.pos(), row.endpos());
#endif
// Row & row = cur.textRow();
// os << bformat(_(", Row b:%1$d e:%2$d"), row.pos(), row.endpos());
#endif