diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-25 16:23:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-29 06:45:42 +0000 |
commit | e6ffb539ee232ea0c679928ff456c1cf97429f63 (patch) | |
tree | e4b71a9bd49edba1a0f1c95f60f6da81433d1983 /vcl/source/window/builder.cxx | |
parent | bbc7ed9c379019f31dc7ac234cf83ea151601465 (diff) |
loplugin:vclwidgets check for assigning from VclPt<T> to T*
Inspired by a recent bug report where we were assigning the result
of VclPtr<T>::Create to a raw pointer.
As a consequence, we also need to change various methods that were
returning newly created Window subclasses via raw pointer, to
instead return those via VclPtr
Change-Id: I8118e0195a5b2b4780e646cfb0e151692e54ae2b
Reviewed-on: https://gerrit.libreoffice.org/31318
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/builder.cxx')
-rw-r--r-- | vcl/source/window/builder.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
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; |