drawinglayer/source/primitive2d/textlayoutdevice.cxx  |   23 ------------------
 editeng/source/accessibility/AccessibleStringWrap.cxx |    7 ++---
 include/drawinglayer/primitive2d/textlayoutdevice.hxx |    3 --
 3 files changed, 3 insertions(+), 30 deletions(-)

New commits:
commit 60c8a8062cc4632b400e5498310d4ade84b8fe34
Author:     Khaled Hosny <kha...@libreoffice.org>
AuthorDate: Wed Jul 19 13:36:19 2023 +0300
Commit:     خالد حسني <kha...@libreoffice.org>
CommitDate: Sun Jul 23 06:04:47 2023 +0200

    drawinglayer: Drop recently unused TextLayouterDevice::getCaretPositions()
    
    Change-Id: I07255d45bc03a5f86a22d7f392c14053eec7f6ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154648
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@libreoffice.org>

diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx 
b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 2b0356518285..1c551ce01363 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -317,29 +317,6 @@ std::vector<double> TextLayouterDevice::getTextArray(const 
OUString& rText, sal_
     return aRetval;
 }
 
-std::vector<double> TextLayouterDevice::getCaretPositions(const OUString& 
rText, sal_uInt32 nIndex,
-                                                          sal_uInt32 nLength) 
const
-{
-    std::vector<double> aRetval;
-    sal_uInt32 nTextLength(nLength);
-    const sal_uInt32 nStringLength(rText.getLength());
-
-    if (nTextLength + nIndex > nStringLength)
-    {
-        nTextLength = nStringLength - nIndex;
-    }
-
-    if (nTextLength)
-    {
-        aRetval.reserve(2 * nTextLength);
-        std::vector<sal_Int32> aArray(2 * nTextLength);
-        mrDevice.GetCaretPositions(rText, aArray.data(), nIndex, nTextLength);
-        aRetval.assign(aArray.begin(), aArray.end());
-    }
-
-    return aRetval;
-}
-
 // helper methods for vcl font handling
 
 vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& 
rFontAttribute,
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx 
b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
index dfb5ba6c5c37..6f98b50a4f06 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -98,9 +98,6 @@ public:
 
     ::std::vector<double> getTextArray(const OUString& rText, sal_uInt32 
nIndex, sal_uInt32 nLength,
                                        bool bCaret = false) const;
-
-    ::std::vector<double> getCaretPositions(const OUString& rText, sal_uInt32 
nIndex,
-                                            sal_uInt32 nLength) const;
 };
 
 // helper methods for vcl font handling
commit d9ae579c8a2f5d305fd6419069ed00cf4d8bb015
Author:     Khaled Hosny <kha...@libreoffice.org>
AuthorDate: Wed Jul 19 10:15:26 2023 +0300
Commit:     خالد حسني <kha...@libreoffice.org>
CommitDate: Sun Jul 23 06:04:39 2023 +0200

    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: خالد حسني <kha...@libreoffice.org>

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() )

Reply via email to