Revision: 12196
http://sourceforge.net/p/foray/code/12196
Author: victormote
Date: 2021-12-09 15:24:30 +0000 (Thu, 09 Dec 2021)
Log Message:
-----------
Allow text to be added to text-only objects (BookmarkTitle).
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoContainerTextOnly.java
Added: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoContainerTextOnly.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoContainerTextOnly.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoContainerTextOnly.java 2021-12-09 15:24:30 UTC (rev 12196)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2021 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree;
+
+/**
+ * Abstract superclass for formatting objects whose content model is {@code (#PCDATA)}.
+ */
+public abstract class FoContainerTextOnly extends FoObj {
+
+ /**
+ * Constructor.
+ * @param parent The parent FoObj.
+ */
+ public FoContainerTextOnly(final FoObj parent) {
+ super(parent);
+ }
+
+}
Property changes on: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoContainerTextOnly.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2021-12-09 14:38:53 UTC (rev 12195)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java 2021-12-09 15:24:30 UTC (rev 12196)
@@ -39,7 +39,6 @@
import org.axsl.fo.FoTreeException;
import org.axsl.fo.FoTreeListener;
import org.axsl.fo.FoTreeParser;
-import org.axsl.fo.fo.BookmarkTitle;
import org.axsl.orthography.OrthographyException;
import org.xml.sax.Attributes;
@@ -172,7 +171,7 @@
* after looking for non-whitespace content, which would indicate essentially a validation error. */
if (this.currentFObj instanceof FoContainerComplex
|| this.currentFObj instanceof FoContainerInline
- || this.currentFObj instanceof BookmarkTitle) {
+ || this.currentFObj instanceof FoContainerTextOnly) {
this.textBuffer.append(data, start, length);
} else {
for (int index = start; index < (start + length); index ++) {
@@ -200,6 +199,8 @@
}
} else if (this.currentFObj instanceof FoContainerInline) {
/* Allow the text to be added to the current FObj. */
+ } else if (this.currentFObj instanceof FoContainerTextOnly) {
+ /* Allow the text to be added to the current FObj. */
} else {
/* This FO does not contain text. */
return;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2021-12-09 14:38:53 UTC (rev 12195)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/BookmarkTitle4a.java 2021-12-09 15:24:30 UTC (rev 12196)
@@ -29,6 +29,7 @@
package org.foray.fotree.fo.obj;
import org.foray.common.WellKnownConstants;
+import org.foray.fotree.FoContainerTextOnly;
import org.foray.fotree.FoObj;
import org.foray.fotree.Namespace;
import org.foray.fotree.PropertyList;
@@ -47,7 +48,7 @@
/**
* A "bookmark-title" object in XSL-FO.
*/
-public class BookmarkTitle4a extends FoObj implements BookmarkTitle {
+public class BookmarkTitle4a extends FoContainerTextOnly implements BookmarkTitle {
/** The parent of this node. */
private FoObj parent;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|