summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 0258fe3acdc4..ebcd21f030f0 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -40,6 +40,7 @@
#include <dmapper/DomainMapper.hxx>
#include "../dmapper/GraphicHelpers.hxx"
#include <rtfsdrimport.hxx>
+#include <boost/optional.hpp>
using rtl::OString;
using rtl::OStringBuffer;
@@ -173,19 +174,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++;
}
}