Skip to content

Commit

Permalink
Avoid unnecessary, wrong downcast
Browse files Browse the repository at this point in the history
...as reported by -fsanitize=vptr when doing "Format - Paragraph... - Area -
Color" in Writer:

> cui/source/tabpages/tpcolor.cxx:65:19: runtime error: downcast of address 0x6030009782b0 which does not point to an object of type 'XOutdevItemPool'
> 0x6030009782b0: note: object is of type 'SwAttrPool'
>  20 01 80 1c  50 e8 e9 85 4d 7f 00 00  e0 28 48 86 4d 7f 00 00  c0 d7 11 00 30 61 00 00  80 29 54 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SwAttrPool'
>     #0 0x7f4b047cfd3a in SvxColorTabPage::SvxColorTabPage(vcl::Window*, SfxItemSet const&) cui/source/tabpages/tpcolor.cxx:65:19
>     #1 0x7f4b0480ec04 in VclPtr<SvxColorTabPage> VclPtr<SvxColorTabPage>::Create<vcl::Window*&, SfxItemSet const&>(vcl::Window*&, SfxItemSet const&) include/vcl/vclptr.hxx:138:46
>     #2 0x7f4b047f8567 in SvxColorTabPage::Create(vcl::Window*, SfxItemSet const*) cui/source/tabpages/tpcolor.cxx:326:12
>     #3 0x7f4b0472132a in CreateFillStyleTabPage(unsigned short, vcl::Window*, SfxItemSet const&) cui/source/tabpages/tparea.cxx:319:42
>     #4 0x7f4b0471ef8b in SvxAreaTabPage::SelectFillTypeHdl_Impl(Button*) cui/source/tabpages/tparea.cxx:330:41
>     #5 0x7f4b047114b3 in SvxAreaTabPage::LinkStubSelectFillTypeHdl_Impl(void*, Button*) cui/source/tabpages/tparea.cxx:323:1
>     #6 0x7f4df3eac737 in Link<Button*, void>::Call(Button*) const include/tools/link.hxx:84:45
>     #7 0x7f4df3e93bb6 in Button::Click()::$_0::operator()() const vcl/source/control/button.cxx:127:85

Change-Id: I6259b100c535fa81b9f7452db84c22d5b10acb1e
  • Loading branch information
stbergmann committed Nov 14, 2016
1 parent 8c12f81 commit b6ce0cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cui/source/tabpages/tpcolor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
, pPos( nullptr )
, aXFStyleItem( drawing::FillStyle_SOLID )
, aXFillColorItem( OUString(), Color( COL_BLACK ) )
, aXFillAttr( static_cast<XOutdevItemPool*>( rInAttrs.GetPool() ))
, aXFillAttr( rInAttrs.GetPool() )
, rXFSet( aXFillAttr.GetItemSet() )
, eCM( ColorModel::RGB )
, m_context(comphelper::getProcessComponentContext())
Expand Down

0 comments on commit b6ce0cd

Please sign in to comment.