~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to plugins/pathshapes/enhancedpath/EnhancedPathShapeFactory.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-07-16 10:51:29 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20120716105129-es1ebubwiwlsfvv0
Tags: 1:2.4.92-0ubuntu1
New upstream RC release

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
KoShape *EnhancedPathShapeFactory::createDefaultShape(KoDocumentResourceManager *) const
53
53
{
54
 
    EnhancedPathShape *shape = new EnhancedPathShape(QRectF(0, 0, 100, 100));
 
54
    EnhancedPathShape *shape = new EnhancedPathShape(QRect(0, 0, 100, 100));
55
55
    shape->setStroke(new KoShapeStroke(1.0));
56
56
    shape->setShapeId(KoPathShapeId);
57
57
 
78
78
 
79
79
KoShape *EnhancedPathShapeFactory::createShape(const KoProperties *params, KoDocumentResourceManager *) const
80
80
{
81
 
    QRectF viewBox(0, 0, 100, 100);
82
81
    QVariant viewboxData;
83
 
    if (params->property("viewBox", viewboxData))
84
 
        viewBox = viewboxData.toRectF();
 
82
    const QRect viewBox = (params->property(QLatin1String("viewBox"), viewboxData)) ?
 
83
        viewboxData.toRect() :
 
84
        QRect(0, 0, 100, 100);
85
85
 
86
86
    EnhancedPathShape *shape = new EnhancedPathShape(viewBox);
87
 
    if (! shape)
88
 
        return 0;
89
87
 
90
88
    shape->setShapeId(KoPathShapeId);
91
89
    shape->setStroke(new KoShapeStroke(1.0));
374
372
    t.toolTip = i18n("A callout");
375
373
    t.icon = "callout-shape";
376
374
    t.properties = dataToProperties(modifiers, commands, handles, formulae);
377
 
    t.properties->setProperty("viewBox", QRectF(0, 0, 21600, 21600));
 
375
    t.properties->setProperty(QLatin1String("viewBox"), QRect(0, 0, 21600, 21600));
378
376
 
379
377
    addTemplate(t);
380
378
}
419
417
    t.toolTip = i18n("Smiley");
420
418
    t.icon = "smiley-shape";
421
419
    t.properties = dataToProperties(modifiers, commands, handles, formulae);
422
 
    t.properties->setProperty("viewBox", QRectF(0, 0, 21600, 21600));
 
420
    t.properties->setProperty(QLatin1String("viewBox"), QRect(0, 0, 21600, 21600));
423
421
 
424
422
    addTemplate(t);
425
423
}
498
496
    t.toolTip = i18n("A circular-arrow");
499
497
    t.icon = "circular-arrow-shape";
500
498
    t.properties = dataToProperties(modifiers, commands, handles, formulae);
501
 
    t.properties->setProperty("viewBox", QRectF(0, 0, 21600, 21600));
 
499
    t.properties->setProperty(QLatin1String("viewBox"), QRect(0, 0, 21600, 21600));
502
500
    addTemplate(t);
503
501
}
504
502
 
543
541
    t.icon = "gearhead-shape";
544
542
    t.properties = dataToProperties(QString(), commands, ListType(), ComplexType());
545
543
    t.properties->setProperty("background", QVariant::fromValue<QColor>(QColor(Qt::blue)));
546
 
    t.properties->setProperty("viewBox", QRectF(0, 0, 40, 90));
 
544
    t.properties->setProperty(QLatin1String("viewBox"), QRect(0, 0, 40, 90));
547
545
    addTemplate(t);
548
546
}
549
547