Nested Indent mismatch

Bug #1731285 reported by Daniel Poirot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Tavmjong Bah

Bug Description

Synopsys Coverity static analysis reports an error in the following file:
  src/libnrtype/Layout-TNG-OutIter.cpp

Please add braces around lines 613 and 614 or change the indent on 614.

Thank you,
- dan

608 if (input_item->Type() == TEXT_SOURCE) {
609 SPStyle const *style = static_cast<InputStreamTextSource*>(input_item)->style;
610 if (_characters[char_index].char_attributes.is_white)
611 dx -= style->word_spacing.computed * getTextLengthMultiplierDue();
    parent: This 'if' statement is the parent, indented to column 17.
612 if (_characters[char_index].char_attributes.is_cursor_position)
    nephew: This statement is nested within its parent, indented to column 21.
613 dx -= style->letter_spacing.computed * getTextLengthMultiplierDue();

CID 10529 (#1 of 1): Nesting level does not match indentation (NESTING_INDENT_MISMATCH)
uncle: This statement is indented to column 21, as if it were nested within the preceding parent statement, but it is not.
614 dx -= getTextLengthIncrementDue();
615 }

Revision history for this message
Mc (mc...) wrote :

Thanks for the report !

Traced back to https://gitlab.com/inkscape/inkscape/commit/374aa610cb550cf7dcd283ca93ad0ad844732d32#5d4166a7de3e77e6dd62fc48083ff68bd0493048_601_611

Tav: Assigning to you since you probably know that code best, but if you don't have time, feel free to unasssign :)

Changed in inkscape:
assignee: nobody → Tavmjong Bah (tavmjong-free)
Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

My guess is the line should not be indented. I'll need to test.

This function is used to convert SVG 1.2 text into SVG 1.1 text. The line in question only matters if 'textAdjust' is set to 'spacing' and 'textLength' is set. This is quite unlikely for SVG 1.2 text.

I'm not sure how well this section of code works when whitespace is preserved or with mandatory ligatures.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.