summaryrefslogtreecommitdiff
path: root/sd/source/ui/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:23:02 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:38 +0100
commit92c697c0e3e4bde88424322875c993c161696b1e (patch)
treeea1be62a0cb8fd7f7e63dd03a52441cedd8e96eb /sd/source/ui/tools
parent65464ed0985802edb96dbcbd1c3eed996f3778bd (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: If1b80da64ba575f07b31dce9bc0e34b7eb9f11a4
Diffstat (limited to 'sd/source/ui/tools')
-rw-r--r--sd/source/ui/tools/EventMultiplexer.cxx22
-rw-r--r--sd/source/ui/tools/IconCache.cxx8
-rw-r--r--sd/source/ui/tools/IdleDetection.cxx6
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx36
-rw-r--r--sd/source/ui/tools/PropertySet.cxx2
-rw-r--r--sd/source/ui/tools/SdGlobalResourceContainer.cxx8
-rw-r--r--sd/source/ui/tools/SlotStateListener.cxx4
-rw-r--r--sd/source/ui/tools/TimerBasedTaskExecution.cxx4
8 files changed, 45 insertions, 45 deletions
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index 2552f2b8d01c..4c501de7ff7a 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -143,7 +143,7 @@ private:
void CallListeners (
EventMultiplexerEvent::EventId eId,
- void* pUserData = NULL);
+ void* pUserData = nullptr);
/** This method throws a DisposedException when the object has already been
disposed.
@@ -210,10 +210,10 @@ EventMultiplexer::Implementation::Implementation (ViewShellBase& rBase)
mrBase (rBase),
mbListeningToController (false),
mbListeningToFrame (false),
- mxControllerWeak(NULL),
- mxFrameWeak(NULL),
- mxSlideSorterSelectionWeak(NULL),
- mpDocument(NULL),
+ mxControllerWeak(nullptr),
+ mxFrameWeak(nullptr),
+ mxSlideSorterSelectionWeak(nullptr),
+ mpDocument(nullptr),
mxConfigurationControllerWeak()
{
// Connect to the frame to listen for controllers being exchanged.
@@ -235,7 +235,7 @@ EventMultiplexer::Implementation::Implementation (ViewShellBase& rBase)
// Listen for document changes.
mpDocument = mrBase.GetDocument();
- if (mpDocument != NULL)
+ if (mpDocument != nullptr)
StartListening (*mpDocument);
// Listen for configuration changes.
@@ -292,10 +292,10 @@ void EventMultiplexer::Implementation::ReleaseListeners()
DisconnectFromController ();
- if (mpDocument != NULL)
+ if (mpDocument != nullptr)
{
EndListening (*mpDocument);
- mpDocument = NULL;
+ mpDocument = nullptr;
}
// Stop listening for configuration changes.
@@ -575,7 +575,7 @@ void SAL_CALL EventMultiplexer::Implementation::notifyConfigurationChange (
= dynamic_cast<slidesorter::SlideSorterViewShell*>(
FrameworkHelper::GetViewShell(
Reference<XView>(rEvent.ResourceObject,UNO_QUERY)).get());
- if (pViewShell != NULL)
+ if (pViewShell != nullptr)
pViewShell->AddSelectionChangeListener (
LINK(this,
EventMultiplexer::Implementation,
@@ -603,7 +603,7 @@ void SAL_CALL EventMultiplexer::Implementation::notifyConfigurationChange (
= dynamic_cast<slidesorter::SlideSorterViewShell*>(
FrameworkHelper::GetViewShell(
Reference<XView>(rEvent.ResourceObject, UNO_QUERY)).get());
- if (pViewShell != NULL)
+ if (pViewShell != nullptr)
pViewShell->RemoveSelectionChangeListener (
LINK(this,
EventMultiplexer::Implementation,
@@ -676,7 +676,7 @@ void EventMultiplexer::Implementation::Notify (
{
const SfxSimpleHint& rSimpleHint = static_cast<const SfxSimpleHint&>(rHint);
if (rSimpleHint.GetId() == SFX_HINT_DYING)
- mpDocument = NULL;
+ mpDocument = nullptr;
}
}
diff --git a/sd/source/ui/tools/IconCache.cxx b/sd/source/ui/tools/IconCache.cxx
index 54563201282f..6c46806bd1b5 100644
--- a/sd/source/ui/tools/IconCache.cxx
+++ b/sd/source/ui/tools/IconCache.cxx
@@ -45,7 +45,7 @@ private:
Image GetIcon (sal_uInt16 nResourceId);
};
-IconCache* IconCache::Implementation::mpInstance = NULL;
+IconCache* IconCache::Implementation::mpInstance = nullptr;
Image IconCache::Implementation::GetIcon (sal_uInt16 nResourceId)
{
@@ -67,11 +67,11 @@ Image IconCache::Implementation::GetIcon (sal_uInt16 nResourceId)
//static
IconCache& IconCache::Instance()
{
- if (Implementation::mpInstance == NULL)
+ if (Implementation::mpInstance == nullptr)
{
::osl::GetGlobalMutex aMutexFunctor;
::osl::MutexGuard aGuard (aMutexFunctor());
- if (Implementation::mpInstance == NULL)
+ if (Implementation::mpInstance == nullptr)
{
IconCache* pCache = new IconCache ();
SdGlobalResourceContainer::Instance().AddResource (
@@ -85,7 +85,7 @@ IconCache& IconCache::Instance()
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
}
- DBG_ASSERT(Implementation::mpInstance!=NULL,
+ DBG_ASSERT(Implementation::mpInstance!=nullptr,
"IconCache::Instance(): instance is NULL");
return *Implementation::mpInstance;
}
diff --git a/sd/source/ui/tools/IdleDetection.cxx b/sd/source/ui/tools/IdleDetection.cxx
index ed16b2f92a3a..e5e9dab48ba4 100644
--- a/sd/source/ui/tools/IdleDetection.cxx
+++ b/sd/source/ui/tools/IdleDetection.cxx
@@ -36,7 +36,7 @@ namespace sd { namespace tools {
sal_Int32 IdleDetection::GetIdleState (const vcl::Window* pWindow)
{
sal_Int32 nResult (CheckInputPending() | CheckSlideShowRunning());
- if (pWindow != NULL)
+ if (pWindow != nullptr)
nResult |= CheckWindowPainting(*pWindow);
return nResult;
}
@@ -57,7 +57,7 @@ sal_Int32 IdleDetection::CheckSlideShowRunning()
// Iterate over all view frames.
for (SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
- pViewFrame!=NULL && !bIsSlideShowShowing;
+ pViewFrame!=nullptr && !bIsSlideShowShowing;
pViewFrame = SfxViewFrame::GetNext(*pViewFrame))
{
// Ignore the current frame when it does not exist, is not valid, or
@@ -77,7 +77,7 @@ sal_Int32 IdleDetection::CheckSlideShowRunning()
// Get sd::ViewShell from active frame.
ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pViewFrame);
- if (pBase != NULL)
+ if (pBase != nullptr)
{
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( *pBase ) );
if( xSlideShow.is() && xSlideShow->isRunning() )
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 67e3f5ac6eb5..a383b759668e 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -67,11 +67,11 @@ PreviewRenderer::PreviewRenderer (
OutputDevice* pTemplate,
const bool bHasFrame)
: mpPreviewDevice (VclPtr<VirtualDevice>::Create()),
- mpDocShellOfView(NULL),
+ mpDocShellOfView(nullptr),
maFrameColor (svtools::ColorConfig().GetColorValue(svtools::DOCBOUNDARIES).nColor),
mbHasFrame(bHasFrame)
{
- if (pTemplate != NULL)
+ if (pTemplate != nullptr)
{
mpPreviewDevice->SetDigitLanguage (pTemplate->GetDigitLanguage());
mpPreviewDevice->SetBackground(pTemplate->GetBackground());
@@ -85,7 +85,7 @@ PreviewRenderer::PreviewRenderer (
PreviewRenderer::~PreviewRenderer()
{
- if (mpDocShellOfView != NULL)
+ if (mpDocShellOfView != nullptr)
EndListening (*mpDocShellOfView);
}
@@ -96,7 +96,7 @@ Image PreviewRenderer::RenderPage (
const bool bObeyHighContrastMode,
const bool bDisplayPresentationObjects)
{
- if (pPage != NULL)
+ if (pPage != nullptr)
{
const Size aPageModelSize (pPage->GetSize());
const double nAspectRatio (
@@ -124,7 +124,7 @@ Image PreviewRenderer::RenderPage (
{
Image aPreview;
- if (pPage != NULL)
+ if (pPage != nullptr)
{
try
{
@@ -214,11 +214,11 @@ bool PreviewRenderer::Initialize (
const Size& rPixelSize,
const bool bObeyHighContrastMode)
{
- if (pPage == NULL)
+ if (pPage == nullptr)
return false;
SdrModel* pModel = pPage->GetModel();
- if (pModel == NULL)
+ if (pModel == nullptr)
return false;
SetupOutputSize(*pPage, rPixelSize);
@@ -229,7 +229,7 @@ bool PreviewRenderer::Initialize (
// Create view
ProvideView (pDocShell);
- if (mpView.get() == NULL)
+ if (mpView.get() == nullptr)
return false;
// Adjust contrast mode.
@@ -254,7 +254,7 @@ bool PreviewRenderer::Initialize (
// Make sure that a page view exists.
SdrPageView* pPageView = mpView->GetSdrPageView();
- if (pPageView == NULL)
+ if (pPageView == nullptr)
return false;
// #i121224# No need to set SetApplicationBackgroundColor (which is the color
@@ -298,9 +298,9 @@ void PreviewRenderer::PaintPage (
vcl::Region aRegion (aPaintRectangle);
// Turn off online spelling and redlining.
- SdrOutliner* pOutliner = NULL;
+ SdrOutliner* pOutliner = nullptr;
EEControlBits nSavedControlWord = EEControlBits::NONE;
- if (mpDocShellOfView!=NULL && mpDocShellOfView->GetDoc()!=NULL)
+ if (mpDocShellOfView!=nullptr && mpDocShellOfView->GetDoc()!=nullptr)
{
pOutliner = &mpDocShellOfView->GetDoc()->GetDrawOutliner();
nSavedControlWord = pOutliner->GetControlWord();
@@ -322,7 +322,7 @@ void PreviewRenderer::PaintPage (
}
// Restore the previous online spelling and redlining states.
- if (pOutliner != NULL)
+ if (pOutliner != nullptr)
pOutliner->SetControlWord(nSavedControlWord);
}
@@ -410,15 +410,15 @@ void PreviewRenderer::ProvideView (DrawDocShell* pDocShell)
// Switch our attention, i.e. listening for DYING events, to
// the new doc shell.
- if (mpDocShellOfView != NULL)
+ if (mpDocShellOfView != nullptr)
EndListening (*mpDocShellOfView);
mpDocShellOfView = pDocShell;
- if (mpDocShellOfView != NULL)
+ if (mpDocShellOfView != nullptr)
StartListening (*mpDocShellOfView);
}
- if (mpView.get() == NULL)
+ if (mpView.get() == nullptr)
{
- mpView.reset (new DrawView (pDocShell, mpPreviewDevice.get(), NULL));
+ mpView.reset (new DrawView (pDocShell, mpPreviewDevice.get(), nullptr));
}
mpView->SetPreviewRenderer(true);
#if 1
@@ -499,7 +499,7 @@ void PreviewRenderer::Notify(SfxBroadcaster&, const SfxHint& rHint)
// ProvideView will create a new one (for another
// doc shell, of course.)
mpView.reset();
- mpDocShellOfView = NULL;
+ mpDocShellOfView = nullptr;
}
}
@@ -521,7 +521,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
{
SdrObject* pObject = rOriginal.GetViewContact().TryToGetSdrObject();
- if (pObject==NULL || pObject->GetPage() == NULL)
+ if (pObject==nullptr || pObject->GetPage() == nullptr)
{
// not a SdrObject visualisation (maybe e.g. page) or no page
return sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
diff --git a/sd/source/ui/tools/PropertySet.cxx b/sd/source/ui/tools/PropertySet.cxx
index 184a3f159237..4d1142abce6c 100644
--- a/sd/source/ui/tools/PropertySet.cxx
+++ b/sd/source/ui/tools/PropertySet.cxx
@@ -44,7 +44,7 @@ void SAL_CALL PropertySet::disposing()
Reference<beans::XPropertySetInfo> SAL_CALL PropertySet::getPropertySetInfo()
throw(RuntimeException, std::exception)
{
- return NULL;
+ return nullptr;
}
void SAL_CALL PropertySet::setPropertyValue (
diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
index d6c0a02cf701..4eb35b221d73 100644
--- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx
+++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
@@ -53,14 +53,14 @@ private:
// static
SdGlobalResourceContainer& SdGlobalResourceContainer::Instance()
{
- DBG_ASSERT(Implementation::mpInstance!=NULL,
+ DBG_ASSERT(Implementation::mpInstance!=nullptr,
"SdGlobalResourceContainer::Instance(): instance has been deleted");
// Maybe we should throw an exception when the instance has been deleted.
return *Implementation::mpInstance;
}
SdGlobalResourceContainer*
- SdGlobalResourceContainer::Implementation::mpInstance = NULL;
+ SdGlobalResourceContainer::Implementation::mpInstance = nullptr;
//===== SdGlobalResourceContainer =============================================
@@ -170,14 +170,14 @@ SdGlobalResourceContainer::~SdGlobalResourceContainer()
++iXInterfaceResource)
{
Reference<lang::XComponent> xComponent (*iXInterfaceResource, UNO_QUERY);
- *iXInterfaceResource = NULL;
+ *iXInterfaceResource = nullptr;
if (xComponent.is())
xComponent->dispose();
}
DBG_ASSERT(Implementation::mpInstance == this,
"~SdGlobalResourceContainer(): more than one instance of singleton");
- Implementation::mpInstance = NULL;
+ Implementation::mpInstance = nullptr;
}
} // end of namespace sd
diff --git a/sd/source/ui/tools/SlotStateListener.cxx b/sd/source/ui/tools/SlotStateListener.cxx
index c3fc2275fcff..e827ff4ec723 100644
--- a/sd/source/ui/tools/SlotStateListener.cxx
+++ b/sd/source/ui/tools/SlotStateListener.cxx
@@ -37,7 +37,7 @@ SlotStateListener::SlotStateListener (
const OUString& rSlotName)
: SlotStateListenerInterfaceBase(maMutex),
maCallback(),
- mxDispatchProviderWeak(NULL)
+ mxDispatchProviderWeak(nullptr)
{
SetCallback(rCallback);
ConnectToDispatchProvider(rxDispatchProvider);
@@ -89,7 +89,7 @@ void SlotStateListener::ObserveSlot (const OUString& rSlotName)
void SlotStateListener::disposing()
{
ReleaseListeners();
- mxDispatchProviderWeak = uno::WeakReference<frame::XDispatchProvider>(NULL);
+ mxDispatchProviderWeak = uno::WeakReference<frame::XDispatchProvider>(nullptr);
maCallback = Link<const OUString&,void>();
}
diff --git a/sd/source/ui/tools/TimerBasedTaskExecution.cxx b/sd/source/ui/tools/TimerBasedTaskExecution.cxx
index 039606ea62a1..bafd904290a2 100644
--- a/sd/source/ui/tools/TimerBasedTaskExecution.cxx
+++ b/sd/source/ui/tools/TimerBasedTaskExecution.cxx
@@ -102,13 +102,13 @@ TimerBasedTaskExecution::~TimerBasedTaskExecution()
void TimerBasedTaskExecution::SetSelf (
const std::shared_ptr<TimerBasedTaskExecution>& rpSelf)
{
- if (mpTask.get() != NULL)
+ if (mpTask.get() != nullptr)
mpSelf = rpSelf;
}
IMPL_LINK_NOARG_TYPED(TimerBasedTaskExecution, TimerCallback, Timer *, void)
{
- if (mpTask.get() != NULL)
+ if (mpTask.get() != nullptr)
{
if (mpTask->HasNextStep())
{