[poppler] 3 commits - poppler/PDFDoc.cc poppler/Stream.cc poppler/Stream.h qt4/src

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Mar 22 07:47:07 PDT 2008


 poppler/PDFDoc.cc                            |    8 +++++++-
 poppler/Stream.cc                            |    5 -----
 poppler/Stream.h                             |    5 -----
 qt4/src/poppler-qiodeviceoutstream-private.h |    1 -
 qt4/src/poppler-qiodeviceoutstream.cc        |    5 -----
 5 files changed, 7 insertions(+), 17 deletions(-)

New commits:
commit 0fb1e697cc4100ce23298141c8b5829273872423
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Mar 22 15:46:44 2008 +0100

    remove unneeded variable

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index b27fd7c..0dc582c 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -615,7 +615,6 @@ void PDFDoc::writeDictionnary (Dict* dict, OutStream* outStr)
 
 void PDFDoc::writeStream (Stream* str, OutStream* outStr)
 {
-  int c;
   outStr->printf("stream\r\n");
   str->reset();
   for (int c=str->getChar(); c!= EOF; c=str->getChar()) {
commit 3404cb626ee9b4520d6fe601e07560745a4cb42a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Mar 22 15:44:50 2008 +0100

    Remove OutStream::reset since noone uses it
    
    This way we have a fseek less to care about if worked or not

diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index 3ef7146..c253129 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -308,11 +308,6 @@ FileOutStream::~FileOutStream ()
   close ();
 }
 
-void FileOutStream::reset ()
-{
-  fseek(f, start, SEEK_SET);
-}
-
 void FileOutStream::close ()
 {
 
diff --git a/poppler/Stream.h b/poppler/Stream.h
index 74152fc..3c463e2 100644
--- a/poppler/Stream.h
+++ b/poppler/Stream.h
@@ -161,9 +161,6 @@ public:
   int incRef() { return ++ref; }
   int decRef() { return --ref; }
 
-  // Reset stream to beginning
-  virtual void reset() = 0;
-
   // Close the stream
   virtual void close() = 0;
 
@@ -191,8 +188,6 @@ public:
 
   virtual ~FileOutStream ();
 
-  virtual void reset();
-
   virtual void close();
 
   virtual int getPos();
diff --git a/qt4/src/poppler-qiodeviceoutstream-private.h b/qt4/src/poppler-qiodeviceoutstream-private.h
index 74b56ca..e7faa29 100644
--- a/qt4/src/poppler-qiodeviceoutstream-private.h
+++ b/qt4/src/poppler-qiodeviceoutstream-private.h
@@ -32,7 +32,6 @@ class QIODeviceOutStream : public OutStream
     QIODeviceOutStream(QIODevice* device);
     virtual ~QIODeviceOutStream();
 
-    virtual void reset();
     virtual void close();
     virtual int getPos();
     virtual void put(char c);
diff --git a/qt4/src/poppler-qiodeviceoutstream.cc b/qt4/src/poppler-qiodeviceoutstream.cc
index e79314e..b0054af 100644
--- a/qt4/src/poppler-qiodeviceoutstream.cc
+++ b/qt4/src/poppler-qiodeviceoutstream.cc
@@ -35,11 +35,6 @@ QIODeviceOutStream::~QIODeviceOutStream()
 {
 }
 
-void QIODeviceOutStream::reset()
-{
-  m_device->reset();
-}
-
 void QIODeviceOutStream::close()
 {
 }
commit 066595dd06c930997d5ec65a06c822616af9baa0
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Mar 22 15:43:07 2008 +0100

    Check the document stream is seekable when opening it
    
    Fixes bug 14126

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index c0c8f58..b27fd7c 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -181,6 +181,13 @@ PDFDoc::PDFDoc(BaseStream *strA, GooString *ownerPassword,
 }
 
 GBool PDFDoc::setup(GooString *ownerPassword, GooString *userPassword) {
+  str->setPos(0, -1);
+  if (str->getPos() <= 0)
+  {
+    error(-1, "Document base stream is not seekable");
+    return gFalse;
+  }
+
   str->reset();
 
   // check footer


More information about the poppler mailing list