Index: BindingHandler.java
===================================================================
--- BindingHandler.java (revision 1700)
+++ BindingHandler.java (working copy)
@@ -69,12 +69,14 @@
/**
* Configure, how the handler handles links found in Custom XML.
*
- * If set to null
, strings containing 'http://'
- * are not converted to w:hyperlink. This is the default behavior.
+ * If hyperlinkStyleId is set to null
, strings
+ * containing 'http://' or 'https://' are not converted to
+ * w:hyperlink. This is the default behavior.
*
- * If set to true
, strings containing 'http://'
- * are converted to w:hyperlink. If you do this, you will
- * need to post-process with RemovalHandler, since a
+ * If hyperlinkStyleId is set to "someWordHyperlinkStyleName"
,
+ * strings containing 'http://' or 'https://' are converted to w:hyperlink.
+ * The default Word hyperlink style name is "Hyperlink".
+ * If you do this, you will need to post-process with RemovalHandler, since a
* content control with SdtPr w:dataBinding and w:text
* which contains a w:hyperlink will prevent Word 2007 from
* opening the docx.
@@ -82,7 +84,7 @@
* Due to the architecture of this class, this is a static flag changing the
* behavior of all following calls to {@link #applyBindings}.
*
- * @param hyperlinkStyle
+ * @param hyperlinkStyleID
* The style to use for hyperlinks (eg Hyperlink)
*/
public static void setHyperlinkStyle (
@@ -327,8 +329,11 @@
private static void processString(JaxbXmlPart sourcePart, DocumentFragment docfrag, String text, RPr rPr) throws JAXBException {
int pos = text.indexOf("http://");
+ if (pos==-1) {
+ pos = text.indexOf("https://");
+ }
- if (pos==-1) {
+ if (pos==-1 || hyperlinkStyleId == null) {
addRunToDocFrag(sourcePart, docfrag, text, rPr);
return;
}