Commit 0fb6474a authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port from auto_ptr to unique_ptr

parent 16460214
......@@ -282,20 +282,20 @@ const CDSCMEDIA* KDSC::page_media() const
return _cdsc->page_media;
}
auto_ptr<KDSCBBOX> KDSC::bbox() const
std::unique_ptr<KDSCBBOX> KDSC::bbox() const
{
if( _cdsc->bbox == nullptr )
return auto_ptr<KDSCBBOX>( nullptr );
return nullptr;
else
return auto_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->bbox ) );
return std::make_unique<KDSCBBOX>( *_cdsc->bbox );
}
auto_ptr<KDSCBBOX> KDSC::page_bbox() const
std::unique_ptr<KDSCBBOX> KDSC::page_bbox() const
{
if( _cdsc->page_bbox == nullptr )
return auto_ptr<KDSCBBOX>( nullptr );
return nullptr;
else
return auto_ptr<KDSCBBOX>( new KDSCBBOX( *_cdsc->page_bbox ) );
return std::make_unique<KDSCBBOX>( *_cdsc->page_bbox );
}
QString KDSC::dsc_title() const
......
......@@ -264,13 +264,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;
......
......@@ -231,7 +231,7 @@ bool GSCreator::create(const QString &path, int width, int height, QImage &img)
}
}
std::auto_ptr<KDSCBBOX> bbox = dsc.bbox();
std::unique_ptr<KDSCBBOX> bbox = dsc.bbox();
const bool is_encapsulated = no_dvi
&& (path.endsWith(QLatin1String(".eps"), Qt::CaseInsensitive)
......
Supports Markdown
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