src/gui/painting/qpdf.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    76         val = -val;
    76         val = -val;
    77     }
    77     }
    78     unsigned int ival = (unsigned int) val;
    78     unsigned int ival = (unsigned int) val;
    79     qreal frac = val - (qreal)ival;
    79     qreal frac = val - (qreal)ival;
    80 
    80 
    81     int ifrac = (int)(frac * 1000000);
    81     int ifrac = (int)(frac * 1000000000);
    82     if (ifrac == 1000000) {
    82     if (ifrac == 1000000000) {
    83         ++ival;
    83         ++ival;
    84         ifrac = 0;
    84         ifrac = 0;
    85     }
    85     }
    86     char output[256];
    86     char output[256];
    87     int i = 0;
    87     int i = 0;
    88     while (ival) {
    88     while (ival) {
    89         output[i] = '0' + (ival % 10);
    89         output[i] = '0' + (ival % 10);
    90         ++i;
    90         ++i;
    91         ival /= 10;
    91         ival /= 10;
    92     }
    92     }
    93     int fact = 100000;
    93     int fact = 100000000;
    94     if (i == 0) {
    94     if (i == 0) {
    95         *(buf++) = '0';
    95         *(buf++) = '0';
    96     } else {
    96     } else {
    97         while (i) {
    97         while (i) {
    98             *(buf++) = output[--i];
    98             *(buf++) = output[--i];
   143             : dev(new QBuffer(byteArray)),
   143             : dev(new QBuffer(byteArray)),
   144             fileBackingEnabled(fileBacking),
   144             fileBackingEnabled(fileBacking),
   145             fileBackingActive(false),
   145             fileBackingActive(false),
   146             handleDirty(false)
   146             handleDirty(false)
   147     {
   147     {
   148         dev->open(QIODevice::ReadWrite);
   148         dev->open(QIODevice::ReadWrite | QIODevice::Append);
   149     }
   149     }
   150 
   150 
   151     ByteStream::ByteStream(bool fileBacking)
   151     ByteStream::ByteStream(bool fileBacking)
   152             : dev(new QBuffer(&ba)),
   152             : dev(new QBuffer(&ba)),
   153             fileBackingEnabled(fileBacking),
   153             fileBackingEnabled(fileBacking),