Commit 178bab06 authored by Albert Astals Cid's avatar Albert Astals Cid

core builds

svn path=/branches/work/kde4/playground/graphics/okular/; revision=521179
parent b2f5f335
......@@ -108,13 +108,13 @@ struct HighlightRect : public NormalizedRect
*/
template <class NormalizedShape, class Shape> class RegularArea :
public QList<NormalizedShape*>
public QList<NormalizedShape>
{
public:
bool contains( double x, double y ) const;
bool contains( NormalizedShape * ) const;
bool contains( NormalizedShape ) const;
bool intersects (const RegularArea<NormalizedShape,Shape> * area) const;
bool intersects (const NormalizedShape * shape) const;
bool intersects (const NormalizedShape shape) const;
void appendArea (const RegularArea<NormalizedShape,Shape> *area);
void simplify ();
bool isNull() const;
......@@ -125,7 +125,7 @@ template <class NormalizedShape, class Shape>
void RegularArea<NormalizedShape, Shape>::simplify()
{
int end=this->count(),i=0,x=0;
QList <NormalizedShape*> m_remove;
QList <NormalizedShape> m_remove;
for (;i<end;i++)
{
if ( i < (end-1) )
......@@ -158,7 +158,7 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
if (this->isEmpty())
return false;
foreach(const NormalizedShape *ns, this)
foreach(const NormalizedShape ns, *this)
if (!(ns->isNull()))
return false;
return true;
......@@ -166,7 +166,7 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
}
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::intersects (const NormalizedShape *rect) const
bool RegularArea<NormalizedShape, Shape>::intersects (const NormalizedShape rect) const
{
if (!this)
return false;
......@@ -174,7 +174,7 @@ bool RegularArea<NormalizedShape, Shape>::intersects (const NormalizedShape *rec
if (this->isEmpty())
return false;
foreach(const NormalizedShape *ns, this)
foreach(const NormalizedShape ns, *this)
{
if(!(ns->isNull()) && ns->intersects (rect))
return true;
......@@ -233,7 +233,7 @@ bool RegularArea<NormalizedShape, Shape>::contains (double x, double y) const
}
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::contains (NormalizedShape * shape) const
bool RegularArea<NormalizedShape, Shape>::contains (NormalizedShape shape) const
{
if (!this)
return false;
......@@ -265,7 +265,7 @@ RegularArea<NormalizedShape, Shape>::geometry( int xScale, int yScale, int dx, i
return ret;
}
typedef RegularArea<NormalizedRect,QRect> RegularAreaRect;
typedef RegularArea<NormalizedRect*,QRect> RegularAreaRect;
class HighlightAreaRect : public RegularAreaRect {
......
......@@ -23,7 +23,7 @@
#include <klocale.h>
#include <kfinddialog.h>
#include <kmessagebox.h>
#include <kapplication.h>
#include <ktoolinvocation.h>
#include <kuserprofile.h>
#include <krun.h>
#include <kstandarddirs.h>
......@@ -697,7 +697,7 @@ void KPDFDocument::setViewport( const DocumentViewport & viewport, int excludeId
d->viewportHistory.pop_front();
// add the item at the end of the queue
d->viewportIterator = d->viewportHistory.append( viewport );
d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(), viewport );
}
// notify change to all other (different from id) observers
......@@ -1190,7 +1190,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
const KPDFLinkBrowse * browse = static_cast< const KPDFLinkBrowse * >( link );
// if the url is a mailto one, invoke mailer
if ( browse->url().startsWith( "mailto:", false ) )
kapp->invokeMailer( browse->url() );
KToolInvocation::invokeMailer( browse->url() );
else
{
QString url = browse->url();
......@@ -1306,7 +1306,7 @@ void KPDFDocument::sendGeneratorRequest()
if ( generator->canGeneratePixmap( request->async ) )
{
kWarning() << "sending request id=" << request->id << " " <<request->width << "x" << request->height << "@" << request->pageNumber << " async == " << request->async << endl;
d->pixmapRequestsStack.remove ( request );
d->pixmapRequestsStack.removeAll ( request );
generator->generatePixmap ( request );
}
else
......@@ -1499,14 +1499,14 @@ void KPDFDocument::loadDocumentInfo()
if ( historyElement.hasAttribute( "viewport" ) )
{
QString vpString = historyElement.attribute( "viewport" );
d->viewportIterator = d->viewportHistory.append(
d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(),
DocumentViewport( vpString ) );
}
historyNode = historyNode.nextSibling();
}
// consistancy check
if ( d->viewportHistory.isEmpty() )
d->viewportIterator = d->viewportHistory.append( DocumentViewport() );
d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(), DocumentViewport() );
}
infoNode = infoNode.nextSibling();
}
......
#include <QTextStream>
#include "generator.h"
std::ostream& operator<< (std::ostream& str, const PixmapRequest *req)
QTextStream& operator<< (QTextStream& str, const PixmapRequest *req)
{
QString s("");
if (req->async)
......
......@@ -165,6 +165,6 @@ struct PixmapRequest
};
std::ostream& operator<< (std::ostream& str, const PixmapRequest *req);
QTextStream& operator<< (QTextStream& str, const PixmapRequest *req);
#endif
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