You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/06/06 14:23:03 UTC
DO NOT REPLY [Bug 45150] New: Mutiple Textboxes from a Slide all
return the same Text.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
Summary: Mutiple Textboxes from a Slide all return the same Text.
Product: POI
Version: 3.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSLF
AssignedTo: dev@poi.apache.org
ReportedBy: daniel.kessler@tt-n.de
I use:
Shape[] shapes = slide.getShapes();
for (int i = 0; i < shapes.length; i++) {
if ( shapes[i] instanceof TextBox ) {
TextBox textBox = (TextBox) shapes[i];
System.out.println(textBox.getText());
}
}
For Example :
I have 4 Textboxes on a slide.
They are all saved in the Shape[].
The method "getText" always returns the same text even if the texts in the
presentation are different.
Is it just a mistake made by myself or a bug?
Im using Poi 3.0.2 Final.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #9 from Yegor Kozlov <ye...@dinom.ru> 2008-11-16 05:38:27 PST ---
I'm marking it as NEEDINFO. If you have more ppt files demonstrating the same
issue, please re-open this bug and upload the files. I will try to figure out
the pattern.
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
--- Comment #7 from Yegor Kozlov <ye...@dinom.ru> 2008-06-06 11:53:25 PST ---
(In reply to comment #4)
> Could you be so nice and show me the way you would walk through the slide
>
> to get
>
> the 4 textboxes
> the autoform (leftrightarrow) and how to make a differen bethween them?
>
> im kinda blocked now -.-
>
Something like this:
/**
* Recursively walk the slides and print basic shape properties
*
* @author Yegor Kozlov
*/
public class SlideWalker {
public static void main(String[] args) throws Exception {
SlideShow ppt = new SlideShow(new FileInputStream(args[0]));
Slide[] slide = ppt.getSlides();
for (int i = 0; i < slide.length; i++) {
System.out.println("Slide: " + slide[i].getTitle());
Shape[] shape = slide[i].getShapes();
for (int j = 0; j < shape.length; j++) {
print(shape[j]);
}
}
}
public static void print(Shape shape) throws Exception {
if(shape instanceof ShapeGroup){
ShapeGroup group = (ShapeGroup)shape;
Shape[] sh = group.getShapes();
for (int i = 0; i < sh.length; i++) {
print(sh[i]);
}
} else {
System.out.println("Name: " + shape.getShapeName());
System.out.println(" " + shape.getClass().getName());
System.out.println(" " + shape.getAnchor());
if(shape instanceof TextShape){
String text = ((TextShape)shape).getText();
if(text != null) System.out.println(" " + text);
}
}
}
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
--- Comment #6 from Yegor Kozlov <ye...@dinom.ru> 2008-06-06 11:51:20 PST ---
Where was this presentation created? Which version of PowerPoint or OpenOffice?
All shapes have shapeId=0 and this is why HSLF fails to link shapes and text
runs.
Regards,
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2008-06-06 05:52:37 PST ---
Please try poi-3.1-beta2. If the problem persists, attach the problem file to
this bug.
Regards,
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
Daniel <da...@tt-n.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
--- Comment #4 from Daniel <da...@tt-n.de> 2008-06-06 07:29:42 PST ---
Could you be so nice and show me the way you would walk through the slide
to get
the 4 textboxes
the autoform (leftrightarrow) and how to make a differen bethween them?
im kinda blocked now -.-
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
Daniel <da...@tt-n.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
--- Comment #5 from Daniel <da...@tt-n.de> 2008-06-06 07:42:14 PST ---
Errr, the different texts from the textboxes are more interesting..
it seems for me as if they all had the same textrun?
no different formatting anymore ...
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> 2008-06-06 06:32:32 PST ---
AutoShape extends TextShape. See the javadocs.
Change your code as follows and try 3.1-beta2.
for (int i = 0; i < shapes.length; i++) {
if ( shapes[i] instanceof TextShape) {
TextShape textBox = (TextShape) shapes[i];
System.out.println(textBox.getText());
}
}
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
--- Comment #8 from Daniel <da...@tt-n.de> 2008-06-09 01:17:30 PST ---
(In reply to comment #6)
> Where was this presentation created? Which version of PowerPoint or OpenOffice?
> All shapes have shapeId=0 and this is why HSLF fails to link shapes and text
> runs.
>
>
> Regards,
> Yegor
>
Guess it was Powerpoint 2000.
I´ll check the result now if i create a presentation with 2003.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 45150] Mutiple Textboxes from a Slide all return
the same Text.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45150
--- Comment #2 from Daniel <da...@tt-n.de> 2008-06-06 06:21:03 PST ---
Created an attachment (id=22087)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=22087)
The presentation i want to import.
Its just about the first slide.
Different texts..
I get all the boxes and the borderstyles etc.
but the texts are always the same.
Any suggestions?
Beta 3.1.2 is nearly useless for me because textboxes are handled as
autoshapes(?).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org