diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index 7c7715beee..5a2b434b17 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -100,6 +100,15 @@ const Cell *PropertySheet::getValue(CellAddress key) const return i->second; } +Cell * PropertySheet::getValueFromAlias(const std::string &alias) +{ + std::map::const_iterator it = revAliasProp.find(alias); + + if (it != revAliasProp.end()) + return getValue(it->second); + else + return 0; +} const Cell * PropertySheet::getValueFromAlias(const std::string &alias) const { @@ -109,7 +118,6 @@ const Cell * PropertySheet::getValueFromAlias(const std::string &alias) const return getValue(it->second); else return 0; - } bool PropertySheet::isValidAlias(const std::string &candidate) @@ -1448,7 +1456,7 @@ PyObject *PropertySheet::getPyValue(PyObject *key) { Py_Return; } - Range range = getRange(Py::Object(key).as_string().c_str()); + Range range = getRange(Py::Object(key).as_string().c_str(), false); if(!range.from().isValid() || !range.to().isValid()) return Py::new_reference_to(Py::Tuple()); @@ -1796,10 +1804,10 @@ void PropertySheet::setPathValue(const ObjectIdentifier &path, const boost::any << " in " << getFullName()); App::CellAddress targetFrom = other->getCellAddress( - Py::Object(seq[1].ptr()).as_string().c_str()); + Py::Object(seq[1].ptr()).as_string().c_str(), false); App::CellAddress targetTo = other->getCellAddress( - Py::Object(seq[2].ptr()).as_string().c_str()); + Py::Object(seq[2].ptr()).as_string().c_str(), false); App::Range range(from,to); App::Range rangeTarget(targetFrom,targetTo); diff --git a/src/Mod/Spreadsheet/App/PropertySheet.h b/src/Mod/Spreadsheet/App/PropertySheet.h index 8a181fec0d..5a9041c364 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.h +++ b/src/Mod/Spreadsheet/App/PropertySheet.h @@ -48,6 +48,8 @@ public: virtual std::map getExpressions() const override; virtual void setExpressions(std::map &&exprs) override; + App::CellAddress getCellAddress(const char *addr, bool silent) const; + App::Range getRange(const char *range, bool silent) const; virtual void onRelabeledDocument(const App::Document &doc) override; virtual void updateElementReference( @@ -106,6 +108,8 @@ public: const Cell * getValue(App::CellAddress key) const; + Cell * getValueFromAlias(const std::string &alias); + const Cell * getValueFromAlias(const std::string &alias) const; bool isValidAlias(const std::string &candidate); diff --git a/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp b/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp index 60e554fc7a..450d584a7d 100644 --- a/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp +++ b/src/Mod/Spreadsheet/Gui/SpreadsheetDelegate.cpp @@ -30,11 +30,14 @@ #include "SpreadsheetDelegate.h" #include "LineEdit.h" +#include #include #include #include #include "DlgBindSheet.h" +FC_LOG_LEVEL_INIT("Spreadsheet",true,true) + using namespace Spreadsheet; using namespace SpreadsheetGui;