diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-11-11 18:10:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-11-14 17:45:17 +0100 |
commit | 2f0885bb364ba795cdda01a145dd88f1318b99b6 (patch) | |
tree | b35029180faab91f63e68a7d7b7608fa9c4cf858 | |
parent | 4622e44812656954cd3cd96671d99db8db6d6fb6 (diff) |
Avoid -fsanitize=null
...when doing "Format - Page..." in Writer (and eFillType is TRANSPARENT):
> cui/source/tabpages/tparea.cxx:331:33: runtime error: reference binding to null pointer of type 'SfxTabPage'
> #0 0x7f9f053e936f in SvxAreaTabPage::SelectFillTypeHdl_Impl(Button*) cui/source/tabpages/tparea.cxx:331:9
> #1 0x7f9f053e548c in SvxAreaTabPage::ActivatePage(SfxItemSet const&) cui/source/tabpages/tparea.cxx:157:13
> #2 0x7fa21be01676 in SfxTabDialog::ActivatePageHdl(TabControl*) sfx2/source/dialog/tabdlg.cxx:1126:19
> #3 0x7fa21bdf70e3 in SfxTabDialog::LinkStubActivatePageHdl(void*, TabControl*) sfx2/source/dialog/tabdlg.cxx:1035:1
> #4 0x7fa1f5efff37 in Link<TabControl*, void>::Call(TabControl*) const include/tools/link.hxx:84:45
> #5 0x7fa1f5ebbcaa in TabControl::ActivatePage() vcl/source/control/tabctrl.cxx:1601:19
Change-Id: I279f507038ab4bae1be4f02b6537e6d1aab76348
-rw-r--r-- | cui/source/inc/cuitabarea.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 86 |
2 files changed, 44 insertions, 44 deletions
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index f58e6cd18843..dd941f844e28 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -302,7 +302,7 @@ public: void SetPos( sal_uInt16 nInPos ) { m_nPos = nInPos; } void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; } virtual void PageCreated(const SfxAllItemSet& aSet) override; - void CreatePage(sal_Int32 nId, SfxTabPage& pTab); + void CreatePage(sal_Int32 nId, SfxTabPage* pTab); void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } void SetGrdChgd( ChangeType* pIn ) { m_pnGradientListState = pIn; } void SetHtchChgd( ChangeType* pIn ) { m_pnHatchingListState = pIn; } diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index b89ebae07c60..fdbcfc91030f 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -334,7 +334,7 @@ IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, Button*, pButton, void) maBox.SelectButton(static_cast<PushButton*>(pButton)); FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos()); m_pFillTabPage.disposeAndReset( CreateFillStyleTabPage(eFillType, m_pFillTab, m_rXFSet) ); - CreatePage( eFillType , *m_pFillTabPage); + CreatePage( eFillType , m_pFillTabPage); } } @@ -362,63 +362,63 @@ void SvxAreaTabPage::PointChanged( vcl::Window* , RectPoint ) { } -void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage& pTab ) +void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab ) { if(nId == SOLID ) { - static_cast<SvxColorTabPage&>(pTab).SetColorList( m_pColorList ); - static_cast<SvxColorTabPage&>(pTab).SetPos( &m_nPos ); - static_cast<SvxColorTabPage&>(pTab).SetColorChgd( m_pnColorListState ); - static_cast<SvxColorTabPage&>(pTab).Construct(); - static_cast<SvxColorTabPage&>(pTab).ActivatePage( m_rXFSet ); - static_cast<SvxColorTabPage&>(pTab).Reset(&m_rXFSet); - static_cast<SvxColorTabPage&>(pTab).Show(); + static_cast<SvxColorTabPage*>(pTab)->SetColorList( m_pColorList ); + static_cast<SvxColorTabPage*>(pTab)->SetPos( &m_nPos ); + static_cast<SvxColorTabPage*>(pTab)->SetColorChgd( m_pnColorListState ); + static_cast<SvxColorTabPage*>(pTab)->Construct(); + static_cast<SvxColorTabPage*>(pTab)->ActivatePage( m_rXFSet ); + static_cast<SvxColorTabPage*>(pTab)->Reset(&m_rXFSet); + static_cast<SvxColorTabPage*>(pTab)->Show(); } else if(nId == GRADIENT) { - static_cast<SvxGradientTabPage&>(pTab).SetColorList( m_pColorList ); - static_cast<SvxGradientTabPage&>(pTab).SetGradientList( m_pGradientList ); - static_cast<SvxGradientTabPage&>(pTab).SetPos( &m_nPos ); - static_cast<SvxGradientTabPage&>(pTab).SetGrdChgd( m_pnGradientListState ); - static_cast<SvxGradientTabPage&>(pTab).SetColorChgd( m_pnColorListState ); - static_cast<SvxGradientTabPage&>(pTab).Construct(); - static_cast<SvxGradientTabPage&>(pTab).ActivatePage( m_rXFSet ); - static_cast<SvxGradientTabPage&>(pTab).Reset(&m_rXFSet); - static_cast<SvxGradientTabPage&>(pTab).Show(); + static_cast<SvxGradientTabPage*>(pTab)->SetColorList( m_pColorList ); + static_cast<SvxGradientTabPage*>(pTab)->SetGradientList( m_pGradientList ); + static_cast<SvxGradientTabPage*>(pTab)->SetPos( &m_nPos ); + static_cast<SvxGradientTabPage*>(pTab)->SetGrdChgd( m_pnGradientListState ); + static_cast<SvxGradientTabPage*>(pTab)->SetColorChgd( m_pnColorListState ); + static_cast<SvxGradientTabPage*>(pTab)->Construct(); + static_cast<SvxGradientTabPage*>(pTab)->ActivatePage( m_rXFSet ); + static_cast<SvxGradientTabPage*>(pTab)->Reset(&m_rXFSet); + static_cast<SvxGradientTabPage*>(pTab)->Show(); } else if(nId == HATCH) { - static_cast<SvxHatchTabPage&>(pTab).SetColorList( m_pColorList ); - static_cast<SvxHatchTabPage&>(pTab).SetHatchingList( m_pHatchingList ); - static_cast<SvxHatchTabPage&>(pTab).SetPos(&m_nPos); - static_cast<SvxHatchTabPage&>(pTab).SetHtchChgd( m_pnHatchingListState ); - static_cast<SvxHatchTabPage&>(pTab).SetColorChgd( m_pnColorListState ); - static_cast<SvxHatchTabPage&>(pTab).Construct(); - static_cast<SvxHatchTabPage&>(pTab).ActivatePage( m_rXFSet ); - static_cast<SvxHatchTabPage&>(pTab).Reset(&m_rXFSet); - static_cast<SvxHatchTabPage&>(pTab).Show(); + static_cast<SvxHatchTabPage*>(pTab)->SetColorList( m_pColorList ); + static_cast<SvxHatchTabPage*>(pTab)->SetHatchingList( m_pHatchingList ); + static_cast<SvxHatchTabPage*>(pTab)->SetPos(&m_nPos); + static_cast<SvxHatchTabPage*>(pTab)->SetHtchChgd( m_pnHatchingListState ); + static_cast<SvxHatchTabPage*>(pTab)->SetColorChgd( m_pnColorListState ); + static_cast<SvxHatchTabPage*>(pTab)->Construct(); + static_cast<SvxHatchTabPage*>(pTab)->ActivatePage( m_rXFSet ); + static_cast<SvxHatchTabPage*>(pTab)->Reset(&m_rXFSet); + static_cast<SvxHatchTabPage*>(pTab)->Show(); } else if(nId == BITMAP) { - static_cast<SvxBitmapTabPage&>(pTab).SetBitmapList( m_pBitmapList ); - static_cast<SvxBitmapTabPage&>(pTab).SetPos( &m_nPos ); - static_cast<SvxBitmapTabPage&>(pTab).SetBmpChgd( m_pnBitmapListState ); - static_cast<SvxBitmapTabPage&>(pTab).Construct(); - static_cast<SvxBitmapTabPage&>(pTab).ActivatePage( m_rXFSet ); - static_cast<SvxBitmapTabPage&>(pTab).Reset(&m_rXFSet); - static_cast<SvxBitmapTabPage&>(pTab).Show(); + static_cast<SvxBitmapTabPage*>(pTab)->SetBitmapList( m_pBitmapList ); + static_cast<SvxBitmapTabPage*>(pTab)->SetPos( &m_nPos ); + static_cast<SvxBitmapTabPage*>(pTab)->SetBmpChgd( m_pnBitmapListState ); + static_cast<SvxBitmapTabPage*>(pTab)->Construct(); + static_cast<SvxBitmapTabPage*>(pTab)->ActivatePage( m_rXFSet ); + static_cast<SvxBitmapTabPage*>(pTab)->Reset(&m_rXFSet); + static_cast<SvxBitmapTabPage*>(pTab)->Show(); } else if(nId == PATTERN) { - static_cast<SvxPatternTabPage&>(pTab).SetColorList( m_pColorList ); - static_cast<SvxPatternTabPage&>(pTab).SetPatternList( m_pPatternList ); - static_cast<SvxPatternTabPage&>(pTab).SetPos( &m_nPos ); - static_cast<SvxPatternTabPage&>(pTab).SetPtrnChgd( m_pnPatternListState ); - static_cast<SvxPatternTabPage&>(pTab).SetColorChgd( m_pnColorListState ); - static_cast<SvxPatternTabPage&>(pTab).Construct(); - static_cast<SvxPatternTabPage&>(pTab).ActivatePage( m_rXFSet ); - static_cast<SvxPatternTabPage&>(pTab).Reset( &m_rXFSet ); - static_cast<SvxPatternTabPage&>(pTab).Show(); + static_cast<SvxPatternTabPage*>(pTab)->SetColorList( m_pColorList ); + static_cast<SvxPatternTabPage*>(pTab)->SetPatternList( m_pPatternList ); + static_cast<SvxPatternTabPage*>(pTab)->SetPos( &m_nPos ); + static_cast<SvxPatternTabPage*>(pTab)->SetPtrnChgd( m_pnPatternListState ); + static_cast<SvxPatternTabPage*>(pTab)->SetColorChgd( m_pnColorListState ); + static_cast<SvxPatternTabPage*>(pTab)->Construct(); + static_cast<SvxPatternTabPage*>(pTab)->ActivatePage( m_rXFSet ); + static_cast<SvxPatternTabPage*>(pTab)->Reset( &m_rXFSet ); + static_cast<SvxPatternTabPage*>(pTab)->Show(); } } |