bool AP_Win32Dialog_Latex::getLatexFromGUI(void)
{
	char buffer[2048]; // TODO: FIXME: BAD BAD FIXED LENGTH
	UT_UTF8String sLatex;

	getControlText(AP_RID_DIALOG_LATEX_EDIT_LATEX, (LPSTR) buffer, 2048);
	sLatex = AP_Win32App::s_fromWinLocaleToUTF8(buffer);
	
	UT_DEBUGMSG(("LaTeX from widget is %s \n",sLatex.utf8_str()));
	setLatex(sLatex);
		
	return true;
}
Пример #2
0
KLFLibEntry::KLFLibEntry(const QString& latex, const QDateTime& dt, const QImage& preview,
			 const QSize& previewsize, const QString& category, const QString& tags,
			 const KLFStyle& style)
  : KLFPropertizedObject("KLFLibEntry")
{
  initRegisteredProperties();
  setLatex(latex);
  setDateTime(dt);
  setPreview(preview);
  setPreviewSize(previewsize);
  setCategory(category);
  setTags(tags);
  setStyle(style);
}
Пример #3
0
KLFLibEntry::KLFLibEntry(const QString& latex, const QDateTime& dt, const QImage& preview,
			 const KLFStyle& style)
  : KLFPropertizedObject("KLFLibEntry")
{
  initRegisteredProperties();
  QString latexonly = stripCategoryTagsFromLatex(latex);
  QString category = categoryFromLatex(latex);
  QString tags = tagsFromLatex(latex);
  QSize previewsize = preview.size();
  setLatex(latexonly);
  setDateTime(dt);
  setPreview(preview);
  setPreviewSize(previewsize);
  setCategory(category);
  setTags(tags);
  setStyle(style);
}
Пример #4
0
ResultItem* TextResultItem::updateFromResult(Cantor::Result* result)
{
    switch(result->type()) {
    case Cantor::TextResult::Type:
        {
            QTextCursor cursor = textCursor();
            cursor.movePosition(QTextCursor::Start);
            cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
            QString html = result->toHtml();
            if (html.isEmpty())
                cursor.removeSelectedText();
            else
                cursor.insertHtml(html);
            return this;
        }
    case Cantor::LatexResult::Type:
        setLatex(dynamic_cast<Cantor::LatexResult*>(result));
        return this;
    default:
        deleteLater();
        return create(parentEntry(), result);
    }
}