@@ -192,28 +192,10 @@ thin.core.Layout.prototype.drawShapeFromElements = function(elements, opt_sectio
192192 * @param {thin.core.ListSectionShape= } opt_sectionShape
193193 */
194194thin . core . Layout . prototype . drawShapes = function ( items , opt_sectionShape ) {
195- var shapes = [ ] ;
195+ var shape ;
196196 goog . array . forEach ( items , function ( item ) {
197- var shape = this . drawShape ( item , opt_sectionShape ) ;
198- shapes . push ( shape ) ;
197+ shape = this . drawShape ( item , opt_sectionShape ) ;
199198 } , this ) ;
200-
201- if ( opt_sectionShape ) {
202- var manager = opt_sectionShape . getManager ( ) ;
203- } else {
204- var manager = this . getManager ( ) ;
205- }
206- var shapeIdManager = manager . getShapeIdManager ( ) ;
207-
208- goog . array . forEach ( shapes , function ( shape , i ) {
209- if ( shape . instanceOfTblockShape ( ) ) {
210- var refId = items [ i ] [ 'reference-id' ] ;
211- if ( ! thin . isExactlyEqual ( refId , thin . core . TblockShape . DEFAULT_REFID ) && thin . isDef ( refId ) ) {
212- shape . setRefId ( refId , shapeIdManager . getShapeForShapeId ( refId ) ) ;
213- }
214- }
215- } ) ;
216-
217199} ;
218200
219201
@@ -494,7 +476,6 @@ thin.core.Layout.prototype.createHelpersElement = function(tagName, attrs) {
494476 * @return {Object }
495477 */
496478thin . core . Layout . prototype . toHash = function ( ) {
497- // TODO: DRY
498479 var childNodes = this . getCanvasElement ( ) . getElement ( ) . childNodes ;
499480 var identifiers = goog . array . map ( childNodes , function ( element , i ) {
500481 return element . getAttribute ( 'id' ) ;
@@ -981,7 +962,7 @@ thin.core.Layout.prototype.pasteShapes = function() {
981962 var referringShape = pasteShapes [ count ] ;
982963 if ( referringShape . instanceOfTblockShape ( ) ) {
983964 if ( ! thin . isExactlyEqual ( refId , defaultRefId ) && ! referringShape . isReferences ( ) ) {
984- referringShape . setRefId ( refId , layout . getShapeForShapeId ( refId , shapeIdManager ) ) ;
965+ referringShape . setRefId ( refId ) ;
985966 }
986967 }
987968 } ) ;
@@ -1000,7 +981,7 @@ thin.core.Layout.prototype.pasteShapes = function() {
1000981 var referringShape = pasteShapes [ count ] ;
1001982 if ( referringShape . instanceOfTblockShape ( ) ) {
1002983 if ( ! thin . isExactlyEqual ( refId , defaultRefId ) && ! referringShape . isReferences ( ) ) {
1003- referringShape . setRefId ( refId , layout . getShapeForShapeId ( refId ) ) ;
984+ referringShape . setRefId ( refId ) ;
1004985 }
1005986 }
1006987 } ) ;
@@ -1134,23 +1115,23 @@ thin.core.Layout.prototype.removeShape = function(shape) {
11341115 listHelper . clearChangingPageSetShape ( ) ;
11351116 }
11361117 goog . array . forEach ( shape . getPageNumberReferences ( ) , function ( target ) {
1137- target . removeTargetShape ( ) ;
1118+ target . removeTargetShapeId ( ) ;
11381119 } ) ;
11391120 }
11401121
11411122 if ( shape . instanceOfTblockShape ( ) ) {
11421123 if ( shape . isReferences ( ) ) {
11431124 goog . array . forEach ( shape . getReferringShapes ( ) , function ( target ) {
1144- target . removeReferenceShape ( ) ;
1125+ target . removeReferenceShapeId ( ) ;
11451126 } ) ;
11461127 }
11471128 if ( shape . isReferring ( ) ) {
1148- shape . removeReferenceShape ( ) ;
1129+ shape . removeReferenceShapeId ( ) ;
11491130 }
11501131 }
11511132
11521133 if ( shape . instanceOfPageNumberShape ( ) ) {
1153- shape . removeTargetShape ( ) ;
1134+ shape . removeTargetShapeId ( ) ;
11541135 }
11551136
11561137 if ( shape . isAffiliationListShape ( ) ) {
@@ -1386,7 +1367,7 @@ thin.core.Layout.prototype.createTblockShape = function() {
13861367 shape . setFormatType ( thin . core . TblockShape . DEFAULT_FORMAT_TYPE ) ;
13871368 shape . setDefaultValueOfLink ( thin . core . TblockShape . DEFAULT_VALUE ) ;
13881369 shape . setBaseFormat ( thin . core . TblockShape . DEFAULT_FORMAT_BASE ) ;
1389- shape . setInternalRefId ( thin . core . TblockShape . DEFAULT_REFID ) ;
1370+ shape . setRefId ( thin . core . TblockShape . DEFAULT_REFID ) ;
13901371 shape . setKerning ( thin . core . TextStyle . DEFAULT_KERNING ) ;
13911372 shape . setDisplay ( thin . core . ModuleShape . DEFAULT_DISPLAY ) ;
13921373 shape . setMultiModeInternal ( thin . core . TblockShape . DEFAULT_MULTIPLE ) ;
0 commit comments