trigger MapMode ScaleX change in writer

Mark Hung marklh9 at
Wed May 25 00:39:00 UTC 2022


I'm refactoring SwFntObj::DrawText() in sw/soucre/core/txtnode/fntcache.c,
and writing unit test for it. I'm looking for a way to trigger the
situation that
GetMapMode().GetScaleX()  doesn't equal to 1. To be more specific, to
trigger the case bStretch = true for following code snippet.

         const Fraction aTmp( 1, 1 );
         bool bStretch = rInf.GetWidth() && (rInf.GetLen() >
TextFrameIndex(1)) && bPrt
                         && ( aTmp !=
rInf.GetOut().GetMapMode().GetScaleX() );

The bStretch decides whether to draw stretched text.

Does anyone know how to do trigger the situation? It seems that none of the
sw unit tests trigger that, scaling in the character property, or zoom in,
print preview cause the value to change.

Mark Hung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list