@@ -57,7 +57,7 @@ internal void Insert(FF.IElement newElement, int position, Document doc)
5757 {
5858 _staticDocDict . TryGetValue ( doc . GetInstanceInfo ( ) , out WordprocessingDocument staticDoc ) ;
5959
60- if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new FileFormatException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
60+ if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new OpenizeException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
6161
6262 _ooxmlDoc = OwDocument . CreateInstance ( staticDoc ) ;
6363
@@ -95,7 +95,7 @@ internal void Insert(FF.IElement newElement, int position, Document doc)
9595 staticDoc . MainDocumentPart . Document . Body . RemoveAllChildren ( ) ;
9696 staticDoc . MainDocumentPart . Document . Body . Append ( originalElements ) ;
9797 var errorMessage = ConstructMessage ( ex , "Remove OOXML Element(s)" ) ;
98- throw new FileFormatException ( errorMessage , ex ) ;
98+ throw new OpenizeException ( errorMessage , ex ) ;
9999 }
100100 }
101101 }
@@ -106,7 +106,7 @@ internal void Update(FF.IElement newElement, int position, Document doc)
106106 {
107107 _staticDocDict . TryGetValue ( doc . GetInstanceInfo ( ) , out WordprocessingDocument staticDoc ) ;
108108
109- if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new FileFormatException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
109+ if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new OpenizeException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
110110
111111 _ooxmlDoc = OwDocument . CreateInstance ( staticDoc ) ;
112112
@@ -147,7 +147,7 @@ internal void Update(FF.IElement newElement, int position, Document doc)
147147 staticDoc . MainDocumentPart . Document . Body . RemoveAllChildren ( ) ;
148148 staticDoc . MainDocumentPart . Document . Body . Append ( originalElements ) ;
149149 var errorMessage = ConstructMessage ( ex , "Update OOXML Element(s)" ) ;
150- throw new FileFormatException ( errorMessage , ex ) ;
150+ throw new OpenizeException ( errorMessage , ex ) ;
151151 }
152152 }
153153 }
@@ -158,7 +158,7 @@ internal void Remove(int position, Document doc)
158158 {
159159 _staticDocDict . TryGetValue ( doc . GetInstanceInfo ( ) , out WordprocessingDocument staticDoc ) ;
160160
161- if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new FileFormatException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
161+ if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new OpenizeException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
162162
163163 var enumerable = staticDoc . MainDocumentPart . Document . Body . Elements ( ) . ToList ( ) ;
164164 var originalElements = new List < DF . OpenXmlElement > ( enumerable ) ;
@@ -174,7 +174,7 @@ internal void Remove(int position, Document doc)
174174 staticDoc . MainDocumentPart . Document . Body . RemoveAllChildren ( ) ;
175175 staticDoc . MainDocumentPart . Document . Body . Append ( originalElements ) ;
176176 var errorMessage = ConstructMessage ( ex , "Remove OOXML Element(s)" ) ;
177- throw new FileFormatException ( errorMessage , ex ) ;
177+ throw new OpenizeException ( errorMessage , ex ) ;
178178 }
179179 }
180180 }
@@ -185,7 +185,7 @@ internal void Append(FF.IElement newElement, Document doc)
185185 {
186186 _staticDocDict . TryGetValue ( doc . GetInstanceInfo ( ) , out WordprocessingDocument staticDoc ) ;
187187
188- if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new FileFormatException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
188+ if ( staticDoc ? . MainDocumentPart ? . Document ? . Body == null ) throw new OpenizeException ( "Package or Document or Body is null" , new NullReferenceException ( ) ) ;
189189
190190 _ooxmlDoc = OwDocument . CreateInstance ( staticDoc ) ;
191191
@@ -225,7 +225,7 @@ internal void Append(FF.IElement newElement, Document doc)
225225 staticDoc . MainDocumentPart . Document . Body . RemoveAllChildren ( ) ;
226226 staticDoc . MainDocumentPart . Document . Body . Append ( originalElements ) ;
227227 var errorMessage = ConstructMessage ( ex , "Append OOXML Element(s)" ) ;
228- throw new FileFormatException ( errorMessage , ex ) ;
228+ throw new OpenizeException ( errorMessage , ex ) ;
229229 }
230230 }
231231 }
@@ -245,7 +245,7 @@ internal void Save(System.IO.Stream stream, Document doc)
245245 catch ( Exception ex )
246246 {
247247 var errorMessage = ConstructMessage ( ex , "Save OOXML OWDocument" ) ;
248- throw new FileFormatException ( errorMessage , ex ) ;
248+ throw new OpenizeException ( errorMessage , ex ) ;
249249 }
250250 }
251251 }
0 commit comments