From 3847b57855c0ffae3f12e60b2e79bc0f59095f5a Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 9 Feb 2022 22:26:11 -0500 Subject: [PATCH] fix(mail): fix type of SOGoMailComposeFontSize defaults --- SoObjects/SOGo/SOGoUserDefaults.h | 6 +++--- SoObjects/SOGo/SOGoUserDefaults.m | 10 +++++----- UI/MailerUI/UIxMailEditor.m | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index 11131f8c16..12f3ee33ac 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -1,6 +1,6 @@ /* SOGoUserDefaults.h - this file is part of SOGo * - * Copyright (C) 2011-2021 Inverse inc. + * Copyright (C) 2011-2022 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -142,8 +142,8 @@ extern NSString *SOGoWeekStartFirstFullWeek; - (void) setMailComposeMessageType: (NSString *) newValue; - (NSString *) mailComposeMessageType; -- (void) setMailComposeFontSize: (NSString *) newValue; -- (NSString *) mailComposeFontSize; +- (void) setMailComposeFontSize: (int) newValue; +- (int) mailComposeFontSize; - (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; - (NSString *) mailDisplayRemoteInlineImages; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 0f8ecb22e5..5e2f021db1 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -1,6 +1,6 @@ /* SOGoUserDefaults.m - this file is part of SOGo * - * Copyright (C) 2009-2021 Inverse inc. + * Copyright (C) 2009-2022 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -600,14 +600,14 @@ - (NSString *) mailComposeMessageType return [self stringForKey: @"SOGoMailComposeMessageType"]; } -- (void) setMailComposeFontSize: (NSString *) newValue +- (void) setMailComposeFontSize: (int) newValue { - [self setObject: newValue forKey: @"SOGoMailComposeFontSize"]; + [self setInteger: newValue forKey: @"SOGoMailComposeFontSize"]; } -- (NSString *) mailComposeFontSize +- (int) mailComposeFontSize { - return [self stringForKey: @"SOGoMailComposeFontSize"]; + return [self integerForKey: @"SOGoMailComposeFontSize"]; } - (void) setMailDisplayRemoteInlineImages: (NSString *) newValue diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index f2f8d86707..9f451b9eef 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -600,11 +600,12 @@ - (NSException *) _saveRequestInfo { NSDictionary *info; NSException *error; - NSString *fontSize, *content; + NSString *content; NGMimeType *mimeType; WORequest *request; SOGoDraftObject *co; SOGoUserDefaults *ud; + int fontSize; error = nil; request = [context request]; @@ -629,8 +630,8 @@ - (NSException *) _saveRequestInfo // Set a base font size if mail is HTML and user has set a default font-size ud = [[context activeUser] userDefaults]; fontSize = [ud mailComposeFontSize]; - if ([fontSize intValue] > 0) - content = [NSString stringWithFormat: @"%@", + if (fontSize > 0) + content = [NSString stringWithFormat: @"%@", fontSize, text]; else content = [NSString stringWithFormat: @"%@", text];