diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-06-24 14:13:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-24 15:11:15 +0200 |
commit | ddddfe8d6ffa05c467bddb3480e43d7043a3d3c9 (patch) | |
tree | 72f3e0a0b6ea32f01aceac690e9a6bfcce89a656 /writerfilter | |
parent | d07cbe86f34ca6dfc6580b63879235c339831a5e (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
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 1b62df3ff071..6cac9c1cceb0 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -317,19 +317,19 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose) // 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++; } } |