[Libreoffice-commits] libcdr.git: src/lib
David Tardon
dtardon at redhat.com
Wed Jan 10 12:48:29 UTC 2018
src/lib/CMXParser.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 786a66f23c75ad9873afcb2a292a6fcc69d0deac
Author: David Tardon <dtardon at redhat.com>
Date: Wed Jan 10 13:47:54 2018 +0100
ofz#4961 fix division by 0
Change-Id: Ie9eca0bbf540adb98505215e1017b636626fbfe9
diff --git a/src/lib/CMXParser.cpp b/src/lib/CMXParser.cpp
index 57a6f5e..33aa40a 100644
--- a/src/lib/CMXParser.cpp
+++ b/src/lib/CMXParser.cpp
@@ -2354,7 +2354,11 @@ libcdr::CDRLineStyle libcdr::CMXParser::getLineStyle(unsigned id)
if (iterPen != m_parserState.m_pens.end())
{
tmpLineStyle.lineWidth = iterPen->second.m_width * (iterPen->second.m_matrix.getScaleX()+iterPen->second.m_matrix.getScaleY())/ 2.0;
- tmpLineStyle.stretch = iterPen->second.m_aspect * (iterPen->second.m_matrix.getScaleX()/iterPen->second.m_matrix.getScaleY());
+ if (iterPen->second.m_matrix.getScaleY() != 0)
+ tmpLineStyle.stretch = iterPen->second.m_matrix.getScaleX()/iterPen->second.m_matrix.getScaleY();
+ else
+ tmpLineStyle.stretch = 1.0;
+ tmpLineStyle.stretch *= iterPen->second.m_aspect;
tmpLineStyle.angle = iterPen->second.m_angle;
}
std::map<unsigned, std::vector<unsigned> >::const_iterator iterDash = m_parserState.m_dashArrays.find(dashArrayId);
More information about the Libreoffice-commits
mailing list