summaryrefslogtreecommitdiff
path: root/core/src/fxge/win32
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-12-30 16:56:12 -0800
committerBo Xu <bo_xu@foxitsoftware.com>2014-12-30 16:56:12 -0800
commit659a56bcbeb12b22708fe979d12b318080d828ba (patch)
treea2dcf561ef8db60344789adc97dbd690f828825c /core/src/fxge/win32
parent3fc36e8ba200e0dd6099a1f4d72c463c3e8a1d01 (diff)
downloadpdfium-659a56bcbeb12b22708fe979d12b318080d828ba.tar.xz
Get rid of FX_LPCSTR cast.
Follow up on https://codereview.chromium.org/733693003 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/809993004
Diffstat (limited to 'core/src/fxge/win32')
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp10
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp8
2 files changed, 9 insertions, 9 deletions
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 06e9777650..debf94d7a6 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -214,7 +214,7 @@ FX_BOOL _GetSubFontName(CFX_ByteString& name)
{
int size = sizeof g_JpFontNameMap;
void* pFontnameMap = (void*)g_JpFontNameMap;
- _FontNameMap* found = (_FontNameMap*)FXSYS_bsearch((FX_LPCSTR)name, pFontnameMap,
+ _FontNameMap* found = (_FontNameMap*)FXSYS_bsearch(name.c_str(), pFontnameMap,
size / sizeof (_FontNameMap), sizeof (_FontNameMap), compareString);
if (found == NULL) {
return FALSE;
@@ -483,13 +483,13 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_R
int pitch = pBitmap->GetPitch();
LPBYTE pBuffer = pBitmap->GetBuffer();
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
- ((BITMAPINFOHEADER*)(FX_LPCSTR)info)->biHeight *= -1;
+ ((BITMAPINFOHEADER*)info.c_str())->biHeight *= -1;
FX_RECT dst_rect(0, 0, width, height);
dst_rect.Intersect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
int dst_width = dst_rect.Width();
int dst_height = dst_rect.Height();
::StretchDIBits(m_hDC, left, top, dst_width, dst_height,
- 0, 0, dst_width, dst_height, pBuffer, (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS, SRCCOPY);
+ 0, 0, dst_width, dst_height, pBuffer, (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS, SRCCOPY);
delete pBitmap;
} else {
CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
@@ -502,7 +502,7 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_R
LPBYTE pBuffer = pBitmap->GetBuffer();
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
::SetDIBitsToDevice(m_hDC, left, top, width, height, pSrcRect->left, pBitmap->GetHeight() - pSrcRect->bottom,
- 0, pBitmap->GetHeight(), pBuffer, (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ 0, pBitmap->GetHeight(), pBuffer, (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS);
if (pBitmap != pBitmap1) {
delete pBitmap;
}
@@ -536,7 +536,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de
CFX_ByteString toStrechBitmapInfo = CFX_WindowsDIB::GetBitmapInfo(pToStrechBitmap);
::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
0, 0, pToStrechBitmap->GetWidth(), pToStrechBitmap->GetHeight(), pToStrechBitmap->GetBuffer(),
- (BITMAPINFO*)(FX_LPCSTR)toStrechBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
+ (BITMAPINFO*)toStrechBitmapInfo.c_str(), DIB_RGB_COLORS, SRCCOPY);
if (del) {
delete pToStrechBitmap;
}
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index e369073cc2..2ecf539ff7 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -108,8 +108,8 @@ HBITMAP CFX_WindowsDIB::GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC)
{
CFX_ByteString info = GetBitmapInfo(pBitmap);
HBITMAP hBitmap = NULL;
- hBitmap = CreateDIBitmap(hDC, (BITMAPINFOHEADER*)(FX_LPCSTR)info, CBM_INIT,
- pBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ hBitmap = CreateDIBitmap(hDC, (BITMAPINFOHEADER*)info.c_str(), CBM_INIT,
+ pBitmap->GetBuffer(), (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS);
return hBitmap;
}
void GetBitmapSize(HBITMAP hBitmap, int& w, int& h)
@@ -146,7 +146,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(FX_LPCWSTR filename)
return NULL;
}
CFX_ByteString info = GetBitmapInfo(pDIBitmap);
- int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS);
if (!ret) {
if (pDIBitmap) {
delete pDIBitmap;
@@ -182,7 +182,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args)
return NULL;
}
CFX_ByteString info = GetBitmapInfo(pDIBitmap);
- int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)info.c_str(), DIB_RGB_COLORS);
if (!ret) {
if (pDIBitmap) {
delete pDIBitmap;