summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-03-03 20:42:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-03-03 20:48:57 +0000
commitcd5cc12d4330d68d0a233a82eda30e983ce202a4 (patch)
tree4b7cdc23268256fad7d346a2107a4ccc6248319b /vcl/source/gdi
parent56f81d96e321d941abb43ed6b26a987bf815f36a (diff)
nLog10Divisor is 1
Change-Id: I8820d435e2f26d04ac3eccb710383399d050e020
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx24
1 files changed, 9 insertions, 15 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 69111345ac11..746636a5beb8 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -845,23 +845,17 @@ static void appendFixedInt( sal_Int32 nValue, OStringBuffer& rBuffer )
rBuffer.append( '-' );
nValue = -nValue;
}
- sal_Int32 nFactor = 1, nDiv = nLog10Divisor;
- while( nDiv-- )
- nFactor *= 10;
-
- sal_Int32 nInt = nValue / nFactor;
+ sal_Int32 nFactor = 10;
+ sal_Int32 nInt = nValue / nFactor;
rBuffer.append( nInt );
- if( nFactor > 1 )
+ sal_Int32 nDecimal = nValue % nFactor;
+ if( nDecimal )
{
- sal_Int32 nDecimal = nValue % nFactor;
- if( nDecimal )
- {
- rBuffer.append( '.' );
- // omit trailing zeros
- while( (nDecimal % 10) == 0 )
- nDecimal /= 10;
- rBuffer.append( nDecimal );
- }
+ rBuffer.append( '.' );
+ // omit trailing zeros
+ while( (nDecimal % 10) == 0 )
+ nDecimal /= 10;
+ rBuffer.append( nDecimal );
}
}