diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-03-06 18:53:05 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-06 18:53:05 +0000 |
commit | a32145f1f16b7b02110bf359208f587d7d486551 (patch) | |
tree | c97a9fbd14c9996e4bb8ceaa5167f0212b17f62c /xfa/fxfa/parser | |
parent | 9600a771999de20fb22130cdb97088591508f89f (diff) | |
download | pdfium-a32145f1f16b7b02110bf359208f587d7d486551.tar.xz |
Rename core/fxcrt IFX files to Iface
This CL renames the 3 IFX files in core/fxcrt to Iface instead.
Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3
Reviewed-on: https://pdfium-review.googlesource.com/27970
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_localemgr.cpp | 23 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_localemgr.h | 18 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_localevalue.cpp | 18 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_localevalue.h | 14 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.cpp | 22 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node.h | 6 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_nodelocale.h | 6 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_xmllocale.h | 6 |
8 files changed, 57 insertions, 56 deletions
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp index bb769b62f0..eb810dfc62 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.cpp +++ b/xfa/fxfa/parser/cxfa_localemgr.cpp @@ -1065,8 +1065,8 @@ const uint8_t g_ruRU_Locale[] = { 0xB3, 0x85, 0xFA, 0x59, 0x2A, 0x7A, 0xFF, 0x3D, 0xC4, 0x3F, 0xDE, 0xCB, 0x8B, 0xC4}; -static std::unique_ptr<IFX_Locale> XFA_GetLocaleFromBuffer(const uint8_t* pBuf, - int nBufLen) { +static std::unique_ptr<LocaleIface> XFA_GetLocaleFromBuffer(const uint8_t* pBuf, + int nBufLen) { if (!pBuf || nBufLen <= 0) return nullptr; @@ -1146,7 +1146,7 @@ uint16_t CXFA_LocaleMgr::GetDefLocaleID() const { return m_dwDeflcid; } -IFX_Locale* CXFA_LocaleMgr::GetDefLocale() { +LocaleIface* CXFA_LocaleMgr::GetDefLocale() { if (m_pDefLocale) return m_pDefLocale; @@ -1156,7 +1156,7 @@ IFX_Locale* CXFA_LocaleMgr::GetDefLocale() { if (!m_XMLLocaleArray.empty()) return m_XMLLocaleArray[0].get(); - std::unique_ptr<IFX_Locale> locale(GetLocale(m_dwDeflcid)); + std::unique_ptr<LocaleIface> locale(GetLocale(m_dwDeflcid)); m_pDefLocale = locale.get(); if (locale) m_XMLLocaleArray.push_back(std::move(locale)); @@ -1164,7 +1164,7 @@ IFX_Locale* CXFA_LocaleMgr::GetDefLocale() { return m_pDefLocale; } -std::unique_ptr<IFX_Locale> CXFA_LocaleMgr::GetLocale(uint16_t lcid) { +std::unique_ptr<LocaleIface> CXFA_LocaleMgr::GetLocale(uint16_t lcid) { switch (lcid) { case FX_LANG_zh_CN: return XFA_GetLocaleFromBuffer(g_zhCN_Locale, sizeof(g_zhCN_Locale)); @@ -1200,28 +1200,29 @@ std::unique_ptr<IFX_Locale> CXFA_LocaleMgr::GetLocale(uint16_t lcid) { } } -IFX_Locale* CXFA_LocaleMgr::GetLocaleByName(const WideString& wsLocaleName) { +LocaleIface* CXFA_LocaleMgr::GetLocaleByName(const WideString& wsLocaleName) { for (size_t i = 0; i < m_LocaleArray.size(); i++) { - IFX_Locale* pLocale = m_LocaleArray[i].get(); + LocaleIface* pLocale = m_LocaleArray[i].get(); if (pLocale->GetName() == wsLocaleName) return pLocale; } if (wsLocaleName.GetLength() < 2) return nullptr; for (size_t i = 0; i < m_XMLLocaleArray.size(); i++) { - IFX_Locale* pLocale = m_XMLLocaleArray[i].get(); + LocaleIface* pLocale = m_XMLLocaleArray[i].get(); if (pLocale->GetName() == wsLocaleName) return pLocale; } - std::unique_ptr<IFX_Locale> pLocale(GetLocale(XFA_GetLanguage(wsLocaleName))); - IFX_Locale* pRetLocale = pLocale.get(); + std::unique_ptr<LocaleIface> pLocale( + GetLocale(XFA_GetLanguage(wsLocaleName))); + LocaleIface* pRetLocale = pLocale.get(); if (pLocale) m_XMLLocaleArray.push_back(std::move(pLocale)); return pRetLocale; } -void CXFA_LocaleMgr::SetDefLocale(IFX_Locale* pLocale) { +void CXFA_LocaleMgr::SetDefLocale(LocaleIface* pLocale) { m_pDefLocale = pLocale; } diff --git a/xfa/fxfa/parser/cxfa_localemgr.h b/xfa/fxfa/parser/cxfa_localemgr.h index d77a94a519..b56a4aeead 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.h +++ b/xfa/fxfa/parser/cxfa_localemgr.h @@ -11,11 +11,11 @@ #include <vector> #include "core/fxcrt/cfx_datetime.h" -#include "core/fxcrt/ifx_locale.h" +#include "core/fxcrt/locale_iface.h" #include "xfa/fxfa/parser/cxfa_localemgr.h" class CXFA_Node; -class IFX_Locale; +class LocaleIface; class CXFA_LocaleMgr { public: @@ -23,18 +23,18 @@ class CXFA_LocaleMgr { ~CXFA_LocaleMgr(); uint16_t GetDefLocaleID() const; - IFX_Locale* GetDefLocale(); - IFX_Locale* GetLocaleByName(const WideString& wsLocaleName); + LocaleIface* GetDefLocale(); + LocaleIface* GetLocaleByName(const WideString& wsLocaleName); - void SetDefLocale(IFX_Locale* pLocale); + void SetDefLocale(LocaleIface* pLocale); WideStringView GetConfigLocaleName(CXFA_Node* pConfig); private: - std::unique_ptr<IFX_Locale> GetLocale(uint16_t lcid); + std::unique_ptr<LocaleIface> GetLocale(uint16_t lcid); - std::vector<std::unique_ptr<IFX_Locale>> m_LocaleArray; - std::vector<std::unique_ptr<IFX_Locale>> m_XMLLocaleArray; - IFX_Locale* m_pDefLocale; // owned by m_LocaleArray or m_XMLLocaleArray. + std::vector<std::unique_ptr<LocaleIface>> m_LocaleArray; + std::vector<std::unique_ptr<LocaleIface>> m_XMLLocaleArray; + LocaleIface* m_pDefLocale; // owned by m_LocaleArray or m_XMLLocaleArray. WideString m_wsConfigLocale; uint16_t m_dwDeflcid; uint16_t m_dwLocaleFlags; diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp index 756d4c2307..8ef67e5183 100644 --- a/xfa/fxfa/parser/cxfa_localevalue.cpp +++ b/xfa/fxfa/parser/cxfa_localevalue.cpp @@ -87,7 +87,7 @@ CXFA_LocaleValue::CXFA_LocaleValue(uint32_t dwType, CXFA_LocaleValue::CXFA_LocaleValue(uint32_t dwType, const WideString& wsValue, const WideString& wsFormat, - IFX_Locale* pLocale, + LocaleIface* pLocale, CXFA_LocaleMgr* pLocaleMgr) : m_pLocaleMgr(pLocaleMgr), m_dwType(dwType), @@ -105,10 +105,10 @@ CXFA_LocaleValue::~CXFA_LocaleValue() {} bool CXFA_LocaleValue::ValidateValue(const WideString& wsValue, const WideString& wsPattern, - IFX_Locale* pLocale, + LocaleIface* pLocale, WideString* pMatchFormat) { WideString wsOutput; - IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); + LocaleIface* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) m_pLocaleMgr->SetDefLocale(pLocale); @@ -318,7 +318,7 @@ bool CXFA_LocaleValue::SetDateTime(const CFX_DateTime& dt) { bool CXFA_LocaleValue::FormatPatterns(WideString& wsResult, const WideString& wsFormat, - IFX_Locale* pLocale, + LocaleIface* pLocale, XFA_VALUEPICTURE eValueType) const { auto pFormat = pdfium::MakeUnique<CFGAS_FormatString>(m_pLocaleMgr); std::vector<WideString> wsPatterns; @@ -334,9 +334,9 @@ bool CXFA_LocaleValue::FormatPatterns(WideString& wsResult, bool CXFA_LocaleValue::FormatSinglePattern(WideString& wsResult, const WideString& wsFormat, - IFX_Locale* pLocale, + LocaleIface* pLocale, XFA_VALUEPICTURE eValueType) const { - IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); + LocaleIface* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) m_pLocaleMgr->SetDefLocale(pLocale); @@ -602,8 +602,8 @@ bool CXFA_LocaleValue::ValidateCanonicalTime(const WideString& wsTime) { bool CXFA_LocaleValue::ParsePatternValue(const WideString& wsValue, const WideString& wsPattern, - IFX_Locale* pLocale) { - IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); + LocaleIface* pLocale) { + LocaleIface* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) m_pLocaleMgr->SetDefLocale(pLocale); @@ -715,7 +715,7 @@ void CXFA_LocaleValue::GetNumericFormat(WideString& wsFormat, bool CXFA_LocaleValue::ValidateNumericTemp(const WideString& wsNumeric, const WideString& wsFormat, - IFX_Locale* pLocale) { + LocaleIface* pLocale) { if (wsFormat.IsEmpty() || wsNumeric.IsEmpty()) return true; diff --git a/xfa/fxfa/parser/cxfa_localevalue.h b/xfa/fxfa/parser/cxfa_localevalue.h index 44db7b15d9..cedea10b10 100644 --- a/xfa/fxfa/parser/cxfa_localevalue.h +++ b/xfa/fxfa/parser/cxfa_localevalue.h @@ -11,7 +11,7 @@ #include "core/fxcrt/fx_system.h" #include "xfa/fxfa/parser/cxfa_node.h" -class IFX_Locale; +class LocaleIface; class CFX_DateTime; class CXFA_LocaleMgr; @@ -36,25 +36,25 @@ class CXFA_LocaleValue { CXFA_LocaleValue(uint32_t dwType, const WideString& wsValue, const WideString& wsFormat, - IFX_Locale* pLocale, + LocaleIface* pLocale, CXFA_LocaleMgr* pLocaleMgr); ~CXFA_LocaleValue(); CXFA_LocaleValue& operator=(const CXFA_LocaleValue& value); bool ValidateValue(const WideString& wsValue, const WideString& wsPattern, - IFX_Locale* pLocale, + LocaleIface* pLocale, WideString* pMatchFormat); bool FormatPatterns(WideString& wsResult, const WideString& wsFormat, - IFX_Locale* pLocale, + LocaleIface* pLocale, XFA_VALUEPICTURE eValueType) const; void GetNumericFormat(WideString& wsFormat, int32_t nIntLen, int32_t nDecLen); bool ValidateNumericTemp(const WideString& wsNumeric, const WideString& wsFormat, - IFX_Locale* pLocale); + LocaleIface* pLocale); WideString GetValue() const { return m_wsValue; } uint32_t GetType() const { return m_dwType; } @@ -68,7 +68,7 @@ class CXFA_LocaleValue { private: bool FormatSinglePattern(WideString& wsResult, const WideString& wsFormat, - IFX_Locale* pLocale, + LocaleIface* pLocale, XFA_VALUEPICTURE eValueType) const; bool ValidateCanonicalValue(const WideString& wsValue, uint32_t dwVType); bool ValidateCanonicalDate(const WideString& wsDate, CFX_DateTime* unDate); @@ -79,7 +79,7 @@ class CXFA_LocaleValue { bool ParsePatternValue(const WideString& wsValue, const WideString& wsPattern, - IFX_Locale* pLocale); + LocaleIface* pLocale); CXFA_LocaleMgr* m_pLocaleMgr; WideString m_wsValue; diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 77b6f74fe4..508fb072b0 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -913,7 +913,7 @@ CXFA_Node* CXFA_Node::GetContainerNode() { return pParentOfValueNode ? pParentOfValueNode->GetContainerNode() : nullptr; } -IFX_Locale* CXFA_Node::GetLocale() { +LocaleIface* CXFA_Node::GetLocale() { Optional<WideString> localeName = GetLocaleName(); if (!localeName) return nullptr; @@ -951,7 +951,7 @@ Optional<WideString> CXFA_Node::GetLocaleName() { return localeName; } - IFX_Locale* pLocale = GetDocument()->GetLocalMgr()->GetDefLocale(); + LocaleIface* pLocale = GetDocument()->GetLocalMgr()->GetDefLocale(); if (!pLocale) return {}; @@ -2047,7 +2047,7 @@ int32_t CXFA_Node::ProcessFormatTestValidate(CXFA_FFDocView* docView, if (wsPicture.IsEmpty()) return XFA_EVENTERROR_NotExist; - IFX_Locale* pLocale = GetLocale(); + LocaleIface* pLocale = GetLocale(); if (!pLocale) return XFA_EVENTERROR_NotExist; @@ -4269,7 +4269,7 @@ bool CXFA_Node::SetValue(XFA_VALUEPICTURE eValueType, XFA_Element eType = pNode->GetElementType(); if (!wsPicture.IsEmpty()) { CXFA_LocaleMgr* pLocalMgr = GetDocument()->GetLocalMgr(); - IFX_Locale* pLocale = GetLocale(); + LocaleIface* pLocale = GetLocale(); CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this); bValidate = widgetValue.ValidateValue(wsValue, wsPicture, pLocale, &wsPicture); @@ -4312,7 +4312,7 @@ WideString CXFA_Node::GetPictureContent(XFA_VALUEPICTURE ePicture) { } } - IFX_Locale* pLocale = GetLocale(); + LocaleIface* pLocale = GetLocale(); if (!pLocale) return L""; @@ -4344,7 +4344,7 @@ WideString CXFA_Node::GetPictureContent(XFA_VALUEPICTURE ePicture) { } } - IFX_Locale* pLocale = GetLocale(); + LocaleIface* pLocale = GetLocale(); if (!pLocale) return L""; @@ -4398,7 +4398,7 @@ WideString CXFA_Node::GetValue(XFA_VALUEPICTURE eValueType) { } case XFA_Element::NumericEdit: if (eValueType != XFA_VALUEPICTURE_Raw && wsPicture.IsEmpty()) { - IFX_Locale* pLocale = GetLocale(); + LocaleIface* pLocale = GetLocale(); if (eValueType == XFA_VALUEPICTURE_Display && pLocale) wsValue = FormatNumStr(NormalizeNumStr(wsValue), pLocale); } @@ -4409,7 +4409,7 @@ WideString CXFA_Node::GetValue(XFA_VALUEPICTURE eValueType) { if (wsPicture.IsEmpty()) return wsValue; - if (IFX_Locale* pLocale = GetLocale()) { + if (LocaleIface* pLocale = GetLocale()) { CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this); CXFA_LocaleMgr* pLocalMgr = GetDocument()->GetLocalMgr(); switch (widgetValue.GetType()) { @@ -4448,7 +4448,7 @@ WideString CXFA_Node::GetNormalizeDataValue(const WideString& wsValue) { return wsValue; CXFA_LocaleMgr* pLocalMgr = GetDocument()->GetLocalMgr(); - IFX_Locale* pLocale = GetLocale(); + LocaleIface* pLocale = GetLocale(); CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this); if (widgetValue.ValidateValue(wsValue, wsPicture, pLocale, &wsPicture)) { widgetValue = CXFA_LocaleValue(widgetValue.GetType(), wsValue, wsPicture, @@ -4467,7 +4467,7 @@ WideString CXFA_Node::GetFormatDataValue(const WideString& wsValue) { return wsValue; WideString wsFormattedValue = wsValue; - if (IFX_Locale* pLocale = GetLocale()) { + if (LocaleIface* pLocale = GetLocale()) { CXFA_Value* pNodeValue = GetChild<CXFA_Value>(0, XFA_Element::Value, false); if (!pNodeValue) return wsValue; @@ -4558,7 +4558,7 @@ WideString CXFA_Node::NormalizeNumStr(const WideString& wsValue) { } WideString CXFA_Node::FormatNumStr(const WideString& wsValue, - IFX_Locale* pLocale) { + LocaleIface* pLocale) { if (wsValue.IsEmpty()) return L""; diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index 85aca156d8..697320dcbb 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -42,7 +42,7 @@ class CXFA_Ui; class CXFA_Validate; class CXFA_Value; class CXFA_WidgetLayoutData; -class IFX_Locale; +class LocaleIface; #define XFA_NODEFILTER_Children 0x01 #define XFA_NODEFILTER_Properties 0x02 @@ -212,7 +212,7 @@ class CXFA_Node : public CXFA_Object { int32_t RemoveBindItem(CXFA_Node* pFormNode); bool HasBindItem(); CXFA_Node* GetContainerNode(); - IFX_Locale* GetLocale(); + LocaleIface* GetLocale(); Optional<WideString> GetLocaleName(); XFA_AttributeEnum GetIntact(); @@ -468,7 +468,7 @@ class CXFA_Node : public CXFA_Object { void InsertListTextItem(CXFA_Node* pItems, const WideString& wsText, int32_t nIndex); - WideString FormatNumStr(const WideString& wsValue, IFX_Locale* pLocale); + WideString FormatNumStr(const WideString& wsValue, LocaleIface* pLocale); void GetItemLabel(const WideStringView& wsValue, WideString& wsLabel); std::pair<XFA_FFWidgetType, CXFA_Ui*> CreateChildUIAndValueNodesIfNeeded(); diff --git a/xfa/fxfa/parser/cxfa_nodelocale.h b/xfa/fxfa/parser/cxfa_nodelocale.h index 6f79e4a65a..d1ed800846 100644 --- a/xfa/fxfa/parser/cxfa_nodelocale.h +++ b/xfa/fxfa/parser/cxfa_nodelocale.h @@ -9,19 +9,19 @@ #include <memory> -#include "core/fxcrt/ifx_locale.h" +#include "core/fxcrt/locale_iface.h" #include "xfa/fxfa/fxfa_basic.h" class CXFA_Node; WideString XFA_PatternToString(FX_LOCALENUMSUBCATEGORY category); -class CXFA_NodeLocale : public IFX_Locale { +class CXFA_NodeLocale : public LocaleIface { public: explicit CXFA_NodeLocale(CXFA_Node* pLocale); ~CXFA_NodeLocale() override; - // IFX_Locale + // LocaleIface WideString GetName() const override; WideString GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const override; diff --git a/xfa/fxfa/parser/cxfa_xmllocale.h b/xfa/fxfa/parser/cxfa_xmllocale.h index 5050855ca6..9deaed20d8 100644 --- a/xfa/fxfa/parser/cxfa_xmllocale.h +++ b/xfa/fxfa/parser/cxfa_xmllocale.h @@ -9,16 +9,16 @@ #include <memory> -#include "core/fxcrt/ifx_locale.h" +#include "core/fxcrt/locale_iface.h" class CXML_Element; -class CXFA_XMLLocale : public IFX_Locale { +class CXFA_XMLLocale : public LocaleIface { public: explicit CXFA_XMLLocale(std::unique_ptr<CXML_Element> pLocaleData); ~CXFA_XMLLocale() override; - // IFX_Locale + // LocaleIface WideString GetName() const override; WideString GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const override; |