diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index f42d8bf837e..162ec002300 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2290,9 +2290,9 @@ IEditor *EditorManager::openEditorWithContents(Id editorId, return edt; } -bool EditorManager::saveEditor(IEditor *editor) +bool EditorManager::saveDocument(IDocument *document) { - return EditorManagerPrivate::saveDocument(editor->document()); + return EditorManagerPrivate::saveDocument(document); } bool EditorManager::hasSplitter() diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index ece8c6ef35a..8d241708df5 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -139,7 +139,7 @@ public: static void addCurrentPositionToNavigationHistory(IEditor *editor = 0, const QByteArray &saveState = QByteArray()); static void cutForwardNavigationHistory(); - static bool saveEditor(IEditor *editor); + static bool saveDocument(IDocument *document); static bool closeEditors(const QList &editorsToClose, bool askAboutModifiedEditors = true); static void closeEditor(IEditor *editor, bool askAboutModifiedEditors = true); diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index e0284be8373..ece35fb0c53 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -899,7 +899,7 @@ void BaseTextEditorWidget::selectEncoding() break; } case CodecSelector::Save: doc->setCodec(codecSelector.selectedCodec()); - Core::EditorManager::saveEditor(editor()); + Core::EditorManager::saveDocument(textDocument()); updateTextCodecLabel(); break; case CodecSelector::Cancel: