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 2009/05/25 15:33:52 UTC

DO NOT REPLY [Bug 47261] New: SlideShow.removeSlide makes PPT corrupted

https://issues.apache.org/bugzilla/show_bug.cgi?id=47261

           Summary: SlideShow.removeSlide makes PPT corrupted
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: HSLF
        AssignedTo: dev@poi.apache.org
        ReportedBy: cvolozhin@pragmaticsoft.com


removeSlide method of SlideShow makes PPT corrupted.
Check code snippet below.
When I try to open TestSlide_Empty.ppt in MS Powerpoint 2003, I catch
"PowerPoint was unable to display some og the text...". error. See full error
text in attached screenshot.

Code snippet:

import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;

public class POITest {

    public static void main(String[] args) throws Exception {

        SlideShow ppt = new SlideShow(new FileInputStream("TestSlide.ppt"));

        Slide[] slides = ppt.getSlides();

        for (int i = 0; i < slides.length; i++) {
          ppt.removeSlide(0);
        }

        FileOutputStream out = new FileOutputStream("TestSlide_Empty.ppt");
        ppt.write(out);
        out.close();

    }

}

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261





--- Comment #2 from Constantin <cv...@pragmaticsoft.com>  2009-05-25 06:37:21 PST ---
Created an attachment (id=23712)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23712)
Screenshot

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261





--- Comment #1 from Constantin <cv...@pragmaticsoft.com>  2009-05-25 06:35:29 PST ---
Created an attachment (id=23711)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23711)
TestSlide.ppt

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261





--- Comment #4 from Constantin <cv...@pragmaticsoft.com>  2009-06-17 07:14:21 PST ---
(In reply to comment #3)
> Is this error with POI-3.2 FINAL or on the current trunk?
> 
> Would you please describe your use case within your production.

On trunk and on 3.2.
I use this method to remove slides.

-- 
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


[Bug 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261

Andreas Beeker <an...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Andreas Beeker <an...@gmx.de> ---
Fix applied with r1648458
Although saving a PPT without slides doesn't make sense, there was a problem
with an optional RoundTripCustomTableStyles12Atom, which occured when all
slides were removed and new slides created afterwards - this is fixed now.

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261

Constantin <cv...@pragmaticsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |blocker

-- 
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


Re: DO NOT REPLY [Bug 47261] SlideShow.removeSlide makes PPT corrupted

Posted by Constantin Volozhin <cv...@pragmaticsoft.com>.
Thank you a lot for great job, Yegor!
Regards.

> https://issues.apache.org/bugzilla/show_bug.cgi?id=47261
> 
> 
> 
> 
> 
> --- Comment #7 from Yegor Kozlov <ye...@dinom.ru>  2009-06-27 03:27:04 PST ---
> Should be fixed in r788948 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=788948 ). There was a typo that prevented deletion of slide's
> notes. 
> 
> Regards,
> Yegor
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261





--- Comment #7 from Yegor Kozlov <ye...@dinom.ru>  2009-06-27 03:27:04 PST ---
Should be fixed in r788948 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=788948 ). There was a typo that prevented deletion of slide's
notes. 

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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal

--- Comment #10 from Yegor Kozlov <ye...@dinom.ru> 2010-02-14 17:09:22 UTC ---
Constantin,

Please don't abuse Bugzilla. Changing the priority of a bug to Blocker will not
help us to fix it sooner. 
If you are really interested in fixing this bug - you are welcome to do a
research and figure out which bits in the PPT format are broken. If you need a
guidance, please ask, I will be happy to help.

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


Re: [Bug 47261] SlideShow.removeSlide makes PPT corrupted

Posted by Constantin Volozhin <cv...@pragmaticsoft.com>.
Yegor,
could you please look at 
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261
comment #6?


> https://issues.apache.org/bugzilla/show_bug.cgi?id=47261
> 
> 
> Yegor Kozlov <ye...@dinom.ru> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
> 
> 
> 
> 
> --- Comment #5 from Yegor Kozlov <ye...@dinom.ru>  2009-06-19 06:27:28 PST ---
> Should be fixed in r786501 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=786501 ). PowerPoint wasn't happy to find orphan references
> to notes belonging to the deleted slide. 
> 
> P.S. PowerPoint 2007 silently ignored this bug, the alert was only in
> PowerPoint 2003 and older.
> 
> Yegor
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261


Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #5 from Yegor Kozlov <ye...@dinom.ru>  2009-06-19 06:27:28 PST ---
Should be fixed in r786501 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=786501 ). PowerPoint wasn't happy to find orphan references
to notes belonging to the deleted slide. 

P.S. PowerPoint 2007 silently ignored this bug, the alert was only in
PowerPoint 2003 and older.

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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261





--- Comment #6 from Constantin <cv...@pragmaticsoft.com>  2009-06-22 03:20:22 PST ---
Created an attachment (id=23844)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23844)
Another PPT

Thanks for quick feedback, Yegor,
but bug still here.
I have attached another PPT, that still causes error.
Could you check please?
Use the same code snippet.

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261

Constantin <cv...@pragmaticsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #9 from Constantin <cv...@pragmaticsoft.com> 2009-10-08 04:05:53 PDT ---
comment #8

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261





--- Comment #3 from David Fisher <df...@jmlafferty.com>  2009-06-17 07:08:05 PST ---
Is this error with POI-3.2 FINAL or on the current trunk?

Would you please describe your use case within your production.

-- 
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 47261] SlideShow.removeSlide makes PPT corrupted

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47261

Constantin <cv...@pragmaticsoft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23711|0                           |1
        is obsolete|                            |
  Attachment #23712|0                           |1
        is obsolete|                            |
  Attachment #23844|0                           |1
        is obsolete|                            |

--- Comment #8 from Constantin <cv...@pragmaticsoft.com> 2009-10-08 04:04:49 PDT ---
Created an attachment (id=24364)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24364)
PowerPoint file

Code snippet:

import java.io.FileInputStream;

import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;

public class POITest {

    public static void main(String[] args) throws Exception {

        SlideShow ppt = new SlideShow(new FileInputStream("tt2.ppt"));

        Slide[] slides = ppt.getSlides();

        for (int i = 0; i < slides.length; i++) {
          ppt.removeSlide(0);
        }

        Slide newSlide = ppt.createSlide();

    }

}

This code generates following error:

Exception in thread "main" java.lang.IllegalStateException: The last child
record of a Document should be EndDocument, but it was
org.apache.poi.hslf.record.UnknownRecordPlaceholder@12d96f2
    at
org.apache.poi.hslf.record.Document.addSlideListWithText(Document.java:179)
    at org.apache.poi.hslf.usermodel.SlideShow.createSlide(SlideShow.java:700)
    at POITest.main(POITest.java:19)

With removeSlide commented works ok.
tt2.ppt attached (file received from our customer)

-- 
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