aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/bookmaker/spellCheck.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-09-14 11:25:39 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-14 16:05:21 +0000
commitd0530ba8f406ef287ce89a995ce7be4b32ab6e85 (patch)
tree4a4f575d252e68364d041a4a67ee38739e7b5e1b /tools/bookmaker/spellCheck.cpp
parentd29f0e7ccb84993562f34f2d8e3933a19a3ed676 (diff)
wip pixmap docs
wip pixmap docs Docs-Preview: https://skia.org/?cl=42522 Bug: skia: 6898 Change-Id: I85947bc36ea057ed008b87d7bef2efa82d7c89ad Reviewed-on: https://skia-review.googlesource.com/42522 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tools/bookmaker/spellCheck.cpp')
-rw-r--r--tools/bookmaker/spellCheck.cpp67
1 files changed, 33 insertions, 34 deletions
diff --git a/tools/bookmaker/spellCheck.cpp b/tools/bookmaker/spellCheck.cpp
index 06a5d2be70..7a45fb04ed 100644
--- a/tools/bookmaker/spellCheck.cpp
+++ b/tools/bookmaker/spellCheck.cpp
@@ -485,9 +485,11 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) {
}
}
SkDebugf("\n");
+ return;
}
if (report.contains("all")) {
int column = 0;
+ char lastInitial = 'a';
for (auto iter : elems) {
if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
continue;
@@ -509,50 +511,47 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) {
if (!allLower) {
continue;
}
- if (column + check.length() > 100) {
+ if (column + check.length() > 100 || check[0] != lastInitial) {
SkDebugf("\n");
column = 0;
}
+ if (check[0] != lastInitial) {
+ SkDebugf("\n");
+ lastInitial = check[0];
+ }
SkDebugf("%s ", check.c_str());
column += check.length();
}
SkDebugf("\n\n");
+ return;
}
- if (report.contains("mispellings")) {
- const char* mispelled[] = {
- "decrementing",
- "differentially",
- "incrementing",
- "superset",
- };
- const char** mispellPtr = mispelled;
- const char** mispellEnd = &mispelled[SK_ARRAY_COUNT(mispelled)];
- for (auto iter : elems) {
- if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
- continue;
- }
- if (string::npos != iter.second.fFile.find("markup.bmh")) {
- continue;
- }
- if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
- continue;
- }
- string check = iter.first.c_str();
- while (check.compare(*mispellPtr) > 0) {
- SkDebugf("%s not found\n", *mispellPtr);
- if (mispellEnd == ++mispellPtr) {
- break;
- }
- }
- if (mispellEnd == mispellPtr) {
+ int index = 0;
+ const char* mispelled = report[0];
+ for (auto iter : elems) {
+ if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
+ continue;
+ }
+ if (string::npos != iter.second.fFile.find("markup.bmh")) {
+ continue;
+ }
+ if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
+ continue;
+ }
+ string check = iter.first.c_str();
+ while (check.compare(mispelled) > 0) {
+ SkDebugf("%s not found\n", mispelled);
+ if (report.count() == ++index) {
break;
}
- if (check.compare(*mispellPtr) == 0) {
- SkDebugf("%s(%d): %s\n", iter.second.fFile.c_str(), iter.second.fLine,
- iter.first.c_str());
- if (mispellEnd == ++mispellPtr) {
- break;
- }
+ }
+ if (report.count() == index) {
+ break;
+ }
+ if (check.compare(mispelled) == 0) {
+ SkDebugf("%s(%d): %s\n", iter.second.fFile.c_str(), iter.second.fLine,
+ iter.first.c_str());
+ if (report.count() == ++index) {
+ break;
}
}
}