Bug 75299 - kword looping on sxw file open
Summary: kword looping on sxw file open
Status: RESOLVED FIXED
Alias: None
Product: kword
Classification: Miscellaneous
Component: tables (show other bugs)
Version: 1.5 or before
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-15 19:04 UTC by kde
Modified: 2006-04-13 17:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
manual.sxw (22.43 KB, application/vnd.sun.xml.writer)
2004-02-15 21:07 UTC, kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kde 2004-02-15 19:04:00 UTC
Version:           1.3 (using KDE 3.2.0, compiled sources)
Compiler:          gcc version 3.3.2
OS:          Linux (i686) release 2.4.24

Trying to open a particular sxw file in kword causes it to loop and spew out error msgs 
ASSERT: "frm" in kwframe.cc (632)
until killed.
OOo opens same file ok

(if I can attach file here, will do so, otherwise can email separately = 22kB)
Comment 1 David Faure 2004-02-15 20:56:33 UTC
Yes, please attach the file in reply to this mail, thanks.

Comment 2 kde 2004-02-15 21:07:25 UTC
On Sunday 15 Feb 2004 19:56, David Faure wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=75299
>
>
>
>
> ------- Additional Comments From faure kde org  2004-02-15 20:56 -------
> Yes, please attach the file in reply to this mail, thanks.


Created an attachment (id=4711)
manual.sxw
Comment 3 David Faure 2004-02-16 11:46:56 UTC
CVS commit by faure: 

Never return negative innerWidth/innerHeight.
CCMAIL: 75299@bugs.kde.org


  M +4 -4      kwframe.cc   1.393.2.3


--- koffice/kword/kwframe.cc  #1.393.2.2:1.393.2.3
@@ -560,6 +560,6 @@ KoRect KWFrame::innerRect() const
     KoRect inner( this->normalize());
     inner.moveBy( bLeft(), bTop());
-    inner.setWidth( inner.width() - bLeft() - bRight() );
-    inner.setHeight( inner.height() - bTop() - bBottom() );
+    inner.setWidth( innerWidth() );
+    inner.setHeight( innerHeight() );
     return inner;
 }
@@ -567,10 +567,10 @@ KoRect KWFrame::innerRect() const
 double KWFrame::innerWidth() const
 {
-    return width() - bLeft() - bRight();
+    return QMAX( 0.0, width() - bLeft() - bRight() );
 }
 
 double KWFrame::innerHeight() const
 {
-    return height() - bTop() - bBottom();
+    return QMAX( 0.0, height() - bTop() - bBottom() );
 }
 


Comment 4 Nicolas Goutte 2004-02-17 02:31:00 UTC
If there was a change for this bug, I assume that it means that the bug is confirmed. :-)
Comment 5 Matt Rogers 2004-02-18 06:04:28 UTC
is this worth a backport (and thus a closing of the bug?)
Comment 6 David Faure 2004-02-18 11:20:24 UTC
> is this worth a backport (and thus a closing of the bug?)
I did the backport, but as I mentionned, the bug can't be closed (many tables-related bugs in this document)

Comment 7 David Faure 2004-02-23 16:17:33 UTC
CVS commit by faure: 

Fixed Qt-3.3 behavior change in QString::toDouble() (it was undocumented, now it's documented....).
QString("123abc").toDouble() returns 0 now, it returned 123 before.
Note that QString("123abc").toDouble(&ok) has always returned ok==false, so the code
testing the bool is unaffected.

This fixes infinite loops when loading OOWriter documents (because they ended
up with width=0 height=0).
CCMAIL: 75299@bugs.kde.org


  M +3 -3      koUnit.cc   1.13


--- koffice/lib/kofficecore/koUnit.cc  #1.12:1.13
@@ -127,10 +127,10 @@ double KoUnit::parseValue( QString value
 
     int index = value.find( QRegExp( "[a-z]+$" ) );
-    double val = value.toDouble();
     if ( index == -1 )
-        return val;
+        return value.toDouble();
 
     QString unit = value.mid( index );
-    //value.truncate ( index );
+    value.truncate ( index );
+    double val = value.toDouble();
 
     if ( unit == "pt" )


Comment 8 David Faure 2004-03-10 14:07:45 UTC
CVS commit by faure: 

delFrame fix for tables: take frame out of the list before calling frameDeleted,
but don't delete it, otherwise the nested delFrame call wil use a deleted frame.

Fixes the warnings and crash on the document in #75299 - but the HUGE multipage
table still needs to infinite looping when doing anything with the doc (e.g.
changing the zoom level)
CCMAIL: 75299@bugs.kde.org


  M +3 -3      kwframe.cc   1.393.2.4


--- koffice/kword/kwframe.cc  #1.393.2.3:1.393.2.4
@@ -628,10 +628,10 @@ void KWFrameSet::addFrame( KWFrame *_fra
 void KWFrameSet::delFrame( unsigned int _num, bool remove, bool recalc )
 {
-    //kdDebug(32001) << k_funcinfo << getName() << " deleting frame" <<  _num << " remove=" << remove << " recalc=" << recalc << endl;
+    //kdDebug(32001) << k_funcinfo << getName() << " deleting frame" <<  _num << " remove=" << remove << " recalc=" << recalc << kdBacktrace();
     KWFrame *frm = frames.at( _num );
     Q_ASSERT( frm );
+    frames.take( _num );
     if ( !remove )
     {
-        frames.take( _num );
         if (frm->isSelected()) // get rid of the resize handles
             frm->setSelected(false);
@@ -641,5 +641,5 @@ void KWFrameSet::delFrame( unsigned int 
         // ###### should something similar be done when just removing a frame from the list?
         frameDeleted( frm, recalc ); // inform kwtableframeset if necessary
-        frames.remove( _num );
+        delete frm;
         //kdDebug(32001) << k_funcinfo << frm << " deleted. Now I have " << frames.count() << " frames" << endl;
     }


Comment 9 Thomas Zander 2006-04-13 17:47:57 UTC
Thank you for your bug report.
The bug that you reported has been identified and has been fixed in the
latest development (SVN) version of KDE. The bug report will be closed.