From a31eb3b2df2ceb8c02d69cc59c75aa7e1d457978 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 26 Jun 2002 16:57:59 +0000 Subject: [PATCH] std::auto_ptr -> boost::scoped_ptr and compile fix. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4490 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 6 ++++++ src/graphics/GraphicsLoader.C | 4 ++++ src/graphics/GraphicsLoader.h | 7 +++++-- src/insets/ChangeLog | 5 +++++ src/insets/insetgraphics.h | 10 +++------- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index b763b1779a..87389b69c0 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,9 @@ +2002-06-26 Angus Leeming + + * GraphicsLoader.[Ch]: use boost::scoped_ptr in preference to + std::auto_ptr. Define an empty Loader d-tor out-of-line to ensure it + compiles. + 2002-06-26 Angus Leeming * GraphicsTypes.h: add "Ready" to the ImageStatus enum. diff --git a/src/graphics/GraphicsLoader.C b/src/graphics/GraphicsLoader.C index 0bb07e1f17..d0c582ce06 100644 --- a/src/graphics/GraphicsLoader.C +++ b/src/graphics/GraphicsLoader.C @@ -153,6 +153,10 @@ Loader::Loader(string const & file, GParams const & params) } +Loader::~Loader() +{} + + void Loader::reset(string const & file, DisplayType type) { pimpl_->unsetOldFile(); diff --git a/src/graphics/GraphicsLoader.h b/src/graphics/GraphicsLoader.h index 6fc988af4b..8cb1408bf9 100644 --- a/src/graphics/GraphicsLoader.h +++ b/src/graphics/GraphicsLoader.h @@ -28,7 +28,7 @@ #include "LString.h" #include -#include +#include namespace grfx { @@ -46,6 +46,9 @@ public: /// The image is transformed before display. Loader(string const & file_with_path, GParams const &); + /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + ~Loader(); + /// The file can be changed, or the display params, or both. void reset(string const & file_with_path, DisplayType = ColorDisplay); /// @@ -76,7 +79,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - std::auto_ptr const pimpl_; + boost::scoped_ptr const pimpl_; }; } // namespace grfx diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index e2333d4fea..fe4f2da56d 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-06-26 Angus Leeming + + * insetgraphics.h: use boost::scoped_ptr in preference to + std::auto_ptr. + 2002-06-26 Angus Leeming * insetgraphics.C: moved the image loading stuff into a new class diff --git a/src/insets/insetgraphics.h b/src/insets/insetgraphics.h index 62a6216f86..ccbdf709a3 100644 --- a/src/insets/insetgraphics.h +++ b/src/insets/insetgraphics.h @@ -25,8 +25,7 @@ // We need a signal here to hide an active dialog when we are deleted. #include #include - -#include // auto_ptr +#include class Dialogs; class LaTeXFeatures; @@ -128,11 +127,8 @@ private: /// The cached variables class Cache; friend class Cache; - /** Can change the contents of the cache, but not the pointer. - * Use std::auto_ptr not boost::scoped_ptr so we do not have to define - * Cache in advance. - */ - std::auto_ptr const cache_; + /// The pointer never changes although *cache_'s contents may. + boost::scoped_ptr const cache_; }; #endif