saving of borders.

Thorsten Zachmann t.zachmann at zagge.de
Tue Aug 30 04:42:57 BST 2011


Hello Pierre,

I'm just in the middle of finding out where we do save invalid odf. One place I 
found is:

    <style:page-layout style:name="pm1" style:page-usage="all">
      <style:page-layout-properties fo:border="0pt none #000000" 
fo:margin="0.000000000000000pt" fo:padding="0.000000000000000pt" fo:page-
height="595.276621799999930pt" fo:page-width="793.702162400000020pt" 
style:diagonal-bl-tr="0pt none #000000" style:diagonal-tl-br="0pt none 
#000000" style:print-orientation="landscape"/>
    </style:page-layout>

this gives the following errors:

error: attribute "diagonal-bl-tr" from namespace 
"urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed at this point; 
ignored
error: attribute "diagonal-tl-br" from namespace 
"urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed at this point; 
ignored

In commit a96abb898f508a49164b92fe028f5c59fbf23e81 you commented out the check 
if the border should be painted or not. Is it possible to remove the comments 
again or will that break stuff like e.g. inheriting of styles which have 
different borders and thus need to be unset. 

If so we need to find a way to not write out the stuff in places where it is not 
supported. Two ideas come to my mind:

1. split the methog of saving in two where one only saves the parts everywhere 
supported. 
2. add a flag for saving to not save unset stuff.

Thorsten


    // Check if we can save all borders in one fo:border attribute, or                                                                                                                        
    // if we have to use several different ones like fo:border-left, etc.                                                                                                                     
    if (leftBorderString == rightBorderString                                                                                                                                                 
        && leftBorderString == topBorderString                                                                                                                                                
        && leftBorderString == bottomBorderString) {                                                                                                                                          
                                                                                                                                                                                              
        // Yes, they were all the same, so use only fo:border                                                                                                                                 
        style.addProperty("fo:border", leftBorderString, type);                                                                                                                               
    } else {                                                                                                                                                                                  
        // No, they were different, so use the individual borders.                                                                                                                            
        //if (leftBorderStyle() != BorderNone)                                                                                                                                                
            style.addProperty("fo:border-left", leftBorderString, type);                                                                                                                      
        //if (rightBorderStyle() != BorderNone)                                                                                                                                               
            style.addProperty("fo:border-right", rightBorderString, type);                                                                                                                    
        //if (topBorderStyle() != BorderNone)                                                                                                                                                 
            style.addProperty("fo:border-top", topBorderString, type);                                                                                                                        
        //if (bottomBorderStyle() != BorderNone)                                                                                                                                              
            style.addProperty("fo:border-bottom", bottomBorderString, type);                                                                                                                  
    }                                                                                                                                                                                         
                                                                                                                                                                                              
    //if (tlbrBorderStyle() != BorderNone) {                                                                                                                                                  
        style.addProperty("style:diagonal-tl-br", tlbrBorderString, type);                                                                                                                    
    //}                                                                                                                                                                                       
    //if (trblBorderStyle() != BorderNone) {                                                                                                                                                  
        style.addProperty("style:diagonal-bl-tr", trblBorderString, type);                                                                                                                    
    //} 



More information about the calligra-devel mailing list