From: André Pönitz Date: Wed, 21 Nov 2007 23:47:47 +0000 (+0000) Subject: remove a few uses of boost::scoped_ptr X-Git-Tag: 1.6.10~7270 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=98ddc514dabfb2556fdfc6c9a8531daf838bebbb;p=lyx.git remove a few uses of boost::scoped_ptr git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21705 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/graphics/GraphicsCache.cpp b/src/graphics/GraphicsCache.cpp index 43743535f2..740ca053ce 100644 --- a/src/graphics/GraphicsCache.cpp +++ b/src/graphics/GraphicsCache.cpp @@ -56,7 +56,9 @@ Cache::Cache() Cache::~Cache() -{} +{ + delete pimpl_; +} std::vector Cache::loadableFormats() const diff --git a/src/graphics/GraphicsCache.h b/src/graphics/GraphicsCache.h index d58ff14342..a422623933 100644 --- a/src/graphics/GraphicsCache.h +++ b/src/graphics/GraphicsCache.h @@ -20,7 +20,6 @@ #ifndef GRAPHICSCACHE_H #define GRAPHICSCACHE_H -#include #include #include @@ -85,7 +84,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics diff --git a/src/graphics/GraphicsCacheItem.cpp b/src/graphics/GraphicsCacheItem.cpp index 7b206986e2..a1310385bb 100644 --- a/src/graphics/GraphicsCacheItem.cpp +++ b/src/graphics/GraphicsCacheItem.cpp @@ -141,7 +141,9 @@ CacheItem::CacheItem(FileName const & file) CacheItem::~CacheItem() -{} +{ + delete pimpl_; +} FileName const & CacheItem::filename() const diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index cceee96f32..34dad4b265 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -30,7 +30,6 @@ #include "GraphicsTypes.h" -#include #include @@ -48,8 +47,7 @@ class CacheItem { public: /// CacheItem(support::FileName const & file); - - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + /// Needed for the pimpl ~CacheItem(); /// @@ -96,9 +94,8 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; - /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics diff --git a/src/graphics/GraphicsConverter.cpp b/src/graphics/GraphicsConverter.cpp index aace6d2b13..3ecc643168 100644 --- a/src/graphics/GraphicsConverter.cpp +++ b/src/graphics/GraphicsConverter.cpp @@ -102,9 +102,10 @@ Converter::Converter(FileName const & from_file, string const & to_file_base, {} -// Empty d-tor out-of-line to keep boost::scoped_ptr happy. Converter::~Converter() -{} +{ + delete pimpl_; +} void Converter::startConversion() const diff --git a/src/graphics/GraphicsConverter.h b/src/graphics/GraphicsConverter.h index d380c36577..f84b9e9b11 100644 --- a/src/graphics/GraphicsConverter.h +++ b/src/graphics/GraphicsConverter.h @@ -17,7 +17,6 @@ #ifndef GRAPHICSCONVERTER_H #define GRAPHICSCONVERTER_H -#include #include namespace lyx { @@ -38,7 +37,7 @@ public: Converter(support::FileName const & from_file, std::string const & to_file_base, std::string const & from_format, std::string const & to_format); - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + /// Needed for the pimpl ~Converter(); /// We are explicit about when we begin the conversion process. @@ -67,9 +66,8 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; - /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index 1863725a7f..062dc6fc13 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -98,7 +98,9 @@ Loader::Loader(Loader const & other) Loader::~Loader() -{} +{ + delete pimpl_; +} Loader & Loader::operator=(Loader const & other) diff --git a/src/graphics/GraphicsLoader.h b/src/graphics/GraphicsLoader.h index 145c0e5858..b1c82d9067 100644 --- a/src/graphics/GraphicsLoader.h +++ b/src/graphics/GraphicsLoader.h @@ -26,7 +26,6 @@ #include "GraphicsTypes.h" -#include #include namespace lyx { @@ -48,8 +47,7 @@ public: Loader(support::FileName const & file_with_path, Params const &); /// Loader(Loader const &); - - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + /// Needed for the pimpl ~Loader(); Loader & operator=(Loader const &); @@ -104,7 +102,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics diff --git a/src/graphics/PreviewImage.cpp b/src/graphics/PreviewImage.cpp index e6083f06f0..02af7c470a 100644 --- a/src/graphics/PreviewImage.cpp +++ b/src/graphics/PreviewImage.cpp @@ -63,7 +63,9 @@ PreviewImage::PreviewImage(PreviewLoader & l, PreviewImage::~PreviewImage() -{} +{ + delete pimpl_; +} string const & PreviewImage::snippet() const diff --git a/src/graphics/PreviewImage.h b/src/graphics/PreviewImage.h index 4064520bd8..6ec29a36ba 100644 --- a/src/graphics/PreviewImage.h +++ b/src/graphics/PreviewImage.h @@ -12,8 +12,7 @@ #ifndef PREVIEWIMAGE_H #define PREVIEWIMAGE_H -#include -#include +#include "support/strfwd.h" namespace lyx { @@ -54,7 +53,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index c81760bd85..5cd738f5d0 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -210,7 +210,6 @@ typedef InProgressProcesses::value_type InProgressProcess; namespace lyx { - namespace graphics { class PreviewLoader::Impl : public boost::signals::trackable { @@ -288,7 +287,9 @@ PreviewLoader::PreviewLoader(Buffer const & b) PreviewLoader::~PreviewLoader() -{} +{ + delete pimpl_; +} PreviewImage const * PreviewLoader::preview(string const & latex_snippet) const diff --git a/src/graphics/PreviewLoader.h b/src/graphics/PreviewLoader.h index d954401b7b..0227466f7d 100644 --- a/src/graphics/PreviewLoader.h +++ b/src/graphics/PreviewLoader.h @@ -18,7 +18,6 @@ #ifndef PREVIEWLOADER_H #define PREVIEWLOADER_H -#include #include @@ -95,7 +94,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics diff --git a/src/graphics/Previews.cpp b/src/graphics/Previews.cpp index 5f7ad4d8c9..5a6772e3dc 100644 --- a/src/graphics/Previews.cpp +++ b/src/graphics/Previews.cpp @@ -54,7 +54,9 @@ Previews::Previews() Previews::~Previews() -{} +{ + delete pimpl_; +} PreviewLoader & Previews::loader(Buffer const & buffer) const diff --git a/src/graphics/Previews.h b/src/graphics/Previews.h index 429855c44a..0a50e29e36 100644 --- a/src/graphics/Previews.h +++ b/src/graphics/Previews.h @@ -15,8 +15,6 @@ #ifndef PREVIEWS_H #define PREVIEWS_H -#include - namespace lyx { class Buffer; @@ -62,7 +60,7 @@ private: /// Use the Pimpl idiom to hide the internals. class Impl; /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics