From: PJ Fanning Date: Thu, 27 Aug 2020 09:19:43 +0000 (+0000) Subject: [bug-64691] rename field X-Git-Tag: before_ooxml_3rd_edition~130 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f89528addc51729a438eb5732129b87c2d87b4b9;p=poi.git [bug-64691] rename field git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1881237 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java index cd180d031c..ca451a5d33 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java @@ -38,7 +38,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOpera public class XSSFDataValidation implements DataValidation { private static final int MAX_TEXT_LENGTH = 255; - private CTDataValidation ctDdataValidation; + private CTDataValidation ctDataValidation; private XSSFDataValidationConstraint validationConstraint; private CellRangeAddressList regions; @@ -90,12 +90,12 @@ public class XSSFDataValidation implements DataValidation { public XSSFDataValidation(XSSFDataValidationConstraint constraint,CellRangeAddressList regions,CTDataValidation ctDataValidation) { super(); this.validationConstraint = constraint; - this.ctDdataValidation = ctDataValidation; + this.ctDataValidation = ctDataValidation; this.regions = regions; } - CTDataValidation getCtDdataValidation() { - return ctDdataValidation; + CTDataValidation getCtDataValidation() { + return ctDataValidation; } @@ -111,8 +111,8 @@ public class XSSFDataValidation implements DataValidation { if(text != null && text.length() > MAX_TEXT_LENGTH) { throw new IllegalStateException("Error-text cannot be longer than 255 characters, but had: " + text); } - ctDdataValidation.setErrorTitle(encodeUtf(title)); - ctDdataValidation.setError(encodeUtf(text)); + ctDataValidation.setErrorTitle(encodeUtf(title)); + ctDataValidation.setError(encodeUtf(text)); } /* (non-Javadoc) @@ -126,8 +126,8 @@ public class XSSFDataValidation implements DataValidation { if(text != null && text.length() > MAX_TEXT_LENGTH) { throw new IllegalStateException("Error-text cannot be longer than 255 characters, but had: " + text); } - ctDdataValidation.setPromptTitle(encodeUtf(title)); - ctDdataValidation.setPrompt(encodeUtf(text)); + ctDataValidation.setPromptTitle(encodeUtf(title)); + ctDataValidation.setPrompt(encodeUtf(text)); } /** @@ -165,63 +165,63 @@ public class XSSFDataValidation implements DataValidation { * @see org.apache.poi.ss.usermodel.DataValidation#getEmptyCellAllowed() */ public boolean getEmptyCellAllowed() { - return ctDdataValidation.getAllowBlank(); + return ctDataValidation.getAllowBlank(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getErrorBoxText() */ public String getErrorBoxText() { - return ctDdataValidation.getError(); + return ctDataValidation.getError(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getErrorBoxTitle() */ public String getErrorBoxTitle() { - return ctDdataValidation.getErrorTitle(); + return ctDataValidation.getErrorTitle(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getErrorStyle() */ public int getErrorStyle() { - return reverseErrorStyleMappings.get(ctDdataValidation.getErrorStyle()); + return reverseErrorStyleMappings.get(ctDataValidation.getErrorStyle()); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getPromptBoxText() */ public String getPromptBoxText() { - return ctDdataValidation.getPrompt(); + return ctDataValidation.getPrompt(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getPromptBoxTitle() */ public String getPromptBoxTitle() { - return ctDdataValidation.getPromptTitle(); + return ctDataValidation.getPromptTitle(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getShowErrorBox() */ public boolean getShowErrorBox() { - return ctDdataValidation.getShowErrorMessage(); + return ctDataValidation.getShowErrorMessage(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getShowPromptBox() */ public boolean getShowPromptBox() { - return ctDdataValidation.getShowInputMessage(); + return ctDataValidation.getShowInputMessage(); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#getSuppressDropDownArrow() */ public boolean getSuppressDropDownArrow() { - return !ctDdataValidation.getShowDropDown(); + return !ctDataValidation.getShowDropDown(); } /* (non-Javadoc) @@ -235,28 +235,28 @@ public class XSSFDataValidation implements DataValidation { * @see org.apache.poi.ss.usermodel.DataValidation#setEmptyCellAllowed(boolean) */ public void setEmptyCellAllowed(boolean allowed) { - ctDdataValidation.setAllowBlank(allowed); + ctDataValidation.setAllowBlank(allowed); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#setErrorStyle(int) */ public void setErrorStyle(int errorStyle) { - ctDdataValidation.setErrorStyle(errorStyleMappings.get(errorStyle)); + ctDataValidation.setErrorStyle(errorStyleMappings.get(errorStyle)); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#setShowErrorBox(boolean) */ public void setShowErrorBox(boolean show) { - ctDdataValidation.setShowErrorMessage(show); + ctDataValidation.setShowErrorMessage(show); } /* (non-Javadoc) * @see org.apache.poi.ss.usermodel.DataValidation#setShowPromptBox(boolean) */ public void setShowPromptBox(boolean show) { - ctDdataValidation.setShowInputMessage(show); + ctDataValidation.setShowInputMessage(show); } /* (non-Javadoc) @@ -264,7 +264,7 @@ public class XSSFDataValidation implements DataValidation { */ public void setSuppressDropDownArrow(boolean suppress) { if (validationConstraint.getValidationType()==ValidationType.LIST) { - ctDdataValidation.setShowDropDown(!suppress); + ctDataValidation.setShowDropDown(!suppress); } } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 954803bb86..cce5bb2b90 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -4037,7 +4037,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { } int currentCount = dataValidations.sizeOfDataValidationArray(); CTDataValidation newval = dataValidations.addNewDataValidation(); - newval.set(xssfDataValidation.getCtDdataValidation()); + newval.set(xssfDataValidation.getCtDataValidation()); dataValidations.setCount(currentCount + 1L); } diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java index 8a6e791b45..8e59366351 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDataValidation.java @@ -325,7 +325,7 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { sheet.addValidationData(validation); final List dataValidations = sheet.getDataValidations(); - assertTrue(dataValidations.get(0).getCtDdataValidation().getAllowBlank()); + assertTrue(dataValidations.get(0).getCtDataValidation().getAllowBlank()); } } @@ -335,12 +335,12 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { XSSFSheet sheet = wb.createSheet(); final XSSFDataValidation validation = createValidation(sheet); - validation.getCtDdataValidation().setAllowBlank(false); + validation.getCtDataValidation().setAllowBlank(false); sheet.addValidationData(validation); final List dataValidations = sheet.getDataValidations(); - assertFalse(dataValidations.get(0).getCtDdataValidation().getAllowBlank()); + assertFalse(dataValidations.get(0).getCtDataValidation().getAllowBlank()); } } @@ -350,12 +350,12 @@ public class TestXSSFDataValidation extends BaseTestDataValidation { XSSFSheet sheet = wb.createSheet(); final XSSFDataValidation validation = createValidation(sheet); - validation.getCtDdataValidation().setAllowBlank(true); + validation.getCtDataValidation().setAllowBlank(true); sheet.addValidationData(validation); final List dataValidations = sheet.getDataValidations(); - assertTrue(dataValidations.get(0).getCtDdataValidation().getAllowBlank()); + assertTrue(dataValidations.get(0).getCtDataValidation().getAllowBlank()); } }