[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Sat Jan 24 04:15:25 PST 2015
sw/source/core/text/itrform2.cxx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
New commits:
commit f06615ef3326f49f86472853555b7df857f50ed7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 23 20:59:46 2015 +0000
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
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 593dd18..6cdbf9c 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -967,8 +967,7 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf )
CalcAscent( rInf, pPor );
const SwFont* pTmpFnt = rInf.GetFont();
- sal_Int32 nExpect = std::min( sal_Int32( reinterpret_cast<vcl::Font const *>(pTmpFnt)->GetSize().Height() ),
- //TODO: is that reinterpret_cast sound?
+ sal_Int32 nExpect = std::min( sal_Int32( pTmpFnt->GetHeight() ),
sal_Int32( pPor->GetAscent() ) ) / 8;
if ( !nExpect )
nExpect = 1;
More information about the Libreoffice-commits
mailing list