You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/03/10 23:47:57 UTC

[Bug 60845] New: copied cell style and CF

https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

            Bug ID: 60845
           Summary: copied cell style and CF
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: dollinger.florian@gmx.de
  Target Milestone: ---

Two equal XLSX Files
Both are using conditional Formatting of the Background Color on e.g. Column 1
Now, copy one Row of File1 to File2 using:

for (int i = 0; i < sourceRow.getLastCellNum(); i++) {

    XSSFCellStyle newStyle = destSheet.getWorkbook().createCellStyle();
    newStyle.cloneStyleFrom(oldCell.getCellStyle());      
    newCell.setCellStyle(newStyle);


    // Set the cell data type
    newCell.setCellType(oldCell.getCellType());

    // Set the cell data value
    switch (oldCell.getCellType()) {
    case Cell.CELL_TYPE_BLANK:
        newCell.setCellValue(oldCell.getStringCellValue());
        break;
    case Cell.CELL_TYPE_BOOLEAN:
        newCell.setCellValue(oldCell.getBooleanCellValue());
        break;
    case Cell.CELL_TYPE_ERROR:
        newCell.setCellErrorValue(oldCell.getErrorCellValue());
        break;
    case Cell.CELL_TYPE_FORMULA:
        newCell.setCellFormula(oldCell.getCellFormula());
        break;
    case Cell.CELL_TYPE_NUMERIC:
        newCell.setCellValue(oldCell.getNumericCellValue());
        break;
    case Cell.CELL_TYPE_STRING:
        newCell.setCellValue(oldCell.getRichStringCellValue());
        break;
    }
}

The Row is copied, the values, the size, also the background colors and so on.
But the conditional formatting does not longer work for the
copied rows. "Not working" means: the cells background is white, even if the
value is the right one.

If you use the cell formatting options (in excel) and simply click on "No
Color" for Filling (which is already selected), and confirm it with OK, it
works.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #30 from dollinger.florian@gmx.de ---
For:

+        if (this == o) 
+            return true;

I would say it's a bit faster if the object is identical to o (in terms of
"same" not just "equal") - since the method returns immediately then. But maybe
that's not the case too often...


The other two if's is just what i personally like
+        if (o == null) 
+            return false; 
+        if (o.getClass() != getClass()) 
+            return false;

Do you think it's slower in summary? It's not necessary to do it that way... I
just thought that the Patch is not applied yet and I can modify it however I
want xD

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #2 from dollinger.florian@gmx.de ---
Created attachment 34815
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34815&action=edit
The resulting file, which is not correctly displayed in Excel, but in
LibreOffice

The same problem holds for

Map<String, Object> prop = new HashMap<>();
prop.put(CellUtil.ROTATION, oldCell.getCellStyle().getRotation());
CellUtil.setCellStyleProperties(newCell, prop);

therefore it is not a cloneStyle issue I guess.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from dollinger.florian@gmx.de ---
there is a workaround, if you set the FillPattern by hand via

bla.setFillPattern(FillPatternType.SOLID_FOREGROUND);

for the cells which are in the range of some CF-rule, then the conditional
formatting works. the problem then is, that the cells background becomes BLACK
if the CF-rule(s) do not fire.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #15 from Dominik Stadler <do...@gmx.at> ---
Please note that providing a diff instead of the whole source of the files
would be better as the whole files can quickly become outdated due to other
changes to the codebase and thus will make applying the changes more and more
difficult over time. 

See http://poi.apache.org/guidelines.html#SubmittingPatches for some automated
ways of creating the patch-files.

Also ideally some additional unit-tests accompany a patch so the changes are
verified and stay in place correctly through future changes to the code.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #8 from dollinger.florian@gmx.de ---
Created attachment 34835
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34835&action=edit
a first idea how to patch it

A first approach to fix the issue, works for now but is still in progress. The
idea is to search the styles.xml for already existing fills before adding a new
one with the same properties.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #23 from dollinger.florian@gmx.de ---
Created attachment 34851
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34851&action=edit
corrected imports

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34847|0                           |1
        is obsolete|                            |
  Attachment #34849|0                           |1
        is obsolete|                            |

--- Comment #22 from dollinger.florian@gmx.de ---
Created attachment 34850
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34850&action=edit
version 3: non-forced font registration

again a new version with a non-forced font registration (does not create a new
one if the cloned one is available)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #13 from dollinger.florian@gmx.de ---
Created attachment 34839
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34839&action=edit
patched equals function

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #29 from Mark Murphy <jm...@apache.org> ---
Comment on attachment 34871
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34871
src, version 6: improved equals method

What is the purpose of this adjustment, It appears multiple times in your
changes.

-        if(!(o instanceof XSSFFont)) return false;
+        
+        if (this == o) 
+            return true;
+        if (o == null) 
+            return false; 
+        if (o.getClass() != getClass()) 
+            return false;

How does the new code provide a different outcome? Aren't you just replacing a
java construct with a bit of reflection?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #33 from Dominik Stadler <do...@gmx.at> ---
Applied most of the patch via r1849969, I left out the changes to
object-equals-checks, I wanted to avoid changing the behavior for now here. 

We very rarely see derived classes for these objects and thus the differences
are likely more academic than of actual relevance. 

For performance, I would only change it if some objective performance
measurement shows that it is contributing a lot to overall run time. "it should
be faster" is often a bad guidance for doing performance optimizations.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #6 from dollinger.florian@gmx.de ---
https://www.java-forums.org/apache-poi/96985-conditional-formatting-does-not-work-copied-cells.html#post417600

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #5 from dollinger.florian@gmx.de ---
Okay, the problem is the following:

Excel applies conditional formatting only to two sorts of cells:
1) those who have the default fillId=0
2) those who have a patternType like "solid"

But POI creates a new one like:

<patternFill>
<fgColor indexed="64"/>
<bgColor indexed="64"/>
</patternFill>

which does not fit any of those two sorts.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #17 from dollinger.florian@gmx.de ---
back to NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34835|0                           |1
        is obsolete|                            |
  Attachment #34837|0                           |1
        is obsolete|                            |
  Attachment #34838|0                           |1
        is obsolete|                            |
  Attachment #34839|0                           |1
        is obsolete|                            |

--- Comment #14 from dollinger.florian@gmx.de ---
Created attachment 34840
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34840&action=edit
patched equals functions for XSSFFont, XSSFCellFill and XSSFCellBorder

This patch changes the equals functions to a semantic one, rather than the
former syntactic one

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #7 from dollinger.florian@gmx.de ---
Thanks for all your replies!
I finally found out where the problem is:

1) Excel shows conditional formatting if, and only if, the cell has fillId=0
(the default NONE one) OR if the fillStylePattern != NONE.
Thats a bug in Excel, not in POI.

2) The problem is, that Excel is de facto "Standard".
POI calls like this to set the new Style: setCellStyleProperties >>
setFormatProperties >> setFillPattern

Here is what setFillPattern looks like:

Java Code:
public void setFillPattern(FillPatternType pattern) {
        CTFill ct = getCTFill();
        CTPatternFill ctptrn = ct.isSetPatternFill() ? ct.getPatternFill() :
ct.addNewPatternFill();

        if (pattern == FillPatternType.NO_FILL && ctptrn.isSetPatternType()) {
                ctptrn.unsetPatternType();
        } else {
               
ctptrn.setPatternType(STPatternType.Enum.forInt(pattern.getCode() + 1));
        }

        addFill(ct);
}


It (POI) does simply not check if the FillStyle does already exist, it always
adds a new one. And in general, this is then not fullfilling condtions in 1)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

andrey_chichkov@mail.ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #36 from andrey_chichkov@mail.ru ---
I'm very sorry, seems like it is a bug only for 4.1.2 version, last 4.* version
for now. We'll try to update to 5.*. 
In 5.2.0 version XSSFCellBorder.equals() method is extended to include diagonal
border checks that we need.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #35 from PJ Fanning <fa...@yahoo.com> ---
Andrey - could you provide a test case?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dollinger.florian@gmx.de

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #20 from dollinger.florian@gmx.de ---
Created attachment 34848
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34848&action=edit
corrected test cases

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #18 from Dominik Stadler <do...@gmx.at> ---
Yes, unit-tests are expected to run fine always, we had some failures on
Windows recently, but they should be fixed again. 

If they fail for you, please post on the dev-mailing-list so we can discuss if
it is a dev-setup-issue or a problem in the tests themselves.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #10 from dollinger.florian@gmx.de ---
The XML-Fragment results from the copy() function in CTFill!


 private CTFill getCTFill(){
  CTFill ct;
  // bug 56295: handle missing applyFill attribute as "true" because Excel does
as well
  if(!_cellXf.isSetApplyFill() || _cellXf.getApplyFill()) {
    int fillIndex = (int)_cellXf.getFillId();
    XSSFCellFill cf = _stylesSource.getFillAt(fillIndex);

    ct = (CTFill)cf.getCTFill().copy();
    // ^^^^^^

  } else {
      ct = CTFill.Factory.newInstance();
  }
  return ct;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #3 from dollinger.florian@gmx.de ---
Created attachment 34816
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34816&action=edit
corrupted styles.xml, which causes the described behaviour

i was able to find out which file in the .zip filestructure causes the problem,
it is the styles.xml, i will also add another one - which was created by excel
on the same basis - the latter is working

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #9 from dollinger.florian@gmx.de ---
Okay, I again looked at the code and problem I described at first is caused by
the following thing:

cloneStyleFrom adds the styles from the original to the destination like that:

---

CTFill fill = CTFill.Factory.parse(
    src.getCTFill().toString(), DEFAULT_XML_OPTIONS
);

addFill(fill);

---

I dont't know why, but that results in the following CTFill-String:

<xml-fragment
xmlns:main="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main">
  <main:patternFill patternType="none"/>
</xml-fragment>

which is definitely not the same as

<patternFill patternType="none"
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"/>

at least not syntactically.

---

addFill (StylesTable.java) now looks if the new FillStyle is already in the Set
by fills.indexOf(newFill).

indexOf is based on equals of XSSFCellFill, which does a string-Comparison!

---

One way to patch that would be to change the equals function to a semantic
comparison like:

public boolean equals(Object o) {
  if (!(o instanceof XSSFCellFill)) return false;

  XSSFCellFill cf = (XSSFCellFill) o;


  return (
    this.getFillBackgroundColor() == cf.getFillBackgroundColor()
    && this.getFillForegroundColor() == cf.getFillForegroundColor()
    && this.getPatternType() == cf.getPatternType()
  );
}

The downside is the deteriorated performance I guess. And you have to do the
same on XSSFFont.java and XSSFCellBorder.java (and maybe more).

---

Another way is to convert the "fragments" into normal XML inside
cloneStyleFrom(),
I am still looking for a way to do that reliable (using xmlbeans).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34846|0                           |1
        is obsolete|                            |

--- Comment #19 from dollinger.florian@gmx.de ---
Created attachment 34847
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34847&action=edit
better version

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34840|0                           |1
        is obsolete|                            |

--- Comment #16 from dollinger.florian@gmx.de ---
Created attachment 34846
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34846&action=edit
patch as a diff file (git)

Hey Dominik,
thanks for the advice, i added the patch diff file - i am not very familiar
with jUnit, but I will give it a try. Btw.: Should the current repository jUnit
tests run without any errors?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #26 from dollinger.florian@gmx.de ---
Created attachment 34854
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34854&action=edit
java source

looks like i am too stupid to use bugzilla xD

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #4 from dollinger.florian@gmx.de ---
Created attachment 34817
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34817&action=edit
working styles.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

andrey_chichkov@mail.ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #34 from andrey_chichkov@mail.ru ---
This fix seems to be incorrect. XSSFCellBorders with different diagonal border
settings are considered equals. It was working when xml representations were
compared.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|copied cell style and CF    |[PATCH] copied cell style
                   |                            |and CF
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #21 from dollinger.florian@gmx.de ---
Created attachment 34849
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34849&action=edit
version 3: non-forced font registration

again a new version with a non-forced font registration (does not create a new
one if the cloned one is available)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34848|0                           |1
        is obsolete|                            |

--- Comment #25 from dollinger.florian@gmx.de ---
Created attachment 34853
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34853&action=edit
testcases

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.15-FINAL                  |3.16-dev

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34840|text/plain                  |application/zip
          mime type|                            |
  Attachment #34840|1                           |0
           is patch|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #31 from Mark Murphy <jm...@apache.org> ---
(In reply to dollinger.florian from comment #30)
> For:
> 
> +        if (this == o) 
> +            return true;
> 
> I would say it's a bit faster if the object is identical to o (in terms of
> "same" not just "equal") - since the method returns immediately then. But
> maybe that's not the case too often...
> 
> 
> The other two if's is just what i personally like
> +        if (o == null) 
> +            return false; 
> +        if (o.getClass() != getClass()) 
> +            return false;
> 
> Do you think it's slower in summary? It's not necessary to do it that way...
> I just thought that the Patch is not applied yet and I can modify it however
> I want xD

Well, there is a great debate about which is correct, but in this case,
sticking with instanceof seems correct to me simply because changing to
getClass is an unnecessary breaking change. Unless there is a bug introduced by
the instanceof, I would keep it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34856|0                           |1
        is obsolete|                            |

--- Comment #28 from dollinger.florian@gmx.de ---
Created attachment 34871
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34871&action=edit
src, version 6: improved equals method

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #12 from dollinger.florian@gmx.de ---
Created attachment 34838
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34838&action=edit
patched equals function

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #11 from dollinger.florian@gmx.de ---
Created attachment 34837
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34837&action=edit
patched equals function

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

dollinger.florian@gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34850|0                           |1
        is obsolete|                            |
  Attachment #34851|0                           |1
        is obsolete|                            |

--- Comment #24 from dollinger.florian@gmx.de ---
Created attachment 34852
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34852&action=edit
corrected imports

marked as patch and obsolete versions

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60845] [PATCH] copied cell style and CF

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #32 from dollinger.florian@gmx.de ---
Well, I was thinking since yesterday why and which one is preferable over the
other and came to the conclusion that the method I used is maybe a bit more
reliable, since

a.getClass() == b.getClass()

returns TRUE only, if the two Classes are really the same. In contrast,

a instanceOf bClass

returns also true, if a is of a subclass of b.
I think that violates the equals contract on transitivity.

I also found a website telling the same: http://onewebsql.com/blog/on-equals

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org