Remove default parameter of UndoGroupHelper constructor

This can lead to mistakes. If no buffer is required at the beginning,
it is better to pass 'nullptr' explicitly.

Fix a case of missing parameter in GuiCompleter (introduced at
f3656600). This avoids some spurious "There is no group open (creating
one)" messages.
This commit is contained in:
Jean-Marc Lasgouttes 2020-09-23 17:28:36 +02:00
parent 8099b9f8e6
commit 967f4d661e
3 changed files with 3 additions and 3 deletions

View File

@ -139,7 +139,7 @@ private:
*/
class UndoGroupHelper {
public:
UndoGroupHelper(Buffer * buf = 0);
UndoGroupHelper(Buffer * buf);
~UndoGroupHelper();

View File

@ -687,7 +687,7 @@ void GuiCompleter::tab()
}
// Make undo possible
UndoGroupHelper ugh;
UndoGroupHelper ugh(cur.buffer());
cur.recordUndo();
// If completion is active, at least complete by one character

View File

@ -121,7 +121,7 @@ void InsetLabel::updateLabelAndRefs(docstring const & new_label,
void InsetLabel::updateReferences(docstring const & old_label,
docstring const & new_label)
{
UndoGroupHelper ugh;
UndoGroupHelper ugh(nullptr);
if (buffer().masterParams().track_changes) {
// With change tracking, we insert a new ref and
// delete the old one