fix -Wextra & -Wdeprecated in Spreadsheet

This commit is contained in:
wmayer 2016-09-22 16:35:05 +02:00
parent 801ac34258
commit 6cf82fbe62
8 changed files with 34 additions and 6 deletions

View File

@ -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();

View File

@ -43,6 +43,7 @@ PropertyRowHeights::PropertyRowHeights()
}
PropertyRowHeights::PropertyRowHeights(const PropertyRowHeights &other)
: Property(), std::map<int, int>(other)
{
}

View File

@ -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();
@ -1286,7 +1286,7 @@ void Sheet::onRelabledDocument(const Document &document)
* @param document
*/
void Sheet::onRenamedDocument(const Document &document)
void Sheet::onRenamedDocument(const Document & /*document*/)
{
}

View File

@ -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;
}
@ -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;
}

View File

@ -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);
@ -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);
@ -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(),
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -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);
@ -849,6 +863,7 @@ CmdCreateSpreadsheet::CmdCreateSpreadsheet()
void CmdCreateSpreadsheet::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::string FeatName = getUniqueObjectName("Spreadsheet");
openCommand("Create Spreadsheet");

View File

@ -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;
@ -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;
}

View File

@ -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();
}

View File

@ -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);
@ -172,6 +172,7 @@ bool SheetView::onHasMsg(const char *pMsg) const
void SheetView::setCurrentCell(QString str)
{
Q_UNUSED(str);
updateContentLine();
}
@ -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;
}
@ -298,6 +301,8 @@ void SheetView::editingFinished()
void SheetView::currentChanged ( const QModelIndex & current, const QModelIndex & previous )
{
Q_UNUSED(current);
Q_UNUSED(previous);
updateContentLine();
}