From 3e3ed348cc702a6994832b8b155b8c87eabfbfe3 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Wed, 16 Apr 2008 07:47:16 +0000 Subject: [PATCH] bug #41071 is fixed in trunk. Added a unit test and resolved. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@648589 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/changes.xml | 3 +++ src/documentation/content/xdocs/status.xml | 3 +++ .../org/apache/poi/hslf/data/41071.ppt | Bin 0 -> 18432 bytes .../apache/poi/hslf/usermodel/TestBugs.java | 20 ++++++++++++++++++ 4 files changed, 26 insertions(+) create mode 100755 src/scratchpad/testcases/org/apache/poi/hslf/data/41071.ppt diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 91090ca5ae..817bd818b7 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,9 @@ + HSLF: Implemented more methods in PPGraphics2D + HSLF: Added Freeform shape which can contain both lines and Bezier curves + 41071 - Improved text extraction in HSLF 30311 - Conditional Formatting - improved API, added HSSFSheetConditionalFormatting Update the formula parser code to use a HSSFWorkbook, rather than the low level model.Workbook, to make things cleaner and make supporting XSSF formulas in future much easier Fix the logger used by POIFSFileSystem, so that commons-logging isn't required when not used diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index ea31578414..6fb6c35c03 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,9 @@ + HSLF: Implemented more methods in PPGraphics2D + HSLF: Added Freeform shape which can contain both lines and Bezier curves + 41071 - Improved text extraction in HSLF 30311 - Conditional Formatting - improved API, added HSSFSheetConditionalFormatting Update the formula parser code to use a HSSFWorkbook, rather than the low level model.Workbook, to make things cleaner and make supporting XSSF formulas in future much easier Fix the logger used by POIFSFileSystem, so that commons-logging isn't required when not used diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/data/41071.ppt b/src/scratchpad/testcases/org/apache/poi/hslf/data/41071.ppt new file mode 100755 index 0000000000000000000000000000000000000000..4a443025e2f1d62ed8e6ea5fe32e9d90e8346ca0 GIT binary patch literal 18432 zcmeHP3viUx6+Zj_8?p%ryCfir3O|T~7BL!H6%_;G0}+T2D^8g)k!-?ZvYT!eP^TT& z@kQ%n@QG+E_-F^I?f9tU^r6yr9BBtDW3>Yv?Zm0hP^7v(8((a{@817z{`}b`8%#lF za+$mLeeOBuo_o&u@4aFBD_H8UWyn(EJG|u9FAClScy0SF^mWikRuSe{?$lFA&y2o z%&lWR!&sD$L_7-dXvA@drcL)4`aM`2SR@JjONk@rN*rlYuEy#V9}a`W7~H7~BDY=F z{J_FjM&7hrHp_30-{pn0{lSkiw^zRusA46B3ZWjeua+q0WiF<0aAXeh%VedrqlH)% z4pYPmSZJpF5|6??ds^6k=M-Hok;Q7Bc4<`FPLJJ~__MePejg zr$d2?HX@8r(udZ8;d2`1H**(Dzk_)*Tr7mJ?6M!jCJ)HJZL%bd&D({I&B#3U0hfw< zeJ-LqED)9t?JH0?Nw$Wm7i#3yF!{g`me)(~Q@LlubC5QGi(JW0aby9~)krCKltQjhk7jYKCPp=oQ2g{t)ft6IY10+*I#+lUgb2nM8 zpTBJSUEso->ZVFVdFG?_V=(}hOAUVg^()j)eA(t*cQ1a19y3pWsiDL4>#uC)HT_NMpVwdZ_M>-V=J_V4*URus z4RF1V_9k>aw|nTOS>*N$fe7^TmH?_kFRGesAcVaiu%LxPH8S=C%4_YmTFKV3e+x9( zxDTk&5kefre*cA%A1|3Oy)==JY<6}UOjtg*TUn63 zwvru8B463l@yo5->`9T8U(Z@6p&PW~XPM!&PqNt)KBsD~mJa#CHma-!wF^Jv z3r|Nq&FM_aAx=x*>BeEI+o7lfzUk_)^}W+|0FUt!3Z4l#hNRiZaSoGC2Pst_m)Fp) zy)k_qJNiO3V2lcCPLB?f)4#pziBIJ(_n-00(z{<`N~dPLl=hlu0{U?tlX9L*y31>r z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RXo1$9Pn{?9=!xerk6Hf+z zIu4VOcFx%lYmat13!ePG)D>B$t?}CA(m>3cIFzzn@1;nZLWk(;l&@{ z**bCwuKoBLx7aWiE8+Dkiy22xV`ecOi|jMd`HKWwbhkr!{sZ~`yZ-SrX56`9>(Kje zNY*#y{WtXN(5q{^Q5#TvZlr^0s&Uw}eZRVYvwN_Vyckbv^Xz8oun%t82ZL z{J(g)eQ3P8UZOD9e=X3AJoh}mQu4pL_TLK)=CkPc?3dMdVb8PZLRY~*L_gl0n>T-d1|5wQke|_4H^Z;P-xtQuKu^)vd$PIDMzn za%f!1^7@URx_r~R3Rh^nYTJ4oiRgXBwg_!MRdn@Sv9Z@s=$8ZL+m-$V?LK9hdzdz! z{snz4p4HG7qyNQ|1^Qh)@8QxMfk+q=-4w3_bASKMdI#k~fB((DJvVoWJpX3@p>SY1 zaInsQ=3u=CD|k6JSTF|y=TM#>rcT-Gf$V?oS?>SAxSyW@IMf}-AWlL&7Lgi$GU8ys z_pZ%QJ`V?!)*rh6J(%~ulzZ>}Z-u)56}c?hia#rum$;@av5L0%GMvn};!kptaOLJ9 Sy$1gaLPA!dMe6qVj{SdRx^IjC literal 0 HcmV?d00001 diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java index 19e7af6417..6947ff9cfd 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -360,4 +360,24 @@ public class TestBugs extends TestCase { assertTrue("No Exceptions while reading file", true); } + + /** + * Bug 41071: Will not extract text from Powerpoint TextBoxes + */ + public void test41071() throws Exception { + FileInputStream is = new FileInputStream(new File(cwd, "41071.ppt")); + SlideShow ppt = new SlideShow(is); + is.close(); + + Slide slide = ppt.getSlides()[0]; + Shape[] sh = slide.getShapes(); + assertEquals(1, sh.length); + assertTrue(sh[0] instanceof TextShape); + TextShape tx = (TextShape)sh[0]; + assertEquals("Fundera, planera och involvera.", tx.getTextRun().getText()); + + TextRun[] run = slide.getTextRuns(); + assertEquals(1, run.length); + assertEquals("Fundera, planera och involvera.", run[0].getText()); + } } -- 2.39.5