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.budea@collabora.com>
(cherry picked from commit 357f07bfd96da6cca87fcf0ef339495c2fea6937)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165836
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index af28112..d052ab5 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