From ae2331b31643db1ba49d2e4dcd2fd80b771d4b73 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 21 Feb 2022 15:41:28 +0100 Subject: [PATCH] Gui: fix warning -Wunused-parameter The function PropertyEditor::recomputeDocument() accepts a pointer to App::Document that is passed by the calling instance closeTransaction(). Since this is the active document there is no need for PropertyEditor::recomputeDocument() to ignore the argument and determine the active document again. --- src/Gui/propertyeditor/PropertyEditor.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index 017575459f..d6fe9e08e3 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -307,13 +307,11 @@ void PropertyEditor::onItemActivated ( const QModelIndex & index ) void PropertyEditor::recomputeDocument(App::Document* doc) { try { - if (App::Document* doc = App::GetApplication().getActiveDocument()) { - if (!doc->isTransactionEmpty()) { - // Between opening and committing a transaction a recompute - // could already have been done - if (doc->isTouched()) - doc->recompute(); - } + if (doc && !doc->isTransactionEmpty()) { + // Between opening and committing a transaction a recompute + // could already have been done + if (doc->isTouched()) + doc->recompute(); } } // do not re-throw