@@ -974,32 +974,27 @@ private void ProcessHTMLElement(Rectangle htmlRectangle, YPosition currentYPosit
974974 return ;
975975 }
976976
977- Paragraph p = blockElement as Paragraph ;
978- Table table = blockElement as Table ;
979- List list = blockElement as List ;
980- Link anchor = blockElement as Link ;
981- Image image = blockElement as Image ;
982- if ( p != null )
977+ if ( blockElement is Paragraph p )
983978 {
984979 p . SetFixedPosition ( this . getPage ( ) , htmlRectangle . GetX ( ) , currentYPosition . CurrentYPosition - blockElementHeight , htmlRectangle . GetWidth ( ) ) ;
985980 document . Add ( p ) ;
986981 }
987- else if ( table != null )
982+ else if ( blockElement is Table table )
988983 {
989984 table . SetFixedPosition ( this . getPage ( ) , htmlRectangle . GetX ( ) , currentYPosition . CurrentYPosition - blockElementHeight , htmlRectangle . GetWidth ( ) ) ;
990985 document . Add ( table ) ;
991986 }
992- else if ( list != null )
987+ else if ( blockElement is List list )
993988 {
994989 list . SetFixedPosition ( this . getPage ( ) , htmlRectangle . GetX ( ) , currentYPosition . CurrentYPosition - blockElementHeight , htmlRectangle . GetWidth ( ) ) ;
995990 document . Add ( list ) ;
996991 }
997- else if ( anchor != null )
992+ else if ( blockElement is Link anchor )
998993 {
999994 anchor . SetFixedPosition ( this . getPage ( ) , htmlRectangle . GetX ( ) , currentYPosition . CurrentYPosition - blockElementHeight , htmlRectangle . GetWidth ( ) ) ;
1000995 document . Add ( ( IBlockElement ) anchor ) ;
1001996 }
1002- else if ( image != null )
997+ else if ( blockElement is Image image )
1003998 {
1004999 image . SetFixedPosition ( this . getPage ( ) , htmlRectangle . GetX ( ) , currentYPosition . CurrentYPosition - blockElementHeight , htmlRectangle . GetWidth ( ) ) ;
10051000 document . Add ( image ) ;
0 commit comments