From dee56c32d4ab9ff95f95481d93ffe3a917e0f0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=A4hr?= Date: Fri, 11 Aug 2023 14:12:55 +0200 Subject: [PATCH] Spreadsheet: fix build on macOS The recent migration from boost::bind to std::bind [1] broke the build on Mac (Apple clang version 13.0.0 (clang-1300.0.29.30) on macOS-11.7.8). In all other cases the `boost::bind` was replaced by `std::bind` (among with the place holders) but in these two spread sheet files src/Mod/Spreadsheet/Gui/SheetModel.cpp src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp the original code only referenced `bind`, which used to get resolved to `boost::bind` but now raises this error: > /Users/jonas/src/FreeCAD/FreeCAD-git/src/Mod/Spreadsheet/Gui/SheetModel.cpp:50:36: error: use of undeclared identifier 'bind'; did you mean 'boost::bind'? > sheet->cellUpdated.connect(bind(&SheetModel::cellUpdated, this, sp::_1)); > ^~~~ > boost::bind This commit changes this to `std::bind` expicitly, just like it's done in the other files. This works on my system/compiler. [1]: https://github.com/FreeCAD/FreeCAD/commit/4ffe0c3218a88db98a7fd70981f4a6d20be4bafa --- src/Mod/Spreadsheet/Gui/SheetModel.cpp | 4 ++-- src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mod/Spreadsheet/Gui/SheetModel.cpp b/src/Mod/Spreadsheet/Gui/SheetModel.cpp index cc41d105d7..31648ecf4a 100644 --- a/src/Mod/Spreadsheet/Gui/SheetModel.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetModel.cpp @@ -47,9 +47,9 @@ SheetModel::SheetModel(Sheet* _sheet, QObject* parent) : QAbstractTableModel(par { //NOLINTBEGIN cellUpdatedConnection = - sheet->cellUpdated.connect(bind(&SheetModel::cellUpdated, this, sp::_1)); + sheet->cellUpdated.connect(std::bind(&SheetModel::cellUpdated, this, sp::_1)); rangeUpdatedConnection = - sheet->rangeUpdated.connect(bind(&SheetModel::rangeUpdated, this, sp::_1)); + sheet->rangeUpdated.connect(std::bind(&SheetModel::rangeUpdated, this, sp::_1)); //NOLINTEND ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp index 660b7a2d9d..c670d3c6bb 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetView.cpp @@ -99,8 +99,8 @@ SheetView::SheetView(Gui::Document *pcDocument, App::DocumentObject *docObj, QWi connect(ui->cellAlias, &LineEdit::textEdited, this, &SheetView::aliasChanged); //NOLINTBEGIN - columnWidthChangedConnection = sheet->columnWidthChanged.connect(bind(&SheetView::resizeColumn, this, sp::_1, sp::_2)); - rowHeightChangedConnection = sheet->rowHeightChanged.connect(bind(&SheetView::resizeRow, this, sp::_1, sp::_2)); + columnWidthChangedConnection = sheet->columnWidthChanged.connect(std::bind(&SheetView::resizeColumn, this, sp::_1, sp::_2)); + rowHeightChangedConnection = sheet->rowHeightChanged.connect(std::bind(&SheetView::resizeRow, this, sp::_1, sp::_2)); //NOLINTEND connect( model, &QAbstractItemModel::dataChanged, this, &SheetView::modelUpdated);