summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_bidi.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-01 18:47:54 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-01 18:47:54 +0000
commit4bbbca4880fdff6b106bd935e6cd62f82025ec55 (patch)
treedfe88a24e9df312a99c1dcfa08d66a4118f98c22 /core/fxcrt/fx_bidi.h
parent13339176b157eab56a1fa0a11525e193c3aa597a (diff)
downloadpdfium-4bbbca4880fdff6b106bd935e6cd62f82025ec55.tar.xz
Clean up CFX_BidiString.
- Refer to the string in CFX_BidiString by const-ref. - Remove useless CharAt() method. - Turn a member variable into a local variable. Change-Id: I30f221b7350150c839a793129789d8ea7cc1f331 Reviewed-on: https://pdfium-review.googlesource.com/31670 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_bidi.h')
-rw-r--r--core/fxcrt/fx_bidi.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/core/fxcrt/fx_bidi.h b/core/fxcrt/fx_bidi.h
index a9b52cf6fb..54d5255e3e 100644
--- a/core/fxcrt/fx_bidi.h
+++ b/core/fxcrt/fx_bidi.h
@@ -41,7 +41,7 @@ class CFX_BidiChar {
// Call after a change in direction is indicated by the above to get
// information about the segment to process.
- Segment GetSegmentInfo() const { return m_LastSegment; }
+ const Segment& GetSegmentInfo() const { return m_LastSegment; }
private:
void StartNewSegment(CFX_BidiChar::Direction direction);
@@ -58,22 +58,18 @@ class CFX_BidiString {
~CFX_BidiString();
// Overall direction is always LEFT or RIGHT, never NEUTRAL.
- CFX_BidiChar::Direction OverallDirection() const {
- return m_eOverallDirection;
- }
+ CFX_BidiChar::Direction OverallDirection() const;
// Force the overall direction to be R2L regardless of what was detected.
void SetOverallDirectionRight();
- wchar_t CharAt(size_t x) const { return m_Str[x]; }
const_iterator begin() const { return m_Order.begin(); }
const_iterator end() const { return m_Order.end(); }
private:
- const WideString m_Str;
- std::unique_ptr<CFX_BidiChar> m_pBidiChar;
+ const WideString& m_Str;
std::vector<CFX_BidiChar::Segment> m_Order;
- CFX_BidiChar::Direction m_eOverallDirection;
+ CFX_BidiChar::Direction m_eOverallDirection = CFX_BidiChar::LEFT;
};
#if PDF_ENABLE_XFA