summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Sobolev <andrey.n.sobolev@gmail.com>2020-09-23 00:02:16 +0500
committerFridrich Štrba <fridrich.strba@bluewin.ch>2021-04-14 20:06:28 +0200
commitb14f6a1f17652aa842b23c66236610aea5233aa6 (patch)
treef34242158bce367288cd5fafd96c46869e0f719b
parent65a34c0b3fc58d8d7e209ad71af84a03802ab579 (diff)
tdf#98994 Fixes parsing CDR7 files with no bbox surrounding text objectsHEADmaster
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
-rw-r--r--src/lib/CDRContentCollector.cpp7
1 files changed, 7 insertions, 0 deletions
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);