Fix inconsistent whitespace/formatting

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1691046 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2015-07-14 18:14:50 +00:00
parent 777806d350
commit e349269fcf
6 changed files with 1021 additions and 1055 deletions

View File

@ -25,11 +25,8 @@ import org.apache.poi.util.LittleEndianOutput;
/** /**
* Border Formatting Block of the Conditional Formatting Rule Record. * Border Formatting Block of the Conditional Formatting Rule Record.
*
* @author Dmitriy Kumshayev
*/ */
public final class BorderFormatting { public final class BorderFormatting {
/** No border */ /** No border */
public final static short BORDER_NONE = 0x0; public final static short BORDER_NONE = 0x0;
/** Thin border */ /** Thin border */

View File

@ -23,12 +23,9 @@ import java.util.List;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
/** /**
* * TODO Should this move to org.apache.poi.ss.util ?
* @author Dmitriy Kumshayev
*/ */
public final class CellRangeUtil public final class CellRangeUtil {
{
private CellRangeUtil() { private CellRangeUtil() {
// no instance of this class // no instance of this class
} }
@ -81,7 +78,6 @@ public final class CellRangeUtil
{ {
return OVERLAP; return OVERLAP;
} }
} }
/** /**
@ -171,15 +167,12 @@ public final class CellRangeUtil
throw new RuntimeException("unexpected intersection result (" + x + ")"); throw new RuntimeException("unexpected intersection result (" + x + ")");
} }
private static CellRangeAddress[] toArray(List<CellRangeAddress> temp) { private static CellRangeAddress[] toArray(List<CellRangeAddress> temp) {
CellRangeAddress[] result = new CellRangeAddress[temp.size()]; CellRangeAddress[] result = new CellRangeAddress[temp.size()];
temp.toArray(result); temp.toArray(result);
return result; return result;
} }
/** /**
* Check if the specified range is located inside of this cell range. * Check if the specified range is located inside of this cell range.
* *
@ -234,14 +227,12 @@ public final class CellRangeUtil
return crA.copy(); return crA.copy();
} }
return return new CellRangeAddress(
new CellRangeAddress(
lt(crB.getFirstRow(), crA.getFirstRow()) ?crB.getFirstRow() :crA.getFirstRow(), lt(crB.getFirstRow(), crA.getFirstRow()) ?crB.getFirstRow() :crA.getFirstRow(),
gt(crB.getLastRow(), crA.getLastRow()) ?crB.getLastRow() :crA.getLastRow(), gt(crB.getLastRow(), crA.getLastRow()) ?crB.getLastRow() :crA.getLastRow(),
lt(crB.getFirstColumn(),crA.getFirstColumn())?crB.getFirstColumn():crA.getFirstColumn(), lt(crB.getFirstColumn(),crA.getFirstColumn())?crB.getFirstColumn():crA.getFirstColumn(),
gt(crB.getLastColumn(), crA.getLastColumn()) ?crB.getLastColumn() :crA.getLastColumn() gt(crB.getLastColumn(), crA.getLastColumn()) ?crB.getLastColumn() :crA.getLastColumn()
); );
} }
/** /**

View File

@ -25,11 +25,8 @@ import org.apache.poi.util.LittleEndian;
/** /**
* Font Formatting Block of the Conditional Formatting Rule Record. * Font Formatting Block of the Conditional Formatting Rule Record.
*
* @author Dmitriy Kumshayev
*/ */
public final class FontFormatting public final class FontFormatting {
{
private byte[] _rawData; private byte[] _rawData;
private static final int OFFSET_FONT_NAME = 0; private static final int OFFSET_FONT_NAME = 0;
@ -238,7 +235,6 @@ public final class FontFormatting
* *
* @param strike - whether the font is stricken out or not * @param strike - whether the font is stricken out or not
*/ */
public void setStrikeout(boolean strike) public void setStrikeout(boolean strike)
{ {
setFontOption(strike, cancellation); setFontOption(strike, cancellation);
@ -250,7 +246,6 @@ public final class FontFormatting
* @return strike - whether the font is stricken out or not * @return strike - whether the font is stricken out or not
* @see #getFontOption(org.apache.poi.util.BitField) * @see #getFontOption(org.apache.poi.util.BitField)
*/ */
public boolean isStruckout() public boolean isStruckout()
{ {
return getFontOption(cancellation); return getFontOption(cancellation);
@ -341,7 +336,6 @@ public final class FontFormatting
* @see org.apache.poi.hssf.usermodel.HSSFFontFormatting#U_SINGLE_ACCOUNTING * @see org.apache.poi.hssf.usermodel.HSSFFontFormatting#U_SINGLE_ACCOUNTING
* @see org.apache.poi.hssf.usermodel.HSSFFontFormatting#U_DOUBLE_ACCOUNTING * @see org.apache.poi.hssf.usermodel.HSSFFontFormatting#U_DOUBLE_ACCOUNTING
*/ */
public short getUnderlineType() public short getUnderlineType()
{ {
return getShort(OFFSET_UNDERLINE_TYPE); return getShort(OFFSET_UNDERLINE_TYPE);
@ -514,7 +508,8 @@ public final class FontFormatting
append(getFontWeight()). append(getFontWeight()).
append( append(
getFontWeight() == FONT_WEIGHT_NORMAL ? "(Normal)" getFontWeight() == FONT_WEIGHT_NORMAL ? "(Normal)"
: getFontWeight() == FONT_WEIGHT_BOLD ? "(Bold)" : "0x"+Integer.toHexString(getFontWeight())). : getFontWeight() == FONT_WEIGHT_BOLD ? "(Bold)"
: "0x"+Integer.toHexString(getFontWeight())).
append("\n"); append("\n");
} }
else else

View File

@ -24,8 +24,6 @@ import org.apache.poi.util.LittleEndianOutput;
/** /**
* Pattern Formatting Block of the Conditional Formatting Rule Record. * Pattern Formatting Block of the Conditional Formatting Rule Record.
*
* @author Dmitriy Kumshayev
*/ */
public final class PatternFormatting implements Cloneable { public final class PatternFormatting implements Cloneable {
/** No background */ /** No background */

View File

@ -25,8 +25,7 @@ import org.apache.poi.ss.usermodel.Color;
* High level representation for Font Formatting component * High level representation for Font Formatting component
* of Conditional Formatting settings * of Conditional Formatting settings
*/ */
public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.FontFormatting public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.FontFormatting {
{
/** Underline type - None */ /** Underline type - None */
public final static byte U_NONE = FontFormatting.U_NONE; public final static byte U_NONE = FontFormatting.U_NONE;
/** Underline type - Single */ /** Underline type - Single */
@ -41,14 +40,12 @@ public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.Fon
private final FontFormatting fontFormatting; private final FontFormatting fontFormatting;
private final HSSFWorkbook workbook; private final HSSFWorkbook workbook;
protected HSSFFontFormatting(CFRuleBase cfRuleRecord, HSSFWorkbook workbook) protected HSSFFontFormatting(CFRuleBase cfRuleRecord, HSSFWorkbook workbook) {
{
this.fontFormatting = cfRuleRecord.getFontFormatting(); this.fontFormatting = cfRuleRecord.getFontFormatting();
this.workbook = workbook; this.workbook = workbook;
} }
protected FontFormatting getFontFormattingBlock() protected FontFormatting getFontFormattingBlock() {
{
return fontFormatting; return fontFormatting;
} }
@ -97,8 +94,7 @@ public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.Fon
* *
* @return fontheight (in points/20); or -1 if not modified * @return fontheight (in points/20); or -1 if not modified
*/ */
public int getFontHeight() public int getFontHeight() {
{
return fontFormatting.getFontHeight(); return fontFormatting.getFontHeight();
} }
@ -108,17 +104,14 @@ public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.Fon
* *
* @return bw - a number between 100-1000 for the fonts "boldness" * @return bw - a number between 100-1000 for the fonts "boldness"
*/ */
public short getFontWeight() {
public short getFontWeight()
{
return fontFormatting.getFontWeight(); return fontFormatting.getFontWeight();
} }
/** /**
* @see org.apache.poi.hssf.record.cf.FontFormatting#getRawRecord() * @see org.apache.poi.hssf.record.cf.FontFormatting#getRawRecord()
*/ */
protected byte[] getRawRecord() protected byte[] getRawRecord() {
{
return fontFormatting.getRawRecord(); return fontFormatting.getRawRecord();
} }
@ -268,10 +261,8 @@ public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.Fon
* @see #SS_SUPER * @see #SS_SUPER
* @see #SS_SUB * @see #SS_SUB
*/ */
public void setEscapementType(short escapementType) public void setEscapementType(short escapementType) {
{ switch(escapementType) {
switch(escapementType)
{
case HSSFFontFormatting.SS_SUB: case HSSFFontFormatting.SS_SUB:
case HSSFFontFormatting.SS_SUPER: case HSSFFontFormatting.SS_SUPER:
fontFormatting.setEscapementType(escapementType); fontFormatting.setEscapementType(escapementType);
@ -289,8 +280,7 @@ public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.Fon
* @param modified * @param modified
* @see org.apache.poi.hssf.record.cf.FontFormatting#setEscapementTypeModified(boolean) * @see org.apache.poi.hssf.record.cf.FontFormatting#setEscapementTypeModified(boolean)
*/ */
public void setEscapementTypeModified(boolean modified) public void setEscapementTypeModified(boolean modified) {
{
fontFormatting.setEscapementTypeModified(modified); fontFormatting.setEscapementTypeModified(modified);
} }
@ -389,10 +379,8 @@ public final class HSSFFontFormatting implements org.apache.poi.ss.usermodel.Fon
* @see #U_SINGLE_ACCOUNTING * @see #U_SINGLE_ACCOUNTING
* @see #U_DOUBLE_ACCOUNTING * @see #U_DOUBLE_ACCOUNTING
*/ */
public void setUnderlineType(short underlineType) public void setUnderlineType(short underlineType) {
{ switch(underlineType) {
switch(underlineType)
{
case HSSFFontFormatting.U_SINGLE: case HSSFFontFormatting.U_SINGLE:
case HSSFFontFormatting.U_DOUBLE: case HSSFFontFormatting.U_DOUBLE:
case HSSFFontFormatting.U_SINGLE_ACCOUNTING: case HSSFFontFormatting.U_SINGLE_ACCOUNTING:

View File

@ -22,9 +22,6 @@ package org.apache.poi.ss.usermodel;
/** /**
* High level representation for Font Formatting component * High level representation for Font Formatting component
* of Conditional Formatting settings * of Conditional Formatting settings
*
* @author Dmitriy Kumshayev
* @author Yegor Kozlov
*/ */
public interface FontFormatting { public interface FontFormatting {
/** Escapement type - None */ /** Escapement type - None */