Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13888/src/gui
Modified Files:
wxComposeView.cpp
Log Message:
preserve the original message encoding when changing the identity in composer
Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.398
retrieving revision 1.399
diff -b -u -2 -r1.398 -r1.399
--- wxComposeView.cpp 12 Feb 2006 17:19:47 -0000 1.398
+++ wxComposeView.cpp 12 Feb 2006 17:33:31 -0000 1.399
@@ -3055,4 +3055,5 @@
wxComposeView::SetEncoding(wxFontEncoding encoding, wxFontEncoding encConv)
{
+ // use the default encoding if no explicit one specified
if ( encoding == wxFONTENCODING_DEFAULT )
{
@@ -3068,6 +3069,17 @@
m_encoding = encoding;
+
+
+ // find the encoding for the editor: it must be one supported by the system
+ if ( encConv == wxFONTENCODING_SYSTEM )
+ {
+ encConv = encoding;
+ if ( !EnsureAvailableTextEncoding(&encConv) )
+ encConv = wxFONTENCODING_SYSTEM;
+ }
+
m_editor->SetEncoding(encConv == wxFONTENCODING_SYSTEM ? encoding :
encConv);
+
// check "Default" menu item if we use the system default encoding in
absence
// of any user-configured default
@@ -3096,6 +3108,4 @@
else // not Unicode
{
- encConv = enc;
- if ( !EnsureAvailableTextEncoding(&encConv) )
encConv = wxFONTENCODING_SYSTEM;
}
@@ -3161,4 +3171,7 @@
if ( !IsModified() )
{
+ // preserve the original encoding as DoClear() resets it
+ wxFontEncoding encodingOrig = m_encoding;
+
DoClear();
@@ -3168,4 +3181,10 @@
m_template.clear();
+ if ( encodingOrig != wxFONTENCODING_DEFAULT &&
+ encodingOrig != wxFONTENCODING_SYSTEM )
+ {
+ SetEncoding(encodingOrig);
+ }
+
DoInitText();
}
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates