Browse Source

Merge pull request #317 in CORE/base-third from ~ABBY/base-third:persist/10.0 to persist/10.0

* commit 'f76d868b141b3af09dd4ce4446c2ba238df2b8fb':
  无 jira 任务, 处理分支信息。
  REPORT-23612 【性能插件】国际换行功能性能问题
  REPORT-23453 html切割时,丢失<br> 标签
  无 jira 任务,BUGFIX 恢复分支信息
qufenxi
Kara 5 years ago
parent
commit
0342b0e47e
  1. 3
      build.third_step1.gradle
  2. 3
      build.third_step2.gradle
  3. 3
      build.third_step3.gradle
  4. 3
      build.third_step4.gradle
  5. 3
      build.third_step5.gradle
  6. 3
      build.third_step6.gradle
  7. 28
      fine-icu4j/src/com/fr/third/ibm/icu/text/RuleBasedBreakIterator.java
  8. 21
      fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java
  9. 8
      fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java

3
build.third_step1.gradle

@ -58,6 +58,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator))
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def MVN_BRANCH = branchVariable.toUpperCase()
// //
dependencies{ dependencies{
@ -65,7 +66,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-quartz/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-quartz/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @branch - // @branch -
compile "com.fr.third:fine-third:10.0-FINAL-SNAPSHOT" compile "com.fr.third:fine-third:10.0-${MVN_BRANCH}-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

3
build.third_step2.gradle

@ -46,6 +46,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator))
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def MVN_BRANCH = branchVariable.toUpperCase()
// //
dependencies{ dependencies{
@ -55,7 +56,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-antlr4/lib",include: '**/*.jar') compile fileTree(dir:"${srcDir}/fine-antlr4/lib",include: '**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @branch - // @branch -
compile "com.fr.third:fine-third:10.0-FINAL-SNAPSHOT" compile "com.fr.third:fine-third:10.0-${MVN_BRANCH}-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

3
build.third_step3.gradle

@ -45,13 +45,14 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator))
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def MVN_BRANCH = branchVariable.toUpperCase()
// //
dependencies{ dependencies{
compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @branch - // @branch -
compile "com.fr.third:fine-third:10.0-FINAL-SNAPSHOT" compile "com.fr.third:fine-third:10.0-${MVN_BRANCH}-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

3
build.third_step4.gradle

@ -44,13 +44,14 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator))
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def MVN_BRANCH = branchVariable.toUpperCase()
// //
dependencies{ dependencies{
compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @branch - // @branch -
compile "com.fr.third:fine-third:10.0-FINAL-SNAPSHOT" compile "com.fr.third:fine-third:10.0-${MVN_BRANCH}-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

3
build.third_step5.gradle

@ -42,6 +42,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator))
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def MVN_BRANCH = branchVariable.toUpperCase()
// //
dependencies{ dependencies{
@ -49,7 +50,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @branch - // @branch -
compile "com.fr.third:fine-third:10.0-FINAL-SNAPSHOT" compile "com.fr.third:fine-third:10.0-${MVN_BRANCH}-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

3
build.third_step6.gradle

@ -68,6 +68,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build*.gradle') FileTree files =fileTree(dir:'./',include:'build*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator)) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf (java.io.File.separator))
def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1) def branchName=buildDir.substring(buildDir.lastIndexOf (java.io.File.separator)+1)
def MVN_BRANCH = branchVariable.toUpperCase()
// //
dependencies{ dependencies{
@ -83,7 +84,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-jgit/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-jgit/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @branch - // @branch -
compile "com.fr.third:fine-third:10.0-FINAL-SNAPSHOT" compile "com.fr.third:fine-third:10.0-${MVN_BRANCH}-SNAPSHOT"
compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar')
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

28
fine-icu4j/src/com/fr/third/ibm/icu/text/RuleBasedBreakIterator.java

@ -17,6 +17,7 @@ import java.nio.ByteBuffer;
import java.text.CharacterIterator; import java.text.CharacterIterator;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import com.fr.third.ibm.icu.impl.CharacterIteration; import com.fr.third.ibm.icu.impl.CharacterIteration;
import com.fr.third.ibm.icu.impl.ICUBinary; import com.fr.third.ibm.icu.impl.ICUBinary;
@ -43,8 +44,11 @@ public class RuleBasedBreakIterator extends BreakIterator {
*/ */
private RuleBasedBreakIterator() { private RuleBasedBreakIterator() {
fDictionaryCharCount = 0; fDictionaryCharCount = 0;
synchronized(gAllBreakEngines) { try {
rLock.lock();
fBreakEngines = new ArrayList<LanguageBreakEngine>(gAllBreakEngines); fBreakEngines = new ArrayList<LanguageBreakEngine>(gAllBreakEngines);
} finally {
rLock.unlock();
} }
} }
@ -131,8 +135,11 @@ public class RuleBasedBreakIterator extends BreakIterator {
if (fText != null) { if (fText != null) {
result.fText = (CharacterIterator)(fText.clone()); result.fText = (CharacterIterator)(fText.clone());
} }
synchronized (gAllBreakEngines) { try {
rLock.lock();
result.fBreakEngines = new ArrayList<LanguageBreakEngine>(gAllBreakEngines); result.fBreakEngines = new ArrayList<LanguageBreakEngine>(gAllBreakEngines);
} finally {
rLock.unlock();
} }
result.fLookAheadMatches = new LookAheadResults(); result.fLookAheadMatches = new LookAheadResults();
result.fBreakCache = result.new BreakCache(fBreakCache); result.fBreakCache = result.new BreakCache(fBreakCache);
@ -294,10 +301,19 @@ public class RuleBasedBreakIterator extends BreakIterator {
*/ */
private static final List<LanguageBreakEngine> gAllBreakEngines; private static final List<LanguageBreakEngine> gAllBreakEngines;
private static final ReentrantReadWriteLock rwLock;
private static final ReentrantReadWriteLock.ReadLock rLock;
private static final ReentrantReadWriteLock.WriteLock wLock;
static { static {
gUnhandledBreakEngine = new UnhandledBreakEngine(); gUnhandledBreakEngine = new UnhandledBreakEngine();
gAllBreakEngines = new ArrayList<LanguageBreakEngine>(); gAllBreakEngines = new ArrayList<LanguageBreakEngine>();
gAllBreakEngines.add(gUnhandledBreakEngine); gAllBreakEngines.add(gUnhandledBreakEngine);
rwLock = new ReentrantReadWriteLock();
rLock = rwLock.readLock();
wLock = rwLock.writeLock();
} }
/** /**
@ -663,7 +679,8 @@ public class RuleBasedBreakIterator extends BreakIterator {
} }
} }
synchronized (gAllBreakEngines) { try {
wLock.lock();
// This break iterator's list of break engines didn't handle the character. // This break iterator's list of break engines didn't handle the character.
// Check the global list, another break iterator may have instantiated the // Check the global list, another break iterator may have instantiated the
// desired engine. // desired engine.
@ -717,7 +734,10 @@ public class RuleBasedBreakIterator extends BreakIterator {
fBreakEngines.add(eng); fBreakEngines.add(eng);
} }
return eng; return eng;
} // end synchronized(gAllBreakEngines) // end synchronized(gAllBreakEngines)
} finally {
wLock.unlock();
}
} }
private static final int kMaxLookaheads = 8; private static final int kMaxLookaheads = 8;

21
fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfChunk.java

@ -88,6 +88,12 @@ public class PdfChunk {
private static final float FONT_SCALE = 100f; private static final float FONT_SCALE = 100f;
private static final String BREAK = "\n";
private static final String BREAK_TAG = "<br>";
private boolean breakTag = false;
public float getHeight() { public float getHeight() {
return height; return height;
} }
@ -200,6 +206,7 @@ public class PdfChunk {
PdfChunk(String string, PdfChunk other) { PdfChunk(String string, PdfChunk other) {
thisChunk[0] = this; thisChunk[0] = this;
value = string; value = string;
updateBreakTag();
this.font = other.font; this.font = other.font;
this.attributes = other.attributes; this.attributes = other.attributes;
this.noStroke = other.noStroke; this.noStroke = other.noStroke;
@ -218,7 +225,7 @@ public class PdfChunk {
this.height = other.getHeight(); this.height = other.getHeight();
} }
/** /**
* Constructs a <CODE>PdfChunk</CODE>-object. * Constructs a <CODE>PdfChunk</CODE>-object.
* *
* @param chunk the original <CODE>Chunk</CODE>-object * @param chunk the original <CODE>Chunk</CODE>-object
@ -228,7 +235,7 @@ public class PdfChunk {
public PdfChunk(Chunk chunk, PdfAction action) { public PdfChunk(Chunk chunk, PdfAction action) {
thisChunk[0] = this; thisChunk[0] = this;
value = chunk.getContent(); value = chunk.getContent();
updateBreakTag();
Font f = chunk.getFont(); Font f = chunk.getFont();
float size = f.getSize(); float size = f.getSize();
if (size == Font.UNDEFINED) if (size == Font.UNDEFINED)
@ -798,7 +805,7 @@ public class PdfChunk {
htmlString.append("<span style='"); htmlString.append("<span style='");
htmlString.append(getStyleAttributes()).append("'"); htmlString.append(getStyleAttributes()).append("'");
htmlString.append(">"); htmlString.append(">");
htmlString.append(value); htmlString.append(breakTag ? BREAK_TAG : value);
htmlString.append("</span>"); htmlString.append("</span>");
return htmlString.toString(); return htmlString.toString();
} }
@ -856,4 +863,12 @@ public class PdfChunk {
return indent.getLeft(); return indent.getLeft();
} }
private void updateBreakTag() {
breakTag = BREAK.equals(value);
}
public boolean isBreakTag() {
return breakTag;
}
} }

8
fine-itext/src/com/fr/third/v2/lowagie/text/pdf/PdfLine.java

@ -94,6 +94,8 @@ public class PdfLine {
protected boolean isRTL = false; protected boolean isRTL = false;
public float getHeight() { public float getHeight() {
return height; return height;
} }
@ -157,6 +159,12 @@ public class PdfLine {
if (chunk == null || chunk.toString().equals("")) { if (chunk == null || chunk.toString().equals("")) {
return null; return null;
} }
// add to line if the chunk is break tag ("\n")
if (chunk.isBreakTag()) {
addToLine(chunk);
width = 0;
return null;
}
// we split the chunk to be added // we split the chunk to be added
PdfChunk overflow = chunk.split(width); PdfChunk overflow = chunk.split(width);

Loading…
Cancel
Save