[Libreoffice-commits] core.git: include/vcl sd/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 19 07:06:32 UTC 2020


 include/vcl/pdfread.hxx              |   15 ++++++++++-----
 sd/source/filter/pdf/sdpdffilter.cxx |    6 +++---
 2 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 1e778cf6fae707480909d76fa4c1c58af7e8c62a
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Aug 18 21:01:33 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Aug 19 09:05:55 2020 +0200

    vcl, sd: various small cleanups
    
    Change-Id: Ic7ad2e044cc1807b105bcad2daf978224b96f298
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100956
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/include/vcl/pdfread.hxx b/include/vcl/pdfread.hxx
index f1534c326ee6..4b76d9360f2b 100644
--- a/include/vcl/pdfread.hxx
+++ b/include/vcl/pdfread.hxx
@@ -42,7 +42,7 @@ struct PDFGraphicAnnotation
     css::util::DateTime maDateTime;
 };
 
-struct PDFGraphicResult
+class PDFGraphicResult
 {
     Graphic maGraphic;
     // Size in HMM
@@ -50,13 +50,18 @@ struct PDFGraphicResult
 
     std::vector<PDFGraphicAnnotation> maAnnotations;
 
-    PDFGraphicResult(Graphic const& rGraphic, Size const& rSize,
-                     std::vector<PDFGraphicAnnotation> const& aAnnotations)
-        : maGraphic(rGraphic)
+public:
+    PDFGraphicResult(Graphic aGraphic, Size const& rSize,
+                     std::vector<PDFGraphicAnnotation> aAnnotations)
+        : maGraphic(std::move(aGraphic))
         , maSize(rSize)
-        , maAnnotations(aAnnotations)
+        , maAnnotations(std::move(aAnnotations))
     {
     }
+
+    const Graphic& GetGraphic() const { return maGraphic; }
+    const Size& GetSize() const { return maSize; }
+    const std::vector<PDFGraphicAnnotation>& GetAnnotations() const { return maAnnotations; }
 };
 
 /// Import PDF as Graphic images (1 per page), but not loaded yet.
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 7072100eb0cd..07b6cd08ff9f 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -64,8 +64,8 @@ bool SdPdfFilter::Import()
 
     for (vcl::PDFGraphicResult const& rPDFGraphicResult : aGraphics)
     {
-        const Graphic& rGraphic = rPDFGraphicResult.maGraphic;
-        const Size& aSizeHMM = rPDFGraphicResult.maSize;
+        const Graphic& rGraphic = rPDFGraphicResult.GetGraphic();
+        const Size& aSizeHMM = rPDFGraphicResult.GetSize();
 
         const sal_Int32 nPageNumber = rGraphic.getPageNumber();
         assert(nPageNumber >= 0 && o3tl::make_unsigned(nPageNumber) < aGraphics.size());
@@ -80,7 +80,7 @@ bool SdPdfFilter::Import()
                                                  tools::Rectangle(Point(), aSizeHMM));
         pPage->InsertObject(pSdrGrafObj);
 
-        for (auto const& rPDFAnnotation : rPDFGraphicResult.maAnnotations)
+        for (auto const& rPDFAnnotation : rPDFGraphicResult.GetAnnotations())
         {
             uno::Reference<office::XAnnotation> xAnnotation;
             pPage->createAnnotation(xAnnotation);


More information about the Libreoffice-commits mailing list