summaryrefslogtreecommitdiffstats
path: root/svgio/source
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:44:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:44:47 +0000
commit91fe6b97952aa6f7cef58327fd085a17db38ad95 (patch)
tree7a4412295bfb80e15a4936fe67d4bd7b96458ce8 /svgio/source
parentReleasing progress-linux version 4:24.2.1-4~progress7.99u1. (diff)
downloadlibreoffice-91fe6b97952aa6f7cef58327fd085a17db38ad95.tar.xz
libreoffice-91fe6b97952aa6f7cef58327fd085a17db38ad95.zip
Merging upstream version 4:24.2.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'svgio/source')
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx38
-rw-r--r--svgio/source/svgreader/svgtoken.cxx1
2 files changed, 38 insertions, 1 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 731df59aee..19070989bb 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -850,7 +850,8 @@ namespace svgio::svgreader
const basegfx::B2DRange aTargetRange(0.0, 0.0, fTargetWidth, fTargetHeight);
const SvgAspectRatio& rRatio = rMarker.getSvgAspectRatio();
- if(rRatio.isSet())
+
+ if(rRatio.isSet() && Overflow::visible != rMarker.getSvgStyleAttributes()->getOverflow())
{
// let mapping be created from SvgAspectRatio
rMarkerTransform = rRatio.createMapping(aTargetRange, aPrimitiveRange);
@@ -1279,6 +1280,7 @@ namespace svgio::svgreader
maTextAlign(TextAlign::notset),
maTextDecoration(TextDecoration::notset),
maTextAnchor(TextAnchor::notset),
+ maOverflow(Overflow::notset),
maVisibility(Visibility::notset),
maFillRule(FillRule::notset),
maClipRule(FillRule::notset),
@@ -1822,6 +1824,21 @@ namespace svgio::svgreader
}
break;
}
+ case SVGToken::Overflow:
+ {
+ if(!aContent.isEmpty())
+ {
+ if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"visible"))
+ {
+ setOverflow(Overflow::visible);
+ }
+ else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"hidden"))
+ {
+ setOverflow(Overflow::hidden);
+ }
+ }
+ break;
+ }
case SVGToken::Visibility:
{
if(!aContent.isEmpty())
@@ -2316,6 +2333,25 @@ namespace svgio::svgreader
return SvgNumber(1.0);
}
+ Overflow SvgStyleAttributes::getOverflow() const
+ {
+ if(Overflow::notset != maOverflow)
+ {
+ return maOverflow;
+ }
+
+ if(mrOwner.hasLocalCssStyle())
+ {
+ const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
+ if (pSvgStyleAttributes)
+ {
+ return pSvgStyleAttributes->getOverflow();
+ }
+ }
+
+ return Overflow::hidden;
+ }
+
Visibility SvgStyleAttributes::getVisibility() const
{
if(Visibility::notset == maVisibility || Visibility::inherit == maVisibility)
diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx
index fa28c8647c..968ead0483 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -110,6 +110,7 @@ constexpr auto aSVGTokenMap = frozen::make_unordered_map<std::u16string_view, SV
{ u"visibility", SVGToken::Visibility },
{ u"title", SVGToken::Title },
{ u"desc", SVGToken::Desc },
+ { u"overflow", SVGToken::Overflow },
{ u"preserveAspectRatio", SVGToken::PreserveAspectRatio },
{ u"defer", SVGToken::Defer },
{ u"none", SVGToken::None },