Exemple #1
0
Doc::Doc(KoPart *part)
        : DocBase(part)
        , dd(new Private)
{
    Q_ASSERT(part);
    connect(d->map, SIGNAL(sheetAdded(Sheet*)), this, SLOT(sheetAdded(Sheet*)));

#ifndef QT_NO_DBUS
    new MapAdaptor(d->map);
    QDBusConnection::sessionBus().registerObject('/' + objectName() + '/' + d->map->objectName(), d->map);
#endif

    // Init chart shape factory with Calligra Sheets' specific configuration panels.
    KoShapeFactoryBase *chartShape = KoShapeRegistry::instance()->value(ChartShapeId);
    if (chartShape) {
        QList<KoShapeConfigFactoryBase*> panels = ChartDialog::panels(d->map);
        chartShape->setOptionPanels(panels);
    }

    connect(d->map, SIGNAL(commandAdded(KUndo2Command*)),
            this, SLOT(addCommand(KUndo2Command*)));

    // Load the function modules.
    FunctionModuleRegistry::instance()->loadFunctionModules();
}