User: hr Date: 2007-08-03 09:51:01+0000 Modified: dba/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java
Log: INTEGRATION: CWS rpt23fix02 (1.2.4); FILE MERGED 2007/07/26 14:10:49 tmorgner 1.2.4.1: Issue number: 77494 The engine now creates a derived style if the section-table has a defined background that is not transparent. However, if the row has an own background that is not transparent, then the row's defined background will be preserved. File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/ ===================================================================== File [changed]: StyleUtilities.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java?r1=1.2&r2=1.3 Delta lines: +52 -3 -------------------- --- StyleUtilities.java 2007-07-09 11:56:07+0000 1.2 +++ StyleUtilities.java 2007-08-03 09:50:59+0000 1.3 @@ -510,4 +510,53 @@ "Deriving the style failed. Clone error: ", e); } } + + public static String queryStyle (final OfficeStylesCollection predefCollection, + final String styleFamily, + final String styleName, + final String sectionName, + final String propertyNamespace, + final String propertyName) + { + return queryStyle(predefCollection, styleFamily, + styleName, sectionName, propertyNamespace, propertyName, new HashSet()); + } + + private static String queryStyle (final OfficeStylesCollection predefCollection, + final String styleFamily, + final String styleName, + final String sectionName, + final String propertyNamespace, + final String propertyName, + final HashSet seenStyles) + { + if (seenStyles.contains(styleName)) + { + return null; + } + seenStyles.add(styleName); + + final OfficeStyle style = predefCollection.getStyle(styleFamily, styleName); + if (style == null) + { + return null; // no such style + } + final Element section = style.findFirstChild(OfficeNamespaces.STYLE_NS, sectionName); + if (section != null) + { + final Object attribute = section.getAttribute(propertyNamespace, propertyName); + if (attribute != null) + { + return String.valueOf(attribute); + } + } + final String parent = style.getStyleParent(); + if (parent == null) + { + return null; + } + return queryStyle(predefCollection, styleFamily, parent, sectionName, propertyNamespace, propertyName, seenStyles); + } + + } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
