diff options
361 files changed, 1385 insertions, 1397 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 853d944864fd..c430df21e7f3 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -1421,7 +1421,7 @@ void SAL_CALL Document::disposing() { m_aEngineListener.endListening(); m_aViewListener.endListening(); - if (m_xParagraphs.get() != nullptr) + if (m_xParagraphs != nullptr) disposeParagraphs(); VCLXAccessibleComponent::disposing(); } @@ -1609,7 +1609,7 @@ IMPL_LINK(Document, WindowEventHandler, ::VclWindowEvent&, rEvent, void) void Document::init() { - if (m_xParagraphs.get() == nullptr) + if (m_xParagraphs == nullptr) { const sal_uInt32 nCount = m_rEngine.GetParagraphCount(); m_xParagraphs.reset(new Paragraphs); diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index 03dadbee4fb3..861c7d377c93 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -397,13 +397,13 @@ uno::Reference< graphic::XGraphic > MediaWindow::grabFrame( const OUString& rURL } } - if( !xRet.is() && !xGraphic.get() ) + if (!xRet.is() && !xGraphic) { const BitmapEx aBmpEx(AVMEDIA_BMP_EMPTYLOGO); xGraphic.reset( new Graphic( aBmpEx ) ); } - if( xGraphic.get() ) + if (xGraphic) xRet = xGraphic->GetXGraphic(); return xRet; diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 9cef7bdd41ec..007269ec71ad 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -631,14 +631,14 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) } const SfxUnoAnyItem* pDocModelItem = rReq.GetArg<SfxUnoAnyItem>(SID_BASICIDE_ARG_DOCUMENT_MODEL); - if ( !pDocument.get() && pDocModelItem ) + if (!pDocument && pDocModelItem) { uno::Reference< frame::XModel > xModel( pDocModelItem->GetValue(), UNO_QUERY ); if ( xModel.is() ) pDocument.reset( new ScriptDocument( xModel ) ); } - if ( !pDocument.get() ) + if (!pDocument) break; const SfxStringItem* pLibNameItem = rReq.GetArg<SfxStringItem>(SID_BASICIDE_ARG_LIBNAME); diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 9a2a040a3a5d..ac990c66890d 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -302,7 +302,7 @@ namespace basctl m_xDocModify.clear(); m_xScriptAccess.clear(); - if ( m_pDocListener.get() ) + if (m_pDocListener) m_pDocListener->dispose(); } diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 3dedac41d42a..f1ad7192aabf 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1013,7 +1013,7 @@ void BasicManager::CheckModules( StarBASIC* pLib, bool bReference ) for ( const auto& pModule: pLib->GetModules() ) { - DBG_ASSERT( pModule.get(), "Module not received!" ); + DBG_ASSERT(pModule, "Module not received!"); if ( !pModule->IsCompiled() && !StarBASIC::GetErrorCode() ) { pModule->Compile(); diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index c9663ef08bd0..c4a3267e1f56 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -2546,7 +2546,7 @@ void SbUserFormModule::Unload() m_xDialog.clear(); //release ref to the uno object SbxValues aVals; bool bWaitForDispose = true; // assume dialog is showing - if ( m_DialogListener.get() ) + if (m_DialogListener) { bWaitForDispose = m_DialogListener->isShowing(); SAL_INFO("basic", "Showing " << bWaitForDispose ); diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index d1c7256c6ad5..04f9ae5df2dc 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -607,7 +607,8 @@ bool Bridge::makeCall( decrementActiveCalls(); decrementCalls(); } - if (resp.get() == nullptr) { + if (resp == nullptr) + { throw css::lang::DisposedException( "Binary URP bridge disposed during call", static_cast< cppu::OWeakObject * >(this)); diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx index 6cb7fd546a8e..b03a85847313 100644 --- a/canvas/source/tools/elapsedtime.cxx +++ b/canvas/source/tools/elapsedtime.cxx @@ -78,8 +78,7 @@ void ElapsedTime::adjustTimer( double fOffset ) double ElapsedTime::getCurrentTime() const { - return m_pTimeBase.get() == nullptr - ? getSystemTime() : m_pTimeBase->getElapsedTimeImpl(); + return m_pTimeBase == nullptr ? getSystemTime() : m_pTimeBase->getElapsedTimeImpl(); } double ElapsedTime::getElapsedTime() const diff --git a/canvas/source/tools/propertysethelper.cxx b/canvas/source/tools/propertysethelper.cxx index 7fdc153bb5cd..35b67e03e3f0 100644 --- a/canvas/source/tools/propertysethelper.cxx +++ b/canvas/source/tools/propertysethelper.cxx @@ -86,7 +86,7 @@ namespace canvas bool PropertySetHelper::isPropertyName( const OUString& aPropertyName ) const { - if( !mpMap.get() ) + if (!mpMap) return false; Callbacks aDummy; @@ -104,9 +104,7 @@ namespace canvas const uno::Any& aValue ) { Callbacks aCallbacks; - if( !mpMap.get() || - !mpMap->lookup( aPropertyName, - aCallbacks ) ) + if (!mpMap || !mpMap->lookup(aPropertyName, aCallbacks)) { throwUnknown( aPropertyName ); } @@ -120,9 +118,7 @@ namespace canvas uno::Any PropertySetHelper::getPropertyValue( const OUString& aPropertyName ) const { Callbacks aCallbacks; - if( !mpMap.get() || - !mpMap->lookup( aPropertyName, - aCallbacks ) ) + if (!mpMap || !mpMap->lookup(aPropertyName, aCallbacks)) { throwUnknown( aPropertyName ); } diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 9f82483f5e66..b828828a546f 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -558,7 +558,7 @@ void DataBrowser::clearHeaders() void DataBrowser::RenewTable() { - if( ! m_apDataBrowserModel.get()) + if (!m_apDataBrowserModel) return; long nOldRow = GetCurRow(); @@ -636,7 +636,7 @@ void DataBrowser::RenewTable() OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const { - OSL_ASSERT( m_apDataBrowserModel.get()); + OSL_ASSERT(m_apDataBrowserModel); if( nColumnId > 0 ) return m_apDataBrowserModel->getRoleOfColumn( nColumnId - 1 ); return OUString(); @@ -1119,14 +1119,14 @@ void DataBrowser::InitController( bool DataBrowser::CellContainsNumbers( sal_uInt16 nCol ) const { - if( ! m_apDataBrowserModel.get()) + if (!m_apDataBrowserModel) return false; return m_apDataBrowserModel->getCellType( lcl_getColumnInData( nCol )) == DataBrowserModel::NUMBER; } sal_uInt32 DataBrowser::GetNumberFormatKey( sal_uInt16 nCol ) const { - if( ! m_apDataBrowserModel.get()) + if (!m_apDataBrowserModel) return 0; return m_apDataBrowserModel->getNumberFormatKey( lcl_getColumnInData( nCol ) ); } diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index 10af6e5cbf4c..15e1d00c307b 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -279,7 +279,7 @@ private: void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); @@ -400,7 +400,7 @@ void DataBrowserModel::insertComplexCategoryLevel( sal_Int32 nAfterColumnIndex ) { //create a new text column for complex categories - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); if (!xDataProvider.is()) return; @@ -438,7 +438,7 @@ void DataBrowserModel::removeComplexCategoryLevel( sal_Int32 nAtColumnIndex ) void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColumnIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); if (nAtColumnIndex < 0 || static_cast<size_t>(nAtColumnIndex) >= m_aColumns.size()) // Out of bound. return; @@ -507,7 +507,7 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu void DataBrowserModel::swapDataSeries( sal_Int32 nFirstColumnIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); if( static_cast< tDataColumnVector::size_type >( nFirstColumnIndex ) < m_aColumns.size() - 1 ) { Reference< chart2::XDataSeries > xSeries( m_aColumns[nFirstColumnIndex].m_xDataSeries ); @@ -521,7 +521,7 @@ void DataBrowserModel::swapDataSeries( sal_Int32 nFirstColumnIndex ) void DataBrowserModel::swapDataPointForAllSeries( sal_Int32 nFirstIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); // lockControllers diff --git a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx index 639fd1afe55c..55273a76fd3c 100644 --- a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx +++ b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx @@ -42,7 +42,7 @@ TimerTriggeredControllerLock::~TimerTriggeredControllerLock() void TimerTriggeredControllerLock::startTimer() { - if(!m_apControllerLockGuard.get()) + if (!m_apControllerLockGuard) m_apControllerLockGuard.reset( new ControllerLockGuardUNO(m_xModel) ); m_aTimer.Start(); } diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index ea7f55413225..9d958a582e86 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -192,7 +192,7 @@ void ErrorBarResources::SetChartDocumentForRangeChoosing( m_apRangeSelectionHelper.reset( new RangeSelectionHelper( xChartDocument )); // has internal data provider => rename "cell range" to "from data" - OSL_ASSERT( m_apRangeSelectionHelper.get()); + OSL_ASSERT(m_apRangeSelectionHelper); if( m_bHasInternalDataProvider ) { m_xRbRange->set_label(m_xUIStringRbRange->get_label()); @@ -435,8 +435,8 @@ IMPL_LINK_NOARG(ErrorBarResources, IndicatorChanged, weld::ToggleButton&, void) IMPL_LINK(ErrorBarResources, ChooseRange, weld::Button&, rButton, void) { - OSL_ASSERT( m_apRangeSelectionHelper.get()); - if( ! m_apRangeSelectionHelper.get()) + OSL_ASSERT(m_apRangeSelectionHelper); + if (!m_apRangeSelectionHelper) return; OSL_ASSERT( m_pCurrentRangeChoosingField == nullptr ); @@ -665,8 +665,8 @@ void ErrorBarResources::FillValueSets() void ErrorBarResources::listeningFinished( const OUString & rNewRange ) { - OSL_ASSERT( m_apRangeSelectionHelper.get()); - if( ! m_apRangeSelectionHelper.get()) + OSL_ASSERT(m_apRangeSelectionHelper); + if (!m_apRangeSelectionHelper) return; // rNewRange becomes invalid after removing the listener @@ -697,8 +697,8 @@ void ErrorBarResources::listeningFinished( void ErrorBarResources::disposingRangeSelection() { - OSL_ASSERT( m_apRangeSelectionHelper.get()); - if( m_apRangeSelectionHelper.get()) + OSL_ASSERT(m_apRangeSelectionHelper); + if (m_apRangeSelectionHelper) m_apRangeSelectionHelper->stopRangeListening( false ); } diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 268c46dd5cf8..75f8a76ff5f8 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -432,7 +432,7 @@ SplineResourceGroup::SplineResourceGroup(weld::Builder* pBuilder, TabPageParent SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog() { - if( !m_xSplinePropertiesDialog.get() ) + if (!m_xSplinePropertiesDialog) { m_xSplinePropertiesDialog.reset(new SplinePropertiesDialog(m_pParent.GetFrameWeld())); } diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 6f151d647956..5f2a688cc64f 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -167,7 +167,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co SdrPage* pPage = new SdrPage( *pModel, false ); pPage->SetSize(Size(1000,1000)); pModel->InsertPage( pPage, 0 ); - std::unique_ptr<SdrView> pView( new SdrView( *pModel.get(), pVDev ) ); + std::unique_ptr<SdrView> pView(new SdrView(*pModel, pVDev)); pView->hideMarkHandles(); SdrPageView* pPageView = pView->ShowSdrPage(pPage); diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index ef1df6ae35d2..0a9669626fcb 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -59,7 +59,8 @@ void ChartController::StartTextEdit( const Point* pMousePixel ) if(!pTextObj) return; - OSL_PRECOND( !m_pTextActionUndoGuard.get(), "ChartController::StartTextEdit: already have a TextUndoGuard!?" ); + OSL_PRECOND(!m_pTextActionUndoGuard, + "ChartController::StartTextEdit: already have a TextUndoGuard!?"); m_pTextActionUndoGuard.reset( new UndoGuard( SchResId( STR_ACTION_EDIT_TEXT ), m_xUndoManager ) ); SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner(); @@ -135,8 +136,8 @@ bool ChartController::EndTextEdit() TitleHelper::setCompleteString( aString, uno::Reference< css::chart2::XTitle >::query( xPropSet ), m_xCC ); - OSL_ENSURE( m_pTextActionUndoGuard.get(), "ChartController::EndTextEdit: no TextUndoGuard!" ); - if ( m_pTextActionUndoGuard.get() ) + OSL_ENSURE(m_pTextActionUndoGuard, "ChartController::EndTextEdit: no TextUndoGuard!"); + if (m_pTextActionUndoGuard) m_pTextActionUndoGuard->commit(); } m_pTextActionUndoGuard.reset(); diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index e552656f1da6..d59ae46fb52e 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -246,7 +246,7 @@ void ChartController::executeDispatch_ScaleText() ControllerLockGuardUNO aCtlLockGuard( getModel() ); std::unique_ptr<ReferenceSizeProvider> pRefSizeProv(impl_createReferenceSizeProvider()); - OSL_ASSERT( pRefSizeProv.get()); + OSL_ASSERT(pRefSizeProv); if (pRefSizeProv) pRefSizeProv->toggleAutoResizeState(); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index e7f656337507..7e006d5f2cc1 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1315,11 +1315,11 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) return bReturn; // handle accelerators - if( ! m_apAccelExecute.get() && m_xFrame.is() && m_xCC.is() ) + if (!m_apAccelExecute && m_xFrame.is() && m_xCC.is()) { m_apAccelExecute = ::svt::AcceleratorExecute::createAcceleratorHelper(); - OSL_ASSERT( m_apAccelExecute.get()); - if( m_apAccelExecute.get() ) + OSL_ASSERT(m_apAccelExecute); + if (m_apAccelExecute) m_apAccelExecute->init( m_xCC, m_xFrame ); } @@ -1328,7 +1328,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) bool bAlternate = aKeyCode.IsMod2(); bool bCtrl = aKeyCode.IsMod1(); - if( m_apAccelExecute.get() ) + if (m_apAccelExecute) bReturn = m_apAccelExecute->execute( aKeyCode ); if( bReturn ) return bReturn; diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index a8f39ee5c989..d920a4a8c988 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -522,8 +522,8 @@ void ControllerCommandDispatch::fireStatusEventForURLImpl( void ControllerCommandDispatch::updateCommandAvailability() { - bool bModelStateIsValid = ( m_apModelState.get() != nullptr ); - bool bControllerStateIsValid = ( m_apControllerState.get() != nullptr ); + bool bModelStateIsValid = (m_apModelState != nullptr); + bool bControllerStateIsValid = (m_apControllerState != nullptr); // Model and controller states exist. OSL_ASSERT( bModelStateIsValid ); OSL_ASSERT( bControllerStateIsValid ); diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index dcf867eede57..1d0e0f014ba9 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -614,13 +614,11 @@ void ChartModel::impl_loadGraphics( ::utl::UcbStreamHelper::CreateStream( xElementStream, true ) ); - if( apIStm.get() ) + if (apIStm) { Graphic aGraphic; - if( !GraphicConverter::Import( - *apIStm.get(), - aGraphic ) ) + if (!GraphicConverter::Import(*apIStm, aGraphic)) { m_aGraphicObjectVector.emplace_back(aGraphic ); } diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index 4484beadd204..84cf07235ddf 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -118,14 +118,14 @@ void ConfigColorScheme::retrieveConfigColors() return; // create config item if necessary - if( ! m_apChartConfigItem.get()) + if (!m_apChartConfigItem) { m_apChartConfigItem.reset( new impl::ChartConfigItem( *this )); m_apChartConfigItem->addPropertyNotification( aSeriesPropName ); } - OSL_ASSERT( m_apChartConfigItem.get()); - if( ! m_apChartConfigItem.get()) + OSL_ASSERT(m_apChartConfigItem); + if (!m_apChartConfigItem) return; // retrieve colors diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index 0c45241d96f0..b18653887969 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -56,8 +56,8 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false) { MutexGuard aGuard( m_rMutex ); - if( rOther.m_pImplProperties.get()) - m_pImplProperties.reset( new impl::ImplOPropertySet( * rOther.m_pImplProperties.get())); + if (rOther.m_pImplProperties) + m_pImplProperties.reset(new impl::ImplOPropertySet(*rOther.m_pImplProperties)); } void OPropertySet::SetNewValuesExplicitlyEvenIfTheyEqualDefault() diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index c6f59216593e..85da43f53daf 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1557,12 +1557,12 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; if( nTextLevel>0 ) { - lcl_shiftLabels( *apTickIter.get(), aCummulatedLabelsDistance ); + lcl_shiftLabels(*apTickIter, aCummulatedLabelsDistance); fRotationAngleDegree = 0.0; } - aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get() - , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ) - , fRotationAngleDegree ); + aCummulatedLabelsDistance += lcl_getLabelsDistance( + *apTickIter, pTickFactory2D->getDistanceAxisTickToText(m_aAxisProperties), + fRotationAngleDegree); } } } @@ -1611,7 +1611,7 @@ void VCartesianAxis::createLabels() { if(nTextLevel==0) { - nScreenDistanceBetweenTicks = TickFactory2D::getTickScreenDistance( *apTickIter.get() ); + nScreenDistanceBetweenTicks = TickFactory2D::getTickScreenDistance(*apTickIter); if( nTextLevelCount>1 ) nScreenDistanceBetweenTicks*=2; //the above used tick iter does contain also the sub ticks -> thus the given distance is only the half } @@ -1624,7 +1624,8 @@ void VCartesianAxis::createLabels() } AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties; - while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickFactory2D, nScreenDistanceBetweenTicks ) ) + while (!createTextShapes(m_xTextTarget, *apTickIter, rAxisLabelProperties, + pTickFactory2D, nScreenDistanceBetweenTicks)) { }; } @@ -1666,7 +1667,8 @@ void VCartesianAxis::createMaximumLabels() std::unique_ptr< TickIter > apTickIter(createMaximumLabelTickIterator( nTextLevel )); if(apTickIter) { - while( !createTextShapes( m_xTextTarget, *apTickIter.get(), aAxisLabelProperties, pTickFactory2D, -1 ) ) + while (!createTextShapes(m_xTextTarget, *apTickIter, aAxisLabelProperties, + pTickFactory2D, -1)) { }; } @@ -1802,7 +1804,9 @@ void VCartesianAxis::createShapes() if( apTickIter ) { double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; - B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ), fRotationAngleDegree ) ); + B2DVector aLabelsDistance(lcl_getLabelsDistance( + *apTickIter, pTickFactory2D->getDistanceAxisTickToText(m_aAxisProperties), + fRotationAngleDegree)); sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength()); aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0 ) ); nOffset += nCurrentLength; diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx index df74eeeaf05d..da6eca3acf0c 100644 --- a/chart2/source/view/axes/VCartesianGrid.cxx +++ b/chart2/source/view/axes/VCartesianGrid.cxx @@ -212,7 +212,7 @@ void VCartesianGrid::createShapes() //create all scaled tickmark values std::unique_ptr< TickFactory > apTickFactory( createTickFactory() ); - TickFactory& aTickFactory = *apTickFactory.get(); + TickFactory& aTickFactory = *apTickFactory; TickInfoArraysType aAllTickInfos; aTickFactory.getAllTicks( aAllTickInfos ); diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index d978310f4986..0a3716df0f98 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -364,7 +364,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries const & rDataSeries { OUString aNumber; - if( m_apNumberFormatterWrapper.get()) + if (m_apNumberFormatterWrapper) { sal_Int32 nNumberFormatKey = 0; if( rDataSeries.hasExplicitNumberFormat(nPointIndex,bAsPercentage) ) @@ -1334,7 +1334,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes( bResizeEquation = false; if( bShowEquation ) { - if( m_apNumberFormatterWrapper.get()) + if (m_apNumberFormatterWrapper) { // iteration 0: default representation (no wrap) // iteration 1: expected width (nFormulaWidth) is calculated aFormula = xRegressionCurveCalculator->getFormattedRepresentation( @@ -1356,7 +1356,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes( { aFormula.append( "R" ).append( OUStringLiteral1( aSuperscriptFigures[2] ) ).append( " = " ); double fR( xRegressionCurveCalculator->getCorrelationCoefficient()); - if( m_apNumberFormatterWrapper.get()) + if (m_apNumberFormatterWrapper) { Color nLabelCol; bool bColChanged; @@ -1459,7 +1459,7 @@ long VSeriesPlotter::calculateTimeResolutionOnXAxis() { const std::vector< double >& rDateCategories = m_pExplicitCategoriesProvider->getDateCategories(); Date aNullDate(30,12,1899); - if( m_apNumberFormatterWrapper.get() ) + if (m_apNumberFormatterWrapper) aNullDate = m_apNumberFormatterWrapper->getNullDate(); if( !rDateCategories.empty() ) { diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 20d7ab778ee9..5d54a7e32444 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -945,7 +945,7 @@ DataPointLabel* VDataSeries::getDataPointLabel( sal_Int32 index ) const if( isAttributedDataPoint( index ) ) { adaptPointCache( index ); - if( !m_apLabel_AttributedPoint.get() ) + if (!m_apLabel_AttributedPoint) m_apLabel_AttributedPoint = getDataPointLabelFromPropertySet(getPropertiesOfPoint(index)); pRet = m_apLabel_AttributedPoint.get(); diff --git a/codemaker/source/codemaker/typemanager.cxx b/codemaker/source/codemaker/typemanager.cxx index 345594a38b1f..2b54a4092772 100644 --- a/codemaker/source/codemaker/typemanager.cxx +++ b/codemaker/source/codemaker/typemanager.cxx @@ -178,8 +178,7 @@ codemaker::UnoType::Sort TypeManager::decompose( switch (s) { case codemaker::UnoType::Sort::Typedef: if (resolveTypedefs) { - n = dynamic_cast<unoidl::TypedefEntity&>(*ent.get()). - getType(); + n = dynamic_cast<unoidl::TypedefEntity&>(*ent).getType(); while (n.startsWith("[]")) { ++k; //TODO: overflow n = n.copy(std::strlen("[]")); diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 722846b0efa6..4b3face0c702 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -736,9 +736,7 @@ OUString CppuType::getTypeClass(OUString const & name, bool cStyle) ? OUString("typelib_TypeClass_INTERFACE") : OUString("::css::uno::TypeClass_INTERFACE"); case codemaker::UnoType::Sort::Typedef: - return getTypeClass( - dynamic_cast<unoidl::TypedefEntity&>(*ent.get()).getType(), - cStyle); + return getTypeClass(dynamic_cast<unoidl::TypedefEntity&>(*ent).getType(), cStyle); default: for (;;) { std::abort(); @@ -988,7 +986,7 @@ OUString CppuType::resolveOuterTypedefs(OUString const & name) const if (m_typeMgr->getSort(n, &ent) != codemaker::UnoType::Sort::Typedef) { return n; } - n = dynamic_cast<unoidl::TypedefEntity&>(*ent.get()).getType(); + n = dynamic_cast<unoidl::TypedefEntity&>(*ent).getType(); } } @@ -1002,11 +1000,8 @@ OUString CppuType::resolveAllTypedefs(OUString const & name) const break; } sal_Int32 k2; - n = b2u( - codemaker::UnoType::decompose( - u2b(dynamic_cast<unoidl::TypedefEntity&>(*ent.get()). - getType()), - &k2)); + n = b2u(codemaker::UnoType::decompose( + u2b(dynamic_cast<unoidl::TypedefEntity&>(*ent).getType()), &k2)); k1 += k2; //TODO: overflow } OUStringBuffer b; @@ -3138,8 +3133,7 @@ sal_uInt32 ExceptionType::getTotalMemberCount(OUString const & base) const throw CannotDumpException( "exception type base " + base + " is not an exception type"); } - unoidl::ExceptionTypeEntity& ent2( - dynamic_cast< unoidl::ExceptionTypeEntity&>(*ent.get())); + unoidl::ExceptionTypeEntity& ent2(dynamic_cast<unoidl::ExceptionTypeEntity&>(*ent)); return getTotalMemberCount(ent2.getDirectBase()) + ent2.getDirectMembers().size(); //TODO: overflow } diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index 5530392b278b..b5ece143572e 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -814,7 +814,7 @@ void handleEnumType( static_cast< ClassFile::AccessFlags >( ClassFile::ACC_PRIVATE | ClassFile::ACC_STATIC), "<clinit>", "()V", code.get(), std::vector< OString >(), ""); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void addField( @@ -1349,8 +1349,7 @@ void addPlainStructBaseArguments( "unexpected entity \"" + base + "\" in call to addPlainStructBaseArguments"); } - unoidl::PlainStructTypeEntity& ent2( - dynamic_cast<unoidl::PlainStructTypeEntity&>(*ent.get())); + unoidl::PlainStructTypeEntity& ent2(dynamic_cast<unoidl::PlainStructTypeEntity&>(*ent)); if (!ent2.getDirectBase().isEmpty()) { addPlainStructBaseArguments( manager, dependencies, methodDescriptor, code, @@ -1435,7 +1434,7 @@ void handlePlainStructType( ClassFile::ACC_PUBLIC, "<init>", desc.getDescriptor(), code.get(), std::vector< OString >(), desc.getSignature()); addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void handlePolyStructType( @@ -1521,7 +1520,7 @@ void handlePolyStructType( ClassFile::ACC_PUBLIC, "<init>", desc.getDescriptor(), code.get(), std::vector< OString >(), desc.getSignature()); addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void addExceptionBaseArguments( @@ -1538,8 +1537,7 @@ void addExceptionBaseArguments( "unexpected entity \"" + base + "\" in call to addExceptionBaseArguments"); } - unoidl::ExceptionTypeEntity& ent2( - dynamic_cast<unoidl::ExceptionTypeEntity&>(*ent.get())); + unoidl::ExceptionTypeEntity& ent2(dynamic_cast<unoidl::ExceptionTypeEntity&>(*ent)); bool baseException = base == "com.sun.star.uno.Exception"; if (!baseException) { addExceptionBaseArguments( @@ -1827,7 +1825,7 @@ void handleExceptionType( std::vector< OString >(), desc2.getSignature()); addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void createExceptionsAttribute( @@ -1954,7 +1952,7 @@ void handleInterfaceType( } } addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void handleTypedef( @@ -2063,7 +2061,7 @@ void handleConstantGroup( | ClassFile::ACC_FINAL), codemaker::convertString(member.name), desc, valueIndex, sig); } - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void addExceptionHandlers( @@ -2324,7 +2322,7 @@ void handleService( code.get(), std::vector< OString >(), ""); } } - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void handleSingleton( @@ -2440,7 +2438,7 @@ void handleSingleton( ClassFile::ACC_PUBLIC | ClassFile::ACC_STATIC), "get", desc.getDescriptor(), code.get(), std::vector< OString >(), desc.getSignature()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } } diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx index 3c5fe7951792..eb21b1795834 100644 --- a/comphelper/source/container/enumerablemap.cxx +++ b/comphelper/source/container/enumerablemap.cxx @@ -349,7 +349,7 @@ namespace comphelper // create the comparator for the KeyType, and throw if the type is not supported std::unique_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, nullptr ) ); - if ( !pComparator.get() ) + if (!pComparator) throw IllegalTypeException("Unsupported key type.", *this ); // init members @@ -369,7 +369,7 @@ namespace comphelper void EnumerableMap::impl_initValues_throw( const Sequence< Pair< Any, Any > >& _initialValues ) { OSL_PRECOND( m_aData.m_pValues.get() && m_aData.m_pValues->empty(), "EnumerableMap::impl_initValues_throw: illegal call!" ); - if ( !m_aData.m_pValues.get() || !m_aData.m_pValues->empty() ) + if (!m_aData.m_pValues || !m_aData.m_pValues->empty()) throw RuntimeException(); const Pair< Any, Any >* mapping = _initialValues.getConstArray(); diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 718d04b56fb9..43dfc4cfdc71 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -277,7 +277,7 @@ namespace comphelper ::cppu::IPropertyArrayHelper& SAL_CALL OPropertyBag::getInfoHelper() { - if ( !m_pArrayHelper.get() ) + if (!m_pArrayHelper) { Sequence< Property > aProperties; m_aDynamicProperties.describeProperties( aProperties ); diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index a13cbc3b6e14..9433548e8e55 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -252,7 +252,8 @@ void ChildAccess::setProperty( css::uno::Any ChildAccess::asValue() { - if (changedValue_.get() != nullptr) { + if (changedValue_ != nullptr) + { return *changedValue_; } css::uno::Any value; @@ -295,7 +296,8 @@ void ChildAccess::commitChanges(bool valid, Modifications * globalModifications) { assert(globalModifications != nullptr); commitChildChanges(valid, globalModifications); - if (valid && changedValue_.get() != nullptr) { + if (valid && changedValue_ != nullptr) + { std::vector<OUString> path(getAbsolutePath()); getComponents().addModification(path); globalModifications->add(path); diff --git a/connectivity/source/commontools/paramwrapper.cxx b/connectivity/source/commontools/paramwrapper.cxx index 38dbf9075333..08a89a539a32 100644 --- a/connectivity/source/commontools/paramwrapper.cxx +++ b/connectivity/source/commontools/paramwrapper.cxx @@ -150,7 +150,7 @@ namespace param ::cppu::IPropertyArrayHelper& ParameterWrapper::getInfoHelper() { - if ( !m_pInfoHelper.get() ) + if (!m_pInfoHelper) { Sequence< Property > aProperties; try diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 9f3ae07c3910..fc928b7325fa 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -259,7 +259,7 @@ namespace connectivity if ( xStream.is() ) { std::unique_ptr<SvStream> pStream( ::utl::UcbStreamHelper::CreateStream(xStream) ); - if ( pStream.get() ) + if (pStream) { OString sLine; OString sVersionString; diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index bfaef457d35e..3e365c74478f 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -666,7 +666,7 @@ void java_sql_Connection::loadDriverFromProperties( const OUString& _sDriverClas ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); } - if ( pDrvClass.get() ) + if (pDrvClass) { LocalRef< jobject > driverObject( t.env() ); driverObject.set( pDrvClass->newInstanceObject() ); diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx index b4a2844ce6f4..05204fe652a0 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx @@ -108,7 +108,7 @@ Reference<XResultSetMetaData> SAL_CALL OPreparedStatement::getMetaData() { MYSQL_RES* pRes = mysql_stmt_result_metadata(m_pStmt); // TODO warning or error if no meta data. - m_xMetaData = new OResultSetMetaData(*m_xConnection.get(), pRes); + m_xMetaData = new OResultSetMetaData(*m_xConnection, pRes); } return m_xMetaData; } @@ -135,19 +135,17 @@ sal_Bool SAL_CALL OPreparedStatement::execute() if (!m_binds.empty() && mysql_stmt_bind_param(m_pStmt, m_binds.data())) { - MYSQL* pMysql = m_xConnection.get()->getMysqlConnection(); + MYSQL* pMysql = m_xConnection->getMysqlConnection(); mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql), - *this, - m_xConnection.get()->getConnectionEncoding()); + *this, m_xConnection->getConnectionEncoding()); } int nFail = mysql_stmt_execute(m_pStmt); if (nFail != 0) { - MYSQL* pMysql = m_xConnection.get()->getMysqlConnection(); + MYSQL* pMysql = m_xConnection->getMysqlConnection(); mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql), - *this, - m_xConnection.get()->getConnectionEncoding()); + *this, m_xConnection->getConnectionEncoding()); } return !nFail; @@ -160,20 +158,18 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate() if (!m_binds.empty() && mysql_stmt_bind_param(m_pStmt, m_binds.data())) { - MYSQL* pMysql = m_xConnection.get()->getMysqlConnection(); + MYSQL* pMysql = m_xConnection->getMysqlConnection(); mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql), - *this, - m_xConnection.get()->getConnectionEncoding()); + *this, m_xConnection->getConnectionEncoding()); } int nFail = mysql_stmt_execute(m_pStmt); if (nFail != 0) { - MYSQL* pMysql = m_xConnection.get()->getMysqlConnection(); + MYSQL* pMysql = m_xConnection->getMysqlConnection(); mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql), - *this, - m_xConnection.get()->getConnectionEncoding()); + *this, m_xConnection->getConnectionEncoding()); } sal_Int32 affectedRows = mysql_stmt_affected_rows(m_pStmt); @@ -210,24 +206,22 @@ Reference<XResultSet> SAL_CALL OPreparedStatement::executeQuery() if (!m_binds.empty() && mysql_stmt_bind_param(m_pStmt, m_binds.data())) { - MYSQL* pMysql = m_xConnection.get()->getMysqlConnection(); + MYSQL* pMysql = m_xConnection->getMysqlConnection(); mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql), - *this, - m_xConnection.get()->getConnectionEncoding()); + *this, m_xConnection->getConnectionEncoding()); } int nFail = mysql_stmt_execute(m_pStmt); if (nFail != 0) { - MYSQL* pMysql = m_xConnection.get()->getMysqlConnection(); + MYSQL* pMysql = m_xConnection->getMysqlConnection(); mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_stmt_error(m_pStmt), mysql_errno(pMysql), - *this, - m_xConnection.get()->getConnectionEncoding()); + *this, m_xConnection->getConnectionEncoding()); } Reference<XResultSet> xResultSet; - xResultSet = new OPreparedResultSet(*m_xConnection.get(), this, m_pStmt); + xResultSet = new OPreparedResultSet(*m_xConnection, this, m_pStmt); return xResultSet; } diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 7d7a741f93c5..7a767ccdbe7c 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -78,7 +78,7 @@ OConnection::~OConnection() oslGenericFunction OConnection::getOdbcFunction(ODBC3SQLFunctionId _nIndex) const { - OSL_ENSURE(m_xDriver.get(),"OConnection::getOdbcFunction: m_xDriver is null!"); + OSL_ENSURE(m_xDriver, "OConnection::getOdbcFunction: m_xDriver is null!"); return m_xDriver->getOdbcFunction(_nIndex); } diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index 172c6fc5f130..0e196d302e6d 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -521,7 +521,7 @@ void Connection::initialize( const Sequence< Any >& aArguments ) { char *err; std::shared_ptr<PQconninfoOption> oOpts(PQconninfoParse(o.getStr(), &err), PQconninfoFree); - if ( oOpts.get() == nullptr ) + if (oOpts == nullptr) { OUString errorMessage; if ( err != nullptr) diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index dcca0fc9db4a..e29c8d394557 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -330,7 +330,7 @@ void OSQLParseTreeIterator::impl_getQueryParameterColumns( const OSQLTable& _rQu OUString sError; std::unique_ptr< OSQLParseNode > pSubQueryNode( const_cast< OSQLParser& >( m_rParser ).parseTree( sError, sSubQueryCommand ) ); - if ( !pSubQueryNode.get() ) + if (!pSubQueryNode) break; OSQLParseTreeIterator aSubQueryIterator( *this, m_rParser, pSubQueryNode.get() ); diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 683ac9e3b3c2..7d9ca005c071 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -679,7 +679,7 @@ bool OSQLParseNode::impl_parseTableNameNodeToString_throw( OUStringBuffer& rStri { OUString sError; std::unique_ptr< OSQLParseNode > pSubQueryNode( rParam.pParser->parseTree( sError, sCommand ) ); - if ( pSubQueryNode.get() ) + if (pSubQueryNode) { // parse the sub-select to SDBC level, too OUStringBuffer sSubSelect; diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 361cbb2c6750..ee08c612e4e1 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -553,7 +553,7 @@ ORegistryFactoryHelper::getPropertySetInfo() IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper() { ::osl::MutexGuard guard( aMutex ); - if (m_property_array_helper.get() == nullptr) + if (m_property_array_helper == nullptr) { beans::Property prop( "ImplementationKey" /* name */, @@ -564,7 +564,7 @@ IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper() m_property_array_helper.reset( new ::cppu::OPropertyArrayHelper( &prop, 1 ) ); } - return *m_property_array_helper.get(); + return *m_property_array_helper; } diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index dd7139af252f..6c64911a5270 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -986,9 +986,8 @@ cppuhelper::ServiceManager::createInstanceWithContext( { std::shared_ptr< Data::Implementation > impl( findServiceImplementation(Context, aServiceSpecifier)); - return impl.get() == nullptr - ? css::uno::Reference< css::uno::XInterface >() - : impl->createInstance(Context, false); + return impl == nullptr ? css::uno::Reference<css::uno::XInterface>() + : impl->createInstance(Context, false); } css::uno::Reference< css::uno::XInterface > @@ -999,9 +998,8 @@ cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext( { std::shared_ptr< Data::Implementation > impl( findServiceImplementation(Context, ServiceSpecifier)); - return impl.get() == nullptr - ? css::uno::Reference< css::uno::XInterface >() - : impl->createInstanceWithArguments(Context, false, Arguments); + return impl == nullptr ? css::uno::Reference<css::uno::XInterface>() + : impl->createInstanceWithArguments(Context, false, Arguments); } css::uno::Type cppuhelper::ServiceManager::getElementType() diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index c92ec7d4ee5b..42c6721b3ec8 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -232,7 +232,7 @@ SpellDialog::~SpellDialog() void SpellDialog::dispose() { - if (pImpl.get()) + if (pImpl) { // save possibly modified user-dictionaries Reference< XSearchableDictionaryList > xDicList( LinguMgr::GetDictionaryList() ); diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 5b4f64891c76..52686ba92045 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -809,7 +809,8 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow, ORowSetRow const & _rK aValue.setSigned(m_aSignedFlags[parameterName.second.nPosition-1]); if ( (_rInsertRow->get())[parameterName.second.nPosition] != aValue ) { - rtl::Reference<ORowSetValueVector> aCopy(new ORowSetValueVector(*m_aParameterValueForCache.get())); + rtl::Reference<ORowSetValueVector> aCopy( + new ORowSetValueVector(*m_aParameterValueForCache)); (aCopy->get())[i] = (_rInsertRow->get())[parameterName.second.nPosition]; m_aUpdatedParameter[i_nBookmark] = aCopy; bChanged = true; diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 4d2787ef6d2d..8d6d7c60e798 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1704,7 +1704,9 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() { DELETEZ(m_pCache); } - m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew, *m_aParameterValueForCache.get(),m_aFilter,m_nMaxRows ); + m_pCache + = new ORowSetCache(xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, + m_bModified, m_bNew, *m_aParameterValueForCache, m_aFilter, m_nMaxRows); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) { m_nPrivileges = Privilege::SELECT; diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 7518cacf1cd7..50df0f2e01ba 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -1412,14 +1412,14 @@ void ORowSetNotifier::fire() std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() const { - OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); + OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); return m_pImpl->aChangedColumns; } void ORowSetNotifier::firePropertyChange() { - OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); - if( m_pImpl.get() ) + OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); + if (m_pImpl) { for (auto const& changedColumn : m_pImpl->aChangedColumns) { diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index cfac370ca6b0..06d453d645bb 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -773,8 +773,9 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) // normalize the statement so that it doesn't contain any application-level features anymore OUString sError; const std::unique_ptr< OSQLParseNode > pStatementTree( m_aSqlParser.parseTree( sError, sSQL ) ); - OSL_ENSURE( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!" ); - if ( pStatementTree.get() ) + OSL_ENSURE(pStatementTree, "OSingleSelectQueryComposer::getColumns: could not parse the " + "column retrieval statement!"); + if (pStatementTree) if ( !pStatementTree->parseNodeToExecutableStatement( sSQL, m_xConnection, m_aSqlParser, nullptr ) ) break; @@ -1768,7 +1769,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC OUString aErrorMsg; std::unique_ptr<OSQLParseNode> pSqlParseNode( m_aSqlParser.parseTree(aErrorMsg,aSql)); - if ( pSqlParseNode.get() ) + if (pSqlParseNode) { m_aAdditiveIterator.setParseTree(pSqlParseNode.get()); // normalize the filter diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 11e3c9768e9f..8f3f5757321e 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -749,7 +749,7 @@ void ODBExport::exportDelimiter() void ODBExport::exportAutoIncrement() { - if ( m_aAutoIncrement.get() ) + if (m_aAutoIncrement) { AddAttribute(XML_NAMESPACE_DB, XML_ADDITIONAL_COLUMN_STATEMENT,m_aAutoIncrement->second); AddAttribute(XML_NAMESPACE_DB, XML_ROW_RETRIEVING_STATEMENT,m_aAutoIncrement->first); diff --git a/dbaccess/source/filter/xml/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx index bcdc8d2a24a3..16385e7d0df6 100644 --- a/dbaccess/source/filter/xml/xmlHelper.cxx +++ b/dbaccess/source/filter/xml/xmlHelper.cxx @@ -52,7 +52,7 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 switch (_nType) { case XML_DB_TYPE_EQUAL: - if ( !m_pDisplayHandler.get() ) + if (!m_pDisplayHandler) { static const SvXMLEnumMapEntry<bool> aDisplayMap[] = { diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index b99d19d905ee..8b34d35f4be4 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -629,7 +629,7 @@ void ODBFilter::fillPropertyMap(const Any& _rValue,TPropertyNameMap& _rMap) const SvXMLTokenMap& ODBFilter::GetDocElemTokenMap() const { - if ( !m_pDocElemTokenMap.get() ) + if (!m_pDocElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -648,7 +648,7 @@ const SvXMLTokenMap& ODBFilter::GetDocElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDocContentElemTokenMap() const { - if (!m_pDocContentElemTokenMap.get()) + if (!m_pDocContentElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -669,7 +669,7 @@ const SvXMLTokenMap& ODBFilter::GetDocContentElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDatabaseElemTokenMap() const { - if ( !m_pDatabaseElemTokenMap.get() ) + if (!m_pDatabaseElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -690,7 +690,7 @@ const SvXMLTokenMap& ODBFilter::GetDatabaseElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDataSourceElemTokenMap() const { - if ( !m_pDataSourceElemTokenMap.get() ) + if (!m_pDataSourceElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -742,7 +742,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetLoginElemTokenMap() const { - if ( !m_pLoginElemTokenMap.get() ) + if (!m_pLoginElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -760,7 +760,7 @@ const SvXMLTokenMap& ODBFilter::GetLoginElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDatabaseDescriptionElemTokenMap() const { - if ( !m_pDatabaseDescriptionElemTokenMap.get() ) + if (!m_pDatabaseDescriptionElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -776,7 +776,7 @@ const SvXMLTokenMap& ODBFilter::GetDatabaseDescriptionElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDataSourceInfoElemTokenMap() const { - if ( !m_pDataSourceInfoElemTokenMap.get() ) + if (!m_pDataSourceInfoElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -803,7 +803,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceInfoElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetDocumentsElemTokenMap() const { - if ( !m_pDocumentsElemTokenMap.get() ) + if (!m_pDocumentsElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -824,7 +824,7 @@ const SvXMLTokenMap& ODBFilter::GetDocumentsElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetComponentElemTokenMap() const { - if ( !m_pComponentElemTokenMap.get() ) + if (!m_pComponentElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -844,7 +844,7 @@ const SvXMLTokenMap& ODBFilter::GetComponentElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetQueryElemTokenMap() const { - if ( !m_pQueryElemTokenMap.get() ) + if (!m_pQueryElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -869,7 +869,7 @@ const SvXMLTokenMap& ODBFilter::GetQueryElemTokenMap() const const SvXMLTokenMap& ODBFilter::GetColumnElemTokenMap() const { - if ( !m_pColumnElemTokenMap.get() ) + if (!m_pColumnElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index aea44e1b4bc7..a9ae4dff51b0 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -402,7 +402,7 @@ namespace dbaui OConnectionLineDataVec& rLines = m_pConnData->GetConnLineDataList(); for( const auto& rLine : rLines ) { - rLine.get()->Reset(); + rLine->Reset(); } m_pConnData->setReferencingTable(_pSource->GetData()); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index ddee752f5376..3d12fe670f9a 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -401,7 +401,7 @@ void OAddTableDlg::impl_switchTo( ObjectList _eList ) void OAddTableDlg::Update() { - if ( !m_xCurrentList.get() ) + if (!m_xCurrentList) impl_switchTo( Tables ); else m_xCurrentList->updateTableObjectList( m_rContext.allowViews() ); diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index fec63a5630f3..d5032b306f85 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -674,7 +674,7 @@ bool ODatabaseExport::createRowSet() { m_pUpdateHelper.reset(new OParameterUpdateHelper(createPreparedStatment(m_xConnection->getMetaData(),m_xTable,m_vColumnPositions))); - return m_pUpdateHelper.get() != nullptr; + return m_pUpdateHelper != nullptr; } bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTextColor, const FontDescriptor& _rFont) diff --git a/dbaccess/source/ui/misc/controllerframe.cxx b/dbaccess/source/ui/misc/controllerframe.cxx index 93361c7a74fc..4bd0c9e4426d 100644 --- a/dbaccess/source/ui/misc/controllerframe.cxx +++ b/dbaccess/source/ui/misc/controllerframe.cxx @@ -119,7 +119,7 @@ namespace dbaui static void lcl_setFrame_nothrow( ControllerFrame_Data& _rData, const Reference< XFrame >& _rxFrame ) { // release old listener - if ( _rData.m_pListener.get() ) + if (_rData.m_pListener) { _rData.m_pListener->dispose(); _rData.m_pListener = nullptr; diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 34efc1019ae5..f41438313952 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -220,7 +220,7 @@ FeatureState OJoinController::GetState(sal_uInt16 _nId) const AddTableDialogContext& OJoinController::impl_getDialogContext() const { - if ( !m_pDialogContext.get() ) + if (!m_pDialogContext) { OJoinController* pNonConstThis = const_cast< OJoinController* >( this ); pNonConstThis->m_pDialogContext.reset( new AddTableDialogContext( *pNonConstThis ) ); diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index f977ec528d03..e605156daebc 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -768,7 +768,7 @@ namespace OUString aErrorMsg; Reference<XPropertySet> xColumn; std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode(_pView->getPredicateTreeFromEntry(field,aCriteria,aErrorMsg,xColumn)); - if (pParseNode.get()) + if (pParseNode) { if (bMulti && !(field->isOtherFunction() || (aFieldName.toChar() == '*'))) pParseNode->replaceNodeValue(field->GetAlias(),aFieldName); @@ -798,7 +798,7 @@ namespace OUString aErrorMsg; Reference<XPropertySet> xColumn; std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode( _pView->getPredicateTreeFromEntry(field,aCriteria,aErrorMsg,xColumn)); - if (pParseNode.get()) + if (pParseNode) { if (bMulti && !(field->isOtherFunction() || (aFieldName.toChar() == '*'))) pParseNode->replaceNodeValue(field->GetAlias(),aFieldName); @@ -1125,7 +1125,7 @@ namespace OUString aErrorMsg; Reference<XPropertySet> xColumn; std::unique_ptr< ::connectivity::OSQLParseNode> pParseNode(_pView->getPredicateTreeFromEntry(field,aTmp,aErrorMsg,xColumn)); - if (pParseNode.get()) + if (pParseNode) { OUString sGroupBy; pParseNode->getChild(0)->parseNodeToStr( sGroupBy, @@ -2824,7 +2824,7 @@ OUString OQueryDesignView::getStatement() ::connectivity::OSQLParser& rParser( rController.getParser() ); OUString sErrorMessage; std::unique_ptr<OSQLParseNode> pParseNode( rParser.parseTree( sErrorMessage, sSQL, true ) ); - if ( pParseNode.get() ) + if (pParseNode) { OSQLParseNode* pNode = pParseNode->getChild(3)->getChild(1); if ( pNode->count() > 1 ) @@ -2934,7 +2934,7 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(const OTableFieldDesc sSql += "SELECT * FROM x WHERE " + pEntry->GetField() + _sCriteria; std::unique_ptr<OSQLParseNode> pParseNode( rParser.parseTree( _rsErrorMessage, sSql, true ) ); nType = DataType::DOUBLE; - if ( pParseNode.get() ) + if (pParseNode) { OSQLParseNode* pColumnRef = pParseNode->getByRule(OSQLParseNode::column_ref); if ( pColumnRef ) diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 7026e023ef87..ff240a54130e 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1711,7 +1711,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings std::unique_ptr< ::connectivity::OSQLParseNode > pNode( m_aSqlParser.parseTree( aErrorMsg, m_sStatement, m_bGraphicalDesign ) ); - if ( pNode.get() ) + if (pNode) { delete m_pSqlIterator->getParseTree(); m_pSqlIterator->setParseTree( pNode.release() ); diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index 17bbd81131df..c9f125779e7b 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -270,7 +270,8 @@ void ServiceImpl::startExecuteModal( } } - if (app.get() != nullptr) { + if (app != nullptr) + { Application::Execute(); DeInitVCL(); } diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index e92dffe5c52d..f56c1da379c0 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -554,21 +554,21 @@ BackendImpl::BackendImpl( void BackendImpl::addDataToDb( OUString const & url, ComponentBackendDb::Data const & data) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->addEntry(url, data); } ComponentBackendDb::Data BackendImpl::readDataFromDb(OUString const & url) { ComponentBackendDb::Data data; - if (m_backendDb.get()) + if (m_backendDb) data = m_backendDb->getEntry(url); return data; } void BackendImpl::revokeEntryFromDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->revokeEntry(url); } @@ -582,7 +582,7 @@ BackendImpl::getSupportedPackageTypes() void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->removeEntry(url); } diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index b9b8645dfc44..a30bf994c7f3 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -242,7 +242,7 @@ BackendImpl::BackendImpl( void BackendImpl::addDataToDb( OUString const & url, ConfigurationBackendDb::Data const & data) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->addEntry(url, data); } @@ -250,27 +250,27 @@ void BackendImpl::addDataToDb( OUString const & url) { ::boost::optional<ConfigurationBackendDb::Data> data; - if (m_backendDb.get()) + if (m_backendDb) data = m_backendDb->getEntry(url); return data; } void BackendImpl::revokeEntryFromDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->revokeEntry(url); } bool BackendImpl::hasActiveEntry(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) return m_backendDb->hasActiveEntry(url); return false; } bool BackendImpl::activateEntry(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) return m_backendDb->activateEntry(url); return false; } @@ -285,7 +285,7 @@ BackendImpl::getSupportedPackageTypes() } void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->removeEntry(url); } diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index 64be7a09992e..e312369328dd 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -118,19 +118,19 @@ BackendImpl::BackendImpl( void BackendImpl::addDataToDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->addEntry(url); } void BackendImpl::revokeEntryFromDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->revokeEntry(url); } bool BackendImpl::hasActiveEntry(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) return m_backendDb->hasActiveEntry(url); return false; } @@ -146,7 +146,7 @@ BackendImpl::getSupportedPackageTypes() void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->removeEntry(url); } diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index d5df148aeec9..0ac91ff197c6 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -159,7 +159,7 @@ BackendImpl::getSupportedPackageTypes() void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->removeEntry(url); } @@ -208,21 +208,21 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( OUString const & url) { ::boost::optional<HelpBackendDb::Data> data; - if (m_backendDb.get()) + if (m_backendDb) data = m_backendDb->getEntry(url); return data; } bool BackendImpl::hasActiveEntry(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) return m_backendDb->hasActiveEntry(url); return false; } bool BackendImpl::activateEntry(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) return m_backendDb->activateEntry(url); return false; } @@ -533,13 +533,13 @@ void BackendImpl::implProcessHelp( } // Writing the data entry replaces writing the flag file. If we got to this // point the registration was successful. - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->addEntry(xPackage->getURL(), data); } } //if (doRegisterPackage) else { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->revokeEntry(xPackage->getURL()); } } diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index c2ca9b0ca4c1..fb6ce8668582 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -334,7 +334,7 @@ void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaT m_xRootRegistry->packageRemoved(item.first, item.second); } - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->removeEntry(url); } @@ -420,7 +420,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( void BackendImpl::addDataToDb( OUString const & url, ExtensionBackendDb::Data const & data) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->addEntry(url, data); } @@ -428,14 +428,14 @@ ExtensionBackendDb::Data BackendImpl::readDataFromDb( OUString const & url) { ExtensionBackendDb::Data data; - if (m_backendDb.get()) + if (m_backendDb) data = m_backendDb->getEntry(url); return data; } void BackendImpl::revokeEntryFromDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->revokeEntry(url); } diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx index f3e5998f214c..68977d72a01c 100644 --- a/desktop/source/deployment/registry/script/dp_script.cxx +++ b/desktop/source/deployment/registry/script/dp_script.cxx @@ -168,13 +168,13 @@ BackendImpl::BackendImpl( } void BackendImpl::addDataToDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->addEntry(url); } bool BackendImpl::hasActiveEntry(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) return m_backendDb->hasActiveEntry(url); return false; } @@ -195,13 +195,13 @@ BackendImpl::getSupportedPackageTypes() } void BackendImpl::revokeEntryFromDb(OUString const & url) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->revokeEntry(url); } void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/) { - if (m_backendDb.get()) + if (m_backendDb) m_backendDb->removeEntry(url); } diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 3d956cfa5c93..825b1504e0de 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1042,7 +1042,7 @@ namespace drawinglayer std::unique_ptr< vcl::PDFWriter::AnyWidget > pPDFControl( ::toolkitform::describePDFControl( rXControl, *mpPDFExtOutDevData ) ); - if(pPDFControl.get()) + if (pPDFControl) { // still need to fill in the location (is a class Rectangle) const basegfx::B2DRange aRangeLogic(rControlPrimitive.getB2DRange(getViewInformation2D())); @@ -1056,7 +1056,7 @@ namespace drawinglayer pPDFControl->TextFont.SetFontSize(aFontSize); mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::Form); - mpPDFExtOutDevData->CreateControl(*pPDFControl.get()); + mpPDFExtOutDevData->CreateControl(*pPDFControl); mpPDFExtOutDevData->EndStructureElement(); // no normal paint needed (see original UnoControlPDFExportContact::do_PaintObject); @@ -1295,8 +1295,8 @@ namespace drawinglayer rtl::Reference< primitive2d::PolygonHairlinePrimitive2D > xPLeft(new primitive2d::PolygonHairlinePrimitive2D(aLeft, rHairlinePrimitive.getBColor())); rtl::Reference< primitive2d::PolygonHairlinePrimitive2D > xPRight(new primitive2d::PolygonHairlinePrimitive2D(aRight, rHairlinePrimitive.getBColor())); - processBasePrimitive2D(*xPLeft.get()); - processBasePrimitive2D(*xPRight.get()); + processBasePrimitive2D(*xPLeft); + processBasePrimitive2D(*xPRight); } else { @@ -1344,8 +1344,8 @@ namespace drawinglayer rtl::Reference< primitive2d::PolygonStrokePrimitive2D > xPRight(new primitive2d::PolygonStrokePrimitive2D( aRight, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute())); - processBasePrimitive2D(*xPLeft.get()); - processBasePrimitive2D(*xPRight.get()); + processBasePrimitive2D(*xPLeft); + processBasePrimitive2D(*xPRight); } else { @@ -1435,8 +1435,8 @@ namespace drawinglayer aEmpty, rStrokeArrowPrimitive.getEnd())); - processBasePrimitive2D(*xPLeft.get()); - processBasePrimitive2D(*xPRight.get()); + processBasePrimitive2D(*xPLeft); + processBasePrimitive2D(*xPRight); } else { diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index 265c7e0d6703..422c7033702c 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -3002,7 +3002,7 @@ namespace wmfemfhelper } else if (pA->GetComment().equalsIgnoreAsciiCase("EMF_PLUS_HEADER_INFO")) { - if (aEMFPlus.get()) + if (aEMFPlus) { // error: should not yet exist SAL_INFO("drawinglayer", "Error: multiple EMF_PLUS_HEADER_INFO"); @@ -3021,7 +3021,7 @@ namespace wmfemfhelper } else if (pA->GetComment().equalsIgnoreAsciiCase("EMF_PLUS")) { - if (!aEMFPlus.get()) + if (!aEMFPlus) { // error: should exist SAL_INFO("drawinglayer", "Error: EMF_PLUS before EMF_PLUS_HEADER_INFO"); diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 106c8963a226..f85ad0287e5d 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -1629,7 +1629,7 @@ void Test::testSectionAttributes() aEngine.QuickSetAttribs(*pSet, ESelection(0,3,0,9)); // 'bbbccc' std::unique_ptr<EditTextObject> pEditText(aEngine.CreateTextObject()); - CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get()); + CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText); std::vector<editeng::Section> aAttrs; pEditText->GetAllSections(aAttrs); @@ -1678,7 +1678,7 @@ void Test::testSectionAttributes() aEngine.QuickSetAttribs(*pSet, ESelection(4,0,4,5)); std::unique_ptr<EditTextObject> pEditText(aEngine.CreateTextObject()); - CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get()); + CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText); std::vector<editeng::Section> aAttrs; pEditText->GetAllSections(aAttrs); CPPUNIT_ASSERT_EQUAL(size_t(5), aAttrs.size()); @@ -1739,7 +1739,7 @@ void Test::testSectionAttributes() CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aEngine.GetParagraphCount()); std::unique_ptr<EditTextObject> pEditText(aEngine.CreateTextObject()); - CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText.get()); + CPPUNIT_ASSERT_MESSAGE("Failed to create text object.", pEditText); std::vector<editeng::Section> aAttrs; pEditText->GetAllSections(aAttrs); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 8185d7412b47..f4c761183276 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1927,7 +1927,7 @@ public: explicit RemoveEachItemFromPool(EditDoc& rDoc) : mrDoc(rDoc) {} void operator() (const std::unique_ptr<ContentNode>& rNode) { - mrDoc.RemoveItemsFromPool(*rNode.get()); + mrDoc.RemoveItemsFromPool(*rNode); } }; @@ -2800,7 +2800,7 @@ const EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 n AttribsType::const_reverse_iterator it = aAttribs.rbegin(), itEnd = aAttribs.rend(); for (; it != itEnd; ++it) { - const EditCharAttrib& rAttr = *it->get(); + const EditCharAttrib& rAttr = **it; if (rAttr.Which() == nWhich && rAttr.IsIn(nPos)) return &rAttr; } @@ -2814,7 +2814,7 @@ EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) AttribsType::reverse_iterator it = aAttribs.rbegin(), itEnd = aAttribs.rend(); for (; it != itEnd; ++it) { - EditCharAttrib& rAttr = *it->get(); + EditCharAttrib& rAttr = **it; if (rAttr.Which() == nWhich && rAttr.IsIn(nPos)) return &rAttr; } @@ -2826,7 +2826,7 @@ const EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_Int assert(nWhich); for (auto const& attrib : aAttribs) { - const EditCharAttrib& rAttr = *attrib.get(); + const EditCharAttrib& rAttr = *attrib; if (rAttr.GetStart() >= nFromPos && rAttr.Which() == nWhich) return &rAttr; } @@ -2838,7 +2838,7 @@ bool CharAttribList::HasAttrib( sal_Int32 nStartPos, sal_Int32 nEndPos ) const AttribsType::const_reverse_iterator it = aAttribs.rbegin(), itEnd = aAttribs.rend(); for (; it != itEnd; ++it) { - const EditCharAttrib& rAttr = *it->get(); + const EditCharAttrib& rAttr = **it; if (rAttr.GetStart() < nEndPos && rAttr.GetEnd() > nStartPos) return true; } @@ -2888,7 +2888,7 @@ bool CharAttribList::HasBoundingAttrib( sal_Int32 nBound ) const AttribsType::const_reverse_iterator it = aAttribs.rbegin(), itEnd = aAttribs.rend(); for (; it != itEnd; ++it) { - const EditCharAttrib& rAttr = *it->get(); + const EditCharAttrib& rAttr = **it; if (rAttr.GetEnd() < nBound) return false; diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index c78d53fb9123..4d69891b289d 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2301,7 +2301,7 @@ EFieldInfo EditEngine::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const sal_uInt16 nCurrentField = 0; for (auto const& attrib : pNode->GetCharAttribs().GetAttribs()) { - const EditCharAttrib& rAttr = *attrib.get(); + const EditCharAttrib& rAttr = *attrib; if (rAttr.Which() == EE_FEATURE_FIELD) { if ( nCurrentField == nField ) diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 7ff6af5bead3..12c6643fdd42 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -128,7 +128,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse for (const auto & aAttrib : rCopyFrom.maCharAttribs) { - const XEditAttribute& rAttr = *aAttrib.get(); + const XEditAttribute& rAttr = *aAttrib; std::unique_ptr<XEditAttribute> pMyAttr = MakeXEditAttribute( rPoolToUse, *rAttr.GetItem(), rAttr.GetStart(), rAttr.GetEnd()); maCharAttribs.push_back(std::move(pMyAttr)); @@ -463,7 +463,7 @@ void EditTextObjectImpl::ObjectInDestruction(const SfxItemPool& rSfxItemPool) ContentInfosType aReplaced; aReplaced.reserve(aContents.size()); for (auto const& content : aContents) - aReplaced.push_back(std::unique_ptr<ContentInfo>(new ContentInfo(*content.get(), *pNewPool))); + aReplaced.push_back(std::unique_ptr<ContentInfo>(new ContentInfo(*content, *pNewPool))); aReplaced.swap(aContents); // set local variables @@ -566,7 +566,7 @@ EditTextObjectImpl::EditTextObjectImpl( EditTextObject* pFront, const EditTextOb aContents.reserve(r.aContents.size()); for (auto const& content : r.aContents) - aContents.push_back(std::unique_ptr<ContentInfo>(new ContentInfo(*content.get(), *pPool))); + aContents.push_back(std::unique_ptr<ContentInfo>(new ContentInfo(*content, *pPool))); } EditTextObjectImpl::~EditTextObjectImpl() @@ -597,7 +597,7 @@ void EditTextObjectImpl::NormalizeString( svl::SharedStringPool& rPool ) { for (auto const& content : aContents) { - ContentInfo& rInfo = *content.get(); + ContentInfo& rInfo = *content; rInfo.NormalizeString(rPool); } } @@ -608,7 +608,7 @@ std::vector<svl::SharedString> EditTextObjectImpl::GetSharedStrings() const aSSs.reserve(aContents.size()); for (auto const& content : aContents) { - const ContentInfo& rInfo = *content.get(); + const ContentInfo& rInfo = *content; aSSs.push_back(rInfo.GetSharedString()); } return aSSs; @@ -700,7 +700,7 @@ void EditTextObjectImpl::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttr const ContentInfo& rC = *aContents[nPara].get(); for (const auto & aAttrib : rC.maCharAttribs) { - const XEditAttribute& rAttr = *aAttrib.get(); + const XEditAttribute& rAttr = *aAttrib; EECharAttrib aEEAttr; aEEAttr.pAttr = rAttr.GetItem(); aEEAttr.nStart = rAttr.GetStart(); @@ -746,7 +746,7 @@ const SvxFieldData* EditTextObjectImpl::GetFieldData(sal_Int32 nPara, size_t nPo size_t nCurPos = 0; for (auto const& charAttrib : rC.maCharAttribs) { - const XEditAttribute& rAttr = *charAttrib.get(); + const XEditAttribute& rAttr = *charAttrib; if (rAttr.GetItem()->Which() != EE_FEATURE_FIELD) // Skip attributes that are not fields. continue; @@ -864,7 +864,7 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs ) rBorders.push_back(rC.GetText().getLength()); for (const auto & aAttrib : rC.maCharAttribs) { - const XEditAttribute& rAttr = *aAttrib.get(); + const XEditAttribute& rAttr = *aAttrib; const SfxPoolItem* pItem = rAttr.GetItem(); if (!pItem) continue; @@ -928,7 +928,7 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs ) for (const auto & aAttrib : rC.maCharAttribs) { - const XEditAttribute& rXAttr = *aAttrib.get(); + const XEditAttribute& rXAttr = *aAttrib; const SfxPoolItem* pItem = rXAttr.GetItem(); if (!pItem) continue; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 95d6db4c85b3..f283524d328f 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -550,7 +550,7 @@ void EditUndoSetAttribs::Undo() ContentNode* pNode = pEE->GetEditDoc().GetObject( nPara ); for (const auto & nAttr : rInf.GetPrevCharAttribs()) { - const EditCharAttrib& rX = *nAttr.get(); + const EditCharAttrib& rX = *nAttr; // is automatically "poolsized" pEE->GetEditDoc().InsertAttrib(pNode, rX.GetStart(), rX.GetEnd(), *rX.GetItem()); if (rX.Which() == EE_FEATURE_FIELD) diff --git a/editeng/source/editeng/fieldupdater.cxx b/editeng/source/editeng/fieldupdater.cxx index aab517773c41..bdb544b5d868 100644 --- a/editeng/source/editeng/fieldupdater.cxx +++ b/editeng/source/editeng/fieldupdater.cxx @@ -31,11 +31,11 @@ public: EditTextObjectImpl::ContentInfosType& rContents = mrObj.GetContents(); for (std::unique_ptr<ContentInfo> & i : rContents) { - ContentInfo& rContent = *i.get(); + ContentInfo& rContent = *i; ContentInfo::XEditAttributesType& rAttribs = rContent.GetCharAttribs(); for (std::unique_ptr<XEditAttribute> & rAttrib : rAttribs) { - XEditAttribute& rAttr = *rAttrib.get(); + XEditAttribute& rAttr = *rAttrib; const SfxPoolItem* pItem = rAttr.GetItem(); if (pItem->Which() != EE_FEATURE_FIELD) // This is not a field item. diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d1f985ac631c..6637796ea687 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2083,7 +2083,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars ) const CharAttribList::AttribsType& rAttribs = rPaM.GetNode()->GetCharAttribs().GetAttribs(); for (const auto & rAttrib : rAttribs) { - const EditCharAttrib& rAttr = *rAttrib.get(); + const EditCharAttrib& rAttr = *rAttrib; if (rAttr.GetEnd() >= nStart && rAttr.GetStart() < nEnd) { EditSelection aSel( rPaM ); @@ -2961,7 +2961,7 @@ bool ImpEditEngine::UpdateFields() CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs(); for (std::unique_ptr<EditCharAttrib> & rAttrib : rAttribs) { - EditCharAttrib& rAttr = *rAttrib.get(); + EditCharAttrib& rAttr = *rAttrib; if (rAttr.Which() == EE_FEATURE_FIELD) { EditCharAttribField& rField = static_cast<EditCharAttribField&>(rAttr); @@ -3356,7 +3356,7 @@ void ImpEditEngine::UpdateSelections() bool bChanged = false; for (std::unique_ptr<DeletedNodeInfo> & aDeletedNode : aDeletedNodes) { - const DeletedNodeInfo& rInf = *aDeletedNode.get(); + const DeletedNodeInfo& rInf = *aDeletedNode; if ( ( aCurSel.Min().GetNode() == rInf.GetNode() ) || ( aCurSel.Max().GetNode() == rInf.GetNode() ) ) { diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index e9e7c67046ce..e34edc9abf35 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -435,7 +435,7 @@ SfxItemSet ImpEditEngine::GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int const CharAttribList::AttribsType& rAttrs = pNode->GetCharAttribs().GetAttribs(); for (const auto & nAttr : rAttrs) { - const EditCharAttrib& rAttr = *nAttr.get(); + const EditCharAttrib& rAttr = *nAttr; if ( nStart == nEnd ) { @@ -549,7 +549,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, SetA CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs(); for (std::unique_ptr<EditCharAttrib> & rAttrib : rAttribs) { - EditCharAttrib& rAttr = *rAttrib.get(); + EditCharAttrib& rAttr = *rAttrib; if (rAttr.GetStart() > nEndPos) break; @@ -746,7 +746,7 @@ void ImpEditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& const CharAttribList::AttribsType& rAttrs = pNode->GetCharAttribs().GetAttribs(); for (const auto & i : rAttrs) { - const EditCharAttrib& rAttr = *i.get(); + const EditCharAttrib& rAttr = *i; EECharAttrib aEEAttr; aEEAttr.pAttr = rAttr.GetItem(); aEEAttr.nStart = rAttr.GetStart(); diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index 5c28cba3de24..1e50742ee19a 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -53,7 +53,7 @@ bool SvXMLAttrContainerItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( dynamic_cast< const SvXMLAttrContainerItem* >(&rItem) != nullptr, "SvXMLAttrContainerItem::operator ==(): Bad type"); - return *pImpl.get() == *static_cast<const SvXMLAttrContainerItem&>(rItem).pImpl.get(); + return *pImpl == *static_cast<const SvXMLAttrContainerItem&>(rItem).pImpl; } bool SvXMLAttrContainerItem::GetPresentation( @@ -74,8 +74,8 @@ sal_uInt16 SvXMLAttrContainerItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ bool SvXMLAttrContainerItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { - Reference<XNameContainer> xContainer = - new SvUnoAttributeContainer( o3tl::make_unique<SvXMLAttrContainerData>( *pImpl.get() ) ); + Reference<XNameContainer> xContainer + = new SvUnoAttributeContainer(o3tl::make_unique<SvXMLAttrContainerData>(*pImpl)); rVal <<= xContainer; return true; diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index dc1dbfc69ec7..1929777c2f26 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -306,7 +306,7 @@ std::unique_ptr<SvxEditSource> SvxEditSourceAdapter::Clone() const { std::unique_ptr< SvxEditSource > pClonedAdaptee( mpAdaptee->Clone() ); - if( pClonedAdaptee.get() ) + if (pClonedAdaptee) { std::unique_ptr<SvxEditSourceAdapter> pClone(new SvxEditSourceAdapter()); pClone->SetEditSource( std::move(pClonedAdaptee) ); @@ -390,7 +390,7 @@ SfxBroadcaster& SvxEditSourceAdapter::GetBroadcaster() const void SvxEditSourceAdapter::SetEditSource( std::unique_ptr< SvxEditSource > && pAdaptee ) { - if( pAdaptee.get() ) + if (pAdaptee) { mpAdaptee = std::move(pAdaptee); mbEditSourceValid = true; diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx index bf3ea97bdd58..e18d60a13aaa 100644 --- a/extensions/source/bibliography/bibconfig.cxx +++ b/extensions/source/bibliography/bibconfig.cxx @@ -270,7 +270,7 @@ const Mapping* BibConfig::GetMapping(const BibDBDescriptor& rDesc) const { for(std::unique_ptr<Mapping> const & i : mvMappings) { - Mapping& rMapping = *i.get(); + Mapping& rMapping = *i; bool bURLEqual = rDesc.sDataSource == rMapping.sURL; if(rDesc.sTableOrQuery == rMapping.sTableName && bURLEqual) return &rMapping; diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx index 94e5898d8b08..d93753dd2a44 100644 --- a/extensions/source/logging/filehandler.cxx +++ b/extensions/source/logging/filehandler.cxx @@ -206,7 +206,7 @@ namespace logging void FileHandler::impl_writeString_nothrow( const OString& _rEntry ) { - OSL_PRECOND( m_pFile.get(), "FileHandler::impl_writeString_nothrow: no file!" ); + OSL_PRECOND(m_pFile, "FileHandler::impl_writeString_nothrow: no file!"); sal_uInt64 nBytesToWrite( _rEntry.getLength() ); sal_uInt64 nBytesWritten( 0 ); @@ -304,7 +304,7 @@ namespace logging void SAL_CALL FileHandler::flush( ) { MethodGuard aGuard( *this ); - if(!m_pFile.get()) + if (!m_pFile) { OSL_PRECOND(false, "FileHandler::flush: no file!"); return; diff --git a/extensions/source/propctrlr/cellbindinghandler.cxx b/extensions/source/propctrlr/cellbindinghandler.cxx index bd7cbe3ed117..ea8f9924e1bc 100644 --- a/extensions/source/propctrlr/cellbindinghandler.cxx +++ b/extensions/source/propctrlr/cellbindinghandler.cxx @@ -100,8 +100,9 @@ namespace pcr { ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) ); - OSL_PRECOND( m_pHelper.get(), "CellBindingPropertyHandler::actuatingPropertyChanged: inconsistentcy!" ); - // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties + OSL_PRECOND(m_pHelper, + "CellBindingPropertyHandler::actuatingPropertyChanged: inconsistentcy!"); + // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties OSL_PRECOND( _rxInspectorUI.is(), "FormComponentPropertyHandler::actuatingPropertyChanged: no access to the UI!" ); if ( !_rxInspectorUI.is() ) @@ -229,8 +230,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "CellBindingPropertyHandler::getPropertyValue: inconsistency!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE(m_pHelper, "CellBindingPropertyHandler::getPropertyValue: inconsistency!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties Any aReturn; switch ( nPropId ) @@ -275,8 +276,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "CellBindingPropertyHandler::setPropertyValue: inconsistency!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE(m_pHelper, "CellBindingPropertyHandler::setPropertyValue: inconsistency!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties try { @@ -347,8 +348,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); Any aPropertyValue; - OSL_ENSURE( m_pHelper.get(), "CellBindingPropertyHandler::convertToPropertyValue: we have no SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE( + m_pHelper, + "CellBindingPropertyHandler::convertToPropertyValue: we have no SupportedProperties!"); + if (!m_pHelper) return aPropertyValue; PropertyId nPropId( m_pInfoService->getPropertyId( _rPropertyName ) ); @@ -396,8 +399,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); Any aControlValue; - OSL_ENSURE( m_pHelper.get(), "CellBindingPropertyHandler::convertToControlValue: we have no SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE( + m_pHelper, + "CellBindingPropertyHandler::convertToControlValue: we have no SupportedProperties!"); + if (!m_pHelper) return aControlValue; PropertyId nPropId( m_pInfoService->getPropertyId( _rPropertyName ) ); diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index 60ae7318cf09..b099b3250822 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -99,8 +99,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "EFormsPropertyHandler::getPropertyValue: we don't have any SupportedProperties!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE( + m_pHelper, + "EFormsPropertyHandler::getPropertyValue: we don't have any SupportedProperties!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties Any aReturn; try @@ -157,8 +159,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "EFormsPropertyHandler::setPropertyValue: we don't have any SupportedProperties!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE( + m_pHelper, + "EFormsPropertyHandler::setPropertyValue: we don't have any SupportedProperties!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties try { @@ -283,7 +287,7 @@ namespace pcr { std::vector< Property > aProperties; - if ( m_pHelper.get() ) + if (m_pHelper) { if ( m_pHelper->canBindToAnyDataType() ) { @@ -315,8 +319,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); Any aReturn; - OSL_ENSURE( m_pHelper.get(), "EFormsPropertyHandler::convertToPropertyValue: we have no SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE( + m_pHelper, + "EFormsPropertyHandler::convertToPropertyValue: we have no SupportedProperties!"); + if (!m_pHelper) return aReturn; PropertyId nPropId( m_pInfoService->getPropertyId( _rPropertyName ) ); @@ -348,8 +354,9 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); Any aReturn; - OSL_ENSURE( m_pHelper.get(), "EFormsPropertyHandler::convertToControlValue: we have no SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE(m_pHelper, + "EFormsPropertyHandler::convertToControlValue: we have no SupportedProperties!"); + if (!m_pHelper) return aReturn; PropertyId nPropId( m_pInfoService->getPropertyId( _rPropertyName ) ); @@ -379,7 +386,7 @@ namespace pcr Sequence< OUString > SAL_CALL EFormsPropertyHandler::getActuatingProperties( ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pHelper.get() ) + if (!m_pHelper) return Sequence< OUString >(); std::vector< OUString > aInterestedInActuations( 2 ); @@ -392,7 +399,7 @@ namespace pcr Sequence< OUString > SAL_CALL EFormsPropertyHandler::getSupersededProperties( ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pHelper.get() ) + if (!m_pHelper) return Sequence< OUString >(); Sequence<OUString> aReturn { PROPERTY_INPUT_REQUIRED }; @@ -406,7 +413,7 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); if ( !_rxControlFactory.is() ) throw NullPointerException(); - if ( !m_pHelper.get() ) + if (!m_pHelper) throw RuntimeException(); LineDescriptor aDescriptor; @@ -417,7 +424,7 @@ namespace pcr { case PROPERTY_ID_LIST_BINDING: nControlType = PropertyControlType::ListBox; - m_pHelper.get()->getAllElementUINames( EFormsHelper::Binding, aListEntries, true ); + m_pHelper->getAllElementUINames(EFormsHelper::Binding, aListEntries, true); break; case PROPERTY_ID_XML_DATA_MODEL: @@ -472,8 +479,9 @@ namespace pcr throw NullPointerException(); ::osl::MutexGuard aGuard( m_aMutex ); - OSL_ENSURE( m_pHelper.get(), "EFormsPropertyHandler::onInteractivePropertySelection: we do not have any SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE(m_pHelper, "EFormsPropertyHandler::onInteractivePropertySelection: we do not " + "have any SupportedProperties!"); + if (!m_pHelper) return InteractiveSelectionResult_Cancelled; PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); @@ -528,7 +536,7 @@ namespace pcr { ::osl::MutexGuard aGuard( m_aMutex ); EFormsPropertyHandler_Base::addPropertyChangeListener( _rxListener ); - if ( m_pHelper.get() ) + if (m_pHelper) m_pHelper->registerBindingListener( _rxListener ); } @@ -536,7 +544,7 @@ namespace pcr void SAL_CALL EFormsPropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pHelper.get() ) + if (m_pHelper) m_pHelper->revokeBindingListener( _rxListener ); EFormsPropertyHandler_Base::removePropertyChangeListener( _rxListener ); } @@ -549,8 +557,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) ); - OSL_PRECOND( m_pHelper.get(), "EFormsPropertyHandler::actuatingPropertyChanged: inconsistentcy!" ); - // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties + OSL_PRECOND(m_pHelper, "EFormsPropertyHandler::actuatingPropertyChanged: inconsistentcy!"); + // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties DBG_ASSERT( _rxInspectorUI.is(), "EFormsPropertyHandler::actuatingPropertyChanged: invalid callback!" ); if ( !_rxInspectorUI.is() ) diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 24c2531a2953..6aeaffd78d88 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2523,7 +2523,8 @@ namespace pcr bool FormComponentPropertyHandler::impl_dialogListSelection_nothrow( const OUString& _rProperty, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - OSL_PRECOND( m_pInfoService.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" ); + OSL_PRECOND(m_pInfoService, "FormComponentPropertyHandler::impl_dialogListSelection_" + "nothrow: no property meta data!"); OUString sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) ); ListSelectionDialog aDialog(impl_getDefaultDialogFrame_nothrow(), m_xComponent, _rProperty, sPropertyUIName); diff --git a/extensions/source/propctrlr/inspectormodelbase.cxx b/extensions/source/propctrlr/inspectormodelbase.cxx index 3da1c29f5650..5c319fc119ff 100644 --- a/extensions/source/propctrlr/inspectormodelbase.cxx +++ b/extensions/source/propctrlr/inspectormodelbase.cxx @@ -137,7 +137,7 @@ namespace pcr ::cppu::IPropertyArrayHelper& InspectorModelProperties::getInfoHelper() { ::osl::MutexGuard aGuard( m_rMutex ); - if ( m_pPropertyInfo.get() == nullptr ) + if (m_pPropertyInfo == nullptr) { Sequence< Property > aProperties; describeProperties( aProperties ); diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 29a12cf9a249..2ae98b20f8dd 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -861,7 +861,7 @@ namespace pcr impl_toggleInspecteeListening_nothrow( false ); // handlers are obsolete, so is our "composer" for their UI requests - if ( m_pUIRequestComposer.get() ) + if (m_pUIRequestComposer) m_pUIRequestComposer->dispose(); m_pUIRequestComposer.reset(); diff --git a/extensions/source/propctrlr/propertycomposer.cxx b/extensions/source/propctrlr/propertycomposer.cxx index 19d5230ee274..e37313db1f6e 100644 --- a/extensions/source/propctrlr/propertycomposer.cxx +++ b/extensions/source/propctrlr/propertycomposer.cxx @@ -356,10 +356,12 @@ namespace pcr void PropertyComposer::impl_ensureUIRequestComposer( const Reference< XObjectInspectorUI >& _rxInspectorUI ) { - OSL_ENSURE( !m_pUIRequestComposer.get() || m_pUIRequestComposer->getDelegatorUI().get() == _rxInspectorUI.get(), - "PropertyComposer::impl_ensureUIRequestComposer: somebody's changing the horse in the mid of the race!" ); + OSL_ENSURE(!m_pUIRequestComposer + || m_pUIRequestComposer->getDelegatorUI().get() == _rxInspectorUI.get(), + "PropertyComposer::impl_ensureUIRequestComposer: somebody's changing the horse " + "in the mid of the race!"); - if ( !m_pUIRequestComposer.get() ) + if (!m_pUIRequestComposer) m_pUIRequestComposer.reset( new ComposedPropertyUIUpdate( _rxInspectorUI, this ) ); } @@ -410,7 +412,7 @@ namespace pcr clearContainer( m_aSlaveHandlers ); - if ( m_pUIRequestComposer.get() ) + if (m_pUIRequestComposer) m_pUIRequestComposer->dispose(); m_pUIRequestComposer.reset(); } diff --git a/extensions/source/propctrlr/submissionhandler.cxx b/extensions/source/propctrlr/submissionhandler.cxx index 164815bbf554..191c17451dbd 100644 --- a/extensions/source/propctrlr/submissionhandler.cxx +++ b/extensions/source/propctrlr/submissionhandler.cxx @@ -122,8 +122,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "SubmissionPropertyHandler::getPropertyValue: inconsistency!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE(m_pHelper, "SubmissionPropertyHandler::getPropertyValue: inconsistency!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties Any aReturn; try @@ -171,8 +171,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "SubmissionPropertyHandler::setPropertyValue: inconsistency!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE(m_pHelper, "SubmissionPropertyHandler::setPropertyValue: inconsistency!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties try { @@ -212,7 +212,7 @@ namespace pcr Sequence< OUString > SAL_CALL SubmissionPropertyHandler::getActuatingProperties( ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pHelper.get() ) + if (!m_pHelper) return Sequence< OUString >(); Sequence<OUString> aReturn { PROPERTY_XFORMS_BUTTONTYPE }; @@ -223,7 +223,7 @@ namespace pcr Sequence< OUString > SAL_CALL SubmissionPropertyHandler::getSupersededProperties( ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pHelper.get() ) + if (!m_pHelper) return Sequence< OUString >(); Sequence< OUString > aReturn( 3 ); @@ -262,7 +262,7 @@ namespace pcr Sequence< Property > SubmissionPropertyHandler::doDescribeSupportedProperties() const { std::vector< Property > aProperties; - if ( m_pHelper.get() ) + if (m_pHelper) { implAddPropertyDescription( aProperties, PROPERTY_SUBMISSION_ID, cppu::UnoType<submission::XSubmission>::get() ); implAddPropertyDescription( aProperties, PROPERTY_XFORMS_BUTTONTYPE, ::cppu::UnoType<FormButtonType>::get() ); @@ -279,7 +279,7 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); if ( !_rxControlFactory.is() ) throw NullPointerException(); - if ( !m_pHelper.get() ) + if (!m_pHelper) throw RuntimeException(); std::vector< OUString > aListEntries; @@ -287,7 +287,7 @@ namespace pcr switch ( nPropId ) { case PROPERTY_ID_SUBMISSION_ID: - m_pHelper.get()->getAllElementUINames( EFormsHelper::Submission, aListEntries, false ); + m_pHelper->getAllElementUINames(EFormsHelper::Submission, aListEntries, false); break; case PROPERTY_ID_XFORMS_BUTTONTYPE: @@ -320,8 +320,9 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) ); - OSL_PRECOND( m_pHelper.get(), "SubmissionPropertyHandler::actuatingPropertyChanged: inconsistentcy!" ); - // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties + OSL_PRECOND(m_pHelper, + "SubmissionPropertyHandler::actuatingPropertyChanged: inconsistentcy!"); + // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties switch ( nActuatingPropId ) { @@ -344,8 +345,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); Any aPropertyValue; - OSL_ENSURE( m_pHelper.get(), "SubmissionPropertyHandler::convertToPropertyValue: we have no SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE( + m_pHelper, + "SubmissionPropertyHandler::convertToPropertyValue: we have no SupportedProperties!"); + if (!m_pHelper) return aPropertyValue; OUString sControlValue; @@ -383,8 +386,10 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); Any aControlValue; - OSL_ENSURE( m_pHelper.get(), "SubmissionPropertyHandler::convertToControlValue: we have no SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE( + m_pHelper, + "SubmissionPropertyHandler::convertToControlValue: we have no SupportedProperties!"); + if (!m_pHelper) return aControlValue; OSL_ENSURE( _rControlValueType.getTypeClass() == TypeClass_STRING, diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index ec4d6c9f914a..ae2b5a0f9c2d 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -103,8 +103,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "XSDValidationPropertyHandler::getPropertyValue: inconsistency!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE(m_pHelper, "XSDValidationPropertyHandler::getPropertyValue: inconsistency!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties Any aReturn; ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType(); @@ -133,8 +133,8 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); - OSL_ENSURE( m_pHelper.get(), "XSDValidationPropertyHandler::getPropertyValue: inconsistency!" ); - // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties + OSL_ENSURE(m_pHelper, "XSDValidationPropertyHandler::getPropertyValue: inconsistency!"); + // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties if ( PROPERTY_ID_XSD_DATA_TYPE == nPropId ) { @@ -174,7 +174,7 @@ namespace pcr { std::vector< Property > aProperties; - if ( m_pHelper.get() ) + if (m_pHelper) { bool bAllowBinding = m_pHelper->canBindToAnyDataType(); @@ -228,7 +228,7 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); std::vector< OUString > aSuperfluous; - if ( m_pHelper.get() ) + if (m_pHelper) { aSuperfluous.push_back( OUString(PROPERTY_CONTROLSOURCE) ); aSuperfluous.push_back( OUString(PROPERTY_EMPTY_IS_NULL) ); @@ -262,7 +262,7 @@ namespace pcr { ::osl::MutexGuard aGuard( m_aMutex ); std::vector< OUString > aInterestedInActuations; - if ( m_pHelper.get() ) + if (m_pHelper) { aInterestedInActuations.push_back( OUString(PROPERTY_XSD_DATA_TYPE) ); aInterestedInActuations.push_back( OUString(PROPERTY_XML_DATA_MODEL) ); @@ -289,7 +289,7 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); if ( !_rxControlFactory.is() ) throw NullPointerException(); - if ( !m_pHelper.get() ) + if (!m_pHelper) throw RuntimeException(); PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); @@ -424,8 +424,9 @@ namespace pcr throw NullPointerException(); ::osl::MutexGuard aGuard( m_aMutex ); - OSL_ENSURE( m_pHelper.get(), "XSDValidationPropertyHandler::onInteractivePropertySelection: we don't have any SupportedProperties!" ); - if ( !m_pHelper.get() ) + OSL_ENSURE(m_pHelper, "XSDValidationPropertyHandler::onInteractivePropertySelection: we " + "don't have any SupportedProperties!"); + if (!m_pHelper) return InteractiveSelectionResult_Cancelled; PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) ); @@ -460,7 +461,7 @@ namespace pcr { ::osl::MutexGuard aGuard( m_aMutex ); XSDValidationPropertyHandler_Base::addPropertyChangeListener( _rxListener ); - if ( m_pHelper.get() ) + if (m_pHelper) m_pHelper->registerBindingListener( _rxListener ); } @@ -468,7 +469,7 @@ namespace pcr void SAL_CALL XSDValidationPropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) { ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pHelper.get() ) + if (m_pHelper) m_pHelper->revokeBindingListener( _rxListener ); XSDValidationPropertyHandler_Base::removePropertyChangeListener( _rxListener ); } @@ -476,7 +477,9 @@ namespace pcr bool XSDValidationPropertyHandler::implPrepareCloneDataCurrentType( OUString& _rNewName ) { - OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implPrepareCloneDataCurrentType: this will crash!" ); + OSL_PRECOND( + m_pHelper, + "XSDValidationPropertyHandler::implPrepareCloneDataCurrentType: this will crash!"); ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType(); if ( !pType.is() ) @@ -499,7 +502,8 @@ namespace pcr void XSDValidationPropertyHandler::implDoCloneCurrentDataType( const OUString& _rNewName ) { - OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implDoCloneCurrentDataType: this will crash!" ); + OSL_PRECOND(m_pHelper, + "XSDValidationPropertyHandler::implDoCloneCurrentDataType: this will crash!"); ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType(); if ( !pType.is() ) @@ -513,7 +517,9 @@ namespace pcr bool XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType() { - OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType: this will crash!" ); + OSL_PRECOND( + m_pHelper, + "XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType: this will crash!"); ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType(); if ( !pType.is() ) @@ -537,7 +543,8 @@ namespace pcr bool XSDValidationPropertyHandler::implDoRemoveCurrentDataType() { - OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implDoRemoveCurrentDataType: this will crash!" ); + OSL_PRECOND(m_pHelper, + "XSDValidationPropertyHandler::implDoRemoveCurrentDataType: this will crash!"); ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType(); if ( !pType.is() ) @@ -562,7 +569,7 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) ); - if ( !m_pHelper.get() ) + if (!m_pHelper) throw RuntimeException(); // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties @@ -647,7 +654,9 @@ namespace pcr void XSDValidationPropertyHandler::implGetAvailableDataTypeNames( std::vector< OUString >& /* [out] */ _rNames ) const { - OSL_PRECOND( m_pHelper.get(), "XSDValidationPropertyHandler::implGetAvailableDataTypeNames: this will crash!" ); + OSL_PRECOND( + m_pHelper, + "XSDValidationPropertyHandler::implGetAvailableDataTypeNames: this will crash!"); // start with *all* types which are available at the model std::vector< OUString > aAllTypes; m_pHelper->getAvailableDataTypeNames( aAllTypes ); diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index a73033579796..d23384b868a3 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -892,7 +892,7 @@ void SaneDlg::AcquirePreview() mrSane.SetOptionValue( nOption, true ); rtl::Reference<BitmapTransporter> xTransporter(new BitmapTransporter); - if( ! mrSane.Start( *xTransporter.get() ) ) + if (!mrSane.Start(*xTransporter)) { std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Warning, VclButtonsType::Ok, diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index 32f3b4875423..3e86885fa621 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -283,7 +283,7 @@ void SAL_CALL UpdateCheckJob::queryTermination( lang::EventObject const & ) void UpdateCheckJob::terminateAndJoinThread() { - if ( m_pInitThread.get() != nullptr ) + if (m_pInitThread != nullptr) { m_pInitThread->setTerminating(); m_pInitThread->join(); diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index 0485d6f55930..43b8195680bc 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -241,9 +241,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, if ( InteractionInfo* pInteraction = mpHostAppData ? mpHostAppData->GetInteractionInfo():nullptr ) { const std::unique_ptr< SvMemoryStream >& pMemStrm = pInteraction->getHyperlinkRecord(); - if ( pMemStrm.get() ) + if (pMemStrm) { - aPropOpt.AddOpt(ESCHER_Prop_pihlShape, false, 0, *pMemStrm.get()); + aPropOpt.AddOpt(ESCHER_Prop_pihlShape, false, 0, *pMemStrm); } aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x00080008 ); } diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index 62147ae598eb..5d985e60cc96 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -107,7 +107,7 @@ CustomToolBarImportHelper::createCommandFromMacro( const OUString& sCmd ) OUString CustomToolBarImportHelper::MSOCommandToOOCommand( sal_Int16 msoCmd ) { OUString result; - if ( pMSOCmdConvertor.get() ) + if (pMSOCmdConvertor) result = pMSOCmdConvertor->MSOCommandToOOCommand( msoCmd ); return result; } @@ -115,7 +115,7 @@ OUString CustomToolBarImportHelper::MSOCommandToOOCommand( sal_Int16 msoCmd ) OUString CustomToolBarImportHelper::MSOTCIDToOOCommand( sal_Int16 msoTCID ) { OUString result; - if ( pMSOCmdConvertor.get() ) + if (pMSOCmdConvertor) result = pMSOCmdConvertor->MSOTCIDToOOCommand( msoTCID ); return result; } diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 07aef15edba3..b638794c8385 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -178,7 +178,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto // get the SvStream to work with std::unique_ptr< SvStream > aStream(utl::UcbStreamHelper::CreateStream(xInputStream, true)); - if(!aStream.get()) + if (!aStream) { // we need the SvStream break; @@ -189,7 +189,8 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto // As a bonus, zipped data is already detected and handled there GraphicFilter aGraphicFilter; Graphic aGraphic; - const ErrCode nGraphicFilterErrorCode(aGraphicFilter.ImportGraphic(aGraphic, OUString(), *aStream.get())); + const ErrCode nGraphicFilterErrorCode( + aGraphicFilter.ImportGraphic(aGraphic, OUString(), *aStream)); if(ERRCODE_NONE != nGraphicFilterErrorCode) { @@ -260,7 +261,7 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto pTargetSdrPage->getSdrModelFromSdrPage(), aGraphic)); - if(!aNewSdrGrafObj.get()) + if (!aNewSdrGrafObj) { // could not create GraphicObject break; @@ -577,7 +578,7 @@ private: std::unique_ptr< SvStream > aStream(utl::UcbStreamHelper::CreateStream(mxInput, true)); - if(!aStream.get()) + if (!aStream) { return; } diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index a1cff2e99346..6fff0b0cb99d 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1990,7 +1990,8 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape ) ImplMap( rShape.maShapePolyPoly, aPolyPoly ); - const bool bLineOnly = ( rShape.maShapeFillColor == COL_TRANSPARENT ) && ( !rShape.mapShapeGradient.get() ); + const bool bLineOnly + = (rShape.maShapeFillColor == COL_TRANSPARENT) && (!rShape.mapShapeGradient); tools::Rectangle aBoundRect( aPolyPoly.GetBoundRect() ); maAttributeWriter.AddPaintAttr( rShape.maShapeLineColor, rShape.maShapeFillColor, &aBoundRect, rShape.mapShapeGradient.get() ); @@ -3076,7 +3077,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, pA->GetDataSize() ) { // write open shape in every case - if( mapCurShape.get() ) + if (mapCurShape) { ImplWriteShape( *mapCurShape ); mapCurShape.reset(); @@ -3114,7 +3115,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( bGradient ) { // step through following actions until the first Gradient/GradientEx action is found - while( !mapCurShape->mapShapeGradient.get() && bSkip && ( ++nCurAction < nCount ) ) + while (!mapCurShape->mapShapeGradient && bSkip + && (++nCurAction < nCount)) { pAction = rMtf.GetAction( nCurAction ); @@ -3172,7 +3174,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, aStroke.getPath(aPoly); - if(mapCurShape.get()) + if (mapCurShape) { if(1 != mapCurShape->maShapePolyPoly.Count() || !mapCurShape->maShapePolyPoly[0].IsEqual(aPoly)) @@ -3184,7 +3186,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, } } - if( !mapCurShape.get() ) + if (!mapCurShape) { mapCurShape.reset( new SVGShapeDescriptor ); @@ -3281,7 +3283,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, } // write open shape in every case - if( mapCurShape.get() ) + if (mapCurShape) { ImplWriteShape( *mapCurShape ); mapCurShape.reset(); @@ -3718,7 +3720,7 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm, ImplEndClipRegion(); // draw open shape that doesn't have a border - if( mapCurShape.get() ) + if (mapCurShape) { ImplWriteShape( *mapCurShape ); mapCurShape.reset(); diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index c0561c5a62d4..ce94ba6d846d 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -736,8 +736,9 @@ bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset ) { try { - OSL_PRECOND( m_pValueFormatter.get(), "OComboBoxModel::commitControlValueToDbColumn: no value formatter!" ); - if ( m_pValueFormatter.get() ) + OSL_PRECOND(m_pValueFormatter, + "OComboBoxModel::commitControlValueToDbColumn: no value formatter!"); + if (m_pValueFormatter) { if ( !m_pValueFormatter->setFormattedValue( sNewValue ) ) return false; @@ -790,8 +791,9 @@ bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset ) Any OComboBoxModel::translateDbColumnToControlValue() { - OSL_PRECOND( m_pValueFormatter.get(), "OComboBoxModel::translateDbColumnToControlValue: no value formatter!" ); - if ( m_pValueFormatter.get() ) + OSL_PRECOND(m_pValueFormatter, + "OComboBoxModel::translateDbColumnToControlValue: no value formatter!"); + if (m_pValueFormatter) { OUString sValue( m_pValueFormatter->getFormattedValue() ); if ( sValue.isEmpty() diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 600010321d7b..589b0e7ffd3b 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -634,10 +634,11 @@ bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) } else { - OSL_PRECOND( m_pValueFormatter.get(), "OEditModel::commitControlValueToDbColumn: no value formatter!" ); + OSL_PRECOND(m_pValueFormatter, + "OEditModel::commitControlValueToDbColumn: no value formatter!"); try { - if ( m_pValueFormatter.get() ) + if (m_pValueFormatter) { if ( !m_pValueFormatter->setFormattedValue( sNewValue ) ) return false; @@ -657,9 +658,10 @@ bool OEditModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) Any OEditModel::translateDbColumnToControlValue() { - OSL_PRECOND( m_pValueFormatter.get(), "OEditModel::translateDbColumnToControlValue: no value formatter!" ); + OSL_PRECOND(m_pValueFormatter, + "OEditModel::translateDbColumnToControlValue: no value formatter!"); Any aRet; - if ( m_pValueFormatter.get() ) + if (m_pValueFormatter) { OUString sValue( m_pValueFormatter->getFormattedValue() ); if ( sValue.isEmpty() diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index 2f8feff4a38a..97b4c60a2ede 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -402,7 +402,7 @@ bool OImageControlModel::impl_updateStreamForURL_lck( const OUString& _rURL, Val else { pImageStream = ::utl::UcbStreamHelper::CreateStream( _rURL, StreamMode::READ ); - bool bSetNull = ( pImageStream.get() == nullptr ) || ( ERRCODE_NONE != pImageStream->GetErrorCode() ); + bool bSetNull = (pImageStream == nullptr) || (ERRCODE_NONE != pImageStream->GetErrorCode()); if ( !bSetNull ) { diff --git a/forms/source/component/Pattern.cxx b/forms/source/component/Pattern.cxx index 07d1c9467936..eddcfbf19ba7 100644 --- a/forms/source/component/Pattern.cxx +++ b/forms/source/component/Pattern.cxx @@ -130,8 +130,9 @@ bool OPatternModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) } else { - OSL_ENSURE( m_pFormattedValue.get(), "OPatternModel::commitControlValueToDbColumn: no value helper!" ); - if ( !m_pFormattedValue.get() ) + OSL_ENSURE(m_pFormattedValue, + "OPatternModel::commitControlValueToDbColumn: no value helper!"); + if (!m_pFormattedValue) return false; if ( !m_pFormattedValue->setFormattedValue( sNewValue ) ) @@ -167,9 +168,10 @@ void OPatternModel::onDisconnectedDbColumn() Any OPatternModel::translateDbColumnToControlValue() { - OSL_PRECOND( m_pFormattedValue.get(), "OPatternModel::translateDbColumnToControlValue: no value helper!" ); + OSL_PRECOND(m_pFormattedValue, + "OPatternModel::translateDbColumnToControlValue: no value helper!"); - if ( m_pFormattedValue.get() ) + if (m_pFormattedValue) { OUString sValue( m_pFormattedValue->getFormattedValue() ); if ( sValue.isEmpty() diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index ac7049c08d62..2f2a9bf13636 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -916,7 +916,8 @@ void OInterfaceContainer::implReplaceByIndex( const sal_Int32 _nIndex, const Any // approve the new object std::unique_ptr< ElementDescription > aElementMetaData( createElementMetaData() ); - DBG_ASSERT( aElementMetaData.get(), "OInterfaceContainer::implReplaceByIndex: createElementMetaData returned nonsense!" ); + DBG_ASSERT(aElementMetaData, + "OInterfaceContainer::implReplaceByIndex: createElementMetaData returned nonsense!"); { Reference< XPropertySet > xElementProps; _rNewElement >>= xElementProps; @@ -956,27 +957,30 @@ void OInterfaceContainer::implReplaceByIndex( const sal_Int32 _nIndex, const Any // examine the new element OUString sName; - DBG_ASSERT( aElementMetaData.get()->xPropertySet.is(), "OInterfaceContainer::implReplaceByIndex: what did approveNewElement do?" ); + DBG_ASSERT(aElementMetaData->xPropertySet.is(), + "OInterfaceContainer::implReplaceByIndex: what did approveNewElement do?"); - aElementMetaData.get()->xPropertySet->getPropertyValue(PROPERTY_NAME) >>= sName; - aElementMetaData.get()->xPropertySet->addPropertyChangeListener(PROPERTY_NAME, this); + aElementMetaData->xPropertySet->getPropertyValue(PROPERTY_NAME) >>= sName; + aElementMetaData->xPropertySet->addPropertyChangeListener(PROPERTY_NAME, this); // insert the new one - m_aMap.insert( ::std::pair<const OUString, css::uno::Reference<css::uno::XInterface> >( sName, aElementMetaData.get()->xInterface ) ); - m_aItems[ _nIndex ] = aElementMetaData.get()->xInterface; + m_aMap.insert(::std::pair<const OUString, css::uno::Reference<css::uno::XInterface>>( + sName, aElementMetaData->xInterface)); + m_aItems[_nIndex] = aElementMetaData->xInterface; - aElementMetaData.get()->xChild->setParent(static_cast<XContainer*>(this)); + aElementMetaData->xChild->setParent(static_cast<XContainer*>(this)); if ( m_xEventAttacher.is() ) { m_xEventAttacher->insertEntry( _nIndex ); - m_xEventAttacher->attach( _nIndex, aElementMetaData.get()->xInterface, makeAny( aElementMetaData.get()->xPropertySet ) ); + m_xEventAttacher->attach(_nIndex, aElementMetaData->xInterface, + makeAny(aElementMetaData->xPropertySet)); } ContainerEvent aReplaceEvent; aReplaceEvent.Source = static_cast< XContainer* >( this ); aReplaceEvent.Accessor <<= _nIndex; - aReplaceEvent.Element = aElementMetaData.get()->xInterface->queryInterface( m_aElementType ); + aReplaceEvent.Element = aElementMetaData->xInterface->queryInterface(m_aElementType); aReplaceEvent.ReplacedElement = xOldElement->queryInterface( m_aElementType ); impl_replacedElement( aReplaceEvent, _rClearBeforeNotify ); @@ -1064,7 +1068,8 @@ void SAL_CALL OInterfaceContainer::insertByName(const OUString& _rName, const An Reference< XPropertySet > xElementProps; std::unique_ptr< ElementDescription > aElementMetaData( createElementMetaData() ); - DBG_ASSERT( aElementMetaData.get(), "OInterfaceContainer::insertByName: createElementMetaData returned nonsense!" ); + DBG_ASSERT(aElementMetaData, + "OInterfaceContainer::insertByName: createElementMetaData returned nonsense!"); // ensure the correct name of the element try diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 7962c7b9bf5d..0d90d3541e60 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -638,11 +638,11 @@ namespace frm { AttributeDispatchers::iterator aDispatcherPos = m_aDispatchers.find( SID_COPY ); if ( aDispatcherPos != m_aDispatchers.end() ) - aDispatcherPos->second.get()->invalidate(); + aDispatcherPos->second->invalidate(); aDispatcherPos = m_aDispatchers.find( SID_CUT ); if ( aDispatcherPos != m_aDispatchers.end() ) - aDispatcherPos->second.get()->invalidate(); + aDispatcherPos->second->invalidate(); } diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index cca527d17578..ba25affe199f 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -122,8 +122,8 @@ namespace frm void ORichTextModel::implInit() { - OSL_ENSURE( m_pEngine.get(), "ORichTextModel::implInit: where's the engine?" ); - if ( m_pEngine.get() ) + OSL_ENSURE(m_pEngine, "ORichTextModel::implInit: where's the engine?"); + if (m_pEngine) { m_pEngine->SetModifyHdl( LINK( this, ORichTextModel, OnEngineContentModified ) ); @@ -201,7 +201,7 @@ namespace frm acquire(); dispose(); } - if ( m_pEngine.get() ) + if (m_pEngine) { SolarMutexGuard g; SfxItemPool* pPool = m_pEngine->getPool(); @@ -485,7 +485,7 @@ namespace frm void ORichTextModel::impl_smlock_setEngineText( const OUString& _rText ) { - if ( m_pEngine.get() ) + if (m_pEngine) { SolarMutexGuard aSolarGuard; m_bSettingEngineText = true; @@ -584,7 +584,7 @@ namespace frm void ORichTextModel::potentialTextChange( ) { OUString sCurrentEngineText; - if ( m_pEngine.get() ) + if (m_pEngine) sCurrentEngineText = m_pEngine->GetText(); if ( sCurrentEngineText != m_sLastKnownEngineText ) diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx index 55ceeac78f14..acae26c8e69f 100644 --- a/forms/source/xforms/datatypes.cxx +++ b/forms/source/xforms/datatypes.cxx @@ -228,7 +228,7 @@ namespace xforms } // let it match the string - if ( !lcl_matchString( *m_pPatternMatcher.get(), _rValue ) ) + if (!lcl_matchString(*m_pPatternMatcher, _rValue)) return RID_STR_XFORMS_PATTERN_DOESNT_MATCH; } diff --git a/forms/source/xforms/propertysetbase.cxx b/forms/source/xforms/propertysetbase.cxx index 393182c2f8f1..d9609640c7f6 100644 --- a/forms/source/xforms/propertysetbase.cxx +++ b/forms/source/xforms/propertysetbase.cxx @@ -69,7 +69,8 @@ Reference< XPropertySetInfo > SAL_CALL PropertySetBase::getPropertySetInfo( ) void PropertySetBase::registerProperty( const Property& rProperty, const ::rtl::Reference< PropertyAccessorBase >& rAccessor ) { - OSL_ENSURE( rAccessor.get(), "PropertySetBase::registerProperty: invalid property accessor, this will crash!" ); + OSL_ENSURE(rAccessor, + "PropertySetBase::registerProperty: invalid property accessor, this will crash!"); m_aAccessors.emplace( rProperty.Handle, rAccessor ); OSL_ENSURE( rAccessor->isWriteable() diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index f97001045ee5..3d53e47c3efd 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -566,7 +566,7 @@ void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct ) // is supported, i.e. the button is visible. if (m_pBtnMatrix->IsVisible() && !m_pBtnMatrix->IsChecked()) { - std::unique_ptr<FormulaCompiler> pCompiler( m_pHelper->createCompiler( *m_pTokenArray.get())); + std::unique_ptr<FormulaCompiler> pCompiler(m_pHelper->createCompiler(*m_pTokenArray)); // In the case of the reportdesign dialog there is no currently active // OpCode symbol mapping that could be used to create strings from // tokens, it's all dreaded API mapping. However, in that case there's @@ -825,7 +825,7 @@ void FormulaDlg_Impl::UpdateTokenArray( const OUString& rStrExp) } } // if ( pTokens && nLen == m_aTokenList.getLength() ) - std::unique_ptr<FormulaCompiler> pCompiler( m_pHelper->createCompiler(*m_pTokenArray.get())); + std::unique_ptr<FormulaCompiler> pCompiler(m_pHelper->createCompiler(*m_pTokenArray)); // #i101512# Disable special handling of jump commands. pCompiler->EnableJumpCommandReorder(false); pCompiler->EnableStopOnError(false); diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 11258ab7d9c4..56c396c6b3cb 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1476,7 +1476,7 @@ oslGenericFunction LocaleDataImpl::getFunctionSymbol( const Locale& rLocale, con if (pCachedItem) cachedItem = std::move(pCachedItem); - if (cachedItem.get()) + if (cachedItem) cachedItem->aLocale = rLocale; return pSymbol; diff --git a/i18npool/source/transliteration/ignoreKana.cxx b/i18npool/source/transliteration/ignoreKana.cxx index 3267fc06d919..29c8b2f1a31d 100644 --- a/i18npool/source/transliteration/ignoreKana.cxx +++ b/i18npool/source/transliteration/ignoreKana.cxx @@ -41,7 +41,7 @@ ignoreKana::transliterateRange( const OUString& str1, const OUString& str2 ) rtl::Reference< hiraganaToKatakana > t1(new hiraganaToKatakana); rtl::Reference< katakanaToHiragana > t2(new katakanaToHiragana); - return transliteration_Ignore::transliterateRange(str1, str2, *t1.get(), *t2.get()); + return transliteration_Ignore::transliterateRange(str1, str2, *t1, *t2); } sal_Unicode SAL_CALL diff --git a/i18npool/source/transliteration/ignoreSize_ja_JP.cxx b/i18npool/source/transliteration/ignoreSize_ja_JP.cxx index 143c679a9b31..8ed2be8b6db3 100644 --- a/i18npool/source/transliteration/ignoreSize_ja_JP.cxx +++ b/i18npool/source/transliteration/ignoreSize_ja_JP.cxx @@ -40,7 +40,7 @@ ignoreSize_ja_JP::transliterateRange( const OUString& str1, const OUString& str2 rtl::Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP); rtl::Reference< largeToSmall_ja_JP > t2(new largeToSmall_ja_JP); - return transliteration_Ignore::transliterateRange(str1, str2, *t1.get(), *t2.get()); + return transliteration_Ignore::transliterateRange(str1, str2, *t1, *t2); } sal_Unicode SAL_CALL diff --git a/i18npool/source/transliteration/ignoreWidth.cxx b/i18npool/source/transliteration/ignoreWidth.cxx index e0e9ef7b701d..d0a0343869bd 100644 --- a/i18npool/source/transliteration/ignoreWidth.cxx +++ b/i18npool/source/transliteration/ignoreWidth.cxx @@ -41,7 +41,7 @@ ignoreWidth::transliterateRange( const OUString& str1, const OUString& str2 ) rtl::Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth); rtl::Reference< halfwidthToFullwidth > t2(new halfwidthToFullwidth); - return transliteration_Ignore::transliterateRange(str1, str2, *t1.get(), *t2.get()); + return transliteration_Ignore::transliterateRange(str1, str2, *t1, *t2); } sal_Unicode SAL_CALL diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 663b4a945a1a..fbe9e2bee283 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -87,7 +87,7 @@ bool HelpParser::CreatePO( std::unique_ptr <XMLFile> file ( aParser.Execute( sHelpFile, pXmlFile ) ); - if(file.get() == nullptr) + if (file == nullptr) { printf( "%s: %s\n", diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 6a08b11498d8..6efba5177523 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -296,7 +296,7 @@ void ConvDic::AddEntry( const OUString &rLeftText, const OUString &rRightText ) DBG_ASSERT(!HasEntry( rLeftText, rRightText), "entry already exists" ); aFromLeft .emplace( rLeftText, rRightText ); - if (pFromRight.get()) + if (pFromRight) pFromRight->emplace( rRightText, rLeftText ); if (bMaxCharCountIsValid) @@ -320,7 +320,7 @@ void ConvDic::RemoveEntry( const OUString &rLeftText, const OUString &rRightText DBG_ASSERT( aLeftIt != aFromLeft.end(), "left map entry missing" ); aFromLeft .erase( aLeftIt ); - if (pFromRight.get()) + if (pFromRight) { ConvMap::iterator aRightIt = GetEntry( *pFromRight, rRightText, rLeftText ); DBG_ASSERT( aRightIt != pFromRight->end(), "right map entry missing" ); @@ -371,7 +371,7 @@ void SAL_CALL ConvDic::clear( ) { MutexGuard aGuard( GetLinguMutex() ); aFromLeft .clear(); - if (pFromRight.get()) + if (pFromRight) pFromRight->clear(); bNeedEntries = false; bIsModified = true; @@ -390,7 +390,7 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversions( { MutexGuard aGuard( GetLinguMutex() ); - if (!pFromRight.get() && eDirection == ConversionDirection_FROM_RIGHT) + if (!pFromRight && eDirection == ConversionDirection_FROM_RIGHT) return uno::Sequence< OUString >(); if (bNeedEntries) @@ -440,7 +440,7 @@ uno::Sequence< OUString > SAL_CALL ConvDic::getConversionEntries( { MutexGuard aGuard( GetLinguMutex() ); - if (!pFromRight.get() && eDirection == ConversionDirection_FROM_RIGHT) + if (!pFromRight && eDirection == ConversionDirection_FROM_RIGHT) return uno::Sequence< OUString >(); if (bNeedEntries) @@ -497,7 +497,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) { MutexGuard aGuard( GetLinguMutex() ); - if (!pFromRight.get() && eDirection == ConversionDirection_FROM_RIGHT) + if (!pFromRight && eDirection == ConversionDirection_FROM_RIGHT) { DBG_ASSERT( nMaxRightCharCount == 0, "max right char count should be 0" ); return 0; @@ -517,7 +517,7 @@ sal_Int16 SAL_CALL ConvDic::getMaxCharCount( ConversionDirection eDirection ) } nMaxRightCharCount = 0; - if (pFromRight.get()) + if (pFromRight) { for (auto const& elem : *pFromRight) { @@ -547,7 +547,7 @@ void SAL_CALL ConvDic::setPropertyType( // currently we assume that entries with the same left text have the // same PropertyType even if the right text is different... - if (pConvPropType.get()) + if (pConvPropType) pConvPropType->emplace( rLeftText, nPropertyType ); bIsModified = true; } @@ -562,7 +562,7 @@ sal_Int16 SAL_CALL ConvDic::getPropertyType( throw container::NoSuchElementException(); sal_Int16 nRes = ConversionPropertyType::NOT_DEFINED; - if (pConvPropType.get()) + if (pConvPropType) { // still assuming that entries with same left text have same PropertyType // even if they have different right text... diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index 51ba74467120..0ee4844c1b38 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -333,7 +333,7 @@ void ConvDicXMLExport::ExportContent_() { OUString aLeftText(elem); AddAttribute( XML_NAMESPACE_TCD, "left-text", aLeftText ); - if (rDic.pConvPropType.get()) // property-type list available? + if (rDic.pConvPropType) // property-type list available? { sal_Int16 nPropertyType = -1; PropTypeMap::iterator aIt2 = rDic.pConvPropType->find( aLeftText ); diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index d62510c0645f..9d57c1432b29 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1650,7 +1650,7 @@ bool LngSvcMgr::SaveCfgSvcs( const OUString &rServiceName ) if (rServiceName == SN_SPELLCHECKER) { - if (!mxSpellDsp.get()) + if (!mxSpellDsp) GetSpellCheckerDsp_Impl(); pDsp = mxSpellDsp.get(); aLocales = getAvailableLocales( SN_SPELLCHECKER ); diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx index afab92eb24ea..5dbaf0f29c03 100644 --- a/lotuswordpro/source/filter/lwpfilter.cxx +++ b/lotuswordpro/source/filter/lwpfilter.cxx @@ -118,7 +118,7 @@ static bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed) std::unique_ptr<LtcUtBenValueStream> aWordProData(pBentoContainer->FindValueStreamWithPropertyName("WordProData")); - if (!aWordProData.get()) + if (!aWordProData) return false; // decompressing diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index d79217319ff3..ce17fab7970f 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -951,7 +951,7 @@ sal_uInt16 LwpMiddleLayout::GetScaleMode() return GetLayoutScale()->GetScaleMode(); rtl::Reference<LwpObject> xBase(GetBasedOnStyle()); if (xBase.is()) - return dynamic_cast<LwpMiddleLayout&>(*xBase.get()).GetScaleMode(); + return dynamic_cast<LwpMiddleLayout&>(*xBase).GetScaleMode(); else return (LwpLayoutScale::FIT_IN_FRAME | LwpLayoutScale::MAINTAIN_ASPECT_RATIO); } @@ -963,7 +963,7 @@ sal_uInt16 LwpMiddleLayout::GetScaleTile() ? 1 : 0; rtl::Reference<LwpObject> xBase(GetBasedOnStyle()); if (xBase.is()) - return dynamic_cast<LwpMiddleLayout&>(*xBase.get()).GetScaleTile(); + return dynamic_cast<LwpMiddleLayout&>(*xBase).GetScaleTile(); else return 0; } @@ -985,7 +985,7 @@ sal_uInt16 LwpMiddleLayout::GetScaleCenter() { rtl::Reference<LwpObject> xBase(GetBasedOnStyle()); if (xBase.is()) - nRet = dynamic_cast<LwpMiddleLayout&>(*xBase.get()).GetScaleCenter(); + nRet = dynamic_cast<LwpMiddleLayout&>(*xBase).GetScaleCenter(); } m_bGettingScaleCenter = false; diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 6c9b71ef5d64..b88a23bcdf1b 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -773,7 +773,7 @@ void LwpTableLayout::ParseTable() throw std::runtime_error("missing super table"); } - if (m_pXFTable.get()) + if (m_pXFTable) { throw std::runtime_error("this table is already parsed"); } diff --git a/oox/source/drawingml/texteffectscontext.cxx b/oox/source/drawingml/texteffectscontext.cxx index 9046ba5fadf9..7359da879e85 100644 --- a/oox/source/drawingml/texteffectscontext.cxx +++ b/oox/source/drawingml/texteffectscontext.cxx @@ -283,7 +283,7 @@ void TextEffectsContext::processAttributes(const AttributeList& rAttribs) void TextEffectsContext::onStartElement(const oox::AttributeList& rAttribs) { - if(mpGrabBagStack.get() == nullptr) + if (mpGrabBagStack == nullptr) { OUString aGrabBagName = lclGetGrabBagName(mnCurrentElement); mpGrabBagStack.reset(new GrabBagStack(aGrabBagName)); diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 0d5698eab0c9..012ca342ae77 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -106,7 +106,7 @@ Drawing::~Drawing() ::oox::ole::EmbeddedForm& Drawing::getControlForm() const { - if( !mxCtrlForm.get() ) + if (!mxCtrlForm) mxCtrlForm.reset( new ::oox::ole::EmbeddedForm( mrFilter.getModel(), mxDrawPage, mrFilter.getGraphicHelper() ) ); return *mxCtrlForm; diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index ece4cbc9162d..81e159fad77e 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -1845,7 +1845,7 @@ void OStorage::InternalDispose( bool bNotifyImpl ) OSL_ENSURE( !m_pData->m_aOpenSubComponentsVector.size() || m_pData->m_pSubElDispListener.get(), "If any subelements are open the listener must exist!" ); - if (m_pData->m_pSubElDispListener.get()) + if (m_pData->m_pSubElDispListener) { m_pData->m_pSubElDispListener->OwnerIsDisposed(); @@ -2042,7 +2042,7 @@ void OStorage::MakeLinkToSubComponent_Impl( const uno::Reference< lang::XCompone if ( !xComponent.is() ) throw uno::RuntimeException( THROW_WHERE ); - if (!m_pData->m_pSubElDispListener.get()) + if (!m_pData->m_pSubElDispListener) { m_pData->m_pSubElDispListener = new OChildDispListener_Impl( *this ); } diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx index c948dddb88a4..5b59b8924b30 100644 --- a/reportdesign/source/core/api/Shape.cxx +++ b/reportdesign/source/core/api/Shape.cxx @@ -193,7 +193,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( cppu::IPropertyArrayHelper& OShape::getInfoHelper() { - if ( !m_pAggHelper.get() ) + if (!m_pAggHelper) { uno::Sequence<beans::Property> aAggSeq; if ( m_aProps.aComponent.m_xProperty.is() ) diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 5a09ba27bc4d..ea94d02740b5 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -812,7 +812,7 @@ void OUnoObject::_propertyChange( const beans::PropertyChangeEvent& evt ) // set old name property OObjectBase::EndListening(); if ( m_xMediator.is() ) - m_xMediator.get()->stopListening(); + m_xMediator->stopListening(); try { xControlModel->setPropertyValue( PROPERTY_NAME, evt.NewValue ); @@ -821,7 +821,7 @@ void OUnoObject::_propertyChange( const beans::PropertyChangeEvent& evt ) { } if ( m_xMediator.is() ) - m_xMediator.get()->startListening(); + m_xMediator->startListening(); OObjectBase::StartListening(); } } diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index a709f0418972..8323bd865037 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -773,7 +773,7 @@ SvXMLImportContext *ORptFilter::CreateFastContext( sal_Int32 nElement, const SvXMLTokenMap& ORptFilter::GetDocElemTokenMap() const { - if ( !m_pDocElemTokenMap.get() ) + if (!m_pDocElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -790,7 +790,7 @@ const SvXMLTokenMap& ORptFilter::GetDocElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetDocContentElemTokenMap() const { - if (!m_pDocContentElemTokenMap.get()) + if (!m_pDocContentElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -808,21 +808,21 @@ const SvXMLTokenMap& ORptFilter::GetDocContentElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetReportElemTokenMap() const { - if ( !m_pReportElemTokenMap.get() ) + if (!m_pReportElemTokenMap) m_pReportElemTokenMap.reset(OXMLHelper::GetReportElemTokenMap()); return *m_pReportElemTokenMap; } const SvXMLTokenMap& ORptFilter::GetSubDocumentElemTokenMap() const { - if ( !m_pSubDocumentElemTokenMap.get() ) + if (!m_pSubDocumentElemTokenMap) m_pSubDocumentElemTokenMap.reset(OXMLHelper::GetSubDocumentElemTokenMap()); return *m_pSubDocumentElemTokenMap; } const SvXMLTokenMap& ORptFilter::GetFunctionElemTokenMap() const { - if ( !m_pFunctionElemTokenMap.get() ) + if (!m_pFunctionElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -840,7 +840,7 @@ const SvXMLTokenMap& ORptFilter::GetFunctionElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetFormatElemTokenMap() const { - if ( !m_pFormatElemTokenMap.get() ) + if (!m_pFormatElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -856,7 +856,7 @@ const SvXMLTokenMap& ORptFilter::GetFormatElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetGroupElemTokenMap() const { - if ( !m_pGroupElemTokenMap.get() ) + if (!m_pGroupElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -882,7 +882,7 @@ const SvXMLTokenMap& ORptFilter::GetGroupElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetReportElementElemTokenMap() const { - if ( !m_pElemTokenMap.get() ) + if (!m_pElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -900,7 +900,7 @@ const SvXMLTokenMap& ORptFilter::GetReportElementElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetControlElemTokenMap() const { - if ( !m_pControlElemTokenMap.get() ) + if (!m_pControlElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -922,7 +922,7 @@ const SvXMLTokenMap& ORptFilter::GetControlElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetControlPropertyElemTokenMap() const { - if ( !m_pControlElemTokenMap.get() ) + if (!m_pControlElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -944,7 +944,7 @@ const SvXMLTokenMap& ORptFilter::GetControlPropertyElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetComponentElemTokenMap() const { - if ( !m_pComponentElemTokenMap.get() ) + if (!m_pComponentElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -960,7 +960,7 @@ const SvXMLTokenMap& ORptFilter::GetComponentElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetColumnTokenMap() const { - if ( !m_pColumnTokenMap.get() ) + if (!m_pColumnTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -984,7 +984,7 @@ const SvXMLTokenMap& ORptFilter::GetColumnTokenMap() const const SvXMLTokenMap& ORptFilter::GetSectionElemTokenMap() const { - if ( !m_pSectionElemTokenMap.get() ) + if (!m_pSectionElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { @@ -1007,7 +1007,7 @@ const SvXMLTokenMap& ORptFilter::GetSectionElemTokenMap() const const SvXMLTokenMap& ORptFilter::GetCellElemTokenMap() const { - if ( !m_pCellElemTokenMap.get() ) + if (!m_pCellElemTokenMap) { static const SvXMLTokenMapEntry aElemTokenMap[]= { diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index e79d4c6a361f..e1b9978633ac 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -4230,7 +4230,7 @@ void OReportController::openZoomDialog() aZoomItem.SetValueSet(SvxZoomEnableFlags::N100|SvxZoomEnableFlags::WHOLEPAGE|SvxZoomEnableFlags::PAGEWIDTH); pDescriptor->Put(aZoomItem); - ScopedVclPtr<AbstractSvxZoomDialog> pDlg( pFact->CreateSvxZoomDialog(nullptr, *pDescriptor.get()) ); + ScopedVclPtr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, *pDescriptor)); pDlg->SetLimits( 20, 400 ); bool bCancel = ( RET_CANCEL == pDlg->Execute() ); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index e64cee395cf5..08cd7e27e2d1 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -567,7 +567,7 @@ bool OReportSection::handleKeyEvent(const KeyEvent& _rEvent) void OReportSection::deactivateOle() { - if ( m_pFunc.get() ) + if (m_pFunc) m_pFunc->deactivateOle(true); } diff --git a/salhelper/qa/test_api.cxx b/salhelper/qa/test_api.cxx index 56cc571dd6b4..2e276860037c 100644 --- a/salhelper/qa/test_api.cxx +++ b/salhelper/qa/test_api.cxx @@ -109,7 +109,7 @@ public: void Test::testCondition() { osl::Mutex mutex; std::unique_ptr< salhelper::Condition > p(new DerivedCondition(mutex)); - CPPUNIT_ASSERT(typeid (*p.get()) != typeid (salhelper::Condition)); + CPPUNIT_ASSERT(typeid(*p) != typeid(salhelper::Condition)); CPPUNIT_ASSERT(bool(typeid (p.get()) == typeid (salhelper::Condition *))); CPPUNIT_ASSERT(bool( typeid (const_cast< salhelper::Condition const * >(p.get())) diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx index 97c5ab277f89..e5322882032f 100644 --- a/sax/source/fastparser/legacyfastparser.cxx +++ b/sax/source/fastparser/legacyfastparser.cxx @@ -71,8 +71,8 @@ void NamespaceHandler::addNSDeclAttributes( rtl::Reference < comphelper::Attribu { for(const auto& aNamespaceDefine : m_aNamespaceDefines) { - OUString& rPrefix = aNamespaceDefine.get()->m_aPrefix; - OUString& rNamespaceURI = aNamespaceDefine.get()->m_aNamespaceURI; + OUString& rPrefix = aNamespaceDefine->m_aPrefix; + OUString& rNamespaceURI = aNamespaceDefine->m_aNamespaceURI; OUString sDecl; if ( rPrefix.isEmpty() ) sDecl = "xmlns"; diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index a2993d216e88..d10794a197d7 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -2305,8 +2305,8 @@ void ScFiltersTest::testCondFormatThemeColorXLSX() const ScDataBarFormatData* pDataBarFormatData = pDataBar->GetDataBarData(); CPPUNIT_ASSERT_EQUAL(Color(157, 195, 230), pDataBarFormatData->maPositiveColor); - CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor.get()); - CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, *pDataBarFormatData->mpNegativeColor.get()); + CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, *pDataBarFormatData->mpNegativeColor); CPPUNIT_ASSERT_EQUAL(size_t(1), rDoc.GetCondFormList(1)->size()); pFormat = rDoc.GetCondFormat(0, 0, 1); @@ -2344,8 +2344,8 @@ void ScFiltersTest::testCondFormatThemeColor2XLSX() const ScDataBarFormatData* pDataBarFormatData = pDataBar->GetDataBarData(); CPPUNIT_ASSERT_EQUAL(Color(99, 142, 198), pDataBarFormatData->maPositiveColor); - CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor.get()); - CPPUNIT_ASSERT_EQUAL(Color(217, 217, 217), *pDataBarFormatData->mpNegativeColor.get()); + CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor); + CPPUNIT_ASSERT_EQUAL(Color(217, 217, 217), *pDataBarFormatData->mpNegativeColor); CPPUNIT_ASSERT_EQUAL(Color(197, 90, 17), pDataBarFormatData->maAxisColor); xDocSh->DoClose(); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index c3b5694f30a9..ad64e51e4853 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -623,7 +623,7 @@ void testDataBarLengthImpl(ScDocument* pDoc, ScDataBarLengthData* pData, const S for (size_t i = 0; pData[i].nLength != -200; ++i) { std::unique_ptr<ScDataBarInfo> xInfo(pDatabar->GetDataBarInfo(ScAddress(nCol, i, 0))); - CPPUNIT_ASSERT(xInfo.get()); + CPPUNIT_ASSERT(xInfo); ASSERT_DOUBLES_EQUAL(pData[i].nLength, xInfo->mnLength); ASSERT_DOUBLES_EQUAL(nZeroPos, xInfo->mnZero); } diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 15efbbf09b36..6bfccbc97bdc 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -1005,7 +1005,7 @@ void Test::testFormulaCompiler() std::unique_ptr<ScTokenArray> pArray; { pArray.reset(compileFormula(m_pDoc, OUString::createFromAscii(aTests[i].pInput), aTests[i].eInputGram)); - CPPUNIT_ASSERT_MESSAGE("Token array shouldn't be NULL!", pArray.get()); + CPPUNIT_ASSERT_MESSAGE("Token array shouldn't be NULL!", pArray); } OUString aFormula = toString(*m_pDoc, ScAddress(), *pArray, aTests[i].eOutputGram); @@ -1033,7 +1033,7 @@ void Test::testFormulaCompilerJumpReordering() // Compile formula string first. std::unique_ptr<ScTokenArray> pCode(compileFormula(m_pDoc, aInput)); - CPPUNIT_ASSERT(pCode.get()); + CPPUNIT_ASSERT(pCode); // Then generate RPN tokens. ScCompiler aCompRPN(m_pDoc, ScAddress(), *pCode, FormulaGrammar::GRAM_NATIVE); diff --git a/sc/source/core/data/cellvalues.cxx b/sc/source/core/data/cellvalues.cxx index 459322e39608..8854f0d8763f 100644 --- a/sc/source/core/data/cellvalues.cxx +++ b/sc/source/core/data/cellvalues.cxx @@ -270,7 +270,7 @@ struct TableValues::Impl m_Tables.push_back(o3tl::make_unique<TableType>()); std::unique_ptr<TableType>& rTab2 = m_Tables.back(); for (size_t nCol = 0; nCol < nCols; ++nCol) - rTab2.get()->push_back(o3tl::make_unique<CellValues>()); + rTab2->push_back(o3tl::make_unique<CellValues>()); } } @@ -287,7 +287,7 @@ struct TableValues::Impl return nullptr; std::unique_ptr<TableType>& rTab2 = m_Tables[nTab-maRange.aStart.Tab()]; size_t nColOffset = nCol - maRange.aStart.Col(); - if(nColOffset >= rTab2.get()->size()) + if (nColOffset >= rTab2->size()) return nullptr; return &rTab2.get()[0][nColOffset].get()[0]; } diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 84b73e269dd6..c53e2774b0d5 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -936,7 +936,7 @@ std::unique_ptr<ScDataBarInfo> ScDataBarFormat::GetDataBarInfo(const ScAddress& { if(mpFormatData->mpNegativeColor) { - pInfo->maColor = *mpFormatData->mpNegativeColor.get(); + pInfo->maColor = *mpFormatData->mpNegativeColor; } else { diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 3ea09da33e0d..6854602b9c49 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -400,7 +400,7 @@ ScDPObject* ScDocument::GetDPAtBlock( const ScRange & rBlock ) const void ScDocument::StopTemporaryChartLock() { - if( apTemporaryChartLock.get() ) + if (apTemporaryChartLock) apTemporaryChartLock->StopLocking(); } @@ -615,7 +615,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab, ScExternalRefManager* ScDocument::GetExternalRefManager() const { ScDocument* pThis = const_cast<ScDocument*>(this); - if (!pExternalRefMgr.get()) + if (!pExternalRefMgr) pThis->pExternalRefMgr.reset( new ScExternalRefManager( pThis)); return pExternalRefMgr.get(); @@ -628,7 +628,7 @@ bool ScDocument::IsInExternalReferenceMarking() const void ScDocument::MarkUsedExternalReferences() { - if (!pExternalRefMgr.get()) + if (!pExternalRefMgr) return; if (!pExternalRefMgr->hasExternalData()) return; @@ -643,7 +643,7 @@ void ScDocument::MarkUsedExternalReferences() ScFormulaParserPool& ScDocument::GetFormulaParserPool() const { - if( !mxFormulaParserPool.get() ) + if (!mxFormulaParserPool) mxFormulaParserPool.reset( new ScFormulaParserPool( *this ) ); return *mxFormulaParserPool; } diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index bf92c9d2d3e7..ccd20606a95e 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -348,7 +348,7 @@ void ScDocument::UpdateChart( const OUString& rChartName ) try { uno::Reference< util::XModifiable > xModif( xChartDoc, uno::UNO_QUERY_THROW ); - if( apTemporaryChartLock.get() ) + if (apTemporaryChartLock) apTemporaryChartLock->AlsoLockThisChart( uno::Reference< frame::XModel >( xModif, uno::UNO_QUERY ) ); xModif->setModified( true ); } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 4fe7bb85ce11..2e4ccbc28e1a 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -386,7 +386,7 @@ EEHorizontalTextDirection ScDocument::GetEditTextDirection(SCTAB nTab) const ScMacroManager* ScDocument::GetMacroManager() { - if (!mpMacroMgr.get()) + if (!mpMacroMgr) mpMacroMgr.reset(new ScMacroManager(this)); return mpMacroMgr.get(); } @@ -811,7 +811,7 @@ bool ScDocument::IsInLinkUpdate() const void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin) { - if (!pExternalRefMgr.get()) + if (!pExternalRefMgr) return; sfx2::LinkManager* pMgr = GetDocLinkManager().getLinkManager(bAutoCalc); @@ -1205,7 +1205,7 @@ void ScDocument::KeyInput() { if ( pChartListenerCollection->hasListeners() ) pChartListenerCollection->StartTimer(); - if( apTemporaryChartLock.get() ) + if (apTemporaryChartLock) apTemporaryChartLock->StartOrContinueLocking(); } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 5126ebbf417d..230891d2d402 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2548,7 +2548,7 @@ void ScDocument::MergeNumberFormatter(const ScDocument* pSrcDoc) ScClipParam& ScDocument::GetClipParam() { - if (!mpClipParam.get()) + if (!mpClipParam) mpClipParam.reset(new ScClipParam); return *mpClipParam; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 02ffea06dd47..8d10bb32f9c6 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -3163,7 +3163,7 @@ void ScDPCollection::NameCaches::updateCache( return; } - ScDPCache& rCache = *itr->second.get(); + ScDPCache& rCache = *itr->second; // Update the cache with new cell values. This will clear all group dimension info. rCache.InitFromDoc(mpDoc, rRange); @@ -3556,7 +3556,7 @@ bool ScDPCollection::GetReferenceGroups(const ScDPObject& rDPObj, const ScDPDime { for (const std::unique_ptr<ScDPObject>& aTable : maTables) { - const ScDPObject& rRefObj = *aTable.get(); + const ScDPObject& rRefObj = *aTable; if (&rRefObj == &rDPObj) continue; @@ -3639,7 +3639,7 @@ void ScDPCollection::CopyToTab( SCTAB nOld, SCTAB nNew ) TablesType::const_iterator it = maTables.begin(), itEnd = maTables.end(); for (; it != itEnd; ++it) { - const ScDPObject& rObj = *it->get(); + const ScDPObject& rObj = **it; ScRange aOutRange = rObj.GetOutRange(); if (aOutRange.aStart.Tab() != nOld) continue; @@ -3664,7 +3664,7 @@ bool ScDPCollection::RefsEqual( const ScDPCollection& r ) const TablesType::const_iterator itr = maTables.begin(), itr2 = r.maTables.begin(), itrEnd = maTables.end(); for (; itr != itrEnd; ++itr, ++itr2) - if (!(*itr)->RefsEqual(*itr2->get())) + if (!(*itr)->RefsEqual(**itr2)) return false; return true; @@ -3678,7 +3678,7 @@ void ScDPCollection::WriteRefsTo( ScDPCollection& r ) const TablesType::const_iterator itr = maTables.begin(), itrEnd = maTables.end(); TablesType::iterator itr2 = r.maTables.begin(); for (; itr != itrEnd; ++itr, ++itr2) - (*itr)->WriteRefsTo(*itr2->get()); + (*itr)->WriteRefsTo(**itr2); } else { @@ -3897,7 +3897,7 @@ void ScDPCollection::GetAllTables(const ScRange& rSrcRange, std::set<ScDPObject* TablesType::const_iterator it = maTables.begin(), itEnd = maTables.end(); for (; it != itEnd; ++it) { - const ScDPObject& rObj = *it->get(); + const ScDPObject& rObj = **it; if (!rObj.IsSheetData()) // Source is not a sheet range. continue; @@ -3926,7 +3926,7 @@ void ScDPCollection::GetAllTables(const OUString& rSrcName, std::set<ScDPObject* TablesType::const_iterator it = maTables.begin(), itEnd = maTables.end(); for (; it != itEnd; ++it) { - const ScDPObject& rObj = *it->get(); + const ScDPObject& rObj = **it; if (!rObj.IsSheetData()) // Source is not a sheet range. continue; @@ -3957,7 +3957,7 @@ void ScDPCollection::GetAllTables( TablesType::const_iterator it = maTables.begin(), itEnd = maTables.end(); for (; it != itEnd; ++it) { - const ScDPObject& rObj = *it->get(); + const ScDPObject& rObj = **it; if (!rObj.IsImportData()) // Source data is not a database. continue; diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index d304e1f5c817..1dec7ca8b50e 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -2367,7 +2367,7 @@ long ScDPMembers::getMinMembers() const { // count only visible with details (default is true for both) const rtl::Reference<ScDPMember>& pMbr = *it; - if (!pMbr.get() || (pMbr->isVisible() && pMbr->getShowDetails())) + if (!pMbr || (pMbr->isVisible() && pMbr->getShowDetails())) ++nVisCount; } } diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index eadff07dc455..0fe000d9a50c 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -695,8 +695,12 @@ void ScMarkData::GetSelectionCover( ScRange& rRange ) pCurColMarkedRows.reset( new ScFlatBoolRowSegments() ); pCurColMarkedRows->setFalse( 0, MAXROW ); ScMultiSelIter aMultiIter( aMultiSel, nCol ); - ScFlatBoolRowSegments::ForwardIterator aPrevItr ( pPrevColMarkedRows.get() ? *pPrevColMarkedRows : aNoRowsMarked ); // For finding left envelope - ScFlatBoolRowSegments::ForwardIterator aPrevItr1( pPrevColMarkedRows.get() ? *pPrevColMarkedRows : aNoRowsMarked ); // For finding right envelope + ScFlatBoolRowSegments::ForwardIterator aPrevItr( + pPrevColMarkedRows ? *pPrevColMarkedRows + : aNoRowsMarked); // For finding left envelope + ScFlatBoolRowSegments::ForwardIterator aPrevItr1( + pPrevColMarkedRows ? *pPrevColMarkedRows + : aNoRowsMarked); // For finding right envelope SCROW nTopPrev = 0, nBottomPrev = 0; // For right envelope while ( aMultiIter.Next( nTop, nBottom ) ) { @@ -813,7 +817,8 @@ void ScMarkData::GetSelectionCover( ScRange& rRange ) bPrevColUnMarked = true; SCROW nTopPrev = 0, nBottomPrev = 0; bool bRangeMarked = false; - ScFlatBoolRowSegments::ForwardIterator aPrevItr( pPrevColMarkedRows.get() ? *pPrevColMarkedRows : aNoRowsMarked ); + ScFlatBoolRowSegments::ForwardIterator aPrevItr( + pPrevColMarkedRows ? *pPrevColMarkedRows : aNoRowsMarked); while( nTopPrev <= MAXROW && nBottomPrev <= MAXROW ) { const bool bHasValue = aPrevItr.getValue(nTopPrev, bRangeMarked); diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index 0e9371ee4b27..70e6d5a1aba4 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -144,7 +144,7 @@ void ScPivotParam::SetLabelData(const ScDPLabelDataVector& rVector) ScDPLabelDataVector::const_iterator it; for (it = rVector.begin(); it != rVector.end(); ++it) { - aNewArray.push_back(o3tl::make_unique<ScDPLabelData>(*it->get())); + aNewArray.push_back(o3tl::make_unique<ScDPLabelData>(**it)); } maLabelArray.swap(aNewArray); } diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index c8727f55bd05..8e961ce28222 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -707,14 +707,14 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& rPos ) const // transfer ownership of outliner object to caption, or set simple text OSL_ENSURE( rInitData.mxOutlinerObj.get() || !rInitData.maSimpleText.isEmpty(), "ScPostIt::CreateCaptionFromInitData - need either outliner para object or simple text" ); - if( rInitData.mxOutlinerObj.get() ) + if (rInitData.mxOutlinerObj) maNoteData.m_pCaption->SetOutlinerParaObject( std::move(rInitData.mxOutlinerObj) ); else maNoteData.m_pCaption->SetText( rInitData.maSimpleText ); // copy all items or set default items; reset shadow items ScCaptionUtil::SetDefaultItems( *maNoteData.m_pCaption, mrDoc ); - if( rInitData.mxItemSet.get() ) + if (rInitData.mxItemSet) ScCaptionUtil::SetCaptionItems( *maNoteData.m_pCaption, *rInitData.mxItemSet ); // set position and size of the caption object diff --git a/sc/source/core/data/simpleformulacalc.cxx b/sc/source/core/data/simpleformulacalc.cxx index 75bc35a322cb..3ed2c173f3c6 100644 --- a/sc/source/core/data/simpleformulacalc.cxx +++ b/sc/source/core/data/simpleformulacalc.cxx @@ -45,7 +45,7 @@ void ScSimpleFormulaCalculator::Calculate() return; mbCalculated = true; - ScInterpreter aInt(nullptr, mpDoc, mpDoc->GetNonThreadedContext(), maAddr, *mpCode.get()); + ScInterpreter aInt(nullptr, mpDoc, mpDoc->GetNonThreadedContext(), maAddr, *mpCode); std::unique_ptr<sfx2::LinkManager> pNewLinkMgr( new sfx2::LinkManager(mpDoc->GetDocumentShell()) ); aInt.SetLinkManager( pNewLinkMgr.get() ); diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx index 9eb0429fd69d..0b563804e58f 100644 --- a/sc/source/core/tool/cellkeytranslator.cxx +++ b/sc/source/core/tool/cellkeytranslator.cxx @@ -157,7 +157,7 @@ static void lclMatchKeyword(OUString& rName, const ScCellKeywordHashMap& aMap, void ScCellKeywordTranslator::transKeyword(OUString& rName, const lang::Locale* pLocale, OpCode eOpCode) { - if ( !spInstance.get() ) + if (!spInstance) spInstance.reset( new ScCellKeywordTranslator ); LanguageType nLang = pLocale ? diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx index 781859a7c4ae..80a974e382a4 100644 --- a/sc/source/core/tool/chartlis.cxx +++ b/sc/source/core/tool/chartlis.cxx @@ -119,7 +119,7 @@ ScChartListener::~ScChartListener() EndListeningTo(); pUnoData.reset(); - if (mpExtRefListener.get()) + if (mpExtRefListener) { // Stop listening to all external files. ScExternalRefManager* pRefMgr = mpDoc->GetExternalRefManager(); @@ -263,7 +263,7 @@ private: void ScChartListener::StartListeningTo() { - if (!mpTokens.get() || mpTokens->empty()) + if (!mpTokens || mpTokens->empty()) // no references to listen to. return; @@ -272,7 +272,7 @@ void ScChartListener::StartListeningTo() void ScChartListener::EndListeningTo() { - if (!mpTokens.get() || mpTokens->empty()) + if (!mpTokens || mpTokens->empty()) // no references to listen to. return; @@ -303,7 +303,7 @@ void ScChartListener::UpdateChartIntersecting( const ScRange& rRange ) ScChartListener::ExternalRefListener* ScChartListener::GetExtRefListener() { - if (!mpExtRefListener.get()) + if (!mpExtRefListener) mpExtRefListener.reset(new ExternalRefListener(*this, mpDoc)); return mpExtRefListener.get(); diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx index fe52a1af994e..8e9bd2f7f7db 100644 --- a/sc/source/core/tool/chartlock.cxx +++ b/sc/source/core/tool/chartlock.cxx @@ -157,7 +157,7 @@ ScTemporaryChartLock::~ScTemporaryChartLock() void ScTemporaryChartLock::StartOrContinueLocking() { - if(!mapScChartLockGuard.get()) + if (!mapScChartLockGuard) mapScChartLockGuard.reset( new ScChartLockGuard(mpDoc) ); maTimer.Start(); } @@ -170,7 +170,7 @@ void ScTemporaryChartLock::StopLocking() void ScTemporaryChartLock::AlsoLockThisChart( const Reference< frame::XModel >& xModel ) { - if(mapScChartLockGuard.get()) + if (mapScChartLockGuard) mapScChartLockGuard->AlsoLockThisChart( xModel ); } diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index e585073f1d1c..dc23b55a43dc 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7573,7 +7573,7 @@ std::unique_ptr<ScDBQueryParamBase> ScInterpreter::GetDBParams( bool& rMissingFi { // First, get the query criteria range. ::std::unique_ptr<ScDBRangeBase> pQueryRef( PopDBDoubleRef() ); - if (!pQueryRef.get()) + if (!pQueryRef) return nullptr; bool bByVal = true; @@ -7635,7 +7635,7 @@ std::unique_ptr<ScDBQueryParamBase> ScInterpreter::GetDBParams( bool& rMissingFi unique_ptr<ScDBRangeBase> pDBRef( PopDBDoubleRef() ); - if (nGlobalError != FormulaError::NONE || !pDBRef.get()) + if (nGlobalError != FormulaError::NONE || !pDBRef) return nullptr; if ( bRangeFake ) @@ -7667,7 +7667,7 @@ std::unique_ptr<ScDBQueryParamBase> ScInterpreter::GetDBParams( bool& rMissingFi unique_ptr<ScDBQueryParamBase> pParam( pDBRef->createQueryParam(pQueryRef.get()) ); - if (pParam.get()) + if (pParam) { // An allowed missing field parameter sets the result field // to any of the query fields, just to be able to return @@ -7706,7 +7706,7 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) sal_uLong nCount = 0; bool bMissingField = false; unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - if (pQueryParam.get()) + if (pQueryParam) { if (!pQueryParam->IsValidFieldIndex()) { @@ -7781,7 +7781,7 @@ void ScInterpreter::ScDBCount() { bool bMissingField = true; unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - if (pQueryParam.get()) + if (pQueryParam) { sal_uLong nCount = 0; if ( bMissingField && pQueryParam->GetType() == ScDBQueryParamBase::INTERNAL ) @@ -7839,7 +7839,7 @@ void ScInterpreter::ScDBCount2() { bool bMissingField = true; unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - if (pQueryParam.get()) + if (pQueryParam) { if (!pQueryParam->IsValidFieldIndex()) { @@ -7895,7 +7895,7 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount ) double fSum = 0.0; bool bMissingField = false; unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - if (pQueryParam.get()) + if (pQueryParam) { if (!pQueryParam->IsValidFieldIndex()) { diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c47b33f8488c..2cc8bc184b4b 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2472,7 +2472,7 @@ void ScInterpreter::ScDBGet() { bool bMissingField = false; unique_ptr<ScDBQueryParamBase> pQueryParam( GetDBParams(bMissingField) ); - if (!pQueryParam.get()) + if (!pQueryParam) { // Failed to create query param. PushIllegalParameter(); diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index c4ef813cdac3..ecadbc761a15 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -261,7 +261,7 @@ void ScRangeData::GetSymbol( OUString& rSymbol, const ScAddress& rPos, const For void ScRangeData::UpdateSymbol( OUStringBuffer& rBuffer, const ScAddress& rPos ) { std::unique_ptr<ScTokenArray> pTemp( pCode->Clone() ); - ScCompiler aComp( pDoc, rPos, *pTemp.get(), formula::FormulaGrammar::GRAM_DEFAULT); + ScCompiler aComp(pDoc, rPos, *pTemp, formula::FormulaGrammar::GRAM_DEFAULT); aComp.MoveRelWrap(MAXCOL, MAXROW); aComp.CreateStringFromTokenArray( rBuffer ); } diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index b3ee0cc8311c..b984ed0f8f1e 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -272,7 +272,7 @@ ScUserList::ScUserList() ScUserList::ScUserList(const ScUserList& rOther) { for (const std::unique_ptr<ScUserListData>& rData : rOther.maData) - maData.push_back( o3tl::make_unique<ScUserListData>(*rData.get()) ); + maData.push_back(o3tl::make_unique<ScUserListData>(*rData)); } const ScUserListData* ScUserList::GetData(const OUString& rSubStr) const @@ -310,7 +310,7 @@ ScUserList& ScUserList::operator=( const ScUserList& rOther ) { maData.clear(); for (const std::unique_ptr<ScUserListData>& rData : rOther.maData) - maData.push_back( o3tl::make_unique<ScUserListData>(*rData.get()) ); + maData.push_back(o3tl::make_unique<ScUserListData>(*rData)); return *this; } @@ -322,8 +322,8 @@ bool ScUserList::operator==( const ScUserList& r ) const DataType::const_iterator itr1 = maData.begin(), itr2 = r.maData.begin(), itrEnd = maData.end(); for (; itr1 != itrEnd; ++itr1, ++itr2) { - const ScUserListData& v1 = *itr1->get(); - const ScUserListData& v2 = *itr2->get(); + const ScUserListData& v1 = **itr1; + const ScUserListData& v2 = **itr2; if (v1.GetString() != v2.GetString() || v1.GetSubCount() != v2.GetSubCount()) return false; } diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 8695ce24150a..221f274f3038 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -142,7 +142,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument* default: DBG_ERROR_BIFF(); } - eRet = xFilter.get() ? xFilter->Read() : SCERR_IMPORT_INTERNAL; + eRet = xFilter ? xFilter->Read() : SCERR_IMPORT_INTERNAL; } return eRet; diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx index c4b067db2b7e..730c26a77569 100644 --- a/sc/source/filter/excel/tokstack.cxx +++ b/sc/source/filter/excel/tokstack.cxx @@ -192,7 +192,7 @@ bool TokenPool::GetElement( const sal_uInt16 nId, ScTokenArray* pScToken ) sal_uInt16 n = pElement[ nId ]; auto* p = ppP_Str.getIfInRange( n ); if (p) - pScToken->AddString(mrStringPool.intern(*p->get())); + pScToken->AddString(mrStringPool.intern(**p)); else bRet = false; } diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index a56f4d98bc23..43c9b98fe8cc 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -1464,8 +1464,10 @@ XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rF const ScRange & rRange = rFormat.GetRange().front(); ScAddress aAddr = rRange.aStart; // exact position is not important, we allow only absolute refs - mpCfvoLowerLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit.get(), aAddr, true ) ); - mpCfvoUpperLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit.get(), aAddr, false ) ); + mpCfvoLowerLimit.reset( + new XclExpCfvo(GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit, aAddr, true)); + mpCfvoUpperLimit.reset( + new XclExpCfvo(GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit, aAddr, false)); mpCol.reset( new XclExpColScaleCol( GetRoot(), mrFormat.GetDataBarData()->maPositiveColor ) ); } @@ -1712,7 +1714,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : // first formula xScTokArr.reset( pValData->CreateFlatCopiedTokenArray( 0 ) ); - if( xScTokArr.get() ) + if (xScTokArr) { if( pValData->GetDataMode() == SC_VALID_LIST ) { @@ -1785,7 +1787,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : // second formula xScTokArr.reset( pValData->CreateFlatCopiedTokenArray( 1 ) ); - if( xScTokArr.get() ) + if (xScTokArr) { if(GetOutput() == EXC_OUTPUT_BINARY) mxTokArr2 = rFmlaComp.CreateFormula( EXC_FMLATYPE_DATAVAL, *xScTokArr ); diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index e4e040e6635e..f2c61bd158da 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -149,10 +149,10 @@ XclExpExtDataBar::XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarForm XclExpRoot(rRoot) { const ScDataBarFormatData& rFormatData = *rFormat.GetDataBarData(); - mpLowerLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpLowerLimit.get(), rPos, true ) ); - mpUpperLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpUpperLimit.get(), rPos, false ) ); - if(rFormatData.mpNegativeColor.get()) - mpNegativeColor.reset( new XclExpExtNegativeColor( *rFormatData.mpNegativeColor.get() ) ); + mpLowerLimit.reset(new XclExpExtCfvo(*this, *rFormatData.mpLowerLimit, rPos, true)); + mpUpperLimit.reset(new XclExpExtCfvo(*this, *rFormatData.mpUpperLimit, rPos, false)); + if (rFormatData.mpNegativeColor) + mpNegativeColor.reset(new XclExpExtNegativeColor(*rFormatData.mpNegativeColor)); else mpNegativeColor.reset( new XclExpExtNegativeColor( rFormatData.maPositiveColor ) ); mpAxisColor.reset( new XclExpExtAxisColor( rFormatData.maAxisColor ) ); diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 021bd342846d..68675bb77896 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -609,12 +609,13 @@ sal_uInt16 XclExpNameManagerImpl::CreateName( SCTAB nTab, const ScRangeData& rRa { // Don't modify the actual document; use a temporary copy to create the export formulas. std::unique_ptr<ScTokenArray> pTokenCopy( pScTokArr->Clone() ); - lcl_EnsureAbs3DToken( nTab, pTokenCopy.get()->FirstToken() ); + lcl_EnsureAbs3DToken(nTab, pTokenCopy->FirstToken()); - xTokArr = GetFormulaCompiler().CreateFormula( EXC_FMLATYPE_NAME, *pTokenCopy.get() ); + xTokArr = GetFormulaCompiler().CreateFormula(EXC_FMLATYPE_NAME, *pTokenCopy); if ( GetOutput() != EXC_OUTPUT_BINARY ) { - ScCompiler aComp( &GetDocRef(), rRangeData.GetPos(), *pTokenCopy.get(), formula::FormulaGrammar::GRAM_OOXML ); + ScCompiler aComp(&GetDocRef(), rRangeData.GetPos(), *pTokenCopy, + formula::FormulaGrammar::GRAM_OOXML); aComp.CreateStringFromTokenArray( sSymbol ); } } diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index ef72040f3c28..7f09ff16ab0d 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -331,14 +331,14 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) OSL_ENSURE( rStrm.GetRecLeft() == 0, "XclImpHyperlink::ReadEmbeddedData - record size mismatch" ); - if( !xLongName.get() && xShortName.get() ) + if (!xLongName && xShortName.get()) xLongName = std::move(xShortName); - else if( !xLongName.get() && xTextMark.get() ) + else if (!xLongName && xTextMark.get()) xLongName.reset( new OUString ); - if( xLongName.get() ) + if (xLongName) { - if( xTextMark.get() ) + if (xTextMark) { if( xLongName->isEmpty() ) { @@ -939,7 +939,7 @@ void XclImpValidationManager::Apply() DVItemList::iterator itr = maDVItems.begin(), itrEnd = maDVItems.end(); for (; itr != itrEnd; ++itr) { - DVItem& rItem = *itr->get(); + DVItem& rItem = **itr; // set the handle ID sal_uLong nHandle = rDoc.AddValidationEntry( rItem.maValidData ); ScPatternAttr aPattern( rDoc.GetPool() ); diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 5e60ef986917..260a5fd59db4 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -232,7 +232,7 @@ void XclImpStringHelper::SetToDocument( ::std::unique_ptr< EditTextObject > pTextObj( lclCreateTextObject( rRoot, rString, XclFontItemType::Editeng, nXFIndex ) ); - if (pTextObj.get()) + if (pTextObj) { rDoc.setEditCell(rPos, std::move(pTextObj)); } diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 1655dbfd9af9..82c920203b61 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -306,8 +306,8 @@ void DataBarRule::importAttribs( const AttributeList& rAttribs ) void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr ) { - ScColorScaleEntry* pUpperEntry = ConvertToModel( *mpUpperLimit.get(), pDoc, rAddr); - ScColorScaleEntry* pLowerEntry = ConvertToModel( *mpLowerLimit.get(), pDoc, rAddr); + ScColorScaleEntry* pUpperEntry = ConvertToModel(*mpUpperLimit, pDoc, rAddr); + ScColorScaleEntry* pLowerEntry = ConvertToModel(*mpLowerLimit, pDoc, rAddr); mxFormat->mpUpperLimit.reset( pUpperEntry ); mxFormat->mpLowerLimit.reset( pLowerEntry ); @@ -860,8 +860,8 @@ void CondFormatRule::finalizeImport() if( maModel.maFormulas.size() >= 2) { pTokenArray2.reset(new ScTokenArray()); - ScTokenConversion::ConvertToTokenArray( rDoc, *pTokenArray2.get(), maModel.maFormulas[ 1 ] ); - rDoc.CheckLinkFormulaNeedingCheck( *pTokenArray2.get()); + ScTokenConversion::ConvertToTokenArray(rDoc, *pTokenArray2, maModel.maFormulas[1]); + rDoc.CheckLinkFormulaNeedingCheck(*pTokenArray2); } ScTokenArray aTokenArray; diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index ebf2e06e9955..a4c779087c75 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -86,7 +86,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl { if (mpCurrentRule) { - ScFormatEntry& rFormat = *maEntries.rbegin()->get(); + ScFormatEntry& rFormat = **maEntries.rbegin(); assert(rFormat.GetType() == ScFormatEntry::Type::Iconset); ScIconSetFormat& rIconSet = static_cast<ScIconSetFormat&>(rFormat); ScDocument* pDoc = &getScDocument(); diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx index e910f6bda5c1..e0ff875fe1fb 100644 --- a/sc/source/filter/oox/worksheetfragment.cxx +++ b/sc/source/filter/oox/worksheetfragment.cxx @@ -78,7 +78,7 @@ const sal_uInt16 BIFF12_OLEOBJECT_AUTOLOAD = 0x0002; void DataValidationsContextBase::SetValidation( WorksheetHelper& rTarget ) { - if (!mxValModel.get()) + if (!mxValModel) return; rTarget.getAddressConverter().convertToCellRangeList(mxValModel->maRanges, maSqref, rTarget.getSheetIndex(), true); diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx index c6a143a743db..e2f8f8706431 100644 --- a/sc/source/filter/rtf/rtfparse.cxx +++ b/sc/source/filter/rtf/rtfparse.cxx @@ -222,7 +222,7 @@ void ScRTFParser::NewCellRow() // Build up TwipCols only after nLastWidth comparison! for (std::unique_ptr<ScRTFCellDefault> & pCellDefault : maDefaultList) { - const ScRTFCellDefault& rD = *pCellDefault.get(); + const ScRTFCellDefault& rD = *pCellDefault; SCCOL nCol; if ( !SeekTwips(rD.nTwips, &nCol) ) aColTwips.insert( rD.nTwips ); diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index bf3ecc400ab5..028b338bd1d5 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -443,7 +443,7 @@ std::unique_ptr<XclExpTbxControlObj> XclEscherEx::CreateTBXCtrlObj( Reference< X if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN ) xTbxCtrl.reset(); - if( xTbxCtrl.get() ) + if (xTbxCtrl) { // find attached macro Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( xShape ); diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index da250fbafe02..bf68d4a48b59 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -655,7 +655,9 @@ SvXMLImportContextRef ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 n case XML_TOK_TABLE_ROW_CELL_ANNOTATION: { bIsEmpty = false; - OSL_ENSURE( !mxAnnotationData.get(), "ScXMLTableRowCellContext::CreateChildContext - multiple annotations in one cell" ); + OSL_ENSURE( + !mxAnnotationData, + "ScXMLTableRowCellContext::CreateChildContext - multiple annotations in one cell"); mxAnnotationData.reset( new ScXMLAnnotationData ); pContext = new ScXMLAnnotationContext( rXMLImport, nPrefix, rLName, xAttrList, *mxAnnotationData); @@ -854,7 +856,7 @@ void ScXMLTableRowCellContext::SetContentValidation( const ScAddress& rCellPos ) void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) { ScDocument* pDoc = rXMLImport.GetDocument(); - if( !pDoc || !mxAnnotationData.get() ) + if (!pDoc || !mxAnnotationData) return; LockSolarMutex(); @@ -906,7 +908,7 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) nOldShapeCount = xShapesIA->getCount(); // an outliner object is required (empty note captions not allowed) - if( xOutlinerObj.get() ) + if (xOutlinerObj) { // create cell note with all data from drawing object pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, rPos, diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index 0861a23c7853..4fbb58b7d3e3 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -409,7 +409,7 @@ void SAL_CALL ScXMLDatabaseRangeContext::endFastElement( sal_Int32 /*nElement*/ { ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_LOCAL_NONAME)); - if (pData.get()) + if (pData) { ScRange aRange; pData->GetArea(aRange); @@ -423,7 +423,7 @@ void SAL_CALL ScXMLDatabaseRangeContext::endFastElement( sal_Int32 /*nElement*/ { ::std::unique_ptr<ScDBData> pData(ConvertToDBData(STR_DB_GLOBAL_NONAME)); - if (pData.get()) + if (pData) { ScRange aRange; pData->GetArea(aRange); @@ -439,7 +439,7 @@ void SAL_CALL ScXMLDatabaseRangeContext::endFastElement( sal_Int32 /*nElement*/ { ::std::unique_ptr<ScDBData> pData(ConvertToDBData(sDatabaseRangeName)); - if (pData.get()) + if (pData) { setAutoFilterFlags(*pDoc, *pData); (void)pDoc->GetDBCollection()->getNamedDBs().insert(std::move(pData)); diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 3d57c2e92ae1..6d3735ed35cf 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -217,7 +217,7 @@ SvXMLImportContextRef ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix, { const SvXMLTokenMap& rTokenMap(GetScImport().GetTableElemTokenMap()); sal_uInt16 nToken = rTokenMap.Get(nPrefix, rLName); - if (pExternalRefInfo.get()) + if (pExternalRefInfo) { return new SvXMLImportContext(GetImport(), nPrefix, rLName); } @@ -258,7 +258,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL sax_fastparser::FastAttributeList *pAttribList = sax_fastparser::FastAttributeList::castToFastAttributeList( xAttrList ); - if (pExternalRefInfo.get()) + if (pExternalRefInfo) { // We only care about the table-row and table-source elements for // external cache data. @@ -420,7 +420,7 @@ void SAL_CALL ScXMLTableContext::endFastElement(sal_Int32 /*nElement*/) rImport.ProgressBarIncrement(); // store stream positions - if (!pExternalRefInfo.get() && nStartOffset >= 0 /* && nEndOffset >= 0 */) + if (!pExternalRefInfo && nStartOffset >= 0 /* && nEndOffset >= 0 */) { ScSheetSaveData* pSheetData = ScModelObj::getImplementation(rImport.GetModel())->GetSheetSaveData(); SCTAB nTab = rTables.GetCurrentSheet(); diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 7727f9b72581..33ee6abac74a 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -632,8 +632,8 @@ IMPL_LINK(ScAccessibleTextData, NotifyHdl, EENotify&, aNotify, void) { ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &aNotify ); - if( aHint.get() ) - GetBroadcaster().Broadcast( *aHint.get() ); + if (aHint) + GetBroadcaster().Broadcast(*aHint); } ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) @@ -731,8 +731,8 @@ IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify&, rNotify, void) { ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &rNotify ); - if( aHint.get() ) - GetBroadcaster().Broadcast( *aHint.get() ); + if (aHint) + GetBroadcaster().Broadcast(*aHint); } ScAccessibleEditLineTextData::ScAccessibleEditLineTextData(EditView* pEditView, vcl::Window* pWin) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index d116c9acc7c0..f976ea141ea5 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1017,10 +1017,7 @@ EditView* ScTextWnd::GetEditView() return mpEditView.get(); } -bool ScTextWnd::HasEditView() const -{ - return mpEditView.get() != nullptr; -} +bool ScTextWnd::HasEditView() const { return mpEditView != nullptr; } long ScTextWnd::GetPixelHeightForLines(long nLines) { diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index bf0fae46c56a..0916ee4fbda4 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -1156,7 +1156,7 @@ ScFormatEntry* ScDataBarFrmtEntry::createDatabarEntry() const SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), *maLbDataBarMinType.get(), *maEdDataBarMin.get(), mpDoc, maPos, true); SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), mpDoc, maPos, true); ScDataBarFormat* pDataBar = new ScDataBarFormat(mpDoc); - pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData.get())); + pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData)); return pDataBar; } diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 8f9711ef28f4..08998266c7f2 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -804,7 +804,7 @@ void ScTPValidationError::Reset( const SfxItemSet* rArgSet ) else m_xEdError->set_text( EMPTY_OUSTRING ); - SelectActionHdl( *m_xLbAction.get() ); + SelectActionHdl(*m_xLbAction); } bool ScTPValidationError::FillItemSet( SfxItemSet* rArgSet ) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index dbc9ce389f37..6642cffdaf16 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1101,7 +1101,7 @@ void ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, ScMyRememberItemVector::iterator aItr = aRememberItems.begin(); while (aItr != aRememberItems.end()) { - rEngine.SetParaAttribs((*aItr).get()->nIndex, (*aItr).get()->aItemSet); + rEngine.SetParaAttribs((*aItr)->nIndex, (*aItr)->aItemSet); ++aItr; } } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 6085573db08b..f4ecb3879833 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1589,7 +1589,7 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray( // no data within specified range. continue; - if (pUsedRange.get()) + if (pUsedRange) // Make sure the used area only grows, not shrinks. pUsedRange->ExtendTo(ScRange(nDataCol1, nDataRow1, 0, nDataCol2, nDataRow2, 0)); else @@ -1638,7 +1638,7 @@ static std::unique_ptr<ScTokenArray> convertToTokenArray( bFirstTab = false; } - if (!pUsedRange.get()) + if (!pUsedRange) return nullptr; s.SetCol(pUsedRange->aStart.Col()); diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 6de58331021f..56efb1cac9d7 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -569,7 +569,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: if( m_pRefBtn ) m_pRefBtn->SetEndImage(); - if (!m_pAccel.get()) + if (!m_pAccel) { m_pAccel.reset( new Accelerator ); m_pAccel->InsertItem( 1, vcl::KeyCode( KEY_RETURN ) ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index a21c8a5db6a1..bf4ad3870802 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -5552,7 +5552,7 @@ void SAL_CALL ScCellRangeObj::filter( const uno::Reference<sheet::XSheetFilterDe uno::Reference<beans::XPropertySet> xPropSet( xDescriptor, uno::UNO_QUERY ); if (xPropSet.is()) - lcl_CopyProperties( *xImpl.get(), *xPropSet.get() ); + lcl_CopyProperties(*xImpl, *xPropSet.get()); if (pDocSh) { diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index ead395b7f5b8..233b0fe6ba73 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -713,7 +713,7 @@ void Chart2Positioner::createPositionMap() if (meGlue == GLUETYPE_NA && mpPositionMap.get()) mpPositionMap.reset(); - if (mpPositionMap.get()) + if (mpPositionMap) return; glueState(); @@ -2411,7 +2411,7 @@ ScChart2DataSequence::~ScChart2DataSequence() if ( m_pDocument ) { m_pDocument->RemoveUnoObject( *this); - if (m_pHiddenListener.get()) + if (m_pHiddenListener) { ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection(); if (pCLC) @@ -2432,7 +2432,7 @@ void ScChart2DataSequence::RefChanged() if( m_pDocument ) { ScChartListenerCollection* pCLC = nullptr; - if (m_pHiddenListener.get()) + if (m_pHiddenListener) { pCLC = m_pDocument->GetChartListenerCollection(); if (pCLC) @@ -2765,7 +2765,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint // Bring the change back from the range list to the token list. UpdateTokensFromRanges(aRanges); - if (pUndoRanges.get()) + if (pUndoRanges) m_pDocument->AddUnoRefChange(m_nObjectId, *pUndoRanges); } } @@ -3205,7 +3205,7 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti if (!m_pValueListener) m_pValueListener.reset(new ScLinkListener( LINK( this, ScChart2DataSequence, ValueListenerHdl ) )); - if (!m_pHiddenListener.get()) + if (!m_pHiddenListener) m_pHiddenListener.reset(new HiddenRangeListener(*this)); if( m_pDocument ) diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx index 796ed043e3e6..e1e2b8f25487 100644 --- a/sc/source/ui/unoobj/notesuno.cxx +++ b/sc/source/ui/unoobj/notesuno.cxx @@ -229,7 +229,7 @@ SvxUnoText& ScAnnotationObj::GetUnoText() pUnoText = new SvxUnoText( &aEditSource, lcl_GetAnnotationPropertySet(), uno::Reference<text::XText>() ); } - return *pUnoText.get(); + return *pUnoText; } const ScPostIt* ScAnnotationObj::ImplGetNote() const diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 14df2e3676aa..f3e7b40327a0 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5241,7 +5241,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos, else pTextObj = ScEditUtil::CreateURLObjectFromURL(rDoc, sURL, sURL); - if (pTextObj.get()) + if (pTextObj) pEngine->SetText(*pTextObj); } @@ -5662,7 +5662,7 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo // GridWindow stores a shown cell cursor in mpOOCursors, hence // we can use that to determine whether we would want to be showing // one (client-side) for tiled rendering too. - if (!mpOOCursors.get()) + if (!mpOOCursors) { return OString("EMPTY"); } diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx index 4e8ca58965e9..f46080430263 100644 --- a/sc/source/ui/view/spelldialog.cxx +++ b/sc/source/ui/view/spelldialog.cxx @@ -258,7 +258,8 @@ void ScSpellDialogChildWindow::Init() bool ScSpellDialogChildWindow::IsSelectionChanged() { - if( !mxOldRangeList.get() || !mpViewShell || (mpViewShell != dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() )) ) + if (!mxOldRangeList || !mpViewShell + || (mpViewShell != dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()))) return true; if( EditView* pEditView = mpViewData->GetSpellingView() ) diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 7002d8bebc3f..d003f32d6aa8 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -840,10 +840,7 @@ void ScTabView::TestHintWindow() } } -bool ScTabView::HasHintWindow() const -{ - return mxInputHintOO.get() != nullptr; -} +bool ScTabView::HasHintWindow() const { return mxInputHintOO != nullptr; } void ScTabView::RemoveHintWindow() { diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 4f979ee54308..c7ae4c93277e 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -226,7 +226,7 @@ namespace dlgprov Reference< XControlModel > DialogProviderImpl::createDialogModelForBasic() { - if ( !m_BasicInfo.get() ) + if (!m_BasicInfo) // shouldn't get here throw RuntimeException("No information to create dialog" ); Reference< resource::XStringResourceManager > xStringResourceManager = getStringResourceFromDialogLibrary( m_BasicInfo->mxDlgLib ); @@ -493,9 +493,11 @@ namespace dlgprov // also add the dialog control itself to the sequence pObjects[nControlCount].set( rxControl, UNO_QUERY ); - Reference< XScriptEventsAttacher > xScriptEventsAttacher = new DialogEventsAttacherImpl - ( m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess, - bDialogProviderMode, ( m_BasicInfo.get() ? m_BasicInfo->mxBasicRTLListener : nullptr ), msDialogLibName ); + Reference<XScriptEventsAttacher> xScriptEventsAttacher + = new DialogEventsAttacherImpl( + m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess, + bDialogProviderMode, + (m_BasicInfo ? m_BasicInfo->mxBasicRTLListener : nullptr), msDialogLibName); Any aHelper; xScriptEventsAttacher->attachEvents( aObjects, Reference< XScriptListener >(), aHelper ); @@ -611,7 +613,7 @@ namespace dlgprov try { // add support for basic RTL_FUNCTION - if ( m_BasicInfo.get() ) + if (m_BasicInfo) xCtrlMod = createDialogModelForBasic(); else { diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx index c7e35d05dffb..70764332d502 100644 --- a/sd/source/core/sdpage_animations.cxx +++ b/sd/source/core/sdpage_animations.cxx @@ -40,7 +40,7 @@ using ::com::sun::star::drawing::XShape; /** returns a helper class to manipulate effects inside the main sequence */ sd::MainSequencePtr const & SdPage::getMainSequence() { - if( nullptr == mpMainSequence.get() ) + if (nullptr == mpMainSequence) mpMainSequence.reset( new sd::MainSequence( getAnimationNode() ) ); return mpMainSequence; diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index 413699e3a533..52fb2d612b5d 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -441,7 +441,8 @@ Reference< XInterface > SAL_CALL SdStyleFamily::createInstance() { throw IllegalAccessException(); } - return Reference< XInterface >( static_cast< XStyle* >( SdStyleSheet::CreateEmptyUserStyle( *mxPool.get(), mnFamily ) ) ); + return Reference<XInterface>( + static_cast<XStyle*>(SdStyleSheet::CreateEmptyUserStyle(*mxPool, mnFamily))); } Reference< XInterface > SAL_CALL SdStyleFamily::createInstanceWithArguments( const Sequence< Any >& ) diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 8b4a095b3482..24f365b30936 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -802,7 +802,7 @@ void SAL_CALL SdStyleSheet::addModifyListener( const Reference< XModifyListener } else { - if( !mpModifyListenerForewarder.get() ) + if (!mpModifyListenerForewarder) mpModifyListenerForewarder.reset( new ModifyListenerForewarder( this ) ); mrBHelper.addListener( cppu::UnoType<XModifyListener>::get(), xListener ); } diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index bcda24246ef6..01122edd607a 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -159,7 +159,7 @@ sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSi } } } - sal_uInt32 nId = pGraphicProv->GetBlibID(aBuExPictureStream, *xGraphicObject.get()); + sal_uInt32 nId = pGraphicProv->GetBlibID(aBuExPictureStream, *xGraphicObject); if ( nId && ( nId < 0x10000 ) ) nRetValue = static_cast<sal_uInt16>(nId) - 1; @@ -813,7 +813,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj ) ParagraphObj* pPara = rTextObj.GetParagraph(i); for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPara->begin(); it != pPara->end(); ++it ) { - const PortionObj& rPortion = *(*it).get(); + const PortionObj& rPortion = **it; nPropertyFlags = 0; sal_uInt32 nCharAttr = rPortion.mnCharAttr; sal_uInt32 nCharColor = rPortion.mnCharColor; @@ -1104,7 +1104,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u pPara = aTextObj.GetParagraph(i); for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPara->begin(); it != pPara->end(); ++it ) { - const PortionObj& rPortion = *(*it).get(); + const PortionObj& rPortion = **it; if ( rPortion.mpFieldEntry ) { const FieldEntry* pFieldEntry = rPortion.mpFieldEntry.get(); @@ -3352,7 +3352,7 @@ void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm ) ParagraphObj* pPtr = GetParagraph(i); for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPtr->begin(); nCharactersLeft && it != pPtr->end(); ++it ) { - const PortionObj& rPortion = *(*it).get(); + const PortionObj& rPortion = **it; sal_Int32 nPortionSize = rPortion.mnTextSize >= nCharactersLeft ? nCharactersLeft : rPortion.mnTextSize; sal_Int32 const nFlags = 7; nCharactersLeft -= nPortionSize; diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 7968a60d0054..a446914b6c57 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -1318,7 +1318,7 @@ void SdPublishingDlg::UpdatePage() */ void SdPublishingDlg::LoadPreviewButtons() { - if( mpButtonSet.get() ) + if (mpButtonSet) { const int nButtonCount = 8; static const char *pButtonNames[nButtonCount] = diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index 112d8a0befe8..629efdca58df 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -206,7 +206,7 @@ Section::Section( const Section& rSection ) for ( int i = 0; i < 16; i++ ) aFMTID[ i ] = rSection.aFMTID[ i ]; for(const std::unique_ptr<PropEntry>& rEntry : rSection.maEntries) - maEntries.push_back(o3tl::make_unique<PropEntry>(*rEntry.get())); + maEntries.push_back(o3tl::make_unique<PropEntry>(*rEntry)); } Section::Section( const sal_uInt8* pFMTID ) @@ -528,7 +528,7 @@ Section& Section::operator=( const Section& rSection ) memcpy( static_cast<void*>(aFMTID), static_cast<void const *>(rSection.aFMTID), 16 ); for(const std::unique_ptr<PropEntry>& rEntry : rSection.maEntries) - maEntries.push_back(o3tl::make_unique<PropEntry>(*rEntry.get())); + maEntries.push_back(o3tl::make_unique<PropEntry>(*rEntry)); } return *this; } @@ -609,7 +609,7 @@ PropRead& PropRead::operator=( const PropRead& rPropRead ) memcpy( mApplicationCLSID, rPropRead.mApplicationCLSID, 16 ); for(const std::unique_ptr<Section>& rSection : rPropRead.maSections) - maSections.push_back(o3tl::make_unique<Section>(*rSection.get())); + maSections.push_back(o3tl::make_unique<Section>(*rSection)); } return *this; } diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx index ea004a876ccb..0c7736a6680c 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx @@ -187,9 +187,9 @@ namespace accessibility { ::std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify) ); - if( aHint.get() ) - { - Broadcast( *aHint.get() ); + if (aHint) + { + Broadcast(*aHint); } } diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 02cb2ac1292c..fb76dca613b5 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -589,7 +589,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) pOutliner->Insert(sReplyText); std::unique_ptr< OutlinerParaObject > pOPO( pOutliner->CreateParaObject() ); - pTextApi->SetText( *pOPO.get() ); + pTextApi->SetText(*pOPO); OUString sReplyAuthor; if (comphelper::LibreOfficeKit::isActive()) @@ -811,7 +811,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward) { // switch to next/previous slide with annotations std::shared_ptr<DrawViewShell> pDrawViewShell(std::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell())); - if (pDrawViewShell.get() != nullptr) + if (pDrawViewShell != nullptr) { pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EditMode::MasterPage : EditMode::Page, false); pDrawViewShell->SwitchPage((pPage->GetPageNum() - 1) >> 1); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index d6ddd78d23cd..757cda4e8727 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -518,7 +518,7 @@ void AnnotationWindow::setAnnotation( const Reference< XAnnotation >& xAnnotatio if( pTextApi ) { std::unique_ptr< OutlinerParaObject > pOPO( pTextApi->CreateText() ); - Engine()->SetText( *pOPO.get() ); + Engine()->SetText(*pOPO); } Engine()->ClearModifyFlag(); diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 7bc2370302ab..923926e4d320 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -601,7 +601,7 @@ void OutlineToImpressFinalizer::operator() (bool) ::sd::OutlineViewShell* pOutlineShell = dynamic_cast<sd::OutlineViewShell*>(FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get()); - if (pOutlineShell != nullptr && mpStream.get() != nullptr) + if (pOutlineShell != nullptr && mpStream != nullptr) { sd::OutlineView* pView = static_cast<sd::OutlineView*>(pOutlineShell->GetView()); // mba: the stream can't contain any relative URLs, because we don't diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx index e278b6817c0d..debdc348acf1 100644 --- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx +++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx @@ -152,7 +152,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent() SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": All requests are processed"); // The queue is empty so tell the ConfigurationManager to update // its state. - if (mpConfigurationUpdater.get() != nullptr) + if (mpConfigurationUpdater != nullptr) { #if DEBUG_SD_CONFIGURATION_TRACE ConfigurationTracer::TraceConfiguration ( diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx b/sd/source/ui/framework/configuration/ConfigurationController.cxx index a27fd4e54f75..018a814ed525 100644 --- a/sd/source/ui/framework/configuration/ConfigurationController.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx @@ -116,7 +116,7 @@ ConfigurationController::~ConfigurationController() throw() void SAL_CALL ConfigurationController::disposing() { - if (mpImplementation.get() == nullptr) + if (mpImplementation == nullptr) return; SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::disposing"); @@ -148,9 +148,9 @@ void SAL_CALL ConfigurationController::disposing() void ConfigurationController::ProcessEvent() { - if (mpImplementation.get() != nullptr) + if (mpImplementation != nullptr) { - OSL_ASSERT(mpImplementation->mpQueueProcessor.get()!=nullptr); + OSL_ASSERT(mpImplementation->mpQueueProcessor != nullptr); mpImplementation->mpQueueProcessor->ProcessOneEvent(); } @@ -158,9 +158,9 @@ void ConfigurationController::ProcessEvent() void ConfigurationController::RequestSynchronousUpdate() { - if (mpImplementation.get() == nullptr) + if (mpImplementation == nullptr) return; - if (mpImplementation->mpQueueProcessor.get() == nullptr) + if (mpImplementation->mpQueueProcessor == nullptr) return; mpImplementation->mpQueueProcessor->ProcessUntilEmpty(); } @@ -175,7 +175,7 @@ void SAL_CALL ConfigurationController::addConfigurationChangeListener ( ::osl::MutexGuard aGuard (maMutex); ThrowIfDisposed(); - OSL_ASSERT(mpImplementation.get()!=nullptr); + OSL_ASSERT(mpImplementation != nullptr); mpImplementation->mpBroadcaster->AddListener(rxListener, rsEventType, rUserData); } @@ -199,14 +199,14 @@ void SAL_CALL ConfigurationController::notifyEvent ( void SAL_CALL ConfigurationController::lock() { - OSL_ASSERT(mpImplementation.get()!=nullptr); - OSL_ASSERT(mpImplementation->mpConfigurationUpdater.get()!=nullptr); + OSL_ASSERT(mpImplementation != nullptr); + OSL_ASSERT(mpImplementation->mpConfigurationUpdater != nullptr); ::osl::MutexGuard aGuard (maMutex); ThrowIfDisposed(); ++mpImplementation->mnLockCount; - if (mpImplementation->mpConfigurationUpdaterLock.get()==nullptr) + if (mpImplementation->mpConfigurationUpdaterLock == nullptr) mpImplementation->mpConfigurationUpdaterLock = mpImplementation->mpConfigurationUpdater->GetLock(); } @@ -509,9 +509,9 @@ void ConfigurationController::ThrowIfDisposed () const const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } - if (mpImplementation.get() == nullptr) + if (mpImplementation == nullptr) { - OSL_ASSERT(mpImplementation.get() != nullptr); + OSL_ASSERT(mpImplementation != nullptr); throw RuntimeException("ConfigurationController not initialized", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx b/sd/source/ui/framework/configuration/ResourceId.cxx index 3036438b9fae..c6c961a2a6f8 100644 --- a/sd/source/ui/framework/configuration/ResourceId.cxx +++ b/sd/source/ui/framework/configuration/ResourceId.cxx @@ -119,7 +119,7 @@ OUString SAL_CALL util::URL SAL_CALL ResourceId::getFullResourceURL() { - if (mpURL.get() != nullptr) + if (mpURL != nullptr) return *mpURL; Reference<util::XURLTransformer> xURLTransformer (mxURLTransformerWeak); diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx index 1b02e63da18d..432b459087b4 100644 --- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -406,7 +406,7 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane ( // With shell and child window id create the ChildWindowPane // wrapper. - if (pShell.get() != nullptr) + if (pShell != nullptr) { xPane = new ChildWindowPane( rxPaneId, diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 7c2a78872e15..864f305e6009 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -162,12 +162,12 @@ Reference<XResource> SAL_CALL BasicViewFactory::createResource ( std::shared_ptr<ViewDescriptor> pDescriptor (GetViewFromCache(rxViewId, xPane)); // When the requested view is not in the cache then create a new view. - if (pDescriptor.get() == nullptr) + if (pDescriptor == nullptr) { pDescriptor = CreateView(rxViewId, *pFrame, *pWindow, xPane, pFrameView, bIsCenterPane); } - if (pDescriptor.get() != nullptr) + if (pDescriptor != nullptr) xView = pDescriptor->mxView; mpViewShellContainer->push_back(pDescriptor); @@ -287,7 +287,7 @@ std::shared_ptr<BasicViewFactory::ViewDescriptor> BasicViewFactory::CreateView ( pFrameView); pDescriptor->mxViewId = rxViewId; - if (pDescriptor->mpViewShell.get() != nullptr) + if (pDescriptor->mpViewShell != nullptr) { pDescriptor->mpViewShell->Init(bIsCenterPane); mpBase->GetViewShellManager()->ActivateViewShell(pDescriptor->mpViewShell.get()); @@ -485,7 +485,7 @@ std::shared_ptr<BasicViewFactory::ViewDescriptor> BasicViewFactory::GetViewFromC // When the view has been found then relocate it to the given pane and // remove it from the cache. - if (pDescriptor.get() != nullptr) + if (pDescriptor != nullptr) { bool bRelocationSuccessfull (false); Reference<XRelocatableResource> xResource (pDescriptor->mxView, UNO_QUERY); diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx index 4f373fe33209..3ad243701290 100644 --- a/sd/source/ui/framework/factories/ChildWindowPane.cxx +++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx @@ -134,7 +134,7 @@ vcl::Window* ChildWindowPane::GetWindow() // visible to early then some layouting seems to be made twice or at // an inconvenient time and the overall process of initializing the // Impress takes longer. - if ( ! mbHasBeenActivated && mpShell.get()!=nullptr && ! mpShell->IsActive()) + if (!mbHasBeenActivated && mpShell != nullptr && !mpShell->IsActive()) break; mbHasBeenActivated = true; diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx index cd38dc210db8..488cad3b1932 100644 --- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx +++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx @@ -196,7 +196,7 @@ sal_Bool SAL_CALL ViewShellWrapper::relocateToAnchor ( xWindow->removeWindowListener(this); mxWindow = nullptr; - if (mpViewShell.get() != nullptr) + if (mpViewShell != nullptr) { VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xPane->getWindow()); if (pWindow && mpViewShell->RelocateToParentWindow(pWindow)) diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx b/sd/source/ui/framework/module/CenterViewFocusModule.cxx index 705325619a7b..4cbe71f7564e 100644 --- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx +++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx @@ -139,7 +139,7 @@ void CenterViewFocusModule::HandleNewView ( if (pViewShellWrapper != nullptr) { std::shared_ptr<ViewShell> pViewShell = pViewShellWrapper->GetViewShell(); - if (pViewShell.get() != nullptr) + if (pViewShell != nullptr) mpBase->GetViewShellManager()->MoveToTop(*pViewShell); } } diff --git a/sd/source/ui/framework/module/ShellStackGuard.cxx b/sd/source/ui/framework/module/ShellStackGuard.cxx index c02843769dd9..180aa5119f9a 100644 --- a/sd/source/ui/framework/module/ShellStackGuard.cxx +++ b/sd/source/ui/framework/module/ShellStackGuard.cxx @@ -93,7 +93,7 @@ void SAL_CALL ShellStackGuard::notifyConfigurationChange ( { if (rEvent.Type == FrameworkHelper::msConfigurationUpdateStartEvent) { - if (mpUpdateLock.get() == nullptr && IsPrinting()) + if (mpUpdateLock == nullptr && IsPrinting()) { // Prevent configuration updates while the printer is printing. mpUpdateLock.reset(new ConfigurationController::Lock(mxConfigurationController)); @@ -122,7 +122,7 @@ IMPL_LINK(ShellStackGuard, TimeoutHandler, Timer*, pIdle, void) #else (void)pIdle; #endif - if (mpUpdateLock.get() != nullptr) + if (mpUpdateLock != nullptr) { if ( ! IsPrinting()) { diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 9e582fa0078d..fb1c2acf35f0 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -815,7 +815,7 @@ void SAL_CALL FrameworkHelper::DisposeListener::disposing() void SAL_CALL FrameworkHelper::DisposeListener::disposing (const lang::EventObject& rEventObject) { - if (mpHelper.get() != nullptr) + if (mpHelper != nullptr) mpHelper->disposing(rEventObject); } diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index 47c401498f58..c0da5576d66a 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -228,7 +228,7 @@ void FuFormatPaintBrush::Deactivate() bool FuFormatPaintBrush::HasContentForThisType( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier ) const { - if( mxItemSet.get() == nullptr ) + if (mxItemSet == nullptr) return false; if( !mpView || (!SdrObjEditView::SupportsFormatPaintbrush( nObjectInventor, nObjectIdentifier) ) ) return false; diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 8c9c47f5aff3..1fe20d09b107 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -387,8 +387,8 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent) if( mbMasterPage ) { - mpDocSh->GetUndoManager()->AddUndoAction( - o3tl::make_unique<StyleSheetUndoAction>(mpDoc, static_cast<SfxStyleSheet*>(pStyleSheet), &(*pTempSet.get()))); + mpDocSh->GetUndoManager()->AddUndoAction(o3tl::make_unique<StyleSheetUndoAction>( + mpDoc, static_cast<SfxStyleSheet*>(pStyleSheet), &(*pTempSet))); pStyleSheet->GetItemSet().Put( *(pTempSet.get()) ); sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); pStyleSheet->Broadcast(SfxHint(SfxHintId::DataChanged)); diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx index 4d893c704215..220418706256 100644 --- a/sd/source/ui/presenter/PresenterCanvas.cxx +++ b/sd/source/ui/presenter/PresenterCanvas.cxx @@ -410,7 +410,7 @@ sal_Bool SAL_CALL PresenterCanvas::updateScreen (sal_Bool bUpdateAll) ThrowIfDisposed(); mbOffsetUpdatePending = true; - if (m_pUpdateRequester.get() != nullptr) + if (m_pUpdateRequester != nullptr) { m_pUpdateRequester->RequestUpdate(bUpdateAll); return true; diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx index c98584bad753..63238d56904a 100644 --- a/sd/source/ui/presenter/PresenterPreviewCache.cxx +++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx @@ -97,7 +97,7 @@ void SAL_CALL PresenterPreviewCache::setDocumentSlides ( const Reference<XInterface>& rxDocument) { ThrowIfDisposed(); - OSL_ASSERT(mpCacheContext.get()!=nullptr); + OSL_ASSERT(mpCacheContext != nullptr); mpCacheContext->SetDocumentSlides(rxSlides, rxDocument); } @@ -107,7 +107,7 @@ void SAL_CALL PresenterPreviewCache::setVisibleRange ( sal_Int32 nLastVisibleSlideIndex) { ThrowIfDisposed(); - OSL_ASSERT(mpCacheContext.get()!=nullptr); + OSL_ASSERT(mpCacheContext != nullptr); mpCacheContext->SetVisibleSlideRange (nFirstVisibleSlideIndex, nLastVisibleSlideIndex); } @@ -116,7 +116,7 @@ void SAL_CALL PresenterPreviewCache::setPreviewSize ( const css::geometry::IntegerSize2D& rSize) { ThrowIfDisposed(); - OSL_ASSERT(mpCache.get()!=nullptr); + OSL_ASSERT(mpCache != nullptr); maPreviewSize = Size(rSize.Width, rSize.Height); mpCache->ChangeSize(maPreviewSize, Bitmap::HasFastScale()); @@ -127,7 +127,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview ( const Reference<rendering::XCanvas>& rxCanvas) { ThrowIfDisposed(); - OSL_ASSERT(mpCacheContext.get()!=nullptr); + OSL_ASSERT(mpCacheContext != nullptr); cppcanvas::CanvasSharedPtr pCanvas ( cppcanvas::VCLFactory::createCanvas(rxCanvas)); @@ -164,14 +164,14 @@ void SAL_CALL PresenterPreviewCache::removePreviewCreationNotifyListener ( void SAL_CALL PresenterPreviewCache::pause() { ThrowIfDisposed(); - OSL_ASSERT(mpCache.get()!=nullptr); + OSL_ASSERT(mpCache != nullptr); mpCache->Pause(); } void SAL_CALL PresenterPreviewCache::resume() { ThrowIfDisposed(); - OSL_ASSERT(mpCache.get()!=nullptr); + OSL_ASSERT(mpCache != nullptr); mpCache->Resume(); } diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 9c4fec708b5f..8b9a7248e088 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -204,8 +204,7 @@ Any PresenterTextView::SetPropertyValue ( void PresenterTextView::ThrowIfDisposed() { if (PresenterTextViewInterfaceBase::rBHelper.bDisposed - || PresenterTextViewInterfaceBase::rBHelper.bInDispose - || mpImplementation.get()==nullptr) + || PresenterTextViewInterfaceBase::rBHelper.bInDispose || mpImplementation == nullptr) { throw lang::DisposedException ("PresenterTextView object has already been disposed", static_cast<uno::XWeak*>(this)); diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 16cc04b26294..6f7cd12b64a8 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -203,8 +203,8 @@ std::shared_ptr<MasterPageContainer::Implementation> Implementation::mpInstance); } - DBG_ASSERT (pInstance.get()!=nullptr, - "MasterPageContainer::Implementation::Instance(): instance is nullptr"); + DBG_ASSERT(pInstance != nullptr, + "MasterPageContainer::Implementation::Instance(): instance is nullptr"); return pInstance; } @@ -625,8 +625,8 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( if (aEntry == maContainer.end()) { // Insert a new MasterPageDescriptor. - bool bIgnore (rpDescriptor->mpPageObjectProvider.get()==nullptr - && rpDescriptor->msURL.isEmpty()); + bool bIgnore(rpDescriptor->mpPageObjectProvider == nullptr + && rpDescriptor->msURL.isEmpty()); if ( ! bIgnore) { @@ -661,7 +661,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( aResult = (*aEntry)->maToken; std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pEventTypes( (*aEntry)->Update(*rpDescriptor)); - if (pEventTypes.get()!=nullptr && pEventTypes->size()>0) + if (pEventTypes != nullptr && pEventTypes->size() > 0) { // One or more aspects of the descriptor have changed. Send // appropriate events to the listeners. @@ -780,7 +780,7 @@ MasterPageContainer::PreviewState MasterPageContainer::Implementation::GetPrevie { if (pDescriptor->maLargePreview.GetSizePixel().Width() != 0) eState = PS_AVAILABLE; - else if (pDescriptor->mpPreviewProvider.get() != nullptr) + else if (pDescriptor->mpPreviewProvider != nullptr) { // The preview does not exist but can be created. When that is // not expensive then do it at once. diff --git a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx index 27d9cbe66078..d007e524f969 100644 --- a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx @@ -85,7 +85,7 @@ void MasterPageContainerFiller::RunNextStep() { case DONE: case ERROR: - if (mpScannerTask.get() != nullptr) + if (mpScannerTask != nullptr) { mrContainerAdapter.FillingDone(); mpScannerTask.reset(); @@ -113,7 +113,7 @@ MasterPageContainerFiller::State MasterPageContainerFiller::ScanTemplate() { State eState (ERROR); - if (mpScannerTask.get() != nullptr) + if (mpScannerTask != nullptr) { if (mpScannerTask->HasNextStep()) { diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx index 98e42367e1f6..4690ad283d7a 100644 --- a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx @@ -153,11 +153,11 @@ sal_Int32 MasterPageContainerQueue::CalculatePriority ( // The cost is used as a starting value. int nCost (0); - if (rpDescriptor->mpPreviewProvider.get() != nullptr) + if (rpDescriptor->mpPreviewProvider != nullptr) { nCost = rpDescriptor->mpPreviewProvider->GetCostIndex(); if (rpDescriptor->mpPreviewProvider->NeedsPageObject()) - if (rpDescriptor->mpPageObjectProvider.get() != nullptr) + if (rpDescriptor->mpPageObjectProvider != nullptr) nCost += rpDescriptor->mpPageObjectProvider->GetCostIndex(); } @@ -220,7 +220,7 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void if ( ! mpWeakContainer.expired()) { std::shared_ptr<ContainerAdapter> pContainer (mpWeakContainer); - if (pContainer.get() != nullptr) + if (pContainer != nullptr) pContainer->UpdateDescriptor(aRequest.mpDescriptor,false,true,true); } } diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx index 168288094687..2f87f3db6423 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx @@ -102,16 +102,16 @@ const Image& MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize bDataChanged = true; } - if (mpPageObjectProvider.get()==nullptr && rDescriptor.mpPageObjectProvider.get()!=nullptr) + if (mpPageObjectProvider == nullptr && rDescriptor.mpPageObjectProvider != nullptr) { mpPageObjectProvider = rDescriptor.mpPageObjectProvider; bDataChanged = true; } - if (mpPreviewProvider.get()==nullptr && rDescriptor.mpPreviewProvider.get()!=nullptr) - { - mpPreviewProvider = rDescriptor.mpPreviewProvider; - bPreviewChanged = true; + if (mpPreviewProvider == nullptr && rDescriptor.mpPreviewProvider != nullptr) + { + mpPreviewProvider = rDescriptor.mpPreviewProvider; + bPreviewChanged = true; } if (mnTemplateIndex<0 && rDescriptor.mnTemplateIndex>=0) @@ -143,9 +143,8 @@ int MasterPageDescriptor::UpdatePageObject ( int nModified = 0; // Update the page object when that is not yet known. - if (mpMasterPage == nullptr - && mpPageObjectProvider.get()!=nullptr - && (nCostThreshold<0 || mpPageObjectProvider->GetCostIndex()<=nCostThreshold)) + if (mpMasterPage == nullptr && mpPageObjectProvider != nullptr + && (nCostThreshold < 0 || mpPageObjectProvider->GetCostIndex() <= nCostThreshold)) { // Note that pDocument may be NULL. @@ -198,9 +197,8 @@ bool MasterPageDescriptor::UpdatePreview ( bool bModified (false); // Update the preview when that is not yet known. - if (maLargePreview.GetSizePixel().Width()==0 - && mpPreviewProvider.get()!=nullptr - && (nCostThreshold<0 || mpPreviewProvider->GetCostIndex()<=nCostThreshold)) + if (maLargePreview.GetSizePixel().Width() == 0 && mpPreviewProvider != nullptr + && (nCostThreshold < 0 || mpPreviewProvider->GetCostIndex() <= nCostThreshold)) { SdPage* pPage = mpSlide; if (pPage == nullptr) @@ -323,20 +321,17 @@ bool MasterPageDescriptor::AllComparator::operator() (const SharedMasterPageDesc // identical in any of these values then there are thought of as // equivalent. Only the Origin has to be the same in both // descriptors. - return - mpDescriptor->meOrigin == rDescriptor->meOrigin - && ( - (!mpDescriptor->msURL.isEmpty() - && mpDescriptor->msURL == rDescriptor->msURL) - || (!mpDescriptor->msPageName.isEmpty() - && mpDescriptor->msPageName == rDescriptor->msPageName) - || (!mpDescriptor->msStyleName.isEmpty() - && mpDescriptor->msStyleName == rDescriptor->msStyleName) - || (mpDescriptor->mpMasterPage!=nullptr - && mpDescriptor->mpMasterPage==rDescriptor->mpMasterPage) - || (mpDescriptor->mpPageObjectProvider.get()!=nullptr - && rDescriptor->mpPageObjectProvider.get()!=nullptr - && mpDescriptor->mpPageObjectProvider==rDescriptor->mpPageObjectProvider)); + return mpDescriptor->meOrigin == rDescriptor->meOrigin + && ((!mpDescriptor->msURL.isEmpty() && mpDescriptor->msURL == rDescriptor->msURL) + || (!mpDescriptor->msPageName.isEmpty() + && mpDescriptor->msPageName == rDescriptor->msPageName) + || (!mpDescriptor->msStyleName.isEmpty() + && mpDescriptor->msStyleName == rDescriptor->msStyleName) + || (mpDescriptor->mpMasterPage != nullptr + && mpDescriptor->mpMasterPage == rDescriptor->mpMasterPage) + || (mpDescriptor->mpPageObjectProvider != nullptr + && rDescriptor->mpPageObjectProvider != nullptr + && mpDescriptor->mpPageObjectProvider == rDescriptor->mpPageObjectProvider)); } } diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index abe81bd05ae3..edbd197f4342 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -948,7 +948,7 @@ void SlideShow::activate( ViewShellBase& rBase ) if( (mpFullScreenViewShellBase == &rBase) && !mxController.is() ) { ::std::shared_ptr<PresentationViewShell> pShell = std::dynamic_pointer_cast<PresentationViewShell>(rBase.GetMainViewShell()); - if(pShell.get() != nullptr) + if (pShell != nullptr) { pShell->FinishInitialization( mpFullScreenFrameView ); mpFullScreenFrameView = nullptr; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index eef3ea1f6251..32b271647157 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1923,7 +1923,7 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl, void*, void) { mnContextMenuEvent = nullptr; - if( mpSlideController.get() == nullptr ) + if (mpSlideController == nullptr) return; mbWasPaused = mbIsPaused; @@ -2568,7 +2568,8 @@ sal_Int32 SAL_CALL SlideshowImpl::getCurrentSlideIndex() Reference< XDrawPage > SAL_CALL SlideshowImpl::getSlideByIndex(::sal_Int32 Index) { - if( (mpSlideController.get() == nullptr ) || (Index < 0) || (Index >= mpSlideController->getSlideIndexCount() ) ) + if ((mpSlideController == nullptr) || (Index < 0) + || (Index >= mpSlideController->getSlideIndexCount())) throw IndexOutOfBoundsException(); return mpSlideController->getSlideByNumber( mpSlideController->getSlideNumber( Index ) ); diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 07dcbda5be92..c2fc2fb8f498 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -237,19 +237,23 @@ void SAL_CALL SlideShowView::disposing( const lang::EventObject& ) // notify all listeners that _we_ are going down (send a disposing()), // then delete listener containers: lang::EventObject const evt( static_cast<OWeakObject *>(this) ); - if (mpViewListeners.get() != nullptr) { + if (mpViewListeners != nullptr) + { mpViewListeners->disposing( evt ); mpViewListeners.reset(); } - if (mpPaintListeners.get() != nullptr) { + if (mpPaintListeners != nullptr) + { mpPaintListeners->disposing( evt ); mpPaintListeners.reset(); } - if (mpMouseListeners.get() != nullptr) { + if (mpMouseListeners != nullptr) + { mpMouseListeners->disposing( evt ); mpMouseListeners.reset(); } - if (mpMouseMotionListeners.get() != nullptr) { + if (mpMouseMotionListeners != nullptr) + { mpMouseMotionListeners->disposing( evt ); mpMouseMotionListeners.reset(); } @@ -380,7 +384,7 @@ void SAL_CALL SlideShowView::addTransformationChangedListener( const Reference< { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpViewListeners.get() ) + if (mpViewListeners) mpViewListeners->addListener( xListener ); } @@ -388,7 +392,7 @@ void SAL_CALL SlideShowView::removeTransformationChangedListener( const Referenc { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpViewListeners.get() ) + if (mpViewListeners) mpViewListeners->removeListener( xListener ); } @@ -396,7 +400,7 @@ void SAL_CALL SlideShowView::addPaintListener( const Reference< awt::XPaintListe { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpPaintListeners.get() ) + if (mpPaintListeners) mpPaintListeners->addTypedListener( xListener ); } @@ -404,7 +408,7 @@ void SAL_CALL SlideShowView::removePaintListener( const Reference< awt::XPaintLi { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpPaintListeners.get() ) + if (mpPaintListeners) mpPaintListeners->removeTypedListener( xListener ); } @@ -412,7 +416,7 @@ void SAL_CALL SlideShowView::addMouseListener( const Reference< awt::XMouseListe { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpMouseListeners.get() ) + if (mpMouseListeners) mpMouseListeners->addTypedListener( xListener ); } @@ -420,7 +424,7 @@ void SAL_CALL SlideShowView::removeMouseListener( const Reference< awt::XMouseLi { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpMouseListeners.get() ) + if (mpMouseListeners) mpMouseListeners->removeTypedListener( xListener ); } @@ -436,7 +440,7 @@ void SAL_CALL SlideShowView::addMouseMotionListener( const Reference< awt::XMous mxWindow->addMouseMotionListener( this ); } - if( mpMouseMotionListeners.get() ) + if (mpMouseMotionListeners) mpMouseMotionListeners->addTypedListener( xListener ); } @@ -444,7 +448,7 @@ void SAL_CALL SlideShowView::removeMouseMotionListener( const Reference< awt::XM { ::osl::MutexGuard aGuard( m_aMutex ); - if( mpMouseMotionListeners.get() ) + if (mpMouseMotionListeners) mpMouseMotionListeners->removeTypedListener( xListener ); // TODO(P1): Might be nice to deregister for mouse motion @@ -500,7 +504,7 @@ void SAL_CALL SlideShowView::windowResized( const awt::WindowEvent& e ) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); - if( mpViewListeners.get() ) + if (mpViewListeners) { // Change event source, to enable listeners to match event // with view @@ -546,7 +550,7 @@ void SAL_CALL SlideShowView::mousePressed( const awt::MouseEvent& e ) aEvent.maEvent = e; aEvent.maEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - if( mpMouseListeners.get() ) + if (mpMouseListeners) mpMouseListeners->notify( aEvent ); updateimpl( aGuard, mpSlideShow ); // warning: clears guard! } @@ -569,7 +573,7 @@ void SAL_CALL SlideShowView::mouseReleased( const awt::MouseEvent& e ) aEvent.maEvent = e; aEvent.maEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - if( mpMouseListeners.get() ) + if (mpMouseListeners) mpMouseListeners->notify( aEvent ); updateimpl( aGuard, mpSlideShow ); // warning: clears guard! } @@ -586,7 +590,7 @@ void SAL_CALL SlideShowView::mouseEntered( const awt::MouseEvent& e ) aEvent.maEvent = e; aEvent.maEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - if( mpMouseListeners.get() ) + if (mpMouseListeners) mpMouseListeners->notify( aEvent ); updateimpl( aGuard, mpSlideShow ); // warning: clears guard! } @@ -602,7 +606,7 @@ void SAL_CALL SlideShowView::mouseExited( const awt::MouseEvent& e ) aEvent.maEvent = e; aEvent.maEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - if( mpMouseListeners.get() ) + if (mpMouseListeners) mpMouseListeners->notify( aEvent ); updateimpl( aGuard, mpSlideShow ); // warning: clears guard! } @@ -619,7 +623,7 @@ void SAL_CALL SlideShowView::mouseDragged( const awt::MouseEvent& e ) aEvent.maEvent = e; aEvent.maEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - if( mpMouseMotionListeners.get() ) + if (mpMouseMotionListeners) mpMouseMotionListeners->notify( aEvent ); updateimpl( aGuard, mpSlideShow ); // warning: clears guard! } @@ -635,7 +639,7 @@ void SAL_CALL SlideShowView::mouseMoved( const awt::MouseEvent& e ) aEvent.maEvent = e; aEvent.maEvent.Source = static_cast< ::cppu::OWeakObject* >( this ); - if( mpMouseMotionListeners.get() ) + if (mpMouseMotionListeners) mpMouseMotionListeners->notify( aEvent ); updateimpl( aGuard, mpSlideShow ); // warning: clears guard! } diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx index c3c2535ab22e..9cfd0867d6fc 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx @@ -59,7 +59,7 @@ public: const BitmapEx& GetMarkedPreview() const { return maMarkedPreview; } inline void SetMarkedPreview (const BitmapEx& rMarkePreview); - bool HasReplacement() const { return (mpReplacement.get() != nullptr); } + bool HasReplacement() const { return (mpReplacement != nullptr); } inline bool HasLosslessReplacement() const; void Invalidate() { mpReplacement.reset(); mpCompressor.reset(); mbIsUpToDate = false; } bool IsPrecious() const { return mbIsPrecious; } @@ -490,7 +490,7 @@ inline sal_Int32 BitmapCache::CacheEntry::GetMemorySize() const sal_Int32 nSize (0); nSize += maPreview.GetSizeBytes(); nSize += maMarkedPreview.GetSizeBytes(); - if (mpReplacement.get() != nullptr) + if (mpReplacement != nullptr) nSize += mpReplacement->GetMemorySize(); return nSize; } @@ -499,7 +499,7 @@ void BitmapCache::CacheEntry::Compress (const std::shared_ptr<BitmapCompressor>& { if ( ! maPreview.IsEmpty()) { - if (mpReplacement.get() == nullptr) + if (mpReplacement == nullptr) { mpReplacement = rpCompressor->Compress(maPreview); @@ -522,7 +522,7 @@ void BitmapCache::CacheEntry::Compress (const std::shared_ptr<BitmapCompressor>& inline void BitmapCache::CacheEntry::Decompress() { - if (mpReplacement.get()!=nullptr && mpCompressor.get()!=nullptr && maPreview.IsEmpty()) + if (mpReplacement != nullptr && mpCompressor != nullptr && maPreview.IsEmpty()) { maPreview = mpCompressor->Decompress(*mpReplacement); maMarkedPreview.SetEmpty(); @@ -551,9 +551,7 @@ inline void BitmapCache::CacheEntry::SetMarkedPreview (const BitmapEx& rMarkedPr inline bool BitmapCache::CacheEntry::HasLosslessReplacement() const { - return mpReplacement.get()!=nullptr - && mpCompressor.get()!=nullptr - && mpCompressor->IsLossless(); + return mpReplacement != nullptr && mpCompressor != nullptr && mpCompressor->IsLossless(); } } } } // end of namespace ::sd::slidesorter::cache diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx index 13f68447b4f4..9eb380a8af08 100644 --- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx @@ -49,24 +49,24 @@ GenericPageCache::GenericPageCache ( GenericPageCache::~GenericPageCache() { - if (mpQueueProcessor.get() != nullptr) + if (mpQueueProcessor != nullptr) mpQueueProcessor->Stop(); maRequestQueue.Clear(); mpQueueProcessor.reset(); - if (mpBitmapCache.get() != nullptr) + if (mpBitmapCache != nullptr) PageCacheManager::Instance()->ReleaseCache(mpBitmapCache); mpBitmapCache.reset(); } void GenericPageCache::ProvideCacheAndProcessor() { - if (mpBitmapCache.get() == nullptr) + if (mpBitmapCache == nullptr) mpBitmapCache = PageCacheManager::Instance()->GetCache( mpCacheContext->GetModel(), maPreviewSize); - if (mpQueueProcessor.get() == nullptr) + if (mpQueueProcessor == nullptr) mpQueueProcessor.reset(new QueueProcessor( maRequestQueue, mpBitmapCache, @@ -87,11 +87,11 @@ void GenericPageCache::ChangePreviewSize ( "GenericPageCache<>::GetPreviewBitmap(): bitmap requested with large width. " "This may indicate an error."); - if (mpBitmapCache.get() != nullptr) + if (mpBitmapCache != nullptr) { mpBitmapCache = PageCacheManager::Instance()->ChangeSize( mpBitmapCache, maPreviewSize, rPreviewSize); - if (mpQueueProcessor.get() != nullptr) + if (mpQueueProcessor != nullptr) { mpQueueProcessor->SetPreviewSize(rPreviewSize, bDoSuperSampling); mpQueueProcessor->SetBitmapCache(mpBitmapCache); @@ -209,7 +209,7 @@ bool GenericPageCache::InvalidatePreviewBitmap (const CacheKey aKey) return pCacheManager->InvalidatePreviewBitmap( mpCacheContext->GetModel(), aKey); - else if (mpBitmapCache.get() != nullptr) + else if (mpBitmapCache != nullptr) return mpBitmapCache->InvalidateBitmap(mpCacheContext->GetPage(aKey)); else return false; @@ -265,14 +265,14 @@ void GenericPageCache::SetPreciousFlag ( void GenericPageCache::Pause() { ProvideCacheAndProcessor(); - if (mpQueueProcessor.get() != nullptr) + if (mpQueueProcessor != nullptr) mpQueueProcessor->Pause(); } void GenericPageCache::Resume() { ProvideCacheAndProcessor(); - if (mpQueueProcessor.get() != nullptr) + if (mpQueueProcessor != nullptr) mpQueueProcessor->Resume(); } diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx index 6192c75c0576..feca2cee49a1 100644 --- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx +++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx @@ -168,7 +168,7 @@ std::shared_ptr<PageCacheManager> PageCacheManager::Instance() ::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex()); pInstance = mpInstance.lock(); - if (pInstance.get() == nullptr) + if (pInstance == nullptr) { pInstance = std::shared_ptr<PageCacheManager>( new PageCacheManager(), @@ -202,11 +202,11 @@ std::shared_ptr<BitmapCache> PageCacheManager::GetCache ( pResult = iCache->second; // Look for the cache in the list of recently used caches. - if (pResult.get() == nullptr) + if (pResult == nullptr) pResult = GetRecentlyUsedCache(pDocument, rPreviewSize); // Create the cache when no suitable one does exist. - if (pResult.get() == nullptr) + if (pResult == nullptr) pResult.reset(new BitmapCache()); // The cache may be newly created and thus empty or is old and may @@ -215,7 +215,7 @@ std::shared_ptr<BitmapCache> PageCacheManager::GetCache ( Recycle(pResult, pDocument,rPreviewSize); // Put the new (or old) cache into the container. - if (pResult.get() != nullptr) + if (pResult != nullptr) mpPageCaches->emplace(aKey, pResult); return pResult; @@ -280,7 +280,7 @@ std::shared_ptr<BitmapCache> PageCacheManager::ChangeSize ( { std::shared_ptr<BitmapCache> pResult; - if (rpCache.get() != nullptr) + if (rpCache != nullptr) { // Look up the given cache in the list of active caches. PageCacheContainer::iterator iCacheToChange (::std::find_if( diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx index 399a1ef7b584..3c4801926b23 100644 --- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx @@ -146,8 +146,7 @@ void QueueProcessor::ProcessOneRequest ( ::osl::MutexGuard aGuard (maMutex); // Create a new preview bitmap and store it in the cache. - if (mpCache.get() != nullptr - && mpCacheContext.get() != nullptr) + if (mpCache != nullptr && mpCacheContext.get() != nullptr) { const SdPage* pSdPage = dynamic_cast<const SdPage*>(mpCacheContext->GetPage(aKey)); if (pSdPage != nullptr) diff --git a/sd/source/ui/slidesorter/cache/SlsRequestFactory.cxx b/sd/source/ui/slidesorter/cache/SlsRequestFactory.cxx index b18b585196e5..471b8b47147e 100644 --- a/sd/source/ui/slidesorter/cache/SlsRequestFactory.cxx +++ b/sd/source/ui/slidesorter/cache/SlsRequestFactory.cxx @@ -38,7 +38,7 @@ void RequestFactory::operator()( // Add the requests for the visible pages. aKeys = rpCacheContext->GetEntryList(true); - if (aKeys.get() != nullptr) + if (aKeys != nullptr) { std::vector<CacheKey>::const_iterator iKey; std::vector<CacheKey>::const_iterator iEnd (aKeys->end()); @@ -48,7 +48,7 @@ void RequestFactory::operator()( // Add the requests for the non-visible pages. aKeys = rpCacheContext->GetEntryList(false); - if (aKeys.get() != nullptr) + if (aKeys != nullptr) { std::vector<CacheKey>::const_iterator iKey; std::vector<CacheKey>::const_iterator iEnd (aKeys->end()); diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 52e817eba7dc..207d288c29f3 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -213,50 +213,50 @@ model::SharedPageDescriptor SlideSorterController::GetPageAt ( PageSelector& SlideSorterController::GetPageSelector() { - OSL_ASSERT(mpPageSelector.get()!=nullptr); - return *mpPageSelector.get(); + OSL_ASSERT(mpPageSelector != nullptr); + return *mpPageSelector; } FocusManager& SlideSorterController::GetFocusManager() { - OSL_ASSERT(mpFocusManager.get()!=nullptr); - return *mpFocusManager.get(); + OSL_ASSERT(mpFocusManager != nullptr); + return *mpFocusManager; } Clipboard& SlideSorterController::GetClipboard() { - OSL_ASSERT(mpClipboard.get()!=nullptr); - return *mpClipboard.get(); + OSL_ASSERT(mpClipboard != nullptr); + return *mpClipboard; } ScrollBarManager& SlideSorterController::GetScrollBarManager() { - OSL_ASSERT(mpScrollBarManager.get()!=nullptr); - return *mpScrollBarManager.get(); + OSL_ASSERT(mpScrollBarManager != nullptr); + return *mpScrollBarManager; } std::shared_ptr<CurrentSlideManager> const & SlideSorterController::GetCurrentSlideManager() const { - OSL_ASSERT(mpCurrentSlideManager.get()!=nullptr); + OSL_ASSERT(mpCurrentSlideManager != nullptr); return mpCurrentSlideManager; } std::shared_ptr<SlotManager> const & SlideSorterController::GetSlotManager() const { - OSL_ASSERT(mpSlotManager.get()!=nullptr); + OSL_ASSERT(mpSlotManager != nullptr); return mpSlotManager; } std::shared_ptr<SelectionManager> const & SlideSorterController::GetSelectionManager() const { - OSL_ASSERT(mpSelectionManager.get()!=nullptr); + OSL_ASSERT(mpSelectionManager != nullptr); return mpSelectionManager; } std::shared_ptr<InsertionIndicatorHandler> const & SlideSorterController::GetInsertionIndicatorHandler() const { - OSL_ASSERT(mpInsertionIndicatorHandler.get()!=nullptr); + OSL_ASSERT(mpInsertionIndicatorHandler != nullptr); return mpInsertionIndicatorHandler; } diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 1ffe7e69c59e..31f64af88d7f 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -892,7 +892,7 @@ sal_Int8 Clipboard::ExecuteOrAcceptShapeDrop ( if (mrSlideSorter.GetViewShell() != nullptr) pDrawViewShell = std::dynamic_pointer_cast<DrawViewShell>( mrSlideSorter.GetViewShell()->GetViewShellBase().GetMainViewShell()); - if (pDrawViewShell.get() != nullptr + if (pDrawViewShell != nullptr && (pDrawViewShell->GetShellType() == ViewShell::ST_IMPRESS || pDrawViewShell->GetShellType() == ViewShell::ST_DRAW)) { diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 0ff831453faf..e46dd4ed1e95 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -361,7 +361,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) { std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell())); - if (pDrawViewShell.get() != nullptr) + if (pDrawViewShell != nullptr) pDrawViewShell->FuSupport(rRequest); } } @@ -706,7 +706,7 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet) { std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell())); - if (pDrawViewShell.get() != nullptr) + if (pDrawViewShell != nullptr) { TransferableDataHelper aDataHelper ( TransferableDataHelper::CreateFromSystemClipboard( diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index 10a4a8cdd18f..2965b5808eb1 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -322,7 +322,7 @@ void SlideSorterModel::ClearDescriptorList() iDescriptor!=iEnd; ++iDescriptor) { - if (iDescriptor->get() != nullptr) + if (*iDescriptor != nullptr) { if (iDescriptor->use_count() > 1) { diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx index 56daffae9add..5e6520b45d2b 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx @@ -298,8 +298,7 @@ void SlideSorter::ReleaseListeners() void SlideSorter::CreateModelViewController() { mpSlideSorterModel.reset(CreateModel()); - DBG_ASSERT (mpSlideSorterModel.get()!=nullptr, - "Can not create model for slide browser"); + DBG_ASSERT(mpSlideSorterModel != nullptr, "Can not create model for slide browser"); mpSlideSorterView.reset(new view::SlideSorterView (*this)); mpSlideSorterController.reset(new controller::SlideSorterController(*this)); diff --git a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx index 2ad22829365b..d416a3efcf9d 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx @@ -148,7 +148,7 @@ void SAL_CALL SlideSorterService::disposing (const lang::EventObject& rEvent) void SAL_CALL SlideSorterService::setCurrentPage(const Reference<drawing::XDrawPage>& rxSlide) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr) + if (mpSlideSorter != nullptr) mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange( mpSlideSorter->GetModel().GetIndex(rxSlide)); } @@ -156,7 +156,7 @@ void SAL_CALL SlideSorterService::setCurrentPage(const Reference<drawing::XDrawP Reference<drawing::XDrawPage> SAL_CALL SlideSorterService::getCurrentPage() { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr) + if (mpSlideSorter != nullptr) return mpSlideSorter->GetController().GetCurrentSlideManager()->GetCurrentSlide()->GetXDrawPage(); else return nullptr; @@ -173,14 +173,14 @@ void SAL_CALL SlideSorterService::setDocumentSlides ( const Reference<container::XIndexAccess >& rxSlides) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetController().SetDocumentSlides(rxSlides); } sal_Bool SAL_CALL SlideSorterService::getIsHighlightCurrentSlide() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return false; else return mpSlideSorter->GetProperties()->IsHighlightCurrentSlide(); @@ -189,7 +189,7 @@ sal_Bool SAL_CALL SlideSorterService::getIsHighlightCurrentSlide() void SAL_CALL SlideSorterService::setIsHighlightCurrentSlide (sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) { mpSlideSorter->GetProperties()->SetHighlightCurrentSlide(bValue); controller::SlideSorterController::ModelChangeLock aLock (mpSlideSorter->GetController()); @@ -200,7 +200,7 @@ void SAL_CALL SlideSorterService::setIsHighlightCurrentSlide (sal_Bool bValue) sal_Bool SAL_CALL SlideSorterService::getIsShowSelection() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return false; else return mpSlideSorter->GetProperties()->IsShowSelection(); @@ -209,14 +209,14 @@ sal_Bool SAL_CALL SlideSorterService::getIsShowSelection() void SAL_CALL SlideSorterService::setIsShowSelection (sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetShowSelection(bValue); } sal_Bool SAL_CALL SlideSorterService::getIsShowFocus() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return false; else return mpSlideSorter->GetProperties()->IsShowFocus(); @@ -225,14 +225,14 @@ sal_Bool SAL_CALL SlideSorterService::getIsShowFocus() void SAL_CALL SlideSorterService::setIsShowFocus (sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetShowFocus(bValue); } sal_Bool SAL_CALL SlideSorterService::getIsCenterSelection() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return false; else return mpSlideSorter->GetProperties()->IsCenterSelection(); @@ -241,14 +241,14 @@ sal_Bool SAL_CALL SlideSorterService::getIsCenterSelection() void SAL_CALL SlideSorterService::setIsCenterSelection (sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetCenterSelection(bValue); } sal_Bool SAL_CALL SlideSorterService::getIsSuspendPreviewUpdatesDuringFullScreenPresentation() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return true; else return mpSlideSorter->GetProperties() @@ -259,7 +259,7 @@ void SAL_CALL SlideSorterService::setIsSuspendPreviewUpdatesDuringFullScreenPres sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties() ->SetSuspendPreviewUpdatesDuringFullScreenPresentation(bValue); } @@ -267,7 +267,7 @@ void SAL_CALL SlideSorterService::setIsSuspendPreviewUpdatesDuringFullScreenPres sal_Bool SAL_CALL SlideSorterService::getIsOrientationVertical() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return true; else return mpSlideSorter->GetView().GetOrientation() != Layouter::HORIZONTAL; @@ -276,7 +276,7 @@ sal_Bool SAL_CALL SlideSorterService::getIsOrientationVertical() void SAL_CALL SlideSorterService::setIsOrientationVertical (sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetView().SetOrientation(bValue ? Layouter::GRID : Layouter::HORIZONTAL); @@ -285,7 +285,7 @@ void SAL_CALL SlideSorterService::setIsOrientationVertical (sal_Bool bValue) sal_Bool SAL_CALL SlideSorterService::getIsSmoothScrolling() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return false; else return mpSlideSorter->GetProperties()->IsSmoothSelectionScrolling(); @@ -294,14 +294,14 @@ sal_Bool SAL_CALL SlideSorterService::getIsSmoothScrolling() void SAL_CALL SlideSorterService::setIsSmoothScrolling (sal_Bool bValue) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetSmoothSelectionScrolling(bValue); } util::Color SAL_CALL SlideSorterService::getBackgroundColor() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return util::Color(); else return util::Color( @@ -311,14 +311,14 @@ util::Color SAL_CALL SlideSorterService::getBackgroundColor() void SAL_CALL SlideSorterService::setBackgroundColor (util::Color aBackgroundColor) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetBackgroundColor(Color(aBackgroundColor)); } util::Color SAL_CALL SlideSorterService::getTextColor() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return util::Color(); else return util::Color( @@ -328,14 +328,14 @@ util::Color SAL_CALL SlideSorterService::getTextColor() void SAL_CALL SlideSorterService::setTextColor (util::Color aTextColor) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetTextColor(Color(aTextColor)); } util::Color SAL_CALL SlideSorterService::getSelectionColor() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return util::Color(); else return util::Color( @@ -345,14 +345,14 @@ util::Color SAL_CALL SlideSorterService::getSelectionColor() void SAL_CALL SlideSorterService::setSelectionColor (util::Color aSelectionColor) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetSelectionColor(Color(aSelectionColor)); } util::Color SAL_CALL SlideSorterService::getHighlightColor() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return util::Color(); else return util::Color( @@ -362,14 +362,14 @@ util::Color SAL_CALL SlideSorterService::getHighlightColor() void SAL_CALL SlideSorterService::setHighlightColor (util::Color aHighlightColor) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetHighlightColor(Color(aHighlightColor)); } sal_Bool SAL_CALL SlideSorterService::getIsUIReadOnly() { ThrowIfDisposed(); - if (mpSlideSorter.get() == nullptr || ! mpSlideSorter->IsValid()) + if (mpSlideSorter == nullptr || !mpSlideSorter->IsValid()) return true; else return mpSlideSorter->GetProperties()->IsUIReadOnly(); @@ -378,7 +378,7 @@ sal_Bool SAL_CALL SlideSorterService::getIsUIReadOnly() void SAL_CALL SlideSorterService::setIsUIReadOnly (sal_Bool bIsUIReadOnly) { ThrowIfDisposed(); - if (mpSlideSorter.get() != nullptr && mpSlideSorter->IsValid()) + if (mpSlideSorter != nullptr && mpSlideSorter->IsValid()) mpSlideSorter->GetProperties()->SetUIReadOnly(bIsUIReadOnly); } diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 6ffeedea6153..4811c360b4b4 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -99,7 +99,7 @@ std::shared_ptr<SlideSorterViewShell> SlideSorterViewShell::Create ( pViewShell.reset( new SlideSorterViewShell(pFrame,rViewShellBase,pParentWindow,pFrameViewArgument)); pViewShell->Initialize(); - if (pViewShell->mpSlideSorter.get() == nullptr) + if (pViewShell->mpSlideSorter == nullptr) pViewShell.reset(); } catch(Exception&) @@ -247,7 +247,7 @@ css::uno::Reference<css::accessibility::XAccessible> { // When the view is not set then the initialization is not yet complete // and we can not yet provide an accessibility object. - if (mpView == nullptr || mpSlideSorter.get() == nullptr) + if (mpView == nullptr || mpSlideSorter == nullptr) return nullptr; assert(mpSlideSorter.get()!=nullptr); @@ -329,7 +329,7 @@ SdPage* SlideSorterViewShell::GetActualPage() if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != nullptr) + if (pMainViewShell != nullptr) pCurrentPage = pMainViewShell->GetActualPage(); } @@ -528,7 +528,7 @@ void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != nullptr) + if (pMainViewShell != nullptr) mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange( pMainViewShell->getCurrentPage()); } diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 4c0e7af496bd..0e87021d7155 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -220,10 +220,7 @@ sal_Int32 SlideSorterView::GetPageIndexAtPoint (const Point& rWindowPosition) co return nIndex; } -Layouter& SlideSorterView::GetLayouter() -{ - return *mpLayouter.get(); -} +Layouter& SlideSorterView::GetLayouter() { return *mpLayouter; } void SlideSorterView::ModelHasChanged() { @@ -688,7 +685,7 @@ void SlideSorterView::ConfigurationChanged ( std::shared_ptr<cache::PageCache> const & SlideSorterView::GetPreviewCache() { sd::Window *pWindow (mrSlideSorter.GetContentWindow().get()); - if (pWindow && mpPreviewCache.get() == nullptr) + if (pWindow && mpPreviewCache == nullptr) { mpPreviewCache.reset( new cache::PageCache( diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 83812ebbe69a..c12930b10ece 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -208,7 +208,7 @@ bool PreviewRenderer::Initialize ( // Create view ProvideView (pDocShell); - if (mpView.get() == nullptr) + if (mpView == nullptr) return false; // Adjust contrast mode. @@ -390,7 +390,7 @@ void PreviewRenderer::ProvideView (DrawDocShell* pDocShell) if (mpDocShellOfView != nullptr) StartListening (*mpDocShellOfView); } - if (mpView.get() == nullptr) + if (mpView == nullptr) { mpView.reset (new DrawView (pDocShell, mpPreviewDevice.get(), nullptr)); } diff --git a/sd/source/ui/tools/TimerBasedTaskExecution.cxx b/sd/source/ui/tools/TimerBasedTaskExecution.cxx index af1b9ff6f065..379665e32f6a 100644 --- a/sd/source/ui/tools/TimerBasedTaskExecution.cxx +++ b/sd/source/ui/tools/TimerBasedTaskExecution.cxx @@ -48,7 +48,7 @@ std::shared_ptr<TimerBasedTaskExecution> TimerBasedTaskExecution::Create ( // Let the new object have a shared_ptr to itself, so that it can // release itself when the AsynchronousTask has been executed // completely. - if (pExecution->mpTask.get() != nullptr) + if (pExecution->mpTask != nullptr) pExecution->mpSelf = pExecution; return pExecution; } @@ -101,7 +101,7 @@ TimerBasedTaskExecution::~TimerBasedTaskExecution() IMPL_LINK_NOARG(TimerBasedTaskExecution, TimerCallback, Timer *, void) { - if (mpTask.get() != nullptr) + if (mpTask != nullptr) { if (mpTask->HasNextStep()) { diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 915c804ff91e..8f7cd937efa4 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -642,14 +642,14 @@ IPropertyArrayHelper & DrawController::getInfoHelper() { SolarMutexGuard aGuard; - if (mpPropertyArrayHelper.get() == nullptr) + if (mpPropertyArrayHelper == nullptr) { ::std::vector<beans::Property> aProperties; FillPropertyTable(aProperties); mpPropertyArrayHelper.reset(new OPropertyArrayHelper(comphelper::containerToSequence(aProperties), false)); } - return *mpPropertyArrayHelper.get(); + return *mpPropertyArrayHelper; } Reference < beans::XPropertySetInfo > DrawController::getPropertySetInfo() diff --git a/sd/source/ui/unoidl/facreg.cxx b/sd/source/ui/unoidl/facreg.cxx index f506830f48ae..2da5885a34d5 100644 --- a/sd/source/ui/unoidl/facreg.cxx +++ b/sd/source/ui/unoidl/facreg.cxx @@ -47,7 +47,7 @@ namespace { static std::shared_ptr<FactoryMap> spFactoryMap; std::shared_ptr<FactoryMap> const & GetFactoryMap() { - if (spFactoryMap.get() == nullptr) + if (spFactoryMap == nullptr) { spFactoryMap.reset(new FactoryMap); (*spFactoryMap)[SdDrawingDocument_getImplementationName()] = SdDrawingDocumentFactoryId; diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index f0513c0f16f1..5cb954286aba 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -450,7 +450,7 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) { std::shared_ptr<sd::ViewShell> pShell (pBase->GetMainViewShell()); SetViewShell(pShell); - if (pShell.get() == nullptr) + if (pShell == nullptr) bAbort = true; else switch (pShell->GetShellType()) @@ -859,7 +859,7 @@ void SdOutliner::DetectChange() std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell)); // Detect whether the view has been switched from the outside. - if (pDrawViewShell.get() != nullptr + if (pDrawViewShell != nullptr && (aPosition.meEditMode != pDrawViewShell->GetEditMode() || aPosition.mePageKind != pDrawViewShell->GetPageKind())) { @@ -962,7 +962,7 @@ void SdOutliner::RememberStartPosition() { std::shared_ptr<sd::DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell)); - if (pDrawViewShell.get() != nullptr) + if (pDrawViewShell != nullptr) { meStartViewMode = pDrawViewShell->GetPageKind(); meStartEditMode = pDrawViewShell->GetEditMode(); @@ -1018,7 +1018,7 @@ void SdOutliner::RestoreStartPosition() std::shared_ptr<sd::DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell)); SetViewMode (meStartViewMode); - if (pDrawViewShell.get() != nullptr) + if (pDrawViewShell != nullptr) { SetPage (meStartEditMode, mnStartPageIndex); mpObj = mpStartEditedObject; @@ -1332,7 +1332,7 @@ void SdOutliner::SetViewMode (PageKind ePageKind) std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock()); std::shared_ptr<sd::DrawViewShell> pDrawViewShell( std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell)); - if (pDrawViewShell.get()!=nullptr && ePageKind != pDrawViewShell->GetPageKind()) + if (pDrawViewShell != nullptr && ePageKind != pDrawViewShell->GetPageKind()) { // Restore old edit mode. pDrawViewShell->ChangeEditMode(mpImpl->meOriginalEditMode, false); @@ -1385,8 +1385,8 @@ void SdOutliner::SetViewMode (PageKind ePageKind) // Save edit mode so that it can be restored when switching the view // shell again. pDrawViewShell = std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell); - OSL_ASSERT(pDrawViewShell.get()!=nullptr); - if (pDrawViewShell.get() != nullptr) + OSL_ASSERT(pDrawViewShell != nullptr); + if (pDrawViewShell != nullptr) mpImpl->meOriginalEditMode = pDrawViewShell->GetEditMode(); } } @@ -1398,8 +1398,8 @@ void SdOutliner::SetPage (EditMode eEditMode, sal_uInt16 nPageIndex) std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock()); std::shared_ptr<sd::DrawViewShell> pDrawViewShell( std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell)); - OSL_ASSERT(pDrawViewShell.get()!=nullptr); - if (pDrawViewShell.get() != nullptr) + OSL_ASSERT(pDrawViewShell != nullptr); + if (pDrawViewShell != nullptr) { pDrawViewShell->ChangeEditMode(eEditMode, false); pDrawViewShell->SwitchPage(nPageIndex); @@ -1752,7 +1752,7 @@ void SdOutliner::Implementation::ProvideOutlinerView ( const std::shared_ptr<sd::ViewShell>& rpViewShell, vcl::Window* pWindow) { - if (rpViewShell.get() != nullptr) + if (rpViewShell != nullptr) { switch (rpViewShell->GetShellType()) { diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index d82b529ea24c..cb802fd3ef9d 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -368,13 +368,13 @@ ToolBarManager::~ToolBarManager() void ToolBarManager::Shutdown() { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) mpImpl.reset(); } void ToolBarManager::ResetToolBars (ToolBarGroup eGroup) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetToolBars(eGroup); @@ -383,7 +383,7 @@ void ToolBarManager::ResetToolBars (ToolBarGroup eGroup) void ToolBarManager::ResetAllToolBars() { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetAllToolBars(); @@ -394,7 +394,7 @@ void ToolBarManager::AddToolBar ( ToolBarGroup eGroup, const OUString& rsToolBarName) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->AddToolBar(eGroup,rsToolBarName); @@ -405,7 +405,7 @@ void ToolBarManager::AddToolBarShell ( ToolBarGroup eGroup, ShellId nToolBarId) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->AddToolBarShell(eGroup,nToolBarId); @@ -416,7 +416,7 @@ void ToolBarManager::RemoveToolBar ( ToolBarGroup eGroup, const OUString& rsToolBarName) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->RemoveToolBar(eGroup,rsToolBarName); @@ -427,7 +427,7 @@ void ToolBarManager::SetToolBar ( ToolBarGroup eGroup, const OUString& rsToolBarName) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetToolBars(eGroup); @@ -439,7 +439,7 @@ void ToolBarManager::SetToolBarShell ( ToolBarGroup eGroup, ShellId nToolBarId) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetToolBars(eGroup); @@ -449,37 +449,37 @@ void ToolBarManager::SetToolBarShell ( void ToolBarManager::PreUpdate() { - if (mpImpl.get()!=nullptr) + if (mpImpl != nullptr) mpImpl->PreUpdate(); } void ToolBarManager::RequestUpdate() { - if (mpImpl.get()!=nullptr) + if (mpImpl != nullptr) mpImpl->RequestUpdate(); } void ToolBarManager::LockViewShellManager() { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) mpImpl->LockViewShellManager(); } void ToolBarManager::LockUpdate() { - if (mpImpl.get()!=nullptr) + if (mpImpl != nullptr) mpImpl->LockUpdate(); } void ToolBarManager::UnlockUpdate() { - if (mpImpl.get()!=nullptr) + if (mpImpl != nullptr) mpImpl->UnlockUpdate(); } void ToolBarManager::MainViewShellChanged () { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { mpImpl->ReleaseAllToolBarShells(); mpImpl->GetToolBarRules().MainViewShellChanged(ViewShell::ST_NONE); @@ -488,7 +488,7 @@ void ToolBarManager::MainViewShellChanged () void ToolBarManager::MainViewShellChanged (const ViewShell& rMainViewShell) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) { mpImpl->ReleaseAllToolBarShells(); mpImpl->GetToolBarRules().MainViewShellChanged(rMainViewShell); @@ -499,13 +499,13 @@ void ToolBarManager::SelectionHasChanged ( const ViewShell& rViewShell, const SdrView& rView) { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) mpImpl->GetToolBarRules().SelectionHasChanged(rViewShell,rView); } void ToolBarManager::ToolBarsDestroyed() { - if (mpImpl.get() != nullptr) + if (mpImpl != nullptr) mpImpl->ToolBarsDestroyed(); } @@ -727,7 +727,7 @@ void ToolBarManager::Implementation::PostUpdate() void ToolBarManager::Implementation::LockViewShellManager() { - if (mpViewShellManagerLock.get() == nullptr) + if (mpViewShellManagerLock == nullptr) mpViewShellManagerLock.reset( new ViewShellManager::UpdateLock(mrBase.GetViewShellManager())); } @@ -740,7 +740,7 @@ void ToolBarManager::Implementation::LockUpdate() DBG_ASSERT(mnLockCount<100, "ToolBarManager lock count unusually high"); if (mnLockCount == 0) { - OSL_ASSERT(mpSynchronousLayouterLock.get()==nullptr); + OSL_ASSERT(mpSynchronousLayouterLock == nullptr); mpSynchronousLayouterLock.reset(new LayouterLock(mxLayouter)); } @@ -792,7 +792,7 @@ void ToolBarManager::Implementation::Update ( // functionality. Those that are not used anymore are // deactivated now. Those that are missing are activated in the // next step together with the view shells. - if (mpViewShellManagerLock.get() == nullptr) + if (mpViewShellManagerLock == nullptr) mpViewShellManagerLock.reset( new ViewShellManager::UpdateLock(mrBase.GetViewShellManager())); maToolBarShellList.UpdateShells( @@ -1384,7 +1384,7 @@ void ToolBarShellList::UpdateShells ( const std::shared_ptr<ViewShell>& rpMainViewShell, const std::shared_ptr<ViewShellManager>& rpManager) { - if (rpMainViewShell.get() != nullptr) + if (rpMainViewShell != nullptr) { GroupedShellList aList; diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index a01519d09661..a5c135d6e645 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -382,7 +382,7 @@ std::shared_ptr<ViewShell> ViewShellBase::GetMainViewShell() const std::shared_ptr<ViewShell> pMainViewShell ( framework::FrameworkHelper::Instance(*const_cast<ViewShellBase*>(this)) ->GetViewShell(framework::FrameworkHelper::msCenterPaneURL)); - if (pMainViewShell.get() == nullptr) + if (pMainViewShell == nullptr) pMainViewShell = framework::FrameworkHelper::Instance(*const_cast<ViewShellBase*>(this)) ->GetViewShell(framework::FrameworkHelper::msFullScreenPaneURL); return pMainViewShell; @@ -532,7 +532,7 @@ Reference<view::XRenderable> ViewShellBase::GetRenderable() SfxPrinter* ViewShellBase::GetPrinter (bool bCreate) { - OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); return GetDocShell()->GetPrinter (bCreate); } @@ -541,7 +541,7 @@ sal_uInt16 ViewShellBase::SetPrinter ( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags) { - OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); GetDocShell()->SetPrinter(pNewPrinter); @@ -920,8 +920,8 @@ OUString ViewShellBase::GetInitialViewShellType() std::shared_ptr<tools::EventMultiplexer> const & ViewShellBase::GetEventMultiplexer() { - OSL_ASSERT(mpImpl.get()!=nullptr); - OSL_ASSERT(mpImpl->mpEventMultiplexer.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); + OSL_ASSERT(mpImpl->mpEventMultiplexer != nullptr); return mpImpl->mpEventMultiplexer; } @@ -933,37 +933,37 @@ const ::tools::Rectangle& ViewShellBase::getClientRectangle() const std::shared_ptr<ToolBarManager> const & ViewShellBase::GetToolBarManager() const { - OSL_ASSERT(mpImpl.get()!=nullptr); - OSL_ASSERT(mpImpl->mpToolBarManager.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); + OSL_ASSERT(mpImpl->mpToolBarManager != nullptr); return mpImpl->mpToolBarManager; } std::shared_ptr<FormShellManager> const & ViewShellBase::GetFormShellManager() const { - OSL_ASSERT(mpImpl.get()!=nullptr); - OSL_ASSERT(mpImpl->mpFormShellManager.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); + OSL_ASSERT(mpImpl->mpFormShellManager != nullptr); return mpImpl->mpFormShellManager; } DrawController& ViewShellBase::GetDrawController() const { - OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); return *mpImpl->mpController; } void ViewShellBase::SetViewTabBar (const ::rtl::Reference<ViewTabBar>& rViewTabBar) { - OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); mpImpl->mpViewTabBar = rViewTabBar; } vcl::Window* ViewShellBase::GetViewWindow() { - OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl != nullptr); return mpImpl->mpViewWindow.get(); } @@ -1438,7 +1438,7 @@ void FocusForwardingWindow::dispose() void FocusForwardingWindow::KeyInput (const KeyEvent& rKEvt) { std::shared_ptr<ViewShell> pViewShell = mrBase.GetMainViewShell(); - if (pViewShell.get() != nullptr) + if (pViewShell != nullptr) { vcl::Window* pWindow = pViewShell->GetActiveWindow(); if (pWindow != nullptr) @@ -1455,7 +1455,7 @@ void FocusForwardingWindow::KeyInput (const KeyEvent& rKEvt) void FocusForwardingWindow::Command (const CommandEvent& rEvent) { std::shared_ptr<ViewShell> pViewShell = mrBase.GetMainViewShell(); - if (pViewShell.get() != nullptr) + if (pViewShell != nullptr) { vcl::Window* pWindow = pViewShell->GetActiveWindow(); if (pWindow != nullptr) diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 110e752b389b..a0957f886984 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -74,7 +74,7 @@ ViewShell::Implementation::~Implementation() COVERITY_NOEXCEPT_FALSE if ( ! mpUpdateLockForMouse.expired()) { std::shared_ptr<ToolBarManagerLock> pLock(mpUpdateLockForMouse); - if (pLock.get() != nullptr) + if (pLock != nullptr) { // Force the ToolBarManagerLock to be released even when the // IsUICaptured() returns <TRUE/>. diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 129f7904a949..f66533ea1a84 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -682,7 +682,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } else if( SfxItemState::DEFAULT == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) ) { - if (mpCurrentClipboardFormats.get() != nullptr) + if (mpCurrentClipboardFormats != nullptr) rSet.Put(*mpCurrentClipboardFormats); } } diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 6fc9e12def03..d19758c1b1d7 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -747,13 +747,13 @@ void DrawViewShell::Notify (SfxBroadcaster&, const SfxHint& rHint) void DrawViewShell::ExecuteAnnotation (SfxRequest const & rRequest) { - if( mpAnnotationManager.get() ) + if (mpAnnotationManager) mpAnnotationManager->ExecuteAnnotation( rRequest ); } void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet ) { - if( mpAnnotationManager.get() ) + if (mpAnnotationManager) mpAnnotationManager->GetAnnotationState( rItemSet ); } diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 5df2438bd791..796f29347eed 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -136,7 +136,8 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie */ OutlineView::~OutlineView() { - DBG_ASSERT(maDragAndDropModelGuard.get() == nullptr, "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!" ); + DBG_ASSERT(maDragAndDropModelGuard == nullptr, + "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!"); Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink ); @@ -332,7 +333,7 @@ IMPL_LINK( OutlineView, ParagraphInsertedHdl, Outliner::ParagraphHdlParam, aPara { // we get calls to this handler during binary insert of drag and drop contents but // we ignore it here and handle it later in OnEndPasteOrDrop() - if( maDragAndDropModelGuard.get() == nullptr ) + if (maDragAndDropModelGuard == nullptr) { OutlineViewPageChangesGuard aGuard(this); @@ -751,7 +752,8 @@ IMPL_LINK_NOARG(OutlineView, StatusEventHdl, EditStatus&, void) IMPL_LINK_NOARG(OutlineView, BeginDropHdl, EditView*, void) { - DBG_ASSERT(maDragAndDropModelGuard.get() == nullptr, "sd::OutlineView::BeginDropHdl(), prior drag operation not finished correctly!" ); + DBG_ASSERT(maDragAndDropModelGuard == nullptr, + "sd::OutlineView::BeginDropHdl(), prior drag operation not finished correctly!"); maDragAndDropModelGuard.reset( new OutlineViewModelChangeGuard( *this ) ); } diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 6d1ce78e86ec..bed0ee921646 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -911,7 +911,7 @@ void ViewShell::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert // usually be the called view shell, but to be on the safe side we call // the main view shell explicitly. SfxInterfaceId nViewID (IMPRESS_FACTORY_ID); - if (GetViewShellBase().GetMainViewShell().get() != nullptr) + if (GetViewShellBase().GetMainViewShell() != nullptr) nViewID = GetViewShellBase().GetMainViewShell()->mpImpl->GetViewId(); rSequence[nIndex].Name = sUNO_View_ViewId; rSequence[nIndex].Value <<= "view" + OUString::number( static_cast<sal_uInt16>(nViewID)); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 47917c01647f..0398ff0488f5 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -608,7 +608,7 @@ void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) { std::shared_ptr<ViewShell::Implementation::ToolBarManagerLock> pLock( mpImpl->mpUpdateLockForMouse); - if (pLock.get() != nullptr) + if (pLock != nullptr) pLock->Release(); } } @@ -665,7 +665,7 @@ void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) { std::shared_ptr<ViewShell::Implementation::ToolBarManagerLock> pLock( mpImpl->mpUpdateLockForMouse); - if (pLock.get() != nullptr) + if (pLock != nullptr) pLock->Release(); } } diff --git a/sdext/source/presenter/PresenterBitmapContainer.cxx b/sdext/source/presenter/PresenterBitmapContainer.cxx index ea39f17e2588..d9d9b90c1f3a 100644 --- a/sdext/source/presenter/PresenterBitmapContainer.cxx +++ b/sdext/source/presenter/PresenterBitmapContainer.cxx @@ -106,7 +106,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::GetBitmap ( BitmapContainer::const_iterator iSet (maIconContainer.find(rsName)); if (iSet != maIconContainer.end()) return iSet->second; - else if (mpParentContainer.get() != nullptr) + else if (mpParentContainer != nullptr) return mpParentContainer->GetBitmap(rsName); else return SharedBitmapDescriptor(); @@ -317,7 +317,7 @@ PresenterBitmapContainer::BitmapDescriptor::BitmapDescriptor ( mxDisabledBitmap(), mxMaskBitmap() { - if (rpDefault.get() != nullptr) + if (rpDefault != nullptr) { mnWidth = rpDefault->mnWidth; mnHeight = rpDefault->mnHeight; diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index 7b7232b04e1a..e24ee663f44e 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -57,11 +57,11 @@ const static double gnVerticalBorder (5); PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= sAction; PresenterTheme::SharedFontDescriptor pFont; - if (rpTheme.get() != nullptr) + if (rpTheme != nullptr) pFont = rpTheme->GetFont("ButtonFont"); PresenterTheme::SharedFontDescriptor pMouseOverFont; - if (rpTheme.get() != nullptr) + if (rpTheme != nullptr) pMouseOverFont = rpTheme->GetFont("ButtonMouseOverFont"); rtl::Reference<PresenterButton> pButton ( diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 6b348dd40b76..dd00b3955e64 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -364,7 +364,7 @@ void PresenterController::UpdatePaneTitles() PresenterPaneContainer::PaneList::const_iterator iPane; for (iPane=mpPaneContainer->maPanes.begin(); iPane!=mpPaneContainer->maPanes.end(); ++iPane) { - OSL_ASSERT((*iPane).get() != nullptr); + OSL_ASSERT(*iPane != nullptr); OUString sTemplate (IsAccessibilityActive() ? (*iPane)->msAccessibleTitleTemplate @@ -427,7 +427,7 @@ void PresenterController::UpdateViews() SharedBitmapDescriptor PresenterController::GetViewBackground (const OUString& rsViewURL) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); return mpTheme->GetBitmap(sStyleName, "Background"); @@ -438,7 +438,7 @@ SharedBitmapDescriptor PresenterTheme::SharedFontDescriptor PresenterController::GetViewFont (const OUString& rsViewURL) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); return mpTheme->GetFont(sStyleName); @@ -1150,7 +1150,7 @@ void PresenterController::UpdatePendingSlideNumber (const sal_Int32 nPendingSlid { mnPendingSlideNumber = nPendingSlideNumber; - if (mpTheme.get() == nullptr) + if (mpTheme == nullptr) return; if ( ! mxMainWindow.is()) diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index 3413d4349dfa..20c1525d7565 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -630,7 +630,7 @@ void PresenterNotesView::ChangeFontSize (const sal_Int32 nSizeChange) std::shared_ptr<PresenterConfigurationAccess> pConfiguration ( mpPresenterController->GetTheme()->GetNodeForViewStyle( sStyleName)); - if (pConfiguration.get()==nullptr || ! pConfiguration->IsValid()) + if (pConfiguration == nullptr || !pConfiguration->IsValid()) return; pConfiguration->GoToChild(OUString("Font")); diff --git a/sdext/source/presenter/PresenterPaneBase.cxx b/sdext/source/presenter/PresenterPaneBase.cxx index f6174652b103..d8d25218dd9e 100644 --- a/sdext/source/presenter/PresenterPaneBase.cxx +++ b/sdext/source/presenter/PresenterPaneBase.cxx @@ -108,7 +108,7 @@ void PresenterPaneBase::SetTitle (const OUString& rsTitle) msTitle = rsTitle; OSL_ASSERT(mpPresenterController.get()!=nullptr); - OSL_ASSERT(mpPresenterController->GetPaintManager().get()!=nullptr); + OSL_ASSERT(mpPresenterController->GetPaintManager() != nullptr); mpPresenterController->GetPaintManager()->Invalidate(mxBorderWindow); } diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx index 5fbad6e5a6e2..551546995b90 100644 --- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx +++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx @@ -209,7 +209,7 @@ void SAL_CALL PresenterPaneBorderPainter::paintBorder ( } ProvideTheme(rxCanvas); - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetupClipping( @@ -244,7 +244,7 @@ void SAL_CALL PresenterPaneBorderPainter::paintBorderWithCallout ( } ProvideTheme(rxCanvas); - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetupClipping( @@ -265,12 +265,11 @@ awt::Point SAL_CALL PresenterPaneBorderPainter::getCalloutOffset ( { ThrowIfDisposed(); ProvideTheme(); - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle( mpRenderer->GetRendererPaneStyle(rsPaneBorderStyleName)); - if (pRendererPaneStyle.get() != nullptr - && pRendererPaneStyle->mpBottomCallout.get() != nullptr) + if (pRendererPaneStyle != nullptr && pRendererPaneStyle->mpBottomCallout.get() != nullptr) { return awt::Point ( 0, @@ -290,7 +289,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva if ( ! mxContext.is()) return false; - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { // Check if the theme already has a canvas. if ( ! mpTheme->HasCanvas()) @@ -305,9 +304,9 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva bModified = true; } - if (mpTheme.get() != nullptr && bModified) + if (mpTheme != nullptr && bModified) { - if (mpRenderer.get() == nullptr) + if (mpRenderer == nullptr) mpRenderer.reset(new Renderer(mxContext, mpTheme)); else mpRenderer->SetCanvas(rxCanvas); @@ -318,7 +317,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva void PresenterPaneBorderPainter::ProvideTheme() { - if (mpTheme.get() == nullptr) + if (mpTheme == nullptr) { // Create a theme without bitmaps (no canvas => no bitmaps). ProvideTheme(nullptr); @@ -330,7 +329,7 @@ void PresenterPaneBorderPainter::ProvideTheme() void PresenterPaneBorderPainter::SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme) { mpTheme = rpTheme; - if (mpRenderer.get() == nullptr) + if (mpRenderer == nullptr) mpRenderer.reset(new Renderer(mxContext, mpTheme)); } @@ -339,10 +338,10 @@ awt::Rectangle PresenterPaneBorderPainter::AddBorder ( const awt::Rectangle& rInnerBox, const css::drawing::framework::BorderType eBorderType) const { - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL)); - if (pRendererPaneStyle.get() != nullptr) + if (pRendererPaneStyle != nullptr) return pRendererPaneStyle->AddBorder(rInnerBox, eBorderType); } return rInnerBox; @@ -353,10 +352,10 @@ awt::Rectangle PresenterPaneBorderPainter::RemoveBorder ( const css::awt::Rectangle& rOuterBox, const css::drawing::framework::BorderType eBorderType) const { - if (mpRenderer.get() != nullptr) + if (mpRenderer != nullptr) { const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL)); - if (pRendererPaneStyle.get() != nullptr) + if (pRendererPaneStyle != nullptr) return pRendererPaneStyle->RemoveBorder(rOuterBox, eBorderType); } return rOuterBox; @@ -416,7 +415,7 @@ void PresenterPaneBorderPainter::Renderer::PaintBorder ( // Create the outer and inner border of the, ahm, border. std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneURL)); - if (pStyle.get() == nullptr) + if (pStyle == nullptr) return; awt::Rectangle aOuterBox (rBBox); @@ -560,7 +559,7 @@ void PresenterPaneBorderPainter::Renderer::PaintTitle ( std::shared_ptr<RendererPaneStyle> PresenterPaneBorderPainter::Renderer::GetRendererPaneStyle (const OUString& rsResourceURL) { - OSL_ASSERT(mpTheme.get()!=nullptr); + OSL_ASSERT(mpTheme != nullptr); RendererPaneStyleContainer::const_iterator iStyle (maRendererPaneStyles.find(rsResourceURL)); if (iStyle == maRendererPaneStyles.end()) @@ -708,7 +707,7 @@ void PresenterPaneBorderPainter::Renderer::SetupClipping ( return; std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneStyleName)); - if (pStyle.get() == nullptr) + if (pStyle == nullptr) { mxViewStateClip = PresenterGeometryHelper::CreatePolygon( rUpdateBox, @@ -765,7 +764,7 @@ RendererPaneStyle::RendererPaneStyle ( maOuterBorderSize(), maTotalBorderSize() { - if (rpTheme.get() != nullptr) + if (rpTheme != nullptr) { mpTopLeft = GetBitmap(rpTheme, rsStyleName, "TopLeft"); mpTop = GetBitmap(rpTheme, rsStyleName, "Top"); diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx index 94f6335cdd79..8160b9431745 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -119,7 +119,7 @@ void SAL_CALL PresenterPaneFactory::disposing() mxConfigurationControllerWeak = WeakReference<XConfigurationController>(); // Dispose the panes in the cache. - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { ResourceContainer::const_iterator iPane (mpResourceCache->begin()); ResourceContainer::const_iterator iEnd (mpResourceCache->end()); @@ -147,7 +147,7 @@ Reference<XResource> SAL_CALL PresenterPaneFactory::createResource ( if (sPaneURL.isEmpty()) return nullptr; - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { // Has the requested resource already been created? ResourceContainer::const_iterator iResource (mpResourceCache->find(sPaneURL)); @@ -194,7 +194,7 @@ void SAL_CALL PresenterPaneFactory::releaseResource (const Reference<XResource>& if (pDescriptor->mxBorderWindow.is()) pDescriptor->mxBorderWindow->setVisible(false); - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { // Store the pane in the cache. (*mpResourceCache)[sPaneURL] = rxResource; diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index 953a7821adf2..f25e7255cd3f 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -341,7 +341,7 @@ Reference<frame::XDispatch> PresenterProtocolHandler::Dispatch::Create ( const ::rtl::Reference<PresenterController>& rpPresenterController) { ::rtl::Reference<Dispatch> pDispatch (new Dispatch (rsURLPath, rpPresenterController)); - if (pDispatch->mpCommand.get() != nullptr) + if (pDispatch->mpCommand != nullptr) return Reference<frame::XDispatch>(pDispatch.get()); else return nullptr; @@ -357,7 +357,7 @@ PresenterProtocolHandler::Dispatch::Dispatch ( maStatusListenerContainer(), mbIsListeningToWindowManager(false) { - if (mpCommand.get() != nullptr) + if (mpCommand != nullptr) { mpPresenterController->GetWindowManager()->AddLayoutListener(this); mbIsListeningToWindowManager = true; @@ -438,7 +438,7 @@ void SAL_CALL PresenterProtocolHandler::Dispatch::dispatch( throw RuntimeException(); } - if (mpCommand.get() != nullptr) + if (mpCommand != nullptr) mpCommand->Execute(); } diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx index da089fb335ce..52f49706f8fe 100644 --- a/sdext/source/presenter/PresenterScrollBar.cxx +++ b/sdext/source/presenter/PresenterScrollBar.cxx @@ -240,7 +240,7 @@ void PresenterScrollBar::SetCanvas (const Reference<css::rendering::XCanvas>& rx mxCanvas = rxCanvas; if (mxCanvas.is()) { - if (mpBitmaps.get()==nullptr) + if (mpBitmaps == nullptr) { if (mpSharedBitmaps.expired()) { @@ -434,7 +434,7 @@ void PresenterScrollBar::Repaint ( const geometry::RealRectangle2D& rBox, const bool bAsynchronousUpdate) { - if (mpPaintManager.get() != nullptr) + if (mpPaintManager != nullptr) mpPaintManager->Invalidate( mxWindow, PresenterGeometryHelper::ConvertRectangle(rBox), @@ -687,7 +687,7 @@ void PresenterVerticalScrollBar::UpdateBorders() void PresenterVerticalScrollBar::UpdateBitmaps() { - if (mpBitmaps.get() != nullptr) + if (mpBitmaps != nullptr) { mpPrevButtonDescriptor = mpBitmaps->GetBitmap("Up"); mpNextButtonDescriptor = mpBitmaps->GetBitmap("Down"); diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index c4368fa3eb9b..55606ad9b9e9 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -734,7 +734,7 @@ void PresenterSlideShowView::PaintEndSlide (const awt::Rectangle& rRepaintBox) if (mpPresenterController.get() == nullptr) break; std::shared_ptr<PresenterTheme> pTheme (mpPresenterController->GetTheme()); - if (pTheme.get() == nullptr) + if (pTheme == nullptr) break; const OUString sViewStyle (pTheme->GetStyleName(mxViewId->getResourceURL())); diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index 210b74087407..ad07a02b4b27 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -309,7 +309,7 @@ PresenterSlideSorter::PresenterSlideSorter ( mxCanvas, "SlideSorterCloser"); - if (mpPresenterController->GetTheme().get() != nullptr) + if (mpPresenterController->GetTheme() != nullptr) { PresenterTheme::SharedFontDescriptor pFont ( mpPresenterController->GetTheme()->GetFont("ButtonFont")); @@ -530,7 +530,7 @@ void SAL_CALL PresenterSlideSorter::mouseEntered (const css::awt::MouseEvent&) { void SAL_CALL PresenterSlideSorter::mouseExited (const css::awt::MouseEvent&) { mnSlideIndexMousePressed = -1; - if (mpMouseOverManager.get() != nullptr) + if (mpMouseOverManager != nullptr) mpMouseOverManager->SetSlide(mnSlideIndexMousePressed, awt::Rectangle(0,0,0,0)); } @@ -538,7 +538,7 @@ void SAL_CALL PresenterSlideSorter::mouseExited (const css::awt::MouseEvent&) void SAL_CALL PresenterSlideSorter::mouseMoved (const css::awt::MouseEvent& rEvent) { - if (mpMouseOverManager.get() != nullptr) + if (mpMouseOverManager != nullptr) { css::awt::MouseEvent rTemp =rEvent; /// check whether RTL interface or not @@ -591,7 +591,7 @@ void SAL_CALL PresenterSlideSorter::propertyChange ( void SAL_CALL PresenterSlideSorter::notifyPreviewCreation ( sal_Int32 nSlideIndex) { - OSL_ASSERT(mpLayout.get()!=nullptr); + OSL_ASSERT(mpLayout != nullptr); awt::Rectangle aBBox (mpLayout->GetBoundingBox(nSlideIndex)); mpPresenterController->GetPaintManager()->Invalidate(mxWindow, aBBox, true); @@ -886,7 +886,7 @@ void PresenterSlideSorter::PaintPreview ( // Emphasize the current slide. if (nSlideIndex == mnCurrentSlideIndex) { - if (mpCurrentSlideFrameRenderer.get() != nullptr) + if (mpCurrentSlideFrameRenderer != nullptr) { const awt::Rectangle aSlideBoundingBox( sal::static_int_cast<sal_Int32>(0.5 + aTopLeft.X), @@ -1443,10 +1443,10 @@ PresenterSlideSorter::MouseOverManager::MouseOverManager ( mxInvalidateTarget(rxInvalidateTarget), mpPaintManager(rpPaintManager) { - if (rpTheme.get()!=nullptr) + if (rpTheme != nullptr) { std::shared_ptr<PresenterBitmapContainer> pBitmaps (rpTheme->GetBitmapContainer()); - if (pBitmaps.get() != nullptr) + if (pBitmaps != nullptr) { mpLeftLabelBitmap = pBitmaps->GetBitmap("LabelLeft"); mpCenterLabelBitmap = pBitmaps->GetBitmap("LabelCenter"); @@ -1709,7 +1709,7 @@ void PresenterSlideSorter::MouseOverManager::PaintButtonBackground ( void PresenterSlideSorter::MouseOverManager::Invalidate() { - if (mpPaintManager.get() != nullptr) + if (mpPaintManager != nullptr) mpPaintManager->Invalidate(mxInvalidateTarget, maSlideBoundingBox, true); } diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx index 4650a7213c70..6e5270b91432 100644 --- a/sdext/source/presenter/PresenterTheme.cxx +++ b/sdext/source/presenter/PresenterTheme.cxx @@ -290,7 +290,7 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const { OUString sStyleName; std::shared_ptr<Theme> pTheme (mpTheme); - while (sStyleName.isEmpty() && pTheme.get()!=nullptr) + while (sStyleName.isEmpty() && pTheme != nullptr) { sStyleName = pTheme->maStyleAssociations.GetStyleName(rsResourceURL); pTheme = pTheme->mpParentTheme; @@ -302,7 +302,7 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const const OUString& rsStyleName, const bool bOuter) const { - OSL_ASSERT(mpTheme.get() != nullptr); + OSL_ASSERT(mpTheme != nullptr); SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); if (pPaneStyle.get() != nullptr) @@ -346,7 +346,7 @@ bool PresenterTheme::ConvertToColor ( std::shared_ptr<PresenterConfigurationAccess> PresenterTheme::GetNodeForViewStyle ( const OUString& rsStyleName) const { - if (mpTheme.get() == nullptr) + if (mpTheme == nullptr) return std::shared_ptr<PresenterConfigurationAccess>(); // Open configuration for writing. @@ -375,16 +375,16 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( const OUString& rsStyleName, const OUString& rsBitmapName) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { if (rsStyleName.isEmpty()) { if (rsBitmapName == "Background") { std::shared_ptr<Theme> pTheme (mpTheme); - while (pTheme.get()!=nullptr && pTheme->mpBackground.get()==nullptr) + while (pTheme != nullptr && pTheme->mpBackground.get() == nullptr) pTheme = pTheme->mpParentTheme; - if (pTheme.get() != nullptr) + if (pTheme != nullptr) return pTheme->mpBackground; else return SharedBitmapDescriptor(); @@ -416,21 +416,21 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( SharedBitmapDescriptor PresenterTheme::GetBitmap ( const OUString& rsBitmapName) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { if (rsBitmapName == "Background") { std::shared_ptr<Theme> pTheme (mpTheme); - while (pTheme.get()!=nullptr && pTheme->mpBackground.get()==nullptr) + while (pTheme != nullptr && pTheme->mpBackground.get() == nullptr) pTheme = pTheme->mpParentTheme; - if (pTheme.get() != nullptr) + if (pTheme != nullptr) return pTheme->mpBackground; else return SharedBitmapDescriptor(); } else { - if (mpTheme->mpIconContainer.get() != nullptr) + if (mpTheme->mpIconContainer != nullptr) return mpTheme->mpIconContainer->GetBitmap(rsBitmapName); } } @@ -440,7 +440,7 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap ( std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) return mpTheme->mpIconContainer; else return std::shared_ptr<PresenterBitmapContainer>(); @@ -449,7 +449,7 @@ std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() c PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont ( const OUString& rsStyleName) const { - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); if (pPaneStyle.get() != nullptr) @@ -460,7 +460,7 @@ PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont ( return pViewStyle->GetFont(); std::shared_ptr<Theme> pTheme (mpTheme); - while (pTheme.get() != nullptr) + while (pTheme != nullptr) { Theme::FontContainer::const_iterator iFont (pTheme->maFontContainer.find(rsStyleName)); if (iFont != pTheme->maFontContainer.end()) @@ -485,7 +485,7 @@ PresenterTheme::FontDescriptor::FontDescriptor ( mnXOffset(0), mnYOffset(0) { - if (rpDescriptor.get() != nullptr) + if (rpDescriptor != nullptr) { msFamilyName = rpDescriptor->msFamilyName; msStyleName = rpDescriptor->msStyleName; @@ -610,16 +610,12 @@ void PresenterTheme::Theme::Read ( maViewStyles.Read(rReadContext, mxThemeRoot); // Read bitmaps. - mpIconContainer.reset( - new PresenterBitmapContainer( - Reference<container::XNameAccess>( - PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), - UNO_QUERY), - mpParentTheme.get()!=nullptr - ? mpParentTheme->mpIconContainer - : std::shared_ptr<PresenterBitmapContainer>(), - rReadContext.mxComponentContext, - rReadContext.mxCanvas)); + mpIconContainer.reset(new PresenterBitmapContainer( + Reference<container::XNameAccess>( + PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), UNO_QUERY), + mpParentTheme != nullptr ? mpParentTheme->mpIconContainer + : std::shared_ptr<PresenterBitmapContainer>(), + rReadContext.mxComponentContext, rReadContext.mxCanvas)); // Read fonts. Reference<container::XNameAccess> xFontNode( @@ -638,7 +634,7 @@ SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName SharedPaneStyle pPaneStyle (maPaneStyles.GetPaneStyle(rsStyleName)); if (pPaneStyle.get() != nullptr) return pPaneStyle; - else if (mpParentTheme.get() != nullptr) + else if (mpParentTheme != nullptr) return mpParentTheme->GetPaneStyle(rsStyleName); else return SharedPaneStyle(); @@ -649,7 +645,7 @@ SharedViewStyle PresenterTheme::Theme::GetViewStyle (const OUString& rsStyleName SharedViewStyle pViewStyle (maViewStyles.GetViewStyle(rsStyleName)); if (pViewStyle.get() != nullptr) return pViewStyle; - else if (mpParentTheme.get() != nullptr) + else if (mpParentTheme != nullptr) return mpParentTheme->GetViewStyle(rsStyleName); else return SharedViewStyle(); @@ -786,7 +782,7 @@ std::shared_ptr<PresenterTheme::Theme> ReadContext::ReadTheme ( } } - if (pTheme.get() != nullptr) + if (pTheme != nullptr) { pTheme->Read(rConfiguration, *this); } @@ -873,7 +869,7 @@ void PaneStyleContainer::ProcessPaneStyle( Reference<container::XNameAccess> xOuterBorderSizeNode (rValues[4], UNO_QUERY); pStyle->maOuterBorderSize = ReadContext::ReadBorderSize(xOuterBorderSizeNode); - if (pStyle->mpParentStyle.get() != nullptr) + if (pStyle->mpParentStyle != nullptr) { pStyle->maInnerBorderSize.Merge(pStyle->mpParentStyle->maInnerBorderSize); pStyle->maOuterBorderSize.Merge(pStyle->mpParentStyle->maOuterBorderSize); @@ -884,11 +880,9 @@ void PaneStyleContainer::ProcessPaneStyle( Reference<container::XNameAccess> xBitmapsNode (rValues[5], UNO_QUERY); pStyle->mpBitmaps.reset(new PresenterBitmapContainer( xBitmapsNode, - pStyle->mpParentStyle.get()!=nullptr - ? pStyle->mpParentStyle->mpBitmaps - : std::shared_ptr<PresenterBitmapContainer>(), - rReadContext.mxComponentContext, - rReadContext.mxCanvas, + pStyle->mpParentStyle != nullptr ? pStyle->mpParentStyle->mpBitmaps + : std::shared_ptr<PresenterBitmapContainer>(), + rReadContext.mxComponentContext, rReadContext.mxCanvas, rReadContext.mxPresenterHelper)); } @@ -918,14 +912,14 @@ PaneStyle::PaneStyle() const SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const { - if (mpBitmaps.get() != nullptr) + if (mpBitmaps != nullptr) { const SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName); if (pBitmap.get() != nullptr) return pBitmap; } - if (mpParentStyle.get() != nullptr) + if (mpParentStyle != nullptr) return mpParentStyle->GetBitmap(rsBitmapName); else return SharedBitmapDescriptor(); @@ -935,7 +929,7 @@ PresenterTheme::SharedFontDescriptor PaneStyle::GetFont() const { if (mpFont.get() != nullptr) return mpFont; - else if (mpParentStyle.get() != nullptr) + else if (mpParentStyle != nullptr) return mpParentStyle->GetFont(); else return PresenterTheme::SharedFontDescriptor(); @@ -1042,7 +1036,7 @@ PresenterTheme::SharedFontDescriptor ViewStyle::GetFont() const { if (mpFont.get() != nullptr) return mpFont; - else if (mpParentStyle.get() != nullptr) + else if (mpParentStyle != nullptr) return mpParentStyle->GetFont(); else return PresenterTheme::SharedFontDescriptor(); diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 99a0eba3219e..916b6bf168e6 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -187,7 +187,7 @@ std::shared_ptr<TimerScheduler> TimerScheduler::Instance( uno::Reference<uno::XComponentContext> const& xContext) { ::osl::MutexGuard aGuard (maInstanceMutex); - if (mpInstance.get() == nullptr) + if (mpInstance == nullptr) { if (!xContext.is()) return nullptr; diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index 553ce220ca0d..33fb79220f70 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -420,7 +420,7 @@ void SAL_CALL PresenterToolBar::disposing() ElementContainer::const_iterator iEnd (maElementContainer.end()); for ( ; iPart!=iEnd; ++iPart) { - OSL_ASSERT(iPart->get()!=nullptr); + OSL_ASSERT(*iPart != nullptr); ElementContainerPart::iterator iElement ((*iPart)->begin()); ElementContainerPart::const_iterator iPartEnd ((*iPart)->end()); for ( ; iElement!=iPartEnd; ++iElement) @@ -1369,7 +1369,7 @@ void ElementMode::ReadElementMode ( UNO_QUERY); Reference<beans::XPropertySet> xProperties ( PresenterConfigurationAccess::GetNodeProperties(xNode, OUString())); - if ( ! xProperties.is() && rpDefaultMode.get()!=nullptr) + if (!xProperties.is() && rpDefaultMode != nullptr) { // The mode is not specified. Use the given, possibly empty, // default mode instead. @@ -1380,30 +1380,25 @@ void ElementMode::ReadElementMode ( // Read action. if ( ! (PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= msAction)) - if (rpDefaultMode.get()!=nullptr) + if (rpDefaultMode != nullptr) msAction = rpDefaultMode->msAction; // Read text and font - OUString sText (rpDefaultMode.get()!=nullptr ? rpDefaultMode->maText.GetText() : OUString()); + OUString sText(rpDefaultMode != nullptr ? rpDefaultMode->maText.GetText() : OUString()); PresenterConfigurationAccess::GetProperty(xProperties, "Text") >>= sText; Reference<container::XHierarchicalNameAccess> xFontNode ( PresenterConfigurationAccess::GetProperty(xProperties, "Font"), UNO_QUERY); - PresenterTheme::SharedFontDescriptor pFont (PresenterTheme::ReadFont( - xFontNode, - rpDefaultMode.get()!=nullptr - ? rpDefaultMode->maText.GetFont() - : PresenterTheme::SharedFontDescriptor())); + PresenterTheme::SharedFontDescriptor pFont(PresenterTheme::ReadFont( + xFontNode, rpDefaultMode != nullptr ? rpDefaultMode->maText.GetFont() + : PresenterTheme::SharedFontDescriptor())); maText = Text(sText,pFont); // Read bitmaps to display as icons. Reference<container::XHierarchicalNameAccess> xIconNode ( PresenterConfigurationAccess::GetProperty(xProperties, "Icon"), UNO_QUERY); mpIcon = PresenterBitmapContainer::LoadBitmap( - xIconNode, - "", - rContext.mxPresenterHelper, - rContext.mxCanvas, - rpDefaultMode.get()!=nullptr ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); + xIconNode, "", rContext.mxPresenterHelper, rContext.mxCanvas, + rpDefaultMode != nullptr ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); } catch(Exception&) { diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx index 983a17996e6c..f8f8c5ed8e0c 100644 --- a/sdext/source/presenter/PresenterViewFactory.cxx +++ b/sdext/source/presenter/PresenterViewFactory.cxx @@ -178,7 +178,7 @@ void SAL_CALL PresenterViewFactory::disposing() mxConfigurationController->removeResourceFactoryForReference(this); mxConfigurationController = nullptr; - if (mpResourceCache.get() != nullptr) + if (mpResourceCache != nullptr) { // Dispose all views in the cache. ResourceContainer::const_iterator iView (mpResourceCache->begin()); @@ -243,7 +243,7 @@ void SAL_CALL PresenterViewFactory::releaseResource (const Reference<XResource>& // Dispose only views that we can not put into the cache. CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get()); - if (pView == nullptr || mpResourceCache.get()==nullptr) + if (pView == nullptr || mpResourceCache == nullptr) { try { @@ -281,7 +281,7 @@ Reference<XResource> PresenterViewFactory::GetViewFromCache( const Reference<XResourceId>& rxViewId, const Reference<XPane>& rxAnchorPane) const { - if (mpResourceCache.get() == nullptr) + if (mpResourceCache == nullptr) return nullptr; try diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx index 2830c444df97..1337da2abbe5 100644 --- a/sdext/source/presenter/PresenterWindowManager.cxx +++ b/sdext/source/presenter/PresenterWindowManager.cxx @@ -156,7 +156,7 @@ void PresenterWindowManager::SetTheme (const std::shared_ptr<PresenterTheme>& rp // Get background bitmap or background color from the theme. - if (mpTheme.get() != nullptr) + if (mpTheme != nullptr) { mpBackgroundBitmap = mpTheme->GetBitmap(OUString(), "Background"); } @@ -255,7 +255,7 @@ void SAL_CALL PresenterWindowManager::windowPaint (const awt::PaintEvent& rEvent if ( ! mxParentCanvas.is()) return; - if (mpTheme.get()!=nullptr) + if (mpTheme != nullptr) { try { diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index a5abc61b5022..0dad602c85b1 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -269,7 +269,7 @@ namespace // previously for (std::unique_ptr<SfxFilterMatcher_Impl>& aImpl : aImplArr) if (aImpl->aName == aName) - return *aImpl.get(); + return *aImpl; // first Matcher created for this factory aImplArr.push_back(o3tl::make_unique<SfxFilterMatcher_Impl>(aName)); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index d85b1b38ff6f..26dcd99f3bc9 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2335,8 +2335,8 @@ FileDialogHelper::FileDialogHelper( aWildcard += aExtName; - OUString const aUIString = ::sfx2::addExtension( aFilterUIName, - aWildcard, (OPEN == lcl_OpenOrSave(mpImpl->m_nDialogType)), *mpImpl.get()); + OUString const aUIString = ::sfx2::addExtension( + aFilterUIName, aWildcard, (OPEN == lcl_OpenOrSave(mpImpl->m_nDialogType)), *mpImpl); AddFilter( aUIString, aWildcard ); } @@ -2401,11 +2401,7 @@ void FileDialogHelper::StartExecuteModal( const Link<FileDialogHelper*,void>& rE mpImpl->implStartExecute(); } - -short FileDialogHelper::GetDialogType() const -{ - return mpImpl.get() ? mpImpl->m_nDialogType : 0; -} +short FileDialogHelper::GetDialogType() const { return mpImpl ? mpImpl->m_nDialogType : 0; } bool FileDialogHelper::IsPasswordEnabled() const { @@ -2415,7 +2411,7 @@ bool FileDialogHelper::IsPasswordEnabled() const OUString FileDialogHelper::GetRealFilter() const { OUString sFilter; - if ( mpImpl.get() ) + if (mpImpl) mpImpl->getRealFilter( sFilter ); return sFilter; } diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index 45a2ccc0bb00..d04d2166a686 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -418,16 +418,16 @@ SfxSecurityPage::SfxSecurityPage(TabPageParent pParent, const SfxItemSet& rItemS bool SfxSecurityPage::FillItemSet( SfxItemSet * /*rItemSet*/ ) { bool bModified = false; - DBG_ASSERT( m_pImpl.get(), "implementation pointer is 0. Still in c-tor?" ); - if (m_pImpl.get() != nullptr) + DBG_ASSERT(m_pImpl, "implementation pointer is 0. Still in c-tor?"); + if (m_pImpl != nullptr) bModified = m_pImpl->FillItemSet_Impl(); return bModified; } void SfxSecurityPage::Reset( const SfxItemSet * /*rItemSet*/ ) { - DBG_ASSERT( m_pImpl.get(), "implementation pointer is 0. Still in c-tor?" ); - if (m_pImpl.get() != nullptr) + DBG_ASSERT(m_pImpl, "implementation pointer is 0. Still in c-tor?"); + if (m_pImpl != nullptr) m_pImpl->Reset_Impl(); } diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index e15df3ed4c9c..80fef06c55b8 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -196,7 +196,7 @@ bool GraphicHelper::getThumbnailFormatFromGDI_Impl(GDIMetaFile const * pMetaFile GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); - if (rFilter.compressAsPNG(aResultBitmap, *pStream.get()) != ERRCODE_NONE) + if (rFilter.compressAsPNG(aResultBitmap, *pStream) != ERRCODE_NONE) return false; pStream->Flush(); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 554fb0100cf3..cb0c0be5e166 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3651,7 +3651,7 @@ bool SfxObjectShell::QueryAllowExoticFormat_Impl( const uno::Reference< task::XI rtl::Reference<ExoticFileLoadException> xException(new ExoticFileLoadException( rURL, rFilterUIName )); uno::Reference< task::XInteractionRequest > xReq( xException.get() ); xHandler->handle( xReq ); - return xException.get()->isApprove(); + return xException->isApprove(); } // No interaction handler, default is to continue to load return true; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index a03e3b7ddd95..8c0e1643a0fc 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -575,7 +575,7 @@ bool SfxObjectShell::PrepareClose // Ask if to save short nRet = RET_YES; { - const Reference< XTitle > xTitle( *pImpl->pBaseModel.get(), UNO_QUERY_THROW ); + const Reference<XTitle> xTitle(*pImpl->pBaseModel, UNO_QUERY_THROW); const OUString sTitle = xTitle->getTitle (); nRet = ExecuteQuerySaveDocument(pFrame->GetWindow().GetFrameWeld(), sTitle); } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index f38ee6396902..f8522be05d08 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1438,7 +1438,7 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC, bool SfxViewShell::ExecKey_Impl(const KeyEvent& aKey) { - if (!pImpl->m_xAccExec.get()) + if (!pImpl->m_xAccExec) { pImpl->m_xAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper(); pImpl->m_xAccExec->init(::comphelper::getProcessComponentContext(), diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 5b6ae3f0c74e..2a4566ca647a 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -674,7 +674,7 @@ NumberAnimationSharedPtr createPushWipeTransition( const SoundPlayerSharedPtr& pSoundPlayer ) { boost::optional<SlideSharedPtr> leavingSlide; // no bitmap - if (leavingSlide_ && (*leavingSlide_).get() != nullptr) + if (leavingSlide_ && *leavingSlide_ != nullptr) { // opt: only page, if we've an // actual slide to move out here. We diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index b97dc5a5a6aa..cafaf43fa9a3 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -862,8 +862,8 @@ SmTextForwarder::~SmTextForwarder() IMPL_LINK(SmTextForwarder, NotifyHdl, EENotify&, rNotify, void) { ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( &rNotify ); - if (aHint.get()) - rEditSource.GetBroadcaster().Broadcast( *aHint.get() ); + if (aHint) + rEditSource.GetBroadcaster().Broadcast(*aHint); } sal_Int32 SmTextForwarder::GetParagraphCount() const diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 1b5a9bfe9c33..a32525745cf1 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -464,10 +464,7 @@ SmCursor& SmDocShell::GetCursor(){ return *mpCursor; } -bool SmDocShell::HasCursor() -{ - return mpCursor.get() != nullptr; -} +bool SmDocShell::HasCursor() { return mpCursor != nullptr; } SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell ) { diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index e2e2bc565598..9ddca3b1e076 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -494,10 +494,10 @@ void AccessController::checkAndClearPostPoned() // check postponed permissions std::unique_ptr< t_rec_vec > rec( static_cast< t_rec_vec * >( m_rec.getData() ) ); m_rec.setData( nullptr ); // takeover ownership - OSL_ASSERT( rec.get() ); - if (rec.get()) + OSL_ASSERT(rec); + if (rec) { - t_rec_vec const & vec = *rec.get(); + t_rec_vec const& vec = *rec; switch (m_mode) { case SINGLE_USER: diff --git a/store/source/stortree.cxx b/store/source/stortree.cxx index e4b577393373..526191153bdb 100644 --- a/store/source/stortree.cxx +++ b/store/source/stortree.cxx @@ -303,7 +303,7 @@ storeError OStoreBTreeNodeObject::remove ( */ void OStoreBTreeRootObject::testInvariant (char const * message) const { - OSL_PRECOND(m_xPage.get() != nullptr, "OStoreBTreeRootObject::testInvariant(): Null pointer"); + OSL_PRECOND(m_xPage != nullptr, "OStoreBTreeRootObject::testInvariant(): Null pointer"); SAL_WARN_IF( (m_xPage->location() - m_xPage->size()) != 0, "store", message); } diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index acfa74f8e910..3d403dfa0326 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -650,9 +650,9 @@ SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleF { xStyle = Create( rName, eFam, mask ); StoreStyleSheet(xStyle); - Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *xStyle.get() ) ); + Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *xStyle)); } - return *xStyle.get(); + return *xStyle; } /** @@ -668,7 +668,7 @@ void SfxStyleSheetBasePool::Add( const SfxStyleSheetBase& rSheet ) } rtl::Reference< SfxStyleSheetBase > xNew( Create( rSheet ) ); pImpl->mxIndexedStyleSheets->AddStyleSheet(xNew); - Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetChanged, *xNew.get() ) ); + Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetChanged, *xNew)); } SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator=( const SfxStyleSheetBasePool& r ) @@ -802,7 +802,7 @@ struct StyleSheetDisposerFunctor final : public svl::StyleSheetDisposer catch( css::uno::Exception& ) { } - mPool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetErased, *styleSheet.get() ) ); + mPool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetErased, *styleSheet)); } SfxStyleSheetBasePool* mPool; diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index 9ea2b42f9ff0..47f260865101 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -380,8 +380,7 @@ std::shared_ptr<SfxItemSet> StylePoolImpl::insertItemSet( const SfxItemSet& rSet { if( !rSet.GetPool()->IsItemPoolable(pItem->Which() ) ) bNonPoolable = true; - if ( !xFoundIgnorableItems.get() || - (xFoundIgnorableItems->Put( *pItem ) == nullptr ) ) + if (!xFoundIgnorableItems || (xFoundIgnorableItems->Put(*pItem) == nullptr)) { pCurNode = pCurNode->findChildNode( *pItem, false ); } diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 518775457a99..d769a2321714 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1562,7 +1562,8 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( if ( ::osl::Condition::result_timeout == eResult ) { // maximum time to wait - OSL_ENSURE( !m_xCancelAsyncTimer.get(), "SvtFileView_Impl::GetFolderContent_Impl: there's still a previous timer!" ); + OSL_ENSURE(!m_xCancelAsyncTimer, + "SvtFileView_Impl::GetFolderContent_Impl: there's still a previous timer!"); m_xCancelAsyncTimer.set(new CallbackTimer(this)); sal_Int32 nMaxTimeout = pAsyncDescriptor->nMaxTimeout; OSL_ENSURE( nMaxTimeout > nMinTimeout, diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index d343532e40a0..1cb397edd890 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -803,7 +803,7 @@ void Ruler::ImplDrawIndents(vcl::RenderContext& rRenderContext, long nMin, long } } bool bIsHit = false; - if(mxCurrentHitTest.get() != nullptr && mxCurrentHitTest->eType == RulerType::Indent) + if (mxCurrentHitTest != nullptr && mxCurrentHitTest->eType == RulerType::Indent) { bIsHit = mxCurrentHitTest->nAryPos == j; } @@ -1996,7 +1996,7 @@ void Ruler::MouseMove( const MouseEvent& rMEvt ) if (ImplHitTest( rMEvt.GetPosPixel(), mxCurrentHitTest.get() )) { - maHoverSelection = *mxCurrentHitTest.get(); + maHoverSelection = *mxCurrentHitTest; if (mxCurrentHitTest->bSize) { @@ -2028,7 +2028,7 @@ void Ruler::MouseMove( const MouseEvent& rMEvt ) } } - if (mxPreviousHitTest.get() != nullptr && mxPreviousHitTest->eType != mxCurrentHitTest->eType) + if (mxPreviousHitTest != nullptr && mxPreviousHitTest->eType != mxCurrentHitTest->eType) { mbFormat = true; } diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 963fc1bb8249..275ac4dcc550 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -400,7 +400,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) nNoneHeight = 0; nNoneSpace = 0; - if (mpNoneItem.get()) + if (mpNoneItem) mpNoneItem.reset(nullptr); } @@ -502,7 +502,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) if (nStyle & WB_NONEFIELD) { - if (mpNoneItem.get()) + if (mpNoneItem) { mpNoneItem->mbVisible = false; mpNoneItem->maText = GetText(); @@ -578,7 +578,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) // create NoSelection field and show it if (nStyle & WB_NONEFIELD) { - if (mpNoneItem.get() == nullptr) + if (mpNoneItem == nullptr) mpNoneItem.reset(new ValueSetItem(*this)); mpNoneItem->mnId = 0; @@ -739,7 +739,7 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt pItem = mItemList[ nPos ].get(); aRect = ImplGetItemRect( nPos ); } - else if (mpNoneItem.get()) + else if (mpNoneItem) { pItem = mpNoneItem.get(); aRect = maNoneItemRect; @@ -866,7 +866,7 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId ) } else { - if (mpNoneItem.get() == nullptr) + if (mpNoneItem == nullptr) { return; } @@ -1219,15 +1219,15 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent ) --nLastItem; - const size_t nCurPos = mnSelItemId ? GetItemPos(mnSelItemId) - : (mpNoneItem.get() ? VALUESET_ITEM_NONEITEM : 0); + const size_t nCurPos + = mnSelItemId ? GetItemPos(mnSelItemId) : (mpNoneItem ? VALUESET_ITEM_NONEITEM : 0); size_t nItemPos = VALUESET_ITEM_NOTFOUND; size_t nVStep = mnCols; switch (rKeyEvent.GetKeyCode().GetCode()) { case KEY_HOME: - nItemPos = mpNoneItem.get() ? VALUESET_ITEM_NONEITEM : 0; + nItemPos = mpNoneItem ? VALUESET_ITEM_NONEITEM : 0; break; case KEY_END: @@ -1241,7 +1241,7 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent ) { nItemPos = nCurPos-1; } - else if (mpNoneItem.get()) + else if (mpNoneItem) { nItemPos = VALUESET_ITEM_NONEITEM; } @@ -1287,7 +1287,7 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent ) // Go up of a whole page nItemPos = nCurPos-nVStep; } - else if (mpNoneItem.get()) + else if (mpNoneItem) { nItemPos = VALUESET_ITEM_NONEITEM; } @@ -2505,15 +2505,15 @@ bool SvtValueSet::KeyInput( const KeyEvent& rKeyEvent ) --nLastItem; - const size_t nCurPos = mnSelItemId ? GetItemPos(mnSelItemId) - : (mpNoneItem.get() ? VALUESET_ITEM_NONEITEM : 0); + const size_t nCurPos + = mnSelItemId ? GetItemPos(mnSelItemId) : (mpNoneItem ? VALUESET_ITEM_NONEITEM : 0); size_t nItemPos = VALUESET_ITEM_NOTFOUND; size_t nVStep = mnCols; switch (rKeyEvent.GetKeyCode().GetCode()) { case KEY_HOME: - nItemPos = mpNoneItem.get() ? VALUESET_ITEM_NONEITEM : 0; + nItemPos = mpNoneItem ? VALUESET_ITEM_NONEITEM : 0; break; case KEY_END: @@ -2527,7 +2527,7 @@ bool SvtValueSet::KeyInput( const KeyEvent& rKeyEvent ) { nItemPos = nCurPos-1; } - else if (mpNoneItem.get()) + else if (mpNoneItem) { nItemPos = VALUESET_ITEM_NONEITEM; } @@ -2572,7 +2572,7 @@ bool SvtValueSet::KeyInput( const KeyEvent& rKeyEvent ) // Go up of a whole page nItemPos = nCurPos-nVStep; } - else if (mpNoneItem.get()) + else if (mpNoneItem) { nItemPos = VALUESET_ITEM_NONEITEM; } @@ -3019,7 +3019,7 @@ void SvtValueSet::Format(vcl::RenderContext const & rRenderContext) nNoneHeight = 0; nNoneSpace = 0; - if (mpNoneItem.get()) + if (mpNoneItem) mpNoneItem.reset(nullptr); } @@ -3115,7 +3115,7 @@ void SvtValueSet::Format(vcl::RenderContext const & rRenderContext) if (nStyle & WB_NONEFIELD) { - if (mpNoneItem.get()) + if (mpNoneItem) { mpNoneItem->mbVisible = false; mpNoneItem->maText = GetText(); @@ -3319,7 +3319,7 @@ void SvtValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 pItem = mItemList[ nPos ].get(); aRect = ImplGetItemRect( nPos ); } - else if (mpNoneItem.get()) + else if (mpNoneItem) { pItem = mpNoneItem.get(); aRect = maNoneItemRect; diff --git a/svtools/source/misc/dialogcontrolling.cxx b/svtools/source/misc/dialogcontrolling.cxx index fbfa4613c6dc..0e2836fed295 100644 --- a/svtools/source/misc/dialogcontrolling.cxx +++ b/svtools/source/misc/dialogcontrolling.cxx @@ -159,7 +159,8 @@ namespace svt void ControlDependencyManager::addController( const std::shared_ptr<DialogController>& _pController ) { - OSL_ENSURE( _pController.get() != nullptr, "ControlDependencyManager::addController: invalid controller, this will crash, sooner or later!" ); + OSL_ENSURE(_pController != nullptr, "ControlDependencyManager::addController: invalid " + "controller, this will crash, sooner or later!"); m_pImpl->aControllers.push_back( _pController ); } diff --git a/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx index b97384d29866..08bb8710a555 100644 --- a/svtools/source/misc/svtaccessiblefactory.cxx +++ b/svtools/source/misc/svtaccessiblefactory.cxx @@ -219,7 +219,7 @@ namespace svt #if HAVE_FEATURE_DESKTOP // load the library implementing the factory - if ( !s_pFactory.get() ) + if (!s_pFactory) { #ifndef DISABLE_DYNLOADING const OUString sModuleName( SVLIBRARY( "acc" )); @@ -249,7 +249,7 @@ namespace svt } #endif // HAVE_FEATURE_DESKTOP - if ( !s_pFactory.get() ) + if (!s_pFactory) // the attempt to load the lib, or to create the factory, failed // -> fall back to a dummy factory s_pFactory = new AccessibleDummyFactory; diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx index 804b208b59aa..88fb69043cc1 100644 --- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx +++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx @@ -225,7 +225,7 @@ namespace accessibility if( !mbEditSourceEmpty ) { // deregister as listener - if( mpEditSource.get() ) + if (mpEditSource) EndListening( mpEditSource->GetBroadcaster() ); } else @@ -236,7 +236,7 @@ namespace accessibility SvxTextForwarder* AccessibleEmptyEditSource::GetTextForwarder() { - if( !mpEditSource.get() ) + if (!mpEditSource) return nullptr; return mpEditSource->GetTextForwarder(); @@ -244,7 +244,7 @@ namespace accessibility SvxViewForwarder* AccessibleEmptyEditSource::GetViewForwarder() { - if( !mpEditSource.get() ) + if (!mpEditSource) return nullptr; return mpEditSource->GetViewForwarder(); @@ -267,7 +267,7 @@ namespace accessibility SvxEditViewForwarder* AccessibleEmptyEditSource::GetEditViewForwarder( bool bCreate ) { - if( !mpEditSource.get() ) + if (!mpEditSource) return nullptr; // switch edit source, if not yet done @@ -279,7 +279,7 @@ namespace accessibility std::unique_ptr<SvxEditSource> AccessibleEmptyEditSource::Clone() const { - if( !mpEditSource.get() ) + if (!mpEditSource) return nullptr; return mpEditSource->Clone(); @@ -287,7 +287,7 @@ namespace accessibility void AccessibleEmptyEditSource::UpdateData() { - if( mpEditSource.get() ) + if (mpEditSource) mpEditSource->UpdateData(); } diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 9f622b696cd5..8a03b91a935a 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -1127,7 +1127,7 @@ namespace accessibility while( !maEventQueue.IsEmpty() ) { ::std::unique_ptr< SfxHint > pHint( maEventQueue.PopFront() ); - if( pHint.get() ) + if (pHint) { const SfxHint& rHint = *(pHint.get()); diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index e6ec4bc8e876..af26b6ebe48d 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -502,7 +502,7 @@ void SvxRuler::UpdateFrame() { // if no initialization by default app behavior const long nOld = lLogicNullOffset; - lLogicNullOffset = mxColumnItem.get() ? mxColumnItem->GetLeft(): mxLRSpaceItem->GetLeft(); + lLogicNullOffset = mxColumnItem ? mxColumnItem->GetLeft() : mxLRSpaceItem->GetLeft(); if(bAppSetNullOffset) { @@ -537,7 +537,7 @@ void SvxRuler::UpdateFrame() { // relative the upper edge of the surrounding frame const long nOld = lLogicNullOffset; - lLogicNullOffset = mxColumnItem.get() ? mxColumnItem->GetLeft() : mxULSpaceItem->GetUpper(); + lLogicNullOffset = mxColumnItem ? mxColumnItem->GetLeft() : mxULSpaceItem->GetUpper(); if(bAppSetNullOffset) { @@ -555,7 +555,7 @@ void SvxRuler::UpdateFrame() SetMargin1(ConvertVPosPixel(lAppNullOffset), nMarginStyle); } - long lLower = mxColumnItem.get() ? mxColumnItem->GetRight() : mxULSpaceItem->GetLower(); + long lLower = mxColumnItem ? mxColumnItem->GetRight() : mxULSpaceItem->GetLower(); long nMargin2 = mxPagePosItem->GetHeight() - lLower - lLogicNullOffset + lAppNullOffset; long nMargin2Pixel = ConvertVPosPixel(nMargin2); @@ -568,7 +568,7 @@ void SvxRuler::UpdateFrame() SetMargin2(); } - if(mxColumnItem.get()) + if (mxColumnItem) { mxRulerImpl->nColLeftPix = static_cast<sal_uInt16>(ConvertSizePixel(mxColumnItem->GetLeft())); mxRulerImpl->nColRightPix = static_cast<sal_uInt16>(ConvertSizePixel(mxColumnItem->GetRight())); @@ -610,7 +610,7 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) { case RulerType::Indent: { - if (!mxParaItem.get()) + if (!mxParaItem) break; long nIndex = aSelection.nAryPos + INDENT_GAP; @@ -631,10 +631,10 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) } case RulerType::Border: { - if (mxColumnItem.get() == nullptr) + if (mxColumnItem == nullptr) break; - SvxColumnItem& aColumnItem = *mxColumnItem.get(); + SvxColumnItem& aColumnItem = *mxColumnItem; if (aSelection.nAryPos + 1 >= aColumnItem.Count()) break; @@ -652,9 +652,9 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) case RulerType::Margin1: { long nLeft = 0.0; - if (mxLRSpaceItem.get()) + if (mxLRSpaceItem) nLeft = mxLRSpaceItem->GetLeft(); - else if (mxULSpaceItem.get()) + else if (mxULSpaceItem) nLeft = mxULSpaceItem->GetUpper(); else break; @@ -668,9 +668,9 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) case RulerType::Margin2: { long nRight = 0.0; - if (mxLRSpaceItem.get()) + if (mxLRSpaceItem) nRight = mxLRSpaceItem->GetRight(); - else if (mxULSpaceItem.get()) + else if (mxULSpaceItem) nRight = mxULSpaceItem->GetLower(); else break; @@ -844,17 +844,17 @@ void SvxRuler::UpdateColumns() void SvxRuler::UpdateObject() { /* Update view of object representation */ - if(mxObjectItem.get()) + if (mxObjectItem) { DBG_ASSERT(!mpObjectBorders.empty(), "no Buffer"); // !! to the page margin - long nMargin = mxLRSpaceItem.get() ? mxLRSpaceItem->GetLeft() : 0; + long nMargin = mxLRSpaceItem ? mxLRSpaceItem->GetLeft() : 0; mpObjectBorders[0].nPos = ConvertPosPixel(mxObjectItem->GetStartX() - nMargin + lAppNullOffset); mpObjectBorders[1].nPos = ConvertPosPixel(mxObjectItem->GetEndX() - nMargin + lAppNullOffset); - nMargin = mxULSpaceItem.get() ? mxULSpaceItem->GetUpper() : 0; + nMargin = mxULSpaceItem ? mxULSpaceItem->GetUpper() : 0; mpObjectBorders[2].nPos = ConvertPosPixel(mxObjectItem->GetStartY() - nMargin + lAppNullOffset); @@ -883,7 +883,7 @@ void SvxRuler::UpdatePara() */ // Dependence on PagePosItem - if(mxParaItem.get() && mxPagePosItem.get() && !mxObjectItem.get()) + if (mxParaItem.get() && mxPagePosItem.get() && !mxObjectItem) { bool bRTLText = mxRulerImpl->pTextRTLItem && mxRulerImpl->pTextRTLItem->GetValue(); // First-line indent is negative to the left paragraph margin @@ -958,7 +958,7 @@ void SvxRuler::UpdateParaBorder(const SvxLRSpaceItem * pItem ) void SvxRuler::UpdatePage() { /* Update view of position and width of page */ - if(mxPagePosItem.get()) + if (mxPagePosItem) { // all objects are automatically adjusted if(bHorz) @@ -1063,10 +1063,7 @@ void SvxRuler::UpdateTabs() if(IsDrag()) return; - if( mxPagePosItem.get() && - mxParaItem.get() && - mxTabStopItem.get() && - !mxObjectItem.get() ) + if (mxPagePosItem.get() && mxParaItem.get() && mxTabStopItem.get() && !mxObjectItem) { // buffer for DefaultTabStop // Distance last Tab <-> Right paragraph margin / DefaultTabDist @@ -1222,7 +1219,7 @@ void SvxRuler::Update() long SvxRuler::GetPageWidth() const { - if (!mxPagePosItem.get()) + if (!mxPagePosItem) return 0; return bHorz ? mxPagePosItem->GetWidth() : mxPagePosItem->GetHeight(); } @@ -1238,25 +1235,25 @@ inline long SvxRuler::GetFrameLeft() const long SvxRuler::GetFirstLineIndent() const { /* Get First-line indent in pixels */ - return mxParaItem.get() ? mpIndents[INDENT_FIRST_LINE].nPos : GetMargin1(); + return mxParaItem ? mpIndents[INDENT_FIRST_LINE].nPos : GetMargin1(); } long SvxRuler::GetLeftIndent() const { /* Get Left paragraph margin in Pixels */ - return mxParaItem.get() ? mpIndents[INDENT_LEFT_MARGIN].nPos : GetMargin1(); + return mxParaItem ? mpIndents[INDENT_LEFT_MARGIN].nPos : GetMargin1(); } long SvxRuler::GetRightIndent() const { /* Get Right paragraph margin in Pixels */ - return mxParaItem.get() ? mpIndents[INDENT_RIGHT_MARGIN].nPos : GetMargin2(); + return mxParaItem ? mpIndents[INDENT_RIGHT_MARGIN].nPos : GetMargin2(); } long SvxRuler::GetLogicRightIndent() const { /* Get Right paragraph margin in Logic */ - return mxParaItem.get() ? GetRightFrameMargin() - mxParaItem->GetRight() : GetRightFrameMargin(); + return mxParaItem ? GetRightFrameMargin() - mxParaItem->GetRight() : GetRightFrameMargin(); } // Left margin in App values, is either the margin (= 0) or the left edge of @@ -1264,8 +1261,8 @@ long SvxRuler::GetLogicRightIndent() const long SvxRuler::GetLeftFrameMargin() const { // #126721# for some unknown reason the current column is set to 0xffff - DBG_ASSERT(!mxColumnItem.get() || mxColumnItem->GetActColumn() < mxColumnItem->Count(), - "issue #126721# - invalid current column!"); + DBG_ASSERT(!mxColumnItem || mxColumnItem->GetActColumn() < mxColumnItem->Count(), + "issue #126721# - invalid current column!"); long nLeft = 0; if (mxColumnItem.get() && mxColumnItem->Count() && @@ -1279,8 +1276,8 @@ long SvxRuler::GetLeftFrameMargin() const inline long SvxRuler::GetLeftMin() const { - DBG_ASSERT(mxMinMaxItem.get(), "no MinMax value set"); - if (mxMinMaxItem.get()) + DBG_ASSERT(mxMinMaxItem, "no MinMax value set"); + if (mxMinMaxItem) { if (bHorz) return mxMinMaxItem->GetValue().Left(); @@ -1292,8 +1289,8 @@ inline long SvxRuler::GetLeftMin() const inline long SvxRuler::GetRightMax() const { - DBG_ASSERT(mxMinMaxItem.get(), "no MinMax value set"); - if (mxMinMaxItem.get()) + DBG_ASSERT(mxMinMaxItem, "no MinMax value set"); + if (mxMinMaxItem) { if (bHorz) return mxMinMaxItem->GetValue().Right(); @@ -1307,7 +1304,7 @@ inline long SvxRuler::GetRightMax() const long SvxRuler::GetRightFrameMargin() const { /* Get right frame margin (in logical units) */ - if (mxColumnItem.get()) + if (mxColumnItem) { if (!IsActLastColumn(true)) { @@ -1402,23 +1399,23 @@ void SvxRuler::AdjustMargin1(long lInputDiff) { long lDiff = lDragPos; SetNullOffset(nOld + lDiff); - if (!mxColumnItem.get() || !(nDragType & SvxRulerDragFlags::OBJECT_SIZE_LINEAR)) + if (!mxColumnItem || !(nDragType & SvxRulerDragFlags::OBJECT_SIZE_LINEAR)) { SetMargin2( GetMargin2() - lDiff, nMarginStyle ); - if (!mxColumnItem.get() && !mxObjectItem.get() && mxParaItem.get()) + if (!mxColumnItem && !mxObjectItem && mxParaItem.get()) { // Right indent of the old position mpIndents[INDENT_RIGHT_MARGIN].nPos -= lDiff; SetIndents(INDENT_COUNT, &mpIndents[0] + INDENT_GAP); } - if(mxObjectItem.get()) + if (mxObjectItem) { mpObjectBorders[GetObjectBordersOff(0)].nPos -= lDiff; mpObjectBorders[GetObjectBordersOff(1)].nPos -= lDiff; SetBorders(2, &mpObjectBorders[0] + GetObjectBordersOff(0)); } - if(mxColumnItem.get()) + if (mxColumnItem) { for(sal_uInt16 i = 0; i < mxColumnItem->Count()-1; ++i) mpBorders[i].nPos -= lDiff; @@ -1426,7 +1423,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) if(mxColumnItem->IsFirstAct()) { // Right indent of the old position - if(mxParaItem.get()) + if (mxParaItem) { mpIndents[INDENT_RIGHT_MARGIN].nPos -= lDiff; SetIndents(INDENT_COUNT, &mpIndents[0] + INDENT_GAP); @@ -1434,7 +1431,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) } else { - if(mxParaItem.get()) + if (mxParaItem) { mpIndents[INDENT_FIRST_LINE].nPos -= lDiff; mpIndents[INDENT_LEFT_MARGIN].nPos -= lDiff; @@ -1456,9 +1453,12 @@ void SvxRuler::AdjustMargin1(long lInputDiff) long lDiff = lDragPos - nOld; SetMargin1(nOld + lDiff, nMarginStyle); - if (!mxColumnItem.get() || !(nDragType & (SvxRulerDragFlags::OBJECT_SIZE_LINEAR | SvxRulerDragFlags::OBJECT_SIZE_PROPORTIONAL))) + if (!mxColumnItem + || !(nDragType + & (SvxRulerDragFlags::OBJECT_SIZE_LINEAR + | SvxRulerDragFlags::OBJECT_SIZE_PROPORTIONAL))) { - if (!mxColumnItem.get() && !mxObjectItem.get() && mxParaItem.get()) + if (!mxColumnItem && !mxObjectItem && mxParaItem.get()) { // Left indent of the old position mpIndents[INDENT_FIRST_LINE].nPos += lDiff; @@ -1466,7 +1466,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) SetIndents(INDENT_COUNT, &mpIndents[0] + INDENT_GAP); } - if (mxColumnItem.get()) + if (mxColumnItem) { for(sal_uInt16 i = 0; i < mxColumnItem->Count() - 1; ++i) mpBorders[i].nPos += lDiff; @@ -1474,7 +1474,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) if (mxColumnItem->IsFirstAct()) { // Left indent of the old position - if(mxParaItem.get()) + if (mxParaItem) { mpIndents[INDENT_FIRST_LINE].nPos += lDiff; mpIndents[INDENT_LEFT_MARGIN].nPos += lDiff; @@ -1483,7 +1483,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) } else { - if(mxParaItem.get()) + if (mxParaItem) { mpIndents[INDENT_FIRST_LINE].nPos += lDiff; mpIndents[INDENT_LEFT_MARGIN].nPos += lDiff; @@ -1492,7 +1492,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) } } } - if(mxTabStopItem.get()) + if (mxTabStopItem) { ModifyTabs_Impl(nTabCount + TAB_GAP, &mpTabs[0], lDiff); SetTabs(nTabCount, &mpTabs[0] + TAB_GAP); @@ -1529,7 +1529,7 @@ void SvxRuler::DragMargin2() SetMargin2( aDragPosition, nMarginStyle ); // Right indent of the old position - if((!mxColumnItem.get() || IsActLastColumn()) && mxParaItem.get()) + if ((!mxColumnItem || IsActLastColumn()) && mxParaItem.get()) { mpIndents[INDENT_FIRST_LINE].nPos += lDiff; SetIndents(INDENT_COUNT, &mpIndents[0] + INDENT_GAP); @@ -1591,7 +1591,7 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) long nDrapPosition = GetCorrectedDragPos( ( nNew & 4 ) != 0, ( nNew & 2 ) != 0 ); nDrapPosition = MakePositionSticky(nDrapPosition, GetLeftFrameMargin()); lTabPosition = ConvertHSizeLogic( nDrapPosition + GetNullOffset() ); - if(mxPagePosItem.get()) + if (mxPagePosItem) lTabPosition += mxPagePosItem->GetPos().X(); pEditWin->InvertTracking( tools::Rectangle( Point(lTabPosition, -aZero.Y()), @@ -1616,7 +1616,7 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) long nDrapPosition = GetCorrectedDragPos(); nDrapPosition = MakePositionSticky(nDrapPosition, GetLeftFrameMargin()); lTabPosition = ConvertVSizeLogic(nDrapPosition + GetNullOffset()); - if(mxPagePosItem.get()) + if (mxPagePosItem) lTabPosition += mxPagePosItem->GetPos().Y(); pEditWin->InvertTracking( tools::Rectangle( Point(-aZero.X(), lTabPosition), @@ -2042,7 +2042,7 @@ void SvxRuler::ApplyMargins() } pBindings->GetDispatcher()->ExecuteList(nId, SfxCallMode::RECORD, { pItem }); - if(mxTabStopItem.get()) + if (mxTabStopItem) UpdateTabs(); } @@ -2309,7 +2309,7 @@ void SvxRuler::ApplyObject() /* Applying object settings, changed by dragging. */ // to the page margin - long nMargin = mxLRSpaceItem.get() ? mxLRSpaceItem->GetLeft() : 0; + long nMargin = mxLRSpaceItem ? mxLRSpaceItem->GetLeft() : 0; long nStartX = PixelAdjust( ConvertPosLogic(mpObjectBorders[0].nPos) + nMargin - @@ -2324,7 +2324,7 @@ void SvxRuler::ApplyObject() mxObjectItem->GetEndX()); mxObjectItem->SetEndX(nEndX); - nMargin = mxULSpaceItem.get() ? mxULSpaceItem->GetUpper() : 0; + nMargin = mxULSpaceItem ? mxULSpaceItem->GetUpper() : 0; long nStartY = PixelAdjust( ConvertPosLogic(mpObjectBorders[2].nPos) + nMargin - @@ -2356,7 +2356,7 @@ void SvxRuler::PrepareProportional_Impl(RulerType eType) case RulerType::Margin1: case RulerType::Border: { - DBG_ASSERT(mxColumnItem.get(), "no ColumnItem"); + DBG_ASSERT(mxColumnItem, "no ColumnItem"); mxRulerImpl->SetPercSize(mxColumnItem->Count()); @@ -2591,7 +2591,7 @@ void SvxRuler::CalcMinMax() mxRulerImpl->lMaxLeftLogic = GetLeftMin(); nMaxLeft=ConvertSizePixel(mxRulerImpl->lMaxLeftLogic); - if (!mxColumnItem.get() || mxColumnItem->Count() == 1 ) + if (!mxColumnItem || mxColumnItem->Count() == 1) { if(bRTL) { @@ -2675,14 +2675,11 @@ void SvxRuler::CalcMinMax() } case RulerType::Margin2: { // right edge of the surrounding Frame - mxRulerImpl->lMaxRightLogic = - mxMinMaxItem.get() ? - GetPageWidth() - GetRightMax() : - GetPageWidth(); + mxRulerImpl->lMaxRightLogic + = mxMinMaxItem ? GetPageWidth() - GetRightMax() : GetPageWidth(); nMaxRight = ConvertSizePixel(mxRulerImpl->lMaxRightLogic); - - if(!mxColumnItem.get()) + if (!mxColumnItem) { if(bRTL) { @@ -2792,7 +2789,7 @@ void SvxRuler::CalcMinMax() } case RulerDragSize::Move: { - if(mxColumnItem.get()) + if (mxColumnItem) { //nIdx contains the position of the currently moved item //next visible separator on the left @@ -3045,7 +3042,7 @@ void SvxRuler::CalcMinMax() { nMaxLeft = lNullPix; nMaxRight = lNullPix + std::min(GetFirstLineIndent(), GetLeftIndent()) - glMinFrame; - if(mxColumnItem.get()) + if (mxColumnItem) { sal_uInt16 nRightCol=GetActRightColumn( true ); if(!IsActLastColumn( true )) @@ -3064,7 +3061,7 @@ void SvxRuler::CalcMinMax() nMaxLeft = lNullPix + std::max(GetFirstLineIndent(), GetLeftIndent()); nMaxRight = lNullPix; - if(mxColumnItem.get()) + if (mxColumnItem) { sal_uInt16 nRightCol=GetActRightColumn( true ); if(!IsActLastColumn( true )) @@ -3126,7 +3123,7 @@ bool SvxRuler::StartDrag() case RulerType::Margin2: // right edge of the surrounding Frame if((bHorz && mxLRSpaceItem.get()) || (!bHorz && mxULSpaceItem.get())) { - if(!mxColumnItem.get()) + if (!mxColumnItem) EvalModifier(); else nDragType = SvxRulerDragFlags::OBJECT; @@ -3137,7 +3134,7 @@ bool SvxRuler::StartDrag() } break; case RulerType::Border: // Table, column (Modifier) - if(mxColumnItem.get()) + if (mxColumnItem) { nDragOffset = 0; if (!mxColumnItem->IsTable()) @@ -3200,9 +3197,9 @@ void SvxRuler::Drag() DragIndents(); break; case RulerType::Border: // Table, columns - if(mxColumnItem.get()) + if (mxColumnItem) DragBorders(); - else if(mxObjectItem.get()) + else if (mxObjectItem) DragObjectBorder(); break; case RulerType::Tab: // Tabs @@ -3233,7 +3230,7 @@ void SvxRuler::EndDrag() case RulerType::Margin1: // upper left edge of the surrounding Frame case RulerType::Margin2: // lower right edge of the surrounding Frame { - if(!mxColumnItem.get() || !mxColumnItem->IsTable()) + if (!mxColumnItem || !mxColumnItem->IsTable()) ApplyMargins(); if(mxColumnItem.get() && @@ -3247,13 +3244,13 @@ void SvxRuler::EndDrag() if(lInitialDragPos != lPos || (mxRulerImpl->bIsTableRows && bHorz)) //special case - the null offset is changed here { - if(mxColumnItem.get()) + if (mxColumnItem) { ApplyBorders(); if(bHorz) UpdateTabs(); } - else if(mxObjectItem.get()) + else if (mxObjectItem) ApplyObject(); } break; @@ -3555,7 +3552,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const if(nActCol == USHRT_MAX) { nRight = 0; - while(!(*mxColumnItem.get())[nRight].bVisible) + while (!(*mxColumnItem)[nRight].bVisible) { nRight++; } @@ -3593,7 +3590,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const sal_uInt16 nVisCols = 0; for(size_t i = GetActRightColumn(false, nCol); i < mpBorders.size();) { - if((*mxColumnItem.get())[i].bVisible) + if ((*mxColumnItem)[i].bVisible) nVisCols++; i = GetActRightColumn(false, i); } diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index dc793ef7773d..b4ad25d981b7 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -770,7 +770,7 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe std::unique_ptr<SfxPoolItem> pItem; eState = pCurrentFrame->GetBindings().QueryState(SID_FM_CTL_PROPERTIES, pItem); - if (eState >= SfxItemState::DEFAULT && pItem.get() != nullptr ) + if (eState >= SfxItemState::DEFAULT && pItem != nullptr) { bool bChecked = dynamic_cast<const SfxBoolItem*>( pItem.get()) != nullptr && static_cast<SfxBoolItem*>(pItem.get())->GetValue(); rMenu.CheckItem("column", bChecked); diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index ee8df28c5ec2..da44c4e55591 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1784,18 +1784,18 @@ OUString DbPatternField::GetFormatText(const Reference< css::sdb::XColumn >& _rx bool bIsForPaint = _rxField != m_rColumn.GetField(); ::std::unique_ptr< FormattedColumnValue >& rpFormatter = bIsForPaint ? m_pPaintFormatter : m_pValueFormatter; - if ( !rpFormatter.get() ) + if (!rpFormatter) { rpFormatter = o3tl::make_unique< FormattedColumnValue> ( m_xContext, getCursor(), Reference< XPropertySet >( _rxField, UNO_QUERY ) ); - OSL_ENSURE( rpFormatter.get(), "DbPatternField::Init: no value formatter!" ); + OSL_ENSURE(rpFormatter, "DbPatternField::Init: no value formatter!"); } else OSL_ENSURE( rpFormatter->getColumn() == _rxField, "DbPatternField::GetFormatText: my value formatter is working for another field ...!" ); // re-creating the value formatter here every time would be quite expensive ... OUString sText; - if ( rpFormatter.get() ) + if (rpFormatter) sText = rpFormatter->getFormattedValue(); return impl_formatText( sText ); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index aa953fa13616..7c2311948a8a 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1608,9 +1608,9 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int _nLabelObjectID))); _pLabelPage->NbcInsertObject(pLabel.get()); - OSL_ENSURE( pLabel.get(), "FmXFormView::createControlLabelPair: could not create the label!" ); + OSL_ENSURE(pLabel, "FmXFormView::createControlLabelPair: could not create the label!"); - if ( !pLabel.get() ) + if (!pLabel) return false; xLabelModel.set( pLabel->GetUnoControlModel(), UNO_QUERY ); @@ -1641,9 +1641,9 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int _nControlObjectID))); _pControlPage->NbcInsertObject(pControl.get()); - OSL_ENSURE( pControl.get(), "FmXFormView::createControlLabelPair: could not create the control!" ); + OSL_ENSURE(pControl, "FmXFormView::createControlLabelPair: could not create the control!"); - if ( !pControl.get() ) + if (!pControl) return false; Reference< XPropertySet > xControlSet( pControl->GetUnoControlModel(), UNO_QUERY ); diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index a5e6fae5fe75..504158432591 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -2490,7 +2490,7 @@ void FormController::insertControl(const Reference< XControl > & xControl) m_aControls.realloc(m_aControls.getLength() + 1); m_aControls.getArray()[m_aControls.getLength() - 1] = xControl; - if ( m_pColumnInfoCache.get() ) + if (m_pColumnInfoCache) m_pColumnInfoCache->deinitializeControls(); implControlInserted( xControl, m_bAttachEvents ); @@ -3711,8 +3711,8 @@ sal_Bool SAL_CALL FormController::approveRowChange(const RowChangeEvent& _rEvent if ( !lcl_shouldValidateRequiredFields_nothrow( _rEvent.Source ) ) return true; - OSL_ENSURE( m_pColumnInfoCache.get(), "FormController::approveRowChange: no column infos!" ); - if ( !m_pColumnInfoCache.get() ) + OSL_ENSURE(m_pColumnInfoCache, "FormController::approveRowChange: no column infos!"); + if (!m_pColumnInfoCache) return true; try diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 1fe3b594ffcf..5b4f67d85020 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -611,7 +611,7 @@ void AreaPropertyPanelBase::ImpUpdateTransparencies() { bool bZeroValue(false); - if(mpTransparanceItem.get()) + if (mpTransparanceItem) { const sal_uInt16 nValue(mpTransparanceItem->GetValue()); @@ -1258,7 +1258,7 @@ IMPL_LINK( AreaPropertyPanelBase, ClickTrGrHdl_Impl, ToolBox*, pToolBox, void ) { if (!mxTrGrPopup) mxTrGrPopup = VclPtr<AreaTransparencyGradientPopup>::Create(*this); - if (mpFloatTransparenceItem.get()) + if (mpFloatTransparenceItem) mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get()); OSL_ASSERT( pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == UNO_SIDEBARGRADIENT); mxTrGrPopup->StartPopupMode(pToolBox, FloatWinPopupFlags::GrabFocus); diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 473953f6ed20..10dad0365a1d 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -785,7 +785,7 @@ void LinePropertyPanelBase::FillLineStyleList() void LinePropertyPanelBase::SelectLineStyle() { - if( !mpStyleItem.get() || !mpDashItem.get() ) + if (!mpStyleItem || !mpDashItem) { mpLBStyle->SetNoSelection(); mpLBStyle->Disable(); @@ -833,7 +833,7 @@ void LinePropertyPanelBase::SelectEndStyle(bool bStart) if(bStart) { - if( !mpStartItem.get() ) + if (!mpStartItem) { mpLBStart->SetNoSelection(); mpLBStart->Disable(); @@ -862,7 +862,7 @@ void LinePropertyPanelBase::SelectEndStyle(bool bStart) } else { - if( !mpEndItem.get() ) + if (!mpEndItem) { mpLBEnd->SetNoSelection(); mpLBEnd->Disable(); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 87e93a1914c1..175abd23252a 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -278,7 +278,7 @@ const GraphicObject& SdrGrafObj::GetGraphicObject(bool bForceSwapIn) const { if (bForceSwapIn) ForceSwapIn(); - return *mpGraphicObject.get(); + return *mpGraphicObject; } const GraphicObject* SdrGrafObj::GetReplacementGraphicObject() const diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index fe440edf4649..c56b06d6c954 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -688,12 +688,7 @@ void SdrObjList::UnGroupObj( size_t nObjNum ) #endif } - -bool SdrObjList::HasObjectNavigationOrder() const -{ - return mxNavigationOrder.get() != nullptr; -} - +bool SdrObjList::HasObjectNavigationOrder() const { return mxNavigationOrder != nullptr; } void SdrObjList::SetObjectNavigationPosition ( SdrObject& rObject, @@ -702,7 +697,7 @@ void SdrObjList::SetObjectNavigationPosition ( // When the navigation order container has not yet been created then // create one now. It is initialized with the z-order taken from // maList. - if (mxNavigationOrder.get() == nullptr) + if (mxNavigationOrder == nullptr) { mxNavigationOrder.reset(new WeakSdrObjectContainerType(maList.size())); ::std::copy( @@ -710,7 +705,7 @@ void SdrObjList::SetObjectNavigationPosition ( maList.end(), mxNavigationOrder->begin()); } - OSL_ASSERT(mxNavigationOrder.get()!=nullptr); + OSL_ASSERT(mxNavigationOrder != nullptr); OSL_ASSERT( mxNavigationOrder->size() == maList.size()); tools::WeakReference<SdrObject> aReference (&rObject); @@ -787,7 +782,7 @@ bool SdrObjList::RecalcNavigationPositions() { if (mbIsNavigationOrderDirty) { - if (mxNavigationOrder.get() != nullptr) + if (mxNavigationOrder != nullptr) { mbIsNavigationOrderDirty = false; @@ -799,7 +794,7 @@ bool SdrObjList::RecalcNavigationPositions() } } - return mxNavigationOrder.get() != nullptr; + return mxNavigationOrder != nullptr; } @@ -811,7 +806,7 @@ void SdrObjList::SetNavigationOrder (const uno::Reference<container::XIndexAcces if (static_cast<sal_uInt32>(nCount) != maList.size()) return; - if (mxNavigationOrder.get() == nullptr) + if (mxNavigationOrder == nullptr) mxNavigationOrder.reset(new WeakSdrObjectContainerType(nCount)); for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex) diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 8eeda9aa556e..9f8ed9f7f771 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1227,7 +1227,7 @@ void SvxFontNameBox_Impl::Select() // while in Dispatch()), accessing members will crash in this case. ReleaseFocus_Impl(); EndPreview(); - if ( pFontItem.get() ) + if (pFontItem) { aArgs[0].Name = "CharFontName"; SfxToolBoxControl::Dispatch( m_xDispatchProvider, @@ -1242,7 +1242,7 @@ void SvxFontNameBox_Impl::Select() EndPreview(); return; } - if ( pFontItem.get() ) + if (pFontItem) { aArgs[0].Name = "CharPreviewFontName"; SfxToolBoxControl::Dispatch( m_xDispatchProvider, diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 790ce87893ab..4192e359a49d 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -890,8 +890,8 @@ IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify&, rNotify, void) { std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify) ); - if( aHint.get() ) - Broadcast( *aHint.get() ); + if (aHint) + Broadcast(*aHint); } } diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 6084df6abb5a..050bf145d995 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -1334,8 +1334,8 @@ bool SwCalc::Str2Double( const OUString& rCommand, sal_Int32& rCommandPos, } } - bool const bRet = lcl_Str2Double( rCommand, rCommandPos, rVal, - (pLclD.get()) ? pLclD.get() : aSysLocale.GetLocaleDataPtr() ); + bool const bRet = lcl_Str2Double(rCommand, rCommandPos, rVal, + pLclD ? pLclD.get() : aSysLocale.GetLocaleDataPtr()); return bRet; } diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 6aca102e00e3..fa258e82ae53 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1160,9 +1160,8 @@ int SwFindParaAttr::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove, con std::unique_ptr<OUString> pRepl( bRegExp ? ReplaceBackReferences( *pSearchOpt, pCursor ) : nullptr ); - m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( *pCursor, - (pRepl.get()) ? *pRepl : pSearchOpt->replaceString, - bRegExp ); + m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( + *pCursor, pRepl ? *pRepl : pSearchOpt->replaceString, bRegExp); m_rCursor.SaveTableBoxContent( pCursor->GetPoint() ); if( bRegExp ) diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 60654d3aace7..73f6feee297a 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -679,11 +679,8 @@ int SwFindParaText::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove, std::unique_ptr<OUString> pRepl( bRegExp ? ReplaceBackReferences( m_rSearchOpt, pCursor ) : nullptr ); - bool const bReplaced = - m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( - *pCursor, - (pRepl.get()) ? *pRepl : m_rSearchOpt.replaceString, - bRegExp ); + bool const bReplaced = m_rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( + *pCursor, pRepl ? *pRepl : m_rSearchOpt.replaceString, bRegExp); m_rCursor.SaveTableBoxContent( pCursor->GetPoint() ); if( bRegExp ) diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 63d437e77f42..ad1f406933a9 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -561,7 +561,7 @@ bool SwDoc::SetFlyFrameAttr( SwFrameFormat& rFlyFormat, SfxItemSet& rSet ) bool const bRet = lcl_SetFlyFrameAttr(*this, &SwDoc::SetFlyFrameAnchor, rFlyFormat, rSet); - if ( pSaveUndo.get() ) + if (pSaveUndo) { if ( pSaveUndo->GetUndo() ) { diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index c75b2fd76f30..efd6218731a4 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -804,7 +804,7 @@ IGrammarContact* getGrammarContact( const SwTextNode& rTextNode ) SwDoc::GetXmlIdRegistry() { // UGLY: this relies on SetClipBoard being called before GetXmlIdRegistry! - if (!m_pXmlIdRegistry.get()) + if (!m_pXmlIdRegistry) { m_pXmlIdRegistry.reset( ::sfx2::createXmlIdRegistry( IsClipBoard() ) ); } diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index bd63396d6340..c43c8fa668ef 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -530,7 +530,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox, ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwNodeIndex aSavePos( aInsIdx, -1 ); - if( pRg.get() ) + if (pRg) pCpyDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly( *pRg, 0, aInsIdx, nullptr, false ); else pDoc->GetNodes().MakeTextNode( aInsIdx, pDoc->GetDfltTextFormatColl() ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 1fc5606eaff3..d94e62c75200 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -3871,7 +3871,7 @@ SwTableAutoFormatTable& SwDoc::GetTableStyles() m_pTableStyles.reset(new SwTableAutoFormatTable); m_pTableStyles->Load(); } - return *m_pTableStyles.get(); + return *m_pTableStyles; } OUString SwDoc::GetUniqueTableName() const @@ -4602,7 +4602,7 @@ std::unique_ptr<SwTableAutoFormat> SwDoc::DelTableStyle(const OUString& rName, b std::unique_ptr<SwTableAutoFormat> pReleasedFormat = GetTableStyles().ReleaseAutoFormat(rName); std::vector<SwTable*> vAffectedTables; - if (pReleasedFormat.get()) + if (pReleasedFormat) { size_t nTableCount = GetTableFrameFormatCount(true); for (size_t i=0; i < nTableCount; ++i) diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index e51fab869e2a..f4dfc7994637 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1491,7 +1491,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt ) // #i50824# // method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs> - lcl_ConvertSdrOle2ObjsToSdrGrafObjs( *pModel.get() ); + lcl_ConvertSdrOle2ObjsToSdrGrafObjs(*pModel); pView->Paste(*pModel, aPos, nullptr, SdrInsertFlags::NONE); const size_t nCnt = pView->GetMarkedObjectList().GetMarkCount(); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 8a36ededbe31..46598f206082 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -807,7 +807,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream() return; } - if ( mpThreadConsumer.get() == nullptr ) + if (mpThreadConsumer == nullptr) { mpThreadConsumer.reset(new SwAsyncRetrieveInputStreamThreadConsumer(*this), o3tl::default_delete<SwAsyncRetrieveInputStreamThreadConsumer>()); diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index f407a0eec839..5dff4890393d 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -815,7 +815,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes, CHECK_TABLE( *this ) // We have to assert a "rectangular" box selection before we start to merge std::unique_ptr< SwBoxSelection > pSel( CollectBoxSelection( rPam ) ); - if( !pSel.get() || pSel->isEmpty() ) + if (!pSel || pSel->isEmpty()) return false; // Now we should have a rectangle of boxes, // i.e. contiguous cells in contiguous rows diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 060ae4cf3995..6741375ee4ad 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -512,7 +512,7 @@ void SwTextField::DeleteTextField( const SwTextField& rTextField ) { std::shared_ptr< SwPaM > pPamForTextField; GetPamForTextField(rTextField, pPamForTextField); - if (pPamForTextField.get() != nullptr) + if (pPamForTextField != nullptr) { rTextField.GetTextNode().GetDoc()->getIDocumentContentOperations().DeleteAndJoin(*pPamForTextField); } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index d5aa051ef7fb..30bfd26ac35f 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1301,7 +1301,7 @@ void SwTextNode::Update( } else if( bNoExp ) { - if ( !pCollector.get() ) + if (!pCollector) { pCollector.reset( new SwpHts ); } @@ -1515,7 +1515,7 @@ void SwTextNode::Update( // base class SwIndexReg::Update( rPos, nChangeLen, bNegative, bDelete ); - if ( pCollector.get() ) + if (pCollector) { const size_t nCount = pCollector->size(); for ( size_t i = 0; i < nCount; ++i ) diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index d7e98e87eee6..024824f60733 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2173,7 +2173,7 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, OSL_ENSURE(!isUNKNOWNATR(nHintWhich), "SwTextNode::GetAttr(): unknown attribute?"); - if ( !pAttrArr.get() ) + if (!pAttrArr) { pAttrArr.reset( new std::vector< SwPoolItemEndPair >(coArrSz)); @@ -2230,7 +2230,7 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, } } - if ( pAttrArr.get() ) + if (pAttrArr) { for (size_t n = 0; n < coArrSz; ++n) { diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index df199cd5a472..b8048539f459 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -220,7 +220,7 @@ SwHistorySetText::~SwHistorySetText() void SwHistorySetText::SetInDoc( SwDoc* pDoc, bool ) { - if ( !m_pAttr.get() ) + if (!m_pAttr) return; if ( RES_TXTATR_CHARFMT == m_pAttr->Which() ) @@ -283,7 +283,7 @@ SwHistorySetTextField::~SwHistorySetTextField() void SwHistorySetTextField::SetInDoc( SwDoc* pDoc, bool ) { - if ( !m_pField.get() ) + if (!m_pField) return; SwFieldType* pNewFieldType = m_pFieldType.get(); @@ -461,7 +461,7 @@ void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool ) if ( !pTextNd ) return; - if ( m_pUndo.get() ) + if (m_pUndo) { // set the footnote in the TextNode SwFormatFootnote aTemp( m_bEndNote ); @@ -622,7 +622,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool ) "<SwHistoryBookmark::SetInDoc(..)>" " - wrong node for a mark"); - if(pPam.get() != nullptr && pContentNd) + if (pPam != nullptr && pContentNd) { pPam->SetMark(); pPam->GetMark()->nNode = m_nOtherNode; @@ -640,7 +640,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool ) *pPam->GetMark() = pMark->GetOtherMarkPos(); } - if(pPam.get()) + if (pPam) { if ( pMark != nullptr ) { diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 514e4aaa1d13..d3b88108a725 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -161,7 +161,7 @@ void SwUndoFormatAttr::UndoImpl(::sw::UndoRedoContext & rContext) // OD 2004-10-26 #i35443# // Important note: <Undo(..)> also called by <ReDo(..)> - if ( !m_pOldSet.get() || !m_pFormat || !IsFormatInDoc( &rContext.GetDoc() )) + if (!m_pOldSet || !m_pFormat || !IsFormatInDoc(&rContext.GetDoc())) return; // #i35443# - If anchor attribute has been successful @@ -290,7 +290,7 @@ void SwUndoFormatAttr::RedoImpl(::sw::UndoRedoContext & rContext) void SwUndoFormatAttr::RepeatImpl(::sw::RepeatContext & rContext) { - if ( !m_pOldSet.get() ) + if (!m_pOldSet) return; SwDoc & rDoc(rContext.GetDoc()); @@ -535,14 +535,16 @@ SwUndoFormatResetAttr::~SwUndoFormatResetAttr() void SwUndoFormatResetAttr::UndoImpl(::sw::UndoRedoContext &) { - if ( m_pOldItem.get() ) { + if (m_pOldItem) + { m_pChangedFormat->SetFormatAttr( *m_pOldItem ); } } void SwUndoFormatResetAttr::RedoImpl(::sw::UndoRedoContext &) { - if ( m_pOldItem.get() ) { + if (m_pOldItem) + { m_pChangedFormat->ResetFormatAttr( m_nWhichId ); } } @@ -726,7 +728,8 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext) // remove all format redlines, will be recreated if needed SetPaM(aPam); pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT); - if ( m_pRedlineSaveData.get() ) { + if (m_pRedlineSaveData) + { SetSaveData( *pDoc, *m_pRedlineSaveData ); } } @@ -849,7 +852,8 @@ SwUndoDefaultAttr::~SwUndoDefaultAttr() void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - if ( m_pOldSet.get() ) { + if (m_pOldSet) + { SwUndoFormatAttrHelper aTmp( *rDoc.GetDfltTextFormatColl() ); rDoc.SetDefault( *m_pOldSet ); @@ -859,7 +863,8 @@ void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext) m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet); } } - if ( m_pTabStop.get() ) { + if (m_pTabStop) + { SvxTabStopItem* pOld = static_cast<SvxTabStopItem*>( rDoc.GetDefault( RES_PARATR_TABSTOP ).Clone() ); rDoc.SetDefault( *m_pTabStop ); diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index de7fa973ca9e..8f59781ae009 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -148,7 +148,7 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext) Join( rDoc, nEndNode ); } - if (m_pHistory.get()) + if (m_pHistory) { m_pHistory->TmpRollback( &rDoc, 0, false ); } @@ -160,7 +160,7 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext) AddUndoRedoPaM(rContext); - if( m_pRedlineSaveData.get()) + if (m_pRedlineSaveData) SetSaveData( rDoc, *m_pRedlineSaveData ); } @@ -170,7 +170,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext) SwPaM & rPam( AddUndoRedoPaM(rContext) ); const SwTOXBaseSection* pUpdateTOX = nullptr; - if (m_pTOXBase.get()) + if (m_pTOXBase) { pUpdateTOX = rDoc.InsertTableOf( *rPam.GetPoint(), *m_pTOXBase, m_pAttrSet.get(), true); @@ -180,7 +180,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.InsertSwSection(rPam, *m_pSectionData, nullptr, m_pAttrSet.get()); } - if (m_pHistory.get()) + if (m_pHistory) { m_pHistory->SetTmpEnd( m_pHistory->Count() ); } @@ -219,7 +219,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext) void SwUndoInsSection::RepeatImpl(::sw::RepeatContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - if (m_pTOXBase.get()) + if (m_pTOXBase) { rDoc.InsertTableOf(*rContext.GetRepeatPaM().GetPoint(), *m_pTOXBase, m_pAttrSet.get(), true); @@ -244,7 +244,7 @@ void SwUndoInsSection::Join( SwDoc& rDoc, sal_uLong nNode ) } pTextNd->JoinNext(); - if (m_pHistory.get()) + if (m_pHistory) { SwIndex aCntIdx( pTextNd, 0 ); pTextNd->RstTextAttr( aCntIdx, pTextNd->Len(), 0, nullptr, true ); @@ -256,7 +256,7 @@ SwUndoInsSection::SaveSplitNode(SwTextNode *const pTextNd, bool const bAtStart) { if( pTextNd->GetpSwpHints() ) { - if (!m_pHistory.get()) + if (!m_pHistory) { m_pHistory.reset( new SwHistory ); } @@ -318,7 +318,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - if (m_pTOXBase.get()) + if (m_pTOXBase) { rDoc.InsertTableOf(m_nStartNode, m_nEndNode-2, *m_pTOXBase, m_pAttrSet.get()); @@ -328,7 +328,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext) SwNodeIndex aStt( rDoc.GetNodes(), m_nStartNode ); SwNodeIndex aEnd( rDoc.GetNodes(), m_nEndNode-2 ); SwSectionFormat* pFormat = rDoc.MakeSectionFormat(); - if (m_pAttrSet.get()) + if (m_pAttrSet) { pFormat->SetFormatAttr( *m_pAttrSet ); } @@ -424,7 +424,7 @@ void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext) SwFormat* pFormat = rNdSect.GetFormat(); SfxItemSet* pCur = ::lcl_GetAttrSet( rNdSect ); - if (m_pAttrSet.get()) + if (m_pAttrSet) { // The Content and Protect items must persist const SfxPoolItem* pItem; diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index c772f6c40da9..aa4ff1cfdcf4 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1651,7 +1651,7 @@ void SwUndoTableNdsChg::SaveNewBoxes( const SwTableNode& rTableNd, void SwUndoTableNdsChg::SaveSection( SwStartNode* pSttNd ) { OSL_ENSURE( IsDelBox(), "wrong Action" ); - if (m_pDelSects.get() == nullptr) + if (m_pDelSects == nullptr) m_pDelSects.reset(new SwUndoSaveSections); SwTableNode* pTableNd = pSttNd->FindTableNode(); @@ -3161,7 +3161,7 @@ void SwUndoTableStyleMake::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoTableStyleMake::RedoImpl(::sw::UndoRedoContext & rContext) { - if (m_pAutoFormat.get()) + if (m_pAutoFormat) { SwTableAutoFormat* pFormat = rContext.GetDoc().MakeTableStyle(m_sName, true); if (pFormat) diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 81a3b1453eee..bfde7f014f88 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2040,7 +2040,7 @@ SwXTextField::getAnchor() std::shared_ptr< SwPaM > pPamForTextField; SwTextField::GetPamForTextField(*pTextField, pPamForTextField); - if (pPamForTextField.get() == nullptr) + if (pPamForTextField == nullptr) return nullptr; // If this is a postit field, then return the range of its annotation mark if it has one. diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 83bd9f22c850..6594a6d00d96 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -306,7 +306,7 @@ SwUnoCursorHelper::SetPageDesc( pNewDesc.reset(new SwFormatPageDesc( *static_cast<const SwFormatPageDesc*>(pItem))); } - if (!pNewDesc.get()) + if (!pNewDesc) { pNewDesc.reset(new SwFormatPageDesc()); } @@ -324,7 +324,7 @@ SwUnoCursorHelper::SetPageDesc( { throw lang::IllegalArgumentException(); } - pNewDesc.get()->RegisterToPageDesc( *pPageDesc ); + pNewDesc->RegisterToPageDesc(*pPageDesc); bPut = true; } if(!bPut) @@ -425,7 +425,7 @@ lcl_setDropcapCharStyle(SwPaM const & rPam, SfxItemSet & rItemSet, { pDrop.reset(new SwFormatDrop(*static_cast<const SwFormatDrop*>(pItem))); } - if (!pDrop.get()) + if (!pDrop) { pDrop.reset(new SwFormatDrop); } @@ -450,7 +450,7 @@ lcl_setRubyCharstyle(SfxItemSet & rItemSet, uno::Any const& rValue) { pRuby.reset(new SwFormatRuby(*static_cast<const SwFormatRuby*>(pItem))); } - if (!pRuby.get()) + if (!pRuby) { pRuby.reset(new SwFormatRuby(OUString())); } @@ -1906,7 +1906,7 @@ SwUnoCursorHelper::GetPropertyStates( } else { - if (!pSet.get()) + if (!pSet) { switch ( eCaller ) { diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 12608d77cb15..ac7d5d88f423 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -714,7 +714,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta, uno::Reference<rdf::XMetadatable> xMeta(rMeta.GetXMeta()); if (xMeta.is()) { - if (pPortions.get()) // set cache in the XMeta to the given portions + if (pPortions) // set cache in the XMeta to the given portions { const uno::Reference<lang::XUnoTunnel> xUT(xMeta, uno::UNO_QUERY); SwXMeta *const pXMeta( @@ -1218,7 +1218,7 @@ SwXMeta::createEnumeration() SwPaM aPam(*pTextNode, nMetaStart); - if (!m_pImpl->m_pTextPortions.get()) + if (!m_pImpl->m_pTextPortions) { return new SwXTextPortionEnumeration( aPam, GetParentText(), nMetaStart, nMetaEnd); diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index e7a2ca50481e..bbbac6aedbba 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -365,35 +365,35 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) RES_COL, RES_COL, RES_FTN_AT_TXTEND, RES_FRAMEDIR, RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER>{}); - if (m_pImpl->m_pProps->m_pBrushItem.get()) + if (m_pImpl->m_pProps->m_pBrushItem) { aSet.Put(*m_pImpl->m_pProps->m_pBrushItem); } - if (m_pImpl->m_pProps->m_pColItem.get()) + if (m_pImpl->m_pProps->m_pColItem) { aSet.Put(*m_pImpl->m_pProps->m_pColItem); } - if (m_pImpl->m_pProps->m_pFootnoteItem.get()) + if (m_pImpl->m_pProps->m_pFootnoteItem) { aSet.Put(*m_pImpl->m_pProps->m_pFootnoteItem); } - if (m_pImpl->m_pProps->m_pEndItem.get()) + if (m_pImpl->m_pProps->m_pEndItem) { aSet.Put(*m_pImpl->m_pProps->m_pEndItem); } - if (m_pImpl->m_pProps->m_pXMLAttr.get()) + if (m_pImpl->m_pProps->m_pXMLAttr) { aSet.Put(*m_pImpl->m_pProps->m_pXMLAttr); } - if (m_pImpl->m_pProps->m_pNoBalanceItem.get()) + if (m_pImpl->m_pProps->m_pNoBalanceItem) { aSet.Put(*m_pImpl->m_pProps->m_pNoBalanceItem); } - if (m_pImpl->m_pProps->m_pFrameDirItem.get()) + if (m_pImpl->m_pProps->m_pFrameDirItem) { aSet.Put(*m_pImpl->m_pProps->m_pFrameDirItem); } - if (m_pImpl->m_pProps->m_pLRSpaceItem.get()) + if (m_pImpl->m_pProps->m_pLRSpaceItem) { aSet.Put(*m_pImpl->m_pProps->m_pLRSpaceItem); } @@ -828,7 +828,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( SfxPoolItem* pPutItem = nullptr; if (RES_COL == pEntry->nWID) { - if (!m_pProps->m_pColItem.get()) + if (!m_pProps->m_pColItem) { m_pProps->m_pColItem.reset(new SwFormatCol); } @@ -836,7 +836,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_BACKGROUND == pEntry->nWID) { - if (!m_pProps->m_pBrushItem.get()) + if (!m_pProps->m_pBrushItem) { m_pProps->m_pBrushItem.reset( new SvxBrushItem(RES_BACKGROUND)); @@ -845,7 +845,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_FTN_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pFootnoteItem.get()) + if (!m_pProps->m_pFootnoteItem) { m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd); } @@ -853,7 +853,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_END_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pEndItem.get()) + if (!m_pProps->m_pEndItem) { m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd); } @@ -861,7 +861,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { - if (!m_pProps->m_pXMLAttr.get()) + if (!m_pProps->m_pXMLAttr) { m_pProps->m_pXMLAttr.reset( new SvXMLAttrContainerItem( @@ -871,7 +871,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_COLUMNBALANCE== pEntry->nWID) { - if (!m_pProps->m_pNoBalanceItem.get()) + if (!m_pProps->m_pNoBalanceItem) { m_pProps->m_pNoBalanceItem.reset( new SwFormatNoBalancedColumns(true)); @@ -880,7 +880,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_FRAMEDIR == pEntry->nWID) { - if (!m_pProps->m_pFrameDirItem.get()) + if (!m_pProps->m_pFrameDirItem) { m_pProps->m_pFrameDirItem.reset( new SvxFrameDirectionItem( @@ -890,7 +890,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl( } else if (RES_LR_SPACE == pEntry->nWID) { - if (!m_pProps->m_pLRSpaceItem.get()) + if (!m_pProps->m_pLRSpaceItem) { m_pProps->m_pLRSpaceItem.reset( new SvxLRSpaceItem( RES_LR_SPACE )); @@ -1169,7 +1169,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( const SfxPoolItem* pQueryItem = nullptr; if (RES_COL == pEntry->nWID) { - if (!m_pProps->m_pColItem.get()) + if (!m_pProps->m_pColItem) { m_pProps->m_pColItem.reset(new SwFormatCol); } @@ -1177,7 +1177,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_BACKGROUND == pEntry->nWID) { - if (!m_pProps->m_pBrushItem.get()) + if (!m_pProps->m_pBrushItem) { m_pProps->m_pBrushItem.reset( new SvxBrushItem(RES_BACKGROUND)); @@ -1186,7 +1186,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_FTN_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pFootnoteItem.get()) + if (!m_pProps->m_pFootnoteItem) { m_pProps->m_pFootnoteItem.reset(new SwFormatFootnoteAtTextEnd); } @@ -1194,7 +1194,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_END_AT_TXTEND == pEntry->nWID) { - if (!m_pProps->m_pEndItem.get()) + if (!m_pProps->m_pEndItem) { m_pProps->m_pEndItem.reset(new SwFormatEndAtTextEnd); } @@ -1202,7 +1202,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { - if (!m_pProps->m_pXMLAttr.get()) + if (!m_pProps->m_pXMLAttr) { m_pProps->m_pXMLAttr.reset( new SvXMLAttrContainerItem); @@ -1211,7 +1211,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_COLUMNBALANCE== pEntry->nWID) { - if (!m_pProps->m_pNoBalanceItem.get()) + if (!m_pProps->m_pNoBalanceItem) { m_pProps->m_pNoBalanceItem.reset( new SwFormatNoBalancedColumns); @@ -1220,7 +1220,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_FRAMEDIR == pEntry->nWID) { - if (!m_pProps->m_pFrameDirItem.get()) + if (!m_pProps->m_pFrameDirItem) { m_pProps->m_pFrameDirItem.reset( new SvxFrameDirectionItem( @@ -1230,7 +1230,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( } else if (RES_LR_SPACE == pEntry->nWID) { - if (!m_pProps->m_pLRSpaceItem.get()) + if (!m_pProps->m_pLRSpaceItem) { m_pProps->m_pLRSpaceItem.reset( new SvxLRSpaceItem( RES_LR_SPACE )); @@ -1402,7 +1402,7 @@ SwXTextSection::getPropertyStates( { if (RES_COL == pEntry->nWID) { - if (!m_pImpl->m_pProps->m_pColItem.get()) + if (!m_pImpl->m_pProps->m_pColItem) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; } @@ -1413,7 +1413,7 @@ SwXTextSection::getPropertyStates( } else { - if (!m_pImpl->m_pProps->m_pBrushItem.get()) + if (!m_pImpl->m_pProps->m_pBrushItem) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 3397127ac23c..f3ae2154993e 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -281,7 +281,8 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow, SwViewShell::~SwViewShell() { - IDocumentLayoutAccess * const pLayoutAccess = mxDoc.get() ? &mxDoc->getIDocumentLayoutAccess() : nullptr; + IDocumentLayoutAccess* const pLayoutAccess + = mxDoc ? &mxDoc->getIDocumentLayoutAccess() : nullptr; { SET_CURR_SHELL( this ); @@ -320,7 +321,7 @@ SwViewShell::~SwViewShell() mpImp.reset(); - if ( mxDoc.get() ) + if (mxDoc) { if( mxDoc->getReferenceCount() > 1 ) GetLayout()->ResetNewLayout(); diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 3cc9826e2785..836e7db42cfa 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -560,14 +560,14 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, // If necessary, take the hard attribute from the style if( pFormatInfo->pItemSet ) { - OSL_ENSURE( !rInfo.pItemSet.get(), "Where does this ItemSet come from?" ); + OSL_ENSURE(!rInfo.pItemSet, "Where does this ItemSet come from?"); rInfo.pItemSet.reset(new SfxItemSet( *pFormatInfo->pItemSet )); } // additionally, add the hard attribute from the paragraph if( pNodeItemSet ) { - if( rInfo.pItemSet.get() ) + if (rInfo.pItemSet) rInfo.pItemSet->Put( *pNodeItemSet ); else rInfo.pItemSet.reset(new SfxItemSet( *pNodeItemSet )); @@ -591,7 +591,7 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, else aULSpaceItem.SetUpper( rHWrt.m_nHeaderFooterSpace ); - if (!rInfo.pItemSet.get()) + if (!rInfo.pItemSet) { rInfo.pItemSet.reset(new SfxItemSet(*rFormat.GetAttrSet().GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>{})); } diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index a056d8dca4d2..313e161c4573 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -2279,7 +2279,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, OSL_ENSURE( m_nRows>0 && m_nCols>0 && m_nCurrentRow==m_nRows, "Was CloseTable not called?" ); - OSL_ENSURE(m_xLayoutInfo.get() == nullptr, "Table already has layout info"); + OSL_ENSURE(m_xLayoutInfo == nullptr, "Table already has layout info"); // Calculate borders of the table and all contained tables SetBorders(); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index e86a01d70f3b..e0a92c344d8b 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -317,7 +317,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm ) INetProtocol::VndSunStarWebdav >= aTargetUrl.GetProtocol() ) ) return bRet; - if (m_pImpl->pFileNameMap.get()) + if (m_pImpl->pFileNameMap) { // has the file been moved? std::map<OUString, OUString>::iterator it = m_pImpl->pFileNameMap->find( rFileNm ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index ca6c7dc4db8f..6451b5c92377 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -4117,7 +4117,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) const NfKeywordTable & MSWordExportBase::GetNfKeywordTable() { - if (m_pKeyMap.get() == nullptr) + if (m_pKeyMap == nullptr) { m_pKeyMap.reset(new NfKeywordTable); NfKeywordTable & rKeywordTable = *m_pKeyMap; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 3435ae2e7292..d06d1de741ed 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -302,17 +302,17 @@ void SwWW8ImplReader::ReadEmbeddedData(SvStream& rStrm, SwDocShell const * pDocS xTextMark.reset(new OUString(read_uInt32_lenPrefixed_uInt16s_ToOUString(rStrm))); } - if( !xLongName.get() && xShortName.get() ) + if (!xLongName && xShortName.get()) { xLongName.reset( new OUString ); *xLongName += *xShortName; } - else if( !xLongName.get() && xTextMark.get() ) + else if (!xLongName && xTextMark.get()) xLongName.reset( new OUString ); - if( xLongName.get() ) + if (xLongName) { - if( xTextMark.get() ) + if (xTextMark) { if (xLongName->isEmpty()) *xTextMark = xTextMark->replace('!', '.'); @@ -488,7 +488,7 @@ SdrObject* SwMSDffManager::ImportOLE( sal_uInt32 nOLEId, if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg )) { tools::SvRef<SotStorage> xSrc = xSrcStg->OpenSotStorage( sStorageName ); - OSL_ENSURE(rReader.m_xFormImpl.get(), "No Form Implementation!"); + OSL_ENSURE(rReader.m_xFormImpl, "No Form Implementation!"); css::uno::Reference< css::drawing::XShape > xShape; if ( (!(rReader.m_bIsHeader || rReader.m_bIsFooter)) && rReader.m_xFormImpl->ReadOCXStream(xSrc,&xShape,true)) @@ -6252,7 +6252,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportWW2(SvStream &rStream) ErrCode WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize ) { ErrCode nRet = ERR_SWG_READ_ERROR; - OSL_ENSURE( m_pStorage.get(), "Where is my Storage?" ); + OSL_ENSURE(m_pStorage, "Where is my Storage?"); rRef = m_pStorage->OpenSotStream( "WordDocument", StreamMode::READ | StreamMode::SHARE_DENYALL); if( rRef.is() ) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 29343e0d092f..87e3ee83c78c 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -480,7 +480,7 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd, { if (!m_xTableDesc) { - OSL_ENSURE(m_xTableDesc.get(), "What!"); + OSL_ENSURE(m_xTableDesc, "What!"); bTestAllowed = false; } else @@ -3481,7 +3481,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) delete pTableWFlyPara; delete pTableSFlyPara; - return m_xTableDesc.get() != nullptr; + return m_xTableDesc != nullptr; } void SwWW8ImplReader::TabCellEnd() @@ -3522,7 +3522,7 @@ void SwWW8ImplReader::PopTableDesc() void SwWW8ImplReader::StopTable() { - OSL_ENSURE(m_xTableDesc.get(), "Panic, stop table with no table!"); + OSL_ENSURE(m_xTableDesc, "Panic, stop table with no table!"); if (!m_xTableDesc) return; @@ -3997,7 +3997,7 @@ void WW8RStyle::ScanStyles() // investigate style dependencies rSI.m_nFilePos = mpStStrm->Tell(); // remember FilePos sal_uInt16 nSkip; std::unique_ptr<WW8_STD> xStd(Read1Style(nSkip, nullptr)); // read STD - rSI.m_bValid = xStd.get() != nullptr; + rSI.m_bValid = xStd != nullptr; if (rSI.m_bValid) { rSI.m_nBase = xStd->istdBase; // remember Basis diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 4732c0c16081..8749367ac965 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -393,7 +393,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, { //Can't put them in headers/footers :-( uno::Reference< drawing::XShape > xRef; - OSL_ENSURE(m_xFormImpl.get(), "Impossible"); + OSL_ENSURE(m_xFormImpl, "Impossible"); if (m_xFormImpl && m_xFormImpl->ReadOCXStream(xSrc1, &xRef)) { pRet = GetSdrObjectFromXShape(xRef); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 0547fb105046..145daf9a60e7 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2531,7 +2531,7 @@ void SwWW8ImplReader::StopApo() { if (!m_xSFlyPara->xMainTextPos) { - OSL_ENSURE(m_xSFlyPara->xMainTextPos.get(), "StopApo: xMainTextPos is nullptr"); + OSL_ENSURE(m_xSFlyPara->xMainTextPos, "StopApo: xMainTextPos is nullptr"); return; } @@ -2573,7 +2573,7 @@ void SwWW8ImplReader::StopApo() if (rBrush.GetColor() != COL_AUTO) aBg = rBrush.GetColor(); - if (m_pLastAnchorPos.get()) + if (m_pLastAnchorPos) { //If the last anchor pos is here, then clear the anchor pos. //This "last anchor pos" is only used for fixing up the diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index b13d36bbe7b1..2487cbb0f9f9 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -643,7 +643,7 @@ bool Tcg::Read(SvStream &rS) bool Tcg::ImportCustomToolBar( SfxObjectShell& rDocSh ) { - if ( tcg.get() ) + if (tcg) return tcg->ImportCustomToolBar( rDocSh ); return false; } diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 99bba3d0d05b..24073bd25a03 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -312,7 +312,7 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) XMLTextParagraphExport* SwXMLExport::CreateTextParagraphExport() { - return new SwXMLTextParagraphExport( *this, *GetAutoStylePool().get() ); + return new SwXMLTextParagraphExport(*this, *GetAutoStylePool()); } XMLShapeExport* SwXMLExport::CreateShapeExport() diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index f49b4c259c1a..2c13bf47dc32 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -243,7 +243,7 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet) NewStartHdl_Impl(*m_xNewStartCB); m_xNewStartNF->save_value(); m_xNewStartNumberCB->save_state(); - StyleHdl_Impl(*m_xNumberStyleLB.get()); + StyleHdl_Impl(*m_xNumberStyleLB); if( SfxItemState::DEFAULT <= rSet->GetItemState(RES_LINENUMBER)) { const SwFormatLineNumber& rNum = rSet->Get(RES_LINENUMBER); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index db55f59555ae..008aa7869990 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1469,8 +1469,7 @@ void SwInsertSectionTabDialog::SetSectionData(SwSectionData const& rSect) short SwInsertSectionTabDialog::Ok() { short nRet = SfxTabDialog::Ok(); - OSL_ENSURE(m_pSectionData.get(), - "SwInsertSectionTabDialog: no SectionData?"); + OSL_ENSURE(m_pSectionData, "SwInsertSectionTabDialog: no SectionData?"); const SfxItemSet* pOutputItemSet = GetOutputItemSet(); rWrtSh.InsertSection(*m_pSectionData, pOutputItemSet); SfxViewFrame* pViewFrame = rWrtSh.GetView().GetViewFrame(); diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index d1410e668abd..1ccc19651629 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1353,7 +1353,7 @@ OUString SwDocShell::GetEventName( sal_Int32 nIndex ) const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const { - return m_xDoc.get() ? &m_xDoc->GetXmlIdRegistry() : nullptr; + return m_xDoc ? &m_xDoc->GetXmlIdRegistry() : nullptr; } bool SwDocShell::IsChangeRecording() const diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index a2df020257fd..283406ea6ed0 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -202,7 +202,8 @@ void SwDocShell::ToggleLayoutMode(SwView* pView) // update text fields on document properties changes void SwDocShell::DoFlushDocInfo() { - if (!m_xDoc.get()) return; + if (!m_xDoc) + return; bool bUnlockView(true); if (m_pWrtShell) @@ -246,7 +247,7 @@ static void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVB // Notification on DocInfo changes void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - if (!m_xDoc.get()) + if (!m_xDoc) { return ; } diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index be850b70611c..76a2acdba069 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -377,7 +377,7 @@ SwDocShell::SwDocShell( SwDoc *const pD, SfxObjectCreateMode const eMode ) SwDocShell::~SwDocShell() { // disable chart related objects now because in ~SwDoc it may be to late for this - if (m_xDoc.get()) + if (m_xDoc) { m_xDoc->getIDocumentChartDataProviderAccess().GetChartControllerHelper().Disconnect(); SwChartDataProvider *pPCD = m_xDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); @@ -411,7 +411,7 @@ void SwDocShell::Init_Impl() void SwDocShell::AddLink() { - if (!m_xDoc.get()) + if (!m_xDoc) { SwDocFac aFactory; m_xDoc = aFactory.GetDoc(); @@ -433,8 +433,8 @@ void SwDocShell::UpdateFontList() if (!m_IsInUpdateFontList) { m_IsInUpdateFontList = true; - OSL_ENSURE(m_xDoc.get(), "No Doc no FontList"); - if (m_xDoc.get()) + OSL_ENSURE(m_xDoc, "No Doc no FontList"); + if (m_xDoc) { m_pFontList.reset( new FontList( m_xDoc->getIDocumentDeviceAccess().getReferenceDevice(true) ) ); PutItem( SvxFontListItem( m_pFontList.get(), SID_ATTR_CHAR_FONTLIST ) ); @@ -448,7 +448,7 @@ void SwDocShell::RemoveLink() // disconnect Uno-Object uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); static_cast<SwXTextDocument*>(xDoc.get())->Invalidate(); - if (m_xDoc.get()) + if (m_xDoc) { if (m_xBasePool.is()) { @@ -484,7 +484,7 @@ bool SwDocShell::Load( SfxMedium& rMedium ) rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false); SAL_INFO( "sw.ui", "after SfxInPlaceObject::Load" ); - if (m_xDoc.get()) // for last version!! + if (m_xDoc) // for last version!! RemoveLink(); // release the existing AddLink(); // set Link and update Data!! @@ -570,7 +570,8 @@ bool SwDocShell::Load( SfxMedium& rMedium ) } UpdateFontList(); - InitDrawModelAndDocShell(this, m_xDoc.get() ? m_xDoc->getIDocumentDrawModelAccess().GetDrawModel() : nullptr); + InitDrawModelAndDocShell(this, m_xDoc ? m_xDoc->getIDocumentDrawModelAccess().GetDrawModel() + : nullptr); SetError(nErr); bRet = !nErr.IsError(); @@ -591,7 +592,7 @@ bool SwDocShell::Load( SfxMedium& rMedium ) bool SwDocShell::LoadFrom( SfxMedium& rMedium ) { bool bRet = false; - if (m_xDoc.get()) + if (m_xDoc) RemoveLink(); AddLink(); // set Link and update Data!! diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index ba4b554f935d..47f65f43f774 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -630,7 +630,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void) pView->InvalidateRulerPos(); if( m_bNew ) - m_xBasePool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *m_xTmp.get() ) ); + m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *m_xTmp)); pDoc->getIDocumentState().SetModified(); if( !m_bModified ) @@ -884,7 +884,7 @@ void SwDocShell::Edit( m_pView->InvalidateRulerPos(); if( bNew ) - m_xBasePool->Broadcast( SfxStyleSheetHint( SfxHintId::StyleSheetCreated, *xTmp.get() ) ); + m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *xTmp)); m_xDoc->getIDocumentState().SetModified(); if( !bModified ) // Bug 57028 diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index fc4fec6896a8..7bd4c97ac1cf 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -2415,7 +2415,7 @@ SfxStyleSheetBase& SwDocStyleSheetPool::Make( const OUString& rName, mxStyleSheet->SetPhysical(true); mxStyleSheet->Create(); - return *mxStyleSheet.get(); + return *mxStyleSheet; } SfxStyleSheetBase* SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOrg*/) diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx index 33adb20335ab..59e95d141295 100644 --- a/sw/source/uibase/app/swdll.cxx +++ b/sw/source/uibase/app/swdll.cxx @@ -168,7 +168,7 @@ SwDLL::~SwDLL() COVERITY_NOEXCEPT_FALSE sw::Filters & SwDLL::getFilters() { assert(filters_); - return *filters_.get(); + return *filters_; } #ifndef DISABLE_DYNLOADING diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index e0f25330ddd4..516f50074e07 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -173,7 +173,7 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void ) { SwSectionData* pSect = static_cast<SwSectionData*>(p); std::unique_ptr<SwSectionData> xSectionData(pSect); - if (!xSectionData.get()) + if (!xSectionData) return; SfxItemSet aSet( diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx index f6fc2e693271..40bee0951c16 100644 --- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx @@ -117,9 +117,9 @@ IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify&, rNotify, void) { std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( &rNotify ) ); - if( aHint.get() ) + if (aHint) { - Broadcast( *aHint.get() ); + Broadcast(*aHint); } } diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx index 5adc7629a37c..30365661e9be 100644 --- a/sw/source/uibase/misc/glosdoc.cxx +++ b/sw/source/uibase/misc/glosdoc.cxx @@ -611,7 +611,7 @@ Reference< text::XAutoTextEntry > SwGlossaries::GetAutoTextEntry( bool bCreate = ( rCompleteGroupName == GetDefName() ); std::unique_ptr< SwTextBlocks > pGlosGroup( GetGroupDoc( rCompleteGroupName, bCreate ) ); - if ( !pGlosGroup.get() || pGlosGroup->GetError() ) + if (!pGlosGroup || pGlosGroup->GetError()) throw lang::WrappedTargetException(); sal_uInt16 nIdx = pGlosGroup->GetIndex( rEntryName ); diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx index 3ecf385bd9f3..93df8a6694a2 100644 --- a/sw/source/uibase/shells/txtcrsr.cxx +++ b/sw/source/uibase/shells/txtcrsr.cxx @@ -330,7 +330,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) std::unique_ptr< svx::ISdrObjectFilter > pFilter( FmFormShell::CreateFocusableControlFilter( *pDrawView, *pWindow ) ); - if ( !pFilter.get() ) + if (!pFilter) break; const SdrObject* pNearestControl = rSh.GetBestObject( true, GotoObjFlags::DrawControl, false, pFilter.get() ); diff --git a/sw/source/uibase/wrtsh/navmgr.cxx b/sw/source/uibase/wrtsh/navmgr.cxx index 39c718e6f726..e2adc872ebbe 100644 --- a/sw/source/uibase/wrtsh/navmgr.cxx +++ b/sw/source/uibase/wrtsh/navmgr.cxx @@ -51,7 +51,7 @@ SwNavigationMgr::~SwNavigationMgr() SolarMutexGuard g; for (auto & it : m_entries) { - EndListening(it.get()->m_aNotifier); + EndListening(it->m_aNotifier); } m_entries.clear(); } @@ -64,7 +64,7 @@ void SwNavigationMgr::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { for (auto it = m_entries.begin(); it != m_entries.end(); ++it) { - if (!it->get() || & rBC == & it->get()->m_aNotifier) + if (!*it || &rBC == &it->get()->m_aNotifier) { EndListening(rBC); m_entries.erase(it); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index f97a0daf62ad..8d5bc9902f84 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1729,7 +1729,7 @@ OUString SwWrtShell::GetSelDescr() const } break; default: - if (mxDoc.get()) + if (mxDoc) aResult = GetCursorDescr(); } diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index c8a5acdd8ae9..9f7edd97a369 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -552,7 +552,8 @@ void lcl_clear( STLCONTAINER& i_container ) // get predicate object ::std::unique_ptr< ::comphelper::IKeyPredicateLess > const pPredicate( ::comphelper::getStandardLessPredicate( dataType, m_collator ) ); - ENSURE_OR_RETURN_FALSE( pPredicate.get(), "SortableGridDataModel::impl_reIndex_nothrow: no sortable data found!" ); + ENSURE_OR_RETURN_FALSE( + pPredicate, "SortableGridDataModel::impl_reIndex_nothrow: no sortable data found!"); // then sort CellDataLessComparison const aComparator( aColumnData, *pPredicate, i_sortAscending ); diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 69aaa59d3d19..e27ec6da790e 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -1312,7 +1312,7 @@ void UnoControlModel::setPropertyValues( const css::uno::Sequence< OUString >& r { if ( ( pHandles[n] >= BASEPROPERTY_FONTDESCRIPTORPART_START ) && ( pHandles[n] <= BASEPROPERTY_FONTDESCRIPTORPART_END ) ) { - if ( !pFD.get() ) + if (!pFD) { css::uno::Any* pProp = &maData[ BASEPROPERTY_FONTDESCRIPTOR ]; pFD.reset( new awt::FontDescriptor ); @@ -1339,7 +1339,7 @@ void UnoControlModel::setPropertyValues( const css::uno::Sequence< OUString >& r // same as a few lines above // Don't merge FD property into array, as it is sorted - if ( pFD.get() ) + if (pFD) { css::uno::Any aValue; aValue <<= *pFD; diff --git a/toolkit/source/helper/accessibilityclient.cxx b/toolkit/source/helper/accessibilityclient.cxx index ec866fbc6a93..bc7ed5db956b 100644 --- a/toolkit/source/helper/accessibilityclient.cxx +++ b/toolkit/source/helper/accessibilityclient.cxx @@ -159,7 +159,7 @@ namespace toolkit #if HAVE_FEATURE_DESKTOP // load the library implementing the factory - if ( !s_pFactory.get() ) + if (!s_pFactory) { #ifndef DISABLE_DYNLOADING const OUString sModuleName( SVLIBRARY( "acc" ) ); @@ -191,7 +191,7 @@ namespace toolkit } #endif // HAVE_FEATURE_DESKTOP - if ( !s_pFactory.get() ) + if (!s_pFactory) // the attempt to load the lib, or to create the factory, failed // -> fall back to a dummy factory s_pFactory = new AccessibleDummyFactory; diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 3d790c70b11e..d0399e6f7a39 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -268,7 +268,7 @@ namespace toolkitform Reference< XPropertySet > xModelProps( _rxControl->getModel(), UNO_QUERY ); sal_Int16 nControlType = classifyFormControl( xModelProps ); Descriptor.reset( createDefaultWidget( nControlType ) ); - if ( !Descriptor.get() ) + if (!Descriptor) // no PDF widget available for this return Descriptor; diff --git a/ucb/source/ucp/cmis/std_inputstream.cxx b/ucb/source/ucp/cmis/std_inputstream.cxx index 2130c3406995..d135d981e9e8 100644 --- a/ucb/source/ucp/cmis/std_inputstream.cxx +++ b/ucb/source/ucp/cmis/std_inputstream.cxx @@ -24,7 +24,7 @@ namespace cmis m_pStream( pStream ), m_nLength( 0 ) { - if ( m_pStream.get() ) + if (m_pStream) { streampos nInitPos = m_pStream->tellg( ); m_pStream->seekg( 0, ios_base::end ); @@ -65,7 +65,7 @@ namespace cmis if ( 0 <= nBytesToRead && aData.getLength() < nBytesToRead ) aData.realloc( nBytesToRead ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); sal_Int32 nRead = 0; @@ -91,7 +91,7 @@ namespace cmis if ( 0 <= nMaxBytesToRead && aData.getLength() < nMaxBytesToRead ) aData.realloc( nMaxBytesToRead ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); sal_Int32 nRead = 0; @@ -111,7 +111,7 @@ namespace cmis { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); try @@ -144,7 +144,7 @@ namespace cmis "Location can't be negative or greater than the length", static_cast< cppu::OWeakObject* >( this ), 0 ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); try @@ -163,7 +163,7 @@ namespace cmis { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); sal_Int64 nPos = m_pStream->tellg( ); diff --git a/ucb/source/ucp/cmis/std_outputstream.cxx b/ucb/source/ucp/cmis/std_outputstream.cxx index a2a1eeb3a1f2..ea8c6d12d1ca 100644 --- a/ucb/source/ucp/cmis/std_outputstream.cxx +++ b/ucb/source/ucp/cmis/std_outputstream.cxx @@ -26,7 +26,7 @@ namespace cmis StdOutputStream::~StdOutputStream() { - if ( m_pStream.get( ) ) + if (m_pStream) m_pStream->setstate( ios::eofbit ); } @@ -51,7 +51,7 @@ namespace cmis { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); try @@ -69,7 +69,7 @@ namespace cmis { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); try @@ -87,7 +87,7 @@ namespace cmis { osl::MutexGuard aGuard( m_aMutex ); - if ( !m_pStream.get() ) + if (!m_pStream) throw io::IOException( ); m_pStream->setstate( ios_base::eofbit ); diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index de5b76226274..8f651edff0ab 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -157,13 +157,10 @@ ContentProperties::ContentProperties() { } - -ContentProperties::ContentProperties( const ContentProperties & rOther ) -: m_aEscapedTitle( rOther.m_aEscapedTitle ), - m_xProps( rOther.m_xProps.get() - ? new PropertyValueMap( *rOther.m_xProps ) - : new PropertyValueMap ), - m_bTrailingSlash( rOther.m_bTrailingSlash ) +ContentProperties::ContentProperties(const ContentProperties& rOther) + : m_aEscapedTitle(rOther.m_aEscapedTitle) + , m_xProps(rOther.m_xProps ? new PropertyValueMap(*rOther.m_xProps) : new PropertyValueMap) + , m_bTrailingSlash(rOther.m_bTrailingSlash) { } diff --git a/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx b/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx index 13eda808ee31..060fcb8984d5 100644 --- a/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx +++ b/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx @@ -49,7 +49,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( m_xContext = rxContext; - if ( !m_xProxyDecider.get() ) + if (!m_xProxyDecider) m_xProxyDecider.reset( new ucbhelper::InternetProxyDecider( rxContext ) ); Map::iterator aIt( m_aMap.begin() ); @@ -67,8 +67,8 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( { NeonUri aURI( inUri ); - std::unique_ptr< DAVSession > xElement( - new NeonSession( this, inUri, rFlags, *m_xProxyDecider.get() ) ); + std::unique_ptr<DAVSession> xElement( + new NeonSession(this, inUri, rFlags, *m_xProxyDecider)); aIt = m_aMap.emplace( inUri, xElement.get() ).first; aIt->second->m_aContainerIt = aIt; @@ -91,7 +91,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( // call a little: NeonUri aURI( inUri ); - aIt->second = new NeonSession( this, inUri, rFlags, *m_xProxyDecider.get() ); + aIt->second = new NeonSession(this, inUri, rFlags, *m_xProxyDecider); aIt->second->m_aContainerIt = aIt; return aIt->second; } diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index e386f1bd435d..39af4be04001 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -196,7 +196,7 @@ namespace } } - if ( xProps.get() ) + if (xProps) xProps->addProperties( rProps, ContentProperties( aResource ) ); @@ -607,7 +607,7 @@ uno::Any SAL_CALL Content::execute( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() ); // clean cached value of PROPFIND property names @@ -615,7 +615,7 @@ uno::Any SAL_CALL Content::execute( xResAccess->DESTROY( Environment ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } catch ( DAVException const & e ) @@ -809,12 +809,12 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } xResAccess->abort(); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } catch ( DAVException const & ) @@ -891,7 +891,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg, std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() ); // clean cached value of PROPFIND property names @@ -900,7 +900,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg, xResAccess->PROPPATCH( aProppatchValues, xEnv ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } // Notify propertyset info change listeners. @@ -981,7 +981,7 @@ void Content::removeProperty( const OUString& Name, std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() ); // clean cached value of PROPFIND property names @@ -990,7 +990,7 @@ void Content::removeProperty( const OUString& Name, xResAccess->PROPPATCH( aProppatchValues, xEnv ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } // Notify propertyset info change listeners. @@ -1334,12 +1334,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aUnescapedTitle = NeonUri::unescape( m_aEscapedTitle ); xIdentifier.set( m_xIdentifier ); xProvider.set( m_xProvider.get() ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); // First, ask cache... - if ( m_xCachedProps.get() ) + if (m_xCachedProps) { - xCachedProps.reset( new ContentProperties( *m_xCachedProps.get() ) ); + xCachedProps.reset(new ContentProperties(*m_xCachedProps)); std::vector< OUString > aMissingProps; if ( xCachedProps->containsAllNames( rProperties, aMissingProps ) ) @@ -1349,7 +1349,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } // use the cached ContentProperties instance - xProps.reset( new ContentProperties( *xCachedProps.get() ) ); + xProps.reset(new ContentProperties(*xCachedProps)); } } @@ -1368,10 +1368,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { // cache lookup... getResourceType may fill the props cache via // PROPFIND! - if ( m_xCachedProps.get() ) + if (m_xCachedProps) { - xCachedProps.reset( - new ContentProperties( *m_xCachedProps.get() ) ); + xCachedProps.reset(new ContentProperties(*m_xCachedProps)); std::vector< OUString > aMissingProps; if ( xCachedProps->containsAllNames( @@ -1383,7 +1382,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } // use the cached ContentProperties instance - xProps.reset( new ContentProperties( *xCachedProps.get() ) ); + xProps.reset(new ContentProperties(*xCachedProps)); } if ( !bHasAll ) @@ -1479,7 +1478,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } } #endif - if ( xProps.get()) + if (xProps) xProps->addProperties( aPropNames, ContentProperties( resources[ 0 ] )); @@ -1534,7 +1533,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( GetPropsUsingHeadRequest(resource, xResAccess, aHeaderNames, xEnv); m_bDidGetOrHead = true; - if (xProps.get()) + if (xProps) xProps->addProperties( aMissingProps, ContentProperties(resource)); @@ -1641,7 +1640,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } else { - if ( !xProps.get() ) + if (!xProps) xProps.reset( new ContentProperties( aUnescapedTitle, false ) ); else xProps->addProperty( @@ -1746,12 +1745,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - if ( !m_xCachedProps.get() ) - m_xCachedProps.reset( new CachableContentProperties( *xProps.get() ) ); + if (!m_xCachedProps) + m_xCachedProps.reset(new CachableContentProperties(*xProps)); else - m_xCachedProps->addProperties( *xProps.get() ); + m_xCachedProps->addProperties(*xProps); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); m_aEscapedTitle = NeonUri::escapeSegment( aUnescapedTitle ); } @@ -1774,7 +1773,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( xProvider.set( m_pProvider ); xIdentifier.set( m_xIdentifier ); bTransient = m_bTransient; - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } uno::Sequence< uno::Any > aRet( rValues.getLength() ); @@ -2150,7 +2149,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } return aRet; @@ -2232,8 +2231,7 @@ uno::Any Content::open( { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( - new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } xResAccess->setFlags( rArg.OpeningFlags ); @@ -2248,14 +2246,13 @@ uno::Any Content::open( osl::MutexGuard aGuard( m_aMutex ); // cache headers. - if ( !m_xCachedProps.get()) + if (!m_xCachedProps) m_xCachedProps.reset( new CachableContentProperties( ContentProperties( aResource ) ) ); else m_xCachedProps->addProperties( ContentProperties( aResource ) ); - m_xResAccess.reset( - new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } catch ( DAVException const & e ) @@ -2277,8 +2274,7 @@ uno::Any Content::open( { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( - new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } xResAccess->setFlags( rArg.OpeningFlags ); @@ -2312,15 +2308,14 @@ uno::Any Content::open( osl::MutexGuard aGuard( m_aMutex ); // cache headers. - if ( !m_xCachedProps.get()) + if (!m_xCachedProps) m_xCachedProps.reset( new CachableContentProperties( ContentProperties( aResource ) ) ); else m_xCachedProps->addProperties( aResource.properties ); - m_xResAccess.reset( - new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } xDataSink->setInputStream( xIn ); @@ -2364,8 +2359,7 @@ void Content::post( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( - new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } removeCachedPropertyNames( xResAccess->getURL() ); @@ -2377,8 +2371,7 @@ void Content::post( { osl::MutexGuard aGuard( m_aMutex ); - m_xResAccess.reset( - new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } xSink->setInputStream( xResult ); @@ -2399,8 +2392,7 @@ void Content::post( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( - new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } removeCachedPropertyNames( xResAccess->getURL() ); @@ -2412,8 +2404,7 @@ void Content::post( { osl::MutexGuard aGuard( m_aMutex ); - m_xResAccess.reset( - new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } catch ( DAVException const & e ) @@ -2502,7 +2493,7 @@ void Content::insert( bTransient = m_bTransient; bCollection = m_bCollection; aEscapedTitle = m_aEscapedTitle; - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } // Check, if all required properties are present. @@ -2664,8 +2655,7 @@ void Content::insert( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( - new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } // Success! @@ -2744,7 +2734,7 @@ void Content::insert( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } @@ -2762,7 +2752,7 @@ void Content::transfer( xIdentifier.set( m_xIdentifier ); xProvider.set( m_xProvider.get() ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } NeonUri sourceURI( rArgs.SourceURL ); @@ -2998,7 +2988,7 @@ void Content::transfer( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } @@ -3037,7 +3027,7 @@ Content::ResourceType Content::resourceTypeForLocks( osl::MutexGuard g(m_aMutex); //check if cache contains what we need, usually the first PROPFIND on the URI has supported lock std::unique_ptr< ContentProperties > xProps; - if ( m_xCachedProps.get() ) + if (m_xCachedProps) { uno::Sequence< ucb::LockEntry > aSupportedLocks; if ( m_xCachedProps->getValue( DAVProperties::SUPPORTEDLOCK ) @@ -3143,7 +3133,7 @@ Content::ResourceType Content::resourceTypeForLocks( // which supposedly means no lock for the resource (happens e.g. with SharePoint exported lists) OUString sContentDisposition; // First, check cached properties - if (m_xCachedProps.get()) + if (m_xCachedProps) { if ((m_xCachedProps->getValue("Content-Disposition") >>= sContentDisposition) && sContentDisposition.startsWithIgnoreAsciiCase("attachment")) @@ -3249,12 +3239,12 @@ Content::ResourceType Content::resourceTypeForLocks( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } Content::ResourceType ret = resourceTypeForLocks( Environment, xResAccess ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } return ret; } @@ -3282,7 +3272,7 @@ void Content::lock( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } uno::Any aOwnerAny; @@ -3305,7 +3295,7 @@ void Content::lock( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } catch ( DAVException const & e ) @@ -3415,7 +3405,7 @@ void Content::unlock( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } // check if the target URL is a Class1 DAV @@ -3435,7 +3425,7 @@ void Content::unlock( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } } catch ( DAVException const & e ) @@ -3763,7 +3753,7 @@ Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess ) osl::Guard< osl::Mutex > aGuard( m_aMutex ); // First, try to obtain value of response header "Content-Location". - if ( m_xCachedProps.get() ) + if (m_xCachedProps) { OUString aLocation; m_xCachedProps->getValue( "Content-Location" ) >>= aLocation; @@ -3976,12 +3966,12 @@ Content::ResourceType Content::getResourceType( std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); } Content::ResourceType const ret = getResourceType( xEnv, xResAccess ); { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + m_xResAccess.reset(new DAVResourceAccess(*xResAccess)); } return ret; } diff --git a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx index 38b840bcbc15..faf6c742ac3e 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx @@ -304,10 +304,9 @@ uno::Sequence< beans::Property > Content::getProperties( osl::Guard< osl::Mutex > aGuard( m_aMutex ); bTransient = m_bTransient; - xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); - if ( m_xCachedProps.get() ) - xCachedProps.reset( - new ContentProperties( *m_xCachedProps.get() ) ); + xResAccess.reset(new DAVResourceAccess(*m_xResAccess)); + if (m_xCachedProps) + xCachedProps.reset(new ContentProperties(*m_xCachedProps)); xProvider.set( m_pProvider ); } @@ -494,7 +493,7 @@ uno::Sequence< beans::Property > Content::getProperties( "CreatableContentsInfo" ) ); // Add cached properties, if present and still missing. - if ( xCachedProps.get() ) + if (xCachedProps) { const std::set< OUString >::const_iterator set_end = aPropSet.end(); diff --git a/unoidl/source/sourcefileprovider.cxx b/unoidl/source/sourcefileprovider.cxx index ba46df1b0f3c..5845dbbc0115 100644 --- a/unoidl/source/sourcefileprovider.cxx +++ b/unoidl/source/sourcefileprovider.cxx @@ -94,7 +94,7 @@ SourceFileProvider::SourceFileProvider( if (k == map->end()) { k = map->insert(std::make_pair(id, new Module)).first; } - Module& mod = dynamic_cast<Module&>(*k->second.get()); + Module& mod = dynamic_cast<Module&>(*k->second); map = &mod.map; } } diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index 04c75fcf84d4..ec7a3fbe7e4f 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -178,8 +178,7 @@ void checkMap( ->createCursor()), ignoreUnpublished); } else { - bool pubA = dynamic_cast<unoidl::PublishableEntity &>(*entA.get()) - .isPublished(); + bool pubA = dynamic_cast<unoidl::PublishableEntity&>(*entA).isPublished(); if (!pubA && ignoreUnpublished) { continue; } @@ -196,9 +195,7 @@ void checkMap( << std::endl; std::exit(EXIT_FAILURE); } - if (pubA - && (!dynamic_cast<unoidl::PublishableEntity &>(*entB.get()) - .isPublished())) + if (pubA && (!dynamic_cast<unoidl::PublishableEntity&>(*entB).isPublished())) { std::cerr << "A published entity " << name << " is not published in B" diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx index b1124549878e..22f214dbf384 100644 --- a/unoxml/source/dom/attr.cxx +++ b/unoxml/source/dom/attr.cxx @@ -47,7 +47,8 @@ namespace DOM xmlNsPtr CAttr::GetNamespace(xmlNodePtr const pNode) { - if (!m_pNamespace.get()) { + if (!m_pNamespace) + { return nullptr; } xmlChar const*const pUri(reinterpret_cast<xmlChar const*>( @@ -217,11 +218,14 @@ namespace DOM if (!m_aNodePtr) { return; } - if (m_pNamespace.get()) { + if (m_pNamespace) + { OSL_ASSERT(!m_aNodePtr->parent); m_pNamespace->second = OUStringToOString(prefix, RTL_TEXTENCODING_UTF8); - } else { + } + else + { CNode::setPrefix(prefix); } } @@ -232,12 +236,15 @@ namespace DOM if (!m_aNodePtr) { return OUString(); } - if (m_pNamespace.get()) { + if (m_pNamespace) + { OSL_ASSERT(!m_aNodePtr->parent); OUString const ret(OStringToOUString( m_pNamespace->second, RTL_TEXTENCODING_UTF8)); return ret; - } else { + } + else + { return CNode::getPrefix(); } } @@ -248,12 +255,15 @@ namespace DOM if (!m_aNodePtr) { return OUString(); } - if (m_pNamespace.get()) { + if (m_pNamespace) + { OSL_ASSERT(!m_aNodePtr->parent); OUString const ret(OStringToOUString( m_pNamespace->first, RTL_TEXTENCODING_UTF8)); return ret; - } else { + } + else + { return CNode::getNamespaceURI(); } } diff --git a/vcl/opengl/PackedTextureAtlas.cxx b/vcl/opengl/PackedTextureAtlas.cxx index 98cffcd78b37..0e3bdc5f1d5c 100644 --- a/vcl/opengl/PackedTextureAtlas.cxx +++ b/vcl/opengl/PackedTextureAtlas.cxx @@ -46,11 +46,7 @@ Node::Node(tools::Rectangle const & aRectangle) , mOccupied(false) {} -bool Node::isLeaf() -{ - return mLeftNode.get() == nullptr && - mRightNode.get() == nullptr; -} +bool Node::isLeaf() { return mLeftNode == nullptr && mRightNode == nullptr; } Node* Node::insert(int nWidth, int nHeight, int nPadding) { diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 5c35e8e41265..8a07f5ceb4a5 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -302,7 +302,7 @@ bool OpenGLSalBitmap::AllocateUserData() } #endif - return mpUserBuffer.get() != nullptr; + return mpUserBuffer != nullptr; } namespace { @@ -486,7 +486,7 @@ GLuint OpenGLSalBitmap::CreateTexture() sal_uInt8* pData( nullptr ); bool bAllocated( false ); - if (mpUserBuffer.get() != nullptr) + if (mpUserBuffer != nullptr) { if( mnBits == 16 || mnBits == 24 || mnBits == 32 ) { diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index ab56a35c0de7..7c1192eda24b 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -245,7 +245,7 @@ static void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputS else rContext.pScopedAccess.reset(new BitmapScopedWriteAccess(pJPEGReader->GetBitmap())); - BitmapScopedWriteAccess& pAccess = bUseExistingBitmap ? *ppAccess : *rContext.pScopedAccess.get(); + BitmapScopedWriteAccess& pAccess = bUseExistingBitmap ? *ppAccess : *rContext.pScopedAccess; if (pAccess) { diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index ed683138b9de..e92c06b4573a 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -46,7 +46,8 @@ GfxLink::GfxLink(std::unique_ptr<sal_uInt8[]> pBuf, sal_uInt32 nSize, GfxLinkTyp , mbPrefMapModeValid(false) , mbPrefSizeValid(false) { - SAL_WARN_IF(mpSwapInData.get() == nullptr || mnSwapInDataSize <= 0, "vcl", "GfxLink::GfxLink(): empty/NULL buffer given"); + SAL_WARN_IF(mpSwapInData == nullptr || mnSwapInDataSize <= 0, "vcl", + "GfxLink::GfxLink(): empty/NULL buffer given"); } bool GfxLink::operator==( const GfxLink& rGfxLink ) const diff --git a/vcl/source/graphic/UnoGraphicObject.cxx b/vcl/source/graphic/UnoGraphicObject.cxx index 81a9d83edf8c..fa03a52813bc 100644 --- a/vcl/source/graphic/UnoGraphicObject.cxx +++ b/vcl/source/graphic/UnoGraphicObject.cxx @@ -74,7 +74,7 @@ uno::Reference<graphic::XGraphic> SAL_CALL GraphicObjectImpl::getGraphic() { osl::MutexGuard aGuard(m_aMutex); - if (!mpGraphicObject.get()) + if (!mpGraphicObject) throw uno::RuntimeException(); return mpGraphicObject->GetGraphic().GetXGraphic(); } @@ -83,7 +83,7 @@ void SAL_CALL GraphicObjectImpl::setGraphic(uno::Reference<graphic::XGraphic> co { osl::MutexGuard aGuard(m_aMutex); - if (!mpGraphicObject.get()) + if (!mpGraphicObject) throw uno::RuntimeException(); Graphic aGraphic(rxGraphic); mpGraphicObject->SetGraphic(aGraphic); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 3c1c0aac5f27..247a465f23b7 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3181,7 +3181,7 @@ LOKWindowsMap& GetLOKWindowsMap() if (!s_pLOKWindowsMap) s_pLOKWindowsMap.reset(new LOKWindowsMap); - return *s_pLOKWindowsMap.get(); + return *s_pLOKWindowsMap; } } diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx index 56d2a2217ea9..0855ebd117ea 100644 --- a/vcl/unx/generic/dtrans/X11_clipboard.cxx +++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx @@ -65,12 +65,12 @@ X11Clipboard::create( SelectionManager& rManager, Atom aSelection ) rtl::Reference<X11Clipboard> cb(new X11Clipboard(rManager, aSelection)); if( aSelection != None ) { - rManager.registerHandler( aSelection, *cb.get() ); + rManager.registerHandler(aSelection, *cb); } else { - rManager.registerHandler( XA_PRIMARY, *cb.get() ); - rManager.registerHandler( rManager.getAtom( "CLIPBOARD" ), *cb.get() ); + rManager.registerHandler(XA_PRIMARY, *cb); + rManager.registerHandler(rManager.getAtom("CLIPBOARD"), *cb); } return cb.get(); } diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index ef0a422f19b2..ae6b0c152c42 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -80,21 +80,21 @@ void X11SalGraphics::CopyScreenArea( Display* pDisplay, void X11SalGraphics::FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) { - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl.get()); + X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); rImpl.FillPixmapFromScreen( pPixmap, nX, nY ); } bool X11SalGraphics::RenderPixmapToScreen( X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY ) { SAL_INFO( "vcl", "RenderPixmapToScreen" ); - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl.get()); + X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); return rImpl.RenderPixmapToScreen( pPixmap, pMask, nX, nY ); } bool X11SalGraphics::TryRenderCachedNativeControl(ControlCacheKey& rControlCacheKey, int nX, int nY) { SAL_INFO( "vcl", "TryRenderCachedNativeControl" ); - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl.get()); + X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); return rImpl.TryRenderCachedNativeControl(rControlCacheKey, nX, nY); } @@ -102,7 +102,7 @@ bool X11SalGraphics::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X11Pixmap* ControlCacheKey& rControlCacheKey) { SAL_INFO( "vcl", "RenderAndCachePixmap" ); - X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl.get()); + X11GraphicsImpl& rImpl = dynamic_cast<X11GraphicsImpl&>(*mxImpl); return rImpl.RenderAndCacheNativeControl(pPixmap, pMask, nX, nY, rControlCacheKey); } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 3a0140f2646e..5310d933ea00 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3699,14 +3699,14 @@ StyleSheetTablePtr const & DomainMapper::GetStyleSheetTable( ) GraphicZOrderHelper* DomainMapper::graphicZOrderHelper() { - if( zOrderHelper.get() == nullptr ) + if (zOrderHelper == nullptr) zOrderHelper.reset( new GraphicZOrderHelper ); return zOrderHelper.get(); } GraphicNamingHelper& DomainMapper::GetGraphicNamingHelper() { - if (m_pGraphicNamingHelper.get() == nullptr) + if (m_pGraphicNamingHelper == nullptr) m_pGraphicNamingHelper.reset(new GraphicNamingHelper()); return *m_pGraphicNamingHelper; } diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index cf3d5e62df01..01c7f59fc314 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -951,7 +951,7 @@ css::uno::Sequence<css::beans::PropertyValues> DomainMapperTableHandler::endTabl #ifdef DEBUG_WRITERFILTER TagLogger::getInstance().startElement("rowProps.row"); #endif - if( rRow.get() ) + if (rRow) { //set default to 'break across pages" rRow->Insert( PROP_IS_SPLIT_ALLOWED, uno::makeAny(true ), false ); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index fb02feccd3cd..2d5605a271dc 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -197,7 +197,7 @@ sal_Int16 ListLevel::GetParentNumbering( const OUString& sText, sal_Int16 nLevel uno::Sequence<beans::PropertyValue> ListLevel::GetProperties(bool bDefaults) { uno::Sequence<beans::PropertyValue> aLevelProps = GetLevelProperties(bDefaults); - if ( m_pParaStyle.get( ) ) + if (m_pParaStyle) AddParaProperties( &aLevelProps ); return aLevelProps; } diff --git a/writerperfect/qa/unit/DirectoryStreamTest.cxx b/writerperfect/qa/unit/DirectoryStreamTest.cxx index 8584184cfaad..7c48e49b48e4 100644 --- a/writerperfect/qa/unit/DirectoryStreamTest.cxx +++ b/writerperfect/qa/unit/DirectoryStreamTest.cxx @@ -141,7 +141,7 @@ void DirectoryStreamTest::testStructuredOperations() unique_ptr<DirectoryStream> pDir(DirectoryStream::createForParent(m_xFile)); CPPUNIT_ASSERT(bool(pDir)); - lcl_testStructuredOperations(*pDir.get()); + lcl_testStructuredOperations(*pDir); } CPPUNIT_TEST_SUITE_REGISTRATION(DirectoryStreamTest); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 0fe3f44b9d8e..7c8aa03b302b 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3496,13 +3496,12 @@ void SchXMLExportHelper_Impl::exportText( const OUString& rText ) // class SchXMLExport -SchXMLExport::SchXMLExport( - const Reference< uno::XComponentContext >& xContext, - OUString const & implementationName, SvXMLExportFlags nExportFlags ) -: SvXMLExport( util::MeasureUnit::CM, xContext, implementationName, - ::xmloff::token::XML_CHART, nExportFlags ), - maAutoStylePool( new SchXMLAutoStylePoolP(*this) ), - maExportHelper( new SchXMLExportHelper(*this, *maAutoStylePool.get()) ) +SchXMLExport::SchXMLExport(const Reference<uno::XComponentContext>& xContext, + OUString const& implementationName, SvXMLExportFlags nExportFlags) + : SvXMLExport(util::MeasureUnit::CM, xContext, implementationName, ::xmloff::token::XML_CHART, + nExportFlags) + , maAutoStylePool(new SchXMLAutoStylePoolP(*this)) + , maExportHelper(new SchXMLExportHelper(*this, *maAutoStylePool)) { if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) GetNamespaceMap_().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT); diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 766c5983beab..57b2a8c73b12 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -521,7 +521,7 @@ SvXMLImportContext *SchXMLImport::CreateDocumentContext(sal_uInt16 const nPrefix ( IsXMLToken( rLocalName, XML_DOCUMENT_STYLES) || IsXMLToken( rLocalName, XML_DOCUMENT_CONTENT) )) { - pContext = new SchXMLDocContext( *maImportHelper.get(), *this, nPrefix, rLocalName ); + pContext = new SchXMLDocContext(*maImportHelper, *this, nPrefix, rLocalName); } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && ( IsXMLToken(rLocalName, XML_DOCUMENT) || (IsXMLToken(rLocalName, XML_DOCUMENT_META) @@ -532,9 +532,8 @@ SvXMLImportContext *SchXMLImport::CreateDocumentContext(sal_uInt16 const nPrefix // mst@: right now, this seems to be not supported, so it is untested if (!xDPS.is()) { pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META)) - ? SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList) - : new SchXMLDocContext( *maImportHelper.get(), *this, - nPrefix, rLocalName ); + ? SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList) + : new SchXMLDocContext(*maImportHelper, *this, nPrefix, rLocalName); } } else { pContext = SvXMLImport::CreateDocumentContext(nPrefix, rLocalName, xAttrList); @@ -557,13 +556,11 @@ SvXMLImportContext *SchXMLImport::CreateFastContext( sal_Int32 nElement, GetModel(), uno::UNO_QUERY); // mst@: right now, this seems to be not supported, so it is untested if (xDPS.is()) { - pContext = (nElement == XML_ELEMENT( OFFICE, XML_DOCUMENT_META )) - ? new SvXMLMetaDocumentContext(*this, - xDPS->getDocumentProperties()) - // flat OpenDocument file format - : new SchXMLFlatDocContext_Impl( - *maImportHelper.get(), *this, nElement, - xDPS->getDocumentProperties()); + pContext = (nElement == XML_ELEMENT(OFFICE, XML_DOCUMENT_META)) + ? new SvXMLMetaDocumentContext(*this, xDPS->getDocumentProperties()) + // flat OpenDocument file format + : new SchXMLFlatDocContext_Impl(*maImportHelper, *this, nElement, + xDPS->getDocumentProperties()); } } break; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 42e14d56bdab..8a918aeeff00 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1751,7 +1751,7 @@ XMLPageExport* SvXMLExport::CreatePageExport() SchXMLExportHelper* SvXMLExport::CreateChartExport() { - return new SchXMLExportHelper(*this,*GetAutoStylePool().get()); + return new SchXMLExportHelper(*this, *GetAutoStylePool()); } XMLFontAutoStylePool* SvXMLExport::CreateFontAutoStylePool() @@ -2428,7 +2428,7 @@ SvXMLExport::AddAttributesRDFa( return; // no xml:id => no RDFa } - if (!mpImpl->mpRDFaHelper.get()) + if (!mpImpl->mpRDFaHelper) { mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaExportHelper(*this) ); } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index d2186d706bde..57826fc6546e 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -304,7 +304,7 @@ public: sal_uInt16 getGeneratorVersion( const SvXMLImport& rImport ) { - if ( !mpDocumentInfo.get() ) + if (!mpDocumentInfo) { mpDocumentInfo.reset( new DocumentInfo( rImport ) ); } @@ -568,7 +568,7 @@ void SAL_CALL SvXMLImport::endDocument() GetTextImport()->MapCrossRefHeadingFieldsHorribly(); - if (mpImpl->mpRDFaHelper.get()) + if (mpImpl->mpRDFaHelper) { const uno::Reference<rdf::XRepositorySupplier> xRS(mxModel, uno::UNO_QUERY); @@ -2005,7 +2005,7 @@ void SvXMLImport::SetXmlId(uno::Reference<uno::XInterface> const & i_xIfc, ::xmloff::RDFaImportHelper & SvXMLImport::GetRDFaImportHelper() { - if (!mpImpl->mpRDFaHelper.get()) + if (!mpImpl->mpRDFaHelper) { mpImpl->mpRDFaHelper.reset( new ::xmloff::RDFaImportHelper(*this) ); } @@ -2184,8 +2184,8 @@ void SvXMLImportFastNamespaceHandler::addNSDeclAttributes( rtl::Reference < comp { for(const auto& aNamespaceDefine : m_aNamespaceDefines) { - OUString& rPrefix = aNamespaceDefine.get()->m_aPrefix; - OUString& rNamespaceURI = aNamespaceDefine.get()->m_aNamespaceURI; + OUString& rPrefix = aNamespaceDefine->m_aPrefix; + OUString& rNamespaceURI = aNamespaceDefine->m_aNamespaceURI; OUString sDecl; if ( rPrefix.isEmpty() ) sDecl = "xmlns"; diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index 422a7b5de18b..beff02ecc549 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -380,15 +380,15 @@ void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& r for (sal_uInt16 i = 0; i < 4; i++) { - if (pNewMargins[i].get()) + if (pNewMargins[i]) { rProperties.push_back(*pNewMargins[i]); } - if (pNewHeaderMargins[i].get()) + if (pNewHeaderMargins[i]) { rProperties.push_back(*pNewHeaderMargins[i]); } - if (pNewFooterMargins[i].get()) + if (pNewFooterMargins[i]) { rProperties.push_back(*pNewFooterMargins[i]); } diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index ae227e7d2920..177fadee8de8 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -734,14 +734,10 @@ void SvXMLAutoStylePoolP_Impl::exportXML( else sName = rFamily.maStrFamilyName; - pAntiImpl->exportStyleAttributes( - GetExport().GetAttrList(), - nFamily, - aExpStyles[i].mpProperties->GetProperties(), - *rFamily.mxMapper.get() - , GetExport().GetMM100UnitConverter(), - GetExport().GetNamespaceMap() - ); + pAntiImpl->exportStyleAttributes(GetExport().GetAttrList(), nFamily, + aExpStyles[i].mpProperties->GetProperties(), + *rFamily.mxMapper, GetExport().GetMM100UnitConverter(), + GetExport().GetNamespaceMap()); SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, sName, @@ -772,14 +768,10 @@ void SvXMLAutoStylePoolP_Impl::exportXML( aExpStyles[i].mpProperties->GetProperties(), nStart, nEnd, SvXmlExportFlags::IGN_WS, bExtensionNamespace ); - pAntiImpl->exportStyleContent( - GetExport().GetDocHandler(), - nFamily, - aExpStyles[i].mpProperties->GetProperties(), - *rFamily.mxMapper.get(), - GetExport().GetMM100UnitConverter(), - GetExport().GetNamespaceMap() - ); + pAntiImpl->exportStyleContent(GetExport().GetDocHandler(), nFamily, + aExpStyles[i].mpProperties->GetProperties(), + *rFamily.mxMapper, GetExport().GetMM100UnitConverter(), + GetExport().GetNamespaceMap()); } } } diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx index 52b900acf808..a456283b2afc 100644 --- a/xmloff/source/text/XMLPropertyBackpatcher.cxx +++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx @@ -158,7 +158,7 @@ static OUString GetSequenceNumber() XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetFootnoteBP() { - if (!m_xBackpatcherImpl->m_pFootnoteBackpatcher.get()) + if (!m_xBackpatcherImpl->m_pFootnoteBackpatcher) { m_xBackpatcherImpl->m_pFootnoteBackpatcher.reset( new XMLPropertyBackpatcher<sal_Int16>(GetSequenceNumber())); @@ -168,7 +168,7 @@ XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetFootnoteBP() XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetSequenceIdBP() { - if (!m_xBackpatcherImpl->m_pSequenceIdBackpatcher.get()) + if (!m_xBackpatcherImpl->m_pSequenceIdBackpatcher) { m_xBackpatcherImpl->m_pSequenceIdBackpatcher.reset( new XMLPropertyBackpatcher<sal_Int16>(GetSequenceNumber())); @@ -178,7 +178,7 @@ XMLPropertyBackpatcher<sal_Int16>& XMLTextImportHelper::GetSequenceIdBP() XMLPropertyBackpatcher<OUString>& XMLTextImportHelper::GetSequenceNameBP() { - if (!m_xBackpatcherImpl->m_pSequenceNameBackpatcher.get()) + if (!m_xBackpatcherImpl->m_pSequenceNameBackpatcher) { m_xBackpatcherImpl->m_pSequenceNameBackpatcher.reset( new XMLPropertyBackpatcher<OUString>("SourceName")); diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 9ed8b7d0115a..7ed81b9e6f2a 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -752,7 +752,7 @@ XMLTextListsHelper & XMLTextImportHelper::GetTextListHelper() const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap() { - if (!m_xImpl->m_xTextElemTokenMap.get()) + if (!m_xImpl->m_xTextElemTokenMap) { m_xImpl->m_xTextElemTokenMap.reset( new SvXMLTokenMap( aTextElemTokenMap )); @@ -762,7 +762,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextElemTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap() { - if (!m_xImpl->m_xTextPElemTokenMap.get()) + if (!m_xImpl->m_xTextPElemTokenMap) { m_xImpl->m_xTextPElemTokenMap.reset( new SvXMLTokenMap( aTextPElemTokenMap )); @@ -772,7 +772,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextPElemTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap() { - if (!m_xImpl->m_xTextPAttrTokenMap.get()) + if (!m_xImpl->m_xTextPAttrTokenMap) { m_xImpl->m_xTextPAttrTokenMap.reset( new SvXMLTokenMap( aTextPAttrTokenMap )); @@ -782,7 +782,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextPAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap() { - if (!m_xImpl->m_xTextFrameAttrTokenMap.get()) + if (!m_xImpl->m_xTextFrameAttrTokenMap) { m_xImpl->m_xTextFrameAttrTokenMap.reset( new SvXMLTokenMap( aTextFrameAttrTokenMap )); @@ -792,7 +792,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextFrameAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap() { - if (!m_xImpl->m_xTextContourAttrTokenMap.get()) + if (!m_xImpl->m_xTextContourAttrTokenMap) { m_xImpl->m_xTextContourAttrTokenMap.reset( new SvXMLTokenMap( aTextContourAttrTokenMap )); @@ -802,7 +802,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextContourAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap() { - if (!m_xImpl->m_xTextHyperlinkAttrTokenMap.get()) + if (!m_xImpl->m_xTextHyperlinkAttrTokenMap) { m_xImpl->m_xTextHyperlinkAttrTokenMap.reset( new SvXMLTokenMap( aTextHyperlinkAttrTokenMap )); @@ -812,7 +812,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextHyperlinkAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap() { - if (!m_xImpl->m_xTextMasterPageElemTokenMap.get()) + if (!m_xImpl->m_xTextMasterPageElemTokenMap) { m_xImpl->m_xTextMasterPageElemTokenMap.reset( new SvXMLTokenMap( aTextMasterPageElemTokenMap )); @@ -822,7 +822,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextMasterPageElemTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextFieldAttrTokenMap() { - if (!m_xImpl->m_xTextFieldAttrTokenMap.get()) + if (!m_xImpl->m_xTextFieldAttrTokenMap) { m_xImpl->m_xTextFieldAttrTokenMap.reset( new SvXMLTokenMap( aTextFieldAttrTokenMap )); @@ -2545,7 +2545,7 @@ void XMLTextImportHelper::PopListContext() const SvXMLTokenMap& XMLTextImportHelper::GetTextNumberedParagraphAttrTokenMap() { - if (!m_xImpl->m_xTextNumberedParagraphAttrTokenMap.get()) + if (!m_xImpl->m_xTextNumberedParagraphAttrTokenMap) { m_xImpl->m_xTextNumberedParagraphAttrTokenMap.reset( new SvXMLTokenMap( aTextNumberedParagraphAttrTokenMap ) ); @@ -2555,7 +2555,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextNumberedParagraphAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockAttrTokenMap() { - if (!m_xImpl->m_xTextListBlockAttrTokenMap.get()) + if (!m_xImpl->m_xTextListBlockAttrTokenMap) { m_xImpl->m_xTextListBlockAttrTokenMap.reset( new SvXMLTokenMap( aTextListBlockAttrTokenMap ) ); @@ -2565,7 +2565,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockAttrTokenMap() const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockElemTokenMap() { - if (!m_xImpl->m_xTextListBlockElemTokenMap.get()) + if (!m_xImpl->m_xTextListBlockElemTokenMap) { m_xImpl->m_xTextListBlockElemTokenMap.reset( new SvXMLTokenMap( aTextListBlockElemTokenMap ) ); @@ -2575,7 +2575,7 @@ const SvXMLTokenMap& XMLTextImportHelper::GetTextListBlockElemTokenMap() SvI18NMap& XMLTextImportHelper::GetRenameMap() { - if (!m_xImpl->m_xRenameMap.get()) + if (!m_xImpl->m_xRenameMap) { m_xImpl->m_xRenameMap.reset( new SvI18NMap ); } @@ -2702,7 +2702,7 @@ void XMLTextImportHelper::ConnectFrameChains( } else { - if (!m_xImpl->m_xPrevFrmNames.get()) + if (!m_xImpl->m_xPrevFrmNames) { m_xImpl->m_xPrevFrmNames.reset( new std::vector<OUString> ); m_xImpl->m_xNextFrmNames.reset( new std::vector<OUString> ); diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index 700af7aa44fc..519fdf3099d4 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -756,11 +756,11 @@ void XMLTextImportPropertyMapper::finished( for (sal_uInt16 i=0; i<4; i++) { - if (pNewParaMargins[i].get()) + if (pNewParaMargins[i]) { rProperties.push_back(*pNewParaMargins[i]); } - if (pNewMargins[i].get()) + if (pNewMargins[i]) { rProperties.push_back(*pNewMargins[i]); } diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 54bc90497958..9134fe01cffb 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1560,7 +1560,8 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( } else { - pContext = new XMLUrlFieldImportContext( rImport, *rImport.GetTextImport().get(), nPrefix, rLocalName ); + pContext = new XMLUrlFieldImportContext(rImport, *rImport.GetTextImport(), nPrefix, + rLocalName); //whitespace handling like other fields rIgnoreLeadingSpace = false; @@ -1584,9 +1585,8 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( } else { - pContext = new XMLFootnoteImportContext( rImport, - *rImport.GetTextImport().get(), - nPrefix, rLocalName ); + pContext = new XMLFootnoteImportContext(rImport, *rImport.GetTextImport(), nPrefix, + rLocalName); } rIgnoreLeadingSpace = false; break; @@ -1595,19 +1595,17 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( case XML_TOK_TEXT_BOOKMARK: case XML_TOK_TEXT_BOOKMARK_START: case XML_TOK_TEXT_BOOKMARK_END: - pContext = new XMLTextMarkImportContext( rImport, - *rImport.GetTextImport().get(), - rHints.GetCrossRefHeadingBookmark(), - nPrefix, rLocalName ); + pContext = new XMLTextMarkImportContext(rImport, *rImport.GetTextImport(), + rHints.GetCrossRefHeadingBookmark(), nPrefix, + rLocalName); break; case XML_TOK_TEXT_FIELDMARK: case XML_TOK_TEXT_FIELDMARK_START: case XML_TOK_TEXT_FIELDMARK_END: - pContext = new XMLTextMarkImportContext( rImport, - *rImport.GetTextImport().get(), - rHints.GetCrossRefHeadingBookmark(), - nPrefix, rLocalName ); + pContext = new XMLTextMarkImportContext(rImport, *rImport.GetTextImport(), + rHints.GetCrossRefHeadingBookmark(), nPrefix, + rLocalName); break; case XML_TOK_TEXT_REFERENCE_START: @@ -1708,10 +1706,8 @@ SvXMLImportContextRef XMLImpSpanContext_Impl::CreateChildContext( default: // none of the above? then it's probably a text field! - pContext = - XMLTextFieldImportContext::CreateTextFieldImportContext( - rImport, *rImport.GetTextImport().get(), nPrefix, rLocalName, - nToken); + pContext = XMLTextFieldImportContext::CreateTextFieldImportContext( + rImport, *rImport.GetTextImport(), nPrefix, rLocalName, nToken); // #108784# import draw elements (except control shapes in headers) if( pContext == nullptr && !( rImport.GetTextImport()->IsInHeaderFooter() && |