summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-06-24 14:13:39 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-06-24 16:42:18 +0200
commit48a25944a8bc00f4cac90c602c01f9f1ecd63256 (patch)
treebbd74dc0873be12614d999bc9ad6ac0e05d13794 /writerfilter
parent59d70e958005cd0ca93eb5def4fae7174bc9fb65 (diff)
bnc#823655 fix RTF import of freeform shape coordinates
E.g. 0,1 was imported as 1,0, as we did not differentiate between not having the coordinate yet and having it as zero. Change-Id: Ia5fbbcc791dc9c6866ffd4c146793690661d81b4 (cherry picked from commit ddddfe8d6ffa05c467bddb3480e43d7043a3d3c9)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 3bb7af932492..62a6cb5b1e38 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -192,19 +192,19 @@ void RTFSdrImport::resolve(RTFShape& rShape)
// The coordinates are in an (x,y) form.
aToken = aToken.copy(1, aToken.getLength() - 2);
sal_Int32 nI = 0;
- sal_Int32 nX = 0;
- sal_Int32 nY = 0;
+ boost::optional<sal_Int32> oX;
+ boost::optional<sal_Int32> oY;
do
{
OUString aPoint = aToken.getToken(0, ',', nI);
- if (!nX)
- nX = aPoint.toInt32();
+ if (!oX)
+ oX.reset(aPoint.toInt32());
else
- nY = aPoint.toInt32();
+ oY.reset(aPoint.toInt32());
}
while (nI >= 0);
- aCoordinates[nIndex].First.Value <<= nX;
- aCoordinates[nIndex].Second.Value <<= nY;
+ aCoordinates[nIndex].First.Value <<= *oX;
+ aCoordinates[nIndex].Second.Value <<= *oY;
nIndex++;
}
}