diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-07-19 19:07:34 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-07-23 06:05:02 +0200 |
commit | 21013c4662a9ab32d293de263c54ebeceb66828c (patch) | |
tree | 58997e69220f3c4d1a452dbf68f03dd1a02d77c8 /vcl/inc | |
parent | 620fdb3a93e07eb87884ce3de8e436d840dc79e1 (diff) |
tdf#156377: Improve cursor traversal in UI widgets
Re-implement GetCaretPositions() on top of GetCharWidths() so it can
benefit from our code that handles cursor insertion in middle of
ligatures.
Change-Id: I2b76b3b0125f2454f78cb6779d88617dc29386fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154660
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/sallayout.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index f96eb7df2977..dbe3000f8a83 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -64,7 +64,7 @@ public: sal_Int32 GetTextBreak(double nMaxWidth, double nCharExtra, int nFactor) const override; double GetTextWidth() const final override; double FillDXArray(std::vector<double>* pDXArray, const OUString& rStr) const override; - void GetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) const override; + void GetCaretPositions(std::vector<double>& rCaretPositions, const OUString& rStr) const override; bool GetNextGlyph(const GlyphItem** pGlyph, basegfx::B2DPoint& rPos, int& nStart, const LogicalFontInstance** ppGlyphFont = nullptr) const override; bool GetOutline(basegfx::B2DPolyPolygonVector&) const override; @@ -120,7 +120,7 @@ public: double GetTextWidth() const final override; double FillDXArray(std::vector<double>* pDXArray, const OUString& rStr) const final override; sal_Int32 GetTextBreak(double nMaxWidth, double nCharExtra, int nFactor) const final override; - void GetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) const final override; + void GetCaretPositions(std::vector<double>& rCaretPositions, const OUString& rStr) const override; // used by display layers LogicalFontInstance& GetFont() const |