1. BindingHandler.setHyperlinkStyle(...) comments say setting the hyperlink style to null (the default) will not convert "http://" to w:hyperlink, but the default, as well as explicitly setting the style ID to null, both seem to always convert to w:hyperlink. While applyBindings does respect the null when deciding whether to "activate" the style, processString(...) seems to ignore the null style ID setting for "http://" and calls addHyperlinkToDocFrag(...), which adds the w:hyperlink. Should processString include " || hyperlinkStyleId == null" in the test of whether to call addRunToDocFrag or addHyperlinkToDocFrag?
- Code: Select all
int pos = text.indexOf("http://");
if (pos==-1 || hyperlinkStyleId == null) { // currently does not include " || hyperlinkStyleId == null"
addRunToDocFrag(sourcePart, docfrag, text, rPr);
return;
}
// There is a hyperlink to deal with
if (pos==0) {
int spacePos = text.indexOf(" ");
if (spacePos==-1) {
addHyperlinkToDocFrag(sourcePart, docfrag, text);
return;
}
etc.
2. BindingHandler.applyBindings(...) accepts either WordprocessingMLPackage or JaxbXmlPart. The examples of the new recommended usage in several forum postings show passing in the main document part rather than the package. The method accepting the package seems to add a few steps before and after itself calling applyBindings with various Parts. Should the recommended call be to pass the package?
Thanks, Frank.