#include "lyxfind.h"
#include "support/lyxtime.h"
+using lyx::docstring;
+
using std::string;
namespace lyx {
}
-string const ControlChanges::getChangeDate()
+docstring const ControlChanges::getChangeDate()
{
Change c(kernel().bufferview()->getCurrentChange());
if (c.type == Change::UNCHANGED || !c.changetime)
- return string();
+ return docstring();
- return formatted_time(c.changetime);
+ // FIXME UNICODE
+ return lyx::from_utf8(formatted_time(c.changetime));
}
-string const ControlChanges::getChangeAuthor()
+docstring const ControlChanges::getChangeAuthor()
{
Change c(kernel().bufferview()->getCurrentChange());
if (c.type == Change::UNCHANGED)
- return string();
+ return docstring();
Author const & a(kernel().buffer().params().authors().get(c.author));
- string author(a.name());
+ // FIXME UNICODE in Author class
+ docstring author(lyx::from_utf8(a.name()));
if (!a.email().empty()) {
author += " (";
- author += a.email() + ")";
+ author += lyx::from_utf8(a.email());
+ author += ")";
}
return author;
#include "Dialog.h"
+#include "support/docstring.h"
+
namespace lyx {
namespace frontend {
bool changed();
/// return date of change
- std::string const getChangeDate();
+ lyx::docstring const getChangeDate();
/// return author of change
- std::string const getChangeAuthor();
+ lyx::docstring const getChangeAuthor();
/// accept the current merge
bool accept();
void GChanges::promptChange()
{
- string const header = lyx::to_utf8(_("Accept highlighted change?"));
- string author = controller().getChangeAuthor();
- string date = controller().getChangeDate();
+ docstring const header = _("Accept highlighted change?");
+ docstring author = controller().getChangeAuthor();
+ docstring date = controller().getChangeDate();
if(author.empty())
- author = lyx::to_utf8(_("unknown author"));
+ author = _("unknown author");
if(date.empty())
- date = lyx::to_utf8(_("unknown date"));
+ date = _("unknown date");
- messagelabel_->set_markup("<big><b>" + header +
- "</b></big>\n\nChanged by <b>" + author
- + "</b> on <b>" + date + "</b>");
+ // FIXME UNICODE in set_markup():
+ messagelabel_->set_markup("<big><b>" + lyx::to_utf8(header) +
+ "</b></big>\n\nChanged by <b>" + lyx::to_utf8(author)
+ + "</b> on <b>" + lyx::to_utf8(date) + "</b>");
acceptbutton_->set_sensitive(true && !readOnly());
rejectbutton_->set_sensitive(true && !readOnly());
void QChanges::update_contents()
{
docstring text;
- docstring author = lyx::from_utf8(controller().getChangeAuthor());
- docstring date = lyx::from_utf8(controller().getChangeDate());
+ docstring author = controller().getChangeAuthor();
+ docstring date = controller().getChangeDate();
if (!author.empty())
text += bformat(_("Change by %1$s\n\n"), author);
controller().find();
docstring text;
- docstring author = lyx::from_utf8(controller().getChangeAuthor());
- docstring date = lyx::from_utf8(controller().getChangeDate());
+ docstring author = controller().getChangeAuthor();
+ docstring date = controller().getChangeDate();
if (!author.empty())
text += bformat(_("Change by %1$s\n\n"), author);
}
-void QLPainter::text(int x, int y, docstring const & s, LyXFont const & f)
+int QLPainter::text(int x, int y, docstring const & s, LyXFont const & f)
{
return text(x, y, reinterpret_cast<char_type const *>(s.data()), s.length(), f);
}
-void QLPainter::text(int x, int y, char_type c, LyXFont const & f)
+int QLPainter::text(int x, int y, char_type c, LyXFont const & f)
{
char_type s[2] = { c, char_type('\0') };
return text(x, y, s, 1, f);
}
-void QLPainter::text(int x, int y, char_type const * s, size_t ls,
+int QLPainter::text(int x, int y, char_type const * s, size_t ls,
LyXFont const & f)
{
#if 0
underline(f, x, y, textwidth);
}
+ return textwidth;
}
lyx::graphics::Image const & image);
/// draw a string at position x, y (y is the baseline)
- virtual void text(int x, int y,
+ virtual int text(int x, int y,
lyx::docstring const & str, LyXFont const & f);
/** Draw a string at position x, y (y is the baseline)
* This is just for fast drawing
*/
- virtual void text(int x, int y,
+ virtual int text(int x, int y,
lyx::char_type const * str, size_t l,
LyXFont const & f);
/// draw a char at position x, y (y is the baseline)
- virtual void text(int x, int y,
+ virtual int text(int x, int y,
lyx::char_type c, LyXFont const & f);
/// draw a pixmap from the image cache