summaryrefslogtreecommitdiff
path: root/cpp/poppler-image.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-05-05 15:12:42 +0200
committerAlbert Astals Cid <aacid@kde.org>2017-05-05 15:12:42 +0200
commitd73bcd3721f3b53bb97241cc53a6abf807aff782 (patch)
tree32ef3e45ae9fddbdd648fad2666a01c74c6dafbf /cpp/poppler-image.cpp
parent9ad9d92591a6389f84919ff2de3668c2b6158dc9 (diff)
auto_ptr -> unique_ptr
Diffstat (limited to 'cpp/poppler-image.cpp')
-rw-r--r--cpp/poppler-image.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/cpp/poppler-image.cpp b/cpp/poppler-image.cpp
index 23306dfb..359298c7 100644
--- a/cpp/poppler-image.cpp
+++ b/cpp/poppler-image.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2010-2011, Pino Toscano <pino@kde.org>
* Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
+ * Copyright (C) 2017, Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -115,7 +116,7 @@ image_private *image_private::create_data(int width, int height, image::format_e
return 0;
}
- std::auto_ptr<image_private> d(new image_private(width, height, format));
+ std::unique_ptr<image_private> d(new image_private(width, height, format));
d->bytes_num = bpr * height;
d->data = reinterpret_cast<char *>(std::malloc(d->bytes_num));
if (!d->data) {
@@ -138,13 +139,13 @@ image_private *image_private::create_data(char *data, int width, int height, ima
return 0;
}
- std::auto_ptr<image_private> d(new image_private(width, height, format));
+ image_private *d = new image_private(width, height, format);
d->bytes_num = bpr * height;
d->data = data;
d->own_data = false;
d->bytes_per_row = bpr;
- return d.release();
+ return d;
}
/**
@@ -345,7 +346,7 @@ bool image::save(const std::string &file_name, const std::string &out_format, in
std::string fmt = out_format;
std::transform(fmt.begin(), fmt.end(), fmt.begin(), tolower);
- std::auto_ptr<ImgWriter> w;
+ std::unique_ptr<ImgWriter> w;
const int actual_dpi = dpi == -1 ? 75 : dpi;
if (false) {
}