Commit a1ebea03 authored by Albert Astals Cid's avatar Albert Astals Cid

Merge remote-tracking branch 'origin/KDE/4.14'

parents 0666e18f 93121820
......@@ -20,6 +20,7 @@
#include <kmimetype.h>
#include <QFile>
#include <QFontDatabase>
#include <QImage>
#include <QPainter>
......@@ -421,11 +422,17 @@ void dviRenderer::epsf_special(const QString& cp)
QFont f = foreGroundPainter->font();
f.setPointSize(8);
foreGroundPainter->setFont(f);
if (QFile::exists(EPSfilename))
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename);
else
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter),
i18n("File not found: \n %1", EPSfilename_orig));
/* if the fonts are mapped for some reason to X bitmap fonts,
the call to drawText() in the non-GUI thread will produce a crash.
Ensure that the rendering of the text is performed only if
the threaded font rendering is available */
if (QFontDatabase::supportsThreadedFontRendering()) {
if (QFile::exists(EPSfilename))
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename);
else
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter),
i18n("File not found: \n %1", EPSfilename_orig));
}
foreGroundPainter->restore();
}
......
......@@ -327,8 +327,8 @@ void AnnotWindow::slotOptionBtn()
void AnnotWindow::slotsaveWindowText()
{
QString contents = textEdit->toPlainText();
int cursorPos = textEdit->textCursor().position();
const QString contents = textEdit->toPlainText();
const int cursorPos = textEdit->textCursor().position();
if (contents != m_annot->contents())
{
m_document->editPageAnnotationContents( m_page, m_annot, contents, cursorPos, m_prevCursorPos, m_prevAnchorPos);
......@@ -344,6 +344,7 @@ void AnnotWindow::renderLatex( bool render )
{
textEdit->setReadOnly( true );
disconnect(textEdit, SIGNAL(textChanged()), this,SLOT(slotsaveWindowText()));
disconnect(textEdit, SIGNAL(cursorPositionChanged()), this,SLOT(slotsaveWindowText()));
textEdit->setAcceptRichText( true );
QString contents = m_annot->contents();
contents = Qt::convertFromPlainText( contents );
......@@ -384,6 +385,7 @@ void AnnotWindow::renderLatex( bool render )
textEdit->setAcceptRichText( false );
textEdit->setPlainText( m_annot->contents() );
connect(textEdit, SIGNAL(textChanged()), this,SLOT(slotsaveWindowText()));
connect(textEdit, SIGNAL(cursorPositionChanged()), this,SLOT(slotsaveWindowText()));
textEdit->setReadOnly( false );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment