diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 42050460b..aeb943121 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 52244 - use correct text attributes when presentation has multiple TxMasterStyleAtoms of the same type support setting background color of sheet tab in XSSF 51564 - support for enforcing fields update in XWPF 51673 - support grouping rows in SXSSF diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java b/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java index 5ebbb27fb..a103d09c7 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java @@ -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]; } } } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java index 471ee5bb5..f59eef3a5 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java @@ -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 index 000000000..aaf384360 Binary files /dev/null and b/test-data/slideshow/52244.ppt differ