Kaydet (Commit) 65464ed0 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: I9b7d8de65780325175d24965057596b88d3c0f05
üst d61d47ad
......@@ -76,7 +76,7 @@ namespace basprov
static Sequence< OUString > getSupportedServiceNames_BasicProviderImpl()
{
static Sequence< OUString >* pNames = 0;
static Sequence< OUString >* pNames = nullptr;
if ( !pNames )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
......@@ -98,10 +98,10 @@ namespace basprov
BasicProviderImpl::BasicProviderImpl( const Reference< XComponentContext >& xContext )
:m_pAppBasicManager( 0 )
,m_pDocBasicManager( 0 )
,m_xLibContainerApp( 0 )
,m_xLibContainerDoc( 0 )
:m_pAppBasicManager( nullptr )
,m_pDocBasicManager( nullptr )
,m_xLibContainerApp( nullptr )
,m_xLibContainerDoc( nullptr )
,m_xContext( xContext )
,m_bIsAppScriptCtx( true )
,m_bIsUserCtx(true)
......@@ -315,7 +315,7 @@ namespace basprov
// In some strange circumstances the Library name can have an
// apparently illegal '.' in it ( in imported VBA )
BasicManager* pBasicMgr = NULL;
BasicManager* pBasicMgr = nullptr;
if ( aLocation == "document" )
{
pBasicMgr = m_pDocBasicManager;
......@@ -417,7 +417,7 @@ namespace basprov
SolarMutexGuard aGuard;
Reference< script::XLibraryContainer > xLibContainer;
BasicManager* pBasicManager = NULL;
BasicManager* pBasicManager = nullptr;
if ( m_bIsAppScriptCtx )
{
......@@ -516,9 +516,9 @@ namespace basprov
{
create_BasicProviderImpl, getImplementationName_BasicProviderImpl,
getSupportedServiceNames_BasicProviderImpl, ::cppu::createSingleComponentFactory,
0, 0
nullptr, 0
},
{ 0, 0, 0, 0, 0, 0 }
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
......
......@@ -64,7 +64,7 @@ namespace basprov
,OPropertyContainer( GetBroadcastHelper() )
,m_xMethod( xMethod )
,m_funcName( funcName )
,m_documentBasicManager( NULL )
,m_documentBasicManager( nullptr )
,m_xDocumentScriptContext()
{
registerProperty( BASSCRIPT_PROPERTY_CALLER, BASSCRIPT_PROPERTY_ID_CALLER, BASSCRIPT_DEFAULT_ATTRIBS(), &m_caller, cppu::UnoType<decltype(m_caller)>::get() );
......@@ -107,7 +107,7 @@ namespace basprov
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>( &rHint );
if ( pSimpleHint && ( pSimpleHint->GetId() == SFX_HINT_DYING ) )
{
m_documentBasicManager = NULL;
m_documentBasicManager = nullptr;
EndListening( rBC ); // prevent multiple notifications
}
}
......@@ -285,7 +285,7 @@ namespace basprov
aReturn = sbxToUnoValue( xReturn );
// reset parameters
m_xMethod->SetParameters( NULL );
m_xMethod->SetParameters( nullptr );
}
return aReturn;
......
......@@ -427,7 +427,7 @@ namespace dlgprov
{
//::osl::MutexGuard aGuard( getMutex() );
firing_impl( Event, NULL );
firing_impl( Event, nullptr );
}
......@@ -667,7 +667,7 @@ namespace dlgprov
{
//::osl::MutexGuard aGuard( getMutex() );
firing_impl( aScriptEvent, NULL );
firing_impl( aScriptEvent, nullptr );
}
......
......@@ -186,7 +186,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
::osl::Mutex& getMutex()
{
static ::osl::Mutex* s_pMutex = 0;
static ::osl::Mutex* s_pMutex = nullptr;
if ( !s_pMutex )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
......@@ -206,7 +206,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
DialogProviderImpl::DialogProviderImpl( const Reference< XComponentContext >& rxContext )
:m_xContext( rxContext )
,m_xModel( 0 )
,m_xModel( nullptr )
{
}
......@@ -526,7 +526,7 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
Reference< XScriptEventsAttacher > xScriptEventsAttacher = new DialogEventsAttacherImpl
( m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess,
bDialogProviderMode, ( m_BasicInfo.get() ? m_BasicInfo->mxBasicRTLListener : NULL ), msDialogLibName );
bDialogProviderMode, ( m_BasicInfo.get() ? m_BasicInfo->mxBasicRTLListener : nullptr ), msDialogLibName );
Any aHelper;
xScriptEventsAttacher->attachEvents( aObjects, Reference< XScriptListener >(), aHelper );
......@@ -777,9 +777,9 @@ static const char aResourceResolverPropName[] = "ResourceResolver";
static struct ::cppu::ImplementationEntry s_component_entries [] =
{
{create_DialogProviderImpl, getImplementationName_DialogProviderImpl,getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,0, 0},
{ &comp_DialogModelProvider::_create,&comp_DialogModelProvider::_getImplementationName,&comp_DialogModelProvider::_getSupportedServiceNames,&::cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
{create_DialogProviderImpl, getImplementationName_DialogProviderImpl,getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,nullptr, 0},
{ &comp_DialogModelProvider::_create,&comp_DialogModelProvider::_getImplementationName,&comp_DialogModelProvider::_getSupportedServiceNames,&::cppu::createSingleComponentFactory, nullptr, 0 },
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
......
......@@ -106,7 +106,7 @@ static css::uno::Reference< css::frame::XModel > tDocUrlToModel( const OUString&
try
{
::ucbhelper::Content root( url, NULL, comphelper::getProcessComponentContext() );
::ucbhelper::Content root( url, nullptr, comphelper::getProcessComponentContext() );
OUString propName = "DocumentModel";
result = getUCBProperty( root, propName );
}
......
......@@ -271,10 +271,10 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact != NULL )
if ( pFact != nullptr )
{
std::unique_ptr<VclAbstractDialog> pDlg(
pFact->CreateScriptErrorDialog( NULL, aException ));
pFact->CreateScriptErrorDialog( nullptr, aException ));
if ( pDlg )
pDlg->Execute();
......@@ -356,7 +356,7 @@ ScriptProtocolHandler::getScriptInvocation()
Reference< XFrame > xFrame( m_xFrame.get(), UNO_QUERY );
if ( xFrame.is() )
{
SfxFrame* pFrame = NULL;
SfxFrame* pFrame = nullptr;
for ( pFrame = SfxFrame::GetFirst(); pFrame; pFrame = SfxFrame::GetNext( *pFrame ) )
{
if ( pFrame->GetFrameInterface() == xFrame )
......@@ -513,11 +513,11 @@ extern "C"
(void)pRegistryKey;
// Set default return value for this operation - if it failed.
void * pReturn = NULL ;
void * pReturn = nullptr ;
if (
( pImplementationName != NULL ) &&
( pServiceManager != NULL )
( pImplementationName != nullptr ) &&
( pServiceManager != nullptr )
)
{
// Define variables which are used in following macros.
......
......@@ -140,7 +140,7 @@ Reference< provider::XScriptProvider >
OUStringBuffer buf;
buf.append( "Failed to create MasterScriptProvider for ScriptInvocationContext: " );
buf.append( "Component supporting XEmbeddScripts interface not found." );
throw lang::IllegalArgumentException( buf.makeStringAndClear(), NULL, 1 );
throw lang::IllegalArgumentException( buf.makeStringAndClear(), nullptr, 1 );
}
::osl::MutexGuard guard( m_mutex );
......@@ -179,7 +179,7 @@ Reference< provider::XScriptProvider >
buf.append( "Failed to create MasterScriptProvider for '" );
buf.append ( context );
buf.append( "': Either XEmbeddScripts or XScriptInvocationContext need to be supported by the document." );
throw lang::IllegalArgumentException( buf.makeStringAndClear(), NULL, 1 );
throw lang::IllegalArgumentException( buf.makeStringAndClear(), nullptr, 1 );
}
::osl::MutexGuard guard( m_mutex );
......
......@@ -185,7 +185,7 @@ public:
explicit LocationBrowseNode( const Reference< browse::XBrowseNode >& node )
{
m_sNodeName = node->getName();
m_hBNA = NULL;
m_hBNA = nullptr;
m_origNode.set( node );
}
......@@ -211,7 +211,7 @@ public:
getChildNodes()
throw ( RuntimeException, std::exception ) override
{
if ( m_hBNA == NULL )
if ( m_hBNA == nullptr )
{
loadChildNodes();
}
......
......@@ -74,7 +74,7 @@ bool endsWith( const OUString& target,
MasterScriptProvider::MasterScriptProvider( const Reference< XComponentContext > & xContext ) throw ( RuntimeException ):
m_xContext( xContext ), m_bIsValid( false ), m_bInitialised( false ),
m_bIsPkgMSP( false ), m_pPCache( 0 )
m_bIsPkgMSP( false ), m_pPCache( nullptr )
{
ENSURE_OR_THROW( m_xContext.is(), "MasterScriptProvider::MasterScriptProvider: No context available\n" );
m_xMgr = m_xContext->getServiceManager();
......@@ -89,7 +89,7 @@ MasterScriptProvider::~MasterScriptProvider()
{
delete m_pPCache;
}
m_pPCache = 0;
m_pPCache = nullptr;
}
......@@ -861,26 +861,26 @@ static const struct cppu::ImplementationEntry s_entries [] =
{
sp_create, sp_getImplementationName,
sp_getSupportedServiceNames, cppu::createSingleComponentFactory,
0, 0
nullptr, 0
},
{
urihelper_create,
urihelper_getImplementationName,
urihelper_getSupportedServiceNames,
cppu::createSingleComponentFactory,
0, 0
nullptr, 0
},
{
func_provider::mspf_create, func_provider::mspf_getImplementationName,
func_provider::mspf_getSupportedServiceNames, cppu::createSingleComponentFactory,
0, 0
nullptr, 0
},
{
browsenodefactory::bnf_create, browsenodefactory::bnf_getImplementationName,
browsenodefactory::bnf_getSupportedServiceNames, cppu::createSingleComponentFactory,
0, 0
nullptr, 0
},
{ 0, 0, 0, 0, 0, 0 }
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
}
......
......@@ -227,49 +227,49 @@ TypeList listBoxList = {&typeXListBox, 1};
//this array stores the OO event to VBA event translation info
static TranslatePropMap aTranslatePropMap_Impl[] =
{
{ OUString("actionPerformed"), { OUString("_Change"), NULL, DenyType, static_cast<void*>(&radioButtonList) } },
{ OUString("actionPerformed"), { OUString("_Change"), nullptr, DenyType, static_cast<void*>(&radioButtonList) } },
// actionPerformed ooo event
{ OUString("actionPerformed"), { OUString("_Click"), NULL, ApproveAll, NULL } },
{ OUString("itemStateChanged"), { OUString("_Change"), NULL, ApproveType, static_cast<void*>(&radioButtonList) } },
{ OUString("actionPerformed"), { OUString("_Click"), nullptr, ApproveAll, nullptr } },
{ OUString("itemStateChanged"), { OUString("_Change"), nullptr, ApproveType, static_cast<void*>(&radioButtonList) } },
// itemStateChanged ooo event
{ OUString("itemStateChanged"), { OUString("_Click"), NULL, ApproveType, static_cast<void*>(&comboBoxList) } },
{ OUString("itemStateChanged"), { OUString("_Click"), nullptr, ApproveType, static_cast<void*>(&comboBoxList) } },
{ OUString("itemStateChanged"), { OUString("_Click"), NULL, ApproveType, static_cast<void*>(&listBoxList) } },
{ OUString("itemStateChanged"), { OUString("_Click"), nullptr, ApproveType, static_cast<void*>(&listBoxList) } },
// changed ooo event
{ OUString("changed"), { OUString("_Change"), NULL, ApproveAll, NULL } },
{ OUString("changed"), { OUString("_Change"), nullptr, ApproveAll, nullptr } },
// focusGained ooo event
{ OUString("focusGained"), { OUString("_GotFocus"), NULL, ApproveAll, NULL } },
{ OUString("focusGained"), { OUString("_GotFocus"), nullptr, ApproveAll, nullptr } },
// focusLost ooo event
{ OUString("focusLost"), { OUString("_LostFocus"), NULL, ApproveAll, NULL } },
{ OUString("focusLost"), { OUString("_Exit"), NULL, ApproveType, static_cast<void*>(&textCompList) } }, // support VBA TextBox_Exit event
{ OUString("focusLost"), { OUString("_LostFocus"), nullptr, ApproveAll, nullptr } },
{ OUString("focusLost"), { OUString("_Exit"), nullptr, ApproveType, static_cast<void*>(&textCompList) } }, // support VBA TextBox_Exit event
// adjustmentValueChanged ooo event
{ OUString("adjustmentValueChanged"), { OUString("_Scroll"), NULL, ApproveAll, NULL } },
{ OUString("adjustmentValueChanged"), { OUString("_Change"), NULL, ApproveAll, NULL } },
{ OUString("adjustmentValueChanged"), { OUString("_Scroll"), nullptr, ApproveAll, nullptr } },
{ OUString("adjustmentValueChanged"), { OUString("_Change"), nullptr, ApproveAll, nullptr } },
// textChanged ooo event
{ OUString("textChanged"), { OUString("_Change"), NULL, ApproveAll, NULL } },
{ OUString("textChanged"), { OUString("_Change"), nullptr, ApproveAll, nullptr } },
// keyReleased ooo event
{ OUString("keyReleased"), { OUString("_KeyUp"), ooKeyPressedToVBAKeyUpDown, ApproveAll, NULL } },
{ OUString("keyReleased"), { OUString("_KeyUp"), ooKeyPressedToVBAKeyUpDown, ApproveAll, nullptr } },
// mouseReleased ooo event
{ OUString("mouseReleased"), { OUString("_Click"), ooMouseEvtToVBAMouseEvt, ApproveType, static_cast<void*>(&fixedTextList) } },
{ OUString("mouseReleased"), { OUString("_MouseUp"), ooMouseEvtToVBAMouseEvt, ApproveAll, NULL } },
{ OUString("mouseReleased"), { OUString("_MouseUp"), ooMouseEvtToVBAMouseEvt, ApproveAll, nullptr } },
// mousePressed ooo event
{ OUString("mousePressed"), { OUString("_MouseDown"), ooMouseEvtToVBAMouseEvt, ApproveAll, NULL } },
{ OUString("mousePressed"), { OUString("_DblClick"), ooMouseEvtToVBADblClick, ApproveAll, NULL } },
{ OUString("mousePressed"), { OUString("_MouseDown"), ooMouseEvtToVBAMouseEvt, ApproveAll, nullptr } },
{ OUString("mousePressed"), { OUString("_DblClick"), ooMouseEvtToVBADblClick, ApproveAll, nullptr } },
// mouseMoved ooo event
{ OUString("mouseMoved"), { OUString("_MouseMove"), ooMouseEvtToVBAMouseEvt, ApproveAll, NULL } },
{ OUString("mouseDragged"), { OUString("_MouseMove"), ooMouseEvtToVBAMouseEvt, DenyMouseDrag, NULL } },
{ OUString("mouseMoved"), { OUString("_MouseMove"), ooMouseEvtToVBAMouseEvt, ApproveAll, nullptr } },
{ OUString("mouseDragged"), { OUString("_MouseMove"), ooMouseEvtToVBAMouseEvt, DenyMouseDrag, nullptr } },
// keyPressed ooo event
{ OUString("keyPressed"), { OUString("_KeyDown"), ooKeyPressedToVBAKeyUpDown, ApproveAll, NULL } },
{ OUString("keyPressed"), { OUString("_KeyPress"), ooKeyPressedToVBAKeyPressed, ApproveAll, NULL } }
{ OUString("keyPressed"), { OUString("_KeyDown"), ooKeyPressedToVBAKeyUpDown, ApproveAll, nullptr } },
{ OUString("keyPressed"), { OUString("_KeyPress"), ooKeyPressedToVBAKeyPressed, ApproveAll, nullptr } }
};
EventInfoHash& getEventTransInfo()
......@@ -647,7 +647,7 @@ private:
DECL_LINK( OnAsyncScriptEvent, ScriptEvent* );
#endif
void setShellFromModel();
void firing_Impl( const ScriptEvent& evt, Any *pSyncRet=NULL ) throw( RuntimeException, std::exception );
void firing_Impl( const ScriptEvent& evt, Any *pSyncRet=nullptr ) throw( RuntimeException, std::exception );
Reference< XComponentContext > m_xContext;
Reference< frame::XModel > m_xModel;
......@@ -657,7 +657,7 @@ private:
};
EventListener::EventListener( const Reference< XComponentContext >& rxContext ) :
OPropertyContainer(GetBroadcastHelper()), m_xContext( rxContext ), m_bDocClosed(false), mpShell( 0 )
OPropertyContainer(GetBroadcastHelper()), m_xContext( rxContext ), m_bDocClosed(false), mpShell( nullptr )
{
registerProperty( EVENTLSTNR_PROPERTY_MODEL, EVENTLSTNR_PROPERTY_ID_MODEL,
beans::PropertyAttribute::TRANSIENT, &m_xModel, cppu::UnoType<decltype(m_xModel)>::get() );
......@@ -668,7 +668,7 @@ void
EventListener::setShellFromModel()
{
// reset mpShell
mpShell = 0;
mpShell = nullptr;
SfxObjectShell* pShell = SfxObjectShell::GetFirst();
while ( m_xModel.is() && pShell )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment