Commit f46a8ba8 authored by Igor.Zotov's avatar Igor.Zotov

при вставке извне(при загрузке изображений) неправиьно закрывалась транзакция

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67486 954022d7-b5bf-4e40-9824-e11837661b57
parent 2fd0b8c6
...@@ -8303,7 +8303,8 @@ ...@@ -8303,7 +8303,8 @@
t._updateCellsRange(arn, canChangeColWidth); t._updateCellsRange(arn, canChangeColWidth);
} }
if(!(prop === "paste" && !isLocal)) //в случае, если вставляем из глобального буфера, транзакцию закрываем внутри функции _pasteFromGlobalBuff на callbacks от загрузки шрифтов и картинок
if(prop !== "paste" || (prop === "paste" && isLocal))
History.EndTransaction(); History.EndTransaction();
}; };
if ("paste" === prop && val.onlyImages !== true) { if ("paste" === prop && val.onlyImages !== true) {
...@@ -8335,7 +8336,6 @@ ...@@ -8335,7 +8336,6 @@
if (!selectData) { if (!selectData) {
bIsUpdate = false; bIsUpdate = false;
History.EndTransaction();
buildRecalc(t.model.workbook); buildRecalc(t.model.workbook);
unLockDraw(t.model.workbook); unLockDraw(t.model.workbook);
return; return;
...@@ -8420,7 +8420,6 @@ ...@@ -8420,7 +8420,6 @@
t._updateCellsRange(arn, canChangeColWidth); t._updateCellsRange(arn, canChangeColWidth);
} }
History.EndTransaction();
var oSelection = History.GetSelection(); var oSelection = History.GetSelection();
if(null != oSelection) if(null != oSelection)
{ {
...@@ -8438,11 +8437,13 @@ ...@@ -8438,11 +8437,13 @@
t._loadFonts(val.fontsNew, function () { t._loadFonts(val.fontsNew, function () {
var api = asc["editor"]; var api = asc["editor"];
var isEndTransaction = false;
if (val.addImages && val.addImages.length != 0 && !(window["Asc"]["editor"] && window["Asc"]["editor"].isChartEditor)) if (val.addImages && val.addImages.length != 0 && !(window["Asc"]["editor"] && window["Asc"]["editor"].isChartEditor))
{ {
if(val.onlyImages !== true) if(val.onlyImages !== true)
t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth); t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth);
api.wb.clipboard._insertImagesFromHTML(t, val); api.wb.clipboard._insertImagesFromHTML(t, val);
isEndTransaction = true;
} }
else if(val.addImagesFromWord && val.addImagesFromWord.length != 0 && !(window["Asc"]["editor"] && window["Asc"]["editor"].isChartEditor)) else if(val.addImagesFromWord && val.addImagesFromWord.length != 0 && !(window["Asc"]["editor"] && window["Asc"]["editor"].isChartEditor))
{ {
...@@ -8483,6 +8484,7 @@ ...@@ -8483,6 +8484,7 @@
if(val.onlyImages !== true) if(val.onlyImages !== true)
t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth); t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth);
api.wb.clipboard._insertImagesFromBinaryWord(t, val, oImageMap); api.wb.clipboard._insertImagesFromBinaryWord(t, val, oImageMap);
isEndTransaction = true;
} }
else else
{ {
...@@ -8493,14 +8495,21 @@ ...@@ -8493,14 +8495,21 @@
if(val.onlyImages !== true) if(val.onlyImages !== true)
t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth); t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth);
api.wb.clipboard._insertImagesFromBinaryWord(t, val, oImageMap); api.wb.clipboard._insertImagesFromBinaryWord(t, val, oImageMap);
//закрываем транзакцию, поскольку в setSelectionInfo она не закроется
History.EndTransaction();
}, true); }, true);
} }
} }
else if(val.onlyImages !== true) else if(val.onlyImages !== true)
t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth); {
t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth);
isEndTransaction = true;
}
History.EndTransaction(); //закрываем транзакцию, поскольку в setSelectionInfo она не закроется
if(isEndTransaction)
History.EndTransaction();
}); });
}; };
...@@ -8531,8 +8540,8 @@ ...@@ -8531,8 +8540,8 @@
{ {
if(!isCheckSelection) if(!isCheckSelection)
{ {
values[arn.r1][arn.c1][0].colSpan = isMergedFirstCell.c2 -isMergedFirstCell.c1 + 1; values[arn.r1][arn.c1][0].colSpan = isMergedFirstCell.c2 -isMergedFirstCell.c1 + 1;
values[arn.r1][arn.c1][0].rowSpan = isMergedFirstCell.r2 -isMergedFirstCell.r1 + 1; values[arn.r1][arn.c1][0].rowSpan = isMergedFirstCell.r2 -isMergedFirstCell.r1 + 1;
} }
isOneMerge = true; isOneMerge = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment