User: kz      
Date: 2008-05-05 15:04:02+0000
Modified:
   
dba/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java

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

File Changes:

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

File [changed]: DocumentContentReadHandler.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java?r1=1.3&r2=1.4
Delta lines:  +172 -181
-----------------------
--- DocumentContentReadHandler.java     2008-04-10 17:45:42+0000        1.3
+++ DocumentContentReadHandler.java     2008-05-05 15:04:00+0000        1.4
@@ -27,8 +27,6 @@
  * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
-
-
 package com.sun.star.report.pentaho.parser.office;
 
 import com.sun.star.report.pentaho.OfficeNamespaces;
@@ -57,6 +55,7 @@
  */
 public class DocumentContentReadHandler extends AbstractXmlReadHandler
 {
+
   private OfficeDocument report;
   private FontFaceDeclsReadHandler fontFaceReadHandler;
   private BodyReadHandler bodyReadHandler;
@@ -87,7 +86,7 @@
     this.officeStylesCollection = parseStylesXml();
   }
 
-  private OfficeStylesCollection parseStylesXml ()
+    private OfficeStylesCollection parseStylesXml()
   {
     final ResourceKey contextKey = getRootHandler().getContext();
     final ResourceManager resourceManager = 
getRootHandler().getResourceManager();
@@ -121,13 +120,8 @@
 
   private OfficeDocument parseContentXml()
   {
-    if (OfficeNamespaces.OFFICE_NS.equals(getUri()) == false)
-    {
-      return new OfficeDocument();
-    }
-
     // Check whether this is a content.xml.
-    if ("document-content".equals(getTagName()) != false)
+        if (!OfficeNamespaces.OFFICE_NS.equals(getUri()) || 
"document-content".equals(getTagName()))
     {
       return new OfficeDocument();
     }
@@ -141,10 +135,10 @@
           resourceManager.deriveKey(contextKey, "content.xml");
       final Resource resource =
           resourceManager.create(key, contextKey, JFreeReport.class);
-      final OfficeDocument report = (OfficeDocument) resource.getResource();
-      if (report != null)
+            final OfficeDocument doc = (OfficeDocument) resource.getResource();
+            if (doc != null)
       {
-        return report;
+                return doc;
       }
     }
     catch (ResourceKeyCreationException e)
@@ -175,17 +169,13 @@
                                               final Attributes atts)
       throws SAXException
   {
-    if (!OfficeNamespaces.OFFICE_NS.equals(uri))
+        if (OfficeNamespaces.OFFICE_NS.equals(uri))
     {
-      return null;
-    }
-
     if ("font-face-decls".equals(tagName))
     {
       if (fontFaceReadHandler == null)
       {
-        fontFaceReadHandler = new FontFaceDeclsReadHandler
-            (officeStylesCollection.getFontFaceDecls());
+                    fontFaceReadHandler = new 
FontFaceDeclsReadHandler(officeStylesCollection.getFontFaceDecls());
       }
       return fontFaceReadHandler;
     }
@@ -206,6 +196,7 @@
       bodyReadHandler = new BodyReadHandler();
       return bodyReadHandler;
     }
+        }
     return null;
   }
 




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

Reply via email to