<!-- Don't forget to update status.xml too! -->
<release version="3.1-beta2" date="2008-05-??">
+ <action dev="POI-DEVELOPERS" type="fix">44985 - Properly update TextSpecInfoAtom when the parent text is changed</action>
<action dev="POI-DEVELOPERS" type="fix">41187 - fixed HSSFSheet to properly read xls files without ROW records</action>
<action dev="POI-DEVELOPERS" type="fix">44950 - fixed HSSFFormulaEvaluator.evaluateInCell() and Area3DEval.getValue() also added validation for number of elements in AreaEvals</action>
<action dev="POI-DEVELOPERS" type="fix">42570 - fixed LabelRecord to use empty string instead of null when the length is zero.</action>
<!-- Don't forget to update changes.xml too! -->
<changes>
<release version="3.1-beta2" date="2008-05-??">
+ <action dev="POI-DEVELOPERS" type="fix">44985 - Properly update TextSpecInfoAtom when the parent text is changed</action>
<action dev="POI-DEVELOPERS" type="fix">41187 - fixed HSSFSheet to properly read xls files without ROW records</action>
<action dev="POI-DEVELOPERS" type="fix">44950 - fixed HSSFFormulaEvaluator.evaluateInCell() and Area3DEval.getValue() also added validation for number of elements in AreaEvals</action>
<action dev="POI-DEVELOPERS" type="fix">42570 - fixed LabelRecord to use empty string instead of null when the length is zero.</action>
3. Checkout the tagged version\r
{code}\r
cd tags\r
-svn checkout https://svn.apache.org/repos/asf/poi/tags/TAG\r
+svn checkout https://svn.apache.org/repos/asf/poi/tags/$TAG\r
{code}\r
\r
4. Merge (if required)\r
\r
{code}\r
cd $TAG\r
-$ svn merge https://svn.apache.org/repos/asf/poi/tags/TAG \\r
+$ svn merge https://svn.apache.org/repos/asf/poi/tags/$TAG \\r
https://svn.apache.org/repos/asf/poi/trunk\r
{code}\r
\r
* touch the stylings.
*/
private void storeText(String s) {
- // Remove a single trailing \n, as there is an implicit one at the
+ // Remove a single trailing \r, as there is an implicit one at the
// end of every record
- if(s.endsWith("\n")) {
+ if(s.endsWith("\r")) {
s = s.substring(0, s.length()-1);
}
* as the the first character has.
* If you care about styling, do setText on a RichTextRun instead
*/
- public synchronized void setText(String s) {
+ public synchronized void setRawText(String s) {
// Save the new text to the atoms
storeText(s);
RichTextRun fst = _rtRuns[0];
}
- /**
+ /**
+ * Changes the text.
+ * Converts '\r' into '\n'
+ */
+ public synchronized void setText(String s) {
+ String text = normalize(s);
+ setRawText(text);
+ }
+
+ /**
* Ensure a StyleTextPropAtom is present for this run,
* by adding if required. Normally for internal TextRun use.
*/
return null;
}
+
+ /**
+ * Returns a new string with line breaks converted into internal ppt representation
+ */
+ public String normalize(String s){
+ String ns = s.replaceAll("\\r?\\n", "\r");
+ return ns;
+ }
}
* Change the text
*/
public void setText(String text) {
- length = text.length();
- parentRun.changeTextInRichTextRun(this,text);
+ String s = parentRun.normalize(text);
+ setRawText(s);
}
+ /**
+ * Change the text
+ */
+ public void setRawText(String text) {
+ length = text.length();
+ parentRun.changeTextInRichTextRun(this,text);
+ }
+
/**
* Tells the RichTextRun its new position in the parent TextRun
* @param startAt