summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:28:21 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:59 +0100
commit45979047abbd9da7a29401f298e8ef9ab58ad337 (patch)
tree139b904d88539d3cf0bc360f93781b49b6ac63e2 /vbahelper
parentbf8b32113fb2d26ca37b71e1e2bfc6f8ee77d0ea (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I6eb8949e3e14d82b52af9a2ba26d67bf1bd8e1a5
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx6
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbaapplicationbase.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbacolorformat.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarcontrols.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbaeventshelperbase.cxx6
-rw-r--r--vbahelper/source/vbahelper/vbaglobalbase.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx20
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx6
10 files changed, 29 insertions, 29 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 8ea22a971821..98f935dd9601 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -119,7 +119,7 @@ ScVbaControlListener::disposing( const lang::EventObject& ) throw( uno::RuntimeE
if( pControl )
{
pControl->removeResource();
- pControl = NULL;
+ pControl = nullptr;
}
}
@@ -170,8 +170,8 @@ void ScVbaControl::removeResource() throw( uno::RuntimeException )
{
uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
xComponent->removeEventListener( m_xEventListener );
- m_xControl= NULL;
- m_xProps = NULL;
+ m_xControl= nullptr;
+ m_xProps = nullptr;
}
//In design model has different behavior
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 8b6fe02e666f..5de371fb0b2d 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -43,7 +43,7 @@ using namespace ::com::sun::star;
// the models in ControlModels can be accessed by name
// also the XDialog is a XControl ( to access the model above
-ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException, uno::RuntimeException ) : ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ), mbDispose( true )
+ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException, uno::RuntimeException ) : ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(nullptr) ), mbDispose( true )
{
m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
@@ -90,7 +90,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException, std::exception)
try
{
uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
- m_xDialog = NULL;
+ m_xDialog = nullptr;
xComp->dispose();
mbDispose = false;
}
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index ef9063ec670f..84230667651b 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -161,7 +161,7 @@ struct VbaApplicationBase_Impl
++aIter )
{
delete aIter->second;
- aIter->second = NULL;
+ aIter->second = nullptr;
}
}
};
@@ -372,7 +372,7 @@ void SAL_CALL VbaApplicationBase::OnTime( const uno::Any& aEarliestTime, const O
if ( aIter != m_pImpl->m_aTimerHash.end() )
{
delete aIter->second;
- aIter->second = NULL;
+ aIter->second = nullptr;
m_pImpl->m_aTimerHash.erase( aIter );
}
diff --git a/vbahelper/source/vbahelper/vbacolorformat.cxx b/vbahelper/source/vbahelper/vbacolorformat.cxx
index 7cade936ca19..8c71b81d1013 100644
--- a/vbahelper/source/vbahelper/vbacolorformat.cxx
+++ b/vbahelper/source/vbahelper/vbacolorformat.cxx
@@ -50,7 +50,7 @@ ScVbaColorFormat::ScVbaColorFormat( const uno::Reference< XHelperInterface >& xP
m_pFillFormat = static_cast<ScVbaFillFormat*>( xFillFormat.get() );
}catch ( uno::RuntimeException& )
{
- m_pFillFormat = NULL;
+ m_pFillFormat = nullptr;
}
}
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 344b4c2f389a..87249d8bef79 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -129,7 +129,7 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
m_xIndexAccess->getByIndex( nPosition ) >>= aProps;
uno::Reference< container::XIndexAccess > xSubMenu;
getPropertyValue( aProps, ITEM_DESCRIPTOR_CONTAINER ) >>= xSubMenu;
- ScVbaCommandBarControl* pNewCommandBarControl = NULL;
+ ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
if( xSubMenu.is() )
pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, true );
else
@@ -224,7 +224,7 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
pCBarHelper->ApplyChange( m_sResourceUrl, m_xBarSettings );
- ScVbaCommandBarControl* pNewCommandBarControl = NULL;
+ ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
if( nType == office::MsoControlType::msoControlPopup )
pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, bTemporary );
else
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index db96c7274ade..8fbfd1b966c4 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -63,7 +63,7 @@ public:
virtual ~MSO2OOCommandbarHelper() {};
static MSO2OOCommandbarHelper* getMSO2OOCommandbarHelper()
{
- if( pMSO2OOCommandbarHelper == NULL )
+ if( pMSO2OOCommandbarHelper == nullptr )
{
pMSO2OOCommandbarHelper = new MSO2OOCommandbarHelper();
}
@@ -83,7 +83,7 @@ public:
}
};
-MSO2OOCommandbarHelper* MSO2OOCommandbarHelper::pMSO2OOCommandbarHelper = NULL;
+MSO2OOCommandbarHelper* MSO2OOCommandbarHelper::pMSO2OOCommandbarHelper = nullptr;
VbaCommandBarHelper::VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw (css::uno::RuntimeException) : mxContext( xContext ), mxModel( xModel )
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index 31595025d218..328ccda87cfe 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -31,7 +31,7 @@ using namespace ::ooo::vba;
VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs, const uno::Reference< uno::XComponentContext >& /*xContext*/ ) :
- mpShell( 0 ),
+ mpShell( nullptr ),
mbDisposed( true )
{
try
@@ -42,7 +42,7 @@ VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs
catch( uno::Exception& )
{
}
- mbDisposed = mpShell == 0;
+ mbDisposed = mpShell == nullptr;
startListening();
}
@@ -233,7 +233,7 @@ void VbaEventsHelperBase::stopListening()
try { xEventBroadcaster->removeEventListener( this ); } catch( uno::Exception& ) {}
mxModel.clear();
- mpShell = 0;
+ mpShell = nullptr;
maEventInfos.clear();
mbDisposed = true;
}
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx
index 53027d2c44ce..d57e421d3f27 100644
--- a/vbahelper/source/vbahelper/vbaglobalbase.cxx
+++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx
@@ -56,7 +56,7 @@ const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCt
// some strange behavior
mxContext = ::cppu::createComponentContext(
aHandlerContextInfo,
- ( sizeof ( aHandlerContextInfo ) / sizeof ( aHandlerContextInfo[0] ) ), NULL );
+ ( sizeof ( aHandlerContextInfo ) / sizeof ( aHandlerContextInfo[0] ) ), nullptr );
if ( aSrvMgr.is() )
{
try
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index e45911c544f6..1622874e7326 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -122,7 +122,7 @@ aNULL()
void dispatchExecute(SfxViewShell* pViewShell, sal_uInt16 nSlot, SfxCallMode nCall)
{
- SfxViewFrame* pViewFrame = NULL;
+ SfxViewFrame* pViewFrame = nullptr;
if ( pViewShell )
pViewFrame = pViewShell->GetViewFrame();
if ( pViewFrame )
@@ -189,14 +189,14 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException)
uno::Reference< frame::XModel > xModel;
SbxObject* pBasic = dynamic_cast< SbxObject* > ( SfxApplication::GetBasic() );
SbxObject* basicChosen = pBasic ;
- if ( basicChosen == NULL)
+ if ( basicChosen == nullptr)
{
SAL_INFO("vbahelper", "getModelFromBasic() StarBASIC* is NULL" );
return xModel;
}
SbxObject* p = pBasic;
SbxObject* pParent = p->GetParent();
- SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
+ SbxObject* pParentParent = pParent ? pParent->GetParent() : nullptr;
if( pParentParent )
{
@@ -366,7 +366,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
{
PrToFileName >>= sFileName;
}
- SfxViewFrame* pViewFrame = NULL;
+ SfxViewFrame* pViewFrame = nullptr;
if ( pViewShell )
pViewFrame = pViewShell->GetViewFrame();
if ( pViewFrame )
@@ -425,7 +425,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell* pViewShell )
{
- SfxViewFrame* pViewFrame = NULL;
+ SfxViewFrame* pViewFrame = nullptr;
if ( pViewShell )
pViewFrame = pViewShell->GetViewFrame();
if ( pViewFrame )
@@ -462,7 +462,7 @@ bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException)
return rAny.get< sal_Int64 >() != 0;
default:;
}
- throw uno::RuntimeException( "Invalid type, cannot convert to boolean." , 0 );
+ throw uno::RuntimeException( "Invalid type, cannot convert to boolean." , nullptr );
}
OUString extractStringFromAny( const uno::Any& rAny, bool bUppercaseBool ) throw (uno::RuntimeException)
@@ -487,7 +487,7 @@ OUString extractStringFromAny( const uno::Any& rAny, bool bUppercaseBool ) throw
return OUString::number( rAny.get< sal_Int64 >() );
default:;
}
- throw uno::RuntimeException( "Invalid type, cannot convert to string." , 0 );
+ throw uno::RuntimeException( "Invalid type, cannot convert to string." , nullptr );
}
OUString extractStringFromAny( const uno::Any& rAny, const OUString& rDefault, bool bUppercaseBool ) throw (uno::RuntimeException)
@@ -924,7 +924,7 @@ double UserFormGeometryHelper::implGetSize( bool bHeight, bool bOuter ) const
{
if( const vcl::Window* pWindow = VCLUnoHelper::GetWindow( mxWindow ) )
{
- Rectangle aOuterRect = pWindow->GetWindowExtentsRelative( NULL );
+ Rectangle aOuterRect = pWindow->GetWindowExtentsRelative( nullptr );
aSizePixel = awt::Size( aOuterRect.getWidth(), aOuterRect.getHeight() );
}
}
@@ -948,7 +948,7 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute
{
if( const vcl::Window* pWindow = VCLUnoHelper::GetWindow( mxWindow ) )
{
- Rectangle aOuterRect = pWindow->GetWindowExtentsRelative( NULL );
+ Rectangle aOuterRect = pWindow->GetWindowExtentsRelative( nullptr );
if( !aOuterRect.IsEmpty() )
{
awt::Rectangle aInnerRect = mxWindow->getPosSize();
@@ -1144,7 +1144,7 @@ uno::Reference< XHelperInterface > getUnoDocModule( const OUString& aModName, Sf
SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
{
- SfxObjectShell* pFoundShell = NULL;
+ SfxObjectShell* pFoundShell = nullptr;
if ( xModel.is() )
{
uno::Reference< lang::XUnoTunnel > xObjShellTunnel( xModel, uno::UNO_QUERY_THROW );
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index 6b6607c553ae..96eb92b63363 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -97,8 +97,8 @@ ScVbaShape::removeShapeListener() throw( uno::RuntimeException )
uno::Reference< lang::XComponent > xComponent( m_xShape, uno::UNO_QUERY_THROW );
xComponent->removeEventListener( this );
}
- m_xShape = NULL;
- m_xPropertySet = NULL;
+ m_xShape = nullptr;
+ m_xPropertySet = nullptr;
}
void
@@ -109,7 +109,7 @@ ScVbaShape::removeShapesListener() throw( uno::RuntimeException )
uno::Reference< lang::XComponent > xComponent( m_xShapes, uno::UNO_QUERY_THROW );
xComponent->removeEventListener( this );
}
- m_xShapes = NULL;
+ m_xShapes = nullptr;
}
sal_Int32