|
|
|
@ -9413,11 +9413,11 @@ newCDocument;drawingObject.graphicObject.graphicObject.Set_Parent(newCDocument);
|
|
|
|
|
node,isIntoShape);else window["AscCommon"].g_specialPasteHelper.Paste_Process_End()};worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback);return}if(copyPasteUseBinary){this.activeRange=worksheet.model.selectionRange.getLast().clone();binaryResult=this._pasteFromBinaryClassHtml(worksheet,node,isIntoShape);if(binaryResult===true)return;else if(binaryResult!==false&&binaryResult!=undefined)node=binaryResult}this.activeRange=worksheet.model.selectionRange.getLast().clone();var callBackAfterLoadImages=
|
|
|
|
|
function(){History.TurnOff();var oTempDrawingDocument=worksheet.model.DrawingDocument;var newCDocument=new CDocument(oTempDrawingDocument,false);newCDocument.bFromDocument=true;newCDocument.Content[0].bFromDocument=true;newCDocument.theme=window["Asc"]["editor"].wbModel.theme;var oOldLogicDocument=oTempDrawingDocument.m_oLogicDocument;oTempDrawingDocument.m_oLogicDocument=newCDocument;var oOldEditor=undefined;if("undefined"!==typeof editor)oOldEditor=editor;editor={WordControl:oTempDrawingDocument,
|
|
|
|
|
isDocumentEditor:true};var oPasteProcessor=new AscCommon.PasteProcessor({WordControl:{m_oLogicDocument:newCDocument},FontLoader:{}},false,false);oPasteProcessor._Prepeare_recursive(node,true,true);if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent)oPasteProcessor.aContent=window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent;else{oPasteProcessor._Execute(node,{},true,true,false);window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent=
|
|
|
|
|
oPasteProcessor.aContent}editor=oOldEditor;oTempDrawingDocument.m_oLogicDocument=oOldLogicDocument;History.TurnOn();var oPasteFromBinaryWord=new pasteFromBinaryWord(t,worksheet);oPasteFromBinaryWord._paste(worksheet,{content:oPasteProcessor.aContent})};var aImagesToDownload=this._getImageFromHtml(node,true);var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps;if(aImagesToDownload!==null&&(!specialPasteProps||specialPasteProps&&specialPasteProps.images)){var api=Asc["editor"];
|
|
|
|
|
AscCommon.sendImgUrls(api,aImagesToDownload,function(data){for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=aImagesToDownload[i];if(null!=elem.url)t.oImages[sFrom]=AscCommon.g_oDocumentUrls.imagePath2Local(elem.path);else t.oImages[sFrom]=sFrom}t.alreadyLoadImagesOnServer=true;callBackAfterLoadImages()},true)}else callBackAfterLoadImages()},_pasteFromBinaryClassHtml:function(worksheet,node,isIntoShape){var base64=null,base64FromWord=null,base64FromPresentation=
|
|
|
|
|
null,t=this;var returnBinary=this._getClassBinaryFromHtml(node);base64=returnBinary.base64;base64FromWord=returnBinary.base64FromWord;base64FromPresentation=returnBinary.base64FromPresentation;var result=false;if(base64!=null)result=this._pasteFromBinaryExcel(worksheet,base64,isIntoShape);else if(base64FromWord)result=this._pasteFromBinaryWord(worksheet,base64FromWord,isIntoShape);else if(base64FromPresentation)result=this._pasteFromBinaryPresentation(worksheet,base64FromPresentation,isIntoShape);
|
|
|
|
|
return result},_getClassBinaryFromHtml:function(node){var base64=null,base64FromWord=null,base64FromPresentation=null;var classNode=AscCommon.searchBinaryClass(node);if(classNode!=null){var cL=classNode.split(" ");for(var i=0;i<cL.length;i++)if(cL[i].indexOf("xslData;")>-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64,base64FromWord:base64FromWord,
|
|
|
|
|
base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i<allImages.length;i++)arrayImages[i]=allImages[i].src;res=arrayImages}else res=allImages}return res},_getBinaryColor:function(c){var bin,m,x,type,r,g,b,a,s;var reColor=/^\s*(?:#?([0-9a-f]{6})|#?([0-9a-f]{3})|rgba?\s*\(\s*((?:\d*\.?\d+)(?:\s*,\s*(?:\d*\.?\d+)){2,3})\s*\))\s*$/i;
|
|
|
|
|
oPasteProcessor.aContent}editor=oOldEditor;oTempDrawingDocument.m_oLogicDocument=oOldLogicDocument;History.TurnOn();var oPasteFromBinaryWord=new pasteFromBinaryWord(t,worksheet);oPasteFromBinaryWord._paste(worksheet,{content:oPasteProcessor.aContent})};var aImagesToDownload=this._getImageFromHtml(node,true);if(aImagesToDownload)return;var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps;if(aImagesToDownload!==null&&(!specialPasteProps||specialPasteProps&&specialPasteProps.images)){var api=
|
|
|
|
|
Asc["editor"];AscCommon.sendImgUrls(api,aImagesToDownload,function(data){for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=aImagesToDownload[i];if(null!=elem.url)t.oImages[sFrom]=AscCommon.g_oDocumentUrls.imagePath2Local(elem.path);else t.oImages[sFrom]=sFrom}t.alreadyLoadImagesOnServer=true;callBackAfterLoadImages()},true)}else callBackAfterLoadImages()},_pasteFromBinaryClassHtml:function(worksheet,node,isIntoShape){var base64=null,base64FromWord=
|
|
|
|
|
null,base64FromPresentation=null,t=this;var returnBinary=this._getClassBinaryFromHtml(node);base64=returnBinary.base64;base64FromWord=returnBinary.base64FromWord;base64FromPresentation=returnBinary.base64FromPresentation;var result=false;if(base64!=null)result=this._pasteFromBinaryExcel(worksheet,base64,isIntoShape);else if(base64FromWord)result=this._pasteFromBinaryWord(worksheet,base64FromWord,isIntoShape);else if(base64FromPresentation)result=this._pasteFromBinaryPresentation(worksheet,base64FromPresentation,
|
|
|
|
|
isIntoShape);return result},_getClassBinaryFromHtml:function(node){var base64=null,base64FromWord=null,base64FromPresentation=null;var classNode=AscCommon.searchBinaryClass(node);if(classNode!=null){var cL=classNode.split(" ");for(var i=0;i<cL.length;i++)if(cL[i].indexOf("xslData;")>-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64,
|
|
|
|
|
base64FromWord:base64FromWord,base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i<allImages.length;i++)arrayImages[i]=allImages[i].src;res=arrayImages}else res=allImages}return res},_getBinaryColor:function(c){var bin,m,x,type,r,g,b,a,s;var reColor=/^\s*(?:#?([0-9a-f]{6})|#?([0-9a-f]{3})|rgba?\s*\(\s*((?:\d*\.?\d+)(?:\s*,\s*(?:\d*\.?\d+)){2,3})\s*\))\s*$/i;
|
|
|
|
|
if(typeof c==="number")bin=c;else{m=reColor.exec(c);if(!m)return null;if(m[1]){x=[m[1].slice(0,2),m[1].slice(2,4),m[1].slice(4)];type=1}else if(m[2]){x=[m[2].slice(0,1),m[2].slice(1,2),m[2].slice(2)];type=0}else{x=m[3].split(/\s*,\s*/i);type=x.length===3?2:3}r=parseInt(type!==0?x[0]:x[0]+x[0],type<2?16:10);g=parseInt(type!==0?x[1]:x[1]+x[1],type<2?16:10);b=parseInt(type!==0?x[2]:x[2]+x[2],type<2?16:10);a=type===3?Math.round(parseFloat(x[3])*100)*.01:1;bin=r<<16|g<<8|b}return bin},_checkMaxTextLength:function(aResult,
|
|
|
|
|
r,c){var result=false;var isChange=false;var currentCellData=aResult.content[r][c];if(currentCellData&¤tCellData.content){currentCellData=currentCellData.content;for(var i=0;i<currentCellData.length;i++)if(currentCellData[i]&¤tCellData[i].text&¤tCellData[i].text.length>c_oAscMaxCellOrCommentLength){isChange=true;var text=currentCellData[i].text;var format=currentCellData[i].format;var lengthOfText=text.length;var iterCount=Math.ceil(lengthOfText/c_oAscMaxCellOrCommentLength);var splitText;
|
|
|
|
|
for(var j=0;j<iterCount;j++){splitText=text.substr(c_oAscMaxCellOrCommentLength*j,c_oAscMaxCellOrCommentLength*(j+1));if(!aResult.content[r])aResult.content[r]=[];if(!aResult.content[r][c])aResult.content[r][c]=[];if(!aResult.content[r][c].content)aResult.content[r][c].content=[];aResult.content[r][c].content[0]={format:format,text:splitText};if(iterCount!==j+1)r++}}if(isChange)result={aResult:aResult,r:r,c:c}}return result},_getBorderStyleName:function(borderStyle,borderWidth){var res=null;var nBorderWidth=
|
|
|
|
|