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

List:       kde-commits
Subject:    KDE/kdegraphics/kolourpaint
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2010-06-14 19:19:57
Message-ID: 20100614191957.6ECE0AC8D3 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1137954 by cfeck:

Fix "Undo" crash after changing selection mode

Patch by Igor Poboiko, thanks!
BUG: 211481


 M  +4 -0      commands/tools/selection/kpToolSelectionDestroyCommand.cpp  
 M  +3 -1      document/kpDocument_Selection.cpp  


--- trunk/KDE/kdegraphics/kolourpaint/commands/tools/selection/kpToolSelectionDestroyCommand.cpp \
#1137953:1137954 @@ -153,11 +153,15 @@
     {
         if (imageSel->transparency () != environ ()->imageSelectionTransparency ())
             environ ()->setImageSelectionTransparency (imageSel->transparency ());
+        if (dynamic_cast <kpTextSelection *> (doc->selection()))
+            doc->selectionPushOntoDocument();
     }
     else if (textSel)
     {
         if (textSel->textStyle () != environ ()->textStyle ())
             environ ()->setTextStyle (textSel->textStyle ());
+        if (dynamic_cast <kpAbstractImageSelection *> (doc->selection()))
+            doc->selectionPushOntoDocument();
     }
     else
         Q_ASSERT (!"Unknown selection type");
--- trunk/KDE/kdegraphics/kolourpaint/document/kpDocument_Selection.cpp \
#1137953:1137954 @@ -291,7 +291,9 @@
 void kpDocument::selectionCopyOntoDocument (bool applySelTransparency)
 {
     Q_ASSERT (m_selection);
-    Q_ASSERT (m_selection->hasContent ());
+    // Empty selection, just doing nothing
+    if (!m_selection->hasContent())
+        return;
 
     const QRect boundingRect = m_selection->boundingRect ();
     Q_ASSERT (boundingRect.isValid ());


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

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