summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-18 15:35:47 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-01-19 15:20:41 +0000
commitb05f85a3fd247baea4f2dd975f2178e04ea5dd6a (patch)
tree025f35dd38753c5e14112231657956339829004d /vcl/inc
parentbaf09e572b377f569b00e61c10710787b1c151ba (diff)
Resolves: tdf#98593 buttons in writer show different text at different zooms
The DrawControlText always renders with a reference device positions but we pass in a rectangle which is derived a different way. So, add a GetControlTextRect which operates on the same reference device as DrawControlText so the rectangles match The rectangle is mapped from pixels to logic and back from logic to pixel, so add an argument to store the logic size from GetControlTextRect and re-use it without conversion on the cases where we pass back the original rectangle zooming in/out on the button in writer is now stable wrt text shown at all zoom levels Change-Id: Ic581eca67d0ff265e2753ab8b6c40e8fca7e6ae4 Reviewed-on: https://gerrit.libreoffice.org/33277 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit db9ef688edd86b31606e0dd6df6a77732faca49b) change DrawControlText to return new rect rather than change old one Change-Id: Id5c80ff263e429d4239a844db216e87a656edb2e (cherry picked from commit bc6479e92b56df742dd7339d337ffc78d2f9e4a1) Ref...DeviceTextLayout::GetTextArray is only called by Ref...DeviceTextLayout so set it as private to de-confuse this a little Change-Id: Idde7f78a767227cc2d52e417b6c39d12e1339745 (cherry picked from commit 3d002fdb8738d9bbc9b04c0270510e349bd58149) Reviewed-on: https://gerrit.libreoffice.org/33281 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/textlayout.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index 97350c0aa405..a8a4124daafb 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -92,7 +92,10 @@ namespace vcl
Rectangle DrawText( const Rectangle& _rRect,
const OUString& _rText, DrawTextFlags _nStyle,
- MetricVector* _pVector, OUString* _pDisplayText );
+ MetricVector* _pVector, OUString* _pDisplayText, const Size* i_pDeviceSize );
+
+ Rectangle GetTextRect( const Rectangle& _rRect,
+ const OUString& _rText, DrawTextFlags _nStyle, Size* o_pDeviceSize );
private:
ControlTextRenderer( const ControlTextRenderer& ) = delete;