User: rt      
Date: 2008-06-16 13:14:09+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java

Log:
 INTEGRATION: CWS rptchart02 (1.5.4); FILE MERGED
 2008/05/27 08:06:15 oj 1.5.4.5: #i77610# handle keep-with-next and 
may-break-between-rows and keep-together
 2008/04/16 06:23:32 oj 1.5.4.4: RESYNC: (1.5-1.6); FILE MERGED
 2008/04/04 13:06:01 oj 1.5.4.3: enable chart
 2008/04/03 11:59:20 oj 1.5.4.2: export frames of ole object with special style
 2008/03/12 09:42:51 oj 1.5.4.1: impl chart handling and some code refactoring

File Changes:

Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/
=====================================================================

File [changed]: OfficeDocumentReportTarget.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java?r1=1.7&r2=1.8
Delta lines:  +31 -33
---------------------
--- OfficeDocumentReportTarget.java     2008-05-05 14:30:03+0000        1.7
+++ OfficeDocumentReportTarget.java     2008-06-16 13:14:07+0000        1.8
@@ -100,8 +100,8 @@
  */
 public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
 {
-    public static final String HORIZONTAL_POS = "horizontal-pos";
 
+    public static final String HORIZONTAL_POS = "horizontal-pos";
     public static final String TAG_DEF_PREFIX = 
"com.sun.star.report.pentaho.output.";
     public static final int ROLE_NONE = 0;
     public static final int ROLE_REPORT_HEADER = 1;
@@ -117,7 +117,6 @@
     public static final int ROLE_TEMPLATE = 11;
     public static final int ROLE_SPREADSHEET_PAGE_HEADER = 12;
     public static final int ROLE_SPREADSHEET_PAGE_FOOTER = 13;
-    
     public static final int STATE_IN_DOCUMENT = 0;
     public static final int STATE_IN_BODY = 1;
     public static final int STATE_IN_CONTENT = 2;
@@ -130,7 +129,6 @@
     public static final String VERTICAL_POS = "vertical-pos";
     private static final String ZERO_CM = "0cm";
     
-
     protected static class BufferState
     {
 
@@ -379,22 +377,24 @@
             predefinedStylesCollection = reportDoc.getStylesCollection();
 
             final OfficeStyles commonStyles = 
predefinedStylesCollection.getCommonStyles();
-            if 
(!commonStyles.containsStyle(OfficeToken.GRAPHIC,OfficeToken.GRAPHICS))
+            if (!commonStyles.containsStyle(OfficeToken.GRAPHIC, 
OfficeToken.GRAPHICS))
             {
                 final OfficeStyle graphicsDefaultStyle = new OfficeStyle();
                 graphicsDefaultStyle.setStyleFamily(OfficeToken.GRAPHIC);
                 graphicsDefaultStyle.setStyleName(OfficeToken.GRAPHICS);
-                final Element graphicProperties = 
produceFirstChild(graphicsDefaultStyle, 
OfficeNamespaces.STYLE_NS,OfficeToken.GRAPHIC_PROPERTIES);
-                graphicProperties.setAttribute(OfficeNamespaces.TEXT_NS, 
"anchor-type",OfficeToken.PARAGRAPH);
-                graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, 
"x",ZERO_CM);
-                graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, 
"y",ZERO_CM);
+                final Element graphicProperties = 
produceFirstChild(graphicsDefaultStyle, OfficeNamespaces.STYLE_NS, 
OfficeToken.GRAPHIC_PROPERTIES);
+                graphicProperties.setAttribute(OfficeNamespaces.TEXT_NS, 
"anchor-type", OfficeToken.PARAGRAPH);
+                graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "x", 
ZERO_CM);
+                graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "y", 
ZERO_CM);
                 graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"wrap", "dynamic");
                 graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"number-wrapped-paragraphs", "no-limit");
                 graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"wrap-contour", OfficeToken.FALSE);
                 graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
VERTICAL_POS, "from-top"); // changed for chart
-                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"vertical-rel",OfficeToken.PARAGRAPH);
-                
graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS,HORIZONTAL_POS, 
"from-left"); // changed for chart
-                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"horizontal-rel",OfficeToken.PARAGRAPH);
+
+                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"vertical-rel", OfficeToken.PARAGRAPH);
+                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
HORIZONTAL_POS, "from-left"); // changed for chart
+
+                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, 
"horizontal-rel", OfficeToken.PARAGRAPH);
                 commonStyles.addStyle(graphicsDefaultStyle);
             }
 
@@ -408,7 +408,7 @@
         }
         catch (IOException e)
         {
-            throw new ReportProcessingException( FAILED,e);
+            throw new ReportProcessingException(FAILED, e);
         }
     }
 
@@ -813,7 +813,6 @@
     protected void startGroupInstance(final AttributeMap attrs)
             throws IOException, DataSourceException, ReportProcessingException
     {
-
     }
 
     protected void startGroupBody(final AttributeMap attrs)
@@ -844,7 +843,7 @@
         }
         catch (IOException e)
         {
-            throw new ReportProcessingException( FAILED,e);
+            throw new ReportProcessingException(FAILED, e);
         }
     }
 
@@ -907,7 +906,7 @@
         }
         catch (IOException e)
         {
-            throw new ReportProcessingException( FAILED,e);
+            throw new ReportProcessingException(FAILED, e);
         }
     }
 
@@ -988,13 +987,11 @@
     protected void endGroupBody(final AttributeMap attrs)
             throws IOException, DataSourceException, ReportProcessingException
     {
-
     }
 
     protected void endGroupInstance(final AttributeMap attrs)
             throws IOException, DataSourceException, ReportProcessingException
     {
-
     }
 
     public int getCurrentRole()
@@ -1058,7 +1055,7 @@
         }
         catch (IOException e)
         {
-            throw new ReportProcessingException( FAILED,e);
+            throw new ReportProcessingException(FAILED, e);
         }
     }
 
@@ -1264,6 +1261,7 @@
 
             // When scaling, we have to create an image-style.
             final CSSNumericValue width = image.getWidth(); // always in 100th 
of a mm
+
             final CSSNumericValue height = image.getHeight(); // always in 
100th of a mm
 
             Log.debug("Image " + imageData + " Width: " + width + ", Height: " 
+ height);
@@ -1300,8 +1298,8 @@
                         final double clipHeight = 
normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
                         if (clipWidth > 0 && clipHeight > 0)
                         {
-                            final OfficeStyle imageStyle = 
deriveStyle(OfficeToken.GRAPHIC,OfficeToken.GRAPHICS);
-                            final Element graphProperties = 
produceFirstChild(imageStyle, 
OfficeNamespaces.STYLE_NS,OfficeToken.GRAPHIC_PROPERTIES);
+                            final OfficeStyle imageStyle = 
deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
+                            final Element graphProperties = 
produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, 
OfficeToken.GRAPHIC_PROPERTIES);
                             final StringBuffer buffer = new StringBuffer();
                             buffer.append("rect(");
                             buffer.append(clipHeight / 2);
@@ -1323,8 +1321,8 @@
                         }
                         else if (clipWidth > 0)
                         {
-                            final OfficeStyle imageStyle = 
deriveStyle(OfficeToken.GRAPHIC,OfficeToken.GRAPHICS);
-                            final Element graphProperties = 
produceFirstChild(imageStyle, 
OfficeNamespaces.STYLE_NS,OfficeToken.GRAPHIC_PROPERTIES);
+                            final OfficeStyle imageStyle = 
deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
+                            final Element graphProperties = 
produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, 
OfficeToken.GRAPHIC_PROPERTIES);
                             final StringBuffer buffer = new StringBuffer();
                             buffer.append("rect(0cm ");
                             buffer.append(clipWidth / 2);
@@ -1341,8 +1339,8 @@
                         }
                         else if (clipHeight > 0)
                         {
-                            final OfficeStyle imageStyle = 
deriveStyle(OfficeToken.GRAPHIC,OfficeToken.GRAPHICS);
-                            final Element graphProperties = 
produceFirstChild(imageStyle, 
OfficeNamespaces.STYLE_NS,OfficeToken.GRAPHIC_PROPERTIES);
+                            final OfficeStyle imageStyle = 
deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
+                            final Element graphProperties = 
produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, 
OfficeToken.GRAPHIC_PROPERTIES);
                             final StringBuffer buffer = new StringBuffer();
                             buffer.append("rect(");
                             buffer.append(clipHeight / 2);
@@ -1381,10 +1379,10 @@
             {
                 frameList.setAttribute(OfficeNamespaces.DRAWING_NS, 
OfficeToken.STYLE_NAME, styleName);
             }
-            frameList.setAttribute(OfficeNamespaces.TEXT_NS, 
"anchor-type",OfficeToken.PARAGRAPH);
+            frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", 
OfficeToken.PARAGRAPH);
             frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0");
-            frameList.setAttribute(OfficeNamespaces.SVG_NS, "x",ZERO_CM);
-            frameList.setAttribute(OfficeNamespaces.SVG_NS, "y",ZERO_CM);
+            frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", ZERO_CM);
+            frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", ZERO_CM);
 
             Log.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal 
+ ", A-Height: " + imageAreaHeightVal);
 
@@ -1416,7 +1414,7 @@
             }
             catch (IOException ioe)
             {
-                throw new ReportProcessingException( FAILED,ioe);
+                throw new ReportProcessingException(FAILED, ioe);
             }
         }
     }
@@ -1623,7 +1621,7 @@
         }
         catch (IOException ioe)
         {
-            throw new ReportProcessingException( FAILED,ioe);
+            throw new ReportProcessingException(FAILED, ioe);
         }
 
 




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

Reply via email to