OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 } | 472 } |
473 case VisibleSelection::NoSelection: | 473 case VisibleSelection::NoSelection: |
474 ASSERT_NOT_REACHED(); | 474 ASSERT_NOT_REACHED(); |
475 break; | 475 break; |
476 } | 476 } |
477 | 477 |
478 ASSERT(!selectionToDelete.isNone()); | 478 ASSERT(!selectionToDelete.isNone()); |
479 if (selectionToDelete.isNone()) | 479 if (selectionToDelete.isNone()) |
480 return; | 480 return; |
481 | 481 |
482 if (selectionToDelete.isCaret() || !frame->selection().shouldDeleteSelection
(selectionToDelete)) | 482 if (selectionToDelete.isCaret()) |
483 return; | 483 return; |
484 | 484 |
485 if (killRing) | 485 if (killRing) |
486 frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(
), false); | 486 frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(
), false); |
487 // Make undo select everything that has been deleted, unless an undo will un
do more than just this deletion. | 487 // Make undo select everything that has been deleted, unless an undo will un
do more than just this deletion. |
488 // FIXME: This behaves like TextEdit except for the case where you open with
text insertion and then delete | 488 // FIXME: This behaves like TextEdit except for the case where you open with
text insertion and then delete |
489 // more text than you insert. In that case all of the text that was around
originally should be selected. | 489 // more text than you insert. In that case all of the text that was around
originally should be selected. |
490 if (m_openedByBackwardDelete) | 490 if (m_openedByBackwardDelete) |
491 setStartingSelection(selectionAfterUndo); | 491 setStartingSelection(selectionAfterUndo); |
492 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete); | 492 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 } | 565 } |
566 case VisibleSelection::NoSelection: | 566 case VisibleSelection::NoSelection: |
567 ASSERT_NOT_REACHED(); | 567 ASSERT_NOT_REACHED(); |
568 break; | 568 break; |
569 } | 569 } |
570 | 570 |
571 ASSERT(!selectionToDelete.isNone()); | 571 ASSERT(!selectionToDelete.isNone()); |
572 if (selectionToDelete.isNone()) | 572 if (selectionToDelete.isNone()) |
573 return; | 573 return; |
574 | 574 |
575 if (selectionToDelete.isCaret() || !frame->selection().shouldDeleteSelection
(selectionToDelete)) | 575 if (selectionToDelete.isCaret()) |
576 return; | 576 return; |
577 | 577 |
578 if (killRing) | 578 if (killRing) |
579 frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(
), false); | 579 frame->editor().addToKillRing(selectionToDelete.toNormalizedRange().get(
), false); |
580 // make undo select what was deleted | 580 // make undo select what was deleted |
581 setStartingSelection(selectionAfterUndo); | 581 setStartingSelection(selectionAfterUndo); |
582 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete); | 582 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete); |
583 setSmartDelete(false); | 583 setSmartDelete(false); |
584 typingAddedToOpenCommand(ForwardDeleteKey); | 584 typingAddedToOpenCommand(ForwardDeleteKey); |
585 } | 585 } |
(...skipping 22 matching lines...) Expand all Loading... |
608 ASSERT_NOT_REACHED(); | 608 ASSERT_NOT_REACHED(); |
609 m_preservesTypingStyle = false; | 609 m_preservesTypingStyle = false; |
610 } | 610 } |
611 | 611 |
612 bool TypingCommand::isTypingCommand() const | 612 bool TypingCommand::isTypingCommand() const |
613 { | 613 { |
614 return true; | 614 return true; |
615 } | 615 } |
616 | 616 |
617 } // namespace WebCore | 617 } // namespace WebCore |
OLD | NEW |