Spreadsheet: Compilation fixes for cherry-picked commits

This commit is contained in:
Chris Hennes
2021-12-16 14:07:30 -06:00
parent 68fca40983
commit 79cda0a1b7
3 changed files with 19 additions and 4 deletions

View File

@@ -100,6 +100,15 @@ const Cell *PropertySheet::getValue(CellAddress key) const
return i->second;
}
Cell * PropertySheet::getValueFromAlias(const std::string &alias)
{
std::map<std::string, CellAddress>::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);

View File

@@ -48,6 +48,8 @@ public:
virtual std::map<App::ObjectIdentifier, const App::Expression*> getExpressions() const override;
virtual void setExpressions(std::map<App::ObjectIdentifier, App::ExpressionPtr> &&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);

View File

@@ -30,11 +30,14 @@
#include "SpreadsheetDelegate.h"
#include "LineEdit.h"
#include <Base/Console.h>
#include <App/DocumentObject.h>
#include <Mod/Spreadsheet/App/Sheet.h>
#include <Gui/ExpressionCompleter.h>
#include "DlgBindSheet.h"
FC_LOG_LEVEL_INIT("Spreadsheet",true,true)
using namespace Spreadsheet;
using namespace SpreadsheetGui;