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

Unified Diff: Source/core/editing/serializers/HTMLInterchange.cpp

Issue 1295073002: Move serializer related files in core/editing/ related files into core/editing/serializers/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-17T15:24:31 Rebase for Source/web/WebPageSerializerImpl.cpp Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/serializers/HTMLInterchange.cpp
diff --git a/Source/core/editing/HTMLInterchange.cpp b/Source/core/editing/serializers/HTMLInterchange.cpp
similarity index 72%
rename from Source/core/editing/HTMLInterchange.cpp
rename to Source/core/editing/serializers/HTMLInterchange.cpp
index 54b815bf3e31304ae8b6d1b72d025d5b90e83216..762188ef915ec8c33c8ccdff95415d991ba0ad7e 100644
--- a/Source/core/editing/HTMLInterchange.cpp
+++ b/Source/core/editing/serializers/HTMLInterchange.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "core/editing/HTMLInterchange.h"
+#include "core/editing/serializers/HTMLInterchange.h"
#include "core/dom/Text.h"
#include "core/editing/EditingUtilities.h"
@@ -60,37 +60,38 @@ String convertHTMLTextToInterchangeFormat(const String& in, const Text& node)
while (count) {
unsigned add = count % 3;
switch (add) {
- case 0:
+ case 0:
+ s.appendLiteral(convertedSpaceString);
+ s.append(' ');
+ s.appendLiteral(convertedSpaceString);
+ add = 3;
+ break;
+ case 1:
+ if (i == 0 || i + 1 == in.length()) // at start or end of string
s.appendLiteral(convertedSpaceString);
+ else
s.append(' ');
+ break;
+ case 2:
+ if (i == 0) {
+ // at start of string
s.appendLiteral(convertedSpaceString);
- add = 3;
- break;
- case 1:
- if (i == 0 || i + 1 == in.length()) // at start or end of string
- s.appendLiteral(convertedSpaceString);
- else
- s.append(' ');
- break;
- case 2:
- if (i == 0) {
- // at start of string
- s.appendLiteral(convertedSpaceString);
- s.append(' ');
- } else if (i + 2 == in.length()) {
- // at end of string
- s.appendLiteral(convertedSpaceString);
- s.appendLiteral(convertedSpaceString);
- } else {
- s.appendLiteral(convertedSpaceString);
- s.append(' ');
- }
- break;
+ s.append(' ');
+ } else if (i + 2 == in.length()) {
+ // at end of string
+ s.appendLiteral(convertedSpaceString);
+ s.appendLiteral(convertedSpaceString);
+ } else {
+ s.appendLiteral(convertedSpaceString);
+ s.append(' ');
+ }
+ break;
}
count -= add;
}
- } else
+ } else {
s.append(in[i]);
+ }
i += consumed;
}
« no previous file with comments | « Source/core/editing/serializers/HTMLInterchange.h ('k') | Source/core/editing/serializers/MarkupAccumulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698