summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-25 16:23:17 +0200
committerAndras Timar <andras.timar@collabora.com>2017-02-18 00:45:43 +0100
commit390e951b78288e082361c386ff5c6618d917c333 (patch)
treede4f00b80ba6183f2678d6582d98d65a94b93aa7 /svx
parent599719217423e8468cc54cc74e7850b8a867120b (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> (cherry picked from commit e6ffb539ee232ea0c679928ff456c1cf97429f63)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/srchdlg.cxx2
-rw-r--r--svx/source/fmcomp/fmgridif.cxx2
-rw-r--r--svx/source/form/datanavi.cxx2
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx2
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx2
-rw-r--r--svx/source/tbxctrls/layctrl.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx2
8 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 4cea9248a627..6eade1edbddd 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1593,7 +1593,7 @@ void SvxSearchDialog::Remember_Impl( const OUString &rStr, bool _bSearch )
return;
std::vector<OUString>* pArr = _bSearch ? &aSearchStrings : &aReplaceStrings;
- ComboBox* pListBox = _bSearch ? m_pSearchLB : m_pReplaceLB;
+ ComboBox* pListBox = _bSearch ? m_pSearchLB.get() : m_pReplaceLB.get();
// ignore identical strings
for (std::vector<OUString>::const_iterator i = pArr->begin(); i != pArr->end(); ++i)
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 936b4f6fe924..57f359ea8001 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -479,7 +479,7 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >&
{
VCLXWindow* pParent = VCLXWindow::GetImplementation(rParentPeer);
if (pParent)
- pParentWin = pParent->GetWindow();
+ pParentWin = pParent->GetWindow().get();
}
FmXGridPeer* pPeer = imp_CreatePeer(pParentWin);
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 3ce5917d35e5..7b921cad373b 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1814,7 +1814,7 @@ namespace svxform
XFormsPage* DataNavigatorWindow::GetCurrentPage( sal_uInt16& rCurId )
{
rCurId = m_pTabCtrl->GetCurPageId();
- XFormsPage* pPage = nullptr;
+ VclPtr<XFormsPage> pPage;
OString sName(m_pTabCtrl->GetPageName(rCurId));
if (sName == "submissions")
{
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 1110e8fc71f2..fc617478d000 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -491,7 +491,7 @@ namespace svx
if ( _rxControl.is() )
xControlPeer = _rxControl->getPeer();
if ( xControlPeer.is() )
- pWindow = VCLUnoHelper::GetWindow( xControlPeer );
+ pWindow = VCLUnoHelper::GetWindow( xControlPeer ).get();
}
catch( const Exception& )
{
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index f1773ea316ca..0a946926297c 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -3513,7 +3513,7 @@ vcl::Window* FormController::getDialogParentWindow()
{
Reference< XControl > xContainerControl( getContainer(), UNO_QUERY_THROW );
Reference< XWindowPeer > xContainerPeer( xContainerControl->getPeer(), UNO_QUERY_THROW );
- pParentWindow = VCLUnoHelper::GetWindow( xContainerPeer );
+ pParentWindow = VCLUnoHelper::GetWindow( xContainerPeer ).get();
}
catch( const Exception& )
{
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 0467ab6495dd..46897dfc1b9f 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -93,7 +93,7 @@ void CandidateMgr::PaintTransparentChildren(vcl::Window & rWindow, Rectangle con
for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
{
- pCandidate = *aI;
+ pCandidate = aI->get();
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
continue;
//rhbz#1007697 this can cause the window itself to be
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index b0e707f58cfe..c6acafaffbe0 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -731,7 +731,7 @@ SvxColumnsToolBoxControl::~SvxColumnsToolBoxControl()
VclPtr<SfxPopupWindow> SvxColumnsToolBoxControl::CreatePopupWindow()
{
- ColumnsWindow* pWin = nullptr;
+ VclPtr<ColumnsWindow> pWin;
if(bEnabled)
{
pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame );
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index 1ec7821a5c92..832cc0dd8c0f 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -131,7 +131,7 @@ sal_Int16 SAL_CALL ChineseTranslation_UnoDialog::execute() throw(uno::RuntimeExc
{
VCLXWindow* pImplementation = VCLXWindow::GetImplementation(m_xParentWindow);
if (pImplementation)
- pParent = pImplementation->GetWindow();
+ pParent = pImplementation->GetWindow().get();
}
uno::Reference< XComponent > xComp( this );
m_pDialog = VclPtr<ChineseTranslationDialog>::Create( pParent );