summaryrefslogtreecommitdiffstats
path: root/svgio/source/svgreader/svgnode.cxx
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 /svgio/source/svgreader/svgnode.cxx
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 '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)