Kaydet (Commit) 8aa37ca1 authored tarafından Caolán McNamara's avatar Caolán McNamara

ubsan SwTableBoxFormat is really SwTableLineFormat

 /sw/source/core/doc/tblrwcl.cxx:1937:29: runtime error: downcast of address 0x2b328cff7da8 which does not point to an object of type ´SwTableBoxFormat´
 0x2b328cff7da8: note: object is of type ´SwTableLineFormat´
  00 00 00 00  f0 ea dd 46 32 2b 00 00  b8 80 ff 8c 32 2b 00 00  e8 43 f5 00 90 61 00 00  58 79 65 80
               ^~~~~~~~~~~~~~~~~~~~~~~
               vptr for ´SwTableLineFormat´
     #0 0x2b323c386daf in lcl_CopyLineToDoc(FndLine_ const&, CpyPara*) /sw/source/core/doc/tblrwcl.cxx:1937:29

Change-Id: I16f7b61a3561de3e599818aba538c72c631511ca
Reviewed-on: https://gerrit.libreoffice.org/48282Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ff8826d4
......@@ -79,12 +79,12 @@ using namespace com::sun::star::uno;
struct CpyTabFrame
{
union {
SwTableBoxFormat *pFrameFormat; // for CopyCol
SwTwips nSize; // for DelCol
SwFrameFormat* pFrameFormat; // for CopyCol
SwTwips nSize; // for DelCol
} Value;
SwTableBoxFormat *pNewFrameFormat;
explicit CpyTabFrame( SwTableBoxFormat* pAktFrameFormat ) : pNewFrameFormat( nullptr )
explicit CpyTabFrame(SwFrameFormat* pAktFrameFormat) : pNewFrameFormat( nullptr )
{ Value.pFrameFormat = pAktFrameFormat; }
bool operator==( const CpyTabFrame& rCpyTabFrame ) const
......@@ -279,7 +279,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
{
// Look up the Frame Format in the Frame Format Array
SwTableBox* pBox = rFndBox.GetBox();
CpyTabFrame aFindFrame( static_cast<SwTableBoxFormat*>(pBox->GetFrameFormat()) );
CpyTabFrame aFindFrame(pBox->GetFrameFormat());
sal_uInt16 nFndPos;
if( pCpyPara->nCpyCnt )
......@@ -379,7 +379,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara)
? rBoxItem.GetTop()
: rBoxItem.GetRight() )
{
aFindFrame.Value.pFrameFormat = static_cast<SwTableBoxFormat*>(pBox->GetFrameFormat());
aFindFrame.Value.pFrameFormat = pBox->GetFrameFormat();
SvxBoxItem aNew( rBoxItem );
if( 8 > pCpyPara->nDelBorderFlag )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment