summaryrefslogtreecommitdiff
path: root/vcl/inc/textlayout.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-18 17:17:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-18 20:43:15 +0000
commitdb9ef688edd86b31606e0dd6df6a77732faca49b (patch)
tree30efa88441bbbeebd84e538d1e809ebd141cab44 /vcl/inc/textlayout.hxx
parentb93856a666cc0af099c934669a3d593116456b84 (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>
Diffstat (limited to 'vcl/inc/textlayout.hxx')
-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;