1. Coin3D
  2. Coin

Commits

Roy Walmsley  committed 3690cea Merge

Merged in TheHubbit/coin/issue66 (pull request #13)

SoAsciiText fails with empty (default) string

  • Participants
  • Parent commits ad4f070, f7327fa
  • Branches default

Comments (0)

Files changed (2)

File src/shapenodes/SoAsciiText.cpp

View file
     cc_glyph3d * prevglyph = NULL;
     const char * p = str.getString();
     size_t length = cc_string_utf8_validate_length(p);
-    assert(length);
+    // No assertion as zero length is handled correctly (results in a new line)
 
     for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {
       uint32_t glyphidx = 0;
       SbString str = this->string[i];
       const char * p = str.getString();
       size_t length = cc_string_utf8_validate_length(p);
-      assert(length);
+      // No assertion as zero length is handled correctly (results in a new line)
 
       for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {
 	uint32_t glyphidx = 0;
   SbString str = master->string[i];
   const char * p = str.getString();
   size_t length = cc_string_utf8_validate_length(p);
-  assert(length);
+  // No assertion as zero length is handled correctly (results in a new line)
 
   for (strcharidx = 0; strcharidx < length; strcharidx++) {
     uint32_t glyphidx = 0;
     cc_glyph3d * prevglyph = NULL;
     const char * p = str.getString();
     size_t length = cc_string_utf8_validate_length(p);
-    assert(length);
+    // No assertion as zero length is handled correctly (results in a new line)
       
     for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {      
       uint32_t glyphidx = 0;
     const float * maxbbox;
     const char * p = str.getString();
     size_t length = cc_string_utf8_validate_length(p);
-    assert(length);
+    // No assertion as zero length is handled correctly (results in a new line)
 
     for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {
       uint32_t glyphidx = 0;

File src/shapenodes/SoText3.cpp

View file
     cc_glyph3d * prevglyph = NULL;
     const char * p = str.getString();
     size_t length = cc_string_utf8_validate_length(p);
-    assert(length);
+    // No assertion as zero length is handled correctly (results in a new line)
 
     for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {
       uint32_t glyphidx = 0;
     cc_glyph3d * prevglyph = NULL;
     const char * p = str.getString();
     size_t length = cc_string_utf8_validate_length(p);
-    assert(length);
+    // No assertion as zero length is handled correctly (results in a new line)
 
     for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {
       uint32_t glyphidx = 0;
     SbString str = textnode->string[i];
     const char * p = str.getString();
     size_t length = cc_string_utf8_validate_length(p);
-    assert(length);
+    // No assertion as zero length is handled correctly (results in a new line)
 
     for (unsigned int strcharidx = 0; strcharidx < length; strcharidx++) {
       uint32_t glyphidx = 0;