summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_textbreak.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-19 12:03:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-19 12:03:15 -0700
commitd403329fa818ffd650221cee366c837f867e3df6 (patch)
treef3bea020aa7d558fc1b0bcb1a0669ea406571ed7 /xfa/fgas/layout/fgas_textbreak.cpp
parentc37b04e80aafc8437d458ced2366f825749ae2d7 (diff)
downloadpdfium-d403329fa818ffd650221cee366c837f867e3df6.tar.xz
Store WideString, not raw pointer, in FX_TXTRUN
Storing raw pointers in structs is a questionable idea, given that we've got string classes to auto-manage lifetimes of the underlying storage. Also, return FX_TXTRUN while we're at it, since we count on RVO removing copies nowadays. BUG=pdfium:480 Review URL: https://codereview.chromium.org/1900743004
Diffstat (limited to 'xfa/fgas/layout/fgas_textbreak.cpp')
-rw-r--r--xfa/fgas/layout/fgas_textbreak.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 0face90abd..f8cfcd0066 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -1174,7 +1174,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
}
IFX_TxtAccess* pAccess = pTxtRun->pAccess;
void* pIdentity = pTxtRun->pIdentity;
- const FX_WCHAR* pStr = pTxtRun->pStr;
+ const FX_WCHAR* pStr = pTxtRun->wsStr.c_str();
int32_t* pWidths = pTxtRun->pWidths;
int32_t iLength = pTxtRun->iLength - 1;
IFX_Font* pFont = pTxtRun->pFont;
@@ -1554,7 +1554,7 @@ int32_t CFX_TxtBreak::GetCharRects(const FX_TXTRUN* pTxtRun,
}
IFX_TxtAccess* pAccess = pTxtRun->pAccess;
void* pIdentity = pTxtRun->pIdentity;
- const FX_WCHAR* pStr = pTxtRun->pStr;
+ const FX_WCHAR* pStr = pTxtRun->wsStr.c_str();
int32_t* pWidths = pTxtRun->pWidths;
int32_t iLength = pTxtRun->iLength;
CFX_RectF rect(*pTxtRun->pRect);