void InsertInlineObjectActionBase::activated() { Q_ASSERT(m_canvas); KoTextEditor *editor = KoTextEditor::getTextEditorFromCanvas(m_canvas); if (editor) { KoInlineObject *obj = createInlineObject(); if (obj) { editor->insertInlineObject(obj); } } }
void InsertInlineObjectActionBase::activated() { Q_ASSERT(m_canvas->toolProxy()); KoTextEditor *handler = qobject_cast<KoTextEditor*> (m_canvas->toolProxy()->selection()); if (handler) { KoInlineObject *obj = createInlineObject(); if (obj) handler->insertInlineObject(obj); } else { kWarning(32500) << "InsertVariableAction: No texttool selected while trying to insert variable"; } }