Spreadsheet: Removed setPosition() function.
This commit is contained in:
parent
b7480210fd
commit
87c6af3547
|
@ -84,8 +84,6 @@ Sheet::Sheet()
|
|||
ADD_PROPERTY_TYPE(cells, (), "Spreadsheet", (PropertyType)(Prop_ReadOnly|Prop_Hidden), "Cell contents");
|
||||
ADD_PROPERTY_TYPE(columnWidths, (), "Spreadsheet", (PropertyType)(Prop_ReadOnly|Prop_Hidden), "Column widths");
|
||||
ADD_PROPERTY_TYPE(rowHeights, (), "Spreadsheet", (PropertyType)(Prop_ReadOnly|Prop_Hidden), "Row heights");
|
||||
ADD_PROPERTY_TYPE(currRow, (0), "Spreadsheet", (PropertyType)(Prop_ReadOnly|Prop_Hidden), "Current row");
|
||||
ADD_PROPERTY_TYPE(currColumn, (0), "Spreadsheet", (PropertyType)(Prop_ReadOnly|Prop_Hidden), "Current column");
|
||||
|
||||
docDeps.setSize(0);
|
||||
|
||||
|
@ -452,18 +450,6 @@ std::map<int, int> Sheet::getRowHeights() const
|
|||
return rowHeights.getValues();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set selected position for property to \a address.
|
||||
* @param address Target position
|
||||
*/
|
||||
|
||||
void Sheet::setPosition(CellAddress address)
|
||||
{
|
||||
currRow.setValue(address.row());
|
||||
currColumn.setValue(address.col());
|
||||
currRow.purgeTouched();
|
||||
currColumn.purgeTouched();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove all aliases.
|
||||
|
@ -845,11 +831,6 @@ DocumentObjectExecReturn *Sheet::execute(void)
|
|||
rowHeights.clearDirty();
|
||||
columnWidths.clearDirty();
|
||||
|
||||
positionChanged(CellAddress(currRow.getValue(), currColumn.getValue()));
|
||||
|
||||
currRow.purgeTouched();
|
||||
currColumn.purgeTouched();
|
||||
|
||||
std::set<DocumentObject*> ds(cells.getDocDeps());
|
||||
|
||||
// Make sure we don't reference ourselves
|
||||
|
|
|
@ -162,8 +162,6 @@ public:
|
|||
|
||||
std::map<int, int> getRowHeights() const;
|
||||
|
||||
void setPosition(CellAddress address);
|
||||
|
||||
// Signals
|
||||
|
||||
boost::signal<void (Spreadsheet::CellAddress)> cellUpdated;
|
||||
|
@ -174,9 +172,6 @@ public:
|
|||
|
||||
boost::signal<void (int, int)> rowHeightChanged;
|
||||
|
||||
boost::signal<void (CellAddress)> positionChanged;
|
||||
|
||||
|
||||
/** @name Access properties */
|
||||
//@{
|
||||
App::Property* addDynamicProperty(
|
||||
|
@ -285,9 +280,6 @@ protected:
|
|||
/* Row heights */
|
||||
PropertyRowHeights rowHeights;
|
||||
|
||||
App::PropertyInteger currRow;
|
||||
App::PropertyInteger currColumn;
|
||||
|
||||
/* Dependencies to other documents */
|
||||
App::PropertyLinkList docDeps;
|
||||
|
||||
|
|
|
@ -155,10 +155,5 @@
|
|||
<UserDocu>Get given spreadsheet row height</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setPosition">
|
||||
<Documentation>
|
||||
<UserDocu>Set focused cell for attached view(s).</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
</PythonExport>
|
||||
</GenerateModel>
|
||||
|
|
|
@ -759,25 +759,6 @@ PyObject* SheetPy::getBackground(PyObject *args)
|
|||
}
|
||||
}
|
||||
|
||||
PyObject* SheetPy::setPosition(PyObject *args)
|
||||
{
|
||||
const char * strAddress;
|
||||
CellAddress address;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s:setPosition", &strAddress))
|
||||
return 0;
|
||||
|
||||
try {
|
||||
address = stringToAddress(strAddress);
|
||||
getSheetPtr()->setPosition(address);
|
||||
Py_Return;
|
||||
}
|
||||
catch (const Base::Exception & e) {
|
||||
PyErr_SetString(PyExc_ValueError, e.what());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* SheetPy::setColumnWidth(PyObject *args)
|
||||
{
|
||||
const char * columnStr;
|
||||
|
|
|
@ -82,8 +82,6 @@ void CmdSpreadsheetMergeCells::activated(int iMsg)
|
|||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.mergeCells('%s')", sheet->getNameInDocument(),
|
||||
i->rangeString().c_str());
|
||||
Gui::Command::commitCommand();
|
||||
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.%s.setPosition('%s')", sheet->getNameInDocument(),
|
||||
ranges[0].address().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@ SheetView::SheetView(Gui::Document *pcDocument, App::DocumentObject *docObj, QWi
|
|||
|
||||
columnWidthChangedConnection = sheet->columnWidthChanged.connect(bind(&SheetView::resizeColumn, this, _1, _2));
|
||||
rowHeightChangedConnection = sheet->rowHeightChanged.connect(bind(&SheetView::resizeRow, this, _1, _2));
|
||||
positionChangedConnection = sheet->positionChanged.connect(bind(&SheetView::setPosition, this, _1));
|
||||
|
||||
QPalette palette = ui->cells->palette();
|
||||
palette.setColor(QPalette::Base, QColor(255, 255, 255));
|
||||
|
@ -263,17 +262,6 @@ void SheetView::resizeColumn(int col, int newSize)
|
|||
ui->cells->setColumnWidth(col, newSize);
|
||||
}
|
||||
|
||||
void SheetView::setPosition(CellAddress address)
|
||||
{
|
||||
QModelIndex curr = ui->cells->currentIndex();
|
||||
QModelIndex i = ui->cells->model()->index(address.row(), address.col());
|
||||
|
||||
if (i.isValid() && (curr.row() != address.row() || curr.column() != address.col())) {
|
||||
ui->cells->clearSelection();
|
||||
ui->cells->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
void SheetView::resizeRow(int col, int newSize)
|
||||
{
|
||||
if (ui->cells->verticalHeader()->sectionSize(col) != newSize)
|
||||
|
@ -299,7 +287,6 @@ void SheetView::editingFinished()
|
|||
void SheetView::currentChanged ( const QModelIndex & current, const QModelIndex & previous )
|
||||
{
|
||||
updateContentLine();
|
||||
sheet->setPosition(CellAddress(current.row(), current.column()));
|
||||
}
|
||||
|
||||
void SheetView::updateCell(const App::Property *prop)
|
||||
|
|
|
@ -87,7 +87,6 @@ protected Q_SLOTS:
|
|||
void columnResizeFinished();
|
||||
void rowResizeFinished();
|
||||
protected:
|
||||
void setPosition(Spreadsheet::CellAddress address);
|
||||
void updateContentLine();
|
||||
void setCurrentCell(QString str);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
|
Loading…
Reference in New Issue
Block a user