summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ca8709a)
shared_ptrs now only require the <memory> header.
24 files changed:
#include "support/types.h"
#include "support/bind.h"
#include "support/types.h"
#include "support/bind.h"
-#include "support/shared_ptr.h"
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <map>
#include <set>
#include <sstream>
#include <vector>
#include <set>
#include <sstream>
#include <vector>
///
virtual shared_ptr<ForkedProcess> clone() const
{
///
virtual shared_ptr<ForkedProcess> clone() const
{
- return shared_ptr<ForkedProcess>(new AutoSaveBuffer(*this));
+ return make_shared<AutoSaveBuffer>(*this);
DocumentClass const & BufferParams::documentClass() const
{
DocumentClass const & BufferParams::documentClass() const
{
- return *doc_class_.get();
#ifndef DOCUMENT_CLASS_PTR_H
#define DOCUMENT_CLASS_PTR_H
#ifndef DOCUMENT_CLASS_PTR_H
#define DOCUMENT_CLASS_PTR_H
-#include "support/shared_ptr.h"
namespace lyx {
class DocumentClass;
namespace lyx {
class DocumentClass;
-typedef shared_ptr<DocumentClass> DocumentClassPtr;
-typedef shared_ptr<DocumentClass const> DocumentClassConstPtr;
+typedef std::shared_ptr<DocumentClass> DocumentClassPtr;
+typedef std::shared_ptr<DocumentClass const> DocumentClassConstPtr;
}
#endif // DISPATCH_RESULT_H
}
#endif // DISPATCH_RESULT_H
#include "support/strfwd.h"
#include "support/strfwd.h"
-#include "support/shared_ptr.h"
-
/// Modifier masks
ModifierPair mod;
/// Keymap for prefix keys
/// Modifier masks
ModifierPair mod;
/// Keymap for prefix keys
- shared_ptr<KeyMap> prefixes;
+ std::shared_ptr<KeyMap> prefixes;
/// Action for !prefix keys
FuncRequest func;
};
/// Action for !prefix keys
FuncRequest func;
};
-#include "support/shared_ptr.h"
This is a hack: Make it possible to add stuff to constant
OutputParams instances.
*/
This is a hack: Make it possible to add stuff to constant
OutputParams instances.
*/
- shared_ptr<ExportData> exportdata;
+ std::shared_ptr<ExportData> exportdata;
/** Whether we are inside a comment inset. Insets that are including
* external files like InsetGraphics, InsetInclude and InsetExternal
/** Whether we are inside a comment inset. Insets that are including
* external files like InsetGraphics, InsetInclude and InsetExternal
}
// Register the new client.
}
// Register the new client.
- clients[client_fd] =
- shared_ptr<LyXDataSocket>(new LyXDataSocket(client_fd));
+ clients[client_fd] = make_shared<LyXDataSocket>(client_fd);
theApp()->registerSocketCallback(
client_fd,
bind(&ServerSocket::dataCallback,
theApp()->registerSocketCallback(
client_fd,
bind(&ServerSocket::dataCallback,
#include "support/FileName.h"
#include "support/FileName.h"
-#include "support/shared_ptr.h"
-
#include <string>
#include <map>
#include <string>
#include <map>
MAX_CLIENTS = 10
};
/// All connections
MAX_CLIENTS = 10
};
/// All connections
- std::map<int, shared_ptr<LyXDataSocket> > clients;
+ std::map<int, std::shared_ptr<LyXDataSocket>> clients;
#ifndef TOC_H
#define TOC_H
#ifndef TOC_H
#define TOC_H
-#include "support/shared_ptr.h"
-
#include <vector>
#include <string>
#include <vector>
#include <string>
typedef std::vector<TocItem> Toc;
typedef std::vector<TocItem> Toc;
-class TocList : public std::map<std::string, shared_ptr<Toc> >
+class TocList : public std::map<std::string, std::shared_ptr<Toc>>
{
private:
// TocList should never map to null pointers.
{
private:
// TocList should never map to null pointers.
- // We forbid the following method which creates null pointers.
- using std::map<std::string, shared_ptr<Toc> >::operator[];
+ // We hide the following methods which create null pointers.
+ using std::map<std::string, std::shared_ptr<Toc>>::operator[];
///////////////////////////////////////////////////////////////////////////
TocBuilder::TocBuilder(shared_ptr<Toc> toc)
///////////////////////////////////////////////////////////////////////////
TocBuilder::TocBuilder(shared_ptr<Toc> toc)
- : toc_(toc ? toc : lyx::make_shared<Toc>()),
+ : toc_(toc ? toc : make_shared<Toc>()),
///////////////////////////////////////////////////////////////////////////
shared_ptr<TocBuilder> TocBuilderStore::get(string const & type,
///////////////////////////////////////////////////////////////////////////
shared_ptr<TocBuilder> TocBuilderStore::get(string const & type,
{
map_t::const_iterator it = map_.find(type);
{
map_t::const_iterator it = map_.find(type);
- if (it == map_.end()) {
- it = map_.insert(std::make_pair(type,
- lyx::make_shared<TocBuilder>(toc))).first;
- }
+ if (it == map_.end())
+ it = map_.insert(make_pair(type, make_shared<TocBuilder>(toc))).first;
{
// Is the type already supported?
TocList::const_iterator it = tocs_.find(type);
{
// Is the type already supported?
TocList::const_iterator it = tocs_.find(type);
- LASSERT(it != tocs_.end(), { return lyx::make_shared<Toc>(); });
+ LASSERT(it != tocs_.end(), { return make_shared<Toc>(); });
shared_ptr<Toc> TocBackend::toc(string const & type)
{
TocList::const_iterator it = tocs_.find(type);
shared_ptr<Toc> TocBackend::toc(string const & type)
{
TocList::const_iterator it = tocs_.find(type);
- if (it == tocs_.end()) {
- it = tocs_.insert(std::make_pair(type, lyx::make_shared<Toc>())).first;
- }
+ if (it == tocs_.end())
+ it = tocs_.insert(make_pair(type, make_shared<Toc>())).first;
-docstring TocBackend::outlinerName(std::string const & type) const
+docstring TocBackend::outlinerName(string const & type) const
{
return translateIfPossible(
buffer_->params().documentClass().outlinerName(type));
{
return translateIfPossible(
buffer_->params().documentClass().outlinerName(type));
+using std::shared_ptr;
+
namespace lyx {
class Buffer;
namespace lyx {
class Buffer;
///
void clear() { map_.clear(); };
private:
///
void clear() { map_.clear(); };
private:
- typedef std::map<std::string, shared_ptr<TocBuilder> > map_t;
+ typedef std::map<std::string, shared_ptr<TocBuilder>> map_t;
#include <QProxyStyle>
#endif
#include <QProxyStyle>
#endif
-#include "support/shared_ptr.h"
-
#include <vector>
using namespace std;
#include <vector>
using namespace std;
func_.setOrigin(origin);
}
func_.setOrigin(origin);
}
- // shared_ptr<MenuDefinition> needs this apprently...
- ~MenuItem() {}
-
/// The label of a given menuitem
QString label() const
{
/// The label of a given menuitem
QString label() const
{
TocModel::TocModel(QObject * parent)
: model_(new TocTypeModel(parent)),
sorted_model_(new QSortFilterProxyModel(parent)),
TocModel::TocModel(QObject * parent)
: model_(new TocTypeModel(parent)),
sorted_model_(new QSortFilterProxyModel(parent)),
- is_sorted_(false), toc_(lyx::make_shared<Toc const>()),
+ is_sorted_(false), toc_(new Toc()),
maxdepth_(0), mindepth_(0)
{
sorted_model_->setSortLocaleAware(true);
maxdepth_(0), mindepth_(0)
{
sorted_model_->setSortLocaleAware(true);
{
model_->blockSignals(true);
model_->clear();
{
model_->blockSignals(true);
model_->clear();
- toc_ = lyx::make_shared<Toc const>();
+ toc_ = make_shared<Toc>();
model_->blockSignals(false);
}
model_->blockSignals(false);
}
-#include "support/shared_ptr.h"
-
#include <QHash>
#include <QSortFilterProxyModel>
#include <QHash>
#include <QSortFilterProxyModel>
///
TocModel(QObject * parent);
///
///
TocModel(QObject * parent);
///
- void reset(shared_ptr<Toc const>);
+ void reset(std::shared_ptr<Toc const>);
- shared_ptr<Toc const> toc_;
+ std::shared_ptr<Toc const> toc_;
#ifndef GRAPHICSCACHE_H
#define GRAPHICSCACHE_H
#ifndef GRAPHICSCACHE_H
#define GRAPHICSCACHE_H
-#include "support/shared_ptr.h"
-
-#include <vector>
*
* You have been warned!
*/
*
* You have been warned!
*/
- typedef shared_ptr<CacheItem> ItemPtr;
+ typedef std::shared_ptr<CacheItem> ItemPtr;
///
ItemPtr const item(support::FileName const & file) const;
///
ItemPtr const item(support::FileName const & file) const;
bool remove_loaded_file_;
/// The image and its loading status.
bool remove_loaded_file_;
/// The image and its loading status.
- shared_ptr<Image> image_;
+ std::shared_ptr<Image> image_;
if (cc_.connected())
cc_.disconnect();
if (cc_.connected())
cc_.disconnect();
string const text = success ? "succeeded" : "failed";
LYXERR(Debug::GRAPHICS, "Image conversion " << text << '.');
string const text = success ? "succeeded" : "failed";
LYXERR(Debug::GRAPHICS, "Image conversion " << text << '.');
- file_to_load_ = converter_.get() ?
- FileName(converter_->convertedFile()) : FileName();
+ file_to_load_ = converter_ ? FileName(converter_->convertedFile())
+ : FileName();
converter_.reset();
cc_.disconnect();
converter_.reset();
cc_.disconnect();
#include "support/bind.h"
#include "support/bind.h"
+#include <memory>
+#include <set>
using namespace std;
using namespace lyx::support;
using namespace std;
using namespace lyx::support;
//
/////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////
-typedef shared_ptr<Image> ImagePtr;
+typedef std::shared_ptr<Image> ImagePtr;
class Loader::Impl : public boost::signals::trackable {
public:
class Loader::Impl : public boost::signals::trackable {
public:
#include "support/bind.h"
#include "support/TempFile.h"
#include "support/bind.h"
#include "support/TempFile.h"
#include <fstream>
#include <iomanip>
#include <fstream>
#include <iomanip>
+#include <memory>
+#include <sstream>
/** cache_ allows easy retrieval of already-generated images
* using the LaTeX snippet as the identifier.
*/
/** cache_ allows easy retrieval of already-generated images
* using the LaTeX snippet as the identifier.
*/
- typedef shared_ptr<PreviewImage> PreviewImagePtr;
+ typedef std::shared_ptr<PreviewImage> PreviewImagePtr;
///
typedef map<string, PreviewImagePtr> Cache;
///
///
typedef map<string, PreviewImagePtr> Cache;
///
dpoint = from_utf8(lyxrc.default_decimal_point);
} else {
cellInfo(cell).alignment = align;
dpoint = from_utf8(lyxrc.default_decimal_point);
} else {
cellInfo(cell).alignment = align;
- cellInset(cell).get()->setContentAlignment(align);
+ cellInset(cell)->setContentAlignment(align);
if (getAlignment(cell) == LYX_ALIGN_DECIMAL) {
// copy cell and split in 2
if (getAlignment(cell) == LYX_ALIGN_DECIMAL) {
// copy cell and split in 2
- InsetTableCell head = InsetTableCell(*cellInset(cell).get());
+ InsetTableCell head = InsetTableCell(*cellInset(cell));
head.setBuffer(buffer());
DocIterator dit = cellInset(cell)->getText(0)->macrocontextPosition();
dit.pop_back();
head.setBuffer(buffer());
DocIterator dit = cellInset(cell)->getText(0)->macrocontextPosition();
dit.pop_back();
// determine horizontal offset because of decimal align (if necessary)
int decimal_width = 0;
if (tabular.getAlignment(cell) == LYX_ALIGN_DECIMAL) {
// determine horizontal offset because of decimal align (if necessary)
int decimal_width = 0;
if (tabular.getAlignment(cell) == LYX_ALIGN_DECIMAL) {
- InsetTableCell tail = InsetTableCell(*tabular.cellInset(cell).get());
+ InsetTableCell tail = InsetTableCell(*tabular.cellInset(cell));
tail.setBuffer(tabular.buffer());
// we need to set macrocontext position everywhere
// otherwise we crash with nested insets (e.g. footnotes)
tail.setBuffer(tabular.buffer());
// we need to set macrocontext position everywhere
// otherwise we crash with nested insets (e.g. footnotes)
}
// check if there is already a caption
bool have_caption = false;
}
// check if there is already a caption
bool have_caption = false;
- InsetTableCell itc = InsetTableCell(*tabular.cellInset(cur.idx()).get());
+ InsetTableCell itc = InsetTableCell(*tabular.cellInset(cur.idx()));
ParagraphList::const_iterator pit = itc.paragraphs().begin();
ParagraphList::const_iterator pend = itc.paragraphs().end();
for (; pit != pend; ++pit) {
ParagraphList::const_iterator pit = itc.paragraphs().begin();
ParagraphList::const_iterator pend = itc.paragraphs().end();
for (; pit != pend; ++pit) {
#include "InsetText.h"
#include "Length.h"
#include "InsetText.h"
#include "Length.h"
-#include "support/shared_ptr.h"
-
#include <climits>
#include <iosfwd>
#include <climits>
#include <iosfwd>
+
+using std::shared_ptr;
+
namespace lyx {
class Buffer;
namespace lyx {
class Buffer;
#include "LayoutEnums.h"
#include "support/docstream.h"
#include "LayoutEnums.h"
#include "support/docstream.h"
-#include "support/shared_ptr.h"
#include "support/strfwd.h"
#include <deque>
#include "support/strfwd.h"
#include <deque>
// own these pointers and how they will be deleted, so we use shared
// pointers.
///
// own these pointers and how they will be deleted, so we use shared
// pointers.
///
- typedef shared_ptr<html::StartTag> TagPtr;
+ typedef std::shared_ptr<html::StartTag> TagPtr;
typedef std::deque<TagPtr> TagDeque;
///
template <typename T>
typedef std::deque<TagPtr> TagDeque;
///
template <typename T>
- shared_ptr<T> makeTagPtr(T const & tag)
- { return shared_ptr<T>(new T(tag)); }
+ TagPtr makeTagPtr(T const & tag) { return std::make_shared<T>(tag); }
///
TagDeque pending_tags_;
///
///
TagDeque pending_tags_;
///
namespace ForkedCallsController {
namespace ForkedCallsController {
-typedef shared_ptr<ForkedProcess> ForkedProcessPtr;
+typedef std::shared_ptr<ForkedProcess> ForkedProcessPtr;
typedef list<ForkedProcessPtr> ListType;
typedef ListType::iterator iterator;
typedef list<ForkedProcessPtr> ListType;
typedef ListType::iterator iterator;
#ifndef FORKEDCALLS_H
#define FORKEDCALLS_H
#ifndef FORKEDCALLS_H
#define FORKEDCALLS_H
-#include "support/shared_ptr.h"
#include "support/strfwd.h"
#include <boost/signal.hpp>
#include "support/strfwd.h"
#include <boost/signal.hpp>
# include <sys/types.h>
#endif
# include <sys/types.h>
#endif
+#include <memory>
+
+
+using std::shared_ptr;
+
namespace lyx {
namespace support {
namespace lyx {
namespace support {
std::string const & lpath = empty_string());
///
virtual shared_ptr<ForkedProcess> clone() const {
std::string const & lpath = empty_string());
///
virtual shared_ptr<ForkedProcess> clone() const {
- return shared_ptr<ForkedProcess>(new ForkedCall(*this));
+ return std::make_shared<ForkedCall>(*this);
}
/** Start the child process.
}
/** Start the child process.
Systemcall.cpp \
Systemcall.h \
SystemcallPrivate.h \
Systemcall.cpp \
Systemcall.h \
SystemcallPrivate.h \
TempFile.cpp \
TempFile.h \
textutils.h \
TempFile.cpp \
TempFile.h \
textutils.h \
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file shared_ptr.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Peter Kümmel
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef LYX_SHARED_PTR_H
-#define LYX_SHARED_PTR_H
-
-#include <memory>
-
-namespace lyx
-{
- using std::shared_ptr;
- using std::make_shared;
- using std::const_pointer_cast;
-}
-
-
-#endif