summaryrefslogtreecommitdiffstats
path: root/svgio/source/svgreader/svgnode.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
commit9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch)
tree812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /svgio/source/svgreader/svgnode.cxx
parentReleasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff)
downloadlibreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz
libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'svgio/source/svgreader/svgnode.cxx')
-rw-r--r--svgio/source/svgreader/svgnode.cxx36
1 files changed, 7 insertions, 29 deletions
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx
index 7a45c681f1..8fdc29eab7 100644
--- a/svgio/source/svgreader/svgnode.cxx
+++ b/svgio/source/svgreader/svgnode.cxx
@@ -691,45 +691,23 @@ namespace {
}
}
- double SvgNode::getCurrentFontSizeInherited() const
- {
- if(getParent())
- {
- return getParent()->getCurrentFontSize();
- }
- else
- {
- return 0.0;
- }
- }
-
double SvgNode::getCurrentFontSize() const
{
if(getSvgStyleAttributes())
return getSvgStyleAttributes()->getFontSizeNumber().solve(*this, NumberType::xcoordinate);
- return getCurrentFontSizeInherited();
- }
-
- double SvgNode::getCurrentXHeightInherited() const
- {
if(getParent())
- {
- return getParent()->getCurrentXHeight();
- }
- else
- {
- return 0.0;
- }
+ return getParent()->getCurrentFontSize();
+
+ return 0.0;
}
double SvgNode::getCurrentXHeight() const
{
- if(getSvgStyleAttributes())
- // for XHeight, use FontSize currently
- return getSvgStyleAttributes()->getFontSizeNumber().solve(*this, NumberType::ycoordinate);
-
- return getCurrentXHeightInherited();
+ // https://drafts.csswg.org/css-values-4/#ex
+ // for XHeight, use 0.5em fallback currently
+ // FIXME: use "x-height of the first available font"
+ return getCurrentFontSize() * 0.5;
}
void SvgNode::setId(OUString const & rId)