Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-5506

Messy ouput because QSvgHandler ignores whitespaceMode hierarchy

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • 4.6.0
    • 4.5.2
    • SVG Support
    • None

      t4id: 261603

      When trying to paint an CorelDraw generated vaild SVG image with QSvg the leading whitespaces of text-Items are skipped even xml:space="preserve" is globallly set in the svg-tag.

      svg sample:
      <svg xml:space="preserve" ...>
      ...
      <text x="23.0529" y="150.829" class="fil3 fnt7"> in my house</text>
      ...
      </svg>

      My suggestion is to change the code in qsvghandler.cpp at line 3436 as follows:

      if(xmlSpace.isNull()) 
      { 
          // This element has no xml:space attribute. 
          // Inherit the whitespace-Mode from parent element if exists 
          if (m_whitespaceMode.isEmpty()) 
              m_whitespaceMode.push(QSvgText::Default); 
          else 
              m_whitespaceMode.push(m_whitespaceMode.top()); 
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sletta Gunnar Sletta
            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes