mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Minor refactoring within TBT commands.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1562 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -200,6 +200,14 @@ void TitleBlockTemplateCommand::setView(TitleBlockTemplateView *view) {
|
||||
view_ = view;
|
||||
}
|
||||
|
||||
/**
|
||||
Refresh the view, if any.
|
||||
*/
|
||||
void TitleBlockTemplateCommand::refreshView() {
|
||||
if (!view_) return;
|
||||
view_ -> refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
This static method is a convenience to create a ModifyTemplateGridCommand
|
||||
that adds a row to \a tbtemplate at \a index.
|
||||
@@ -870,9 +878,7 @@ void CutTemplateCellsCommand::undo() {
|
||||
foreach (TitleBlockCell *cell, cut_cells_.keys()) {
|
||||
cell -> cell_type = cut_cells_.value(cell);
|
||||
}
|
||||
if (view_) {
|
||||
view_ -> refresh();
|
||||
}
|
||||
refreshView();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -882,9 +888,7 @@ void CutTemplateCellsCommand::redo() {
|
||||
foreach (TitleBlockCell *cell, cut_cells_.keys()) {
|
||||
cell -> cell_type = TitleBlockCell::EmptyCell;
|
||||
}
|
||||
if (view_) {
|
||||
view_ -> refresh();
|
||||
}
|
||||
refreshView();
|
||||
}
|
||||
|
||||
void CutTemplateCellsCommand::setCutCells(const QList<TitleBlockCell *> &cells) {
|
||||
@@ -932,9 +936,7 @@ void PasteTemplateCellsCommand::undo() {
|
||||
foreach (TitleBlockCell *cell, erased_cells_.keys()) {
|
||||
cell -> loadContentFromCell(erased_cells_.value(cell));
|
||||
}
|
||||
if (view_) {
|
||||
view_ -> refresh();
|
||||
}
|
||||
refreshView();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -945,9 +947,7 @@ void PasteTemplateCellsCommand::redo() {
|
||||
foreach (TitleBlockCell *cell, erased_cells_.keys()) {
|
||||
cell -> loadContentFromCell(pasted_cells_.value(cell));
|
||||
}
|
||||
if (view_) {
|
||||
view_ -> refresh();
|
||||
}
|
||||
refreshView();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user