]> source.dussan.org Git - poi.git/commitdiff
Use a different arbitrary value for the ID of the comment shape type. This appears...
authorDavid North <dnorth@apache.org>
Wed, 3 Jun 2015 12:50:10 +0000 (12:50 +0000)
committerDavid North <dnorth@apache.org>
Wed, 3 Jun 2015 12:50:10 +0000 (12:50 +0000)
Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=55410

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1683315 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java

index a1458662bf4b41a3e57328c72d60d42a1e9dc27c..75f292fa6352adaefe581c03e96db173363f2a0a 100644 (file)
@@ -68,6 +68,7 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart {
     private static final QName QNAME_SHAPE_LAYOUT = new QName("urn:schemas-microsoft-com:office:office", "shapelayout");
     private static final QName QNAME_SHAPE_TYPE = new QName("urn:schemas-microsoft-com:vml", "shapetype");
     private static final QName QNAME_SHAPE = new QName("urn:schemas-microsoft-com:vml", "shape");
+    private static final String COMMENT_SHAPE_TYPE_ID = "_x0000_t202"; // this ID value seems to have significance to Excel >= 2010; see https://issues.apache.org/bugzilla/show_bug.cgi?id=55409
 
     /**
      * regexp to parse shape ids, in VML they have weird form of id="_x0000_s1026"
@@ -190,7 +191,7 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart {
         _qnames.add(QNAME_SHAPE_LAYOUT);
 
         CTShapetype shapetype = CTShapetype.Factory.newInstance();
-        _shapeTypeId = "_xssf_cell_comment";
+        _shapeTypeId = COMMENT_SHAPE_TYPE_ID;
         shapetype.setId(_shapeTypeId);
         shapetype.setCoordsize("21600,21600");
         shapetype.setSpt(202);
index 346abe0790c9d2d6b258f11a4b648b125615252a..5bb3acd0fb2bbc275ec483e321214b766833d7a2 100644 (file)
@@ -54,14 +54,14 @@ public class TestXSSFVMLDrawing extends TestCase {
         assertEquals("21600,21600", type.getCoordsize());
         assertEquals(202.0f, type.getSpt());
         assertEquals("m,l,21600r21600,l21600,xe", type.getPath2());
-        assertEquals("_xssf_cell_comment", type.getId());
+        assertEquals("_x0000_t202", type.getId());
         assertEquals(STTrueFalse.T, type.getPathArray(0).getGradientshapeok());
         assertEquals(STConnectType.RECT, type.getPathArray(0).getConnecttype());
 
         CTShape shape = vml.newCommentShape();
         assertEquals(3, items.size());
         assertSame(items.get(2),  shape);
-        assertEquals("#_xssf_cell_comment", shape.getType());
+        assertEquals("#_x0000_t202", shape.getType());
         assertEquals("position:absolute; visibility:hidden", shape.getStyle());
         assertEquals("#ffffe1", shape.getFillcolor());
         assertEquals(STInsetMode.AUTO, shape.getInsetmode());