vcl/inc/textlayout.hxx         |   16 ++++++----------
 vcl/source/text/textlayout.cxx |    5 ++++-
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit d62abd20dbfcc90cbea7b0b66fd4a3f3660f7ce9
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jan 16 09:54:26 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jan 16 12:52:02 2024 +0100

    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.gran...@collabora.co.uk>

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;

Reply via email to