]> source.dussan.org Git - poi.git/commitdiff
#53192 - Images in ppt file have wrong width when convering ppt to png
authorAndreas Beeker <kiwiwings@apache.org>
Mon, 9 Nov 2015 01:28:31 +0000 (01:28 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Mon, 9 Nov 2015 01:28:31 +0000 (01:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713332 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
test-data/slideshow/bug53192.ppt [new file with mode: 0644]

index 474d357137f5dcebbcdd8303dac70bbcba506bd0..0bd364b9e9aa7145f8dd64c837bd1e95ad0ec607 100644 (file)
@@ -298,21 +298,26 @@ public class DrawTextParagraph implements Drawable {
         TextCap cap = tr.getTextCap();\r
         String tabs = null;\r
         for (char c : tr.getRawText().toCharArray()) {\r
-            if(c == '\t') {\r
-                if (tabs == null) {\r
-                    tabs = tab2space(tr);\r
-                }\r
-                buf.append(tabs);\r
-                continue;\r
-            }\r
-\r
-            switch (cap) {\r
-                case ALL: c = Character.toUpperCase(c); break;\r
-                case SMALL: c = Character.toLowerCase(c); break;\r
-                case NONE: break;\r
+            switch (c) {\r
+                case '\t':\r
+                    if (tabs == null) {\r
+                        tabs = tab2space(tr);\r
+                    }\r
+                    buf.append(tabs);\r
+                    break;\r
+                case '\u000b':\r
+                    buf.append('\n');\r
+                    break;\r
+                default:\r
+                    switch (cap) {\r
+                        case ALL: c = Character.toUpperCase(c); break;\r
+                        case SMALL: c = Character.toLowerCase(c); break;\r
+                        case NONE: break;\r
+                    }\r
+    \r
+                    buf.append(c);\r
+                    break;\r
             }\r
-\r
-            buf.append(c);\r
         }\r
 \r
         return buf.toString();\r
diff --git a/test-data/slideshow/bug53192.ppt b/test-data/slideshow/bug53192.ppt
new file mode 100644 (file)
index 0000000..54797b5
Binary files /dev/null and b/test-data/slideshow/bug53192.ppt differ