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>
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 3240e48..28138c3 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -304,7 +304,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() )
@@ -315,7 +315,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;
@@ -324,10 +324,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