[haiku-commits] r36800 - haiku/trunk/src/apps/showimage

  • From: leavengood@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 13 May 2010 06:28:57 +0200 (CEST)

Author: leavengood
Date: 2010-05-13 06:28:57 +0200 (Thu, 13 May 2010)
New Revision: 36800
Changeset: http://dev.haiku-os.org/changeset/36800/haiku
Ticket: http://dev.haiku-os.org/ticket/5808

Modified:
   haiku/trunk/src/apps/showimage/ShowImageView.cpp
   haiku/trunk/src/apps/showimage/ShowImageView.h
Log:
Fix #5808. I'm not completely happy with this solution, but it fixes the
problem without a bunch of refactoring. I intend to do more refactoring of
ShowImage after developing an automated test suite.


Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp
===================================================================
--- haiku/trunk/src/apps/showimage/ShowImageView.cpp    2010-05-13 03:43:05 UTC 
(rev 36799)
+++ haiku/trunk/src/apps/showimage/ShowImageView.cpp    2010-05-13 04:28:57 UTC 
(rev 36800)
@@ -2014,7 +2014,7 @@
 
 
 void
-ShowImageView::_RemoveSelection(bool toClipboard)
+ShowImageView::_RemoveSelection(bool toClipboard, bool neverCutBackground)
 {
        if (!_HasSelection())
                return;
@@ -2029,7 +2029,7 @@
 
        _SetHasSelection(false);
 
-       if (cutBackground) {
+       if (!neverCutBackground && cutBackground) {
                // If the user hasn't dragged the selection,
                // paint a white rectangle where the selection was
                restore = _CopyFromRect(rect);
@@ -2111,7 +2111,8 @@
 {
        // Remove the selection,
        // DON'T copy it to the clipboard
-       _RemoveSelection(false);
+       // or white out the selection
+       _RemoveSelection(false, true);
 }
 
 

Modified: haiku/trunk/src/apps/showimage/ShowImageView.h
===================================================================
--- haiku/trunk/src/apps/showimage/ShowImageView.h      2010-05-13 03:43:05 UTC 
(rev 36799)
+++ haiku/trunk/src/apps/showimage/ShowImageView.h      2010-05-13 04:28:57 UTC 
(rev 36800)
@@ -132,7 +132,7 @@
                };
                void _InitPatterns();
                void _RotatePatterns();
-               void _RemoveSelection(bool bToClipboard);
+               void _RemoveSelection(bool bToClipboard, bool 
neverCutBackground = false);
                bool _HasSelection() { return fHasSelection; }
                void _SetHasSelection(bool bHasSelection);
                void _AnimateSelection(bool a);


Other related posts:

  • » [haiku-commits] r36800 - haiku/trunk/src/apps/showimage - leavengood