Skip to content
  • Jarosław Staniek's avatar
    Indentation of XML elements breaks spacing between odf text:spans (and possibly in other places). · 4fd9fcad
    Jarosław Staniek authored
    We definitely want to save the XML markup without any spacing or newlines (maybe except the first line). 
    If there are spaces or newlines, both kword and oo.o writer adds a visual 
    spacing between every text:span (i.e. each blocks that changes the text formatting).
    For example, in the rendering instead of having:
    
      Formatting test: italics, bold italics, underline, 
    
    We would have extra spaces:
    
      Formatting test: italics , bold italics , underline , 
                             ^^^^            ^^^         ^^
    
    Writing XML this way is loosy.
    
    Solution:
    In KoXmlWriter we assume that nobody would want to have zero indentation with line endings (i.e. indentLevel==0 in the ctor).
    So this value is considered as an indication that indentation is not added, and line endings are not present.
    This is default setting in the ctor, so in addition the fix already fixes ODF support in KOffice in a natural way.
    
    In writeIndent() we do nothing for the indentLevel==0 case, what is some kind of optimization, since the method is critical. 
    
    Also added condition that skips allocating unncessary memory for indentLevel==0.
    
    Added extra documentation for the ctor.
    
    
    svn path=/trunk/koffice/; revision=989984
    4fd9fcad