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

This cast is complete rubbish of course

It just works because the first element in SwFont is an array of three
SvxFont's which inherit from vcl::Font so this ends up as calling
GetSize().Height() on the first (i.e. LATIN) font.

To keep this exactly the same we could call GetFnt(SW_LATIN) to get the first
font that we have been querying all these years, but lets try instead to take
the presumably intended "nActual" font here.

Change-Id: I1d0f404d4620c2b3d38b35e4de48b8c9f6b011a6
üst 0fc8df6d
...@@ -967,8 +967,7 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf ) ...@@ -967,8 +967,7 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf )
CalcAscent( rInf, pPor ); CalcAscent( rInf, pPor );
const SwFont* pTmpFnt = rInf.GetFont(); const SwFont* pTmpFnt = rInf.GetFont();
sal_Int32 nExpect = std::min( sal_Int32( reinterpret_cast<vcl::Font const *>(pTmpFnt)->GetSize().Height() ), sal_Int32 nExpect = std::min( sal_Int32( pTmpFnt->GetHeight() ),
//TODO: is that reinterpret_cast sound?
sal_Int32( pPor->GetAscent() ) ) / 8; sal_Int32( pPor->GetAscent() ) ) / 8;
if ( !nExpect ) if ( !nExpect )
nExpect = 1; nExpect = 1;
......
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