git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1151511 13f79535-47bb-0310-9956-ffa450edef68tags/REL_3_8_BETA4
import java.util.Set; | import java.util.Set; | ||||
import java.util.TreeSet; | import java.util.TreeSet; | ||||
import org.apache.poi.util.POILogFactory; | |||||
import org.apache.poi.util.POILogger; | |||||
import org.apache.poi.hwpf.HWPFDocument; | import org.apache.poi.hwpf.HWPFDocument; | ||||
import org.apache.poi.hwpf.HWPFDocumentCore; | import org.apache.poi.hwpf.HWPFDocumentCore; | ||||
import org.apache.poi.hwpf.HWPFOldDocument; | import org.apache.poi.hwpf.HWPFOldDocument; | ||||
{ | { | ||||
static final String EMPTY = ""; | static final String EMPTY = ""; | ||||
private static final POILogger logger = POILogFactory | |||||
.getLogger( AbstractWordUtils.class ); | |||||
public static final float TWIPS_PER_INCH = 1440.0f; | public static final float TWIPS_PER_INCH = 1440.0f; | ||||
public static final int TWIPS_PER_PT = 20; | public static final int TWIPS_PER_PT = 20; | ||||
return ""; | return ""; | ||||
} | } | ||||
public static String getLanguage( int languageCode ) | |||||
{ | |||||
switch ( languageCode ) | |||||
{ | |||||
case 1033: | |||||
return "en-us"; | |||||
case 1049: | |||||
return "ru-ru"; | |||||
case 2057: | |||||
return "en-uk"; | |||||
default: | |||||
logger.log( POILogger.WARN, "Uknown or unmapped language code: ", | |||||
Integer.valueOf( languageCode ) ); | |||||
return ""; | |||||
} | |||||
} | |||||
public static String getListItemNumberLabel( int number, int format ) | public static String getListItemNumberLabel( int number, int format ) | ||||
{ | { | ||||
{ | { | ||||
inline.setAttribute( "color", getColor24( characterRun.getIco24() ) ); | inline.setAttribute( "color", getColor24( characterRun.getIco24() ) ); | ||||
} | } | ||||
if ( characterRun.getLanguageCode() != 0 ) | |||||
{ | |||||
final String language = getLanguage( characterRun.getLanguageCode() ); | |||||
if ( isNotEmpty( language ) ) | |||||
inline.setAttribute( "language", language ); | |||||
} | |||||
if ( characterRun.isCapitalized() ) | if ( characterRun.isCapitalized() ) | ||||
{ | { | ||||
inline.setAttribute( "text-transform", "uppercase" ); | inline.setAttribute( "text-transform", "uppercase" ); | ||||
graphicElement.setAttribute( "clip", "rect(" + rectTop + "pt, " | graphicElement.setAttribute( "clip", "rect(" + rectTop + "pt, " | ||||
+ rectRight + "pt, " + rectBottom + "pt, " + rectLeft | + rectRight + "pt, " + rectBottom + "pt, " + rectLeft | ||||
+ "pt)" ); | + "pt)" ); | ||||
graphicElement.setAttribute( "oveerflow", "hidden" ); | |||||
graphicElement.setAttribute( "overflow", "hidden" ); | |||||
} | } | ||||
} | } | ||||
return _props.getBrc(); | return _props.getBrc(); | ||||
} | } | ||||
public int getLanguageCode() { | |||||
return _props.getLidDefault(); | |||||
} | |||||
public String toString() { | public String toString() { | ||||
String text = text(); | String text = text(); | ||||
return "CharacterRun of " + text.length() + " characters - " + text; | return "CharacterRun of " + text.length() + " characters - " + text; |