File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,8 +68,9 @@ internal static DocxDocument Read(Stream stream)
6868 if ( entry == null )
6969 return new DocxDocument ( [ ] ) ;
7070
71- using var docStream = entry . Open ( ) ;
72- var doc = XDocument . Load ( docStream ) ;
71+ XDocument doc ;
72+ using ( var docStream = entry . Open ( ) )
73+ doc = XDocument . Load ( docStream ) ;
7374 var body = doc . Descendants ( W + "body" ) . FirstOrDefault ( ) ;
7475 if ( body == null )
7576 return new DocxDocument ( [ ] ) ;
Original file line number Diff line number Diff line change @@ -166,7 +166,8 @@ public void Convert_FooterPageFieldWithSwitch_RendersPageNumber()
166166 var doc = DocxToPdfConverter . Convert ( docxStream ) ;
167167
168168 Assert . True ( doc . Pages . Count >= 1 ) ;
169- Assert . Contains ( doc . Pages [ 0 ] . TextBlocks , b => b . Text == "1" ) ;
169+ var texts = doc . Pages [ 0 ] . TextBlocks . Select ( b => b . Text ) . ToList ( ) ;
170+ Assert . Contains ( "1" , texts , StringComparer . Ordinal ) ;
170171 }
171172
172173 // ── Helper: Create minimal DOCX ─────────────────────────────────────
You can’t perform that action at this time.
0 commit comments