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. 10
      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')
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 MVN_BRANCH = branchVariable.toUpperCase()
//
dependencies{
@ -65,7 +66,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-quartz/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @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')
testCompile 'junit:junit:4.12'
}

3
build.third_step2.gradle

@ -46,6 +46,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
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 MVN_BRANCH = branchVariable.toUpperCase()
//
dependencies{
@ -55,7 +56,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-antlr4/lib",include: '**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @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')
testCompile 'junit:junit:4.12'
}

3
build.third_step3.gradle

@ -45,13 +45,14 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
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 MVN_BRANCH = branchVariable.toUpperCase()
//
dependencies{
compile fileTree(dir:"${srcDir}/fine-jboss-logging/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @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')
testCompile 'junit:junit:4.12'
}

3
build.third_step4.gradle

@ -44,13 +44,14 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
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 MVN_BRANCH = branchVariable.toUpperCase()
//
dependencies{
compile fileTree(dir:"${srcDir}/fine-hibernate/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @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')
testCompile 'junit:junit:4.12'
}

3
build.third_step5.gradle

@ -42,6 +42,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
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 MVN_BRANCH = branchVariable.toUpperCase()
//
dependencies{
@ -49,7 +50,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-druid/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @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')
testCompile 'junit:junit:4.12'
}

3
build.third_step6.gradle

@ -68,6 +68,7 @@ repositories{
FileTree files =fileTree(dir:'./',include:'build*.gradle')
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 MVN_BRANCH = branchVariable.toUpperCase()
//
dependencies{
@ -83,7 +84,7 @@ dependencies{
compile fileTree(dir:"${srcDir}/fine-jgit/lib",include:'**/*.jar')
compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar')
// @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')
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.util.ArrayList;
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.ICUBinary;
@ -43,8 +44,11 @@ public class RuleBasedBreakIterator extends BreakIterator {
*/
private RuleBasedBreakIterator() {
fDictionaryCharCount = 0;
synchronized(gAllBreakEngines) {
try {
rLock.lock();
fBreakEngines = new ArrayList<LanguageBreakEngine>(gAllBreakEngines);
} finally {
rLock.unlock();
}
}
@ -131,8 +135,11 @@ public class RuleBasedBreakIterator extends BreakIterator {
if (fText != null) {
result.fText = (CharacterIterator)(fText.clone());
}
synchronized (gAllBreakEngines) {
try {
rLock.lock();
result.fBreakEngines = new ArrayList<LanguageBreakEngine>(gAllBreakEngines);
} finally {
rLock.unlock();
}
result.fLookAheadMatches = new LookAheadResults();
result.fBreakCache = result.new BreakCache(fBreakCache);
@ -294,10 +301,19 @@ public class RuleBasedBreakIterator extends BreakIterator {
*/
private static final List<LanguageBreakEngine> gAllBreakEngines;
private static final ReentrantReadWriteLock rwLock;
private static final ReentrantReadWriteLock.ReadLock rLock;
private static final ReentrantReadWriteLock.WriteLock wLock;
static {
gUnhandledBreakEngine = new UnhandledBreakEngine();
gAllBreakEngines = new ArrayList<LanguageBreakEngine>();
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.
// Check the global list, another break iterator may have instantiated the
// desired engine.
@ -717,7 +734,10 @@ public class RuleBasedBreakIterator extends BreakIterator {
fBreakEngines.add(eng);
}
return eng;
} // end synchronized(gAllBreakEngines)
// end synchronized(gAllBreakEngines)
} finally {
wLock.unlock();
}
}
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 String BREAK = "\n";
private static final String BREAK_TAG = "<br>";
private boolean breakTag = false;
public float getHeight() {
return height;
}
@ -200,6 +206,7 @@ public class PdfChunk {
PdfChunk(String string, PdfChunk other) {
thisChunk[0] = this;
value = string;
updateBreakTag();
this.font = other.font;
this.attributes = other.attributes;
this.noStroke = other.noStroke;
@ -218,7 +225,7 @@ public class PdfChunk {
this.height = other.getHeight();
}
/**
/**
* Constructs a <CODE>PdfChunk</CODE>-object.
*
* @param chunk the original <CODE>Chunk</CODE>-object
@ -228,7 +235,7 @@ public class PdfChunk {
public PdfChunk(Chunk chunk, PdfAction action) {
thisChunk[0] = this;
value = chunk.getContent();
updateBreakTag();
Font f = chunk.getFont();
float size = f.getSize();
if (size == Font.UNDEFINED)
@ -798,7 +805,7 @@ public class PdfChunk {
htmlString.append("<span style='");
htmlString.append(getStyleAttributes()).append("'");
htmlString.append(">");
htmlString.append(value);
htmlString.append(breakTag ? BREAK_TAG : value);
htmlString.append("</span>");
return htmlString.toString();
}
@ -856,4 +863,12 @@ public class PdfChunk {
return indent.getLeft();
}
private void updateBreakTag() {
breakTag = BREAK.equals(value);
}
public boolean isBreakTag() {
return breakTag;
}
}

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

@ -94,6 +94,8 @@ public class PdfLine {
protected boolean isRTL = false;
public float getHeight() {
return height;
}
@ -155,7 +157,13 @@ public class PdfLine {
public PdfChunk add(PdfChunk chunk) {
// nothing happens if the chunk is null.
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

Loading…
Cancel
Save