mail: partial style cleanup

No functional changes

Change-Id: I8f2b18da4955ee48cba87359050fbe3fc8cdb9ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3830
Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
Siddhant Gupta
2021-04-01 14:02:32 +00:00
committed by Jérôme Duval
parent 16196fd3b7
commit f67bf6411c
4 changed files with 19 additions and 19 deletions
+2 -2
View File
@@ -1371,7 +1371,7 @@ TTextView::MessageReceived(BMessage *msg)
case B_INPUT_METHOD_EVENT: case B_INPUT_METHOD_EVENT:
{ {
int32 im_op; int32 im_op;
if (msg->FindInt32("be:opcode", &im_op) == B_OK){ if (msg->FindInt32("be:opcode", &im_op) == B_OK) {
switch (im_op) { switch (im_op) {
case B_INPUT_METHOD_STARTED: case B_INPUT_METHOD_STARTED:
fInputMethodUndoState.replace = true; fInputMethodUndoState.replace = true;
@@ -1382,7 +1382,7 @@ TTextView::MessageReceived(BMessage *msg)
if (fInputMethodUndoBuffer.CountItems() > 0) { if (fInputMethodUndoBuffer.CountItems() > 0) {
KUndoItem *undo = fInputMethodUndoBuffer.ItemAt( KUndoItem *undo = fInputMethodUndoBuffer.ItemAt(
fInputMethodUndoBuffer.CountItems() - 1); fInputMethodUndoBuffer.CountItems() - 1);
if (undo->History == K_INSERTED){ if (undo->History == K_INSERTED) {
fUndoBuffer.MakeNewUndoItem(); fUndoBuffer.MakeNewUndoItem();
fUndoBuffer.AddUndo(undo->RedoText, undo->Length, fUndoBuffer.AddUndo(undo->RedoText, undo->Length,
undo->Offset, undo->History, undo->CursorPos); undo->Offset, undo->History, undo->CursorPos);
+1 -1
View File
@@ -154,7 +154,7 @@ KUndoBuffer::AddUndo(const char* text, int32 length, int32 offset,
int32 c_offset = CurrentUndoItem->Offset; int32 c_offset = CurrentUndoItem->Offset;
undo_type c_history = CurrentUndoItem->History; undo_type c_history = CurrentUndoItem->History;
if (c_history == history) { if (c_history == history) {
switch(c_history) { switch (c_history) {
case K_INSERTED: case K_INSERTED:
case K_REPLACED: case K_REPLACED:
if ((c_offset + c_length) == offset) if ((c_offset + c_length) == offset)
+3 -3
View File
@@ -392,7 +392,7 @@ TMailApp::MessageReceived(BMessage *msg)
case MAIL_WINDOW: case MAIL_WINDOW:
{ {
TMailWindow* window; TMailWindow* window;
if( msg->FindPointer("window", (void**)&window) == B_OK) if (msg->FindPointer("window", (void**)&window) == B_OK)
fWindowList.RemoveItem(window); fWindowList.RemoveItem(window);
fWindowCount--; fWindowCount--;
break; break;
@@ -623,7 +623,7 @@ TMailApp::RefsReceived(BMessage *msg)
|| strcmp(type, B_PARTIAL_MAIL_TYPE) == 0) { || strcmp(type, B_PARTIAL_MAIL_TYPE) == 0) {
window = NewWindow(&ref, NULL, false, &messenger); window = NewWindow(&ref, NULL, false, &messenger);
window->Show(); window->Show();
} else if(strcmp(type, "application/x-person") == 0) { } else if (strcmp(type, "application/x-person") == 0) {
/* Got a People contact info file, see if it has an Email address. */ /* Got a People contact info file, see if it has an Email address. */
BString name; BString name;
BString email; BString email;
@@ -640,7 +640,7 @@ TMailApp::RefsReceived(BMessage *msg)
/* we got something... */ /* we got something... */
if (email.Length() > 0) { if (email.Length() > 0) {
/* see if we can get a username as well */ /* see if we can get a username as well */
if(file.GetAttrInfo("META:name", &info) == B_NO_ERROR) { if (file.GetAttrInfo("META:name", &info) == B_NO_ERROR) {
attrib = (char *) malloc(info.size + 1); attrib = (char *) malloc(info.size + 1);
file.ReadAttr("META:name", B_STRING_TYPE, 0, attrib, info.size); file.ReadAttr("META:name", B_STRING_TYPE, 0, attrib, info.size);
attrib[info.size] = 0; // Just in case it wasn't NUL terminated. attrib[info.size] = 0; // Just in case it wasn't NUL terminated.
+13 -13
View File
@@ -525,9 +525,9 @@ suffix_word(char* dst, const char* src, char flag)
end = stpcpy(dst, src); end = stpcpy(dst, src);
flag = toupper(flag); flag = toupper(flag);
switch(flag) { switch (flag) {
case 'V': case 'V':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ive"); end = stpcpy(end - 1, "ive");
break; break;
@@ -537,7 +537,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'N': case 'N':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ion"); end = stpcpy(end - 1, "ion");
break; break;
@@ -550,7 +550,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'X': case 'X':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ions"); end = stpcpy(end - 1, "ions");
break; break;
@@ -563,7 +563,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'H': case 'H':
switch(end[-1]) { switch (end[-1]) {
case 'y': case 'y':
end = stpcpy(end - 1, "ieth"); end = stpcpy(end - 1, "ieth");
break; break;
@@ -576,7 +576,7 @@ suffix_word(char* dst, const char* src, char flag)
end = stpcpy(end, "ly"); end = stpcpy(end, "ly");
break; break;
case 'G': case 'G':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ing"); end = stpcpy(end - 1, "ing");
break; break;
@@ -586,7 +586,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'J': case 'J':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ings"); end = stpcpy(end - 1, "ings");
break; break;
@@ -596,7 +596,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'D': case 'D':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ed"); end = stpcpy(end - 1, "ed");
break; break;
@@ -612,7 +612,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'T': case 'T':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "est"); end = stpcpy(end - 1, "est");
break; break;
@@ -628,7 +628,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'R': case 'R':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "er"); end = stpcpy(end - 1, "er");
break; break;
@@ -644,7 +644,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'Z': case 'Z':
switch(end[-1]) { switch (end[-1]) {
case 'e': case 'e':
end = stpcpy(end - 1, "ers"); end = stpcpy(end - 1, "ers");
break; break;
@@ -660,7 +660,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'S': case 'S':
switch(end[-1]) { switch (end[-1]) {
case 's': case 's':
case 'x': case 'x':
case 'z': case 'z':
@@ -679,7 +679,7 @@ suffix_word(char* dst, const char* src, char flag)
} }
break; break;
case 'P': case 'P':
switch(end[-1]) { switch (end[-1]) {
case 'y': case 'y':
if (!strchr("aeiou", end[-2])) { if (!strchr("aeiou", end[-2])) {
end = stpcpy(end - 1, "iness"); end = stpcpy(end - 1, "iness");