[Libreoffice-commits] libmspub.git: 2 commits - src/lib
David Tardon
dtardon at redhat.com
Tue May 9 10:44:30 UTC 2017
src/lib/MSPUBCollector.cpp | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
New commits:
commit 860883fa6fa861f808c091a3cecd03aa351d87a8
Author: David Tardon <dtardon at redhat.com>
Date: Tue May 9 12:40:16 2017 +0200
use existing conv. functions
Change-Id: Ia2f5ab36ae42321771fd43e77b96b5a0b9452412
diff --git a/src/lib/MSPUBCollector.cpp b/src/lib/MSPUBCollector.cpp
index d703549..b071cb6 100644
--- a/src/lib/MSPUBCollector.cpp
+++ b/src/lib/MSPUBCollector.cpp
@@ -310,11 +310,8 @@ void MSPUBCollector::setShapeStretchBorderArt(unsigned seqNum)
void MSPUBCollector::setRectCoordProps(Coordinate coord, librevenge::RVNGPropertyList *props) const
{
- int xs = coord.m_xs, ys = coord.m_ys;
- double x_center = m_width / 2;
- double y_center = m_height / 2;
- props->insert("svg:x", x_center + (double)xs / EMUS_IN_INCH);
- props->insert("svg:y", y_center + (double)ys / EMUS_IN_INCH);
+ props->insert("svg:x", coord.getXIn(m_width));
+ props->insert("svg:y", coord.getYIn(m_width));
props->insert("svg:width", coord.getWidthIn());
props->insert("svg:height", coord.getHeightIn());
}
commit b14004f95982560820f63a44b18d99ff64438f64
Author: David Tardon <dtardon at redhat.com>
Date: Tue May 9 12:39:21 2017 +0200
ofz#1357 avoid integer overflow
Change-Id: I60b2118c0fad45c3bba2006f60636f20bb95eaf0
diff --git a/src/lib/MSPUBCollector.cpp b/src/lib/MSPUBCollector.cpp
index d900893..d703549 100644
--- a/src/lib/MSPUBCollector.cpp
+++ b/src/lib/MSPUBCollector.cpp
@@ -310,13 +310,13 @@ void MSPUBCollector::setShapeStretchBorderArt(unsigned seqNum)
void MSPUBCollector::setRectCoordProps(Coordinate coord, librevenge::RVNGPropertyList *props) const
{
- int xs = coord.m_xs, ys = coord.m_ys, xe = coord.m_xe, ye = coord.m_ye;
+ int xs = coord.m_xs, ys = coord.m_ys;
double x_center = m_width / 2;
double y_center = m_height / 2;
props->insert("svg:x", x_center + (double)xs / EMUS_IN_INCH);
props->insert("svg:y", y_center + (double)ys / EMUS_IN_INCH);
- props->insert("svg:width", (double)(xe - xs) / EMUS_IN_INCH);
- props->insert("svg:height", (double)(ye - ys) / EMUS_IN_INCH);
+ props->insert("svg:width", coord.getWidthIn());
+ props->insert("svg:height", coord.getHeightIn());
}
Coordinate getFudgedCoordinates(Coordinate coord, const std::vector<Line> &lines, bool makeBigger, BorderPosition borderPosition)
More information about the Libreoffice-commits
mailing list