~ubuntu-branches/ubuntu/saucy/koffice/saucy

« back to all changes in this revision

Viewing changes to libs/flake/KoShape.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-12-06 15:30:09 UTC
  • mfrom: (0.13.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101206153009-yf0dqbp9l7fzwxi8
Tags: 1:2.2.91-0ubuntu1
New upstream RC release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1341
1341
                    && qAbs(matrix.m12()) < 1E-5        // 0
1342
1342
                    && qAbs(matrix.m21()) < 1E-5        // 0
1343
1343
                    && qAbs(matrix.m22() - 1) < 1E-5) { // 1
1344
 
                context.xmlWriter().addAttribute("svg:x", QString("%1pt").arg(matrix.dx()));
1345
 
                context.xmlWriter().addAttribute("svg:y", QString("%1pt").arg(matrix.dy()));
 
1344
                context.xmlWriter().addAttributePt("svg:x", matrix.dx());
 
1345
                context.xmlWriter().addAttributePt("svg:y", matrix.dy());
1346
1346
            } else {
1347
1347
                QString m = QString("matrix(%1 %2 %3 %4 %5pt %6pt)")
1348
 
                            .arg(matrix.m11()).arg(matrix.m12())
1349
 
                            .arg(matrix.m21()).arg(matrix.m22())
1350
 
                            .arg(matrix.dx()) .arg(matrix.dy());
 
1348
                            .arg(matrix.m11(), 0, 'f', 11)
 
1349
                            .arg(matrix.m12(), 0, 'f', 11)
 
1350
                            .arg(matrix.m21(), 0, 'f', 11)
 
1351
                            .arg(matrix.m22(), 0, 'f', 11)
 
1352
                            .arg(matrix.dx(), 0, 'f', 11)
 
1353
                            .arg(matrix.dy(), 0, 'f', 11);
1351
1354
                context.xmlWriter().addAttribute("draw:transform", m);
1352
1355
            }
1353
1356
        }
1360
1363
    }
1361
1364
 
1362
1365
    if (attributes & OdfAdditionalAttributes) {
1363
 
        QMap<QByteArray, QString>::const_iterator it(d->additionalAttributes.constBegin());
 
1366
        QMap<QString, QString>::const_iterator it(d->additionalAttributes.constBegin());
1364
1367
        for (; it != d->additionalAttributes.constEnd(); ++it) {
1365
 
            context.xmlWriter().addAttribute(it.key(), it.value());
 
1368
            context.xmlWriter().addAttribute(it.key().toUtf8(), it.value());
1366
1369
        }
1367
1370
    }
1368
1371
}
1453
1456
    return KoSnapData();
1454
1457
}
1455
1458
 
1456
 
void KoShape::setAdditionalAttribute(const char *name, const QString &value)
 
1459
void KoShape::setAdditionalAttribute(const QString &name, const QString &value)
1457
1460
{
1458
1461
    Q_D(KoShape);
1459
1462
    d->additionalAttributes.insert(name, value);
1460
1463
}
1461
1464
 
1462
 
void KoShape::removeAdditionalAttribute(const char *name)
 
1465
void KoShape::removeAdditionalAttribute(const QString &name)
1463
1466
{
1464
1467
    Q_D(KoShape);
1465
1468
    d->additionalAttributes.remove(name);
1466
1469
}
1467
1470
 
1468
 
bool KoShape::hasAdditionalAttribute(const char *name) const
 
1471
bool KoShape::hasAdditionalAttribute(const QString &name) const
1469
1472
{
1470
1473
    Q_D(const KoShape);
1471
1474
    return d->additionalAttributes.contains(name);
1472
1475
}
1473
1476
 
1474
 
QString KoShape::additionalAttribute(const char *name) const
 
1477
QString KoShape::additionalAttribute(const QString &name) const
1475
1478
{
1476
1479
    Q_D(const KoShape);
1477
1480
    return d->additionalAttributes.value(name);