[Libreoffice-commits] libcdr.git: src/lib
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Apr 14 18:06:59 UTC 2021
src/lib/CDRContentCollector.cpp | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit b14f6a1f17652aa842b23c66236610aea5233aa6
Author: Andrey Sobolev <andrey.n.sobolev at gmail.com>
AuthorDate: Wed Sep 23 00:02:16 2020 +0500
Commit: Fridrich Štrba <fridrich.strba at bluewin.ch>
CommitDate: Wed Apr 14 20:06:28 2021 +0200
tdf#98994 Fixes parsing CDR7 files with no bbox surrounding text objects
As of now, libcdr gets the coordinates of a text object from the BoundingBox (bbox entry)
corresponding to the object. However, there are certain CDR version 700 files that do not contain
bounding boxes for text objects. In this case the coordinates of the text object can be found from
the transform (trfd entry) for the text object. This commit provides the coordinates from trfd if
the bbox coordinates of the object are 0 (the case with no bbox).
Change-Id: I68a7aefbb8a8e2b24466f9dd3fd5e460e28ad9e7
diff --git a/src/lib/CDRContentCollector.cpp b/src/lib/CDRContentCollector.cpp
index f1a5817..46e2fa6 100644
--- a/src/lib/CDRContentCollector.cpp
+++ b/src/lib/CDRContentCollector.cpp
@@ -452,6 +452,13 @@ void libcdr::CDRContentCollector::_flushCurrentPath()
x2 = m_currentBBox.getMinX() + m_currentBBox.getWidth();
}
}
+ else if (!m_currentTransforms.empty())
+ {
+ x1 = m_currentTransforms.getTranslateX();
+ y1 = m_currentTransforms.getTranslateY();
+ x2 = x1;
+ y2 = y1;
+ }
CDRTransform tmpTrafo(1.0, 0.0, -m_page.offsetX, 0.0, 1.0, -m_page.offsetY);
tmpTrafo.applyToPoint(x1, y1);
More information about the Libreoffice-commits
mailing list