summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_textbreak.h
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.h
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.h')
-rw-r--r--xfa/fgas/layout/fgas_textbreak.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h
index b83f2604c8..af6d52163f 100644
--- a/xfa/fgas/layout/fgas_textbreak.h
+++ b/xfa/fgas/layout/fgas_textbreak.h
@@ -79,27 +79,25 @@ class IFX_TxtAccess {
};
struct FX_TXTRUN {
- FX_TXTRUN() {
- pAccess = NULL;
- pIdentity = NULL;
- pStr = NULL;
- pWidths = NULL;
- iLength = 0;
- pFont = NULL;
- fFontSize = 12;
- dwStyles = 0;
- iHorizontalScale = 100;
- iVerticalScale = 100;
- iCharRotation = 0;
- dwCharStyles = 0;
- pRect = NULL;
- wLineBreakChar = L'\n';
- bSkipSpace = TRUE;
- }
+ FX_TXTRUN()
+ : pAccess(nullptr),
+ pIdentity(nullptr),
+ pWidths(nullptr),
+ iLength(0),
+ pFont(nullptr),
+ fFontSize(12),
+ dwStyles(0),
+ iHorizontalScale(100),
+ iVerticalScale(100),
+ iCharRotation(0),
+ dwCharStyles(0),
+ pRect(nullptr),
+ wLineBreakChar(L'\n'),
+ bSkipSpace(TRUE) {}
IFX_TxtAccess* pAccess;
void* pIdentity;
- const FX_WCHAR* pStr;
+ CFX_WideString wsStr;
int32_t* pWidths;
int32_t iLength;
IFX_Font* pFont;