[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] Fix for text attribute debug output



Find attached below a fix for the debug tree output of font typefac, 
bold, italic and underline attribute nodes. Up to now, nothing was 
displayed for them in the tree view because some text was non-Unicode 
and GTK checks the validity of the UTF8-text it is supplied refusing 
to display anything if it is incorrect.

Martin
Index: Kernel/txtattr.cpp
===================================================================
--- Kernel/txtattr.cpp	(Revision 1556)
+++ Kernel/txtattr.cpp	(Arbeitskopie)
@@ -4055,11 +4055,11 @@
 		}
 		
 		(*Str) += buf;
-		camSnprintf( buf, 255, _T("Bold = %s\r\n"), Value.IsBold ? "TRUE":"FALSE");
+		camSnprintf( buf, 255, _T("Bold = %s\r\n"), Value.IsBold ? _T("TRUE"):_T("FALSE"));
 		(*Str) += buf;
-		camSnprintf( buf, 255, _T("Italic = %s\r\n"), Value.IsItalic ? "TRUE":"FALSE");
+		camSnprintf( buf, 255, _T("Italic = %s\r\n"), Value.IsItalic ? _T("TRUE"):_T("FALSE"));
 		(*Str) += buf;	
-		camSnprintf( buf, 255, _T("Replaced = %s\r\n"), FONTMANAGER->IsFontReplaced(&FontName, Class) ? "TRUE":"FALSE");
+		camSnprintf( buf, 255, _T("Replaced = %s\r\n"), FONTMANAGER->IsFontReplaced(&FontName, Class) ? _T("TRUE"):_T("FALSE"));
 		(*Str) += buf;	
 	}
 }
@@ -4342,9 +4342,9 @@
 	NodeAttribute::GetDebugDetails( Str );
 
 	String_256 TempStr;
-	char* p;
+	TCHAR* p;
 
-	(Value.BoldOn) ? (p = "TRUE") : (p = "FALSE");
+	(Value.BoldOn) ? (p = _T("TRUE")) : (p = _T("FALSE"));
 	TempStr._MakeMsg( TEXT("\r\nBold=#1%s\r\n"), p);
 	(*Str) += TempStr;
 }
@@ -4627,9 +4627,9 @@
 	NodeAttribute::GetDebugDetails( Str );
 
 	String_256 TempStr;
-	char* p;
+	TCHAR* p;
 
-	(Value.ItalicOn) ? (p = "TRUE") : (p = "FALSE");
+	(Value.ItalicOn) ? (p = _T("TRUE")) : (p = _T("FALSE"));
 	TempStr._MakeMsg( TEXT("\r\nItalic=#1%s\r\n"), p);
 	(*Str) += TempStr;
 }
@@ -5211,8 +5211,8 @@
 	NodeAttribute::GetDebugDetails( Str );
 
 	String_256 TempStr;
-	char* p;
-	(Value.Underlined) ? (p="TRUE") : (p="FALSE");
+	TCHAR* p;
+	(Value.Underlined) ? (p=_T("TRUE")) : (p=_T("FALSE"));
 	TempStr._MakeMsg( TEXT("\r\nUnderline=#1%s\r\n"), p);
 	(*Str) += TempStr;
 }