Code

bug 1598337 / patch 1603279 by atwupack: crash deleting invisible layers
authorcyreve <cyreve@users.sourceforge.net>
Mon, 27 Nov 2006 00:01:19 +0000 (00:01 +0000)
committercyreve <cyreve@users.sourceforge.net>
Mon, 27 Nov 2006 00:01:19 +0000 (00:01 +0000)
src/libnrtype/Layout-TNG-Compute.cpp
src/libnrtype/Layout-TNG-Input.cpp

index c6d18a469f765dafb85fc993fd3f51ad91acd58c..fc69ef4c7523f256b1074ba9c85734aa91a47375 100755 (executable)
@@ -927,7 +927,7 @@ void Layout::Calculator::_computeFontLineHeight(font_instance *font, double font
             }
             break;
         }
-        if (style->object->parent == NULL) break;
+        if (style->object == NULL || style->object->parent == NULL) break;
         style = style->object->parent->style;
         if (style == NULL) break;
     }
index 295b062a2863b5580b2e5cff0a9cb7d92fbe6526..499f67a7b8993c1318b38fd9b1dced6b20ec37a9 100755 (executable)
@@ -140,7 +140,7 @@ float Layout::InputStreamTextSource::styleComputeFontSize() const
                 }
             }
         }
-        if (this_style->object->parent == NULL) break;
+        if (this_style->object == NULL || this_style->object->parent == NULL) break;
         this_style = this_style->object->parent->style;
         if (this_style == NULL) break;
     }
@@ -169,7 +169,7 @@ Layout::Direction Layout::InputStreamTextSource::styleGetBlockProgression() cons
             return (Layout::Direction)_enum_converter(this_style->block_progression.computed, enum_convert_spstyle_block_progression_to_direction, sizeof(enum_convert_spstyle_block_progression_to_direction)/sizeof(enum_convert_spstyle_block_progression_to_direction[0]));
         if (this_style->writing_mode.set)
             return (Layout::Direction)_enum_converter(this_style->writing_mode.computed, enum_convert_spstyle_writing_mode_to_direction, sizeof(enum_convert_spstyle_writing_mode_to_direction)/sizeof(enum_convert_spstyle_writing_mode_to_direction[0]));
-        if (this_style->object->parent == NULL) break;
+        if (this_style->object == NULL || this_style->object->parent == NULL) break;
         this_style = this_style->object->parent->style;
         if (this_style == NULL) break;
     }
@@ -213,7 +213,7 @@ Layout::Alignment Layout::InputStreamTextSource::styleGetAlignment(Layout::Direc
         }
         if (this_style->text_anchor.set)
             return text_anchor_to_alignment(this_style->text_anchor.computed, para_direction);
-        if (this_style->object->parent == NULL) break;
+        if (this_style->object == NULL || this_style->object->parent == NULL) break;
         this_style = this_style->object->parent->style;
         if (this_style == NULL) break;
     }