Skip to content

Commit

Permalink
fix(mail): fix type of SOGoMailComposeFontSize defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Feb 10, 2022
1 parent 150fe70 commit 3847b57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions SoObjects/SOGo/SOGoUserDefaults.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions SoObjects/SOGo/SOGoUserDefaults.m
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions UI/MailerUI/UIxMailEditor.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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: @"<html><span style=\"font-size: %@px;\">%@</span></html>",
if (fontSize > 0)
content = [NSString stringWithFormat: @"<html><span style=\"font-size: %ipx;\">%@</span></html>",
fontSize, text];
else
content = [NSString stringWithFormat: @"<html>%@</html>", text];
Expand Down

0 comments on commit 3847b57

Please sign in to comment.