Kaydet (Commit) e3560f47 authored tarafından Mike Kaganski's avatar Mike Kaganski

Replace deprecated boost::optional::reset(val) with operator =

Change-Id: I7340a561e0df0c781fd834388deb4b9f83800f9b
Reviewed-on: https://gerrit.libreoffice.org/63221
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 77e3cb33
......@@ -222,7 +222,7 @@ void SbxArray::PutAlias( const OUString& rAlias, sal_uInt16 nIdx )
else
{
SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>( GetRef( nIdx ) );
rRef.maAlias.reset(rAlias);
rRef.maAlias = rAlias;
}
}
......@@ -327,7 +327,7 @@ void SbxArray::Merge( SbxArray* p )
SbxVarEntry aNewEntry;
aNewEntry.mpVar = rEntry1.mpVar;
if (rEntry1.maAlias)
aNewEntry.maAlias.reset(*rEntry1.maAlias);
aNewEntry.maAlias = *rEntry1.maAlias;
mVarEntries.push_back(aNewEntry);
}
}
......
......@@ -162,7 +162,7 @@ namespace dbtools
lcl_checkConnected( _metaData );
try
{
_cachedSetting.reset( (_metaData.xConnectionMetaData.get()->*_getter)() );
_cachedSetting = (_metaData.xConnectionMetaData.get()->*_getter)();
}
catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("connectivity.commontools"); }
}
......
......@@ -56,9 +56,9 @@ void SAL_CALL java_io_Reader::skipBytes( sal_Int32 nBytesToSkip )
if(nBytesToSkip <= 0)
return;
if(m_buf != boost::none)
if(m_buf)
{
m_buf = boost::none;
m_buf.reset();
--nBytesToSkip;
}
......@@ -69,14 +69,14 @@ void SAL_CALL java_io_Reader::skipBytes( sal_Int32 nBytesToSkip )
{
assert(nBytesToSkip % sizeof(jchar) == 1);
Sequence< sal_Int8 > aData(1);
assert(m_buf == boost::none);
assert(m_buf);
readBytes(aData, 1);
}
}
sal_Int32 SAL_CALL java_io_Reader::available( )
{
if(m_buf != boost::none)
if(m_buf)
return 1;
jboolean out;
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java environment has been deleted!");
......@@ -90,7 +90,7 @@ sal_Int32 SAL_CALL java_io_Reader::available( )
out = t.pEnv->CallBooleanMethod( object, mID);
ThrowRuntimeException(t.pEnv,*this);
} //t.pEnv
return (m_buf != boost::none ? 1 : 0) + (out ? 1 : 0); // no way to tell *how much* is ready
return (m_buf ? 1 : 0) + (out ? 1 : 0); // no way to tell *how much* is ready
}
void SAL_CALL java_io_Reader::closeInput( )
......@@ -109,7 +109,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( css::uno::Sequence< sal_Int8 >& aD
sal_Int8 *dst(aData.getArray());
sal_Int32 nBytesWritten(0);
if(m_buf != boost::none)
if (m_buf)
{
if(aData.getLength() == 0)
{
......@@ -117,7 +117,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( css::uno::Sequence< sal_Int8 >& aD
dst = aData.getArray();
}
*dst = *m_buf;
m_buf = boost::none;
m_buf.reset();
++nBytesWritten;
++dst;
--nBytesToRead;
......@@ -166,7 +166,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( css::uno::Sequence< sal_Int8 >& aD
if(outBytes < outChars*jcs)
{
assert(outChars*jcs - outBytes == 1);
assert(m_buf == boost::none);
assert(!m_buf);
m_buf = reinterpret_cast<char*>(outBuf)[outBytes];
}
}
......
......@@ -170,7 +170,7 @@ namespace
void obtain( Any& _out_rValue, ::boost::optional< T > & _rCache, const sal_Int32 _nPos, const Reference < XResultSetMetaData >& _rxResultMeta, T (SAL_CALL XResultSetMetaData::*Getter)( sal_Int32 ) )
{
if ( !_rCache )
_rCache.reset( (_rxResultMeta.get()->*Getter)( _nPos ) );
_rCache = (_rxResultMeta.get()->*Getter)(_nPos);
_out_rValue <<= *_rCache;
}
}
......
......@@ -799,7 +799,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
{
sal_Int16 nMacroExecMode( !aDocumentMacroMode ? MacroExecMode::USE_CONFIG : *aDocumentMacroMode );
OSL_VERIFY( pIter->Value >>= nMacroExecMode );
aDocumentMacroMode.reset( nMacroExecMode );
aDocumentMacroMode = nMacroExecMode;
continue;
}
......@@ -850,7 +850,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
// sub document, in case the settings require this, *and* the document
// contains scripts in the content.xml. But this is better than the security
// issue we had before ...
aDocumentMacroMode.reset( MacroExecMode::USE_CONFIG );
aDocumentMacroMode = MacroExecMode::USE_CONFIG;
}
}
......@@ -858,7 +858,8 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons
{
// nobody so far felt responsible for setting it
// => use the DBDoc-wide macro exec mode for the document, too
aDocumentMacroMode.reset( bExecuteDBDocMacros ? MacroExecMode::ALWAYS_EXECUTE_NO_WARN : MacroExecMode::NEVER_EXECUTE );
aDocumentMacroMode = bExecuteDBDocMacros ? MacroExecMode::ALWAYS_EXECUTE_NO_WARN
: MacroExecMode::NEVER_EXECUTE;
}
aDocumentArgs.put( "MacroExecutionMode", *aDocumentMacroMode );
......
......@@ -200,7 +200,7 @@ namespace dbaui
const SfxPoolItem* pItem = _rSet.GetItem<SfxPoolItem>(booleanSetting.nItemId);
if (const SfxBoolItem *pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
{
aValue.reset( pBoolItem->GetValue() );
aValue = pBoolItem->GetValue();
}
else if (const OptionalBoolItem *pOptionalItem = dynamic_cast<const OptionalBoolItem*>( pItem) )
{
......
......@@ -41,7 +41,7 @@ namespace dbaui
bool HasValue() const { return !!m_aValue; }
void ClearValue() { m_aValue.reset(); }
bool GetValue() const { return *m_aValue; }
void SetValue( const bool _bValue ) { m_aValue.reset( _bValue ); }
void SetValue(bool _bValue) { m_aValue = _bValue; }
const ::boost::optional< bool >&
GetFullValue() const { return m_aValue; }
......
......@@ -118,7 +118,7 @@ public:
if (!next(&url, false)) {
throw CommandLineArgs::Supplier::Exception();
}
m_cwdUrl.reset(url);
m_cwdUrl = url;
break;
}
case '2':
......@@ -131,7 +131,7 @@ public:
if (osl::FileBase::getFileURLFromSystemPath(path, url) ==
osl::FileBase::E_None)
{
m_cwdUrl.reset(url);
m_cwdUrl = url;
}
break;
}
......
......@@ -749,7 +749,7 @@ namespace frm
{
sal_Int16 nBoundColumn( 0 );
m_aBoundColumn >>= nBoundColumn;
aBoundColumn.reset( nBoundColumn );
aBoundColumn = nBoundColumn;
}
::utl::SharedUNOComponent< XResultSet > xListCursor;
......@@ -782,7 +782,7 @@ namespace frm
Reference<XPropertySet> xFieldAsSet(xFieldsByIndex->getByIndex( *aBoundColumn ),UNO_QUERY);
assert(xFieldAsSet.is());
xFieldAsSet->getPropertyValue(PROPERTY_NAME) >>= aBoundFieldName;
aBoundColumn.reset( 1 );
aBoundColumn = 1;
xFieldAsSet.set(xFieldsByIndex->getByIndex(0),UNO_QUERY);
xFieldAsSet->getPropertyValue(PROPERTY_NAME) >>= aFieldName;
......
......@@ -97,45 +97,14 @@ namespace dbaui
{
class ODataView;
// = optional
/** convenience wrapper around boost::optional, allowing typed assignments
*/
template < typename T >
class optional : public ::boost::optional< T >
{
typedef ::boost::optional< T > base_type;
public:
optional ( ) : base_type( ) { }
explicit optional ( T const& val ) : base_type( val ) { }
optional ( optional const& rhs ) : base_type( static_cast<base_type const&>(rhs) ) { }
public:
optional& operator= ( T const& rhs )
{
base_type::reset( rhs );
return *this;
}
optional& operator= ( optional< T > const& rhs )
{
if ( rhs.is_initialized() )
base_type::reset( rhs.get() );
else
base_type::reset();
return *this;
}
};
template< typename T >
inline bool SAL_CALL operator >>= ( const css::uno::Any & _any, optional< T >& _value )
inline bool SAL_CALL operator >>= (const css::uno::Any& _any, boost::optional< T >& _value)
{
_value.reset(); // de-init the optional value
T directValue = T();
if ( _any >>= directValue )
_value.reset( directValue );
_value = directValue;
return !!_value;
}
......@@ -153,10 +122,10 @@ namespace dbaui
{
bool bEnabled;
optional< bool > bChecked;
optional< bool > bInvisible;
boost::optional<bool> bChecked;
boost::optional<bool> bInvisible;
css::uno::Any aValue;
optional< OUString > sTitle;
boost::optional<OUString> sTitle;
FeatureState() : bEnabled(false) { }
};
......
......@@ -418,7 +418,7 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
{
aPropSet.setProperty<sal_Int32>( PROP_ParaLeftMargin, 0);
rioBulletMap.setProperty( PROP_LeftMargin, *noParaLeftMargin);
noParaLeftMargin = boost::none;
noParaLeftMargin.reset();
}
if ( noFirstLineIndentation )
{
......@@ -426,7 +426,7 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p
// (non) bullet line if not set to zero explicitly :(
aPropSet.setProperty<sal_Int32>( PROP_ParaFirstLineIndent, 0);
rioBulletMap.setProperty( PROP_FirstLineOffset, *noFirstLineIndentation);
noFirstLineIndentation = boost::none;
noFirstLineIndentation.reset();
}
if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.hasProperty( PROP_BulletColor ) && pFilterBase )
rioBulletMap.setProperty( PROP_BulletColor, maTextCharacterProperties.maFillProperties.getBestSolidColor().getColor( pFilterBase->getGraphicHelper()));
......
......@@ -524,7 +524,8 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con
// And no LineColor property; individual borders can have colors and widths
boost::optional<sal_Int32> oLineWidth;
if (maTypeModel.maStrokeModel.moWeight.has())
oLineWidth.reset(ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maStrokeModel.moWeight.get(), 0, false, false));
oLineWidth = ConversionHelper::decodeMeasureToHmm(
rGraphicHelper, maTypeModel.maStrokeModel.moWeight.get(), 0, false, false);
if (aPropMap.hasProperty(PROP_LineColor))
{
uno::Reference<beans::XPropertySet> xPropertySet(rxShape, uno::UNO_QUERY);
......@@ -658,7 +659,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
boost::optional<sal_Int32> oRotation;
bool bFlipX = false, bFlipY = false;
if (!maTypeModel.maRotation.isEmpty())
oRotation.reset(ConversionHelper::decodeRotation(maTypeModel.maRotation));
oRotation = ConversionHelper::decodeRotation(maTypeModel.maRotation);
if (!maTypeModel.maFlip.isEmpty())
{
if (maTypeModel.maFlip == "x")
......
......@@ -592,7 +592,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
break;
case SID_INSERT_DIAGRAM:
aReturn.bEnabled = isEditable();
aReturn.bInvisible = optional< bool >(!m_bChartEnabled);
aReturn.bInvisible = !m_bChartEnabled;
aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_OLE2;
break;
case SID_FM_FIXEDTEXT:
......
......@@ -168,7 +168,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
case XML_ELEMENT( TABLE, XML_CONTENT_VALIDATION_NAME ):
OSL_ENSURE(!maContentValidationName, "here should be only one Validation Name");
if (!it.isEmpty())
maContentValidationName.reset(it.toString());
maContentValidationName = it.toString();
break;
case XML_ELEMENT( TABLE, XML_NUMBER_ROWS_SPANNED ):
bIsMerged = true;
......@@ -240,7 +240,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
if (!it.isEmpty())
{
OSL_ENSURE(!maStringValue, "here should be only one string value");
maStringValue.reset(it.toString());
maStringValue = it.toString();
bIsEmpty = false;
}
}
......@@ -266,7 +266,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
OSL_ENSURE(!maFormula, "here should be only one formula");
OUString aFormula, aFormulaNmsp;
rXMLImport.ExtractFormulaNamespaceGrammar( aFormula, aFormulaNmsp, eGrammar, it.toString() );
maFormula.reset( FormulaWithNamespace(aFormula, aFormulaNmsp) );
maFormula = FormulaWithNamespace(aFormula, aFormulaNmsp);
}
}
break;
......@@ -630,7 +630,7 @@ void ScXMLTableRowCellContext::PushParagraphEnd()
}
else if (mnCurParagraph == 0)
{
maFirstParagraph.reset(maParagraph.makeStringAndClear());
maFirstParagraph = maParagraph.makeStringAndClear();
mbEditEngineHasText = true;
}
......@@ -1336,7 +1336,7 @@ void ScXMLTableRowCellContext::AddNonFormulaCell( const ScAddress& rCellPos )
if( nCellType == util::NumberFormat::TEXT )
{
if( !bIsEmpty && !maStringValue && !mbEditEngineHasText && cellExists(rCellPos) && CellsAreRepeated() )
pOUText.reset( getOutputString(rXMLImport.GetDocument(), rCellPos) );
pOUText = getOutputString(rXMLImport.GetDocument(), rCellPos);
if (!mbEditEngineHasText && !pOUText && !maStringValue)
bIsEmpty = true;
......@@ -1525,7 +1525,7 @@ void SAL_CALL ScXMLTableRowCellContext::endFastElement(sal_Int32 /*nElement*/)
HasSpecialCaseFormulaText();
if( bFormulaTextResult && (mbPossibleErrorCell || mbCheckWithCompilerForError) )
{
maStringValue.reset(GetFirstParagraph());
maStringValue = GetFirstParagraph();
}
ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos();
......
......@@ -403,21 +403,21 @@ AnimationActivitySharedPtr createFromToByActivity(
ENSURE_OR_THROW(
extractValue( aTmpValue, rFromAny, rShape, rSlideBounds ),
"createFromToByActivity(): Could not extract from value" );
aFrom.reset(aTmpValue);
aFrom = aTmpValue;
}
if( rToAny.hasValue() )
{
ENSURE_OR_THROW(
extractValue( aTmpValue, rToAny, rShape, rSlideBounds ),
"createFromToByActivity(): Could not extract to value" );
aTo.reset(aTmpValue);
aTo = aTmpValue;
}
if( rByAny.hasValue() )
{
ENSURE_OR_THROW(
extractValue( aTmpValue, rByAny, rShape, rSlideBounds ),
"createFromToByActivity(): Could not extract by value" );
aBy.reset(aTmpValue);
aBy = aTmpValue;
}
return AnimationActivitySharedPtr(
......
......@@ -390,7 +390,7 @@ AnimationBaseNode::fillCommonParameters() const
boost::optional<double> aRepeats;
double nRepeats = 0;
if( mxAnimateNode->getRepeatCount() >>= nRepeats ) {
aRepeats.reset( nRepeats );
aRepeats = nRepeats;
}
else {
if( mxAnimateNode->getRepeatDuration() >>= nRepeats ) {
......@@ -402,9 +402,9 @@ AnimationBaseNode::fillCommonParameters() const
// convert duration back to repeat counts
if( bAutoReverse )
aRepeats.reset( nRepeats / (2.0 * nDuration) );
aRepeats = nRepeats / (2.0 * nDuration);
else
aRepeats.reset( nRepeats / nDuration );
aRepeats = nRepeats / nDuration;
}
else
{
......@@ -419,7 +419,7 @@ AnimationBaseNode::fillCommonParameters() const
{
// no indefinite timing, no other values given -
// use simple run, i.e. repeat of 1.0
aRepeats.reset( 1.0 );
aRepeats = 1.0;
}
}
}
......
......@@ -557,7 +557,7 @@ namespace slideshow
{
// setup clip poly
if( pAttr->isClipValid() )
aClip.reset( pAttr->getClip() );
aClip = pAttr->getClip();
// emulate global shape alpha by first rendering into
// a temp bitmap, and then to screen (this would have
......
......@@ -1531,7 +1531,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
"setProperty(): User paint overrides invisible mouse" );
// enable user paint
maUserPaintColor.reset( unoColor2RGBColor( nColor ) );
maUserPaintColor = unoColor2RGBColor(nColor);
if( mpCurrentSlide && !mpCurrentSlide->isPaintOverlayActive() )
mpCurrentSlide->enablePaintOverlay();
......@@ -1561,7 +1561,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
"setProperty(): User paint overrides invisible mouse" );
// enable user paint
maEraseAllInk.reset( bEraseAllInk );
maEraseAllInk = bEraseAllInk;
maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk );
}
......@@ -1578,7 +1578,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
if(bSwitchPenMode){
// Switch to Pen Mode
maSwitchPenMode.reset( bSwitchPenMode );
maSwitchPenMode = bSwitchPenMode;
maEventMultiplexer.notifySwitchPenMode();
}
}
......@@ -1594,7 +1594,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
"setProperty(): User paint overrides invisible mouse" );
if(bSwitchEraserMode){
// switch to Eraser mode
maSwitchEraserMode.reset( bSwitchEraserMode );
maSwitchEraserMode = bSwitchEraserMode;
maEventMultiplexer.notifySwitchEraserMode();
}
}
......@@ -1611,7 +1611,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty )
"setProperty(): User paint overrides invisible mouse" );
// enable user paint
maEraseInk.reset( nEraseInk );
maEraseInk = nEraseInk;
maEventMultiplexer.notifyEraseInkWidth( *maEraseInk );
}
......
......@@ -1072,7 +1072,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition(
if (pLeavingSlide) {
// only generate, if fade
// effect really needs it.
leavingSlide.reset( pLeavingSlide );
leavingSlide = pLeavingSlide;
}
aFadeColor = rTransitionFadeColor;
break;
......
......@@ -548,7 +548,7 @@ namespace svt { namespace table
Color nColor = COL_TRANSPARENT;
if ( i_color >>= nColor )
{
o_convertedColor.reset( nColor );
o_convertedColor = nColor;
}
else
{
......@@ -705,7 +705,7 @@ namespace svt { namespace table
{
aColors[i] = Color(aAPIColors[i]);
}
m_pImpl->m_aRowColors.reset( aColors );
m_pImpl->m_aRowColors = aColors;
}
}
......
......@@ -39,12 +39,10 @@ struct FmFormModelImplData
{
rtl::Reference<FmXUndoEnvironment> mxUndoEnv;
bool bOpenInDesignIsDefaulted;
::boost::optional< sal_Bool >
aControlsUseRefDevice;
boost::optional<bool> aControlsUseRefDevice;
FmFormModelImplData()
:bOpenInDesignIsDefaulted( true )
,aControlsUseRefDevice()
{
}
};
......@@ -161,7 +159,7 @@ bool FmFormModel::ControlsUseRefDevice() const
DocumentType eDocType = eUnknownDocumentType;
if ( m_pObjShell )
eDocType = DocumentClassification::classifyHostDocument( m_pObjShell->GetModel() );
m_pImpl->aControlsUseRefDevice.reset( ControlLayouter::useDocumentReferenceDevice( eDocType ) );
m_pImpl->aControlsUseRefDevice = ControlLayouter::useDocumentReferenceDevice(eDocType);
}
return *m_pImpl->aControlsUseRefDevice;
}
......
......@@ -513,7 +513,7 @@ SdrItemPool& SdrObject::GetGlobalDrawObjectItemPool()
void SdrObject::SetRelativeWidth( double nValue )
{
mpImpl->mnRelativeWidth.reset( nValue );
mpImpl->mnRelativeWidth = nValue;
}
void SdrObject::SetRelativeWidthRelation( sal_Int16 eValue )
......@@ -523,7 +523,7 @@ void SdrObject::SetRelativeWidthRelation( sal_Int16 eValue )
void SdrObject::SetRelativeHeight( double nValue )
{
mpImpl->mnRelativeHeight.reset( nValue );
mpImpl->mnRelativeHeight = nValue;
}
void SdrObject::SetRelativeHeightRelation( sal_Int16 eValue )
......
......@@ -79,7 +79,7 @@ void SwFont::SetTopBorder( const editeng::SvxBorderLine* pTopBorder )
m_aTopBorder = *pTopBorder;
else
{
m_aTopBorder = boost::none;
m_aTopBorder.reset();
m_nTopBorderDist = 0;
}
m_bFontChg = true;
......@@ -92,7 +92,7 @@ void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder )
m_aBottomBorder = *pBottomBorder;
else
{
m_aBottomBorder = boost::none;
m_aBottomBorder.reset();
m_nBottomBorderDist = 0;
}
m_bFontChg = true;
......@@ -105,7 +105,7 @@ void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder )
m_aRightBorder = *pRightBorder;
else
{
m_aRightBorder = boost::none;
m_aRightBorder.reset();
m_nRightBorderDist = 0;
}
m_bFontChg = true;
......@@ -118,7 +118,7 @@ void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder )
m_aLeftBorder = *pLeftBorder;
else
{
m_aLeftBorder = boost::none;
m_aLeftBorder.reset();
m_nLeftBorderDist = 0;
}
m_bFontChg = true;
......
......@@ -8279,7 +8279,7 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
void DocxAttributeOutput::FormatFillStyle( const XFillStyleItem& rFillStyle )
{
if (!m_bIgnoreNextFill)
m_oFillStyle.reset(rFillStyle.GetValue());
m_oFillStyle = rFillStyle.GetValue();
else
m_bIgnoreNextFill = false;
......
......@@ -1534,7 +1534,7 @@ boost::optional<SvxBrushItem> MSWordExportBase::getBackground()
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
if (aBrush.GetColor() != COL_AUTO)
oRet.reset(aBrush);
oRet = aBrush;
}
return oRet;
}
......
......@@ -52,7 +52,7 @@ short SwBreakDlg::run()
if (nPos != 0 && nPos != -1)
{
m_aTemplate = m_xPageCollBox->get_active_text();
oPgNum = boost::none;
oPgNum.reset();
if (m_xPageNumBox->get_active())
{
oPgNum = static_cast<sal_uInt16>(m_xPageNumEdit->get_value());
......
......@@ -2115,7 +2115,7 @@ static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFoot
rHeaderFooter = aOldValue;
rHeaderFooterBitmap = BitmapEx();
rMenuBarTextColor = boost::none;
rMenuBarTextColor.reset();
// now read the new values and setup bitmaps
OUString aHeader, aFooter;
......
......@@ -124,7 +124,7 @@ namespace vcl
if ( m_pData->sCurrentSearchString.getLength() == 1 )
{ // first character in the search -> remember
m_pData->aSingleSearchChar.reset( c );
m_pData->aSingleSearchChar = c;
}
else if ( m_pData->sCurrentSearchString.getLength() > 1 )
{
......
......@@ -50,14 +50,14 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
if ( bIsX11 )
{
if ( pDisplay != boost::none )
if (pDisplay)
{
inhibitXScreenSaver( bInhibit, pDisplay.get() );
inhibitXAutoLock( bInhibit, pDisplay.get() );
inhibitDPMS( bInhibit, pDisplay.get() );
}
if ( xid != boost::none )
if (xid)
{
inhibitGSM( bInhibit, appname, aReason.getStr(), xid.get() );
inhibitMSM( bInhibit, appname, aReason.getStr(), xid.get() );
......@@ -72,8 +72,8 @@ static void dbusInhibit( bool bInhibit,
const std::function<GVariant*( GDBusProxy*, const guint, GError*& )>& fUnInhibit,
boost::optional<guint>& rCookie )
{
if ( ( !bInhibit && ( rCookie == boost::none ) ) ||
( bInhibit && ( rCookie != boost::none ) ) )
if ( ( !bInhibit && !rCookie ) ||
( bInhibit && rCookie ) )
{
return;
}
......@@ -130,7 +130,7 @@ static void dbusInhibit( bool bInhibit,
else
{
res = fUnInhibit( proxy, rCookie.get(), error );
rCookie = boost::none;
rCookie.reset();
if (res != nullptr)
{
......@@ -281,12 +281,12 @@ void ScreenSaverInhibitor::inhibitXScreenSaver( bool bInhibit, Display* pDisplay
XSetScreenSaver( pDisplay, 0, nInterval,
bPreferBlanking, bAllowExposures );
}
else if ( !bInhibit && ( mnXScreenSaverTimeout != boost::none ) )
else if ( !bInhibit && mnXScreenSaverTimeout )
{
XSetScreenSaver( pDisplay, mnXScreenSaverTimeout.get(),
nInterval, bPreferBlanking,
bAllowExposures );
mnXScreenSaverTimeout = boost::none;
mnXScreenSaverTimeout.reset();
}
}
......
......@@ -1031,7 +1031,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_Background_color:
if (m_pImpl->GetSettingsTable()->GetDisplayBackgroundShape())
m_pImpl->m_oBackgroundColor.reset(nIntValue);
m_pImpl->m_oBackgroundColor = nIntValue;
break;
case NS_ooxml::LN_CT_PageNumber_start:
if (pSectionContext != nullptr)
......
......@@ -451,7 +451,7 @@ void DomainMapperTableManager::startLevel( )
boost::optional<sal_Int32> oCurrentWidth;
if (m_bPushCurrentWidth && !m_aCellWidths.empty() && !m_aCellWidths.back()->empty())
{
oCurrentWidth.reset(m_aCellWidths.back()->back());
oCurrentWidth = m_aCellWidths.back()->back();
m_aCellWidths.back()->pop_back();