diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-10-26 14:42:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-10-26 15:17:31 +0100 |
commit | 8c6d3cd45e2183a19f91e9a30c1fdc699de393f8 (patch) | |
tree | cf73e671b25ec9e7da5a74510b3fd31d6385b714 | |
parent | cc926007e2471b9d7396a9724cae026e27e52ed2 (diff) |
Avoid boost::optional<bool>
Change-Id: Idaacaf80098e59df47183741402c8664ba5ea631
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index f15a67558ec1..f2081b4611fd 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -42,6 +42,8 @@ #include <oox/drawingml/shapepropertymap.hxx> #include <oox/helper/propertyset.hxx> +#include <boost/logic/tribool.hpp> + using namespace com::sun::star; namespace writerfilter @@ -147,7 +149,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape, uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); sal_Int16 nHoriOrient = 0; sal_Int16 nVertOrient = 0; - boost::optional<bool> obFitShapeToText; + boost::logic::tribool obFitShapeToText(boost::logic::indeterminate); bool bFilled = true; if (aKey == "posh") @@ -191,7 +193,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape, } } else if (aKey == "fFitShapeToText") - obFitShapeToText.reset(aValue.toInt32() == 1); + obFitShapeToText = aValue.toInt32() == 1; else if (aKey == "fFilled") bFilled = aValue.toInt32() == 1; else if (aKey == "rotation") @@ -208,10 +210,10 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape, xPropertySet->setPropertyValue("HoriOrient", uno::makeAny(nHoriOrient)); if (nVertOrient != 0 && xPropertySet.is()) xPropertySet->setPropertyValue("VertOrient", uno::makeAny(nVertOrient)); - if (obFitShapeToText && xPropertySet.is()) + if (!boost::logic::indeterminate(obFitShapeToText) && xPropertySet.is()) { - xPropertySet->setPropertyValue("SizeType", uno::makeAny(*obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX)); - xPropertySet->setPropertyValue("FrameIsAutomaticHeight", uno::makeAny(*obFitShapeToText)); + xPropertySet->setPropertyValue("SizeType", uno::makeAny(obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX)); + xPropertySet->setPropertyValue("FrameIsAutomaticHeight", uno::makeAny(static_cast<bool>(obFitShapeToText))); } if (!bFilled && xPropertySet.is()) { |