diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-30 17:48:32 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-12-01 14:57:16 +0100 |
commit | 7e403195e574be5174815a51cf5c42f06f76a87a (patch) | |
tree | c6147bcac095cd387f06dee63a25e15db6ca84c6 /writerfilter/source | |
parent | 7b3190eda387bcd897095205732f6752dedf01ef (diff) |
Introduce o3tl::optional as an alias for std::optional
...with a boost::optional fallback for Xcode < 10 (as std::optional is only
available starting with Xcode 10 according to
<https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS
and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite
all code to use o3tl::optional instead of boost::optional.
One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per
fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus
-Werror=maybe-uninitialized" should no longer be necessary (and whose check
happened to no longer trigger for GCC 10 trunk, even though that compiler would
still emit bogus -Wmaybe-uninitialized for uses of boost::optional under
--enable-optimized, which made me ponder whether this switch from
boost::optional to std::optional would be a useful thing to do; I keep that
configure.ac check for now, though, and will only remove it in a follow up
commit).
Another longer-term benefit is that the code is now already in good shape for an
eventual switch to std::optional (a switch we would have done anyway once we no
longer need to support Xcode < 10).
Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses
boost::property_tree::ptree::get_child_optional returning boost::optional, so
let it keep using boost::optional for now.
After a number of preceding commits have paved the way for this change, this
commit is completely mechanical, done with
> git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g'
(before committing include/o3tl/optional.hxx, and relying on some GNU features).
It excludes some files where mention of boost::optional et al should apparently
not be changed (and the sub-repo directory stubs). It turned out that all uses
of boost::none across the code base were in combination with boost::optional, so
had all to be rewritten as o3tl::nullopt.
Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b
Reviewed-on: https://gerrit.libreoffice.org/84128
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 26 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 26 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 10 | ||||
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.hxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/SdtHelper.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TextEffectsHandler.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 22 |
15 files changed, 74 insertions, 74 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 0744c5673b68..27a1d729160e 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -448,7 +448,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) { style::LineSpacing aSpacing; PropertyMapPtr pTopContext = m_pImpl->GetTopContext(); - boost::optional<PropertyMap::Property> aLineSpacingVal; + o3tl::optional<PropertyMap::Property> aLineSpacingVal; if (pTopContext && (aLineSpacingVal = pTopContext->getProperty(PROP_PARA_LINE_SPACING)) ) { aLineSpacingVal->second >>= aSpacing; @@ -2635,7 +2635,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) case NS_ooxml::LN_cntxtAlts_cntxtAlts: { tools::SvRef<TextEffectsHandler> pTextEffectsHandlerPtr( new TextEffectsHandler(nSprmId) ); - boost::optional<PropertyIds> aPropertyId = pTextEffectsHandlerPtr->getGrabBagPropertyId(); + o3tl::optional<PropertyIds> aPropertyId = pTextEffectsHandlerPtr->getGrabBagPropertyId(); if(aPropertyId) { writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index d6be09fbd4e4..9fa23720ba00 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -89,7 +89,7 @@ void DomainMapperTableHandler::startTable(const TablePropertyMapPtr& pProps) static void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const PropertyMapPtr& pDest ) { - boost::optional<PropertyMap::Property> pOrigVal = pOrig->getProperty(nId); + o3tl::optional<PropertyMap::Property> pOrigVal = pOrig->getProperty(nId); if ( pOrigVal ) { @@ -100,8 +100,8 @@ static void lcl_mergeBorder( PropertyIds nId, const PropertyMapPtr& pOrig, const static void lcl_computeCellBorders( const PropertyMapPtr& pTableBorders, const PropertyMapPtr& pCellProps, sal_Int32 nCell, sal_Int32 nRow, bool bIsEndCol, bool bIsEndRow ) { - boost::optional<PropertyMap::Property> pVerticalVal = pCellProps->getProperty(META_PROP_VERTICAL_BORDER); - boost::optional<PropertyMap::Property> pHorizontalVal = pCellProps->getProperty(META_PROP_HORIZONTAL_BORDER); + o3tl::optional<PropertyMap::Property> pVerticalVal = pCellProps->getProperty(META_PROP_VERTICAL_BORDER); + o3tl::optional<PropertyMap::Property> pHorizontalVal = pCellProps->getProperty(META_PROP_HORIZONTAL_BORDER); // Handle the vertical and horizontal borders uno::Any aVertProp; @@ -246,7 +246,7 @@ bool lcl_extractTableBorderProperty(const PropertyMapPtr& pTableProperties, cons if (!pTableProperties) return false; - const boost::optional<PropertyMap::Property> aTblBorder = pTableProperties->getProperty(nId); + const o3tl::optional<PropertyMap::Property> aTblBorder = pTableProperties->getProperty(nId); if( aTblBorder ) { OSL_VERIFY(aTblBorder->second >>= rLine); @@ -380,7 +380,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo aGrabBag["TablePosition"] <<= aGrabBagTS; } - boost::optional<PropertyMap::Property> aTableStyleVal = m_aTableProperties->getProperty(META_PROP_TABLE_STYLE_NAME); + o3tl::optional<PropertyMap::Property> aTableStyleVal = m_aTableProperties->getProperty(META_PROP_TABLE_STYLE_NAME); if(aTableStyleVal) { // Apply table style properties recursively @@ -448,7 +448,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo } // This is the one preserving just all the table look attributes. - boost::optional<PropertyMap::Property> oTableLook = m_aTableProperties->getProperty(META_PROP_TABLE_LOOK); + o3tl::optional<PropertyMap::Property> oTableLook = m_aTableProperties->getProperty(META_PROP_TABLE_LOOK); if (oTableLook) { aGrabBag["TableStyleLook"] = oTableLook->second; @@ -456,7 +456,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo } // This is just the "val" attribute's numeric value. - const boost::optional<PropertyMap::Property> aTblLook = m_aTableProperties->getProperty(PROP_TBL_LOOK); + const o3tl::optional<PropertyMap::Property> aTblLook = m_aTableProperties->getProperty(PROP_TBL_LOOK); if(aTblLook) { aTblLook->second >>= rInfo.nTblLook; @@ -564,7 +564,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo if ( !m_aCellProperties.empty() && !m_aCellProperties[0].empty() ) { // aLeftBorder already contains tblBorder; overwrite if cell is different. - boost::optional<PropertyMap::Property> aCellBorder + o3tl::optional<PropertyMap::Property> aCellBorder = m_aCellProperties[0][0]->getProperty(PROP_LEFT_BORDER); if ( aCellBorder ) aCellBorder->second >>= aLeftBorder; @@ -624,7 +624,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo // if table is only a single row, and row is set as don't split, set the same value for the whole table. if( m_aRowProperties.size() == 1 && m_aRowProperties[0].get() ) { - boost::optional<PropertyMap::Property> oSplitAllowed = m_aRowProperties[0]->getProperty(PROP_IS_SPLIT_ALLOWED); + o3tl::optional<PropertyMap::Property> oSplitAllowed = m_aRowProperties[0]->getProperty(PROP_IS_SPLIT_ALLOWED); if( oSplitAllowed ) { bool bRowCanSplit = true; @@ -770,8 +770,8 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl }; for (const PropertyIds& rBorder : pBorders) { - boost::optional<PropertyMap::Property> oStyleCellBorder = pStyleProps->getProperty(rBorder); - boost::optional<PropertyMap::Property> oDirectCellBorder = (*aCellIterator)->getProperty(rBorder); + o3tl::optional<PropertyMap::Property> oStyleCellBorder = pStyleProps->getProperty(rBorder); + o3tl::optional<PropertyMap::Property> oDirectCellBorder = (*aCellIterator)->getProperty(rBorder); if (oStyleCellBorder && oDirectCellBorder) { // We have a cell border from the table style and as direct formatting as well. @@ -786,7 +786,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } else { - boost::optional<PropertyMap::Property> oTableBorder = rInfo.pTableBorders->getProperty(rBorder); + o3tl::optional<PropertyMap::Property> oTableBorder = rInfo.pTableBorders->getProperty(rBorder); if (oTableBorder) { table::BorderLine2 aTableBorder = oTableBorder->second.get<table::BorderLine2>(); @@ -843,7 +843,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl uno::makeAny(rInfo.nBottomBorderDistance ), false); // Horizontal merge is not a UNO property, extract that info here to rMerges, and then remove it from the map. - const boost::optional<PropertyMap::Property> aHorizontalMergeVal = (*aCellIterator)->getProperty(PROP_HORIZONTAL_MERGE); + const o3tl::optional<PropertyMap::Property> aHorizontalMergeVal = (*aCellIterator)->getProperty(PROP_HORIZONTAL_MERGE); if (aHorizontalMergeVal) { if (aHorizontalMergeVal->second.get<bool>()) diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 3a3b713723ee..e25f55e68bb7 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -16,7 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <boost/optional.hpp> +#include <o3tl/optional.hxx> #include "DomainMapperTableManager.hxx" #include "BorderHandler.hxx" #include "CellColorHandler.hxx" @@ -435,7 +435,7 @@ void DomainMapperTableManager::startLevel( ) TableManager::startLevel( ); // If requested, pop the value that was pushed too early. - boost::optional<sal_Int32> oCurrentWidth; + o3tl::optional<sal_Int32> oCurrentWidth; if (m_bPushCurrentWidth && !m_aCellWidths.empty() && !m_aCellWidths.back()->empty()) { oCurrentWidth = m_aCellWidths.back()->back(); @@ -476,7 +476,7 @@ void DomainMapperTableManager::endLevel( ) m_aGridSpans.pop_back( ); // Do the same trick as in startLevel(): pop the value that was pushed too early. - boost::optional<sal_Int32> oCurrentWidth; + o3tl::optional<sal_Int32> oCurrentWidth; if (m_bPushCurrentWidth && !m_aCellWidths.empty() && !m_aCellWidths.back()->empty()) oCurrentWidth = m_aCellWidths.back()->back(); m_aCellWidths.pop_back( ); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f203399278bf..49f98383801b 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -802,7 +802,7 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId, StyleShee { if(pEntry->pProperties) { - boost::optional<PropertyMap::Property> aProperty = + o3tl::optional<PropertyMap::Property> aProperty = pEntry->pProperties->getProperty(eId); if( aProperty ) { @@ -827,7 +827,7 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId, StyleShee const PropertyMapPtr& pDefaultParaProps = GetStyleSheetTable()->GetDefaultParaProps(); if ( pDefaultParaProps ) { - boost::optional<PropertyMap::Property> aProperty = pDefaultParaProps->getProperty(eId); + o3tl::optional<PropertyMap::Property> aProperty = pDefaultParaProps->getProperty(eId); if ( aProperty ) return aProperty->second; } @@ -837,7 +837,7 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId, StyleShee const PropertyMapPtr& pDefaultCharProps = GetStyleSheetTable()->GetDefaultCharProps(); if ( pDefaultCharProps ) { - boost::optional<PropertyMap::Property> aProperty = pDefaultCharProps->getProperty(eId); + o3tl::optional<PropertyMap::Property> aProperty = pDefaultCharProps->getProperty(eId); if ( aProperty ) return aProperty->second; } @@ -872,7 +872,7 @@ uno::Any DomainMapper_Impl::GetAnyProperty(PropertyIds eId, const PropertyMapPtr // first look in directly applied attributes if ( rContext ) { - boost::optional<PropertyMap::Property> aProperty = rContext->getProperty(eId); + o3tl::optional<PropertyMap::Property> aProperty = rContext->getProperty(eId); if ( aProperty ) return aProperty->second; } @@ -1030,7 +1030,7 @@ static void lcl_AddRangeAndStyle( pToBeSavedProperties->SetStartingRange(xParaCursor->getStart()); if(pPropertyMap) { - boost::optional<PropertyMap::Property> aParaStyle = pPropertyMap->getProperty(PROP_PARA_STYLE_NAME); + o3tl::optional<PropertyMap::Property> aParaStyle = pPropertyMap->getProperty(PROP_PARA_STYLE_NAME); if( aParaStyle ) { OUString sName; @@ -1360,7 +1360,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con // over the ones from the numbering styles in Word // but in Writer numbering styles have priority, // so insert directly into the paragraph properties to compensate. - boost::optional<PropertyMap::Property> oProperty; + o3tl::optional<PropertyMap::Property> oProperty; const StyleSheetEntryPtr pParent = (!pEntry->sBaseStyleIdentifier.isEmpty()) ? GetStyleSheetTable()->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier) : nullptr; const StyleSheetPropertyMap* pParentProperties = dynamic_cast<const StyleSheetPropertyMap*>(pParent ? pParent->pProperties.get() : nullptr); if (!pEntry->sBaseStyleIdentifier.isEmpty()) @@ -2253,7 +2253,7 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote ) // This adds a hack on top of the following hack to save the style name in the context. PropertyMapPtr pTopContext = GetTopContext(); OUString sFootnoteCharStyleName; - boost::optional< PropertyMap::Property > aProp = pTopContext->getProperty(PROP_CHAR_STYLE_NAME); + o3tl::optional< PropertyMap::Property > aProp = pTopContext->getProperty(PROP_CHAR_STYLE_NAME); if (aProp) aProp->second >>= sFootnoteCharStyleName; @@ -2729,7 +2729,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape // Fix spacing for as-character objects. If the paragraph has CT_Spacing_after set, // it needs to be set on the object too, as that's what object placement code uses. PropertyMapPtr paragraphContext = GetTopContextOfType( CONTEXT_PARAGRAPH ); - boost::optional<PropertyMap::Property> aPropMargin = paragraphContext->getProperty(PROP_PARA_BOTTOM_MARGIN); + o3tl::optional<PropertyMap::Property> aPropMargin = paragraphContext->getProperty(PROP_PARA_BOTTOM_MARGIN); if(aPropMargin) xProps->setPropertyValue( getPropertyName( PROP_BOTTOM_MARGIN ), aPropMargin->second ); } @@ -3233,7 +3233,7 @@ static bool lcl_FindInCommand( void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale) { PropertyMapPtr pTopContext = GetTopContext(); - boost::optional<PropertyMap::Property> pLocale = pTopContext->getProperty(PROP_CHAR_LOCALE); + o3tl::optional<PropertyMap::Property> pLocale = pTopContext->getProperty(PROP_CHAR_LOCALE); if( pLocale ) pLocale->second >>= rLocale; else @@ -4514,7 +4514,7 @@ void DomainMapper_Impl::handleIndex static auto InsertFieldmark(std::stack<TextAppendContext> & rTextAppendStack, uno::Reference<text::XFormField> const& xFormField, uno::Reference<text::XTextRange> const& xStartRange, - boost::optional<FieldId> const oFieldId) -> void + o3tl::optional<FieldId> const oFieldId) -> void { uno::Reference<text::XTextContent> const xTextContent(xFormField, uno::UNO_QUERY_THROW); uno::Reference<text::XTextAppend> const& xTextAppend(rTextAppendStack.top().xTextAppend); @@ -4556,7 +4556,7 @@ static auto InsertFieldmark(std::stack<TextAppendContext> & rTextAppendStack, static auto PopFieldmark(std::stack<TextAppendContext> & rTextAppendStack, uno::Reference<text::XTextCursor> const& xCursor, - boost::optional<FieldId> const oFieldId) -> void + o3tl::optional<FieldId> const oFieldId) -> void { if (oFieldId && (oFieldId == FIELD_FORMCHECKBOX || oFieldId == FIELD_FORMDROPDOWN)) @@ -6515,7 +6515,7 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::GetCurrentNumberingCharSt } // In case numbering rules is not found via a style, try the direct formatting instead. - boost::optional<PropertyMap::Property> oProp = pContext->getProperty(PROP_NUMBERING_RULES); + o3tl::optional<PropertyMap::Property> oProp = pContext->getProperty(PROP_NUMBERING_RULES); if (oProp) { xLevels.set(oProp->second, uno::UNO_QUERY); @@ -6621,7 +6621,7 @@ sal_Int32 DomainMapper_Impl::getCurrentNumberingProperty(const OUString& aProp) { sal_Int32 nRet = 0; - boost::optional<PropertyMap::Property> pProp = m_pTopContext->getProperty(PROP_NUMBERING_RULES); + o3tl::optional<PropertyMap::Property> pProp = m_pTopContext->getProperty(PROP_NUMBERING_RULES); uno::Reference<container::XIndexAccess> xNumberingRules; if (pProp) xNumberingRules.set(pProp->second, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index d191c1abeb3c..1422b747035e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -32,7 +32,7 @@ #include <tuple> #include <unordered_map> #include <vector> -#include <boost/optional.hpp> +#include <o3tl/optional.hxx> #include <ooxml/resourceids.hxx> @@ -144,7 +144,7 @@ class FieldContext : public virtual SvRefBase OUString m_sCommand; OUString m_sResult; - boost::optional<FieldId> m_eFieldId; + o3tl::optional<FieldId> m_eFieldId; bool m_bFieldLocked; css::uno::Reference<css::text::XTextField> m_xTextField; @@ -174,7 +174,7 @@ public: const OUString& GetCommand() const {return m_sCommand; } void SetFieldId(FieldId eFieldId ) { m_eFieldId = eFieldId; } - boost::optional<FieldId> const & GetFieldId() const { return m_eFieldId; } + o3tl::optional<FieldId> const & GetFieldId() const { return m_eFieldId; } void AppendResult(OUString const& rResult) { m_sResult += rResult; } const OUString& GetResult() const { return m_sResult; } @@ -428,7 +428,7 @@ private: css::uno::Reference<css::uno::XComponentContext> m_xComponentContext; css::uno::Reference<css::container::XNameContainer> m_xPageStyles1; // cache next available number, expensive to repeatedly compute - boost::optional<int> m_xNextUnusedPageStyleNo; + o3tl::optional<int> m_xNextUnusedPageStyleNo; css::uno::Reference<css::text::XText> m_xBodyText; css::uno::Reference<css::text::XTextContent> m_xEmbedded; @@ -960,7 +960,7 @@ public: tools::SvRef<SdtHelper> m_pSdtHelper; /// Document background color, applied to every page style. - boost::optional<sal_Int32> m_oBackgroundColor; + o3tl::optional<sal_Int32> m_oBackgroundColor; /** * This contains the raw table depth. m_nTableDepth > 0 is the same as diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 7dd903b7784f..7b1916df0268 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -247,10 +247,10 @@ public: std::queue<OUString>& m_rPositivePercentages; OUString sAnchorId; comphelper::SequenceAsHashMap m_aInteropGrabBag; - boost::optional<sal_Int32> m_oEffectExtentLeft; - boost::optional<sal_Int32> m_oEffectExtentTop; - boost::optional<sal_Int32> m_oEffectExtentRight; - boost::optional<sal_Int32> m_oEffectExtentBottom; + o3tl::optional<sal_Int32> m_oEffectExtentLeft; + o3tl::optional<sal_Int32> m_oEffectExtentTop; + o3tl::optional<sal_Int32> m_oEffectExtentRight; + o3tl::optional<sal_Int32> m_oEffectExtentBottom; GraphicImport_Impl(GraphicImportType eImportType, DomainMapper& rDMapper, std::pair<OUString, OUString>& rPositionOffsets, std::pair<OUString, OUString>& rAligns, std::queue<OUString>& rPositivePercentages) : nXSize(0) diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 62ca40c99e1a..f55282f3df4f 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -293,7 +293,7 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults PROP_FIRST_LINE_OFFSET, PROP_LEFT_MARGIN }; for(PropertyIds const & rReadId : aReadIds) { - boost::optional<PropertyMap::Property> aProp = getProperty(rReadId); + o3tl::optional<PropertyMap::Property> aProp = getProperty(rReadId); if (aProp) aNumberingProperties.emplace_back( getPropertyName(aProp->first), 0, aProp->second, beans::PropertyState_DIRECT_VALUE ); else if (rReadId == PROP_FIRST_LINE_INDENT && bDefaults) @@ -306,7 +306,7 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults beans::PropertyState_DIRECT_VALUE); } - boost::optional<PropertyMap::Property> aPropFont = getProperty(PROP_CHAR_FONT_NAME); + o3tl::optional<PropertyMap::Property> aPropFont = getProperty(PROP_CHAR_FONT_NAME); if(aPropFont && !isOutlineNumbering()) aNumberingProperties.emplace_back( getPropertyName(PROP_BULLET_FONT_NAME), 0, aPropFont->second, beans::PropertyState_DIRECT_VALUE ); diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx index 4b2083922420..ff87787f2ace 100644 --- a/writerfilter/source/dmapper/NumberingManager.hxx +++ b/writerfilter/source/dmapper/NumberingManager.hxx @@ -132,7 +132,7 @@ private: OUString m_sNumStyleLink; /// list id to use for all derived numbering definitions - boost::optional<OUString> m_oListId; + o3tl::optional<OUString> m_oListId; public: typedef tools::SvRef< AbstractListDef > Pointer; diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 226ac355ead5..d6e9794a9728 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -251,11 +251,11 @@ void PropertyMap::Erase( PropertyIds eId ) Invalidate(); } -boost::optional< PropertyMap::Property > PropertyMap::getProperty( PropertyIds eId ) const +o3tl::optional< PropertyMap::Property > PropertyMap::getProperty( PropertyIds eId ) const { std::map< PropertyIds, PropValue >::const_iterator aIter = m_vMap.find( eId ); if ( aIter == m_vMap.end() ) - return boost::optional<Property>(); + return o3tl::optional<Property>(); else return std::make_pair( eId, aIter->second.getValue() ); } @@ -662,7 +662,7 @@ void SectionPropertyMap::ApplySectionProperties( const uno::Reference< beans::XP { if ( xSection.is() ) { - boost::optional< PropertyMap::Property > pProp = getProperty( PROP_WRITING_MODE ); + o3tl::optional< PropertyMap::Property > pProp = getProperty( PROP_WRITING_MODE ); if ( pProp ) xSection->setPropertyValue( "WritingMode", pProp->second ); } @@ -1299,7 +1299,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) if ( pLastContext ) { bool bIsLandscape = false; - boost::optional< PropertyMap::Property > pProp = getProperty( PROP_IS_LANDSCAPE ); + o3tl::optional< PropertyMap::Property > pProp = getProperty( PROP_IS_LANDSCAPE ); if ( pProp ) pProp->second >>= bIsLandscape; @@ -1446,7 +1446,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) //prepare text grid properties sal_Int32 nHeight = 1; - boost::optional< PropertyMap::Property > pProp = getProperty( PROP_HEIGHT ); + o3tl::optional< PropertyMap::Property > pProp = getProperty( PROP_HEIGHT ); if ( pProp ) pProp->second >>= nHeight; @@ -1487,7 +1487,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( "Standard" ); if ( pEntry.get() ) { - boost::optional< PropertyMap::Property > pPropHeight = pEntry->pProperties->getProperty( PROP_CHAR_HEIGHT_ASIAN ); + o3tl::optional< PropertyMap::Property > pPropHeight = pEntry->pProperties->getProperty( PROP_CHAR_HEIGHT_ASIAN ); if ( pPropHeight ) { double fHeight = 0; diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 64e9969fa038..b7603301ccc8 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -28,7 +28,7 @@ #include <com/sun/star/uno/Any.h> #include "PropertyIds.hxx" #include <memory> -#include <boost/optional.hpp> +#include <o3tl/optional.hxx> #include <map> #include <vector> #include "TagLogger.hxx" @@ -149,7 +149,7 @@ public: void InsertProps( const PropertyMapPtr& rMap, const bool bOverwrite = true ); // Returns a copy of the property if it exists, .first is its PropertyIds and .second is its Value (type css::uno::Any) - boost::optional< Property > getProperty( PropertyIds eId ) const; + o3tl::optional< Property > getProperty( PropertyIds eId ) const; // Has the property named been set (via Insert)? bool isSet( PropertyIds eId ) const; @@ -215,7 +215,7 @@ private: css::uno::Reference< css::beans::XPropertySet > m_aFirstPageStyle; css::uno::Reference< css::beans::XPropertySet > m_aFollowPageStyle; - boost::optional< css::table::BorderLine2 > m_oBorderLines[4]; + o3tl::optional< css::table::BorderLine2 > m_oBorderLines[4]; sal_Int32 m_nBorderDistances[4]; BorderApply m_eBorderApply; BorderOffsetFrom m_eBorderOffsetFrom; diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index aef7ac1e5fbd..bdd82cc11b04 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -42,11 +42,11 @@ static awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet, PropertyMapPtr pDefaultCharProps = pStyleSheet->GetDefaultCharProps(); vcl::Font aFont(pOut->GetFont()); - boost::optional<PropertyMap::Property> aFontName + o3tl::optional<PropertyMap::Property> aFontName = pDefaultCharProps->getProperty(PROP_CHAR_FONT_NAME); if (aFontName) aFont.SetFamilyName(aFontName->second.get<OUString>()); - boost::optional<PropertyMap::Property> aHeight + o3tl::optional<PropertyMap::Property> aHeight = pDefaultCharProps->getProperty(PROP_CHAR_HEIGHT); if (aHeight) { diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 4c05506a9151..7c47732a6667 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -112,10 +112,10 @@ void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, const PropertyMapP if ( nType == pTypesToFix[i] ) { PropertyIds nChecked = pPropsToCheck[i]; - boost::optional<PropertyMap::Property> pChecked = pProps->getProperty(nChecked); + o3tl::optional<PropertyMap::Property> pChecked = pProps->getProperty(nChecked); PropertyIds nInsideProp = ( i < 2 ) ? META_PROP_HORIZONTAL_BORDER : META_PROP_VERTICAL_BORDER; - boost::optional<PropertyMap::Property> pInside = pProps->getProperty(nInsideProp); + o3tl::optional<PropertyMap::Property> pInside = pProps->getProperty(nInsideProp); if ( pChecked && pProps ) { @@ -200,7 +200,7 @@ static void lcl_mergeProps( const PropertyMapPtr& pToFill, const PropertyMapPtr& for ( unsigned i = 0 ; i != SAL_N_ELEMENTS(pPropsToCheck); i++ ) { PropertyIds nId = pPropsToCheck[i]; - boost::optional<PropertyMap::Property> pProp = pToAdd->getProperty(nId); + o3tl::optional<PropertyMap::Property> pProp = pToAdd->getProperty(nId); if ( pProp ) { diff --git a/writerfilter/source/dmapper/TextEffectsHandler.hxx b/writerfilter/source/dmapper/TextEffectsHandler.hxx index 6a40ed67a0db..b4a74715b02c 100644 --- a/writerfilter/source/dmapper/TextEffectsHandler.hxx +++ b/writerfilter/source/dmapper/TextEffectsHandler.hxx @@ -21,7 +21,7 @@ #include <oox/helper/grabbagstack.hxx> #include <memory> -#include <boost/optional.hpp> +#include <o3tl/optional.hxx> namespace writerfilter { namespace dmapper @@ -31,7 +31,7 @@ namespace dmapper class TextEffectsHandler : public LoggedProperties { private: - boost::optional<PropertyIds> maPropertyId; + o3tl::optional<PropertyIds> maPropertyId; OUString maElementName; std::unique_ptr<oox::GrabBagStack> mpGrabBagStack; @@ -45,7 +45,7 @@ public: explicit TextEffectsHandler(sal_uInt32 aElementId); virtual ~TextEffectsHandler() override; - const boost::optional<PropertyIds>& getGrabBagPropertyId() const { return maPropertyId;} + const o3tl::optional<PropertyIds>& getGrabBagPropertyId() const { return maPropertyId;} css::beans::PropertyValue getInteropGrabBag(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 019b961c36ac..99e91aace902 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -13,7 +13,7 @@ #include <queue> #include <tuple> #include <vector> -#include <boost/optional.hpp> +#include <o3tl/optional.hxx> #include <com/sun/star/text/WrapTextMode.hpp> #include <oox/mathml/importutils.hxx> @@ -274,7 +274,7 @@ private: sal_Int32 m_nTop = 0; sal_Int32 m_nRight = 0; sal_Int32 m_nBottom = 0; - boost::optional<sal_Int32> m_oZ; ///< Z-Order of the shape. + o3tl::optional<sal_Int32> m_oZ; ///< Z-Order of the shape. sal_Int16 m_nHoriOrientRelation = 0; ///< Horizontal text::RelOrientation for drawinglayer shapes. sal_Int16 m_nVertOrientRelation = 0; ///< Vertical text::RelOrientation for drawinglayer shapes. @@ -380,7 +380,7 @@ private: sal_Int32 m_nHoriPadding, m_nVertPadding; sal_Int32 m_nHoriAlign, m_nHoriAnchor, m_nVertAlign, m_nVertAnchor; Id m_nHRule; - boost::optional<Id> m_oWrap; + o3tl::optional<Id> m_oWrap; public: explicit RTFFrame(RTFParserState* pParserState); diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 8dc10cc53622..86cae03f4260 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -373,14 +373,14 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap uno::Any aLineWidth = uno::makeAny(sal_Int32(26)); sal_Int16 eWritingMode = text::WritingMode2::LR_TB; // Groupshape support - boost::optional<sal_Int32> oGroupLeft; - boost::optional<sal_Int32> oGroupTop; - boost::optional<sal_Int32> oGroupRight; - boost::optional<sal_Int32> oGroupBottom; - boost::optional<sal_Int32> oRelLeft; - boost::optional<sal_Int32> oRelTop; - boost::optional<sal_Int32> oRelRight; - boost::optional<sal_Int32> oRelBottom; + o3tl::optional<sal_Int32> oGroupLeft; + o3tl::optional<sal_Int32> oGroupTop; + o3tl::optional<sal_Int32> oGroupRight; + o3tl::optional<sal_Int32> oGroupBottom; + o3tl::optional<sal_Int32> oRelLeft; + o3tl::optional<sal_Int32> oRelTop; + o3tl::optional<sal_Int32> oRelRight; + o3tl::optional<sal_Int32> oRelBottom; // Importing these are not trivial, let the VML import do the hard work. oox::vml::FillModel aFillModel; // Gradient. @@ -388,8 +388,8 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap bool bOpaque = true; - boost::optional<sal_Int16> oRelativeWidth; - boost::optional<sal_Int16> oRelativeHeight; + o3tl::optional<sal_Int16> oRelativeWidth; + o3tl::optional<sal_Int16> oRelativeHeight; sal_Int16 nRelativeWidthRelation = text::RelOrientation::PAGE_FRAME; sal_Int16 nRelativeHeightRelation = text::RelOrientation::PAGE_FRAME; boost::logic::tribool obRelFlipV(boost::logic::indeterminate); @@ -727,7 +727,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap sal_Int16 nPercentage = rtl::math::round(rProperty.second.toDouble() / 10); if (nPercentage) { - boost::optional<sal_Int16>& rPercentage + o3tl::optional<sal_Int16>& rPercentage = rProperty.first == "pctHoriz" ? oRelativeWidth : oRelativeHeight; rPercentage = nPercentage; } |