Kaynağa Gözat

enable OneStatementPerLine rule; fix violations

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1296441 13f79535-47bb-0310-9956-ffa450edef68
pull/26/head
Glenn Adams 12 yıl önce
ebeveyn
işleme
1d4e8c30c8

+ 1
- 1
checkstyle-5.5.xml Dosyayı Görüntüle

@@ -188,7 +188,7 @@
<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->
<!-- <module name="OneStatementPerLine"/> produces 43 new errors -->
<module name="OneStatementPerLine"/>
<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

+ 6
- 2
src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java Dosyayı Görüntüle

@@ -151,8 +151,12 @@ public final class UnicodeClasses {
/**
* The column numbers in the UCD file
*/
public static final int UNICODE = 0, GENERAL_CATEGORY = 2, SIMPLE_UPPERCASE_MAPPING = 12,
SIMPLE_LOWERCASE_MAPPING = 13, SIMPLE_TITLECASE_MAPPING = 14, NUM_FIELDS = 15;
public static final int UNICODE = 0;
public static final int GENERAL_CATEGORY = 2;
public static final int SIMPLE_UPPERCASE_MAPPING = 12;
public static final int SIMPLE_LOWERCASE_MAPPING = 13;
public static final int SIMPLE_TITLECASE_MAPPING = 14;
public static final int NUM_FIELDS = 15;

/**
* Generate classes.xml from Unicode Character Database files

+ 3
- 1
src/java/org/apache/fop/afp/goca/GraphicsSetProcessColor.java Dosyayı Görüntüle

@@ -44,7 +44,9 @@ public class GraphicsSetProcessColor extends AbstractGraphicsDrawingOrder {
* X'08' CIELAB
* X'40' Standard OCA color space
*/
private static final byte RGB = 0x01, CMYK = 0x04, CIELAB = 0x08;
private static final byte RGB = 0x01;
private static final byte CMYK = 0x04;
private static final byte CIELAB = 0x08;

private final Color color;
private final int componentsSize;

+ 12
- 6
src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java Dosyayı Görüntüle

@@ -256,7 +256,8 @@ public class GlyphProcessingState {
if ( consumed == 0 ) {
consumed = 1;
}
index += consumed; consumed = 0;
index += consumed;
consumed = 0;
if ( index > indexLast ) {
index = indexLast;
}
@@ -297,7 +298,8 @@ public class GlyphProcessingState {
if ( consumed == 0 ) {
consumed = 1;
}
index -= consumed; consumed = 0;
index -= consumed;
consumed = 0;
if ( index < 0 ) {
index = 0;
}
@@ -452,7 +454,8 @@ public class GlyphProcessingState {
} else {
if ( ( ignoreTester == null ) || ! ignoreTester.test ( gi, getLookupFlags() ) ) {
if ( k < count ) {
glyphs [ k++ ] = gi; counted++;
glyphs [ k++ ] = gi;
counted++;
} else {
break;
}
@@ -478,7 +481,8 @@ public class GlyphProcessingState {
} else {
if ( ( ignoreTester == null ) || ! ignoreTester.test ( gi, getLookupFlags() ) ) {
if ( k < count ) {
glyphs [ k++ ] = gi; counted++;
glyphs [ k++ ] = gi;
counted++;
} else {
break;
}
@@ -698,7 +702,8 @@ public class GlyphProcessingState {
} else {
if ( ( ignoreTester == null ) || ! ignoreTester.test ( gi, getLookupFlags() ) ) {
if ( k < count ) {
associations [ k++ ] = getAssociation ( i - index ); counted++;
associations [ k++ ] = getAssociation ( i - index );
counted++;
} else {
break;
}
@@ -725,7 +730,8 @@ public class GlyphProcessingState {
} else {
if ( ( ignoreTester == null ) || ! ignoreTester.test ( gi, getLookupFlags() ) ) {
if ( k < count ) {
associations [ k++ ] = getAssociation ( i - index ); counted++;
associations [ k++ ] = getAssociation ( i - index );
counted++;
} else {
break;
}

+ 2
- 1
src/java/org/apache/fop/complexscripts/fonts/GlyphTable.java Dosyayı Görüntüle

@@ -516,7 +516,8 @@ public class GlyphTable {
added = true;
} else if ( d == 0 ) {
// duplicate entry is ignored
added = false; subtable = null;
added = false;
subtable = null;
}
}
// append at end of list

+ 18
- 4
src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java Dosyayı Görüntüle

@@ -1680,11 +1680,23 @@ public final class OTFAdvancedTypographicTableReader {
int df = in.readTTFUShort();
int s1, m1, dm, dd, s2;
if ( df == 1 ) {
s1 = 14; m1 = 0x3; dm = 1; dd = 4; s2 = 2;
s1 = 14;
m1 = 0x3;
dm = 1;
dd = 4;
s2 = 2;
} else if ( df == 2 ) {
s1 = 12; m1 = 0xF; dm = 7; dd = 16; s2 = 4;
s1 = 12;
m1 = 0xF;
dm = 7;
dd = 16;
s2 = 4;
} else if ( df == 3 ) {
s1 = 8; m1 = 0xFF; dm = 127; dd = 256; s2 = 8;
s1 = 8;
m1 = 0xFF;
dm = 127;
dd = 256;
s2 = 8;
} else {
log.debug ( "unsupported device table delta format: " + df + ", ignoring device table" );
return null;
@@ -3760,7 +3772,9 @@ public final class OTFAdvancedTypographicTableReader {

private void resetATStateAll() {
resetATState();
gdef = null; gsub = null; gpos = null;
gdef = null;
gsub = null;
gpos = null;
}

/** helper method for formatting an integer array for output */

+ 12
- 5
src/java/org/apache/fop/complexscripts/scripts/DefaultScriptProcessor.java Dosyayı Görüntüle

@@ -105,27 +105,34 @@ public class DefaultScriptProcessor extends ScriptProcessor {
int[] pa = ( gpa != null ) ? gpa [ i ] : null;
GlyphSequence.CharAssociation ca = aa [ i ];
if ( gdef.isGlyphClass ( gid, GlyphDefinitionTable.GLYPH_CLASS_MARK ) ) {
nga [ k ] = gid; naa [ k ] = ca;
nga [ k ] = gid;
naa [ k ] = ca;
if ( npa != null ) {
npa [ k ] = pa;
}
k++;
} else {
if ( bg != -1 ) {
nga [ k ] = bg; naa [ k ] = ba;
nga [ k ] = bg;
naa [ k ] = ba;
if ( npa != null ) {
npa [ k ] = bpa;
}
k++;
bg = -1; ba = null; bpa = null;
bg = -1;
ba = null;
bpa = null;
}
if ( bg == -1 ) {
bg = gid; ba = ca; bpa = pa;
bg = gid;
ba = ca;
bpa = pa;
}
}
}
if ( bg != -1 ) {
nga [ k ] = bg; naa [ k ] = ba;
nga [ k ] = bg;
naa [ k ] = ba;
if ( npa != null ) {
npa [ k ] = bpa;
}

+ 4
- 2
src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java Dosyayı Görüntüle

@@ -222,11 +222,13 @@ public class DevanagariScriptProcessor extends IndicScriptProcessor {
int i;
// consume dead consonants
while ( ( i = isDeadConsonant ( ca, s, e ) ) > s ) {
s = i; nd++;
s = i;
nd++;
}
// consume zero or one live consonant
if ( ( i = isLiveConsonant ( ca, s, e ) ) > s ) {
s = i; nl++;
s = i;
nl++;
}
return ( ( nd > 0 ) || ( nl > 0 ) ) ? s : -1;
}

+ 4
- 2
src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java Dosyayı Görüntüle

@@ -222,11 +222,13 @@ public class GujaratiScriptProcessor extends IndicScriptProcessor {
int i;
// consume dead consonants
while ( ( i = isDeadConsonant ( ca, s, e ) ) > s ) {
s = i; nd++;
s = i;
nd++;
}
// consume zero or one live consonant
if ( ( i = isLiveConsonant ( ca, s, e ) ) > s ) {
s = i; nl++;
s = i;
nl++;
}
return ( ( nd > 0 ) || ( nl > 0 ) ) ? s : -1;
}

+ 4
- 2
src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java Dosyayı Görüntüle

@@ -223,11 +223,13 @@ public class GurmukhiScriptProcessor extends IndicScriptProcessor {
int i;
// consume dead consonants
while ( ( i = isDeadConsonant ( ca, s, e ) ) > s ) {
s = i; nd++;
s = i;
nd++;
}
// consume zero or one live consonant
if ( ( i = isLiveConsonant ( ca, s, e ) ) > s ) {
s = i; nl++;
s = i;
nl++;
}
return ( ( nd > 0 ) || ( nl > 0 ) ) ? s : -1;
}

+ 2
- 1
src/java/org/apache/fop/complexscripts/util/CharScript.java Dosyayı Görüntüle

@@ -758,7 +758,8 @@ public final class CharScript {
assert v != null;
int c = v.intValue();
if ( c > cMax ) {
cMax = c; sMax = s;
cMax = c;
sMax = s;
}
break;
}

+ 2
- 1
src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java Dosyayı Görüntüle

@@ -712,7 +712,8 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
for ( int k = 0; k < 4; k++ ) {
int a = wpa2 [ k ];
if ( a != 0 ) {
wpa1 [ k ] += a; adjusted = true;
wpa1 [ k ] += a;
adjusted = true;
}
}
}

+ 2
- 1
src/java/org/apache/fop/render/intermediate/IFUtil.java Dosyayı Görüntüle

@@ -345,7 +345,8 @@ public final class IFUtil {
*/
public static void adjustPA ( int[] paDst, int[] paSrc ) {
if ( ( paDst != null ) && ( paSrc != null ) ) {
assert paDst.length == 4; assert paSrc.length == 4;
assert paDst.length == 4;
assert paSrc.length == 4;
for ( int i = 0; i < 4; i++ ) {
paDst[i] += paSrc[i];
}

+ 2
- 1
src/java/org/apache/fop/util/XMLUtil.java Dosyayı Görüntüle

@@ -197,7 +197,8 @@ public final class XMLUtil implements XMLConstants {
for ( int k = 0; k < 4; k++ ) {
int a = pa [ k ];
if ( a != 0 ) {
encodeNextAdjustment ( sb, nz, a ); nz = 0;
encodeNextAdjustment ( sb, nz, a );
nz = 0;
} else {
nz++;
}

Loading…
İptal
Kaydet