[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 2 commits - include/svtools svtools/source sw/source
Michael Meeks
michael.meeks at collabora.com
Tue Apr 14 13:02:39 PDT 2015
include/svtools/treelistbox.hxx | 6 +++---
svtools/source/contnr/treelistbox.cxx | 5 ++---
sw/source/uibase/misc/redlndlg.cxx | 3 ++-
3 files changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 0a285fad16cac7a6cf06e186c5a844079593e8f7
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Tue Apr 14 20:59:26 2015 +0100
Fix redline dialog lifecycle foo.
Change-Id: Idf34e57243b7baba7789fd3d83a2bd7726d3c147
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index c2f616c..6d69bfa 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -149,7 +149,7 @@ void SwModelessRedlineAcceptDlg::dispose()
SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer *pBuilder,
vcl::Window *pContentArea, bool bAutoFmt) :
pParentDlg (pParent),
- aTabPagesCTRL (new SvxAcceptChgCtr(pContentArea, pBuilder)),
+ aTabPagesCTRL (VclPtr<SvxAcceptChgCtr>::Create(pContentArea, pBuilder)),
aPopup (SW_RES(MN_REDLINE_POPUP)),
sInserted (SW_RES(STR_REDLINE_INSERTED)),
sDeleted (SW_RES(STR_REDLINE_DELETED)),
@@ -221,6 +221,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
SwRedlineAcceptDlg::~SwRedlineAcceptDlg()
{
+ aTabPagesCTRL.disposeAndClear();
}
void SwRedlineAcceptDlg::Init(sal_uInt16 nStart)
commit 35237cb348d22c60dbde4b3378f7eab5546631d3
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Tue Apr 14 20:59:00 2015 +0100
Help SvTreeListBox survive post dispose.
Change-Id: I7a4aca5918b2bdadc32810a84afb84477e97fd2e
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index ed81c37..56ffb51 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -349,11 +349,11 @@ public:
sal_uLong GetEntryCount() const
{
- return pModel->GetEntryCount();
+ return pModel ? pModel->GetEntryCount() : 0;
}
SvTreeListEntry* First() const
{
- return pModel->First();
+ return pModel ? pModel->First() : NULL;
}
SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth = 0 ) const
{
@@ -365,7 +365,7 @@ public:
}
SvTreeListEntry* Last() const
{
- return pModel->Last();
+ return pModel ? pModel->Last() : NULL;
}
SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const;
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index b4861c3..bc5e933e 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -2221,10 +2221,9 @@ void SvTreeListBox::LoseFocus()
{
//If there is no item in the tree, delete visual focus.
if( !First())
- {
Invalidate();
- }
- pImp->LoseFocus();
+ if( pImp )
+ pImp->LoseFocus();
Control::LoseFocus();
}
More information about the Libreoffice-commits
mailing list