aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-05-28 00:49:18 +0200
committerm-holger <m-holger@kubitscheck.org>2023-06-09 16:42:11 +0200
commit7bc0f1d828eccbc5a277b75aedc85b7523919f87 (patch)
treebdf203f336bc7671cf4f650a9bf142f5b72dd6f6 /examples
parent22c6b8ccbc9693d2e9c9015a976188fc1e00e517 (diff)
downloadqpdf-7bc0f1d828eccbc5a277b75aedc85b7523919f87.tar.zst
Code tidy - Clang-Tidy rule modernize-use-emplace
Diffstat (limited to 'examples')
-rw-r--r--examples/pdf-create.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/examples/pdf-create.cc b/examples/pdf-create.cc
index c793b5f8..7b44fb7f 100644
--- a/examples/pdf-create.cc
+++ b/examples/pdf-create.cc
@@ -50,28 +50,28 @@ ImageProvider::ImageProvider(std::string const& color_space, std::string const&
{
if (color_space == "/DeviceCMYK") {
j_color_space = JCS_CMYK;
- stripes.push_back(std::string("\xff\x00\x00\x00", 4));
- stripes.push_back(std::string("\x00\xff\x00\x00", 4));
- stripes.push_back(std::string("\x00\x00\xff\x00", 4));
- stripes.push_back(std::string("\xff\x00\xff\x00", 4));
- stripes.push_back(std::string("\xff\xff\x00\x00", 4));
- stripes.push_back(std::string("\x00\x00\x00\xff", 4));
+ stripes.emplace_back("\xff\x00\x00\x00", 4);
+ stripes.emplace_back("\x00\xff\x00\x00", 4);
+ stripes.emplace_back("\x00\x00\xff\x00", 4);
+ stripes.emplace_back("\xff\x00\xff\x00", 4);
+ stripes.emplace_back("\xff\xff\x00\x00", 4);
+ stripes.emplace_back("\x00\x00\x00\xff", 4);
} else if (color_space == "/DeviceRGB") {
j_color_space = JCS_RGB;
- stripes.push_back(std::string("\xff\x00\x00", 3));
- stripes.push_back(std::string("\x00\xff\x00", 3));
- stripes.push_back(std::string("\x00\x00\xff", 3));
- stripes.push_back(std::string("\xff\x00\xff", 3));
- stripes.push_back(std::string("\xff\xff\x00", 3));
- stripes.push_back(std::string("\x00\x00\x00", 3));
+ stripes.emplace_back("\xff\x00\x00", 3);
+ stripes.emplace_back("\x00\xff\x00", 3);
+ stripes.emplace_back("\x00\x00\xff", 3);
+ stripes.emplace_back("\xff\x00\xff", 3);
+ stripes.emplace_back("\xff\xff\x00", 3);
+ stripes.emplace_back("\x00\x00\x00", 3);
} else if (color_space == "/DeviceGray") {
j_color_space = JCS_GRAYSCALE;
- stripes.push_back(std::string("\xee", 1));
- stripes.push_back(std::string("\xcc", 1));
- stripes.push_back(std::string("\x99", 1));
- stripes.push_back(std::string("\x66", 1));
- stripes.push_back(std::string("\x33", 1));
- stripes.push_back(std::string("\x00", 1));
+ stripes.emplace_back("\xee", 1);
+ stripes.emplace_back("\xcc", 1);
+ stripes.emplace_back("\x99", 1);
+ stripes.emplace_back("\x66", 1);
+ stripes.emplace_back("\x33", 1);
+ stripes.emplace_back("\x00", 1);
}
}
@@ -335,13 +335,13 @@ create_pdf(char const* filename)
">>"_qpdf);
std::vector<std::string> color_spaces;
- color_spaces.push_back("/DeviceCMYK");
- color_spaces.push_back("/DeviceRGB");
- color_spaces.push_back("/DeviceGray");
+ color_spaces.emplace_back("/DeviceCMYK");
+ color_spaces.emplace_back("/DeviceRGB");
+ color_spaces.emplace_back("/DeviceGray");
std::vector<std::string> filters;
- filters.push_back("null");
- filters.push_back("/DCTDecode");
- filters.push_back("/RunLengthDecode");
+ filters.emplace_back("null");
+ filters.emplace_back("/DCTDecode");
+ filters.emplace_back("/RunLengthDecode");
QPDFPageDocumentHelper dh(pdf);
for (auto const& color_space: color_spaces) {
for (auto const& filter: filters) {