@@ -75,28 +75,36 @@ internal void Insert(FF.IElement newElement, int position, Document doc)
7575 switch ( newElement )
7676 {
7777 case FF . Paragraph ffPara :
78- var wpPara = _ooxmlDoc . CreateParagraph ( ffPara ) ;
78+ //var wpPara = _ooxmlDoc.CreateParagraph(ffPara);
79+ var wpPara = OoxmlParagraph . CreateInstance (
80+ _ooxmlDoc . IDs , _ooxmlDoc . NumberingPart ) . CreateParagraph ( ffPara ) ;
7981 elements . ElementAt ( position ) . InsertBeforeSelf ( wpPara ) ;
8082 break ;
8183
8284
8385 case FF . Table ffTable :
84- var wpTable = _ooxmlDoc . CreateTable ( ffTable ) ;
86+ var wpTable = OoxmlTable . CreateInstance (
87+ _ooxmlDoc . IDs , _ooxmlDoc . NumberingPart ) . CreateTable ( ffTable ) ;
8588 elements . ElementAt ( position ) . InsertBeforeSelf ( wpTable ) ;
8689 break ;
8790
8891 case FF . Image ffImage :
89- var wpImage = _ooxmlDoc . CreateImage ( ffImage , staticDoc . MainDocumentPart ) ;
92+ //var wpImage = _ooxmlDoc.CreateImage(ffImage, staticDoc.MainDocumentPart);
93+ var wpImage = OoxmlImage . CreateInstance (
94+ _ooxmlDoc . MainPart ) . CreateImage ( ffImage ) ;
9095 elements . ElementAt ( position ) . InsertBeforeSelf ( wpImage ) ;
9196 break ;
9297
9398 case FF . Shape ffShape :
94- var wpShape = _ooxmlDoc . CreateShape ( ffShape ) ;
99+ //var wpShape = _ooxmlDoc.CreateShape(ffShape);
100+ var wpShape = OoxmlShape . CreateInstance ( ) . CreateShape ( ffShape ) ;
95101 elements . ElementAt ( position ) . InsertBeforeSelf ( wpShape ) ;
96102 break ;
97103
98104 case FF . GroupShape ffGroupShape :
99- var wpGroupShape = _ooxmlDoc . CreateGroupShape ( ffGroupShape ) ;
105+ //var wpGroupShape = _ooxmlDoc.CreateGroupShape(ffGroupShape);
106+ var wpGroupShape = OoxmlGroupShape . CreateInstance ( ) .
107+ CreateGroupShape ( ffGroupShape ) ;
100108 elements . ElementAt ( position ) . InsertBeforeSelf ( wpGroupShape ) ;
101109 break ;
102110 }
@@ -137,26 +145,34 @@ internal void Update(FF.IElement newElement, int position, Document doc)
137145 switch ( newElement )
138146 {
139147 case FF . Paragraph ffPara :
140- var wpPara = _ooxmlDoc . CreateParagraph ( ffPara ) ;
148+ //var wpPara = _ooxmlDoc.CreateParagraph(ffPara);
149+ var wpPara = OoxmlParagraph . CreateInstance (
150+ _ooxmlDoc . IDs , _ooxmlDoc . NumberingPart ) . CreateParagraph ( ffPara ) ;
141151 enumerable1 . ElementAt ( position ) . InsertBeforeSelf ( wpPara ) ;
142152 break ;
143153
144154 case FF . Table ffTable :
145- var wpTable = _ooxmlDoc . CreateTable ( ffTable ) ;
155+ var wpTable = OoxmlTable . CreateInstance (
156+ _ooxmlDoc . IDs , _ooxmlDoc . NumberingPart ) . CreateTable ( ffTable ) ;
146157 enumerable1 . ElementAt ( position ) . InsertBeforeSelf ( wpTable ) ;
147158 break ;
148159 case FF . Image ffImage :
149- var wpImage = _ooxmlDoc . CreateImage ( ffImage , staticDoc . MainDocumentPart ) ;
160+ //var wpImage = _ooxmlDoc.CreateImage(ffImage, staticDoc.MainDocumentPart);
161+ var wpImage = OoxmlImage . CreateInstance (
162+ _ooxmlDoc . MainPart ) . CreateImage ( ffImage ) ;
150163 enumerable1 . ElementAt ( position ) . InsertBeforeSelf ( wpImage ) ;
151164 break ;
152165
153166 case FF . Shape ffShape :
154- var wpShape = _ooxmlDoc . CreateShape ( ffShape ) ;
167+ //var wpShape = _ooxmlDoc.CreateShape(ffShape);
168+ var wpShape = OoxmlShape . CreateInstance ( ) . CreateShape ( ffShape ) ;
155169 enumerable1 . ElementAt ( position ) . InsertBeforeSelf ( wpShape ) ;
156170 break ;
157171
158172 case FF . GroupShape ffGroupShape :
159- var wpGroupShape = _ooxmlDoc . CreateGroupShape ( ffGroupShape ) ;
173+ //var wpGroupShape = _ooxmlDoc.CreateGroupShape(ffGroupShape);
174+ var wpGroupShape = OoxmlGroupShape . CreateInstance ( ) .
175+ CreateGroupShape ( ffGroupShape ) ;
160176 elements . ElementAt ( position ) . InsertBeforeSelf ( wpGroupShape ) ;
161177 break ;
162178 }
@@ -224,28 +240,36 @@ internal void Append(FF.IElement newElement, Document doc)
224240 switch ( newElement )
225241 {
226242 case FF . Paragraph ffPara :
227- var wpPara = _ooxmlDoc . CreateParagraph ( ffPara ) ;
243+ //var wpPara = _ooxmlDoc.CreateParagraph(ffPara);
244+ var wpPara = OoxmlParagraph . CreateInstance (
245+ _ooxmlDoc . IDs , _ooxmlDoc . NumberingPart ) . CreateParagraph ( ffPara ) ;
228246 if ( lastSectionProperties != null ) staticDoc . MainDocumentPart . Document . Body . InsertBefore ( wpPara , lastSectionProperties ) ;
229247 else staticDoc . MainDocumentPart . Document . Body . Append ( wpPara ) ;
230248 break ;
231249 case FF . Table ffTable :
232- var wpTable = _ooxmlDoc . CreateTable ( ffTable ) ;
250+ var wpTable = OoxmlTable . CreateInstance (
251+ _ooxmlDoc . IDs , _ooxmlDoc . NumberingPart ) . CreateTable ( ffTable ) ;
233252 if ( lastSectionProperties != null ) staticDoc . MainDocumentPart . Document . Body . InsertBefore ( wpTable , lastSectionProperties ) ;
234253 else staticDoc . MainDocumentPart . Document . Body . Append ( wpTable ) ;
235254 break ;
236255 case FF . Image ffImage :
237- var wpImage = _ooxmlDoc . CreateImage ( ffImage , staticDoc . MainDocumentPart ) ;
256+ //var wpImage = _ooxmlDoc.CreateImage(ffImage, staticDoc.MainDocumentPart);
257+ var wpImage = OoxmlImage . CreateInstance (
258+ _ooxmlDoc . MainPart ) . CreateImage ( ffImage ) ;
238259 if ( lastSectionProperties != null ) staticDoc . MainDocumentPart . Document . Body . InsertBefore ( wpImage , lastSectionProperties ) ;
239260 else staticDoc . MainDocumentPart . Document . Body . Append ( wpImage ) ;
240261 break ;
241262 case FF . Shape ffShape :
242- var wpShape = _ooxmlDoc . CreateShape ( ffShape ) ;
263+ //var wpShape = _ooxmlDoc.CreateShape(ffShape);
264+ var wpShape = OoxmlShape . CreateInstance ( ) . CreateShape ( ffShape ) ;
243265 if ( lastSectionProperties != null ) staticDoc . MainDocumentPart . Document . Body . InsertBefore ( wpShape , lastSectionProperties ) ;
244266 else staticDoc . MainDocumentPart . Document . Body . Append ( wpShape ) ;
245267 break ;
246268
247269 case FF . GroupShape ffGroupShape :
248- var wpGroupShape = _ooxmlDoc . CreateGroupShape ( ffGroupShape ) ;
270+ //var wpGroupShape = _ooxmlDoc.CreateGroupShape(ffGroupShape);
271+ var wpGroupShape = OoxmlGroupShape . CreateInstance ( ) .
272+ CreateGroupShape ( ffGroupShape ) ;
249273 if ( lastSectionProperties != null ) staticDoc . MainDocumentPart . Document . Body . InsertBefore ( wpGroupShape , lastSectionProperties ) ;
250274 else staticDoc . MainDocumentPart . Document . Body . Append ( wpGroupShape ) ;
251275 break ;
0 commit comments