[poppler] cpp/poppler-image.cpp cpp/poppler-page.cpp .gitlab-ci.yml poppler/ViewerPreferences.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 2 21:20:05 UTC 2019


 .gitlab-ci.yml               |    2 +-
 cpp/poppler-image.cpp        |   10 +++++-----
 cpp/poppler-page.cpp         |    2 +-
 poppler/ViewerPreferences.cc |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 77aa3a007598c4c4836f45d355642d7240f7432b
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Dec 2 20:03:33 2019 +0100

    Enable modernize-use-emplace
    
    Not claiming copyright since it's a mechanical change

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4dbc4d78..086f2ee7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -40,7 +40,7 @@ build_clang_libcpp:
   script:
     - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
     - mkdir -p build && cd build
-    - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
+    - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
     - ninja
     - ctest --output-on-failure
 
diff --git a/cpp/poppler-image.cpp b/cpp/poppler-image.cpp
index 48f021bf..0b3908ac 100644
--- a/cpp/poppler-image.cpp
+++ b/cpp/poppler-image.cpp
@@ -480,16 +480,16 @@ std::vector<std::string> image::supported_image_formats()
 {
     std::vector<std::string> formats;
 #if defined(ENABLE_LIBPNG)
-    formats.push_back("png");
+    formats.emplace_back("png");
 #endif
 #if defined(ENABLE_LIBJPEG)
-    formats.push_back("jpeg");
-    formats.push_back("jpg");
+    formats.emplace_back("jpeg");
+    formats.emplace_back("jpg");
 #endif
 #if defined(ENABLE_LIBTIFF)
-    formats.push_back("tiff");
+    formats.emplace_back("tiff");
 #endif
-    formats.push_back("pnm");
+    formats.emplace_back("pnm");
     return formats;
 }
 
diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp
index 1f767584..f9cba3e5 100644
--- a/cpp/poppler-page.cpp
+++ b/cpp/poppler-page.cpp
@@ -384,7 +384,7 @@ std::vector<text_box> page::text_list() const
             tb.m_data->char_bboxes.reserve(word->getLength());
             for (int j = 0; j < word->getLength(); j ++) {
                 word->getCharBBox(j, &xMin, &yMin, &xMax, &yMax);
-                tb.m_data->char_bboxes.push_back({xMin, yMin, xMax-xMin, yMax-yMin});
+                tb.m_data->char_bboxes.emplace_back(xMin, yMin, xMax-xMin, yMax-yMin);
             }
 
             output_list.push_back(std::move(tb));
diff --git a/poppler/ViewerPreferences.cc b/poppler/ViewerPreferences.cc
index 0ab4523f..3e96283f 100644
--- a/poppler/ViewerPreferences.cc
+++ b/poppler/ViewerPreferences.cc
@@ -125,7 +125,7 @@ ViewerPreferences::ViewerPreferences(Dict *prefDict)
       if (obj2.isInt() && (pageNumber1 = obj2.getInt()) >= 1 &&
           obj3.isInt() && (pageNumber2 = obj3.getInt()) >= 1 &&
           pageNumber1 < pageNumber2) {
-        printPageRange.push_back(std::pair<int, int>(pageNumber1, pageNumber2));
+        printPageRange.emplace_back(pageNumber1, pageNumber2);
       } else {
         printPageRange.clear();
         break;


More information about the poppler mailing list