From 80c399f1cb15965ea49ab56a1f7b48715c7ffbf5 Mon Sep 17 00:00:00 2001 From: cyreve Date: Mon, 27 Nov 2006 00:01:19 +0000 Subject: [PATCH] bug 1598337 / patch 1603279 by atwupack: crash deleting invisible layers --- src/libnrtype/Layout-TNG-Compute.cpp | 2 +- src/libnrtype/Layout-TNG-Input.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index c6d18a469..fc69ef4c7 100755 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -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; } diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp index 295b062a2..499f67a7b 100755 --- a/src/libnrtype/Layout-TNG-Input.cpp +++ b/src/libnrtype/Layout-TNG-Input.cpp @@ -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; } -- 2.30.2