[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    RE: Layout. cpp and captions
From:       Korinek Pavol <pavol.korinek () ixonos ! com>
Date:       2010-02-24 7:16:42
Message-ID: C495228385CC1D409A54846080C9CBA56634C20D95 () jklmail01 ! ixonos ! local
[Download RAW message or body]

Hi,

I'm new to kword development so I don't have commit right to svn. I can add code to \
reviewboard first. Could you please commit it ? Than we can have fix commited \
earlier.

Palo

-----Original Message-----
From: Thomas Zander [mailto:zander@kde.org] 
Sent: Tuesday, February 23, 2010 6:16 PM
To: For developer's discussion about KOffice
Cc: Korinek Pavol
Subject: Re: Layout. cpp and captions

Hi Korinek :)

Thanks for the great diagnostic of the crash you found!
I think your first solution is the right one, there should be an if surrounding 
the referring of m_textShape.

m_textShape is a variable that can indeed end up being null due to the dynamic 
cast failing. KWord sets a random KoShape inheriting class using the 
setFollowupShape() call and in that case the dynamic cast can fail. This is 
expected and correct behavior.

The reason why KWord does this (in case you are curious) is to allow the text 
layout to continue even if there is no shape to do layout into. The usecase 
here is that if you add a text shape you can set it to 'auto-extend'. So it 
resizes when there is more text. To know how much it has to resize this trick 
of using a dummy shape is used.

After adding that check 
-        m_textShape->markLayoutDone();
+        if (m_textShape) // may be null in relation to setFollowupShape
+            m_textShape->markLayoutDone();
loading the document succeeds just fine for me. Using this mornings svn 
revision.

Do you have svn commit rights to commit the above check as you suggested? Or 
should I commit it?

On Tuesday 23. February 2010 17.23.40 Korinek Pavol wrote:
> Hello,
> 
> I'm working on bug:
> 
> https://projects.maemo.org/bugzilla/show_bug.cgi?id=150283
> 
> and there are some problems in Layout.cpp
> 
> I don't know exactly the logic of Layouts. If somebody is familiar with it,
> could you please consult this problems with me ?
> 
> First problem:
> 
> application crashes on .odt input from bugzilla. that didn't happened
> before my update form svn approximately week ago.
> 
> Possible fix:       add NULL pointer check before call     
> m_textShape->markLayoutDone();       in method      Layout::nextParag()   
> in file        Layout.cpp
> 
> Problem is because m_data and m_textShape are related and there is only
> check on: if (m_data == 0) // no shape to layout, so stop here.
> return true;
> but later is m_textShape used.
> 
> Inconsistency may by possibly created:
> m_data, m_textShape      are initialized to     NULL
> in method:
> Layout::resetPrivate()
> is m_text_Shape checked -> OK
> 
> in method:
> Layout::setFollowupShape(KoShape *followupShape)
> m_data may by not NULL and m_textShape is then NULL -> NOT OK
> 
> similar situation in: Layout::previousParag()
> no check on NULL after dynamic_cast
> 
> Seccond problem:
> 
> after and load input file from bugzilla the rendering process never stops.
> I have added some debug output in function: TextShape::markLayoutDone()
> and printing never ends after loading file
> is it possible that some signal is still generated and relayout called ?
> Is it OK ?
> 
> this is probably not because of not supporting of text:sequence tag in
> OpenOffice .odt file, which I saw while debugging.
> 
> Palo
> 
> Best regards
> 
> Mgr. Pavol Korinek
> SW Developer
> Ixonos Slovakia, s.r.o.
> Štúrova 27
> 04001 Košice, Slovakia
> Mobile: +421 918 718 984
> e-mail: pavol.korinek@ixonos.com<mailto:pavol.korinek@ixonos.com>
> www.ixonos.com<http://www.ixonos.com>
> 

-- 
Thomas Zander

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic