[Libreoffice-commits] core.git: vcl/inc vcl/source

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 20 05:42:16 UTC 2021


 vcl/inc/PhysicalFontFace.hxx           |    2 --
 vcl/source/font/PhysicalFontFace.cxx   |   23 +++--------------------
 vcl/source/font/PhysicalFontFamily.cxx |    2 +-
 3 files changed, 4 insertions(+), 23 deletions(-)

New commits:
commit 73ad4bc218b5a2c3f8b25e0cf4e3858cddfb4d01
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Sat Sep 11 16:22:07 2021 +1000
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Sep 20 07:41:41 2021 +0200

    vcl: unneeded functions in PhysicalFontFace
    
    Nothing uses PhysicalFontFace::SetBitmapSize(), so remove it. This in
    turn meant that the class doesn't ever use CompareWithSize() directly,
    as this calls on CompareIgnoreSize() when no width or height is set I
    have removed CompareWithSize().
    
    Change-Id: I1012ffd3bc0f39f917a8b725f9985844967533dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121931
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/inc/PhysicalFontFace.hxx b/vcl/inc/PhysicalFontFace.hxx
index a4d032f6160a..44d18550c840 100644
--- a/vcl/inc/PhysicalFontFace.hxx
+++ b/vcl/inc/PhysicalFontFace.hxx
@@ -73,12 +73,10 @@ public:
     virtual bool GetFontCapabilities(vcl::FontCapabilities&) const = 0;
 
     bool                    IsBetterMatch( const FontSelectPattern&, FontMatchStatus& ) const;
-    sal_Int32               CompareWithSize( const PhysicalFontFace& ) const;
     sal_Int32               CompareIgnoreSize( const PhysicalFontFace& ) const;
 
 protected:
     explicit PhysicalFontFace(const FontAttributes&);
-    void                    SetBitmapSize( int nW, int nH ) { mnWidth=nW; mnHeight=nH; }
 
     tools::Long                    mnWidth;    // Width (in pixels)
     tools::Long                    mnHeight;   // Height (in pixels)
diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx
index 876d6dfbb924..4fc3f005bbeb 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
 #include <sal/types.h>
 #include <tools/fontenum.hxx>
 #include <unotools/fontdefs.hxx>
@@ -65,25 +67,6 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther )
     return nRet;
 }
 
-sal_Int32 PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const
-{
-    sal_Int32 nCompare = CompareIgnoreSize( rOther );
-    if (nCompare != 0)
-        return nCompare;
-
-    if( mnHeight < rOther.mnHeight )
-        return -1;
-    else if( mnHeight > rOther.mnHeight )
-        return 1;
-
-    if( mnWidth < rOther.mnWidth )
-        return -1;
-    else if( mnWidth > rOther.mnWidth )
-        return 1;
-
-    return 0;
-}
-
 bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchStatus& rStatus ) const
 {
     int nMatch = 0;
@@ -196,4 +179,4 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
     return true;
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx
index cfe93b9d22b7..e6aacb9d854d 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -162,7 +162,7 @@ void PhysicalFontFamily::AddFontFace( PhysicalFontFace* pNewFontFace )
     for (; it != maFontFaces.end(); ++it)
     {
         PhysicalFontFace* pFoundFontFace = it->get();
-        sal_Int32 eComp = pNewFontFace->CompareWithSize( *pFoundFontFace );
+        sal_Int32 eComp = pNewFontFace->CompareIgnoreSize( *pFoundFontFace );
         if( eComp > 0 )
             continue;
         if( eComp < 0 )


More information about the Libreoffice-commits mailing list