@ -8402,18 +8402,18 @@ function(font_index,stream_index){this.embeddedFontFiles[font_index].SetStreamIn
false ; var oThis = this ; if ( window [ "AscDesktopEditor" ] && window [ "AscDesktopEditor" ] [ "IsLocalFile" ] && window [ "AscDesktopEditor" ] [ "isBlockchainSupport" ] ) { this . isBlockchainSupport = window [ "AscDesktopEditor" ] [ "isBlockchainSupport" ] ( ) && ! window [ "AscDesktopEditor" ] [ "IsLocalFile" ] ( ) ; if ( this . isBlockchainSupport ) { Image . prototype . preload _crypto = function ( _url ) { window [ "crypto_images_map" ] = window [ "crypto_images_map" ] || { } ; if ( ! window [ "crypto_images_map" ] [ _url ] ) window [ "crypto_images_map" ] [ _url ] = [ ] ; window [ "crypto_images_map" ] [ _url ] . push ( this ) ;
window [ "AscDesktopEditor" ] [ "PreloadCryptoImage" ] ( _url , AscCommon . g _oDocumentUrls . getLocal ( _url ) ) ; oThis . Api . sync _StartAction ( Asc . c _oAscAsyncActionType . BlockInteraction , Asc . c _oAscAsyncAction . LoadImage ) } ; Image . prototype [ "onload_crypto" ] = function ( _src , _crypto _data ) { if ( _crypto _data && AscCommon . EncryptionWorker && AscCommon . EncryptionWorker . isCryptoImages ( ) ) { AscCommon . EncryptionWorker . decryptImage ( _src , this , _crypto _data ) ; return } this . crossOrigin = "" ; this . src = _src ; oThis . Api . sync _EndAction ( Asc . c _oAscAsyncActionType . BlockInteraction ,
Asc . c _oAscAsyncAction . LoadImage ) } } } this . put _Api = function ( _api ) { this . Api = _api ; if ( this . Api . IsAsyncOpenDocumentImages !== undefined ) { this . bIsAsyncLoadDocumentImages = this . Api . IsAsyncOpenDocumentImages ( ) ; if ( this . bIsAsyncLoadDocumentImages ) if ( undefined === this . Api . asyncImageEndLoadedBackground ) this . bIsAsyncLoadDocumentImages = false } } ; this . LoadDocumentImagesCallback = function ( ) { if ( this . ThemeLoader == null ) this . Api . asyncImagesDocumentEndLoaded ( ) ; else this . ThemeLoader . asyncImagesEndLoaded ( ) } ; this . LoadDocumentImages =
function ( _images ) { if ( this . ThemeLoader == null ) this . Api . asyncImagesDocumentStartLoaded ( ) ; else this . ThemeLoader . asyncImagesStartLoaded ( ) ; this . images _loading = [ ] ; for ( var id in _images ) this . images _loading [ this . images _loading . length ] = AscCommon . getFullImageSrc2 ( _images [ id ] ) ; if ( ! this . bIsAsyncLoadDocumentImages ) { this . nNoByOrderCounter = 0 ; this . _LoadImages ( ) } else { var _len = this . images _loading . length ; for( var i = 0 ; i < _len ; i ++ ) this . LoadImageAsync ( i ) ; this . images _loading . splice ( 0 , _len ) ; var that = this ; setTimeout ( function ( ) { that . LoadDocumentImagesCallback ( ) } ,
3E3 ) } } ; this . loadImageByUrl = function ( _image , _url ) { if ( this . isBlockchainSupport ) _image . preload _crypto ( _url ) ; else _image . src = _url } ; this . _LoadImages = function ( ) { var _count _images = this . images _loading . length ; if ( 0 == _count _images ) { this . nNoByOrderCounter = 0 ; if ( this . ThemeLoader == null ) this . Api . asyncImagesDocumentEndLoaded ( ) ; else this . ThemeLoader . asyncImagesEndLoaded ( ) ; return } for ( var i = 0 ; i < _count _images ; i ++ ) { var _id = this . images _loading [ i ] ; var oImage = new CImage ( _id ) ; oImage . Status = ImageLoadStatus . Loading ; oImage . Image =
new Image ; oThis . map _image _index [ oImage . src ] = oImage ; oImage . Image . parentImage = oImage ; oImage . Image . onload = function ( ) { this . parentImage . Status = ImageLoadStatus . Complete ; oThis . nNoByOrderCounter ++ ; if ( oThis . bIsLoadDocumentFirst === true ) { oThis . Api . OpenDocumentProgress . CurrentImage ++ ; oThis . Api . SendOpenProgress ( ) } if ( ! oThis . bIsLoadDocumentImagesNoByOrder ) { oThis . images _loading . shift ( ) ; oThis . _LoadImages ( ) } else if ( oThis . nNoByOrderCounter == oThis . images _loading . length ) { oThis . images _loading = [ ] ; oThis . _LoadImages ( ) } } ;
oImage . Image . onerror = function ( ) { this . parentImage . Status = ImageLoadStatus . Complete ; this . parentImage . Image = null ; oThis . nNoByOrderCounter ++ ; if ( oThis . bIsLoadDocumentFirst === true ) { oThis . Api . OpenDocumentProgress . CurrentImage ++ ; oThis . Api . SendOpenProgress ( ) } if ( ! oThis . bIsLoadDocumentImagesNoByOrder ) { oThis . images _loading . shift ( ) ; oThis . _LoadImages ( ) } else if ( oThis . nNoByOrderCounter == oThis . images _loading . length ) { oThis . images _loading = [ ] ; oThis . _LoadImages ( ) } } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img ,
img . src ) } ) ; oThis . loadImageByUrl ( oImage . Image , oImage . src ) ; if ( ! oThis . bIsLoadDocumentImagesNoByOrder ) return } } ; this . LoadImage = function ( src , Type ) { var _image = this . map _image _index [ src ] ; if ( undefined != _image ) return _image ; this . Api . asyncImageStartLoaded ( ) ; var oImage = new CImage ( src ) ; oImage . Type = Type ; oImage . Image = new Image ; oImage . Status = ImageLoadStatus . Loading ; oThis . map _image _index [ oImage . src ] = oImage ; oImage . Image . onload = function ( ) { oImage . Status = ImageLoadStatus . Complete ; oThis . Api . asyncImageEndLoaded ( oImage ) } ;
oImage . Image . onerror = function ( ) { oImage . Image = null ; oImage . Status = ImageLoadStatus . Complete ; oThis . Api . asyncImageEndLoaded ( oImage ) } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img , img . src ) } ) ; this . loadImageByUrl ( oImage . Image , oImage . src ) ; return null } ; this . LoadImageAsync = function ( i ){ var _id = oThis . images _loading [ i ] ; var oImage = new CImage ( _id ) ; oImage . Status = ImageLoadStatus . Loading ; oImage . Image = new Image ; oThis . map _image _index [ oImage . src ] = oImage ; var oThat = oThis ; oImage . Image . onload =
function ( ) { oImage . Status = ImageLoadStatus . Complete ; oThat . Api . asyncImageEndLoadedBackground ( oImage ) } ; oImage . Image . onerror = function ( ) { oImage . Status = ImageLoadStatus . Complete ; oImage . Image = null ; oThat . Api . asyncImageEndLoadedBackground ( oImage ) } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img , img . src ) } ) ; console . log ( "Loading image " + i ) ; console . log ( oImage ) ; window . parent . APP . getImageURL ( oImage . src , function ( url ) { if ( url == "" ) oThis . loadImageByUrl ( oImage . Image , oImage . src ) ; else { oThis . loadImageByUrl ( oImage . Image ,
url ) ; oThis . map _image _index [ url ] = oImage } } ) } ; this . LoadImagesWithCallback = function ( arr , loadImageCallBack , loadImageCallBackArgs ) { var arrAsync = [ ] ; var i = 0 ; for ( i = 0 ; i < arr . length ; i ++ ) if ( this . map _image _index [ arr [ i ] ] === undefined ) arrAsync . push ( arr [ i ] ) ; if ( arrAsync . length == 0 ) { loadImageCallBack . call ( this . Api , loadImageCallBackArgs ) ; return } this . loadImageCallBackCounter = 0 ; this . loadImageCallBackCounterMax = arrAsync . length ; this . loadImageCallBack = loadImageCallBack ; this . loadImageCallBackArgs = loadImageCallBackArgs ; for ( i =
0 ; i < arrAsync . length ; i ++ ) { var oImage = new CImage ( arrAsync [ i ] ) ; oImage . Image = new Image ; oImage . Image . parentImage = oImage ; oImage . Status = ImageLoadStatus . Loading ; this . map _image _index [ oImage . src ] = oImage ; oImage . Image . onload = function ( ) { this . parentImage . Status = ImageLoadStatus . Complete ; oThis . loadImageCallBackCounter ++ ; if ( oThis . loadImageCallBackCounter == oThis . loadImageCallBackCounterMax ) oThis . LoadImagesWithCallbackEnd ( ) } ; oImage . Image . onerror = function ( ) { this . parentImage . Image = null ; this . parentImage . Status = ImageLoadStatus . Complete ;
oThis . loadImageCallBackCounter ++ ; if ( oThis . loadImageCallBackCounter == oThis . loadImageCallBackCounterMax ) oThis . LoadImagesWithCallbackEnd ( ) } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img , img . src ) } ) ; this . loadImageByUrl ( oImage . Image , oImage . src ) } } ; this . LoadImagesWithCallbackEnd = function ( ) { this . loadImageCallBack . call ( this . Api , this . loadImageCallBackArgs ) ; this . loadImageCallBack = null ; this . loadImageCallBackArgs = null ; this . loadImageCallBackCounterMax = 0 ; this . loadImageCallBackCounter =
0 } } var g _flow _anchor = new Image ; g _flow _anchor . asc _complete = false ; g _flow _anchor . onload = function ( ) { g _flow _anchor . asc _complete = true } ; g _flow _anchor . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC" ; var g _flow _anchor2 = new Image ; g _flow _anchor2 . asc _complete =
false ; g _flow _anchor2 . onload = function ( ) { g _flow _anchor2 . asc _complete = true } ; g _flow _anchor2 . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC" ;
function ( _images ) { if ( this . ThemeLoader == null ) this . Api . asyncImagesDocumentStartLoaded ( ) ; else this . ThemeLoader . asyncImagesStartLoaded ( ) ; this . images _loading = [ ] ; for ( var id in _images ) this . images _loading [ this . images _loading . length ] = AscCommon . getFullImageSrc2 ( _images [ id ] ) ; if ( ! this . bIsAsyncLoadDocumentImages ) { this . nNoByOrderCounter = 0 ; this . _LoadImages ( ) } else { var _len = this . images _loading . length ; if( _len === 0 ) return void this . LoadDocumentImagesCallback ( ) ; var todo = _len ; var that = this ; var done = function ( ) { todo -- ;
if ( todo === 0 ) { that . images _loading . splice ( 0 , _len ) ; setTimeout ( function ( ) { that . LoadDocumentImagesCallback ( ) } , 100 ) ; done = function ( ) { } } } ; for ( var i = 0 ; i < _len ; i ++ ) this . LoadImageAsync ( i , done ) ; return ; this . images _loading . splice ( 0 , _len ) ; var that = this ; setTimeout ( function ( ) { that . LoadDocumentImagesCallback ( ) } , 3E3 ) } } ; this . loadImageByUrl = function ( _image , _url ) { if ( this . isBlockchainSupport ) _image . preload _crypto ( _url ) ; else _image . src = _url } ; this . _LoadImages = function ( ) { var _count _images = this . images _loading . length ; if ( 0 == _count _images ) { this . nNoByOrderCounter =
0 ; if ( this . ThemeLoader == null ) this . Api . asyncImagesDocumentEndLoaded ( ) ; else this . ThemeLoader . asyncImagesEndLoaded ( ) ; return } for ( var i = 0 ; i < _count _images ; i ++ ) { var _id = this . images _loading [ i ] ; var oImage = new CImage ( _id ) ; oImage . Status = ImageLoadStatus . Loading ; oImage . Image = new Image ; oThis . map _image _index [ oImage . src ] = oImage ; oImage . Image . parentImage = oImage ; oImage . Image . onload = function ( ) { this . parentImage . Status = ImageLoadStatus . Complete ; oThis . nNoByOrderCounter ++ ; if ( oThis . bIsLoadDocumentFirst === true ) { oThis . Api . OpenDocumentProgress . CurrentImage ++ ;
oThis . Api . SendOpenProgress ( ) } if ( ! oThis . bIsLoadDocumentImagesNoByOrder ) { oThis . images _loading . shift ( ) ; oThis . _LoadImages ( ) } else if ( oThis . nNoByOrderCounter == oThis . images _loading . length ) { oThis . images _loading = [ ] ; oThis . _LoadImages ( ) } } ; oImage . Image . onerror = function ( ) { this . parentImage . Status = ImageLoadStatus . Complete ; this . parentImage . Image = null ; oThis . nNoByOrderCounter ++ ; if ( oThis . bIsLoadDocumentFirst === true ) { oThis . Api . OpenDocumentProgress . CurrentImage ++ ; oThis . Api . SendOpenProgress ( ) } if ( ! oThis . bIsLoadDocumentImagesNoByOrder ) { oThis . images _loading . shift ( ) ;
oThis . _LoadImages ( ) } else if ( oThis . nNoByOrderCounter == oThis . images _loading . length ) { oThis . images _loading = [ ] ; oThis . _LoadImages ( ) } } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img , img . src ) } ) ; oThis . loadImageByUrl ( oImage . Image , oImage . src ) ; if ( ! oThis . bIsLoadDocumentImagesNoByOrder ) return } } ; this . LoadImage = function ( src , Type ) { var _image = this . map _image _index [ src ] ; if ( undefined != _image ) return _image ; this . Api . asyncImageStartLoaded ( ) ; var oImage = new CImage ( src ) ; oImage . Type = Type ; oImage . Image =
new Image ; oImage . Status = ImageLoadStatus . Loading ; oThis . map _image _index [ oImage . src ] = oImage ; oImage . Image . onload = function ( ) { oImage . Status = ImageLoadStatus . Complete ; oThis . Api . asyncImageEndLoaded ( oImage ) } ; oImage . Image . onerror = function ( ) { oImage . Image = null ; oImage . Status = ImageLoadStatus . Complete ; oThis . Api . asyncImageEndLoaded ( oImage ) } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img , img . src ) } ) ; this . loadImageByUrl ( oImage . Image , oImage . src ) ; return null } ; this . LoadImageAsync = function ( i ,
cb ) { var _id = oThis . images _loading [ i ] ; var oImage = new CImage ( _id ) ; oImage . Status = ImageLoadStatus . Loading ; oImage . Image = new Image ; oThis . map _image _index [ oImage . src ] = oImage ; var oThat = oThis ; oImage . Image . onload = function ( ) { oImage . Status = ImageLoadStatus . Complete ; oThat . Api . asyncImageEndLoadedBackground ( oImage ) } ; oImage . Image . onerror = function ( ) { oImage . Status = ImageLoadStatus . Complete ; oImage . Image = null ; oThat . Api . asyncImageEndLoadedBackground ( oImage ) } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img ,
img . src ) } ) ; window . parent . APP . getImageURL ( oImage . src , function ( url ) { if ( url == "" ) oThis . loadImageByUrl ( oImage . Image , oImage . src ) ; else { oThis . loadImageByUrl ( oImage . Image , url ) ; oThis . map _image _index [ url ] = oImage } if ( typeof cb === "function" ) cb ( ) } ) } ; this . LoadImagesWithCallback = function ( arr , loadImageCallBack , loadImageCallBackArgs ) { var arrAsync = [ ] ; var i = 0 ; for ( i = 0 ; i < arr . length ; i ++ ) if ( this . map _image _index [ arr [ i ] ] === undefined ) arrAsync . push ( arr [ i ] ) ; if ( arrAsync . length == 0 ) { loadImageCallBack . call ( this . Api , loadImageCallBackArgs ) ;
return } this . loadImageCallBackCounter = 0 ; this . loadImageCallBackCounterMax = arrAsync . length ; this . loadImageCallBack = loadImageCallBack ; this . loadImageCallBackArgs = loadImageCallBackArgs ; for ( i = 0 ; i < arrAsync . length ; i ++ ) { var oImage = new CImage ( arrAsync [ i ] ) ; oImage . Image = new Image ; oImage . Image . parentImage = oImage ; oImage . Status = ImageLoadStatus . Loading ; this . map _image _index [ oImage . src ] = oImage ; oImage . Image . onload = function ( ) { this . parentImage . Status = ImageLoadStatus . Complete ; oThis . loadImageCallBackCounter ++ ; if ( oThis . loadImageCallBackCounter ==
oThis . loadImageCallBackCounterMax ) oThis . LoadImagesWithCallbackEnd ( ) } ; oImage . Image . onerror = function ( ) { this . parentImage . Image = null ; this . parentImage . Status = ImageLoadStatus . Complete ; oThis . loadImageCallBackCounter ++ ; if ( oThis . loadImageCallBackCounter == oThis . loadImageCallBackCounterMax ) oThis . LoadImagesWithCallbackEnd ( ) } ; AscCommon . backoffOnErrorImg ( oImage . Image , function ( img ) { oThis . loadImageByUrl ( img , img . src ) } ) ; this . loadImageByUrl ( oImage . Image , oImage . src ) } } ; this . LoadImagesWithCallbackEnd = function ( ) { this . loadImageCallBack . call ( this . Api ,
this . loadImageCallBackArgs ) ; this . loadImageCallBack = null ; this . loadImageCallBackArgs = null ; this . loadImageCallBackCounterMax = 0 ; this . loadImageCallBackCounter = 0 } } var g _flow _anchor = new Image ; g _flow _anchor . asc _complete = false ; g _flow _anchor . onload = function ( ) { g _flow _anchor . asc _complete = true } ; g _flow _anchor . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC" ;
var g _flow _anchor2 = new Image ; g _flow _anchor2 . asc _complete = false ; g _flow _anchor2 . onload = function ( ) { g _flow _anchor2 . asc _complete = true } ; g _flow _anchor2 . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC" ;
window [ "AscCommon" ] = window [ "AscCommon" ] || { } ; window [ "AscCommon" ] . g _font _loader = new CGlobalFontLoader ; window [ "AscCommon" ] . g _image _loader = new CGlobalImageLoader ; window [ "AscCommon" ] . g _flow _anchor = g _flow _anchor ; window [ "AscCommon" ] . g _flow _anchor2 = g _flow _anchor2 } ) ( window , window . document ) ; "use strict" ; ( function ( window , undefined ) { var g _dKoef _mm _to _pix = AscCommon . g _dKoef _mm _to _pix ; function CBounds ( ) { this . L = 0 ; this . T = 0 ; this . R = 0 ; this . B = 0 ; this . isAbsL = false ; this . isAbsT = false ; this . isAbsR = false ; this . isAbsB = false ; this . AbsW =
- 1 ; this . AbsH = - 1 ; this . SetParams = function ( _l , _t , _r , _b , abs _l , abs _t , abs _r , abs _b , absW , absH ) { this . L = _l ; this . T = _t ; this . R = _r ; this . B = _b ; this . isAbsL = abs _l ; this . isAbsT = abs _t ; this . isAbsR = abs _r ; this . isAbsB = abs _b ; this . AbsW = absW ; this . AbsH = absH } } function CAbsolutePosition ( ) { this . L = 0 ; this . T = 0 ; this . R = 0 ; this . B = 0 } var g _anchor _left = 1 ; var g _anchor _top = 2 ; var g _anchor _right = 4 ; var g _anchor _bottom = 8 ; function CControl ( ) { this . Bounds = new CBounds ; this . Anchor = g _anchor _left | g _anchor _top ; this . Name = null ; this . Parent = null ; this . TabIndex =
null ; this . HtmlElement = null ; this . AbsolutePosition = new CBounds ; this . Resize = function ( _width , _height , api ) { if ( null == this . Parent || null == this . HtmlElement ) return ; var _x = 0 ; var _y = 0 ; var _r = 0 ; var _b = 0 ; var hor _anchor = this . Anchor & 5 ; var ver _anchor = this . Anchor & 10 ; if ( g _anchor _left == hor _anchor ) { if ( this . Bounds . isAbsL ) _x = this . Bounds . L ; else _x = this . Bounds . L * _width / 1E3 ; if ( - 1 != this . Bounds . AbsW ) _r = _x + this . Bounds . AbsW ; else if ( this . Bounds . isAbsR ) _r = _width - this . Bounds . R ; else _r = this . Bounds . R * _width / 1E3 } else if ( g _anchor _right ==
@ -16494,8 +16494,8 @@ LineIndex+1}var RangeOffset=1+this.Lines[0]+this.Lines[LineIndex+1]+RangeIndex*2
function ( LineIndex , RangeIndex , EndPos ) { var RangeOffset = this . protected _GetRangeOffset ( LineIndex , RangeIndex ) ; this . Lines [ RangeOffset + 1 ] = EndPos } ; CParagraphContentWithContentBase . prototype . private _UpdateSpellChecking = function ( ) { if ( this . Paragraph && this . Paragraph . SpellChecker ) { this . Paragraph . SpellChecker . ClearPausedEngine ( ) ; this . Paragraph . RecalcInfo . Set _Type _0 _Spell ( pararecalc _0 _Spell _All ) } } ; CParagraphContentWithContentBase . prototype . Is _UseInDocument = function ( Id ) { if ( this . Paragraph ) { for ( var i = 0 ; i < this . Content . length ; ++ i ) if ( this . Content [ i ] . Get _Id &&
this . Content [ i ] . Get _Id ( ) === Id ) break ; if ( i < this . Content . length ) return this . Paragraph . Is _UseInDocument ( this . Get _Id ( ) ) } return false } ; CParagraphContentWithContentBase . prototype . IsUseInDocument = function ( sId ) { return this . Is _UseInDocument ( sId ) } ; CParagraphContentWithContentBase . prototype . protected _GetPrevRangeEndPos = function ( LineIndex , RangeIndex ) { var RangeCount = this . protected _GetRangesCount ( LineIndex - 1 ) ; var RangeOffset = this . protected _GetRangeOffset ( LineIndex - 1 , RangeCount - 1 ) ; return LineIndex == 0 && RangeIndex ==
0 ? 0 : this . Lines [ RangeOffset + 1 ] } ; CParagraphContentWithContentBase . prototype . private _UpdateTrackRevisions = function ( ) { if ( this . Paragraph && this . Paragraph . LogicDocument && this . Paragraph . LogicDocument . GetTrackRevisionsManager ) { var RevisionsManager = this . Paragraph . LogicDocument . GetTrackRevisionsManager ( ) ; RevisionsManager . CheckElement ( this . Paragraph ) } } ; CParagraphContentWithContentBase . prototype . CanSplit = function ( ) { return true } ; CParagraphContentWithContentBase . prototype . PreDelete = function ( ) { } ; CParagraphContentWithContentBase . prototype . private _UpdateDocumentOutline =
function ( ) { if ( this . Paragraph ) this . Paragraph . UpdateDocumentOutline ( ) } ; CParagraphContentWithContentBase . prototype . IsSolid = function ( ) { return false } ; CParagraphContentWithContentBase . prototype . ConvertParaContentPosToRangePos = function ( oContentPos , nDepth ) { return 0 } ; CParagraphContentWithContentBase . prototype . ProcessNotInlineObjectCheck = function ( oChecker ) { oChecker . Result = false ; oChecker . Found = true } ; function CParagraphContentWithParagraphLikeContent ( ) { CParagraphContentWithContentBase . call ( this ) ; this . Type = undefined ;
this . Paragraph = null ; this . m _oContentChanges = new AscCommon . CContentChanges ; this . Content = [ ] ; this . State = new CParaRunState ; this . Selection = this . State . Selection ; this . NearPosArray = [ ] ; this . SearchMarks = [ ] } CParagraphContentWithParagraphLikeContent . prototype = Object . create ( CParagraphContentWithContentBase . prototype ) ; CParagraphContentWithParagraphLikeContent . prototype . constructor = CParagraphContentWithParagraphLikeContent ; CParagraphContentWithParagraphLikeContent . prototype . Get _Type = function ( ) { return this . Type } ;
function ( ) { if ( this . Paragraph && this . Paragraph . UpdateDocumentOutline ) this . Paragraph . UpdateDocumentOutline ( ) } ; CParagraphContentWithContentBase . prototype . IsSolid = function ( ) { return false } ; CParagraphContentWithContentBase . prototype . ConvertParaContentPosToRangePos = function ( oContentPos , nDepth ) { return 0 } ; CParagraphContentWithContentBase . prototype . ProcessNotInlineObjectCheck = function ( oChecker ) { oChecker . Result = false ; oChecker . Found = true } ; function CParagraphContentWithParagraphLikeContent ( ) { CParagraphContentWithContentBase . call ( this ) ;
this . Type = undefined ; this . Paragraph = null ; this . m _oContentChanges = new AscCommon . CContentChanges ; this . Content = [ ] ; this . State = new CParaRunState ; this . Selection = this . State . Selection ; this . NearPosArray = [ ] ; this . SearchMarks = [ ] } CParagraphContentWithParagraphLikeContent . prototype = Object . create ( CParagraphContentWithContentBase . prototype ) ; CParagraphContentWithParagraphLikeContent . prototype . constructor = CParagraphContentWithParagraphLikeContent ; CParagraphContentWithParagraphLikeContent . prototype . Get _Type = function ( ) { return this . Type } ;
CParagraphContentWithParagraphLikeContent . prototype . Copy = function ( Selected , oPr ) { var NewElement = new this . constructor ; var StartPos = 0 ; var EndPos = this . Content . length - 1 ; if ( true === Selected && true === this . State . Selection . Use ) { StartPos = this . State . Selection . StartPos ; EndPos = this . State . Selection . EndPos ; if ( StartPos > EndPos ) { StartPos = this . State . Selection . EndPos ; EndPos = this . State . Selection . StartPos } } for ( var CurPos = StartPos ; CurPos <= EndPos ; CurPos ++ ) { var Item = this . Content [ CurPos ] ; if ( StartPos === CurPos || EndPos === CurPos ) NewElement . Add _ToContent ( CurPos -
StartPos , Item . Copy ( Selected , oPr ) ) ; else NewElement . Add _ToContent ( CurPos - StartPos , Item . Copy ( false , oPr ) ) } return NewElement } ; CParagraphContentWithParagraphLikeContent . prototype . GetSelectedContent = function ( oSelectedContent ) { var oNewElement = new this . constructor ; var nStartPos = this . State . Selection . StartPos ; var nEndPos = this . State . Selection . EndPos ; if ( nStartPos > nEndPos ) { nStartPos = this . State . Selection . EndPos ; nEndPos = this . State . Selection . StartPos } var nItemPos = 0 ; for ( var nPos = nStartPos , nItemPos = 0 ; nPos <= nEndPos ; ++ nPos ) { var oNewItem =
this . Content [ nPos ] . GetSelectedContent ( oSelectedContent ) ; if ( oNewItem ) { oNewElement . AddToContent ( nItemPos , oNewItem ) ; nItemPos ++ } } if ( 0 === nItemPos ) return null ; return oNewElement } ; CParagraphContentWithParagraphLikeContent . prototype . CopyContent = function ( Selected ) { var CopyContent = [ ] ; var StartPos = 0 ; var EndPos = this . Content . length - 1 ; if ( true === Selected && true === this . State . Selection . Use ) { StartPos = this . State . Selection . StartPos ; EndPos = this . State . Selection . EndPos ; if ( StartPos > EndPos ) { StartPos = this . State . Selection . EndPos ;
@ -16697,155 +16697,156 @@ CChangesParaTextPrUnderline.prototype.private_SetValue=function(Value){this.Clas
AscDFH . historyitem _TextPr _FontSize ; CChangesParaTextPrFontSize . prototype . private _SetValue = function ( Value ) { this . Class . Value . FontSize = Value } ; CChangesParaTextPrFontSize . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrColor ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrColor . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrColor . prototype . constructor = CChangesParaTextPrColor ;
CChangesParaTextPrColor . prototype . Type = AscDFH . historyitem _TextPr _Color ; CChangesParaTextPrColor . prototype . private _SetValue = function ( Value ) { this . Class . Value . Color = Value } ; CChangesParaTextPrColor . prototype . private _CreateObject = function ( ) { return new CDocumentColor ( 0 , 0 , 0 , false ) } ; CChangesParaTextPrColor . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrVertAlign ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrVertAlign . prototype =
Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrVertAlign . prototype . constructor = CChangesParaTextPrVertAlign ; CChangesParaTextPrVertAlign . prototype . Type = AscDFH . historyitem _TextPr _VertAlign ; CChangesParaTextPrVertAlign . prototype . private _SetValue = function ( Value ) { this . Class . Value . VertAlign = Value } ; CChangesParaTextPrVertAlign . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrHighLight ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class ,
Old , New , Color ) } CChangesParaTextPrHighLight . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrHighLight . prototype . constructor = CChangesParaTextPrHighLight ; CChangesParaTextPrHighLight . prototype . Type = AscDFH . historyitem _TextPr _HighLight ; CChangesParaTextPrHighLight . prototype . private _SetValue = function ( Value ) { this . Class . Value . HighLight = Value } ; CChangesParaTextPrHighLight . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |=
2 ; else if ( highlight _None === this . New ) nFlags |= 4 ; if ( undefined === this . Old ) nFlags |= 8 ; else if ( highlight _None === this . Old ) nFlags |= 16 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New && highlight _None !== this . New ) this . New . Write _ToBinary ( Writer ) ; if ( undefined !== this . Old && highlight _None !== this . Old ) this . Old . Write _ToBinary ( Writer ) } ; CChangesParaTextPrHighLight . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else if ( nFlags &
4 ) this . New = highlight _None ; else { this . New = new CDocumentColor ( 0 , 0 , 0 ) ; this . New . Read _FromBinary ( Reader ) } if ( nFlags & 8 ) this . Old = undefined ; else if ( nFlags & 16 ) this . Old = highlight _None ; else { this . Old = new CDocumentColor ( 0 , 0 , 0 ) ; this . Old . Read _FromBinary ( Reader ) } } ; CChangesParaTextPrHighLight . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrRStyle ( Class , Old , New , Color ) { AscDFH . CChangesBaseStringProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRStyle . prototype = Object . create ( AscDFH . CChangesBaseStringProperty . prototype ) ;
CChangesParaTextPrRStyle . prototype . constructor = CChangesParaTextPrRStyle ; CChangesParaTextPrRStyle . prototype . Type = AscDFH . historyitem _TextPr _RStyle ; CChangesParaTextPrRStyle . prototype . private _SetValue = function ( Value ) { this . Class . Value . RStyle = Value } ; CChangesParaTextPrRStyle . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrSpacing ( Class , Old , New , Color ) { AscDFH . CChangesBaseDoubleProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrSpacing . prototype = Object . create ( AscDFH . CChangesBaseDoubleProperty . prototype ) ;
CChangesParaTextPrSpacing . prototype . constructor = CChangesParaTextPrSpacing ; CChangesParaTextPrSpacing . prototype . Type = AscDFH . historyitem _TextPr _Spacing ; CChangesParaTextPrSpacing . prototype . private _SetValue = function ( Value ) { this . Class . Value . Spacing = Value } ; CChangesParaTextPrSpacing . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrDStrikeout ( Class , Old , New , Color ) { AscDFH . CChangesBaseBoolProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrDStrikeout . prototype = Object . create ( AscDFH . CChangesBaseBoolProperty . prototype ) ;
CChangesParaTextPrDStrikeout . prototype . constructor = CChangesParaTextPrDStrikeout ; CChangesParaTextPrDStrikeout . prototype . Type = AscDFH . historyitem _TextPr _DStrikeout ; CChangesParaTextPrDStrikeout . prototype . private _SetValue = function ( Value ) { this . Class . Value . DStrikeout = Value } ; CChangesParaTextPrDStrikeout . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrCaps ( Class , Old , New , Color ) { AscDFH . CChangesBaseBoolProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrCaps . prototype = Object . create ( AscDFH . CChangesBaseBoolProperty . prototype ) ;
CChangesParaTextPrCaps . prototype . constructor = CChangesParaTextPrCaps ; CChangesParaTextPrCaps . prototype . Type = AscDFH . historyitem _TextPr _Caps ; CChangesParaTextPrCaps . prototype . private _SetValue = function ( Value ) { this . Class . Value . Caps = Value } ; CChangesParaTextPrCaps . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrSmallCaps ( Class , Old , New , Color ) { AscDFH . CChangesBaseBoolProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrSmallCaps . prototype = Object . create ( AscDFH . CChangesBaseBoolProperty . prototype ) ;
CChangesParaTextPrSmallCaps . prototype . constructor = CChangesParaTextPrSmallCaps ; CChangesParaTextPrSmallCaps . prototype . Type = AscDFH . historyitem _TextPr _SmallCaps ; CChangesParaTextPrSmallCaps . prototype . private _SetValue = function ( Value ) { this . Class . Value . SmallCaps = Value } ; CChangesParaTextPrSmallCaps . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrPosition ( Class , Old , New , Color ) { AscDFH . CChangesBaseDoubleProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrPosition . prototype =
Object . create ( AscDFH . CChangesBaseDoubleProperty . prototype ) ; CChangesParaTextPrPosition . prototype . constructor = CChangesParaTextPrPosition ; CChangesParaTextPrPosition . prototype . Type = AscDFH . historyitem _TextPr _Position ; CChangesParaTextPrPosition . prototype . private _SetValue = function ( Value ) { this . Class . Value . Position = Value } ; CChangesParaTextPrPosition . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrValue ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old ,
New , Color ) } CChangesParaTextPrValue . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrValue . prototype . constructor = CChangesParaTextPrValue ; CChangesParaTextPrValue . prototype . Type = AscDFH . historyitem _TextPr _Value ; CChangesParaTextPrValue . prototype . private _SetValue = function ( Value ) { this . Class . Value = Value } ; CChangesParaTextPrValue . prototype . private _CreateObject = function ( ) { return new CTextPr } ; CChangesParaTextPrValue . prototype . private _IsCreateEmptyObject = function ( ) { return true } ;
CChangesParaTextPrValue . prototype . Merge = function ( oChange ) { if ( oChange . Class !== this . Class ) return true ; if ( oChange . Type === this . Type ) return false ; if ( ! this . New ) this . New = new CTextPr ; switch ( oChange . Type ) { case AscDFH . historyitem _TextPr _Bold : { this . New . Bold = oChange . New ; break } case AscDFH . historyitem _TextPr _Italic : { this . New . Italic = oChange . New ; break } case AscDFH . historyitem _TextPr _Strikeout : { this . New . Strikeout = oChange . New ; break } case AscDFH . historyitem _TextPr _Underline : { this . New . Underline = oChange . New ; break } case AscDFH . historyitem _TextPr _FontSize : { this . New . FontSize =
oChange . New ; break } case AscDFH . historyitem _TextPr _Color : { this . New . Color = oChange . New ; break } case AscDFH . historyitem _TextPr _VertAlign : { this . New . VertAlign = oChange . New ; break } case AscDFH . historyitem _TextPr _HighLight : { this . New . HighLight = oChange . New ; break } case AscDFH . historyitem _TextPr _RStyle : { this . New . RStyle = oChange . New ; break } case AscDFH . historyitem _TextPr _Spacing : { this . New . Spacing = oChange . New ; break } case AscDFH . historyitem _TextPr _DStrikeout : { this . New . DStrikeout = oChange . New ; break } case AscDFH . historyitem _TextPr _Caps : { this . New . Caps =
oChange . New ; break } case AscDFH . historyitem _TextPr _SmallCaps : { this . New . SmallCaps = oChange . New ; break } case AscDFH . historyitem _TextPr _Position : { this . New . Position = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts : { this . New . RFonts = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _Ascii : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . Ascii = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _HAnsi : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . HAnsi = oChange . New ;
break } case AscDFH . historyitem _TextPr _RFonts _CS : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . CS = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _EastAsia : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _Hint : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . Hint = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang : { this . New . Lang = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _Bidi : { if ( ! this . New . Lang ) this . New . Lang =
new CLang ; this . New . Lang . Bidi = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _EastAsia : { if ( ! this . New . Lang ) this . New . Lang = new CLang ; this . New . Lang . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _Val : { if ( ! this . New . Lang ) this . New . Lang = new CLang ; this . New . Lang . Val = oChange . New ; break } case AscDFH . historyitem _TextPr _Unifill : { this . New . Unifill = oChange . New ; break } case AscDFH . historyitem _TextPr _FontSizeCS : { this . New . FontSizeCS = oChange . New ; break } case AscDFH . historyitem _TextPr _Outline : { this . New . TextOutline =
oChange . New ; break } case AscDFH . historyitem _TextPr _Fill : { this . New . TextFill = oChange . New ; break } } return true } ; function CChangesParaTextPrRFonts ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFonts . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrRFonts . prototype . constructor = CChangesParaTextPrRFonts ; CChangesParaTextPrRFonts . prototype . Type = AscDFH . historyitem _TextPr _RFonts ; CChangesParaTextPrRFonts . prototype . private _SetValue =
function ( Value ) { this . Class . Value . RFonts = Value } ; CChangesParaTextPrRFonts . prototype . private _CreateObject = function ( ) { return new CRFonts } ; CChangesParaTextPrRFonts . prototype . private _IsCreateEmptyObject = function ( ) { return true } ; CChangesParaTextPrRFonts . prototype . Merge = function ( oChange ) { if ( this . Class !== oChange . Class ) return true ; if ( this . Type === oChange . Type || oChange . Type === AscDFH . historyitem _TextPr _Value ) return false ; if ( ! this . New ) this . New = new CRFonts ; switch ( oChange . Type ) { case AscDFH . historyitem _TextPr _RFonts _Ascii : { this . New . Ascii =
oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _HAnsi : { this . New . HAnsi = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _CS : { this . New . CS = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _EastAsia : { this . New . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _Hint : { this . New . Hint = oChange . New ; break } } return true } ; function CChangesParaTextPrRFontsAscii ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsAscii . prototype =
Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsAscii . prototype . constructor = CChangesParaTextPrRFontsAscii ; CChangesParaTextPrRFontsAscii . prototype . Type = AscDFH . historyitem _TextPr _RFonts _Ascii ; CChangesParaTextPrRFontsAscii . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !==
this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsAscii . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ; CChangesParaTextPrRFontsAscii . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . Ascii = Value } ; CChangesParaTextPrRFontsAscii . prototype . Merge =
private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsHAnsi ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsHAnsi . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsHAnsi . prototype . constructor = CChangesParaTextPrRFontsHAnsi ; CChangesParaTextPrRFontsHAnsi . prototype . Type = AscDFH . historyitem _TextPr _RFonts _HAnsi ; CChangesParaTextPrRFontsHAnsi . prototype . WriteToBinary = function ( Writer ) { var nFlags =
0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsHAnsi . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ;
else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ; CChangesParaTextPrRFontsHAnsi . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . HAnsi = Value } ; CChangesParaTextPrRFontsHAnsi . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsCS ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsCS . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsCS . prototype . constructor =
CChangesParaTextPrRFontsCS ; CChangesParaTextPrRFontsCS . prototype . Type = AscDFH . historyitem _TextPr _RFonts _CS ; CChangesParaTextPrRFontsCS . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsCS . prototype . ReadFromBinary = function ( Reader ) { var nFlags =
Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ; CChangesParaTextPrRFontsCS . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . CS = Value } ; CChangesParaTextPrRFontsCS . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsEastAsia ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this ,
Class , Old , New , Color ) } CChangesParaTextPrRFontsEastAsia . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsEastAsia . prototype . constructor = CChangesParaTextPrRFontsEastAsia ; CChangesParaTextPrRFontsEastAsia . prototype . Type = AscDFH . historyitem _TextPr _RFonts _EastAsia ; CChangesParaTextPrRFontsEastAsia . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ;
if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsEastAsia . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ; CChangesParaTextPrRFontsEastAsia . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . EastAsia =
Value } ; CChangesParaTextPrRFontsEastAsia . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsHint ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsHint . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrRFontsHint . prototype . constructor = CChangesParaTextPrRFontsHint ; CChangesParaTextPrRFontsHint . prototype . Type = AscDFH . historyitem _TextPr _RFonts _Hint ; CChangesParaTextPrRFontsHint . prototype . private _SetValue =
function ( Value ) { this . Class . Value . RFonts . Hint = Value } ; CChangesParaTextPrRFontsHint . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrLang ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLang . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrLang . prototype . constructor = CChangesParaTextPrLang ; CChangesParaTextPrLang . prototype . Type = AscDFH . historyitem _TextPr _Lang ; CChangesParaTextPrLang . prototype . private _SetValue =
function ( Value ) { this . Class . Value . Lang = Value } ; CChangesParaTextPrLang . prototype . private _CreateObject = function ( ) { return new CLang } ; CChangesParaTextPrLang . prototype . private _IsCreateEmptyObject = function ( ) { return true } ; CChangesParaTextPrLang . prototype . Merge = function ( oChange ) { if ( this . Class !== oChange . Class ) return true ; if ( AscDFH . historyitem _TextPr _Lang === oChange . Type || AscDFH . historyitem _TextPr _Value === oChange . Type ) return false ; if ( ! this . New ) this . New = new CLang ; switch ( oChange . Type ) { case AscDFH . historyitem _TextPr _Lang _Bidi : { this . New . Bidi =
oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _EastAsia : { this . New . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _Val : { this . New . Val = oChange . New ; break } } return true } ; function CChangesParaTextPrLangBidi ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLangBidi . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrLangBidi . prototype . constructor = CChangesParaTextPrLangBidi ; CChangesParaTextPrLangBidi . prototype . Type =
AscDFH . historyitem _TextPr _Lang _Bidi ; CChangesParaTextPrLangBidi . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang . Bidi = Value } ; CChangesParaTextPrLangBidi . prototype . Merge = private _ParaTextPrChangesOnMergeLangValue ; function CChangesParaTextPrLangEastAsia ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLangEastAsia . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrLangEastAsia . prototype . constructor = CChangesParaTextPrLangEastAsia ;
CChangesParaTextPrLangEastAsia . prototype . Type = AscDFH . historyitem _TextPr _Lang _EastAsia ; CChangesParaTextPrLangEastAsia . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang . EastAsia = Value } ; CChangesParaTextPrLangEastAsia . prototype . Merge = private _ParaTextPrChangesOnMergeLangValue ; function CChangesParaTextPrLangVal ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLangVal . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrLangVal . prototype . constructor =
CChangesParaTextPrLangVal ; CChangesParaTextPrLangVal . prototype . Type = AscDFH . historyitem _TextPr _Lang _Val ; CChangesParaTextPrLangVal . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang . Val = Value } ; CChangesParaTextPrLangVal . prototype . Merge = private _ParaTextPrChangesOnMergeLangValue ; function CChangesParaTextPrUnifill ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrUnifill . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ;
CChangesParaTextPrUnifill . prototype . constructor = CChangesParaTextPrUnifill ; CChangesParaTextPrUnifill . prototype . Type = AscDFH . historyitem _TextPr _Unifill ; CChangesParaTextPrUnifill . prototype . private _SetValue = function ( Value ) { this . Class . Value . Unifill = Value } ; CChangesParaTextPrUnifill . prototype . private _CreateObject = function ( ) { return new AscFormat . CUniFill } ; CChangesParaTextPrUnifill . prototype . Load = function ( Color ) { this . Redo ( ) ; var Unifill = this . Class . Value . Unifill ; if ( AscCommon . CollaborativeEditing && Unifill && Unifill . fill &&
Unifill . fill . type === Asc . c _oAscFill . FILL _TYPE _BLIP && typeof Unifill . fill . RasterImageId === "string" && Unifill . fill . RasterImageId . length > 0 ) AscCommon . CollaborativeEditing . Add _NewImage ( Unifill . fill . RasterImageId ) } ; CChangesParaTextPrUnifill . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrFontSizeCS ( Class , Old , New , Color ) { AscDFH . CChangesBaseDoubleProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrFontSizeCS . prototype = Object . create ( AscDFH . CChangesBaseDoubleProperty . prototype ) ;
CChangesParaTextPrFontSizeCS . prototype . constructor = CChangesParaTextPrFontSizeCS ; CChangesParaTextPrFontSizeCS . prototype . Type = AscDFH . historyitem _TextPr _FontSizeCS ; CChangesParaTextPrFontSizeCS . prototype . private _SetValue = function ( Value ) { this . Class . Value . FontSizeCS = Value } ; CChangesParaTextPrFontSizeCS . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrTextOutline ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrTextOutline . prototype =
Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrTextOutline . prototype . constructor = CChangesParaTextPrTextOutline ; CChangesParaTextPrTextOutline . prototype . Type = AscDFH . historyitem _TextPr _Outline ; CChangesParaTextPrTextOutline . prototype . private _SetValue = function ( Value ) { this . Class . Value . TextOutline = Value } ; CChangesParaTextPrTextOutline . prototype . private _CreateObject = function ( ) { return new AscFormat . CLn } ; CChangesParaTextPrTextOutline . prototype . Merge = private _ParaTextPrChangesOnMergeValue ;
function CChangesParaTextPrTextFill ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrTextFill . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrTextFill . prototype . constructor = CChangesParaTextPrTextFill ; CChangesParaTextPrTextFill . prototype . Type = AscDFH . historyitem _TextPr _Fill ; CChangesParaTextPrTextFill . prototype . private _SetValue = function ( Value ) { this . Class . Value . TextFill = Value } ; CChangesParaTextPrTextFill . prototype . private _CreateObject =
function ( ) { return new AscFormat . CUniFill } ; CChangesParaTextPrTextFill . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; "use strict" ; var drawing _Inline = 1 ; var drawing _Anchor = 2 ; var WRAPPING _TYPE _NONE = 0 ; var WRAPPING _TYPE _SQUARE = 1 ; var WRAPPING _TYPE _THROUGH = 2 ; var WRAPPING _TYPE _TIGHT = 3 ; var WRAPPING _TYPE _TOP _AND _BOTTOM = 4 ; var WRAP _HIT _TYPE _POINT = 0 ; var WRAP _HIT _TYPE _SECTION = 1 ; var c _oAscAlignH = Asc . c _oAscAlignH ; var c _oAscAlignV = Asc . c _oAscAlignV ; function ParaDrawing ( W , H , GraphicObj , DrawingDocument , DocumentContent ,
Parent ) { CRunElementBase . call ( this ) ; this . Id = AscCommon . g _oIdCounter . Get _NewId ( ) ; this . DrawingType = drawing _Inline ; this . GraphicObj = GraphicObj ; this . X = 0 ; this . Y = 0 ; this . Width = 0 ; this . Height = 0 ; this . OrigX = 0 ; this . OrigY = 0 ; this . ShiftX = 0 ; this . ShiftY = 0 ; this . PageNum = 0 ; this . LineNum = 0 ; this . YOffset = 0 ; this . DocumentContent = DocumentContent ; this . DrawingDocument = DrawingDocument ; this . Parent = Parent ; this . LogicDocument = DrawingDocument ? DrawingDocument . m _oLogicDocument : null ; this . Distance = { T : 0 , B : 0 , L : 0 , R : 0 } ; this . LayoutInCell = true ;
this . RelativeHeight = undefined ; this . SimplePos = { Use : false , X : 0 , Y : 0 } ; this . Extent = { W : W , H : H } ; this . EffectExtent = { L : 0 , T : 0 , R : 0 , B : 0 } ; this . docPr = new AscFormat . CNvPr ; this . SizeRelH = undefined ; this . SizeRelV = undefined ; this . AllowOverlap = true ; this . Locked = null ; this . Hidden = null ; this . PositionH = { RelativeFrom : c _oAscRelativeFromH . Column , Align : false , Value : 0 , Percent : false } ; this . PositionV = { RelativeFrom : c _oAscRelativeFromV . Paragraph , Align : false , Value : 0 , Percent : false } ; this . PositionH _Old = undefined ; this . PositionV _Old = undefined ;
this . Internal _Position = new CAnchorPosition ; this . wrappingType = WRAPPING _TYPE _THROUGH ; this . useWrap = true ; if ( typeof CWrapPolygon !== "undefined" ) this . wrappingPolygon = new CWrapPolygon ( this ) ; this . document = editor . WordControl . m _oLogicDocument ; this . drawingDocument = DrawingDocument ; this . graphicObjects = editor . WordControl . m _oLogicDocument . DrawingObjects ; this . selected = false ; this . behindDoc = false ; this . bNoNeedToAdd = false ; this . pageIndex = - 1 ; this . Lock = new AscCommon . CLock ; this . ParaMath = null ; this . SkipOnRecalculate = false ;
this . LineTop = null ; this . LineBottom = null ; g _oTableId . Add ( this , this . Id ) ; if ( this . graphicObjects ) { this . Set _RelativeHeight ( this . graphicObjects . getZIndex ( ) ) ; if ( History . Is _On ( ) && ! g _oTableId . m _bTurnOff ) this . graphicObjects . addGraphicObject ( this ) } } ParaDrawing . prototype = Object . create ( CRunElementBase . prototype ) ; ParaDrawing . prototype . constructor = ParaDrawing ; ParaDrawing . prototype . Type = para _Drawing ; ParaDrawing . prototype . Get _Type = function ( ) { return this . Type } ; ParaDrawing . prototype . Get _Width = function ( ) { return this . Width } ;
ParaDrawing . prototype . Get _WidthVisible = function ( ) { return this . WidthVisible } ; ParaDrawing . prototype . Set _WidthVisible = function ( WidthVisible ) { this . WidthVisible = WidthVisible } ; ParaDrawing . prototype . GetSelectedContent = function ( SelectedContent ) { if ( this . GraphicObj && this . GraphicObj . GetSelectedContent ) this . GraphicObj . GetSelectedContent ( SelectedContent ) } ; ParaDrawing . prototype . GetSearchElementId = function ( bNext , bCurrent ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . GetSearchElementId === "function" ) return this . GraphicObj . GetSearchElementId ( bNext ,
bCurrent ) ; return null } ; ParaDrawing . prototype . CheckCorrect = function ( ) { if ( ! this . GraphicObj ) return false ; if ( this . GraphicObj && this . GraphicObj . checkCorrect ) return this . GraphicObj . checkCorrect ( ) ; return true } ; ParaDrawing . prototype . GetAllDrawingObjects = function ( DrawingObjects ) { if ( null == DrawingObjects ) DrawingObjects = [ ] ; if ( this . GraphicObj . GetAllDrawingObjects ) this . GraphicObj . GetAllDrawingObjects ( DrawingObjects ) } ; ParaDrawing . prototype . canRotate = function ( ) { return AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . canRotate ==
"function" && this . GraphicObj . canRotate ( ) } ; ParaDrawing . prototype . GetParagraph = function ( ) { return this . Get _ParentParagraph ( ) } ; ParaDrawing . prototype . GetRun = function ( ) { return this . Get _Run ( ) } ; ParaDrawing . prototype . Get _Run = function ( ) { var oParagraph = this . Get _ParentParagraph ( ) ; if ( oParagraph ) return oParagraph . Get _DrawingObjectRun ( this . Id ) ; return null } ; ParaDrawing . prototype . Get _Props = function ( OtherProps ) { var Props = { } ; Props . Width = this . GraphicObj . extX ; Props . Height = this . GraphicObj . extY ; if ( drawing _Inline === this . DrawingType ) Props . WrappingStyle =
c _oAscWrapStyle2 . Inline ; else if ( WRAPPING _TYPE _NONE === this . wrappingType ) Props . WrappingStyle = this . behindDoc === true ? c _oAscWrapStyle2 . Behind : c _oAscWrapStyle2 . InFront ; else switch ( this . wrappingType ) { case WRAPPING _TYPE _SQUARE : Props . WrappingStyle = c _oAscWrapStyle2 . Square ; break ; case WRAPPING _TYPE _TIGHT : Props . WrappingStyle = c _oAscWrapStyle2 . Tight ; break ; case WRAPPING _TYPE _THROUGH : Props . WrappingStyle = c _oAscWrapStyle2 . Through ; break ; case WRAPPING _TYPE _TOP _AND _BOTTOM : Props . WrappingStyle = c _oAscWrapStyle2 . TopAndBottom ;
break ; default : Props . WrappingStyle = c _oAscWrapStyle2 . Inline ; break } if ( drawing _Inline === this . DrawingType ) Props . Paddings = { Left : AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT , Right : AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT , Top : 0 , Bottom : 0 } ; else { var oDistance = this . Get _Distance ( ) ; Props . Paddings = { Left : oDistance . L , Right : oDistance . R , Top : oDistance . T , Bottom : oDistance . B } } Props . AllowOverlap = this . AllowOverlap ; Props . Position = { X : this . X , Y : this . Y } ; Props . PositionH = { RelativeFrom : this . PositionH . RelativeFrom , UseAlign : this . PositionH . Align ,
Align : true === this . PositionH . Align ? this . PositionH . Value : undefined , Value : true === this . PositionH . Align ? 0 : this . PositionH . Value , Percent : this . PositionH . Percent } ; Props . PositionV = { RelativeFrom : this . PositionV . RelativeFrom , UseAlign : this . PositionV . Align , Align : true === this . PositionV . Align ? this . PositionV . Value : undefined , Value : true === this . PositionV . Align ? 0 : this . PositionV . Value , Percent : this . PositionV . Percent } ; if ( this . SizeRelH && this . SizeRelH . Percent > 0 ) Props . SizeRelH = { RelativeFrom : AscFormat . ConvertRelSizeHToRelPosition ( this . SizeRelH . RelativeFrom ) ,
Value : this . SizeRelH . Percent * 100 >> 0 } ; if ( this . SizeRelV && this . SizeRelV . Percent > 0 ) Props . SizeRelV = { RelativeFrom : AscFormat . ConvertRelSizeVToRelPosition ( this . SizeRelV . RelativeFrom ) , Value : this . SizeRelV . Percent * 100 >> 0 } ; Props . Internal _Position = this . Internal _Position ; Props . Locked = this . Lock . Is _Locked ( ) ; var ParentParagraph = this . Get _ParentParagraph ( ) ; if ( ParentParagraph && undefined !== ParentParagraph . Parent ) { var DocContent = ParentParagraph . Parent ; if ( true === DocContent . Is _DrawingShape ( ) || DocContent . GetTopDocumentContent ( ) instanceof
CFootEndnote ) Props . CanBeFlow = false } Props . title = this . docPr . title !== null ? this . docPr . title : undefined ; Props . description = this . docPr . descr !== null ? this . docPr . descr : undefined ; if ( null != OtherProps && undefined != OtherProps ) { if ( undefined === OtherProps . Width || . 001 > Math . abs ( Props . Width - OtherProps . Width ) ) Props . Width = undefined ; if ( undefined === OtherProps . Height || . 001 > Math . abs ( Props . Height - OtherProps . Height ) ) Props . Height = undefined ; if ( undefined === OtherProps . WrappingStyle || Props . WrappingStyle != OtherProps . WrappingStyle ) Props . WrappingStyle =
undefined ; if ( undefined === OtherProps . ImageUrl || Props . ImageUrl != OtherProps . ImageUrl ) Props . ImageUrl = undefined ; if ( undefined === OtherProps . Paddings . Left || . 001 > Math . abs ( Props . Paddings . Left - OtherProps . Paddings . Left ) ) Props . Paddings . Left = undefined ; if ( undefined === OtherProps . Paddings . Right || . 001 > Math . abs ( Props . Paddings . Right - OtherProps . Paddings . Right ) ) Props . Paddings . Right = undefined ; if ( undefined === OtherProps . Paddings . Top || . 001 > Math . abs ( Props . Paddings . Top - OtherProps . Paddings . Top ) ) Props . Paddings . Top = undefined ; if ( undefined ===
OtherProps . Paddings . Bottom || . 001 > Math . abs ( Props . Paddings . Bottom - OtherProps . Paddings . Bottom ) ) Props . Paddings . Bottom = undefined ; if ( undefined === OtherProps . AllowOverlap || Props . AllowOverlap != OtherProps . AllowOverlap ) Props . AllowOverlap = undefined ; if ( undefined === OtherProps . Position . X || . 001 > Math . abs ( Props . Position . X - OtherProps . Position . X ) ) Props . Position . X = undefined ; if ( undefined === OtherProps . Position . Y || . 001 > Math . abs ( Props . Position . Y - OtherProps . Position . Y ) ) Props . Position . Y = undefined ; if ( undefined === OtherProps . PositionH . RelativeFrom ||
Props . PositionH . RelativeFrom != OtherProps . PositionH . RelativeFrom ) Props . PositionH . RelativeFrom = undefined ; if ( undefined === OtherProps . PositionH . UseAlign || Props . PositionH . UseAlign != OtherProps . PositionH . UseAlign ) Props . PositionH . UseAlign = undefined ; if ( Props . PositionH . RelativeFrom === OtherProps . PositionH . RelativeFrom && Props . PositionH . UseAlign === OtherProps . PositionH . UseAlign ) { if ( true != Props . PositionH . UseAlign && . 001 > Math . abs ( Props . PositionH . Value - OtherProps . PositionH . Value ) ) Props . PositionH . Value = undefined ; if ( true ===
Props . PositionH . UseAlign && Props . PositionH . Align != OtherProps . PositionH . Align ) Props . PositionH . Align = undefined } if ( undefined === OtherProps . PositionV . RelativeFrom || Props . PositionV . RelativeFrom != OtherProps . PositionV . RelativeFrom ) Props . PositionV . RelativeFrom = undefined ; if ( undefined === OtherProps . PositionV . UseAlign || Props . PositionV . UseAlign != OtherProps . PositionV . UseAlign ) Props . PositionV . UseAlign = undefined ; if ( Props . PositionV . RelativeFrom === OtherProps . PositionV . RelativeFrom && Props . PositionV . UseAlign === OtherProps . PositionV . UseAlign ) { if ( true !=
Props . PositionV . UseAlign && . 001 > Math . abs ( Props . PositionV . Value - OtherProps . PositionV . Value ) ) Props . PositionV . Value = undefined ; if ( true === Props . PositionV . UseAlign && Props . PositionV . Align != OtherProps . PositionV . Align ) Props . PositionV . Align = undefined } if ( false === OtherProps . Locked ) Props . Locked = false ; if ( false === OtherProps . CanBeFlow || false === Props . CanBeFlow ) Props . CanBeFlow = false ; else Props . CanBeFlow = true ; if ( undefined === OtherProps . title || Props . title !== OtherProps . title ) Props . title = undefined ; if ( undefined === OtherProps . description ||
Props . description !== OtherProps . description ) Props . description = undefined } return Props } ; ParaDrawing . prototype . Is _UseInDocument = function ( ) { if ( this . Parent ) { var Run = this . Parent . Get _DrawingObjectRun ( this . Id ) ; if ( Run ) return Run . Is _UseInDocument ( this . Get _Id ( ) ) } return false } ; ParaDrawing . prototype . IsUseInDocument = function ( ) { return this . Is _UseInDocument ( ) } ; ParaDrawing . prototype . CheckGroupSizes = function ( ) { if ( this . GraphicObj && this . GraphicObj . CheckGroupSizes ) this . GraphicObj . CheckGroupSizes ( ) } ; ParaDrawing . prototype . Set _DrawingType =
function ( DrawingType ) { History . Add ( new CChangesParaDrawingDrawingType ( this , this . DrawingType , DrawingType ) ) ; this . DrawingType = DrawingType } ; ParaDrawing . prototype . Set _WrappingType = function ( WrapType ) { History . Add ( new CChangesParaDrawingWrappingType ( this , this . wrappingType , WrapType ) ) ; this . wrappingType = WrapType } ; ParaDrawing . prototype . Set _Distance = function ( L , T , R , B ) { var oDistance = this . Get _Distance ( ) ; if ( ! AscFormat . isRealNumber ( L ) ) L = oDistance . L ; if ( ! AscFormat . isRealNumber ( T ) ) T = oDistance . T ; if ( ! AscFormat . isRealNumber ( R ) ) R =
oDistance . R ; if ( ! AscFormat . isRealNumber ( B ) ) B = oDistance . B ; History . Add ( new CChangesParaDrawingDistance ( this , { Left : this . Distance . L , Top : this . Distance . T , Right : this . Distance . R , Bottom : this . Distance . B } , { Left : L , Top : T , Right : R , Bottom : B } ) ) ; this . Distance . L = L ; this . Distance . R = R ; this . Distance . T = T ; this . Distance . B = B } ; ParaDrawing . prototype . Set _AllowOverlap = function ( AllowOverlap ) { History . Add ( new CChangesParaDrawingAllowOverlap ( this , this . AllowOverlap , AllowOverlap ) ) ; this . AllowOverlap = AllowOverlap } ; ParaDrawing . prototype . Set _PositionH =
function ( RelativeFrom , Align , Value , Percent ) { var _Value , _Percent ; if ( AscFormat . isRealNumber ( Value ) && AscFormat . fApproxEqual ( Value , 0 ) && true === Percent ) { _Value = 0 ; _Percent = false } else { _Value = Value ; _Percent = Percent } History . Add ( new CChangesParaDrawingPositionH ( this , { RelativeFrom : this . PositionH . RelativeFrom , Align : this . PositionH . Align , Value : this . PositionH . Value , Percent : this . PositionH . Percent } , { RelativeFrom : RelativeFrom , Align : Align , Value : _Value , Percent : _Percent } ) ) ; this . PositionH . RelativeFrom = RelativeFrom ; this . PositionH . Align =
Align ; this . PositionH . Value = _Value ; this . PositionH . Percent = _Percent } ; ParaDrawing . prototype . Set _PositionV = function ( RelativeFrom , Align , Value , Percent ) { var _Value , _Percent ; if ( AscFormat . isRealNumber ( Value ) && AscFormat . fApproxEqual ( Value , 0 ) && true === Percent ) { _Value = 0 ; _Percent = false } else { _Value = Value ; _Percent = Percent } History . Add ( new CChangesParaDrawingPositionV ( this , { RelativeFrom : this . PositionV . RelativeFrom , Align : this . PositionV . Align , Value : this . PositionV . Value , Percent : this . PositionV . Percent } , { RelativeFrom : RelativeFrom ,
Align : Align , Value : _Value , Percent : _Percent } ) ) ; this . PositionV . RelativeFrom = RelativeFrom ; this . PositionV . Align = Align ; this . PositionV . Value = _Value ; this . PositionV . Percent = _Percent } ; ParaDrawing . prototype . GetPositionH = function ( ) { return { RelativeFrom : this . PositionH . RelativeFrom , Align : this . PositionH . Align , Value : this . PositionH . Value , Percent : this . PositionH . Percent } } ; ParaDrawing . prototype . GetPositionV = function ( ) { return { RelativeFrom : this . PositionV . RelativeFrom , Align : this . PositionV . Align , Value : this . PositionV . Value ,
Percent : this . PositionV . Percent } } ; ParaDrawing . prototype . Set _BehindDoc = function ( BehindDoc ) { History . Add ( new CChangesParaDrawingBehindDoc ( this , this . behindDoc , BehindDoc ) ) ; this . behindDoc = BehindDoc } ; ParaDrawing . prototype . Set _GraphicObject = function ( graphicObject ) { var oldId = AscCommon . isRealObject ( this . GraphicObj ) ? this . GraphicObj . Get _Id ( ) : null ; var newId = AscCommon . isRealObject ( graphicObject ) ? graphicObject . Get _Id ( ) : null ; History . Add ( new CChangesParaDrawingGraphicObject ( this , oldId , newId ) ) ; if ( graphicObject ) graphicObject . handleUpdateExtents ( ) ;
this . GraphicObj = graphicObject } ; ParaDrawing . prototype . setSimplePos = function ( use , x , y ) { History . Add ( new CChangesParaDrawingSimplePos ( this , { Use : this . SimplePos . Use , X : this . SimplePos . X , Y : this . SimplePos . Y } , { Use : use , X : x , Y : y } ) ) ; this . SimplePos . Use = use ; this . SimplePos . X = x ; this . SimplePos . Y = y } ; ParaDrawing . prototype . setExtent = function ( extX , extY ) { History . Add ( new CChangesParaDrawingExtent ( this , { W : this . Extent . W , H : this . Extent . H } , { W : extX , H : extY } ) ) ; this . Extent . W = extX ; this . Extent . H = extY } ; ParaDrawing . prototype . addWrapPolygon =
function ( wrapPolygon ) { History . Add ( new CChangesParaDrawingWrapPolygon ( this , this . wrappingPolygon , wrapPolygon ) ) ; this . wrappingPolygon = wrapPolygon } ; ParaDrawing . prototype . Set _Locked = function ( bLocked ) { History . Add ( new CChangesParaDrawingLocked ( this , this . Locked , bLocked ) ) ; this . Locked = bLocked } ; ParaDrawing . prototype . Set _RelativeHeight = function ( nRelativeHeight ) { History . Add ( new CChangesParaDrawingRelativeHeight ( this , this . RelativeHeight , nRelativeHeight ) ) ; this . Set _RelativeHeight2 ( nRelativeHeight ) } ; ParaDrawing . prototype . Set _RelativeHeight2 =
function ( nRelativeHeight ) { this . RelativeHeight = nRelativeHeight ; if ( this . graphicObjects && AscFormat . isRealNumber ( nRelativeHeight ) && nRelativeHeight > this . graphicObjects . maximalGraphicObjectZIndex ) this . graphicObjects . maximalGraphicObjectZIndex = nRelativeHeight } ; ParaDrawing . prototype . setEffectExtent = function ( L , T , R , B ) { var oEE = this . EffectExtent ; History . Add ( new CChangesParaDrawingEffectExtent ( this , { L : oEE . L , T : oEE . T , R : oEE . R , B : oEE . B } , { L : L , T : T , R : R , B : B } ) ) ; this . EffectExtent . L = L ; this . EffectExtent . T = T ; this . EffectExtent . R =
R ; this . EffectExtent . B = B } ; ParaDrawing . prototype . Set _Parent = function ( oParent ) { History . Add ( new CChangesParaDrawingParent ( this , this . Parent , oParent ) ) ; this . Parent = oParent } ; ParaDrawing . prototype . IsWatermark = function ( ) { if ( ! this . GraphicObj ) return false ; if ( this . GraphicObj . getObjectType ( ) !== AscDFH . historyitem _type _Shape && this . GraphicObj . getObjectType ( ) !== AscDFH . historyitem _type _ImageShape ) return false ; if ( this . Is _Inline ( ) ) return false ; var oParagraph = this . GetParagraph ( ) ; if ( ! ( oParagraph instanceof Paragraph ) ) return false ;
var oContent = oParagraph . Parent ; if ( ! oContent || oContent . Is _DrawingShape ( false ) ) return false ; var oHdrFtr = oContent . IsHdrFtr ( true ) ; if ( ! oHdrFtr ) return false ; var oRun = this . Get _Run ( ) ; if ( ! oRun ) return false ; var arrDocPos = oRun . GetDocumentPositionFromObject ( ) ; for ( var nIndex = 0 , nCount = arrDocPos . length ; nIndex < nCount ; ++ nIndex ) { var oClass = arrDocPos [ nIndex ] . Class ; var oSdt = null ; if ( oClass instanceof CDocumentContent && oClass . Parent instanceof CBlockLevelSdt ) oSdt = oClass . Parent ; else if ( oClass instanceof CInlineLevelSdt ) oSdt =
oClass ; if ( oSdt ) { var oPr = oSdt . Pr ; if ( AscCommon . isRealObject ( oPr ) && AscCommon . isRealObject ( oPr . DocPartObj ) && oPr . DocPartObj . Gallery === "Watermarks" ) return true } } return false } ; ParaDrawing . prototype . Set _ParaMath = function ( ParaMath ) { History . Add ( new CChangesParaDrawingParaMath ( this , this . ParaMath , ParaMath ) ) ; this . ParaMath = ParaMath } ; ParaDrawing . prototype . Set _LayoutInCell = function ( LayoutInCell ) { if ( this . LayoutInCell === LayoutInCell ) return ; History . Add ( new CChangesParaDrawingLayoutInCell ( this , this . LayoutInCell , LayoutInCell ) ) ;
this . LayoutInCell = LayoutInCell } ; ParaDrawing . prototype . SetSizeRelH = function ( oSize ) { History . Add ( new CChangesParaDrawingSizeRelH ( this , this . SizeRelH , oSize ) ) ; this . SizeRelH = oSize } ; ParaDrawing . prototype . SetSizeRelV = function ( oSize ) { History . Add ( new CChangesParaDrawingSizeRelV ( this , this . SizeRelV , oSize ) ) ; this . SizeRelV = oSize } ; ParaDrawing . prototype . getXfrmExtX = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && AscCommon . isRealObject ( this . GraphicObj . spPr ) && AscCommon . isRealObject ( this . GraphicObj . spPr . xfrm ) &&
AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extX ) ) return this . GraphicObj . spPr . xfrm . extX ; if ( AscFormat . isRealNumber ( this . Extent . W ) ) return this . Extent . W ; return 0 } ; ParaDrawing . prototype . getXfrmExtY = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && AscCommon . isRealObject ( this . GraphicObj . spPr ) && AscCommon . isRealObject ( this . GraphicObj . spPr . xfrm ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extY ) ) return this . GraphicObj . spPr . xfrm . extY ; if ( AscFormat . isRealNumber ( this . Extent . H ) ) return this . Extent . H ;
return 0 } ; ParaDrawing . prototype . getXfrmRot = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && AscCommon . isRealObject ( this . GraphicObj . spPr ) && AscCommon . isRealObject ( this . GraphicObj . spPr . xfrm ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . rot ) ) return this . GraphicObj . spPr . xfrm . rot ; return 0 } ; ParaDrawing . prototype . Get _Bounds = function ( ) { var InsL , InsT , InsR , InsB ; InsL = 0 ; InsT = 0 ; InsR = 0 ; InsB = 0 ; if ( ! this . Is _Inline ( ) ) { var oDistance = this . Get _Distance ( ) ; if ( oDistance ) { InsL = oDistance . L ; InsT = oDistance . T ; InsR =
oDistance . R ; InsB = oDistance . B } } var ExtX = this . getXfrmExtX ( ) ; var ExtY = this . getXfrmExtY ( ) ; var Rot = this . getXfrmRot ( ) ; var X , Y , W , H ; if ( AscFormat . checkNormalRotate ( Rot ) ) { X = this . X ; Y = this . Y ; W = ExtX ; H = ExtY } else { X = this . X + ExtX / 2 - ExtY / 2 ; Y = this . Y + ExtY / 2 - ExtX / 2 ; W = ExtY ; H = ExtX } return { Left : X - this . EffectExtent . L - InsL , Top : Y - this . EffectExtent . T - InsT , Bottom : Y + H + this . EffectExtent . B + InsB , Right : X + W + this . EffectExtent . R + InsR } } ; ParaDrawing . prototype . Search = function ( Str , Props , SearchEngine , Type ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . Search === "function" ) this . GraphicObj . Search ( Str , Props , SearchEngine , Type ) } ; ParaDrawing . prototype . Set _Props = function ( Props ) { var bCheckWrapPolygon = false ; var isPictureCC = false ; var oRun = this . GetRun ( ) ; if ( oRun ) { var arrContentControls = oRun . GetParentContentControls ( ) ; for ( var nIndex = 0 , nCount = arrContentControls . length ; nIndex < nCount ; ++ nIndex ) if ( arrContentControls [ nIndex ] . IsPicture ( ) ) { isPictureCC = true ; break } } if ( undefined != Props . WrappingStyle && ! isPictureCC ) { if ( drawing _Inline === this . DrawingType &&
c _oAscWrapStyle2 . Inline != Props . WrappingStyle && undefined === Props . Paddings ) this . Set _Distance ( 3.2 , 0 , 3.2 , 0 ) ; this . Set _DrawingType ( c _oAscWrapStyle2 . Inline === Props . WrappingStyle ? drawing _Inline : drawing _Anchor ) ; if ( c _oAscWrapStyle2 . Inline === Props . WrappingStyle ) if ( AscCommon . isRealObject ( this . GraphicObj . bounds ) && AscFormat . isRealNumber ( this . GraphicObj . bounds . w ) && AscFormat . isRealNumber ( this . GraphicObj . bounds . h ) ) this . CheckWH ( ) ; if ( c _oAscWrapStyle2 . Behind === Props . WrappingStyle || c _oAscWrapStyle2 . InFront === Props . WrappingStyle ) { this . Set _WrappingType ( WRAPPING _TYPE _NONE ) ;
this . Set _BehindDoc ( c _oAscWrapStyle2 . Behind === Props . WrappingStyle ? true : false ) } else { switch ( Props . WrappingStyle ) { case c _oAscWrapStyle2 . Square : this . Set _WrappingType ( WRAPPING _TYPE _SQUARE ) ; break ; case c _oAscWrapStyle2 . Tight : { bCheckWrapPolygon = true ; this . Set _WrappingType ( WRAPPING _TYPE _TIGHT ) ; break } case c _oAscWrapStyle2 . Through : { this . Set _WrappingType ( WRAPPING _TYPE _THROUGH ) ; bCheckWrapPolygon = true ; break } case c _oAscWrapStyle2 . TopAndBottom : this . Set _WrappingType ( WRAPPING _TYPE _TOP _AND _BOTTOM ) ; break ; default : this . Set _WrappingType ( WRAPPING _TYPE _SQUARE ) ;
break } this . Set _BehindDoc ( false ) } } if ( undefined != Props . Paddings ) this . Set _Distance ( Props . Paddings . Left , Props . Paddings . Top , Props . Paddings . Right , Props . Paddings . Bottom ) ; if ( undefined != Props . AllowOverlap ) this . Set _AllowOverlap ( Props . AllowOverlap ) ; if ( undefined != Props . PositionH ) this . Set _PositionH ( Props . PositionH . RelativeFrom , Props . PositionH . UseAlign , true === Props . PositionH . UseAlign ? Props . PositionH . Align : Props . PositionH . Value , Props . PositionH . Percent ) ; if ( undefined != Props . PositionV ) this . Set _PositionV ( Props . PositionV . RelativeFrom ,
Props . PositionV . UseAlign , true === Props . PositionV . UseAlign ? Props . PositionV . Align : Props . PositionV . Value , Props . PositionV . Percent ) ; if ( undefined != Props . SizeRelH ) this . SetSizeRelH ( { RelativeFrom : AscFormat . ConvertRelPositionHToRelSize ( Props . SizeRelH . RelativeFrom ) , Percent : Props . SizeRelH . Value / 100 } ) ; if ( undefined != Props . SizeRelV ) this . SetSizeRelV ( { RelativeFrom : AscFormat . ConvertRelPositionVToRelSize ( Props . SizeRelV . RelativeFrom ) , Percent : Props . SizeRelV . Value / 100 } ) ; if ( this . SizeRelH && ! this . SizeRelV ) this . SetSizeRelV ( { RelativeFrom : AscCommon . c _oAscSizeRelFromV . sizerelfromvPage ,
Percent : 0 } ) ; if ( this . SizeRelV && ! this . SizeRelH ) this . SetSizeRelH ( { RelativeFrom : AscCommon . c _oAscSizeRelFromH . sizerelfromhPage , Percent : 0 } ) ; if ( bCheckWrapPolygon ) this . Check _WrapPolygon ( ) ; if ( undefined != Props . description ) this . docPr . setDescr ( Props . description ) ; if ( undefined != Props . title ) this . docPr . setTitle ( Props . title ) } ; ParaDrawing . prototype . CheckWH = function ( ) { if ( ! this . GraphicObj ) return ; var oldExtW = this . Extent . W ; var oldExtH = this . Extent . H ; if ( this . GraphicObj . spPr && this . GraphicObj . spPr . xfrm && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extX ) &&
AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extY ) ) { this . Extent . W = this . GraphicObj . spPr . xfrm . extX ; this . Extent . H = this . GraphicObj . spPr . xfrm . extY } this . GraphicObj . recalculate ( ) ; this . Extent . W = oldExtW ; this . Extent . H = oldExtH ; var extX , extY , rot ; if ( this . GraphicObj . spPr && this . GraphicObj . spPr . xfrm ) { if ( AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extX ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extY ) ) { extX = this . GraphicObj . spPr . xfrm . extX ; extY = this . GraphicObj . spPr . xfrm . extY } else { extX = 5 ; extY = 5 } if ( AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . rot ) ) rot =
this . GraphicObj . spPr . xfrm . rot ; else rot = 0 } else { extX = 5 ; extY = 5 ; rot = 0 } this . setExtent ( extX , extY ) ; var EEL = 0 , EET = 0 , EER = 0 , EEB = 0 ; { var xc = this . GraphicObj . localTransform . TransformPointX ( this . GraphicObj . extX / 2 , this . GraphicObj . extY / 2 ) ; var yc = this . GraphicObj . localTransform . TransformPointY ( this . GraphicObj . extX / 2 , this . GraphicObj . extY / 2 ) ; var oBounds = this . GraphicObj . bounds ; var LineCorrect = 0 ; if ( this . GraphicObj . pen && this . GraphicObj . pen . Fill && this . GraphicObj . pen . Fill . fill ) { LineCorrect = this . GraphicObj . pen . w == null ? 12700 :
parseInt ( this . GraphicObj . pen . w ) ; LineCorrect /= 72E3 } var l = oBounds . x ; var r = l + oBounds . w ; var t = oBounds . y ; var b = t + oBounds . h ; var startX , startY ; if ( ! AscFormat . checkNormalRotate ( rot ) ) { var temp = extX ; extX = extY ; extY = temp } startX = xc - extX / 2 ; startY = yc - extY / 2 ; if ( l > startX ) l = startX ; if ( r < startX + extX ) r = startX + extX ; if ( t > startY ) t = startY ; if ( b < startY + extY ) b = startY + extY ; EEL = xc - extX / 2 - l + LineCorrect ; EET = yc - extY / 2 - t + LineCorrect ; EER = r + LineCorrect - ( xc + extX / 2 ) ; EEB = b + LineCorrect - ( yc + extY / 2 ) } this . setEffectExtent ( EEL , EET , EER , EEB ) ; this . Check _WrapPolygon ( ) } ;
ParaDrawing . prototype . Check _WrapPolygon = function ( ) { if ( ( this . wrappingType === WRAPPING _TYPE _TIGHT || this . wrappingType === WRAPPING _TYPE _THROUGH ) && this . wrappingPolygon && ! this . wrappingPolygon . edited ) { this . GraphicObj . recalculate ( ) ; this . wrappingPolygon . setArrRelPoints ( this . wrappingPolygon . calculate ( this . GraphicObj ) ) } } ; ParaDrawing . prototype . Draw = function ( X , Y , pGraphics , PDSE ) { var nPageIndex = null ; if ( AscCommon . isRealObject ( PDSE ) ) nPageIndex = PDSE . Page ; if ( pGraphics . Start _Command ) { pGraphics . m _aDrawings . push ( new AscFormat . ParaDrawingStruct ( undefined ,
this ) ) ; return } if ( this . Is _Inline ( ) ) { pGraphics . shapePageIndex = nPageIndex ; this . draw ( pGraphics , PDSE ) ; pGraphics . shapePageIndex = null } if ( pGraphics . End _Command ) pGraphics . End _Command ( ) } ; ParaDrawing . prototype . Measure = function ( ) { if ( ! this . GraphicObj ) { this . Width = 0 ; this . Height = 0 ; return } if ( AscFormat . isRealNumber ( this . Extent . W ) && AscFormat . isRealNumber ( this . Extent . H ) && ( ! this . GraphicObj . checkAutofit || ! this . GraphicObj . checkAutofit ( ) ) && ! this . SizeRelH && ! this . SizeRelV ) { var oEffectExtent = this . EffectExtent ; var W , H ; if ( AscFormat . isRealNumber ( this . GraphicObj . rot ) ) if ( AscFormat . checkNormalRotate ( this . GraphicObj . rot ) ) { W =
this . Extent . W ; H = this . Extent . H } else { W = this . Extent . H ; H = this . Extent . W } else { W = this . Extent . W ; H = this . Extent . H } this . Width = W + AscFormat . getValOrDefault ( oEffectExtent . L , 0 ) + AscFormat . getValOrDefault ( oEffectExtent . R , 0 ) ; this . Height = H + AscFormat . getValOrDefault ( oEffectExtent . T , 0 ) + AscFormat . getValOrDefault ( oEffectExtent . B , 0 ) ; this . WidthVisible = this . Width } else { this . GraphicObj . recalculate ( ) ; if ( this . GraphicObj . recalculateText ) this . GraphicObj . recalculateText ( ) ; if ( this . PositionH . UseAlign || this . Is _Inline ( ) ) this . Width = this . GraphicObj . bounds . w ;
else this . Width = this . GraphicObj . extX ; this . WidthVisible = this . Width ; if ( this . PositionV . UseAlign || this . Is _Inline ( ) ) this . Height = this . GraphicObj . bounds . h ; else this . Height = this . GraphicObj . extY } } ; ParaDrawing . prototype . SaveRecalculateObject = function ( Copy ) { var DrawingObj = { } ; DrawingObj . Type = this . Type ; DrawingObj . DrawingType = this . DrawingType ; DrawingObj . WrappingType = this . wrappingType ; if ( drawing _Anchor === this . Get _DrawingType ( ) && true === this . Use _TextWrap ( ) ) { var oDistance = this . Get _Distance ( ) ; DrawingObj . FlowPos = { X : this . X -
oDistance . L , Y : this . Y - oDistance . T , W : this . Width + oDistance . R , H : this . Height + oDistance . B } } DrawingObj . PageNum = this . PageNum ; DrawingObj . X = this . X ; DrawingObj . Y = this . Y ; DrawingObj . spRecaclcObject = this . GraphicObj . getRecalcObject ( ) ; return DrawingObj } ; ParaDrawing . prototype . LoadRecalculateObject = function ( RecalcObj ) { this . updatePosition3 ( RecalcObj . PageNum , RecalcObj . X , RecalcObj . Y ) ; this . GraphicObj . setRecalcObject ( RecalcObj . spRecaclcObject ) } ; ParaDrawing . prototype . Reassign _ImageUrls = function ( mapUrls ) { if ( this . GraphicObj ) this . GraphicObj . Reassign _ImageUrls ( mapUrls ) } ;
ParaDrawing . prototype . PrepareRecalculateObject = function ( ) { } ; ParaDrawing . prototype . Is _RealContent = function ( ) { return true } ; ParaDrawing . prototype . Can _AddNumbering = function ( ) { if ( drawing _Inline === this . DrawingType ) return true ; return false } ; ParaDrawing . prototype . Copy = function ( oPr ) { var c = new ParaDrawing ( this . Extent . W , this . Extent . H , null , editor . WordControl . m _oLogicDocument . DrawingDocument , null , null ) ; c . Set _DrawingType ( this . DrawingType ) ; if ( AscCommon . isRealObject ( this . GraphicObj ) ) { var oCopyPr = new AscFormat . CCopyObjectProperties ;
oCopyPr . contentCopyPr = oPr ; c . Set _GraphicObject ( this . GraphicObj . copy ( oCopyPr ) ) ; c . GraphicObj . setParent ( c ) } var d = this . Distance ; c . Set _PositionH ( this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value , this . PositionH . Percent ) ; c . Set _PositionV ( this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) ; c . Set _Distance ( d . L , d . T , d . R , d . B ) ; c . Set _AllowOverlap ( this . AllowOverlap ) ; c . Set _WrappingType ( this . wrappingType ) ; if ( this . wrappingPolygon ) c . wrappingPolygon . fromOther ( this . wrappingPolygon ) ;
c . Set _BehindDoc ( this . behindDoc ) ; c . Set _RelativeHeight ( this . RelativeHeight ) ; if ( this . SizeRelH ) c . SetSizeRelH ( { RelativeFrom : this . SizeRelH . RelativeFrom , Percent : this . SizeRelH . Percent } ) ; if ( this . SizeRelV ) c . SetSizeRelV ( { RelativeFrom : this . SizeRelV . RelativeFrom , Percent : this . SizeRelV . Percent } ) ; if ( AscFormat . isRealNumber ( this . Extent . W ) && AscFormat . isRealNumber ( this . Extent . H ) ) c . setExtent ( this . Extent . W , this . Extent . H ) ; var EE = this . EffectExtent ; if ( EE . L > 0 || EE . T > 0 || EE . R > 0 || EE . B > 0 ) c . setEffectExtent ( EE . L , EE . T , EE . R , EE . B ) ;
c . docPr . setFromOther ( this . docPr ) ; if ( this . ParaMath ) c . Set _ParaMath ( this . ParaMath . Copy ( ) ) ; return c } ; ParaDrawing . prototype . IsEqual = function ( oElement ) { return false } ; ParaDrawing . prototype . Get _Id = function ( ) { return this . Id } ; ParaDrawing . prototype . GetId = function ( ) { return this . Id } ; ParaDrawing . prototype . setParagraphTabs = function ( tabs ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphTabs === "function" ) this . GraphicObj . setParagraphTabs ( tabs ) } ; ParaDrawing . prototype . IsMovingTableBorder =
function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . IsMovingTableBorder === "function" ) return this . GraphicObj . IsMovingTableBorder ( ) ; return false } ; ParaDrawing . prototype . SetVerticalClip = function ( Top , Bottom ) { this . LineTop = Top ; this . LineBottom = Bottom } ; ParaDrawing . prototype . Update _Position = function ( Paragraph , ParaLayout , PageLimits , PageLimitsOrigin , LineNum ) { if ( undefined != this . PositionH _Old ) { this . PositionH . RelativeFrom = this . PositionH _Old . RelativeFrom2 ; this . PositionH . Align = this . PositionH _Old . Align2 ;
this . PositionH . Value = this . PositionH _Old . Value2 ; this . PositionH . Percent = this . PositionH _Old . Percent2 } if ( undefined != this . PositionV _Old ) { this . PositionV . RelativeFrom = this . PositionV _Old . RelativeFrom2 ; this . PositionV . Align = this . PositionV _Old . Align2 ; this . PositionV . Value = this . PositionV _Old . Value2 ; this . PositionV . Percent = this . PositionV _Old . Percent2 } var oDocumentContent = this . Parent && this . Parent . Parent ; if ( oDocumentContent && oDocumentContent . IsBlockLevelSdtContent ( ) ) oDocumentContent = oDocumentContent . Parent . Parent ;
this . Parent = Paragraph ; this . DocumentContent = oDocumentContent ; var PageNum = ParaLayout . PageNum ; var OtherFlowObjects = editor . WordControl . m _oLogicDocument . DrawingObjects . getAllFloatObjectsOnPage ( PageNum , this . Parent . Parent ) ; var bInline = this . Is _Inline ( ) ; this . Internal _Position . Set ( this . GraphicObj . extX , this . GraphicObj . extY , this . getXfrmRot ( ) , this . EffectExtent , this . YOffset , ParaLayout , PageLimits ) ; this . Internal _Position . Calculate _X ( bInline , this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value , this . PositionH . Percent ) ;
this . Internal _Position . Calculate _Y ( bInline , this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) ; var bCorrect = false ; if ( oDocumentContent && oDocumentContent . IsTableCellContent && oDocumentContent . IsTableCellContent ( false ) ) bCorrect = true ; if ( this . PositionH . RelativeFrom !== c _oAscRelativeFromH . Page || this . PositionV . RelativeFrom !== c _oAscRelativeFromV . Page ) bCorrect = true ; this . Internal _Position . Correct _Values ( bInline , PageLimits , this . AllowOverlap , this . Use _TextWrap ( ) , OtherFlowObjects ,
bCorrect ) ; this . GraphicObj . bounds . l = this . GraphicObj . bounds . x + this . Internal _Position . CalcX ; this . GraphicObj . bounds . r = this . GraphicObj . bounds . x + this . GraphicObj . bounds . w + this . Internal _Position . CalcX ; this . GraphicObj . bounds . t = this . GraphicObj . bounds . y + this . Internal _Position . CalcY ; this . GraphicObj . bounds . b = this . GraphicObj . bounds . y + this . GraphicObj . bounds . h + this . Internal _Position . CalcY ; var OldPageNum = this . PageNum ; this . PageNum = PageNum ; this . LineNum = LineNum ; this . X = this . Internal _Position . CalcX ; this . Y = this . Internal _Position . CalcY ;
if ( undefined != this . PositionH _Old ) { this . PositionH . RelativeFrom = this . PositionH _Old . RelativeFrom ; this . PositionH . Align = this . PositionH _Old . Align ; this . PositionH . Value = this . PositionH _Old . Value ; this . PositionH . Percent = this . PositionH _Old . Percent ; var Value = this . Internal _Position . Calculate _X _Value ( this . PositionH _Old . RelativeFrom ) ; this . Set _PositionH ( this . PositionH _Old . RelativeFrom , false , Value , false ) ; this . X = this . Internal _Position . Calculate _X ( bInline , this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value ,
this . PositionH . Percent ) } if ( undefined != this . PositionV _Old ) { this . PositionV . RelativeFrom = this . PositionV _Old . RelativeFrom ; this . PositionV . Align = this . PositionV _Old . Align ; this . PositionV . Value = this . PositionV _Old . Value ; this . PositionV . Percent = this . PositionV _Old . Percent ; var Value = this . Internal _Position . Calculate _Y _Value ( this . PositionV _Old . RelativeFrom ) ; this . Set _PositionV ( this . PositionV _Old . RelativeFrom , false , Value , false ) ; this . Y = this . Internal _Position . Calculate _Y ( bInline , this . PositionV . RelativeFrom , this . PositionV . Align ,
this . PositionV . Value , this . PositionV . Percent ) } this . OrigX = this . X ; this . OrigY = this . Y ; this . ShiftX = 0 ; this . ShiftY = 0 ; this . updatePosition3 ( this . PageNum , this . X , this . Y , OldPageNum ) ; this . useWrap = this . Use _TextWrap ( ) } ; ParaDrawing . prototype . GetClipRect = function ( ) { if ( this . Is _Inline ( ) || this . Use _TextWrap ( ) ) { var oCell ; if ( this . DocumentContent && ( oCell = this . DocumentContent . IsTableCellContent ( true ) ) ) { var arrPages = oCell . GetCurPageByAbsolutePage ( this . PageNum ) ; for ( var nIndex = 0 , nCount = arrPages . length ; nIndex < nCount ; ++ nIndex ) { var oPageBounds =
oCell . GetPageBounds ( arrPages [ nIndex ] ) ; if ( this . GraphicObj . bounds . isIntersect ( oPageBounds . Left , oPageBounds . Top , oPageBounds . Right , oPageBounds . Bottom ) ) return new AscFormat . CGraphicBounds ( oPageBounds . Left , oPageBounds . Top , oPageBounds . Right , oPageBounds . Bottom ) } } } return null } ; ParaDrawing . prototype . Update _PositionYHeaderFooter = function ( TopMarginY , BottomMarginY ) { this . Internal _Position . Update _PositionYHeaderFooter ( TopMarginY , BottomMarginY ) ; this . Internal _Position . Calculate _Y ( this . Is _Inline ( ) , this . PositionV . RelativeFrom ,
this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) ; this . OrigY = this . Internal _Position . CalcY ; this . Y = this . OrigY + this . ShiftY ; this . updatePosition3 ( this . PageNum , this . X , this . Y , this . PageNum ) } ; ParaDrawing . prototype . Reset _SavedPosition = function ( ) { this . PositionV _Old = undefined ; this . PositionH _Old = undefined } ; ParaDrawing . prototype . setParagraphBorders = function ( val ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphBorders === "function" ) this . GraphicObj . setParagraphBorders ( val ) } ;
ParaDrawing . prototype . deselect = function ( ) { this . selected = false ; if ( this . GraphicObj && this . GraphicObj . deselect ) this . GraphicObj . deselect ( ) } ; ParaDrawing . prototype . updatePosition3 = function ( pageIndex , x , y , oldPageNum ) { var _x = x , _y = y ; this . graphicObjects . removeById ( pageIndex , this . Get _Id ( ) ) ; if ( AscFormat . isRealNumber ( oldPageNum ) ) this . graphicObjects . removeById ( oldPageNum , this . Get _Id ( ) ) ; var bChangePageIndex = this . pageIndex !== pageIndex ; this . setPageIndex ( pageIndex ) ; if ( typeof this . GraphicObj . setStartPage === "function" ) { var bIsHfdFtr =
this . DocumentContent && this . DocumentContent . IsHdrFtr ( ) ; this . GraphicObj . setStartPage ( pageIndex , bIsHfdFtr , bIsHfdFtr || bChangePageIndex ) } if ( ! ( this . DocumentContent && this . DocumentContent . IsHdrFtr ( ) && this . DocumentContent . Get _StartPage _Absolute ( ) !== pageIndex ) ) { this . graphicObjects . addObjectOnPage ( pageIndex , this . GraphicObj ) ; this . bNoNeedToAdd = false } else this . bNoNeedToAdd = true ; if ( this . GraphicObj . bNeedUpdatePosition || ! ( AscFormat . isRealNumber ( this . GraphicObj . posX ) && AscFormat . isRealNumber ( this . GraphicObj . posY ) ) ||
! ( Math . abs ( this . GraphicObj . posX - _x ) < MOVE _DELTA && Math . abs ( this . GraphicObj . posY - _y ) < MOVE _DELTA ) ) this . GraphicObj . updatePosition ( _x , _y ) ; if ( this . GraphicObj . bNeedUpdatePosition || ! ( AscFormat . isRealNumber ( this . wrappingPolygon . posX ) && AscFormat . isRealNumber ( this . wrappingPolygon . posY ) ) || ! ( Math . abs ( this . wrappingPolygon . posX - _x ) < MOVE _DELTA && Math . abs ( this . wrappingPolygon . posY - _y ) < MOVE _DELTA ) ) this . wrappingPolygon . updatePosition ( _x , _y ) ; this . calculateSnapArrays ( ) } ; ParaDrawing . prototype . calculateAfterChangeTheme = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . calculateAfterChangeTheme === "function" ) this . GraphicObj . calculateAfterChangeTheme ( ) } ; ParaDrawing . prototype . selectionIsEmpty = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . selectionIsEmpty === "function" ) return this . GraphicObj . selectionIsEmpty ( ) ; return false } ; ParaDrawing . prototype . recalculateDocContent = function ( ) { } ; ParaDrawing . prototype . Shift = function ( Dx , Dy ) { this . ShiftX = Dx ; this . ShiftY = Dy ; this . X = this . OrigX + Dx ; this . Y = this . OrigY + Dy ; this . updatePosition3 ( this . PageNum ,
this . X , this . Y ) } ; ParaDrawing . prototype . IsLayoutInCell = function ( ) { if ( this . LogicDocument && this . LogicDocument . GetCompatibilityMode ( ) >= AscCommon . document _compatibility _mode _Word15 ) return true ; return this . LayoutInCell } ; ParaDrawing . prototype . Get _Distance = function ( ) { var oDist = this . Distance ; return new AscFormat . CDistance ( AscFormat . getValOrDefault ( oDist . L , AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT ) , AscFormat . getValOrDefault ( oDist . T , 0 ) , AscFormat . getValOrDefault ( oDist . R , AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT ) , AscFormat . getValOrDefault ( oDist . B ,
0 ) ) } ; ParaDrawing . prototype . Set _XYForAdd = function ( X , Y , NearPos , PageNum ) { if ( null !== NearPos ) { var Layout = NearPos . Paragraph . Get _Layout ( NearPos . ContentPos , this ) ; this . private _SetXYByLayout ( X , Y , PageNum , Layout , true , true ) ; var nRecalcIndex = null ; var oLogicDocument = this . document ; if ( oLogicDocument ) { nRecalcIndex = oLogicDocument . Get _History ( ) . GetRecalculateIndex ( ) ; this . SetSkipOnRecalculate ( true ) ; oLogicDocument . TurnOff _InterfaceEvents ( ) ; oLogicDocument . Recalculate ( ) ; oLogicDocument . TurnOn _InterfaceEvents ( false ) ; this . SetSkipOnRecalculate ( false ) } if ( null !==
nRecalcIndex ) oLogicDocument . Get _History ( ) . SetRecalculateIndex ( nRecalcIndex ) ; Layout = NearPos . Paragraph . Get _Layout ( NearPos . ContentPos , this ) ; this . private _SetXYByLayout ( X , Y , PageNum , Layout , true , true ) } } ; ParaDrawing . prototype . SetSkipOnRecalculate = function ( isSkip ) { this . SkipOnRecalculate = isSkip } ; ParaDrawing . prototype . IsSkipOnRecalculate = function ( ) { return this . SkipOnRecalculate } ; ParaDrawing . prototype . Set _XY = function ( X , Y , Paragraph , PageNum , bResetAlign ) { if ( Paragraph ) { var PageNumOld = this . PageNum ; var ContentPos =
Paragraph . Get _DrawingObjectContentPos ( this . Get _Id ( ) ) ; if ( null === ContentPos ) return ; var Layout = Paragraph . Get _Layout ( ContentPos , this ) ; this . private _SetXYByLayout ( X , Y , PageNum , Layout , bResetAlign || true !== this . PositionH . Align ? true : false , bResetAlign || true !== this . PositionV . Align ? true : false ) ; var nRecalcIndex = null ; var oLogicDocument = this . document ; if ( oLogicDocument ) { nRecalcIndex = oLogicDocument . Get _History ( ) . GetRecalculateIndex ( ) ; this . SetSkipOnRecalculate ( true ) ; oLogicDocument . Recalculate ( ) ; this . SetSkipOnRecalculate ( false ) } if ( null !==
nRecalcIndex ) oLogicDocument . Get _History ( ) . SetRecalculateIndex ( nRecalcIndex ) ; if ( ! this . LogicDocument || null === this . LogicDocument . FullRecalc . Id || PageNum < this . LogicDocument . FullRecalc . PageIndex && PageNumOld < this . LogicDocument . FullRecalc . PageIndex ) Layout = Paragraph . Get _Layout ( ContentPos , this ) ; this . private _SetXYByLayout ( X , Y , PageNum , Layout , bResetAlign || true !== this . PositionH . Align ? true : false , bResetAlign || true !== this . PositionV . Align ? true : false ) } } ; ParaDrawing . prototype . private _SetXYByLayout = function ( X , Y , PageNum ,
Layout , bChangeX , bChangeY ) { if ( ! Layout ) return ; this . PageNum = PageNum ; this . Internal _Position . Set ( this . GraphicObj . extX , this . GraphicObj . extY , this . getXfrmRot ( ) , this . EffectExtent , this . YOffset , Layout . ParagraphLayout , Layout . PageLimitsOrigin ) ; this . Internal _Position . Calculate _X ( false , c _oAscRelativeFromH . Page , false , X - Layout . PageLimitsOrigin . X , false ) ; this . Internal _Position . Calculate _Y ( false , c _oAscRelativeFromV . Page , false , Y - Layout . PageLimitsOrigin . Y , false ) ; var bCorrect = false ; if ( this . DocumentContent && this . DocumentContent . IsTableCellContent &&
this . DocumentContent . IsTableCellContent ( false ) ) bCorrect = true ; if ( this . PositionH . RelativeFrom !== c _oAscRelativeFromH . Page || this . PositionV . RelativeFrom !== c _oAscRelativeFromV . Page ) bCorrect = true ; this . Internal _Position . Correct _Values ( false , Layout . PageLimits , this . AllowOverlap , this . Use _TextWrap ( ) , [ ] , bCorrect ) ; if ( true === bChangeX ) { this . X = this . Internal _Position . CalcX ; var ValueX = this . Internal _Position . Calculate _X _Value ( this . PositionH . RelativeFrom ) ; this . Set _PositionH ( this . PositionH . RelativeFrom , false , ValueX , false ) ;
this . X = this . Internal _Position . Calculate _X ( false , this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value , this . PositionH . Percent ) } if ( true === bChangeY ) { this . Y = this . Internal _Position . CalcY ; var ValueY = this . Internal _Position . Calculate _Y _Value ( this . PositionV . RelativeFrom ) ; this . Set _PositionV ( this . PositionV . RelativeFrom , false , ValueY , false ) ; this . Y = this . Internal _Position . Calculate _Y ( false , this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) } } ; ParaDrawing . prototype . Get _DrawingType =
function ( ) { return this . DrawingType } ; ParaDrawing . prototype . Is _Inline = function ( ) { if ( this . Parent && this . Parent . Get _ParentTextTransform && this . Parent . Get _ParentTextTransform ( ) ) return true ; return drawing _Inline === this . DrawingType ? true : false } ; ParaDrawing . prototype . IsInline = function ( ) { return this . Is _Inline ( ) } ; ParaDrawing . prototype . Use _TextWrap = function ( ) { if ( ! this . Parent || ! this . Parent . Get _FramePr || null !== this . Parent . Get _FramePr ( ) && undefined !== this . Parent . Get _FramePr ( ) ) return false ; return drawing _Anchor === this . DrawingType &&
! ( this . wrappingType === WRAPPING _TYPE _NONE ) } ; ParaDrawing . prototype . IsUseTextWrap = function ( ) { return this . Use _TextWrap ( ) } ; ParaDrawing . prototype . Draw _Selection = function ( ) { var Padding = this . DrawingDocument . GetMMPerDot ( 6 ) ; var extX , extY ; if ( this . GraphicObj ) { extX = this . GraphicObj . extX ; extY = this . GraphicObj . extY } else { extX = this . getXfrmExtX ( ) ; extY = this . getXfrmExtY ( ) } var rot = this . getXfrmRot ( ) ; if ( AscFormat . checkNormalRotate ( rot ) ) this . DrawingDocument . AddPageSelection ( this . PageNum , this . X - this . EffectExtent . L - Padding ,
this . Y - this . EffectExtent . T - Padding , this . EffectExtent . L + extX + this . EffectExtent . R + 2 * Padding , this . EffectExtent . T + extY + this . EffectExtent . B + 2 * Padding ) ; else this . DrawingDocument . AddPageSelection ( this . PageNum , this . X + extX / 2 - extY / 2 - this . EffectExtent . L - Padding , this . Y + extY / 2 - extX / 2 - this . EffectExtent . T - Padding , this . EffectExtent . L + extY + this . EffectExtent . R + 2 * Padding , this . EffectExtent . T + extX + this . EffectExtent . B + 2 * Padding ) } ; ParaDrawing . prototype . CanInsertToPos = function ( oAnchorPos ) { if ( ! oAnchorPos || ! oAnchorPos . Paragraph ||
! oAnchorPos . Paragraph . Parent ) return false ; return ! ( ( this . IsShape ( ) || this . IsGroup ( ) ) && ( true === oAnchorPos . Paragraph . Parent . Is _DrawingShape ( ) || true === oAnchorPos . Paragraph . Parent . IsFootnote ( ) ) ) } ; ParaDrawing . prototype . OnEnd _MoveInline = function ( NearPos ) { if ( ! this . Parent ) return ; NearPos . Paragraph . Check _NearestPos ( NearPos ) ; var oRun = this . GetRun ( ) ; var oPictureCC = false ; if ( oRun ) { var arrContentControls = oRun . GetParentContentControls ( ) ; for ( var nIndex = arrContentControls . length - 1 ; nIndex >= 0 ; -- nIndex ) if ( arrContentControls [ nIndex ] . IsPicture ( ) ) { oPictureCC =
arrContentControls [ nIndex ] ; break } } var oDstRun = null ; var arrClasses = NearPos . Paragraph . GetClassesByPos ( NearPos . ContentPos ) ; for ( var nIndex = arrClasses . length - 1 ; nIndex >= 0 ; -- nIndex ) if ( arrClasses [ nIndex ] instanceof ParaRun ) { oDstRun = arrClasses [ nIndex ] ; break } if ( ! oDstRun || oPictureCC && oDstRun === oRun || oDstRun . GetParentForm ( ) ) { NearPos . Paragraph . Clear _NearestPosArray ( ) ; return } var NewParaDrawing = this . Copy ( ) ; var RunPr = this . Remove _FromDocument ( false ) ; this . DocumentContent . Select _DrawingObject ( NewParaDrawing . GetId ( ) ) ;
NewParaDrawing . Add _ToDocument ( NearPos , true , RunPr , undefined , oPictureCC ) } ; ParaDrawing . prototype . Get _ParentTextTransform = function ( ) { if ( this . Parent ) return this . Parent . Get _ParentTextTransform ( ) ; return null } ; ParaDrawing . prototype . GoTo _Text = function ( bBefore , bUpdateStates ) { var Paragraph = this . Get _ParentParagraph ( ) ; if ( Paragraph ) { Paragraph . MoveCursorToDrawing ( this . Id , bBefore ) ; Paragraph . Document _SetThisElementCurrent ( undefined === bUpdateStates ? true : bUpdateStates ) } } ; ParaDrawing . prototype . Remove _FromDocument = function ( bRecalculate ) { var oResult =
null ; if ( ! this . Parent ) return oResult ; var oRun = this . Parent . Get _DrawingObjectRun ( this . Id ) ; if ( oRun ) { var oGrObject = this . GraphicObj ; if ( oGrObject && oGrObject . getObjectType ( ) === AscDFH . historyitem _type _Shape ) if ( oGrObject . signatureLine ) oGrObject . setSignature ( oGrObject . signatureLine ) ; var oPictureCC = null ; var arrContentControls = oRun . GetParentContentControls ( ) ; for ( var nIndex = arrContentControls . length - 1 ; nIndex >= 0 ; -- nIndex ) if ( arrContentControls [ nIndex ] . IsPicture ( ) ) { oPictureCC = arrContentControls [ nIndex ] ; break } if ( oPictureCC ) oPictureCC . RemoveContentControlWrapper ( ) ;
oRun . Remove _DrawingObject ( this . Id ) ; if ( oRun . IsInHyperlink ( ) ) oResult = new CTextPr ; else oResult = oRun . GetTextPr ( ) ; if ( oGrObject && oGrObject . getObjectType ( ) === AscDFH . historyitem _type _Shape ) if ( oGrObject . signatureLine ) { editor . sendEvent ( "asc_onRemoveSignature" , oGrObject . signatureLine . id ) ; oGrObject . setSignature ( oGrObject . signatureLine ) } } if ( false != bRecalculate ) editor . WordControl . m _oLogicDocument . Recalculate ( ) ; return oResult } ; ParaDrawing . prototype . Get _ParentParagraph = function ( ) { if ( this . Parent instanceof Paragraph ) return this . Parent ;
if ( this . Parent instanceof ParaRun ) return this . Parent . Paragraph ; if ( this . Parent && this . Parent . GetParagraph ( ) ) return this . Parent . GetParagraph ( ) ; return null } ; ParaDrawing . prototype . SelectAsText = function ( ) { var oParagraph = this . GetParagraph ( ) ; var oRun = this . GetRun ( ) ; if ( ! oParagraph || ! oRun ) return ; var oDocument = oParagraph . GetLogicDocument ( ) ; if ( ! oDocument ) return ; oDocument . RemoveSelection ( ) ; oRun . Make _ThisElementCurrent ( false ) ; oRun . SetCursorPosition ( oRun . GetElementPosition ( this ) ) ; var oStartPos = oDocument . GetContentPosition ( false ) ;
oRun . SetCursorPosition ( oRun . GetElementPosition ( this ) + 1 ) ; var oEndPos = oDocument . GetContentPosition ( false ) ; oDocument . RemoveSelection ( ) ; oDocument . SetSelectionByContentPositions ( oStartPos , oEndPos ) } ; ParaDrawing . prototype . Add _ToDocument = function ( NearPos , bRecalculate , RunPr , Run , oPictureCC ) { NearPos . Paragraph . Check _NearestPos ( NearPos ) ; var LogicDocument = this . DrawingDocument . m _oLogicDocument ; var Para = new Paragraph ( this . DrawingDocument , LogicDocument ) ; var DrawingRun = new ParaRun ( Para ) ; DrawingRun . Add _ToContent ( 0 ,
this ) ; if ( RunPr ) DrawingRun . Set _Pr ( RunPr . Copy ( ) ) ; if ( Run ) DrawingRun . SetReviewTypeWithInfo ( Run . GetReviewType ( ) , Run . GetReviewInfo ( ) ) ; if ( oPictureCC ) { var oSdt = new CInlineLevelSdt ; oSdt . SetPicturePr ( true ) ; oSdt . ReplacePlaceHolderWithContent ( ) ; oSdt . AddToContent ( 0 , DrawingRun ) ; Para . Add _ToContent ( 0 , oSdt ) ; var oFormPr = oPictureCC . GetFormPr ( ) ; if ( oFormPr ) oSdt . SetFormPr ( oFormPr . Copy ( ) ) } else Para . Add _ToContent ( 0 , DrawingRun ) ; var SelectedElement = new CSelectedElement ( Para , false ) ; var SelectedContent = new CSelectedContent ;
SelectedContent . Add ( SelectedElement ) ; SelectedContent . SetMoveDrawing ( true ) ; SelectedContent . DrawingObjects . push ( this ) ; NearPos . Paragraph . Parent . InsertContent ( SelectedContent , NearPos ) ; NearPos . Paragraph . Clear _NearestPosArray ( ) ; NearPos . Paragraph . Correct _Content ( ) ; this . Set _Parent ( NearPos . Paragraph ) ; if ( false != bRecalculate ) LogicDocument . Recalculate ( ) } ; ParaDrawing . prototype . Add _ToDocument2 = function ( Paragraph ) { var DrawingRun = new ParaRun ( Paragraph ) ; DrawingRun . Add _ToContent ( 0 , this ) ; Paragraph . Add _ToContent ( 0 , DrawingRun ) ;
this . Set _Parent ( Paragraph ) } ; ParaDrawing . prototype . UpdateCursorType = function ( X , Y , PageIndex ) { this . DrawingDocument . SetCursorType ( "move" , new AscCommon . CMouseMoveData ) ; if ( null != this . Parent ) { var Lock = this . Parent . Lock ; if ( true === Lock . Is _Locked ( ) ) { var PNum = Math . max ( 0 , Math . min ( PageIndex - this . Parent . PageNum , this . Parent . Pages . length - 1 ) ) ; var _X = this . Parent . Pages [ PNum ] . X ; var _Y = this . Parent . Pages [ PNum ] . Y ; var MMData = new AscCommon . CMouseMoveData ; var Coords = this . DrawingDocument . ConvertCoordsToCursorWR ( _X , _Y , this . Parent . Get _StartPage _Absolute ( ) +
( PageIndex - this . Parent . PageNum ) ) ; MMData . X _abs = Coords . X - 5 ; MMData . Y _abs = Coords . Y ; MMData . Type = Asc . c _oAscMouseMoveDataTypes . LockedObject ; MMData . UserId = Lock . Get _UserId ( ) ; MMData . HaveChanges = Lock . Have _Changes ( ) ; MMData . LockedObjectType = c _oAscMouseMoveLockedObjectType . Common ; editor . sync _MouseMoveCallback ( MMData ) } } } ; ParaDrawing . prototype . Get _AnchorPos = function ( ) { if ( ! this . Parent ) return null ; return this . Parent . Get _AnchorPos ( this ) } ; ParaDrawing . prototype . CheckRecalcAutoFit = function ( oSectPr ) { if ( this . GraphicObj &&
this . GraphicObj . CheckNeedRecalcAutoFit ) if ( this . GraphicObj . CheckNeedRecalcAutoFit ( oSectPr ) ) { if ( this . GraphicObj ) this . GraphicObj . recalcWrapPolygon && this . GraphicObj . recalcWrapPolygon ( ) ; this . Measure ( ) } } ; ParaDrawing . prototype . Get _ParentObject _or _DocumentPos = function ( ) { if ( this . Parent != null ) return this . Parent . Get _ParentObject _or _DocumentPos ( ) } ; ParaDrawing . prototype . Refresh _RecalcData = function ( Data ) { var oRun = this . GetRun ( ) ; if ( oRun ) { if ( AscCommon . isRealObject ( Data ) ) switch ( Data . Type ) { case AscDFH . historyitem _Drawing _Distance : { if ( this . GraphicObj ) { this . GraphicObj . recalcWrapPolygon &&
this . GraphicObj . recalcWrapPolygon ( ) ; this . GraphicObj . addToRecalculate ( ) } break } case AscDFH . historyitem _Drawing _SetExtent : { oRun . RecalcInfo . Measure = true ; break } case AscDFH . historyitem _Drawing _SetSizeRelH : case AscDFH . historyitem _Drawing _SetSizeRelV : case AscDFH . historyitem _Drawing _SetGraphicObject : { if ( this . GraphicObj ) { this . GraphicObj . handleUpdateExtents && this . GraphicObj . handleUpdateExtents ( ) ; this . GraphicObj . addToRecalculate ( ) } oRun . RecalcInfo . Measure = true ; break } case AscDFH . historyitem _Drawing _WrappingType : { if ( this . GraphicObj ) { this . GraphicObj . recalcWrapPolygon &&
this . GraphicObj . recalcWrapPolygon ( ) ; this . GraphicObj . addToRecalculate ( ) } break } } return oRun . Refresh _RecalcData2 ( ) } } ; ParaDrawing . prototype . Refresh _RecalcData2 = function ( Data ) { var oRun = this . GetRun ( ) ; if ( oRun ) return oRun . Refresh _RecalcData2 ( ) } ; ParaDrawing . prototype . hyperlinkCheck = function ( bCheck ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkCheck === "function" ) return this . GraphicObj . hyperlinkCheck ( bCheck ) ; return null } ; ParaDrawing . prototype . hyperlinkCanAdd = function ( bCheckInHyperlink ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . hyperlinkCanAdd === "function" ) return this . GraphicObj . hyperlinkCanAdd ( bCheckInHyperlink ) ; return false } ; ParaDrawing . prototype . hyperlinkRemove = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkCanAdd === "function" ) return this . GraphicObj . hyperlinkRemove ( ) ; return false } ; ParaDrawing . prototype . hyperlinkModify = function ( HyperProps ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkModify === "function" ) return this . GraphicObj . hyperlinkModify ( HyperProps ) } ;
ParaDrawing . prototype . hyperlinkAdd = function ( HyperProps ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkAdd === "function" ) return this . GraphicObj . hyperlinkAdd ( HyperProps ) } ; ParaDrawing . prototype . documentStatistics = function ( stat ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . documentStatistics === "function" ) this . GraphicObj . documentStatistics ( stat ) } ; ParaDrawing . prototype . documentCreateFontCharMap = function ( fontMap ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . documentCreateFontCharMap === "function" ) this . GraphicObj . documentCreateFontCharMap ( fontMap ) } ; ParaDrawing . prototype . documentCreateFontMap = function ( fontMap ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . documentCreateFontMap === "function" ) this . GraphicObj . documentCreateFontMap ( fontMap ) } ; ParaDrawing . prototype . tableCheckSplit = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableCheckSplit === "function" ) return this . GraphicObj . tableCheckSplit ( ) ;
return false } ; ParaDrawing . prototype . tableCheckMerge = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableCheckMerge === "function" ) return this . GraphicObj . tableCheckMerge ( ) ; return false } ; ParaDrawing . prototype . tableSelect = function ( Type ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableSelect === "function" ) return this . GraphicObj . tableSelect ( Type ) } ; ParaDrawing . prototype . tableRemoveTable = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableRemoveTable ===
"function" ) return this . GraphicObj . tableRemoveTable ( ) } ; ParaDrawing . prototype . tableSplitCell = function ( Cols , Rows ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableSplitCell === "function" ) return this . GraphicObj . tableSplitCell ( Cols , Rows ) } ; ParaDrawing . prototype . tableMergeCells = function ( Cols , Rows ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableMergeCells === "function" ) return this . GraphicObj . tableMergeCells ( Cols , Rows ) } ; ParaDrawing . prototype . tableRemoveCol = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . tableRemoveCol === "function" ) return this . GraphicObj . tableRemoveCol ( ) } ; ParaDrawing . prototype . tableAddCol = function ( bBefore , nCount ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableAddCol === "function" ) return this . GraphicObj . tableAddCol ( bBefore , nCount ) } ; ParaDrawing . prototype . tableRemoveRow = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableRemoveRow === "function" ) return this . GraphicObj . tableRemoveRow ( ) } ; ParaDrawing . prototype . tableAddRow =
function ( bBefore , nCount ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableAddRow === "function" ) return this . GraphicObj . tableAddRow ( bBefore , nCount ) } ; ParaDrawing . prototype . getCurrentParagraph = function ( bIgnoreSelection , arrSelectedParagraphs ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getCurrentParagraph === "function" ) return this . GraphicObj . getCurrentParagraph ( bIgnoreSelection , arrSelectedParagraphs ) ; if ( this . Parent instanceof Paragraph ) return this . Parent } ; ParaDrawing . prototype . GetSelectedText =
function ( bClearText , oPr ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . GetSelectedText === "function" ) return this . GraphicObj . GetSelectedText ( bClearText , oPr ) ; return "" } ; ParaDrawing . prototype . getCurPosXY = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getCurPosXY === "function" ) return this . GraphicObj . getCurPosXY ( ) ; return { X : 0 , Y : 0 } } ; ParaDrawing . prototype . setParagraphKeepLines = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphKeepLines ===
"function" ) return this . GraphicObj . setParagraphKeepLines ( Value ) } ; ParaDrawing . prototype . setParagraphKeepNext = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphKeepNext === "function" ) return this . GraphicObj . setParagraphKeepNext ( Value ) } ; ParaDrawing . prototype . setParagraphWidowControl = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphWidowControl === "function" ) return this . GraphicObj . setParagraphWidowControl ( Value ) } ; ParaDrawing . prototype . setParagraphPageBreakBefore =
function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphPageBreakBefore === "function" ) return this . GraphicObj . setParagraphPageBreakBefore ( Value ) } ; ParaDrawing . prototype . isTextSelectionUse = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . isTextSelectionUse === "function" ) return this . GraphicObj . isTextSelectionUse ( ) ; return false } ; ParaDrawing . prototype . paragraphFormatPaste = function ( CopyTextPr , CopyParaPr , Bool ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . isTextSelectionUse === "function" ) return this . GraphicObj . paragraphFormatPaste ( CopyTextPr , CopyParaPr , Bool ) } ; ParaDrawing . prototype . getNearestPos = function ( x , y , pageIndex ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getNearestPos === "function" ) return this . GraphicObj . getNearestPos ( x , y , pageIndex ) ; return null } ; ParaDrawing . prototype . Write _ToBinary = function ( Writer ) { Writer . WriteLong ( this . Type ) ; Writer . WriteString2 ( this . Id ) } ; ParaDrawing . prototype . Write _ToBinary2 = function ( Writer ) { Writer . WriteLong ( AscDFH . historyitem _type _Drawing ) ;
Writer . WriteString2 ( this . Id ) ; AscFormat . writeDouble ( Writer , this . Extent . W ) ; AscFormat . writeDouble ( Writer , this . Extent . H ) ; AscFormat . writeObject ( Writer , this . GraphicObj ) ; AscFormat . writeObject ( Writer , this . DocumentContent ) ; AscFormat . writeObject ( Writer , this . Parent ) ; AscFormat . writeObject ( Writer , this . wrappingPolygon ) ; AscFormat . writeLong ( Writer , this . RelativeHeight ) ; AscFormat . writeObject ( Writer , this . docPr ) } ; ParaDrawing . prototype . Read _FromBinary2 = function ( Reader ) { this . Id = Reader . GetString2 ( ) ; this . DrawingDocument =
editor . WordControl . m _oLogicDocument . DrawingDocument ; this . LogicDocument = this . DrawingDocument ? this . DrawingDocument . m _oLogicDocument : null ; this . Extent . W = AscFormat . readDouble ( Reader ) ; this . Extent . H = AscFormat . readDouble ( Reader ) ; this . GraphicObj = AscFormat . readObject ( Reader ) ; this . DocumentContent = AscFormat . readObject ( Reader ) ; this . Parent = AscFormat . readObject ( Reader ) ; this . wrappingPolygon = AscFormat . readObject ( Reader ) ; this . RelativeHeight = AscFormat . readLong ( Reader ) ; this . docPr = AscFormat . readObject ( Reader ) ; if ( this . wrappingPolygon ) this . wrappingPolygon . wordGraphicObject =
this ; this . drawingDocument = editor . WordControl . m _oLogicDocument . DrawingDocument ; this . document = editor . WordControl . m _oLogicDocument ; this . graphicObjects = editor . WordControl . m _oLogicDocument . DrawingObjects ; this . graphicObjects . addGraphicObject ( this ) ; g _oTableId . Add ( this , this . Id ) } ; ParaDrawing . prototype . Load _LinkData = function ( ) { } ; ParaDrawing . prototype . draw = function ( graphics , PDSE ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . draw === "function" ) { graphics . SaveGrState ( ) ; var bInline = this . Is _Inline ( ) ;
if ( bInline && AscCommon . isRealObject ( PDSE ) && AscFormat . isRealNumber ( this . LineTop ) && AscFormat . isRealNumber ( this . LineBottom ) && AscCommon . isRealObject ( this . GraphicObj . bounds ) ) { var x , y , w , h ; var oEffectExtent = this . EffectExtent ; x = PDSE . X ; y = this . LineTop ; w = this . GraphicObj . bounds . r - this . GraphicObj . bounds . l + AscFormat . getValOrDefault ( oEffectExtent . R , 0 ) + AscFormat . getValOrDefault ( oEffectExtent . L , 0 ) ; h = this . LineBottom - this . LineTop ; graphics . AddClipRect ( x , y , w , h ) } this . GraphicObj . draw ( graphics ) ; graphics . RestoreGrState ( ) } } ;
ParaDrawing . prototype . drawAdjustments = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . drawAdjustments === "function" ) this . GraphicObj . drawAdjustments ( ) } ; ParaDrawing . prototype . getTransformMatrix = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getTransformMatrix === "function" ) return this . GraphicObj . getTransformMatrix ( ) ; return null } ; ParaDrawing . prototype . getExtensions = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getExtensions ===
"function" ) return this . GraphicObj . getExtensions ( ) ; return null } ; ParaDrawing . prototype . isGroup = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . isGroup === "function" ) return this . GraphicObj . isGroup ( ) ; return false } ; ParaDrawing . prototype . isShapeChild = function ( bRetShape ) { if ( ! this . Is _Inline ( ) || ! this . DocumentContent ) return bRetShape ? null : false ; var cur _doc _content = this . DocumentContent ; var oCell ; while ( oCell = cur _doc _content . IsTableCellContent ( true ) ) cur _doc _content = oCell . Row . Table . Parent ;
if ( AscCommon . isRealObject ( cur _doc _content . Parent ) && typeof cur _doc _content . Parent . getObjectType === "function" && cur _doc _content . Parent . getObjectType ( ) === AscDFH . historyitem _type _Shape ) return bRetShape ? cur _doc _content . Parent : true ; return bRetShape ? null : false } ; ParaDrawing . prototype . checkShapeChildAndGetTopParagraph = function ( paragraph ) { var parent _paragraph = ! paragraph ? this . Get _ParentParagraph ( ) : paragraph ; var parent _doc _content = parent _paragraph . Parent ; if ( parent _doc _content . Parent instanceof AscFormat . CShape ) if ( ! parent _doc _content . Parent . group ) return parent _doc _content . Parent . parent . Get _ParentParagraph ( ) ;
Old , New , Color ) } CChangesParaTextPrHighLight . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrHighLight . prototype . constructor = CChangesParaTextPrHighLight ; CChangesParaTextPrHighLight . prototype . Type = AscDFH . historyitem _TextPr _HighLight ; CChangesParaTextPrHighLight . prototype . private _SetValue = function ( Value ) { if ( this . Class . Value ) this . Class . Value . HighLight = Value } ; CChangesParaTextPrHighLight . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ;
if ( undefined === this . New ) nFlags |= 2 ; else if ( highlight _None === this . New ) nFlags |= 4 ; if ( undefined === this . Old ) nFlags |= 8 ; else if ( highlight _None === this . Old ) nFlags |= 16 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New && highlight _None !== this . New ) this . New . Write _ToBinary ( Writer ) ; if ( undefined !== this . Old && highlight _None !== this . Old ) this . Old . Write _ToBinary ( Writer ) } ; CChangesParaTextPrHighLight . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags &
2 ) this . New = undefined ; else if ( nFlags & 4 ) this . New = highlight _None ; else { this . New = new CDocumentColor ( 0 , 0 , 0 ) ; this . New . Read _FromBinary ( Reader ) } if ( nFlags & 8 ) this . Old = undefined ; else if ( nFlags & 16 ) this . Old = highlight _None ; else { this . Old = new CDocumentColor ( 0 , 0 , 0 ) ; this . Old . Read _FromBinary ( Reader ) } } ; CChangesParaTextPrHighLight . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrRStyle ( Class , Old , New , Color ) { AscDFH . CChangesBaseStringProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRStyle . prototype =
Object . create ( AscDFH . CChangesBaseStringProperty . prototype ) ; CChangesParaTextPrRStyle . prototype . constructor = CChangesParaTextPrRStyle ; CChangesParaTextPrRStyle . prototype . Type = AscDFH . historyitem _TextPr _RStyle ; CChangesParaTextPrRStyle . prototype . private _SetValue = function ( Value ) { this . Class . Value . RStyle = Value } ; CChangesParaTextPrRStyle . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrSpacing ( Class , Old , New , Color ) { AscDFH . CChangesBaseDoubleProperty . call ( this , Class , Old , New , Color ) }
CChangesParaTextPrSpacing . prototype = Object . create ( AscDFH . CChangesBaseDoubleProperty . prototype ) ; CChangesParaTextPrSpacing . prototype . constructor = CChangesParaTextPrSpacing ; CChangesParaTextPrSpacing . prototype . Type = AscDFH . historyitem _TextPr _Spacing ; CChangesParaTextPrSpacing . prototype . private _SetValue = function ( Value ) { this . Class . Value . Spacing = Value } ; CChangesParaTextPrSpacing . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrDStrikeout ( Class , Old , New , Color ) { AscDFH . CChangesBaseBoolProperty . call ( this ,
Class , Old , New , Color ) } CChangesParaTextPrDStrikeout . prototype = Object . create ( AscDFH . CChangesBaseBoolProperty . prototype ) ; CChangesParaTextPrDStrikeout . prototype . constructor = CChangesParaTextPrDStrikeout ; CChangesParaTextPrDStrikeout . prototype . Type = AscDFH . historyitem _TextPr _DStrikeout ; CChangesParaTextPrDStrikeout . prototype . private _SetValue = function ( Value ) { this . Class . Value . DStrikeout = Value } ; CChangesParaTextPrDStrikeout . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrCaps ( Class ,
Old , New , Color ) { AscDFH . CChangesBaseBoolProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrCaps . prototype = Object . create ( AscDFH . CChangesBaseBoolProperty . prototype ) ; CChangesParaTextPrCaps . prototype . constructor = CChangesParaTextPrCaps ; CChangesParaTextPrCaps . prototype . Type = AscDFH . historyitem _TextPr _Caps ; CChangesParaTextPrCaps . prototype . private _SetValue = function ( Value ) { this . Class . Value . Caps = Value } ; CChangesParaTextPrCaps . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrSmallCaps ( Class ,
Old , New , Color ) { AscDFH . CChangesBaseBoolProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrSmallCaps . prototype = Object . create ( AscDFH . CChangesBaseBoolProperty . prototype ) ; CChangesParaTextPrSmallCaps . prototype . constructor = CChangesParaTextPrSmallCaps ; CChangesParaTextPrSmallCaps . prototype . Type = AscDFH . historyitem _TextPr _SmallCaps ; CChangesParaTextPrSmallCaps . prototype . private _SetValue = function ( Value ) { this . Class . Value . SmallCaps = Value } ; CChangesParaTextPrSmallCaps . prototype . Merge = private _ParaTextPrChangesOnMergeValue ;
function CChangesParaTextPrPosition ( Class , Old , New , Color ) { AscDFH . CChangesBaseDoubleProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrPosition . prototype = Object . create ( AscDFH . CChangesBaseDoubleProperty . prototype ) ; CChangesParaTextPrPosition . prototype . constructor = CChangesParaTextPrPosition ; CChangesParaTextPrPosition . prototype . Type = AscDFH . historyitem _TextPr _Position ; CChangesParaTextPrPosition . prototype . private _SetValue = function ( Value ) { this . Class . Value . Position = Value } ; CChangesParaTextPrPosition . prototype . Merge =
private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrValue ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrValue . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrValue . prototype . constructor = CChangesParaTextPrValue ; CChangesParaTextPrValue . prototype . Type = AscDFH . historyitem _TextPr _Value ; CChangesParaTextPrValue . prototype . private _SetValue = function ( Value ) { this . Class . Value = Value } ; CChangesParaTextPrValue . prototype . private _CreateObject =
function ( ) { return new CTextPr } ; CChangesParaTextPrValue . prototype . private _IsCreateEmptyObject = function ( ) { return true } ; CChangesParaTextPrValue . prototype . Merge = function ( oChange ) { if ( oChange . Class !== this . Class ) return true ; if ( oChange . Type === this . Type ) return false ; if ( ! this . New ) this . New = new CTextPr ; switch ( oChange . Type ) { case AscDFH . historyitem _TextPr _Bold : { this . New . Bold = oChange . New ; break } case AscDFH . historyitem _TextPr _Italic : { this . New . Italic = oChange . New ; break } case AscDFH . historyitem _TextPr _Strikeout : { this . New . Strikeout =
oChange . New ; break } case AscDFH . historyitem _TextPr _Underline : { this . New . Underline = oChange . New ; break } case AscDFH . historyitem _TextPr _FontSize : { this . New . FontSize = oChange . New ; break } case AscDFH . historyitem _TextPr _Color : { this . New . Color = oChange . New ; break } case AscDFH . historyitem _TextPr _VertAlign : { this . New . VertAlign = oChange . New ; break } case AscDFH . historyitem _TextPr _HighLight : { this . New . HighLight = oChange . New ; break } case AscDFH . historyitem _TextPr _RStyle : { this . New . RStyle = oChange . New ; break } case AscDFH . historyitem _TextPr _Spacing : { this . New . Spacing =
oChange . New ; break } case AscDFH . historyitem _TextPr _DStrikeout : { this . New . DStrikeout = oChange . New ; break } case AscDFH . historyitem _TextPr _Caps : { this . New . Caps = oChange . New ; break } case AscDFH . historyitem _TextPr _SmallCaps : { this . New . SmallCaps = oChange . New ; break } case AscDFH . historyitem _TextPr _Position : { this . New . Position = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts : { this . New . RFonts = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _Ascii : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . Ascii =
oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _HAnsi : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . HAnsi = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _CS : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . CS = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _EastAsia : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ; this . New . RFonts . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _Hint : { if ( ! this . New . RFonts ) this . New . RFonts = new CRFonts ;
this . New . RFonts . Hint = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang : { this . New . Lang = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _Bidi : { if ( ! this . New . Lang ) this . New . Lang = new CLang ; this . New . Lang . Bidi = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _EastAsia : { if ( ! this . New . Lang ) this . New . Lang = new CLang ; this . New . Lang . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _Val : { if ( ! this . New . Lang ) this . New . Lang = new CLang ; this . New . Lang . Val = oChange . New ; break } case AscDFH . historyitem _TextPr _Unifill : { this . New . Unifill =
oChange . New ; break } case AscDFH . historyitem _TextPr _FontSizeCS : { this . New . FontSizeCS = oChange . New ; break } case AscDFH . historyitem _TextPr _Outline : { this . New . TextOutline = oChange . New ; break } case AscDFH . historyitem _TextPr _Fill : { this . New . TextFill = oChange . New ; break } } return true } ; function CChangesParaTextPrRFonts ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFonts . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrRFonts . prototype . constructor =
CChangesParaTextPrRFonts ; CChangesParaTextPrRFonts . prototype . Type = AscDFH . historyitem _TextPr _RFonts ; CChangesParaTextPrRFonts . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts = Value } ; CChangesParaTextPrRFonts . prototype . private _CreateObject = function ( ) { return new CRFonts } ; CChangesParaTextPrRFonts . prototype . private _IsCreateEmptyObject = function ( ) { return true } ; CChangesParaTextPrRFonts . prototype . Merge = function ( oChange ) { if ( this . Class !== oChange . Class ) return true ; if ( this . Type === oChange . Type ||
oChange . Type === AscDFH . historyitem _TextPr _Value ) return false ; if ( ! this . New ) this . New = new CRFonts ; switch ( oChange . Type ) { case AscDFH . historyitem _TextPr _RFonts _Ascii : { this . New . Ascii = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _HAnsi : { this . New . HAnsi = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _CS : { this . New . CS = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _EastAsia : { this . New . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _RFonts _Hint : { this . New . Hint = oChange . New ; break } } return true } ;
function CChangesParaTextPrRFontsAscii ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsAscii . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsAscii . prototype . constructor = CChangesParaTextPrRFontsAscii ; CChangesParaTextPrRFontsAscii . prototype . Type = AscDFH . historyitem _TextPr _RFonts _Ascii ; CChangesParaTextPrRFontsAscii . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined ===
this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsAscii . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ;
CChangesParaTextPrRFontsAscii . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . Ascii = Value } ; CChangesParaTextPrRFontsAscii . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsHAnsi ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsHAnsi . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsHAnsi . prototype . constructor = CChangesParaTextPrRFontsHAnsi ; CChangesParaTextPrRFontsHAnsi . prototype . Type =
AscDFH . historyitem _TextPr _RFonts _HAnsi ; CChangesParaTextPrRFontsHAnsi . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsHAnsi . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color =
false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ; CChangesParaTextPrRFontsHAnsi . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . HAnsi = Value } ; CChangesParaTextPrRFontsHAnsi . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsCS ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsCS . prototype =
Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsCS . prototype . constructor = CChangesParaTextPrRFontsCS ; CChangesParaTextPrRFontsCS . prototype . Type = AscDFH . historyitem _TextPr _RFonts _CS ; CChangesParaTextPrRFontsCS . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |= 1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ;
CChangesParaTextPrRFontsCS . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) , Index : - 1 } } ; CChangesParaTextPrRFontsCS . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . CS = Value } ; CChangesParaTextPrRFontsCS . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ;
function CChangesParaTextPrRFontsEastAsia ( Class , Old , New , Color ) { AscDFH . CChangesBaseProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsEastAsia . prototype = Object . create ( AscDFH . CChangesBaseProperty . prototype ) ; CChangesParaTextPrRFontsEastAsia . prototype . constructor = CChangesParaTextPrRFontsEastAsia ; CChangesParaTextPrRFontsEastAsia . prototype . Type = AscDFH . historyitem _TextPr _RFonts _EastAsia ; CChangesParaTextPrRFontsEastAsia . prototype . WriteToBinary = function ( Writer ) { var nFlags = 0 ; if ( false !== this . Color ) nFlags |=
1 ; if ( undefined === this . New ) nFlags |= 2 ; if ( undefined === this . Old ) nFlags |= 4 ; Writer . WriteLong ( nFlags ) ; if ( undefined !== this . New ) Writer . WriteString2 ( this . New . Name ) ; if ( undefined !== this . Old ) Writer . WriteString2 ( this . Old . Name ) } ; CChangesParaTextPrRFontsEastAsia . prototype . ReadFromBinary = function ( Reader ) { var nFlags = Reader . GetLong ( ) ; if ( nFlags & 1 ) this . Color = true ; else this . Color = false ; if ( nFlags & 2 ) this . New = undefined ; else this . New = { Name : Reader . GetString2 ( ) , Index : - 1 } ; if ( nFlags & 4 ) this . Old = undefined ; else this . Old = { Name : Reader . GetString2 ( ) ,
Index : - 1 } } ; CChangesParaTextPrRFontsEastAsia . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . EastAsia = Value } ; CChangesParaTextPrRFontsEastAsia . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrRFontsHint ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrRFontsHint . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrRFontsHint . prototype . constructor = CChangesParaTextPrRFontsHint ;
CChangesParaTextPrRFontsHint . prototype . Type = AscDFH . historyitem _TextPr _RFonts _Hint ; CChangesParaTextPrRFontsHint . prototype . private _SetValue = function ( Value ) { this . Class . Value . RFonts . Hint = Value } ; CChangesParaTextPrRFontsHint . prototype . Merge = private _ParaTextPrChangesOnMergeRFontsValue ; function CChangesParaTextPrLang ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLang . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrLang . prototype . constructor =
CChangesParaTextPrLang ; CChangesParaTextPrLang . prototype . Type = AscDFH . historyitem _TextPr _Lang ; CChangesParaTextPrLang . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang = Value } ; CChangesParaTextPrLang . prototype . private _CreateObject = function ( ) { return new CLang } ; CChangesParaTextPrLang . prototype . private _IsCreateEmptyObject = function ( ) { return true } ; CChangesParaTextPrLang . prototype . Merge = function ( oChange ) { if ( this . Class !== oChange . Class ) return true ; if ( AscDFH . historyitem _TextPr _Lang === oChange . Type ||
AscDFH . historyitem _TextPr _Value === oChange . Type ) return false ; if ( ! this . New ) this . New = new CLang ; switch ( oChange . Type ) { case AscDFH . historyitem _TextPr _Lang _Bidi : { this . New . Bidi = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _EastAsia : { this . New . EastAsia = oChange . New ; break } case AscDFH . historyitem _TextPr _Lang _Val : { this . New . Val = oChange . New ; break } } return true } ; function CChangesParaTextPrLangBidi ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLangBidi . prototype =
Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrLangBidi . prototype . constructor = CChangesParaTextPrLangBidi ; CChangesParaTextPrLangBidi . prototype . Type = AscDFH . historyitem _TextPr _Lang _Bidi ; CChangesParaTextPrLangBidi . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang . Bidi = Value } ; CChangesParaTextPrLangBidi . prototype . Merge = private _ParaTextPrChangesOnMergeLangValue ; function CChangesParaTextPrLangEastAsia ( Class , Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this ,
Class , Old , New , Color ) } CChangesParaTextPrLangEastAsia . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrLangEastAsia . prototype . constructor = CChangesParaTextPrLangEastAsia ; CChangesParaTextPrLangEastAsia . prototype . Type = AscDFH . historyitem _TextPr _Lang _EastAsia ; CChangesParaTextPrLangEastAsia . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang . EastAsia = Value } ; CChangesParaTextPrLangEastAsia . prototype . Merge = private _ParaTextPrChangesOnMergeLangValue ; function CChangesParaTextPrLangVal ( Class ,
Old , New , Color ) { AscDFH . CChangesBaseLongProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrLangVal . prototype = Object . create ( AscDFH . CChangesBaseLongProperty . prototype ) ; CChangesParaTextPrLangVal . prototype . constructor = CChangesParaTextPrLangVal ; CChangesParaTextPrLangVal . prototype . Type = AscDFH . historyitem _TextPr _Lang _Val ; CChangesParaTextPrLangVal . prototype . private _SetValue = function ( Value ) { this . Class . Value . Lang . Val = Value } ; CChangesParaTextPrLangVal . prototype . Merge = private _ParaTextPrChangesOnMergeLangValue ;
function CChangesParaTextPrUnifill ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrUnifill . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrUnifill . prototype . constructor = CChangesParaTextPrUnifill ; CChangesParaTextPrUnifill . prototype . Type = AscDFH . historyitem _TextPr _Unifill ; CChangesParaTextPrUnifill . prototype . private _SetValue = function ( Value ) { this . Class . Value . Unifill = Value } ; CChangesParaTextPrUnifill . prototype . private _CreateObject =
function ( ) { return new AscFormat . CUniFill } ; CChangesParaTextPrUnifill . prototype . Load = function ( Color ) { this . Redo ( ) ; var Unifill = this . Class . Value . Unifill ; if ( AscCommon . CollaborativeEditing && Unifill && Unifill . fill && Unifill . fill . type === Asc . c _oAscFill . FILL _TYPE _BLIP && typeof Unifill . fill . RasterImageId === "string" && Unifill . fill . RasterImageId . length > 0 ) AscCommon . CollaborativeEditing . Add _NewImage ( Unifill . fill . RasterImageId ) } ; CChangesParaTextPrUnifill . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrFontSizeCS ( Class ,
Old , New , Color ) { AscDFH . CChangesBaseDoubleProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrFontSizeCS . prototype = Object . create ( AscDFH . CChangesBaseDoubleProperty . prototype ) ; CChangesParaTextPrFontSizeCS . prototype . constructor = CChangesParaTextPrFontSizeCS ; CChangesParaTextPrFontSizeCS . prototype . Type = AscDFH . historyitem _TextPr _FontSizeCS ; CChangesParaTextPrFontSizeCS . prototype . private _SetValue = function ( Value ) { this . Class . Value . FontSizeCS = Value } ; CChangesParaTextPrFontSizeCS . prototype . Merge = private _ParaTextPrChangesOnMergeValue ;
function CChangesParaTextPrTextOutline ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrTextOutline . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrTextOutline . prototype . constructor = CChangesParaTextPrTextOutline ; CChangesParaTextPrTextOutline . prototype . Type = AscDFH . historyitem _TextPr _Outline ; CChangesParaTextPrTextOutline . prototype . private _SetValue = function ( Value ) { this . Class . Value . TextOutline = Value } ; CChangesParaTextPrTextOutline . prototype . private _CreateObject =
function ( ) { return new AscFormat . CLn } ; CChangesParaTextPrTextOutline . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; function CChangesParaTextPrTextFill ( Class , Old , New , Color ) { AscDFH . CChangesBaseObjectProperty . call ( this , Class , Old , New , Color ) } CChangesParaTextPrTextFill . prototype = Object . create ( AscDFH . CChangesBaseObjectProperty . prototype ) ; CChangesParaTextPrTextFill . prototype . constructor = CChangesParaTextPrTextFill ; CChangesParaTextPrTextFill . prototype . Type = AscDFH . historyitem _TextPr _Fill ; CChangesParaTextPrTextFill . prototype . private _SetValue =
function ( Value ) { this . Class . Value . TextFill = Value } ; CChangesParaTextPrTextFill . prototype . private _CreateObject = function ( ) { return new AscFormat . CUniFill } ; CChangesParaTextPrTextFill . prototype . Merge = private _ParaTextPrChangesOnMergeValue ; "use strict" ; var drawing _Inline = 1 ; var drawing _Anchor = 2 ; var WRAPPING _TYPE _NONE = 0 ; var WRAPPING _TYPE _SQUARE = 1 ; var WRAPPING _TYPE _THROUGH = 2 ; var WRAPPING _TYPE _TIGHT = 3 ; var WRAPPING _TYPE _TOP _AND _BOTTOM = 4 ; var WRAP _HIT _TYPE _POINT = 0 ; var WRAP _HIT _TYPE _SECTION = 1 ; var c _oAscAlignH = Asc . c _oAscAlignH ;
var c _oAscAlignV = Asc . c _oAscAlignV ; function ParaDrawing ( W , H , GraphicObj , DrawingDocument , DocumentContent , Parent ) { CRunElementBase . call ( this ) ; this . Id = AscCommon . g _oIdCounter . Get _NewId ( ) ; this . DrawingType = drawing _Inline ; this . GraphicObj = GraphicObj ; this . X = 0 ; this . Y = 0 ; this . Width = 0 ; this . Height = 0 ; this . OrigX = 0 ; this . OrigY = 0 ; this . ShiftX = 0 ; this . ShiftY = 0 ; this . PageNum = 0 ; this . LineNum = 0 ; this . YOffset = 0 ; this . DocumentContent = DocumentContent ; this . DrawingDocument = DrawingDocument ; this . Parent = Parent ; this . LogicDocument = DrawingDocument ?
DrawingDocument . m _oLogicDocument : null ; this . Distance = { T : 0 , B : 0 , L : 0 , R : 0 } ; this . LayoutInCell = true ; this . RelativeHeight = undefined ; this . SimplePos = { Use : false , X : 0 , Y : 0 } ; this . Extent = { W : W , H : H } ; this . EffectExtent = { L : 0 , T : 0 , R : 0 , B : 0 } ; this . docPr = new AscFormat . CNvPr ; this . SizeRelH = undefined ; this . SizeRelV = undefined ; this . AllowOverlap = true ; this . Locked = null ; this . Hidden = null ; this . PositionH = { RelativeFrom : c _oAscRelativeFromH . Column , Align : false , Value : 0 , Percent : false } ; this . PositionV = { RelativeFrom : c _oAscRelativeFromV . Paragraph ,
Align : false , Value : 0 , Percent : false } ; this . PositionH _Old = undefined ; this . PositionV _Old = undefined ; this . Internal _Position = new CAnchorPosition ; this . wrappingType = WRAPPING _TYPE _THROUGH ; this . useWrap = true ; if ( typeof CWrapPolygon !== "undefined" ) this . wrappingPolygon = new CWrapPolygon ( this ) ; this . document = editor . WordControl . m _oLogicDocument ; this . drawingDocument = DrawingDocument ; this . graphicObjects = editor . WordControl . m _oLogicDocument . DrawingObjects ; this . selected = false ; this . behindDoc = false ; this . bNoNeedToAdd = false ; this . pageIndex =
- 1 ; this . Lock = new AscCommon . CLock ; this . ParaMath = null ; this . SkipOnRecalculate = false ; this . LineTop = null ; this . LineBottom = null ; g _oTableId . Add ( this , this . Id ) ; if ( this . graphicObjects ) { this . Set _RelativeHeight ( this . graphicObjects . getZIndex ( ) ) ; if ( History . Is _On ( ) && ! g _oTableId . m _bTurnOff ) this . graphicObjects . addGraphicObject ( this ) } } ParaDrawing . prototype = Object . create ( CRunElementBase . prototype ) ; ParaDrawing . prototype . constructor = ParaDrawing ; ParaDrawing . prototype . Type = para _Drawing ; ParaDrawing . prototype . Get _Type = function ( ) { return this . Type } ;
ParaDrawing . prototype . Get _Width = function ( ) { return this . Width } ; ParaDrawing . prototype . Get _WidthVisible = function ( ) { return this . WidthVisible } ; ParaDrawing . prototype . Set _WidthVisible = function ( WidthVisible ) { this . WidthVisible = WidthVisible } ; ParaDrawing . prototype . GetSelectedContent = function ( SelectedContent ) { if ( this . GraphicObj && this . GraphicObj . GetSelectedContent ) this . GraphicObj . GetSelectedContent ( SelectedContent ) } ; ParaDrawing . prototype . GetSearchElementId = function ( bNext , bCurrent ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . GetSearchElementId === "function" ) return this . GraphicObj . GetSearchElementId ( bNext , bCurrent ) ; return null } ; ParaDrawing . prototype . CheckCorrect = function ( ) { if ( ! this . GraphicObj ) return false ; if ( this . GraphicObj && this . GraphicObj . checkCorrect ) return this . GraphicObj . checkCorrect ( ) ; return true } ; ParaDrawing . prototype . GetAllDrawingObjects = function ( DrawingObjects ) { if ( null == DrawingObjects ) DrawingObjects = [ ] ; if ( this . GraphicObj . GetAllDrawingObjects ) this . GraphicObj . GetAllDrawingObjects ( DrawingObjects ) } ;
ParaDrawing . prototype . canRotate = function ( ) { return AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . canRotate == "function" && this . GraphicObj . canRotate ( ) } ; ParaDrawing . prototype . GetParagraph = function ( ) { return this . Get _ParentParagraph ( ) } ; ParaDrawing . prototype . GetRun = function ( ) { return this . Get _Run ( ) } ; ParaDrawing . prototype . Get _Run = function ( ) { var oParagraph = this . Get _ParentParagraph ( ) ; if ( oParagraph ) return oParagraph . Get _DrawingObjectRun ( this . Id ) ; return null } ; ParaDrawing . prototype . Get _Props = function ( OtherProps ) { var Props =
{ } ; Props . Width = this . GraphicObj . extX ; Props . Height = this . GraphicObj . extY ; if ( drawing _Inline === this . DrawingType ) Props . WrappingStyle = c _oAscWrapStyle2 . Inline ; else if ( WRAPPING _TYPE _NONE === this . wrappingType ) Props . WrappingStyle = this . behindDoc === true ? c _oAscWrapStyle2 . Behind : c _oAscWrapStyle2 . InFront ; else switch ( this . wrappingType ) { case WRAPPING _TYPE _SQUARE : Props . WrappingStyle = c _oAscWrapStyle2 . Square ; break ; case WRAPPING _TYPE _TIGHT : Props . WrappingStyle = c _oAscWrapStyle2 . Tight ; break ; case WRAPPING _TYPE _THROUGH : Props . WrappingStyle =
c _oAscWrapStyle2 . Through ; break ; case WRAPPING _TYPE _TOP _AND _BOTTOM : Props . WrappingStyle = c _oAscWrapStyle2 . TopAndBottom ; break ; default : Props . WrappingStyle = c _oAscWrapStyle2 . Inline ; break } if ( drawing _Inline === this . DrawingType ) Props . Paddings = { Left : AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT , Right : AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT , Top : 0 , Bottom : 0 } ; else { var oDistance = this . Get _Distance ( ) ; Props . Paddings = { Left : oDistance . L , Right : oDistance . R , Top : oDistance . T , Bottom : oDistance . B } } Props . AllowOverlap = this . AllowOverlap ; Props . Position =
{ X : this . X , Y : this . Y } ; Props . PositionH = { RelativeFrom : this . PositionH . RelativeFrom , UseAlign : this . PositionH . Align , Align : true === this . PositionH . Align ? this . PositionH . Value : undefined , Value : true === this . PositionH . Align ? 0 : this . PositionH . Value , Percent : this . PositionH . Percent } ; Props . PositionV = { RelativeFrom : this . PositionV . RelativeFrom , UseAlign : this . PositionV . Align , Align : true === this . PositionV . Align ? this . PositionV . Value : undefined , Value : true === this . PositionV . Align ? 0 : this . PositionV . Value , Percent : this . PositionV . Percent } ;
if ( this . SizeRelH && this . SizeRelH . Percent > 0 ) Props . SizeRelH = { RelativeFrom : AscFormat . ConvertRelSizeHToRelPosition ( this . SizeRelH . RelativeFrom ) , Value : this . SizeRelH . Percent * 100 >> 0 } ; if ( this . SizeRelV && this . SizeRelV . Percent > 0 ) Props . SizeRelV = { RelativeFrom : AscFormat . ConvertRelSizeVToRelPosition ( this . SizeRelV . RelativeFrom ) , Value : this . SizeRelV . Percent * 100 >> 0 } ; Props . Internal _Position = this . Internal _Position ; Props . Locked = this . Lock . Is _Locked ( ) ; var ParentParagraph = this . Get _ParentParagraph ( ) ; if ( ParentParagraph && undefined !==
ParentParagraph . Parent ) { var DocContent = ParentParagraph . Parent ; if ( true === DocContent . Is _DrawingShape ( ) || DocContent . GetTopDocumentContent ( ) instanceof CFootEndnote ) Props . CanBeFlow = false } Props . title = this . docPr . title !== null ? this . docPr . title : undefined ; Props . description = this . docPr . descr !== null ? this . docPr . descr : undefined ; if ( null != OtherProps && undefined != OtherProps ) { if ( undefined === OtherProps . Width || . 001 > Math . abs ( Props . Width - OtherProps . Width ) ) Props . Width = undefined ; if ( undefined === OtherProps . Height || . 001 > Math . abs ( Props . Height -
OtherProps . Height ) ) Props . Height = undefined ; if ( undefined === OtherProps . WrappingStyle || Props . WrappingStyle != OtherProps . WrappingStyle ) Props . WrappingStyle = undefined ; if ( undefined === OtherProps . ImageUrl || Props . ImageUrl != OtherProps . ImageUrl ) Props . ImageUrl = undefined ; if ( undefined === OtherProps . Paddings . Left || . 001 > Math . abs ( Props . Paddings . Left - OtherProps . Paddings . Left ) ) Props . Paddings . Left = undefined ; if ( undefined === OtherProps . Paddings . Right || . 001 > Math . abs ( Props . Paddings . Right - OtherProps . Paddings . Right ) ) Props . Paddings . Right =
undefined ; if ( undefined === OtherProps . Paddings . Top || . 001 > Math . abs ( Props . Paddings . Top - OtherProps . Paddings . Top ) ) Props . Paddings . Top = undefined ; if ( undefined === OtherProps . Paddings . Bottom || . 001 > Math . abs ( Props . Paddings . Bottom - OtherProps . Paddings . Bottom ) ) Props . Paddings . Bottom = undefined ; if ( undefined === OtherProps . AllowOverlap || Props . AllowOverlap != OtherProps . AllowOverlap ) Props . AllowOverlap = undefined ; if ( undefined === OtherProps . Position . X || . 001 > Math . abs ( Props . Position . X - OtherProps . Position . X ) ) Props . Position . X = undefined ;
if ( undefined === OtherProps . Position . Y || . 001 > Math . abs ( Props . Position . Y - OtherProps . Position . Y ) ) Props . Position . Y = undefined ; if ( undefined === OtherProps . PositionH . RelativeFrom || Props . PositionH . RelativeFrom != OtherProps . PositionH . RelativeFrom ) Props . PositionH . RelativeFrom = undefined ; if ( undefined === OtherProps . PositionH . UseAlign || Props . PositionH . UseAlign != OtherProps . PositionH . UseAlign ) Props . PositionH . UseAlign = undefined ; if ( Props . PositionH . RelativeFrom === OtherProps . PositionH . RelativeFrom && Props . PositionH . UseAlign ===
OtherProps . PositionH . UseAlign ) { if ( true != Props . PositionH . UseAlign && . 001 > Math . abs ( Props . PositionH . Value - OtherProps . PositionH . Value ) ) Props . PositionH . Value = undefined ; if ( true === Props . PositionH . UseAlign && Props . PositionH . Align != OtherProps . PositionH . Align ) Props . PositionH . Align = undefined } if ( undefined === OtherProps . PositionV . RelativeFrom || Props . PositionV . RelativeFrom != OtherProps . PositionV . RelativeFrom ) Props . PositionV . RelativeFrom = undefined ; if ( undefined === OtherProps . PositionV . UseAlign || Props . PositionV . UseAlign !=
OtherProps . PositionV . UseAlign ) Props . PositionV . UseAlign = undefined ; if ( Props . PositionV . RelativeFrom === OtherProps . PositionV . RelativeFrom && Props . PositionV . UseAlign === OtherProps . PositionV . UseAlign ) { if ( true != Props . PositionV . UseAlign && . 001 > Math . abs ( Props . PositionV . Value - OtherProps . PositionV . Value ) ) Props . PositionV . Value = undefined ; if ( true === Props . PositionV . UseAlign && Props . PositionV . Align != OtherProps . PositionV . Align ) Props . PositionV . Align = undefined } if ( false === OtherProps . Locked ) Props . Locked = false ; if ( false === OtherProps . CanBeFlow ||
false === Props . CanBeFlow ) Props . CanBeFlow = false ; else Props . CanBeFlow = true ; if ( undefined === OtherProps . title || Props . title !== OtherProps . title ) Props . title = undefined ; if ( undefined === OtherProps . description || Props . description !== OtherProps . description ) Props . description = undefined } return Props } ; ParaDrawing . prototype . Is _UseInDocument = function ( ) { if ( this . Parent ) { var Run = this . Parent . Get _DrawingObjectRun ( this . Id ) ; if ( Run ) return Run . Is _UseInDocument ( this . Get _Id ( ) ) } return false } ; ParaDrawing . prototype . IsUseInDocument = function ( ) { return this . Is _UseInDocument ( ) } ;
ParaDrawing . prototype . CheckGroupSizes = function ( ) { if ( this . GraphicObj && this . GraphicObj . CheckGroupSizes ) this . GraphicObj . CheckGroupSizes ( ) } ; ParaDrawing . prototype . Set _DrawingType = function ( DrawingType ) { History . Add ( new CChangesParaDrawingDrawingType ( this , this . DrawingType , DrawingType ) ) ; this . DrawingType = DrawingType } ; ParaDrawing . prototype . Set _WrappingType = function ( WrapType ) { History . Add ( new CChangesParaDrawingWrappingType ( this , this . wrappingType , WrapType ) ) ; this . wrappingType = WrapType } ; ParaDrawing . prototype . Set _Distance =
function ( L , T , R , B ) { var oDistance = this . Get _Distance ( ) ; if ( ! AscFormat . isRealNumber ( L ) ) L = oDistance . L ; if ( ! AscFormat . isRealNumber ( T ) ) T = oDistance . T ; if ( ! AscFormat . isRealNumber ( R ) ) R = oDistance . R ; if ( ! AscFormat . isRealNumber ( B ) ) B = oDistance . B ; History . Add ( new CChangesParaDrawingDistance ( this , { Left : this . Distance . L , Top : this . Distance . T , Right : this . Distance . R , Bottom : this . Distance . B } , { Left : L , Top : T , Right : R , Bottom : B } ) ) ; this . Distance . L = L ; this . Distance . R = R ; this . Distance . T = T ; this . Distance . B = B } ; ParaDrawing . prototype . Set _AllowOverlap =
function ( AllowOverlap ) { History . Add ( new CChangesParaDrawingAllowOverlap ( this , this . AllowOverlap , AllowOverlap ) ) ; this . AllowOverlap = AllowOverlap } ; ParaDrawing . prototype . Set _PositionH = function ( RelativeFrom , Align , Value , Percent ) { var _Value , _Percent ; if ( AscFormat . isRealNumber ( Value ) && AscFormat . fApproxEqual ( Value , 0 ) && true === Percent ) { _Value = 0 ; _Percent = false } else { _Value = Value ; _Percent = Percent } History . Add ( new CChangesParaDrawingPositionH ( this , { RelativeFrom : this . PositionH . RelativeFrom , Align : this . PositionH . Align ,
Value : this . PositionH . Value , Percent : this . PositionH . Percent } , { RelativeFrom : RelativeFrom , Align : Align , Value : _Value , Percent : _Percent } ) ) ; this . PositionH . RelativeFrom = RelativeFrom ; this . PositionH . Align = Align ; this . PositionH . Value = _Value ; this . PositionH . Percent = _Percent } ; ParaDrawing . prototype . Set _PositionV = function ( RelativeFrom , Align , Value , Percent ) { var _Value , _Percent ; if ( AscFormat . isRealNumber ( Value ) && AscFormat . fApproxEqual ( Value , 0 ) && true === Percent ) { _Value = 0 ; _Percent = false } else { _Value = Value ; _Percent = Percent } History . Add ( new CChangesParaDrawingPositionV ( this ,
{ RelativeFrom : this . PositionV . RelativeFrom , Align : this . PositionV . Align , Value : this . PositionV . Value , Percent : this . PositionV . Percent } , { RelativeFrom : RelativeFrom , Align : Align , Value : _Value , Percent : _Percent } ) ) ; this . PositionV . RelativeFrom = RelativeFrom ; this . PositionV . Align = Align ; this . PositionV . Value = _Value ; this . PositionV . Percent = _Percent } ; ParaDrawing . prototype . GetPositionH = function ( ) { return { RelativeFrom : this . PositionH . RelativeFrom , Align : this . PositionH . Align , Value : this . PositionH . Value , Percent : this . PositionH . Percent } } ;
ParaDrawing . prototype . GetPositionV = function ( ) { return { RelativeFrom : this . PositionV . RelativeFrom , Align : this . PositionV . Align , Value : this . PositionV . Value , Percent : this . PositionV . Percent } } ; ParaDrawing . prototype . Set _BehindDoc = function ( BehindDoc ) { History . Add ( new CChangesParaDrawingBehindDoc ( this , this . behindDoc , BehindDoc ) ) ; this . behindDoc = BehindDoc } ; ParaDrawing . prototype . Set _GraphicObject = function ( graphicObject ) { var oldId = AscCommon . isRealObject ( this . GraphicObj ) ? this . GraphicObj . Get _Id ( ) : null ; var newId = AscCommon . isRealObject ( graphicObject ) ?
graphicObject . Get _Id ( ) : null ; History . Add ( new CChangesParaDrawingGraphicObject ( this , oldId , newId ) ) ; if ( graphicObject ) graphicObject . handleUpdateExtents ( ) ; this . GraphicObj = graphicObject } ; ParaDrawing . prototype . setSimplePos = function ( use , x , y ) { History . Add ( new CChangesParaDrawingSimplePos ( this , { Use : this . SimplePos . Use , X : this . SimplePos . X , Y : this . SimplePos . Y } , { Use : use , X : x , Y : y } ) ) ; this . SimplePos . Use = use ; this . SimplePos . X = x ; this . SimplePos . Y = y } ; ParaDrawing . prototype . setExtent = function ( extX , extY ) { History . Add ( new CChangesParaDrawingExtent ( this ,
{ W : this . Extent . W , H : this . Extent . H } , { W : extX , H : extY } ) ) ; this . Extent . W = extX ; this . Extent . H = extY } ; ParaDrawing . prototype . addWrapPolygon = function ( wrapPolygon ) { History . Add ( new CChangesParaDrawingWrapPolygon ( this , this . wrappingPolygon , wrapPolygon ) ) ; this . wrappingPolygon = wrapPolygon } ; ParaDrawing . prototype . Set _Locked = function ( bLocked ) { History . Add ( new CChangesParaDrawingLocked ( this , this . Locked , bLocked ) ) ; this . Locked = bLocked } ; ParaDrawing . prototype . Set _RelativeHeight = function ( nRelativeHeight ) { History . Add ( new CChangesParaDrawingRelativeHeight ( this ,
this . RelativeHeight , nRelativeHeight ) ) ; this . Set _RelativeHeight2 ( nRelativeHeight ) } ; ParaDrawing . prototype . Set _RelativeHeight2 = function ( nRelativeHeight ) { this . RelativeHeight = nRelativeHeight ; if ( this . graphicObjects && AscFormat . isRealNumber ( nRelativeHeight ) && nRelativeHeight > this . graphicObjects . maximalGraphicObjectZIndex ) this . graphicObjects . maximalGraphicObjectZIndex = nRelativeHeight } ; ParaDrawing . prototype . setEffectExtent = function ( L , T , R , B ) { var oEE = this . EffectExtent ; History . Add ( new CChangesParaDrawingEffectExtent ( this ,
{ L : oEE . L , T : oEE . T , R : oEE . R , B : oEE . B } , { L : L , T : T , R : R , B : B } ) ) ; this . EffectExtent . L = L ; this . EffectExtent . T = T ; this . EffectExtent . R = R ; this . EffectExtent . B = B } ; ParaDrawing . prototype . Set _Parent = function ( oParent ) { History . Add ( new CChangesParaDrawingParent ( this , this . Parent , oParent ) ) ; this . Parent = oParent } ; ParaDrawing . prototype . IsWatermark = function ( ) { if ( ! this . GraphicObj ) return false ; if ( this . GraphicObj . getObjectType ( ) !== AscDFH . historyitem _type _Shape && this . GraphicObj . getObjectType ( ) !== AscDFH . historyitem _type _ImageShape ) return false ;
if ( this . Is _Inline ( ) ) return false ; var oParagraph = this . GetParagraph ( ) ; if ( ! ( oParagraph instanceof Paragraph ) ) return false ; var oContent = oParagraph . Parent ; if ( ! oContent || oContent . Is _DrawingShape ( false ) ) return false ; var oHdrFtr = oContent . IsHdrFtr ( true ) ; if ( ! oHdrFtr ) return false ; var oRun = this . Get _Run ( ) ; if ( ! oRun ) return false ; var arrDocPos = oRun . GetDocumentPositionFromObject ( ) ; for ( var nIndex = 0 , nCount = arrDocPos . length ; nIndex < nCount ; ++ nIndex ) { var oClass = arrDocPos [ nIndex ] . Class ; var oSdt = null ; if ( oClass instanceof
CDocumentContent && oClass . Parent instanceof CBlockLevelSdt ) oSdt = oClass . Parent ; else if ( oClass instanceof CInlineLevelSdt ) oSdt = oClass ; if ( oSdt ) { var oPr = oSdt . Pr ; if ( AscCommon . isRealObject ( oPr ) && AscCommon . isRealObject ( oPr . DocPartObj ) && oPr . DocPartObj . Gallery === "Watermarks" ) return true } } return false } ; ParaDrawing . prototype . Set _ParaMath = function ( ParaMath ) { History . Add ( new CChangesParaDrawingParaMath ( this , this . ParaMath , ParaMath ) ) ; this . ParaMath = ParaMath } ; ParaDrawing . prototype . Set _LayoutInCell = function ( LayoutInCell ) { if ( this . LayoutInCell ===
LayoutInCell ) return ; History . Add ( new CChangesParaDrawingLayoutInCell ( this , this . LayoutInCell , LayoutInCell ) ) ; this . LayoutInCell = LayoutInCell } ; ParaDrawing . prototype . SetSizeRelH = function ( oSize ) { History . Add ( new CChangesParaDrawingSizeRelH ( this , this . SizeRelH , oSize ) ) ; this . SizeRelH = oSize } ; ParaDrawing . prototype . SetSizeRelV = function ( oSize ) { History . Add ( new CChangesParaDrawingSizeRelV ( this , this . SizeRelV , oSize ) ) ; this . SizeRelV = oSize } ; ParaDrawing . prototype . getXfrmExtX = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
AscCommon . isRealObject ( this . GraphicObj . spPr ) && AscCommon . isRealObject ( this . GraphicObj . spPr . xfrm ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extX ) ) return this . GraphicObj . spPr . xfrm . extX ; if ( AscFormat . isRealNumber ( this . Extent . W ) ) return this . Extent . W ; return 0 } ; ParaDrawing . prototype . getXfrmExtY = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && AscCommon . isRealObject ( this . GraphicObj . spPr ) && AscCommon . isRealObject ( this . GraphicObj . spPr . xfrm ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extY ) ) return this . GraphicObj . spPr . xfrm . extY ;
if ( AscFormat . isRealNumber ( this . Extent . H ) ) return this . Extent . H ; return 0 } ; ParaDrawing . prototype . getXfrmRot = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && AscCommon . isRealObject ( this . GraphicObj . spPr ) && AscCommon . isRealObject ( this . GraphicObj . spPr . xfrm ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . rot ) ) return this . GraphicObj . spPr . xfrm . rot ; return 0 } ; ParaDrawing . prototype . Get _Bounds = function ( ) { var InsL , InsT , InsR , InsB ; InsL = 0 ; InsT = 0 ; InsR = 0 ; InsB = 0 ; if ( ! this . Is _Inline ( ) ) { var oDistance = this . Get _Distance ( ) ;
if ( oDistance ) { InsL = oDistance . L ; InsT = oDistance . T ; InsR = oDistance . R ; InsB = oDistance . B } } var ExtX = this . getXfrmExtX ( ) ; var ExtY = this . getXfrmExtY ( ) ; var Rot = this . getXfrmRot ( ) ; var X , Y , W , H ; if ( AscFormat . checkNormalRotate ( Rot ) ) { X = this . X ; Y = this . Y ; W = ExtX ; H = ExtY } else { X = this . X + ExtX / 2 - ExtY / 2 ; Y = this . Y + ExtY / 2 - ExtX / 2 ; W = ExtY ; H = ExtX } return { Left : X - this . EffectExtent . L - InsL , Top : Y - this . EffectExtent . T - InsT , Bottom : Y + H + this . EffectExtent . B + InsB , Right : X + W + this . EffectExtent . R + InsR } } ; ParaDrawing . prototype . Search = function ( Str , Props ,
SearchEngine , Type ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . Search === "function" ) this . GraphicObj . Search ( Str , Props , SearchEngine , Type ) } ; ParaDrawing . prototype . Set _Props = function ( Props ) { var bCheckWrapPolygon = false ; var isPictureCC = false ; var oRun = this . GetRun ( ) ; if ( oRun ) { var arrContentControls = oRun . GetParentContentControls ( ) ; for ( var nIndex = 0 , nCount = arrContentControls . length ; nIndex < nCount ; ++ nIndex ) if ( arrContentControls [ nIndex ] . IsPicture ( ) ) { isPictureCC = true ; break } } if ( undefined != Props . WrappingStyle &&
! isPictureCC ) { if ( drawing _Inline === this . DrawingType && c _oAscWrapStyle2 . Inline != Props . WrappingStyle && undefined === Props . Paddings ) this . Set _Distance ( 3.2 , 0 , 3.2 , 0 ) ; this . Set _DrawingType ( c _oAscWrapStyle2 . Inline === Props . WrappingStyle ? drawing _Inline : drawing _Anchor ) ; if ( c _oAscWrapStyle2 . Inline === Props . WrappingStyle ) if ( AscCommon . isRealObject ( this . GraphicObj . bounds ) && AscFormat . isRealNumber ( this . GraphicObj . bounds . w ) && AscFormat . isRealNumber ( this . GraphicObj . bounds . h ) ) this . CheckWH ( ) ; if ( c _oAscWrapStyle2 . Behind === Props . WrappingStyle ||
c _oAscWrapStyle2 . InFront === Props . WrappingStyle ) { this . Set _WrappingType ( WRAPPING _TYPE _NONE ) ; this . Set _BehindDoc ( c _oAscWrapStyle2 . Behind === Props . WrappingStyle ? true : false ) } else { switch ( Props . WrappingStyle ) { case c _oAscWrapStyle2 . Square : this . Set _WrappingType ( WRAPPING _TYPE _SQUARE ) ; break ; case c _oAscWrapStyle2 . Tight : { bCheckWrapPolygon = true ; this . Set _WrappingType ( WRAPPING _TYPE _TIGHT ) ; break } case c _oAscWrapStyle2 . Through : { this . Set _WrappingType ( WRAPPING _TYPE _THROUGH ) ; bCheckWrapPolygon = true ; break } case c _oAscWrapStyle2 . TopAndBottom : this . Set _WrappingType ( WRAPPING _TYPE _TOP _AND _BOTTOM ) ;
break ; default : this . Set _WrappingType ( WRAPPING _TYPE _SQUARE ) ; break } this . Set _BehindDoc ( false ) } } if ( undefined != Props . Paddings ) this . Set _Distance ( Props . Paddings . Left , Props . Paddings . Top , Props . Paddings . Right , Props . Paddings . Bottom ) ; if ( undefined != Props . AllowOverlap ) this . Set _AllowOverlap ( Props . AllowOverlap ) ; if ( undefined != Props . PositionH ) this . Set _PositionH ( Props . PositionH . RelativeFrom , Props . PositionH . UseAlign , true === Props . PositionH . UseAlign ? Props . PositionH . Align : Props . PositionH . Value , Props . PositionH . Percent ) ; if ( undefined !=
Props . PositionV ) this . Set _PositionV ( Props . PositionV . RelativeFrom , Props . PositionV . UseAlign , true === Props . PositionV . UseAlign ? Props . PositionV . Align : Props . PositionV . Value , Props . PositionV . Percent ) ; if ( undefined != Props . SizeRelH ) this . SetSizeRelH ( { RelativeFrom : AscFormat . ConvertRelPositionHToRelSize ( Props . SizeRelH . RelativeFrom ) , Percent : Props . SizeRelH . Value / 100 } ) ; if ( undefined != Props . SizeRelV ) this . SetSizeRelV ( { RelativeFrom : AscFormat . ConvertRelPositionVToRelSize ( Props . SizeRelV . RelativeFrom ) , Percent : Props . SizeRelV . Value /
100 } ) ; if ( this . SizeRelH && ! this . SizeRelV ) this . SetSizeRelV ( { RelativeFrom : AscCommon . c _oAscSizeRelFromV . sizerelfromvPage , Percent : 0 } ) ; if ( this . SizeRelV && ! this . SizeRelH ) this . SetSizeRelH ( { RelativeFrom : AscCommon . c _oAscSizeRelFromH . sizerelfromhPage , Percent : 0 } ) ; if ( bCheckWrapPolygon ) this . Check _WrapPolygon ( ) ; if ( undefined != Props . description ) this . docPr . setDescr ( Props . description ) ; if ( undefined != Props . title ) this . docPr . setTitle ( Props . title ) } ; ParaDrawing . prototype . CheckWH = function ( ) { if ( ! this . GraphicObj ) return ; var oldExtW =
this . Extent . W ; var oldExtH = this . Extent . H ; if ( this . GraphicObj . spPr && this . GraphicObj . spPr . xfrm && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extX ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extY ) ) { this . Extent . W = this . GraphicObj . spPr . xfrm . extX ; this . Extent . H = this . GraphicObj . spPr . xfrm . extY } this . GraphicObj . recalculate ( ) ; this . Extent . W = oldExtW ; this . Extent . H = oldExtH ; var extX , extY , rot ; if ( this . GraphicObj . spPr && this . GraphicObj . spPr . xfrm ) { if ( AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extX ) && AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . extY ) ) { extX =
this . GraphicObj . spPr . xfrm . extX ; extY = this . GraphicObj . spPr . xfrm . extY } else { extX = 5 ; extY = 5 } if ( AscFormat . isRealNumber ( this . GraphicObj . spPr . xfrm . rot ) ) rot = this . GraphicObj . spPr . xfrm . rot ; else rot = 0 } else { extX = 5 ; extY = 5 ; rot = 0 } this . setExtent ( extX , extY ) ; var EEL = 0 , EET = 0 , EER = 0 , EEB = 0 ; { var xc = this . GraphicObj . localTransform . TransformPointX ( this . GraphicObj . extX / 2 , this . GraphicObj . extY / 2 ) ; var yc = this . GraphicObj . localTransform . TransformPointY ( this . GraphicObj . extX / 2 , this . GraphicObj . extY / 2 ) ; var oBounds = this . GraphicObj . bounds ;
var LineCorrect = 0 ; if ( this . GraphicObj . pen && this . GraphicObj . pen . Fill && this . GraphicObj . pen . Fill . fill ) { LineCorrect = this . GraphicObj . pen . w == null ? 12700 : parseInt ( this . GraphicObj . pen . w ) ; LineCorrect /= 72E3 } var l = oBounds . x ; var r = l + oBounds . w ; var t = oBounds . y ; var b = t + oBounds . h ; var startX , startY ; if ( ! AscFormat . checkNormalRotate ( rot ) ) { var temp = extX ; extX = extY ; extY = temp } startX = xc - extX / 2 ; startY = yc - extY / 2 ; if ( l > startX ) l = startX ; if ( r < startX + extX ) r = startX + extX ; if ( t > startY ) t = startY ; if ( b < startY + extY ) b = startY + extY ; EEL = xc - extX /
2 - l + LineCorrect ; EET = yc - extY / 2 - t + LineCorrect ; EER = r + LineCorrect - ( xc + extX / 2 ) ; EEB = b + LineCorrect - ( yc + extY / 2 ) } this . setEffectExtent ( EEL , EET , EER , EEB ) ; this . Check _WrapPolygon ( ) } ; ParaDrawing . prototype . Check _WrapPolygon = function ( ) { if ( ( this . wrappingType === WRAPPING _TYPE _TIGHT || this . wrappingType === WRAPPING _TYPE _THROUGH ) && this . wrappingPolygon && ! this . wrappingPolygon . edited ) { this . GraphicObj . recalculate ( ) ; this . wrappingPolygon . setArrRelPoints ( this . wrappingPolygon . calculate ( this . GraphicObj ) ) } } ; ParaDrawing . prototype . Draw =
function ( X , Y , pGraphics , PDSE ) { var nPageIndex = null ; if ( AscCommon . isRealObject ( PDSE ) ) nPageIndex = PDSE . Page ; if ( pGraphics . Start _Command ) { pGraphics . m _aDrawings . push ( new AscFormat . ParaDrawingStruct ( undefined , this ) ) ; return } if ( this . Is _Inline ( ) ) { pGraphics . shapePageIndex = nPageIndex ; this . draw ( pGraphics , PDSE ) ; pGraphics . shapePageIndex = null } if ( pGraphics . End _Command ) pGraphics . End _Command ( ) } ; ParaDrawing . prototype . Measure = function ( ) { if ( ! this . GraphicObj ) { this . Width = 0 ; this . Height = 0 ; return } if ( AscFormat . isRealNumber ( this . Extent . W ) &&
AscFormat . isRealNumber ( this . Extent . H ) && ( ! this . GraphicObj . checkAutofit || ! this . GraphicObj . checkAutofit ( ) ) && ! this . SizeRelH && ! this . SizeRelV ) { var oEffectExtent = this . EffectExtent ; var W , H ; if ( AscFormat . isRealNumber ( this . GraphicObj . rot ) ) if ( AscFormat . checkNormalRotate ( this . GraphicObj . rot ) ) { W = this . Extent . W ; H = this . Extent . H } else { W = this . Extent . H ; H = this . Extent . W } else { W = this . Extent . W ; H = this . Extent . H } this . Width = W + AscFormat . getValOrDefault ( oEffectExtent . L , 0 ) + AscFormat . getValOrDefault ( oEffectExtent . R , 0 ) ; this . Height =
H + AscFormat . getValOrDefault ( oEffectExtent . T , 0 ) + AscFormat . getValOrDefault ( oEffectExtent . B , 0 ) ; this . WidthVisible = this . Width } else { this . GraphicObj . recalculate ( ) ; if ( this . GraphicObj . recalculateText ) this . GraphicObj . recalculateText ( ) ; if ( this . PositionH . UseAlign || this . Is _Inline ( ) ) this . Width = this . GraphicObj . bounds . w ; else this . Width = this . GraphicObj . extX ; this . WidthVisible = this . Width ; if ( this . PositionV . UseAlign || this . Is _Inline ( ) ) this . Height = this . GraphicObj . bounds . h ; else this . Height = this . GraphicObj . extY } } ; ParaDrawing . prototype . SaveRecalculateObject =
function ( Copy ) { var DrawingObj = { } ; DrawingObj . Type = this . Type ; DrawingObj . DrawingType = this . DrawingType ; DrawingObj . WrappingType = this . wrappingType ; if ( drawing _Anchor === this . Get _DrawingType ( ) && true === this . Use _TextWrap ( ) ) { var oDistance = this . Get _Distance ( ) ; DrawingObj . FlowPos = { X : this . X - oDistance . L , Y : this . Y - oDistance . T , W : this . Width + oDistance . R , H : this . Height + oDistance . B } } DrawingObj . PageNum = this . PageNum ; DrawingObj . X = this . X ; DrawingObj . Y = this . Y ; DrawingObj . spRecaclcObject = this . GraphicObj . getRecalcObject ( ) ; return DrawingObj } ;
ParaDrawing . prototype . LoadRecalculateObject = function ( RecalcObj ) { this . updatePosition3 ( RecalcObj . PageNum , RecalcObj . X , RecalcObj . Y ) ; this . GraphicObj . setRecalcObject ( RecalcObj . spRecaclcObject ) } ; ParaDrawing . prototype . Reassign _ImageUrls = function ( mapUrls ) { if ( this . GraphicObj ) this . GraphicObj . Reassign _ImageUrls ( mapUrls ) } ; ParaDrawing . prototype . PrepareRecalculateObject = function ( ) { } ; ParaDrawing . prototype . Is _RealContent = function ( ) { return true } ; ParaDrawing . prototype . Can _AddNumbering = function ( ) { if ( drawing _Inline ===
this . DrawingType ) return true ; return false } ; ParaDrawing . prototype . Copy = function ( oPr ) { var c = new ParaDrawing ( this . Extent . W , this . Extent . H , null , editor . WordControl . m _oLogicDocument . DrawingDocument , null , null ) ; c . Set _DrawingType ( this . DrawingType ) ; if ( AscCommon . isRealObject ( this . GraphicObj ) ) { var oCopyPr = new AscFormat . CCopyObjectProperties ; oCopyPr . contentCopyPr = oPr ; c . Set _GraphicObject ( this . GraphicObj . copy ( oCopyPr ) ) ; c . GraphicObj . setParent ( c ) } var d = this . Distance ; c . Set _PositionH ( this . PositionH . RelativeFrom , this . PositionH . Align ,
this . PositionH . Value , this . PositionH . Percent ) ; c . Set _PositionV ( this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) ; c . Set _Distance ( d . L , d . T , d . R , d . B ) ; c . Set _AllowOverlap ( this . AllowOverlap ) ; c . Set _WrappingType ( this . wrappingType ) ; if ( this . wrappingPolygon ) c . wrappingPolygon . fromOther ( this . wrappingPolygon ) ; c . Set _BehindDoc ( this . behindDoc ) ; c . Set _RelativeHeight ( this . RelativeHeight ) ; if ( this . SizeRelH ) c . SetSizeRelH ( { RelativeFrom : this . SizeRelH . RelativeFrom , Percent : this . SizeRelH . Percent } ) ;
if ( this . SizeRelV ) c . SetSizeRelV ( { RelativeFrom : this . SizeRelV . RelativeFrom , Percent : this . SizeRelV . Percent } ) ; if ( AscFormat . isRealNumber ( this . Extent . W ) && AscFormat . isRealNumber ( this . Extent . H ) ) c . setExtent ( this . Extent . W , this . Extent . H ) ; var EE = this . EffectExtent ; if ( EE . L > 0 || EE . T > 0 || EE . R > 0 || EE . B > 0 ) c . setEffectExtent ( EE . L , EE . T , EE . R , EE . B ) ; c . docPr . setFromOther ( this . docPr ) ; if ( this . ParaMath ) c . Set _ParaMath ( this . ParaMath . Copy ( ) ) ; return c } ; ParaDrawing . prototype . IsEqual = function ( oElement ) { return false } ; ParaDrawing . prototype . Get _Id =
function ( ) { return this . Id } ; ParaDrawing . prototype . GetId = function ( ) { return this . Id } ; ParaDrawing . prototype . setParagraphTabs = function ( tabs ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphTabs === "function" ) this . GraphicObj . setParagraphTabs ( tabs ) } ; ParaDrawing . prototype . IsMovingTableBorder = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . IsMovingTableBorder === "function" ) return this . GraphicObj . IsMovingTableBorder ( ) ; return false } ; ParaDrawing . prototype . SetVerticalClip =
function ( Top , Bottom ) { this . LineTop = Top ; this . LineBottom = Bottom } ; ParaDrawing . prototype . Update _Position = function ( Paragraph , ParaLayout , PageLimits , PageLimitsOrigin , LineNum ) { if ( undefined != this . PositionH _Old ) { this . PositionH . RelativeFrom = this . PositionH _Old . RelativeFrom2 ; this . PositionH . Align = this . PositionH _Old . Align2 ; this . PositionH . Value = this . PositionH _Old . Value2 ; this . PositionH . Percent = this . PositionH _Old . Percent2 } if ( undefined != this . PositionV _Old ) { this . PositionV . RelativeFrom = this . PositionV _Old . RelativeFrom2 ;
this . PositionV . Align = this . PositionV _Old . Align2 ; this . PositionV . Value = this . PositionV _Old . Value2 ; this . PositionV . Percent = this . PositionV _Old . Percent2 } var oDocumentContent = this . Parent && this . Parent . Parent ; if ( oDocumentContent && oDocumentContent . IsBlockLevelSdtContent ( ) ) oDocumentContent = oDocumentContent . Parent . Parent ; this . Parent = Paragraph ; this . DocumentContent = oDocumentContent ; var PageNum = ParaLayout . PageNum ; var OtherFlowObjects = editor . WordControl . m _oLogicDocument . DrawingObjects . getAllFloatObjectsOnPage ( PageNum ,
this . Parent . Parent ) ; var bInline = this . Is _Inline ( ) ; this . Internal _Position . Set ( this . GraphicObj . extX , this . GraphicObj . extY , this . getXfrmRot ( ) , this . EffectExtent , this . YOffset , ParaLayout , PageLimits ) ; this . Internal _Position . Calculate _X ( bInline , this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value , this . PositionH . Percent ) ; this . Internal _Position . Calculate _Y ( bInline , this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) ; var bCorrect = false ; if ( oDocumentContent &&
oDocumentContent . IsTableCellContent && oDocumentContent . IsTableCellContent ( false ) ) bCorrect = true ; if ( this . PositionH . RelativeFrom !== c _oAscRelativeFromH . Page || this . PositionV . RelativeFrom !== c _oAscRelativeFromV . Page ) bCorrect = true ; this . Internal _Position . Correct _Values ( bInline , PageLimits , this . AllowOverlap , this . Use _TextWrap ( ) , OtherFlowObjects , bCorrect ) ; this . GraphicObj . bounds . l = this . GraphicObj . bounds . x + this . Internal _Position . CalcX ; this . GraphicObj . bounds . r = this . GraphicObj . bounds . x + this . GraphicObj . bounds . w + this . Internal _Position . CalcX ;
this . GraphicObj . bounds . t = this . GraphicObj . bounds . y + this . Internal _Position . CalcY ; this . GraphicObj . bounds . b = this . GraphicObj . bounds . y + this . GraphicObj . bounds . h + this . Internal _Position . CalcY ; var OldPageNum = this . PageNum ; this . PageNum = PageNum ; this . LineNum = LineNum ; this . X = this . Internal _Position . CalcX ; this . Y = this . Internal _Position . CalcY ; if ( undefined != this . PositionH _Old ) { this . PositionH . RelativeFrom = this . PositionH _Old . RelativeFrom ; this . PositionH . Align = this . PositionH _Old . Align ; this . PositionH . Value = this . PositionH _Old . Value ;
this . PositionH . Percent = this . PositionH _Old . Percent ; var Value = this . Internal _Position . Calculate _X _Value ( this . PositionH _Old . RelativeFrom ) ; this . Set _PositionH ( this . PositionH _Old . RelativeFrom , false , Value , false ) ; this . X = this . Internal _Position . Calculate _X ( bInline , this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value , this . PositionH . Percent ) } if ( undefined != this . PositionV _Old ) { this . PositionV . RelativeFrom = this . PositionV _Old . RelativeFrom ; this . PositionV . Align = this . PositionV _Old . Align ; this . PositionV . Value =
this . PositionV _Old . Value ; this . PositionV . Percent = this . PositionV _Old . Percent ; var Value = this . Internal _Position . Calculate _Y _Value ( this . PositionV _Old . RelativeFrom ) ; this . Set _PositionV ( this . PositionV _Old . RelativeFrom , false , Value , false ) ; this . Y = this . Internal _Position . Calculate _Y ( bInline , this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) } this . OrigX = this . X ; this . OrigY = this . Y ; this . ShiftX = 0 ; this . ShiftY = 0 ; this . updatePosition3 ( this . PageNum , this . X , this . Y , OldPageNum ) ; this . useWrap =
this . Use _TextWrap ( ) } ; ParaDrawing . prototype . GetClipRect = function ( ) { if ( this . Is _Inline ( ) || this . Use _TextWrap ( ) ) { var oCell ; if ( this . DocumentContent && ( oCell = this . DocumentContent . IsTableCellContent ( true ) ) ) { var arrPages = oCell . GetCurPageByAbsolutePage ( this . PageNum ) ; for ( var nIndex = 0 , nCount = arrPages . length ; nIndex < nCount ; ++ nIndex ) { var oPageBounds = oCell . GetPageBounds ( arrPages [ nIndex ] ) ; if ( this . GraphicObj . bounds . isIntersect ( oPageBounds . Left , oPageBounds . Top , oPageBounds . Right , oPageBounds . Bottom ) ) return new AscFormat . CGraphicBounds ( oPageBounds . Left ,
oPageBounds . Top , oPageBounds . Right , oPageBounds . Bottom ) } } } return null } ; ParaDrawing . prototype . Update _PositionYHeaderFooter = function ( TopMarginY , BottomMarginY ) { this . Internal _Position . Update _PositionYHeaderFooter ( TopMarginY , BottomMarginY ) ; this . Internal _Position . Calculate _Y ( this . Is _Inline ( ) , this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) ; this . OrigY = this . Internal _Position . CalcY ; this . Y = this . OrigY + this . ShiftY ; this . updatePosition3 ( this . PageNum , this . X , this . Y , this . PageNum ) } ;
ParaDrawing . prototype . Reset _SavedPosition = function ( ) { this . PositionV _Old = undefined ; this . PositionH _Old = undefined } ; ParaDrawing . prototype . setParagraphBorders = function ( val ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphBorders === "function" ) this . GraphicObj . setParagraphBorders ( val ) } ; ParaDrawing . prototype . deselect = function ( ) { this . selected = false ; if ( this . GraphicObj && this . GraphicObj . deselect ) this . GraphicObj . deselect ( ) } ; ParaDrawing . prototype . updatePosition3 = function ( pageIndex ,
x , y , oldPageNum ) { var _x = x , _y = y ; this . graphicObjects . removeById ( pageIndex , this . Get _Id ( ) ) ; if ( AscFormat . isRealNumber ( oldPageNum ) ) this . graphicObjects . removeById ( oldPageNum , this . Get _Id ( ) ) ; var bChangePageIndex = this . pageIndex !== pageIndex ; this . setPageIndex ( pageIndex ) ; if ( typeof this . GraphicObj . setStartPage === "function" ) { var bIsHfdFtr = this . DocumentContent && this . DocumentContent . IsHdrFtr ( ) ; this . GraphicObj . setStartPage ( pageIndex , bIsHfdFtr , bIsHfdFtr || bChangePageIndex ) } if ( ! ( this . DocumentContent && this . DocumentContent . IsHdrFtr ( ) &&
this . DocumentContent . Get _StartPage _Absolute ( ) !== pageIndex ) ) { this . graphicObjects . addObjectOnPage ( pageIndex , this . GraphicObj ) ; this . bNoNeedToAdd = false } else this . bNoNeedToAdd = true ; if ( this . GraphicObj . bNeedUpdatePosition || ! ( AscFormat . isRealNumber ( this . GraphicObj . posX ) && AscFormat . isRealNumber ( this . GraphicObj . posY ) ) || ! ( Math . abs ( this . GraphicObj . posX - _x ) < MOVE _DELTA && Math . abs ( this . GraphicObj . posY - _y ) < MOVE _DELTA ) ) this . GraphicObj . updatePosition ( _x , _y ) ; if ( this . GraphicObj . bNeedUpdatePosition || ! ( AscFormat . isRealNumber ( this . wrappingPolygon . posX ) &&
AscFormat . isRealNumber ( this . wrappingPolygon . posY ) ) || ! ( Math . abs ( this . wrappingPolygon . posX - _x ) < MOVE _DELTA && Math . abs ( this . wrappingPolygon . posY - _y ) < MOVE _DELTA ) ) this . wrappingPolygon . updatePosition ( _x , _y ) ; this . calculateSnapArrays ( ) } ; ParaDrawing . prototype . calculateAfterChangeTheme = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . calculateAfterChangeTheme === "function" ) this . GraphicObj . calculateAfterChangeTheme ( ) } ; ParaDrawing . prototype . selectionIsEmpty = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . selectionIsEmpty === "function" ) return this . GraphicObj . selectionIsEmpty ( ) ; return false } ; ParaDrawing . prototype . recalculateDocContent = function ( ) { } ; ParaDrawing . prototype . Shift = function ( Dx , Dy ) { this . ShiftX = Dx ; this . ShiftY = Dy ; this . X = this . OrigX + Dx ; this . Y = this . OrigY + Dy ; this . updatePosition3 ( this . PageNum , this . X , this . Y ) } ; ParaDrawing . prototype . IsLayoutInCell = function ( ) { if ( this . LogicDocument && this . LogicDocument . GetCompatibilityMode ( ) >= AscCommon . document _compatibility _mode _Word15 ) return true ;
return this . LayoutInCell } ; ParaDrawing . prototype . Get _Distance = function ( ) { var oDist = this . Distance ; return new AscFormat . CDistance ( AscFormat . getValOrDefault ( oDist . L , AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT ) , AscFormat . getValOrDefault ( oDist . T , 0 ) , AscFormat . getValOrDefault ( oDist . R , AscFormat . DISTANCE _TO _TEXT _LEFTRIGHT ) , AscFormat . getValOrDefault ( oDist . B , 0 ) ) } ; ParaDrawing . prototype . Set _XYForAdd = function ( X , Y , NearPos , PageNum ) { if ( null !== NearPos ) { var Layout = NearPos . Paragraph . Get _Layout ( NearPos . ContentPos , this ) ; this . private _SetXYByLayout ( X ,
Y , PageNum , Layout , true , true ) ; var nRecalcIndex = null ; var oLogicDocument = this . document ; if ( oLogicDocument ) { nRecalcIndex = oLogicDocument . Get _History ( ) . GetRecalculateIndex ( ) ; this . SetSkipOnRecalculate ( true ) ; oLogicDocument . TurnOff _InterfaceEvents ( ) ; oLogicDocument . Recalculate ( ) ; oLogicDocument . TurnOn _InterfaceEvents ( false ) ; this . SetSkipOnRecalculate ( false ) } if ( null !== nRecalcIndex ) oLogicDocument . Get _History ( ) . SetRecalculateIndex ( nRecalcIndex ) ; Layout = NearPos . Paragraph . Get _Layout ( NearPos . ContentPos , this ) ; this . private _SetXYByLayout ( X ,
Y , PageNum , Layout , true , true ) } } ; ParaDrawing . prototype . SetSkipOnRecalculate = function ( isSkip ) { this . SkipOnRecalculate = isSkip } ; ParaDrawing . prototype . IsSkipOnRecalculate = function ( ) { return this . SkipOnRecalculate } ; ParaDrawing . prototype . Set _XY = function ( X , Y , Paragraph , PageNum , bResetAlign ) { if ( Paragraph ) { var PageNumOld = this . PageNum ; var ContentPos = Paragraph . Get _DrawingObjectContentPos ( this . Get _Id ( ) ) ; if ( null === ContentPos ) return ; var Layout = Paragraph . Get _Layout ( ContentPos , this ) ; this . private _SetXYByLayout ( X , Y , PageNum ,
Layout , bResetAlign || true !== this . PositionH . Align ? true : false , bResetAlign || true !== this . PositionV . Align ? true : false ) ; var nRecalcIndex = null ; var oLogicDocument = this . document ; if ( oLogicDocument ) { nRecalcIndex = oLogicDocument . Get _History ( ) . GetRecalculateIndex ( ) ; this . SetSkipOnRecalculate ( true ) ; oLogicDocument . Recalculate ( ) ; this . SetSkipOnRecalculate ( false ) } if ( null !== nRecalcIndex ) oLogicDocument . Get _History ( ) . SetRecalculateIndex ( nRecalcIndex ) ; if ( ! this . LogicDocument || null === this . LogicDocument . FullRecalc . Id || PageNum <
this . LogicDocument . FullRecalc . PageIndex && PageNumOld < this . LogicDocument . FullRecalc . PageIndex ) Layout = Paragraph . Get _Layout ( ContentPos , this ) ; this . private _SetXYByLayout ( X , Y , PageNum , Layout , bResetAlign || true !== this . PositionH . Align ? true : false , bResetAlign || true !== this . PositionV . Align ? true : false ) } } ; ParaDrawing . prototype . private _SetXYByLayout = function ( X , Y , PageNum , Layout , bChangeX , bChangeY ) { if ( ! Layout ) return ; this . PageNum = PageNum ; this . Internal _Position . Set ( this . GraphicObj . extX , this . GraphicObj . extY , this . getXfrmRot ( ) ,
this . EffectExtent , this . YOffset , Layout . ParagraphLayout , Layout . PageLimitsOrigin ) ; this . Internal _Position . Calculate _X ( false , c _oAscRelativeFromH . Page , false , X - Layout . PageLimitsOrigin . X , false ) ; this . Internal _Position . Calculate _Y ( false , c _oAscRelativeFromV . Page , false , Y - Layout . PageLimitsOrigin . Y , false ) ; var bCorrect = false ; if ( this . DocumentContent && this . DocumentContent . IsTableCellContent && this . DocumentContent . IsTableCellContent ( false ) ) bCorrect = true ; if ( this . PositionH . RelativeFrom !== c _oAscRelativeFromH . Page || this . PositionV . RelativeFrom !==
c _oAscRelativeFromV . Page ) bCorrect = true ; this . Internal _Position . Correct _Values ( false , Layout . PageLimits , this . AllowOverlap , this . Use _TextWrap ( ) , [ ] , bCorrect ) ; if ( true === bChangeX ) { this . X = this . Internal _Position . CalcX ; var ValueX = this . Internal _Position . Calculate _X _Value ( this . PositionH . RelativeFrom ) ; this . Set _PositionH ( this . PositionH . RelativeFrom , false , ValueX , false ) ; this . X = this . Internal _Position . Calculate _X ( false , this . PositionH . RelativeFrom , this . PositionH . Align , this . PositionH . Value , this . PositionH . Percent ) } if ( true ===
bChangeY ) { this . Y = this . Internal _Position . CalcY ; var ValueY = this . Internal _Position . Calculate _Y _Value ( this . PositionV . RelativeFrom ) ; this . Set _PositionV ( this . PositionV . RelativeFrom , false , ValueY , false ) ; this . Y = this . Internal _Position . Calculate _Y ( false , this . PositionV . RelativeFrom , this . PositionV . Align , this . PositionV . Value , this . PositionV . Percent ) } } ; ParaDrawing . prototype . Get _DrawingType = function ( ) { return this . DrawingType } ; ParaDrawing . prototype . Is _Inline = function ( ) { if ( this . Parent && this . Parent . Get _ParentTextTransform &&
this . Parent . Get _ParentTextTransform ( ) ) return true ; return drawing _Inline === this . DrawingType ? true : false } ; ParaDrawing . prototype . IsInline = function ( ) { return this . Is _Inline ( ) } ; ParaDrawing . prototype . Use _TextWrap = function ( ) { if ( ! this . Parent || ! this . Parent . Get _FramePr || null !== this . Parent . Get _FramePr ( ) && undefined !== this . Parent . Get _FramePr ( ) ) return false ; return drawing _Anchor === this . DrawingType && ! ( this . wrappingType === WRAPPING _TYPE _NONE ) } ; ParaDrawing . prototype . IsUseTextWrap = function ( ) { return this . Use _TextWrap ( ) } ;
ParaDrawing . prototype . Draw _Selection = function ( ) { var Padding = this . DrawingDocument . GetMMPerDot ( 6 ) ; var extX , extY ; if ( this . GraphicObj ) { extX = this . GraphicObj . extX ; extY = this . GraphicObj . extY } else { extX = this . getXfrmExtX ( ) ; extY = this . getXfrmExtY ( ) } var rot = this . getXfrmRot ( ) ; if ( AscFormat . checkNormalRotate ( rot ) ) this . DrawingDocument . AddPageSelection ( this . PageNum , this . X - this . EffectExtent . L - Padding , this . Y - this . EffectExtent . T - Padding , this . EffectExtent . L + extX + this . EffectExtent . R + 2 * Padding , this . EffectExtent . T + extY + this . EffectExtent . B +
2 * Padding ) ; else this . DrawingDocument . AddPageSelection ( this . PageNum , this . X + extX / 2 - extY / 2 - this . EffectExtent . L - Padding , this . Y + extY / 2 - extX / 2 - this . EffectExtent . T - Padding , this . EffectExtent . L + extY + this . EffectExtent . R + 2 * Padding , this . EffectExtent . T + extX + this . EffectExtent . B + 2 * Padding ) } ; ParaDrawing . prototype . CanInsertToPos = function ( oAnchorPos ) { if ( ! oAnchorPos || ! oAnchorPos . Paragraph || ! oAnchorPos . Paragraph . Parent ) return false ; return ! ( ( this . IsShape ( ) || this . IsGroup ( ) ) && ( true === oAnchorPos . Paragraph . Parent . Is _DrawingShape ( ) ||
true === oAnchorPos . Paragraph . Parent . IsFootnote ( ) ) ) } ; ParaDrawing . prototype . OnEnd _MoveInline = function ( NearPos ) { if ( ! this . Parent ) return ; NearPos . Paragraph . Check _NearestPos ( NearPos ) ; var oRun = this . GetRun ( ) ; var oPictureCC = false ; if ( oRun ) { var arrContentControls = oRun . GetParentContentControls ( ) ; for ( var nIndex = arrContentControls . length - 1 ; nIndex >= 0 ; -- nIndex ) if ( arrContentControls [ nIndex ] . IsPicture ( ) ) { oPictureCC = arrContentControls [ nIndex ] ; break } } var oDstRun = null ; var arrClasses = NearPos . Paragraph . GetClassesByPos ( NearPos . ContentPos ) ;
for ( var nIndex = arrClasses . length - 1 ; nIndex >= 0 ; -- nIndex ) if ( arrClasses [ nIndex ] instanceof ParaRun ) { oDstRun = arrClasses [ nIndex ] ; break } if ( ! oDstRun || oPictureCC && oDstRun === oRun || oDstRun . GetParentForm ( ) ) { NearPos . Paragraph . Clear _NearestPosArray ( ) ; return } var NewParaDrawing = this . Copy ( ) ; var RunPr = this . Remove _FromDocument ( false ) ; this . DocumentContent . Select _DrawingObject ( NewParaDrawing . GetId ( ) ) ; NewParaDrawing . Add _ToDocument ( NearPos , true , RunPr , undefined , oPictureCC ) } ; ParaDrawing . prototype . Get _ParentTextTransform = function ( ) { if ( this . Parent ) return this . Parent . Get _ParentTextTransform ( ) ;
return null } ; ParaDrawing . prototype . GoTo _Text = function ( bBefore , bUpdateStates ) { var Paragraph = this . Get _ParentParagraph ( ) ; if ( Paragraph ) { Paragraph . MoveCursorToDrawing ( this . Id , bBefore ) ; Paragraph . Document _SetThisElementCurrent ( undefined === bUpdateStates ? true : bUpdateStates ) } } ; ParaDrawing . prototype . Remove _FromDocument = function ( bRecalculate ) { var oResult = null ; if ( ! this . Parent ) return oResult ; var oRun = this . Parent . Get _DrawingObjectRun ( this . Id ) ; if ( oRun ) { var oGrObject = this . GraphicObj ; if ( oGrObject && oGrObject . getObjectType ( ) ===
AscDFH . historyitem _type _Shape ) if ( oGrObject . signatureLine ) oGrObject . setSignature ( oGrObject . signatureLine ) ; var oPictureCC = null ; var arrContentControls = oRun . GetParentContentControls ( ) ; for ( var nIndex = arrContentControls . length - 1 ; nIndex >= 0 ; -- nIndex ) if ( arrContentControls [ nIndex ] . IsPicture ( ) ) { oPictureCC = arrContentControls [ nIndex ] ; break } if ( oPictureCC ) oPictureCC . RemoveContentControlWrapper ( ) ; oRun . Remove _DrawingObject ( this . Id ) ; if ( oRun . IsInHyperlink ( ) ) oResult = new CTextPr ; else oResult = oRun . GetTextPr ( ) ; if ( oGrObject &&
oGrObject . getObjectType ( ) === AscDFH . historyitem _type _Shape ) if ( oGrObject . signatureLine ) { editor . sendEvent ( "asc_onRemoveSignature" , oGrObject . signatureLine . id ) ; oGrObject . setSignature ( oGrObject . signatureLine ) } } if ( false != bRecalculate ) editor . WordControl . m _oLogicDocument . Recalculate ( ) ; return oResult } ; ParaDrawing . prototype . Get _ParentParagraph = function ( ) { if ( this . Parent instanceof Paragraph ) return this . Parent ; if ( this . Parent instanceof ParaRun ) return this . Parent . Paragraph ; if ( this . Parent && this . Parent . GetParagraph ( ) ) return this . Parent . GetParagraph ( ) ;
return null } ; ParaDrawing . prototype . SelectAsText = function ( ) { var oParagraph = this . GetParagraph ( ) ; var oRun = this . GetRun ( ) ; if ( ! oParagraph || ! oRun ) return ; var oDocument = oParagraph . GetLogicDocument ( ) ; if ( ! oDocument ) return ; oDocument . RemoveSelection ( ) ; oRun . Make _ThisElementCurrent ( false ) ; oRun . SetCursorPosition ( oRun . GetElementPosition ( this ) ) ; var oStartPos = oDocument . GetContentPosition ( false ) ; oRun . SetCursorPosition ( oRun . GetElementPosition ( this ) + 1 ) ; var oEndPos = oDocument . GetContentPosition ( false ) ; oDocument . RemoveSelection ( ) ;
oDocument . SetSelectionByContentPositions ( oStartPos , oEndPos ) } ; ParaDrawing . prototype . Add _ToDocument = function ( NearPos , bRecalculate , RunPr , Run , oPictureCC ) { NearPos . Paragraph . Check _NearestPos ( NearPos ) ; var LogicDocument = this . DrawingDocument . m _oLogicDocument ; var Para = new Paragraph ( this . DrawingDocument , LogicDocument ) ; var DrawingRun = new ParaRun ( Para ) ; DrawingRun . Add _ToContent ( 0 , this ) ; if ( RunPr ) DrawingRun . Set _Pr ( RunPr . Copy ( ) ) ; if ( Run ) DrawingRun . SetReviewTypeWithInfo ( Run . GetReviewType ( ) , Run . GetReviewInfo ( ) ) ; if ( oPictureCC ) { var oSdt =
new CInlineLevelSdt ; oSdt . SetPicturePr ( true ) ; oSdt . ReplacePlaceHolderWithContent ( ) ; oSdt . AddToContent ( 0 , DrawingRun ) ; Para . Add _ToContent ( 0 , oSdt ) ; var oFormPr = oPictureCC . GetFormPr ( ) ; if ( oFormPr ) oSdt . SetFormPr ( oFormPr . Copy ( ) ) } else Para . Add _ToContent ( 0 , DrawingRun ) ; var SelectedElement = new CSelectedElement ( Para , false ) ; var SelectedContent = new CSelectedContent ; SelectedContent . Add ( SelectedElement ) ; SelectedContent . SetMoveDrawing ( true ) ; SelectedContent . DrawingObjects . push ( this ) ; NearPos . Paragraph . Parent . InsertContent ( SelectedContent ,
NearPos ) ; NearPos . Paragraph . Clear _NearestPosArray ( ) ; NearPos . Paragraph . Correct _Content ( ) ; this . Set _Parent ( NearPos . Paragraph ) ; if ( false != bRecalculate ) LogicDocument . Recalculate ( ) } ; ParaDrawing . prototype . Add _ToDocument2 = function ( Paragraph ) { var DrawingRun = new ParaRun ( Paragraph ) ; DrawingRun . Add _ToContent ( 0 , this ) ; Paragraph . Add _ToContent ( 0 , DrawingRun ) ; this . Set _Parent ( Paragraph ) } ; ParaDrawing . prototype . UpdateCursorType = function ( X , Y , PageIndex ) { this . DrawingDocument . SetCursorType ( "move" , new AscCommon . CMouseMoveData ) ;
if ( null != this . Parent ) { var Lock = this . Parent . Lock ; if ( true === Lock . Is _Locked ( ) ) { var PNum = Math . max ( 0 , Math . min ( PageIndex - this . Parent . PageNum , this . Parent . Pages . length - 1 ) ) ; var _X = this . Parent . Pages [ PNum ] . X ; var _Y = this . Parent . Pages [ PNum ] . Y ; var MMData = new AscCommon . CMouseMoveData ; var Coords = this . DrawingDocument . ConvertCoordsToCursorWR ( _X , _Y , this . Parent . Get _StartPage _Absolute ( ) + ( PageIndex - this . Parent . PageNum ) ) ; MMData . X _abs = Coords . X - 5 ; MMData . Y _abs = Coords . Y ; MMData . Type = Asc . c _oAscMouseMoveDataTypes . LockedObject ;
MMData . UserId = Lock . Get _UserId ( ) ; MMData . HaveChanges = Lock . Have _Changes ( ) ; MMData . LockedObjectType = c _oAscMouseMoveLockedObjectType . Common ; editor . sync _MouseMoveCallback ( MMData ) } } } ; ParaDrawing . prototype . Get _AnchorPos = function ( ) { if ( ! this . Parent ) return null ; return this . Parent . Get _AnchorPos ( this ) } ; ParaDrawing . prototype . CheckRecalcAutoFit = function ( oSectPr ) { if ( this . GraphicObj && this . GraphicObj . CheckNeedRecalcAutoFit ) if ( this . GraphicObj . CheckNeedRecalcAutoFit ( oSectPr ) ) { if ( this . GraphicObj ) this . GraphicObj . recalcWrapPolygon &&
this . GraphicObj . recalcWrapPolygon ( ) ; this . Measure ( ) } } ; ParaDrawing . prototype . Get _ParentObject _or _DocumentPos = function ( ) { if ( this . Parent != null ) return this . Parent . Get _ParentObject _or _DocumentPos ( ) } ; ParaDrawing . prototype . Refresh _RecalcData = function ( Data ) { var oRun = this . GetRun ( ) ; if ( oRun ) { if ( AscCommon . isRealObject ( Data ) ) switch ( Data . Type ) { case AscDFH . historyitem _Drawing _Distance : { if ( this . GraphicObj ) { this . GraphicObj . recalcWrapPolygon && this . GraphicObj . recalcWrapPolygon ( ) ; this . GraphicObj . addToRecalculate ( ) } break } case AscDFH . historyitem _Drawing _SetExtent : { oRun . RecalcInfo . Measure =
true ; break } case AscDFH . historyitem _Drawing _SetSizeRelH : case AscDFH . historyitem _Drawing _SetSizeRelV : case AscDFH . historyitem _Drawing _SetGraphicObject : { if ( this . GraphicObj ) { this . GraphicObj . handleUpdateExtents && this . GraphicObj . handleUpdateExtents ( ) ; this . GraphicObj . addToRecalculate ( ) } oRun . RecalcInfo . Measure = true ; break } case AscDFH . historyitem _Drawing _WrappingType : { if ( this . GraphicObj ) { this . GraphicObj . recalcWrapPolygon && this . GraphicObj . recalcWrapPolygon ( ) ; this . GraphicObj . addToRecalculate ( ) } break } } return oRun . Refresh _RecalcData2 ( ) } } ;
ParaDrawing . prototype . Refresh _RecalcData2 = function ( Data ) { var oRun = this . GetRun ( ) ; if ( oRun ) return oRun . Refresh _RecalcData2 ( ) } ; ParaDrawing . prototype . hyperlinkCheck = function ( bCheck ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkCheck === "function" ) return this . GraphicObj . hyperlinkCheck ( bCheck ) ; return null } ; ParaDrawing . prototype . hyperlinkCanAdd = function ( bCheckInHyperlink ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkCanAdd === "function" ) return this . GraphicObj . hyperlinkCanAdd ( bCheckInHyperlink ) ;
return false } ; ParaDrawing . prototype . hyperlinkRemove = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkCanAdd === "function" ) return this . GraphicObj . hyperlinkRemove ( ) ; return false } ; ParaDrawing . prototype . hyperlinkModify = function ( HyperProps ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hyperlinkModify === "function" ) return this . GraphicObj . hyperlinkModify ( HyperProps ) } ; ParaDrawing . prototype . hyperlinkAdd = function ( HyperProps ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . hyperlinkAdd === "function" ) return this . GraphicObj . hyperlinkAdd ( HyperProps ) } ; ParaDrawing . prototype . documentStatistics = function ( stat ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . documentStatistics === "function" ) this . GraphicObj . documentStatistics ( stat ) } ; ParaDrawing . prototype . documentCreateFontCharMap = function ( fontMap ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . documentCreateFontCharMap === "function" ) this . GraphicObj . documentCreateFontCharMap ( fontMap ) } ;
ParaDrawing . prototype . documentCreateFontMap = function ( fontMap ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . documentCreateFontMap === "function" ) this . GraphicObj . documentCreateFontMap ( fontMap ) } ; ParaDrawing . prototype . tableCheckSplit = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableCheckSplit === "function" ) return this . GraphicObj . tableCheckSplit ( ) ; return false } ; ParaDrawing . prototype . tableCheckMerge = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . tableCheckMerge === "function" ) return this . GraphicObj . tableCheckMerge ( ) ; return false } ; ParaDrawing . prototype . tableSelect = function ( Type ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableSelect === "function" ) return this . GraphicObj . tableSelect ( Type ) } ; ParaDrawing . prototype . tableRemoveTable = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableRemoveTable === "function" ) return this . GraphicObj . tableRemoveTable ( ) } ; ParaDrawing . prototype . tableSplitCell =
function ( Cols , Rows ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableSplitCell === "function" ) return this . GraphicObj . tableSplitCell ( Cols , Rows ) } ; ParaDrawing . prototype . tableMergeCells = function ( Cols , Rows ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableMergeCells === "function" ) return this . GraphicObj . tableMergeCells ( Cols , Rows ) } ; ParaDrawing . prototype . tableRemoveCol = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableRemoveCol ===
"function" ) return this . GraphicObj . tableRemoveCol ( ) } ; ParaDrawing . prototype . tableAddCol = function ( bBefore , nCount ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableAddCol === "function" ) return this . GraphicObj . tableAddCol ( bBefore , nCount ) } ; ParaDrawing . prototype . tableRemoveRow = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . tableRemoveRow === "function" ) return this . GraphicObj . tableRemoveRow ( ) } ; ParaDrawing . prototype . tableAddRow = function ( bBefore , nCount ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . tableAddRow === "function" ) return this . GraphicObj . tableAddRow ( bBefore , nCount ) } ; ParaDrawing . prototype . getCurrentParagraph = function ( bIgnoreSelection , arrSelectedParagraphs ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getCurrentParagraph === "function" ) return this . GraphicObj . getCurrentParagraph ( bIgnoreSelection , arrSelectedParagraphs ) ; if ( this . Parent instanceof Paragraph ) return this . Parent } ; ParaDrawing . prototype . GetSelectedText = function ( bClearText , oPr ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . GetSelectedText === "function" ) return this . GraphicObj . GetSelectedText ( bClearText , oPr ) ; return "" } ; ParaDrawing . prototype . getCurPosXY = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getCurPosXY === "function" ) return this . GraphicObj . getCurPosXY ( ) ; return { X : 0 , Y : 0 } } ; ParaDrawing . prototype . setParagraphKeepLines = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphKeepLines === "function" ) return this . GraphicObj . setParagraphKeepLines ( Value ) } ;
ParaDrawing . prototype . setParagraphKeepNext = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphKeepNext === "function" ) return this . GraphicObj . setParagraphKeepNext ( Value ) } ; ParaDrawing . prototype . setParagraphWidowControl = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . setParagraphWidowControl === "function" ) return this . GraphicObj . setParagraphWidowControl ( Value ) } ; ParaDrawing . prototype . setParagraphPageBreakBefore = function ( Value ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . setParagraphPageBreakBefore === "function" ) return this . GraphicObj . setParagraphPageBreakBefore ( Value ) } ; ParaDrawing . prototype . isTextSelectionUse = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . isTextSelectionUse === "function" ) return this . GraphicObj . isTextSelectionUse ( ) ; return false } ; ParaDrawing . prototype . paragraphFormatPaste = function ( CopyTextPr , CopyParaPr , Bool ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . isTextSelectionUse === "function" ) return this . GraphicObj . paragraphFormatPaste ( CopyTextPr ,
CopyParaPr , Bool ) } ; ParaDrawing . prototype . getNearestPos = function ( x , y , pageIndex ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getNearestPos === "function" ) return this . GraphicObj . getNearestPos ( x , y , pageIndex ) ; return null } ; ParaDrawing . prototype . Write _ToBinary = function ( Writer ) { Writer . WriteLong ( this . Type ) ; Writer . WriteString2 ( this . Id ) } ; ParaDrawing . prototype . Write _ToBinary2 = function ( Writer ) { Writer . WriteLong ( AscDFH . historyitem _type _Drawing ) ; Writer . WriteString2 ( this . Id ) ; AscFormat . writeDouble ( Writer ,
this . Extent . W ) ; AscFormat . writeDouble ( Writer , this . Extent . H ) ; AscFormat . writeObject ( Writer , this . GraphicObj ) ; AscFormat . writeObject ( Writer , this . DocumentContent ) ; AscFormat . writeObject ( Writer , this . Parent ) ; AscFormat . writeObject ( Writer , this . wrappingPolygon ) ; AscFormat . writeLong ( Writer , this . RelativeHeight ) ; AscFormat . writeObject ( Writer , this . docPr ) } ; ParaDrawing . prototype . Read _FromBinary2 = function ( Reader ) { this . Id = Reader . GetString2 ( ) ; this . DrawingDocument = editor . WordControl . m _oLogicDocument . DrawingDocument ; this . LogicDocument =
this . DrawingDocument ? this . DrawingDocument . m _oLogicDocument : null ; this . Extent . W = AscFormat . readDouble ( Reader ) ; this . Extent . H = AscFormat . readDouble ( Reader ) ; this . GraphicObj = AscFormat . readObject ( Reader ) ; this . DocumentContent = AscFormat . readObject ( Reader ) ; this . Parent = AscFormat . readObject ( Reader ) ; this . wrappingPolygon = AscFormat . readObject ( Reader ) ; this . RelativeHeight = AscFormat . readLong ( Reader ) ; this . docPr = AscFormat . readObject ( Reader ) ; if ( this . wrappingPolygon ) this . wrappingPolygon . wordGraphicObject = this ; this . drawingDocument =
editor . WordControl . m _oLogicDocument . DrawingDocument ; this . document = editor . WordControl . m _oLogicDocument ; this . graphicObjects = editor . WordControl . m _oLogicDocument . DrawingObjects ; this . graphicObjects . addGraphicObject ( this ) ; g _oTableId . Add ( this , this . Id ) } ; ParaDrawing . prototype . Load _LinkData = function ( ) { } ; ParaDrawing . prototype . draw = function ( graphics , PDSE ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . draw === "function" ) { graphics . SaveGrState ( ) ; var bInline = this . Is _Inline ( ) ; if ( bInline && AscCommon . isRealObject ( PDSE ) &&
AscFormat . isRealNumber ( this . LineTop ) && AscFormat . isRealNumber ( this . LineBottom ) && AscCommon . isRealObject ( this . GraphicObj . bounds ) ) { var x , y , w , h ; var oEffectExtent = this . EffectExtent ; x = PDSE . X ; y = this . LineTop ; w = this . GraphicObj . bounds . r - this . GraphicObj . bounds . l + AscFormat . getValOrDefault ( oEffectExtent . R , 0 ) + AscFormat . getValOrDefault ( oEffectExtent . L , 0 ) ; h = this . LineBottom - this . LineTop ; graphics . AddClipRect ( x , y , w , h ) } this . GraphicObj . draw ( graphics ) ; graphics . RestoreGrState ( ) } } ; ParaDrawing . prototype . drawAdjustments = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) &&
typeof this . GraphicObj . drawAdjustments === "function" ) this . GraphicObj . drawAdjustments ( ) } ; ParaDrawing . prototype . getTransformMatrix = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getTransformMatrix === "function" ) return this . GraphicObj . getTransformMatrix ( ) ; return null } ; ParaDrawing . prototype . getExtensions = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getExtensions === "function" ) return this . GraphicObj . getExtensions ( ) ; return null } ; ParaDrawing . prototype . isGroup =
function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . isGroup === "function" ) return this . GraphicObj . isGroup ( ) ; return false } ; ParaDrawing . prototype . isShapeChild = function ( bRetShape ) { if ( ! this . Is _Inline ( ) || ! this . DocumentContent ) return bRetShape ? null : false ; var cur _doc _content = this . DocumentContent ; var oCell ; while ( oCell = cur _doc _content . IsTableCellContent ( true ) ) cur _doc _content = oCell . Row . Table . Parent ; if ( AscCommon . isRealObject ( cur _doc _content . Parent ) && typeof cur _doc _content . Parent . getObjectType ===
"function" && cur _doc _content . Parent . getObjectType ( ) === AscDFH . historyitem _type _Shape ) return bRetShape ? cur _doc _content . Parent : true ; return bRetShape ? null : false } ; ParaDrawing . prototype . checkShapeChildAndGetTopParagraph = function ( paragraph ) { var parent _paragraph = ! paragraph ? this . Get _ParentParagraph ( ) : paragraph ; var parent _doc _content = parent _paragraph . Parent ; if ( parent _doc _content . Parent instanceof AscFormat . CShape ) if ( ! parent _doc _content . Parent . group ) return parent _doc _content . Parent . parent . Get _ParentParagraph ( ) ;
else { var top _group = parent _doc _content . Parent . group ; while ( top _group . group ) top _group = top _group . group ; return top _group . parent . Get _ParentParagraph ( ) } else if ( parent _doc _content . IsTableCellContent ( ) ) { var top _doc _content = parent _doc _content ; var oCell ; while ( oCell = top _doc _content . IsTableCellContent ( true ) ) top _doc _content = oCell . Row . Table . Parent ; if ( top _doc _content . Parent instanceof AscFormat . CShape ) if ( ! top _doc _content . Parent . group ) return top _doc _content . Parent . parent . Get _ParentParagraph ( ) ; else { var top _group = top _doc _content . Parent . group ;
while ( top _group . group ) top _group = top _group . group ; return top _group . parent . Get _ParentParagraph ( ) } else return parent _paragraph } return parent _paragraph } ; ParaDrawing . prototype . hit = function ( x , y ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hit === "function" ) return this . GraphicObj . hit ( x , y ) ; return false } ; ParaDrawing . prototype . hitToTextRect = function ( x , y ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . hitToTextRect === "function" ) return this . GraphicObj . hitToTextRect ( x ,
y ) ; return false } ; ParaDrawing . prototype . cursorGetPos = function ( ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . cursorGetPos === "function" ) return this . GraphicObj . cursorGetPos ( ) ; return { X : 0 , Y : 0 } } ; ParaDrawing . prototype . getResizeCoefficients = function ( handleNum , x , y ) { if ( AscCommon . isRealObject ( this . GraphicObj ) && typeof this . GraphicObj . getResizeCoefficients === "function" ) return this . GraphicObj . getResizeCoefficients ( handleNum , x , y ) ; return { kd1 : 1 , kd2 : 1 } } ; ParaDrawing . prototype . getParagraphParaPr =
@ -19395,59 +19396,59 @@ this.CheckFootnote(X,Y,CurPage);if(isInText&&null!=oHyperlink&&(Y<=this.Pages[Cu
Asc . c _oAscMouseMoveDataTypes . Common ; if ( isInText && ( null != oHyperlink || bPageRefLink ) && true === AscCommon . global _keyboardEvent . CtrlKey ) this . DrawingDocument . SetCursorType ( "pointer" , MMData ) ; else this . DrawingDocument . SetCursorType ( "text" , MMData ) ; var Bounds = this . Pages [ CurPage ] . Bounds ; if ( true === this . Lock . Is _Locked ( ) && X < Bounds . Right && X > Bounds . Left && Y > Bounds . Top && Y < Bounds . Bottom && this . LogicDocument && ! this . LogicDocument . IsViewModeInReview ( ) ) { var _X = this . Pages [ CurPage ] . X ; var _Y = this . Pages [ CurPage ] . Y ; var MMData =
new AscCommon . CMouseMoveData ; var Coords = this . DrawingDocument . ConvertCoordsToCursorWR ( _X , _Y , this . Get _AbsolutePage ( CurPage ) , text _transform ) ; MMData . X _abs = Coords . X - 5 ; MMData . Y _abs = Coords . Y ; MMData . Type = Asc . c _oAscMouseMoveDataTypes . LockedObject ; MMData . UserId = this . Lock . Get _UserId ( ) ; MMData . HaveChanges = this . Lock . Have _Changes ( ) ; MMData . LockedObjectType = c _oAscMouseMoveLockedObjectType . Common ; editor . sync _MouseMoveCallback ( MMData ) } } ; Paragraph . prototype . Document _CreateFontMap = function ( FontMap ) { if ( true === this . FontMap . NeedRecalc ) { this . FontMap . Map =
{ } ; this . private _CompileParaPr ( ) ; var FontScheme = this . Get _Theme ( ) . themeElements . fontScheme ; var CurTextPr = this . CompiledPr . Pr . TextPr . Copy ( ) ; CurTextPr . Document _CreateFontMap ( this . FontMap . Map , FontScheme ) ; CurTextPr . Merge ( this . TextPr . Value ) ; CurTextPr . Document _CreateFontMap ( this . FontMap . Map , FontScheme ) ; var Count = this . Content . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) this . Content [ Index ] . Create _FontMap ( this . FontMap . Map ) ; this . FontMap . NeedRecalc = false } for ( var Key in this . FontMap . Map ) FontMap [ Key ] = this . FontMap . Map [ Key ] } ;
Paragraph . prototype . Document _CreateFontCharMap = function ( FontCharMap ) { } ; Paragraph . prototype . Document _Get _AllFontNames = function ( AllFonts ) { this . TextPr . Value . Document _Get _AllFontNames ( AllFonts ) ; if ( this . Pr . Bullet ) this . Pr . Bullet . Get _AllFontNames ( AllFonts ) ; if ( this . Pr . DefaultRunPr ) this . Pr . DefaultRunPr . Document _Get _AllFontNames ( AllFonts ) ; var Count = this . Content . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) this. Content [ Index ] . Get _AllFontNames ( AllFonts ) } ; Paragraph . prototype . Document _UpdateRulersState = function ( ) { if ( this . CalculatedFrame ) { var oFrame =
this . CalculatedFrame ; this . Parent . DrawingDocument . Set _RulerState _Paragraph ( { L : oFrame . L2 , T : oFrame . T2 , R : oFrame . L2 + oFrame . W2 , B : oFrame . T2 + oFrame . H2 , PageIndex : this . GetStartPageAbsolute ( ) , Frame : this } , false ) } else if ( this . Parent instanceof CDocument ) if ( this . LogicDocument ) this . LogicDocument . Document _UpdateRulersStateBySection ( ) } ; Paragraph . prototype . Document _UpdateInterfaceState = function ( ) { var StartPos , EndPos ; if ( true === this . Selection . Use ) { StartPos = this . Get _ParaContentPos ( true , true ) ; EndPos = this . Get _ParaContentPos ( true ,
false ) } else { var CurPos = this . Get _ParaContentPos ( false , false ) ; StartPos = CurPos ; EndPos = CurPos } if ( this . LogicDocument && true === this . LogicDocument . Spelling . Use && ( selectionflag _Numbering !== this . Selection . Flag && selectionflag _NumberingCur !== this . Selection . Flag ) ) this . SpellChecker . Document _UpdateInterfaceState ( StartPos , EndPos ) ; if ( true === this . Selection . Use ) { var StartPos = this . Selection . StartPos ; var EndPos = this . Selection . EndPos ; if ( StartPos > EndPos ) { StartPos = this . Selection . EndPos ; EndPos = this . Selection . StartPos } for ( var CurPos =
StartPos ; CurPos <= EndPos ; CurPos ++ ) { var Element = this . Content [ CurPos ] ; if ( true !== Element . IsSelectionEmpty ( ) && Element . Document _UpdateInterfaceState ) Element . Document _UpdateInterfaceState ( ) } } else { var CurType = this . Content [ this . CurPos . ContentPos ] . Type ; if ( this . Content [ this . CurPos . ContentPos ] . Document _UpdateInterfaceState ) this . Content [ this . CurPos . ContentPos ] . Document _UpdateInterfaceState ( ) } var arrComplexFields = this . GetCurrentComplexFields ( ) ; for ( var nIndex = 0 , nCount = arrComplexFields . length ; nIndex < nCount ; ++ nIndex ) { var oInstruction =
arrComplexFields [ nIndex ] . GetInstruction ( ) ; if ( oInstruction && fieldtype _HYPERLINK === oInstruction . GetType ( ) ) { var oHyperProps = new Asc . CHyperlinkProperty ; oHyperProps . put _ToolTip ( oInstruction . GetToolTip ( ) ) ; oHyperProps . put _Value ( oInstruction . GetValue ( ) ) ; oHyperProps . put _Text ( this . LogicDocument ? this . LogicDocument . GetComplexFieldTextValue ( arrComplexFields [ nIndex ] ) : null ) ; oHyperProps . put _InternalHyperlink ( oInstruction ) ; editor . sync _HyperlinkPropCallback ( oHyperProps ) } } if ( editor && this . bFromDocument ) { if ( ! this . LogicDocument ) return ;
var TrackManager = this . LogicDocument . GetTrackRevisionsManager ( ) ; if ( this . Pages . length <= 0 && this . Lines . length <= 0 ) return ; var ContentPos = this . Get _ParaContentPos ( this . Selection . Use , true ) ; var ParaPos = this . Get _ParaPosByContentPos ( ContentPos ) ; if ( this . Pages . length <= ParaPos . Page || this . Lines . length <= ParaPos . Line ) return ; var Page _abs = this . Get _AbsolutePage ( ParaPos . Page ) ; var _Y = this . Pages [ ParaPos . Page ] . Y + this . Lines [ ParaPos . Line ] . Top ; var TextTransform = this . Get _ParentTextTransform ( ) ; var _X = this . LogicDocument ? this . LogicDocument . Get _PageLimits ( Page _abs ) . XLimit :
0 ; var Coords = this . DrawingDocument . ConvertCoordsToCursorWR ( _X , _Y , Page _abs , TextTransform ) ; if ( false === this . Selection . Use ) { var Changes = TrackManager . GetElementChanges ( this . GetId ( ) ) ; if ( Changes . length > 0 ) for ( var ChangeIndex = 0 , ChangesCount = Changes . length ; ChangeIndex < ChangesCount ; ChangeIndex ++ ) { var Change = Changes [ ChangeIndex ] ; var Type = Change . get _Type ( ) ; if ( c _oAscRevisionsChangeType . TextAdd !== Type && c _oAscRevisionsChangeType . TextRem !== Type && c _oAscRevisionsChangeType . TextPr !== Type || StartPos . Compare ( Change . get _StartPos ( ) ) >=
0 && StartPos . Compare ( Change . get _EndPos ( ) ) <= 0 ) { Change . put _InternalPos ( _X , _Y , Page _abs ) ; TrackManager . AddVisibleChange ( Change ) } } } } } ; Paragraph . prototype . PreDelete = function ( ) { for ( var Index = 0 ; Index < this . Content . length ; Index ++ ) { var Item = this . Content [ Index ] ; if ( Item . PreDelete ) Item . PreDelete ( ) ; if ( this . LogicDocument ) if ( para _Comment === Item . Type && true === this . LogicDocument . RemoveCommentsOnPreDelete ) this . LogicDocument . RemoveComment ( Item . CommentId , true , false ) ; else if ( para _Bookmark === Item . Type ) this . LogicDocument . GetBookmarksManager ( ) . SetNeedUpdate ( true ) } this . RemoveSelection ( ) ;
this . UpdateDocumentOutline ( ) ; if ( undefined !== this . Get _SectionPr ( ) && this . LogicDocument ) this . Set _SectionPr ( undefined ) } ; Paragraph . prototype . Document _SetThisElementCurrent = function ( bUpdateStates ) { this . Parent . Update _ContentIndexing ( ) ; this . Parent . Set _CurrentElement ( this . Index , bUpdateStates ) } ; Paragraph . prototype . Is _ThisElementCurrent = function ( ) { var Parent = this . Parent ; Parent . Update _ContentIndexing ( ) ; if ( docpostype _Content === Parent . GetDocPosType ( ) && false === Parent . Selection . Use && this . Index === Parent . CurPos . ContentPos &&
Parent . Content [ this . Index ] === this ) return this . Parent . Is _ThisElementCurrent ( ) ; return false } ; Paragraph . prototype . Is _Inline = function ( ) { if ( this . bFromDocument === false ) return true ; var PrevElement = this . Get _DocumentPrev ( ) ; if ( true === this . Is _Empty ( ) && undefined !== this . Get _SectionPr ( ) && null !== PrevElement && ( type _Paragraph !== PrevElement . Get _Type ( ) || undefined === PrevElement . Get _SectionPr ( ) ) ) return true ; if ( undefined === this . Parent || ! ( this . Parent instanceof CDocument ) && ( undefined === this . Parent . Parent || ! ( this . Parent . Parent instanceof
CHeaderFooter ) ) ) return true ; if ( undefined != this . Pr . FramePr && Asc . c _oAscYAlign . Inline !== this . Pr . FramePr . YAlign ) return false ; return true } ; Paragraph . prototype . IsInline = function ( ) { return this . Is _Inline ( ) } ; Paragraph . prototype . GetFramePr = function ( ) { return this . Get _CompiledPr2 ( false ) . ParaPr . FramePr } ; Paragraph . prototype . Get _FramePr = function ( ) { return this . GetFramePr ( ) } ; Paragraph . prototype . Set _FramePr = function ( FramePr , bDelete ) { var FramePr _old = this . Pr . FramePr ; if ( undefined === bDelete ) bDelete = false ; if ( true === bDelete ) { this . Pr . FramePr =
undefined ; this . private _AddPrChange ( ) ; History . Add ( new CChangesParagraphFramePr ( this , FramePr _old , undefined ) ) ; this . CompiledPr . NeedRecalc = true ; this . private _UpdateTrackRevisionOnChangeParaPr ( true ) ; return } var FrameParas = this . Internal _Get _FrameParagraphs ( ) ; if ( true === FramePr . FromDropCapMenu && 1 === FrameParas . length ) { var NewFramePr = FramePr _old ? FramePr _old . Copy ( ) : new CFramePr ; if ( undefined != FramePr . DropCap ) { var OldLines = NewFramePr . Lines ; NewFramePr . Init _Default _DropCap ( FramePr . DropCap === Asc . c _oAscDropCap . Drop ?
true : false ) ; NewFramePr . Lines = OldLines } if ( undefined != FramePr . Lines ) { var AnchorPara = this . Get _FrameAnchorPara ( ) ; if ( null === AnchorPara || AnchorPara . Lines . length <= 0 ) return ; var Before = AnchorPara . Get _CompiledPr ( ) . ParaPr . Spacing . Before ; var LineH = AnchorPara . Lines [ 0 ] . Bottom - AnchorPara . Lines [ 0 ] . Top - Before ; var LineTA = AnchorPara . Lines [ 0 ] . Metrics . TextAscent2 ; var LineTD = AnchorPara . Lines [ 0 ] . Metrics . TextDescent + AnchorPara . Lines [ 0 ] . Metrics . LineGap ; this . Set _Spacing ( { LineRule : linerule _Exact , Line : FramePr . Lines * LineH } , false ) ;
this . Update _DropCapByLines ( this . Internal _CalculateTextPr ( this . Internal _GetStartPos ( ) ) , FramePr . Lines , LineH , LineTA , LineTD , Before ) ; NewFramePr . Lines = FramePr . Lines } if ( undefined != FramePr . FontFamily ) { var FF = new ParaTextPr ( { RFonts : { Ascii : { Name : FramePr . FontFamily . Name , Index : - 1 } } } ) ; this . SelectAll ( ) ; this . Add ( FF ) ; this . RemoveSelection ( ) } if ( undefined != FramePr . HSpace ) NewFramePr . HSpace = FramePr . HSpace ; this . Pr . FramePr = NewFramePr } else { var NewFramePr = FramePr _old ? FramePr _old . Copy ( ) : new CFramePr ; if ( undefined != FramePr . H ) NewFramePr . H =
FramePr . H ; if ( undefined != FramePr . HAnchor ) NewFramePr . HAnchor = FramePr . HAnchor ; if ( undefined != FramePr . HRule ) NewFramePr . HRule = FramePr . HRule ; if ( undefined != FramePr . HSpace ) NewFramePr . HSpace = FramePr . HSpace ; if ( undefined != FramePr . Lines ) NewFramePr . Lines = FramePr . Lines ; if ( undefined != FramePr . VAnchor ) NewFramePr . VAnchor = FramePr . VAnchor ; if ( undefined != FramePr . VSpace ) NewFramePr . VSpace = FramePr . VSpace ; NewFramePr . W = FramePr . W ; if ( undefined != FramePr . X ) { NewFramePr . X = FramePr . X ; NewFramePr . XAlign = undefined } if ( undefined != FramePr . XAlign ) { NewFramePr . XAlign =
FramePr . XAlign ; NewFramePr . X = undefined } if ( undefined != FramePr . Y ) { NewFramePr . Y = FramePr . Y ; NewFramePr . YAlign = undefined } if ( undefined != FramePr . YAlign ) { NewFramePr . YAlign = FramePr . YAlign ; NewFramePr . Y = undefined } if ( undefined !== FramePr . Wrap ) if ( false === FramePr . Wrap ) NewFramePr . Wrap = wrap _NotBeside ; else if ( true === FramePr . Wrap ) NewFramePr . Wrap = wrap _Around ; else NewFramePr . Wrap = FramePr . Wrap ; this . Pr . FramePr = NewFramePr } if ( undefined != FramePr . Brd ) { var Count = FrameParas . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) FrameParas [ Index ] . Set _Borders ( FramePr . Brd ) } if ( undefined !=
FramePr . Shd ) { var Count = FrameParas . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) FrameParas [ Index ] . Set _Shd ( FramePr . Shd ) } this . private _AddPrChange ( ) ; History . Add ( new CChangesParagraphFramePr ( this , FramePr _old , this . Pr . FramePr ) ) ; this . CompiledPr . NeedRecalc = true ; this . private _UpdateTrackRevisionOnChangeParaPr ( true ) } ; Paragraph . prototype . Set _FramePr2 = function ( FramePr ) { this . private _AddPrChange ( ) ; History . Add ( new CChangesParagraphFramePr ( this , this . Pr . FramePr , FramePr ) ) ; this . Pr . FramePr = FramePr ; this . CompiledPr . NeedRecalc =
true ; this . private _UpdateTrackRevisionOnChangeParaPr ( true ) } ; Paragraph . prototype . Set _FrameParaPr = function ( Para ) { Para . CopyPr ( this ) ; Para . Set _Ind ( { FirstLine : 0 } , false ) ; this . Set _Spacing ( { After : 0 } , false ) ; this . Set _Ind ( { Right : 0 } , false ) ; this . RemoveNumPr ( ) } ; Paragraph . prototype . Get _FrameBounds = function ( FrameX , FrameY , FrameW , FrameH ) { var X0 = FrameX , Y0 = FrameY , X1 = FrameX + FrameW , Y1 = FrameY + FrameH ; var Paras = this . Internal _Get _FrameParagraphs ( ) ; var Count = Paras . length ; var FramePr = this . Get _FramePr ( ) ; if ( 0 >= Count ) return { X : X0 ,
Y : Y0 , W : X1 - X0 , H : Y1 - Y0 } ; for ( var Index = 0 ; Index < Count ; Index ++ ) { var Para = Paras [ Index ] ; var ParaPr = Para . Get _CompiledPr2 ( false ) . ParaPr ; var Brd = ParaPr . Brd ; var _X0 = FrameX ; if ( undefined !== Brd . Left && border _None !== Brd . Left . Value ) _X0 -= Brd . Left . Size + Brd . Left . Space + 1 ; if ( _X0 < X0 ) X0 = _X0 ; var _X1 = FrameX + FrameW ; if ( undefined !== Brd . Right && border _None !== Brd . Right . Value ) { _X1 = Math . max ( _X1 , _X1 - ParaPr . Ind . Right ) ; _X1 += Brd . Right . Size + Brd . Right . Space + 1 } if ( _X1 > X1 ) X1 = _X1 } var _Y1 = Y1 ; var BottomBorder = Paras [ Count - 1 ] . Get _CompiledPr2 ( false ) . ParaPr . Brd . Bottom ;
if ( undefined !== BottomBorder && border _None !== BottomBorder . Value ) _Y1 += BottomBorder . Size + BottomBorder . Space ; if ( _Y1 > Y1 && ( Asc . linerule _Auto === FramePr . HRule || Asc . linerule _AtLeast === FramePr . HRule && FrameH >= FramePr . H ) ) Y1 = _Y1 ; return { X : X0 , Y : Y0 , W : X1 - X0 , H : Y1 - Y0 } } ; Paragraph . prototype . SetCalculatedFrame = function ( oFrame ) { this . CalculatedFrame = oFrame ; oFrame . AddParagraph ( this ) } ; Paragraph . prototype . GetCalculatedFrame = function ( ) { return this . CalculatedFrame } ; Paragraph . prototype . Internal _Get _FrameParagraphs = function ( ) { if ( this . CalculatedFrame &&
this . CalculatedFrame . GetParagraphs ( ) . length > 0 ) return this . CalculatedFrame . GetParagraphs ( ) ; var FrameParas = [ ] ; var FramePr = this . Get _FramePr ( ) ; if ( undefined === FramePr ) return FrameParas ; FrameParas . push ( this ) ; var Prev = this . Get _DocumentPrev ( ) ; while ( null != Prev ) if ( type _Paragraph === Prev . GetType ( ) ) { var PrevFramePr = Prev . Get _FramePr ( ) ; if ( undefined != PrevFramePr && true === FramePr . Compare ( PrevFramePr ) ) { FrameParas . push ( Prev ) ; Prev = Prev . Get _DocumentPrev ( ) } else break } else break ; var Next = this . Get _DocumentNext ( ) ; while ( null !=
Next ) if ( type _Paragraph === Next . GetType ( ) ) { var NextFramePr = Next . Get _FramePr ( ) ; if ( undefined != NextFramePr && true === FramePr . Compare ( NextFramePr ) ) { FrameParas . push ( Next ) ; Next = Next . Get _DocumentNext ( ) } else break } else break ; return FrameParas } ; Paragraph . prototype . Is _LineDropCap = function ( ) { var FrameParas = this . Internal _Get _FrameParagraphs ( ) ; if ( 1 !== FrameParas . length || 1 !== this . Lines . length ) return false ; return true } ; Paragraph . prototype . Get _LineDropCapWidth = function ( ) { var W = this . Lines [ 0 ] . Ranges [ 0 ] . W ; var ParaPr = this . Get _CompiledPr2 ( false ) . ParaPr ;
W += ParaPr . Ind . Left + ParaPr . Ind . FirstLine ; return W } ; Paragraph . prototype . Change _Frame = function ( X , Y , W , H , PageIndex ) { if ( ! this . LogicDocument || ! this . CalculatedFrame || ! this . CalculatedFrame . GetFramePr ( ) ) return ; var FramePr = this . CalculatedFrame . GetFramePr ( ) ; if ( Math . abs ( Y - this . CalculatedFrame . T2 ) < . 001 && Math . abs ( X - this . CalculatedFrame . L2 ) < . 001 && Math . abs ( W - this . CalculatedFrame . W2 ) < . 001 && Math . abs ( H - this . CalculatedFrame . H2 ) < . 001 && PageIndex === this . CalculatedFrame . PageIndex ) return ; var FrameParas = this . Internal _Get _FrameParagraphs ( ) ;
if ( false === this . LogicDocument . Document _Is _SelectionLocked ( AscCommon . changestype _None , { Type : AscCommon . changestype _2 _ElementsArray _and _Type , Elements : FrameParas , CheckType : AscCommon . changestype _Paragraph _Content } ) ) { this . LogicDocument . StartAction ( AscDFH . historydescription _Document _ParagraphChangeFrame ) ; var NewFramePr = FramePr . Copy ( ) ; if ( Math . abs ( X - this . CalculatedFrame . L2 ) > . 001 ) { NewFramePr . X = X + ( this . CalculatedFrame . L - this . CalculatedFrame . L2 ) ; NewFramePr . XAlign = undefined ; NewFramePr . HAnchor = Asc . c _oAscHAnchor . Page } if ( Math . abs ( Y -
this . CalculatedFrame . T2 ) > . 001 ) { NewFramePr . Y = Y + ( this . CalculatedFrame . T - this . CalculatedFrame . T2 ) ; NewFramePr . YAlign = undefined ; NewFramePr . VAnchor = Asc . c _oAscVAnchor . Page } if ( Math . abs ( W - this . CalculatedFrame . W2 ) > . 001 ) NewFramePr . W = W - Math . abs ( this . CalculatedFrame . W2 - this . CalculatedFrame . W ) ; if ( Math . abs ( H - this . CalculatedFrame . H2 ) > . 001 ) if ( undefined != FramePr . DropCap && Asc . c _oAscDropCap . None != FramePr . DropCap && 1 === FrameParas . length ) { var PageH = this . LogicDocument . Get _PageLimits ( PageIndex ) . YLimit ; var _H = Math . min ( H , PageH ) ;
NewFramePr . Lines = this . Update _DropCapByHeight ( _H ) ; NewFramePr . HRule = linerule _Exact ; NewFramePr . H = H - Math . abs ( this . CalculatedFrame . H2 - this . CalculatedFrame . H ) } else { if ( H <= this . CalculatedFrame . H2 ) NewFramePr . HRule = linerule _Exact ; else NewFramePr . HRule = Asc . linerule _AtLeast ; NewFramePr . H = H } var Count = FrameParas . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) { var Para = FrameParas [ Index ] ; Para . Set _FramePr ( NewFramePr , false ) } this . LogicDocument . Recalculate ( ) ; this . LogicDocument . UpdateInterface ( ) ; this . LogicDocument . UpdateRulers ( ) ;
this . LogicDocument . UpdateTracks ( ) ; this . LogicDocument . FinalizeAction ( ) } } ; Paragraph . prototype . Supplement _FramePr = function ( FramePr ) { if ( undefined != FramePr . DropCap && Asc . c _oAscDropCap . None != FramePr . DropCap ) { var _FramePr = this . Get _FramePr ( ) ; var FirstFramePara = this ; var Prev = FirstFramePara . Get _DocumentPrev ( ) ; while ( null != Prev ) if ( type _Paragraph === Prev . GetType ( ) ) { var PrevFramePr = Prev . Get _FramePr ( ) ; if ( undefined != PrevFramePr && true === _FramePr . Compare ( PrevFramePr ) ) { FirstFramePara = Prev ; Prev = Prev . Get _DocumentPrev ( ) } else break } else break ;
var TextPr = FirstFramePara . GetFirstRunPr ( ) ; if ( undefined === TextPr . RFonts || undefined === TextPr . RFonts . Ascii ) TextPr = this . Get _CompiledPr2 ( false ) . TextPr ; FramePr . FontFamily = { Name : TextPr . RFonts . Ascii . Name , Index : TextPr . RFonts . Ascii . Index } } var FrameParas = this . Internal _Get _FrameParagraphs ( ) ; var Count = FrameParas . length ; var ParaPr = FrameParas [ 0 ] . Get _CompiledPr2 ( false ) . ParaPr . Copy ( ) ; for ( var Index = 1 ; Index < Count ; Index ++ ) { var TempPr = FrameParas [ Index ] . Get _CompiledPr2 ( false ) . ParaPr ; ParaPr = ParaPr . Compare ( TempPr ) } FramePr . Brd =
ParaPr . Brd ; FramePr . Shd = ParaPr . Shd } ; Paragraph . prototype . CanAddDropCap = function ( ) { for ( var nPos = 0 , nCount = this . Content . length ; nPos < nCount ; ++ nPos ) { var bResult = this . Content [ nPos ] . CanAddDropCap ( ) ; if ( null !== bResult ) return bResult } return false } ; Paragraph . prototype . Get _TextForDropCap = function ( DropCapText , UseContentPos , ContentPos , Depth ) { var EndPos = true === UseContentPos ? ContentPos . Get ( Depth ) : this . Content . length - 1 ; for ( var Pos = 0 ; Pos <= EndPos ; Pos ++ ) { this . Content [ Pos ] . Get _TextForDropCap ( DropCapText , true === UseContentPos &&
Pos === EndPos ? true : false , ContentPos , Depth + 1 ) ; if ( true === DropCapText . Mixed && ( true === DropCapText . Check || DropCapText . Runs . length > 0 ) ) return } } ; Paragraph . prototype . Split _DropCap = function ( NewParagraph ) { var DropCapText = new CParagraphGetDropCapText ; if ( true == this . Selection . Use && this . Parent . IsSelectedSingleElement ( ) ) { var SelSP = this . Get _ParaContentPos ( true , true ) ; var SelEP = this . Get _ParaContentPos ( true , false ) ; if ( 0 <= SelSP . Compare ( SelEP ) ) SelEP = SelSP ; DropCapText . Check = true ; this . Get _TextForDropCap ( DropCapText , true , SelEP ,
0 ) ; DropCapText . Check = false ; this . Get _TextForDropCap ( DropCapText , true , SelEP , 0 ) } else { DropCapText . Mixed = true ; DropCapText . Check = false ; this . Get _TextForDropCap ( DropCapText , false ) } var Count = DropCapText . Text . length ; var PrevRun = null ; var CurrRun = null ; for ( var Pos = 0 , ParaPos = 0 , RunPos = 0 ; Pos < Count ; Pos ++ ) { if ( PrevRun !== DropCapText . Runs [ Pos ] ) { PrevRun = DropCapText . Runs [ Pos ] ; CurrRun = new ParaRun ( NewParagraph ) ; CurrRun . Set _Pr ( DropCapText . Runs [ Pos ] . Pr . Copy ( ) ) ; NewParagraph . Internal _Content _Add ( ParaPos ++ , CurrRun , false ) ; RunPos =
0 } CurrRun . Add _ToContent ( RunPos ++ , DropCapText . Text [ Pos ] , false ) } if ( Count > 0 ) return DropCapText . Runs [ Count - 1 ] . Get _CompiledPr ( true ) ; return null } ; Paragraph . prototype . SelectFirstLetter = function ( ) { var oStartPos = new CParagraphContentPos ; var oEndPos = new CParagraphContentPos ; for ( var nPos = 0 , nCount = this . Content . length ; nPos < nCount ; ++ nPos ) { oStartPos . Update ( nPos , 0 ) ; oEndPos . Update ( nPos , 0 ) ; if ( this . Content [ nPos ] . GetFirstRunElementPos ( para _Text , oStartPos , oEndPos , 1 ) ) { this . StartSelectionFromCurPos ( ) ; this . SetSelectionContentPos ( oStartPos ,
oEndPos , false ) ; this . Document _SetThisElementCurrent ( ) ; return true } } return false } ; Paragraph . prototype . CheckSelectionForDropCap = function ( ) { var oSelectionStart = this . Get _ParaContentPos ( true , true ) ; var oSelectionEnd = this . Get _ParaContentPos ( true , false ) ; if ( 0 <= oSelectionStart . Compare ( oSelectionEnd ) ) oSelectionEnd = oSelectionStart ; var nEndPos = oSelectionEnd . Get ( 0 ) ; for ( var nPos = 0 ; nPos <= nEndPos ; ++ nPos ) if ( ! this . Content [ nPos ] . CheckSelectionForDropCap ( nPos === nEndPos , oSelectionEnd , 1 ) ) return false ; return true } ; Paragraph . prototype . Update _DropCapByLines =
function ( TextPr , Count , LineH , LineTA , LineTD , Before ) { if ( null === TextPr ) return ; this . Set _Spacing ( { Before : Before , After : 0 , LineRule : linerule _Exact , Line : Count * LineH - . 001 } , false ) ; var FontSize = 72 ; TextPr . FontSize = FontSize ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII , 1 ) ; var TMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TMetrics ) ; var TDescent = TMetrics . Descent ; var TAscent = TMetrics . Ascent ; var THeight = 0 ; if ( null === TAscent || null === TDescent ) THeight =
g _oTextMeasurer . GetHeight ( ) ; else THeight = - TDescent + TAscent ; var EmHeight = THeight ; var NewEmHeight = ( Count - 1 ) * LineH + LineTA ; var Koef = NewEmHeight / EmHeight ; var NewFontSize = TextPr . FontSize * Koef ; TextPr . FontSize = parseInt ( NewFontSize * 2 ) / 2 ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII , 1 ) ; var TNewMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TNewMetrics ) ; var TNewDescent = TNewMetrics . Descent ; var TNewAscent = TNewMetrics . Ascent ; var TNewHeight =
0 ; if ( null === TNewAscent || null === TNewDescent ) TNewHeight = g _oTextMeasurer . GetHeight ( ) ; else TNewHeight = - TNewDescent + TNewAscent ; var Descent = g _oTextMeasurer . GetDescender ( ) ; var Ascent = g _oTextMeasurer . GetAscender ( ) ; var Dy = Descent * ( LineH * Count ) / ( Ascent - Descent ) + TNewHeight - TNewAscent + LineTD ; var PTextPr = new ParaTextPr ( { RFonts : { Ascii : { Name : TextPr . RFonts . Ascii . Name , Index : - 1 } } , FontSize : TextPr . FontSize , Position : Dy } ) ; this . SelectAll ( ) ; this . Add ( PTextPr ) ; this . RemoveSelection ( ) } ; Paragraph . prototype . Update _DropCapByHeight =
function ( _Height ) { var AnchorPara = this . Get _FrameAnchorPara ( ) ; if ( null === AnchorPara || AnchorPara . Lines . length <= 0 ) return 1 ; var Before = AnchorPara . Get _CompiledPr ( ) . ParaPr . Spacing . Before ; var LineH = AnchorPara . Lines [ 0 ] . Bottom - AnchorPara . Lines [ 0 ] . Top - Before ; var LineTA = AnchorPara . Lines [ 0 ] . Metrics . TextAscent2 ; var LineTD = AnchorPara . Lines [ 0 ] . Metrics . TextDescent + AnchorPara . Lines [ 0 ] . Metrics . LineGap ; var Height = _Height - Before ; this . Set _Spacing ( { LineRule : linerule _Exact , Line : Height } , false ) ; var LinesCount = Math . ceil ( Height /
LineH ) ; var TextPr = this . Internal _CalculateTextPr ( this . Internal _GetStartPos ( ) ) ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII , 1 ) ; var TMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TMetrics ) ; var TDescent = TMetrics . Descent ; var TAscent = TMetrics . Ascent ; var THeight = 0 ; if ( null === TAscent || null === TDescent ) THeight = g _oTextMeasurer . GetHeight ( ) ; else THeight = - TDescent + TAscent ; var Koef = ( Height - LineTD ) / THeight ; var NewFontSize = TextPr . FontSize * Koef ;
TextPr . FontSize = parseInt ( NewFontSize * 2 ) / 2 ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII , 1 ) ; var TNewMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TNewMetrics ) ; var TNewDescent = TNewMetrics . Descent ; var TNewAscent = TNewMetrics . Ascent ; var TNewHeight = 0 ; if ( null === TNewAscent || null === TNewDescent ) TNewHeight = g _oTextMeasurer . GetHeight ( ) ; else TNewHeight = - TNewDescent + TNewAscent ; var Descent = g _oTextMeasurer . GetDescender ( ) ; var Ascent = g _oTextMeasurer . GetAscender ( ) ;
var Dy = Descent * Height / ( Ascent - Descent ) + TNewHeight - TNewAscent + LineTD ; var PTextPr = new ParaTextPr ( { RFonts : { Ascii : { Name : TextPr . RFonts . Ascii . Name , Index : - 1 } } , FontSize : TextPr . FontSize , Position : Dy } ) ; this . SelectAll ( ) ; this . Add ( PTextPr ) ; this . RemoveSelection ( ) ; return LinesCount } ; Paragraph . prototype . Get _FrameAnchorPara = function ( ) { var FramePr = this . Get _FramePr ( ) ; if ( undefined === FramePr ) return null ; var Next = this . Get _DocumentNext ( ) ; while ( null != Next ) { if ( type _Paragraph === Next . GetType ( ) ) { var NextFramePr = Next . Get _FramePr ( ) ;
if ( undefined === NextFramePr || false === FramePr . Compare ( NextFramePr ) ) return Next } Next = Next . Get _DocumentNext ( ) } return Next } ; Paragraph . prototype . Split = function ( NewParagraph ) { if ( ! NewParagraph ) NewParagraph = new Paragraph ( this . DrawingDocument , this . Parent ) ; NewParagraph . DeleteCommentOnRemove = false ; this . DeleteCommentOnRemove = false ; this . RemoveSelection ( ) ; NewParagraph . RemoveSelection ( ) ; var ContentPos = this . Get _ParaContentPos ( false , false ) ; var CurPos = ContentPos . Get ( 0 ) ; var TextPr = this . Get _TextPr ( ContentPos ) ; var oLogicDocument =
this . GetLogicDocument ( ) ; var oStyles = oLogicDocument && oLogicDocument . GetStyles ? oLogicDocument . GetStyles ( ) : null ; if ( oStyles && ( TextPr . RStyle === oStyles . GetDefaultEndnoteReference ( ) || TextPr . RStyle === oStyles . GetDefaultFootnoteReference ( ) ) ) { TextPr = TextPr . Copy ( ) ; TextPr . RStyle = undefined } var NewElement = this . Content [ CurPos ] . Split ( ContentPos , 1 ) ; if ( null === NewElement ) { NewElement = new ParaRun ( NewParagraph ) ; NewElement . Set _Pr ( TextPr . Copy ( ) ) } var NewContent = this . Content . slice ( CurPos + 1 ) ; this . Internal _Content _Remove2 ( CurPos +
1 , this . Content . length - CurPos - 1 ) ; var EndRun = new ParaRun ( this ) ; EndRun . Add _ToContent ( 0 , new ParaEnd ) ; this . Internal _Content _Add ( this . Content . length , EndRun ) ; NewParagraph . Internal _Content _Remove2 ( 0 , NewParagraph . Content . length ) ; NewParagraph . Internal _Content _Concat ( NewContent ) ; NewParagraph . Internal _Content _Add ( 0 , NewElement ) ; NewParagraph . Correct _Content ( ) ; this . CopyPr ( NewParagraph ) ; this . TextPr . Clear _Style ( ) ; this . TextPr . Apply _TextPr ( TextPr ) ; var SectPr = this . Get _SectionPr ( ) ; if ( undefined !== SectPr ) { this . Set _SectionPr ( undefined ) ;
NewParagraph . Set _SectionPr ( SectPr ) } this . MoveCursorToEndPos ( false , false ) ; NewParagraph . MoveCursorToStartPos ( false ) ; NewParagraph . DeleteCommentOnRemove = true ; this . DeleteCommentOnRemove = true ; return NewParagraph } ; Paragraph . prototype . Concat = function ( Para , isUseConcatedStyle ) { this . DeleteCommentOnRemove = false ; Para . DeleteCommentOnRemove = false ; this . Remove _ParaEnd ( ) ; var NearPosCount = Para . NearPosArray . length ; for ( var Pos = 0 ; Pos < NearPosCount ; Pos ++ ) { var ParaNearPos = Para . NearPosArray [ Pos ] ; ParaNearPos . Classes [ 0 ] = this ;
ParaNearPos . NearPos . Paragraph = this ; ParaNearPos . NearPos . ContentPos . Data [ 0 ] += this . Content . length ; this . NearPosArray . push ( ParaNearPos ) } this . Internal _Content _Concat ( Para . Content ) ; Para . ClearContent ( ) ; this . Set _SectionPr ( undefined ) ; var SectPr = Para . Get _SectionPr ( ) ; if ( undefined !== SectPr ) { Para . Set _SectionPr ( undefined ) ; this . Set _SectionPr ( SectPr ) } this . DeleteCommentOnRemove = true ; Para . DeleteCommentOnRemove = true ; if ( true === isUseConcatedStyle ) Para . CopyPr ( this ) } ; Paragraph . prototype . ConcatBefore = function ( oPara ) { this . DeleteCommentOnRemove =
false ; oPara . DeleteCommentOnRemove = false ; oPara . Remove _ParaEnd ( ) ; for ( var nPos = 0 , nCount = this . NearPosArray . length ; nPos < nCount ; ++ nPos ) { var oParaNearPos = this . NearPosArray [ nPos ] ; oParaNearPos . NearPos . ContentPos . Data [ 0 ] += oPara . Content . length } for ( var nPos = 0 , nCount = oPara . NearPosArray . length ; nPos < nCount ; ++ nPos ) { var oParaNearPos = oPara . NearPosArray [ nPos ] ; oParaNearPos . Classes [ 0 ] = this ; oParaNearPos . NearPos . Paragraph = this ; this . NearPosArray . push ( oParaNearPos ) } for ( var nPos = 0 , nCount = oPara . Content . length ; nPos < nCount ; ++ nPos ) this . AddToContent ( nPos ,
oPara . Content [ nPos ] ) ; oPara . ClearContent ( ) ; oPara . Set _SectionPr ( undefined ) ; this . DeleteCommentOnRemove = true ; oPara . DeleteCommentOnRemove = true ; oPara . CopyPr ( this ) } ; Paragraph . prototype . Continue = function ( NewParagraph ) { var TextPr ; if ( this . IsEmpty ( ) ) TextPr = this . TextPr . Value . Copy ( ) ; else { var EndPos = this . Get _EndPos2 ( false ) ; var CurPos = this . Get _ParaContentPos ( false , false ) ; this . Set _ParaContentPos ( EndPos , true , - 1 , - 1 ) ; TextPr = this . Get _TextPr ( this . Get _ParaContentPos ( false , false ) ) . Copy ( ) ; this . Set _ParaContentPos ( CurPos ,
false , - 1 , - 1 , false ) ; TextPr . HighLight = highlight _None ; var oStyles ; if ( this . bFromDocument && this . LogicDocument && ( oStyles = this . LogicDocument . GetStyles ( ) ) && ( TextPr . RStyle === oStyles . GetDefaultFootnoteReference ( ) || TextPr . RStyle === oStyles . GetDefaultEndnoteReference ( ) ) ) TextPr . RStyle = undefined } this . CopyPr ( NewParagraph ) ; if ( ! this . HaveNumbering ( ) && ! this . Lock . Is _Locked ( ) ) { this . TextPr . Clear _Style ( ) ; this . TextPr . Apply _TextPr ( TextPr ) } NewParagraph . Internal _Content _Add ( 0 , new ParaRun ( NewParagraph ) ) ; NewParagraph . Correct _Content ( ) ;
NewParagraph . MoveCursorToStartPos ( false ) ; for ( var Pos = 0 , Count = NewParagraph . Content . length ; Pos < Count ; Pos ++ ) if ( para _Run === NewParagraph . Content [ Pos ] . Type ) NewParagraph . Content [ Pos ] . Set _Pr ( TextPr . Copy ( ) ) } ; Paragraph . prototype . GetSelectionState = function ( ) { var ParaState = { } ; ParaState . CurPos = { X : this . CurPos . X , Y : this . CurPos . Y , Line : this . CurPos . Line , ContentPos : this . Get _ParaContentPos ( false , false ) , RealX : this . CurPos . RealX , RealY : this . CurPos . RealY , PagesPos : this . CurPos . PagesPos } ; ParaState . Selection = { Start : this . Selection . Start ,
Use : this . Selection . Use , StartPos : 0 , EndPos : 0 , Flag : this . Selection . Flag } ; if ( true === this . Selection . Use ) { ParaState . Selection . StartPos = this . Get _ParaContentPos ( true , true ) ; ParaState . Selection . EndPos = this . Get _ParaContentPos ( true , false ) } return [ ParaState ] } ; Paragraph . prototype . SetSelectionState = function ( State , StateIndex ) { if ( State . length <= 0 ) return ; var ParaState = State [ StateIndex ] ; this . CurPos . X = ParaState . CurPos . X ; this . CurPos . Y = ParaState . CurPos . Y ; this . CurPos . Line = ParaState . CurPos . Line ; this . CurPos . RealX = ParaState . CurPos . RealX ;
this . CurPos . RealY = ParaState . CurPos . RealY ; this . CurPos . PagesPos = ParaState . CurPos . PagesPos ; this . Set _ParaContentPos ( ParaState . CurPos . ContentPos , true , - 1 , - 1 ) ; this . RemoveSelection ( ) ; this . Selection . Start = ParaState . Selection . Start ; this . Selection . Use = ParaState . Selection . Use ; this . Selection . Flag = ParaState . Selection . Flag ; if ( true === this . Selection . Use ) this . Set _SelectionContentPos ( ParaState . Selection . StartPos , ParaState . Selection . EndPos ) } ; Paragraph . prototype . Get _ParentObject _or _DocumentPos = function ( ) { this . Parent . Update _ContentIndexing ( ) ;
return this . Parent . Get _ParentObject _or _DocumentPos ( this . Index ) } ; Paragraph . prototype . Refresh _RecalcData = function ( Data ) { var Type = Data . Type ; var bNeedRecalc = false ; var CurPage = 0 ; switch ( Type ) { case AscDFH . historyitem _Paragraph _AddItem : case AscDFH . historyitem _Paragraph _RemoveItem : { for ( CurPage = this . Pages . length - 1 ; CurPage > 0 ; CurPage -- ) if ( Data . Pos > this . Lines [ this . Pages [ CurPage ] . StartLine ] . Get _StartPos ( ) ) break ; this . RecalcInfo . Set _Type _0 ( pararecalc _0 _All ) ; bNeedRecalc = true ; break } case AscDFH . historyitem _Paragraph _Numbering : case AscDFH . historyitem _Paragraph _PStyle : case AscDFH . historyitem _Paragraph _Pr : case AscDFH . historyitem _Paragraph _PresentationPr _Bullet : case AscDFH . historyitem _Paragraph _PresentationPr _Level : { this . RecalcInfo . Set _Type _0 ( pararecalc _0 _All ) ;
bNeedRecalc = true ; this . CompiledPr . NeedRecalc = true ; this . Recalc _RunsCompiledPr ( ) ; break } case AscDFH . historyitem _Paragraph _Align : case AscDFH . historyitem _Paragraph _DefaultTabSize : case AscDFH . historyitem _Paragraph _Ind _First : case AscDFH . historyitem _Paragraph _Ind _Left : case AscDFH . historyitem _Paragraph _Ind _Right : case AscDFH . historyitem _Paragraph _ContextualSpacing : case AscDFH . historyitem _Paragraph _KeepLines : case AscDFH . historyitem _Paragraph _KeepNext : case AscDFH . historyitem _Paragraph _PageBreakBefore : case AscDFH . historyitem _Paragraph _Spacing _Line : case AscDFH . historyitem _Paragraph _Spacing _LineRule : case AscDFH . historyitem _Paragraph _Spacing _Before : case AscDFH . historyitem _Paragraph _Spacing _After : case AscDFH . historyitem _Paragraph _Spacing _AfterAutoSpacing : case AscDFH . historyitem _Paragraph _Spacing _BeforeAutoSpacing : case AscDFH . historyitem _Paragraph _WidowControl : case AscDFH . historyitem _Paragraph _Tabs : case AscDFH . historyitem _Paragraph _Borders _Between : case AscDFH . historyitem _Paragraph _Borders _Bottom : case AscDFH . historyitem _Paragraph _Borders _Left : case AscDFH . historyitem _Paragraph _Borders _Right : case AscDFH . historyitem _Paragraph _Borders _Top : case AscDFH . historyitem _Paragraph _FramePr : { bNeedRecalc =
Paragraph . prototype . Document _CreateFontCharMap = function ( FontCharMap ) { } ; Paragraph . prototype . Document _Get _AllFontNames = function ( AllFonts ) { this . TextPr . Value . Document _Get _AllFontNames ( AllFonts ) ; if ( this . Pr . Bullet ) this . Pr . Bullet . Get _AllFontNames ( AllFonts ) ; if ( this . Pr . DefaultRunPr ) this . Pr . DefaultRunPr . Document _Get _AllFontNames ( AllFonts ) ; var Count = this . Content . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) if( this . Content [ Index ] && typeof this . Content [ Index ] . Get _AllFontNames === "function" ) this. Content [ Index ] . Get _AllFontNames ( AllFonts ) } ;
Paragraph . prototype . Document _UpdateRulersState = function ( ) { if ( this . CalculatedFrame ) { var oFrame = this . CalculatedFrame ; this . Parent . DrawingDocument . Set _RulerState _Paragraph ( { L : oFrame . L2 , T : oFrame . T2 , R : oFrame . L2 + oFrame . W2 , B : oFrame . T2 + oFrame . H2 , PageIndex : this . GetStartPageAbsolute ( ) , Frame : this } , false ) } else if ( this . Parent instanceof CDocument ) if ( this . LogicDocument ) this . LogicDocument . Document _UpdateRulersStateBySection ( ) } ; Paragraph . prototype . Document _UpdateInterfaceState = function ( ) { var StartPos , EndPos ; if ( true ===
this . Selection . Use ) { StartPos = this . Get _ParaContentPos ( true , true ) ; EndPos = this . Get _ParaContentPos ( true , false ) } else { var CurPos = this . Get _ParaContentPos ( false , false ) ; StartPos = CurPos ; EndPos = CurPos } if ( this . LogicDocument && true === this . LogicDocument . Spelling . Use && ( selectionflag _Numbering !== this . Selection . Flag && selectionflag _NumberingCur !== this . Selection . Flag ) ) this . SpellChecker . Document _UpdateInterfaceState ( StartPos , EndPos ) ; if ( true === this . Selection . Use ) { var StartPos = this . Selection . StartPos ; var EndPos = this . Selection . EndPos ;
if ( StartPos > EndPos ) { StartPos = this . Selection . EndPos ; EndPos = this . Selection . StartPos } for ( var CurPos = StartPos ; CurPos <= EndPos ; CurPos ++ ) { var Element = this . Content [ CurPos ] ; if ( true !== Element . IsSelectionEmpty ( ) && Element . Document _UpdateInterfaceState ) Element . Document _UpdateInterfaceState ( ) } } else { var CurType = this . Content [ this . CurPos . ContentPos ] . Type ; if ( this . Content [ this . CurPos . ContentPos ] . Document _UpdateInterfaceState ) this . Content [ this . CurPos . ContentPos ] . Document _UpdateInterfaceState ( ) } var arrComplexFields = this . GetCurrentComplexFields ( ) ;
for ( var nIndex = 0 , nCount = arrComplexFields . length ; nIndex < nCount ; ++ nIndex ) { var oInstruction = arrComplexFields [ nIndex ] . GetInstruction ( ) ; if ( oInstruction && fieldtype _HYPERLINK === oInstruction . GetType ( ) ) { var oHyperProps = new Asc . CHyperlinkProperty ; oHyperProps . put _ToolTip ( oInstruction . GetToolTip ( ) ) ; oHyperProps . put _Value ( oInstruction . GetValue ( ) ) ; oHyperProps . put _Text ( this . LogicDocument ? this . LogicDocument . GetComplexFieldTextValue ( arrComplexFields [ nIndex ] ) : null ) ; oHyperProps . put _InternalHyperlink ( oInstruction ) ; editor . sync _HyperlinkPropCallback ( oHyperProps ) } } if ( editor &&
this . bFromDocument ) { if ( ! this . LogicDocument ) return ; var TrackManager = this . LogicDocument . GetTrackRevisionsManager ( ) ; if ( this . Pages . length <= 0 && this . Lines . length <= 0 ) return ; var ContentPos = this . Get _ParaContentPos ( this . Selection . Use , true ) ; var ParaPos = this . Get _ParaPosByContentPos ( ContentPos ) ; if ( this . Pages . length <= ParaPos . Page || this . Lines . length <= ParaPos . Line ) return ; var Page _abs = this . Get _AbsolutePage ( ParaPos . Page ) ; var _Y = this . Pages [ ParaPos . Page ] . Y + this . Lines [ ParaPos . Line ] . Top ; var TextTransform = this . Get _ParentTextTransform ( ) ;
var _X = this . LogicDocument ? this . LogicDocument . Get _PageLimits ( Page _abs ) . XLimit : 0 ; var Coords = this . DrawingDocument . ConvertCoordsToCursorWR ( _X , _Y , Page _abs , TextTransform ) ; if ( false === this . Selection . Use ) { var Changes = TrackManager . GetElementChanges ( this . GetId ( ) ) ; if ( Changes . length > 0 ) for ( var ChangeIndex = 0 , ChangesCount = Changes . length ; ChangeIndex < ChangesCount ; ChangeIndex ++ ) { var Change = Changes [ ChangeIndex ] ; var Type = Change . get _Type ( ) ; if ( c _oAscRevisionsChangeType . TextAdd !== Type && c _oAscRevisionsChangeType . TextRem !==
Type && c _oAscRevisionsChangeType . TextPr !== Type || StartPos . Compare ( Change . get _StartPos ( ) ) >= 0 && StartPos . Compare ( Change . get _EndPos ( ) ) <= 0 ) { Change . put _InternalPos ( _X , _Y , Page _abs ) ; TrackManager . AddVisibleChange ( Change ) } } } } } ; Paragraph . prototype . PreDelete = function ( ) { for ( var Index = 0 ; Index < this . Content . length ; Index ++ ) { var Item = this . Content [ Index ] ; if ( Item . PreDelete ) Item . PreDelete ( ) ; if ( this . LogicDocument ) if ( para _Comment === Item . Type && true === this . LogicDocument . RemoveCommentsOnPreDelete ) this . LogicDocument . RemoveComment ( Item . CommentId ,
true , false ) ; else if ( para _Bookmark === Item . Type ) this . LogicDocument . GetBookmarksManager ( ) . SetNeedUpdate ( true ) } this . RemoveSelection ( ) ; this . UpdateDocumentOutline ( ) ; if ( undefined !== this . Get _SectionPr ( ) && this . LogicDocument ) this . Set _SectionPr ( undefined ) } ; Paragraph . prototype . Document _SetThisElementCurrent = function ( bUpdateStates ) { this . Parent . Update _ContentIndexing ( ) ; this . Parent . Set _CurrentElement ( this . Index , bUpdateStates ) } ; Paragraph . prototype . Is _ThisElementCurrent = function ( ) { var Parent = this . Parent ; Parent . Update _ContentIndexing ( ) ;
if ( docpostype _Content === Parent . GetDocPosType ( ) && false === Parent . Selection . Use && this . Index === Parent . CurPos . ContentPos && Parent . Content [ this . Index ] === this ) return this . Parent . Is _ThisElementCurrent ( ) ; return false } ; Paragraph . prototype . Is _Inline = function ( ) { if ( this . bFromDocument === false ) return true ; var PrevElement = this . Get _DocumentPrev ( ) ; if ( true === this . Is _Empty ( ) && undefined !== this . Get _SectionPr ( ) && null !== PrevElement && ( type _Paragraph !== PrevElement . Get _Type ( ) || undefined === PrevElement . Get _SectionPr ( ) ) ) return true ;
if ( undefined === this . Parent || ! ( this . Parent instanceof CDocument ) && ( undefined === this . Parent . Parent || ! ( this . Parent . Parent instanceof CHeaderFooter ) ) ) return true ; if ( undefined != this . Pr . FramePr && Asc . c _oAscYAlign . Inline !== this . Pr . FramePr . YAlign ) return false ; return true } ; Paragraph . prototype . IsInline = function ( ) { return this . Is _Inline ( ) } ; Paragraph . prototype . GetFramePr = function ( ) { return this . Get _CompiledPr2 ( false ) . ParaPr . FramePr } ; Paragraph . prototype . Get _FramePr = function ( ) { return this . GetFramePr ( ) } ; Paragraph . prototype . Set _FramePr =
function ( FramePr , bDelete ) { var FramePr _old = this . Pr . FramePr ; if ( undefined === bDelete ) bDelete = false ; if ( true === bDelete ) { this . Pr . FramePr = undefined ; this . private _AddPrChange ( ) ; History . Add ( new CChangesParagraphFramePr ( this , FramePr _old , undefined ) ) ; this . CompiledPr . NeedRecalc = true ; this . private _UpdateTrackRevisionOnChangeParaPr ( true ) ; return } var FrameParas = this . Internal _Get _FrameParagraphs ( ) ; if ( true === FramePr . FromDropCapMenu && 1 === FrameParas . length ) { var NewFramePr = FramePr _old ? FramePr _old . Copy ( ) : new CFramePr ; if ( undefined !=
FramePr . DropCap ) { var OldLines = NewFramePr . Lines ; NewFramePr . Init _Default _DropCap ( FramePr . DropCap === Asc . c _oAscDropCap . Drop ? true : false ) ; NewFramePr . Lines = OldLines } if ( undefined != FramePr . Lines ) { var AnchorPara = this . Get _FrameAnchorPara ( ) ; if ( null === AnchorPara || AnchorPara . Lines . length <= 0 ) return ; var Before = AnchorPara . Get _CompiledPr ( ) . ParaPr . Spacing . Before ; var LineH = AnchorPara . Lines [ 0 ] . Bottom - AnchorPara . Lines [ 0 ] . Top - Before ; var LineTA = AnchorPara . Lines [ 0 ] . Metrics . TextAscent2 ; var LineTD = AnchorPara . Lines [ 0 ] . Metrics . TextDescent +
AnchorPara . Lines [ 0 ] . Metrics . LineGap ; this . Set _Spacing ( { LineRule : linerule _Exact , Line : FramePr . Lines * LineH } , false ) ; this . Update _DropCapByLines ( this . Internal _CalculateTextPr ( this . Internal _GetStartPos ( ) ) , FramePr . Lines , LineH , LineTA , LineTD , Before ) ; NewFramePr . Lines = FramePr . Lines } if ( undefined != FramePr . FontFamily ) { var FF = new ParaTextPr ( { RFonts : { Ascii : { Name : FramePr . FontFamily . Name , Index : - 1 } } } ) ; this . SelectAll ( ) ; this . Add ( FF ) ; this . RemoveSelection ( ) } if ( undefined != FramePr . HSpace ) NewFramePr . HSpace = FramePr . HSpace ; this . Pr . FramePr =
NewFramePr } else { var NewFramePr = FramePr _old ? FramePr _old . Copy ( ) : new CFramePr ; if ( undefined != FramePr . H ) NewFramePr . H = FramePr . H ; if ( undefined != FramePr . HAnchor ) NewFramePr . HAnchor = FramePr . HAnchor ; if ( undefined != FramePr . HRule ) NewFramePr . HRule = FramePr . HRule ; if ( undefined != FramePr . HSpace ) NewFramePr . HSpace = FramePr . HSpace ; if ( undefined != FramePr . Lines ) NewFramePr . Lines = FramePr . Lines ; if ( undefined != FramePr . VAnchor ) NewFramePr . VAnchor = FramePr . VAnchor ; if ( undefined != FramePr . VSpace ) NewFramePr . VSpace = FramePr . VSpace ; NewFramePr . W =
FramePr . W ; if ( undefined != FramePr . X ) { NewFramePr . X = FramePr . X ; NewFramePr . XAlign = undefined } if ( undefined != FramePr . XAlign ) { NewFramePr . XAlign = FramePr . XAlign ; NewFramePr . X = undefined } if ( undefined != FramePr . Y ) { NewFramePr . Y = FramePr . Y ; NewFramePr . YAlign = undefined } if ( undefined != FramePr . YAlign ) { NewFramePr . YAlign = FramePr . YAlign ; NewFramePr . Y = undefined } if ( undefined !== FramePr . Wrap ) if ( false === FramePr . Wrap ) NewFramePr . Wrap = wrap _NotBeside ; else if ( true === FramePr . Wrap ) NewFramePr . Wrap = wrap _Around ; else NewFramePr . Wrap = FramePr . Wrap ;
this . Pr . FramePr = NewFramePr } if ( undefined != FramePr . Brd ) { var Count = FrameParas . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) FrameParas [ Index ] . Set _Borders ( FramePr . Brd ) } if ( undefined != FramePr . Shd ) { var Count = FrameParas . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) FrameParas [ Index ] . Set _Shd ( FramePr . Shd ) } this . private _AddPrChange ( ) ; History . Add ( new CChangesParagraphFramePr ( this , FramePr _old , this . Pr . FramePr ) ) ; this . CompiledPr . NeedRecalc = true ; this . private _UpdateTrackRevisionOnChangeParaPr ( true ) } ; Paragraph . prototype . Set _FramePr2 =
function ( FramePr ) { this . private _AddPrChange ( ) ; History . Add ( new CChangesParagraphFramePr ( this , this . Pr . FramePr , FramePr ) ) ; this . Pr . FramePr = FramePr ; this . CompiledPr . NeedRecalc = true ; this . private _UpdateTrackRevisionOnChangeParaPr ( true ) } ; Paragraph . prototype . Set _FrameParaPr = function ( Para ) { Para . CopyPr ( this ) ; Para . Set _Ind ( { FirstLine : 0 } , false ) ; this . Set _Spacing ( { After : 0 } , false ) ; this . Set _Ind ( { Right : 0 } , false ) ; this . RemoveNumPr ( ) } ; Paragraph . prototype . Get _FrameBounds = function ( FrameX , FrameY , FrameW , FrameH ) { var X0 = FrameX ,
Y0 = FrameY , X1 = FrameX + FrameW , Y1 = FrameY + FrameH ; var Paras = this . Internal _Get _FrameParagraphs ( ) ; var Count = Paras . length ; var FramePr = this . Get _FramePr ( ) ; if ( 0 >= Count ) return { X : X0 , Y : Y0 , W : X1 - X0 , H : Y1 - Y0 } ; for ( var Index = 0 ; Index < Count ; Index ++ ) { var Para = Paras [ Index ] ; var ParaPr = Para . Get _CompiledPr2 ( false ) . ParaPr ; var Brd = ParaPr . Brd ; var _X0 = FrameX ; if ( undefined !== Brd . Left && border _None !== Brd . Left . Value ) _X0 -= Brd . Left . Size + Brd . Left . Space + 1 ; if ( _X0 < X0 ) X0 = _X0 ; var _X1 = FrameX + FrameW ; if ( undefined !== Brd . Right && border _None !== Brd . Right . Value ) { _X1 =
Math . max ( _X1 , _X1 - ParaPr . Ind . Right ) ; _X1 += Brd . Right . Size + Brd . Right . Space + 1 } if ( _X1 > X1 ) X1 = _X1 } var _Y1 = Y1 ; var BottomBorder = Paras [ Count - 1 ] . Get _CompiledPr2 ( false ) . ParaPr . Brd . Bottom ; if ( undefined !== BottomBorder && border _None !== BottomBorder . Value ) _Y1 += BottomBorder . Size + BottomBorder . Space ; if ( _Y1 > Y1 && ( Asc . linerule _Auto === FramePr . HRule || Asc . linerule _AtLeast === FramePr . HRule && FrameH >= FramePr . H ) ) Y1 = _Y1 ; return { X : X0 , Y : Y0 , W : X1 - X0 , H : Y1 - Y0 } } ; Paragraph . prototype . SetCalculatedFrame = function ( oFrame ) { this . CalculatedFrame =
oFrame ; oFrame . AddParagraph ( this ) } ; Paragraph . prototype . GetCalculatedFrame = function ( ) { return this . CalculatedFrame } ; Paragraph . prototype . Internal _Get _FrameParagraphs = function ( ) { if ( this . CalculatedFrame && this . CalculatedFrame . GetParagraphs ( ) . length > 0 ) return this . CalculatedFrame . GetParagraphs ( ) ; var FrameParas = [ ] ; var FramePr = this . Get _FramePr ( ) ; if ( undefined === FramePr ) return FrameParas ; FrameParas . push ( this ) ; var Prev = this . Get _DocumentPrev ( ) ; while ( null != Prev ) if ( type _Paragraph === Prev . GetType ( ) ) { var PrevFramePr =
Prev . Get _FramePr ( ) ; if ( undefined != PrevFramePr && true === FramePr . Compare ( PrevFramePr ) ) { FrameParas . push ( Prev ) ; Prev = Prev . Get _DocumentPrev ( ) } else break } else break ; var Next = this . Get _DocumentNext ( ) ; while ( null != Next ) if ( type _Paragraph === Next . GetType ( ) ) { var NextFramePr = Next . Get _FramePr ( ) ; if ( undefined != NextFramePr && true === FramePr . Compare ( NextFramePr ) ) { FrameParas . push ( Next ) ; Next = Next . Get _DocumentNext ( ) } else break } else break ; return FrameParas } ; Paragraph . prototype . Is _LineDropCap = function ( ) { var FrameParas = this . Internal _Get _FrameParagraphs ( ) ;
if ( 1 !== FrameParas . length || 1 !== this . Lines . length ) return false ; return true } ; Paragraph . prototype . Get _LineDropCapWidth = function ( ) { var W = this . Lines [ 0 ] . Ranges [ 0 ] . W ; var ParaPr = this . Get _CompiledPr2 ( false ) . ParaPr ; W += ParaPr . Ind . Left + ParaPr . Ind . FirstLine ; return W } ; Paragraph . prototype . Change _Frame = function ( X , Y , W , H , PageIndex ) { if ( ! this . LogicDocument || ! this . CalculatedFrame || ! this . CalculatedFrame . GetFramePr ( ) ) return ; var FramePr = this . CalculatedFrame . GetFramePr ( ) ; if ( Math . abs ( Y - this . CalculatedFrame . T2 ) < . 001 && Math . abs ( X -
this . CalculatedFrame . L2 ) < . 001 && Math . abs ( W - this . CalculatedFrame . W2 ) < . 001 && Math . abs ( H - this . CalculatedFrame . H2 ) < . 001 && PageIndex === this . CalculatedFrame . PageIndex ) return ; var FrameParas = this . Internal _Get _FrameParagraphs ( ) ; if ( false === this . LogicDocument . Document _Is _SelectionLocked ( AscCommon . changestype _None , { Type : AscCommon . changestype _2 _ElementsArray _and _Type , Elements : FrameParas , CheckType : AscCommon . changestype _Paragraph _Content } ) ) { this . LogicDocument . StartAction ( AscDFH . historydescription _Document _ParagraphChangeFrame ) ;
var NewFramePr = FramePr . Copy ( ) ; if ( Math . abs ( X - this . CalculatedFrame . L2 ) > . 001 ) { NewFramePr . X = X + ( this . CalculatedFrame . L - this . CalculatedFrame . L2 ) ; NewFramePr . XAlign = undefined ; NewFramePr . HAnchor = Asc . c _oAscHAnchor . Page } if ( Math . abs ( Y - this . CalculatedFrame . T2 ) > . 001 ) { NewFramePr . Y = Y + ( this . CalculatedFrame . T - this . CalculatedFrame . T2 ) ; NewFramePr . YAlign = undefined ; NewFramePr . VAnchor = Asc . c _oAscVAnchor . Page } if ( Math . abs ( W - this . CalculatedFrame . W2 ) > . 001 ) NewFramePr . W = W - Math . abs ( this . CalculatedFrame . W2 - this . CalculatedFrame . W ) ;
if ( Math . abs ( H - this . CalculatedFrame . H2 ) > . 001 ) if ( undefined != FramePr . DropCap && Asc . c _oAscDropCap . None != FramePr . DropCap && 1 === FrameParas . length ) { var PageH = this . LogicDocument . Get _PageLimits ( PageIndex ) . YLimit ; var _H = Math . min ( H , PageH ) ; NewFramePr . Lines = this . Update _DropCapByHeight ( _H ) ; NewFramePr . HRule = linerule _Exact ; NewFramePr . H = H - Math . abs ( this . CalculatedFrame . H2 - this . CalculatedFrame . H ) } else { if ( H <= this . CalculatedFrame . H2 ) NewFramePr . HRule = linerule _Exact ; else NewFramePr . HRule = Asc . linerule _AtLeast ; NewFramePr . H =
H } var Count = FrameParas . length ; for ( var Index = 0 ; Index < Count ; Index ++ ) { var Para = FrameParas [ Index ] ; Para . Set _FramePr ( NewFramePr , false ) } this . LogicDocument . Recalculate ( ) ; this . LogicDocument . UpdateInterface ( ) ; this . LogicDocument . UpdateRulers ( ) ; this . LogicDocument . UpdateTracks ( ) ; this . LogicDocument . FinalizeAction ( ) } } ; Paragraph . prototype . Supplement _FramePr = function ( FramePr ) { if ( undefined != FramePr . DropCap && Asc . c _oAscDropCap . None != FramePr . DropCap ) { var _FramePr = this . Get _FramePr ( ) ; var FirstFramePara = this ; var Prev = FirstFramePara . Get _DocumentPrev ( ) ;
while ( null != Prev ) if ( type _Paragraph === Prev . GetType ( ) ) { var PrevFramePr = Prev . Get _FramePr ( ) ; if ( undefined != PrevFramePr && true === _FramePr . Compare ( PrevFramePr ) ) { FirstFramePara = Prev ; Prev = Prev . Get _DocumentPrev ( ) } else break } else break ; var TextPr = FirstFramePara . GetFirstRunPr ( ) ; if ( undefined === TextPr . RFonts || undefined === TextPr . RFonts . Ascii ) TextPr = this . Get _CompiledPr2 ( false ) . TextPr ; FramePr . FontFamily = { Name : TextPr . RFonts . Ascii . Name , Index : TextPr . RFonts . Ascii . Index } } var FrameParas = this . Internal _Get _FrameParagraphs ( ) ;
var Count = FrameParas . length ; var ParaPr = FrameParas [ 0 ] . Get _CompiledPr2 ( false ) . ParaPr . Copy ( ) ; for ( var Index = 1 ; Index < Count ; Index ++ ) { var TempPr = FrameParas [ Index ] . Get _CompiledPr2 ( false ) . ParaPr ; ParaPr = ParaPr . Compare ( TempPr ) } FramePr . Brd = ParaPr . Brd ; FramePr . Shd = ParaPr . Shd } ; Paragraph . prototype . CanAddDropCap = function ( ) { for ( var nPos = 0 , nCount = this . Content . length ; nPos < nCount ; ++ nPos ) { var bResult = this . Content [ nPos ] . CanAddDropCap ( ) ; if ( null !== bResult ) return bResult } return false } ; Paragraph . prototype . Get _TextForDropCap =
function ( DropCapText , UseContentPos , ContentPos , Depth ) { var EndPos = true === UseContentPos ? ContentPos . Get ( Depth ) : this . Content . length - 1 ; for ( var Pos = 0 ; Pos <= EndPos ; Pos ++ ) { this . Content [ Pos ] . Get _TextForDropCap ( DropCapText , true === UseContentPos && Pos === EndPos ? true : false , ContentPos , Depth + 1 ) ; if ( true === DropCapText . Mixed && ( true === DropCapText . Check || DropCapText . Runs . length > 0 ) ) return } } ; Paragraph . prototype . Split _DropCap = function ( NewParagraph ) { var DropCapText = new CParagraphGetDropCapText ; if ( true == this . Selection . Use && this . Parent . IsSelectedSingleElement ( ) ) { var SelSP =
this . Get _ParaContentPos ( true , true ) ; var SelEP = this . Get _ParaContentPos ( true , false ) ; if ( 0 <= SelSP . Compare ( SelEP ) ) SelEP = SelSP ; DropCapText . Check = true ; this . Get _TextForDropCap ( DropCapText , true , SelEP , 0 ) ; DropCapText . Check = false ; this . Get _TextForDropCap ( DropCapText , true , SelEP , 0 ) } else { DropCapText . Mixed = true ; DropCapText . Check = false ; this . Get _TextForDropCap ( DropCapText , false ) } var Count = DropCapText . Text . length ; var PrevRun = null ; var CurrRun = null ; for ( var Pos = 0 , ParaPos = 0 , RunPos = 0 ; Pos < Count ; Pos ++ ) { if ( PrevRun !== DropCapText . Runs [ Pos ] ) { PrevRun =
DropCapText . Runs [ Pos ] ; CurrRun = new ParaRun ( NewParagraph ) ; CurrRun . Set _Pr ( DropCapText . Runs [ Pos ] . Pr . Copy ( ) ) ; NewParagraph . Internal _Content _Add ( ParaPos ++ , CurrRun , false ) ; RunPos = 0 } CurrRun . Add _ToContent ( RunPos ++ , DropCapText . Text [ Pos ] , false ) } if ( Count > 0 ) return DropCapText . Runs [ Count - 1 ] . Get _CompiledPr ( true ) ; return null } ; Paragraph . prototype . SelectFirstLetter = function ( ) { var oStartPos = new CParagraphContentPos ; var oEndPos = new CParagraphContentPos ; for ( var nPos = 0 , nCount = this . Content . length ; nPos < nCount ; ++ nPos ) { oStartPos . Update ( nPos ,
0 ) ; oEndPos . Update ( nPos , 0 ) ; if ( this . Content [ nPos ] . GetFirstRunElementPos ( para _Text , oStartPos , oEndPos , 1 ) ) { this . StartSelectionFromCurPos ( ) ; this . SetSelectionContentPos ( oStartPos , oEndPos , false ) ; this . Document _SetThisElementCurrent ( ) ; return true } } return false } ; Paragraph . prototype . CheckSelectionForDropCap = function ( ) { var oSelectionStart = this . Get _ParaContentPos ( true , true ) ; var oSelectionEnd = this . Get _ParaContentPos ( true , false ) ; if ( 0 <= oSelectionStart . Compare ( oSelectionEnd ) ) oSelectionEnd = oSelectionStart ; var nEndPos =
oSelectionEnd . Get ( 0 ) ; for ( var nPos = 0 ; nPos <= nEndPos ; ++ nPos ) if ( ! this . Content [ nPos ] . CheckSelectionForDropCap ( nPos === nEndPos , oSelectionEnd , 1 ) ) return false ; return true } ; Paragraph . prototype . Update _DropCapByLines = function ( TextPr , Count , LineH , LineTA , LineTD , Before ) { if ( null === TextPr ) return ; this . Set _Spacing ( { Before : Before , After : 0 , LineRule : linerule _Exact , Line : Count * LineH - . 001 } , false ) ; var FontSize = 72 ; TextPr . FontSize = FontSize ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII ,
1 ) ; var TMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TMetrics ) ; var TDescent = TMetrics . Descent ; var TAscent = TMetrics . Ascent ; var THeight = 0 ; if ( null === TAscent || null === TDescent ) THeight = g _oTextMeasurer . GetHeight ( ) ; else THeight = - TDescent + TAscent ; var EmHeight = THeight ; var NewEmHeight = ( Count - 1 ) * LineH + LineTA ; var Koef = NewEmHeight / EmHeight ; var NewFontSize = TextPr . FontSize * Koef ; TextPr . FontSize = parseInt ( NewFontSize * 2 ) / 2 ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII ,
1 ) ; var TNewMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TNewMetrics ) ; var TNewDescent = TNewMetrics . Descent ; var TNewAscent = TNewMetrics . Ascent ; var TNewHeight = 0 ; if ( null === TNewAscent || null === TNewDescent ) TNewHeight = g _oTextMeasurer . GetHeight ( ) ; else TNewHeight = - TNewDescent + TNewAscent ; var Descent = g _oTextMeasurer . GetDescender ( ) ; var Ascent = g _oTextMeasurer . GetAscender ( ) ; var Dy = Descent * ( LineH * Count ) / ( Ascent - Descent ) + TNewHeight - TNewAscent + LineTD ; var PTextPr = new ParaTextPr ( { RFonts : { Ascii : { Name : TextPr . RFonts . Ascii . Name ,
Index : - 1 } } , FontSize : TextPr . FontSize , Position : Dy } ) ; this . SelectAll ( ) ; this . Add ( PTextPr ) ; this . RemoveSelection ( ) } ; Paragraph . prototype . Update _DropCapByHeight = function ( _Height ) { var AnchorPara = this . Get _FrameAnchorPara ( ) ; if ( null === AnchorPara || AnchorPara . Lines . length <= 0 ) return 1 ; var Before = AnchorPara . Get _CompiledPr ( ) . ParaPr . Spacing . Before ; var LineH = AnchorPara . Lines [ 0 ] . Bottom - AnchorPara . Lines [ 0 ] . Top - Before ; var LineTA = AnchorPara . Lines [ 0 ] . Metrics . TextAscent2 ; var LineTD = AnchorPara . Lines [ 0 ] . Metrics . TextDescent +
AnchorPara . Lines [ 0 ] . Metrics . LineGap ; var Height = _Height - Before ; this . Set _Spacing ( { LineRule : linerule _Exact , Line : Height } , false ) ; var LinesCount = Math . ceil ( Height / LineH ) ; var TextPr = this . Internal _CalculateTextPr ( this . Internal _GetStartPos ( ) ) ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII , 1 ) ; var TMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TMetrics ) ; var TDescent = TMetrics . Descent ; var TAscent = TMetrics . Ascent ; var THeight = 0 ; if ( null === TAscent ||
null === TDescent ) THeight = g _oTextMeasurer . GetHeight ( ) ; else THeight = - TDescent + TAscent ; var Koef = ( Height - LineTD ) / THeight ; var NewFontSize = TextPr . FontSize * Koef ; TextPr . FontSize = parseInt ( NewFontSize * 2 ) / 2 ; g _oTextMeasurer . SetTextPr ( TextPr , this . Get _Theme ( ) ) ; g _oTextMeasurer . SetFontSlot ( fontslot _ASCII , 1 ) ; var TNewMetrics = { Ascent : null , Descent : null } ; this . private _RecalculateTextMetrics ( TNewMetrics ) ; var TNewDescent = TNewMetrics . Descent ; var TNewAscent = TNewMetrics . Ascent ; var TNewHeight = 0 ; if ( null === TNewAscent || null === TNewDescent ) TNewHeight =
g _oTextMeasurer . GetHeight ( ) ; else TNewHeight = - TNewDescent + TNewAscent ; var Descent = g _oTextMeasurer . GetDescender ( ) ; var Ascent = g _oTextMeasurer . GetAscender ( ) ; var Dy = Descent * Height / ( Ascent - Descent ) + TNewHeight - TNewAscent + LineTD ; var PTextPr = new ParaTextPr ( { RFonts : { Ascii : { Name : TextPr . RFonts . Ascii . Name , Index : - 1 } } , FontSize : TextPr . FontSize , Position : Dy } ) ; this . SelectAll ( ) ; this . Add ( PTextPr ) ; this . RemoveSelection ( ) ; return LinesCount } ; Paragraph . prototype . Get _FrameAnchorPara = function ( ) { var FramePr = this . Get _FramePr ( ) ;
if ( undefined === FramePr ) return null ; var Next = this . Get _DocumentNext ( ) ; while ( null != Next ) { if ( type _Paragraph === Next . GetType ( ) ) { var NextFramePr = Next . Get _FramePr ( ) ; if ( undefined === NextFramePr || false === FramePr . Compare ( NextFramePr ) ) return Next } Next = Next . Get _DocumentNext ( ) } return Next } ; Paragraph . prototype . Split = function ( NewParagraph ) { if ( ! NewParagraph ) NewParagraph = new Paragraph ( this . DrawingDocument , this . Parent ) ; NewParagraph . DeleteCommentOnRemove = false ; this . DeleteCommentOnRemove = false ; this . RemoveSelection ( ) ; NewParagraph . RemoveSelection ( ) ;
var ContentPos = this . Get _ParaContentPos ( false , false ) ; var CurPos = ContentPos . Get ( 0 ) ; var TextPr = this . Get _TextPr ( ContentPos ) ; var oLogicDocument = this . GetLogicDocument ( ) ; var oStyles = oLogicDocument && oLogicDocument . GetStyles ? oLogicDocument . GetStyles ( ) : null ; if ( oStyles && ( TextPr . RStyle === oStyles . GetDefaultEndnoteReference ( ) || TextPr . RStyle === oStyles . GetDefaultFootnoteReference ( ) ) ) { TextPr = TextPr . Copy ( ) ; TextPr . RStyle = undefined } var NewElement = this . Content [ CurPos ] . Split ( ContentPos , 1 ) ; if ( null === NewElement ) { NewElement =
new ParaRun ( NewParagraph ) ; NewElement . Set _Pr ( TextPr . Copy ( ) ) } var NewContent = this . Content . slice ( CurPos + 1 ) ; this . Internal _Content _Remove2 ( CurPos + 1 , this . Content . length - CurPos - 1 ) ; var EndRun = new ParaRun ( this ) ; EndRun . Add _ToContent ( 0 , new ParaEnd ) ; this . Internal _Content _Add ( this . Content . length , EndRun ) ; NewParagraph . Internal _Content _Remove2 ( 0 , NewParagraph . Content . length ) ; NewParagraph . Internal _Content _Concat ( NewContent ) ; NewParagraph . Internal _Content _Add ( 0 , NewElement ) ; NewParagraph . Correct _Content ( ) ; this . CopyPr ( NewParagraph ) ;
this . TextPr . Clear _Style ( ) ; this . TextPr . Apply _TextPr ( TextPr ) ; var SectPr = this . Get _SectionPr ( ) ; if ( undefined !== SectPr ) { this . Set _SectionPr ( undefined ) ; NewParagraph . Set _SectionPr ( SectPr ) } this . MoveCursorToEndPos ( false , false ) ; NewParagraph . MoveCursorToStartPos ( false ) ; NewParagraph . DeleteCommentOnRemove = true ; this . DeleteCommentOnRemove = true ; return NewParagraph } ; Paragraph . prototype . Concat = function ( Para , isUseConcatedStyle ) { this . DeleteCommentOnRemove = false ; Para . DeleteCommentOnRemove = false ; this . Remove _ParaEnd ( ) ; var NearPosCount =
Para . NearPosArray . length ; for ( var Pos = 0 ; Pos < NearPosCount ; Pos ++ ) { var ParaNearPos = Para . NearPosArray [ Pos ] ; ParaNearPos . Classes [ 0 ] = this ; ParaNearPos . NearPos . Paragraph = this ; ParaNearPos . NearPos . ContentPos . Data [ 0 ] += this . Content . length ; this . NearPosArray . push ( ParaNearPos ) } this . Internal _Content _Concat ( Para . Content ) ; Para . ClearContent ( ) ; this . Set _SectionPr ( undefined ) ; var SectPr = Para . Get _SectionPr ( ) ; if ( undefined !== SectPr ) { Para . Set _SectionPr ( undefined ) ; this . Set _SectionPr ( SectPr ) } this . DeleteCommentOnRemove = true ; Para . DeleteCommentOnRemove =
true ; if ( true === isUseConcatedStyle ) Para . CopyPr ( this ) } ; Paragraph . prototype . ConcatBefore = function ( oPara ) { this . DeleteCommentOnRemove = false ; oPara . DeleteCommentOnRemove = false ; oPara . Remove _ParaEnd ( ) ; for ( var nPos = 0 , nCount = this . NearPosArray . length ; nPos < nCount ; ++ nPos ) { var oParaNearPos = this . NearPosArray [ nPos ] ; oParaNearPos . NearPos . ContentPos . Data [ 0 ] += oPara . Content . length } for ( var nPos = 0 , nCount = oPara . NearPosArray . length ; nPos < nCount ; ++ nPos ) { var oParaNearPos = oPara . NearPosArray [ nPos ] ; oParaNearPos . Classes [ 0 ] = this ;
oParaNearPos . NearPos . Paragraph = this ; this . NearPosArray . push ( oParaNearPos ) } for ( var nPos = 0 , nCount = oPara . Content . length ; nPos < nCount ; ++ nPos ) this . AddToContent ( nPos , oPara . Content [ nPos ] ) ; oPara . ClearContent ( ) ; oPara . Set _SectionPr ( undefined ) ; this . DeleteCommentOnRemove = true ; oPara . DeleteCommentOnRemove = true ; oPara . CopyPr ( this ) } ; Paragraph . prototype . Continue = function ( NewParagraph ) { var TextPr ; if ( this . IsEmpty ( ) ) TextPr = this . TextPr . Value . Copy ( ) ; else { var EndPos = this . Get _EndPos2 ( false ) ; var CurPos = this . Get _ParaContentPos ( false ,
false ) ; this . Set _ParaContentPos ( EndPos , true , - 1 , - 1 ) ; TextPr = this . Get _TextPr ( this . Get _ParaContentPos ( false , false ) ) . Copy ( ) ; this . Set _ParaContentPos ( CurPos , false , - 1 , - 1 , false ) ; TextPr . HighLight = highlight _None ; var oStyles ; if ( this . bFromDocument && this . LogicDocument && ( oStyles = this . LogicDocument . GetStyles ( ) ) && ( TextPr . RStyle === oStyles . GetDefaultFootnoteReference ( ) || TextPr . RStyle === oStyles . GetDefaultEndnoteReference ( ) ) ) TextPr . RStyle = undefined } this . CopyPr ( NewParagraph ) ; if ( ! this . HaveNumbering ( ) && ! this . Lock . Is _Locked ( ) ) { this . TextPr . Clear _Style ( ) ;
this . TextPr . Apply _TextPr ( TextPr ) } NewParagraph . Internal _Content _Add ( 0 , new ParaRun ( NewParagraph ) ) ; NewParagraph . Correct _Content ( ) ; NewParagraph . MoveCursorToStartPos ( false ) ; for ( var Pos = 0 , Count = NewParagraph . Content . length ; Pos < Count ; Pos ++ ) if ( para _Run === NewParagraph . Content [ Pos ] . Type ) NewParagraph . Content [ Pos ] . Set _Pr ( TextPr . Copy ( ) ) } ; Paragraph . prototype . GetSelectionState = function ( ) { var ParaState = { } ; ParaState . CurPos = { X : this . CurPos . X , Y : this . CurPos . Y , Line : this . CurPos . Line , ContentPos : this . Get _ParaContentPos ( false ,
false ) , RealX : this . CurPos . RealX , RealY : this . CurPos . RealY , PagesPos : this . CurPos . PagesPos } ; ParaState . Selection = { Start : this . Selection . Start , Use : this . Selection . Use , StartPos : 0 , EndPos : 0 , Flag : this . Selection . Flag } ; if ( true === this . Selection . Use ) { ParaState . Selection . StartPos = this . Get _ParaContentPos ( true , true ) ; ParaState . Selection . EndPos = this . Get _ParaContentPos ( true , false ) } return [ ParaState ] } ; Paragraph . prototype . SetSelectionState = function ( State , StateIndex ) { if ( State . length <= 0 ) return ; var ParaState = State [ StateIndex ] ;
this . CurPos . X = ParaState . CurPos . X ; this . CurPos . Y = ParaState . CurPos . Y ; this . CurPos . Line = ParaState . CurPos . Line ; this . CurPos . RealX = ParaState . CurPos . RealX ; this . CurPos . RealY = ParaState . CurPos . RealY ; this . CurPos . PagesPos = ParaState . CurPos . PagesPos ; this . Set _ParaContentPos ( ParaState . CurPos . ContentPos , true , - 1 , - 1 ) ; this . RemoveSelection ( ) ; this . Selection . Start = ParaState . Selection . Start ; this . Selection . Use = ParaState . Selection . Use ; this . Selection . Flag = ParaState . Selection . Flag ; if ( true === this . Selection . Use ) this . Set _SelectionContentPos ( ParaState . Selection . StartPos ,
ParaState . Selection . EndPos ) } ; Paragraph . prototype . Get _ParentObject _or _DocumentPos = function ( ) { this . Parent . Update _ContentIndexing ( ) ; return this . Parent . Get _ParentObject _or _DocumentPos ( this . Index ) } ; Paragraph . prototype . Refresh _RecalcData = function ( Data ) { var Type = Data . Type ; var bNeedRecalc = false ; var CurPage = 0 ; switch ( Type ) { case AscDFH . historyitem _Paragraph _AddItem : case AscDFH . historyitem _Paragraph _RemoveItem : { for ( CurPage = this . Pages . length - 1 ; CurPage > 0 ; CurPage -- ) if ( Data . Pos > this . Lines [ this . Pages [ CurPage ] . StartLine ] . Get _StartPos ( ) ) break ;
this . RecalcInfo . Set _Type _0 ( pararecalc _0 _All ) ; bNeedRecalc = true ; break } case AscDFH . historyitem _Paragraph _Numbering : case AscDFH . historyitem _Paragraph _PStyle : case AscDFH . historyitem _Paragraph _Pr : case AscDFH . historyitem _Paragraph _PresentationPr _Bullet : case AscDFH . historyitem _Paragraph _PresentationPr _Level : { this . RecalcInfo . Set _Type _0 ( pararecalc _0 _All ) ; bNeedRecalc = true ; this . CompiledPr . NeedRecalc = true ; this . Recalc _RunsCompiledPr ( ) ; break } case AscDFH . historyitem _Paragraph _Align : case AscDFH . historyitem _Paragraph _DefaultTabSize : case AscDFH . historyitem _Paragraph _Ind _First : case AscDFH . historyitem _Paragraph _Ind _Left : case AscDFH . historyitem _Paragraph _Ind _Right : case AscDFH . historyitem _Paragraph _ContextualSpacing : case AscDFH . historyitem _Paragraph _KeepLines : case AscDFH . historyitem _Paragraph _KeepNext : case AscDFH . historyitem _Paragraph _PageBreakBefore : case AscDFH . historyitem _Paragraph _Spacing _Line : case AscDFH . historyitem _Paragraph _Spacing _LineRule : case AscDFH . historyitem _Paragraph _Spacing _Before : case AscDFH . historyitem _Paragraph _Spacing _After : case AscDFH . historyitem _Paragraph _Spacing _AfterAutoSpacing : case AscDFH . historyitem _Paragraph _Spacing _BeforeAutoSpacing : case AscDFH . historyitem _Paragraph _WidowControl : case AscDFH . historyitem _Paragraph _Tabs : case AscDFH . historyitem _Paragraph _Borders _Between : case AscDFH . historyitem _Paragraph _Borders _Bottom : case AscDFH . historyitem _Paragraph _Borders _Left : case AscDFH . historyitem _Paragraph _Borders _Right : case AscDFH . historyitem _Paragraph _Borders _Top : case AscDFH . historyitem _Paragraph _FramePr : { bNeedRecalc =
true ; break } case AscDFH . historyitem _Paragraph _Shd _Value : case AscDFH . historyitem _Paragraph _Shd _Color : case AscDFH . historyitem _Paragraph _Shd _Unifill : case AscDFH . historyitem _Paragraph _Shd : { if ( this . Parent ) { var oDrawingShape = this . Parent . Is _DrawingShape ( true ) ; if ( oDrawingShape && oDrawingShape . getObjectType && oDrawingShape . getObjectType ( ) === AscDFH . historyitem _type _Shape ) if ( oDrawingShape . chekBodyPrTransform ( oDrawingShape . getBodyPr ( ) ) || oDrawingShape . checkContentWordArt ( oDrawingShape . getDocContent ( ) ) ) bNeedRecalc =
true ; if ( this . Parent . IsTableHeader ( ) ) bNeedRecalc = true } break } case AscDFH . historyitem _Paragraph _SectionPr : { if ( this . Parent instanceof CDocument ) { this . Parent . UpdateContentIndexing ( ) ; var nSectionIndex = this . Parent . GetSectionIndexByElementIndex ( this . GetIndex ( ) ) ; var oFirstElement = this . Parent . GetFirstElementInSection ( nSectionIndex ) ; if ( oFirstElement ) this . Parent . Refresh _RecalcData2 ( oFirstElement . GetIndex ( ) , oFirstElement . private _GetRelativePageIndex ( 0 ) ) } break } case AscDFH . historyitem _Paragraph _PrChange : { if ( Data instanceof
CChangesParagraphPrChange && Data . IsChangedNumbering ( ) ) bNeedRecalc = true ; break } case AscDFH . historyitem _Paragraph _SuppressLineNumbers : { History . AddLineNumbersToRecalculateData ( ) ; break } } if ( true === bNeedRecalc ) { var Prev = this . Get _DocumentPrev ( ) ; if ( 0 === CurPage && null != Prev && type _Paragraph === Prev . GetType ( ) && true === Prev . Get _CompiledPr2 ( false ) . ParaPr . KeepNext ) Prev . Refresh _RecalcData2 ( Prev . Pages . length - 1 ) ; return this . Refresh _RecalcData2 ( CurPage ) } } ; Paragraph . prototype . Refresh _RecalcData2 = function ( CurPage ) { if ( ! CurPage ) CurPage =