--Boundary-00=_LfMT/w2q8dDPcVV Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 27 August 2003 10:52, Peter Simonsson wrote: > Hi! > Sorry if this is a duplicate, but I haven't seen my mail from yesterday > arrive yet so... > This patch fixes deletion of connected connectors, see bug 63001. > I'll commit tomorrow if nobody objects... And with a working patch this time :( =2D --=20 LLaP Peter Simonsson Kivio (KOffice Flowcharting Application) - http://www.koffice.org/kivio/ Kexi - http://www.koffice.org/kexi/ =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/TMfPjR6JKcrOq3sRArJrAKC9V9PRE2xHdSRou99YUQDMlVq7ygCfUuGS DzRt0bRtGmNAXCdYCcOo8c0=3D =3D38SH =2D----END PGP SIGNATURE----- --Boundary-00=_LfMT/w2q8dDPcVV Content-Type: text/x-diff; charset="iso-8859-1"; name="kivio.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kivio.diff" Index: kiviopart/kivio_command.cc =================================================================== RCS file: /home/kde/koffice/kivio/kiviopart/kivio_command.cc,v retrieving revision 1.25 diff -u -p -r1.25 kivio_command.cc --- kiviopart/kivio_command.cc 30 Jun 2003 10:08:57 -0000 1.25 +++ kiviopart/kivio_command.cc 27 Aug 2003 08:48:20 -0000 @@ -136,6 +136,7 @@ void KivioAddStencilCommand::execute() m_layer->insertStencil( m_stencil ); m_page->doc()->updateView(m_page); m_stencil->unselect(); + m_stencil->searchForConnections(m_page, 4.0); //FIXME: The threshold should probably be zoomed.... m_page->doc()->slotSelectionChanged(); } Index: kiviopart/kivio_page.cpp =================================================================== RCS file: /home/kde/koffice/kivio/kiviopart/kivio_page.cpp,v retrieving revision 1.53 diff -u -p -r1.53 kivio_page.cpp --- kiviopart/kivio_page.cpp 22 Jul 2003 20:51:12 -0000 1.53 +++ kiviopart/kivio_page.cpp 27 Aug 2003 08:48:20 -0000 @@ -64,6 +64,7 @@ #include "kivio_point.h" #include "kivio_ps_printer.h" #include "kivio_stencil.h" +#include "kivio_1d_stencil.h" #include "KIvioPageIface.h" #include "kivio_command.h" #include "kivioglobal.h" @@ -635,34 +636,14 @@ void KivioPage::deleteSelectedStencils() bool createMacro = false; while( pStencil ) { - /* - * The following code is commented out because selections can only take - * place on the current layer. - */ - // Now iterate through the layers attempting to delete the current stencil. If - // true is returned, that means that the delete was successful and we can stop - // looking through layers. - /* - KivioLayer* pLayer = m_lstLayers.first(); - while( pLayer ) - { - if( pLayer->removeStencil( pStencil )==true ) - { - break; - } - - pLayer = m_lstLayers.next(); - } - */ -/* - if( m_pCurLayer->removeStencil( pStencil ) == false ) - { - kdDebug(43000) << "KivioPage::deleteSelectedStencils() - Failed to locate a selected stencil in the current layer" << endl; - } -*/ KivioRemoveStencilCommand *cmd =new KivioRemoveStencilCommand(i18n("Remove Stencil"), this, m_pCurLayer , pStencil ); createMacro = true; macro->addCommand( cmd); + + if(pStencil->type() == kstConnector) { + static_cast(pStencil)->disconnectFromTargets(); + } + pStencil = m_lstSelection.take(); } if ( createMacro ) Index: kiviopart/kiviosdk/kivio_1d_stencil.cpp =================================================================== RCS file: /home/kde/koffice/kivio/kiviopart/kiviosdk/kivio_1d_stencil.cpp,v retrieving revision 1.17 diff -u -p -r1.17 kivio_1d_stencil.cpp --- kiviopart/kiviosdk/kivio_1d_stencil.cpp 22 Jul 2003 20:51:13 -0000 1.17 +++ kiviopart/kiviosdk/kivio_1d_stencil.cpp 27 Aug 2003 08:48:21 -0000 @@ -948,3 +948,15 @@ bool Kivio1DStencil::connected() return false; } + +void Kivio1DStencil::disconnectFromTargets() +{ + KivioConnectorPoint *p; + p = m_pConnectorPoints->first(); + + while( p ) + { + p->disconnect(true); + p = m_pConnectorPoints->next(); + } +} Index: kiviopart/kiviosdk/kivio_1d_stencil.h =================================================================== RCS file: /home/kde/koffice/kivio/kiviopart/kiviosdk/kivio_1d_stencil.h,v retrieving revision 1.7 diff -u -p -r1.7 kivio_1d_stencil.h --- kiviopart/kiviosdk/kivio_1d_stencil.h 30 Jun 2003 22:13:09 -0000 1.7 +++ kiviopart/kiviosdk/kivio_1d_stencil.h 27 Aug 2003 08:48:21 -0000 @@ -139,6 +139,7 @@ public: // returns which resize handles are valid virtual int resizeHandlePositions(); + virtual void disconnectFromTargets(); }; --Boundary-00=_LfMT/w2q8dDPcVV Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel --Boundary-00=_LfMT/w2q8dDPcVV--