You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2008/02/17 09:08:01 UTC
svn commit: r628440 - in /maven/doxia/doxia/trunk:
doxia-core/src/test/java/org/apache/maven/doxia/sink/
doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/
doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/mo...
Author: ltheussl
Date: Sun Feb 17 00:07:58 2008
New Revision: 628440
URL: http://svn.apache.org/viewvc?rev=628440&view=rev
Log:
Unify figure handling: figure source must specify file extension
Added:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/test/resources/images/figure.png
- copied unchanged from r628246, maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/test/resources/images/figure
Removed:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/test/resources/images/figure
Modified:
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java?rev=628440&r1=628439&r2=628440&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java Sun Feb 17 00:07:58 2008
@@ -290,7 +290,7 @@
{
sink.figure();
- sink.figureGraphics( "figure" );
+ sink.figureGraphics( "figure.png" );
sink.figureCaption();
sink.text( "Figure caption" );
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java?rev=628440&r1=628439&r2=628440&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java Sun Feb 17 00:07:58 2008
@@ -89,16 +89,6 @@
setNameSpace( "fo" );
}
- /**
- * Returns the configuration object of this sink.
- *
- * @return The configuration object of this sink.
- */
- public FoConfiguration getFoConfiguration()
- {
- return config;
- }
-
// TODO add FOP compliance mode?
/** {@inheritDoc} */
@@ -532,8 +522,7 @@
/** {@inheritDoc} */
public void figureGraphics( String s )
{
- // TODO: figure out file extension.
- writeln( " src=\"" + s + ".png\"/>" );
+ writeln( " src=\"" + s + "\"/>" );
}
/** {@inheritDoc} */
@@ -963,6 +952,16 @@
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
+
+ /**
+ * Returns the configuration object of this sink.
+ *
+ * @return The configuration object of this sink.
+ */
+ protected FoConfiguration getFoConfiguration()
+ {
+ return config;
+ }
/**
* Writes a start tag, prepending EOL.
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java?rev=628440&r1=628439&r2=628440&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java Sun Feb 17 00:07:58 2008
@@ -271,7 +271,7 @@
String dtAtts = getConfig().getAttributeString( "figure.graphics" );
String ddAtts = getConfig().getAttributeString( "figure.caption" );
return "<fo:block" + dlAtts + "><fo:external-graphic" + dtAtts
- + " src=\"" + source + ".png" + "\"/><fo:block" + ddAtts
+ + " src=\"" + source + "\"/><fo:block" + ddAtts
+ ">" + caption + "</fo:block></fo:block>";
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java?rev=628440&r1=628439&r2=628440&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java Sun Feb 17 00:07:58 2008
@@ -975,12 +975,10 @@
public void figureGraphics( String name )
{
- /*
- * The name argument is a path name without file extension.
- */
- StringBuffer buf = new StringBuffer( name );
- buf.append( ".ppm" );
- name = buf.toString();
+ if ( !name.endsWith( ".ppm" ) )
+ {
+ getLog().warn( "Unsupported image type: " + name );
+ }
Paragraph paragraph = new Paragraph();
paragraph.justification = Parser.JUSTIFY_CENTER;