From 11d365241808405483b79efd7879fa04bee8945e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:15:45 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: Ic67c3138ca66c6b6d6fcf76b09d4581e23f51f8d --- forms/source/component/Button.cxx | 4 +-- forms/source/component/ComboBox.cxx | 2 +- forms/source/component/DatabaseForm.cxx | 32 ++++++++--------- forms/source/component/Edit.cxx | 4 +-- forms/source/component/EventThread.cxx | 4 +-- forms/source/component/Filter.cxx | 4 +-- forms/source/component/FormComponent.cxx | 30 ++++++++-------- forms/source/component/FormattedField.cxx | 14 ++++---- forms/source/component/FormsCollection.cxx | 2 +- forms/source/component/Grid.cxx | 8 ++--- forms/source/component/ImageControl.cxx | 8 ++--- forms/source/component/ListBox.cxx | 4 +-- forms/source/component/clickableimage.cxx | 30 ++++++++-------- forms/source/component/clickableimage.hxx | 2 +- forms/source/component/imgprod.cxx | 16 ++++----- forms/source/component/propertybaghelper.cxx | 12 +++---- forms/source/helper/controlfeatureinterception.cxx | 10 +++--- forms/source/helper/formnavigation.cxx | 10 +++--- forms/source/helper/windowstateguard.cxx | 2 +- forms/source/misc/InterfaceContainer.cxx | 10 +++--- forms/source/misc/limitedformats.cxx | 18 +++++----- forms/source/resource/frm_resource.cxx | 2 +- forms/source/richtext/attributedispatcher.cxx | 4 +-- forms/source/richtext/clipboarddispatcher.cxx | 4 +-- forms/source/richtext/featuredispatcher.cxx | 2 +- .../richtext/parametrizedattributedispatcher.cxx | 2 +- forms/source/richtext/richtextcontrol.cxx | 14 ++++---- forms/source/richtext/richtextengine.cxx | 2 +- forms/source/richtext/richtextimplcontrol.cxx | 10 +++--- forms/source/richtext/richtextimplcontrol.hxx | 2 +- forms/source/richtext/richtextmodel.cxx | 4 +-- forms/source/richtext/richtextvclcontrol.cxx | 2 +- forms/source/richtext/richtextvclcontrol.hxx | 2 +- forms/source/richtext/richtextviewport.cxx | 2 +- forms/source/richtext/richtextviewport.hxx | 2 +- forms/source/richtext/rtattributehandler.cxx | 2 +- forms/source/richtext/rtattributes.hxx | 8 ++--- forms/source/richtext/specialdispatchers.cxx | 10 +++--- forms/source/runtime/formoperations.cxx | 14 ++++---- forms/source/runtime/formoperations.hxx | 2 +- forms/source/solar/component/navbarcontrol.cxx | 2 +- forms/source/solar/control/navtoolbar.cxx | 28 +++++++-------- forms/source/xforms/binding.cxx | 36 +++++++++---------- forms/source/xforms/convert.cxx | 6 ++-- forms/source/xforms/model.cxx | 40 +++++++++++----------- forms/source/xforms/model_helper.hxx | 12 +++---- forms/source/xforms/model_ui.cxx | 40 +++++++++++----------- forms/source/xforms/propertysetbase.cxx | 6 ++-- forms/source/xforms/submission.cxx | 10 +++--- forms/source/xforms/submission/replace.cxx | 2 +- forms/source/xforms/submission/submission_get.cxx | 2 +- forms/source/xforms/xpathlib/xpathlib.cxx | 2 +- 52 files changed, 251 insertions(+), 251 deletions(-) diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx index a4c88e2ef9ea..e22590701608 100644 --- a/forms/source/component/Button.cxx +++ b/forms/source/component/Button.cxx @@ -353,7 +353,7 @@ css::uno::Sequence OButtonControl::getSupportedServiceNames() throw(s OButtonControl::OButtonControl(const Reference& _rxFactory) :OClickableImageBaseControl(_rxFactory, VCL_CONTROL_COMMANDBUTTON) ,OFormNavigationHelper( _rxFactory ) - ,m_nClickEvent( 0 ) + ,m_nClickEvent( nullptr ) ,m_nTargetUrlFeatureId( -1 ) ,m_bEnabledByPropertyValue( false ) { @@ -426,7 +426,7 @@ void OButtonControl::actionPerformed(const ActionEvent& /*rEvent*/) throw ( css: IMPL_LINK_NOARG_TYPED(OButtonControl, OnClick, void*, void) { ::osl::ClearableMutexGuard aGuard( m_aMutex ); - m_nClickEvent = 0; + m_nClickEvent = nullptr; if (m_aApproveActionListeners.getLength()) { diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 19916a4c2cf1..bbb7da042884 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -166,7 +166,7 @@ void OComboBoxModel::disposing() OBoundControlModel::disposing(); OEntryListHelper::disposing(); OErrorBroadcaster::disposing(); - m_xFormatter = NULL; + m_xFormatter = nullptr; } diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index c169d0ea7deb..0c0b3470f4d8 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -261,12 +261,12 @@ ODatabaseForm::ODatabaseForm(const Reference& _rxContext) ,m_aErrorListeners(m_aMutex) ,m_aResetListeners( *this, m_aMutex ) ,m_aPropertyBagHelper( *this ) - ,m_pAggregatePropertyMultiplexer(NULL) - ,m_pGroupManager( NULL ) + ,m_pAggregatePropertyMultiplexer(nullptr) + ,m_pGroupManager( nullptr ) ,m_aParameterManager( m_aMutex, _rxContext ) ,m_aFilterManager() - ,m_pLoadTimer(NULL) - ,m_pThread(NULL) + ,m_pLoadTimer(nullptr) + ,m_pThread(nullptr) ,m_nResetsPending(0) ,m_nPrivileges(0) ,m_bInsertOnly( false ) @@ -300,12 +300,12 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource ) ,m_aErrorListeners( m_aMutex ) ,m_aResetListeners( *this, m_aMutex ) ,m_aPropertyBagHelper( *this ) - ,m_pAggregatePropertyMultiplexer( NULL ) - ,m_pGroupManager( NULL ) + ,m_pAggregatePropertyMultiplexer( nullptr ) + ,m_pGroupManager( nullptr ) ,m_aParameterManager( m_aMutex, _cloneSource.m_xContext ) ,m_aFilterManager() - ,m_pLoadTimer( NULL ) - ,m_pThread( NULL ) + ,m_pLoadTimer( nullptr ) + ,m_pThread( nullptr ) ,m_nResetsPending( 0 ) ,m_nPrivileges( 0 ) ,m_bInsertOnly( _cloneSource.m_bInsertOnly ) @@ -433,18 +433,18 @@ ODatabaseForm::~ODatabaseForm() { m_pGroupManager->release(); - m_pGroupManager = NULL; + m_pGroupManager = nullptr; if (m_xAggregate.is()) - m_xAggregate->setDelegator( NULL ); + m_xAggregate->setDelegator( nullptr ); - m_aWarnings.setExternalWarnings( NULL ); + m_aWarnings.setExternalWarnings( nullptr ); if (m_pAggregatePropertyMultiplexer) { m_pAggregatePropertyMultiplexer->dispose(); m_pAggregatePropertyMultiplexer->release(); - m_pAggregatePropertyMultiplexer = NULL; + m_pAggregatePropertyMultiplexer = nullptr; } } @@ -1018,7 +1018,7 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN { OUString aFileName(rFileName); OUString aContentType(CONTENT_TYPE_STR_TEXT_PLAIN); - SvStream *pStream = 0; + SvStream *pStream = nullptr; if (!aFileName.isEmpty()) { @@ -1033,7 +1033,7 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN if (!pStream || (pStream->GetError() != ERRCODE_NONE)) { delete pStream; - pStream = 0; + pStream = nullptr; } sal_Int32 nSepInd = aFileName.lastIndexOf('.'); OUString aExtension = aFileName.copy( nSepInd + 1, aFileName.getLength() - nSepInd - 1 ); @@ -1284,7 +1284,7 @@ void ODatabaseForm::disposing() if (m_pThread) { m_pThread->release(); - m_pThread = NULL; + m_pThread = nullptr; } } @@ -2559,7 +2559,7 @@ void SAL_CALL ODatabaseForm::disposing(const EventObject& Source) throw( Runtime void ODatabaseForm::impl_createLoadTimer() { - OSL_PRECOND( m_pLoadTimer == NULL, "ODatabaseForm::impl_createLoadTimer: timer already exists!" ); + OSL_PRECOND( m_pLoadTimer == nullptr, "ODatabaseForm::impl_createLoadTimer: timer already exists!" ); m_pLoadTimer = new Timer(); m_pLoadTimer->SetTimeout(100); m_pLoadTimer->SetTimeoutHdl(LINK(this,ODatabaseForm,OnTimeout)); diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index e9fac0fe6b0f..2ed97bc19f24 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -85,7 +85,7 @@ Any SAL_CALL OEditControl::queryAggregation(const Type& _rType) throw (RuntimeEx OEditControl::OEditControl(const Reference& _rxFactory) :OBoundControl( _rxFactory, FRM_SUN_CONTROL_RICHTEXTCONTROL ) ,m_aChangeListeners(m_aMutex) - ,m_nKeyEvent( 0 ) + ,m_nKeyEvent( nullptr ) { osl_atomic_increment(&m_refCount); @@ -249,7 +249,7 @@ void OEditControl::keyReleased(const css::awt::KeyEvent& /*e*/) throw ( css::uno IMPL_LINK_NOARG_TYPED(OEditControl, OnKeyPressed, void*, void) { - m_nKeyEvent = 0; + m_nKeyEvent = nullptr; Reference xFComp(getModel(), UNO_QUERY); css::uno::Reference xParent = xFComp->getParent(); diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index 669c1a0db5e1..7de4e876694b 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -101,8 +101,8 @@ void OComponentEventThread::disposing( const EventObject& evt ) throw ( css::uno // Free the Control and set pCompImpl to 0, // so that the thread knows, that it should terminate. - m_xComp = 0; - m_pCompImpl = 0; + m_xComp = nullptr; + m_pCompImpl = nullptr; // Wake up the thread and terminate m_aCond.set(); diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 720750a37eef..e23009b6fd6f 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -759,8 +759,8 @@ namespace frm PropertyValue aProp; NamedValue aValue; - const OUString* pName = NULL; - const Any* pValue = NULL; + const OUString* pName = nullptr; + const Any* pValue = nullptr; Reference< XPropertySet > xControlModel; if (aArguments.getLength() == 3 diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 9f0bceb66622..5bcf79e1f1ae 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -141,7 +141,7 @@ OControl::~OControl() void OControl::doResetDelegator() { if ( m_xAggregate.is() ) - m_xAggregate->setDelegator( NULL ); + m_xAggregate->setDelegator( nullptr ); } void OControl::doSetDelegator() @@ -199,7 +199,7 @@ void OControl::disposing() { OComponentHelper::disposing(); - m_aWindowStateGuard.attach( NULL, NULL ); + m_aWindowStateGuard.attach( nullptr, nullptr ); Reference< XComponent > xComp; if (query_aggregation(m_xAggregate, xComp)) @@ -599,7 +599,7 @@ void OControlModel::clonedFrom( const OControlModel* /*_pOriginal*/ ) void OControlModel::doResetDelegator() { if (m_xAggregate.is()) - m_xAggregate->setDelegator(NULL); + m_xAggregate->setDelegator(nullptr); } void OControlModel::doSetDelegator() @@ -708,7 +708,7 @@ void SAL_CALL OControlModel::disposing(const css::lang::EventObject& _rSource) t if (_rSource.Source == m_xParent) { osl::MutexGuard aGuard(m_aMutex); - m_xParent = NULL; + m_xParent = nullptr; } else { @@ -1159,7 +1159,7 @@ OBoundControlModel::OBoundControlModel( ,m_aUpdateListeners(m_aMutex) ,m_aFormComponentListeners( m_aMutex ) ,m_bInputRequired( true ) - ,m_pAggPropMultiplexer( NULL ) + ,m_pAggPropMultiplexer( nullptr ) ,m_bFormListening( false ) ,m_bLoaded(false) ,m_bRequired(false) @@ -1192,7 +1192,7 @@ OBoundControlModel::OBoundControlModel( ,m_aFormComponentListeners( m_aMutex ) ,m_xValidator( _pOriginal->m_xValidator ) ,m_bInputRequired( true ) - ,m_pAggPropMultiplexer( NULL ) + ,m_pAggPropMultiplexer( nullptr ) ,m_bFormListening( false ) ,m_bLoaded( false ) ,m_bRequired( false ) @@ -1237,7 +1237,7 @@ OBoundControlModel::~OBoundControlModel() { m_pAggPropMultiplexer->dispose(); m_pAggPropMultiplexer->release(); - m_pAggPropMultiplexer = NULL; + m_pAggPropMultiplexer = nullptr; } } @@ -1384,7 +1384,7 @@ void OBoundControlModel::disposing() resetField(); } - m_xCursor = NULL; + m_xCursor = nullptr; Reference< XComponent > xComp( m_xLabelControl, UNO_QUERY ); if ( xComp.is() ) xComp->removeEventListener(static_cast< XEventListener* >( static_cast< XPropertyChangeListener* >( this ) ) ); @@ -1504,7 +1504,7 @@ void SAL_CALL OBoundControlModel::disposing(const css::lang::EventObject& _rEven else if ( _rEvent.Source == m_xLabelControl ) { Reference xOldValue = m_xLabelControl; - m_xLabelControl = NULL; + m_xLabelControl = nullptr; // fire a propertyChanged (when we leave aLock's scope) aLock.addPropertyNotification( PROPERTY_ID_CONTROLLABEL, makeAny( xOldValue ), makeAny( m_xLabelControl ) ); } @@ -1566,7 +1566,7 @@ void OBoundControlModel::defaultCommonProperties() Reference xComp(m_xLabelControl, UNO_QUERY); if (xComp.is()) xComp->removeEventListener(static_cast(static_cast(this))); - m_xLabelControl = NULL; + m_xLabelControl = nullptr; } void OBoundControlModel::readCommonProperties(const Reference& _rxInStream) @@ -1734,7 +1734,7 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co Reference< XComponent > xComp( m_xLabelControl, UNO_QUERY ); if ( xComp.is() ) xComp->removeEventListener( static_cast< XPropertyChangeListener* >( this ) ); - m_xLabelControl = NULL; + m_xLabelControl = nullptr; break; } @@ -1963,7 +1963,7 @@ bool OBoundControlModel::connectToField(const Reference& rForm) } else - impl_setField_noNotify( NULL ); + impl_setField_noNotify( nullptr ); if ( m_xField.is() ) { if ( m_xField->getPropertySetInfo()->hasPropertyByName( PROPERTY_VALUE ) ) @@ -1981,7 +1981,7 @@ bool OBoundControlModel::connectToField(const Reference& rForm) else { SAL_WARN("forms.component", "OBoundControlModel::connectToField: property " PROPERTY_VALUE " not supported!"); - impl_setField_noNotify( NULL ); + impl_setField_noNotify( nullptr ); } } @@ -2076,7 +2076,7 @@ void OBoundControlModel::impl_disconnectDatabaseColumn_noNotify() resetField(); } - m_xCursor = NULL; + m_xCursor = nullptr; m_bLoaded = false; } @@ -2634,7 +2634,7 @@ Any OBoundControlModel::translateExternalValueToControlValue( const Any& _rExter // if the external value is VOID, and our value property is not allowed to be VOID, // then default-construct a value if ( !aControlValue.hasValue() && !m_bValuePropertyMayBeVoid ) - aControlValue.setValue( NULL, m_aValuePropertyType ); + aControlValue.setValue( nullptr, m_aValuePropertyType ); // out of here return aControlValue; } diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 4c4068e0cc50..f27f31e46f44 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -138,7 +138,7 @@ void StandardFormatsSupplier::notifyTermination() // earlier than upon unloading the library // #i29147# s_xDefaultFormatsSupplier = WeakReference< XNumberFormatsSupplier >( ); - SetNumberFormatter( NULL ); + SetNumberFormatter( nullptr ); DELETEZ( m_pMyPrivateFormatter ); } Sequence OFormattedControl::_getTypes() @@ -157,7 +157,7 @@ Any SAL_CALL OFormattedControl::queryAggregation(const Type& _rType) throw (Runt } OFormattedControl::OFormattedControl(const Reference& _rxFactory) :OBoundControl(_rxFactory, VCL_CONTROL_FORMATTEDFIELD) - ,m_nKeyEvent(0) + ,m_nKeyEvent(nullptr) { osl_atomic_increment(&m_refCount); { @@ -235,7 +235,7 @@ void OFormattedControl::keyReleased(const css::awt::KeyEvent& /*e*/) throw ( css IMPL_LINK_NOARG_TYPED(OFormattedControl, OnKeyPressed, void*, void) { - m_nKeyEvent = 0; + m_nKeyEvent = nullptr; Reference xFComp(getModel(), UNO_QUERY); css::uno::Reference xParent = xFComp->getParent(); Reference xSubmit(xParent, UNO_QUERY); @@ -263,7 +263,7 @@ void OFormattedModel::implConstruct() // members m_bOriginalNumeric = false; m_bNumeric = false; - m_xOriginalFormatter = NULL; + m_xOriginalFormatter = nullptr; m_nKeyType = NumberFormat::UNDEFINED; m_aNullDate = DBTypeConversion::getStandardDate(); m_nFieldType = DataType::OTHER; @@ -517,7 +517,7 @@ Reference OFormattedModel::calcFormFormatsSupplier() co if (!xNextParentForm.is()) { OSL_FAIL("OFormattedModel::calcFormFormatsSupplier : have no ancestor which is a form !"); - return NULL; + return nullptr; } // The FormatSupplier of my ancestor (if it has one) Reference< XRowSet > xRowSet( xNextParentForm, UNO_QUERY ); @@ -549,7 +549,7 @@ void OFormattedModel::loaded(const EventObject& rEvent) throw ( css::uno::Runtim void OFormattedModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm ) { - m_xOriginalFormatter = NULL; + m_xOriginalFormatter = nullptr; // get some properties of the field m_nFieldType = DataType::OTHER; Reference xField = getField(); @@ -639,7 +639,7 @@ void OFormattedModel::onDisconnectedDbColumn() m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(m_xOriginalFormatter)); m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, Any()); setPropertyValue(PROPERTY_TREATASNUMERIC, makeAny(m_bOriginalNumeric)); - m_xOriginalFormatter = NULL; + m_xOriginalFormatter = nullptr; } m_nFieldType = DataType::OTHER; m_nKeyType = NumberFormat::UNDEFINED; diff --git a/forms/source/component/FormsCollection.cxx b/forms/source/component/FormsCollection.cxx index f5b497e75b4d..7e5bd1b4bf1b 100644 --- a/forms/source/component/FormsCollection.cxx +++ b/forms/source/component/FormsCollection.cxx @@ -122,7 +122,7 @@ void OFormsCollection::disposing() OInterfaceContainer::disposing(); } FormsCollectionComponentBase::disposing(); - m_xParent = NULL; + m_xParent = nullptr; } //XChild diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 4d878dfc9293..6b8682371372 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -253,7 +253,7 @@ void OGridControlModel::disposing() OControlModel::disposing(); OErrorBroadcaster::disposing(); OInterfaceContainer::disposing(); - setParent(NULL); + setParent(nullptr); EventObject aEvt(static_cast(this)); m_aSelectListeners.disposeAndClear(aEvt); m_aResetListeners.disposeAndClear(aEvt); @@ -694,7 +694,7 @@ Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const OGridColumn* OGridControlModel::getColumnImplementation(const css::uno::Reference& _rxIFace) { - OGridColumn* pImplementation = NULL; + OGridColumn* pImplementation = nullptr; Reference< XUnoTunnel > xUnoTunnel( _rxIFace, UNO_QUERY ); if ( xUnoTunnel.is() ) pImplementation = reinterpret_cast(xUnoTunnel->getSomething(OGridColumn::getUnoTunnelImplementationId())); @@ -785,7 +785,7 @@ void OGridControlModel::write(const Reference& _rxOutStream { // first the service name for the unerlying model OGridColumn* pCol = getColumnImplementation(m_aItems[i]); - DBG_ASSERT(pCol != NULL, "OGridControlModel::write : such items should never reach it into my container !"); + DBG_ASSERT(pCol != nullptr, "OGridControlModel::write : such items should never reach it into my container !"); _rxOutStream << pCol->getModelName(); // then the object itself sal_Int32 nMark = xMark->createMark(); @@ -896,7 +896,7 @@ void OGridControlModel::read(const Reference& _rxInStream) t xMark->deleteMark(nMark); } if ( xCol.is() ) - implInsert( i, xCol, false, NULL, false ); + implInsert( i, xCol, false, nullptr, false ); } } // In the base implementation events are only read, elements in the container exist diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx index f55d01023e19..88f79b4aadd6 100644 --- a/forms/source/component/ImageControl.cxx +++ b/forms/source/component/ImageControl.cxx @@ -130,7 +130,7 @@ Sequence OImageControlModel::_getTypes() OImageControlModel::OImageControlModel(const Reference& _rxFactory) :OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL, false, false, false ) // use the old control name for compytibility reasons - ,m_pImageProducer( NULL ) + ,m_pImageProducer( nullptr ) ,m_bExternalGraphic( true ) ,m_bReadOnly( false ) ,m_sImageURL() @@ -146,7 +146,7 @@ OImageControlModel::OImageControlModel(const Reference& _rxFa OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, const Reference< XComponentContext >& _rxFactory ) :OBoundControlModel( _pOriginal, _rxFactory ) // use the old control name for compytibility reasons - ,m_pImageProducer( NULL ) + ,m_pImageProducer( nullptr ) ,m_bExternalGraphic( true ) ,m_bReadOnly( _pOriginal->m_bReadOnly ) ,m_sImageURL( _pOriginal->m_sImageURL ) @@ -413,7 +413,7 @@ bool OImageControlModel::impl_updateStreamForURL_lck( const OUString& _rURL, Val else { pImageStream.reset( ::utl::UcbStreamHelper::CreateStream( _rURL, StreamMode::READ ) ); - bool bSetNull = ( pImageStream.get() == NULL ) || ( ERRCODE_NONE != pImageStream->GetErrorCode() ); + bool bSetNull = ( pImageStream.get() == nullptr ) || ( ERRCODE_NONE != pImageStream->GetErrorCode() ); if ( !bSetNull ) { @@ -667,7 +667,7 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException, s IMPL_LINK_TYPED( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic, void ) { - const Reference< XGraphic > xGraphic( i_pGraphic != NULL ? Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() : NULL ); + const Reference< XGraphic > xGraphic( i_pGraphic != nullptr ? Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() : nullptr ); m_bExternalGraphic = false; try { diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index ca1cb8b6b236..a777b255cf41 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -436,7 +436,7 @@ namespace frm { // if both SelectedItems and StringItemList are set, care for this // #i27024# - const Any* pSelectSequenceValue = NULL; + const Any* pSelectSequenceValue = nullptr; const OUString* pStartPos = _rPropertyNames.getConstArray(); const OUString* pEndPos = _rPropertyNames.getConstArray() + _rPropertyNames.getLength(); @@ -1948,7 +1948,7 @@ namespace frm t = m_pItemBroadcaster; m_pItemBroadcaster->removeEventsForProcessor( this ); m_pItemBroadcaster->terminate(); - m_pItemBroadcaster = NULL; + m_pItemBroadcaster = nullptr; } } if (t.is()) { diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index 2e8707ce3180..1d4618846f4e 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -83,7 +83,7 @@ namespace frm OClickableImageBaseControl::OClickableImageBaseControl(const Reference& _rxFactory, const OUString& _aService) :OControl(_rxFactory, _aService) - ,m_pThread(NULL) + ,m_pThread(nullptr) ,m_aSubmissionVetoListeners( m_aMutex ) ,m_aApproveActionListeners( m_aMutex ) ,m_aActionListeners( m_aMutex ) @@ -153,7 +153,7 @@ namespace frm if( m_pThread ) { m_pThread->release(); - m_pThread = NULL; + m_pThread = nullptr; } } @@ -367,7 +367,7 @@ namespace frm void SAL_CALL OClickableImageBaseControl::submit( ) throw (VetoException, WrappedTargetException, RuntimeException, std::exception) { - implSubmit( MouseEvent(), NULL ); + implSubmit( MouseEvent(), nullptr ); } @@ -455,8 +455,8 @@ namespace frm :OControlModel( _rxFactory, _rUnoControlModelTypeName, rDefault ) ,OPropertyChangeListener(m_aMutex) ,m_xGraphicObject() - ,m_pMedium(NULL) - ,m_pProducer( NULL ) + ,m_pMedium(nullptr) + ,m_pProducer( nullptr ) ,m_bDispatchUrlInternal(false) ,m_bDownloading(false) ,m_bProdStarted(false) @@ -470,8 +470,8 @@ namespace frm :OControlModel( _pOriginal, _rxFactory ) ,OPropertyChangeListener( m_aMutex ) ,m_xGraphicObject( _pOriginal->m_xGraphicObject ) - ,m_pMedium( NULL ) - ,m_pProducer( NULL ) + ,m_pMedium( nullptr ) + ,m_pProducer( nullptr ) ,m_bDispatchUrlInternal(false) ,m_bDownloading( false ) ,m_bProdStarted( false ) @@ -524,7 +524,7 @@ namespace frm acquire(); dispose(); } - DBG_ASSERT(m_pMedium == NULL, "OClickableImageBaseModel::~OClickableImageBaseModel : leaving a memory leak ..."); + DBG_ASSERT(m_pMedium == nullptr, "OClickableImageBaseModel::~OClickableImageBaseModel : leaving a memory leak ..."); // This should be cleaned up at least in the dispose } @@ -583,11 +583,11 @@ namespace frm if (m_pMedium) { delete m_pMedium; - m_pMedium = NULL; + m_pMedium = nullptr; } - m_xProducer = NULL; - m_pProducer = NULL; + m_xProducer = nullptr; + m_pProducer = nullptr; } @@ -704,7 +704,7 @@ namespace frm { pImgProd->SetImage(OUString()); delete m_pMedium; - m_pMedium = 0; + m_pMedium = nullptr; m_bDownloading = false; } } @@ -717,7 +717,7 @@ namespace frm // Free the stream at the Producer, before the medium is deleted GetImageProducer()->SetImage(OUString()); delete m_pMedium; - m_pMedium = NULL; + m_pMedium = nullptr; } // the SfxMedium is not allowed to be created with an invalid URL, so we have to check this first @@ -749,7 +749,7 @@ namespace frm // Search for the Object shell by iterating over all Object shells // and comparing their XModel to ourĀ“s. // As an optimization, we try the current Object shell first. - SfxObjectShell *pObjSh = 0; + SfxObjectShell *pObjSh = nullptr; if( xModel.is() ) { @@ -858,7 +858,7 @@ namespace frm IMPL_LINK_TYPED( OClickableImageBaseModel, OnImageImportDone, Graphic*, i_pGraphic, void ) { - const Reference< XGraphic > xGraphic( i_pGraphic != NULL ? Graphic(i_pGraphic->GetBitmapEx()).GetXGraphic() : NULL ); + const Reference< XGraphic > xGraphic( i_pGraphic != nullptr ? Graphic(i_pGraphic->GetBitmapEx()).GetXGraphic() : nullptr ); if ( !xGraphic.is() ) { m_xGraphicObject.clear(); diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx index 27fb4eb72ef7..78a11bf2f45a 100644 --- a/forms/source/component/clickableimage.hxx +++ b/forms/source/component/clickableimage.hxx @@ -165,7 +165,7 @@ namespace frm explicit ImageModelMethodGuard( OClickableImageBaseModel& _rModel ) :GuardBase( _rModel.getMutex( OClickableImageBaseModel::GuardAccess() ) ) { - if ( NULL == _rModel.getImageProducer( OClickableImageBaseModel::GuardAccess() ) ) + if ( nullptr == _rModel.getImageProducer( OClickableImageBaseModel::GuardAccess() ) ) throw css::lang::DisposedException( OUString(), static_cast< css::form::XImageProducerSupplier* >( &_rModel ) diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index e2976519f8bc..6fce82364851 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -171,7 +171,7 @@ ErrCode ImgProdLockBytes::Stat( SvLockBytesStat* pStat, SvLockBytesStatFlag eFla // - ImageProducer - ImageProducer::ImageProducer() - : mpStm(NULL) + : mpStm(nullptr) , mnTransIndex(0) , mbConsInit(false) { @@ -181,10 +181,10 @@ ImageProducer::ImageProducer() ImageProducer::~ImageProducer() { delete mpGraphic; - mpGraphic = NULL; + mpGraphic = nullptr; delete mpStm; - mpStm = NULL; + mpStm = nullptr; } // css::uno::XInterface @@ -233,10 +233,10 @@ void ImageProducer::SetImage( const OUString& rPath ) else if( !maURL.isEmpty() ) { SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_STD_READ ); - mpStm = pIStm ? new SvStream( new ImgProdLockBytes( pIStm, true ) ) : NULL; + mpStm = pIStm ? new SvStream( new ImgProdLockBytes( pIStm, true ) ) : nullptr; } else - mpStm = NULL; + mpStm = nullptr; } @@ -263,7 +263,7 @@ void ImageProducer::setImage( css::uno::Reference< css::io::XInputStream > & rIn if( rInputStmRef.is() ) mpStm = new SvStream( new ImgProdLockBytes( rInputStmRef ) ); else - mpStm = NULL; + mpStm = nullptr; } @@ -314,7 +314,7 @@ void ImageProducer::startProduction() throw(css::uno::RuntimeException, std::exc (*iter)->complete( css::awt::ImageStatus::IMAGESTATUS_STATICIMAGEDONE, this ); } - maDoneHdl.Call( NULL ); + maDoneHdl.Call( nullptr ); } } } @@ -441,7 +441,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic ) if( pBmpAcc ) { Bitmap aMask( aBmpEx.GetMask() ); - BitmapReadAccess* pMskAcc = !!aMask ? aMask.AcquireReadAccess() : NULL; + BitmapReadAccess* pMskAcc = !!aMask ? aMask.AcquireReadAccess() : nullptr; const long nWidth = pBmpAcc->Width(); const long nHeight = pBmpAcc->Height(); const long nStartX = 0L; diff --git a/forms/source/component/propertybaghelper.cxx b/forms/source/component/propertybaghelper.cxx index 410d88fde5e3..dfcc45856426 100644 --- a/forms/source/component/propertybaghelper.cxx +++ b/forms/source/component/propertybaghelper.cxx @@ -72,7 +72,7 @@ namespace frm PropertyBagHelper::PropertyBagHelper( IPropertyBagHelperContext& _rContext ) :m_rContext( _rContext ) - ,m_pPropertyArrayHelper( NULL ) + ,m_pPropertyArrayHelper( nullptr ) ,m_bDisposed( false ) { } @@ -80,7 +80,7 @@ namespace frm PropertyBagHelper::~PropertyBagHelper() { - delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = NULL; + delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = nullptr; } @@ -99,7 +99,7 @@ namespace frm void PropertyBagHelper::impl_nts_invalidatePropertySetInfo() { - delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = NULL; + delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = nullptr; } @@ -109,7 +109,7 @@ namespace frm // check the preferred handle sal_Int32 nHandle = lcl_getPropertyInfos().getPreferredPropertyId( _rPropertyName ); - if ( ( nHandle != -1 ) && rPropInfo.fillPropertyMembersByHandle( NULL, NULL, nHandle ) ) + if ( ( nHandle != -1 ) && rPropInfo.fillPropertyMembersByHandle( nullptr, nullptr, nHandle ) ) nHandle = -1; // search a free handle in F_1009 @@ -120,7 +120,7 @@ namespace frm sal_Int32 nNum = nFactor; while ( nNum != 1 ) { - if ( !rPropInfo.fillPropertyMembersByHandle( NULL, NULL, nNum + NEW_HANDLE_BASE ) ) + if ( !rPropInfo.fillPropertyMembersByHandle( nullptr, nullptr, nNum + NEW_HANDLE_BASE ) ) { // handle not used, yet nHandle = nNum + NEW_HANDLE_BASE; @@ -134,7 +134,7 @@ namespace frm if ( nHandle == -1 ) { nHandle = NEW_HANDLE_BASE + 1009; - while ( rPropInfo.fillPropertyMembersByHandle( NULL, NULL, nHandle ) ) + while ( rPropInfo.fillPropertyMembersByHandle( nullptr, nullptr, nHandle ) ) ++nHandle; } diff --git a/forms/source/helper/controlfeatureinterception.cxx b/forms/source/helper/controlfeatureinterception.cxx index a341316574ba..2cd10e668bc6 100644 --- a/forms/source/helper/controlfeatureinterception.cxx +++ b/forms/source/helper/controlfeatureinterception.cxx @@ -55,7 +55,7 @@ namespace frm // we are the master of the chain's first interceptor m_xFirstDispatchInterceptor = _rxInterceptor; - m_xFirstDispatchInterceptor->setMasterDispatchProvider( NULL ); + m_xFirstDispatchInterceptor->setMasterDispatchProvider( nullptr ); // it's the first of the interceptor chain } @@ -88,8 +88,8 @@ namespace frm Reference< XDispatchProviderInterceptor > xMaster( xChainWalk->getMasterDispatchProvider(), UNO_QUERY ); // unchain the interceptor that has to be removed - xChainWalk->setSlaveDispatchProvider( NULL ); - xChainWalk->setMasterDispatchProvider( NULL ); + xChainWalk->setSlaveDispatchProvider( nullptr ); + xChainWalk->setMasterDispatchProvider( nullptr ); // reconnect the chain if ( xMaster.is() ) @@ -115,12 +115,12 @@ namespace frm while ( xInterceptor.is() ) { // tell the interceptor it has a new (means no) predecessor - xInterceptor->setMasterDispatchProvider( NULL ); + xInterceptor->setMasterDispatchProvider( nullptr ); // ask for it's successor Reference< XDispatchProvider > xSlave = xInterceptor->getSlaveDispatchProvider(); // and give it the new (means no) successoert - xInterceptor->setSlaveDispatchProvider( NULL ); + xInterceptor->setSlaveDispatchProvider( nullptr ); // start over with the next chain element xInterceptor.set(xSlave, css::uno::UNO_QUERY); diff --git a/forms/source/helper/formnavigation.cxx b/forms/source/helper/formnavigation.cxx index 994574ee6170..e56f2f27b3b0 100644 --- a/forms/source/helper/formnavigation.cxx +++ b/forms/source/helper/formnavigation.cxx @@ -132,7 +132,7 @@ namespace frm if ( aFeature->second.xDispatcher == _rSource.Source ) { aFeature->second.xDispatcher->removeStatusListener( static_cast< XStatusListener* >( this ), aFeature->second.aURL ); - aFeature->second.xDispatcher = NULL; + aFeature->second.xDispatcher = nullptr; aFeature->second.bCachedState = false; aFeature->second.aCachedAdditionalState.clear(); --m_nConnectedFeatures; @@ -234,7 +234,7 @@ namespace frm if ( aFeature->second.xDispatcher.is() ) aFeature->second.xDispatcher->removeStatusListener( static_cast< XStatusListener* >( this ), aFeature->second.aURL ); - aFeature->second.xDispatcher = NULL; + aFeature->second.xDispatcher = nullptr; aFeature->second.bCachedState = false; aFeature->second.aCachedAdditionalState.clear(); } @@ -386,7 +386,7 @@ namespace frm if ( pAsciiURL ) _rURL = m_pUrlTransformer->getStrictURLFromAscii( pAsciiURL ); - return ( pAsciiURL != NULL ); + return ( pAsciiURL != nullptr ); } @@ -426,7 +426,7 @@ namespace frm FeatureURL( FormFeature::InteractiveFilter, URL_FORM_FILTER ), FeatureURL( FormFeature::ToggleApplyFilter, URL_FORM_APPLY_FILTER ), FeatureURL( FormFeature::RemoveFilterAndSort, URL_FORM_REMOVE_FILTER ), - FeatureURL( 0, NULL ) + FeatureURL( 0, nullptr ) }; return s_aFeatureURLs; } @@ -442,7 +442,7 @@ namespace frm return pFeatures->pAsciiURL; ++pFeatures; } - return NULL; + return nullptr; } diff --git a/forms/source/helper/windowstateguard.cxx b/forms/source/helper/windowstateguard.cxx index b5aeec7d562a..330424e9a6e4 100644 --- a/forms/source/helper/windowstateguard.cxx +++ b/forms/source/helper/windowstateguard.cxx @@ -198,7 +198,7 @@ namespace frm if ( m_pImpl.is() ) { m_pImpl->dispose(); - m_pImpl = NULL; + m_pImpl = nullptr; } Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY ); diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index f4f72cc38c06..bc75f4eea26d 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -580,7 +580,7 @@ void SAL_CALL OInterfaceContainer::read( const Reference< XObjectInputStream >& m_aItems.size(), // position xElement, // element to insert false, // no event attacher manager handling - NULL, // not yet approved - let implInsert do it + nullptr, // not yet approved - let implInsert do it true // fire the event ); } @@ -593,7 +593,7 @@ void SAL_CALL OInterfaceContainer::read( const Reference< XObjectInputStream >& // couldn't handle it throw; // insert the placeholder - implInsert( m_aItems.size(), xElement, false, NULL, true ); + implInsert( m_aItems.size(), xElement, false, nullptr, true ); } } } @@ -865,7 +865,7 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper if ( bHandleVbaEvents ) { Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY ); - OInterfaceContainer* pIfcMgr = xMgr.is() ? dynamic_cast(xMgr.get()) : NULL; + OInterfaceContainer* pIfcMgr = xMgr.is() ? dynamic_cast(xMgr.get()) : nullptr; if (pIfcMgr) { sal_Int32 nLen = pIfcMgr->getCount(); @@ -942,7 +942,7 @@ void SAL_CALL OInterfaceContainer::insertByIndex( sal_Int32 _nIndex, const Any& { Reference< XPropertySet > xElement; _rElement >>= xElement; - implInsert( _nIndex, xElement, true /* event handling */ , NULL /* not yet approved */ , true /* notification */ ); + implInsert( _nIndex, xElement, true /* event handling */ , nullptr /* not yet approved */ , true /* notification */ ); } @@ -1319,7 +1319,7 @@ void OFormComponents::disposing() { OInterfaceContainer::disposing(); FormComponentsBase::disposing(); - m_xParent = NULL; + m_xParent = nullptr; } //XChild diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx index f8d57762eeb1..ae27f25a2f34 100644 --- a/forms/source/misc/limitedformats.cxx +++ b/forms/source/misc/limitedformats.cxx @@ -95,7 +95,7 @@ namespace frm { "HH:MM:SS", -1, ltEnglishUS }, { "HH:MM AM/PM", -1, ltEnglishUS }, { "HH:MM:SS AM/PM", -1, ltEnglishUS }, - { NULL, -1, ltSystem } + { nullptr, -1, ltSystem } }; return s_aFormats; } @@ -117,14 +117,14 @@ namespace frm { "JJ-MM-TT", -1, ltGerman }, { "JJJJ-MM-TT", -1, ltGerman }, - { NULL, -1, ltSystem } + { nullptr, -1, ltSystem } }; return s_aFormats; } } OSL_FAIL("lcl_getFormatTable: invalid id!"); - return NULL; + return nullptr; } OLimitedFormats::OLimitedFormats(const Reference< XComponentContext >& _rxContext, const sal_Int16 _nClassId) @@ -252,11 +252,11 @@ namespace frm // seek to the nValue'th entry sal_Int32 nLookup = 0; for ( ; - (NULL != pFormats->pDescription) && (nLookup < nValue); + (nullptr != pFormats->pDescription) && (nLookup < nValue); ++pFormats, ++nLookup ) ; - OSL_ENSURE(NULL != pFormats->pDescription, "OLimitedFormats::getFormatKeyPropertyValue: did not find the value!"); + OSL_ENSURE(nullptr != pFormats->pDescription, "OLimitedFormats::getFormatKeyPropertyValue: did not find the value!"); if (pFormats->pDescription) _rValue <<= pFormats->nKey; } @@ -290,7 +290,7 @@ namespace frm // look for the entry with the given format key sal_Int32 nTablePosition = 0; for ( ; - (NULL != pFormats->pDescription) && (nNewFormat != pFormats->nKey); + (nullptr != pFormats->pDescription) && (nNewFormat != pFormats->nKey); ++pFormats, ++nTablePosition ) { @@ -298,7 +298,7 @@ namespace frm _rOldValue <<= pFormats->nKey; } - bool bFoundIt = (NULL != pFormats->pDescription); + bool bFoundIt = (nullptr != pFormats->pDescription); bool bModified = false; if (bFoundIt) { @@ -327,7 +327,7 @@ namespace frm if (!bFoundIt) { // somebody gave us a format which we can't translate OUString sMessage ("This control supports only a very limited number of formats."); - throw IllegalArgumentException(sMessage, NULL, 2); + throw IllegalArgumentException(sMessage, nullptr, 2); } return bModified; @@ -366,7 +366,7 @@ namespace frm if (0 == --s_nInstanceCount) { ::comphelper::disposeComponent(s_xStandardFormats); - s_xStandardFormats = NULL; + s_xStandardFormats = nullptr; clearTable(FormComponentType::TIMEFIELD); clearTable(FormComponentType::DATEFIELD); diff --git a/forms/source/resource/frm_resource.cxx b/forms/source/resource/frm_resource.cxx index 227803af0983..3ae6805694c3 100644 --- a/forms/source/resource/frm_resource.cxx +++ b/forms/source/resource/frm_resource.cxx @@ -33,7 +33,7 @@ namespace frm //= ResourceManager - SimpleResMgr* ResourceManager::m_pImpl = NULL; + SimpleResMgr* ResourceManager::m_pImpl = nullptr; ResourceManager::EnsureDelete::~EnsureDelete() diff --git a/forms/source/richtext/attributedispatcher.cxx b/forms/source/richtext/attributedispatcher.cxx index 971d66a43b6c..768d3f28becb 100644 --- a/forms/source/richtext/attributedispatcher.cxx +++ b/forms/source/richtext/attributedispatcher.cxx @@ -51,7 +51,7 @@ namespace frm void OAttributeDispatcher::disposing( ::osl::ClearableMutexGuard& _rClearBeforeNotify ) { - m_pMasterDispatcher = NULL; + m_pMasterDispatcher = nullptr; ORichTextFeatureDispatcher::disposing( _rClearBeforeNotify ); } @@ -102,7 +102,7 @@ namespace frm #endif if ( m_pMasterDispatcher ) - m_pMasterDispatcher->executeAttribute( m_nAttributeId, NULL ); + m_pMasterDispatcher->executeAttribute( m_nAttributeId, nullptr ); } diff --git a/forms/source/richtext/clipboarddispatcher.cxx b/forms/source/richtext/clipboarddispatcher.cxx index 84e82be27d43..09cbdbc5039d 100644 --- a/forms/source/richtext/clipboarddispatcher.cxx +++ b/forms/source/richtext/clipboarddispatcher.cxx @@ -130,7 +130,7 @@ namespace frm OPasteClipboardDispatcher::OPasteClipboardDispatcher( EditView& _rView ) :OClipboardDispatcher( _rView, ePaste ) - ,m_pClipListener( NULL ) + ,m_pClipListener( nullptr ) ,m_bPastePossible( false ) { m_pClipListener = new TransferableClipboardListener( LINK( this, OPasteClipboardDispatcher, OnClipboardChanged ) ); @@ -172,7 +172,7 @@ namespace frm m_pClipListener->AddRemoveListener( getEditView()->GetWindow(), false ); m_pClipListener->release(); - m_pClipListener = NULL; + m_pClipListener = nullptr; } OClipboardDispatcher::disposing( _rClearBeforeNotify ); diff --git a/forms/source/richtext/featuredispatcher.cxx b/forms/source/richtext/featuredispatcher.cxx index 34c6efb73193..66740eb5afa2 100644 --- a/forms/source/richtext/featuredispatcher.cxx +++ b/forms/source/richtext/featuredispatcher.cxx @@ -61,7 +61,7 @@ namespace frm void ORichTextFeatureDispatcher::disposing( ::osl::ClearableMutexGuard& /*_rClearBeforeNotify*/ ) { - m_pEditView = NULL; + m_pEditView = nullptr; } diff --git a/forms/source/richtext/parametrizedattributedispatcher.cxx b/forms/source/richtext/parametrizedattributedispatcher.cxx index b90da3285617..47fe59a182a3 100644 --- a/forms/source/richtext/parametrizedattributedispatcher.cxx +++ b/forms/source/richtext/parametrizedattributedispatcher.cxx @@ -97,7 +97,7 @@ namespace frm SfxAllItemSet aParameterSet( getEditView()->GetEmptyItemSet() ); TransformParameters( nSlotId, _rArguments, aParameterSet ); - const SfxPoolItem* pArgument = NULL; + const SfxPoolItem* pArgument = nullptr; if ( aParameterSet.Count() ) { OSL_ENSURE( aParameterSet.Count() == 1, "OParametrizedAttributeDispatcher::convertDispatchArgsToItem: Arguments which form more than 1 item? How this?" ); diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 1dc7d24dcc45..b3830c583a33 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -170,7 +170,7 @@ namespace frm mbCreatingPeer = true; // determine the VLC window for the parent - vcl::Window* pParentWin = NULL; + vcl::Window* pParentWin = nullptr; if ( _rParentPeer.is() ) { VCLXWindow* pParentXWin = VCLXWindow::GetImplementation( _rParentPeer ); @@ -277,7 +277,7 @@ namespace frm RichTextEngine* pEngine = ORichTextModel::getEditEngine( _rxModel ); OSL_ENSURE( pEngine, "ORichTextPeer::Create: could not obtaine the edit engine from the model!" ); if ( !pEngine ) - return NULL; + return nullptr; // the peer itself ORichTextPeer* pPeer = new ORichTextPeer; @@ -339,7 +339,7 @@ namespace frm return; OutputDevice* pTargetDevice = VCLUnoHelper::GetOutputDevice( getGraphics() ); - OSL_ENSURE( pTargetDevice != NULL, "ORichTextPeer::draw: no graphics -> no drawing!" ); + OSL_ENSURE( pTargetDevice != nullptr, "ORichTextPeer::draw: no graphics -> no drawing!" ); if ( !pTargetDevice ) return; @@ -468,10 +468,10 @@ namespace frm VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >(); OSL_PRECOND( pRichTextControl, "ORichTextPeer::implCreateDispatcher: invalid window!" ); if ( !pRichTextControl ) - return SingleAttributeDispatcher( NULL ); + return SingleAttributeDispatcher( nullptr ); - ORichTextFeatureDispatcher* pDispatcher = NULL; - OAttributeDispatcher* pAttributeDispatcher = NULL; + ORichTextFeatureDispatcher* pDispatcher = nullptr; + OAttributeDispatcher* pAttributeDispatcher = nullptr; switch ( _nSlotId ) { case SID_CUT: @@ -550,7 +550,7 @@ namespace frm { SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(); const SfxSlot* pSlot = rSlotPool.GetSlot( _nSlotId ); - const SfxType* pType = pSlot ? pSlot->GetType() : NULL; + const SfxType* pType = pSlot ? pSlot->GetType() : nullptr; if ( pType ) { bNeedParametrizedDispatcher = ( pType->nAttribs > 0 ); diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx index bce9f149c848..ede2b4dccb9e 100644 --- a/forms/source/richtext/richtextengine.cxx +++ b/forms/source/richtext/richtextengine.cxx @@ -82,7 +82,7 @@ namespace frm RichTextEngine* RichTextEngine::Clone() { - RichTextEngine* pClone( NULL ); + RichTextEngine* pClone( nullptr ); { SolarMutexGuard aGuard; std::unique_ptr pMyText(CreateTextObject()); diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index 040fda57952c..8eb2ae6a9343 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -43,12 +43,12 @@ namespace frm RichTextControlImpl::RichTextControlImpl( Control* _pAntiImpl, RichTextEngine* _pEngine, ITextAttributeListener* _pTextAttrListener, ITextSelectionListener* _pSelectionListener ) :m_pAntiImpl ( _pAntiImpl ) - ,m_pViewport ( NULL ) - ,m_pHScroll ( NULL ) - ,m_pVScroll ( NULL ) - ,m_pScrollCorner ( NULL ) + ,m_pViewport ( nullptr ) + ,m_pHScroll ( nullptr ) + ,m_pVScroll ( nullptr ) + ,m_pScrollCorner ( nullptr ) ,m_pEngine ( _pEngine ) - ,m_pView ( NULL ) + ,m_pView ( nullptr ) ,m_pTextAttrListener ( _pTextAttrListener ) ,m_pSelectionListener ( _pSelectionListener ) ,m_bHasEverBeenShown ( false ) diff --git a/forms/source/richtext/richtextimplcontrol.hxx b/forms/source/richtext/richtextimplcontrol.hxx index 7a3194642b23..265427428873 100644 --- a/forms/source/richtext/richtextimplcontrol.hxx +++ b/forms/source/richtext/richtextimplcontrol.hxx @@ -85,7 +85,7 @@ namespace frm void updateAttribute( AttributeId _nAttribute ); /// enables the callback for a particular attribute - void enableAttributeNotification( AttributeId _nAttributeId, ITextAttributeListener* _pListener = NULL ); + void enableAttributeNotification( AttributeId _nAttributeId, ITextAttributeListener* _pListener = nullptr ); /// disables the change notifications for a particular attribute void disableAttributeNotification( AttributeId _nAttributeId ); diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index 21a9f7f9c6b2..c2faf06964e8 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -516,7 +516,7 @@ namespace frm RichTextEngine* ORichTextModel::getEditEngine( const Reference< XControlModel >& _rxModel ) { - RichTextEngine* pEngine = NULL; + RichTextEngine* pEngine = nullptr; Reference< XUnoTunnel > xTunnel( _rxModel, UNO_QUERY ); OSL_ENSURE( xTunnel.is(), "ORichTextModel::getEditEngine: invalid model!" ); @@ -537,7 +537,7 @@ namespace frm Sequence< sal_Int8 > ORichTextModel::getEditEngineTunnelId() { - static ::cppu::OImplementationId * pId = 0; + static ::cppu::OImplementationId * pId = nullptr; if (! pId) { ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx index 7d0219e2c3a3..35293e59319b 100644 --- a/forms/source/richtext/richtextvclcontrol.cxx +++ b/forms/source/richtext/richtextvclcontrol.cxx @@ -44,7 +44,7 @@ namespace frm RichTextControl::RichTextControl( RichTextEngine* _pEngine, vcl::Window* _pParent, WinBits _nStyle, ITextAttributeListener* _pTextAttribListener, ITextSelectionListener* _pSelectionListener ) :Control( _pParent, implInitStyle( _nStyle ) ) - ,m_pImpl( NULL ) + ,m_pImpl( nullptr ) { implInit( _pEngine, _pTextAttribListener, _pSelectionListener ); } diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx index c7d9f896f0c1..a1789d4043b4 100644 --- a/forms/source/richtext/richtextvclcontrol.hxx +++ b/forms/source/richtext/richtextvclcontrol.hxx @@ -67,7 +67,7 @@ namespace frm If you previously already enabled the notification for this attribute, and specified a different listener, then the previous listener will be replaced with the new listener, provided the latter is not . */ - void enableAttributeNotification( AttributeId _nAttributeId, ITextAttributeListener* _pListener = NULL ); + void enableAttributeNotification( AttributeId _nAttributeId, ITextAttributeListener* _pListener = nullptr ); /** disables the change notifications for a particular attribute diff --git a/forms/source/richtext/richtextviewport.cxx b/forms/source/richtext/richtextviewport.cxx index abf83f63ee36..36aeef8101cf 100644 --- a/forms/source/richtext/richtextviewport.cxx +++ b/forms/source/richtext/richtextviewport.cxx @@ -24,7 +24,7 @@ namespace frm { RichTextViewPort::RichTextViewPort( vcl::Window* _pParent ) : Control ( _pParent ) - , m_pView(NULL) + , m_pView(nullptr) , m_bHideInactiveSelection( true ) { } diff --git a/forms/source/richtext/richtextviewport.hxx b/forms/source/richtext/richtextviewport.hxx index 25e172e623bc..ec488e6b8b2d 100644 --- a/forms/source/richtext/richtextviewport.hxx +++ b/forms/source/richtext/richtextviewport.hxx @@ -54,7 +54,7 @@ namespace frm private: inline void implInvalidateAttributes() const { - m_aInvalidationHandler.Call( NULL ); + m_aInvalidationHandler.Call( nullptr ); } }; diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx index da0d9c4596ad..b4793cbeb94a 100644 --- a/forms/source/richtext/rtattributehandler.cxx +++ b/forms/source/richtext/rtattributehandler.cxx @@ -409,7 +409,7 @@ namespace frm // if the current adjustment of the was the default adjustment for the *previous* text direction, // then we toggle the adjustment, too SvxAdjust eCurrentAdjustment = SVX_ADJUST_LEFT; - const SfxPoolItem* pCurrentAdjustment = NULL; + const SfxPoolItem* pCurrentAdjustment = nullptr; if ( SfxItemState::SET == _rCurrentAttribs.GetItemState( EE_PARA_JUST, true, &pCurrentAdjustment ) ) eCurrentAdjustment = static_cast< const SvxAdjustItem* >( pCurrentAdjustment )->GetAdjust(); diff --git a/forms/source/richtext/rtattributes.hxx b/forms/source/richtext/rtattributes.hxx index f8d4f7a98229..5e61f55dbffa 100644 --- a/forms/source/richtext/rtattributes.hxx +++ b/forms/source/richtext/rtattributes.hxx @@ -62,19 +62,19 @@ namespace frm }; inline AttributeState::AttributeState( ) - :pItemHandleItem ( NULL ) + :pItemHandleItem ( nullptr ) ,eSimpleState( eIndetermined ) { } inline AttributeState::AttributeState( AttributeCheckState _eCheckState ) - :pItemHandleItem ( NULL ) + :pItemHandleItem ( nullptr ) ,eSimpleState( _eCheckState ) { } inline AttributeState::AttributeState( const AttributeState& _rSource ) - :pItemHandleItem ( NULL ) + :pItemHandleItem ( nullptr ) ,eSimpleState( eIndetermined ) { operator=( _rSource ); @@ -107,7 +107,7 @@ namespace frm if ( _pItem ) pItemHandleItem = _pItem->Clone(); else - pItemHandleItem = NULL; + pItemHandleItem = nullptr; } inline bool AttributeState::operator==( const AttributeState& _rRHS ) diff --git a/forms/source/richtext/specialdispatchers.cxx b/forms/source/richtext/specialdispatchers.cxx index bc288a949371..fd9be3973820 100644 --- a/forms/source/richtext/specialdispatchers.cxx +++ b/forms/source/richtext/specialdispatchers.cxx @@ -60,7 +60,7 @@ namespace frm checkDisposed(); - EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : NULL; + EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : nullptr; OSL_ENSURE( pEngine, "OSelectAllDispatcher::dispatch: no edit engine - but not yet disposed?" ); if ( !pEngine ) return; @@ -93,7 +93,7 @@ namespace frm { FeatureStateEvent aEvent( OAttributeDispatcher::buildStatusEvent() ); - EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : NULL; + EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : nullptr; OSL_ENSURE( pEngine, "OParagraphDirectionDispatcher::dispatch: no edit engine - but not yet disposed?" ); if ( pEngine && pEngine->IsVertical() ) aEvent.IsEnabled = sal_False; @@ -115,7 +115,7 @@ namespace frm checkDisposed(); - EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : NULL; + EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : nullptr; OSL_ENSURE( pEngine, "OTextDirectionDispatcher::dispatch: no edit engine - but not yet disposed?" ); if ( !pEngine ) return; @@ -128,7 +128,7 @@ namespace frm { FeatureStateEvent aEvent( ORichTextFeatureDispatcher::buildStatusEvent() ); - EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : NULL; + EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : nullptr; OSL_ENSURE( pEngine, "OTextDirectionDispatcher::dispatch: no edit engine - but not yet disposed?" ); aEvent.IsEnabled = sal_True; @@ -164,7 +164,7 @@ namespace frm } OSL_FAIL( "OAsianFontLayoutDispatcher::convertDispatchArgsToItem: did not find the one and only argument!" ); - return NULL; + return nullptr; } diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 53dd2f41416a..5954c3bd20f9 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -620,7 +620,7 @@ namespace frm case FormFeature::ReloadForm: if ( m_xLoadableForm.is() ) { - WaitObject aWO( NULL ); + WaitObject aWO( nullptr ); m_xLoadableForm->reload(); // refresh all controls in the form (and sub forms) which can be refreshed @@ -745,7 +745,7 @@ namespace frm aValues[0] <<= OUString(); aValues[1] <<= OUString(); - WaitObject aWO( NULL ); + WaitObject aWO( nullptr ); xProperties->setPropertyValues( aNames, aValues ); if ( m_xLoadableForm.is() ) @@ -763,7 +763,7 @@ namespace frm m_xCursorProperties->setPropertyValue( PROPERTY_APPLYFILTER, makeAny( !bApplied ) ); // and reload - WaitObject aWO( NULL ); + WaitObject aWO( nullptr ); m_xLoadableForm->reload(); } break; @@ -1395,7 +1395,7 @@ namespace frm { OSL_PRECOND( m_xController.is(), "FormOperations::impl_getCurrentBoundField_nothrow: no controller -> no control!" ); if ( !m_xController.is() ) - return NULL; + return nullptr; Reference< XPropertySet > xField; try @@ -1569,7 +1569,7 @@ namespace frm impl_appendOrderByColumn_throw aAction(this, xBoundField, _bUp); impl_doActionInSQLContext_throw(aAction, RID_STR_COULD_NOT_SET_ORDER ); - WaitObject aWO( NULL ); + WaitObject aWO( nullptr ); try { m_xCursorProperties->setPropertyValue( PROPERTY_SORT, makeAny( m_xParser->getOrder() ) ); @@ -1635,7 +1635,7 @@ namespace frm impl_appendFilterByColumn_throw aAction(this, xBoundField); impl_doActionInSQLContext_throw( aAction, RID_STR_COULD_NOT_SET_FILTER ); - WaitObject aWO( NULL ); + WaitObject aWO( nullptr ); try { m_xCursorProperties->setPropertyValue( PROPERTY_FILTER, makeAny( m_xParser->getFilter() ) ); @@ -1700,7 +1700,7 @@ namespace frm if ( RET_OK == xDialog->execute() ) { - WaitObject aWO( NULL ); + WaitObject aWO( nullptr ); if ( _bFilter ) m_xCursorProperties->setPropertyValue( PROPERTY_FILTER, makeAny( m_xParser->getFilter() ) ); else diff --git a/forms/source/runtime/formoperations.hxx b/forms/source/runtime/formoperations.hxx index 197481003f98..4602445491b5 100644 --- a/forms/source/runtime/formoperations.hxx +++ b/forms/source/runtime/formoperations.hxx @@ -272,7 +272,7 @@ namespace frm @precond our mutex is locked */ - bool impl_commitCurrentRecord_throw( sal_Bool* _pRecordInserted = NULL ) const; + bool impl_commitCurrentRecord_throw( sal_Bool* _pRecordInserted = nullptr ) const; /** impl-version of commitCurrentControl, which can be called in const-contexts diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx index e7c862494a89..6c182cb2f158 100644 --- a/forms/source/solar/component/navbarcontrol.cxx +++ b/forms/source/solar/component/navbarcontrol.cxx @@ -121,7 +121,7 @@ namespace frm mbCreatingPeer = true; // determine the VLC window for the parent - vcl::Window* pParentWin = NULL; + vcl::Window* pParentWin = nullptr; if ( _rParentPeer.is() ) { VCLXWindow* pParentXWin = VCLXWindow::GetImplementation( _rParentPeer ); diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index 90723a27b9c0..6f0226c93c80 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -64,7 +64,7 @@ namespace frm OUString lcl_getCommandURL( const sal_Int16 _nFormFeature ) { - const sal_Char* pAsciiCommandName = NULL; + const sal_Char* pAsciiCommandName = nullptr; switch ( _nFormFeature ) { case FormFeature::MoveAbsolute : pAsciiCommandName = "AbsoluteRecord"; break; @@ -87,7 +87,7 @@ namespace frm case FormFeature::ToggleApplyFilter : pAsciiCommandName = "FormFiltered"; break; case FormFeature::RemoveFilterAndSort : pAsciiCommandName = "RemoveFilterSort"; break; } - if ( pAsciiCommandName != NULL ) + if ( pAsciiCommandName != nullptr ) return ".uno:" + OUString::createFromAscii( pAsciiCommandName ); OSL_FAIL( "lcl_getCommandURL: unknown FormFeature!" ); @@ -103,7 +103,7 @@ namespace frm public: explicit ImplNavToolBar( vcl::Window* _pParent ) :ToolBox( _pParent, WB_3DLOOK ) - ,m_pDispatcher( NULL ) + ,m_pDispatcher( nullptr ) { } @@ -135,11 +135,11 @@ namespace frm NavigationToolBar::NavigationToolBar( vcl::Window* _pParent, WinBits _nStyle, const PCommandImageProvider& _pImageProvider, const PCommandDescriptionProvider& _pDescriptionProvider ) :Window( _pParent, _nStyle ) - ,m_pDispatcher( NULL ) + ,m_pDispatcher( nullptr ) ,m_pImageProvider( _pImageProvider ) ,m_pDescriptionProvider( _pDescriptionProvider ) ,m_eImageSize( eSmall ) - ,m_pToolbar( NULL ) + ,m_pToolbar( nullptr ) { implInit( ); } @@ -298,7 +298,7 @@ namespace frm if ( pSupportedFeatures->bItemWindow ) { - vcl::Window* pItemWindow = NULL; + vcl::Window* pItemWindow = nullptr; if ( FormFeature::MoveAbsolute == pSupportedFeatures->nId ) { pItemWindow = VclPtr::Create( m_pToolbar ); @@ -337,7 +337,7 @@ namespace frm } } - forEachItemWindow( &NavigationToolBar::adjustItemWindowWidth, NULL ); + forEachItemWindow( &NavigationToolBar::adjustItemWindowWidth, nullptr ); implUpdateImages(); } @@ -409,7 +409,7 @@ namespace frm void NavigationToolBar::ShowFunctionGroup( FunctionGroup _eGroup, bool _bShow ) { - const sal_uInt16* pGroupIds = NULL; + const sal_uInt16* pGroupIds = nullptr; switch ( _eGroup ) { @@ -486,12 +486,12 @@ namespace frm break; case StateChangedType::ControlFont: - forEachItemWindow( &NavigationToolBar::setItemControlFont, NULL ); - forEachItemWindow( &NavigationToolBar::adjustItemWindowWidth, NULL ); + forEachItemWindow( &NavigationToolBar::setItemControlFont, nullptr ); + forEachItemWindow( &NavigationToolBar::adjustItemWindowWidth, nullptr ); break; case StateChangedType::ControlForeground: - forEachItemWindow( &NavigationToolBar::setItemControlForeground, NULL ); + forEachItemWindow( &NavigationToolBar::setItemControlForeground, nullptr ); break; case StateChangedType::Mirroring: @@ -524,7 +524,7 @@ namespace frm { Window::SetControlBackground(); m_pToolbar->SetControlBackground(); - forEachItemWindow( &NavigationToolBar::setItemBackground, NULL ); + forEachItemWindow( &NavigationToolBar::setItemBackground, nullptr ); implUpdateImages(); } @@ -544,7 +544,7 @@ namespace frm { Window::SetTextLineColor( ); m_pToolbar->SetTextLineColor( ); - forEachItemWindow( &NavigationToolBar::setTextLineColor, NULL ); + forEachItemWindow( &NavigationToolBar::setTextLineColor, nullptr ); } @@ -659,7 +659,7 @@ namespace frm RecordPositionInput::RecordPositionInput( vcl::Window* _pParent ) :NumericField( _pParent, WB_BORDER | WB_VCENTER ) - ,m_pDispatcher( NULL ) + ,m_pDispatcher( nullptr ) { SetMin( 1 ); SetFirst( 1 ); diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index ebb8eb45b35e..9c7f4484674f 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -137,7 +137,7 @@ Binding::Binding() : Binding::~Binding() { - _setModel(NULL); + _setModel(nullptr); } void Binding::_setModel( const css::uno::Reference& xModel ) @@ -162,7 +162,7 @@ void Binding::_setModel( const css::uno::Reference& xModel OUString Binding::getModelID() const { Model* pModel = getModelImpl(); - return ( pModel == NULL ) ? OUString() : pModel->getID(); + return ( pModel == nullptr ) ? OUString() : pModel->getID(); } @@ -243,7 +243,7 @@ bool Binding::isUseful() // 3) we are bound to some control // (this can be assumed if some listeners are set) bool bUseful = - getModelImpl() == NULL + getModelImpl() == nullptr // || msBindingID.getLength() > 0 || ! msTypeName.isEmpty() || ! maReadonly.isEmptyExpression() @@ -298,7 +298,7 @@ OUString Binding::explainInvalid() EvaluationContext Binding::getEvaluationContext() const { - OSL_ENSURE( getModelImpl() != NULL, "need model impl" ); + OSL_ENSURE( getModelImpl() != nullptr, "need model impl" ); EvaluationContext aContext = getModelImpl()->getEvaluationContext(); aContext.mxNamespaces = getBindingNamespaces(); return aContext; @@ -306,7 +306,7 @@ EvaluationContext Binding::getEvaluationContext() const ::std::vector Binding::getMIPEvaluationContexts() { - OSL_ENSURE( getModelImpl() != NULL, "need model impl" ); + OSL_ENSURE( getModelImpl() != nullptr, "need model impl" ); // bind (in case we were not bound before) bind(); @@ -325,7 +325,7 @@ Binding* SAL_CALL Binding::getBinding( const Reference& xPropertyS Reference xTunnel( xPropertySet, UNO_QUERY ); return xTunnel.is() ? reinterpret_cast( xTunnel->getSomething(getUnoTunnelID())) - : NULL; + : nullptr; } @@ -492,7 +492,7 @@ Model* Binding::getModelImpl( const css::uno::Reference& xM Model* pModel = xTunnel.is() ? reinterpret_cast( xTunnel->getSomething( Model::getUnoTunnelID() ) ) - : NULL; + : nullptr; return pModel; } @@ -538,7 +538,7 @@ static void lcl_removeListenerFromNode( Reference xNode, ::std::vector Binding::_getMIPEvaluationContexts() const { - OSL_ENSURE( getModelImpl() != NULL, "need model impl" ); + OSL_ENSURE( getModelImpl() != nullptr, "need model impl" ); // iterate over nodes of bind expression and create // EvaluationContext for each @@ -621,7 +621,7 @@ void Binding::bind( bool bForceRebind ) // 3) remove old MIPs defined by this binding Model* pModel = getModelImpl(); - OSL_ENSURE( pModel != NULL, "need model" ); + OSL_ENSURE( pModel != nullptr, "need model" ); pModel->removeMIPs( this ); // 4) calculate all MIPs @@ -809,7 +809,7 @@ css::uno::Reference Binding::getDataType() return ( xRepository.is() && xRepository->hasByName( sTypeName ) ) ? Reference( xRepository->getByName( sTypeName ), UNO_QUERY) - : Reference( NULL ); + : Reference( nullptr ); } bool Binding::isValid_DataType() @@ -831,7 +831,7 @@ void Binding::clear() { // remove MIPs contributed by this binding Model* pModel = getModelImpl(); - if( pModel != NULL ) + if( pModel != nullptr ) pModel->removeMIPs( this ); // remove all references @@ -924,7 +924,7 @@ css::uno::Reference Binding::_getNamespaces() co // merge model's with binding's own namespaces Model* pModel = getModelImpl(); - if( pModel != NULL ) + if( pModel != nullptr ) lcl_copyNamespaces( pModel->getNamespaces(), xNamespaces, false ); return xNamespaces; @@ -936,10 +936,10 @@ void Binding::_setNamespaces( const css::uno::Reference xModelNamespaces = ( pModel != NULL ) + css::uno::Reference xModelNamespaces = ( pModel != nullptr ) ? pModel->getNamespaces() - : NULL; - OSL_ENSURE( ( pModel != NULL ) == xModelNamespaces.is(), "no model nmsp?"); + : nullptr; + OSL_ENSURE( ( pModel != nullptr ) == xModelNamespaces.is(), "no model nmsp?"); // remove deleted namespaces lcl_removeOtherNamespaces( rNamespaces, mxNamespaces ); @@ -1265,7 +1265,7 @@ void Binding::handleEvent( const css::uno::Reference& xId ) throw( RuntimeException, std::exception ) { - return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : NULL ); + return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : nullptr ); } @@ -1298,11 +1298,11 @@ css::uno::Reference SAL_CALL Binding::createClone() #define REGISTER_PROPERTY_RO( property, type ) \ registerProperty( PROPERTY_RO( property, type ), \ - new DirectPropertyAccessor< Binding, type >( this, NULL, &Binding::get##property ) ); + new DirectPropertyAccessor< Binding, type >( this, nullptr, &Binding::get##property ) ); #define REGISTER_BOOL_PROPERTY_RO( property ) \ registerProperty( PROPERTY_RO( property, sal_Bool ), \ - new BooleanPropertyAccessor< Binding, bool >( this, NULL, &Binding::get##property ) ); + new BooleanPropertyAccessor< Binding, bool >( this, nullptr, &Binding::get##property ) ); void Binding::initializePropertySet() { diff --git a/forms/source/xforms/convert.cxx b/forms/source/xforms/convert.cxx index ddf1c7c8dc0e..0e05f2ef2221 100644 --- a/forms/source/xforms/convert.cxx +++ b/forms/source/xforms/convert.cxx @@ -286,11 +286,11 @@ void Convert::init() Convert& Convert::get() { // create our Singleton instance on demand - static Convert* pConvert = NULL; - if( pConvert == NULL ) + static Convert* pConvert = nullptr; + if( pConvert == nullptr ) pConvert = new Convert(); - OSL_ENSURE( pConvert != NULL, "no converter?" ); + OSL_ENSURE( pConvert != nullptr, "no converter?" ); return *pConvert; } diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index 4095073e1e3a..b7fe53b77b33 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -101,8 +101,8 @@ void Model::ensureAtLeastOneInstance() /** Model default constructor; create empty model */ Model::Model() : msID(), - mpBindings( NULL ), - mpSubmissions( NULL ), + mpBindings( nullptr ), + mpSubmissions( nullptr ), mpInstances( new InstanceCollection ), mxNamespaces( new NameContainer() ), mxBindings( mpBindings ), @@ -129,13 +129,13 @@ Model::~Model() throw() { // give up bindings & submissions; the mxBindings/mxSubmissions // references will then delete them - mpBindings = NULL; - mpSubmissions = NULL; + mpBindings = nullptr; + mpSubmissions = nullptr; } static Model* lcl_getModel( const Reference& xTunnel ) { - Model* pModel = NULL; + Model* pModel = nullptr; if( xTunnel.is() ) pModel = reinterpret_cast( xTunnel->getSomething( Model::getUnoTunnelID() ) ); @@ -219,7 +219,7 @@ void Model::dbg_assertInvariant() const // MIP management void Model::addMIP( void* pTag, const XNode_t& xNode, const MIP& rMIP ) { - OSL_ENSURE( pTag != NULL, "empty tag?" ); + OSL_ENSURE( pTag != nullptr, "empty tag?" ); OSL_ENSURE( xNode.is(), "no node" ); MIPs_t::value_type aValue( xNode, ::std::pair( pTag, rMIP ) ); @@ -228,7 +228,7 @@ void Model::addMIP( void* pTag, const XNode_t& xNode, const MIP& rMIP ) void Model::removeMIPs( void* pTag ) { - OSL_ENSURE( pTag != NULL, "empty tag?" ); + OSL_ENSURE( pTag != nullptr, "empty tag?" ); for( MIPs_t::iterator aIter = maMIPs.begin(); aIter != maMIPs.end(); ) @@ -273,14 +273,14 @@ MIP Model::queryMIP( const XNode_t& xNode ) const void Model::rebind() { - OSL_ENSURE( mpBindings != NULL, "bindings?" ); + OSL_ENSURE( mpBindings != nullptr, "bindings?" ); // iterate over all bindings and call update sal_Int32 nCount = mpBindings->countItems(); for( sal_Int32 i = 0; i < nCount; i++ ) { Binding* pBind = Binding::getBinding( mpBindings->Collection::getItem( i ) ); - OSL_ENSURE( pBind != NULL, "binding?" ); + OSL_ENSURE( pBind != nullptr, "binding?" ); pBind->update(); } } @@ -294,7 +294,7 @@ void Model::deferNotifications( bool bDefer ) for( sal_Int32 i = 0; i < nCount; i++ ) { Binding* pBind = Binding::getBinding( mpBindings->Collection::getItem( i ) ); - OSL_ENSURE( pBind != NULL, "binding?" ); + OSL_ENSURE( pBind != nullptr, "binding?" ); pBind->deferNotifications( bDefer ); } } @@ -370,7 +370,7 @@ void Model::loadInstance( sal_Int32 nInstance ) // find URL from instance OUString sURL; bool bOnce = false; - getInstanceData( aSequence, NULL, NULL, &sURL, &bOnce ); + getInstanceData( aSequence, nullptr, nullptr, &sURL, &bOnce ); // if we have a URL, load the document and set it into the instance if( !sURL.isEmpty() ) @@ -386,8 +386,8 @@ void Model::loadInstance( sal_Int32 nInstance ) if( xInstance.is() ) { OUString sEmpty; - setInstanceData( aSequence, NULL, &xInstance, - bOnce ? &sEmpty : &sURL, NULL); + setInstanceData( aSequence, nullptr, &xInstance, + bOnce ? &sEmpty : &sURL, nullptr); mpInstances->setItem( nInstance, aSequence ); } } @@ -417,7 +417,7 @@ bool Model::isValid() const for( sal_Int32 i = 0; bValid && i < nCount; i++ ) { Binding* pBind = Binding::getBinding( mpBindings->Collection::getItem( i ) ); - OSL_ENSURE( pBind != NULL, "binding?" ); + OSL_ENSURE( pBind != nullptr, "binding?" ); bValid = pBind->isValid(); } return bValid; @@ -497,7 +497,7 @@ void SAL_CALL Model::submitWithInteraction( { Submission* pSubmission = Submission::getSubmission( mpSubmissions->getItem( sID ) ); - OSL_ENSURE( pSubmission != NULL, "no submission?" ); + OSL_ENSURE( pSubmission != nullptr, "no submission?" ); OSL_ENSURE( pSubmission->getModel() == Reference( this ), "wrong model" ); @@ -509,7 +509,7 @@ void SAL_CALL Model::submitWithInteraction( void Model::submit( const OUString& sID ) throw( VetoException, WrappedTargetException, RuntimeException, std::exception ) { - submitWithInteraction( sID, NULL ); + submitWithInteraction( sID, nullptr ); } css::uno::Reference SAL_CALL Model::getDataTypeRepository( ) @@ -539,7 +539,7 @@ css::uno::Reference Model::getInstanceDocument( const sal_Int32 nInstance = lcl_findInstance( mpInstances, rName ); if( nInstance != -1 ) getInstanceData( mpInstances->getItem( nInstance ), - NULL, &aInstance, NULL, NULL ); + nullptr, &aInstance, nullptr, nullptr ); return aInstance; } @@ -549,7 +549,7 @@ css::uno::Reference SAL_CALL Model::getDefaultInstance ensureAtLeastOneInstance(); DBG_ASSERT( mpInstances->countItems() > 0, "no instance?" ); Reference aInstance; - getInstanceData( mpInstances->getItem( 0 ), NULL, &aInstance, NULL, NULL ); + getInstanceData( mpInstances->getItem( 0 ), nullptr, &aInstance, nullptr, nullptr ); return aInstance; } @@ -579,7 +579,7 @@ Model::XPropertySet_t Model::getBinding( const OUString& sId ) throw( RuntimeException, std::exception ) { DBG_INVARIANT(); - return mpBindings->hasItem( sId ) ? mpBindings->getItem( sId ) : NULL; + return mpBindings->hasItem( sId ) ? mpBindings->getItem( sId ) : nullptr; } css::uno::Reference Model::getBindings() @@ -670,7 +670,7 @@ void Model::update() sal_Int64 Model::getSomething( const css::uno::Sequence& xId ) throw( RuntimeException, std::exception ) { - return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : NULL ); + return reinterpret_cast( ( xId == getUnoTunnelID() ) ? this : nullptr ); } Sequence Model::getImplementationId() diff --git a/forms/source/xforms/model_helper.hxx b/forms/source/xforms/model_helper.hxx index 0635b7be35de..3f2752c314ed 100644 --- a/forms/source/xforms/model_helper.hxx +++ b/forms/source/xforms/model_helper.hxx @@ -57,19 +57,19 @@ public: virtual bool isValid( const T& t ) const override { - return Binding::getBinding( t ) != NULL; + return Binding::getBinding( t ) != nullptr; } protected: virtual void _insert( const T& t ) override { - OSL_ENSURE( Binding::getBinding( t ) != NULL, "invalid item?" ); + OSL_ENSURE( Binding::getBinding( t ) != nullptr, "invalid item?" ); Binding::getBinding( t )->_setModel( css::uno::Reference( mpModel ) ); } virtual void _remove( const T& t ) override { - OSL_ENSURE( Binding::getBinding( t ) != NULL, "invalid item?" ); + OSL_ENSURE( Binding::getBinding( t ) != nullptr, "invalid item?" ); Binding::getBinding( t )->_setModel( css::uno::Reference() ); } }; @@ -85,19 +85,19 @@ public: public: virtual bool isValid( const T& t ) const override { - return Submission::getSubmission( t ) != NULL; + return Submission::getSubmission( t ) != nullptr; } protected: virtual void _insert( const T& t ) override { - OSL_ENSURE( Submission::getSubmission( t ) != NULL, "invalid item?" ); + OSL_ENSURE( Submission::getSubmission( t ) != nullptr, "invalid item?" ); Submission::getSubmission( t )->setModel( css::uno::Reference( mpModel ) ); } virtual void _remove( const T& t ) override { - OSL_ENSURE( Submission::getSubmission( t ) != NULL, "invalid item?" ); + OSL_ENSURE( Submission::getSubmission( t ) != nullptr, "invalid item?" ); Submission::getSubmission( t )->setModel( css::uno::Reference( ) ); } }; diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index 730a0f69b405..dd393299fe23 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -134,7 +134,7 @@ static void lcl_OutPosition( OUStringBuffer& rBuffer, if( xNode->getParentNode().is() ) { for( Reference xIter = xNode->getParentNode()->getFirstChild(); - xIter != NULL; + xIter != nullptr; xIter = xIter->getNextSibling() ) { if( xIter->getNodeType() == xNode->getNodeType() && @@ -192,7 +192,7 @@ static void lcl_OutInstance( OUStringBuffer& rBuffer, // get ID and instance OUString sId; Reference xInstance; - getInstanceData( aValues, &sId, &xInstance, NULL, NULL ); + getInstanceData( aValues, &sId, &xInstance, nullptr, nullptr ); // now check whether this was our instance: if( xInstance == xDoc ) @@ -247,7 +247,7 @@ OUString Model::getDefaultBindingExpressionForNode( default: // unknown type? fail! OSL_FAIL( "unknown node type!" ); - xCurrent.set( NULL ); + xCurrent.set( nullptr ); aBuffer.makeStringAndClear(); // we'll remove the slash below aBuffer.insert( 0, '/' ); @@ -399,7 +399,7 @@ void Model::removeBindingIfUseless( const XPropertySet_t& xBinding ) throw( RuntimeException, std::exception ) { Binding* pBinding = Binding::getBinding( xBinding ); - if( pBinding != NULL ) + if( pBinding != nullptr ) { if( ! pBinding->isUseful() ) mpBindings->removeItem( pBinding ); @@ -450,7 +450,7 @@ sal_Int32 xforms::lcl_findInstance( const InstanceCollection* pInstances, for( ; !bFound && n < nLength; n++ ) { OUString sName; - getInstanceData( pInstances->getItem( n ), &sName, NULL, NULL, NULL ); + getInstanceData( pInstances->getItem( n ), &sName, nullptr, nullptr, nullptr ); bFound = ( sName == rName ); } return bFound ? ( n - 1 ) : -1; @@ -702,7 +702,7 @@ Model::XPropertySet_t Model::getBindingForNode( const XNode_t& xNode, // appropriateness of the respective binding for this node. The // best one will be used. If we don't find any and bCreate is set, // then we will create a suitable binding. - Binding* pBestBinding = NULL; + Binding* pBestBinding = nullptr; sal_Int32 nBestScore = 0; for( sal_Int32 n = 0; n < mpBindings->countItems(); n++ ) @@ -710,7 +710,7 @@ Model::XPropertySet_t Model::getBindingForNode( const XNode_t& xNode, Binding* pBinding = Binding::getBinding( mpBindings->Collection::getItem( n ) ); - OSL_ENSURE( pBinding != NULL, "no binding?" ); + OSL_ENSURE( pBinding != nullptr, "no binding?" ); Reference xNodeList = pBinding->getXNodeList(); sal_Int32 nNodes = xNodeList.is() ? xNodeList->getLength() : 0; @@ -736,9 +736,9 @@ Model::XPropertySet_t Model::getBindingForNode( const XNode_t& xNode, } // create binding, if none was found and bCreate is set - OSL_ENSURE( ( nBestScore == 0 ) == ( pBestBinding == NULL ), + OSL_ENSURE( ( nBestScore == 0 ) == ( pBestBinding == nullptr ), "score != binding?" ); - if( bCreate && pBestBinding == NULL ) + if( bCreate && pBestBinding == nullptr ) { pBestBinding = new Binding(); pBestBinding->setBindingExpression( @@ -905,7 +905,7 @@ OUString Model::getResultForExpression( throw( RuntimeException, std::exception ) { Binding* pBinding = Binding::getBinding( xBinding ); - if( pBinding == NULL ) + if( pBinding == nullptr ) throw RuntimeException(); // prepare & evaluate expression @@ -938,13 +938,13 @@ OUString Model::getResultForExpression( sal_Bool Model::isValidXMLName( const OUString& sName ) throw( RuntimeException, std::exception ) { - return isValidQName( sName, NULL ); + return isValidQName( sName, nullptr ); } sal_Bool Model::isValidPrefixName( const OUString& sName ) throw( RuntimeException, std::exception ) { - return ::isValidPrefixName( sName, NULL ); + return ::isValidPrefixName( sName, nullptr ); } void Model::setNodeValue( @@ -973,7 +973,7 @@ void xforms::getInstanceData( { const PropertyValue& rValue = pValues[n]; #define PROP(NAME) \ - if( p##NAME != NULL && \ + if( p##NAME != nullptr && \ rValue.Name == #NAME ) \ rValue.Value >>= (*p##NAME) PROP(ID); @@ -997,13 +997,13 @@ void xforms::setInstanceData( OUString sURL; bool bURLOnce = false; getInstanceData( aSequence, &sID, &xInstance, &sURL, &bURLOnce ); - const OUString* pID = !sID.isEmpty() ? &sID : NULL; - const Reference* pInstance = xInstance.is() ? &xInstance : NULL; - const OUString* pURL = !sURL.isEmpty() ? &sURL : NULL; - const bool* pURLOnce = ( bURLOnce && pURL != NULL ) ? &bURLOnce : NULL; + const OUString* pID = !sID.isEmpty() ? &sID : nullptr; + const Reference* pInstance = xInstance.is() ? &xInstance : nullptr; + const OUString* pURL = !sURL.isEmpty() ? &sURL : nullptr; + const bool* pURLOnce = ( bURLOnce && pURL != nullptr ) ? &bURLOnce : nullptr; // determine new instance data -#define PROP(NAME) if( _p##NAME != NULL ) p##NAME = _p##NAME +#define PROP(NAME) if( _p##NAME != nullptr ) p##NAME = _p##NAME PROP(ID); PROP(Instance); PROP(URL); @@ -1012,7 +1012,7 @@ void xforms::setInstanceData( // count # of values we want to set sal_Int32 nCount = 0; -#define PROP(NAME) if( p##NAME != NULL ) nCount++ +#define PROP(NAME) if( p##NAME != nullptr ) nCount++ PROP(ID); PROP(Instance); PROP(URL); @@ -1024,7 +1024,7 @@ void xforms::setInstanceData( PropertyValue* pSequence = aSequence.getArray(); sal_Int32 nIndex = 0; #define PROP(NAME) \ - if( p##NAME != NULL ) \ + if( p##NAME != nullptr ) \ { \ pSequence[ nIndex ].Name = #NAME; \ pSequence[ nIndex ].Value <<= *p##NAME; \ diff --git a/forms/source/xforms/propertysetbase.cxx b/forms/source/xforms/propertysetbase.cxx index 815f04c9d748..986635143f71 100644 --- a/forms/source/xforms/propertysetbase.cxx +++ b/forms/source/xforms/propertysetbase.cxx @@ -45,7 +45,7 @@ PropertyAccessorBase::~PropertyAccessorBase() } PropertySetBase::PropertySetBase( ) - :m_pProperties( NULL ) + :m_pProperties( nullptr ) { } @@ -94,10 +94,10 @@ void PropertySetBase::notifyAndCachePropertyValue( sal_Int32 nHandle ) // determine the type of this property ::cppu::IPropertyArrayHelper& rPropertyMetaData = getInfoHelper(); OUString sPropName; - OSL_VERIFY( rPropertyMetaData.fillPropertyMembersByHandle( &sPropName, NULL, nHandle ) ); + OSL_VERIFY( rPropertyMetaData.fillPropertyMembersByHandle( &sPropName, nullptr, nHandle ) ); Property aProperty = rPropertyMetaData.getPropertyByName( sPropName ); // default construct a value of this type - Any aEmptyValue( NULL, aProperty.Type ); + Any aEmptyValue( nullptr, aProperty.Type ); // insert into the cache aPos = m_aCache.insert( PropertyValueCache::value_type( nHandle, aEmptyValue ) ).first; } diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx index 0ec72bc5456f..a547e5c9274e 100644 --- a/forms/source/xforms/submission.cxx +++ b/forms/source/xforms/submission.cxx @@ -212,7 +212,7 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler ) if( !msBind.isEmpty() ) { Binding* pBinding = Binding::getBinding( mxModel->getBinding(msBind) ); - if( pBinding != NULL ) + if( pBinding != nullptr ) { aExpression.setExpression( pBinding->getBindingExpression() ); aEvalContext = pBinding->getEvaluationContext(); @@ -284,7 +284,7 @@ Submission* Submission::getSubmission( return xTunnel.is() ? reinterpret_cast( xTunnel->getSomething( getUnoTunnelID() ) ) - : NULL; + : nullptr; } @@ -303,7 +303,7 @@ void Submission::liveCheck() Model* Submission::getModelImpl() const { - Model* pModel = NULL; + Model* pModel = nullptr; if( mxModel.is() ) pModel = Model::getModel( mxModel ); return pModel; @@ -433,7 +433,7 @@ void SAL_CALL Submission::submitWithInteraction( ); Model* pModel = Model::getModel( xModel ); - OSL_ENSURE( pModel != NULL, "illegal model?" ); + OSL_ENSURE( pModel != nullptr, "illegal model?" ); // #i36765# #i47248# warning on submission of illegal data // check for validity (and query user if invalid) @@ -510,7 +510,7 @@ void SAL_CALL Submission::submitWithInteraction( void SAL_CALL Submission::submit( ) throw ( VetoException, WrappedTargetException, RuntimeException, std::exception ) { - submitWithInteraction( NULL ); + submitWithInteraction( nullptr ); } void SAL_CALL Submission::addSubmissionVetoListener( const Reference< XSubmissionVetoListener >& /*listener*/ ) throw (NoSupportException, RuntimeException, std::exception) diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx index 0cbc86fefeb0..93861082c9ee 100644 --- a/forms/source/xforms/submission/replace.cxx +++ b/forms/source/xforms/submission/replace.cxx @@ -121,7 +121,7 @@ CSubmission::SubmissionResult CSubmission::replace(const OUString& aReplace, con pHelper->m_aInteractionHandler = _xHandler; else pHelper->m_aInteractionHandler.set( - InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW); + InteractionHandler::createWithParent(m_xContext, nullptr), UNO_QUERY_THROW); CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; pHelper->m_aProgressHandler.set(pProgressHelper); diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index e638213828e8..a120e95e4e08 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -62,7 +62,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference< pHelper->m_aInteractionHandler = aInteractionHandler; else pHelper->m_aInteractionHandler.set( - css::task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW); + css::task::InteractionHandler::createWithParent(m_xContext, nullptr), UNO_QUERY_THROW); CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; pHelper->m_aProgressHandler.set(pProgressHelper); diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx index 7d1943d365ed..fe68cd93a845 100644 --- a/forms/source/xforms/xpathlib/xpathlib.cxx +++ b/forms/source/xforms/xpathlib/xpathlib.cxx @@ -83,7 +83,7 @@ xmlXPathFunction xforms_lookupFunc(void *, const xmlChar *xname, const xmlChar * else if ((strcmp("current", name))==0) return xforms_currentFunction; else - return NULL; + return nullptr; } // boolean functions -- cgit