diff options
author | AmosAidoo <aidooamos20@gmail.com> | 2023-11-21 03:17:12 +0100 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2023-11-22 21:49:57 +0100 |
commit | 94d2d9a59450fa4bccd0a3a450d8b273271d2ff2 (patch) | |
tree | 508a44eb5902077a4c2ccb2582cc7f93f912f946 /include/svx | |
parent | 847001ffbbcaf6d2657a5cce18f6c58151efbd2c (diff) |
tdf#154088 Merge code snippets for character retrieval and string construction
The DrawChars_Impl method has been unified since the duplicates were identical
and only differed in how they retrieved characters from a separate source. Each
class now has its own implentation of GetCharFromIndex as a solution.
Change-Id: Ic2d10a46a91ea8dee2c94b620e6745bf77ae9eab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159773
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/charmap.hxx | 3 | ||||
-rw-r--r-- | include/svx/searchcharmap.hxx | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index 8057eae3c1bd..1c440b6ee2c1 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -66,6 +66,7 @@ public: void SelectCharacter( sal_UCS4 cNew ); virtual sal_UCS4 GetSelectCharacter() const; + virtual sal_UCS4 GetCharFromIndex(int index) const; void createContextMenu(const Point& rPosition); void SetDoubleClickHdl( const Link<SvxShowCharSet*,void>& rLink ) { aDoubleClkHdl = rLink; } @@ -148,7 +149,7 @@ protected: protected: virtual bool KeyInput(const KeyEvent&) override; - virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2); + void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2); void InitSettings(vcl::RenderContext& rRenderContext); // abstraction layers are: Unicode<->MapIndex<->Pixel Point MapIndexToPixel( int) const; diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx index d05f3ea82728..b07d58a4c8ad 100644 --- a/include/svx/searchcharmap.hxx +++ b/include/svx/searchcharmap.hxx @@ -44,6 +44,7 @@ public: void SelectCharacter( const Subset* sub); virtual sal_UCS4 GetSelectCharacter() const override; + virtual sal_UCS4 GetCharFromIndex(int index) const override; virtual svx::SvxShowCharSetItem* ImplGetItem( int _nPos ) override; virtual int LastInView() const override; @@ -59,7 +60,6 @@ private: //to uniquely identify each appended element std::unordered_map<sal_Int32, sal_UCS4> m_aItemList; private: - virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; virtual bool KeyInput(const KeyEvent& rKEvt) override; }; |