Index: java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
===================================================================
--- java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java (revision 267166)
+++ java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java (working copy)
@@ -75,6 +75,14 @@
/** constant for subscript */
public static final String ATTR_SUBSCRIPT = "sub";
+ /** RtfText attributes: paragraph shading attributes */
+ /** Constant for the shading of the paragraph */
+ public static final String SHADING = "shading";
+ /** Constant for the document's color tableshading of the paragraph */
+ public static final String SHADING_FRONT_COLOR = "cfpat";
+ /** Constant for the 100% shading of the paragraph */
+ public static final int FULL_SHADING = 10000;
+
/** RtfText attributes: alignment attributes */
/** constant for align center */
public static final String ALIGN_CENTER = "qc";
Index: java/org/apache/fop/render/rtf/TextAttributesConverter.java
===================================================================
--- java/org/apache/fop/render/rtf/TextAttributesConverter.java (revision 267166)
+++ java/org/apache/fop/render/rtf/TextAttributesConverter.java (working copy)
@@ -65,7 +65,7 @@
attrFont(fobj.getCommonFont(), attrib);
attrFontColor(fobj.getColor(), attrib);
//attrTextDecoration(fobj.getTextDecoration(), attrib);
- attrBackgroundColor(fobj.getCommonBorderPaddingBackground(), attrib);
+ attrBlockBackgroundColor(fobj.getCommonBorderPaddingBackground(), attrib);
attrBlockMargin(fobj.getCommonMarginBlock(), attrib);
attrBlockTextAlign(fobj.getTextAlign(), attrib);
@@ -228,6 +228,19 @@
}
/**
+ * Reads background-color for block from bpb
and writes it to
+ * rtfAttr
.
+ */
+ private static void attrBlockBackgroundColor(
+ CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr) {
+ if (bpb.hasBackground()) {
+ rtfAttr.set(RtfText.SHADING, RtfText.FULL_SHADING);
+ rtfAttr.set(RtfText.SHADING_FRONT_COLOR,
+ convertFOPColorToRTF(bpb.backgroundColor));
+ }
+ }
+
+ /**
* Reads background-color from bl and writes it to rtfAttr.
*
* @param bl the Block object the properties are read from