Beispiel #1
0
void KoScriptingOdfReader::start()
{
    KoXmlElement elem = m_doc.documentElement();
    handleElement(elem);
    setCurrentElement(KoXmlElement());
    setLevel(0);
}
Beispiel #2
0
/**
 * Handler for mouse press events.
 * Mouse tracking is enabled, any pop up menu removed, the position of the
 * cursor set and paste state disabled.
 * Then, the current association or widget are set (if any), and events are
 * delivered to the specific methods, depending on where the cursor was
 * pressed.
 *
 * @param ome The received event.
 * @see setCurrentElement()
 */
void ToolBarState::mousePress(UMLSceneMouseEvent* ome)
{
    setMouseEvent(ome, QEvent::MouseButtonPress);

    m_pUMLScene->viewport()->setMouseTracking(true);

    //TODO Doesn't another way of emiting the signal exist? A method only for
    //that seems a bit dirty.
    m_pUMLScene->emitRemovePopupMenu();

    // TODO: Check who needs this.
    m_pUMLScene->setPos(m_pMouseEvent->pos());

    //TODO check why
    m_pUMLScene->setPaste(false);

    setCurrentElement();

    if (getCurrentWidget()) {
        mousePressWidget();
    } else if (getCurrentAssociation()) {
        mousePressAssociation();
    } else {
        mousePressEmpty();
    }
}
Beispiel #3
0
void KoScriptingOdfReader::handleElement(KoXmlElement &elem, int level)
{
    bool ok = m_filter.isNull();
    if (! ok) {
        if (m_filterRegExp.isEmpty())
            ok = m_filter == elem.tagName();
        else
            ok = m_filterRegExp.exactMatch(elem.tagName());
    }
    if (ok) {
        setCurrentElement(elem);
        setLevel(level);
        emitOnElement();
    }
    level++;
    KoXmlElement e;
    forEachElement(e, elem)
        handleElement(e, level); // recursive
}
Beispiel #4
0
void ElBaseCommand::replaceElement(const bool isUndo)
{
    Element *currentElement = removeElementAndReturnIt();
    insertElementObj(_element, isUndo);
    setCurrentElement(currentElement);
}