From 47dd2c63f649828a833543e21d4eca5866ec9ebe Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 30 Nov 2019 16:50:00 +0100 Subject: Rewrite uses of boost::optional ...to only use functions that are also available for std::optional (in preparation for changing from boost::optional to std::optional): * uses of get are replaced with operator * or operator -> * uses of is_initialized are replaced with operator bool * uses of reset with an argument are replace with operator = (All of the replacements are also available for boost::optional "since forever", so this change should not break builds against old --with-system-boost. An alternative replacement for is_initialized would have been has_value, but that is only available since Boost 1.68.) Change-Id: I532687b6a5ee37dab28befb8e0eb05c22cbecf0f Reviewed-on: https://gerrit.libreoffice.org/84124 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 ++-- writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8eebe7869dd2..f203399278bf 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -202,11 +202,11 @@ static bool IsFieldNestingAllowed(const FieldContextPtr& pOuter, const FieldCont return true; } - switch (pOuter->GetFieldId().get()) + switch (*pOuter->GetFieldId()) { case FIELD_IF: { - switch (pInner->GetFieldId().get()) + switch (*pInner->GetFieldId()) { case FIELD_MERGEFIELD: { diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index bf68ffb1dc08..019b961c36ac 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -218,7 +218,7 @@ public: sal_Int32 getBottom() const { return m_nBottom; } - void setZ(sal_Int32 nZ) { m_oZ.reset(nZ); } + void setZ(sal_Int32 nZ) { m_oZ = nZ; } bool hasZ() const { return bool(m_oZ); } -- cgit