============================================================================= Style_StrGetSize()
| 2449 | // Style_StrGetSize() |
| 2450 | // |
| 2451 | BOOL Style_StrGetSize ( LPCWSTR lpszStyle, int *i ) |
| 2452 | { |
| 2453 | WCHAR tch[256]; |
| 2454 | WCHAR *p; |
| 2455 | int iValue; |
| 2456 | int iSign = 0; |
| 2457 | int itok; |
| 2458 | if ( p = StrStrI ( lpszStyle, L"size:" ) ) { |
| 2459 | lstrcpy ( tch, p + CSTRLEN ( L"size:" ) ); |
| 2460 | if ( tch[0] == L'+' ) { |
| 2461 | iSign = 1; |
| 2462 | tch[0] = L' '; |
| 2463 | } else if ( tch[0] == L'-' ) { |
| 2464 | iSign = -1; |
| 2465 | tch[0] = L' '; |
| 2466 | } |
| 2467 | if ( p = StrChr ( tch, L';' ) ) { |
| 2468 | *p = L'\0'; |
| 2469 | } |
| 2470 | TrimString ( tch ); |
| 2471 | itok = swscanf ( tch, L"%i", &iValue ); |
| 2472 | if ( itok == 1 ) { |
| 2473 | if ( iSign == 0 ) { |
| 2474 | *i = iValue; |
| 2475 | } else { |
| 2476 | *i = max ( 0, iBaseFontSize + iValue * iSign ); // size must be + |
| 2477 | } |
| 2478 | return TRUE; |
| 2479 | } |
| 2480 | } |
| 2481 | return FALSE; |
| 2482 | } |
| 2483 | |
| 2484 | |
| 2485 | //============================================================================= |
no test coverage detected