Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/readme update #276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/diffx/com/topologi/diffx/algorithm/DiffXFitsy.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ public int length() {
}
}
}
if (i % (this.length1 / 50) == 0) {
System.err.println(i * 100 / this.length1+"% at "+(t1 - System.currentTimeMillis())+"ms");
if (this.length1 / 50 != 0) {
if (i % (this.length1 / 50) == 0) {
System.err.println(i * 100 / this.length1+"% at "+(t1 - System.currentTimeMillis())+"ms");
}
}
}
this.length = this.matrix.get(0, 0);
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/org/docx4j/model/fields/FldSimpleModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/** Just a basic model for w:fldSimple that gets used in the
* FldSimpleModelConverter for the conversion to pdf/html
Expand All @@ -20,6 +22,7 @@
public class FldSimpleModel {

private static Logger log = LoggerFactory.getLogger(FldSimpleModel.class);
private static final Pattern TAG_REGEX = Pattern.compile("(<_.+?/>)");

protected CTSimpleField fldSimple = null;
protected Node content = null;
Expand Down Expand Up @@ -74,6 +77,10 @@ public static List<String> splitParameters(String text) {

log.debug("splitParameters: " + text);
List<String> ret = Collections.EMPTY_LIST;
ret = splitBAparameters(text);
if(!ret.isEmpty()) {
return ret;
}
int valStart = -1;
boolean inLiteral = false;
char ch = '\0';
Expand Down Expand Up @@ -111,6 +118,20 @@ else if (valStart == -1) {
return ret;
}

/**
* BS ADD to manage BA custom tags
* @param text
* @return list spllitter parameter
*/
private static List<String> splitBAparameters(String text) {
List<String> ret = new ArrayList<String>();
final Matcher matcher = TAG_REGEX.matcher(text);
while (matcher.find()) {
ret.add(matcher.group(1));
}
return ret;
}

public static void appendParameter(List<String> parameters, String value) {
log.debug("parameter: " + value);
parameters.add(value);
Expand Down