]> source.dussan.org Git - poi.git/commitdiff
bugzilla 52244 - use correct text attributes when presentation has multiple TxMasterS...
authorYegor Kozlov <yegor@apache.org>
Thu, 1 Mar 2012 09:03:16 +0000 (09:03 +0000)
committerYegor Kozlov <yegor@apache.org>
Thu, 1 Mar 2012 09:03:16 +0000 (09:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1295478 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java
src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
test-data/slideshow/52244.ppt [new file with mode: 0644]

index 42050460beff97170d99e348b34e76a9c68c020b..aeb943121bf7886beb61269a5c69a8ec5624d921 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta6" date="2012-??-??">
+           <action dev="poi-developers" type="fix">52244 - use correct text attributes when presentation has multiple TxMasterStyleAtoms of the same type</action>
            <action dev="poi-developers" type="add">support setting background color of sheet tab in XSSF</action>
            <action dev="poi-developers" type="add">51564 - support for enforcing fields update in XWPF</action>
            <action dev="poi-developers" type="add">51673 - support grouping rows in SXSSF</action>
index 5ebbb27fbabf77adfb8ad667ef4a5168a0707dcc..a103d09c777e082fa8c6a515b30049ff34fa79f8 100644 (file)
@@ -124,7 +124,8 @@ public final class SlideMaster extends MasterSheet {
 
             TxMasterStyleAtom[] txrec = ((MainMaster)getSheetContainer()).getTxMasterStyleAtoms();
             for (int i = 0; i < txrec.length; i++) {
-                _txmaster[txrec[i].getTextType()] = txrec[i];
+                int txType = txrec[i].getTextType();
+                if(_txmaster[txType] == null) _txmaster[txType] = txrec[i];
             }
         }
     }
index 471ee5bb50abe1cb2e1df37d88eccdfdcf5b880f..f59eef3a5f95c1f3c082af509235c3f9f6d0e034 100644 (file)
@@ -531,4 +531,21 @@ public final class TestTextRun extends TestCase {
         }
 
     }
+
+    public void test52244() throws IOException {
+        SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("52244.ppt"));
+        Slide slide = ppt.getSlides()[0];
+        TextRun[] runs = slide.getTextRuns();
+
+        assertEquals("Arial", runs[0].getRichTextRuns()[0].getFontName());
+        assertEquals(36, runs[0].getRichTextRuns()[0].getFontSize());
+
+        assertEquals("Arial", runs[1].getRichTextRuns()[0].getFontName());
+        assertEquals(24, runs[1].getRichTextRuns()[0].getFontSize());
+
+        assertEquals("Arial", runs[2].getRichTextRuns()[0].getFontName());
+        assertEquals(32, runs[2].getRichTextRuns()[0].getFontSize());
+
+    }
+
 }
diff --git a/test-data/slideshow/52244.ppt b/test-data/slideshow/52244.ppt
new file mode 100644 (file)
index 0000000..aaf3843
Binary files /dev/null and b/test-data/slideshow/52244.ppt differ