summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/pdfread.hxx15
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx6
2 files changed, 13 insertions, 8 deletions
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);