diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-16 09:54:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-16 12:52:02 +0100 |
commit | d62abd20dbfcc90cbea7b0b66fd4a3f3660f7ce9 (patch) | |
tree | aa03e099c268e6e1ad82ca99e3af8aec4523dfd6 | |
parent | b804dc3c61ab595d3971e1b1a0e9a09ea498a7e4 (diff) |
ITextLayout is unnecessary
everything inherits through TextLayoutCommon
Change-Id: Ibf91804a62fc8f4a803682c7d4b9eaaba7468512
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162156
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/inc/textlayout.hxx | 16 | ||||
-rw-r--r-- | vcl/source/text/textlayout.cxx | 5 |
2 files changed, 10 insertions, 11 deletions
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx index 7f81fcbeb10a..22349a8d2e9a 100644 --- a/vcl/inc/textlayout.hxx +++ b/vcl/inc/textlayout.hxx @@ -33,7 +33,7 @@ class Control; namespace vcl { - class SAL_NO_VTABLE ITextLayout + class VCL_DLLPUBLIC TextLayoutCommon { public: virtual tools::Long GetTextWidth( const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const = 0; @@ -43,13 +43,6 @@ namespace vcl virtual sal_Int32 GetTextBreak( const OUString& _rText, tools::Long _nMaxTextWidth, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const = 0; virtual bool DecomposeTextRectAction() const = 0; - protected: - ~ITextLayout() COVERITY_NOEXCEPT_FALSE {} - }; - - class VCL_DLLPUBLIC TextLayoutCommon : public ITextLayout - { - public: OUString GetEllipsisString(OUString const& rOrigStr, tools::Long nMaxWidth, DrawTextFlags nStyle); std::tuple<sal_Int32, sal_Int32> BreakLine(const tools::Long nWidth, OUString const& rStr, @@ -66,13 +59,16 @@ namespace vcl tools::Long nWidth, OUString const& rStr, DrawTextFlags nStyle); + protected: + ~TextLayoutCommon() COVERITY_NOEXCEPT_FALSE; + private: OUString GetCenterEllipsisString(OUString const& rOrigStr, sal_Int32 nIndex, tools::Long nMaxWidth); OUString GetEndEllipsisString(OUString const& rOrigStr, sal_Int32 nIndex, tools::Long nMaxWidth, bool bClipText); OUString GetNewsEllipsisString(OUString const& rOrigStr, tools::Long nMaxWidth, DrawTextFlags nStyle); }; - /** is an implementation of the ITextLayout interface which simply delegates its calls to the respective + /** is an implementation of TextLayoutCommon which simply delegates its calls to the respective methods of an OutputDevice instance, without any inbetween magic. */ class VCL_DLLPUBLIC DefaultTextLayout final : public TextLayoutCommon @@ -84,7 +80,7 @@ namespace vcl } virtual ~DefaultTextLayout(); - // ITextLayout overridables + // TextLayoutCommon overridables virtual tools::Long GetTextWidth( const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const override; diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index 8797689963c0..d0c76c852f63 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -62,6 +62,9 @@ void ImplMultiTextLineInfo::Clear() namespace vcl { + TextLayoutCommon::~TextLayoutCommon() COVERITY_NOEXCEPT_FALSE + {} + OUString TextLayoutCommon::GetCenterEllipsisString(OUString const& rOrigStr, sal_Int32 nIndex, tools::Long nMaxWidth) { OUStringBuffer aTmpStr(rOrigStr); @@ -502,7 +505,7 @@ namespace vcl ReferenceDeviceTextLayout( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice ); virtual ~ReferenceDeviceTextLayout(); - // ITextLayout + // TextLayoutCommon virtual tools::Long GetTextWidth( const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen ) const override; virtual void DrawText( const Point& _rStartPoint, const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength, std::vector< tools::Rectangle >* _pVector, OUString* _pDisplayText ) override; virtual tools::Long GetTextArray( const OUString& _rText, KernArray* _pDXAry, sal_Int32 _nStartIndex, sal_Int32 _nLength, bool bCaret = false ) const override; |