Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: xfa/fee/fde_txtedtengine.cpp

Issue 1882043004: Remove implicit cast from CFX_WideString to (const wchar_t*) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: win error #2 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fde/xml/fde_xml_imp.cpp ('k') | xfa/fgas/crt/fgas_stream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fee/fde_txtedtengine.cpp
diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp
index b98f1e141f58ed81a41cfbbe1fd26063155398a6..ac3c74f620b2b093db09a4f178ede54fb3cecca1 100644
--- a/xfa/fee/fde_txtedtengine.cpp
+++ b/xfa/fee/fde_txtedtengine.cpp
@@ -1195,7 +1195,7 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) {
CFX_ArrayTemplate<int32_t> PosArr;
int32_t nLength = wsText.GetLength();
int32_t i = 0;
- FX_WCHAR* lpPos = (FX_WCHAR*)(const FX_WCHAR*)wsText;
+ FX_WCHAR* lpPos = const_cast<FX_WCHAR*>(wsText.c_str());
for (i = 0; i < nLength; i++, lpPos++) {
if (*lpPos == m_wLineEnd) {
*lpPos = wc;
@@ -1226,7 +1226,7 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) {
wsText = wsTemp;
} else {
int32_t nLength = wsText.GetLength();
- FX_WCHAR* lpBuf = (FX_WCHAR*)(const FX_WCHAR*)wsText;
+ FX_WCHAR* lpBuf = const_cast<FX_WCHAR*>(wsText.c_str());
for (int32_t i = 0; i < nLength; i++, lpBuf++) {
if (*lpBuf == m_wLineEnd) {
*lpBuf = wc;
@@ -1527,7 +1527,7 @@ FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
}
pTextOut->SetStyles(dwStyle);
wsText += L"\n";
- pTextOut->CalcLogicSize(wsText, wsText.GetLength(), rcText);
+ pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), rcText);
pTextOut->Release();
wsText.Delete(wsText.GetLength() - 1);
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz) &&
« no previous file with comments | « xfa/fde/xml/fde_xml_imp.cpp ('k') | xfa/fgas/crt/fgas_stream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698