summaryrefslogtreecommitdiff
path: root/xfa/fgas
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-13 17:21:31 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-13 17:21:31 -0700
commitafe94306e3c542f0d499e7f7706ee5dec4028d8a (patch)
tree5012c9356cf1af259c74da3008dc7fcad439db2a /xfa/fgas
parent01e624fb699af3a8ee2f81620d59d366dac18f29 (diff)
downloadpdfium-afe94306e3c542f0d499e7f7706ee5dec4028d8a.tar.xz
Make CFX_WideString(const CFX_WideString&) explicit.
BUG= Review-Url: https://codereview.chromium.org/1979723003
Diffstat (limited to 'xfa/fgas')
-rw-r--r--xfa/fgas/localization/fgas_locale.cpp15
-rw-r--r--xfa/fgas/localization/fgas_locale.h2
-rw-r--r--xfa/fgas/localization/fgas_localeimp.h3
-rw-r--r--xfa/fgas/localization/fgas_localemgr.cpp5
-rw-r--r--xfa/fgas/localization/fgas_localemgr.h14
5 files changed, 19 insertions, 20 deletions
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index 2336b20ee3..851b687c4b 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -677,7 +677,7 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString& wsPattern,
while (ccf < iLenf && pStr[ccf] != ')') {
wsLCID += pStr[ccf++];
}
- pLocale = GetPatternLocale(wsLCID.AsStringC());
+ pLocale = GetPatternLocale(wsLCID);
} else if (pStr[ccf] == '{') {
bBrackOpen = TRUE;
break;
@@ -737,7 +737,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern,
while (ccf < iLenf && pStr[ccf] != ')') {
wsLCID += pStr[ccf++];
}
- pLocale = GetPatternLocale(wsLCID.AsStringC());
+ pLocale = GetPatternLocale(wsLCID);
} else if (pStr[ccf] == '{') {
bBrackOpen = TRUE;
break;
@@ -2192,7 +2192,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(
while (ccf < iLenf && pStr[ccf] != ')') {
wsLCID += pStr[ccf++];
}
- pLocale = GetPatternLocale(wsLCID.AsStringC());
+ pLocale = GetPatternLocale(wsLCID);
} else if (pStr[ccf] == '{') {
bBraceOpen = TRUE;
break;
@@ -2883,7 +2883,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(const CFX_WideStringC& wsInputNum,
int32_t cc = 0, ccf = 0;
const FX_WCHAR* strf = wsNumFormat.c_str();
int lenf = wsNumFormat.GetLength();
- CFX_WideString wsSrcNum = wsInputNum;
+ CFX_WideString wsSrcNum(wsInputNum);
wsSrcNum.TrimLeft('0');
if (wsSrcNum.IsEmpty() || wsSrcNum[0] == '.') {
wsSrcNum.Insert(0, '0');
@@ -4269,7 +4269,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime,
wsOutput);
}
} else {
- CFX_WideStringC wsSrcDate(wsSrcDateTime.c_str(), iT);
+ CFX_WideString wsSrcDate(wsSrcDateTime.c_str(), iT);
CFX_WideStringC wsSrcTime(wsSrcDateTime.c_str() + iT + 1,
wsSrcDateTime.GetLength() - iT - 1);
if (wsSrcDate.IsEmpty() || wsSrcTime.IsEmpty()) {
@@ -4345,10 +4345,7 @@ FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern,
}
return TRUE;
}
-IFX_Locale* CFX_FormatString::GetPatternLocale(
- const CFX_WideStringC& wsLocale) {
- if (m_bUseLCID) {
- }
+IFX_Locale* CFX_FormatString::GetPatternLocale(const CFX_WideString& wsLocale) {
return m_pLocaleMgr->GetLocaleByName(wsLocale);
}
#define FXMATH_DECIMAL_SCALELIMIT 0x1c
diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h
index 48592a3bb2..d1d862b0b5 100644
--- a/xfa/fgas/localization/fgas_locale.h
+++ b/xfa/fgas/localization/fgas_locale.h
@@ -90,7 +90,7 @@ class IFX_LocaleMgr {
virtual uint16_t GetDefLocaleID() = 0;
virtual IFX_Locale* GetDefLocale() = 0;
virtual IFX_Locale* GetLocale(uint16_t lcid) = 0;
- virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName) = 0;
+ virtual IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) = 0;
};
IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath,
uint16_t wDefaultLCID);
diff --git a/xfa/fgas/localization/fgas_localeimp.h b/xfa/fgas/localization/fgas_localeimp.h
index c828a6bbd7..bbbdcb17e1 100644
--- a/xfa/fgas/localization/fgas_localeimp.h
+++ b/xfa/fgas/localization/fgas_localeimp.h
@@ -114,7 +114,8 @@ class CFX_FormatString {
IFX_Locale*& pLocale,
CFX_WideString& wsDatePattern,
CFX_WideString& wsTimePattern);
- IFX_Locale* GetPatternLocale(const CFX_WideStringC& wsLocale);
+ IFX_Locale* GetPatternLocale(const CFX_WideString& wsLocale);
+
IFX_LocaleMgr* m_pLocaleMgr;
FX_BOOL m_bUseLCID;
};
diff --git a/xfa/fgas/localization/fgas_localemgr.cpp b/xfa/fgas/localization/fgas_localemgr.cpp
index 93e5ea0874..e0ce8d9127 100644
--- a/xfa/fgas/localization/fgas_localemgr.cpp
+++ b/xfa/fgas/localization/fgas_localemgr.cpp
@@ -91,7 +91,6 @@ IFX_Locale* CFX_LocaleMgr::GetLocale(uint16_t lcid) {
}
return pLocale;
}
-IFX_Locale* CFX_LocaleMgr::GetLocaleByName(
- const CFX_WideStringC& wsLocaleName) {
- return NULL;
+IFX_Locale* CFX_LocaleMgr::GetLocaleByName(const CFX_WideString& wsLocaleName) {
+ return nullptr;
}
diff --git a/xfa/fgas/localization/fgas_localemgr.h b/xfa/fgas/localization/fgas_localemgr.h
index 5f2647071b..d0ba90c9a8 100644
--- a/xfa/fgas/localization/fgas_localemgr.h
+++ b/xfa/fgas/localization/fgas_localemgr.h
@@ -12,15 +12,17 @@
class CFX_LocaleMgr : public IFX_LocaleMgr {
public:
CFX_LocaleMgr(uint16_t wDefLCID);
- virtual void Release() { delete this; }
- virtual uint16_t GetDefLocaleID();
- virtual IFX_Locale* GetDefLocale();
- virtual IFX_Locale* GetLocale(uint16_t lcid);
- virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName);
+
+ void Release() override { delete this; }
+ uint16_t GetDefLocaleID() override;
+ IFX_Locale* GetDefLocale() override;
+ IFX_Locale* GetLocale(uint16_t lcid) override;
+ IFX_Locale* GetLocaleByName(const CFX_WideString& wsLocaleName) override;
+
CFX_MapPtrToPtr m_lcid2xml;
protected:
- ~CFX_LocaleMgr();
+ ~CFX_LocaleMgr() override;
CFX_MapPtrToPtr m_lcid2locale;
uint16_t m_wDefLCID;
};