forked from qt-creator/qt-creator
Qnx: Fixing Bar Descriptor XML file editor to provide editor actions
BarDescriptorEditorWidget is using TextEditorActionHandler class to provide editor actions e.g. Undo, Redo, Cut, Copy, Paste accessible from main menu and using shortcuts. TextEditorActionHandler.resolveTextEditorWidget() virtual function is added to all resolving TextEditorWidget for an Editor. This allows to have IEditor->widget() to have non-BaseTextEditorWidget instances too. Task-number: QTCREATORBUG-10040 Change-Id: I6f433fc307c13ef2b2a20c48e6473826f2619544 Reviewed-by: David Kaspar <dkaspar@blackberry.com> Reviewed-by: David Schulz <david.schulz@digia.com> Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
@@ -560,6 +560,11 @@ FUNCTION(gotoNextWordCamelCase)
|
||||
FUNCTION(gotoNextWordCamelCaseWithSelection)
|
||||
|
||||
|
||||
BaseTextEditorWidget *TextEditorActionHandler::resolveTextEditorWidget(Core::IEditor *editor) const
|
||||
{
|
||||
return qobject_cast<BaseTextEditorWidget *>(editor->widget());
|
||||
}
|
||||
|
||||
void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
|
||||
{
|
||||
m_currentEditor = 0;
|
||||
@@ -567,7 +572,7 @@ void TextEditorActionHandler::updateCurrentEditor(Core::IEditor *editor)
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
BaseTextEditorWidget *baseEditor = qobject_cast<BaseTextEditorWidget *>(editor->widget());
|
||||
BaseTextEditorWidget *baseEditor = resolveTextEditorWidget(editor);
|
||||
|
||||
if (baseEditor && baseEditor->actionHack() == this) {
|
||||
m_currentEditor = baseEditor;
|
||||
|
||||
Reference in New Issue
Block a user