ASF Bugzilla – Attachment 34846 Details for
Bug 60845
[PATCH] copied cell style and CF
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch as a diff file (git)
bug60845.patch (text/plain), 3.40 KB, created by
dollinger.florian
on 2017-03-19 20:56:15 UTC
(
hide
)
Description:
patch as a diff file (git)
Filename:
MIME Type:
Creator:
dollinger.florian
Created:
2017-03-19 20:56:15 UTC
Size:
3.40 KB
patch
obsolete
>diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java >index bdbbf74..42c0c07 100644 >--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java >+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java >@@ -644,7 +644,24 @@ > if(!(o instanceof XSSFFont)) return false; > > XSSFFont cf = (XSSFFont)o; >- return _ctFont.toString().equals(cf.getCTFont().toString()); >+ >+ // BUG 60845 >+ boolean equal = >+ this.getItalic() == cf.getItalic() >+ && this.getBold() == cf.getBold() >+ && this.getStrikeout() == cf.getStrikeout() >+ && this.getCharSet() == cf.getCharSet() >+ && this.getBold() == cf.getBold() >+ && this.getColor() == cf.getColor() >+ && this.getFamily() == cf.getFamily() >+ && this.getFontHeight() == cf.getFontHeight() >+ && this.getFontName() == cf.getFontName() >+ && this.getScheme() == cf.getScheme() >+ && this.getThemeColor() == cf.getThemeColor() >+ && this.getTypeOffset() == cf.getTypeOffset() >+ && this.getUnderline() == cf.getUnderline() >+ && this.getXSSFColor() == cf.getXSSFColor(); >+ return equal; > } > > } >diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java >index b100bc2..48c10e6 100644 >--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java >+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java >@@ -180,6 +180,17 @@ > if (!(o instanceof XSSFCellBorder)) return false; > > XSSFCellBorder cf = (XSSFCellBorder) o; >- return border.toString().equals(cf.getCTBorder().toString()); >+ >+ // bug 60845 >+ boolean equal = true; >+ for(BorderSide side : BorderSide.values()){ >+ if(this.getBorderColor(side) != cf.getBorderColor(side) >+ || this.getBorderStyle(side) != cf.getBorderStyle(side)){ >+ equal = false; >+ break; >+ } >+ } >+ >+ return equal; > } > } >\ No newline at end of file >diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellFill.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellFill.java >index fd6a70e..724de3a 100644 >--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellFill.java >+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellFill.java >@@ -162,6 +162,18 @@ > if (!(o instanceof XSSFCellFill)) return false; > > XSSFCellFill cf = (XSSFCellFill) o; >- return _fill.toString().equals(cf.getCTFill().toString()); >+ >+ // bug 60845 >+ // Do not compare the representing strings but the properties >+ // Reason: >+ // The strings are different if he XMLObject is a fragment (e.g. the ones from cloneStyle) >+ // even if they are in fact representing the same style >+ >+ boolean equal = >+ this.getFillBackgroundColor() == cf.getFillBackgroundColor() >+ && this.getFillForegroundColor() == cf.getFillForegroundColor() >+ && this.getPatternType() == cf.getPatternType(); >+ >+ return equal; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60845
:
34815
|
34816
|
34817
|
34835
|
34837
|
34838
|
34839
|
34840
|
34846
|
34847
|
34848
|
34849
|
34850
|
34851
|
34852
|
34853
|
34854
|
34856
|
34871