summaryrefslogtreecommitdiffstats
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
commit8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59 (patch)
treeca2b0cc4fba88107f5f6e740285184a061011866 /vcl/source/gdi
parentAdding debian version 4:24.2.3-2. (diff)
downloadlibreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.tar.xz
libreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx14
-rw-r--r--vcl/source/gdi/sallayout.cxx33
2 files changed, 21 insertions, 26 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index ff7383d7be..16b0b5e235 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2746,15 +2746,11 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace,
appendDouble(aRect.GetWidth() * fScale, aContents);
aContents.append(" 0 0 ");
appendDouble(aRect.GetHeight() * fScale, aContents);
- aContents.append(
- + " "
- + OString::number(aRect.getX())
- + " "
- + OString::number(aRect.getY())
- + " cm "
- "/Im"
- + OString::number(nObject)
- + " Do Q\n");
+ aContents.append(" ");
+ appendDouble(aRect.getX() * fScale, aContents);
+ aContents.append(" ");
+ appendDouble(aRect.getY() * fScale, aContents);
+ aContents.append(" cm /Im" + OString::number(nObject) + " Do Q\n");
}
const auto& rOutline = rGlyph.getOutline();
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 28138c3f61..3b1279dd1f 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -220,11 +220,10 @@ static double trimInsignificant(double n)
return std::abs(n) >= 0x1p53 ? n : std::round(n * 1e5) / 1e5;
}
-bool SalLayout::GetBoundRect(tools::Rectangle& rRect) const
+bool SalLayout::GetBoundRect(basegfx::B2DRectangle& rRect) const
{
bool bRet = false;
-
- basegfx::B2DRectangle aUnion;
+ rRect.reset();
basegfx::B2DRectangle aRectangle;
basegfx::B2DPoint aPos;
@@ -240,28 +239,28 @@ bool SalLayout::GetBoundRect(tools::Rectangle& rRect) const
{
aRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(aPos));
// merge rectangle
- aUnion.expand(aRectangle);
+ rRect.expand(aRectangle);
}
bRet = true;
}
}
- if (aUnion.isEmpty())
- {
- rRect = {};
- }
- else
- {
- double l = rtl::math::approxFloor(trimInsignificant(aUnion.getMinX())),
- t = rtl::math::approxFloor(trimInsignificant(aUnion.getMinY())),
- r = rtl::math::approxCeil(trimInsignificant(aUnion.getMaxX())),
- b = rtl::math::approxCeil(trimInsignificant(aUnion.getMaxY()));
- assert(std::isfinite(l) && std::isfinite(t) && std::isfinite(r) && std::isfinite(b));
- rRect = tools::Rectangle(l, t, r, b);
- }
return bRet;
}
+tools::Rectangle SalLayout::BoundRect2Rectangle(basegfx::B2DRectangle& rRect)
+{
+ if (rRect.isEmpty())
+ return {};
+
+ double l = rtl::math::approxFloor(trimInsignificant(rRect.getMinX())),
+ t = rtl::math::approxFloor(trimInsignificant(rRect.getMinY())),
+ r = rtl::math::approxCeil(trimInsignificant(rRect.getMaxX())),
+ b = rtl::math::approxCeil(trimInsignificant(rRect.getMaxY()));
+ assert(std::isfinite(l) && std::isfinite(t) && std::isfinite(r) && std::isfinite(b));
+ return tools::Rectangle(l, t, r, b);
+}
+
SalLayoutGlyphs SalLayout::GetGlyphs() const
{
return SalLayoutGlyphs(); // invalid