fix -Wextra & -Wdeprecated in Drawing

This commit is contained in:
wmayer 2016-09-22 15:29:10 +02:00
parent 4d2ccdfb72
commit b9c25c8402
8 changed files with 66 additions and 59 deletions

View File

@ -569,7 +569,7 @@ void DXFOutput::printCircle(const BRepAdaptor_Curve& c, std::ostream& out)
}
}
void DXFOutput::printEllipse(const BRepAdaptor_Curve& c, int id, std::ostream& out)
void DXFOutput::printEllipse(const BRepAdaptor_Curve& c, int /*id*/, std::ostream& out)
{
gp_Elips ellp = c.Ellipse();
const gp_Pnt& p= ellp.Location();
@ -713,7 +713,7 @@ void DXFOutput::printBSpline(const BRepAdaptor_Curve& c, int id, std::ostream& o
}
}
void DXFOutput::printGeneric(const BRepAdaptor_Curve& c, int id, std::ostream& out)
void DXFOutput::printGeneric(const BRepAdaptor_Curve& c, int /*id*/, std::ostream& out)
{
double uStart = c.FirstParameter();
gp_Pnt PS;

View File

@ -31,7 +31,6 @@
#endif
#include <strstream>
#include <Base/Writer.h>
#include <Base/Reader.h>
#include <Base/Exception.h>

View File

@ -29,7 +29,6 @@
#endif
#include <strstream>
#include <Base/Writer.h>
#include <Base/Reader.h>
#include <Base/Exception.h>

View File

@ -262,7 +262,7 @@ std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double to
/* dxf output section - Dan Falck 2011/09/25 */
std::string ProjectionAlgos::getDXF(ExtractionType type, double scale, double tolerance)
std::string ProjectionAlgos::getDXF(ExtractionType type, double /*scale*/, double tolerance)
{
std::stringstream result;
DXFOutput output;

View File

@ -64,9 +64,9 @@ CmdDrawingOpen::CmdDrawingOpen()
sPixmap = "actions/document-new";
}
void CmdDrawingOpen::activated(int iMsg)
{
Q_UNUSED(iMsg);
// Reading an image
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an SVG file to open"), QString::null,
QString::fromLatin1("%1 (*.svg *.svgz)").arg(QObject::tr("Scalable Vector Graphic")));
@ -281,6 +281,7 @@ CmdDrawingNewA3Landscape::CmdDrawingNewA3Landscape()
void CmdDrawingNewA3Landscape::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::string FeatName = getUniqueObjectName("Page");
openCommand("Create page");
@ -319,6 +320,7 @@ CmdDrawingNewView::CmdDrawingNewView()
void CmdDrawingNewView::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> shapes = getSelection().getObjectsOfType(Part::Feature::getClassTypeId());
if (shapes.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
@ -397,6 +399,7 @@ CmdDrawingOrthoViews::CmdDrawingOrthoViews()
void CmdDrawingOrthoViews::activated(int iMsg)
{
Q_UNUSED(iMsg);
const std::vector<App::DocumentObject*> shapes = getSelection().getObjectsOfType(Part::Feature::getClassTypeId());
if (shapes.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
@ -446,6 +449,7 @@ CmdDrawingOpenBrowserView::CmdDrawingOpenBrowserView()
void CmdDrawingOpenBrowserView::activated(int iMsg)
{
Q_UNUSED(iMsg);
unsigned int n = getSelection().countObjectsOfType(Drawing::FeaturePage::getClassTypeId());
if (n != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
@ -483,7 +487,7 @@ CmdDrawingAnnotation::CmdDrawingAnnotation()
void CmdDrawingAnnotation::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> pages = getSelection().getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
if (pages.empty()) {
pages = this->getDocument()->getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
@ -531,7 +535,7 @@ CmdDrawingClip::CmdDrawingClip()
void CmdDrawingClip::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> pages = getSelection().getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
if (pages.empty()) {
pages = this->getDocument()->getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
@ -576,7 +580,7 @@ CmdDrawingSymbol::CmdDrawingSymbol()
void CmdDrawingSymbol::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> pages = getSelection().getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
if (pages.empty()) {
pages = this->getDocument()->getObjectsOfType(Drawing::FeaturePage::getClassTypeId());
@ -632,6 +636,7 @@ CmdDrawingExportPage::CmdDrawingExportPage()
void CmdDrawingExportPage::activated(int iMsg)
{
Q_UNUSED(iMsg);
unsigned int n = getSelection().countObjectsOfType(Drawing::FeaturePage::getClassTypeId());
if (n != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
@ -682,6 +687,7 @@ CmdDrawingProjectShape::CmdDrawingProjectShape()
void CmdDrawingProjectShape::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog();
if (!dlg) {
dlg = new DrawingGui::TaskProjection();
@ -718,6 +724,7 @@ CmdDrawingDraftView::CmdDrawingDraftView()
void CmdDrawingDraftView::activated(int iMsg)
{
Q_UNUSED(iMsg);
addModule(Gui,"Draft");
doCommand(Gui,"Gui.runCommand(\"Draft_Drawing\")");
}
@ -748,6 +755,7 @@ CmdDrawingSpreadsheetView::CmdDrawingSpreadsheetView()
void CmdDrawingSpreadsheetView::activated(int iMsg)
{
Q_UNUSED(iMsg);
const std::vector<App::DocumentObject*> spreads = getSelection().getObjectsOfType(Spreadsheet::Sheet::getClassTypeId());
if (spreads.size() != 1) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),

View File

@ -50,7 +50,6 @@
# include <QSvgRenderer>
# include <QSvgWidget>
# include <QWheelEvent>
# include <strstream>
# include <cmath>
#endif
@ -381,7 +380,7 @@ void DrawingView::setRenderer(QAction *action)
}
}
bool DrawingView::onMsg(const char* pMsg, const char** ppReturn)
bool DrawingView::onMsg(const char* pMsg, const char** )
{
if (strcmp("ViewFit",pMsg) == 0) {
viewAll();
@ -613,53 +612,53 @@ void DrawingView::print(QPrinter* printer)
QPrinter::PageSize DrawingView::getPageSize(int w, int h) const
{
static const float paperSizes[][2] = {
{210, 297}, // A4
{176, 250}, // B5
{215.9f, 279.4f}, // Letter
{215.9f, 355.6f}, // Legal
{190.5f, 254}, // Executive
{841, 1189}, // A0
{594, 841}, // A1
{420, 594}, // A2
{297, 420}, // A3
{148, 210}, // A5
{105, 148}, // A6
{74, 105}, // A7
{52, 74}, // A8
{37, 52}, // A8
{1000, 1414}, // B0
{707, 1000}, // B1
{31, 44}, // B10
{500, 707}, // B2
{353, 500}, // B3
{250, 353}, // B4
{125, 176}, // B6
{88, 125}, // B7
{62, 88}, // B8
{33, 62}, // B9
{163, 229}, // C5E
{105, 241}, // US Common
{110, 220}, // DLE
{210, 330}, // Folio
{431.8f, 279.4f}, // Ledger
{279.4f, 431.8f} // Tabloid
};
static const float paperSizes[][2] = {
{210, 297}, // A4
{176, 250}, // B5
{215.9f, 279.4f}, // Letter
{215.9f, 355.6f}, // Legal
{190.5f, 254}, // Executive
{841, 1189}, // A0
{594, 841}, // A1
{420, 594}, // A2
{297, 420}, // A3
{148, 210}, // A5
{105, 148}, // A6
{74, 105}, // A7
{52, 74}, // A8
{37, 52}, // A8
{1000, 1414}, // B0
{707, 1000}, // B1
{31, 44}, // B10
{500, 707}, // B2
{353, 500}, // B3
{250, 353}, // B4
{125, 176}, // B6
{88, 125}, // B7
{62, 88}, // B8
{33, 62}, // B9
{163, 229}, // C5E
{105, 241}, // US Common
{110, 220}, // DLE
{210, 330}, // Folio
{431.8f, 279.4f}, // Ledger
{279.4f, 431.8f} // Tabloid
};
QPrinter::PageSize ps = QPrinter::Custom;
for (int i=0; i<30; i++) {
if (std::abs(paperSizes[i][0]-w) <= 1 &&
std::abs(paperSizes[i][1]-h) <= 1) {
ps = static_cast<QPrinter::PageSize>(i);
break;
}
else
if (std::abs(paperSizes[i][0]-h) <= 1 &&
std::abs(paperSizes[i][1]-w) <= 1) {
ps = static_cast<QPrinter::PageSize>(i);
break;
}
}
for (int i=0; i<30; i++) {
if (std::abs(paperSizes[i][0]-w) <= 1 &&
std::abs(paperSizes[i][1]-h) <= 1) {
ps = static_cast<QPrinter::PageSize>(i);
break;
}
else
if (std::abs(paperSizes[i][0]-h) <= 1 &&
std::abs(paperSizes[i][1]-w) <= 1) {
ps = static_cast<QPrinter::PageSize>(i);
break;
}
}
return ps;
}

View File

@ -867,6 +867,7 @@ void OrthoViews::get_configs(float configs[5]) // get scale & posit
TaskOrthoViews::TaskOrthoViews(QWidget *parent)
: ui(new Ui_TaskOrthoViews)
{
Q_UNUSED(parent);
ui->setupUi(this);
std::vector<App::DocumentObject*> obj = Gui::Selection().getObjectsOfType(Part::Feature::getClassTypeId());
const char * part = obj.front()->getNameInDocument();
@ -1074,7 +1075,7 @@ void TaskOrthoViews::projectionChanged(int index)
set_configs();
}
void TaskOrthoViews::setPrimary(int dir)
void TaskOrthoViews::setPrimary(int /*dir*/)
{
int p_sel = ui->view_from->currentIndex(); // index for entry selected for 'view from'
int r_sel = ui->axis_right->currentIndex(); // index for entry selected for 'rightwards axis'
@ -1229,7 +1230,7 @@ void TaskOrthoViews::setup_axo_tab()
ui->axoScale->setText(QString::number(axo_scale));
}
void TaskOrthoViews::change_axo(int p)
void TaskOrthoViews::change_axo(int /*p*/)
{
int u_sel = ui->axoUp->currentIndex(); // index for entry selected for 'view from'
int r_sel = ui->axoRight->currentIndex(); // index for entry selected for 'rightwards axis'

View File

@ -154,6 +154,7 @@ void ViewProviderDrawingPage::setupContextMenu(QMenu* menu, QObject* receiver, c
bool ViewProviderDrawingPage::setEdit(int ModNum)
{
Q_UNUSED(ModNum);
doubleClicked();
return false;
}