summaryrefslogtreecommitdiff
path: root/sd/source/ui/sidebar
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.cxx4
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx20
-rw-r--r--sd/source/ui/sidebar/DocumentHelper.cxx84
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx48
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx2
-rw-r--r--sd/source/ui/sidebar/MasterPageContainerFiller.cxx10
-rw-r--r--sd/source/ui/sidebar/MasterPageContainerProviders.cxx32
-rw-r--r--sd/source/ui/sidebar/MasterPageContainerQueue.cxx10
-rw-r--r--sd/source/ui/sidebar/MasterPageDescriptor.cxx36
-rw-r--r--sd/source/ui/sidebar/MasterPageObserver.cxx12
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx38
-rw-r--r--sd/source/ui/sidebar/PanelBase.cxx4
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx8
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx6
15 files changed, 160 insertions, 160 deletions
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index 769ffd1aac77..9654c7b85877 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -83,8 +83,8 @@ VclPtr<vcl::Window> AllMasterPagesSelector::Create (
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
SdDrawDocument* pDocument = rViewShellBase.GetDocument();
- if (pDocument == NULL)
- return NULL;
+ if (pDocument == nullptr)
+ return nullptr;
std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index adb5de107452..6470397cb271 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -48,8 +48,8 @@ VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
SdDrawDocument* pDocument = rViewShellBase.GetDocument();
- if (pDocument == NULL)
- return NULL;
+ if (pDocument == nullptr)
+ return nullptr;
std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
@@ -95,13 +95,13 @@ CurrentMasterPagesSelector::~CurrentMasterPagesSelector()
void CurrentMasterPagesSelector::dispose()
{
- if (mrDocument.GetDocSh() != NULL)
+ if (mrDocument.GetDocSh() != nullptr)
{
EndListening(*mrDocument.GetDocSh());
}
else
{
- OSL_ASSERT(mrDocument.GetDocSh() != NULL);
+ OSL_ASSERT(mrDocument.GetDocSh() != nullptr);
}
Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener));
@@ -114,13 +114,13 @@ void CurrentMasterPagesSelector::LateInit()
{
MasterPagesSelector::LateInit();
MasterPagesSelector::Fill();
- if (mrDocument.GetDocSh() != NULL)
+ if (mrDocument.GetDocSh() != nullptr)
{
StartListening(*mrDocument.GetDocSh());
}
else
{
- OSL_ASSERT(mrDocument.GetDocSh() != NULL);
+ OSL_ASSERT(mrDocument.GetDocSh() != nullptr);
}
}
@@ -133,7 +133,7 @@ void CurrentMasterPagesSelector::Fill (ItemList& rItemList)
for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++)
{
SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD);
- if (pMasterPage == NULL)
+ if (pMasterPage == nullptr)
continue;
// Use the name of the master page to avoid duplicate entries.
@@ -179,7 +179,7 @@ void CurrentMasterPagesSelector::UpdateSelection()
for (nIndex=0; nIndex<nPageCount && bLoop; nIndex++)
{
SdPage* pPage = mrDocument.GetSdPage (nIndex, PK_STANDARD);
- if (pPage != NULL && pPage->IsSelected())
+ if (pPage != nullptr && pPage->IsSelected())
{
if ( ! pPage->TRG_HasMasterPage())
{
@@ -195,7 +195,7 @@ void CurrentMasterPagesSelector::UpdateSelection()
{
SdrPage& rMasterPage (pPage->TRG_GetMasterPage());
SdPage* pMasterPage = static_cast<SdPage*>(&rMasterPage);
- if (pMasterPage != NULL)
+ if (pMasterPage != nullptr)
aNames.insert (pMasterPage->GetName());
}
}
@@ -220,7 +220,7 @@ void CurrentMasterPagesSelector::ExecuteCommand (const sal_Int32 nCommandId)
// Check once again that the master page can safely be deleted,
// i.e. is not used.
SdPage* pMasterPage = GetSelectedMasterPage();
- if (pMasterPage != NULL
+ if (pMasterPage != nullptr
&& mrDocument.GetMasterPageUserCount(pMasterPage) == 0)
{
// Removing the precious flag so that the following call to
diff --git a/sd/source/ui/sidebar/DocumentHelper.cxx b/sd/source/ui/sidebar/DocumentHelper.cxx
index 05bd618e5921..9e1d855e469d 100644
--- a/sd/source/ui/sidebar/DocumentHelper.cxx
+++ b/sd/source/ui/sidebar/DocumentHelper.cxx
@@ -43,17 +43,17 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
SdDrawDocument& rTargetDocument,
SdPage* pMasterPage)
{
- SdPage* pNewMasterPage = NULL;
+ SdPage* pNewMasterPage = nullptr;
do
{
- if (pMasterPage == NULL)
+ if (pMasterPage == nullptr)
break;
// Check the presence of the source document.
SdDrawDocument* pSourceDocument = static_cast<SdDrawDocument*>(
pMasterPage->GetModel());
- if (pSourceDocument == NULL)
+ if (pSourceDocument == nullptr)
break;
// When the given master page already belongs to the target document
@@ -84,7 +84,7 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
// Get the notes master page.
SdPage* pNotesMasterPage = static_cast<SdPage*>(
pSourceDocument->GetMasterPage(nIndex+1));
- if (pNotesMasterPage == NULL)
+ if (pNotesMasterPage == nullptr)
break;
// Check if a master page with the same name as that of the given
@@ -95,7 +95,7 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
{
SdPage* pCandidate = static_cast<SdPage*>(
rTargetDocument.GetMasterSdPage (nMaster, PK_STANDARD));
- if (pMasterPage!=NULL
+ if (pMasterPage!=nullptr
&& pCandidate->GetName() == pMasterPage->GetName())
{
bPageExists = true;
@@ -121,18 +121,18 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
SdPage* pSlide = rTargetDocument.GetSdPage(
rTargetDocument.GetSdPageCount(PK_STANDARD)-1,
PK_STANDARD);
- if (pSlide == NULL)
+ if (pSlide == nullptr)
break;
pSlide->SetAutoLayout(AUTOLAYOUT_TITLE, true);
// Create a copy of the master page and the associated notes
// master page and insert them into our document.
pNewMasterPage = AddMasterPage(rTargetDocument, pMasterPage);
- if (pNewMasterPage==NULL)
+ if (pNewMasterPage==nullptr)
break;
SdPage* pNewNotesMasterPage
= AddMasterPage(rTargetDocument, pNotesMasterPage);
- if (pNewNotesMasterPage==NULL)
+ if (pNewNotesMasterPage==nullptr)
break;
// Make the connection from the new slide to the master page
@@ -156,15 +156,15 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument (
SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage)
{
- SdPage* pCandidate = NULL;
+ SdPage* pCandidate = nullptr;
- SdDrawDocument* pDocument = NULL;
- if (pMasterPage != NULL)
+ SdDrawDocument* pDocument = nullptr;
+ if (pMasterPage != nullptr)
pDocument = dynamic_cast<SdDrawDocument*>(pMasterPage->GetModel());
// Iterate over all pages and check if it references the given master
// page.
- if (pDocument!=NULL && pDocument->GetSdPageCount(PK_STANDARD) > 0)
+ if (pDocument!=nullptr && pDocument->GetSdPageCount(PK_STANDARD) > 0)
{
// In most cases a new slide has just been inserted so start with
// the last page.
@@ -175,7 +175,7 @@ SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage)
pCandidate = pDocument->GetSdPage(
nPageIndex,
PK_STANDARD);
- if (pCandidate != NULL)
+ if (pCandidate != nullptr)
{
if (static_cast<SdPage*>(&pCandidate->TRG_GetMasterPage())
== pMasterPage)
@@ -194,7 +194,7 @@ SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage)
// If no page was found that refernced the given master page reset
// the pointer that is returned.
if ( ! bFound)
- pCandidate = NULL;
+ pCandidate = nullptr;
}
return pCandidate;
@@ -204,9 +204,9 @@ SdPage* DocumentHelper::AddMasterPage (
SdDrawDocument& rTargetDocument,
SdPage* pMasterPage)
{
- SdPage* pClonedMasterPage = NULL;
+ SdPage* pClonedMasterPage = nullptr;
- if (pMasterPage!=NULL)
+ if (pMasterPage!=nullptr)
{
try
{
@@ -216,7 +216,7 @@ SdPage* DocumentHelper::AddMasterPage (
// Copy the necessary styles.
SdDrawDocument* pSourceDocument
= static_cast<SdDrawDocument*>(pMasterPage->GetModel());
- if (pSourceDocument != NULL)
+ if (pSourceDocument != nullptr)
ProvideStyles (*pSourceDocument, rTargetDocument, pClonedMasterPage);
// Copy the precious flag.
@@ -228,17 +228,17 @@ SdPage* DocumentHelper::AddMasterPage (
}
catch(const uno::Exception&)
{
- pClonedMasterPage = NULL;
+ pClonedMasterPage = nullptr;
DBG_UNHANDLED_EXCEPTION();
}
catch(const ::std::exception&)
{
- pClonedMasterPage = NULL;
+ pClonedMasterPage = nullptr;
OSL_TRACE ("caught general exception");
}
catch(...)
{
- pClonedMasterPage = NULL;
+ pClonedMasterPage = nullptr;
OSL_TRACE ("caught general exception");
}
}
@@ -272,7 +272,7 @@ void DocumentHelper::ProvideStyles (
if( !aCreatedStyles.empty() )
{
::svl::IUndoManager* pUndoManager = rTargetDocument.GetDocSh()->GetUndoManager();
- if (pUndoManager != NULL)
+ if (pUndoManager != nullptr)
{
SdMoveStyleSheetsUndoAction* pMovStyles =
new SdMoveStyleSheetsUndoAction (
@@ -289,7 +289,7 @@ void DocumentHelper::AssignMasterPageToPageList (
SdPage* pMasterPage,
const std::shared_ptr<std::vector<SdPage*> >& rpPageList)
{
- if (pMasterPage == NULL || !pMasterPage->IsMasterPage())
+ if (pMasterPage == nullptr || !pMasterPage->IsMasterPage())
return;
// Make the layout name by stripping ouf the layout postfix from the
@@ -309,8 +309,8 @@ void DocumentHelper::AssignMasterPageToPageList (
::std::vector<SdPage*> aCleanedList;
for (iPage=rpPageList->begin(); iPage!=rpPageList->end(); ++iPage)
{
- OSL_ASSERT(*iPage!=NULL && (*iPage)->GetModel() == &rTargetDocument);
- if (*iPage != NULL && (*iPage)->GetLayoutName() != sFullLayoutName)
+ OSL_ASSERT(*iPage!=nullptr && (*iPage)->GetModel() == &rTargetDocument);
+ if (*iPage != nullptr && (*iPage)->GetLayoutName() != sFullLayoutName)
{
aCleanedList.push_back(*iPage);
}
@@ -323,7 +323,7 @@ void DocumentHelper::AssignMasterPageToPageList (
pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), OUString());
SdPage* pMasterPageInDocument = ProvideMasterPage(rTargetDocument,pMasterPage,rpPageList);
- if (pMasterPageInDocument == NULL)
+ if (pMasterPageInDocument == nullptr)
return;
// Assign the master pages to the given list of pages.
@@ -346,9 +346,9 @@ SdPage* DocumentHelper::AddMasterPage (
SdPage* pMasterPage,
sal_uInt16 nInsertionIndex)
{
- SdPage* pClonedMasterPage = NULL;
+ SdPage* pClonedMasterPage = nullptr;
- if (pMasterPage!=NULL)
+ if (pMasterPage!=nullptr)
{
// Duplicate the master page.
pClonedMasterPage = static_cast<SdPage*>(pMasterPage->Clone());
@@ -359,7 +359,7 @@ SdPage* DocumentHelper::AddMasterPage (
// Copy the necessary styles.
SdDrawDocument* pSourceDocument
= static_cast<SdDrawDocument*>(pMasterPage->GetModel());
- if (pSourceDocument != NULL)
+ if (pSourceDocument != nullptr)
{
ProvideStyles (*pSourceDocument, rTargetDocument, pClonedMasterPage);
@@ -403,10 +403,10 @@ void DocumentHelper::AssignMasterPageToPage (
SdPage* pPage)
{
// Leave early when the parameters are invalid.
- if (pPage == NULL || pMasterPage == NULL)
+ if (pPage == nullptr || pMasterPage == nullptr)
return;
SdDrawDocument* pDocument = dynamic_cast<SdDrawDocument*>(pPage->GetModel());
- if (pDocument == NULL)
+ if (pDocument == nullptr)
return;
if ( ! pPage->IsMasterPage())
@@ -430,12 +430,12 @@ void DocumentHelper::AssignMasterPageToPage (
else
{
// Find first slide that uses the master page.
- SdPage* pSlide = NULL;
+ SdPage* pSlide = nullptr;
sal_uInt16 nPageCount = pDocument->GetSdPageCount(PK_STANDARD);
- for (sal_uInt16 nPage=0; nPage<nPageCount&&pSlide==NULL; nPage++)
+ for (sal_uInt16 nPage=0; nPage<nPageCount&&pSlide==nullptr; nPage++)
{
SdrPage* pCandidate = pDocument->GetSdPage(nPage,PK_STANDARD);
- if (pCandidate != NULL
+ if (pCandidate != nullptr
&& pCandidate->TRG_HasMasterPage()
&& &(pCandidate->TRG_GetMasterPage()) == pPage)
{
@@ -443,7 +443,7 @@ void DocumentHelper::AssignMasterPageToPage (
}
}
- if (pSlide != NULL)
+ if (pSlide != nullptr)
{
// 2. Assign the given master pages to the first slide that was
// found above that uses the master page.
@@ -472,26 +472,26 @@ SdPage* DocumentHelper::ProvideMasterPage (
// Make sure that both the master page and its notes master exist
// in the source document. If one is missing then return without
// making any changes.
- if (pMasterPage == NULL)
+ if (pMasterPage == nullptr)
{
// The caller should make sure that the master page is valid.
- OSL_ASSERT(pMasterPage != NULL);
- return NULL;
+ OSL_ASSERT(pMasterPage != nullptr);
+ return nullptr;
}
SdDrawDocument* pSourceDocument = static_cast<SdDrawDocument*>(pMasterPage->GetModel());
- if (pSourceDocument == NULL)
- return NULL;
+ if (pSourceDocument == nullptr)
+ return nullptr;
SdPage* pNotesMasterPage = static_cast<SdPage*>(
pSourceDocument->GetMasterPage(pMasterPage->GetPageNum()+1));
- if (pNotesMasterPage == NULL)
+ if (pNotesMasterPage == nullptr)
{
// The model is not in a valid state. Maybe a new master page
// is being (not finished yet) created? Return without making
// any changes.
- return NULL;
+ return nullptr;
}
- SdPage* pMasterPageInDocument = NULL;
+ SdPage* pMasterPageInDocument = nullptr;
// Search for a master page with the same name as the given one in
// the target document.
const OUString sMasterPageLayoutName (pMasterPage->GetLayoutName());
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 6ec03406c5ee..212d0a6c17c4 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -129,7 +129,7 @@ LayoutMenu::LayoutMenu (
DropTargetHelper(this),
mrBase(rViewShellBase),
mbUseOwnScrollBar(false),
- mxListener(NULL),
+ mxListener(nullptr),
mbSelectionUpdatePending(true),
mbIsMainViewChangePending(false),
mxSidebar(rxSidebar),
@@ -231,7 +231,7 @@ AutoLayout LayoutMenu::GetSelectedAutoLayout()
if ( ! IsNoSelection() && GetSelectItemId()!=0)
{
AutoLayout* pLayout = static_cast<AutoLayout*>(GetItemData(GetSelectItemId()));
- if (pLayout != NULL)
+ if (pLayout != nullptr)
aResult = *pLayout;
}
@@ -318,21 +318,21 @@ void LayoutMenu::MouseButtonDown (const MouseEvent& rEvent)
void LayoutMenu::InsertPageWithLayout (AutoLayout aLayout)
{
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
- if (pViewShell == NULL)
+ if (pViewShell == nullptr)
return;
SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
- if (pViewFrame == NULL)
+ if (pViewFrame == nullptr)
return;
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
- if (pDispatcher == NULL)
+ if (pDispatcher == nullptr)
return;
// Call SID_INSERTPAGE with the right arguments. This is because
// the popup menu can not call this slot with arguments directly.
SfxRequest aRequest (CreateRequest(SID_INSERTPAGE, aLayout));
- if (aRequest.GetArgs() != NULL)
+ if (aRequest.GetArgs() != nullptr)
{
pDispatcher->Execute(
SID_INSERTPAGE,
@@ -384,7 +384,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
{
// The view shell in the center pane has to be present.
ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
- if (pMainViewShell == NULL)
+ if (pMainViewShell == nullptr)
break;
// Determine if the current view is in an invalid master page mode.
@@ -397,7 +397,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
case ViewShell::ST_IMPRESS:
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
- if (pDrawViewShell != NULL)
+ if (pDrawViewShell != nullptr)
if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
bMasterPageMode = true;
}
@@ -416,7 +416,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
// possible only some of the view shells in the center pane. When
// no valid slide sorter is available then ask the main view shell
// for its current page.
- SlideSorterViewShell* pSlideSorter = NULL;
+ SlideSorterViewShell* pSlideSorter = nullptr;
switch (pMainViewShell->GetShellType())
{
case ViewShell::ST_IMPRESS:
@@ -427,13 +427,13 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
default:
break;
}
- if (pSlideSorter != NULL)
+ if (pSlideSorter != nullptr)
{
// There is a slide sorter visible so get the list of selected pages from it.
pPageSelection = pSlideSorter->GetPageSelection();
}
- if( (pSlideSorter == NULL) || (pPageSelection.get() == 0) || pPageSelection->empty() )
+ if( (pSlideSorter == nullptr) || (pPageSelection.get() == nullptr) || pPageSelection->empty() )
{
// No valid slide sorter available. Ask the main view shell for
// its current page.
@@ -447,7 +447,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
::std::vector<SdPage*>::iterator iPage;
for (iPage=pPageSelection->begin(); iPage!=pPageSelection->end(); ++iPage)
{
- if ((*iPage) == NULL)
+ if ((*iPage) == nullptr)
continue;
// Call the SID_ASSIGN_LAYOUT slot with all the necessary parameters.
@@ -474,10 +474,10 @@ SfxRequest LayoutMenu::CreateRequest (
sal_uInt8 aBackgroundObject (rLayerAdmin.GetLayerID(
SD_RESSTR(STR_LAYER_BCKGRNDOBJ), false));
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
- if (pViewShell == NULL)
+ if (pViewShell == nullptr)
break;
SdPage* pPage = pViewShell->GetActualPage();
- if (pPage == NULL)
+ if (pPage == nullptr)
break;
SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers());
@@ -502,7 +502,7 @@ void LayoutMenu::Fill()
SvtLanguageOptions aLanguageOptions;
bool bVertical = aLanguageOptions.IsVerticalTextEnabled();
SdDrawDocument* pDocument = mrBase.GetDocument();
- bool bRightToLeft = (pDocument!=NULL
+ bool bRightToLeft = (pDocument!=nullptr
&& pDocument->GetDefaultWritingMode() == WritingMode_RL_TB);
// Get URL of the view in the center pane.
@@ -521,7 +521,7 @@ void LayoutMenu::Fill()
catch (RuntimeException&)
{}
- const snewfoil_value_info* pInfo = NULL;
+ const snewfoil_value_info* pInfo = nullptr;
if (sCenterPaneViewName.equals(framework::FrameworkHelper::msNotesViewURL))
{
pInfo = notes;
@@ -537,12 +537,12 @@ void LayoutMenu::Fill()
}
else
{
- pInfo = NULL;
+ pInfo = nullptr;
}
Clear();
int n = 0;
- for (sal_uInt16 i=1; pInfo!=NULL&&pInfo->mnBmpResId!=0; i++,pInfo++)
+ for (sal_uInt16 i=1; pInfo!=nullptr&&pInfo->mnBmpResId!=0; i++,pInfo++)
{
if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical)
{
@@ -610,14 +610,14 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
// Setup the menu.
std::shared_ptr<PopupMenu> pMenu (new PopupMenu(SdResId(RID_TASKPANE_LAYOUTMENU_POPUP)));
FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
- if (pMenuWindow != NULL)
+ if (pMenuWindow != nullptr)
pMenuWindow->SetPopupModeFlags(
pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
pMenu->SetSelectHdl(LINK(this, LayoutMenu, OnMenuItemSelected));
// Disable the SID_INSERTPAGE_LAYOUT_MENU item when
// the document is read-only.
- const SfxPoolItem* pItem = NULL;
+ const SfxPoolItem* pItem = nullptr;
const SfxItemState aState (
mrBase.GetViewFrame()->GetDispatcher()->QueryState(SID_INSERTPAGE, pItem));
if (aState == SfxItemState::DISABLED)
@@ -641,9 +641,9 @@ IMPL_LINK_NOARG_TYPED(LayoutMenu, StateChangeHandler, const OUString&, void)
IMPL_LINK_TYPED(LayoutMenu, OnMenuItemSelected, Menu*, pMenu, bool)
{
- if (pMenu == NULL)
+ if (pMenu == nullptr)
{
- OSL_ENSURE(pMenu!=NULL, "LayoutMenu::OnMenuItemSelected: illegal menu!");
+ OSL_ENSURE(pMenu!=nullptr, "LayoutMenu::OnMenuItemSelected: illegal menu!");
return false;
}
@@ -672,11 +672,11 @@ void LayoutMenu::UpdateSelection()
{
// Get current page of main view.
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
- if (pViewShell == NULL)
+ if (pViewShell == nullptr)
break;
SdPage* pCurrentPage = pViewShell->getCurrentPage();
- if (pCurrentPage == NULL)
+ if (pCurrentPage == nullptr)
break;
// Get layout of current page.
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index 71121d38352e..a75743aa2da9 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -580,7 +580,7 @@ void MasterPageContainer::Implementation::UpdatePreviewSizePixel()
MasterPageContainerType::const_iterator iDescriptor;
MasterPageContainerType::const_iterator iContainerEnd(maContainer.end());
for (iDescriptor=maContainer.begin(); iDescriptor!=iContainerEnd; ++iDescriptor)
- if (*iDescriptor!=0 && (*iDescriptor)->mpMasterPage != nullptr)
+ if (*iDescriptor!=nullptr && (*iDescriptor)->mpMasterPage != nullptr)
{
Size aPageSize ((*iDescriptor)->mpMasterPage->GetSize());
OSL_ASSERT(aPageSize.Width() > 0 && aPageSize.Height() > 0);
diff --git a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx
index c47d2ed52cc0..43e60a1ff9c3 100644
--- a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx
@@ -32,7 +32,7 @@ MasterPageContainerFiller::MasterPageContainerFiller (ContainerAdapter& rpAdapte
: mrContainerAdapter(rpAdapter),
meState(INITIALIZE_TEMPLATE_SCANNER),
mpScannerTask(),
- mpLastAddedEntry(NULL),
+ mpLastAddedEntry(nullptr),
mnIndex(1)
{
// Add one entry for the default master page. We use temporarily the
@@ -85,7 +85,7 @@ void MasterPageContainerFiller::RunNextStep()
{
case DONE:
case ERROR:
- if (mpScannerTask.get() != NULL)
+ if (mpScannerTask.get() != nullptr)
{
mrContainerAdapter.FillingDone();
mpScannerTask.reset();
@@ -112,7 +112,7 @@ MasterPageContainerFiller::State MasterPageContainerFiller::ScanTemplate()
{
State eState (ERROR);
- if (mpScannerTask.get() != NULL)
+ if (mpScannerTask.get() != nullptr)
{
if (mpScannerTask->HasNextStep())
{
@@ -120,7 +120,7 @@ MasterPageContainerFiller::State MasterPageContainerFiller::ScanTemplate()
if (mpScannerTask->GetLastAddedEntry() != mpLastAddedEntry)
{
mpLastAddedEntry = mpScannerTask->GetLastAddedEntry();
- if (mpLastAddedEntry != NULL)
+ if (mpLastAddedEntry != nullptr)
eState = ADD_TEMPLATE;
else
eState = SCAN_TEMPLATE;
@@ -137,7 +137,7 @@ MasterPageContainerFiller::State MasterPageContainerFiller::ScanTemplate()
MasterPageContainerFiller::State MasterPageContainerFiller::AddTemplate()
{
- if (mpLastAddedEntry != NULL)
+ if (mpLastAddedEntry != nullptr)
{
SharedMasterPageDescriptor pDescriptor (new MasterPageDescriptor(
MasterPageContainer::TEMPLATE,
diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
index 1c73b514ff09..3bd897d56614 100644
--- a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
@@ -51,7 +51,7 @@ Image PagePreviewProvider::operator () (
{
Image aPreview;
- if (pPage != NULL)
+ if (pPage != nullptr)
{
// Use the given renderer to create a preview of the given page
// object.
@@ -118,24 +118,24 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume
// Unused parameters.
(void)pContainerDocument;
- SdPage* pPage = NULL;
+ SdPage* pPage = nullptr;
- mxDocumentShell = NULL;
- ::sd::DrawDocShell* pDocumentShell = NULL;
+ mxDocumentShell = nullptr;
+ ::sd::DrawDocShell* pDocumentShell = nullptr;
try
{
// Load the template document and return its first page.
pDocumentShell = LoadDocument (msURL);
- if (pDocumentShell != NULL)
+ if (pDocumentShell != nullptr)
{
SdDrawDocument* pDocument = pDocumentShell->GetDoc();
- if (pDocument != NULL)
+ if (pDocument != nullptr)
{
pPage = pDocument->GetMasterSdPage(0, PK_STANDARD);
// In order to make the newly loaded master page deletable
// when copied into documents it is marked as no "precious".
// When it is modified then it is marked as "precious".
- if (pPage != NULL)
+ if (pPage != nullptr)
pPage->SetPrecious(false);
}
}
@@ -143,7 +143,7 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume
catch (const uno::RuntimeException&)
{
DBG_UNHANDLED_EXCEPTION();
- pPage = NULL;
+ pPage = nullptr;
}
return pPage;
@@ -157,7 +157,7 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume
pSet->Put (SfxBoolItem (SID_PREVIEW, true));
if (pSfxApp->LoadTemplate (mxDocumentShell, sFileName, true, pSet))
{
- mxDocumentShell = NULL;
+ mxDocumentShell = nullptr;
}
SfxObjectShell* pShell = mxDocumentShell;
return dynamic_cast< ::sd::DrawDocShell *>( pShell );
@@ -172,7 +172,7 @@ bool TemplatePageObjectProvider::operator== (const PageObjectProvider& rProvider
{
const TemplatePageObjectProvider* pTemplatePageObjectProvider
= dynamic_cast<const TemplatePageObjectProvider*>(&rProvider);
- if (pTemplatePageObjectProvider != NULL)
+ if (pTemplatePageObjectProvider != nullptr)
return (msURL == pTemplatePageObjectProvider->msURL);
else
return false;
@@ -186,16 +186,16 @@ DefaultPageObjectProvider::DefaultPageObjectProvider()
SdPage* DefaultPageObjectProvider::operator () (SdDrawDocument* pContainerDocument)
{
- SdPage* pLocalMasterPage = NULL;
- if (pContainerDocument != NULL)
+ SdPage* pLocalMasterPage = nullptr;
+ if (pContainerDocument != nullptr)
{
sal_Int32 nIndex (0);
SdPage* pLocalSlide = pContainerDocument->GetSdPage((sal_uInt16)nIndex, PK_STANDARD);
- if (pLocalSlide!=NULL && pLocalSlide->TRG_HasMasterPage())
+ if (pLocalSlide!=nullptr && pLocalSlide->TRG_HasMasterPage())
pLocalMasterPage = dynamic_cast<SdPage*>(&pLocalSlide->TRG_GetMasterPage());
}
- if (pLocalMasterPage == NULL)
+ if (pLocalMasterPage == nullptr)
{
DBG_ASSERT(false, "can not create master page for slide");
}
@@ -210,7 +210,7 @@ int DefaultPageObjectProvider::GetCostIndex()
bool DefaultPageObjectProvider::operator== (const PageObjectProvider& rProvider)
{
- return (dynamic_cast<const DefaultPageObjectProvider*>(&rProvider) != NULL);
+ return (dynamic_cast<const DefaultPageObjectProvider*>(&rProvider) != nullptr);
}
//===== ExistingPageProvider ==================================================
@@ -236,7 +236,7 @@ bool ExistingPageProvider::operator== (const PageObjectProvider& rProvider)
{
const ExistingPageProvider* pExistingPageProvider
= dynamic_cast<const ExistingPageProvider*>(&rProvider);
- if (pExistingPageProvider != NULL)
+ if (pExistingPageProvider != nullptr)
return (mpPage == pExistingPageProvider->mpPage);
else
return false;
diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx
index 65a5af93ba1a..76a121b8a917 100644
--- a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx
@@ -116,7 +116,7 @@ void MasterPageContainerQueue::LateInit()
bool MasterPageContainerQueue::RequestPreview (const SharedMasterPageDescriptor& rpDescriptor)
{
bool bSuccess (false);
- if (rpDescriptor.get() != NULL
+ if (rpDescriptor.get() != nullptr
&& rpDescriptor->maLargePreview.GetSizePixel().Width() == 0)
{
sal_Int32 nPriority (CalculatePriority(rpDescriptor));
@@ -153,11 +153,11 @@ sal_Int32 MasterPageContainerQueue::CalculatePriority (
// The cost is used as a starting value.
int nCost (0);
- if (rpDescriptor->mpPreviewProvider.get() != NULL)
+ if (rpDescriptor->mpPreviewProvider.get() != nullptr)
{
nCost = rpDescriptor->mpPreviewProvider->GetCostIndex();
if (rpDescriptor->mpPreviewProvider->NeedsPageObject())
- if (rpDescriptor->mpPageObjectProvider.get() != NULL)
+ if (rpDescriptor->mpPageObjectProvider.get() != nullptr)
nCost += rpDescriptor->mpPageObjectProvider->GetCostIndex();
}
@@ -214,13 +214,13 @@ IMPL_LINK_TYPED(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer
mpRequestQueue->erase(mpRequestQueue->begin());
- if (aRequest.mpDescriptor.get() != NULL)
+ if (aRequest.mpDescriptor.get() != nullptr)
{
mnRequestsServedCount += 1;
if ( ! mpWeakContainer.expired())
{
std::shared_ptr<ContainerAdapter> pContainer (mpWeakContainer);
- if (pContainer.get() != NULL)
+ if (pContainer.get() != nullptr)
pContainer->UpdateDescriptor(aRequest.mpDescriptor,false,true,true);
}
}
diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx
index 025b3f23512e..7a1d461b956d 100644
--- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx
+++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx
@@ -42,8 +42,8 @@ MasterPageDescriptor::MasterPageDescriptor (
msPageName(rsPageName),
msStyleName(rsStyleName),
mbIsPrecious(bIsPrecious),
- mpMasterPage(NULL),
- mpSlide(NULL),
+ mpMasterPage(nullptr),
+ mpSlide(nullptr),
maSmallPreview(),
maLargePreview(),
mpPreviewProvider(rpPreviewProvider),
@@ -123,13 +123,13 @@ Image MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize eSize)
bDataChanged = true;
}
- if (mpPageObjectProvider.get()==NULL && rDescriptor.mpPageObjectProvider.get()!=NULL)
+ if (mpPageObjectProvider.get()==nullptr && rDescriptor.mpPageObjectProvider.get()!=nullptr)
{
mpPageObjectProvider = rDescriptor.mpPageObjectProvider;
bDataChanged = true;
}
- if (mpPreviewProvider.get()==NULL && rDescriptor.mpPreviewProvider.get()!=NULL)
+ if (mpPreviewProvider.get()==nullptr && rDescriptor.mpPreviewProvider.get()!=nullptr)
{
mpPreviewProvider = rDescriptor.mpPreviewProvider;
bPreviewChanged = true;
@@ -164,8 +164,8 @@ int MasterPageDescriptor::UpdatePageObject (
int nModified = 0;
// Update the page object when that is not yet known.
- if (mpMasterPage == NULL
- && mpPageObjectProvider.get()!=NULL
+ if (mpMasterPage == nullptr
+ && mpPageObjectProvider.get()!=nullptr
&& (nCostThreshold<0 || mpPageObjectProvider->GetCostIndex()<=nCostThreshold))
{
// Note that pDocument may be NULL.
@@ -174,18 +174,18 @@ int MasterPageDescriptor::UpdatePageObject (
if (meOrigin == MasterPageContainer::MASTERPAGE)
{
mpMasterPage = pPage;
- if (mpMasterPage != NULL)
+ if (mpMasterPage != nullptr)
mpMasterPage->SetPrecious(mbIsPrecious);
}
else
{
// Master pages from templates are copied into the local document.
- if (pDocument != NULL)
+ if (pDocument != nullptr)
mpMasterPage = DocumentHelper::CopyMasterPageToLocalDocument(*pDocument,pPage);
mpSlide = DocumentHelper::GetSlideForMasterPage(mpMasterPage);
}
- if (mpMasterPage != NULL)
+ if (mpMasterPage != nullptr)
{
// Update page name and style name.
if (msPageName.isEmpty())
@@ -220,11 +220,11 @@ bool MasterPageDescriptor::UpdatePreview (
// Update the preview when that is not yet known.
if (maLargePreview.GetSizePixel().Width()==0
- && mpPreviewProvider.get()!=NULL
+ && mpPreviewProvider.get()!=nullptr
&& (nCostThreshold<0 || mpPreviewProvider->GetCostIndex()<=nCostThreshold))
{
SdPage* pPage = mpSlide;
- if (pPage == NULL)
+ if (pPage == nullptr)
{
pPage = mpMasterPage;
}
@@ -288,7 +288,7 @@ MasterPageDescriptor::URLComparator::URLComparator (const OUString& sURL)
bool MasterPageDescriptor::URLComparator::operator() (
const SharedMasterPageDescriptor& rDescriptor)
{
- if (rDescriptor.get() == NULL)
+ if (rDescriptor.get() == nullptr)
return false;
else
return rDescriptor->msURL.equals(msURL);
@@ -304,7 +304,7 @@ MasterPageDescriptor::StyleNameComparator::StyleNameComparator (const OUString&
bool MasterPageDescriptor::StyleNameComparator::operator() (
const SharedMasterPageDescriptor& rDescriptor)
{
- if (rDescriptor.get() == NULL)
+ if (rDescriptor.get() == nullptr)
return false;
else
return rDescriptor->msStyleName.equals(msStyleName);
@@ -320,7 +320,7 @@ MasterPageDescriptor::PageObjectComparator::PageObjectComparator (const SdPage*
bool MasterPageDescriptor::PageObjectComparator::operator() (
const SharedMasterPageDescriptor& rDescriptor)
{
- if (rDescriptor.get() == NULL)
+ if (rDescriptor.get() == nullptr)
return false;
else
return rDescriptor->mpMasterPage==mpMasterPage;
@@ -335,7 +335,7 @@ MasterPageDescriptor::AllComparator::AllComparator(const SharedMasterPageDescrip
bool MasterPageDescriptor::AllComparator::operator() (const SharedMasterPageDescriptor&rDescriptor)
{
- if (rDescriptor.get() == NULL)
+ if (rDescriptor.get() == nullptr)
return false;
else
{
@@ -353,10 +353,10 @@ bool MasterPageDescriptor::AllComparator::operator() (const SharedMasterPageDesc
&& mpDescriptor->msPageName.equals(rDescriptor->msPageName))
|| (!mpDescriptor->msStyleName.isEmpty()
&& mpDescriptor->msStyleName.equals(rDescriptor->msStyleName))
- || (mpDescriptor->mpMasterPage!=NULL
+ || (mpDescriptor->mpMasterPage!=nullptr
&& mpDescriptor->mpMasterPage==rDescriptor->mpMasterPage)
- || (mpDescriptor->mpPageObjectProvider.get()!=NULL
- && rDescriptor->mpPageObjectProvider.get()!=NULL
+ || (mpDescriptor->mpPageObjectProvider.get()!=nullptr
+ && rDescriptor->mpPageObjectProvider.get()!=nullptr
&& mpDescriptor->mpPageObjectProvider==rDescriptor->mpPageObjectProvider));
}
}
diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx
index a9855f6a113d..1e0a14ecd687 100644
--- a/sd/source/ui/sidebar/MasterPageObserver.cxx
+++ b/sd/source/ui/sidebar/MasterPageObserver.cxx
@@ -88,17 +88,17 @@ private:
void SendEvent (MasterPageObserverEvent& rEvent);
};
-MasterPageObserver* MasterPageObserver::Implementation::mpInstance = NULL;
+MasterPageObserver* MasterPageObserver::Implementation::mpInstance = nullptr;
//===== MasterPageObserver ====================================================
MasterPageObserver& MasterPageObserver::Instance()
{
- if (Implementation::mpInstance == NULL)
+ if (Implementation::mpInstance == nullptr)
{
::osl::GetGlobalMutex aMutexFunctor;
::osl::MutexGuard aGuard (aMutexFunctor());
- if (Implementation::mpInstance == NULL)
+ if (Implementation::mpInstance == nullptr)
{
MasterPageObserver* pInstance = new MasterPageObserver ();
SdGlobalResourceContainer::Instance().AddResource (
@@ -112,7 +112,7 @@ MasterPageObserver& MasterPageObserver::Instance()
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
}
- DBG_ASSERT(Implementation::mpInstance!=NULL,
+ DBG_ASSERT(Implementation::mpInstance!=nullptr,
"MasterPageObserver::Instance(): instance is NULL");
return *Implementation::mpInstance;
}
@@ -156,7 +156,7 @@ void MasterPageObserver::Implementation::RegisterDocument (
for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD);
- if (pMasterPage != NULL)
+ if (pMasterPage != nullptr)
aMasterPageSet.insert (pMasterPage->GetName());
}
@@ -259,7 +259,7 @@ void MasterPageObserver::Implementation::AnalyzeUsedMasterPages (
for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD);
- if (pMasterPage != NULL)
+ if (pMasterPage != nullptr)
aCurrentMasterPages.insert (pMasterPage->GetName());
OSL_TRACE("currently used master page %d is %s",
nIndex,
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 0f24434b8fc7..2daa5ec3f09e 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -188,10 +188,10 @@ IMPL_LINK_TYPED(MasterPagesSelector, RightClickHandler, const MouseEvent&, rEven
PreviewValueSet::GrabFocus ();
PreviewValueSet::ReleaseMouse();
SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
- if (pViewFrame != NULL)
+ if (pViewFrame != nullptr)
{
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
- if (pDispatcher != NULL)
+ if (pDispatcher != nullptr)
{
sal_uInt16 nIndex = PreviewValueSet::GetItemId (rEvent.GetPosPixel());
if (nIndex > 0)
@@ -225,7 +225,7 @@ void MasterPagesSelector::Command (const CommandEvent& rEvent)
// Setup the menu.
std::unique_ptr<PopupMenu> pMenu (new PopupMenu(GetContextMenuResId()));
FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
- if (pMenuWindow != NULL)
+ if (pMenuWindow != nullptr)
pMenuWindow->SetPopupModeFlags(
pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
pMenu->SetSelectHdl(LINK(this, MasterPagesSelector, OnMenuItemSelected));
@@ -252,9 +252,9 @@ void MasterPagesSelector::ProcessPopupMenu (Menu& rMenu)
IMPL_LINK_TYPED(MasterPagesSelector, OnMenuItemSelected, Menu*, pMenu, bool)
{
- if (pMenu == NULL)
+ if (pMenu == nullptr)
{
- OSL_ENSURE(pMenu!=NULL, "MasterPagesSelector::OnMenuItemSelected: illegal menu!");
+ OSL_ENSURE(pMenu!=nullptr, "MasterPagesSelector::OnMenuItemSelected: illegal menu!");
return false;
}
@@ -308,10 +308,10 @@ void MasterPagesSelector::ExecuteCommand (const sal_Int32 nCommandId)
if (pMasterPage)
xSelectedMaster.set(pMasterPage->getUnoPage(), uno::UNO_QUERY);
SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
- if (pViewFrame != NULL && xSelectedMaster.is())
+ if (pViewFrame != nullptr && xSelectedMaster.is())
{
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
- if (pDispatcher != NULL)
+ if (pDispatcher != nullptr)
{
sal_uInt16 nIndex = PreviewValueSet::GetSelectItemId();
pDispatcher->Execute(SID_MASTERPAGE, SfxCallMode::SYNCHRON);
@@ -339,10 +339,10 @@ SdPage* MasterPagesSelector::GetSelectedMasterPage()
{
const ::osl::MutexGuard aGuard (maMutex);
- SdPage* pMasterPage = NULL;
+ SdPage* pMasterPage = nullptr;
sal_uInt16 nIndex = PreviewValueSet::GetSelectItemId();
UserData* pData = GetUserData(nIndex);
- if (pData != NULL)
+ if (pData != nullptr)
{
pMasterPage = mpContainer->GetPageObjectForToken(pData->second);
}
@@ -354,7 +354,7 @@ SdPage* MasterPagesSelector::GetSelectedMasterPage()
*/
void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage)
{
- if (pMasterPage == NULL)
+ if (pMasterPage == nullptr)
return;
sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD);
@@ -370,7 +370,7 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage)
for (sal_uInt16 nPageIndex=0; nPageIndex<nPageCount; nPageIndex++)
{
SdPage* pPage = mrDocument.GetSdPage (nPageIndex, PK_STANDARD);
- if (pPage != NULL && pPage->GetLayoutName() != sFullLayoutName)
+ if (pPage != nullptr && pPage->GetLayoutName() != sFullLayoutName)
{
pPageList->push_back (pPage);
}
@@ -388,12 +388,12 @@ void MasterPagesSelector::AssignMasterPageToSelectedSlides (
using namespace ::sd::slidesorter;
using namespace ::sd::slidesorter::controller;
- if (pMasterPage == NULL)
+ if (pMasterPage == nullptr)
return;
// Find a visible slide sorter.
SlideSorterViewShell* pSlideSorter = SlideSorterViewShell::GetSlideSorter(mrBase);
- if (pSlideSorter == NULL)
+ if (pSlideSorter == nullptr)
return;
// Get a list of selected pages.
@@ -470,7 +470,7 @@ MasterPagesSelector::UserData* MasterPagesSelector::GetUserData (int nIndex) con
if (nIndex>0 && static_cast<unsigned int>(nIndex)<=PreviewValueSet::GetItemCount())
return static_cast<UserData*>(PreviewValueSet::GetItemData((sal_uInt16)nIndex));
else
- return NULL;
+ return nullptr;
}
void MasterPagesSelector::SetUserData (int nIndex, UserData* pData)
@@ -480,7 +480,7 @@ void MasterPagesSelector::SetUserData (int nIndex, UserData* pData)
if (nIndex>0 && static_cast<unsigned int>(nIndex)<=PreviewValueSet::GetItemCount())
{
UserData* pOldData = GetUserData(nIndex);
- if (pOldData!=NULL && pOldData!=pData)
+ if (pOldData!=nullptr && pOldData!=pData)
delete pOldData;
PreviewValueSet::SetItemData((sal_uInt16)nIndex, pData);
}
@@ -552,7 +552,7 @@ void MasterPagesSelector::RemoveTokenToIndexEntry (
const ::osl::MutexGuard aGuard (maMutex);
UserData* pData = GetUserData(nIndex);
- if (pData != NULL)
+ if (pData != nullptr)
{
// Get the token that the index pointed to previously.
MasterPageContainer::Token aOldToken (pData->second);
@@ -572,7 +572,7 @@ void MasterPagesSelector::InvalidatePreview (const SdPage* pPage)
for (size_t nIndex=1; nIndex<=PreviewValueSet::GetItemCount(); nIndex++)
{
UserData* pData = GetUserData(nIndex);
- if (pData != NULL)
+ if (pData != nullptr)
{
MasterPageContainer::Token aToken (pData->second);
if (pPage == mpContainer->GetPageObjectForToken(aToken,false))
@@ -592,7 +592,7 @@ void MasterPagesSelector::UpdateAllPreviews()
for (size_t nIndex=1; nIndex<=PreviewValueSet::GetItemCount(); nIndex++)
{
UserData* pData = GetUserData(nIndex);
- if (pData != NULL)
+ if (pData != nullptr)
{
MasterPageContainer::Token aToken (pData->second);
PreviewValueSet::SetItemImage(
@@ -612,7 +612,7 @@ void MasterPagesSelector::ClearPageSet()
for (size_t nIndex=1; nIndex<=PreviewValueSet::GetItemCount(); nIndex++)
{
UserData* pData = GetUserData(nIndex);
- if (pData != NULL)
+ if (pData != nullptr)
delete pData;
}
PreviewValueSet::Clear();
diff --git a/sd/source/ui/sidebar/PanelBase.cxx b/sd/source/ui/sidebar/PanelBase.cxx
index 3aaa0b2cd90f..c96f5fbab376 100644
--- a/sd/source/ui/sidebar/PanelBase.cxx
+++ b/sd/source/ui/sidebar/PanelBase.cxx
@@ -25,7 +25,7 @@ PanelBase::PanelBase (
vcl::Window* pParentWindow,
ViewShellBase& rViewShellBase)
: Control(pParentWindow),
- mpWrappedControl(NULL),
+ mpWrappedControl(nullptr),
mxSidebar(),
mrViewShellBase(rViewShellBase)
{
@@ -75,7 +75,7 @@ bool PanelBase::ProvideWrappedControl()
if (mxSidebar.is())
mxSidebar->requestLayout();
}
- return mpWrappedControl.get() != NULL;
+ return mpWrappedControl.get() != nullptr;
}
ISidebarReceiver::~ISidebarReceiver()
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index 139cd91f5540..8939525859ba 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -80,7 +80,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
// Throw exceptions when the arguments are not as expected.
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
- if ( ! xParentWindow.is() || pParentWindow==NULL)
+ if ( ! xParentWindow.is() || pParentWindow==nullptr)
throw RuntimeException(
"PanelFactory::createUIElement called without ParentWindow");
if ( ! xFrame.is())
@@ -88,16 +88,16 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
"PanelFactory::createUIElement called without XFrame");
// Tunnel through the controller to obtain a ViewShellBase.
- ViewShellBase* pBase = NULL;
+ ViewShellBase* pBase = nullptr;
Reference<lang::XUnoTunnel> xTunnel (xFrame->getController(), UNO_QUERY);
if (xTunnel.is())
{
::sd::DrawController* pController = reinterpret_cast<sd::DrawController*>(
xTunnel->getSomething(sd::DrawController::getUnoTunnelId()));
- if (pController != NULL)
+ if (pController != nullptr)
pBase = pController->GetViewShellBase();
}
- if (pBase == NULL)
+ if (pBase == nullptr)
throw RuntimeException("can not get ViewShellBase for frame");
// Get bindings from given arguments.
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index c4492e837b87..f9a23f115aab 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -38,8 +38,8 @@ VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
SdDrawDocument* pDocument = rViewShellBase.GetDocument();
- if (pDocument == NULL)
- return NULL;
+ if (pDocument == nullptr)
+ return nullptr;
std::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
@@ -100,7 +100,7 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList)
for (nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD);
- if (pMasterPage != NULL)
+ if (pMasterPage != nullptr)
aCurrentNames.insert (pMasterPage->GetName());
}
diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
index 318108d19987..7d52c78540bb 100644
--- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
+++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
@@ -61,15 +61,15 @@ static OUString GetPathToSetNode()
namespace sd { namespace sidebar {
-RecentlyUsedMasterPages* RecentlyUsedMasterPages::mpInstance = NULL;
+RecentlyUsedMasterPages* RecentlyUsedMasterPages::mpInstance = nullptr;
RecentlyUsedMasterPages& RecentlyUsedMasterPages::Instance()
{
- if (mpInstance == NULL)
+ if (mpInstance == nullptr)
{
::osl::GetGlobalMutex aMutexFunctor;
::osl::MutexGuard aGuard (aMutexFunctor());
- if (mpInstance == NULL)
+ if (mpInstance == nullptr)
{
RecentlyUsedMasterPages* pInstance = new RecentlyUsedMasterPages();
pInstance->LateInit();