diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-03 08:49:15 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-03 08:49:15 +0000 |
commit | f4590502bfd72e1c3ab4e760b43a6b671465cf0c (patch) | |
tree | 4077618480940296b009a245c3c1fe58c1586720 /reportdesign | |
parent | d34f9955f7bcc7a37a0ebad53d082d8e30ebcbe5 (diff) |
INTEGRATION: CWS rpt23fix02 (1.2.4); FILE MERGED
2007/07/24 17:19:27 tmorgner 1.2.4.1: Issue number: #78502, #77039
The formatted-text-layout controller did not look for the correct node,
and therefore never found the expected 'office:value-type' attribute.
This now fixes the #78502 bug, and possibly addresses the #77039 bug as
well (although this bug might be connected to a writer-bug).
Fixed the repositories so that the StorageRepository does no longer log
exceptions whenever we test for an non-existing file. We expect the
exception and can safely swallow it here.
The FileRepository now maintains its own manifest for all files that
are written. This class is needed for all test-runs outside of OpenOffice.
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/java/com/sun/star/report/StorageRepository.java | 6 | ||||
-rw-r--r-- | reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java | 44 |
2 files changed, 9 insertions, 41 deletions
diff --git a/reportdesign/java/com/sun/star/report/StorageRepository.java b/reportdesign/java/com/sun/star/report/StorageRepository.java index 9764a9f37fa1..9e41f4bce9df 100644 --- a/reportdesign/java/com/sun/star/report/StorageRepository.java +++ b/reportdesign/java/com/sun/star/report/StorageRepository.java @@ -4,9 +4,9 @@ * * $RCSfile: StorageRepository.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $ + * last change: $Author: hr $ $Date: 2007-08-03 09:48:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -113,7 +113,7 @@ public class StorageRepository implements InputRepository, OutputRepository { } catch (com.sun.star.lang.IllegalArgumentException ex) { ex.printStackTrace(); } catch (NoSuchElementException ex) { - ex.printStackTrace(); + // We expect this exception, no need to log it. } return false; } diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java index c3c7dbb1bea8..4f2d317ec9f4 100644 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java +++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java @@ -4,9 +4,9 @@ * * $RCSfile: FormattedTextLayoutController.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $ + * last change: $Author: hr $ $Date: 2007-08-03 09:49:15 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -64,43 +64,10 @@ import org.jfree.util.Log; public class FormattedTextLayoutController extends AbstractReportElementLayoutController { -// private Boolean inRepeatingSection; - public FormattedTextLayoutController() { } -// private boolean isInRepeatingSection () -// { -// if (inRepeatingSection == null) -// { -// LayoutController parent = getParent(); -// while (parent != null && inRepeatingSection == null) -// { -// if (parent instanceof OfficeRepeatingStructureLayoutController) -// { -// final OfficeRepeatingStructureLayoutController orslc = -// (OfficeRepeatingStructureLayoutController) parent; -// if (orslc.isNormalFlowProcessing()) -// { -// inRepeatingSection = Boolean.FALSE; -// } -// else -// { -// inRepeatingSection = Boolean.TRUE; -// } -// } -// parent = parent.getParent(); -// } -// -// if (inRepeatingSection == null) -// { -// inRepeatingSection = Boolean.FALSE; -// } -// } -// return inRepeatingSection.booleanValue(); -// } - private VariablesCollection getVariablesCollection() { LayoutController parent = getParent(); @@ -179,9 +146,9 @@ public class FormattedTextLayoutController LayoutController parent = getParent(); while (parent != null) { - if (parent instanceof ElementLayoutController) + if (parent instanceof TableCellLayoutController) { - final ElementLayoutController cellController = (ElementLayoutController) parent; + final TableCellLayoutController cellController = (TableCellLayoutController) parent; return cellController.getElement(); } parent = parent.getParent(); @@ -195,12 +162,13 @@ public class FormattedTextLayoutController if (tce == null) { // NO particular format means: Fallback to string and hope and pray .. - return "string"; + throw new IllegalStateException("A formatted text element must be a child of a Table-Cell."); } final String type = (String) tce.getAttribute(OfficeNamespaces.OFFICE_NS, "value-type"); if (type == null) { + Log.error ("The Table-Cell does not have a office:value attribute defined. Your content will be messed up."); return "string"; } return type; |