Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on LibreOffice 3.5 #3

Closed
ebugnet opened this issue Sep 20, 2012 · 11 comments
Closed

Error on LibreOffice 3.5 #3

ebugnet opened this issue Sep 20, 2012 · 11 comments

Comments

@ebugnet
Copy link

ebugnet commented Sep 20, 2012

Hi,
I got an error on LO 3.5

New file is created, loaded, some slides are generated... but :

Macro stop on slide.remove(shapes(n)) from :

' remove from the given slide all shapes that are invisible in the specified frame
sub removeInvisibleShapes(slide as Object, visibility, frame as Integer)
shapes = getAnimatedShapes(slide)
for n = 0 to UBound(shapes)
if visibility(n, frame) = false then
slide.remove(shapes(n)) <------ HERE
end if
next
end sub

Message is :
Cannot coerce argument type during corereflection call!

Have any idea ?
Thanks
Eric

@monperrus
Copy link
Owner

Seems similar to #1
Do your animations involve text fragments?

@ebugnet
Copy link
Author

ebugnet commented Sep 20, 2012

I think it was, but no !
I test again with a new file, just one slide, one word in title, one word in text boxe (write here)...
Animate with appear effect only...
Same symptoms.

I'm on ubuntu, and using LO 3.5...
I will test my file on windows, and LO 3.4 if I can see something else.

Thanks, Eric

@ebugnet
Copy link
Author

ebugnet commented Sep 20, 2012

Hi again.
OK, it seems to be a bug for Libreoffice 3.5, 3.6.1, 3.6.2 (test this 3)
When you animate a text boxe, you can't choose "as one object"
Defaut is line by line, and changing this option crash impress !

@ebugnet ebugnet closed this as completed Sep 20, 2012
@Johann-Tree
Copy link

Hi,

I run into the same error. I don't know how to fix it but I have an idea how to one possibly can get around it.
What would you think about adding the following feature?

Providing an option which cause that a slide containing a bulleted list will be duplicated as often that the first slide has just the first bullet point and that on the next slide is just one more bullet, and so on. So no worrying about any effects added to that text box. :-)Maybe a second option could be interesting to also get another slide for a bullet down in the hierarchy. (I'm sorry, I don't know the right term because I'm using the German version of LO…)

I think this would be very helpful because I'm using Impress mostly like in this description: http://www.xaprb.com/blog/2007/08/06/how-to-create-stepping-slides-in-openofficeorg-impress/

Thank you very much,
Johann

@monperrus
Copy link
Owner

Hi Johann,

I really like your idea. I'm quite busy these days, so feel free to
implement it.

Regards, --Martin

On Sun, Dec 30, 2012 at 9:12 PM, Johann-Tree notifications@github.comwrote:

Hi,

I run into the same error. I don't know how to fix it but I have an idea
how to one possibly can get around it.
What would you think about adding the following feature?

Providing an option which cause that a slide containing a bulleted list
will be duplicated as often that the first slide has just the first bullet
point and that on the next slide is just one more bullet, and so on. So no
worrying about any effects added to that text box. :-)Maybe a second option
could be interesting to also get another slide for a bullet down in the
hierarchy. (I'm sorry, I don't know the right term because I'm using the
German version of LO…)

I think this would be very helpful because I'm using Impress mostly like
in this description:
http://www.xaprb.com/blog/2007/08/06/how-to-create-stepping-slides-in-openofficeorg-impress/

Thank you very much,
Johann


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-11768237.

@grrrats
Copy link

grrrats commented Jan 10, 2013

I just developed a patch that solves this problem, at least for OO 3.5. The error arises because the code expects all animation targets to be UNO shape objects (e.g. SvxShapeText), but animating a text box (even a single-paragraph text box) creates a UNO struct of type com.sun.star.presentation.ParagraphTarget. This struct contains two variables, one of which is of type SvxShapeText and seems to refer to the entire text box.

I don't see how to upload a patch here, so I'll just describe my (very simple) fix below:

In these two functions:

getAnimatedShapes
getShapeVisibility

after the line:

target = animNode.target

I added the following lines:

if (IsUnoStruct(target)) then 'handle com.sun.star.presentation.ParagraphTarget
    target = target.Shape
end if

Thanks for a useful extension!
Philip

@monperrus
Copy link
Owner

Hi Philip,

Thanks very much for the patch. Could you send it as attachment, I'll
commit it to the repo.

Regards, --Martin

On 01/10/2013 06:01 PM, grrrats wrote:

I just developed a patch that solves this problem, at least for OO
3.5. The error arises because the code expects all animation targets
to be UNO shape objects (e.g. SvxShapeText), but animating a text box
(even a single-paragraph text box) creates a UNO struct of type
com.sun.star.presentation.ParagraphTarget. This struct contains two
variables, one of which is of type SvxShapeText and seems to refer to
the /entire/ text box.

I don't see how to upload a patch here, so I'll just describe my (very
simple) fix below:

In these two functions:
getAnimatedShapes
getShapeVisibility
after the line:
target = animNode.target
I added the following lines:
if (IsUnoStruct(target)) then 'handle
com.sun.star.presentation.ParagraphTarget
target = target.Shape
end if

Thanks for a useful extension!
Philip


Reply to this email directly or view it on GitHub
#3 (comment).

@grrrats
Copy link

grrrats commented Jan 24, 2013

Hi Martin,

See attached for patch.  Note that this change also eliminates the error message in issue number #2, although it does not solve that issue because the entire text box will be displayed instead of just the relevant paragraph.

Regards,
Philip

--- On Wed, 1/23/13, Martin Monperrus notifications@github.com wrote:
Hi Philip,

Thanks very much for the patch. Could you send it as attachment, I'll

commit it to the repo.

Regards, --Martin

@grrrats
Copy link

grrrats commented Jan 24, 2013

Unbelievable. Github seems to silently delete attachments when commenting via email and (from googling) has no means of attaching a patch to an issue. Here it is embedded in this comment:

diff --git a/src/ExpandAnimations.bas b/src/ExpandAnimations.bas
index da22ead..b128c57 100644
--- a/src/ExpandAnimations.bas
+++ b/src/ExpandAnimations.bas
@@ -183,6 +183,10 @@ function getAnimatedShapes(slide as Object)
                     animNode = animNodes.nextElement()
                     if isVisibilityAnimation(animNode) then
                         target = animNode.target
+                        'special handling for com.sun.star.presentation.ParagraphTarget
+                        if (IsUnoStruct(target)) then
+                           target = target.Shape
+                        end if
                         ' if we haven't seen this shape yet, add it to the array
                         if not containsObject(shapes, target) then
                             newUBound = UBound(shapes) + 1
@@ -233,6 +237,10 @@ function getShapeVisibility(slide as Object, nFrames as Integer)
                              animNode = animNodes.nextElement()
                              if isVisibilityAnimation(animNode) then
                                 target = animNode.target
+                                'special handling for com.sun.star.presentation.ParagraphTarget
+                                if (IsUnoStruct(target)) then
+                                   target = target.Shape
+                                end if
                                 ' if this is the shape we want, check the visibility
                                 if EqualUnoObjects(shape, target) then
                                     visCurrent = animNode.To

@monperrus
Copy link
Owner

Hi Philip,

Added your patch (see
cf23f01).
The new installation file is
https://raw.github.com/monperrus/ExpandAnimations/master/dist/ExpandAnimations-0.2.oxt

Thanks again for the contribution.

--Martin

On 01/24/2013 04:12 PM, Philip Johnson wrote:

Hi Martin,

See attached for patch. Note that this change also eliminates the
error message in issue number #2, although it does not solve that
issue because the entire text box will be displayed instead of just
the relevant paragraph.

Regards,
Philip

--- On Wed, 1/23/13, Martin Monperrus notifications@github.com wrote:
Hi Philip,

Thanks very much for the patch. Could you send it as attachment, I'll

commit it to the repo.

Regards, --Martin


Reply to this email directly or view it on GitHub
#3 (comment).

@Johann-Tree
Copy link

Hi Martin,

I really like your idea. I'm quite busy these days, so feel free to implement it.

I'm sorry, I somehow forget to respond in time.
Unfortunately I'm not able to implement the idea myself because I'm not a programmer but only a user. So I would be really glad if you (or someone else) would do this. But probably you're still busy, I guess?
I don't know how much work would be necessary but I'm willing to donate.

I really like your addon but until know it's not really useful for me.

Thank you very much,
Johann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants