fix pasting raster to cell
This commit is contained in:
parent
1c796dd055
commit
2b95cf72d0
1 changed files with 7 additions and 1 deletions
|
@ -779,6 +779,8 @@ bool pasteRasterImageInCellWithoutUndo(int row, int col,
|
|||
app->getCurrentLevel()->setLevel(sl);
|
||||
app->getCurrentLevel()->notifyLevelChange();
|
||||
sl->save();
|
||||
// after saving you need to obtain the image again
|
||||
img = sl->getFrame(fid, true);
|
||||
} else {
|
||||
img = sl->createEmptyFrame();
|
||||
assert(img);
|
||||
|
@ -788,6 +790,8 @@ bool pasteRasterImageInCellWithoutUndo(int row, int col,
|
|||
sl->setFrame(fid, img);
|
||||
}
|
||||
xsh->setCell(row, col, TXshCell(sl, fid));
|
||||
// to let the undo to know which frame is edited
|
||||
TTool::m_cellsData.push_back({row, row, TTool::CellOps::BlankToNew});
|
||||
} else {
|
||||
sl = cell.getSimpleLevel();
|
||||
fid = cell.getFrameId();
|
||||
|
@ -1785,6 +1789,8 @@ static void pasteRasterImageInCell(int row, int col,
|
|||
bool newLevel = false) {
|
||||
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
|
||||
|
||||
// to let the undo to know which frame is edited
|
||||
TTool::m_cellsData.clear();
|
||||
bool createdFrame = false;
|
||||
bool isLevelCreated = false;
|
||||
TPaletteP oldPalette = 0;
|
||||
|
@ -4085,4 +4091,4 @@ void TCellSelection::fillEmptyCell() {
|
|||
if (initUndo) TUndoManager::manager()->endBlock();
|
||||
|
||||
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue