[skip ci] fix more -Wgnu-zero-variadic-macro-arguments

This commit is contained in:
wmayer
2019-11-17 15:14:18 +01:00
parent d68a8c5e24
commit f50dc8e652
6 changed files with 42 additions and 46 deletions

View File

@@ -27,7 +27,7 @@
#include <App/Range.h>
#include <App/Document.h>
#include <App/ExpressionParser.h>
#include <Gui/Command.h>
#include <Gui/CommandT.h>
#include "ui_PropertiesDialog.h"
using namespace App;
@@ -231,17 +231,17 @@ void PropertiesDialog::apply()
for (; i != ranges.end(); ++i) {
if (orgAlignment != alignment) {
FCMD_OBJ_CMD2("setAlignment('%s', '%s')", sheet,
Gui::cmdAppObjectArgs(sheet, "setAlignment('%s', '%s')",
i->rangeString().c_str(), Cell::encodeAlignment(alignment).c_str());
changes = true;
}
if (orgStyle != style) {
FCMD_OBJ_CMD2("setStyle('%s', '%s')", sheet,
Gui::cmdAppObjectArgs(sheet, "setStyle('%s', '%s')",
i->rangeString().c_str(), Cell::encodeStyle(style).c_str());
changes = true;
}
if (orgForegroundColor != foregroundColor) {
FCMD_OBJ_CMD2("setForeground('%s', (%f,%f,%f,%f))", sheet,
Gui::cmdAppObjectArgs(sheet, "setForeground('%s', (%f,%f,%f,%f))",
i->rangeString().c_str(),
foregroundColor.r,
foregroundColor.g,
@@ -250,7 +250,7 @@ void PropertiesDialog::apply()
changes = true;
}
if (orgBackgroundColor != backgroundColor) {
FCMD_OBJ_CMD2("setBackground('%s', (%f,%f,%f,%f))", sheet,
Gui::cmdAppObjectArgs(sheet, "setBackground('%s', (%f,%f,%f,%f))",
i->rangeString().c_str(),
backgroundColor.r,
backgroundColor.g,
@@ -260,12 +260,12 @@ void PropertiesDialog::apply()
}
if (orgDisplayUnit != displayUnit) {
std::string escapedstr = Base::Tools::escapedUnicodeFromUtf8(displayUnit.stringRep.c_str());
FCMD_OBJ_CMD2("setDisplayUnit('%s', '%s')", sheet,
Gui::cmdAppObjectArgs(sheet, "setDisplayUnit('%s', '%s')",
i->rangeString().c_str(), escapedstr.c_str());
changes = true;
}
if (ranges.size() == 1 && ranges[0].size() == 1 && orgAlias != alias) {
FCMD_OBJ_CMD2("setAlias('%s', '%s')", sheet,
Gui::cmdAppObjectArgs(sheet, "setAlias('%s', '%s')",
i->address().c_str(), alias.c_str());
changes = true;
}

View File

@@ -33,7 +33,7 @@
#include <App/Application.h>
#include <App/AutoTransaction.h>
#include <App/Document.h>
#include <Gui/Command.h>
#include <Gui/CommandT.h>
#include <Gui/MainWindow.h>
#include <boost/bind.hpp>
#include "../App/Utils.h"
@@ -175,8 +175,7 @@ void SheetTableView::insertRows()
break;
}
FCMD_OBJ_CMD2("insertRows('%s', %d)", sheet,
rowName(prev).c_str(), count);
Gui::cmdAppObjectArgs(sheet, "insertRows('%s', %d)", rowName(prev).c_str(), count);
}
Gui::Command::commitCommand();
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
@@ -197,8 +196,7 @@ void SheetTableView::removeRows()
/* Remove rows */
Gui::Command::openCommand("Remove rows");
for (std::vector<int>::const_iterator it = sortedRows.begin(); it != sortedRows.end(); ++it) {
FCMD_OBJ_CMD2("removeRows('%s', %d)", sheet,
rowName(*it).c_str(), 1);
Gui::cmdAppObjectArgs(sheet, "removeRows('%s', %d)", rowName(*it).c_str(), 1);
}
Gui::Command::commitCommand();
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
@@ -235,8 +233,8 @@ void SheetTableView::insertColumns()
break;
}
FCMD_OBJ_CMD2("insertColumns('%s', %d)", sheet,
columnName(prev).c_str(), count);
Gui::cmdAppObjectArgs(sheet, "insertColumns('%s', %d)",
columnName(prev).c_str(), count);
}
Gui::Command::commitCommand();
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
@@ -257,8 +255,8 @@ void SheetTableView::removeColumns()
/* Remove columns */
Gui::Command::openCommand("Remove rows");
for (std::vector<int>::const_iterator it = sortedColumns.begin(); it != sortedColumns.end(); ++it)
FCMD_OBJ_CMD2("removeColumns('%s', %d)", sheet,
columnName(*it).c_str(), 1);
Gui::cmdAppObjectArgs(sheet, "removeColumns('%s', %d)",
columnName(*it).c_str(), 1);
Gui::Command::commitCommand();
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
}