Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 25754003: Refactoring: Removing unused variables and duplicate function call. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 Text* textNode = toText(node); 668 Text* textNode = toText(node);
669 669
670 if (textNode->length() == 0) 670 if (textNode->length() == 0)
671 return; 671 return;
672 RenderObject* renderer = textNode->renderer(); 672 RenderObject* renderer = textNode->renderer();
673 if (renderer && !renderer->style()->collapseWhiteSpace()) 673 if (renderer && !renderer->style()->collapseWhiteSpace())
674 return; 674 return;
675 675
676 // Delete collapsed whitespace so that inserting nbsps doesn't uncollapse it . 676 // Delete collapsed whitespace so that inserting nbsps doesn't uncollapse it .
677 Position upstreamPos = position.upstream(); 677 Position upstreamPos = position.upstream();
678 deleteInsignificantText(position.upstream(), position.downstream()); 678 deleteInsignificantText(upstreamPos, position.downstream());
679 position = upstreamPos.downstream(); 679 position = upstreamPos.downstream();
680 680
681 VisiblePosition visiblePos(position); 681 VisiblePosition visiblePos(position);
682 VisiblePosition previousVisiblePos(visiblePos.previous()); 682 VisiblePosition previousVisiblePos(visiblePos.previous());
683 replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(previousVisiblePos) ; 683 replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(previousVisiblePos) ;
684 replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(visiblePos); 684 replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNeeded(visiblePos);
685 } 685 }
686 686
687 void CompositeEditCommand::replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNee ded(const VisiblePosition& visiblePosition) 687 void CompositeEditCommand::replaceCollapsibleWhitespaceWithNonBreakingSpaceIfNee ded(const VisiblePosition& visiblePosition)
688 { 688 {
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 return node.release(); 1456 return node.release();
1457 } 1457 }
1458 1458
1459 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) 1459 PassRefPtr<Element> createBlockPlaceholderElement(Document& document)
1460 { 1460 {
1461 RefPtr<Element> breakNode = document.createElement(brTag, false); 1461 RefPtr<Element> breakNode = document.createElement(brTag, false);
1462 return breakNode.release(); 1462 return breakNode.release();
1463 } 1463 }
1464 1464
1465 } // namespace WebCore 1465 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698