diff options
Diffstat (limited to 'kghostview/dscparse')
-rw-r--r-- | kghostview/dscparse/dscparse.cpp | 39 | ||||
-rw-r--r-- | kghostview/dscparse/dscparse.h | 6 | ||||
-rw-r--r-- | kghostview/dscparse/dscparse_adapter.cpp | 18 | ||||
-rw-r--r-- | kghostview/dscparse/dscparse_adapter.h | 56 |
4 files changed, 30 insertions, 89 deletions
diff --git a/kghostview/dscparse/dscparse.cpp b/kghostview/dscparse/dscparse.cpp index 7b85395f..e31b9edd 100644 --- a/kghostview/dscparse/dscparse.cpp +++ b/kghostview/dscparse/dscparse.cpp @@ -2026,7 +2026,7 @@ dsc_scan_comments(CDSC *dsc) continued ? 3 : 10)) return CDSC_ERROR; } - else if (IS_DSC(line, "%%Qt::Orientation:")) { + else if (IS_DSC(line, "%%Orientation:")) { dsc->id = CDSC_ORIENTATION; if (dsc_parse_orientation(dsc, &(dsc->page_orientation), continued ? 3 : 14)) @@ -2330,7 +2330,7 @@ dsc_scan_defaults(CDSC *dsc) } else if (IS_DSC(line, "%%PageQt::Orientation:")) { dsc->id = CDSC_PAGEORIENTATION; - /* This can override %%Qt::Orientation: */ + /* This can override %%Orientation: */ if (dsc_parse_orientation(dsc, &(dsc->page_orientation), 18)) return CDSC_ERROR; } @@ -2936,30 +2936,30 @@ dsc_scan_page(CDSC *dsc) * %%DocumentProcessColors: * %%DocumentSuppliedFiles: * %%DocumentSuppliedFonts: - * %%DocumentSuppliedProcSets: - * %%DocumentSuppliedResources: - * %%Qt::Orientation: - * %%Pages: - * %%PageOrder: + * %%DocumentSuppliedProcSets: + * %%DocumentSuppliedResources: + * %%Orientation: + * %%Pages: + * %%PageOrder: * * Our supported subset is * %%Trailer * %%EOF * %%BoundingBox: - * %%Qt::Orientation: - * %%Pages: - * %%PageOrder: + * %%Orientation: + * %%Pages: + * %%PageOrder: * In addition to these, we support * %%DocumentMedia: * * A %%PageTrailer can have the following: - * %%PageBoundingBox: - * %%PageCustomColors: - * %%PageFiles: - * %%PageFonts: - * %%PageQt::Orientation: - * %%PageProcessColors: - * %%PageResources: + * %%PageBoundingBox: + * %%PageCustomColors: + * %%PageFiles: + * %%PageFonts: + * %%PageQt::Orientation: + * %%PageProcessColors: + * %%PageResources: */ dsc_private int @@ -3052,7 +3052,7 @@ dsc_scan_trailer(CDSC *dsc) continued ? 3 : 10)) return CDSC_ERROR; } - else if (IS_DSC(line, "%%Qt::Orientation:")) { + else if (IS_DSC(line, "%%Orientation:")) { dsc->id = CDSC_ORIENTATION; if (dsc_parse_orientation(dsc, &(dsc->page_orientation), continued ? 3 : 14)) return CDSC_ERROR; @@ -3427,6 +3427,3 @@ dsc_error(CDSC *dsc, unsigned int explanation, /* treat DSC as being correct */ return CDSC_RESPONSE_CANCEL; } - - -// vim:sw=4:sts=4:ts=8:noet diff --git a/kghostview/dscparse/dscparse.h b/kghostview/dscparse/dscparse.h index a82a3218..77b670a0 100644 --- a/kghostview/dscparse/dscparse.h +++ b/kghostview/dscparse/dscparse.h @@ -98,7 +98,7 @@ typedef enum { CDSC_FOR = 207, /* %%For: */ CDSC_LANGUAGELEVEL = 208, /* %%LanguageLevel: */ CDSC_BOUNDINGBOX = 209, /* %%BoundingBox: */ - CDSC_ORIENTATION = 210, /* %%Qt::Orientation: */ + CDSC_ORIENTATION = 210, /* %%Orientation: */ CDSC_PAGEORDER = 211, /* %%PageOrder: */ CDSC_DOCUMENTMEDIA = 212, /* %%DocumentMedia: */ CDSC_DOCUMENTPAPERSIZES = 213, /* %%DocumentPaperSizes: */ @@ -159,7 +159,7 @@ typedef enum { /* Trailer section */ CDSC_TRAILER = 800, /* %%Trailer */ -/* also %%Pages, %%BoundingBox, %%Qt::Orientation, %%PageOrder, %%DocumentMedia */ +/* also %%Pages, %%BoundingBox, %%Orientation, %%PageOrder, %%DocumentMedia */ /* %%Page is recognised as an error */ /* also %%DocumentNeededFonts, %%DocumentSuppliedFonts */ @@ -469,5 +469,3 @@ int dsc_set_page_bbox(P6(CDSC *dsc, unsigned int page_number, int llx, int lly, int urx, int ury)); #endif - -// vim:sw=4:sts=4:ts=8:noet diff --git a/kghostview/dscparse/dscparse_adapter.cpp b/kghostview/dscparse/dscparse_adapter.cpp index 17ae0231..5aae47b8 100644 --- a/kghostview/dscparse/dscparse_adapter.cpp +++ b/kghostview/dscparse/dscparse_adapter.cpp @@ -282,20 +282,20 @@ const CDSCMEDIA* KDSC::page_media() const return _cdsc->page_media; } -auto_ptr<KDSCBBOX> KDSC::bbox() const +unique_ptr<KDSCBBOX> KDSC::bbox() const { - if( _cdsc->bbox == 0 ) - return auto_ptr<KDSCBBOX>( 0 ); + if( _cdsc->bbox == nullptr ) + return unique_ptr<KDSCBBOX>( nullptr ); else - return auto_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->bbox ) ); + return unique_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->bbox ) ); } -auto_ptr<KDSCBBOX> KDSC::page_bbox() const +unique_ptr<KDSCBBOX> KDSC::page_bbox() const { - if( _cdsc->page_bbox == 0 ) - return auto_ptr<KDSCBBOX>( 0 ); + if( _cdsc->page_bbox == nullptr ) + return unique_ptr<KDSCBBOX>( nullptr ); else - return auto_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->page_bbox ) ); + return unique_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->page_bbox ) ); } TQString KDSC::dsc_title() const @@ -416,5 +416,3 @@ bool KDSCScanHandlerByLine::scanData( char* buf, unsigned int count ) else return true; } - -// vim:sw=4:sts=4:ts=8:noet diff --git a/kghostview/dscparse/dscparse_adapter.h b/kghostview/dscparse/dscparse_adapter.h index c5c1cbf9..77855972 100644 --- a/kghostview/dscparse/dscparse_adapter.h +++ b/kghostview/dscparse/dscparse_adapter.h @@ -28,51 +28,6 @@ #include "dscparse.h" -#if defined(__GNUC__) -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93) -/* - * We add a quick 'n' dirty inline implementation of auto_ptr for older - * releases of GCC, which don't include an auto_ptr implementation in - * <memory>. - */ - -template <class T> class auto_ptr { -private: - T* _ptr; - -public: - typedef T element_type; - explicit auto_ptr(T* p = 0) : _ptr(p) {} - auto_ptr(auto_ptr& a) : _ptr(a.release()) {} - template <class T1> auto_ptr(auto_ptr<T1>& a) : _ptr(a.release()) {} - auto_ptr& operator=(auto_ptr& a) { - if (&a != this) { - delete _ptr; - _ptr = a.release(); - } - return *this; - } - template <class T1> - auto_ptr& operator=(auto_ptr<T1>& a) { - if (a.get() != this->get()) { - delete _ptr; - _ptr = a.release(); - } - return *this; - } - ~auto_ptr() { delete _ptr; } - - T& operator*() const { return *_ptr; } - T* operator->() const { return _ptr; } - T* get() const { return _ptr; } - T* release() { T* tmp = _ptr; _ptr = 0; return tmp; } - void reset(T* p = 0) { delete _ptr; _ptr = p; } -}; - -#endif -#endif - - class KDSCBBOX { public: @@ -304,13 +259,8 @@ public: CDSCMEDIA** media() const; const CDSCMEDIA* page_media() const; -#if defined(__GNUC__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)) - auto_ptr<KDSCBBOX> bbox() const; - auto_ptr<KDSCBBOX> page_bbox() const; -#else - std::auto_ptr<KDSCBBOX> bbox() const; - std::auto_ptr<KDSCBBOX> page_bbox() const; -#endif + std::unique_ptr<KDSCBBOX> bbox() const; + std::unique_ptr<KDSCBBOX> page_bbox() const; // CDSCDOSEPS *doseps; @@ -382,5 +332,3 @@ protected: }; #endif - -// vim:sw=4:sts=4:ts=8:noet |