<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>113387</bug_id>
          
          <creation_ts>2005-09-26 21:25:16 +0000</creation_ts>
          <short_desc>KmPlot crashes when the Remove action is added in a toolbar and used to remove a graph</short_desc>
          <delta_ts>2005-09-29 22:12:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmplot</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne-Marie Mahfouf">annma</reporter>
          <assigned_to name="Klaus-Dieter M">kd.moeller</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>376346</commentid>
    <comment_count>0</comment_count>
    <who name="Anne-Marie Mahfouf">annma</who>
    <bug_when>2005-09-26 21:26:03 +0000</bug_when>
    <thetext>Version:           1.2.0 (using KDE 3.4.91 (beta1, &gt;= 20050910), compiled sources)
Compiler:          Target: i586-mandriva-linux-gnu
OS:                Linux (i686) release 2.6.11-9.mm.6mdk

Using Settings -&gt; Configure Toolbars, I add the Remove action to maintoolbar (kmplot).
When you click on that button to delete the current graph, KmPlot crashes with the following back trace:

Using host libthread_db library &quot;/lib/tls/libthread_db.so.1&quot;.
[Thread debugging using libthread_db enabled]
[New Thread -1231739200 (LWP 18442)]
[KCrash handler]
#7  0xb6754d29 in View::mnuRemove_clicked ()
   from /usr/local/kde3.5/lib/kde3/libkmplotpart.so
#8  0xb6770d8d in View::qt_invoke ()
   from /usr/local/kde3.5/lib/kde3/libkmplotpart.so
#9  0xb71794d7 in QObject::activate_signal (this=0x81b3a88, clist=0x81b3c60, 
    o=0xbfffe93c) at kernel/qobject.cpp:2356
#10 0xb7179fbb in QObject::activate_signal (this=0x81b3a88, signal=2)
    at kernel/qobject.cpp:2325
#11 0xb7aa8d95 in KAction::activated ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#12 0xb7aa8ebb in KAction::slotActivated ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#13 0xb7aae5a5 in KAction::slotButtonClicked ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#14 0xb7aae900 in KAction::qt_invoke ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#15 0xb71794d7 in QObject::activate_signal (this=0x823e9d0, clist=0x8234f50, 
    o=0xbfffea80) at kernel/qobject.cpp:2356
#16 0xb7b5ebfc in KToolBarButton::buttonClicked ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#17 0xb7b5efa9 in KToolBarButton::mouseReleaseEvent ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#18 0xb71b4c36 in QWidget::event (this=0x823e9d0, e=0xbfffef64)
    at kernel/qwidget.cpp:4677
#19 0xb7b5f6ed in KToolBarButton::event ()
   from /usr/local/kde3.5/lib/libkdeui.so.4
#20 0xb710f4e4 in QApplication::internalNotify (this=0xbffff47c, 
    receiver=0x823e9d0, e=0xbfffef64) at kernel/qapplication.cpp:2635
#21 0xb710faa8 in QApplication::notify (this=0xbffff47c, receiver=0x823e9d0, 
    e=0xbfffef64) at kernel/qapplication.cpp:2421
#22 0xb77d49f7 in KApplication::notify ()
   from /usr/local/kde3.5/lib/libkdecore.so.4
#23 0xb70a1e51 in QApplication::sendSpontaneousEvent (receiver=0x823e9d0, 
    event=0xbfffef64) at qapplication.h:499
#24 0xb709dbb8 in QETWidget::translateMouseEvent (this=0x823e9d0, 
    event=0xbffff2b8) at kernel/qapplication_x11.cpp:4296
#25 0xb709bea3 in QApplication::x11ProcessEvent (this=0xbffff47c, 
    event=0xbffff2b8) at kernel/qapplication_x11.cpp:3447
#26 0xb70b4b24 in QEventLoop::processEvents (this=0x80f45d8, flags=4)
    at kernel/qeventloop_x11.cpp:192
#27 0xb7127856 in QEventLoop::enterLoop (this=0x80f45d8)
    at kernel/qeventloop.cpp:198
#28 0xb712777f in QEventLoop::exec (this=0x80f45d8)
    at kernel/qeventloop.cpp:145
#29 0xb710e06d in QApplication::exec (this=0xbffff47c)
    at kernel/qapplication.cpp:2758
#30 0x08051a3d in main ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>377393</commentid>
    <comment_count>1</comment_count>
    <who name="Fredrik Edemar">f_edemar</who>
    <bug_when>2005-09-29 22:12:20 +0000</bug_when>
    <thetext>SVN commit 465447 by fedemar:

Bug 113387: KmPlot crashes when the Remove action is added in a toolbar and used to remove a graph.

BUG: 113387


 M  +14 -0     View.cpp  


--- branches/KDE/3.5/kdeedu/kmplot/kmplot/View.cpp #465446:465447
@@ -1829,6 +1829,9 @@
 
 void View::mnuHide_clicked()
 {
+    if ( csmode == -1 )
+      return;
+    
 	Ufkt *ufkt = &amp;m_parser-&gt;ufkt[ m_parser-&gt;ixValue(csmode)];
 	switch (cstype )
 	{
@@ -1865,6 +1868,9 @@
 }
 void View::mnuRemove_clicked()
 {
+  if ( csmode == -1 )
+    return;
+  
 	if ( KMessageBox::warningContinueCancel(this,i18n(&quot;Are you sure you want to remove this function?&quot;), QString::null, KStdGuiItem::del()) == KMessageBox::Continue )
 	{
 		Ufkt *ufkt =  &amp;m_parser-&gt;ufkt[m_parser-&gt;ixValue(csmode)];
@@ -1888,6 +1894,8 @@
 }
 void View::mnuEdit_clicked()
 {
+  if ( csmode == -1 )
+    return;
 	if ( m_parser-&gt;ufkt[m_parser-&gt;ixValue(csmode)].fstr[0] == &apos;x&apos;) // a parametric function
 	{
 		int y_index = csmode+1; //the y-function
@@ -1919,12 +1927,18 @@
 
 void View::mnuCopy_clicked()
 {
+  if ( csmode == -1 )
+  return;
+  
 	if ( m_parser-&gt;sendFunction(csmode) )
 		m_modified = true;
 }
 
 void View::mnuMove_clicked()
 {
+  if ( csmode == -1 )
+    return;
+  
 	if ( m_parser-&gt;sendFunction(csmode) )
 	{
 	  	if (!m_parser-&gt;delfkt(csmode) )
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>