vcl/source/gdi/sallayout.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit beff8cb9344f13ddbcdc667ad6b73d2d405fa21d
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Sat Apr 6 22:48:07 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Apr 8 16:55:48 2024 +0200

    tdf#160342 Unwanted space before end of line when printing
    
    Also adjust some numeric literals to reflect they're
    floating point values in the expressions.
    
    Regression from 172b500ccbc8dac0496cc2936a9bcca793c0b594.
    
    Change-Id: I8281ba7c7d480135471ba94b11d447d76fd33063
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165860
    Tested-by: Jenkins
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>
    (cherry picked from commit 357f07bfd96da6cca87fcf0ef339495c2fea6937)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165836
    Reviewed-by: خالد حسني <kha...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index af281127ba86..d052ab53221b 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -292,7 +292,7 @@ void GenericSalLayout::Justify(double nNewWidth)
     std::vector<GlyphItem>::iterator pGlyphIter;
     // count stretchable glyphs
     int nStretchable = 0;
-    double nMaxGlyphWidth = 0;
+    double nMaxGlyphWidth = 0.0;
     for(pGlyphIter = m_GlyphItems.begin(); pGlyphIter != pGlyphIterRight; 
++pGlyphIter)
     {
         if( !pGlyphIter->IsInCluster() )
@@ -303,7 +303,7 @@ void GenericSalLayout::Justify(double nNewWidth)
 
     // move rightmost glyph to requested position
     nOldWidth -= pGlyphIterRight->origWidth();
-    if( nOldWidth <= 0 )
+    if( nOldWidth <= 0.0 )
         return;
     if( nNewWidth < nMaxGlyphWidth)
         nNewWidth = nMaxGlyphWidth;
@@ -312,10 +312,10 @@ void GenericSalLayout::Justify(double nNewWidth)
 
     // justify glyph widths and positions
     double nDiffWidth = nNewWidth - nOldWidth;
-    if( nDiffWidth >= 0) // expanded case
+    if( nDiffWidth >= 0.0 ) // expanded case
     {
         // expand width by distributing space between glyphs evenly
-        int nDeltaSum = 0;
+        double nDeltaSum = 0.0;
         for( pGlyphIter = m_GlyphItems.begin(); pGlyphIter != pGlyphIterRight; 
++pGlyphIter )
         {
             // move glyph to justified position

Reply via email to