diff options
Diffstat (limited to 'vcl/source/window')
54 files changed, 623 insertions, 623 deletions
diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx index 3ae9e30fafc7..d12d4d47d451 100644 --- a/vcl/source/window/abstdlg.cxx +++ b/vcl/source/window/abstdlg.cxx @@ -33,7 +33,7 @@ extern "C" VclAbstractDialogFactory* CreateDialogFactory(); VclAbstractDialogFactory* VclAbstractDialogFactory::Create() { - FuncPtrCreateDialogFactory fp = 0; + FuncPtrCreateDialogFactory fp = nullptr; #if HAVE_FEATURE_DESKTOP #ifndef DISABLE_DYNLOADING static ::osl::Module aDialogLibrary; @@ -50,7 +50,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create() #endif if ( fp ) return fp(); - return 0; + return nullptr; } VclAbstractDialog::~VclAbstractDialog() diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index a8ce0a4ecfc5..d06e6a28ebd8 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -40,7 +40,7 @@ public: }; sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId, - sal_uInt16* pIndex = NULL ) + sal_uInt16* pIndex = nullptr ) { size_t nLow; size_t nHigh; @@ -96,7 +96,7 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry ) do { nIndex++; - ImplAccelEntry* pTempEntry = NULL; + ImplAccelEntry* pTempEntry = nullptr; if ( nIndex < pList->size() ) pTempEntry = (*pList)[ nIndex ]; if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) ) @@ -147,7 +147,7 @@ void Accelerator::ImplInit() mnCurId = 0; mnCurRepeat = 0; mbIsCancel = false; - mpDel = NULL; + mpDel = nullptr; } ImplAccelEntry* Accelerator::ImplGetAccelData( const vcl::KeyCode& rKeyCode ) const @@ -156,7 +156,7 @@ ImplAccelEntry* Accelerator::ImplGetAccelData( const vcl::KeyCode& rKeyCode ) co if( it != mpData->maKeyMap.end() ) return it->second; else - return NULL; + return nullptr; } void Accelerator::ImplCopyData( ImplAccelData& rAccelData ) @@ -173,7 +173,7 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData ) pEntry->mpAutoAccel = pEntry->mpAccel; } else - pEntry->mpAutoAccel = NULL; + pEntry->mpAutoAccel = nullptr; mpData->maKeyMap.insert( std::make_pair( pEntry->maKeyCode.GetFullCode(), pEntry ) ); mpData->maIdList.push_back( pEntry ); @@ -310,7 +310,7 @@ void Accelerator::Select() void Accelerator::InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ) { - ImplInsertAccel( nItemId, rKeyCode, true, NULL ); + ImplInsertAccel( nItemId, rKeyCode, true, nullptr ); } void Accelerator::InsertItem( const ResId& rResId ) @@ -320,7 +320,7 @@ void Accelerator::InsertItem( const ResId& rResId ) sal_uInt16 nAccelKeyId; sal_uInt16 bDisable; vcl::KeyCode aKeyCode; - Accelerator* pAutoAccel = NULL; + Accelerator* pAutoAccel = nullptr; GetRes( rResId.SetRT( RSC_ACCELITEM ) ); nObjMask = ReadLongRes(); @@ -364,7 +364,7 @@ vcl::KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const { - ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; + ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : nullptr; if ( pEntry ) return pEntry->mnId; else @@ -378,7 +378,7 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const if ( nIndex != ACCELENTRY_NOTFOUND ) return mpData->maIdList[ nIndex ]->mpAccel; else - return NULL; + return nullptr; } Accelerator& Accelerator::operator=( const Accelerator& rAccel ) diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index 5b79b92e82cd..e0a708f78ff9 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -109,11 +109,11 @@ using ::com::sun::star::awt::XTopWindow; ImplAccessibleInfos::ImplAccessibleInfos() { nAccessibleRole = 0xFFFF; - pAccessibleName = NULL; - pAccessibleDescription = NULL; - pLabeledByWindow = NULL; - pLabelForWindow = NULL; - pMemberOfWindow = NULL; + pAccessibleName = nullptr; + pAccessibleDescription = nullptr; + pLabeledByWindow = nullptr; + pLabelForWindow = nullptr; + pMemberOfWindow = nullptr; } ImplAccessibleInfos::~ImplAccessibleInfos() @@ -215,13 +215,13 @@ vcl::Window* Window::ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uIn rChildCount++; } - return NULL; + return nullptr; } vcl::Window* Window::GetAccessibleParentWindow() const { if ( ImplIsAccessibleNativeFrame() ) - return NULL; + return nullptr; vcl::Window* pParent = mpWindowImpl->mpParent; if( GetType() == WINDOW_MENUBARWINDOW ) @@ -620,7 +620,7 @@ vcl::Window* Window::GetAccessibleRelationMemberOf() const if (!isContainerWindow(this) && !isContainerWindow(GetParent())) return getLegacyNonLayoutAccessibleRelationMemberOf(); - return NULL; + return nullptr; } vcl::Window* Window::getAccessibleRelationLabelFor() const @@ -628,7 +628,7 @@ vcl::Window* Window::getAccessibleRelationLabelFor() const if (mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow) return mpWindowImpl->mpAccessibleInfos->pLabelForWindow; - return NULL; + return nullptr; } vcl::Window* Window::GetAccessibleRelationLabelFor() const @@ -641,7 +641,7 @@ vcl::Window* Window::GetAccessibleRelationLabelFor() const if (!isContainerWindow(this) && !isContainerWindow(GetParent())) return getLegacyNonLayoutAccessibleRelationLabelFor(); - return NULL; + return nullptr; } vcl::Window* Window::GetAccessibleRelationLabeledBy() const @@ -665,7 +665,7 @@ vcl::Window* Window::GetAccessibleRelationLabeledBy() const if (!isContainerWindow(this) && !isContainerWindow(GetParent())) return getLegacyNonLayoutAccessibleRelationLabeledBy(); - return NULL; + return nullptr; } bool Window::IsAccessibilityEventsSuppressed( bool bTraverseParentPath ) diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index b94e8c062414..295a1681d40a 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -90,12 +90,12 @@ void ImplAccelManager::EndSequence() { Accelerator* pTempAccel = (*mpSequenceList)[ i ]; pTempAccel->mbIsCancel = false; - pTempAccel->mpDel = NULL; + pTempAccel->mpDel = nullptr; } // delete sequence-list delete mpSequenceList; - mpSequenceList = NULL; + mpSequenceList = nullptr; } bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRepeat ) @@ -111,7 +111,7 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRep // are we in a sequence ? if ( mpSequenceList ) { - pAccel = mpSequenceList->empty() ? NULL : (*mpSequenceList)[ 0 ]; + pAccel = mpSequenceList->empty() ? nullptr : (*mpSequenceList)[ 0 ]; // not found ? if ( !pAccel ) @@ -160,7 +160,7 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRep pAccel->maCurKeyCode = vcl::KeyCode(); pAccel->mnCurId = 0; pAccel->mnCurRepeat = 0; - pAccel->mpDel = NULL; + pAccel->mpDel = nullptr; } return true; @@ -230,7 +230,7 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode, sal_uInt16 nRep pAccel->maCurKeyCode = vcl::KeyCode(); pAccel->mnCurId = 0; pAccel->mnCurRepeat = 0; - pAccel->mpDel = NULL; + pAccel->mpDel = nullptr; } return true; diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index adb0621ab66b..f65e69ec26d7 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -442,7 +442,7 @@ void ImplNoBorderWindowView::DrawWindow(vcl::RenderContext&, sal_uInt16, const P // - ImplSmallBorderWindowView - ImplSmallBorderWindowView::ImplSmallBorderWindowView( ImplBorderWindow* pBorderWindow ) : mpBorderWindow(pBorderWindow) - , mpOutDev(NULL) + , mpOutDev(nullptr) , mnWidth(0) , mnHeight(0) , mnLeftBorder(0) @@ -460,7 +460,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei mnHeight = nHeight; mbNWFBorder = false; - vcl::Window *pWin = NULL, *pCtrl = NULL; + vcl::Window *pWin = nullptr, *pCtrl = nullptr; if (mpOutDev->GetOutDevType() == OUTDEV_WINDOW) pWin = static_cast<vcl::Window*>(mpOutDev.get()); @@ -552,7 +552,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei mpBorderWindow->SetBackground(); pCtrl->SetPaintTransparent( true ); - vcl::Window* pCompoundParent = NULL; + vcl::Window* pCompoundParent = nullptr; if( pWin->GetParent() && pWin->GetParent()->IsCompoundControl() ) pCompoundParent = pWin->GetParent(); @@ -805,8 +805,8 @@ ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindo maFrameData.mnHelpState = DrawButtonFlags::NONE; maFrameData.mbTitleClipped = false; - mpATitleVirDev = NULL; - mpDTitleVirDev = NULL; + mpATitleVirDev = nullptr; + mpDTitleVirDev = nullptr; } ImplStdBorderWindowView::~ImplStdBorderWindowView() @@ -1728,7 +1728,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, sal_uInt16 nTypeStyle, const ::com::sun::star::uno::Any& ) { - ImplInit( pParent, nStyle, nTypeStyle, NULL ); + ImplInit( pParent, nStyle, nTypeStyle, nullptr ); } void ImplBorderWindow::ImplInit( vcl::Window* pParent, @@ -1786,7 +1786,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, SetBackground(); SetTextFillColor(); - mpMenuBarWindow = NULL; + mpMenuBarWindow = nullptr; mnMinWidth = 0; mnMinHeight = 0; mnMaxWidth = SHRT_MAX; @@ -1832,7 +1832,7 @@ ImplBorderWindow::~ImplBorderWindow() void ImplBorderWindow::dispose() { delete mpBorderView; - mpBorderView = NULL; + mpBorderView = nullptr; mpMenuBarWindow.clear(); mpNotebookBarWindow.disposeAndClear(); vcl::Window::dispose(); diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index ec9589aea781..6ad603ab1a76 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -101,7 +101,7 @@ ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const return &(*it); } - return NULL; + return nullptr; } long ButtonDialog::ImplGetButtonSize() @@ -236,7 +236,7 @@ void ButtonDialog::StateChanged( StateChangedType nType ) for (auto & it : m_ItemList) { if ( it->mpPushButton && it->mbOwnButton ) - it->mpPushButton->SetZOrder(0, ZOrderFlags::Last); + it->mpPushButton->SetZOrder(nullptr, ZOrderFlags::Last); } // Set focus on default button. @@ -366,7 +366,7 @@ PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const if ( pItem ) return pItem->mpPushButton; else - return NULL; + return nullptr; } void ButtonDialog::SetButtonText( sal_uInt16 nId, const OUString& rText ) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index f16d439f1bb5..e39eb6f8435f 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -376,9 +376,9 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr for (std::vector<ButtonImageWidgetMap>::iterator aI = m_pParserState->m_aButtonImageWidgetMaps.begin(), aEnd = m_pParserState->m_aButtonImageWidgetMaps.end(); aI != aEnd; ++aI) { - PushButton *pTargetButton = NULL; - RadioButton *pTargetRadio = NULL; - Button *pTarget = NULL; + PushButton *pTargetButton = nullptr; + RadioButton *pTargetRadio = nullptr; + Button *pTarget = nullptr; if (!aI->m_bRadio) { @@ -1851,7 +1851,7 @@ VclPtr<vcl::Window> VclBuilder::insertObject(vcl::Window *pParent, const OString //deferred due to waiting to encounter it in this .ui, and it hasn't //been seen yet, then make unattached widgets parent-less toplevels if (pParent == m_pParent.get() && m_bToplevelHasDeferredInit) - pParent = NULL; + pParent = nullptr; pCurrentChild = makeObject(pParent, rClass, rID, rProps); } @@ -2029,7 +2029,7 @@ bool VclBuilder::sortIntoBestTabTraversalOrder::operator()(const vcl::Window *pA void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader) { - vcl::Window *pCurrentChild = NULL; + vcl::Window *pCurrentChild = nullptr; xmlreader::Span name; int nsId; @@ -2102,7 +2102,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader) else if (sInternalChild.startsWith("action_area") || sInternalChild.startsWith("messagedialog-action_area")) { vcl::Window *pContentArea = pCurrentChild->GetParent(); - if (Dialog *pBoxParent = dynamic_cast<Dialog*>(pContentArea ? pContentArea->GetParent() : NULL)) + if (Dialog *pBoxParent = dynamic_cast<Dialog*>(pContentArea ? pContentArea->GetParent() : nullptr)) { pBoxParent->set_action_area(static_cast<VclButtonBox*>(pCurrentChild)); // FIXME-VCLPTR } @@ -2117,7 +2117,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader) aChilds.push_back(pChild); } - bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != NULL; + bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr; //sort child order within parent so that tabbing //between controls goes in a visually sensible sequence @@ -2945,12 +2945,12 @@ VclPtr<vcl::Window> VclBuilder::handleObject(vcl::Window *pParent, xmlreader::Xm if (sClass == "GtkAdjustment") { handleAdjustment(sID, aProperties); - return NULL; + return nullptr; } else if (sClass == "GtkTextBuffer") { handleTextBuffer(sID, aProperties); - return NULL; + return nullptr; } if (!pCurrentChild) @@ -3010,7 +3010,7 @@ void VclBuilder::applyPackingProperty(vcl::Window *pCurrent, //ToolBoxItems are not true widgets just elements //of the ToolBox itself - ToolBox *pToolBoxParent = NULL; + ToolBox *pToolBoxParent = nullptr; if (pCurrent == pParent) pToolBoxParent = dynamic_cast<ToolBox*>(pParent); @@ -3217,7 +3217,7 @@ void VclBuilder::collectAccelerator(xmlreader::XmlReader &reader, stringmap &rMa vcl::Window *VclBuilder::get_widget_root() { - return m_aChildren.empty() ? NULL : m_aChildren[0].m_pWindow.get(); + return m_aChildren.empty() ? nullptr : m_aChildren[0].m_pWindow.get(); } vcl::Window *VclBuilder::get_by_name(const OString& sID) @@ -3229,7 +3229,7 @@ vcl::Window *VclBuilder::get_by_name(const OString& sID) return aI->m_pWindow; } - return NULL; + return nullptr; } PopupMenu *VclBuilder::get_menu(const OString& sID) @@ -3241,7 +3241,7 @@ PopupMenu *VclBuilder::get_menu(const OString& sID) return aI->m_pMenu; } - return NULL; + return nullptr; } short VclBuilder::get_response(const vcl::Window *pWindow) const @@ -3355,7 +3355,7 @@ const VclBuilder::ListStore *VclBuilder::get_model_by_name(const OString& sID) c std::map<OString, ListStore>::const_iterator aI = m_pParserState->m_aModels.find(sID); if (aI != m_pParserState->m_aModels.end()) return &(aI->second); - return NULL; + return nullptr; } const VclBuilder::TextBuffer *VclBuilder::get_buffer_by_name(const OString& sID) const @@ -3363,7 +3363,7 @@ const VclBuilder::TextBuffer *VclBuilder::get_buffer_by_name(const OString& sID) std::map<OString, TextBuffer>::const_iterator aI = m_pParserState->m_aTextBuffers.find(sID); if (aI != m_pParserState->m_aTextBuffers.end()) return &(aI->second); - return NULL; + return nullptr; } const VclBuilder::Adjustment *VclBuilder::get_adjustment_by_name(const OString& sID) const @@ -3371,7 +3371,7 @@ const VclBuilder::Adjustment *VclBuilder::get_adjustment_by_name(const OString& std::map<OString, Adjustment>::const_iterator aI = m_pParserState->m_aAdjustments.find(sID); if (aI != m_pParserState->m_aAdjustments.end()) return &(aI->second); - return NULL; + return nullptr; } void VclBuilder::mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt16 nActiveId) diff --git a/vcl/source/window/cairo_cairo.cxx b/vcl/source/window/cairo_cairo.cxx index a722c2e8d073..54b27dc98cf7 100644 --- a/vcl/source/window/cairo_cairo.cxx +++ b/vcl/source/window/cairo_cairo.cxx @@ -35,7 +35,7 @@ namespace cairo const SystemEnvData* GetSysData(const vcl::Window *pOutputWindow) { - const SystemEnvData* pSysData = NULL; + const SystemEnvData* pSysData = nullptr; // check whether we're a SysChild: have to fetch system data // directly from SystemChildWindow, because the GetSystemData // method is unfortunately not virtual diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index 9b088c3fa868..41ed2cb6d786 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -274,7 +274,7 @@ void Window::ImplInitWinChildClipRegion() if ( mpWindowImpl->mpChildClipRegion ) { delete mpWindowImpl->mpChildClipRegion; - mpWindowImpl->mpChildClipRegion = NULL; + mpWindowImpl->mpChildClipRegion = nullptr; } } else @@ -375,7 +375,7 @@ bool Window::ImplSysObjClip( const vcl::Region* pOldRegion ) void Window::ImplUpdateSysObjChildrenClip() { if ( mpWindowImpl->mpSysObj && mpWindowImpl->mbInitWinClipRegion ) - ImplSysObjClip( NULL ); + ImplSysObjClip( nullptr ); vcl::Window* pWindow = mpWindowImpl->mpFirstChild; while ( pWindow ) @@ -423,7 +423,7 @@ bool Window::ImplSetClipFlagChildren( bool bSysObjOnlySmaller ) bool bUpdate = true; if ( mpWindowImpl->mpSysObj ) { - vcl::Region* pOldRegion = NULL; + vcl::Region* pOldRegion = nullptr; if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion ) pOldRegion = new vcl::Region( mpWindowImpl->maWinClipRegion ); @@ -898,7 +898,7 @@ void Window::ImplDeleteOverlapBackground() if ( mpWindowImpl->mpOverlapData->mpSaveBackRgn ) { delete mpWindowImpl->mpOverlapData->mpSaveBackRgn; - mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL; + mpWindowImpl->mpOverlapData->mpSaveBackRgn = nullptr; } // remove window from the list @@ -911,7 +911,7 @@ void Window::ImplDeleteOverlapBackground() pTemp = pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin; pTemp->mpWindowImpl->mpOverlapData->mpNextBackWin = mpWindowImpl->mpOverlapData->mpNextBackWin; } - mpWindowImpl->mpOverlapData->mpNextBackWin = NULL; + mpWindowImpl->mpOverlapData->mpNextBackWin = nullptr; } } diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx index 803d7e24f64a..1af5431a5c66 100644 --- a/vcl/source/window/cmdevt.cxx +++ b/vcl/source/window/cmdevt.cxx @@ -32,7 +32,7 @@ CommandExtTextInputData::CommandExtTextInputData( const OUString& rText, memcpy( mpTextAttr, pTextAttr, maText.getLength()*sizeof(sal_uInt16) ); } else - mpTextAttr = NULL; + mpTextAttr = nullptr; mnCursorPos = nCursorPos; mnCursorFlags = nCursorFlags; mbOnlyCursor = bOnlyCursor; @@ -47,7 +47,7 @@ CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData& memcpy( mpTextAttr, rData.mpTextAttr, maText.getLength()*sizeof(sal_uInt16) ); } else - mpTextAttr = NULL; + mpTextAttr = nullptr; mnCursorPos = rData.mnCursorPos; mnCursorFlags = rData.mnCursorFlags; mbOnlyCursor = rData.mbOnlyCursor; diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 5a01d10e676a..738ff0d3418c 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -175,7 +175,7 @@ void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) pWindow = Application::GetFocusWindow(); if ( !pWindow || (pWindow->mpWindowImpl->mpCursor != this) || pWindow->mpWindowImpl->mbInPaint || !pWindow->mpWindowImpl->mpFrameData->mbHasFocus ) - pWindow = NULL; + pWindow = nullptr; } if ( pWindow ) @@ -216,7 +216,7 @@ bool vcl::Cursor::ImplDoHide( bool bSuspend ) if ( !bSuspend ) { mpData->maTimer.Stop(); - mpData->mpWindow = NULL; + mpData->mpWindow = nullptr; } } return bWasCurVisible; @@ -269,8 +269,8 @@ IMPL_LINK_NOARG_TYPED(vcl::Cursor, ImplTimerHdl, Timer *, void) vcl::Cursor::Cursor() { - mpData = NULL; - mpWindow = NULL; + mpData = nullptr; + mpWindow = nullptr; mnSlant = 0; mnOrientation = 0; mnDirection = CursorDirection::NONE; @@ -282,8 +282,8 @@ vcl::Cursor::Cursor( const Cursor& rCursor ) : maSize( rCursor.maSize ), maPos( rCursor.maPos ) { - mpData = NULL; - mpWindow = NULL; + mpData = nullptr; + mpWindow = nullptr; mnSlant = rCursor.mnSlant; mnOrientation = rCursor.mnOrientation; mnDirection = rCursor.mnDirection; diff --git a/vcl/source/window/debug.cxx b/vcl/source/window/debug.cxx index e1d48fc876e7..baa370027022 100644 --- a/vcl/source/window/debug.cxx +++ b/vcl/source/window/debug.cxx @@ -41,7 +41,7 @@ const char* ImplDbgCheckWindow( const void* pObj ) pChild = pChild->mpWindowImpl->mpNext; } - return NULL; + return nullptr; } #endif diff --git a/vcl/source/window/debugevent.cxx b/vcl/source/window/debugevent.cxx index 11d17daa8f2a..e57b06b35db8 100644 --- a/vcl/source/window/debugevent.cxx +++ b/vcl/source/window/debugevent.cxx @@ -49,7 +49,7 @@ vcl::Window *DebugEventInjector::ChooseWindow() if (!(pParent = Application::GetTopWindow( nIdx ))) pParent = static_cast<vcl::Window *>(Application::GetAppWindow()); } - assert (pParent != NULL); + assert (pParent != nullptr); std::vector< vcl::Window *> aChildren; pParent->CollectChildren( aChildren ); @@ -104,7 +104,7 @@ void DebugEventInjector::InjectMenuEvent() sal_uInt16 nEvent = nEvents[ (int)(getRandom() * SAL_N_ELEMENTS( nEvents )) ]; SalMenuEvent aEvent = aIds[ getRandom() * aIds.size() ]; - bool bHandled = ImplWindowFrameProc( pSysWin, NULL, nEvent, &aEvent); + bool bHandled = ImplWindowFrameProc( pSysWin, nullptr, nEvent, &aEvent); SAL_INFO( "vcl.debugevent", "Injected menu event " << aEvent.mpMenu @@ -160,14 +160,14 @@ void DebugEventInjector::InjectTextEvent() if( getRandom() < 0.05 ) // modifier aKeyEvent.mnCode |= (sal_uInt16)( getRandom() * KEY_MODIFIERS_MASK ) & KEY_MODIFIERS_MASK; - bool bHandled = ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYINPUT, &aKeyEvent); + bool bHandled = ImplWindowFrameProc( pWindow, nullptr, SALEVENT_KEYINPUT, &aKeyEvent); SAL_INFO( "vcl.debugevent", "Injected key 0x" << std::hex << (int) aKeyEvent.mnCode << std::dec << " -> " << bHandled << " win " << pWindow ); - ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYUP, &aKeyEvent ); + ImplWindowFrameProc( pWindow, nullptr, SALEVENT_KEYUP, &aKeyEvent ); } /* @@ -242,13 +242,13 @@ void DebugEventInjector::InjectKeyNavEdit() aKeyEvent.mnCharCode = 0x0; // hopefully unused. - bool bHandled = ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYINPUT, &aKeyEvent ); + bool bHandled = ImplWindowFrameProc( pWindow, nullptr, SALEVENT_KEYINPUT, &aKeyEvent ); SAL_INFO( "vcl.debugevent", "Injected edit / move key 0x" << std::hex << (int) aKeyEvent.mnCode << std::dec << " -> " << bHandled << " win " << pWindow ); - ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYUP, &aKeyEvent ); + ImplWindowFrameProc( pWindow, nullptr, SALEVENT_KEYUP, &aKeyEvent ); } void DebugEventInjector::Invoke() @@ -269,12 +269,12 @@ DebugEventInjector *DebugEventInjector::getCreate() sal_uInt32 nEvents; const char *pEvents = getenv("VCL_EVENT_INJECTION"); if (!pEvents) - return NULL; + return nullptr; nEvents = OString( pEvents ).toUInt32(); if (nEvents > 0) return new DebugEventInjector( nEvents ); else - return NULL; + return nullptr; } #endif // OSL_DEBUG_LEVEL > 0 diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 376c7bf2bb4e..538c6b1d9573 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -623,7 +623,7 @@ void ImplDrawButton( OutputDevice *const pDev, Rectangle aFillRect, void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, const StyleSettings& rStyleSettings, DrawFrameStyle nStyle, DrawFrameFlags nFlags ) { - vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : NULL; + vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : nullptr; const bool bMenuStyle(nFlags & DrawFrameFlags::Menu); @@ -683,7 +683,7 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, if ( bNoDraw ) { - ImplDrawDPILineRect( pDev, rRect, NULL, bRound ); + ImplDrawDPILineRect( pDev, rRect, nullptr, bRound ); } else { @@ -1055,7 +1055,7 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo { Point aStart( rStart ), aStop( rStop ); const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings(); - vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(mpOutDev.get()) : NULL; + vcl::Window *const pWin = (mpOutDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(mpOutDev.get()) : nullptr; if(pWin) { ControlPart nPart = ( bVertical ? PART_SEPARATOR_VERT : PART_SEPARATOR_HORZ ); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index ea24882f7bba..c98270cf38e8 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -135,9 +135,9 @@ vcl::Window * nextLogicalChildOfParent(vcl::Window *pTopLevel, vcl::Window *pChi { vcl::Window *pParent = pLastChild->GetParent(); if (!pParent) - return NULL; + return nullptr; if (pParent == pTopLevel) - return NULL; + return nullptr; pLastChild = pParent; pChild = pParent->GetWindow(GetWindowType::Next); } @@ -161,9 +161,9 @@ vcl::Window * prevLogicalChildOfParent(vcl::Window *pTopLevel, vcl::Window *pChi { vcl::Window *pParent = pLastChild->GetParent(); if (!pParent) - return NULL; + return nullptr; if (pParent == pTopLevel) - return NULL; + return nullptr; pLastChild = pParent; pChild = pParent->GetWindow(GetWindowType::Prev); } @@ -237,7 +237,7 @@ void ImplWindowAutoMnemonic( vcl::Window* pWindow ) static VclButtonBox* getActionArea(Dialog *pDialog) { - VclButtonBox *pButtonBox = NULL; + VclButtonBox *pButtonBox = nullptr; if (pDialog->isLayoutEnabled()) { vcl::Window *pBox = pDialog->GetWindow(GetWindowType::FirstChild); @@ -276,7 +276,7 @@ static PushButton* ImplGetDefaultButton( Dialog* pDialog ) pChild = pChild->GetWindow( GetWindowType::Next ); } - return NULL; + return nullptr; } static PushButton* ImplGetOKButton( Dialog* pDialog ) @@ -290,7 +290,7 @@ static PushButton* ImplGetOKButton( Dialog* pDialog ) pChild = pChild->GetWindow( GetWindowType::Next ); } - return NULL; + return nullptr; } static PushButton* ImplGetCancelButton( Dialog* pDialog ) @@ -305,7 +305,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog ) pChild = pChild->GetWindow( GetWindowType::Next ); } - return NULL; + return nullptr; } static void ImplMouseAutoPos( Dialog* pDialog ) @@ -342,7 +342,7 @@ struct DialogImpl void Dialog::ImplInitDialogData() { mpWindowImpl->mbDialog = true; - mpPrevExecuteDlg = NULL; + mpPrevExecuteDlg = nullptr; mbInExecute = false; mbOldSaveBack = false; mbInClose = false; @@ -365,7 +365,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag ) nStyle |= WB_SYSTEMWINDOW; if (eFlag == InitFlag::NoParent) - pParent = NULL; + pParent = nullptr; else if (!pParent) // parent is NULL: get the default Dialog parent { pParent = Application::GetDefDialogParent(); @@ -402,7 +402,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag ) if ( (nStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE)) == WB_BORDER ) { VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle, BORDERWINDOW_STYLE_FRAME ); - SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL ); + SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, nullptr ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpWindowImpl->mpBorderWindow = pBorderWin; @@ -412,7 +412,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag ) { mpWindowImpl->mbFrame = true; mpWindowImpl->mbOverlapWin = true; - SystemWindow::ImplInit( pParent, (nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE)) | WB_CLOSEABLE, NULL ); + SystemWindow::ImplInit( pParent, (nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE)) | WB_CLOSEABLE, nullptr ); // Now set all style bits mpWindowImpl->mnStyle = nStyle; } @@ -420,7 +420,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag ) else { VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle, BORDERWINDOW_STYLE_OVERLAP | BORDERWINDOW_STYLE_BORDER ); - SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL ); + SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, nullptr ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpWindowImpl->mpBorderWindow = pBorderWin; @@ -508,7 +508,7 @@ OUString VclBuilderContainer::getUIRootDir() void Dialog::doDeferredInit(WinBits nBits) { VclPtr<vcl::Window> pParent = mpDialogParent; - mpDialogParent = NULL; + mpDialogParent = nullptr; ImplInit(pParent, nBits, mnInitFlag); mbIsDefferedInit = false; } @@ -572,7 +572,7 @@ Dialog::~Dialog() void Dialog::dispose() { delete mpDialogImpl; - mpDialogImpl = NULL; + mpDialogImpl = nullptr; mpPrevExecuteDlg.clear(); mpActionArea.clear(); mpContentArea.clear(); @@ -955,7 +955,7 @@ void Dialog::EndDialog( long nResult ) mpPrevExecuteDlg->GrabFocus(); } } - mpPrevExecuteDlg = NULL; + mpPrevExecuteDlg = nullptr; Hide(); EnableSaveBackground( mbOldSaveBack ); @@ -1092,7 +1092,7 @@ void Dialog::GrabFocusToFirstControl() // find focus control, even if the dialog has focus if ( HasFocus() ) - pFocusControl = NULL; + pFocusControl = nullptr; else { // prefer a child window which had focus before @@ -1174,7 +1174,7 @@ bool Dialog::set_property(const OString &rKey, const OString &rValue) } VclBuilderContainer::VclBuilderContainer() - : m_pUIBuilder(NULL) + : m_pUIBuilder(nullptr) { } diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 097f3ef95e8e..11f3c3c96fbd 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -70,8 +70,8 @@ static vcl::Window* ImplGetTopParentOfTabHierarchy( vcl::Window* pParent ) static vcl::Window* ImplGetSubChildWindow( vcl::Window* pParent, sal_uInt16 n, sal_uInt16& nIndex ) { - vcl::Window* pTabPage = NULL; - vcl::Window* pFoundWindow = NULL; + vcl::Window* pTabPage = nullptr; + vcl::Window* pFoundWindow = nullptr; vcl::Window* pWindow = firstLogicalChildOfParent(pParent); vcl::Window* pNextWindow = pWindow; @@ -86,7 +86,7 @@ static vcl::Window* ImplGetSubChildWindow( vcl::Window* pParent, sal_uInt16 n, s if ( pTabPage ) { pFoundWindow = ImplGetSubChildWindow( pTabPage, n, nIndex ); - pTabPage = NULL; + pTabPage = nullptr; } else { @@ -189,7 +189,7 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType DBG_ASSERT( (nIndex >= nFormStart) && (nIndex <= nFormEnd), "Window::ImplGetDlgWindow() - nIndex not in Form" ); - vcl::Window* pWindow = NULL; + vcl::Window* pWindow = nullptr; sal_uInt16 i; sal_uInt16 nTemp; sal_uInt16 nStartIndex; @@ -275,7 +275,7 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType } if ( !(pWindow->GetStyle() & WB_TABSTOP) ) - pWindow = NULL; + pWindow = nullptr; } } } @@ -292,8 +292,8 @@ vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow, sal_uInt16& rFormStart, sal_uInt16& rFormEnd ) { vcl::Window* pSWindow; - vcl::Window* pSecondWindow = NULL; - vcl::Window* pTempWindow = NULL; + vcl::Window* pSecondWindow = nullptr; + vcl::Window* pTempWindow = nullptr; sal_uInt16 i; sal_uInt16 nSecond_i = 0; sal_uInt16 nFormStart = 0; @@ -303,7 +303,7 @@ vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow, // find focus window in the child list vcl::Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, false ); - if( pWindow == NULL ) + if( pWindow == nullptr ) pWindow = pSWindow; while ( pSWindow ) @@ -325,14 +325,14 @@ vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow, pSWindow = ImplGetNextWindow( pParent, i, i, false ); if ( !i ) - pSWindow = NULL; + pSWindow = nullptr; } if ( !pSWindow ) { // Window not found; we cannot handle it if ( !pSecondWindow ) - return NULL; + return nullptr; else { pSWindow = pSecondWindow; @@ -445,7 +445,7 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_ sal_uInt16 nChildFormEnd; // get form start and end - ::ImplFindDlgCtrlWindow( pWindow, NULL, + ::ImplFindDlgCtrlWindow( pWindow, nullptr, nChildIndex, nChildFormStart, nChildFormEnd ); vcl::Window* pAccelWin = ImplFindAccelWindow( pWindow, nChildIndex, cCharCode, nChildFormStart, nChildFormEnd, @@ -467,7 +467,7 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_ pWindow = ImplGetChildWindow( pParent, nFormStart, i, bCheckEnable ); } - return NULL; + return nullptr; } namespace vcl { @@ -619,7 +619,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) } while ( pTempWindow ); - pButtonWindow = NULL; + pButtonWindow = nullptr; if ( nKeyCode == KEY_RETURN ) { @@ -634,7 +634,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) pButtonWindow = ImplGetNextWindow( this, iButton, iButton, true ); if ( (iButton <= iButtonStart) || (iButton > nFormEnd) ) - pButtonWindow = NULL; + pButtonWindow = nullptr; } if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & DialogControlFlags::Return) ) @@ -679,7 +679,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) pTempWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex ); } if ( (i <= iStart) || (i > nFormEnd) ) - pTempWindow = NULL; + pTempWindow = nullptr; } // if this is the same window, simulate a Get/LoseFocus, // in case AROUND is being processed @@ -709,7 +709,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) pButtonWindow = ImplGetNextWindow( this, iButton, iButton, true ); if ( (iButton <= iButtonStart) || (iButton > nFormEnd) ) - pButtonWindow = NULL; + pButtonWindow = nullptr; } if ( bKeyInput && mpWindowImpl->mpDlgCtrlDownWindow ) @@ -717,7 +717,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) if ( mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow ) { static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false ); - mpWindowImpl->mpDlgCtrlDownWindow = NULL; + mpWindowImpl->mpDlgCtrlDownWindow = nullptr; return true; } } @@ -738,10 +738,10 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) if ( aKeyCode.IsMod1() ) { // search group - vcl::Window* pFormularFirstWindow = NULL; - vcl::Window* pLastFormularFirstWindow = NULL; + vcl::Window* pFormularFirstWindow = nullptr; + vcl::Window* pLastFormularFirstWindow = nullptr; pTempWindow = ImplGetChildWindow( this, 0, iTemp, false ); - vcl::Window* pPrevFirstFormularFirstWindow = NULL; + vcl::Window* pPrevFirstFormularFirstWindow = nullptr; vcl::Window* pFirstFormularFirstWindow = pTempWindow; while ( pTempWindow ) { @@ -765,7 +765,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, false ); if ( !iTemp ) - pTempWindow = NULL; + pTempWindow = nullptr; } if ( bFormular ) @@ -929,7 +929,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow.get() != pButtonWindow) ) { static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false ); - mpWindowImpl->mpDlgCtrlDownWindow = NULL; + mpWindowImpl->mpDlgCtrlDownWindow = nullptr; } static_cast<PushButton*>(pButtonWindow)->SetPressed( true ); @@ -937,7 +937,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) } else if ( mpWindowImpl->mpDlgCtrlDownWindow.get() == pButtonWindow ) { - mpWindowImpl->mpDlgCtrlDownWindow = NULL; + mpWindowImpl->mpDlgCtrlDownWindow = nullptr; static_cast<PushButton*>(pButtonWindow)->SetPressed( false ); static_cast<PushButton*>(pButtonWindow)->Click(); } @@ -1000,8 +1000,8 @@ if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->G static void ImplDlgCtrlUpdateDefButton( vcl::Window* pParent, vcl::Window* pFocusWindow, bool bGetFocus ) { - PushButton* pOldDefButton = NULL; - PushButton* pNewDefButton = NULL; + PushButton* pOldDefButton = nullptr; + PushButton* pNewDefButton = nullptr; vcl::Window* pSWindow; sal_uInt16 i; sal_uInt16 nFormStart; @@ -1031,7 +1031,7 @@ static void ImplDlgCtrlUpdateDefButton( vcl::Window* pParent, vcl::Window* pFocu pSWindow = ImplGetNextWindow( pParent, i, i, false ); if ( !i || (i > nFormEnd) ) - pSWindow = NULL; + pSWindow = nullptr; } if ( !bGetFocus ) @@ -1039,10 +1039,10 @@ static void ImplDlgCtrlUpdateDefButton( vcl::Window* pParent, vcl::Window* pFocu sal_uInt16 nDummy; vcl::Window* pNewFocusWindow = Application::GetFocusWindow(); if ( !pNewFocusWindow || !pParent->ImplIsWindowOrChild( pNewFocusWindow ) ) - pNewDefButton = NULL; + pNewDefButton = nullptr; else if ( !::ImplFindDlgCtrlWindow( pParent, pNewFocusWindow, i, nDummy, nDummy ) || (i < nFormStart) || (i > nFormEnd) ) - pNewDefButton = NULL; + pNewDefButton = nullptr; } if ( pOldDefButton != pNewDefButton ) @@ -1059,7 +1059,7 @@ void Window::ImplDlgCtrlFocusChanged( vcl::Window* pWindow, bool bGetFocus ) if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus ) { static_cast<PushButton*>(mpWindowImpl->mpDlgCtrlDownWindow.get())->SetPressed( false ); - mpWindowImpl->mpDlgCtrlDownWindow = NULL; + mpWindowImpl->mpDlgCtrlDownWindow = nullptr; } ImplDlgCtrlUpdateDefButton( this, pWindow, bGetFocus ); @@ -1077,12 +1077,12 @@ vcl::Window* Window::ImplFindDlgCtrlWindow( vcl::Window* pWindow ) vcl::Window* Window::GetParentLabelFor( const vcl::Window* ) const { - return NULL; + return nullptr; } vcl::Window* Window::GetParentLabeledBy( const vcl::Window* ) const { - return NULL; + return nullptr; } KeyEvent Window::GetActivationKey() const diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx index 33dfbc44366c..a436bdefa002 100644 --- a/vcl/source/window/dndevdis.cxx +++ b/vcl/source/window/dndevdis.cxx @@ -35,14 +35,14 @@ using namespace ::com::sun::star::datatransfer::dnd; // DNDEventDispatcher::DNDEventDispatcher DNDEventDispatcher::DNDEventDispatcher( vcl::Window * pTopWindow ): m_pTopWindow( pTopWindow ), - m_pCurrentWindow( NULL ) + m_pCurrentWindow( nullptr ) { } // DNDEventDispatcher::~DNDEventDispatcher DNDEventDispatcher::~DNDEventDispatcher() { - designate_currentwindow(NULL); + designate_currentwindow(nullptr); } vcl::Window* DNDEventDispatcher::findTopLevelWindow(Point location) @@ -55,7 +55,7 @@ vcl::Window* DNDEventDispatcher::findTopLevelWindow(Point location) m_pTopWindow->ImplMirrorFramePos( location ); vcl::Window * pChildWindow = m_pTopWindow->ImplFindWindow( location ); - if( NULL == pChildWindow ) + if( nullptr == pChildWindow ) pChildWindow = m_pTopWindow; while( pChildWindow->ImplGetClientWindow() ) @@ -74,7 +74,7 @@ IMPL_LINK_TYPED(DNDEventDispatcher, WindowEventListener, VclWindowEvent&, rEvent { if (rEvent.GetId() == VCLEVENT_OBJECT_DYING) { - designate_currentwindow(NULL); + designate_currentwindow(nullptr); } } @@ -120,7 +120,7 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde ) } // this is a drop -> no further drag overs - designate_currentwindow(NULL); + designate_currentwindow(nullptr); m_aDataFlavorList.realloc( 0 ); } @@ -160,7 +160,7 @@ void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ ) fireDragExitEvent( m_pCurrentWindow ); // reset member values - designate_currentwindow(NULL); + designate_currentwindow(nullptr); m_aDataFlavorList.realloc( 0 ); } diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index 41330fb1326e..6ea846de11f3 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -47,7 +47,7 @@ DockingAreaWindow::ImplData::~ImplData() DockingAreaWindow::DockingAreaWindow( vcl::Window* pParent ) : Window( WINDOW_DOCKINGAREA ) { - ImplInit( pParent, WB_CLIPCHILDREN|WB_3DLOOK, NULL ); + ImplInit( pParent, WB_CLIPCHILDREN|WB_3DLOOK, nullptr ); mpImplData = new ImplData; } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 05a08f599ca7..b3fc00522b08 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -75,7 +75,7 @@ ImplDockFloatWin2::ImplDockFloatWin2( vcl::Window* pParent, WinBits nWinBits, mpDockWin( pDockingWin ), mnLastTicks( tools::Time::GetSystemTicks() ), mbInMove( false ), - mnLastUserEvent( 0 ) + mnLastUserEvent( nullptr ) { // copy state of DockingWindow if ( pDockingWin ) @@ -154,7 +154,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, EndDockTimerHdl, Idle *, void) IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, DockingHdl, void*, void) { // called during move of a floating window - mnLastUserEvent = 0; + mnLastUserEvent = nullptr; vcl::Window *pDockingArea = mpDockWin->GetWindow()->GetParent(); PointerState aState = pDockingArea->GetPointerState(); @@ -242,7 +242,7 @@ void ImplDockFloatWin2::Move() * last Move message. */ if( ! mnLastUserEvent ) - mnLastUserEvent = Application::PostUserEvent( LINK( this, ImplDockFloatWin2, DockingHdl ), NULL, true ); + mnLastUserEvent = Application::PostUserEvent( LINK( this, ImplDockFloatWin2, DockingHdl ), nullptr, true ); } void ImplDockFloatWin2::Resize() @@ -314,7 +314,7 @@ ImplDockingWindowWrapper* DockingManager::GetDockingWindowWrapper( const vcl::Wi else ++p; } - return NULL; + return nullptr; } bool DockingManager::IsDockable( const vcl::Window *pWindow ) @@ -325,7 +325,7 @@ bool DockingManager::IsDockable( const vcl::Window *pWindow ) if( pWindow->HasDockingHandler() ) return true; */ - return (pWrapper != NULL); + return (pWrapper != nullptr); } bool DockingManager::IsFloating( const vcl::Window *pWindow ) @@ -521,7 +521,7 @@ ImplPopupFloatWin::~ImplPopupFloatWin() void ImplPopupFloatWin::dispose() { - mpDockingWin = NULL; + mpDockingWin = nullptr; FloatingWindow::dispose(); } @@ -794,8 +794,8 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt ) ImplDockingWindowWrapper::ImplDockingWindowWrapper( const vcl::Window *pWindow ) : mpDockingWindow(const_cast<vcl::Window*>(pWindow)) - , mpFloatWin(NULL) - , mpOldBorderWin(NULL) + , mpFloatWin(nullptr) + , mpOldBorderWin(nullptr) , mpParent(pWindow->GetParent()) , maMaxOutSize( SHRT_MAX, SHRT_MAX ) , mnTrackX(0) @@ -1109,7 +1109,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin vcl::Window* pRealParent = GetWindow()->GetWindow( GetWindowType::Parent ); mpOldBorderWin = GetWindow()->GetWindow( GetWindowType::Border ); if( mpOldBorderWin.get() == GetWindow() ) - mpOldBorderWin = NULL; // no border window found + mpOldBorderWin = nullptr; // no border window found // the new parent for popup mode VclPtrInstance<ImplPopupFloatWin> pWin( mpParent, this, bool(nFlags & FloatWinPopupFlags::AllowTearOff) ); @@ -1119,7 +1119,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin pWin->SetOutputSizePixel( GetWindow()->GetSizePixel() ); - GetWindow()->mpWindowImpl->mpBorderWindow = NULL; + GetWindow()->mpWindowImpl->mpBorderWindow = nullptr; GetWindow()->mpWindowImpl->mnLeftBorder = 0; GetWindow()->mpWindowImpl->mnTopBorder = 0; GetWindow()->mpWindowImpl->mnRightBorder = 0; @@ -1168,7 +1168,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, v // before deleting change parent back, so we can delete the floating window alone vcl::Window* pRealParent = GetWindow()->GetWindow( GetWindowType::Parent ); - GetWindow()->mpWindowImpl->mpBorderWindow = NULL; + GetWindow()->mpWindowImpl->mpBorderWindow = nullptr; if ( mpOldBorderWin ) { GetWindow()->SetParent( mpOldBorderWin ); @@ -1216,7 +1216,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) vcl::Window* pRealParent = GetWindow()->GetWindow( GetWindowType::Parent ); mpOldBorderWin = GetWindow()->GetWindow( GetWindowType::Border ); if( mpOldBorderWin == mpDockingWindow ) - mpOldBorderWin = NULL; // no border window found + mpOldBorderWin = nullptr; // no border window found ImplDockFloatWin2* pWin = VclPtr<ImplDockFloatWin2>::Create( @@ -1228,7 +1228,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) : mnFloatBits, this ); - GetWindow()->mpWindowImpl->mpBorderWindow = NULL; + GetWindow()->mpWindowImpl->mpBorderWindow = nullptr; GetWindow()->mpWindowImpl->mnLeftBorder = 0; GetWindow()->mpWindowImpl->mnTopBorder = 0; GetWindow()->mpWindowImpl->mnRightBorder = 0; @@ -1281,7 +1281,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) maMaxOutSize = mpFloatWin->GetMaxOutputSizePixel(); vcl::Window* pRealParent = GetWindow()->GetWindow( GetWindowType::Parent ); //mpWindowImpl->mpRealParent; - GetWindow()->mpWindowImpl->mpBorderWindow = NULL; + GetWindow()->mpWindowImpl->mpBorderWindow = nullptr; if ( mpOldBorderWin ) { GetWindow()->SetParent( mpOldBorderWin ); diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 083fd0e9a4bf..2f0fc5b57d9f 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -48,7 +48,7 @@ public: DockingWindow::ImplData::ImplData() { - mpParent = NULL; + mpParent = nullptr; maMaxOutSize = Size( SHRT_MAX, SHRT_MAX ); } @@ -91,7 +91,7 @@ ImplDockFloatWin::ImplDockFloatWin( vcl::Window* pParent, WinBits nWinBits, mpDockWin( pDockingWin ), mnLastTicks( tools::Time::GetSystemTicks() ), mbInMove( false ), - mnLastUserEvent( 0 ) + mnLastUserEvent( nullptr ) { // copy settings of DockingWindow if ( pDockingWin ) @@ -157,7 +157,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockFloatWin, DockingHdl, void*, void) { PointerState aState = mpDockWin->GetParent()->GetPointerState(); - mnLastUserEvent = 0; + mnLastUserEvent = nullptr; if( mpDockWin->IsDockable() && (tools::Time::GetSystemTicks() - mnLastTicks > 500) && ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) && @@ -208,7 +208,7 @@ void ImplDockFloatWin::Move() * last Move message. */ if( ! mnLastUserEvent ) - mnLastUserEvent = Application::PostUserEvent( LINK( this, ImplDockFloatWin, DockingHdl ), NULL, true ); + mnLastUserEvent = Application::PostUserEvent( LINK( this, ImplDockFloatWin, DockingHdl ), nullptr, true ); } void ImplDockFloatWin::Resize() @@ -305,8 +305,8 @@ bool DockingWindow::ImplStartDocking( const Point& rPos ) void DockingWindow::ImplInitDockingWindowData() { mpWindowImpl->mbDockWin = true; - mpFloatWin = NULL; - mpOldBorderWin = NULL; + mpFloatWin = nullptr; + mpOldBorderWin = nullptr; mpImplData = new ImplData; mnTrackX = 0; mnTrackY = 0; @@ -333,7 +333,7 @@ void DockingWindow::ImplInitDockingWindowData() mbIsDefferedInit = false; mbIsCalculatingInitialLayoutSize = false; mbInitialLayoutDone = false; - mpDialogParent = NULL; + mpDialogParent = nullptr; //To-Do, reuse maResizeTimer maLayoutIdle.SetPriority(SchedulerPriority::RESIZE); @@ -352,7 +352,7 @@ void DockingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) if ( nStyle & WB_DOCKBORDER ) nStyle |= WB_BORDER; - Window::ImplInit( pParent, nStyle, NULL ); + Window::ImplInit( pParent, nStyle, nullptr ); ImplInitSettings(); } @@ -444,7 +444,7 @@ DockingWindow::DockingWindow( vcl::Window* pParent, const ResId& rResId ) : void DockingWindow::doDeferredInit(WinBits nBits) { vcl::Window *pParent = mpDialogParent; - mpDialogParent = NULL; + mpDialogParent = nullptr; ImplInit(pParent, nBits); mbIsDefferedInit = false; } @@ -479,7 +479,7 @@ void DockingWindow::dispose() SetFloatingMode(false); } delete mpImplData; - mpImplData = NULL; + mpImplData = nullptr; mpFloatWin.clear(); mpOldBorderWin.clear(); mpDialogParent.clear(); @@ -805,7 +805,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ? mnFloatBits | WB_SYSTEMWINDOW : mnFloatBits, this ); mpFloatWin = pWin; - mpWindowImpl->mpBorderWindow = NULL; + mpWindowImpl->mpBorderWindow = nullptr; mpWindowImpl->mnLeftBorder = 0; mpWindowImpl->mnTopBorder = 0; mpWindowImpl->mnRightBorder = 0; @@ -866,7 +866,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) mpImplData->maMaxOutSize = mpFloatWin->GetMaxOutputSizePixel(); vcl::Window* pRealParent = mpWindowImpl->mpRealParent; - mpWindowImpl->mpBorderWindow = NULL; + mpWindowImpl->mpBorderWindow = nullptr; if ( mpOldBorderWin ) { SetParent( mpOldBorderWin ); diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index 548e8704054c..c31aa63e1fe4 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -316,7 +316,7 @@ ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCalle { ImplRemoveDel( &(pSVEvent->maDelData) ); delete pSVEvent; - pSVEvent = 0; + pSVEvent = nullptr; } return pSVEvent; } @@ -331,7 +331,7 @@ void Window::RemoveUserEvent( ImplSVEvent * nUserEvent ) if ( nUserEvent->mpWindow ) { nUserEvent->mpWindow->ImplRemoveDel( &(nUserEvent->maDelData) ); - nUserEvent->mpWindow = NULL; + nUserEvent->mpWindow = nullptr; } nUserEvent->mbCall = false; @@ -507,7 +507,7 @@ void Window::ImplCallMove() if( mpWindowImpl->mbFrame ) { // update frame position - SalFrame *pParentFrame = NULL; + SalFrame *pParentFrame = nullptr; vcl::Window *pParent = ImplGetParent(); while( pParent ) { @@ -581,7 +581,7 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, pLastRealWindow->Activate(); } } - pSVData->maWinData.mpLastDeacWin = NULL; + pSVData->maWinData.mpLastDeacWin = nullptr; } } @@ -623,8 +623,8 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, NotifyEvent::NotifyEvent() { - mpWindow = NULL; - mpData = NULL; + mpWindow = nullptr; + mpData = nullptr; mnEventType = MouseNotifyEvent::NONE; mnRetValue = 0; } diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index c470f754d004..b5c038ccdb53 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -45,7 +45,7 @@ public: FloatingWindow::ImplData::ImplData() { - mpBox = NULL; + mpBox = nullptr; } FloatingWindow::ImplData::~ImplData() @@ -77,7 +77,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) { mpWindowImpl->mbOverlapWin = true; nStyle |= WB_DIALOGCONTROL; - SystemWindow::ImplInit(pParent, nStyle, NULL); + SystemWindow::ImplInit(pParent, nStyle, nullptr); } else { @@ -92,7 +92,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) // nFloatWinStyle |= WB_CLOSEABLE; mpWindowImpl->mbFrame = true; mpWindowImpl->mbOverlapWin = true; - SystemWindow::ImplInit(pParent, nFloatWinStyle & ~WB_BORDER, NULL); + SystemWindow::ImplInit(pParent, nFloatWinStyle & ~WB_BORDER, nullptr); } else { @@ -110,7 +110,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) nStyle |= WB_CLOSEABLE; // make undecorated floaters closeable } pBorderWin = VclPtr<ImplBorderWindow>::Create(pParent, nStyle, nBorderStyle); - SystemWindow::ImplInit(pBorderWin, nStyle & ~WB_BORDER, NULL); + SystemWindow::ImplInit(pBorderWin, nStyle & ~WB_BORDER, nullptr); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder(mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder); @@ -121,9 +121,9 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) } SetActivateMode( ActivateModeFlags::NONE ); - mpNextFloat = NULL; - mpFirstPopupModeWin = NULL; - mnPostId = 0; + mpNextFloat = nullptr; + mpFirstPopupModeWin = nullptr; + mnPostId = nullptr; mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FloatWinTitleType::Normal : FloatWinTitleType::NONE; mnOldTitle = mnTitle; mnPopupModeFlags = FloatWinPopupFlags::NONE; @@ -158,10 +158,10 @@ FloatingWindow::FloatingWindow(vcl::Window* pParent, WinBits nStyle) : FloatingWindow::FloatingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) : SystemWindow(WINDOW_FLOATINGWINDOW) - , mpNextFloat(0) - , mpFirstPopupModeWin(0) - , mpImplData(0) - , mnPostId(0) + , mpNextFloat(nullptr) + , mpFirstPopupModeWin(nullptr) + , mpImplData(nullptr) + , mnPostId(nullptr) , mnPopupModeFlags(FloatWinPopupFlags::NONE) , mnTitle(FloatWinTitleType::Unknown) , mnOldTitle(FloatWinTitleType::Unknown) @@ -181,7 +181,7 @@ FloatingWindow::FloatingWindow(vcl::Window* pParent, const OString& rID, const O void FloatingWindow::doDeferredInit(WinBits nBits) { vcl::Window *pParent = mpDialogParent; - mpDialogParent = NULL; + mpDialogParent = nullptr; ImplInit(pParent, nBits); mbIsDefferedInit = false; } @@ -223,11 +223,11 @@ void FloatingWindow::dispose() if ( mnPostId ) Application::RemoveUserEvent( mnPostId ); - mnPostId = 0; + mnPostId = nullptr; } delete mpImplData; - mpImplData = NULL; + mpImplData = nullptr; mpNextFloat.clear(); mpFirstPopupModeWin.clear(); @@ -503,7 +503,7 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( vcl::Window* pReference, const while ( pWin ); rHitTest = HITTEST_OUTSIDE; - return NULL; + return nullptr; } FloatingWindow* FloatingWindow::ImplFindLastLevelFloat() @@ -542,7 +542,7 @@ bool FloatingWindow::ImplIsFloatPopupModeWindow( const vcl::Window* pWindow ) IMPL_LINK_NOARG_TYPED(FloatingWindow, ImplEndPopupModeHdl, void*, void) { VclPtr<FloatingWindow> pThis(this); - mnPostId = 0; + mnPostId = nullptr; mnPopupModeFlags = FloatWinPopupFlags::NONE; mbPopupMode = false; PopupModeEnd(); @@ -606,7 +606,7 @@ void FloatingWindow::ImplCallPopupModeEnd() // call Handler asynchronously. if ( mpImplData && !mnPostId ) - mnPostId = Application::PostUserEvent( LINK( this, FloatingWindow, ImplEndPopupModeHdl ), NULL, true ); + mnPostId = Application::PostUserEvent( LINK( this, FloatingWindow, ImplEndPopupModeHdl ), nullptr, true ); } void FloatingWindow::PopupModeEnd() @@ -771,7 +771,7 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, sal_uLong n // delete window from the list pSVData->maWinData.mpFirstFloat = mpNextFloat; - mpNextFloat = NULL; + mpNextFloat = nullptr; FloatWinPopupFlags nPopupModeFlags = mnPopupModeFlags; @@ -806,7 +806,7 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, sal_uLong n if ( mpImplData->mpBox ) { mpImplData->mpBox->ImplFloatControl( false, this ); - mpImplData->mpBox = NULL; + mpImplData->mpBox = nullptr; } // call PopupModeEnd-Handler depending on parameter diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx index b7bd49bba6a9..50c871203e90 100644 --- a/vcl/source/window/introwin.cxx +++ b/vcl/source/window/introwin.cxx @@ -35,7 +35,7 @@ IntroWindow::IntroWindow( ) : WorkWindow( WINDOW_INTROWINDOW ) { ImplInitIntroWindowData(); - WorkWindow::ImplInit( 0, WB_INTROWIN ); + WorkWindow::ImplInit( nullptr, WB_INTROWIN ); } IntroWindow::~IntroWindow() diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index aa8f6518161a..62e9e4fd7682 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -20,7 +20,7 @@ VclContainer::VclContainer(vcl::Window *pParent, WinBits nStyle) : Window(WINDOW_CONTAINER) , m_bLayoutDirty(true) { - ImplInit(pParent, nStyle, NULL); + ImplInit(pParent, nStyle, nullptr); EnableChildTransparentMode(); SetPaintTransparent(true); SetBackground(); @@ -757,7 +757,7 @@ struct GridEntry int x; int y; GridEntry() - : pChild(0) + : pChild(nullptr) , nSpanWidth(0) , nSpanHeight(0) , x(-1) @@ -1370,7 +1370,7 @@ void VclFrame::setAllocation(const Size &rAllocation) IMPL_LINK_TYPED(VclFrame, WindowEventListener, VclWindowEvent&, rEvent, void) { if (rEvent.GetId() == VCLEVENT_OBJECT_DYING) - designate_label(NULL); + designate_label(nullptr); } void VclFrame::designate_label(vcl::Window *pWindow) @@ -1391,7 +1391,7 @@ const vcl::Window *VclFrame::get_label_widget() const //The label widget is normally the first (of two) children const WindowImpl* pWindowImpl = ImplGetWindowImpl(); if (pWindowImpl->mpFirstChild == pWindowImpl->mpLastChild) //no label exists - return NULL; + return nullptr; return pWindowImpl->mpFirstChild; } @@ -1408,7 +1408,7 @@ const vcl::Window *VclFrame::get_child() const if (!m_pLabel) return pWindowImpl->mpLastChild; if (pWindowImpl->mpFirstChild == pWindowImpl->mpLastChild) //only label exists - return NULL; + return nullptr; return pWindowImpl->mpLastChild; } @@ -1520,7 +1520,7 @@ Size VclExpander::calculateRequisition() const WindowImpl* pWindowImpl = ImplGetWindowImpl(); const vcl::Window *pChild = get_child(); - const vcl::Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild.get() : NULL; + const vcl::Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild.get() : nullptr; if (pChild && pChild->IsVisible() && m_pDisclosureButton->IsChecked()) aRet = getLayoutRequisition(*pChild); @@ -1557,7 +1557,7 @@ void VclExpander::setAllocation(const Size &rAllocation) //The label widget is the last (of two) children vcl::Window *pChild = get_child(); - vcl::Window *pLabel = pChild != pWindowImpl->mpLastChild.get() ? pWindowImpl->mpLastChild.get() : NULL; + vcl::Window *pLabel = pChild != pWindowImpl->mpLastChild.get() ? pWindowImpl->mpLastChild.get() : nullptr; Size aButtonSize = getLayoutRequisition(*m_pDisclosureButton); Size aLabelSize; @@ -1631,7 +1631,7 @@ IMPL_LINK_TYPED( VclExpander, ClickHdl, CheckBox&, rBtn, void ) { pChild->Show(rBtn.IsChecked()); queue_resize(); - Dialog* pResizeDialog = m_bResizeTopLevel ? GetParentDialog() : NULL; + Dialog* pResizeDialog = m_bResizeTopLevel ? GetParentDialog() : nullptr; if (pResizeDialog) pResizeDialog->setOptimalLayoutSize(); } @@ -1999,12 +1999,12 @@ MessageDialog::MessageDialog(vcl::Window* pParent, WinBits nStyle) : Dialog(pParent, nStyle) , m_eButtonsType(VCL_BUTTONS_NONE) , m_eMessageType(VCL_MESSAGE_INFO) - , m_pOwnedContentArea(NULL) - , m_pOwnedActionArea(NULL) - , m_pGrid(NULL) - , m_pImage(NULL) - , m_pPrimaryMessage(NULL) - , m_pSecondaryMessage(NULL) + , m_pOwnedContentArea(nullptr) + , m_pOwnedActionArea(nullptr) + , m_pGrid(nullptr) + , m_pImage(nullptr) + , m_pPrimaryMessage(nullptr) + , m_pSecondaryMessage(nullptr) { SetType(WINDOW_MESSBOX); } @@ -2017,10 +2017,10 @@ MessageDialog::MessageDialog(vcl::Window* pParent, : Dialog(pParent, nStyle) , m_eButtonsType(eButtonsType) , m_eMessageType(eMessageType) - , m_pGrid(NULL) - , m_pImage(NULL) - , m_pPrimaryMessage(NULL) - , m_pSecondaryMessage(NULL) + , m_pGrid(nullptr) + , m_pImage(nullptr) + , m_pPrimaryMessage(nullptr) + , m_pSecondaryMessage(nullptr) , m_sPrimaryString(rMessage) { SetType(WINDOW_MESSBOX); @@ -2031,12 +2031,12 @@ MessageDialog::MessageDialog(vcl::Window* pParent, const OString& rID, const OUS : Dialog(pParent, OStringToOUString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_MESSBOX) , m_eButtonsType(VCL_BUTTONS_NONE) , m_eMessageType(VCL_MESSAGE_INFO) - , m_pOwnedContentArea(NULL) - , m_pOwnedActionArea(NULL) - , m_pGrid(NULL) - , m_pImage(NULL) - , m_pPrimaryMessage(NULL) - , m_pSecondaryMessage(NULL) + , m_pOwnedContentArea(nullptr) + , m_pOwnedActionArea(nullptr) + , m_pGrid(nullptr) + , m_pImage(nullptr) + , m_pPrimaryMessage(nullptr) + , m_pSecondaryMessage(nullptr) { } @@ -2194,7 +2194,7 @@ short MessageDialog::Execute() m_pSecondaryMessage->SetText(m_sSecondaryString); m_pSecondaryMessage->Show(bHasSecondaryText); - MessageDialog::SetMessagesWidths(this, m_pPrimaryMessage, bHasSecondaryText ? m_pSecondaryMessage.get() : NULL); + MessageDialog::SetMessagesWidths(this, m_pPrimaryMessage, bHasSecondaryText ? m_pSecondaryMessage.get() : nullptr); VclButtonBox *pButtonBox = get_action_area(); assert(pButtonBox); @@ -2417,13 +2417,13 @@ bool isEnabledInLayout(const vcl::Window *pWindow) bool isLayoutEnabled(const vcl::Window *pWindow) { //Child is a container => we're layout enabled - const vcl::Window *pChild = pWindow ? pWindow->GetWindow(GetWindowType::FirstChild) : NULL; + const vcl::Window *pChild = pWindow ? pWindow->GetWindow(GetWindowType::FirstChild) : nullptr; return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(GetWindowType::Next); } bool isInitialLayout(const vcl::Window *pWindow) { - Dialog *pParentDialog = pWindow ? pWindow->GetParentDialog() : NULL; + Dialog *pParentDialog = pWindow ? pWindow->GetParentDialog() : nullptr; return pParentDialog && pParentDialog->isCalculatingInitialLayoutSize(); } diff --git a/vcl/source/window/legacyaccessibility.cxx b/vcl/source/window/legacyaccessibility.cxx index aa0cf67ad3f3..1cddcab06201 100644 --- a/vcl/source/window/legacyaccessibility.cxx +++ b/vcl/source/window/legacyaccessibility.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star; static vcl::Window* ImplGetLabelFor( vcl::Window* pFrameWindow, WindowType nMyType, vcl::Window* pLabel, sal_Unicode nAccel ) { - vcl::Window* pWindow = NULL; + vcl::Window* pWindow = nullptr; if( nMyType == WINDOW_FIXEDTEXT || nMyType == WINDOW_FIXEDLINE || @@ -103,14 +103,14 @@ namespace vcl { Window* Window::getLegacyNonLayoutAccessibleRelationLabelFor() const { - Window* pWindow = NULL; + Window* pWindow = nullptr; Window* pFrameWindow = ImplGetFrameWindow(); WinBits nFrameStyle = pFrameWindow->GetStyle(); if( ! ( nFrameStyle & WB_DIALOGCONTROL ) || ( nFrameStyle & WB_NODIALOGCONTROL ) ) - return NULL; + return nullptr; if ( mpWindowImpl->mpRealParent ) pWindow = mpWindowImpl->mpRealParent->GetParentLabelFor( this ); @@ -128,7 +128,7 @@ Window* Window::getLegacyNonLayoutAccessibleRelationLabelFor() const static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Window* pLabeled ) { - Window* pWindow = NULL; + Window* pWindow = nullptr; if ( (nMyType != WINDOW_GROUPBOX) && (nMyType != WINDOW_FIXEDLINE) ) { // search for a control that labels this window @@ -183,7 +183,7 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo Window* Window::getLegacyNonLayoutAccessibleRelationLabeledBy() const { - Window* pWindow = NULL; + Window* pWindow = nullptr; Window* pFrameWindow = ImplGetFrameWindow(); if ( mpWindowImpl->mpRealParent ) @@ -196,7 +196,7 @@ Window* Window::getLegacyNonLayoutAccessibleRelationLabeledBy() const // #i62723#, #104191# checkboxes and radiobuttons are not supposed to have labels if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON ) - return NULL; + return nullptr; // if( ! ( GetType() == WINDOW_FIXEDTEXT || // GetType() == WINDOW_FIXEDLINE || @@ -213,7 +213,7 @@ Window* Window::getLegacyNonLayoutAccessibleRelationLabeledBy() const Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const { - Window* pWindow = NULL; + Window* pWindow = nullptr; Window* pFrameWindow = GetParent(); if ( !pFrameWindow ) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 6ca2bd38b9bd..49acb2e0c10c 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -114,13 +114,13 @@ static void ImplSetMenuItemData( MenuItemData* pData ) } Menu::Menu() - : mpFirstDel(NULL), + : mpFirstDel(nullptr), pItemList(new MenuItemList), - pLogo(NULL), - pStartedFrom(NULL), - pWindow(NULL), + pLogo(nullptr), + pStartedFrom(nullptr), + pWindow(nullptr), nTitleHeight(0), - nEventId(0), + nEventId(nullptr), mnHighlightedItemPos(ITEMPOS_INVALID), nMenuFlags(MenuFlags::NONE), nDefaultItem(0), @@ -130,8 +130,8 @@ Menu::Menu() bCanceled(false), bInCallback(false), bKilled(false), - mpLayoutData(NULL), - mpSalMenu(NULL) + mpLayoutData(nullptr), + mpSalMenu(nullptr) { } @@ -145,7 +145,7 @@ Menu::~Menu() { MenuFloatingWindow* pFloat = static_cast<MenuFloatingWindow*>(pWindow.get()); if( pFloat->pMenu == this ) - pFloat->pMenu = NULL; + pFloat->pMenu = nullptr; pWindow->SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >() ); } @@ -164,7 +164,7 @@ Menu::~Menu() ImplMenuDelData* pDelData = mpFirstDel; while ( pDelData ) { - pDelData->mpMenu = NULL; + pDelData->mpMenu = nullptr; pDelData = pDelData->mpNext; } @@ -175,7 +175,7 @@ Menu::~Menu() delete mpLayoutData; // Native-support: destroy SalMenu - ImplSetSalMenu( NULL ); + ImplSetSalMenu( nullptr ); } void Menu::CreateAutoMnemonics() @@ -291,7 +291,7 @@ void Menu::ImplSelect() // call select ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mpActivePopupMenu = NULL; // if new execute in select() + pSVData->maAppData.mpActivePopupMenu = nullptr; // if new execute in select() nEventId = Application::PostUserEvent( LINK( this, Menu, ImplCallSelect ) ); } @@ -395,7 +395,7 @@ void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nIt NbcInsertItem(nItemId, nItemBits, rStr, this, nPos, rIdent); vcl::Window* pWin = ImplGetWindow(); - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; if ( pWin ) { ImplCalcSize( pWin ); @@ -522,7 +522,7 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos ) } IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE*>(GetClassRes()) ) ); } - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; } void Menu::InsertSeparator(const OString &rIdent, sal_uInt16 nPos) @@ -544,7 +544,7 @@ void Menu::InsertSeparator(const OString &rIdent, sal_uInt16 nPos) if( ImplGetSalMenu() && pData && pData->pSalMenuItem ) ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos ); - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); } @@ -570,7 +570,7 @@ void Menu::RemoveItem( sal_uInt16 nPos ) if ( pWin->IsVisible() ) pWin->Invalidate(); } - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; if ( bRemove ) ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos ); @@ -793,7 +793,7 @@ void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) // #112023# Make sure pStartedFrom does not point to invalid (old) data if ( pData->pSubMenu ) - pData->pSubMenu->pStartedFrom = 0; + pData->pSubMenu->pStartedFrom = nullptr; // set native submenu if( ImplGetSalMenu() && pData->pSalMenuItem ) @@ -801,7 +801,7 @@ void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) if( pMenu ) ImplGetSalMenu()->SetSubMenu( pData->pSalMenuItem, pMenu->ImplGetSalMenu(), nPos ); else - ImplGetSalMenu()->SetSubMenu( pData->pSalMenuItem, NULL, nPos ); + ImplGetSalMenu()->SetSubMenu( pData->pSalMenuItem, nullptr, nPos ); } ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos ); @@ -814,7 +814,7 @@ PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const if ( pData ) return static_cast<PopupMenu*>(pData->pSubMenu); else - return NULL; + return nullptr; } void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode ) @@ -1030,7 +1030,7 @@ void Menu::SetItemText( sal_uInt16 nItemId, const OUString& rStr ) ImplGetSalMenu()->SetItemText( nPos, pData->pSalMenuItem, rStr ); vcl::Window* pWin = ImplGetWindow(); - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; if (pWin && IsMenuBar()) { ImplCalcSize( pWin ); @@ -1190,9 +1190,9 @@ OUString Menu::ImplGetHelpText( sal_uInt16 nItemId ) const if ( pHelp ) { if (!pData->aCommandStr.isEmpty()) - pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL ); + pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, nullptr ); if (pData->aHelpText.isEmpty() && !pData->aHelpId.isEmpty()) - pData->aHelpText = pHelp->GetHelpText( OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); + pData->aHelpText = pHelp->GetHelpText( OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), nullptr ); } } @@ -1286,7 +1286,7 @@ bool Menu::ImplIsVisible( sal_uInt16 nPos ) const // always avoid adjacent separators size_t nCount = pItemList->size(); size_t n; - MenuItemData* pNextData = NULL; + MenuItemData* pNextData = nullptr; // search next visible item for( n = nPos + 1; n < nCount; n++ ) { @@ -1470,7 +1470,7 @@ void Menu::ImplAddDel( ImplMenuDelData& rDel ) void Menu::ImplRemoveDel( ImplMenuDelData& rDel ) { - rDel.mpMenu = NULL; + rDel.mpMenu = nullptr; if ( mpFirstDel == &rDel ) { mpFirstDel = rDel.mpNext; @@ -1740,7 +1740,7 @@ static void ImplPaintCheckBackground(vcl::RenderContext& rRenderContext, vcl::Wi { const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() ); - RenderTools::DrawSelectionBackground(rRenderContext, rWindow, i_rRect, 0, i_bHighlight, true, false, NULL, 2, &aColor); + RenderTools::DrawSelectionBackground(rRenderContext, rWindow, i_rRect, 0, i_bHighlight, true, false, nullptr, 2, &aColor); } } @@ -2028,8 +2028,8 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, if (pData->bIsTemporary) nStyle |= DrawTextFlags::Disable; - MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL; - OUString* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL; + MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : nullptr; + OUString* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : nullptr; if (bLayout) { mpLayoutData->m_aLineIndices.push_back(mpLayoutData->m_aDisplayText.getLength()); @@ -2204,13 +2204,13 @@ void Menu::ImplCallHighlight(sal_uInt16 nItem) IMPL_LINK_NOARG_TYPED(Menu, ImplCallSelect, void*, void) { - nEventId = 0; + nEventId = nullptr; Select(); } Menu* Menu::ImplFindSelectMenu() { - Menu* pSelMenu = nEventId ? this : NULL; + Menu* pSelMenu = nEventId ? this : nullptr; for ( size_t n = GetItemList()->size(); n && !pSelMenu; ) { @@ -2225,7 +2225,7 @@ Menu* Menu::ImplFindSelectMenu() Menu* Menu::ImplFindMenu( sal_uInt16 nItemId ) { - Menu* pSelMenu = NULL; + Menu* pSelMenu = nullptr; for ( size_t n = GetItemList()->size(); n && !pSelMenu; ) { @@ -2272,7 +2272,7 @@ void Menu::RemoveDisabledEntries( bool bCheckPopups, bool bRemoveEmptyPopups ) if ( pItem->eType == MenuItemType::SEPARATOR ) RemoveItem( nLast ); } - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; } bool Menu::HasValidEntries( bool bCheckPopups ) @@ -2304,7 +2304,7 @@ void Menu::MenuBarKeyInput(const KeyEvent&) void Menu::ImplKillLayoutData() const { - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; } void Menu::ImplFillLayoutData() const @@ -2314,12 +2314,12 @@ void Menu::ImplFillLayoutData() const mpLayoutData = new MenuLayoutData(); if (IsMenuBar()) { - ImplPaint(*pWindow, 0, 0, 0, false, true); // FIXME + ImplPaint(*pWindow, 0, 0, nullptr, false, true); // FIXME } else { MenuFloatingWindow* pFloat = static_cast<MenuFloatingWindow*>(pWindow.get()); - ImplPaint(*pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, false, true); //FIXME + ImplPaint(*pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), nullptr, false, true); //FIXME } } } @@ -2557,7 +2557,7 @@ vcl::Window* MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, Men pWindow = pMenuBarWindow = VclPtr<MenuBarWindow>::Create( pParent ); } - pMenu->pStartedFrom = 0; + pMenu->pStartedFrom = nullptr; pMenu->pWindow = pWindow; pMenuBarWindow->SetMenu(pMenu); long nHeight = pWindow ? pMenu->ImplCalcSize(pWindow).Height() : 0; @@ -2583,7 +2583,7 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, bool bDelete ) pMenuWin->KillActivePopup(); pWindow->disposeOnce(); } - pMenu->pWindow = NULL; + pMenu->pWindow = nullptr; } bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu ) @@ -2769,13 +2769,13 @@ MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const { } PopupMenu::PopupMenu() - : pRefAutoSubMenu(NULL) + : pRefAutoSubMenu(nullptr) { mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); } PopupMenu::PopupMenu( const ResId& rResId ) - : pRefAutoSubMenu(NULL) + : pRefAutoSubMenu(nullptr) { mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); @@ -2809,7 +2809,7 @@ PopupMenu::PopupMenu( const ResId& rResId ) PopupMenu::PopupMenu( const PopupMenu& rMenu ) : Menu(), - pRefAutoSubMenu(NULL) + pRefAutoSubMenu(nullptr) { mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); *this = rMenu; @@ -2818,7 +2818,7 @@ PopupMenu::PopupMenu( const PopupMenu& rMenu ) PopupMenu::~PopupMenu() { if( pRefAutoSubMenu && *pRefAutoSubMenu == this ) - *pRefAutoSubMenu = NULL; // #111060# avoid second delete in ~MenuItemData + *pRefAutoSubMenu = nullptr; // #111060# avoid second delete in ~MenuItemData } void PopupMenu::ClosePopup(Menu* pMenu) @@ -2909,7 +2909,7 @@ sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const Rectangle& rRect, if (nFlags & PopupMenuFlags::NoHorzPlacement) nPopupModeFlags |= FloatWinPopupFlags::NoHorzPlacement; - return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, false ); + return ImplExecute( pExecWindow, rRect, nPopupModeFlags, nullptr, false ); } sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst ) @@ -2921,7 +2921,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa if( pSFrom && pSFrom->IsMenuBar()) ((static_cast<MenuBarWindow*>(pSFrom->pWindow.get())))->SetMBWHideAccel(!(static_cast<MenuBarWindow*>(pSFrom->pWindow.get())->GetMBWMenuKey())); - delete mpLayoutData, mpLayoutData = NULL; + delete mpLayoutData, mpLayoutData = nullptr; ImplSVData* pSVData = ImplGetSVData(); @@ -2994,7 +2994,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa { OUString aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) ); - MenuItemData* pData = NbcInsertItem(0xFFFF, MenuItemBits::NONE, aTmpEntryText, NULL, 0xFFFF, OString()); + MenuItemData* pData = NbcInsertItem(0xFFFF, MenuItemBits::NONE, aTmpEntryText, nullptr, 0xFFFF, OString()); size_t nPos = 0; pData = pItemList->GetData( pData->nId, nPos ); assert(pData); @@ -3079,7 +3079,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa pWin->StopExecute(); pWin->doShutdown(); pWindow->doLazyDelete(); - pWindow = NULL; + pWindow = nullptr; return nSelectedId; } else @@ -3157,7 +3157,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa } pWin->doShutdown(); pWindow->doLazyDelete(); - pWindow = NULL; + pWindow = nullptr; // is there still Select? Menu* pSelect = ImplFindSelectMenu(); @@ -3165,7 +3165,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa { // Select should be called prior to leaving execute in a popup menu! Application::RemoveUserEvent( pSelect->nEventId ); - pSelect->nEventId = 0; + pSelect->nEventId = nullptr; pSelect->Select(); } } @@ -3222,8 +3222,8 @@ long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const } ImplMenuDelData::ImplMenuDelData( const Menu* pMenu ) -: mpNext( 0 ) -, mpMenu( 0 ) +: mpNext( nullptr ) +, mpMenu( nullptr ) { if( pMenu ) const_cast< Menu* >( pMenu )->ImplAddDel( *this ); @@ -3242,7 +3242,7 @@ struct MenuInvalidateListeners : public vcl::DeletionNotifier std::vector<Link<LinkParamNone*,void>> m_aListeners; }; -static MenuInvalidateListeners* pMenuInvalidateListeners = NULL; +static MenuInvalidateListeners* pMenuInvalidateListeners = nullptr; void AddMenuInvalidateListener(const Link<LinkParamNone*,void>& rLink) { diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 67eba4eed45f..32093142d5b6 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -124,8 +124,8 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) : aHideBtn(VclPtr<PushButton>::Create(this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE)) { SetType(WINDOW_MENUBARWINDOW); - pMenu = NULL; - pActivePopup = NULL; + pMenu = nullptr; + pActivePopup = nullptr; nSaveFocusId = 0; nHighlightedItem = ITEMPOS_INVALID; nRolloveredItem = ITEMPOS_INVALID; @@ -287,7 +287,7 @@ IMPL_LINK_TYPED( MenuBarWindow, ShowHideListener, VclWindowEvent&, rEvent, void void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) { - MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL; + MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : nullptr; if ( pItemData ) { bIgnoreFirstMove = true; @@ -300,7 +300,7 @@ void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) { pActivePopup = static_cast<PopupMenu*>(pItemData->pSubMenu); long nX = 0; - MenuItemData* pData = 0; + MenuItemData* pData = nullptr; for ( sal_uLong n = 0; n < nHighlightedItem; n++ ) { pData = pMenu->GetItemList()->GetDataFromPos( n ); @@ -353,9 +353,9 @@ void MenuBarWindow::KillActivePopup() pActivePopup->ImplGetFloatingWindow()->StopExecute(); pActivePopup->ImplGetFloatingWindow()->doShutdown(); pActivePopup->pWindow->doLazyDelete(); - pActivePopup->pWindow = NULL; + pActivePopup->pWindow = nullptr; } - pActivePopup = 0; + pActivePopup = nullptr; } } @@ -544,7 +544,7 @@ static int ImplGetTopDockingAreaHeight( vcl::Window *pWindow ) vcl::Window *pChildWin = pWin->GetWindow( GetWindowType::FirstChild ); //mpWindowImpl->mpFirstChild; while( pChildWin ) { - DockingAreaWindow *pDockingArea = NULL; + DockingAreaWindow *pDockingArea = nullptr; if ( pChildWin->GetType() == WINDOW_DOCKINGAREA ) pDockingArea = static_cast< DockingAreaWindow* >( pChildWin ); diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 0fff6618d878..327af121ba1d 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -31,7 +31,7 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, vcl::Window* pParent, WinBit { mpWindowImpl->mbMenuFloatingWindow= true; pMenu = pMen; - pActivePopup = 0; + pActivePopup = nullptr; nSaveFocusId = 0; bInExecute = false; bScrollMenu = false; @@ -98,7 +98,7 @@ void MenuFloatingWindow::doShutdown() Rectangle aInvRect( GetWindowExtentsRelative( GetParent() ) ); GetParent()->Invalidate( aInvRect ); } - pMenu = NULL; + pMenu = nullptr; RemoveEventListener( LINK( this, MenuFloatingWindow, ShowHideListener ) ); } } @@ -231,7 +231,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, bool bMBDow if ( bPopupArea && bAllowNewPopup ) { - HighlightChanged( NULL ); + HighlightChanged( nullptr ); } } else @@ -243,7 +243,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, bool bMBDow else if ( pItemData->nBits & MenuItemBits::POPUPSELECT ) { if ( bPopupArea && ( pActivePopup != pItemData->pSubMenu ) ) - HighlightChanged( NULL ); + HighlightChanged( nullptr ); } } bHighlighted = true; @@ -284,7 +284,7 @@ IMPL_LINK_NOARG_TYPED(MenuFloatingWindow, PopupEnd, FloatingWindow*, void) } if ( pM ) - pM->pStartedFrom = 0; + pM->pStartedFrom = nullptr; } IMPL_LINK_NOARG_TYPED(MenuFloatingWindow, AutoScroll, Timer *, void) @@ -311,7 +311,7 @@ IMPL_LINK_TYPED( MenuFloatingWindow, HighlightChanged, Timer*, pTimer, void ) { pActivePopup = static_cast<PopupMenu*>(pItemData->pSubMenu); long nY = nScrollerHeight+ImplGetStartY(); - MenuItemData* pData = 0; + MenuItemData* pData = nullptr; for ( sal_uLong n = 0; n < nHighlightedItem; n++ ) { pData = pMenu->pItemList->GetDataFromPos( n ); @@ -394,7 +394,7 @@ void MenuFloatingWindow::Execute() while ( bInExecute ) Application::Yield(); - pSVData->maAppData.mpActivePopupMenu = NULL; + pSVData->maAppData.mpActivePopupMenu = nullptr; } void MenuFloatingWindow::StopExecute( sal_uLong nFocusId ) @@ -437,7 +437,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) // For all actions pActivePopup = 0, if e.g. // PopupModeEndHdl the popups to destroy were called synchronous PopupMenu* pPopup = pActivePopup; - pActivePopup = NULL; + pActivePopup = nullptr; pPopup->bInCallback = true; pPopup->Deactivate(); pPopup->bInCallback = false; @@ -446,7 +446,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) pPopup->ImplGetFloatingWindow()->StopExecute(); pPopup->ImplGetFloatingWindow()->doShutdown(); pPopup->pWindow->doLazyDelete(); - pPopup->pWindow = NULL; + pPopup->pWindow = nullptr; Update(); } @@ -455,7 +455,7 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) void MenuFloatingWindow::EndExecute() { - Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL; + Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : nullptr; sal_uLong nFocusId = 0; if (pStart) nFocusId = pStart->DeactivateMenuBar(nFocusId); @@ -517,7 +517,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt ) void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt ) { - MenuItemData* pData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL; + MenuItemData* pData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : nullptr; // nMBDownPos store in local variable and reset immediately, // as it will be too late after EndExecute sal_uInt16 _nMBDownPos = nMBDownPos; @@ -548,7 +548,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) if ( rMEvt.IsLeaveWindow() ) { // #102461# do not remove highlight if a popup menu is open at this position - MenuItemData* pData = pMenu ? pMenu->pItemList->GetDataFromPos( nHighlightedItem ) : NULL; + MenuItemData* pData = pMenu ? pMenu->pItemList->GetDataFromPos( nHighlightedItem ) : nullptr; // close popup with some delayed if we leave somewhere else if( pActivePopup && pData && pData->pSubMenu != pActivePopup ) pActivePopup->ImplGetFloatingWindow()->aSubmenuCloseTimer.Start(); @@ -1055,7 +1055,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) MenuItemData* pData = pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ); if ( pData && pData->pSubMenu ) { - HighlightChanged( 0 ); + HighlightChanged( nullptr ); bDone = true; } } @@ -1079,7 +1079,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) if ( pData && pData->bEnabled ) { if ( pData->pSubMenu ) - HighlightChanged( 0 ); + HighlightChanged( nullptr ); else EndExecute(); } @@ -1107,7 +1107,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) sal_uInt16 nPos = 0; sal_uInt16 nDuplicates = 0; MenuItemData* pData = (nCharCode && pMenu) ? - pMenu->GetItemList()->SearchItem(nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem) : NULL; + pMenu->GetItemList()->SearchItem(nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem) : nullptr; bool bConsume = false; bool accel = ImplGetSVData()->maNWFData.mbEnableAccel; if (pData && accel) @@ -1122,7 +1122,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) if ( pData->pSubMenu || nDuplicates > 1 ) { ChangeHighlightItem( nPos, false ); - HighlightChanged( 0 ); + HighlightChanged( nullptr ); } else { @@ -1212,7 +1212,7 @@ void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt ) { nHighlightedItem = ITEMPOS_INVALID; EndExecute(); - pW = NULL; + pW = nullptr; } if( !ImplHandleHelpEvent( pW, pM, nId, rHEvt, aHighlightRect ) ) diff --git a/vcl/source/window/menufloatingwindow.hxx b/vcl/source/window/menufloatingwindow.hxx index 8797d4ba9361..6fe08e4f8572 100644 --- a/vcl/source/window/menufloatingwindow.hxx +++ b/vcl/source/window/menufloatingwindow.hxx @@ -79,7 +79,7 @@ protected: long ImplGetStartY() const; Rectangle ImplGetItemRect( sal_uInt16 nPos ); void RenderHighlightItem( vcl::RenderContext& rRenderContext, sal_uInt16 nPos, bool bHighlight ); - long GetInitialItemY( long *pOptStartY = NULL ) const; + long GetInitialItemY( long *pOptStartY = nullptr ) const; void InvalidateItem( sal_uInt16 nPos ); public: @@ -113,7 +113,7 @@ public: void EndExecute( sal_uInt16 nSelectId ); PopupMenu* GetActivePopup() const { return pActivePopup; } - void KillActivePopup( PopupMenu* pThisOnly = NULL ); + void KillActivePopup( PopupMenu* pThisOnly = nullptr ); void ChangeHighlightItem(sal_uInt16 n, bool bStartPopupTimer); sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } diff --git a/vcl/source/window/menuitemlist.cxx b/vcl/source/window/menuitemlist.cxx index c104ba8a1ef8..d1042b4fb30b 100644 --- a/vcl/source/window/menuitemlist.cxx +++ b/vcl/source/window/menuitemlist.cxx @@ -36,9 +36,9 @@ MenuItemData::~MenuItemData() aUserValueReleaseFunc(nUserValue); if( pAutoSubMenu ) { - static_cast<PopupMenu*>(pAutoSubMenu)->pRefAutoSubMenu = NULL; + static_cast<PopupMenu*>(pAutoSubMenu)->pRefAutoSubMenu = nullptr; delete pAutoSubMenu; - pAutoSubMenu = NULL; + pAutoSubMenu = nullptr; } if( pSalMenuItem ) ImplGetSVData()->mpDefInst->DestroyMenuItem( pSalMenuItem ); @@ -66,8 +66,8 @@ MenuItemData* MenuItemList::Insert( pData->sIdent = rIdent; pData->eType = eType; pData->nBits = nBits; - pData->pSubMenu = NULL; - pData->pAutoSubMenu = NULL; + pData->pSubMenu = nullptr; + pData->pAutoSubMenu = nullptr; pData->nUserValue = 0; pData->bChecked = false; pData->bEnabled = true; @@ -102,8 +102,8 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos) pData->sIdent = rIdent; pData->eType = MenuItemType::SEPARATOR; pData->nBits = MenuItemBits::NONE; - pData->pSubMenu = NULL; - pData->pAutoSubMenu = NULL; + pData->pSubMenu = nullptr; + pData->pAutoSubMenu = nullptr; pData->nUserValue = 0; pData->bChecked = false; pData->bEnabled = true; @@ -116,7 +116,7 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos) aSalMIData.nId = 0; aSalMIData.eType = MenuItemType::SEPARATOR; aSalMIData.nBits = MenuItemBits::NONE; - aSalMIData.pMenu = NULL; + aSalMIData.pMenu = nullptr; aSalMIData.aText.clear(); aSalMIData.aImage = Image(); @@ -149,7 +149,7 @@ MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, size_t& rPos ) const return maItemList[ i ]; } } - return NULL; + return nullptr; } MenuItemData* MenuItemList::SearchItem( @@ -221,7 +221,7 @@ MenuItemData* MenuItemList::SearchItem( } } - return NULL; + return nullptr; } size_t MenuItemList::GetItemCount( sal_Unicode cSelectChar ) const diff --git a/vcl/source/window/menuitemlist.hxx b/vcl/source/window/menuitemlist.hxx index 6f2b2631bdef..3f7f8d2d6166 100644 --- a/vcl/source/window/menuitemlist.hxx +++ b/vcl/source/window/menuitemlist.hxx @@ -62,28 +62,28 @@ struct MenuItemData : nId(0) , eType(MenuItemType::DONTKNOW) , nBits(MenuItemBits::NONE) - , pSubMenu(NULL) - , pAutoSubMenu(NULL) + , pSubMenu(nullptr) + , pAutoSubMenu(nullptr) , nUserValue(0) - , aUserValueReleaseFunc(0) + , aUserValueReleaseFunc(nullptr) , bChecked(false) , bEnabled(false) , bVisible(false) , bIsTemporary(false) , bMirrorMode(false) , nItemImageAngle(0) - , pSalMenuItem(NULL) + , pSalMenuItem(nullptr) { } MenuItemData( const OUString& rStr, const Image& rImage ) : nId(0) , eType(MenuItemType::DONTKNOW) , nBits(MenuItemBits::NONE) - , pSubMenu(NULL) - , pAutoSubMenu(NULL) + , pSubMenu(nullptr) + , pAutoSubMenu(nullptr) , aText(rStr) , nUserValue(0) - , aUserValueReleaseFunc(0) + , aUserValueReleaseFunc(nullptr) , aImage(rImage) , bChecked(false) , bEnabled(false) @@ -91,7 +91,7 @@ struct MenuItemData , bIsTemporary(false) , bMirrorMode(false) , nItemImageAngle(0) - , pSalMenuItem(NULL) + , pSalMenuItem(nullptr) { } ~MenuItemData(); @@ -134,7 +134,7 @@ public: } MenuItemData* GetDataFromPos( size_t nPos ) const { - return ( nPos < maItemList.size() ) ? maItemList[ nPos ] : NULL; + return ( nPos < maItemList.size() ) ? maItemList[ nPos ] : nullptr; } MenuItemData* SearchItem( diff --git a/vcl/source/window/menuwindow.cxx b/vcl/source/window/menuwindow.cxx index e915c33e4c07..72a1baecbb3f 100644 --- a/vcl/source/window/menuwindow.cxx +++ b/vcl/source/window/menuwindow.cxx @@ -99,9 +99,9 @@ bool MenuWindow::ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_ aHelpId = OOO_HELP_INDEX; if ( !aCommand.isEmpty() ) - pHelp->Start( aCommand, NULL ); + pHelp->Start( aCommand, nullptr ); else - pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); + pHelp->Start( OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), nullptr ); } bDone = true; } diff --git a/vcl/source/window/mnemonicengine.cxx b/vcl/source/window/mnemonicengine.cxx index f9f74398e172..6901d1aa4ed1 100644 --- a/vcl/source/window/mnemonicengine.cxx +++ b/vcl/source/window/mnemonicengine.cxx @@ -47,7 +47,7 @@ namespace vcl OUString sEntryText; const void* pSearchEntry = _rEntryList.FirstSearchEntry( sEntryText ); - const void* pFirstFoundEntry = NULL; + const void* pFirstFoundEntry = nullptr; bool bCheckingAmbiguity = false; const void* pStartedWith = pSearchEntry; while ( pSearchEntry ) diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index ad6c460d6d91..198e4cde7460 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -160,12 +160,12 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged ) void Window::ImplGenerateMouseMove() { if ( !mpWindowImpl->mpFrameData->mnMouseMoveId ) - mpWindowImpl->mpFrameData->mnMouseMoveId = Application::PostUserEvent( LINK( mpWindowImpl->mpFrameWindow, Window, ImplGenerateMouseMoveHdl ), NULL, true ); + mpWindowImpl->mpFrameData->mnMouseMoveId = Application::PostUserEvent( LINK( mpWindowImpl->mpFrameWindow, Window, ImplGenerateMouseMoveHdl ), nullptr, true ); } IMPL_LINK_NOARG_TYPED(Window, ImplGenerateMouseMoveHdl, void*, void) { - mpWindowImpl->mpFrameData->mnMouseMoveId = 0; + mpWindowImpl->mpFrameData->mnMouseMoveId = nullptr; vcl::Window* pCaptureWin = ImplGetSVData()->maWinData.mpCaptureWin; if( ! pCaptureWin || (pCaptureWin->mpWindowImpl && pCaptureWin->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame) @@ -384,7 +384,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags ) if ( !ImplCallPreNotify( aNEvt ) && !aDogTag.IsDead() ) CompatGetFocus(); if( !aDogTag.IsDead() ) - ImplCallActivateListeners( (pOldFocusWindow && ! aOldFocusDel.IsDead()) ? pOldFocusWindow : NULL ); + ImplCallActivateListeners( (pOldFocusWindow && ! aOldFocusDel.IsDead()) ? pOldFocusWindow : nullptr ); if( !aDogTag.IsDead() ) { mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE; @@ -473,7 +473,7 @@ void Window::ReleaseMouse() if ( pSVData->maWinData.mpCaptureWin.get() == this ) { - pSVData->maWinData.mpCaptureWin = NULL; + pSVData->maWinData.mpCaptureWin = nullptr; mpWindowImpl->mpFrame->CaptureMouse( false ); ImplGenerateMouseMove(); } diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 659c3fe33449..e892c1d3c7be 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -52,10 +52,10 @@ static void ImplInitMsgBoxImageList() void MessBox::ImplInitMessBoxData() { - mpVCLMultiLineEdit = NULL; - mpFixedImage = NULL; + mpVCLMultiLineEdit = nullptr; + mpFixedImage = nullptr; mbHelpBtn = false; - mpCheckBox = NULL; + mpCheckBox = nullptr; mbCheck = false; } diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx index 9af4c0ff399b..3f95894181d1 100644 --- a/vcl/source/window/openglwin.cxx +++ b/vcl/source/window/openglwin.cxx @@ -42,7 +42,7 @@ OpenGLWindowImpl::~OpenGLWindowImpl() OpenGLWindow::OpenGLWindow(vcl::Window* pParent): Window(pParent, 0), mxImpl(new OpenGLWindowImpl(this)), - mpRenderer(NULL) + mpRenderer(nullptr) { } @@ -55,7 +55,7 @@ void OpenGLWindow::dispose() { if(mpRenderer) mpRenderer->contextDestroyed(); - mpRenderer = NULL; + mpRenderer = nullptr; mxImpl.reset(); Window::dispose(); } diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index ade79ba0d77d..6dd4da85a2ba 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -215,7 +215,7 @@ public: PaintHelper::PaintHelper(vcl::Window *pWindow, sal_uInt16 nPaintFlags) : m_pWindow(pWindow) - , m_pChildRegion(NULL) + , m_pChildRegion(nullptr) , m_nPaintFlags(nPaintFlags) , m_bPop(false) , m_bRestoreCursor(false) @@ -519,7 +519,7 @@ void Window::PopPaintHelper(PaintHelper *pHelper) } mpWindowImpl->mbInPaint = false; mbInitClipRegion = true; - mpWindowImpl->mpPaintRegion = NULL; + mpWindowImpl->mpPaintRegion = nullptr; if (mpWindowImpl->mpCursor) mpWindowImpl->mpCursor->ImplResume(pHelper->GetRestoreCursor()); } @@ -628,7 +628,7 @@ void Window::ImplCallOverlapPaint() // - RTL - notify ImplCallPaint to check for re-mirroring (CHECKRTL) // because we were called from the Sal layer OutputDevice::PaintScope aScope( GetOutDev() ); - ImplCallPaint(NULL, mpWindowImpl->mnPaintFlags /*| IMPL_PAINT_CHECKRTL */); + ImplCallPaint(nullptr, mpWindowImpl->mnPaintFlags /*| IMPL_PAINT_CHECKRTL */); } } @@ -671,12 +671,12 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandleResizeTimerHdl, Idle *, void) ImplCallResize(); if( ImplDoTiledRendering() ) { - ImplHandlePaintHdl(NULL); + ImplHandlePaintHdl(nullptr); } else if( mpWindowImpl->mpFrameData->maPaintIdle.IsActive() ) { mpWindowImpl->mpFrameData->maPaintIdle.Stop(); - mpWindowImpl->mpFrameData->maPaintIdle.GetIdleHdl().Call( NULL ); + mpWindowImpl->mpFrameData->maPaintIdle.GetIdleHdl().Call( nullptr ); } } } @@ -811,7 +811,7 @@ void Window::ImplInvalidate( const vcl::Region* pRegion, InvalidateFlags nFlags if ( (nFlags & InvalidateFlags::NoChildren) && mpWindowImpl->mpFirstChild ) bInvalidateAll = false; if ( bInvalidateAll ) - ImplInvalidateFrameRegion( NULL, nFlags ); + ImplInvalidateFrameRegion( nullptr, nFlags ); else { Rectangle aRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ); @@ -970,7 +970,7 @@ void Window::ImplValidate( const vcl::Region* pRegion, ValidateFlags nFlags ) if ( (nFlags & ValidateFlags::NoChildren) && mpWindowImpl->mpFirstChild ) bValidateAll = false; if ( bValidateAll ) - ImplValidateFrameRegion( NULL, nFlags ); + ImplValidateFrameRegion( nullptr, nFlags ); else { Rectangle aRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ); @@ -1017,7 +1017,7 @@ void Window::ImplUpdateAll( bool bOverlapWindows ) else { if (pWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTCHILDREN)) - pWindow->ImplCallPaint(NULL, pWindow->mpWindowImpl->mnPaintFlags); + pWindow->ImplCallPaint(nullptr, pWindow->mpWindowImpl->mnPaintFlags); } if ( bFlush ) @@ -1208,8 +1208,8 @@ void Window::Invalidate( InvalidateFlags nFlags ) if ( !comphelper::LibreOfficeKit::isActive() && (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; - ImplInvalidate( NULL, nFlags ); - LogicInvalidate(0); + ImplInvalidate( nullptr, nFlags ); + LogicInvalidate(nullptr); } void Window::Invalidate( const Rectangle& rRect, InvalidateFlags nFlags ) @@ -1235,8 +1235,8 @@ void Window::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags ) if ( rRegion.IsNull() ) { - ImplInvalidate( NULL, nFlags ); - LogicInvalidate(0); + ImplInvalidate( nullptr, nFlags ); + LogicInvalidate(nullptr); } else { @@ -1255,7 +1255,7 @@ void Window::Validate( ValidateFlags nFlags ) if ( !comphelper::LibreOfficeKit::isActive() && (!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) ) return; - ImplValidate( NULL, nFlags ); + ImplValidate( nullptr, nFlags ); } bool Window::HasPaintEvent() const @@ -1345,7 +1345,7 @@ void Window::Update() pUpdateOverlapWindow = pUpdateOverlapWindow->mpWindowImpl->mpNext; } - pUpdateWindow->ImplCallPaint(NULL, pUpdateWindow->mpWindowImpl->mnPaintFlags); + pUpdateWindow->ImplCallPaint(nullptr, pUpdateWindow->mpWindowImpl->mnPaintFlags); if (aDogTag.IsDead()) return; @@ -1485,7 +1485,7 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& / DBG_ASSERT( ! pDev->HasMirroredGraphics(), "PaintToDevice to mirroring graphics" ); DBG_ASSERT( ! pDev->IsRTLEnabled(), "PaintToDevice to mirroring device" ); - vcl::Window* pRealParent = NULL; + vcl::Window* pRealParent = nullptr; if( ! mpWindowImpl->mbVisible ) { vcl::Window* pTempParent = ImplGetDefaultWindow(); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ef58f37eea17..71c175b52dfc 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -571,7 +571,7 @@ void PrintDialog::OutputOptPage::storeToSettings() PrintDialog::PrintDialog( vcl::Window* i_pParent, const std::shared_ptr<PrinterController>& i_rController ) : ModalDialog(i_pParent, "PrintDialog", "vcl/ui/printdialog.ui") - , mpCustomOptionsUIBuilder(NULL) + , mpCustomOptionsUIBuilder(nullptr) , maPController( i_rController ) , maNUpPage(m_pUIBuilder) , maJobPage(m_pUIBuilder) @@ -1002,7 +1002,7 @@ void PrintDialog::setupOptionalUI() if( pVal ) pVal->Value >>= bVal; maNUpPage.mpBrochureBtn->Check( bVal ); - maNUpPage.mpBrochureBtn->Enable( maPController->isUIOptionEnabled( aPropertyName ) && pVal != NULL ); + maNUpPage.mpBrochureBtn->Enable( maPController->isUIOptionEnabled( aPropertyName ) && pVal != nullptr ); maNUpPage.mpBrochureBtn->SetToggleHdl( LINK( this, PrintDialog, ToggleRadioHdl ) ); maPropertyToWindowMap[ aPropertyName ].push_back( maNUpPage.mpBrochureBtn ); @@ -1671,7 +1671,7 @@ IMPL_LINK_TYPED( PrintDialog, ModifyHdl, Edit&, rEdit, void ) PropertyValue* PrintDialog::getValueForWindow( vcl::Window* i_pWindow ) const { - PropertyValue* pVal = NULL; + PropertyValue* pVal = nullptr; auto it = maControlToPropertyMap.find( i_pWindow ); if( it != maControlToPropertyMap.end() ) { diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index 88e1cf1106d7..b438d1e6c009 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -91,7 +91,7 @@ void ImplWheelWindow::dispose() { ImplStop(); delete mpTimer; - mpTimer = NULL; + mpTimer = nullptr; FloatingWindow::dispose(); } @@ -123,7 +123,7 @@ void ImplWheelWindow::ImplCreateImageList() ResMgr* pResMgr = ImplGetResMgr(); if( pResMgr ) maImgList.InsertFromHorizontalBitmap - ( ResId( SV_RESID_BITMAP_SCROLLBMP, *pResMgr ), 6, NULL ); + ( ResId( SV_RESID_BITMAP_SCROLLBMP, *pResMgr ), 6, nullptr ); } void ImplWheelWindow::ImplSetWheelMode( sal_uLong nWheelMode ) diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index 115ec625e159..de21f161c778 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -52,7 +52,7 @@ namespace void Splitter::ImplInitSplitterData() { ImplGetWindowImpl()->mbSplitter = true; - mpRefWin = NULL; + mpRefWin = nullptr; mnSplitPos = 0; mnLastSplitPos = 0; mnStartSplitPos = 0; @@ -88,7 +88,7 @@ void Splitter::ImplInitHorVer(bool bNew) void Splitter::ImplInit( vcl::Window* pParent, WinBits nWinStyle ) { - Window::ImplInit( pParent, nWinStyle, NULL ); + Window::ImplInit( pParent, nWinStyle, nullptr ); mpRefWin = pParent; @@ -183,7 +183,7 @@ Splitter* Splitter::ImplFindSibling() { // look for another splitter with the same parent but different orientation vcl::Window *pWin = GetParent()->GetWindow( GetWindowType::FirstChild ); - Splitter *pSplitter = NULL; + Splitter *pSplitter = nullptr; while( pWin ) { if( pWin->ImplIsSplitter() ) @@ -194,7 +194,7 @@ Splitter* Splitter::ImplFindSibling() } pWin = pWin->GetWindow( GetWindowType::Next ); } - return NULL; + return nullptr; } bool Splitter::ImplSplitterActive() diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 572a9a4b6966..e6d62d305580 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -111,7 +111,7 @@ ImplSplitItem::ImplSplitItem() , mnOldSplitSize(0) , mnOldWidth(0) , mnOldHeight(0) - , mpSet(0) + , mpSet(nullptr) , mnId(0) , mnBits(SplitWindowItemFlags::NONE) , mbFixed(false) @@ -130,15 +130,15 @@ void ImplSplitItem::dispose() { if (mpSet) { delete mpSet ; - mpSet = NULL; + mpSet = nullptr; } mpWindow.clear(); mpOrgParent.clear(); } ImplSplitSet::ImplSplitSet() : - mpWallpaper( NULL ), - mpBitmap( NULL ), + mpWallpaper( nullptr ), + mpBitmap( nullptr ), mnLastSize( 0 ), mnSplitSize( SPLITWIN_SPLITSIZE ), mnId( 0 ), @@ -161,12 +161,12 @@ void ImplSplitSet::dispose() if ( mpWallpaper ) { delete mpWallpaper; - mpWallpaper = NULL; + mpWallpaper = nullptr; } if ( mpBitmap ) { delete mpBitmap; - mpBitmap = NULL; + mpBitmap = nullptr; } } @@ -359,7 +359,7 @@ static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId ) } } - return NULL; + return nullptr; } static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt16& rPos ) @@ -387,7 +387,7 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt1 } } - return NULL; + return nullptr; } static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, vcl::Window* pWindow ) @@ -1304,8 +1304,8 @@ void SplitWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) mpMainSet = pNewSet; mpBaseSet = pNewSet; - mpSplitSet = NULL; - mpLastSizes = NULL; + mpSplitSet = nullptr; + mpLastSizes = nullptr; mnDX = 0; mnDY = 0; mnLeftBorder = 0; @@ -1404,7 +1404,7 @@ void SplitWindow::dispose() // delete Sets if (mpMainSet) { delete mpMainSet ; - mpMainSet = NULL; //NULL for base-class callbacks during destruction + mpMainSet = nullptr; //NULL for base-class callbacks during destruction } DockingWindow::dispose(); } @@ -2487,8 +2487,8 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) if ( rTEvt.IsTrackingEnded() ) { delete [] mpLastSizes; - mpLastSizes = NULL; - mpSplitSet = NULL; + mpLastSizes = nullptr; + mpSplitSet = nullptr; mnMouseOff = 0; mnMStartPos = 0; mnMSplitPos = 0; @@ -2501,9 +2501,9 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) bool SplitWindow::PreNotify( NotifyEvent& rNEvt ) { - const MouseEvent* pMouseEvt = NULL; + const MouseEvent* pMouseEvt = nullptr; - if( (rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE) && (pMouseEvt = rNEvt.GetMouseEvent()) != NULL ) + if( (rNEvt.GetType() == MouseNotifyEvent::MOUSEMOVE) && (pMouseEvt = rNEvt.GetMouseEvent()) != nullptr ) { if( !pMouseEvt->GetButtons() && !pMouseEvt->IsSynthetic() && !pMouseEvt->IsModifierChanged() ) { @@ -2719,7 +2719,7 @@ void SplitWindow::InsertItem( sal_uInt16 nId, long nSize, sal_uInt16 nPos, sal_uInt16 nIntoSetId, SplitWindowItemFlags nBits ) { - InsertItem( nId, NULL, nSize, nPos, nIntoSetId, nBits ); + InsertItem( nId, nullptr, nSize, nPos, nIntoSetId, nBits ); } void SplitWindow::RemoveItem( sal_uInt16 nId, bool bHide ) @@ -2743,7 +2743,7 @@ void SplitWindow::RemoveItem( sal_uInt16 nId, bool bHide ) // delete set if required if ( !pWindow ) { delete pItem->mpSet ; - pItem->mpSet = NULL; + pItem->mpSet = nullptr; } // remove item @@ -3100,7 +3100,7 @@ void SplitWindow::SetItemSizeRange (sal_uInt16 nId, const Range& rRange) sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos); - if (pSet != NULL) + if (pSet != nullptr) { pSet->mpItems[nPos]->mnMinSize = rRange.Min(); pSet->mpItems[nPos]->mnMaxSize = rRange.Max(); @@ -3121,7 +3121,7 @@ sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const bool SplitWindow::IsItemValid( sal_uInt16 nId ) const { sal_uInt16 nPos; - ImplSplitSet* pSet = mpBaseSet ? ImplFindItem(mpBaseSet, nId, nPos) : NULL; + ImplSplitSet* pSet = mpBaseSet ? ImplFindItem(mpBaseSet, nId, nPos) : nullptr; if ( pSet ) return true; diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 3a3e8730565f..cb5f316b94aa 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -148,8 +148,8 @@ void Window::ImplRemoveWindow( bool bRemoveFrameData ) mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = mpWindowImpl->mpPrev; } - mpWindowImpl->mpPrev = NULL; - mpWindowImpl->mpNext = NULL; + mpWindowImpl->mpPrev = nullptr; + mpWindowImpl->mpNext = nullptr; } if ( bRemoveFrameData ) @@ -205,7 +205,7 @@ void Window::ImplToBottomChild() mpWindowImpl->mpPrev = mpWindowImpl->mpParent->mpWindowImpl->mpLastChild; mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = this; mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this; - mpWindowImpl->mpNext = NULL; + mpWindowImpl->mpNext = nullptr; } } @@ -228,7 +228,7 @@ void Window::ImplCalcToTop( ImplCalcToTopData* pPrevData ) { ImplCalcToTopData* pData = new ImplCalcToTopData; pPrevData->mpNext = pData; - pData->mpNext = NULL; + pData->mpNext = nullptr; pData->mpWindow = this; pData->mpInvalidateRegion = new vcl::Region( aInvalidateRegion ); } @@ -339,7 +339,7 @@ void Window::ImplStartToTop( ToTopFlags nFlags ) // first calculate paint areas vcl::Window* pTempOverlapWindow = pOverlapWindow; - aStartData.mpNext = NULL; + aStartData.mpNext = nullptr; pCurData = &aStartData; do { @@ -577,7 +577,7 @@ void Window::SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags ) // Invalidate all windows which are next to each other // Is INCOMPLETE !!! Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ); - vcl::Window* pWindow = NULL; + vcl::Window* pWindow = nullptr; if ( ImplIsOverlapWindow() ) { if ( mpWindowImpl->mpOverlapWindow ) @@ -676,7 +676,7 @@ vcl::Window* Window::ImplFindWindow( const Point& rFramePos ) // then we check our window if ( !mpWindowImpl->mbVisible ) - return NULL; + return nullptr; sal_uInt16 nHitTest = ImplHitTest( rFramePos ); if ( nHitTest & WINDOW_HITTEST_INSIDE ) @@ -692,12 +692,12 @@ vcl::Window* Window::ImplFindWindow( const Point& rFramePos ) } if ( nHitTest & WINDOW_HITTEST_TRANSPARENT ) - return NULL; + return nullptr; else return this; } - return NULL; + return nullptr; } bool Window::ImplIsRealParentPath( const vcl::Window* pWindow ) const @@ -844,7 +844,7 @@ SystemWindow* Window::GetSystemWindow() const static SystemWindow *ImplGetLastSystemWindow( vcl::Window *pWin ) { // get the most top-level system window, the one that contains the taskpanelist - SystemWindow *pSysWin = NULL; + SystemWindow *pSysWin = nullptr; if( !pWin ) return pSysWin; vcl::Window *pMyParent = pWin; @@ -867,7 +867,7 @@ void Window::SetParent( vcl::Window* pNewParent ) // check if the taskpanelist would change and move the window pointer accordingly SystemWindow *pSysWin = ImplGetLastSystemWindow(this); - SystemWindow *pNewSysWin = NULL; + SystemWindow *pNewSysWin = nullptr; bool bChangeTaskPaneList = false; if( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) ) { @@ -907,16 +907,16 @@ void Window::SetParent( vcl::Window* pNewParent ) // check if the overlap window changes vcl::Window* pOldOverlapWindow; - vcl::Window* pNewOverlapWindow = NULL; + vcl::Window* pNewOverlapWindow = nullptr; if ( ImplIsOverlapWindow() ) - pOldOverlapWindow = NULL; + pOldOverlapWindow = nullptr; else { pNewOverlapWindow = pNewParent->ImplGetFirstOverlapWindow(); if ( mpWindowImpl->mpOverlapWindow.get() != pNewOverlapWindow ) pOldOverlapWindow = mpWindowImpl->mpOverlapWindow; else - pOldOverlapWindow = NULL; + pOldOverlapWindow = nullptr; } // convert windows in the hierarchy @@ -928,17 +928,17 @@ void Window::SetParent( vcl::Window* pNewParent ) if ( mpWindowImpl->mpFrameData->mpFocusWin ) { if ( IsWindowOrChild( mpWindowImpl->mpFrameData->mpFocusWin ) ) - mpWindowImpl->mpFrameData->mpFocusWin = NULL; + mpWindowImpl->mpFrameData->mpFocusWin = nullptr; } if ( mpWindowImpl->mpFrameData->mpMouseMoveWin ) { if ( IsWindowOrChild( mpWindowImpl->mpFrameData->mpMouseMoveWin ) ) - mpWindowImpl->mpFrameData->mpMouseMoveWin = NULL; + mpWindowImpl->mpFrameData->mpMouseMoveWin = nullptr; } if ( mpWindowImpl->mpFrameData->mpMouseDownWin ) { if ( IsWindowOrChild( mpWindowImpl->mpFrameData->mpMouseDownWin ) ) - mpWindowImpl->mpFrameData->mpMouseDownWin = NULL; + mpWindowImpl->mpFrameData->mpMouseDownWin = nullptr; } } ImplRemoveWindow( bNewFrame ); @@ -971,7 +971,7 @@ void Window::SetParent( vcl::Window* pNewParent ) if ( bFocusWin || (pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow && IsWindowOrChild( pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow )) ) - pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow = NULL; + pOldOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr; vcl::Window* pOverlapWindow = pOldOverlapWindow->mpWindowImpl->mpFirstOverlap; while ( pOverlapWindow ) @@ -1041,7 +1041,7 @@ sal_uInt16 Window::GetChildCount() const vcl::Window* Window::GetChild( sal_uInt16 nChild ) const { if (!mpWindowImpl) - return NULL; + return nullptr; sal_uInt16 nChildCount = 0; vcl::Window* pChild = mpWindowImpl->mpFirstChild; @@ -1053,13 +1053,13 @@ vcl::Window* Window::GetChild( sal_uInt16 nChild ) const nChildCount++; } - return NULL; + return nullptr; } vcl::Window* Window::GetWindow( GetWindowType nType ) const { if (!mpWindowImpl) - return 0; + return nullptr; switch ( nType ) { @@ -1111,40 +1111,40 @@ vcl::Window* Window::GetWindow( GetWindowType nType ) const return const_cast<vcl::Window*>(this); case GetWindowType::FirstTopWindowChild: - return ImplGetWinData()->maTopWindowChildren.empty() ? NULL : (*ImplGetWinData()->maTopWindowChildren.begin()).get(); + return ImplGetWinData()->maTopWindowChildren.empty() ? nullptr : (*ImplGetWinData()->maTopWindowChildren.begin()).get(); case GetWindowType::LastTopWindowChild: - return ImplGetWinData()->maTopWindowChildren.empty() ? NULL : (*ImplGetWinData()->maTopWindowChildren.rbegin()).get(); + return ImplGetWinData()->maTopWindowChildren.empty() ? nullptr : (*ImplGetWinData()->maTopWindowChildren.rbegin()).get(); case GetWindowType::PrevTopWindowSibling: { if ( !mpWindowImpl->mpRealParent ) - return NULL; + return nullptr; const ::std::list< VclPtr<vcl::Window> >& rTopWindows( mpWindowImpl->mpRealParent->ImplGetWinData()->maTopWindowChildren ); ::std::list< VclPtr<vcl::Window> >::const_iterator myPos = ::std::find( rTopWindows.begin(), rTopWindows.end(), this ); if ( myPos == rTopWindows.end() ) - return NULL; + return nullptr; if ( myPos == rTopWindows.begin() ) - return NULL; + return nullptr; return *--myPos; } case GetWindowType::NextTopWindowSibling: { if ( !mpWindowImpl->mpRealParent ) - return NULL; + return nullptr; const ::std::list< VclPtr<vcl::Window> >& rTopWindows( mpWindowImpl->mpRealParent->ImplGetWinData()->maTopWindowChildren ); ::std::list< VclPtr<vcl::Window> >::const_iterator myPos = ::std::find( rTopWindows.begin(), rTopWindows.end(), this ); if ( ( myPos == rTopWindows.end() ) || ( ++myPos == rTopWindows.end() ) ) - return NULL; + return nullptr; return *myPos; } } - return NULL; + return nullptr; } bool Window::IsChild( const vcl::Window* pWindow, bool bSystemWindow ) const @@ -1183,7 +1183,7 @@ void Window::ImplSetFrameParent( const vcl::Window* pParent ) { DBG_ASSERT( mpWindowImpl->mpFrame != pFrameWindow->mpWindowImpl->mpFrame, "SetFrameParent to own" ); DBG_ASSERT( mpWindowImpl->mpFrame, "no frame" ); - SalFrame* pParentFrame = pParent ? pParent->mpWindowImpl->mpFrame : NULL; + SalFrame* pParentFrame = pParent ? pParent->mpWindowImpl->mpFrame : nullptr; pFrameWindow->mpWindowImpl->mpFrame->SetParent( pParentFrame ); } pFrameWindow = pFrameWindow->mpWindowImpl->mpFrameData->mpNextFrame; diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index c4a349012faf..c9649aaa8e77 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -53,7 +53,7 @@ public: StatusBar::ImplData::ImplData() { - mpVirDev = NULL; + mpVirDev = nullptr; mbDrawItemFrames = false; mnItemBorderWidth = 0; } @@ -120,7 +120,7 @@ void StatusBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) if ( !(nStyle & (WB_LEFT | WB_RIGHT)) ) nStyle |= WB_RIGHT; - Window::ImplInit( pParent, nStyle & ~WB_BORDER, NULL ); + Window::ImplInit( pParent, nStyle & ~WB_BORDER, nullptr ); // remember WinBits mpItemList = new ImplStatusItemList; @@ -300,7 +300,7 @@ Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const { Rectangle aRect; ImplStatusItem* pItem; - pItem = ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : NULL; + pItem = ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : nullptr; if ( pItem ) { if ( pItem->mbVisible ) @@ -940,7 +940,7 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth, pItem->mnBits = nBits; pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET; pItem->mnOffset = nOffset; - pItem->mpUserData = 0; + pItem->mpUserData = nullptr; pItem->mbVisible = true; // add item to list @@ -1255,7 +1255,7 @@ void* StatusBar::GetItemData( sal_uInt16 nItemId ) const if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->mpUserData; - return NULL; + return nullptr; } void StatusBar::RedrawItem(sal_uInt16 nItemId) diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 0f16a49d717f..0615cf5f69e1 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -82,7 +82,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */, if ( !pWindow->ImplGetFrameData()->mnFocusId ) { pWindow->ImplGetFrameData()->mbStartFocusState = true; - pWindow->ImplGetFrameData()->mnFocusId = Application::PostUserEvent( LINK( pWindow->ImplGetFrameWindow(), vcl::Window, ImplAsyncFocusHdl ), NULL, true ); + pWindow->ImplGetFrameData()->mnFocusId = Application::PostUserEvent( LINK( pWindow->ImplGetFrameWindow(), vcl::Window, ImplAsyncFocusHdl ), nullptr, true ); } break; @@ -108,7 +108,7 @@ void SystemChildWindow::ImplInitSysChild( vcl::Window* pParent, WinBits nStyle, { mpWindowImpl->mpSysObj = ImplGetSVData()->mpDefInst->CreateObject( pParent->ImplGetFrame(), pData, bShow ); - Window::ImplInit( pParent, nStyle, NULL ); + Window::ImplInit( pParent, nStyle, nullptr ); // we do not paint if it is the right SysChild if ( GetSystemData() ) @@ -122,7 +122,7 @@ void SystemChildWindow::ImplInitSysChild( vcl::Window* pParent, WinBits nStyle, SystemChildWindow::SystemChildWindow( vcl::Window* pParent, WinBits nStyle ) : Window( WINDOW_SYSTEMCHILDWINDOW ) { - ImplInitSysChild( pParent, nStyle, NULL ); + ImplInitSysChild( pParent, nStyle, nullptr ); } SystemChildWindow::SystemChildWindow( vcl::Window* pParent, WinBits nStyle, SystemWindowData *pData, bool bShow ) : @@ -142,7 +142,7 @@ void SystemChildWindow::dispose() if ( mpWindowImpl && mpWindowImpl->mpSysObj ) { ImplGetSVData()->mpDefInst->DestroyObject( mpWindowImpl->mpSysObj ); - mpWindowImpl->mpSysObj = NULL; + mpWindowImpl->mpSysObj = nullptr; } Window::dispose(); } @@ -152,7 +152,7 @@ const SystemEnvData* SystemChildWindow::GetSystemData() const if ( mpWindowImpl->mpSysObj ) return mpWindowImpl->mpSysObj->GetSystemData(); else - return NULL; + return nullptr; } void SystemChildWindow::EnableEraseBackground( bool bEnable ) @@ -181,7 +181,7 @@ void SystemChildWindow::ImplTestJavaException( void* pEnv ) if(jsMessage) { - const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); + const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, nullptr); ouMessage = OUString(jcMessage); pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); } @@ -234,7 +234,7 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( bool bUseJava ) rtl_getGlobalProcessId( reinterpret_cast<sal_uInt8*>(aProcessID.getArray()) ); aProcessID[ 16 ] = 0; OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64"); - sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0)); + sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(nullptr)); xJavaVM->getJavaVM(aProcessID) >>= nPointer; xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index a8f753800f0c..d353f4607d7d 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -58,7 +58,7 @@ public: SystemWindow::ImplData::ImplData() { - mpTaskPaneList = NULL; + mpTaskPaneList = nullptr; maMaxOutSize = Size( SHRT_MAX, SHRT_MAX ); } @@ -73,7 +73,7 @@ void SystemWindow::Init() mpWindowImpl->mbSysWin = true; mpWindowImpl->mnActivateMode = ActivateModeFlags::GrabFocus; - mpMenuBar = NULL; + mpMenuBar = nullptr; mbPinned = false; mbRollUp = false; mbRollFunc = false; @@ -84,7 +84,7 @@ void SystemWindow::Init() mbInitialLayoutDone = false; mnMenuBarMode = MenuBarMode::Normal; mnIcon = 0; - mpDialogParent = NULL; + mpDialogParent = nullptr; //To-Do, reuse maResizeTimer maLayoutIdle.SetPriority(SchedulerPriority::RESIZE); @@ -115,7 +115,7 @@ void SystemWindow::dispose() { maLayoutIdle.Stop(); delete mpImplData; - mpImplData = NULL; + mpImplData = nullptr; // Hack to make sure code called from base ~Window does not interpret this // as a SystemWindow (which it no longer is by then): @@ -198,7 +198,7 @@ bool SystemWindow::PreNotify( NotifyEvent& rNEvt ) TaskPaneList* SystemWindow::GetTaskPaneList() { if( !mpImplData ) - return NULL; + return nullptr; if( mpImplData->mpTaskPaneList ) return mpImplData->mpTaskPaneList ; else @@ -909,8 +909,8 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) if ( mpMenuBar != pMenuBar ) { MenuBar* pOldMenuBar = mpMenuBar; - vcl::Window* pOldWindow = NULL; - vcl::Window* pNewWindow=NULL; + vcl::Window* pOldWindow = nullptr; + vcl::Window* pNewWindow=nullptr; mpMenuBar = pMenuBar; if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) ) @@ -918,7 +918,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) if ( pOldMenuBar ) pOldWindow = pOldMenuBar->ImplGetWindow(); else - pOldWindow = NULL; + pOldWindow = nullptr; if ( pOldWindow ) { CallEventListeners( VCLEVENT_WINDOW_MENUBARREMOVED, static_cast<void*>(pOldMenuBar) ); @@ -934,11 +934,11 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) CallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, static_cast<void*>(pMenuBar) ); } else - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( NULL ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( nullptr ); ImplToBottomChild(); if ( pOldMenuBar ) { - bool bDelete = (pMenuBar == 0); + bool bDelete = (pMenuBar == nullptr); if( bDelete && pOldWindow ) { if( mpImplData->mpTaskPaneList ) @@ -946,7 +946,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar) } MenuBar::ImplDestroy( pOldMenuBar, bDelete ); if( bDelete ) - pOldWindow = NULL; // will be deleted in MenuBar::ImplDestroy, + pOldWindow = nullptr; // will be deleted in MenuBar::ImplDestroy, } } diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index c5bea40f1278..3e8531b43cc2 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -25,8 +25,8 @@ void TabDialog::ImplInitTabDialogData() { - mpFixedLine = NULL; - mpViewWindow = NULL; + mpFixedLine = nullptr; + mpViewWindow = nullptr; meViewAlign = WindowAlign::Left; mbPosControls = true; } @@ -39,7 +39,7 @@ void TabDialog::ImplPosControls() Size aCtrlSize( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT ); long nDownCtrl = 0; long nOffY = 0; - vcl::Window* pTabControl = NULL; + vcl::Window* pTabControl = nullptr; vcl::Window* pChild = GetWindow( GetWindowType::FirstChild ); while ( pChild ) diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index e5c4c6c4d9f2..e22f91d9402c 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -36,7 +36,7 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle ) if ( !(nStyle & WB_NODIALOGCONTROL) ) nStyle |= WB_DIALOGCONTROL; - Window::ImplInit( pParent, nStyle, NULL ); + Window::ImplInit( pParent, nStyle, nullptr ); ImplInitSettings(); diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index 081947c538e3..e12f8d4ba418 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -180,7 +180,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent) } // activate next task pane - vcl::Window *pNextWin = NULL; + vcl::Window *pNextWin = nullptr; if( bSplitterOnly ) pNextWin = FindNextSplitter( *p ); @@ -213,9 +213,9 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent) // the focus is not in the list: activate first float if F6 was pressed vcl::Window *pWin; if( bSplitterOnly ) - pWin = FindNextSplitter( NULL ); + pWin = FindNextSplitter( nullptr ); else - pWin = FindNextFloat( NULL, bForward ); + pWin = FindNextFloat( nullptr, bForward ); if( pWin ) { ImplTaskPaneListGrabFocus( pWin, bForward ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index cfcf37e8849b..3f414c759056 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -124,7 +124,7 @@ public: void StartDragging( ToolBox* pDragBox, const Point& rPos, const Rectangle& rRect, sal_uInt16 nLineMode, bool bResizeItem, - void* pData = NULL ); + void* pData = nullptr ); void Dragging( const Point& rPos ); void EndDragging( bool bOK = true ); void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); } @@ -658,7 +658,7 @@ const ImplToolItem *ToolBox::ImplGetFirstClippedItem( const ToolBox* pThis ) return &(*it); ++it; } - return NULL; + return nullptr; } Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode ) @@ -1128,12 +1128,12 @@ sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos ) ImplTBDragMgr::ImplTBDragMgr() : mpBoxList(new ImplTBList()) - , mpDragBox(NULL) + , mpDragBox(nullptr) , mnMinWidth(0) , mnMaxWidth(0) , mnLineMode(0) , mnStartLines(0) - , mpCustomizeData(NULL) + , mpCustomizeData(nullptr) , mbResizeMode(false) , mbShowDragRect(false) { @@ -1173,7 +1173,7 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect ) } } - return NULL; + return nullptr; } void ImplTBDragMgr::StartDragging( ToolBox* pToolBox, @@ -1319,12 +1319,12 @@ void ImplTBDragMgr::EndDragging( bool bOK ) } } } - mpCustomizeData = NULL; + mpCustomizeData = nullptr; mbResizeMode = false; mpDragBox->Deactivate(); } - mpDragBox = NULL; + mpDragBox = nullptr; } void ImplTBDragMgr::UpdateDragRect() @@ -1349,7 +1349,7 @@ void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) // initialize variables ImplGetWindowImpl()->mbToolBox = true; mpData = new ImplToolBoxPrivateData; - mpFloatWin = NULL; + mpFloatWin = nullptr; mnDX = 0; mnDY = 0; mnMaxItemWidth = 0; @@ -1642,11 +1642,11 @@ void ToolBox::dispose() // still connected if ( mpFloatWin ) mpFloatWin->EndPopupMode( FloatWinPopupEndFlags::Cancel ); - mpFloatWin = NULL; + mpFloatWin = nullptr; // delete private data delete mpData; - mpData = NULL; + mpData = nullptr; // remove the lists when there are no more toolbox references to // the lists @@ -1660,7 +1660,7 @@ void ToolBox::dispose() if ( !pSVData->maCtrlData.mpTBDragMgr->size() ) { delete pSVData->maCtrlData.mpTBDragMgr; - pSVData->maCtrlData.mpTBDragMgr = NULL; + pSVData->maCtrlData.mpTBDragMgr = nullptr; } } mpFloatWin.clear(); @@ -1670,7 +1670,7 @@ void ToolBox::dispose() ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const { if (!mpData) - return NULL; + return nullptr; std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); while ( it != mpData->m_aItems.end() ) @@ -1680,7 +1680,7 @@ ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const ++it; } - return NULL; + return nullptr; } static void ImplAddButtonBorder( long &rWidth, long& rHeight, bool bNativeButtons ) @@ -2399,7 +2399,7 @@ void ToolBox::ImplFormat( bool bResize ) // compute line breaks and visible lines give the current window width (nMax) // the break indicators will be stored within each item (it->mbBreak) - mnCurLines = ImplCalcBreaks( nMax, NULL, mbHorz ); + mnCurLines = ImplCalcBreaks( nMax, nullptr, mbHorz ); // check for scrollbar buttons or dropdown menu // (if a menu is enabled, this will be used to store clipped @@ -2411,7 +2411,7 @@ void ToolBox::ImplFormat( bool bResize ) if( !IsMenuEnabled() ) { nMax -= TB_SPIN_SIZE+TB_SPIN_OFFSET; - mnCurLines = ImplCalcBreaks( nMax, NULL, mbHorz ); + mnCurLines = ImplCalcBreaks( nMax, nullptr, mbHorz ); } // compute scroll rectangles or menu button @@ -2972,7 +2972,7 @@ void ToolBox::ImplDrawButton(vcl::RenderContext& rRenderContext, const Rectangle } if (!bNativeOk) - vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, rRect, bIsWindow ? 3 : highlight, bChecked, true, bIsWindow, NULL, 2); + vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, rRect, bIsWindow ? 3 : highlight, bChecked, true, bIsWindow, nullptr, 2); } void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, sal_uInt16 nHighlight, bool bPaint, bool bLayout) @@ -2988,8 +2988,8 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, rRenderContext.SetFillColor(); ImplToolItem* pItem = &mpData->m_aItems[nPos]; - MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL; - OUString* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL; + MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : nullptr; + OUString* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : nullptr; if (!pItem->mbEnabled) nHighlight = 0; @@ -3057,7 +3057,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, pMgr->HideDragRect(); } else - pMgr = NULL; + pMgr = nullptr; // during configuration mode visible windows will be drawn in a special way if ( mbCustomizeMode && pItem->mbShowWindow ) @@ -3346,7 +3346,7 @@ void ToolBox::ImplFloatControl( bool bStart, FloatingWindow* pFloatWindow ) } else { - mpFloatWin = NULL; + mpFloatWin = nullptr; // if focus is still in this toolbox, then the floater was opened by keyboard // draw current item with highlight and keep old state @@ -4953,7 +4953,7 @@ void ToolBox::GetFocus() void ToolBox::LoseFocus() { - ImplChangeHighlight( NULL, true ); + ImplChangeHighlight( nullptr, true ); DockingWindow::LoseFocus(); } @@ -5069,7 +5069,7 @@ bool ToolBox::ImplOpenItem( vcl::KeyCode aKeyCode ) return bRet; UpdateCustomMenu(); - mpData->mnEventId = Application::PostUserEvent( LINK( this, ToolBox, ImplCallExecuteCustomMenu ), NULL, true ); + mpData->mnEventId = Application::PostUserEvent( LINK( this, ToolBox, ImplCallExecuteCustomMenu ), nullptr, true ); } else if( mnHighItemId && ImplGetItem( mnHighItemId ) && (ImplGetItem( mnHighItemId )->mnBits & ToolBoxItemBits::DROPDOWN) ) @@ -5186,13 +5186,13 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) break; case KEY_END: { - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); ImplChangeHighlightUpDn( false ); } break; case KEY_HOME: { - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); ImplChangeHighlightUpDn( true ); } break; @@ -5235,7 +5235,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) default: { sal_uInt16 aKeyGroup = aKeyCode.GetGroup(); - ImplToolItem *pItem = NULL; + ImplToolItem *pItem = nullptr; if( mnHighItemId ) pItem = ImplGetItem( mnHighItemId ); // #i13931# forward alphanum keyinput into embedded control @@ -5306,7 +5306,7 @@ sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem ) ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine ) { if( !nLine || nLine > mnCurLines ) - return NULL; + return nullptr; nLine--; @@ -5324,14 +5324,14 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine ) { ++it; if( it == mpData->m_aItems.end() || it->mbBreak ) - return NULL; // no valid items in this line + return nullptr; // no valid items in this line } return &(*it); } ++it; } - return (it == mpData->m_aItems.end()) ? NULL : &(*it); + return (it == mpData->m_aItems.end()) ? nullptr : &(*it); } sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList ) @@ -5362,7 +5362,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus ) mbChangingHighlight = true; - ImplToolItem* pOldItem = NULL; + ImplToolItem* pOldItem = nullptr; if ( mnHighItemId ) { @@ -5452,7 +5452,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle ) { // select last valid non-clipped item std::vector< ImplToolItem >::iterator it = mpData->m_aItems.end(); - ImplToolItem* pItem = NULL; + ImplToolItem* pItem = nullptr; while( it != mpData->m_aItems.begin() ) { --it; @@ -5498,11 +5498,11 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle ) // select the menu button if a clipped item would be selected if( (it != mpData->m_aItems.end() && &(*it) == ImplGetFirstClippedItem( this )) && IsMenuEnabled() ) { - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); InvalidateMenuButton(); } else - ImplChangeHighlight( (it != mpData->m_aItems.end()) ? &(*it) : NULL ); + ImplChangeHighlight( (it != mpData->m_aItems.end()) ? &(*it) : nullptr ); return true; } else @@ -5512,13 +5512,13 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle ) // docked toolbars have the menubutton as last item - if this button is enabled if( IsMenuEnabled() && !ImplIsFloatingMode() ) { - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); InvalidateMenuButton(); } else { std::vector< ImplToolItem >::iterator it = mpData->m_aItems.end(); - ImplToolItem* pItem = NULL; + ImplToolItem* pItem = nullptr; while( it != mpData->m_aItems.begin() ) { --it; @@ -5552,7 +5552,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle ) // highlight the menu button if it is the last item if( IsMenuEnabled() && !ImplIsFloatingMode() ) { - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); InvalidateMenuButton(); return true; } @@ -5570,7 +5570,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle ) // highlight the menu button if it is the last item if( IsMenuEnabled() && !ImplIsFloatingMode() ) { - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); InvalidateMenuButton(); return true; } @@ -5589,7 +5589,7 @@ bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle ) if( pToolItem->IsClipped() && IsMenuEnabled() ) { // select the menu button if a clipped item would be selected - ImplChangeHighlight( NULL ); + ImplChangeHighlight( nullptr ); InvalidateMenuButton(); } else if( i != nCount ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index f8dd351fab23..b2b6adf2e969 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -51,11 +51,11 @@ using namespace com::sun::star; #define TB_SEP_SIZE 8 ImplToolBoxPrivateData::ImplToolBoxPrivateData() : - m_pLayoutData( NULL ) + m_pLayoutData( nullptr ) { meButtonSize = TOOLBOX_BUTTONSIZE_DONTCARE; mpMenu = new PopupMenu(); - mnEventId = 0; + mnEventId = nullptr; maMenuType = TOOLBOX_MENUTYPE_NONE; maMenubuttonItem.maItemSize = Size( TB_MENUBUTTON_SIZE+TB_MENUBUTTON_OFFSET, TB_MENUBUTTON_SIZE+TB_MENUBUTTON_OFFSET ); @@ -85,8 +85,8 @@ void ImplToolItem::init(sal_uInt16 nItemId, ToolBoxItemBits nItemBits, bool bEmptyBtn) { mnId = nItemId; - mpWindow = NULL; - mpUserData = NULL; + mpWindow = nullptr; + mpUserData = nullptr; meType = ToolBoxItemType::BUTTON; mnBits = nItemBits; meState = TRISTATE_FALSE; @@ -744,7 +744,7 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, // push ToolBox item onto the list ImplToolItem aNewItem = rToolBox.mpData->m_aItems[nPos]; // reset state - aNewItem.mpWindow = NULL; + aNewItem.mpWindow = nullptr; aNewItem.mbShowWindow = false; mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aNewItem ); @@ -1110,7 +1110,7 @@ void* ToolBox::GetItemData( sal_uInt16 nItemId ) const if ( pItem ) return pItem->mpUserData; else - return NULL; + return nullptr; } void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) @@ -1315,7 +1315,7 @@ vcl::Window* ToolBox::GetItemWindow( sal_uInt16 nItemId ) const if ( pItem ) return pItem->mpWindow; else - return NULL; + return nullptr; } void ToolBox::StartSelection() @@ -1863,7 +1863,7 @@ IMPL_LINK_TYPED( ToolBox, ImplCustomMenuListener, VclMenuEvent&, rEvent, void ) IMPL_LINK_NOARG_TYPED(ToolBox, ImplCallExecuteCustomMenu, void*, void) { - mpData->mnEventId = 0; + mpData->mnEventId = nullptr; ImplExecuteCustomMenu(); } @@ -1939,7 +1939,7 @@ void ToolBox::ExecuteCustomMenu() // handle custom menu asynchronously // to avoid problems if the toolbox is closed during menu execute UpdateCustomMenu(); - mpData->mnEventId = Application::PostUserEvent( LINK( this, ToolBox, ImplCallExecuteCustomMenu ), NULL, true ); + mpData->mnEventId = Application::PostUserEvent( LINK( this, ToolBox, ImplCallExecuteCustomMenu ), nullptr, true ); } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index c7f4fd615fd9..48be7171a994 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -93,16 +93,16 @@ Window::Window( vcl::Window* pParent, WinBits nStyle ) { ImplInitWindowData( WINDOW_WINDOW ); - ImplInit( pParent, nStyle, NULL ); + ImplInit( pParent, nStyle, nullptr ); } Window::Window( vcl::Window* pParent, const ResId& rResId ) - : mpWindowImpl(NULL) + : mpWindowImpl(nullptr) { rResId.SetRT( RSC_WINDOW ); WinBits nStyle = ImplInitRes( rResId ); ImplInitWindowData( WINDOW_WINDOW ); - ImplInit( pParent, nStyle, NULL ); + ImplInit( pParent, nStyle, nullptr ); ImplLoadRes( rResId ); if ( !(nStyle & WB_HIDE) ) @@ -258,7 +258,7 @@ void Window::dispose() if ( pSVData->maWinData.mpCaptureWin == this ) ReleaseMouse(); if ( pSVData->maWinData.mpDefDialogParent == this ) - pSVData->maWinData.mpDefDialogParent = NULL; + pSVData->maWinData.mpDefDialogParent = nullptr; #if OSL_DEBUG_LEVEL > 0 if ( true ) // always perform these tests in debug builds @@ -282,7 +282,7 @@ void Window::dispose() Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed! } - if (mpWindowImpl->mpFrameData != 0) + if (mpWindowImpl->mpFrameData != nullptr) { pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap; while ( pTempWin ) @@ -345,7 +345,7 @@ void Window::dispose() } vcl::Window* pMyParent = GetParent(); - SystemWindow* pMySysWin = NULL; + SystemWindow* pMySysWin = nullptr; while ( pMyParent ) { @@ -369,7 +369,7 @@ void Window::dispose() if( mpWindowImpl->mbIsInTaskPaneList ) { vcl::Window* pMyParent = GetParent(); - SystemWindow* pMySysWin = NULL; + SystemWindow* pMySysWin = nullptr; while ( pMyParent ) { @@ -416,7 +416,7 @@ void Window::dispose() { EndExtTextInput( EndExtTextInputFlags::Complete ); if ( pSVData->maWinData.mpExtTextInputWin == this ) - pSVData->maWinData.mpExtTextInputWin = NULL; + pSVData->maWinData.mpExtTextInputWin = nullptr; } // check if the focus window is our child @@ -442,8 +442,8 @@ void Window::dispose() { if ( mpWindowImpl->mbFrame ) { - pSVData->maWinData.mpFocusWin = NULL; - pOverlapWindow->mpWindowImpl->mpLastFocusWindow = NULL; + pSVData->maWinData.mpFocusWin = nullptr; + pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr; } else { @@ -467,43 +467,43 @@ void Window::dispose() // If the focus was set back to 'this' set it to nothing if ( pSVData->maWinData.mpFocusWin == this ) { - pSVData->maWinData.mpFocusWin = NULL; - pOverlapWindow->mpWindowImpl->mpLastFocusWindow = NULL; + pSVData->maWinData.mpFocusWin = nullptr; + pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr; } } } - if ( pOverlapWindow != 0 && + if ( pOverlapWindow != nullptr && pOverlapWindow->mpWindowImpl->mpLastFocusWindow == this ) - pOverlapWindow->mpWindowImpl->mpLastFocusWindow = NULL; + pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr; // reset hint for DefModalDialogParent if( pSVData->maWinData.mpActiveApplicationFrame == this ) - pSVData->maWinData.mpActiveApplicationFrame = NULL; + pSVData->maWinData.mpActiveApplicationFrame = nullptr; // reset marked windows - if ( mpWindowImpl->mpFrameData != 0 ) + if ( mpWindowImpl->mpFrameData != nullptr ) { if ( mpWindowImpl->mpFrameData->mpFocusWin == this ) - mpWindowImpl->mpFrameData->mpFocusWin = NULL; + mpWindowImpl->mpFrameData->mpFocusWin = nullptr; if ( mpWindowImpl->mpFrameData->mpMouseMoveWin == this ) - mpWindowImpl->mpFrameData->mpMouseMoveWin = NULL; + mpWindowImpl->mpFrameData->mpMouseMoveWin = nullptr; if ( mpWindowImpl->mpFrameData->mpMouseDownWin == this ) - mpWindowImpl->mpFrameData->mpMouseDownWin = NULL; + mpWindowImpl->mpFrameData->mpMouseDownWin = nullptr; } // reset Deactivate-Window if ( pSVData->maWinData.mpLastDeacWin == this ) - pSVData->maWinData.mpLastDeacWin = NULL; + pSVData->maWinData.mpLastDeacWin = nullptr; if ( mpWindowImpl->mpFrameData ) { if ( mpWindowImpl->mpFrameData->mnFocusId ) Application::RemoveUserEvent( mpWindowImpl->mpFrameData->mnFocusId ); - mpWindowImpl->mpFrameData->mnFocusId = NULL; + mpWindowImpl->mpFrameData->mnFocusId = nullptr; if ( mpWindowImpl->mpFrameData->mnMouseMoveId ) Application::RemoveUserEvent( mpWindowImpl->mpFrameData->mnMouseMoveId ); - mpWindowImpl->mpFrameData->mnMouseMoveId = NULL; + mpWindowImpl->mpFrameData->mnMouseMoveId = nullptr; } // release SalGraphics @@ -568,15 +568,15 @@ void Window::dispose() assert (mpWindowImpl->mpFrameData->mpNextFrame.get() != pSysWin); pSysWin->mpWindowImpl->mpFrameData->mpNextFrame = mpWindowImpl->mpFrameData->mpNextFrame; } - mpWindowImpl->mpFrame->SetCallback( NULL, NULL ); + mpWindowImpl->mpFrame->SetCallback( nullptr, nullptr ); pSVData->mpDefInst->DestroyFrame( mpWindowImpl->mpFrame ); - assert (mpWindowImpl->mpFrameData->mnFocusId == NULL); - assert (mpWindowImpl->mpFrameData->mnMouseMoveId == NULL); + assert (mpWindowImpl->mpFrameData->mnFocusId == nullptr); + assert (mpWindowImpl->mpFrameData->mnMouseMoveId == nullptr); delete mpWindowImpl->mpFrameData; } // should be the last statements - delete mpWindowImpl; mpWindowImpl = NULL; + delete mpWindowImpl; mpWindowImpl = nullptr; OutputDevice::dispose(); } @@ -611,32 +611,32 @@ WindowImpl::WindowImpl( WindowType nType ) maZoom = Fraction( 1, 1 ); maWinRegion = vcl::Region(true); maWinClipRegion = vcl::Region(true); - mpWinData = NULL; // Extra Window Data, that we don't need for all windows - mpOverlapData = NULL; // Overlap Data - mpFrameData = NULL; // Frame Data - mpFrame = NULL; // Pointer to frame window - mpSysObj = NULL; - mpFrameWindow = NULL; // window to top level parent (same as frame window) - mpOverlapWindow = NULL; // first overlap parent - mpBorderWindow = NULL; // Border-Window - mpClientWindow = NULL; // Client-Window of a FrameWindow - mpParent = NULL; // parent (incl. BorderWindow) - mpRealParent = NULL; // real parent (excl. BorderWindow) - mpFirstChild = NULL; // first child window - mpLastChild = NULL; // last child window - mpFirstOverlap = NULL; // first overlap window (only set in overlap windows) - mpLastOverlap = NULL; // last overlap window (only set in overlap windows) - mpPrev = NULL; // prev window - mpNext = NULL; // next window - mpNextOverlap = NULL; // next overlap window of frame - mpLastFocusWindow = NULL; // window for focus restore - mpDlgCtrlDownWindow = NULL; // window for dialog control - mpFirstDel = NULL; // Dtor notification list - mpUserData = NULL; // user data - mpCursor = NULL; // cursor - mpControlFont = NULL; // font properties - mpVCLXWindow = NULL; - mpAccessibleInfos = NULL; + mpWinData = nullptr; // Extra Window Data, that we don't need for all windows + mpOverlapData = nullptr; // Overlap Data + mpFrameData = nullptr; // Frame Data + mpFrame = nullptr; // Pointer to frame window + mpSysObj = nullptr; + mpFrameWindow = nullptr; // window to top level parent (same as frame window) + mpOverlapWindow = nullptr; // first overlap parent + mpBorderWindow = nullptr; // Border-Window + mpClientWindow = nullptr; // Client-Window of a FrameWindow + mpParent = nullptr; // parent (incl. BorderWindow) + mpRealParent = nullptr; // real parent (excl. BorderWindow) + mpFirstChild = nullptr; // first child window + mpLastChild = nullptr; // last child window + mpFirstOverlap = nullptr; // first overlap window (only set in overlap windows) + mpLastOverlap = nullptr; // last overlap window (only set in overlap windows) + mpPrev = nullptr; // prev window + mpNext = nullptr; // next window + mpNextOverlap = nullptr; // next overlap window of frame + mpLastFocusWindow = nullptr; // window for focus restore + mpDlgCtrlDownWindow = nullptr; // window for dialog control + mpFirstDel = nullptr; // Dtor notification list + mpUserData = nullptr; // user data + mpCursor = nullptr; // cursor + mpControlFont = nullptr; // font properties + mpVCLXWindow = nullptr; + mpAccessibleInfos = nullptr; maControlForeground = Color( COL_TRANSPARENT ); // no foreground set maControlBackground = Color( COL_TRANSPARENT ); // no background set mnLeftBorder = 0; // left border @@ -650,8 +650,8 @@ WindowImpl::WindowImpl( WindowType nType ) mnX = 0; // X-Position to Parent mnY = 0; // Y-Position to Parent mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning - mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren - mpPaintRegion = NULL; // Paint-ClipRegion + mpChildClipRegion = nullptr; // Child-Clip-Region when ClipChildren + mpPaintRegion = nullptr; // Paint-ClipRegion mnStyle = 0; // style (init in ImplInitWindow) mnPrevStyle = 0; // prevstyle (set in SetStyle) mnExtendedStyle = 0; // extended style (init in ImplInitWindow) @@ -863,9 +863,9 @@ void Window::ReleaseGraphics( bool bRelease ) else pSVData->maGDIData.mpLastWinGraphics = mpPrevGraphics; - mpGraphics = NULL; - mpPrevGraphics = NULL; - mpNextGraphics = NULL; + mpGraphics = nullptr; + mpPrevGraphics = nullptr; + mpNextGraphics = nullptr; } static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI) @@ -933,9 +933,9 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p if ( mpWindowImpl->mbOverlapWin ) { mpWindowImpl->mpOverlapData = new ImplOverlapData; - mpWindowImpl->mpOverlapData->mpSaveBackDev = NULL; - mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL; - mpWindowImpl->mpOverlapData->mpNextBackWin = NULL; + mpWindowImpl->mpOverlapData->mpSaveBackDev = nullptr; + mpWindowImpl->mpOverlapData->mpSaveBackRgn = nullptr; + mpWindowImpl->mpOverlapData->mpNextBackWin = nullptr; mpWindowImpl->mpOverlapData->mnSaveBackSize = 0; mpWindowImpl->mpOverlapData->mbSaveBack = false; mpWindowImpl->mpOverlapData->mnTopLevel = 1; @@ -1001,7 +1001,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p break; } - SalFrame* pParentFrame = NULL; + SalFrame* pParentFrame = nullptr; if ( pParent ) pParentFrame = pParent->mpWindowImpl->mpFrame; SalFrame* pFrame; @@ -1029,16 +1029,16 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p assert (pSVData->maWinData.mpFirstFrame.get() != this); mpWindowImpl->mpFrameData->mpNextFrame = pSVData->maWinData.mpFirstFrame; pSVData->maWinData.mpFirstFrame = this; - mpWindowImpl->mpFrameData->mpFirstOverlap = NULL; - mpWindowImpl->mpFrameData->mpFocusWin = NULL; - mpWindowImpl->mpFrameData->mpMouseMoveWin = NULL; - mpWindowImpl->mpFrameData->mpMouseDownWin = NULL; - mpWindowImpl->mpFrameData->mpFirstBackWin = NULL; + mpWindowImpl->mpFrameData->mpFirstOverlap = nullptr; + mpWindowImpl->mpFrameData->mpFocusWin = nullptr; + mpWindowImpl->mpFrameData->mpMouseMoveWin = nullptr; + mpWindowImpl->mpFrameData->mpMouseDownWin = nullptr; + mpWindowImpl->mpFrameData->mpFirstBackWin = nullptr; mpWindowImpl->mpFrameData->mpFontCollection = pSVData->maGDIData.mpScreenFontList; mpWindowImpl->mpFrameData->mpFontCache = pSVData->maGDIData.mpScreenFontCache; mpWindowImpl->mpFrameData->mnAllSaveBackSize = 0; - mpWindowImpl->mpFrameData->mnFocusId = 0; - mpWindowImpl->mpFrameData->mnMouseMoveId = 0; + mpWindowImpl->mpFrameData->mnFocusId = nullptr; + mpWindowImpl->mpFrameData->mnMouseMoveId = nullptr; mpWindowImpl->mpFrameData->mnLastMouseX = -1; mpWindowImpl->mpFrameData->mnLastMouseY = -1; mpWindowImpl->mpFrameData->mnBeforeLastMouseX = -1; @@ -1259,7 +1259,7 @@ void Window::drawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rD GDIMetaFile* pOldMetaFile = mpMetaFile; bool bOldMap = mbMap; RasterOp eOldROP = GetRasterOp(); - mpMetaFile = NULL; + mpMetaFile = nullptr; mbMap = false; SetRasterOp( ROP_OVERPAINT ); @@ -1297,14 +1297,14 @@ ImplWinData* Window::ImplGetWinData() const static const char* pNoNWF = getenv( "SAL_NO_NWF" ); const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData = new ImplWinData; - mpWindowImpl->mpWinData->mpExtOldText = NULL; - mpWindowImpl->mpWinData->mpExtOldAttrAry = NULL; - mpWindowImpl->mpWinData->mpCursorRect = NULL; + mpWindowImpl->mpWinData->mpExtOldText = nullptr; + mpWindowImpl->mpWinData->mpExtOldAttrAry = nullptr; + mpWindowImpl->mpWinData->mpCursorRect = nullptr; mpWindowImpl->mpWinData->mnCursorExtWidth = 0; - mpWindowImpl->mpWinData->mpCompositionCharRects = NULL; + mpWindowImpl->mpWinData->mpCompositionCharRects = nullptr; mpWindowImpl->mpWinData->mnCompositionCharRects = 0; - mpWindowImpl->mpWinData->mpFocusRect = NULL; - mpWindowImpl->mpWinData->mpTrackRect = NULL; + mpWindowImpl->mpWinData->mpFocusRect = nullptr; + mpWindowImpl->mpWinData->mpTrackRect = nullptr; mpWindowImpl->mpWinData->mnTrackFlags = 0; mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) mpWindowImpl->mpWinData->mbMouseOver = false; @@ -1352,7 +1352,7 @@ SalGraphics* Window::ImplGetFrameGraphics() const OutputDevice* pFrameWinOutDev = mpWindowImpl->mpFrameWindow; if ( ! pFrameWinOutDev->AcquireGraphics() ) { - return NULL; + return nullptr; } } mpWindowImpl->mpFrameWindow->mpGraphics->ResetClipRegion(); @@ -1418,7 +1418,7 @@ void Window::ImplAddDel( ImplDelData* pDel ) // TODO: make "const" when incompat void Window::ImplRemoveDel( ImplDelData* pDel ) // TODO: make "const" when incompatibility ok { - pDel->mpWindow = NULL; // #112873# pDel is not associated with a Window anymore + pDel->mpWindow = nullptr; // #112873# pDel is not associated with a Window anymore if ( IsDisposed() ) return; @@ -1577,8 +1577,8 @@ void Window::ImplPosSizeWindow( long nX, long nY, long nOldOutOffY = mnOutOffY; long nOldOutWidth = mnOutWidth; long nOldOutHeight = mnOutHeight; - vcl::Region* pOverlapRegion = NULL; - vcl::Region* pOldRegion = NULL; + vcl::Region* pOverlapRegion = nullptr; + vcl::Region* pOldRegion = nullptr; if ( IsReallyVisible() ) { @@ -1829,7 +1829,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, else bInvalidate = true; if ( bInvalidate ) - ImplInvalidateFrameRegion( NULL, InvalidateFlags::Children ); + ImplInvalidateFrameRegion( nullptr, InvalidateFlags::Children ); } else { @@ -1888,8 +1888,8 @@ void Window::ImplNewInputContext() SalInputContext aNewContext; const vcl::Font& rFont = rInputContext.GetFont(); const OUString& rFontName = rFont.GetName(); - ImplFontEntry* pFontEntry = NULL; - aNewContext.mpFont = NULL; + ImplFontEntry* pFontEntry = nullptr; + aNewContext.mpFont = nullptr; if (!rFontName.isEmpty()) { OutputDevice *pFocusWinOutDev = pFocusWin->GetOutDev(); @@ -2153,8 +2153,8 @@ void Window::SetBorderStyle( WindowBorderStyle nBorderStyle ) // borders in case of NWF drawing. So they need a method to remove their border window VclPtr<vcl::Window> pBorderWin = mpWindowImpl->mpBorderWindow; // remove us as border window's client - pBorderWin->mpWindowImpl->mpClientWindow = NULL; - mpWindowImpl->mpBorderWindow = NULL; + pBorderWin->mpWindowImpl->mpClientWindow = nullptr; + mpWindowImpl->mpBorderWindow = nullptr; mpWindowImpl->mpRealParent = pBorderWin->mpWindowImpl->mpParent; // reparent us above the border window SetParent( pBorderWin->mpWindowImpl->mpParent ); @@ -2246,7 +2246,7 @@ void Window::SetCursorRect( const Rectangle* pRect, long nExtTextInputWidth ) else { delete pWinData->mpCursorRect; - pWinData->mpCursorRect = NULL; + pWinData->mpCursorRect = nullptr; } } else @@ -2278,7 +2278,7 @@ void Window::SetCompositionCharRect( const Rectangle* pRect, long nCompositionLe ImplWinData* pWinData = ImplGetWinData(); delete[] pWinData->mpCompositionCharRects; pWinData->mbVertical = bVertical; - pWinData->mpCompositionCharRects = NULL; + pWinData->mpCompositionCharRects = nullptr; pWinData->mnCompositionCharRects = nCompositionLength; if ( pRect && (nCompositionLength > 0) ) { @@ -2468,7 +2468,7 @@ void Window::Show(bool bVisible, ShowFlags nFlags) InvalidateFlags nInvalidateFlags = InvalidateFlags::Children; if( ! IsPaintTransparent() ) nInvalidateFlags |= InvalidateFlags::NoTransparent; - ImplInvalidate( NULL, nInvalidateFlags ); + ImplInvalidate( nullptr, nInvalidateFlags ); ImplGenerateMouseMove(); } } @@ -2555,7 +2555,7 @@ Size Window::GetSizePixel() const { ImplDelData aDogtag( const_cast<Window*>(this) ); mpWindowImpl->mpFrameData->maResizeIdle.Stop(); - mpWindowImpl->mpFrameData->maResizeIdle.GetIdleHdl().Call( NULL ); + mpWindowImpl->mpFrameData->maResizeIdle.GetIdleHdl().Call( nullptr ); if( aDogtag.IsDead() ) return Size(0,0); } @@ -3400,7 +3400,7 @@ Reference< XClipboard > Window::GetClipboard() return mpWindowImpl->mpFrameData->mxClipboard; } - return static_cast < XClipboard * > (0); + return static_cast < XClipboard * > (nullptr); } Reference< XClipboard > Window::GetPrimarySelection() @@ -3443,7 +3443,7 @@ Reference< XClipboard > Window::GetPrimarySelection() return mpWindowImpl->mpFrameData->mxSelection; } - return static_cast < XClipboard * > (0); + return static_cast < XClipboard * > (nullptr); } void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect ) @@ -3452,12 +3452,12 @@ void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& mpOutDevData->mpRecordLayout = pLayout; mpOutDevData->maRecordRect = rRect; Paint(*this, rRect); - mpOutDevData->mpRecordLayout = NULL; + mpOutDevData->mpRecordLayout = nullptr; } void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder, bool bDrawExtBorderOnly ) { - DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL ); + DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, nullptr, nullptr ); } void Window::DrawSelectionBackground( const Rectangle& rRect, @@ -3662,7 +3662,7 @@ void Window::ImplIncModalCount() { pParent = pParent->GetParent(); } - pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : NULL; + pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : nullptr; } } void Window::ImplDecModalCount() @@ -3676,7 +3676,7 @@ void Window::ImplDecModalCount() { pParent = pParent->GetParent(); } - pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : NULL; + pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow.get() : nullptr; } } @@ -3897,7 +3897,7 @@ void Window::ApplySettings(vcl::RenderContext& /*rRenderContext*/) const SystemEnvData* Window::GetSystemData() const { - return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : NULL; + return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : nullptr; } Any Window::GetSystemDataAny() const diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 5eaaf6f0eabe..d39810a8f44a 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -341,10 +341,10 @@ void Window::EndTracking( TrackingEventFlags nFlags ) if ( pSVData->maWinData.mpTrackTimer ) { delete pSVData->maWinData.mpTrackTimer; - pSVData->maWinData.mpTrackTimer = NULL; + pSVData->maWinData.mpTrackTimer = nullptr; } - pSVData->maWinData.mpTrackWin = NULL; + pSVData->maWinData.mpTrackWin = nullptr; pSVData->maWinData.mnTrackFlags = StartTrackingFlags::NONE; ReleaseMouse(); } @@ -396,11 +396,11 @@ void Window::EndAutoScroll() if ( pSVData->maWinData.mpAutoScrollWin.get() == this ) { - pSVData->maWinData.mpAutoScrollWin = NULL; + pSVData->maWinData.mpAutoScrollWin = nullptr; pSVData->maWinData.mnAutoScrollFlags = StartAutoScrollFlags::NONE; pSVData->maAppData.mpWheelWindow->ImplStop(); pSVData->maAppData.mpWheelWindow->doLazyDelete(); - pSVData->maAppData.mpWheelWindow = NULL; + pSVData->maAppData.mpWheelWindow = nullptr; } } @@ -512,7 +512,7 @@ void Window::SetControlFont() if (mpWindowImpl && mpWindowImpl->mpControlFont) { delete mpWindowImpl->mpControlFont; - mpWindowImpl->mpControlFont = NULL; + mpWindowImpl->mpControlFont = nullptr; CompatStateChanged(StateChangedType::ControlFont); } } @@ -762,7 +762,7 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd, nLines = pData->GetNotchDelta() * (long)nScrollLines; if ( nLines ) { - ImplHandleScroll( NULL, + ImplHandleScroll( nullptr, 0L, pData->IsHorz() ? pHScrl : pVScrl, nLines ); @@ -931,27 +931,27 @@ vcl::Window* Window::ImplGetWindow() ImplFrameData* Window::ImplGetFrameData() { - return mpWindowImpl ? mpWindowImpl->mpFrameData : NULL; + return mpWindowImpl ? mpWindowImpl->mpFrameData : nullptr; } SalFrame* Window::ImplGetFrame() const { - return mpWindowImpl ? mpWindowImpl->mpFrame : NULL; + return mpWindowImpl ? mpWindowImpl->mpFrame : nullptr; } vcl::Window* Window::ImplGetParent() const { - return mpWindowImpl ? mpWindowImpl->mpParent.get() : NULL; + return mpWindowImpl ? mpWindowImpl->mpParent.get() : nullptr; } vcl::Window* Window::ImplGetClientWindow() const { - return mpWindowImpl ? mpWindowImpl->mpClientWindow.get() : NULL; + return mpWindowImpl ? mpWindowImpl->mpClientWindow.get() : nullptr; } vcl::Window* Window::ImplGetBorderWindow() const { - return mpWindowImpl ? mpWindowImpl->mpBorderWindow.get() : NULL; + return mpWindowImpl ? mpWindowImpl->mpBorderWindow.get() : nullptr; } vcl::Window* Window::ImplGetFirstOverlapWindow() @@ -972,7 +972,7 @@ const vcl::Window* Window::ImplGetFirstOverlapWindow() const vcl::Window* Window::ImplGetFrameWindow() const { - return mpWindowImpl ? mpWindowImpl->mpFrameWindow.get() : NULL; + return mpWindowImpl ? mpWindowImpl->mpFrameWindow.get() : nullptr; } bool Window::IsDockingWindow() const @@ -1148,7 +1148,7 @@ const InputContext& Window::GetInputContext() const bool Window::IsControlFont() const { - return (mpWindowImpl->mpControlFont != 0); + return (mpWindowImpl->mpControlFont != nullptr); } Color Window::GetControlForeground() const @@ -1178,7 +1178,7 @@ bool Window::IsInPaint() const vcl::Window* Window::GetParent() const { - return mpWindowImpl ? mpWindowImpl->mpRealParent.get() : NULL; + return mpWindowImpl ? mpWindowImpl->mpRealParent.get() : nullptr; } bool Window::IsVisible() const @@ -1280,7 +1280,7 @@ bool Window::IsWait() const vcl::Cursor* Window::GetCursor() const { if (!mpWindowImpl) - return NULL; + return nullptr; return mpWindowImpl->mpCursor; } @@ -1338,7 +1338,7 @@ const Pointer& Window::GetPointer() const VCLXWindow* Window::GetWindowPeer() const { - return mpWindowImpl ? mpWindowImpl->mpVCLXWindow : NULL; + return mpWindowImpl ? mpWindowImpl->mpVCLXWindow : nullptr; } void Window::SetPosPixel( const Point& rNewPos ) @@ -2012,7 +2012,7 @@ void Window::remove_mnemonic_label(FixedText *pLabel) if (aFind == v.end()) return; v.erase(aFind); - pLabel->set_mnemonic_widget(NULL); + pLabel->set_mnemonic_widget(nullptr); } std::vector<VclPtr<FixedText> > Window::list_mnemonic_labels() const diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index ae7272735451..544ea6e95d3a 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -196,8 +196,8 @@ static void ImplSetMousePointer( vcl::Window* pChild ) pChild->ImplGetFrame()->SetPointer( pChild->ImplGetMousePointer() ); } -static bool ImplCallCommand( vcl::Window* pChild, CommandEventId nEvt, void* pData = NULL, - bool bMouse = false, Point* pPos = NULL ) +static bool ImplCallCommand( vcl::Window* pChild, CommandEventId nEvt, void* pData = nullptr, + bool bMouse = false, Point* pPos = nullptr ) { Point aPos; if ( pPos ) @@ -255,7 +255,7 @@ static void ContextMenuEventLink( void* pCEvent, void* ) if( ! pEv->aDelData.IsDead() ) { pEv->pWindow->ImplRemoveDel( &pEv->aDelData ); - ImplCallCommand( pEv->pWindow, CommandEventId::ContextMenu, NULL, true, &pEv->aChildPos ); + ImplCallCommand( pEv->pWindow, CommandEventId::ContextMenu, nullptr, true, &pEv->aChildPos ); } delete pEv; } @@ -266,7 +266,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool { ImplSVData* pSVData = ImplGetSVData(); Point aMousePos( nX, nY ); - vcl::Window* pChild(NULL); + vcl::Window* pChild(nullptr); bool bRet(false); sal_uInt16 nClicks(0); ImplFrameData* pWinFrameData = pWindow->ImplGetFrameData(); @@ -349,7 +349,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool else { if ( bMouseLeave ) - pChild = NULL; + pChild = nullptr; else pChild = pWindow->ImplFindWindow( aMousePos ); } @@ -488,7 +488,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool // create a uno mouse event out of the available data ::com::sun::star::awt::MouseEvent aMouseEvent( - static_cast < ::com::sun::star::uno::XInterface * > ( 0 ), + static_cast < ::com::sun::star::uno::XInterface * > ( nullptr ), #ifdef MACOSX nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3), #else @@ -544,13 +544,13 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool aNLeaveEvt.GetWindow()->ImplNotifyKeyMouseCommandEventListeners( aNLeaveEvt ); } - pWinFrameData->mpMouseMoveWin = NULL; + pWinFrameData->mpMouseMoveWin = nullptr; pWinFrameData->mbInMouseMove = false; if ( pChild ) { if ( aDelData2.IsDead() ) - pChild = NULL; + pChild = nullptr; else pChild->ImplRemoveDel( &aDelData2 ); } @@ -787,9 +787,9 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool { MouseMiddleButtonAction nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction(); if ( nMiddleAction == MouseMiddleButtonAction::AutoScroll ) - bRet = !ImplCallCommand( pChild, CommandEventId::StartAutoScroll, NULL, true, &aChildPos ); + bRet = !ImplCallCommand( pChild, CommandEventId::StartAutoScroll, nullptr, true, &aChildPos ); else if ( nMiddleAction == MouseMiddleButtonAction::PasteSelection ) - bRet = !ImplCallCommand( pChild, CommandEventId::PasteSelection, NULL, true, &aChildPos ); + bRet = !ImplCallCommand( pChild, CommandEventId::PasteSelection, nullptr, true, &aChildPos ); } else { @@ -818,7 +818,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool Application::PostUserEvent( Link<void*,void>( pEv, ContextMenuEventLink ) ); } else - bRet = ! ImplCallCommand( pChild, CommandEventId::ContextMenu, NULL, true, &aChildPos ); + bRet = ! ImplCallCommand( pChild, CommandEventId::ContextMenu, nullptr, true, &aChildPos ); } } } @@ -836,8 +836,8 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow ) pSVData->maAppData.mnLastInputTime = tools::Time::GetSystemTicks(); // #127104# workaround for destroyed windows - if( pWindow->ImplGetWindowImpl() == NULL ) - return 0; + if( pWindow->ImplGetWindowImpl() == nullptr ) + return nullptr; // find window - is every time the window which has currently the // focus or the last time the focus. @@ -853,7 +853,7 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow ) // no child - than no input if ( !pChild ) - return 0; + return nullptr; // We call also KeyInput if we haven't the focus, because on Unix // system this is often the case when a Lookup Choice Window has @@ -864,7 +864,7 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow ) // no keyinput to disabled windows if ( !pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalMode() ) - return 0; + return nullptr; return pChild; } @@ -1153,7 +1153,7 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow, sal_Int32 nCursorPos, sal_uInt16 nCursorFlags ) { ImplSVData* pSVData = ImplGetSVData(); - vcl::Window* pChild = NULL; + vcl::Window* pChild = nullptr; int nTries = 200; while( nTries-- ) @@ -1180,7 +1180,7 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow, if ( pWinData->mpExtOldAttrAry ) { delete [] pWinData->mpExtOldAttrAry; - pWinData->mpExtOldAttrAry = NULL; + pWinData->mpExtOldAttrAry = nullptr; } pSVData->maWinData.mpExtTextInputWin = pChild; ImplCallCommand( pChild, CommandEventId::StartExtTextInput ); @@ -1230,7 +1230,7 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow, if ( pWinData->mpExtOldAttrAry ) { delete [] pWinData->mpExtOldAttrAry; - pWinData->mpExtOldAttrAry = NULL; + pWinData->mpExtOldAttrAry = nullptr; } if ( pTextAttr ) { @@ -1249,17 +1249,17 @@ static bool ImplHandleEndExtTextInput( vcl::Window* /* pWindow */ ) if ( pChild ) { pChild->ImplGetWindowImpl()->mbExtTextInput = false; - pSVData->maWinData.mpExtTextInputWin = NULL; + pSVData->maWinData.mpExtTextInputWin = nullptr; ImplWinData* pWinData = pChild->ImplGetWinData(); if ( pWinData->mpExtOldText ) { delete pWinData->mpExtOldText; - pWinData->mpExtOldText = NULL; + pWinData->mpExtOldText = nullptr; } if ( pWinData->mpExtOldAttrAry ) { delete [] pWinData->mpExtOldAttrAry; - pWinData->mpExtOldAttrAry = NULL; + pWinData->mpExtOldAttrAry = nullptr; } nRet = !ImplCallCommand( pChild, CommandEventId::EndExtTextInput ); } @@ -1308,9 +1308,9 @@ static void ImplHandleExtTextInputPos( vcl::Window* pWindow, if ( !rInputWidth ) rInputWidth = rRect.GetWidth(); } - if (pVertical != 0) + if (pVertical != nullptr) *pVertical - = pChild != 0 && pChild->GetInputContext().GetFont().IsVertical(); + = pChild != nullptr && pChild->GetInputContext().GetFont().IsVertical(); } static bool ImplHandleInputContextChange( vcl::Window* pWindow, LanguageType eNewLang ) @@ -1395,7 +1395,7 @@ bool HandleGestureEventBase::Setup() vcl::Window* HandleGestureEventBase::FindTarget() { // first check any floating window ( eg. drop down listboxes) - vcl::Window *pMouseWindow = NULL; + vcl::Window *pMouseWindow = nullptr; if (m_pSVData->maWinData.mpFirstFloat && !m_pSVData->maWinData.mpCaptureWin && !m_pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( m_pWindow ) ) @@ -1433,7 +1433,7 @@ vcl::Window* HandleGestureEventBase::FindTarget() vcl::Window *HandleGestureEventBase::Dispatch(vcl::Window* pMouseWindow) { - vcl::Window *pDispatchedTo = NULL; + vcl::Window *pDispatchedTo = nullptr; if (acceptableWheelScrollTarget(pMouseWindow) && pMouseWindow->IsEnabled()) { @@ -1529,7 +1529,7 @@ bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt) pPreviousWindow = Dispatch(pMouseWindow); - return pPreviousWindow != NULL; + return pPreviousWindow != nullptr; } class HandleGestureEvent : public HandleGestureEventBase @@ -1549,7 +1549,7 @@ bool HandleGestureEvent::HandleEvent() vcl::Window *pTarget = FindTarget(); - bool bHandled = Dispatch(pTarget) != NULL; + bool bHandled = Dispatch(pTarget) != nullptr; return bHandled; } @@ -1771,7 +1771,7 @@ static void ImplActivateFloatingWindows( vcl::Window* pWindow, bool bActive ) IMPL_LINK_NOARG_TYPED(vcl::Window, ImplAsyncFocusHdl, void*, void) { - ImplGetWindowImpl()->mpFrameData->mnFocusId = 0; + ImplGetWindowImpl()->mpFrameData->mnFocusId = nullptr; // If the status has been preserved, because we got back the focus // in the meantime, we do nothing @@ -1829,7 +1829,7 @@ IMPL_LINK_NOARG_TYPED(vcl::Window, ImplAsyncFocusHdl, void*, void) // FocusWindow umsetzen vcl::Window* pOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow(); pOverlapWindow->ImplGetWindowImpl()->mpLastFocusWindow = pFocusWin; - pSVData->maWinData.mpFocusWin = NULL; + pSVData->maWinData.mpFocusWin = nullptr; if ( pFocusWin->ImplGetWindowImpl()->mpCursor ) pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide( true ); @@ -1864,7 +1864,7 @@ IMPL_LINK_NOARG_TYPED(vcl::Window, ImplAsyncFocusHdl, void*, void) NotifyEvent aNEvt( MouseNotifyEvent::LOSEFOCUS, pFocusWin ); if ( !ImplCallPreNotify( aNEvt ) ) pFocusWin->CompatLoseFocus(); - pFocusWin->ImplCallDeactivateListeners( NULL ); + pFocusWin->ImplCallDeactivateListeners( nullptr ); } // XXX } @@ -1885,7 +1885,7 @@ static void ImplHandleGetFocus( vcl::Window* pWindow ) if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId ) { pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus; - pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), NULL, true); + pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), nullptr, true); vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin; if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor ) pFocusWin->ImplGetWindowImpl()->mpCursor->ImplShow(); @@ -1914,7 +1914,7 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow ) if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId ) { pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus; - pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), NULL, true ); + pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), nullptr, true ); } vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin; @@ -2379,7 +2379,7 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalFrame* /*pFrame*/, // #119709# for some unknown reason it is possible to receive events (in this case key events) // although the corresponding VCL window must have been destroyed already // at least ImplGetWindowImpl() was NULL in these cases, so check this here - if( pWindow->ImplGetWindowImpl() == NULL ) + if( pWindow->ImplGetWindowImpl() == nullptr ) return false; switch ( nEvent ) diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 3881f15009d5..78dc4bb06e0d 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -50,7 +50,7 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentDat nFrameStyle |= BORDERWINDOW_STYLE_APP; VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, pSystemParentData, nStyle, nFrameStyle ); - Window::ImplInit( pBorderWin, nStyle & (WB_3DLOOK | WB_CLIPCHILDREN | WB_DIALOGCONTROL | WB_SYSTEMFLOATWIN), NULL ); + Window::ImplInit( pBorderWin, nStyle & (WB_3DLOOK | WB_CLIPCHILDREN | WB_DIALOGCONTROL | WB_SYSTEMFLOATWIN), nullptr ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpWindowImpl->mpBorderWindow = pBorderWin; @@ -108,7 +108,7 @@ WorkWindow::WorkWindow( SystemParentData* pParent ) : { ImplInitWorkWindowData(); mbSysChild = true; - ImplInit( NULL, 0, pParent ); + ImplInit( nullptr, 0, pParent ); } WorkWindow::~WorkWindow() @@ -121,7 +121,7 @@ void WorkWindow::dispose() ImplSVData* pSVData = ImplGetSVData(); if ( pSVData->maWinData.mpAppWin == this ) { - pSVData->maWinData.mpAppWin = NULL; + pSVData->maWinData.mpAppWin = nullptr; Application::Quit(); } SystemWindow::dispose(); |