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()->setLevel(sl);
|
||||||
app->getCurrentLevel()->notifyLevelChange();
|
app->getCurrentLevel()->notifyLevelChange();
|
||||||
sl->save();
|
sl->save();
|
||||||
|
// after saving you need to obtain the image again
|
||||||
|
img = sl->getFrame(fid, true);
|
||||||
} else {
|
} else {
|
||||||
img = sl->createEmptyFrame();
|
img = sl->createEmptyFrame();
|
||||||
assert(img);
|
assert(img);
|
||||||
|
@ -788,6 +790,8 @@ bool pasteRasterImageInCellWithoutUndo(int row, int col,
|
||||||
sl->setFrame(fid, img);
|
sl->setFrame(fid, img);
|
||||||
}
|
}
|
||||||
xsh->setCell(row, col, TXshCell(sl, fid));
|
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 {
|
} else {
|
||||||
sl = cell.getSimpleLevel();
|
sl = cell.getSimpleLevel();
|
||||||
fid = cell.getFrameId();
|
fid = cell.getFrameId();
|
||||||
|
@ -1785,6 +1789,8 @@ static void pasteRasterImageInCell(int row, int col,
|
||||||
bool newLevel = false) {
|
bool newLevel = false) {
|
||||||
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
|
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
|
||||||
|
|
||||||
|
// to let the undo to know which frame is edited
|
||||||
|
TTool::m_cellsData.clear();
|
||||||
bool createdFrame = false;
|
bool createdFrame = false;
|
||||||
bool isLevelCreated = false;
|
bool isLevelCreated = false;
|
||||||
TPaletteP oldPalette = 0;
|
TPaletteP oldPalette = 0;
|
||||||
|
|
Loading…
Reference in a new issue