diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-07-19 10:15:26 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-07-23 06:04:39 +0200 |
commit | d9ae579c8a2f5d305fd6419069ed00cf4d8bb015 (patch) | |
tree | 6794c14de677ecd39867f362265ae9ced0a0aacd /editeng | |
parent | 11b513da7f850307cf8371f155e87e9c52f2dd87 (diff) |
editeng: Use GetTextArray() instead of GetCaretPositions()
One way of getting text widths should be enough.
Change-Id: I21e24c3f69a116e5210685d76268936219aae279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154639
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/accessibility/AccessibleStringWrap.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx b/editeng/source/accessibility/AccessibleStringWrap.cxx index 519a1feb7b83..5461aad9f4c8 100644 --- a/editeng/source/accessibility/AccessibleStringWrap.cxx +++ b/editeng/source/accessibility/AccessibleStringWrap.cxx @@ -57,12 +57,11 @@ void AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, tools::Rectangl } else { - sal_Int32 aXArray[2]; - mrDev.GetCaretPositions( maText, aXArray, nIndex, 1 ); + KernArray aDXArray; + mrDev.GetTextArray(maText, &aDXArray, nIndex, 1); rRect.SetLeft( 0 ); rRect.SetTop( 0 ); - rRect.SetSize( Size(mrDev.GetTextHeight(), std::abs(aXArray[0] - aXArray[1])) ); - rRect.Move( std::min(aXArray[0], aXArray[1]), 0 ); + rRect.SetSize(Size(mrDev.GetTextHeight(), aDXArray[0])); } if( mrFont.IsVertical() ) |