]> git.lyx.org Git - lyx.git/commitdiff
Replace boost::scoped_ptr with unique_ptr
authorGuillaume Munch <gm@lyx.org>
Thu, 2 Jun 2016 22:49:36 +0000 (23:49 +0100)
committerGuillaume Munch <gm@lyx.org>
Thu, 9 Jun 2016 14:21:39 +0000 (15:21 +0100)
16 files changed:
3rdparty/boost/extract.sh
src/Buffer.cpp
src/CutAndPaste.cpp
src/LyX.cpp
src/LyXVC.cpp
src/LyXVC.h
src/client/client.cpp
src/graphics/GraphicsCacheItem.cpp
src/insets/InsetExternal.h
src/insets/InsetIPA.h
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h
src/insets/InsetPreview.h
src/insets/InsetTabular.cpp
src/mathed/InsetMathHull.h
src/mathed/InsetMathSymbol.cpp

index 64ffbe4a4331dfe0713dfaa46f9d1d54d734ed84..4525cf09b3b6f8696a180fbf027712ede10b87da 100755 (executable)
@@ -26,7 +26,6 @@ bcp --boost=$1 \
        boost/cstdint.hpp \
        boost/lexical_cast.hpp \
        boost/regex.hpp \
-       boost/scoped_ptr.hpp \
        boost/signal.hpp \
        boost/signals/connection.hpp \
        boost/signals/trackable.hpp \
index b75ddd0d70ece6f3d27bce2d2f3a62aa3daf5edd..431f3f6c920c0a6769031b0e1bbe1ee5125e3e9f 100644 (file)
@@ -1397,9 +1397,8 @@ bool Buffer::save() const
        // proper location once that has been done successfully. that
        // way we preserve the original file if something goes wrong.
        string const justname = fileName().onlyFileNameWithoutExt();
-       boost::scoped_ptr<TempFile>
-               tempfile(new TempFile(fileName().onlyPath(),
-                  justname + "-XXXXXX.lyx"));
+       auto tempfile = make_unique<TempFile>(fileName().onlyPath(),
+                                             justname + "-XXXXXX.lyx");
        bool const symlink = fileName().isSymLink();
        if (!symlink)
                tempfile->setAutoRemove(false);
index 44bcb5e962c56bc420bbb7faa093f3f05ffd36d4..4d90c6c120daacaf2dcbe3ea9fc3561cc4120605 100644 (file)
@@ -62,6 +62,7 @@
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/TempFile.h"
+#include "support/unique_ptr.h"
 
 #include "frontends/alert.h"
 #include "frontends/Clipboard.h"
@@ -1055,7 +1056,8 @@ docstring selection(size_t sel_index, DocumentClassConstPtr docclass)
        if (sel_index >= theCuts.size())
                return docstring();
 
-       boost::scoped_ptr<Buffer> buffer(copyToTempBuffer(theCuts[sel_index].first, docclass));
+       unique_ptr<Buffer> buffer(copyToTempBuffer(theCuts[sel_index].first,
+                                                  docclass));
        if (!buffer)
                return docstring();
 
index d2484d152e1f25195eeca966702258200a77744d..b7b1edf91520e86ff4646fcfbe54c741ea2cef60 100644 (file)
@@ -50,6 +50,7 @@
 #include "frontends/alert.h"
 #include "frontends/Application.h"
 
+#include "support/bind.h"
 #include "support/ConsoleApplication.h"
 #include "support/lassert.h"
 #include "support/debug.h"
@@ -61,9 +62,7 @@
 #include "support/Messages.h"
 #include "support/os.h"
 #include "support/Package.h"
-
-#include "support/bind.h"
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
 
 #include <algorithm>
 #include <iostream>
@@ -150,13 +149,13 @@ struct LyX::Impl {
        ///
        CmdDef toplevel_cmddef_;
        ///
-       boost::scoped_ptr<Server> lyx_server_;
+       unique_ptr<Server> lyx_server_;
        ///
-       boost::scoped_ptr<ServerSocket> lyx_socket_;
+       unique_ptr<ServerSocket> lyx_socket_;
        ///
-       boost::scoped_ptr<frontend::Application> application_;
+       unique_ptr<frontend::Application> application_;
        /// lyx session, containing lastfiles, lastfilepos, and lastopened
-       boost::scoped_ptr<Session> session_;
+       unique_ptr<Session> session_;
 
        /// Files to load at start.
        vector<string> files_to_load_;
@@ -1415,7 +1414,7 @@ Server & theServer()
        // FIXME: this should not be use_gui dependent
        LWARNIF(use_gui);
        LAPPERR(singleton_);
-       return *singleton_->pimpl_->lyx_server_.get();
+       return *singleton_->pimpl_->lyx_server_;
 }
 
 
@@ -1424,7 +1423,7 @@ ServerSocket & theServerSocket()
        // FIXME: this should not be use_gui dependent
        LWARNIF(use_gui);
        LAPPERR(singleton_);
-       return *singleton_->pimpl_->lyx_socket_.get();
+       return *singleton_->pimpl_->lyx_socket_;
 }
 
 
index d48031102b76436b578f667e76c9f6aa66e57f73..b28139fb61c08d124220acde13dd986f42c324f7 100644 (file)
@@ -41,11 +41,6 @@ LyXVC::LyXVC()
 }
 
 
-// for the sake of boost::scoped_ptr
-LyXVC::~LyXVC()
-{}
-
-
 bool LyXVC::fileInVC(FileName const & fn)
 {
        if (!RCS::findFile(fn).empty())
index 3036a396e3a8d4bb448cf7cfc044e986fdaee043..27d935ed737177959daf66755679ad779fdf780b 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef LYX_VC_H
 #define LYX_VC_H
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
 
 #include <string>
 
@@ -48,8 +48,6 @@ public:
        };
        ///
        LyXVC();
-       ///
-       ~LyXVC();
        /// Is \p fn under version control?
        static bool fileInVC(support::FileName const & fn);
        /** Not a good name perhaps. This function should be called whenever
@@ -190,7 +188,7 @@ private:
        Buffer * owner_;
 
        ///
-       boost::scoped_ptr<VCS> vcs;
+       unique_ptr<VCS> vcs;
 };
 
 
index 9c7856014b36f0d994415cf84e041acf818e278e..f303c1833efe3466c7bf3a6810235f407fb53075 100644 (file)
@@ -19,8 +19,7 @@
 #include "support/lstrings.h"
 #include "support/Messages.h"
 #include "support/unicode.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
 
 // getpid(), getppid()
 #ifdef HAVE_SYS_TYPES_H
 #include <map>
 #include <iostream>
 
+
 using namespace std;
 using namespace lyx::support;
 
-using ::boost::scoped_ptr;
-
 namespace lyx {
 
 // Dummy LyXRC support
@@ -618,7 +616,7 @@ int LyXClientApp::run()
                return EXIT_FAILURE;
        }
 
-       scoped_ptr<LyXDataSocket> server;
+       unique_ptr<LyXDataSocket> server;
 
        if (!cmdline::serverAddress.empty()) {
                server.reset(new LyXDataSocket(FileName(to_utf8(cmdline::serverAddress))));
index 2e8c415f36b6709d849389281d2a084f6e031a64..2d004c93e65db306be0e4417775c27f1a3a741af 100644 (file)
@@ -120,7 +120,7 @@ public:
        boost::signals::connection cc_;
 
        ///
-       boost::scoped_ptr<Converter> converter_;
+       unique_ptr<Converter> converter_;
 };
 
 
index 813e933a0a1d9088ca72576a7fd4826feb3beb86..70cfaa2510d31474c1e25937e079a1a9f52960ad 100644 (file)
@@ -17,8 +17,8 @@
 #include "ExternalTemplate.h"
 
 #include "support/FileName.h"
+#include "support/unique_ptr.h"
 
-#include <boost/scoped_ptr.hpp>
 #include <boost/signals/trackable.hpp>
 
 
@@ -169,7 +169,7 @@ private:
        /// The current params
        InsetExternalParams params_;
        /// The thing that actually draws the image on LyX's screen.
-       boost::scoped_ptr<RenderBase> renderer_;
+       unique_ptr<RenderBase> renderer_;
        /// changes color of the button when mouse enters/leaves this inset
        mutable std::map<BufferView const *, bool> mouse_hover_;
 };
index 783871d8a465e2cb367bb373a9e14c5f638c71e7..9b702c92b368cd7fa06c31efd94259f70ca5badc 100644 (file)
@@ -16,7 +16,8 @@
 
 #include "Dimension.h"
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
+
 
 namespace lyx {
 
@@ -93,7 +94,7 @@ protected:
        void preparePreview(DocIterator const & pos) const;
 
        ///
-       boost::scoped_ptr<RenderPreview> preview_;
+       unique_ptr<RenderPreview> preview_;
 };
 
 
index e9b96000754c4ce4ade9176208ff93a08f10473d..1031f3a557ac66f92c9b6f08048123f2b424d147 100644 (file)
@@ -1067,7 +1067,7 @@ void InsetInclude::fileChanged() const
                return;
 
        preview_->removePreview(*buffer);
-       add_preview(*preview_.get(), *this, *buffer);
+       add_preview(*preview_, *this, *buffer);
        preview_->startLoading(*buffer);
 }
 
index 78d308008ce4d0f5ad233400112b78978ba7fdcf..c844075489f7034c65ae87ab42f912cf93920674 100644 (file)
@@ -17,7 +17,8 @@
 
 #include "RenderButton.h"
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
+
 
 namespace lyx {
 
@@ -164,7 +165,7 @@ private:
        docstring const include_label;
 
        /// The pointer never changes although *preview_'s contents may.
-       boost::scoped_ptr<RenderMonitoredPreview> const preview_;
+       unique_ptr<RenderMonitoredPreview> const preview_;
 
        /// 
        mutable bool failedtoload_;
index 1c80f3efd6b241196cdf072c35262b08893eb5cf..d6d693da756fad16be93aaa4adb5ee06f351b2ad 100644 (file)
@@ -16,7 +16,8 @@
 
 #include "Dimension.h"
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
+
 
 namespace lyx {
 
@@ -80,7 +81,7 @@ protected:
        void preparePreview(DocIterator const & pos) const;
 
        ///
-       boost::scoped_ptr<RenderPreview> preview_;
+       unique_ptr<RenderPreview> preview_;
 
 };
 
index 6477ef3fe673a2febfa66eabe5f5e0baafdb7ffd..f56991470c89ef367d30d7099ff9d73565d8c5bb 100644 (file)
@@ -61,8 +61,7 @@
 #include "support/gettext.h"
 #include "support/lassert.h"
 #include "support/lstrings.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
 
 #include <cstring>
 #include <iostream>
@@ -96,7 +95,7 @@ int const WIDTH_OF_LINE = 5; // space between double lines
 
 
 ///
-boost::scoped_ptr<Tabular> paste_tabular;
+unique_ptr<Tabular> paste_tabular;
 
 
 struct TabularFeature {
index c12fcc75931fd1c45972cc98772de1fd126770aa..1fdf0d098a5429f6be2da44c65db3947a0cf8f14 100644 (file)
@@ -17,7 +17,7 @@
 #include "DocIterator.h"
 #include "OutputEnums.h"
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
 
 
 namespace lyx {
@@ -258,7 +258,7 @@ private:
        ///
        std::vector<InsetLabel *> label_;
        ///
-       boost::scoped_ptr<RenderPreview> preview_;
+       unique_ptr<RenderPreview> preview_;
        ///
        DocIterator docit_;
        ///
index a04f6e0bcf7bed47bd99dd7593ed81854d00591f..5a86536b52296aea9c67c793329770d60b3e6196 100644 (file)
@@ -22,8 +22,7 @@
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/textutils.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
 
 
 namespace lyx {
@@ -255,9 +254,9 @@ void InsetMathSymbol::octave(OctaveStream & os) const
 
 void InsetMathSymbol::write(WriteStream & os) const
 {
-       boost::scoped_ptr<MathEnsurer> ensurer;
+       unique_ptr<MathEnsurer> ensurer;
        if (currentMode() != TEXT_MODE)
-               ensurer.reset(new MathEnsurer(os));
+               ensurer = make_unique<MathEnsurer>(os);
        os << '\\' << name();
 
        // $,#, etc. In theory the restriction based on catcodes, but then