============================================================================= Style_StrGetColor()
| 2508 | // Style_StrGetColor() |
| 2509 | // |
| 2510 | BOOL Style_StrGetColor ( BOOL bFore, LPCWSTR lpszStyle, int *rgb ) |
| 2511 | { |
| 2512 | WCHAR tch[256]; |
| 2513 | WCHAR *p; |
| 2514 | int iValue; |
| 2515 | int itok; |
| 2516 | WCHAR *pItem = ( bFore ) ? L"fore:" : L"back:"; |
| 2517 | if ( p = StrStrI ( lpszStyle, pItem ) ) { |
| 2518 | lstrcpy ( tch, p + lstrlen ( pItem ) ); |
| 2519 | if ( tch[0] == L'#' ) { |
| 2520 | tch[0] = L' '; |
| 2521 | } |
| 2522 | if ( p = StrChr ( tch, L';' ) ) { |
| 2523 | *p = L'\0'; |
| 2524 | } |
| 2525 | TrimString ( tch ); |
| 2526 | itok = swscanf ( tch, L"%x", &iValue ); |
| 2527 | if ( itok == 1 ) { |
| 2528 | *rgb = RGB ( ( iValue & 0xFF0000 ) >> 16, ( iValue & 0xFF00 ) >> 8, iValue & 0xFF ); |
| 2529 | return TRUE; |
| 2530 | } |
| 2531 | } |
| 2532 | return FALSE; |
| 2533 | } |
| 2534 | |
| 2535 | |
| 2536 | //============================================================================= |
no test coverage detected