User: kz      
Date: 2008-05-05 14:32:22+0000
Modified:
   dba/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java

Log:
 INTEGRATION: CWS dba30beta (1.6.6); FILE MERGED
 2008/04/22 10:30:28 oj 1.6.6.1: #i88503# merge changes from rptchart02

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.6&r2=1.7
Delta lines:  +463 -482
-----------------------
--- StyleUtilities.java 2008-04-10 17:36:23+0000        1.6
+++ StyleUtilities.java 2008-05-05 14:32:15+0000        1.7
@@ -27,8 +27,6 @@
  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
-
-
 package com.sun.star.report.pentaho.output;
 
 import java.util.HashSet;
@@ -40,6 +38,7 @@
 import com.sun.star.report.pentaho.model.OfficeStyle;
 import com.sun.star.report.pentaho.model.OfficeStyles;
 import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import java.util.Set;
 import org.jfree.report.ReportProcessingException;
 import org.jfree.report.structure.Element;
 import org.jfree.report.util.AttributeNameGenerator;
@@ -53,6 +52,7 @@
  */
 public class StyleUtilities
 {
+
     private static final String STYLE = "style";
 
   private StyleUtilities()
@@ -105,7 +105,7 @@
                                 final OfficeStylesCollection stylesCollection,
                                 final OfficeStylesCollection commonCollection,
                                 final OfficeStylesCollection predefCollection,
-                                final HashSet inheritanceTracker)
+            final Set inheritanceTracker)
       throws ReportProcessingException
   {
     if (inheritanceTracker.contains(styleName))
@@ -165,7 +165,7 @@
       final OfficeStylesCollection commonCollection,
       final OfficeStylesCollection predefCollection,
       final String styleFamily,
-      final HashSet inheritanceTracker)
+            final Set inheritanceTracker)
       throws ReportProcessingException
   {
     try
@@ -193,14 +193,11 @@
     }
     catch (CloneNotSupportedException e)
     {
-      throw new ReportProcessingException
-          ("Failed to derive a stylesheet", e);
+            throw new ReportProcessingException("Failed to derive a 
stylesheet", e);
     }
   }
 
-
-  private static void performFontFaceProcessing
-      (final OfficeStyle style,
+    private static void performFontFaceProcessing(final OfficeStyle style,
        final OfficeStylesCollection stylesCollection,
        final OfficeStylesCollection predefCollection)
       throws ReportProcessingException
@@ -216,11 +213,8 @@
       final FontFaceDeclsSection currentFonts = 
stylesCollection.getFontFaceDecls();
       final FontFaceDeclsSection predefFonts = 
predefCollection.getFontFaceDecls();
 
-      final String fontName = (String)
-          textProperties.getAttribute(OfficeNamespaces.STYLE_NS, "font-name");
-      if (fontName != null)
-      {
-        if (currentFonts.containsFont(fontName) == false)
+            final String fontName = (String) 
textProperties.getAttribute(OfficeNamespaces.STYLE_NS, "font-name");
+            if (fontName != null && !currentFonts.containsFont(fontName))
         {
           final FontFaceElement element = predefFonts.getFontFace(fontName);
           if (element != null)
@@ -228,14 +222,10 @@
             currentFonts.addFontFace((FontFaceElement) element.clone());
           }
         }
-      }
 
-      final String fontNameAsian = (String)
-          textProperties.getAttribute(OfficeNamespaces.STYLE_NS,
+            final String fontNameAsian = (String) 
textProperties.getAttribute(OfficeNamespaces.STYLE_NS,
               "font-name-asian");
-      if (fontNameAsian != null)
-      {
-        if (currentFonts.containsFont(fontNameAsian) == false)
+            if (fontNameAsian != null && 
!currentFonts.containsFont(fontNameAsian))
         {
           final FontFaceElement element = predefFonts.getFontFace(
               fontNameAsian);
@@ -244,14 +234,10 @@
             currentFonts.addFontFace((FontFaceElement) element.clone());
           }
         }
-      }
 
-      final String fontNameComplex = (String)
-          textProperties.getAttribute(OfficeNamespaces.STYLE_NS,
+            final String fontNameComplex = (String) 
textProperties.getAttribute(OfficeNamespaces.STYLE_NS,
               "font-name-complex");
-      if (fontNameComplex != null)
-      {
-        if (currentFonts.containsFont(fontNameComplex) == false)
+            if (fontNameComplex != null && 
!currentFonts.containsFont(fontNameComplex))
         {
           final FontFaceElement element = predefFonts.getFontFace(
               fontNameComplex);
@@ -261,15 +247,13 @@
           }
         }
       }
-    }
     catch (CloneNotSupportedException e)
     {
       throw new ReportProcessingException("Failed to clone font-face element");
     }
   }
 
-  private static void performDataStyleProcessing
-      (final OfficeStyle style,
+    private static void performDataStyleProcessing(final OfficeStyle style,
        final OfficeStylesCollection stylesCollection,
        final OfficeStylesCollection predefCollection)
       throws ReportProcessingException
@@ -464,7 +448,7 @@
 
     // now copy the common style ..
     final OfficeStyles commonStyles = commonCollection.getCommonStyles();
-    if (commonStyles.containsStyle(styleFamily, styleName) == false)
+        if (!commonStyles.containsStyle(styleFamily, styleName) )
     {
       copyStyleInternal(commonStyle, commonStyles,
           commonCollection, commonCollection, predefCollection,
@@ -487,8 +471,7 @@
       autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
       autostyle.setType(STYLE);
       autostyle.setStyleFamily(styleFamily);
-      autostyle.setStyleName
-          (nameGenerator.generateName("derived_auto_" + styleName));
+            autostyle.setStyleName(nameGenerator.generateName("derived_auto_" 
+ styleName));
 
 
       final String parent = autostyle.getStyleParent();
@@ -506,7 +489,7 @@
     }
   }
 
-  public static String queryStyle (final OfficeStylesCollection 
predefCollection,
+    public static String queryStyle(final OfficeStylesCollection 
predefCollection,
                                    final String styleFamily,
                                    final String styleName,
                                    final String sectionName,
@@ -517,13 +500,13 @@
         styleName, sectionName, propertyNamespace, propertyName, new 
HashSet());
   }
 
-  private static String queryStyle (final OfficeStylesCollection 
predefCollection,
+    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)
+            final Set seenStyles)
   {
     if (seenStyles.contains(styleName))
     {
@@ -552,6 +535,4 @@
     }
     return queryStyle(predefCollection, styleFamily, parent, sectionName, 
propertyNamespace, propertyName, seenStyles);
   }
-
-
 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to