summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/accessibility.cxx7
-rw-r--r--vcl/source/window/builder.cxx7
-rw-r--r--vcl/source/window/menu.cxx4
-rw-r--r--vcl/source/window/syswin.cxx2
-rw-r--r--vcl/source/window/taskpanelist.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx4
-rw-r--r--vcl/source/window/window2.cxx3
7 files changed, 14 insertions, 19 deletions
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 55c9d3071d36..ab2ac82bee85 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -605,11 +605,10 @@ vcl::Window* Window::GetAccessibleRelationLabeledBy() const
if (!aMnemonicLabels.empty())
{
//if we have multiple labels, then prefer the first that is visible
- for (auto aI = aMnemonicLabels.begin(), aEnd = aMnemonicLabels.end(); aI != aEnd; ++aI)
+ for (auto const & rCandidate : aMnemonicLabels)
{
- vcl::Window *pCandidate = *aI;
- if (pCandidate->IsVisible())
- return pCandidate;
+ if (rCandidate->IsVisible())
+ return rCandidate;
}
return aMnemonicLabels[0];
}
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index a3d626964eaf..32bd8b8e9d29 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -472,11 +472,8 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr
}
//fdo#67378 merge the label into the disclosure button
- for (auto aI = m_pParserState->m_aExpanderWidgets.begin(),
- aEnd = m_pParserState->m_aExpanderWidgets.end(); aI != aEnd; ++aI)
+ for (VclPtr<VclExpander> const & pOne : m_pParserState->m_aExpanderWidgets)
{
- VclExpander *pOne = *aI;
-
vcl::Window *pChild = pOne->get_child();
vcl::Window* pLabel = pOne->GetWindow(GetWindowType::LastChild);
if (pLabel && pLabel != pChild && pLabel->GetType() == WINDOW_FIXEDTEXT)
@@ -2111,7 +2108,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader)
{
if (name.equals("object") || name.equals("placeholder"))
{
- pCurrentChild = handleObject(pParent, reader);
+ pCurrentChild = handleObject(pParent, reader).get();
bool bObjectInserted = pCurrentChild && pParent != pCurrentChild;
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index e88914c2d361..ba1e6fd92e3e 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2478,9 +2478,9 @@ void MenuBar::SetDisplayable( bool bDisplayable )
}
}
-vcl::Window* MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu)
+VclPtr<vcl::Window> MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu)
{
- MenuBarWindow *pMenuBarWindow = dynamic_cast<MenuBarWindow*>(pWindow);
+ VclPtr<MenuBarWindow> pMenuBarWindow = dynamic_cast<MenuBarWindow*>(pWindow);
if (!pMenuBarWindow)
{
pWindow = pMenuBarWindow = VclPtr<MenuBarWindow>::Create( pParent );
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index f31dff20abf4..95c1652be2af 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -925,7 +925,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar)
{
MenuBar* pOldMenuBar = mpMenuBar;
vcl::Window* pOldWindow = nullptr;
- vcl::Window* pNewWindow=nullptr;
+ VclPtr<vcl::Window> pNewWindow;
mpMenuBar = pMenuBar;
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index b5d1738de2d8..0cd840779a5a 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -176,7 +176,7 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent)
auto p = mTaskPanes.begin();
while( p != mTaskPanes.end() )
{
- vcl::Window *pWin = *p;
+ vcl::Window *pWin = p->get();
if( pWin->HasChildPathFocus( true ) )
{
// Ctrl-F6 goes directly to the document
@@ -252,7 +252,7 @@ vcl::Window* TaskPaneList::FindNextSplitter( vcl::Window *pWindow )
p = mTaskPanes.begin();
if( (*p)->ImplIsSplitter() && (*p)->IsReallyVisible() && !(*p)->IsDialog() && (*p)->GetParent()->HasChildPathFocus() )
{
- pWindow = *p;
+ pWindow = (*p).get();
break;
}
if( !pWindow ) // increment after test, otherwise first element is skipped
@@ -291,7 +291,7 @@ vcl::Window* TaskPaneList::FindNextFloat( vcl::Window *pWindow, bool bForward )
if( (*p)->IsReallyVisible() && !(*p)->ImplIsSplitter() &&
( (*p)->GetType() != WINDOW_MENUBARWINDOW || static_cast<MenuBarWindow*>(p->get())->CanGetFocus() ) )
{
- pWindow = *p;
+ pWindow = (*p).get();
break;
}
if( !pWindow ) // increment after test, otherwise first element is skipped
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 14579fafe3dc..a8be10972635 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -5590,7 +5590,7 @@ void ToolBox::ImplShowFocus()
ImplToolItem* pItem = ImplGetItem( mnHighItemId );
if( pItem->mpWindow && !pItem->mpWindow->IsDisposed() )
{
- vcl::Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
+ vcl::Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow.get() : pItem->mpWindow.get();
pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = true;
pWin->Invalidate();
}
@@ -5604,7 +5604,7 @@ void ToolBox::ImplHideFocus()
ImplToolItem* pItem = ImplGetItem( mnHighItemId );
if( pItem && pItem->mpWindow )
{
- vcl::Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow;
+ vcl::Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow.get() : pItem->mpWindow.get();
pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = false;
pWin->Invalidate();
}
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 24d1fa79eae2..095452df7b17 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1390,9 +1390,8 @@ void Window::queue_resize(StateChangedType eReason)
if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VCL_SIZE_GROUP_NONE)
{
std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
- for (auto aI = rWindows.begin(), aEnd = rWindows.end(); aI != aEnd; ++aI)
+ for (VclPtr<vcl::Window> const & pOther : rWindows)
{
- vcl::Window *pOther = *aI;
if (pOther == this)
continue;
queue_ungrouped_resize(pOther);