Skip to content

Commit

Permalink
fix -Wextra & -Wdeprecated in Spreadsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Sep 22, 2016
1 parent 801ac34 commit 6cf82fb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ PropertyColumnWidths::PropertyColumnWidths()
}

PropertyColumnWidths::PropertyColumnWidths(const PropertyColumnWidths &other)
: Property(), std::map<int, int>(other)
{
std::map<int, int>::const_iterator i = other.begin();

Expand Down
1 change: 1 addition & 0 deletions src/Mod/Spreadsheet/App/PropertyRowHeights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ PropertyRowHeights::PropertyRowHeights()
}

PropertyRowHeights::PropertyRowHeights(const PropertyRowHeights &other)
: Property(), std::map<int, int>(other)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Spreadsheet/App/Sheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ short Sheet::mustExecute(void) const
*
*/

void Sheet::clear(CellAddress address, bool all)
void Sheet::clear(CellAddress address, bool /*all*/)
{
Cell * cell = getCell(address);
std::string addr = address.toString();
Expand Down Expand Up @@ -1286,7 +1286,7 @@ void Sheet::onRelabledDocument(const Document &document)
* @param document
*/

void Sheet::onRenamedDocument(const Document &document)
void Sheet::onRenamedDocument(const Document & /*document*/)
{
}

Expand Down
5 changes: 4 additions & 1 deletion src/Mod/Spreadsheet/App/SheetPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ PyObject* SheetPy::clear(PyObject *args)

PyObject* SheetPy::clearAll(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;

this->getSheetPtr()->clearAll();
Py_Return;
}
Expand Down Expand Up @@ -912,7 +915,7 @@ PyObject *SheetPy::getCustomAttributes(const char* attr) const
return prop->getPyObject();
}

int SheetPy::setCustomAttributes(const char* attr, PyObject* obj)
int SheetPy::setCustomAttributes(const char* , PyObject* )
{
return 0;
}
15 changes: 15 additions & 0 deletions src/Mod/Spreadsheet/Gui/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ CmdSpreadsheetMergeCells::CmdSpreadsheetMergeCells()

void CmdSpreadsheetMergeCells::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -120,6 +121,7 @@ CmdSpreadsheetSplitCell::CmdSpreadsheetSplitCell()

void CmdSpreadsheetSplitCell::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -175,6 +177,7 @@ CmdSpreadsheetImport::CmdSpreadsheetImport()

void CmdSpreadsheetImport::activated(int iMsg)
{
Q_UNUSED(iMsg);
QString selectedFilter;
QString formatList = QObject::tr("All (*)");
QString fileName = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
Expand Down Expand Up @@ -214,6 +217,7 @@ CmdSpreadsheetExport::CmdSpreadsheetExport()

void CmdSpreadsheetExport::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -262,6 +266,7 @@ CmdSpreadsheetAlignLeft::CmdSpreadsheetAlignLeft()

void CmdSpreadsheetAlignLeft::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -313,6 +318,7 @@ CmdSpreadsheetAlignCenter::CmdSpreadsheetAlignCenter()

void CmdSpreadsheetAlignCenter::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -364,6 +370,7 @@ CmdSpreadsheetAlignRight::CmdSpreadsheetAlignRight()

void CmdSpreadsheetAlignRight::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -415,6 +422,7 @@ CmdSpreadsheetAlignTop::CmdSpreadsheetAlignTop()

void CmdSpreadsheetAlignTop::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -466,6 +474,7 @@ CmdSpreadsheetAlignBottom::CmdSpreadsheetAlignBottom()

void CmdSpreadsheetAlignBottom::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -517,6 +526,7 @@ CmdSpreadsheetAlignVCenter::CmdSpreadsheetAlignVCenter()

void CmdSpreadsheetAlignVCenter::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -568,6 +578,7 @@ CmdSpreadsheetStyleBold::CmdSpreadsheetStyleBold()

void CmdSpreadsheetStyleBold::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -641,6 +652,7 @@ CmdSpreadsheetStyleItalic::CmdSpreadsheetStyleItalic()

void CmdSpreadsheetStyleItalic::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -714,6 +726,7 @@ CmdSpreadsheetStyleUnderline::CmdSpreadsheetStyleUnderline()

void CmdSpreadsheetStyleUnderline::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -787,6 +800,7 @@ CmdSpreadsheetSetAlias::CmdSpreadsheetSetAlias()

void CmdSpreadsheetSetAlias::activated(int iMsg)
{
Q_UNUSED(iMsg);
if (getActiveGuiDocument()) {
Gui::MDIView* activeWindow = Gui::getMainWindow()->activeWindow();
SpreadsheetGui::SheetView * sheetView = freecad_dynamic_cast<SpreadsheetGui::SheetView>(activeWindow);
Expand Down Expand Up @@ -849,6 +863,7 @@ CmdCreateSpreadsheet::CmdCreateSpreadsheet()

void CmdCreateSpreadsheet::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::string FeatName = getUniqueObjectName("Spreadsheet");

openCommand("Create Spreadsheet");
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Spreadsheet/Gui/SheetModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "../App/Sheet.h"
#include <Gui/Command.h>
#include <Base/Tools.h>
#include <strstream>
#include <boost/bind.hpp>

using namespace SpreadsheetGui;
Expand All @@ -58,11 +57,13 @@ SheetModel::~SheetModel()

int SheetModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return 16384;
}

int SheetModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return 26 * 26 + 26;
}

Expand Down
4 changes: 3 additions & 1 deletion src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ void SpreadsheetDelegate::setModelData(QWidget *editor,
}
}

QSize SpreadsheetDelegate::sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const
QSize SpreadsheetDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
Q_UNUSED(option);
Q_UNUSED(index);
return QSize();
}

Expand Down
7 changes: 6 additions & 1 deletion src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ SheetView::~SheetView()
//delete delegate;
}

bool SheetView::onMsg(const char *pMsg, const char **ppReturn)
bool SheetView::onMsg(const char *pMsg, const char **)
{
if(strcmp("Undo",pMsg) == 0 ) {
getGuiDocument()->undo(1);
Expand Down Expand Up @@ -172,6 +172,7 @@ bool SheetView::onHasMsg(const char *pMsg) const

void SheetView::setCurrentCell(QString str)
{
Q_UNUSED(str);
updateContentLine();
}

Expand Down Expand Up @@ -260,11 +261,13 @@ void SheetView::modelUpdated(const QModelIndex &topLeft, const QModelIndex &bott

void SheetView::columnResized(int col, int oldSize, int newSize)
{
Q_UNUSED(oldSize);
newColumnSizes[col] = newSize;
}

void SheetView::rowResized(int row, int oldSize, int newSize)
{
Q_UNUSED(oldSize);
newRowSizes[row] = newSize;
}

Expand Down Expand Up @@ -298,6 +301,8 @@ void SheetView::editingFinished()

void SheetView::currentChanged ( const QModelIndex & current, const QModelIndex & previous )
{
Q_UNUSED(current);
Q_UNUSED(previous);
updateContentLine();
}

Expand Down

0 comments on commit 6cf82fb

Please sign in to comment.