core builds

svn path=/branches/work/kde4/playground/graphics/okular/; revision=521179
remotes/origin/old/work/newpageview
Albert Astals Cid 20 years ago
parent b2f5f33559
commit 178bab06cb
  1. 18
      core/area.h
  2. 12
      core/document.cpp
  3. 4
      core/generator.cpp
  4. 2
      core/generator.h

@ -108,13 +108,13 @@ struct HighlightRect : public NormalizedRect
*/ */
template <class NormalizedShape, class Shape> class RegularArea : template <class NormalizedShape, class Shape> class RegularArea :
public QList<NormalizedShape*> public QList<NormalizedShape>
{ {
public: public:
bool contains( double x, double y ) const; 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 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 appendArea (const RegularArea<NormalizedShape,Shape> *area);
void simplify (); void simplify ();
bool isNull() const; bool isNull() const;
@ -125,7 +125,7 @@ template <class NormalizedShape, class Shape>
void RegularArea<NormalizedShape, Shape>::simplify() void RegularArea<NormalizedShape, Shape>::simplify()
{ {
int end=this->count(),i=0,x=0; int end=this->count(),i=0,x=0;
QList <NormalizedShape*> m_remove; QList <NormalizedShape> m_remove;
for (;i<end;i++) for (;i<end;i++)
{ {
if ( i < (end-1) ) if ( i < (end-1) )
@ -158,7 +158,7 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
if (this->isEmpty()) if (this->isEmpty())
return false; return false;
foreach(const NormalizedShape *ns, this) foreach(const NormalizedShape ns, *this)
if (!(ns->isNull())) if (!(ns->isNull()))
return false; return false;
return true; return true;
@ -166,7 +166,7 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
} }
template <class NormalizedShape, class Shape> 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) if (!this)
return false; return false;
@ -174,7 +174,7 @@ bool RegularArea<NormalizedShape, Shape>::intersects (const NormalizedShape *rec
if (this->isEmpty()) if (this->isEmpty())
return false; return false;
foreach(const NormalizedShape *ns, this) foreach(const NormalizedShape ns, *this)
{ {
if(!(ns->isNull()) && ns->intersects (rect)) if(!(ns->isNull()) && ns->intersects (rect))
return true; return true;
@ -233,7 +233,7 @@ bool RegularArea<NormalizedShape, Shape>::contains (double x, double y) const
} }
template <class NormalizedShape, class Shape> template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::contains (NormalizedShape * shape) const bool RegularArea<NormalizedShape, Shape>::contains (NormalizedShape shape) const
{ {
if (!this) if (!this)
return false; return false;
@ -265,7 +265,7 @@ RegularArea<NormalizedShape, Shape>::geometry( int xScale, int yScale, int dx, i
return ret; return ret;
} }
typedef RegularArea<NormalizedRect,QRect> RegularAreaRect; typedef RegularArea<NormalizedRect*,QRect> RegularAreaRect;
class HighlightAreaRect : public RegularAreaRect { class HighlightAreaRect : public RegularAreaRect {

@ -23,7 +23,7 @@
#include <klocale.h> #include <klocale.h>
#include <kfinddialog.h> #include <kfinddialog.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kapplication.h> #include <ktoolinvocation.h>
#include <kuserprofile.h> #include <kuserprofile.h>
#include <krun.h> #include <krun.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
@ -697,7 +697,7 @@ void KPDFDocument::setViewport( const DocumentViewport & viewport, int excludeId
d->viewportHistory.pop_front(); d->viewportHistory.pop_front();
// add the item at the end of the queue // 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 // 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 ); const KPDFLinkBrowse * browse = static_cast< const KPDFLinkBrowse * >( link );
// if the url is a mailto one, invoke mailer // if the url is a mailto one, invoke mailer
if ( browse->url().startsWith( "mailto:", false ) ) if ( browse->url().startsWith( "mailto:", false ) )
kapp->invokeMailer( browse->url() ); KToolInvocation::invokeMailer( browse->url() );
else else
{ {
QString url = browse->url(); QString url = browse->url();
@ -1306,7 +1306,7 @@ void KPDFDocument::sendGeneratorRequest()
if ( generator->canGeneratePixmap( request->async ) ) if ( generator->canGeneratePixmap( request->async ) )
{ {
kWarning() << "sending request id=" << request->id << " " <<request->width << "x" << request->height << "@" << request->pageNumber << " async == " << request->async << endl; 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 ); generator->generatePixmap ( request );
} }
else else
@ -1499,14 +1499,14 @@ void KPDFDocument::loadDocumentInfo()
if ( historyElement.hasAttribute( "viewport" ) ) if ( historyElement.hasAttribute( "viewport" ) )
{ {
QString vpString = historyElement.attribute( "viewport" ); QString vpString = historyElement.attribute( "viewport" );
d->viewportIterator = d->viewportHistory.append( d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(),
DocumentViewport( vpString ) ); DocumentViewport( vpString ) );
} }
historyNode = historyNode.nextSibling(); historyNode = historyNode.nextSibling();
} }
// consistancy check // consistancy check
if ( d->viewportHistory.isEmpty() ) if ( d->viewportHistory.isEmpty() )
d->viewportIterator = d->viewportHistory.append( DocumentViewport() ); d->viewportIterator = d->viewportHistory.insert( d->viewportHistory.end(), DocumentViewport() );
} }
infoNode = infoNode.nextSibling(); infoNode = infoNode.nextSibling();
} }

@ -1,6 +1,8 @@
#include <QTextStream>
#include "generator.h" #include "generator.h"
std::ostream& operator<< (std::ostream& str, const PixmapRequest *req) QTextStream& operator<< (QTextStream& str, const PixmapRequest *req)
{ {
QString s(""); QString s("");
if (req->async) 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 #endif

Loading…
Cancel
Save