mirror of
https://github.com/moparisthebest/k-9
synced 2024-08-13 17:03:48 -04:00
astyle
This commit is contained in:
parent
8bb7613471
commit
aacb414004
@ -78,7 +78,8 @@ class InsertableHtmlContent implements Serializable
|
|||||||
/**
|
/**
|
||||||
* Remove all quoted content.
|
* Remove all quoted content.
|
||||||
*/
|
*/
|
||||||
public void clearQuotedContent() {
|
public void clearQuotedContent()
|
||||||
|
{
|
||||||
quotedContent.setLength(0);
|
quotedContent.setLength(0);
|
||||||
footerInsertionPoint = 0;
|
footerInsertionPoint = 0;
|
||||||
headerInsertionPoint = 0;
|
headerInsertionPoint = 0;
|
||||||
@ -89,7 +90,8 @@ class InsertableHtmlContent implements Serializable
|
|||||||
* inserted content buffer.
|
* inserted content buffer.
|
||||||
* @param content
|
* @param content
|
||||||
*/
|
*/
|
||||||
public void setUserContent(final String content) {
|
public void setUserContent(final String content)
|
||||||
|
{
|
||||||
userContent = new StringBuilder(content);
|
userContent = new StringBuilder(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,7 +1193,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
|
|
||||||
// FYI, there's nothing in the code that requires these variables to one letter. They're one
|
// FYI, there's nothing in the code that requires these variables to one letter. They're one
|
||||||
// letter simply to save space. This name sucks. It's too similar to Account.Identity.
|
// letter simply to save space. This name sucks. It's too similar to Account.Identity.
|
||||||
private enum IdentityField {
|
private enum IdentityField
|
||||||
|
{
|
||||||
LENGTH("l"),
|
LENGTH("l"),
|
||||||
OFFSET("o"),
|
OFFSET("o"),
|
||||||
MESSAGE_FORMAT("f"),
|
MESSAGE_FORMAT("f"),
|
||||||
@ -1205,11 +1206,13 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
IdentityField(String value) {
|
IdentityField(String value)
|
||||||
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String value() {
|
public String value()
|
||||||
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1218,7 +1221,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
* checked for integer-ness during decoding.
|
* checked for integer-ness during decoding.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static IdentityField[] getIntegerFields() {
|
public static IdentityField[] getIntegerFields()
|
||||||
|
{
|
||||||
return new IdentityField[] { LENGTH, OFFSET };
|
return new IdentityField[] { LENGTH, OFFSET };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1232,13 +1236,17 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
* @param body {@link TextBody} to analyze for body length and offset.
|
* @param body {@link TextBody} to analyze for body length and offset.
|
||||||
* @return Identity string.
|
* @return Identity string.
|
||||||
*/
|
*/
|
||||||
private String buildIdentityHeader(final TextBody body) {
|
private String buildIdentityHeader(final TextBody body)
|
||||||
|
{
|
||||||
Uri.Builder uri = new Uri.Builder();
|
Uri.Builder uri = new Uri.Builder();
|
||||||
if(body.getComposedMessageLength() != null && body.getComposedMessageOffset() != null) {
|
if(body.getComposedMessageLength() != null && body.getComposedMessageOffset() != null)
|
||||||
|
{
|
||||||
// See if the message body length is already in the TextBody.
|
// See if the message body length is already in the TextBody.
|
||||||
uri.appendQueryParameter(IdentityField.LENGTH.value(), body.getComposedMessageLength().toString());
|
uri.appendQueryParameter(IdentityField.LENGTH.value(), body.getComposedMessageLength().toString());
|
||||||
uri.appendQueryParameter(IdentityField.OFFSET.value(), body.getComposedMessageOffset().toString());
|
uri.appendQueryParameter(IdentityField.OFFSET.value(), body.getComposedMessageOffset().toString());
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// If not, calculate it now.
|
// If not, calculate it now.
|
||||||
uri.appendQueryParameter(IdentityField.LENGTH.value(), Integer.toString(body.getText().length()));
|
uri.appendQueryParameter(IdentityField.LENGTH.value(), Integer.toString(body.getText().length()));
|
||||||
uri.appendQueryParameter(IdentityField.OFFSET.value(), Integer.toString(0));
|
uri.appendQueryParameter(IdentityField.OFFSET.value(), Integer.toString(0));
|
||||||
@ -1312,7 +1320,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Integer.parseInt(identity.get(key));
|
Integer.parseInt(identity.get(key));
|
||||||
} catch (NumberFormatException e)
|
}
|
||||||
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
Log.e(K9.LOG_TAG, "Invalid " + key.name() + " field in identity: " + identity.get(key));
|
Log.e(K9.LOG_TAG, "Invalid " + key.name() + " field in identity: " + identity.get(key));
|
||||||
}
|
}
|
||||||
@ -1334,7 +1343,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
identity.put(IdentityField.LENGTH, Integer.valueOf(bodyLengthS).toString());
|
identity.put(IdentityField.LENGTH, Integer.valueOf(bodyLengthS).toString());
|
||||||
} catch (Exception e)
|
}
|
||||||
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(K9.LOG_TAG, "Unable to parse bodyLength '" + bodyLengthS + "'");
|
Log.e(K9.LOG_TAG, "Unable to parse bodyLength '" + bodyLengthS + "'");
|
||||||
}
|
}
|
||||||
@ -2253,7 +2263,9 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
// composition window. If that's the case, try and convert it to text to
|
// composition window. If that's the case, try and convert it to text to
|
||||||
// match the behavior in text mode.
|
// match the behavior in text mode.
|
||||||
mMessageContentView.setText(getBodyTextFromMessage(message, MessageFormat.TEXT));
|
mMessageContentView.setText(getBodyTextFromMessage(message, MessageFormat.TEXT));
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Part part = MimeUtility.findFirstPartByMimeType(message, "text/html");
|
Part part = MimeUtility.findFirstPartByMimeType(message, "text/html");
|
||||||
if (part != null) // Shouldn't happen if we were the one who saved it.
|
if (part != null) // Shouldn't happen if we were the one who saved it.
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user