diff options
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 16 | ||||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 22 |
2 files changed, 15 insertions, 23 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 6f2f1de42f72..e1ae905cef33 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -914,15 +914,13 @@ void ImpSdrPdfImport::ImportImage(std::unique_ptr<vcl::pdf::PDFiumPageObject> co break; } - float left; - float bottom; - float right; - float top; - if (!FPDFPageObj_GetBounds(pPageObject->getPointer(), &left, &bottom, &right, &top)) - { - SAL_WARN("sd.filter", "FAILED to get image bounds"); - } - + basegfx::B2DRectangle aBounds = pPageObject->getBounds(); + float left = aBounds.getMinX(); + // Upside down. + float bottom = aBounds.getMinY(); + float right = aBounds.getMaxX(); + // Upside down. + float top = aBounds.getMaxY(); tools::Rectangle aRect = PointsToLogic(left, right, top, bottom); aRect.AdjustRight(1); aRect.AdjustBottom(1); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 7af85573be40..69b7d17711a2 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -1535,9 +1535,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106702) if (pPageObject->getType() != vcl::pdf::PDFPageObjectType::Image) continue; - float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0; - FPDFPageObj_GetBounds(pPageObject->getPointer(), &fLeft, &fBottom, &fRight, &fTop); - nExpected = fTop; + // Top, but upside down. + nExpected = pPageObject->getBounds().getMaxY(); break; } @@ -1552,9 +1551,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106702) if (pPageObject->getType() != vcl::pdf::PDFPageObjectType::Image) continue; - float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0; - FPDFPageObj_GetBounds(pPageObject->getPointer(), &fLeft, &fBottom, &fRight, &fTop); - nActual = fTop; + // Top, but upside down. + nActual = pPageObject->getBounds().getMaxY(); break; } @@ -1593,9 +1591,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf113143) if (pPageObject->getType() != vcl::pdf::PDFPageObjectType::Image) continue; - float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0; - FPDFPageObj_GetBounds(pPageObject->getPointer(), &fLeft, &fBottom, &fRight, &fTop); - nLarger = fRight - fLeft; + nLarger = pPageObject->getBounds().getWidth(); break; } @@ -1610,9 +1606,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf113143) if (pPageObject->getType() != vcl::pdf::PDFPageObjectType::Image) continue; - float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0; - FPDFPageObj_GetBounds(pPageObject->getPointer(), &fLeft, &fBottom, &fRight, &fTop); - nSmaller = fRight - fLeft; + nSmaller = pPageObject->getBounds().getWidth(); break; } @@ -1652,8 +1646,8 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115262) for (int i = 0; i < nPageObjectCount; ++i) { std::unique_ptr<vcl::pdf::PDFiumPageObject> pPageObject = pPdfPage->getObject(i); - float fLeft = 0, fBottom = 0, fRight = 0, fTop = 0; - FPDFPageObj_GetBounds(pPageObject->getPointer(), &fLeft, &fBottom, &fRight, &fTop); + // Top, but upside down. + float fTop = pPageObject->getBounds().getMaxY(); if (pPageObject->getType() == vcl::pdf::PDFPageObjectType::Image) { |