summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAdam Reichold <adam.reichold@t-online.de>2018-08-31 18:47:52 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2018-08-31 17:55:37 +0000
commit9bfc10eecb57354270806aa1d9278eebb1db2287 (patch)
tree5cc0fea6a2148b26a3dcd1e34d67c263aa264ec9 /cpp
parentd2fa4a727fc994256219a4c4f777a1c38dcc26c5 (diff)
Bump required C++ standard version to C++14 and convert a few hopefully obvious call sites where types are repeated to using std::make_unique.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/poppler-image.cpp2
-rw-r--r--cpp/poppler-page.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/cpp/poppler-image.cpp b/cpp/poppler-image.cpp
index 6bd43f7d..7c9bdad7 100644
--- a/cpp/poppler-image.cpp
+++ b/cpp/poppler-image.cpp
@@ -125,7 +125,7 @@ image_private *image_private::create_data(int width, int height, image::format_e
return nullptr;
}
- std::unique_ptr<image_private> d(new image_private(width, height, format));
+ auto d = std::make_unique<image_private>(width, height, format);
d->bytes_num = bpr * height;
d->data = reinterpret_cast<char *>(std::malloc(d->bytes_num));
if (!d->data) {
diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp
index c3862cef..8280c14f 100644
--- a/cpp/poppler-page.cpp
+++ b/cpp/poppler-page.cpp
@@ -336,13 +336,13 @@ std::vector<text_box> page::text_list() const
std::vector<text_box> output_list;
/* config values are same with Qt5 Page::TextList() */
- std::unique_ptr<TextOutputDev> output_dev{
- new TextOutputDev(nullptr, /* char* fileName */
- gFalse, /* GBool physLayoutA */
- 0, /* double fixedPitchA */
- gFalse, /* GBool rawOrderA */
- gFalse) /* GBool append */
- };
+ auto output_dev = std::make_unique<TextOutputDev>(
+ nullptr, /* char* fileName */
+ gFalse, /* GBool physLayoutA */
+ 0, /* double fixedPitchA */
+ gFalse, /* GBool rawOrderA */
+ gFalse /* GBool append */
+ );
/*
* config values are same with Qt5 Page::TextList(),