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

List:       koffice-devel
Subject:    Review needed for kchart patch
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2009-06-01 4:51:28
Message-ID: 200906010651.29340.t.zachmann () zagge ! de
[Download RAW message or body]

Hello,

a user reported a crash in KPresenter when a layout with a chart was used and 
the chart added. See:

https://bugs.kde.org/show_bug.cgi?id=194473

In a debug branch you get the following assert seen in the bt at the end of 
the mail. The problem is that the shape is not yet set but already used by the 
option widget. The attached patch fixes the crash. Is this the right way to 
fix the bug. My tests showed that all is working fine. 

Thorsten

Thread 1 (Thread 0xb57ac700 (LWP 5813)):
[KCrash Handler]
#6  0xb7f65430 in __kernel_vsyscall ()
#7  0xb6d6b6d0 in raise () from /lib/tls/i686/cmov/libc.so.6
#8  0xb6d6d098 in abort () from /lib/tls/i686/cmov/libc.so.6
#9  0xb705353f in qt_message_output (msgType=QtFatalMsg, buf=0xa08e340 
"ASSERT: \"legend\" in file 
/home/tz/develop/kde/svn/koffice/kchart/shape/ChartConfigWidget.cpp, line 
350")
    at global/qglobal.cpp:2017
#10 0xb70535b6 in qFatal (msg=0xb71a9214 "ASSERT: \"%s\" in file %s, line %d") 
at global/qglobal.cpp:2216
#11 0xb70539f5 in qt_assert (assertion=0xb3587f14 "legend", file=0xb3587380 
"/home/tz/develop/kde/svn/koffice/kchart/shape/ChartConfigWidget.cpp", 
line=350) at global/qglobal.cpp:1786
#12 0xb356f26d in KChart::ChartConfigWidget::open (this=0x9f79a28, shape=0x0) 
at /home/tz/develop/kde/svn/koffice/kchart/shape/ChartConfigWidget.cpp:350
#13 0xb3566f27 in KChart::ChartTool::createOptionWidget (this=0x9a6df18) at 
/home/tz/develop/kde/svn/koffice/kchart/shape/ChartTool.cpp:234
#14 0xb3b72952 in KoTool::createOptionWidgets (this=0x9a6df18) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoTool.cpp:185
#15 0xb3b728db in KoTool::optionWidgets (this=0x9a6df18) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoTool.cpp:157
#16 0xb3b8666c in KoToolManager::postSwitchTool (this=0x9a71808, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:406
#17 0xb3b876bc in KoToolManager::switchTool (this=0x9a71808, tool=0x9a6df18, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:377
#18 0xb3b879bf in KoToolManager::switchTool (this=0x9a71808, id=@0xbf87f324, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:311
#19 0xb3b87f52 in KoToolManager::switchToolRequested (this=0x9a71808, 
id=@0xbf87f324) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:567
#20 0xb3b88b6d in KoToolManager::qt_metacall (this=0x9a71808, 
_c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xbf87f2ac) at /home/ko2/koffice-
build/libs/flake/KoToolManager.moc:107
#21 0xb716a1a7 in QMetaObject::activate (sender=0x8f492e8, 
from_signal_index=4, to_signal_index=4, argv=0xbf87f2ac) at 
kernel/qobject.cpp:3117
#22 0xb716b573 in QMetaObject::activate (sender=0x8f492e8, m=0xb3bf7bf8, 
local_signal_index=0, argv=0xbf87f2ac) at kernel/qobject.cpp:3194
#23 0xb3b7257a in KoTool::activateTool (this=0x8f492e8, _t1=@0xbf87f324) at 
/home/ko2/koffice-build/libs/flake/KoTool.moc:107
#24 0xb3d7f671 in KPrPlaceholderTool::activate (this=0x8f492e8, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/kpresenter/part/tools/KPrPlaceholderTool.cpp:102
#25 0xb3b8660f in KoToolManager::postSwitchTool (this=0x9a71808, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:400
#26 0xb3b876bc in KoToolManager::switchTool (this=0x9a71808, tool=0x8f492e8, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:377
#27 0xb3b879bf in KoToolManager::switchTool (this=0x9a71808, id=@0xbf87f5f8, 
temporary=false) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:311
#28 0xb3b87f52 in KoToolManager::switchToolRequested (this=0x9a71808, 
id=@0xbf87f5f8) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolManager.cpp:567
#29 0xb379844f in DefaultTool::mouseDoubleClickEvent (this=0x9f47278, 
event=0xbf87f648) at 
/home/tz/develop/kde/svn/koffice/plugins/defaultTools/defaulttool/DefaultTool.cpp:639
#30 0xb3b901a8 in KoToolProxy::mouseDoubleClickEvent (this=0x9a71720, 
event=0xbf87fc88, point=@0xbf87f6c0) at 
/home/tz/develop/kde/svn/koffice/libs/flake/KoToolProxy.cpp:241
#31 0xb3cf6e16 in KoPAViewModeNormal::mouseDoubleClickEvent (this=0x9f6dbd8, 
event=0xbf87fc88, point=@0xbf87f6c0) at 
/home/tz/develop/kde/svn/koffice/libs/kopageapp/KoPAViewModeNormal.cpp:83
#32 0xb3cf05db in KoPACanvas::mouseDoubleClickEvent (this=0x9a2c028, 
event=0xbf87fc88) at 
/home/tz/develop/kde/svn/koffice/libs/kopageapp/KoPACanvas.cpp:152


["kchart.patch" (text/x-patch)]

Index: kchart/shape/ChartConfigWidget.cpp
===================================================================
--- kchart/shape/ChartConfigWidget.cpp	(revision 975767)
+++ kchart/shape/ChartConfigWidget.cpp	(working copy)
@@ -331,6 +331,9 @@ void ChartConfigWidget::initTableEditorD
 
 void ChartConfigWidget::open( KoShape* shape )
 {
+    if ( ! shape ) {
+        return;
+    }
     // Find the selected shape and adapt the tool option window to
     // which of the subshapes of the chart widget that was actually
     // selected.  Then select the tab depending on which one it was.


_______________________________________________
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