Commit cf3b8a94 authored by Enrico Ros's avatar Enrico Ros

Misc updates.

svn path=/branches/kpdf_experiments/kdegraphics/kpdf/; revision=346097
parent 73303907
......@@ -222,7 +222,27 @@ void KPDFDocument::slotFind( bool /*nextMatch*/, const QString & /*text*/ )
kdDebug() << "found at " << pg << endl;
goToPage(pg);
// xpdf says: can happen that we do not find the text if coalescing is bad OUCH
m_outputDev->find(u, len, false);
//FIXME Enrico: expanded "m_outputDev(the widget)->find(u, len, false);" above:
bool PageWidget::find( Unicode * u, int len, bool next )
{return false; TODO !!restore!! Enrico
bool b;
if (!next)
{
// ensure we are searching the whole page
m_xMin = 0;
m_yMin = 0;
}
b = m_outputdev(a QOut..) -> find(u, len, !next, true, next, false, &m_xMin, &m_yMin, &m_xMax, &m_yMax);
m_xMin = m_xMin / m_zoomFactor;
m_yMin = m_yMin / m_zoomFactor;
m_xMax = m_xMax / m_zoomFactor;
m_yMax = m_yMax / m_zoomFactor;
m_selection = b;
updateContents();
return b;
}
// expanded ends here
}
else
{
......
......@@ -45,7 +45,7 @@ public:
class KPDFDocument : public QObject
{
Q_OBJECT
public:
KPDFDocument();
~KPDFDocument();
......
......@@ -33,12 +33,12 @@ class LinkAction;
class LinkDest;
class ThumbnailList;
class PageWidget;
class KPDFDocument;
namespace KPDF
{
class BrowserExtension;
class PageWidget;
/**
* This is a "Part". It that does all the real work in a KPart
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kpdf_part" version="13">
<kpartgui name="kpdf_part" version="14">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
<Action name="save" group="file_save"/>
......@@ -31,9 +31,11 @@
</Menu>
</MenuBar>
<ToolBar name="mainToolBar">
<Separator/>
<Action name="zoom_in"/>
<Action name="zoomTo" />
<Action name="zoom_out"/>
<Action name="fit_to_width"/>
<Separator/>
<Action name="previous_page"/>
<Action name="next_page"/>
......
......@@ -43,17 +43,29 @@ KPDFPage::~KPDFPage()
//BEGIN drawing functions
// drawing functions draw the pixmap directly if it has the right size, or
// else set a scale matrix to the painter and paint a quick 'zoomed' pixmap
//TODO drawing: if !pix but thumb still draw pix scaling thumb and vice-versa.
void KPDFPage::drawPixmap( QPainter * p, const QRect & limits, int width, int height ) const
{
if ( m_pixmap )
{
//if ( m_pixmap->width() == width && m_pixmap->height() == height )
if ( m_pixmap->width() == width && m_pixmap->height() == height )
p->drawPixmap( limits.topLeft(), *m_pixmap, limits );
//else
//{
// p->scale( width / (double)m_pixmap->width(), height / (double)m_pixmap->height() );
// p->drawPixmap( 0,0, *m_pixmap, 0,0, m_pixmap->width(), m_pixmap->height() );
//}
else
{
p->scale( width / (double)m_pixmap->width(), height / (double)m_pixmap->height() );
p->drawPixmap( 0,0, *m_pixmap, 0,0, m_pixmap->width(), m_pixmap->height() );
p->setPen( Qt::black );
p->drawLine( 0, 0, 20, 0 );
p->drawLine( 20, 0, 0, 20 );
p->drawLine( 0, 20, 0, 0 );
}
// draw selection (FIXME Enrico: move selection stuff inside PAGE!!)
/*if ( there is something to hilght )
p->setBrush(Qt::SolidPattern);
p->setPen(QPen(Qt::black, 1)); // should not be necessary bug a Qt bug makes it necessary
p->setRasterOp(Qt::NotROP);
p->drawRect(qRound(m_xMin*m_zoomFactor), qRound(m_yMin*m_zoomFactor), qRound((m_xMax- m_xMin)*m_zoomFactor), qRound((m_yMax- m_yMin)*m_zoomFactor));
*/
}
else
p->fillRect( limits, Qt::white /*FIXME change to the page bg color*/ );
......
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