summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/templdlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-12 12:46:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-12 13:03:59 +0000
commite79c381f4d4906d5ba6c02bb84b7a40475a5399b (patch)
treec21d4e441c5979b976c4893fb2d7d2a983607727 /sfx2/source/dialog/templdlg.cxx
parentcc7b1ee2f3a06c6f0a52f6c6de06b2dd21e1150c (diff)
coverity#441010 Dereference after null check
Change-Id: I3f35f2ed2154f75303d561efecd1638b73872b61
Diffstat (limited to 'sfx2/source/dialog/templdlg.cxx')
-rw-r--r--sfx2/source/dialog/templdlg.cxx52
1 files changed, 3 insertions, 49 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 5af668194f45..3a0cf048db92 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -504,50 +504,8 @@ void SfxTemplatePanelControl::StateChanged( StateChangedType nStateChange )
DockingWindow::StateChanged( nStateChange );
}
-
-//=========================================================================
-typedef std::vector<OUString> ExpandedEntries_t;
-
-/* [Description]
-
- TreeListBox class for displaying the hierarchical view of the templates
-*/
-
-class StyleTreeListBox_Impl : public DropListBox_Impl
-{
-private:
- SvTreeListEntry* pCurEntry;
- Link aDoubleClickLink;
- Link aDropLink;
- OUString aParent;
- OUString aStyle;
-
-protected:
- virtual void Command( const CommandEvent& rMEvt );
- virtual bool Notify( NotifyEvent& rNEvt );
- virtual sal_Bool DoubleClickHdl();
- virtual bool ExpandingHdl();
- virtual void ExpandedHdl();
- virtual sal_Bool NotifyMoving(SvTreeListEntry* pTarget,
- SvTreeListEntry* pEntry,
- SvTreeListEntry*& rpNewParent,
- sal_uIntPtr& rNewChildPos);
-public:
- StyleTreeListBox_Impl( SfxCommonTemplateDialog_Impl* pParent, WinBits nWinStyle = 0);
-
- void SetDoubleClickHdl(const Link &rLink) { aDoubleClickLink = rLink; }
- void SetDropHdl(const Link &rLink) { aDropLink = rLink; }
- using SvTreeListBox::GetParent;
- const OUString& GetParent() const { return aParent; }
- const OUString& GetStyle() const { return aStyle; }
- void MakeExpanded_Impl(ExpandedEntries_t& rEntries) const;
-
- virtual PopupMenu* CreateContextMenu( void );
-};
-
//-------------------------------------------------------------------------
-
void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries_t& rEntries) const
{
SvTreeListEntry *pEntry;
@@ -1261,9 +1219,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
}
MakeTree_Impl(aArr);
ExpandedEntries_t aEntries;
- if(pTreeBox)
- ((const StyleTreeListBox_Impl *)pTreeBox)->
- MakeExpanded_Impl( aEntries);
+ pTreeBox->MakeExpanded_Impl(aEntries);
pTreeBox->SetUpdateMode( sal_False );
pTreeBox->Clear();
const sal_uInt16 nCount = aArr.size();
@@ -1850,11 +1806,9 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
pTreeBox->SetNodeDefaultImages();
pTreeBox->SetSelectHdl(
LINK(this, SfxCommonTemplateDialog_Impl, FmtSelectHdl));
- ((StyleTreeListBox_Impl*)pTreeBox)->
- SetDoubleClickHdl(
+ pTreeBox->SetDoubleClickHdl(
LINK(this, SfxCommonTemplateDialog_Impl, ApplyHdl));
- ((StyleTreeListBox_Impl*)pTreeBox)->
- SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl));
+ pTreeBox->SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl));
pTreeBox->SetOptimalImageIndent();
FillTreeBox();
SelectStyle(aSelectEntry);