Patch from bug #52190 - null check on XWPF setFontFamily

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1202620 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2011-11-16 10:33:05 +00:00
parent 14ee39dde1
commit fab3636895
3 changed files with 2 additions and 2 deletions

View File

@ -34,6 +34,7 @@
<changes>
<release version="3.8-beta5" date="2011-??-??">
<action dev="poi-developers" type="fix">52190 - null check on XWPF setFontFamily</action>
<action dev="poi-developers" type="fix">52062 - ensure that temporary files in SXSSF are deleted</action>
<action dev="poi-developers" type="fix">50936 - Exception parsing MS Word 8.0 file (as duplicate of 47958)</action>
<action dev="poi-developers" type="fix">47958 - ArrayIndexOutOfBoundsException from PicturesTable.getAllPictures() during Escher tree walk</action>

View File

@ -91,7 +91,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSelection;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetCalcPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetData;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetFormatPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetProtection;

View File

@ -461,7 +461,7 @@ public class XWPFRun {
* @param fontFamily
*/
public void setFontFamily(String fontFamily) {
CTRPr pr = run.getRPr();
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTFonts fonts = pr.isSetRFonts() ? pr.getRFonts() : pr.addNewRFonts();
fonts.setAscii(fontFamily);
}