diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-02-13 18:57:46 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-02-14 11:21:51 +0100 |
commit | e2372907c991833a8bbe13f84460783d8d8fdfdb (patch) | |
tree | af8e58ad8ffb73a4352de578496f006839763ad2 /sw/source/uibase | |
parent | 532576461654eaf43120d2f693172c07a41275fa (diff) |
Make SwFormatFrameSize derive from SvxSizeItem
...as seen in UBSan builds when, on an image in Writer, selecting context menu's
"Properties..." to open the "Image" dialog, there'll be failure
> cui/source/tabpages/grfpage.cxx:206:21: runtime error: downcast of address 0x00001293f5c0 which does not point to an object of type 'const SvxSizeItem'
> 0x00001293f5c0: note: object is of type 'SwFormatFrameSize'
00 00 00 00 68 d5 ea aa 8f 7f 00 00 01 00 00 00 43 27 00 00 81 2e 00 00 00 00 00 00 c5 41 00 00
> ^~~~~~~~~~~~~~~~~~~~~~~
> vptr for 'SwFormatFrameSize'
> #0 0x7f8f1ec29a34 in SvxGrfCropPage::Reset(SfxItemSet const*) cui/source/tabpages/grfpage.cxx:206:21
> #1 0x7f9036000d98 in SfxTabDialog::ActivatePageHdl(TabControl*) sfx2/source/dialog/tabdlg.cxx:1115:19
Moved the {Get,Set}{Width,Height} convenience functions down from
SwFormatFrameSize to SvxSizeItem. And "reverted" the SvxSizeItem
{Has,Scale}Metrics overrides in SwFormatFrameSize, "just in case." Renamed
SvxSizeItem::aSize to m_aSize to avoid GCC -Werror=shadow in
SwFormatFrameSize::dumpAsXml (sw/source/core/layout/atrfrm.cxx), which has a
local variable named aSize.
Change-Id: I9a2e0b19f21c1468ecba87a5bdafa40c8c424ae4
Reviewed-on: https://gerrit.libreoffice.org/49678
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 2434e42a80d5..145a17cb8088 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -300,7 +300,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) } SwFormatFrameSize aSize( pFormat->GetFrameSize() ); - long nOldWidth = static_cast<long>(aSize.GetWidth()); + long nOldWidth = aSize.GetWidth(); if(aSize.GetWidthPercent()) { @@ -317,7 +317,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) { SwFormatCol aCol(pFormat->GetCol()); - ::ResizeFrameCols(aCol, nOldWidth, static_cast<long>(aSize.GetWidth()), nDeltaX ); + ::ResizeFrameCols(aCol, nOldWidth, aSize.GetWidth(), nDeltaX ); aSet.Put(aCol); } |