diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-03-21 15:00:20 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-03-21 15:00:20 -0700 |
commit | 62a70f90c49cf7714c960186eb063ad55333e6f3 (patch) | |
tree | 84b5d0f70b770e6a9ec261342d46638f4d5102bd /xfa | |
parent | 4161c5ca6c5438476bf07b6dacfafb61ea611cc5 (diff) | |
download | pdfium-62a70f90c49cf7714c960186eb063ad55333e6f3.tar.xz |
Remove FX_WORD in favor of uint16_t.
It isn't buying us anthing, and it looks strange in
a struct when other uint types are already present.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1821043003 .
Diffstat (limited to 'xfa')
57 files changed, 1229 insertions, 326 deletions
diff --git a/xfa/fde/css/#fde_cssstyleselector.h# b/xfa/fde/css/#fde_cssstyleselector.h# new file mode 100644 index 0000000000..9078a44dd5 --- /dev/null +++ b/xfa/fde/css/#fde_cssstyleselector.h# @@ -0,0 +1,901 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ +#define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ + +#include <vector> + +#include "core/include/fxcrt/fx_ext.h" +#include "xfa/fde/css/fde_css.h" +#include "xfa/fde/css/fde_csscache.h" +#include "xfa/fde/css/fde_cssdeclaration.h" +#include "xfa/fgas/crt/fgas_memory.h" +#include "xfa/fgas/crt/fgas_system.h" + +#define FDE_CSSUNIVERSALHASH ('*') + +class FDE_CSSRuleData : public CFX_Target { + public: + FDE_CSSRuleData(IFDE_CSSSelector* pSel, + IFDE_CSSDeclaration* pDecl, + FX_DWORD dwPos); + + IFDE_CSSSelector* pSelector; + IFDE_CSSDeclaration* pDeclaration; + FX_DWORD dwPriority; + FDE_CSSRuleData* pNext; +}; + +class CFDE_CSSRuleCollection : public CFX_Target { + public: + CFDE_CSSRuleCollection() + : m_pStaticStore(nullptr), + m_pUniversalRules(nullptr), + m_pPersudoRules(nullptr), + m_iSelectors(0) {} + ~CFDE_CSSRuleCollection() { Clear(); } + void AddRulesFrom(const CFDE_CSSStyleSheetArray& sheets, + FX_DWORD dwMediaList, + IFX_FontMgr* pFontMgr); + void Clear(); + + int32_t CountSelectors() const { return m_iSelectors; } + FDE_CSSRuleData* GetIDRuleData(FX_DWORD dwIDHash) { + void* pData; + return m_IDRules.Lookup((void*)(uintptr_t)dwIDHash, pData) + ? (FDE_CSSRuleData*)pData + : NULL; + } + FDE_CSSRuleData* GetTagRuleData(FX_DWORD dwTagHasn) { + void* pData; + return m_TagRules.Lookup((void*)(uintptr_t)dwTagHasn, pData) + ? (FDE_CSSRuleData*)pData + : NULL; + } + FDE_CSSRuleData* GetClassRuleData(FX_DWORD dwIDHash) { + void* pData; + return m_ClassRules.Lookup((void*)(uintptr_t)dwIDHash, pData) + ? (FDE_CSSRuleData*)pData + : NULL; + } + FDE_CSSRuleData* GetUniversalRuleData() { return m_pUniversalRules; } + FDE_CSSRuleData* GetPersudoRuleData() { return m_pPersudoRules; } + IFX_MEMAllocator* m_pStaticStore; + + protected: + void AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet, + IFDE_CSSRule* pRule, + FX_DWORD dwMediaList, + IFX_FontMgr* pFontMgr); + void AddRuleTo(CFX_MapPtrToPtr& map, + FX_DWORD dwKey, + IFDE_CSSSelector* pSel, + IFDE_CSSDeclaration* pDecl); + FX_BOOL AddRuleTo(FDE_CSSRuleData*& pList, FDE_CSSRuleData* pData); + FDE_CSSRuleData* NewRuleData(IFDE_CSSSelector* pSel, + IFDE_CSSDeclaration* pDecl); + CFX_MapPtrToPtr m_IDRules; + CFX_MapPtrToPtr m_TagRules; + CFX_MapPtrToPtr m_ClassRules; + FDE_CSSRuleData* m_pUniversalRules; + FDE_CSSRuleData* m_pPersudoRules; + int32_t m_iSelectors; +}; +class CFDE_CSSAccelerator; +class CFDE_CSSComputedStyle; +class CFDE_CSSStyleSelector : public IFDE_CSSStyleSelector, public CFX_Target { + public: + CFDE_CSSStyleSelector(); + ~CFDE_CSSStyleSelector(); + virtual void Release() { delete this; } + + virtual void SetFontMgr(IFX_FontMgr* pFontMgr); + virtual void SetDefFontSize(FX_FLOAT fFontSize); + + virtual FX_BOOL SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, + IFDE_CSSStyleSheet* pSheet); + virtual FX_BOOL SetStyleSheets(FDE_CSSSTYLESHEETGROUP eType, + const CFDE_CSSStyleSheetArray* pArray); + virtual void SetStylePriority(FDE_CSSSTYLESHEETGROUP eType, + FDE_CSSSTYLESHEETPRIORITY ePriority); + virtual void UpdateStyleIndex(FX_DWORD dwMediaList); + virtual IFDE_CSSAccelerator* InitAccelerator(); + virtual IFDE_CSSComputedStyle* CreateComputedStyle( + IFDE_CSSComputedStyle* pParentStyle); + virtual int32_t MatchDeclarations( + IFDE_CSSTagProvider* pTag, + CFDE_CSSDeclarationArray& matchedDecls, + FDE_CSSPERSUDO ePersudoType = FDE_CSSPERSUDO_NONE); + virtual void ComputeStyle(IFDE_CSSTagProvider* pTag, + const IFDE_CSSDeclaration** ppDeclArray, + int32_t iDeclCount, + IFDE_CSSComputedStyle* pDestStyle); + + protected: + void Reset(); + void MatchRules(FDE_CSSTagCache* pCache, + FDE_CSSRuleData* pList, + FDE_CSSPERSUDO ePersudoType); + FX_BOOL MatchSelector(FDE_CSSTagCache* pCache, + IFDE_CSSSelector* pSel, + FDE_CSSPERSUDO ePersudoType); + void AppendInlineStyle(CFDE_CSSDeclaration* pDecl, + const FX_WCHAR* psz, + int32_t iLen); + void ApplyDeclarations(FX_BOOL bPriority, + const IFDE_CSSDeclaration** ppDeclArray, + int32_t iDeclCount, + IFDE_CSSComputedStyle* pDestStyle); + void ApplyProperty(FDE_CSSPROPERTY eProperty, + IFDE_CSSValue* pValue, + CFDE_CSSComputedStyle* pComputedStyle); + + FX_FLOAT ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit, + FX_FLOAT fValue, + FX_FLOAT fPercentBase); + FX_BOOL SetLengthWithPercent(FDE_CSSLENGTH& width, + FDE_CSSPRIMITIVETYPE eType, + IFDE_CSSPrimitiveValue* pPrimitive, + FX_FLOAT fFontSize); + FX_FLOAT ToFontSize(FDE_CSSPROPERTYVALUE eValue, FX_FLOAT fCurFontSize); + FDE_CSSDISPLAY ToDisplay(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSTEXTALIGN ToTextAlign(FDE_CSSPROPERTYVALUE eValue); + uint16_t ToFontWeight(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSFONTSTYLE ToFontStyle(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSBORDERSTYLE ToBorderStyle(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSVERTICALALIGN ToVerticalAlign(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSLISTSTYLETYPE ToListStyleType(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSLISTSTYLEPOSITION ToListStylePosition(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSVISIBILITY ToVisibility(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSWHITESPACE ToWhiteSpace(FDE_CSSPROPERTYVALUE eValue); + FX_DWORD ToTextDecoration(IFDE_CSSValueList* pList); + FDE_CSSTEXTTRANSFORM ToTextTransform(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSFONTVARIANT ToFontVariant(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSFLOAT ToFloat(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSCLEAR ToClear(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSWRITINGMODE ToWritingMode(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSWORDBREAK ToWordBreak(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSPAGEBREAK ToPageBreak(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSOVERFLOW ToOverflow(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSLINEBREAK ToLineBreak(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSTEXTCOMBINE ToTextCombine(FDE_CSSPROPERTYVALUE eValue); + FX_BOOL ToTextEmphasisMark(FDE_CSSPROPERTYVALUE eValue, + FDE_CSSTEXTEMPHASISMARK& eMark); + FX_BOOL ToTextEmphasisFill(FDE_CSSPROPERTYVALUE eValue, + FDE_CSSTEXTEMPHASISFILL& eFill); + FDE_CSSCURSOR ToCursor(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSPOSITION ToPosition(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSCAPTIONSIDE ToCaptionSide(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSBKGREPEAT ToBKGRepeat(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSBKGATTACHMENT ToBKGAttachment(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSRUBYALIGN ToRubyAlign(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSRUBYOVERHANG ToRubyOverhang(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSRUBYPOSITION ToRubyPosition(FDE_CSSPROPERTYVALUE eValue); + FDE_CSSRUBYSPAN ToRubySpan(FDE_CSSPROPERTYVALUE eValue); + IFX_FontMgr* m_pFontMgr; + FX_FLOAT m_fDefFontSize; + IFX_MEMAllocator* m_pRuleDataStore; + CFDE_CSSStyleSheetArray m_SheetGroups[FDE_CSSSTYLESHEETGROUP_MAX]; + CFDE_CSSRuleCollection m_RuleCollection[FDE_CSSSTYLESHEETGROUP_MAX]; + FDE_CSSSTYLESHEETGROUP m_ePriorities[FDE_CSSSTYLESHEETPRIORITY_MAX]; + IFX_MEMAllocator* m_pInlineStyleStore; + IFX_MEMAllocator* m_pFixedStyleStore; + CFDE_CSSAccelerator* m_pAccelerator; + std::vector<FDE_CSSRuleData*> m_MatchedRules; +}; + +struct FDE_CSSCOUNTERDATA { + public: + FDE_CSSCOUNTERDATA() { FXSYS_memset(this, 0, sizeof(FDE_CSSCOUNTERDATA)); } + FX_BOOL GetCounterIncrement(int32_t& iValue) { + iValue = m_iIncVal; + return m_bIncrement; + } + FX_BOOL GetCounterReset(int32_t& iValue) { + iValue = m_iResetVal; + return m_bReset; + } + + const FX_WCHAR* m_pszIdent; + FX_BOOL m_bIncrement; + FX_BOOL m_bReset; + int32_t m_iIncVal; + int32_t m_iResetVal; +}; + +class CFDE_CSSCounterStyle { + public: + CFDE_CSSCounterStyle() : m_pCounterInc(NULL), m_pCounterReset(NULL) {} + void SetCounterIncrementList(IFDE_CSSValueList* pList) { + m_pCounterInc = pList; + m_bIndexDirty = TRUE; + } + void SetCounterResetList(IFDE_CSSValueList* pList) { + m_pCounterReset = pList; + m_bIndexDirty = TRUE; + } + int32_t CountCounters() { + UpdateIndex(); + return m_arrCounterData.GetSize(); + } + FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) { + UpdateIndex(); + return m_arrCounterData.ElementAt(index).GetCounterIncrement(iValue); + } + FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) { + UpdateIndex(); + return m_arrCounterData.ElementAt(index).GetCounterReset(iValue); + } + const FX_WCHAR* GetCounterIdentifier(int32_t index) { + UpdateIndex(); + return m_arrCounterData.ElementAt(index).m_pszIdent; + } + + protected: + void UpdateIndex(); + void DoUpdateIndex(IFDE_CSSValueList* pList); + int32_t FindIndex(const FX_WCHAR* pszIdentifier); + IFDE_CSSValueList* m_pCounterInc; + IFDE_CSSValueList* m_pCounterReset; + CFX_ArrayTemplate<FDE_CSSCOUNTERDATA> m_arrCounterData; + FX_BOOL m_bIndexDirty; +}; +class CFDE_CSSInheritedData { + public: + void Reset() { + FXSYS_memset(this, 0, sizeof(CFDE_CSSInheritedData)); + m_LetterSpacing.Set(FDE_CSSLENGTHUNIT_Normal); + m_WordSpacing.Set(FDE_CSSLENGTHUNIT_Normal); + m_TextIndent.Set(FDE_CSSLENGTHUNIT_Point, 0); + m_fFontSize = 12.0f; + m_fLineHeight = 14.0f; + m_wFontWeight = 400; + m_dwFontColor = 0xFF000000; + m_iWidows = 2; + m_bTextEmphasisColorCurrent = TRUE; + m_iOrphans = 2; + } + const FX_WCHAR* m_pszListStyleImage; + FDE_CSSLENGTH m_LetterSpacing; + FDE_CSSLENGTH m_WordSpacing; + FDE_CSSLENGTH m_TextIndent; + IFDE_CSSValueList* m_pFontFamily; + IFDE_CSSValueList* m_pQuotes; + IFDE_CSSValueList* m_pCursorUris; + FDE_CSSCURSOR m_eCursor; + FX_FLOAT m_fFontSize; + FX_FLOAT m_fLineHeight; + FX_ARGB m_dwFontColor; + FX_ARGB m_dwTextEmphasisColor; + uint16_t m_wFontWeight; + int32_t m_iWidows; + int32_t m_iOrphans; + const FX_WCHAR* m_pszTextEmphasisCustomMark; + FX_DWORD m_eFontVariant : 1; + FX_DWORD m_eFontStyle : 1; + FX_DWORD m_bTextEmphasisColorCurrent : 1; + FX_DWORD m_eTextAligh : 2; + FX_DWORD m_eVisibility : 2; + FX_DWORD m_eWhiteSpace : 3; + FX_DWORD m_eTextTransform : 2; + FX_DWORD m_eWritingMode : 2; + FX_DWORD m_eWordBreak : 2; + FX_DWORD m_eLineBreak : 2; + FX_DWORD m_eTextEmphasisFill : 1; + FX_DWORD m_eTextEmphasisMark : 3; + FX_DWORD m_eCaptionSide : 3; + + uint16_t m_eRubyAlign : 4; + uint16_t m_eRubyOverhang : 2; + uint16_t m_eRubyPosition : 2; +}; +class CFDE_CSSNonInheritedData { + public: + void Reset() { + FXSYS_memset(this, 0, sizeof(CFDE_CSSNonInheritedData)); + m_MarginWidth = m_BorderWidth = + m_PaddingWidth.Set(FDE_CSSLENGTHUNIT_Point, 0); + m_MinBoxSize.Set(FDE_CSSLENGTHUNIT_Point, 0); + m_MaxBoxSize.Set(FDE_CSSLENGTHUNIT_None); + m_eDisplay = FDE_CSSDISPLAY_Inline; + m_fVerticalAlign = 0.0f; + m_ColumnCount.Set(FDE_CSSLENGTHUNIT_Auto); + m_ColumnGap.Set(FDE_CSSLENGTHUNIT_Normal); + m_bColumnRuleColorSame = TRUE; + m_ColumnWidth.Set(FDE_CSSLENGTHUNIT_Auto); + m_ColumnRuleWidth.Set(FDE_CSSLENGTHUNIT_Auto); + m_eTextCombine = FDE_CSSTEXTCOMBINE_None; + } + + IFDE_CSSValueList* m_pContentList; + CFDE_CSSCounterStyle* m_pCounterStyle; + FDE_CSSRECT m_MarginWidth; + FDE_CSSRECT m_BorderWidth; + FDE_CSSRECT m_PaddingWidth; + FDE_CSSSIZE m_BoxSize; + FDE_CSSSIZE m_MinBoxSize; + FDE_CSSSIZE m_MaxBoxSize; + FDE_CSSPOINT m_BKGPosition; + const FX_WCHAR* m_pszBKGImage; + FX_ARGB m_dwBKGColor; + FX_ARGB m_dwBDRLeftColor; + FX_ARGB m_dwBDRTopColor; + FX_ARGB m_dwBDRRightColor; + FX_ARGB m_dwBDRBottomColor; + IFDE_CSSValue* m_pRubySpan; + FDE_CSSLENGTH m_ColumnCount; + FDE_CSSLENGTH m_ColumnGap; + FDE_CSSLENGTH m_ColumnRuleWidth; + FDE_CSSLENGTH m_ColumnWidth; + FX_ARGB m_dwColumnRuleColor; + FDE_CSSLENGTH m_Top; + FDE_CSSLENGTH m_Bottom; + FDE_CSSLENGTH m_Left; + FDE_CSSLENGTH m_Right; + + FX_FLOAT m_fVerticalAlign; + FX_FLOAT m_fTextCombineNumber; + FX_DWORD m_eBDRLeftStyle : 4; + FX_DWORD m_eBDRTopStyle : 4; + FX_DWORD m_eBDRRightStyle : 4; + FX_DWORD m_eBDRBottomStyle : 4; + FX_DWORD m_eDisplay : 5; + FX_DWORD m_eVerticalAlign : 4; + FX_DWORD m_eListStyleType : 5; + FX_DWORD m_eColumnRuleStyle : 4; + FX_DWORD m_ePageBreakInside : 3; + FX_DWORD m_ePageBreakAfter : 3; + FX_DWORD m_ePageBreakBefore : 3; + FX_DWORD m_ePosition : 2; + FX_DWORD m_eBKGRepeat : 2; + FX_DWORD m_eFloat : 2; + FX_DWORD m_eClear : 2; + FX_DWORD m_eOverflowX : 3; + FX_DWORD m_eOverflowY : 3; + FX_DWORD m_eListStylePosition : 1; + FX_DWORD m_eBKGAttachment : 1; + FX_DWORD m_bHasMargin : 1; + FX_DWORD m_bHasBorder : 1; + FX_DWORD m_bHasPadding : 1; + FX_DWORD m_dwTextDecoration : 5; + FX_DWORD m_eTextCombine : 1; + FX_DWORD m_bColumnRuleColorSame : 1; + FX_DWORD m_bHasTextCombineNumber : 1; +}; +class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, + public IFDE_CSSFontStyle, + public IFDE_CSSBoundaryStyle, + public IFDE_CSSPositionStyle, + public IFDE_CSSParagraphStyle, + public IFDE_CSSBackgroundStyle, + public IFDE_CSSVisualStyle, + public IFDE_CSSListStyle, + public IFDE_CSSMultiColumnStyle, + public IFDE_CSSGeneratedContentStyle, + public IFDE_CSSTableStyle, + public IFDE_CSSRubyStyle, + public CFX_Target { + public: + CFDE_CSSComputedStyle(IFX_MEMAllocator* pAlloc) + : m_dwRefCount(1), m_pAllocator(pAlloc) {} + ~CFDE_CSSComputedStyle() {} + virtual FX_DWORD AddRef() { return ++m_dwRefCount; } + virtual FX_DWORD Release() { + FX_DWORD dwRefCount = --m_dwRefCount; + if (dwRefCount == 0) { + if (m_NonInheritedData.m_pCounterStyle != NULL) { + delete m_NonInheritedData.m_pCounterStyle; + } + FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this); + } + return dwRefCount; + } + + virtual void Reset() { + m_InheritedData.Reset(); + m_NonInheritedData.Reset(); + } + virtual IFDE_CSSFontStyle* GetFontStyles() const { + return (IFDE_CSSFontStyle * const) this; + } + virtual IFDE_CSSBoundaryStyle* GetBoundaryStyles() const { + return (IFDE_CSSBoundaryStyle * const) this; + } + virtual IFDE_CSSPositionStyle* GetPositionStyles() const { + return (IFDE_CSSPositionStyle * const) this; + } + virtual IFDE_CSSParagraphStyle* GetParagraphStyles() const { + return (IFDE_CSSParagraphStyle * const) this; + } + virtual IFDE_CSSBackgroundStyle* GetBackgroundStyles() const { + return (IFDE_CSSBackgroundStyle * const) this; + } + virtual IFDE_CSSVisualStyle* GetVisualStyles() const { + return (IFDE_CSSVisualStyle * const) this; + } + virtual IFDE_CSSListStyle* GetListStyles() const { + return (IFDE_CSSListStyle * const) this; + } + virtual IFDE_CSSTableStyle* GetTableStyle() const { + return (IFDE_CSSTableStyle * const) this; + } + virtual IFDE_CSSMultiColumnStyle* GetMultiColumnStyle() const { + return (IFDE_CSSMultiColumnStyle * const) this; + } + virtual IFDE_CSSGeneratedContentStyle* GetGeneratedContentStyle() const { + return (IFDE_CSSGeneratedContentStyle * const) this; + } + virtual IFDE_CSSRubyStyle* GetRubyStyle() const { + return (IFDE_CSSRubyStyle * const) this; + } + virtual FX_BOOL GetCustomStyle(const CFX_WideStringC& wsName, + CFX_WideString& wsValue) const { + for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) { + if (wsName == m_CustomProperties[i]) { + wsValue = m_CustomProperties[i + 1]; + return TRUE; + } + } + return FALSE; + } + virtual FDE_CSSRUBYALIGN GetRubyAlign() const { + return (FDE_CSSRUBYALIGN)m_InheritedData.m_eRubyAlign; + } + virtual FDE_CSSRUBYPOSITION GetRubyPosition() const { + return (FDE_CSSRUBYPOSITION)m_InheritedData.m_eRubyPosition; + } + virtual FDE_CSSRUBYOVERHANG GetRubyOverhang() const { + return (FDE_CSSRUBYOVERHANG)m_InheritedData.m_eRubyOverhang; + } + virtual FDE_CSSRUBYSPAN GetRubySpanType() const { + return m_NonInheritedData.m_pRubySpan == NULL ? FDE_CSSRUBYSPAN_None + : FDE_CSSRUBYSPAN_Attr; + } + virtual IFDE_CSSValue* GetRubySpanAttr() const { + return m_NonInheritedData.m_pRubySpan; + } + virtual FDE_CSSCAPTIONSIDE GetCaptionSide() const { + return (FDE_CSSCAPTIONSIDE)m_InheritedData.m_eCaptionSide; + } + virtual int32_t CountCounters() { + return (m_NonInheritedData.m_pCounterStyle == NULL) + ? 0 + : m_NonInheritedData.m_pCounterStyle->CountCounters(); + } + virtual const FX_WCHAR* GetCounterIdentifier(int32_t index) { + return m_NonInheritedData.m_pCounterStyle->GetCounterIdentifier(index); + } + virtual FX_BOOL GetCounterReset(int32_t index, int32_t& iValue) { + return m_NonInheritedData.m_pCounterStyle->GetCounterReset(index, iValue); + } + virtual FX_BOOL GetCounterIncrement(int32_t index, int32_t& iValue) { + return m_NonInheritedData.m_pCounterStyle->GetCounterIncrement(index, + iValue); + } + virtual IFDE_CSSValueList* GetContent() const { + return m_NonInheritedData.m_pContentList; + } + virtual int32_t CountQuotes() const { + return m_InheritedData.m_pQuotes == NULL + ? 0 + : m_InheritedData.m_pQuotes->CountValues(); + } + virtual const FX_WCHAR* GetQuotes(int32_t index) const { + FXSYS_assert(m_InheritedData.m_pQuotes != NULL && + m_InheritedData.m_pQuotes->CountValues() > index); + return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pQuotes->GetValue( + index))) + ->GetString(index); + } + virtual const FDE_CSSLENGTH& GetColumnCount() const { + return m_NonInheritedData.m_ColumnCount; + } + virtual const FDE_CSSLENGTH& GetColumnGap() const { + return m_NonInheritedData.m_ColumnGap; + } + virtual FX_ARGB GetColumnRuleColor() const { + return m_NonInheritedData.m_bColumnRuleColorSame + ? m_InheritedData.m_dwFontColor + : m_NonInheritedData.m_dwColumnRuleColor; + } + virtual FDE_CSSBORDERSTYLE GetColumnRuleStyle() const { + return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eColumnRuleStyle; + } + virtual const FDE_CSSLENGTH& GetColumnRuleWidth() const { + return m_NonInheritedData.m_ColumnRuleWidth; + } + virtual const FDE_CSSLENGTH& GetColumnWidth() const { + return m_NonInheritedData.m_ColumnWidth; + } + virtual void SetColumnCount(const FDE_CSSLENGTH& columnCount) { + m_NonInheritedData.m_ColumnCount = columnCount; + } + virtual void SetColumnGap(const FDE_CSSLENGTH& columnGap) { + m_NonInheritedData.m_ColumnGap = columnGap; + } + virtual void SetColumnRuleColor(FX_ARGB dwColumnRuleColor) { + m_NonInheritedData.m_dwColumnRuleColor = dwColumnRuleColor, + m_NonInheritedData.m_bColumnRuleColorSame = FALSE; + } + virtual void SetColumnRuleStyle(FDE_CSSBORDERSTYLE eColumnRuleStyle) { + m_NonInheritedData.m_eColumnRuleStyle = eColumnRuleStyle; + } + virtual void SetColumnRuleWidth(const FDE_CSSLENGTH& columnRuleWidth) { + m_NonInheritedData.m_ColumnRuleWidth = columnRuleWidth; + } + virtual void SetColumnWidth(const FDE_CSSLENGTH& columnWidth) { + m_NonInheritedData.m_ColumnWidth = columnWidth; + } + virtual int32_t CountFontFamilies() const { + return m_InheritedData.m_pFontFamily + ? m_InheritedData.m_pFontFamily->CountValues() + : 0; + } + virtual const FX_WCHAR* GetFontFamily(int32_t index) const { + return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pFontFamily->GetValue( + index))) + ->GetString(index); + } + virtual uint16_t GetFontWeight() const { + return m_InheritedData.m_wFontWeight; + } + virtual FDE_CSSFONTVARIANT GetFontVariant() const { + return (FDE_CSSFONTVARIANT)m_InheritedData.m_eFontVariant; + } + virtual FDE_CSSFONTSTYLE GetFontStyle() const { + return (FDE_CSSFONTSTYLE)m_InheritedData.m_eFontStyle; + } + virtual FX_FLOAT GetFontSize() const { return m_InheritedData.m_fFontSize; } + virtual FX_ARGB GetColor() const { return m_InheritedData.m_dwFontColor; } + virtual void SetFontWeight(uint16_t wFontWeight) { + m_InheritedData.m_wFontWeight = wFontWeight; + } + virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) { + m_InheritedData.m_eFontVariant = eFontVariant; + } + virtual void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) { + m_InheritedData.m_eFontStyle = eFontStyle; + } + virtual void SetFontSize(FX_FLOAT fFontSize) { + m_InheritedData.m_fFontSize = fFontSize; + } + virtual void SetColor(FX_ARGB dwFontColor) { + m_InheritedData.m_dwFontColor = dwFontColor; + } + virtual FX_ARGB GetBorderLeftColor() const { + return m_NonInheritedData.m_dwBDRLeftColor; + } + virtual FX_ARGB GetBorderTopColor() const { + return m_NonInheritedData.m_dwBDRTopColor; + } + virtual FX_ARGB GetBorderRightColor() const { + return m_NonInheritedData.m_dwBDRRightColor; + } + virtual FX_ARGB GetBorderBottomColor() const { + return m_NonInheritedData.m_dwBDRBottomColor; + } + + virtual FDE_CSSBORDERSTYLE GetBorderLeftStyle() const { + return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRLeftStyle; + } + virtual FDE_CSSBORDERSTYLE GetBorderTopStyle() const { + return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRTopStyle; + } + virtual FDE_CSSBORDERSTYLE GetBorderRightStyle() const { + return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRRightStyle; + } + virtual FDE_CSSBORDERSTYLE GetBorderBottomStyle() const { + return (FDE_CSSBORDERSTYLE)m_NonInheritedData.m_eBDRBottomStyle; + } + + virtual const FDE_CSSRECT* GetBorderWidth() const { + return m_NonInheritedData.m_bHasBorder ? &(m_NonInheritedData.m_BorderWidth) + : NULL; + } + virtual const FDE_CSSRECT* GetMarginWidth() const { + return m_NonInheritedData.m_bHasMargin ? &(m_NonInheritedData.m_MarginWidth) + : NULL; + } + virtual const FDE_CSSRECT* GetPaddingWidth() const { + return m_NonInheritedData.m_bHasPadding + ? &(m_NonInheritedData.m_PaddingWidth) + : NULL; + } + virtual void SetBorderLeftColor(FX_ARGB dwBorderColor) { + m_NonInheritedData.m_dwBDRLeftColor = dwBorderColor; + } + virtual void SetBorderTopColor(FX_ARGB dwBorderColor) { + m_NonInheritedData.m_dwBDRTopColor = dwBorderColor; + } + virtual void SetBorderRightColor(FX_ARGB dwBorderColor) { + m_NonInheritedData.m_dwBDRRightColor = dwBorderColor; + } + virtual void SetBorderBottomColor(FX_ARGB dwBorderColor) { + m_NonInheritedData.m_dwBDRBottomColor = dwBorderColor; + } + + virtual void SetBorderLeftStyle(FDE_CSSBORDERSTYLE eBorderStyle) { + m_NonInheritedData.m_eBDRLeftStyle = eBorderStyle; + } + virtual void SetBorderTopStyle(FDE_CSSBORDERSTYLE eBorderStyle) { + m_NonInheritedData.m_eBDRTopStyle = eBorderStyle; + } + virtual void SetBorderRightStyle(FDE_CSSBORDERSTYLE eBorderStyle) { + m_NonInheritedData.m_eBDRRightStyle = eBorderStyle; + } + virtual void SetBorderBottomStyle(FDE_CSSBORDERSTYLE eBorderStyle) { + m_NonInheritedData.m_eBDRBottomStyle = eBorderStyle; + } + + virtual void SetBorderWidth(const FDE_CSSRECT& rect) { + m_NonInheritedData.m_BorderWidth = rect; + m_NonInheritedData.m_bHasBorder = TRUE; + } + virtual void SetMarginWidth(const FDE_CSSRECT& rect) { + m_NonInheritedData.m_MarginWidth = rect; + m_NonInheritedData.m_bHasMargin = TRUE; + } + virtual void SetPaddingWidth(const FDE_CSSRECT& rect) { + m_NonInheritedData.m_PaddingWidth = rect; + m_NonInheritedData.m_bHasPadding = TRUE; + } + virtual FDE_CSSDISPLAY GetDisplay() const { + return (FDE_CSSDISPLAY)m_NonInheritedData.m_eDisplay; + } + virtual const FDE_CSSSIZE& GetBoxSize() const { + return m_NonInheritedData.m_BoxSize; + } + virtual const FDE_CSSSIZE& GetMinBoxSize() const { + return m_NonInheritedData.m_MinBoxSize; + } + virtual const FDE_CSSSIZE& GetMaxBoxSize() const { + return m_NonInheritedData.m_MaxBoxSize; + } + virtual FDE_CSSFLOAT GetFloat() const { + return (FDE_CSSFLOAT)m_NonInheritedData.m_eFloat; + } + virtual FDE_CSSCLEAR GetClear() const { + return (FDE_CSSCLEAR)m_NonInheritedData.m_eClear; + } + virtual FDE_CSSPOSITION GetPosition() const { + return (FDE_CSSPOSITION)m_NonInheritedData.m_ePosition; + } + virtual FDE_CSSLENGTH GetTop() const { return m_NonInheritedData.m_Top; } + virtual FDE_CSSLENGTH GetBottom() const { + return m_NonInheritedData.m_Bottom; + } + virtual FDE_CSSLENGTH GetLeft() const { return m_NonInheritedData.m_Left; } + virtual FDE_CSSLENGTH GetRight() const { return m_NonInheritedData.m_Right; } + + virtual void SetDisplay(FDE_CSSDISPLAY eDisplay) { + m_NonInheritedData.m_eDisplay = eDisplay; + } + virtual void SetBoxSize(const FDE_CSSSIZE& size) { + m_NonInheritedData.m_BoxSize = size; + } + virtual void SetMinBoxSize(const FDE_CSSSIZE& size) { + m_NonInheritedData.m_MinBoxSize = size; + } + virtual void SetMaxBoxSize(const FDE_CSSSIZE& size) { + m_NonInheritedData.m_MaxBoxSize = size; + } + virtual void SetFloat(FDE_CSSFLOAT eFloat) { + m_NonInheritedData.m_eFloat = eFloat; + } + virtual void SetClear(FDE_CSSCLEAR eClear) { + m_NonInheritedData.m_eClear = eClear; + } + virtual FX_FLOAT GetLineHeight() const { + return m_InheritedData.m_fLineHeight; + } + virtual FDE_CSSWHITESPACE GetWhiteSpace() const { + return (FDE_CSSWHITESPACE)m_InheritedData.m_eWhiteSpace; + } + virtual const FDE_CSSLENGTH& GetTextIndent() const { + return m_InheritedData.m_TextIndent; + } + virtual FDE_CSSTEXTALIGN GetTextAlign() const { + return (FDE_CSSTEXTALIGN)m_InheritedData.m_eTextAligh; + } + virtual FDE_CSSVERTICALALIGN GetVerticalAlign() const { + return (FDE_CSSVERTICALALIGN)m_NonInheritedData.m_eVerticalAlign; + } + virtual FX_FLOAT GetNumberVerticalAlign() const { + return m_NonInheritedData.m_fVerticalAlign; + } + virtual FDE_CSSTEXTTRANSFORM GetTextTransform() const { + return (FDE_CSSTEXTTRANSFORM)m_InheritedData.m_eTextTransform; + } + virtual FX_DWORD GetTextDecoration() const { + return m_NonInheritedData.m_dwTextDecoration; + } + virtual const FDE_CSSLENGTH& GetLetterSpacing() const { + return m_InheritedData.m_LetterSpacing; + } + virtual const FDE_CSSLENGTH& GetWordSpacing() const { + return m_InheritedData.m_WordSpacing; + } + virtual FDE_CSSWRITINGMODE GetWritingMode() const { + return (FDE_CSSWRITINGMODE)m_InheritedData.m_eWritingMode; + } + virtual FDE_CSSWORDBREAK GetWordBreak() const { + return (FDE_CSSWORDBREAK)m_InheritedData.m_eWordBreak; + } + virtual int32_t GetWidows() const { return m_InheritedData.m_iWidows; } + virtual FX_ARGB GetTextEmphasisColor() const { + return m_InheritedData.m_bTextEmphasisColorCurrent + ? m_InheritedData.m_dwFontColor + : m_InheritedData.m_dwTextEmphasisColor; + } + virtual FDE_CSSPAGEBREAK GetPageBreakBefore() const { + return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakBefore; + } + virtual FDE_CSSPAGEBREAK GetPageBreakAfter() const { + return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakAfter; + } + virtual FDE_CSSPAGEBREAK GetPageBreakInside() const { + return (FDE_CSSPAGEBREAK)m_NonInheritedData.m_ePageBreakInside; + } + virtual int32_t GetOrphans() const { return m_InheritedData.m_iOrphans; } + virtual FDE_CSSLINEBREAK GetLineBreak() const { + return (FDE_CSSLINEBREAK)m_InheritedData.m_eLineBreak; + } + virtual FDE_CSSTEXTEMPHASISMARK GetTextEmphasisMark() const; + virtual FDE_CSSTEXTEMPHASISFILL GetTextEmphasisFill() const { + return (FDE_CSSTEXTEMPHASISFILL)m_InheritedData.m_eTextEmphasisFill; + } + virtual const FX_WCHAR* GetTextEmphasisCustom() const { + FXSYS_assert(m_InheritedData.m_eTextEmphasisMark == + FDE_CSSTEXTEMPHASISMARK_Custom); + return m_InheritedData.m_pszTextEmphasisCustomMark; + } + virtual FDE_CSSTEXTCOMBINE GetTextCombineType() const { + return (FDE_CSSTEXTCOMBINE)m_NonInheritedData.m_eTextCombine; + } + virtual FX_BOOL HasTextCombineNumber() const { + return m_NonInheritedData.m_bHasTextCombineNumber; + } + virtual FX_FLOAT GetTextCombineNumber() const { + FXSYS_assert(m_NonInheritedData.m_eTextCombine == + FDE_CSSTEXTCOMBINE_Horizontal); + return m_NonInheritedData.m_fTextCombineNumber; + } + virtual void SetLineHeight(FX_FLOAT fLineHeight) { + m_InheritedData.m_fLineHeight = fLineHeight; + } + virtual void SetWhiteSpace(FDE_CSSWHITESPACE eWhiteSpace) { + m_InheritedData.m_eWhiteSpace = eWhiteSpace; + } + virtual void SetTextIndent(const FDE_CSSLENGTH& textIndent) { + m_InheritedData.m_TextIndent = textIndent; + } + virtual void SetTextAlign(FDE_CSSTEXTALIGN eTextAlign) { + m_InheritedData.m_eTextAligh = eTextAlign; + } + virtual void SetVerticalAlign(FDE_CSSVERTICALALIGN eVerticalAlign) { + m_NonInheritedData.m_eVerticalAlign = eVerticalAlign; + } + virtual void SetNumberVerticalAlign(FX_FLOAT fAlign) { + m_NonInheritedData.m_eVerticalAlign = FDE_CSSVERTICALALIGN_Number, + m_NonInheritedData.m_fVerticalAlign = fAlign; + } + virtual void SetTextTransform(FDE_CSSTEXTTRANSFORM eTextTransform) { + m_InheritedData.m_eTextTransform = eTextTransform; + } + virtual void SetTextDecoration(FX_DWORD dwTextDecoration) { + m_NonInheritedData.m_dwTextDecoration = dwTextDecoration; + } + virtual void SetLetterSpacing(const FDE_CSSLENGTH& letterSpacing) { + m_InheritedData.m_LetterSpacing = letterSpacing; + } + virtual void SetWordSpacing(const FDE_CSSLENGTH& wordSpacing) { + m_InheritedData.m_WordSpacing = wordSpacing; + } + virtual void SetWritingMode(FDE_CSSWRITINGMODE eWritingMode) { + m_InheritedData.m_eWritingMode = eWritingMode; + } + virtual void SetWordBreak(FDE_CSSWORDBREAK eWordBreak) { + m_InheritedData.m_eWordBreak = eWordBreak; + } + virtual void SetWidows(int32_t iWidows) { + m_InheritedData.m_iWidows = iWidows; + } + virtual void SetTextEmphasisColor(FX_ARGB dwTextEmphasisColor) { + m_InheritedData.m_dwTextEmphasisColor = dwTextEmphasisColor, + m_InheritedData.m_bTextEmphasisColorCurrent = FALSE; + } + virtual void SetPageBreakBefore(FDE_CSSPAGEBREAK ePageBreakBefore) { + m_NonInheritedData.m_ePageBreakBefore = ePageBreakBefore; + } + virtual void SetPageBreakAfter(FDE_CSSPAGEBREAK ePageBreakAfter) { + m_NonInheritedData.m_ePageBreakAfter = ePageBreakAfter; + } + virtual void SetPageBreakInside(FDE_CSSPAGEBREAK ePageBreakInside) { + m_NonInheritedData.m_ePageBreakInside = ePageBreakInside; + } + virtual void SetOrphans(int32_t iOrphans) { + m_InheritedData.m_iOrphans = iOrphans; + } + virtual void SetLineBreak(FDE_CSSLINEBREAK eLineBreak) { + m_InheritedData.m_eLineBreak = eLineBreak; + } + virtual FX_ARGB GetBKGColor() const { + return m_NonInheritedData.m_dwBKGColor; + } + virtual const FX_WCHAR* GetBKGImage() const { + return m_NonInheritedData.m_pszBKGImage; + } + virtual const FDE_CSSPOINT& GetBKGPosition() const { + return m_NonInheritedData.m_BKGPosition; + } + virtual FDE_CSSBKGREPEAT GetBKGRepeat() const { + return (FDE_CSSBKGREPEAT)m_NonInheritedData.m_eBKGRepeat; + } + virtual FDE_CSSBKGATTACHMENT GetBKGAttachment() const { + return (FDE_CSSBKGATTACHMENT)m_NonInheritedData.m_eBKGAttachment; + } + virtual void SetBKGColor(FX_ARGB dwBKGColor) { + m_NonInheritedData.m_dwBKGColor = dwBKGColor; + } + virtual void SetBKGPosition(const FDE_CSSPOINT& bkgPosition) { + m_NonInheritedData.m_BKGPosition = bkgPosition; + } + virtual FDE_CSSVISIBILITY GetVisibility() const { + return (FDE_CSSVISIBILITY)m_InheritedData.m_eVisibility; + } + virtual FDE_CSSOVERFLOW GetOverflowX() const { + return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowX; + } + virtual FDE_CSSOVERFLOW GetOverflowY() const { + return (FDE_CSSOVERFLOW)m_NonInheritedData.m_eOverflowY; + } + virtual int32_t CountCursorUrls() const { + return m_InheritedData.m_pCursorUris == NULL + ? 0 + : m_InheritedData.m_pCursorUris->CountValues(); + } + virtual const FX_WCHAR* GetCursorUrl(int32_t index) const { + FXSYS_assert(m_InheritedData.m_pCursorUris != NULL); + return ((IFDE_CSSPrimitiveValue*)(m_InheritedData.m_pCursorUris->GetValue( + index))) + ->GetString(index); + } + virtual FDE_CSSCURSOR GetCursorType() const { + return m_InheritedData.m_eCursor; + } + virtual void SetVisibility(FDE_CSSVISIBILITY eVisibility) { + m_InheritedData.m_eVisibility = eVisibility; + } + virtual FDE_CSSLISTSTYLETYPE GetListStyleType() const { + return (FDE_CSSLISTSTYLETYPE)m_NonInheritedData.m_eListStyleType; + } + virtual FDE_CSSLISTSTYLEPOSITION GetListStylePosition() const { + return (FDE_CSSLISTSTYLEPOSITION)m_NonInheritedData.m_eListStylePosition; + } + virtual const FX_WCHAR* GetListStyleImage() const { + return m_InheritedData.m_pszListStyleImage; + } + virtual void SetListStyleType(FDE_CSSLISTSTYLETYPE eListStyleType) { + m_NonInheritedData.m_eListStyleType = eListStyleType; + } + virtual void SetListStylePosition( + FDE_CSSLISTSTYLEPOSITION eListStylePosition) { + m_NonInheritedData.m_eListStylePosition = eListStylePosition; + } + void AddCustomStyle(const CFX_WideString& wsName, + const CFX_WideString& wsValue) { + m_CustomProperties.Add(wsName); + m_CustomProperties.Add(wsValue); + } + FX_DWORD m_dwRefCount; + IFX_MEMAllocator* m_pAllocator; + CFDE_CSSInheritedData m_InheritedData; + CFDE_CSSNonInheritedData m_NonInheritedData; + CFX_WideStringArray m_CustomProperties; +}; + +#endif // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ diff --git a/xfa/fde/css/fde_css.h b/xfa/fde/css/fde_css.h index 4c3e253167..791620071d 100644 --- a/xfa/fde/css/fde_css.h +++ b/xfa/fde/css/fde_css.h @@ -443,17 +443,17 @@ class IFDE_CSSStyleSheet : public IFX_Unknown { static IFDE_CSSStyleSheet* LoadFromStream( const CFX_WideString& szUrl, IFX_Stream* pStream, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); static IFDE_CSSStyleSheet* LoadFromBuffer( const CFX_WideString& szUrl, const FX_WCHAR* pBuffer, int32_t iBufSize, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwMediaList = FDE_CSSMEDIATYPE_ALL); virtual FX_BOOL GetUrl(CFX_WideString& szUrl) = 0; virtual FX_DWORD GetMediaList() const = 0; - virtual FX_WORD GetCodePage() const = 0; + virtual uint16_t GetCodePage() const = 0; virtual int32_t CountRules() const = 0; virtual IFDE_CSSRule* GetRule(int32_t index) = 0; @@ -866,12 +866,12 @@ class IFDE_CSSFontStyle { virtual ~IFDE_CSSFontStyle() {} virtual int32_t CountFontFamilies() const = 0; virtual const FX_WCHAR* GetFontFamily(int32_t index) const = 0; - virtual FX_WORD GetFontWeight() const = 0; + virtual uint16_t GetFontWeight() const = 0; virtual FDE_CSSFONTVARIANT GetFontVariant() const = 0; virtual FDE_CSSFONTSTYLE GetFontStyle() const = 0; virtual FX_FLOAT GetFontSize() const = 0; virtual FX_ARGB GetColor() const = 0; - virtual void SetFontWeight(FX_WORD wFontWeight) = 0; + virtual void SetFontWeight(uint16_t wFontWeight) = 0; virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) = 0; virtual void SetFontStyle(FDE_CSSFONTSTYLE eFontStyle) = 0; virtual void SetFontSize(FX_FLOAT fFontSize) = 0; diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp index ef09e99baf..8f448d8536 100644 --- a/xfa/fde/css/fde_cssdatatable.cpp +++ b/xfa/fde/css/fde_cssdatatable.cpp @@ -609,11 +609,11 @@ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum( FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(const FX_WCHAR* pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); - FX_WORD wHash = (FX_WORD)FX_HashCode_String_GetW(pszName, iLength, TRUE); + uint16_t wHash = (uint16_t)FX_HashCode_String_GetW(pszName, iLength, TRUE); int32_t iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; int32_t iMid, iStart = 0; - FX_WORD uMid; + uint16_t uMid; do { iMid = (iStart + iEnd) / 2; uMid = g_FDE_CSSMediaTypes[iMid].wHash; @@ -630,11 +630,11 @@ FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(const FX_WCHAR* pszName, FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(const FX_WCHAR* pszName, int32_t iLength) { FXSYS_assert(pszName != NULL && iLength > 0); - FX_WORD wHash = (FX_WORD)FX_HashCode_String_GetW(pszName, iLength, TRUE); + uint16_t wHash = (uint16_t)FX_HashCode_String_GetW(pszName, iLength, TRUE); int32_t iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; int32_t iMid, iStart = 0; - FX_WORD wMid; + uint16_t wMid; do { iMid = (iStart + iEnd) / 2; wMid = g_FDE_CSSLengthUnits[iMid].wHash; diff --git a/xfa/fde/css/fde_cssdatatable.h b/xfa/fde/css/fde_cssdatatable.h index ef7e0dc704..c96520a670 100644 --- a/xfa/fde/css/fde_cssdatatable.h +++ b/xfa/fde/css/fde_cssdatatable.h @@ -153,15 +153,15 @@ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName( FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum( FDE_CSSPROPERTYVALUE eName); struct FDE_CSSMEDIATYPETABLE { - FX_WORD wHash; - FX_WORD wValue; + uint16_t wHash; + uint16_t wValue; }; typedef FDE_CSSMEDIATYPETABLE const* FDE_LPCCSSMEDIATYPETABLE; FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName(const FX_WCHAR* pszName, int32_t iLength); struct FDE_CSSLENGTHUNITTABLE { - FX_WORD wHash; - FX_WORD wValue; + uint16_t wHash; + uint16_t wValue; }; typedef FDE_CSSLENGTHUNITTABLE const* FDE_LPCCSSLENGTHUNITTABLE; FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName(const FX_WCHAR* pszName, diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index ca3a01c4c7..ebf2d262c1 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -1523,7 +1523,7 @@ FDE_CSSTEXTALIGN CFDE_CSSStyleSelector::ToTextAlign( return FDE_CSSTEXTALIGN_Left; } } -FX_WORD CFDE_CSSStyleSelector::ToFontWeight(FDE_CSSPROPERTYVALUE eValue) { +uint16_t CFDE_CSSStyleSelector::ToFontWeight(FDE_CSSPROPERTYVALUE eValue) { switch (eValue) { case FDE_CSSPROPERTYVALUE_Normal: return 400; diff --git a/xfa/fde/css/fde_cssstyleselector.h b/xfa/fde/css/fde_cssstyleselector.h index 4f8177f5c5..5016e8f5cb 100644 --- a/xfa/fde/css/fde_cssstyleselector.h +++ b/xfa/fde/css/fde_cssstyleselector.h @@ -144,7 +144,7 @@ class CFDE_CSSStyleSelector : public IFDE_CSSStyleSelector, public CFX_Target { FX_FLOAT ToFontSize(FDE_CSSPROPERTYVALUE eValue, FX_FLOAT fCurFontSize); FDE_CSSDISPLAY ToDisplay(FDE_CSSPROPERTYVALUE eValue); FDE_CSSTEXTALIGN ToTextAlign(FDE_CSSPROPERTYVALUE eValue); - FX_WORD ToFontWeight(FDE_CSSPROPERTYVALUE eValue); + uint16_t ToFontWeight(FDE_CSSPROPERTYVALUE eValue); FDE_CSSFONTSTYLE ToFontStyle(FDE_CSSPROPERTYVALUE eValue); FDE_CSSBORDERSTYLE ToBorderStyle(FDE_CSSPROPERTYVALUE eValue); FDE_CSSVERTICALALIGN ToVerticalAlign(FDE_CSSPROPERTYVALUE eValue); @@ -271,27 +271,26 @@ class CFDE_CSSInheritedData { FX_FLOAT m_fLineHeight; FX_ARGB m_dwFontColor; FX_ARGB m_dwTextEmphasisColor; - FX_WORD m_wFontWeight; + uint16_t m_wFontWeight; int32_t m_iWidows; int32_t m_iOrphans; const FX_WCHAR* m_pszTextEmphasisCustomMark; - FX_WORD m_eFontVariant : 1; - FX_WORD m_eFontStyle : 1; - FX_WORD m_bTextEmphasisColorCurrent : 1; - FX_WORD m_eTextAligh : 2; - FX_WORD m_eVisibility : 2; - FX_WORD m_eWhiteSpace : 3; - FX_WORD m_eTextTransform : 2; - FX_WORD m_eWritingMode : 2; - FX_WORD m_eWordBreak : 2; - FX_WORD m_eLineBreak : 2; - FX_WORD m_eTextEmphasisFill : 1; - FX_WORD m_eTextEmphasisMark : 3; - FX_WORD m_eCaptionSide : 3; - - FX_WORD m_eRubyAlign : 4; - FX_WORD m_eRubyOverhang : 2; - FX_WORD m_eRubyPosition : 2; + uint32_t m_eFontVariant : 1; + uint32_t m_eFontStyle : 1; + uint32_t m_bTextEmphasisColorCurrent : 1; + uint32_t m_eTextAligh : 2; + uint32_t m_eVisibility : 2; + uint32_t m_eWhiteSpace : 3; + uint32_t m_eTextTransform : 2; + uint32_t m_eWritingMode : 2; + uint32_t m_eWordBreak : 2; + uint32_t m_eLineBreak : 2; + uint32_t m_eTextEmphasisFill : 1; + uint32_t m_eTextEmphasisMark : 3; + uint32_t m_eCaptionSide : 3; + uint8_t m_eRubyAlign : 4; + uint8_t m_eRubyOverhang : 2; + uint8_t m_eRubyPosition : 2; }; class CFDE_CSSNonInheritedData { public: @@ -540,7 +539,7 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, index))) ->GetString(index); } - virtual FX_WORD GetFontWeight() const { + virtual uint16_t GetFontWeight() const { return m_InheritedData.m_wFontWeight; } virtual FDE_CSSFONTVARIANT GetFontVariant() const { @@ -551,7 +550,7 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, } virtual FX_FLOAT GetFontSize() const { return m_InheritedData.m_fFontSize; } virtual FX_ARGB GetColor() const { return m_InheritedData.m_dwFontColor; } - virtual void SetFontWeight(FX_WORD wFontWeight) { + virtual void SetFontWeight(uint16_t wFontWeight) { m_InheritedData.m_wFontWeight = wFontWeight; } virtual void SetFontVariant(FDE_CSSFONTVARIANT eFontVariant) { diff --git a/xfa/fde/css/fde_cssstylesheet.cpp b/xfa/fde/css/fde_cssstylesheet.cpp index 561b2f42f3..e0f8fa6cdf 100644 --- a/xfa/fde/css/fde_cssstylesheet.cpp +++ b/xfa/fde/css/fde_cssstylesheet.cpp @@ -48,7 +48,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadHTMLStandardStyleSheet() { IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromStream( const CFX_WideString& szUrl, IFX_Stream* pStream, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwMediaList) { CFDE_CSSStyleSheet* pStyleSheet = new CFDE_CSSStyleSheet(dwMediaList); if (!pStyleSheet->LoadFromStream(szUrl, pStream, wCodePage)) { @@ -61,7 +61,7 @@ IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadFromBuffer( const CFX_WideString& szUrl, const FX_WCHAR* pBuffer, int32_t iBufSize, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwMediaList) { CFDE_CSSStyleSheet* pStyleSheet = new CFDE_CSSStyleSheet(dwMediaList); if (!pStyleSheet->LoadFromBuffer(szUrl, pBuffer, iBufSize, wCodePage)) { @@ -124,7 +124,7 @@ IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(int32_t index) { } FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl, IFX_Stream* pStream, - FX_WORD wCodePage) { + uint16_t wCodePage) { FXSYS_assert(pStream != NULL); IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create(); if (pSyntax == NULL) { @@ -142,7 +142,7 @@ FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl, FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString& szUrl, const FX_WCHAR* pBuffer, int32_t iBufSize, - FX_WORD wCodePage) { + uint16_t wCodePage) { FXSYS_assert(pBuffer != NULL && iBufSize > 0); IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create(); if (pSyntax == NULL) { diff --git a/xfa/fde/css/fde_cssstylesheet.h b/xfa/fde/css/fde_cssstylesheet.h index f39ff1f22a..e6f4f2904d 100644 --- a/xfa/fde/css/fde_cssstylesheet.h +++ b/xfa/fde/css/fde_cssstylesheet.h @@ -106,16 +106,16 @@ class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target { return szUrl.GetLength() > 0; } virtual FX_DWORD GetMediaList() const { return m_dwMediaList; } - virtual FX_WORD GetCodePage() const { return m_wCodePage; } + virtual uint16_t GetCodePage() const { return m_wCodePage; } virtual int32_t CountRules() const; virtual IFDE_CSSRule* GetRule(int32_t index); FX_BOOL LoadFromStream(const CFX_WideString& szUrl, IFX_Stream* pStream, - FX_WORD wCodePage); + uint16_t wCodePage); FX_BOOL LoadFromBuffer(const CFX_WideString& szUrl, const FX_WCHAR* pBuffer, int32_t iBufSize, - FX_WORD wCodePage); + uint16_t wCodePage); protected: void Reset(); @@ -128,8 +128,8 @@ class CFDE_CSSStyleSheet : public IFDE_CSSStyleSheet, public CFX_Target { FDE_CSSSYNTAXSTATUS LoadFontFaceRule(IFDE_CSSSyntaxParser* pSyntax, CFDE_CSSRuleArray& ruleArray); FDE_CSSSYNTAXSTATUS SkipRuleSet(IFDE_CSSSyntaxParser* pSyntax); - FX_WORD m_wCodePage; - FX_WORD m_wRefCount; + uint16_t m_wCodePage; + uint16_t m_wRefCount; FX_DWORD m_dwMediaList; IFX_MEMAllocator* m_pAllocator; CFDE_CSSRuleArray m_RuleArray; diff --git a/xfa/fde/css/fde_csssyntax.cpp b/xfa/fde/css/fde_csssyntax.cpp index e03c57c6a8..2d0d972f77 100644 --- a/xfa/fde/css/fde_csssyntax.cpp +++ b/xfa/fde/css/fde_csssyntax.cpp @@ -337,7 +337,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() { DisableCharset(); if (m_iTextDatLen > 0) { if (m_pStream != NULL) { - FX_WORD wCodePage = FX_GetCodePageFormStringW( + uint16_t wCodePage = FX_GetCodePageFormStringW( m_TextData.GetBuffer(), m_iTextDatLen); if (wCodePage < 0xFFFF && m_pStream->GetCodePage() != wCodePage) { diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp index 731f88db40..3e0c87f821 100644 --- a/xfa/fde/xml/fde_xml_imp.cpp +++ b/xfa/fde/xml/fde_xml_imp.cpp @@ -388,7 +388,7 @@ void CFDE_XMLNode::SaveXMLNode(IFX_Stream* pXMLStream) { CFDE_XMLInstruction* pInstruction = (CFDE_XMLInstruction*)pNode; if (pInstruction->m_wsTarget.CompareNoCase(L"xml") == 0) { ws = L"<?xml version=\"1.0\" encoding=\""; - FX_WORD wCodePage = pXMLStream->GetCodePage(); + uint16_t wCodePage = pXMLStream->GetCodePage(); if (wCodePage == FX_CODEPAGE_UTF16LE) { ws += L"UTF-16"; } else if (wCodePage == FX_CODEPAGE_UTF16BE) { @@ -914,7 +914,7 @@ FX_BOOL CFDE_XMLDoc::LoadXML(IFX_Stream* pXMLStream, iTextDataSize = 128; } m_pStream = pXMLStream; - FX_WORD wCodePage = m_pStream->GetCodePage(); + uint16_t wCodePage = m_pStream->GetCodePage(); if (wCodePage != FX_CODEPAGE_UTF16LE && wCodePage != FX_CODEPAGE_UTF16BE && wCodePage != FX_CODEPAGE_UTF8) { m_pStream->SetCodePage(FX_CODEPAGE_UTF8); @@ -958,7 +958,7 @@ void CFDE_XMLDoc::SaveXMLNode(IFX_Stream* pXMLStream, IFDE_XMLNode* pINode) { CFDE_XMLInstruction* pInstruction = (CFDE_XMLInstruction*)pNode; if (pInstruction->m_wsTarget.CompareNoCase(L"xml") == 0) { ws = L"<?xml version=\"1.0\" encoding=\""; - FX_WORD wCodePage = pXMLStream->GetCodePage(); + uint16_t wCodePage = pXMLStream->GetCodePage(); if (wCodePage == FX_CODEPAGE_UTF16LE) { ws += L"UTF-16"; } else if (wCodePage == FX_CODEPAGE_UTF16BE) { @@ -1067,7 +1067,7 @@ void CFDE_XMLDoc::SaveXML(IFX_Stream* pXMLStream, FX_BOOL bSaveBOM) { } FXSYS_assert((pXMLStream->GetAccessModes() & FX_STREAMACCESS_Text) != 0); FXSYS_assert((pXMLStream->GetAccessModes() & FX_STREAMACCESS_Write) != 0); - FX_WORD wCodePage = pXMLStream->GetCodePage(); + uint16_t wCodePage = pXMLStream->GetCodePage(); if (wCodePage != FX_CODEPAGE_UTF16LE && wCodePage != FX_CODEPAGE_UTF16BE && wCodePage != FX_CODEPAGE_UTF8) { wCodePage = FX_CODEPAGE_UTF8; diff --git a/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp b/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp index d1b079edb1..6b8ae806d6 100644 --- a/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp +++ b/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp @@ -158,8 +158,8 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter, pIter->Next(bPrev); FX_WCHAR wcTemp = pIter->GetChar(); eNextType = FX_GetWordBreakProperty(wcTemp); - FX_WORD wBreak = - gs_FX_WordBreak_Table[eCurType] & ((FX_WORD)(1 << eNextType)); + uint16_t wBreak = + gs_FX_WordBreak_Table[eCurType] & ((uint16_t)(1 << eNextType)); if (wBreak) { if (pIter->IsEOF(!bPrev)) { pIter->Next(!bPrev); diff --git a/xfa/fee/fx_wordbreak/fx_wordbreak_impl.h b/xfa/fee/fx_wordbreak/fx_wordbreak_impl.h index 95f5a43eb0..e7421ca1af 100644 --- a/xfa/fee/fx_wordbreak/fx_wordbreak_impl.h +++ b/xfa/fee/fx_wordbreak/fx_wordbreak_impl.h @@ -15,7 +15,7 @@ #include "xfa/fee/fx_wordbreak/fx_wordbreak_impl.h" #include "xfa/fee/ifde_txtedtengine.h" -extern const FX_WORD gs_FX_WordBreak_Table[16]; +extern const uint16_t gs_FX_WordBreak_Table[16]; extern const uint8_t gs_FX_WordBreak_CodePointProperties[(0xFFFF - 1) / 2 + 1]; enum FX_WordBreakProp { FX_WordBreakProp_None = 0, diff --git a/xfa/fee/fx_wordbreak/fx_wordbreakdata.cpp b/xfa/fee/fx_wordbreak/fx_wordbreakdata.cpp index ffb4889954..b632d5fafc 100644 --- a/xfa/fee/fx_wordbreak/fx_wordbreakdata.cpp +++ b/xfa/fee/fx_wordbreak/fx_wordbreakdata.cpp @@ -6,7 +6,7 @@ #include "xfa/fee/fx_wordbreak/fx_wordbreak_impl.h" -const FX_WORD gs_FX_WordBreak_Table[16] = { +const uint16_t gs_FX_WordBreak_Table[16] = { 0xFFFF, 0xFFF9, 0xFFFB, 0xFFFB, 0xFFFB, 0xFFFB, 0xEFBB, 0xE77B, 0xFFFB, 0xFFFB, 0xFFFB, 0xE77B, 0xE73B, 0xFFFB, 0xFFFB, 0xFFFB, }; diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp index e717873abe..dcf3dfa690 100644 --- a/xfa/fgas/crt/fgas_codepage.cpp +++ b/xfa/fgas/crt/fgas_codepage.cpp @@ -17,7 +17,7 @@ static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = { {186, 1257}, {204, 1251}, {222, 874}, {238, 1250}, {254, 437}, {255, 850}, }; -FX_WORD FX_GetCodePageFromCharset(uint8_t charset) { +uint16_t FX_GetCodePageFromCharset(uint8_t charset) { int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); int32_t iStart = 0, iMid; @@ -43,7 +43,7 @@ static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = { {84, 10004}, {85, 10006}, {86, 10081}, {87, 10021}, {88, 10029}, {89, 10007}, }; -FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage) { +uint16_t FX_GetCharsetFromCodePage(uint16_t codepage) { int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1; FXSYS_assert(iEnd >= 0); int32_t iStart = 0, iMid; @@ -197,7 +197,7 @@ const FX_LANG2CPMAP g_FXLang2CodepageTable[] = { {FX_LANG_Spanish_Nicaragua, FX_CODEPAGE_MSWin_WesternEuropean}, {FX_LANG_Spanish_PuertoRico, FX_CODEPAGE_MSWin_WesternEuropean}, }; -FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage) { +uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage) { int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1; FXSYS_assert(iEnd >= 0); int32_t iStart = 0, iMid; @@ -301,7 +301,7 @@ static const FX_STR2CPHASH g_FXCPHashTable[] = { {0xf3d463c2, 0x3a4}, {0xf52a70a3, 0xc42e}, {0xf5693147, 0x6fb3}, {0xf637e157, 0x478}, {0xfc213f3a, 0x2717}, {0xff654d14, 0x3b5}, }; -FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { +uint16_t FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { FXSYS_assert(pStr != NULL); if (iLength < 0) { iLength = FXSYS_strlen(pStr); @@ -317,7 +317,7 @@ FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { iMid = (iStart + iEnd) / 2; const FX_STR2CPHASH& cp = g_FXCPHashTable[iMid]; if (uHash == cp.uHash) { - return (FX_WORD)cp.uCodePage; + return (uint16_t)cp.uCodePage; } else if (uHash < cp.uHash) { iEnd = iMid - 1; } else { @@ -326,7 +326,7 @@ FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { } while (iStart <= iEnd); return 0xFFFF; } -FX_WORD FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength) { +uint16_t FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength) { if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } diff --git a/xfa/fgas/crt/fgas_codepage.h b/xfa/fgas/crt/fgas_codepage.h index ec01816386..fe69f7ce93 100644 --- a/xfa/fgas/crt/fgas_codepage.h +++ b/xfa/fgas/crt/fgas_codepage.h @@ -133,24 +133,24 @@ #define FX_CHARSET_US 254 #define FX_CHARSET_OEM 255 -FX_WORD FX_GetCodePageFromCharset(uint8_t charset); -FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage); -FX_WORD FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength); -FX_WORD FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength); -FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage); +uint16_t FX_GetCodePageFromCharset(uint8_t charset); +uint16_t FX_GetCharsetFromCodePage(uint16_t codepage); +uint16_t FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength); +uint16_t FX_GetCodePageFormStringW(const FX_WCHAR* pStr, int32_t iLength); +uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage); void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength); void FX_SwapByteOrderCopy(const FX_WCHAR* pSrc, FX_WCHAR* pDst, int32_t iLength); void FX_UTF16ToWChar(void* pBuffer, int32_t iLength); -void FX_UTF16ToWCharCopy(const FX_WORD* pUTF16, +void FX_UTF16ToWCharCopy(const uint16_t* pUTF16, FX_WCHAR* pWChar, int32_t iLength); void FX_WCharToUTF16(void* pBuffer, int32_t iLength); void FX_WCharToUTF16Copy(const FX_WCHAR* pWChar, - FX_WORD* pUTF16, + uint16_t* pUTF16, int32_t iLength); -int32_t FX_DecodeString(FX_WORD wCodePage, +int32_t FX_DecodeString(uint16_t wCodePage, const FX_CHAR* pSrc, int32_t* pSrcLen, FX_WCHAR* pDst, diff --git a/xfa/fgas/crt/fgas_encode.cpp b/xfa/fgas/crt/fgas_encode.cpp index 138b4b1f5e..7d04e58131 100644 --- a/xfa/fgas/crt/fgas_encode.cpp +++ b/xfa/fgas/crt/fgas_encode.cpp @@ -11,17 +11,17 @@ void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) { if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } - FX_WORD wch; + uint16_t wch; if (sizeof(FX_WCHAR) > 2) { while (iLength-- > 0) { - wch = (FX_WORD)*pStr; + wch = (uint16_t)*pStr; wch = (wch >> 8) | (wch << 8); wch &= 0x00FF; *pStr++ = wch; } } else { while (iLength-- > 0) { - wch = (FX_WORD)*pStr; + wch = (uint16_t)*pStr; wch = (wch >> 8) | (wch << 8); *pStr++ = wch; } @@ -34,17 +34,17 @@ void FX_SwapByteOrderCopy(const FX_WCHAR* pSrc, if (iLength < 0) { iLength = FXSYS_wcslen(pSrc); } - FX_WORD wch; + uint16_t wch; if (sizeof(FX_WCHAR) > 2) { while (iLength-- > 0) { - wch = (FX_WORD)*pSrc++; + wch = (uint16_t)*pSrc++; wch = (wch >> 8) | (wch << 8); wch &= 0x00FF; *pDst++ = wch; } } else { while (iLength-- > 0) { - wch = (FX_WORD)*pSrc++; + wch = (uint16_t)*pSrc++; wch = (wch >> 8) | (wch << 8); *pDst++ = wch; } @@ -55,13 +55,13 @@ void FX_UTF16ToWChar(void* pBuffer, int32_t iLength) { if (sizeof(FX_WCHAR) == 2) { return; } - FX_WORD* pSrc = (FX_WORD*)pBuffer; + uint16_t* pSrc = (uint16_t*)pBuffer; FX_WCHAR* pDst = (FX_WCHAR*)pBuffer; while (--iLength >= 0) { pDst[iLength] = (FX_WCHAR)pSrc[iLength]; } } -void FX_UTF16ToWCharCopy(const FX_WORD* pUTF16, +void FX_UTF16ToWCharCopy(const uint16_t* pUTF16, FX_WCHAR* pWChar, int32_t iLength) { FXSYS_assert(pUTF16 != NULL && pWChar != NULL && iLength > 0); @@ -79,30 +79,30 @@ void FX_WCharToUTF16(void* pBuffer, int32_t iLength) { return; } const FX_WCHAR* pSrc = (const FX_WCHAR*)pBuffer; - FX_WORD* pDst = (FX_WORD*)pBuffer; + uint16_t* pDst = (uint16_t*)pBuffer; while (--iLength >= 0) { - *pDst++ = (FX_WORD)*pSrc++; + *pDst++ = (uint16_t)*pSrc++; } } void FX_WCharToUTF16Copy(const FX_WCHAR* pWChar, - FX_WORD* pUTF16, + uint16_t* pUTF16, int32_t iLength) { FXSYS_assert(pWChar != NULL && pUTF16 != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { FXSYS_memcpy(pUTF16, pWChar, iLength * sizeof(FX_WCHAR)); } else { while (--iLength >= 0) { - *pUTF16++ = (FX_WORD)*pWChar++; + *pUTF16++ = (uint16_t)*pWChar++; } } } inline FX_DWORD FX_DWordFromBytes(const uint8_t* pStr) { return FXBSTR_ID(pStr[3], pStr[2], pStr[1], pStr[0]); } -inline FX_WORD FX_WordFromBytes(const uint8_t* pStr) { +inline uint16_t FX_WordFromBytes(const uint8_t* pStr) { return (pStr[1] << 8 | pStr[0]); } -int32_t FX_DecodeString(FX_WORD wCodePage, +int32_t FX_DecodeString(uint16_t wCodePage, const FX_CHAR* pSrc, int32_t* pSrcLen, FX_WCHAR* pDst, diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp index 6f082dd5f1..4dc3737d75 100644 --- a/xfa/fgas/crt/fgas_stream.cpp +++ b/xfa/fgas/crt/fgas_stream.cpp @@ -201,8 +201,8 @@ class CFX_Stream : public IFX_Stream { virtual void Flush(); virtual FX_BOOL SetLength(int32_t iLength); virtual int32_t GetBOM(uint8_t bom[4]) const; - virtual FX_WORD GetCodePage() const; - virtual FX_WORD SetCodePage(FX_WORD wCodePage); + virtual uint16_t GetCodePage() const; + virtual uint16_t SetCodePage(uint16_t wCodePage); virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength); @@ -242,15 +242,15 @@ class CFX_TextStream : public IFX_Stream { virtual FX_BOOL SetLength(int32_t iLength); virtual int32_t GetBOM(uint8_t bom[4]) const; - virtual FX_WORD GetCodePage() const; - virtual FX_WORD SetCodePage(FX_WORD wCodePage); + virtual uint16_t GetCodePage() const; + virtual uint16_t SetCodePage(uint16_t wCodePage); virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength); protected: - FX_WORD m_wCodePage; + uint16_t m_wCodePage; int32_t m_wBOMLength; FX_DWORD m_dwBOM; uint8_t* m_pBuf; @@ -1015,7 +1015,7 @@ void CFX_TextStream::Flush() { FX_BOOL CFX_TextStream::SetLength(int32_t iLength) { return m_pStreamImp->SetLength(iLength); } -FX_WORD CFX_TextStream::GetCodePage() const { +uint16_t CFX_TextStream::GetCodePage() const { return m_wCodePage; } IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, @@ -1038,11 +1038,11 @@ int32_t CFX_TextStream::GetBOM(uint8_t bom[4]) const { *(FX_DWORD*)bom = m_dwBOM; return m_wBOMLength; } -FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage) { +uint16_t CFX_TextStream::SetCodePage(uint16_t wCodePage) { if (m_wBOMLength > 0) { return m_wCodePage; } - FX_WORD v = m_wCodePage; + uint16_t v = m_wCodePage; m_wCodePage = wCodePage; return v; } @@ -1421,14 +1421,14 @@ int32_t CFX_Stream::GetBOM(uint8_t bom[4]) const { } return 0; } -FX_WORD CFX_Stream::GetCodePage() const { +uint16_t CFX_Stream::GetCodePage() const { #if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_ return FX_CODEPAGE_UTF16LE; #else return FX_CODEPAGE_UTF16BE; #endif } -FX_WORD CFX_Stream::SetCodePage(FX_WORD wCodePage) { +uint16_t CFX_Stream::SetCodePage(uint16_t wCodePage) { #if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_ return FX_CODEPAGE_UTF16LE; #else diff --git a/xfa/fgas/crt/fgas_stream.h b/xfa/fgas/crt/fgas_stream.h index e083886ec7..94b7f01ed6 100644 --- a/xfa/fgas/crt/fgas_stream.h +++ b/xfa/fgas/crt/fgas_stream.h @@ -68,8 +68,8 @@ class IFX_Stream { virtual void Flush() = 0; virtual FX_BOOL SetLength(int32_t iLength) = 0; virtual int32_t GetBOM(uint8_t bom[4]) const = 0; - virtual FX_WORD GetCodePage() const = 0; - virtual FX_WORD SetCodePage(FX_WORD wCodePage) = 0; + virtual uint16_t GetCodePage() const = 0; + virtual uint16_t SetCodePage(uint16_t wCodePage) = 0; virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) = 0; diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h index f03e3983fa..1138cfd7c9 100644 --- a/xfa/fgas/crt/fgas_utils.h +++ b/xfa/fgas/crt/fgas_utils.h @@ -85,7 +85,7 @@ class CFX_BaseArrayTemplate : public CFX_BaseArray { }; typedef CFX_BaseArrayTemplate<void*> CFDE_PtrArray; typedef CFX_BaseArrayTemplate<FX_DWORD> CFDE_DWordArray; -typedef CFX_BaseArrayTemplate<FX_WORD> CFDE_WordArray; +typedef CFX_BaseArrayTemplate<uint16_t> CFDE_WordArray; template <class baseType> class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { @@ -282,7 +282,7 @@ class CFX_MassArrayTemplate : public CFX_BaseMassArray { typedef CFX_MassArrayTemplate<void*> CFX_PtrMassArray; typedef CFX_MassArrayTemplate<int32_t> CFX_Int32MassArray; typedef CFX_MassArrayTemplate<FX_DWORD> CFX_DWordMassArray; -typedef CFX_MassArrayTemplate<FX_WORD> CFX_WordMassArray; +typedef CFX_MassArrayTemplate<uint16_t> CFX_WordMassArray; typedef CFX_MassArrayTemplate<CFX_Rect> CFX_RectMassArray; typedef CFX_MassArrayTemplate<CFX_RectF> CFX_RectFMassArray; @@ -397,7 +397,7 @@ class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray { }; typedef CFX_DiscreteArrayTemplate<void*> CFX_PtrDiscreteArray; typedef CFX_DiscreteArrayTemplate<FX_DWORD> CFX_DWordDiscreteArray; -typedef CFX_DiscreteArrayTemplate<FX_WORD> CFX_WordDiscreteArray; +typedef CFX_DiscreteArrayTemplate<uint16_t> CFX_WordDiscreteArray; class CFX_BaseStack : public CFX_Target { protected: @@ -436,7 +436,7 @@ class CFX_StackTemplate : public CFX_BaseStack { }; typedef CFX_StackTemplate<void*> CFX_PtrStack; typedef CFX_StackTemplate<FX_DWORD> CFX_DWordStack; -typedef CFX_StackTemplate<FX_WORD> CFX_WordStack; +typedef CFX_StackTemplate<uint16_t> CFX_WordStack; typedef CFX_StackTemplate<int32_t> CFX_Int32Stack; template <class baseType> diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h index 5c362122ba..b13602cee6 100644 --- a/xfa/fgas/font/fgas_font.h +++ b/xfa/fgas/font/fgas_font.h @@ -61,7 +61,7 @@ class IFX_Font { public: static IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage, + uint16_t wCodePage, IFX_FontMgr* pFontMgr); static IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength, @@ -76,7 +76,7 @@ class IFX_Font { virtual ~IFX_Font() {} virtual void Release() = 0; virtual IFX_Font* Retain() = 0; - virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0) = 0; + virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0) = 0; virtual void GetFamilyName(CFX_WideString& wsFamily) const = 0; virtual void GetPsName(CFX_WideString& wsName) const = 0; virtual FX_DWORD GetFontStyles() const = 0; @@ -108,7 +108,7 @@ struct FX_FONTMATCHPARAMS { FX_DWORD dwUSB; FX_DWORD dwMatchFlags; FX_WCHAR wUnicode; - FX_WORD wCodePage; + uint16_t wCodePage; }; typedef FX_FONTMATCHPARAMS* FX_LPFONTMATCHPARAMS; typedef FX_FONTMATCHPARAMS const* FX_LPCFONTMATCHPARAMS; @@ -161,7 +161,7 @@ class IFX_FontMgr { virtual ~IFX_FontMgr() {} virtual void Release() = 0; virtual IFX_Font* GetDefFontByCodePage( - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByCharset( @@ -173,22 +173,22 @@ class IFX_FontMgr { FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage( - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) = 0; + uint16_t wCodePage = 0xFFFF) = 0; virtual IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength) = 0; virtual IFX_Font* LoadFont(const FX_WCHAR* pszFileName) = 0; virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, const FX_WCHAR* pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, - FX_WORD wCodePage = 0, + uint16_t wCodePage = 0, FX_BOOL bSaveStream = FALSE) = 0; virtual IFX_Font* LoadFont(IFX_Font* pSrcFont, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) = 0; + uint16_t wCodePage = 0xFFFF) = 0; virtual void ClearFontCache() = 0; virtual void RemoveFont(IFX_Font* pFont) = 0; }; @@ -198,7 +198,7 @@ class IFX_FontMgrDelegate { virtual ~IFX_FontMgrDelegate() {} virtual IFX_Font* GetDefFontByCodePage( IFX_FontMgr* pFontMgr, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByCharset( @@ -213,7 +213,7 @@ class IFX_FontMgrDelegate { const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage( IFX_FontMgr* pFontMgr, - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; }; @@ -233,7 +233,7 @@ class IFX_FontMgr { virtual ~IFX_FontMgr() {} virtual void Release() = 0; virtual IFX_Font* GetDefFontByCodePage( - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByCharset( @@ -245,15 +245,15 @@ class IFX_FontMgr { FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* GetDefFontByLanguage( - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; - virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; inline IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); } virtual IFX_Font* GetFontByCharset(uint8_t nCharset, @@ -262,7 +262,7 @@ class IFX_FontMgr { virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; - virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL) = 0; virtual IFX_Font* LoadFont(const uint8_t* pBuffer, diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp index 51bba0123e..e115e0f42d 100644 --- a/xfa/fgas/font/fgas_fontutils.cpp +++ b/xfa/fgas/font/fgas_fontutils.cpp @@ -9,7 +9,7 @@ #include "core/include/fxcrt/fx_ext.h" #include "xfa/fgas/font/fgas_font.h" -FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) { +FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles) { FX_DWORD dwHash = wCodePage; if (dwFontStyles & FX_FONTSTYLE_FixedPitch) { dwHash |= 0x00010000; @@ -33,7 +33,7 @@ FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles) { } FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { CFX_WideString wsFont(pszFontFamily); if (dwFontStyles & FX_FONTSTYLE_Bold) { wsFont += L"Bold"; diff --git a/xfa/fgas/font/fgas_fontutils.h b/xfa/fgas/font/fgas_fontutils.h index ab567aee6b..d5608063ca 100644 --- a/xfa/fgas/font/fgas_fontutils.h +++ b/xfa/fgas/font/fgas_fontutils.h @@ -16,10 +16,10 @@ struct FGAS_FONTUSB { uint16_t wCodePage; }; -FX_DWORD FGAS_GetFontHashCode(FX_WORD wCodePage, FX_DWORD dwFontStyles); +FX_DWORD FGAS_GetFontHashCode(uint16_t wCodePage, FX_DWORD dwFontStyles); FX_DWORD FGAS_GetFontFamilyHash(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage); + uint16_t wCodePage); const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode); #endif // XFA_FGAS_FONT_FGAS_FONTUTILS_H_ diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index 831da7e7d6..75ed0b2a1f 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -11,7 +11,7 @@ IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage, + uint16_t wCodePage, IFX_FontMgr* pFontMgr) { #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (NULL != pFontMgr) { @@ -189,7 +189,7 @@ IFX_Font* CFX_GEFont::Retain() { } FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { if (m_pFont) { return FALSE; } @@ -221,7 +221,7 @@ FX_BOOL CFX_GEFont::LoadFont(const FX_WCHAR* pszFontFamily, } int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; - FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage); + uint16_t wCharSet = FX_GetCharsetFromCodePage(wCodePage); if (wCharSet == 0xFFFF) { wCharSet = FXSYS_GetACP(); } @@ -329,7 +329,7 @@ FX_BOOL CFX_GEFont::InitFont() { } return TRUE; } -IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage) { +IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, uint16_t wCodePage) { if (GetFontStyles() == dwFontStyles) { return Retain(); } @@ -489,7 +489,7 @@ int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, if (pFontUSB == NULL) { return 0xFFFF; } - FX_WORD wBitField = pFontUSB->wBitField; + uint16_t wBitField = pFontUSB->wBitField; if (wBitField >= 128) { return 0xFFFF; } diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h index 034220ef64..03bc32ce63 100644 --- a/xfa/fgas/font/fgas_gefont.h +++ b/xfa/fgas/font/fgas_gefont.h @@ -21,12 +21,12 @@ class CFX_GEFont : public IFX_Font { virtual IFX_Font* Retain(); FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage); + uint16_t wCodePage); FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t length); FX_BOOL LoadFont(const FX_WCHAR* pszFileName); FX_BOOL LoadFont(IFX_Stream* pFontStream, FX_BOOL bSaveStream); FX_BOOL LoadFont(CFX_Font* pExtFont, FX_BOOL bTakeOver = FALSE); - virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0); + virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0); virtual void GetFamilyName(CFX_WideString& wsFamily) const; virtual void GetPsName(CFX_WideString& wsName) const; virtual FX_DWORD GetFontStyles() const; @@ -71,7 +71,7 @@ class CFX_GEFont : public IFX_Font { CFX_RectMassArray* m_pRectArray; CFX_MapPtrToPtr* m_pBBoxMap; IFX_FontProvider* m_pProvider; - FX_WORD m_wCharSet; + uint16_t m_wCharSet; CFX_PtrArray m_SubstFonts; CFX_MapPtrToPtr m_FontMapper; FX_BOOL InitFont(); diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index ffe520dc87..331ea86582 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.cpp +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp @@ -57,7 +57,7 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() { m_Fonts.RemoveAll(); } IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage( - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles); @@ -115,7 +115,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode( if (!pFD) return nullptr; - FX_WORD wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet); + uint16_t wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet); const FX_WCHAR* pFontFace = pFD->wsFontFace; pFont = IFX_Font::LoadFont(pFontFace, dwFontStyles, wCodePage, this); if (pFont) { @@ -131,7 +131,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode( } IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage( - FX_WORD wLanguage, + uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetDefFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), @@ -139,7 +139,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByLanguage( } IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage); IFX_Font* pFont = NULL; @@ -203,7 +203,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFileName) { IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, const FX_WCHAR* pszFontAlias, FX_DWORD dwFontStyles, - FX_WORD wCodePage, + uint16_t wCodePage, FX_BOOL bSaveStream) { FXSYS_assert(pFontStream != NULL && pFontStream->GetLength() > 0); IFX_Font* pFont = NULL; @@ -232,7 +232,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, } IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font* pSrcFont, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { FXSYS_assert(pSrcFont != NULL); if (pSrcFont->GetFontStyles() == dwFontStyles) { return pSrcFont->Retain(); @@ -299,7 +299,7 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font* pFont) { FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, FX_DWORD dwMatchFlags, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwUSB, FX_WCHAR wUnicode) { if (m_pMatcher == NULL) { @@ -688,7 +688,7 @@ void CFX_FontMgrImp::Release() { } delete this; } -IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, +IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage( @@ -709,14 +709,14 @@ IFX_Font* CFX_FontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, : m_pDelegate->GetDefFontByUnicode( this, wUnicode, dwFontStyles, pszFontFamily); } -IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(FX_WORD wLanguage, +IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByLanguage( this, wLanguage, dwFontStyles, pszFontFamily); } -IFX_Font* CFX_FontMgrImp::GetFontByCodePage(FX_WORD wCodePage, +IFX_Font* CFX_FontMgrImp::GetFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { CFX_ByteString bsHash; @@ -770,8 +770,8 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode(FX_WCHAR wUnicode, if (m_FailedUnicodes2NULL.Lookup(wUnicode, pFont)) return nullptr; const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wUnicode); - FX_WORD wCodePage = x ? x->wCodePage : 0xFFFF; - FX_WORD wBitField = x ? x->wBitField : 0x03E7; + uint16_t wCodePage = x ? x->wCodePage : 0xFFFF; + uint16_t wBitField = x ? x->wBitField : 0x03E7; CFX_ByteString bsHash; if (wCodePage == 0xFFFF) bsHash.Format("%d, %d, %d", wCodePage, wBitField, dwFontStyles); @@ -851,7 +851,7 @@ FX_BOOL CFX_FontMgrImp::VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode) { } return TRUE; } -IFX_Font* CFX_FontMgrImp::GetFontByLanguage(FX_WORD wLanguage, +IFX_Font* CFX_FontMgrImp::GetFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily) { return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, @@ -1072,7 +1072,7 @@ IFX_FileRead* CFX_FontMgrImp::CreateFontStream( return nullptr; } int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode) { @@ -1104,8 +1104,8 @@ int32_t CFX_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, return MatchedFonts.GetSize(); } struct FX_BitCodePage { - FX_WORD wBit; - FX_WORD wCodePage; + uint16_t wBit; + uint16_t wCodePage; }; static const FX_BitCodePage g_Bit2CodePage[] = { {0, 1252}, {1, 1250}, {2, 1251}, {3, 1253}, {4, 1254}, {5, 1255}, @@ -1121,21 +1121,21 @@ static const FX_BitCodePage g_Bit2CodePage[] = { {60, 737}, {61, 708}, {62, 850}, {63, 437}, }; -FX_WORD FX_GetCodePageBit(FX_WORD wCodePage) { +uint16_t FX_GetCodePageBit(uint16_t wCodePage) { for (size_t i = 0; i < FX_ArraySize(g_Bit2CodePage); ++i) { if (g_Bit2CodePage[i].wCodePage == wCodePage) return g_Bit2CodePage[i].wBit; } - return (FX_WORD)-1; + return (uint16_t)-1; } -FX_WORD FX_GetUnicodeBit(FX_WCHAR wcUnicode) { +uint16_t FX_GetUnicodeBit(FX_WCHAR wcUnicode) { const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wcUnicode); return x ? x->wBitField : 999; } int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode) { @@ -1192,10 +1192,10 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, if (nPenalty >= 0xFFFF) { return 0xFFFF; } - FX_WORD wBit = - ((0 == wCodePage || 0xFFFF == wCodePage) ? (FX_WORD)-1 + uint16_t wBit = + ((0 == wCodePage || 0xFFFF == wCodePage) ? (uint16_t)-1 : FX_GetCodePageBit(wCodePage)); - if (wBit != (FX_WORD)-1) { + if (wBit != (uint16_t)-1) { FXSYS_assert(wBit < 64); if (0 == (pInstalled->m_dwCsb[wBit / 32] & (1 << (wBit % 32)))) { nPenalty += 0xFFFF; @@ -1204,9 +1204,9 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, } } wBit = - ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (FX_WORD)999 + ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (uint16_t)999 : FX_GetUnicodeBit(wcUnicode)); - if (wBit != (FX_WORD)999) { + if (wBit != (uint16_t)999) { FXSYS_assert(wBit < 128); if (0 == (pInstalled->m_dwUsb[wBit / 32] & (1 << (wBit % 32)))) { nPenalty += 0xFFFF; @@ -1290,7 +1290,7 @@ void CFX_FontMgrImp::RegisterFace(FXFT_Face pFace, pFont->m_dwFontStyles |= FXFT_Is_Face_Bold(pFace) ? FX_FONTSTYLE_Bold : 0; pFont->m_dwFontStyles |= FXFT_Is_Face_Italic(pFace) ? FX_FONTSTYLE_Italic : 0; pFont->m_dwFontStyles |= GetFlags(pFace); - CFX_WordArray Charsets; + CFX_ArrayTemplate<uint16_t> Charsets; GetCharsets(pFace, Charsets); GetUSBCSB(pFace, pFont->m_dwUsb, pFont->m_dwCsb); unsigned long nLength = 0; @@ -1404,8 +1404,8 @@ void CFX_FontMgrImp::GetNames(const uint8_t* name_table, #undef GetUInt16 #undef GetUInt32 struct FX_BIT2CHARSET { - FX_WORD wBit; - FX_WORD wCharset; + uint16_t wBit; + uint16_t wCharset; }; FX_BIT2CHARSET g_FX_Bit2Charset1[16] = { {1 << 0, FX_CHARSET_ANSI}, @@ -1469,11 +1469,12 @@ FX_BIT2CHARSET g_FX_Bit2Charset4[16] = { Charsets.Add(g_FX_Bit2Charset##n[i].wCharset); \ } \ } -void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace, CFX_WordArray& Charsets) { +void CFX_FontMgrImp::GetCharsets(FXFT_Face pFace, + CFX_ArrayTemplate<uint16_t>& Charsets) { Charsets.RemoveAll(); TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(pFace, ft_sfnt_os2); if (NULL != pOS2) { - FX_WORD a1, a2, a3, a4; + uint16_t a1, a2, a3, a4; a1 = pOS2->ulCodePageRange1 & 0x0000ffff; CODEPAGERANGE_IMPLEMENT(1); a2 = (pOS2->ulCodePageRange1 >> 16) & 0x0000ffff; diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h index e646c28917..e548cf5d2b 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.h +++ b/xfa/fgas/font/fgas_stdfontmgr.h @@ -26,7 +26,7 @@ class CFX_StdFontMgrImp : public IFX_FontMgr { void* pUserData); ~CFX_StdFontMgrImp(); virtual void Release() { delete this; } - virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, @@ -35,22 +35,22 @@ class CFX_StdFontMgrImp : public IFX_FontMgr { virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* LoadFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); + uint16_t wCodePage = 0xFFFF); virtual IFX_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength); virtual IFX_Font* LoadFont(const FX_WCHAR* pszFileName); virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, const FX_WCHAR* pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, - FX_WORD wCodePage = 0, + uint16_t wCodePage = 0, FX_BOOL bSaveStream = FALSE); virtual IFX_Font* LoadFont(IFX_Font* pSrcFont, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); + uint16_t wCodePage = 0xFFFF); virtual void ClearFontCache(); virtual void RemoveFont(IFX_Font* pFont); @@ -71,7 +71,7 @@ class CFX_StdFontMgrImp : public IFX_FontMgr { FX_LPCFONTDESCRIPTOR FindFont(const FX_WCHAR* pszFontFamily, FX_DWORD dwFontStyles, FX_DWORD dwMatchFlags, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwUSB = 999, FX_WCHAR wUnicode = 0); IFX_Font* GetFont(FX_LPCFONTDESCRIPTOR pFD, FX_DWORD dwFontStyles); @@ -159,7 +159,7 @@ class CFX_FontMgrImp : public IFX_FontMgr { IFX_FontMgrDelegate* pDelegate = NULL, void* pUserData = NULL); virtual void Release(); - virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetDefFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, @@ -168,10 +168,10 @@ class CFX_FontMgrImp : public IFX_FontMgr { virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetDefFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, + virtual IFX_Font* GetFontByCodePage(uint16_t wCodePage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* GetFontByCharset(uint8_t nCharset, @@ -180,7 +180,7 @@ class CFX_FontMgrImp : public IFX_FontMgr { virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); - virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, + virtual IFX_Font* GetFontByLanguage(uint16_t wLanguage, FX_DWORD dwFontStyles, const FX_WCHAR* pszFontFamily = NULL); virtual IFX_Font* LoadFont(const uint8_t* pBuffer, @@ -211,7 +211,7 @@ class CFX_FontMgrImp : public IFX_FontMgr { void RegisterFaces(IFX_FileRead* pFontStream, const CFX_WideString* pFaceName); void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names); - void GetCharsets(FXFT_Face pFace, CFX_WordArray& Charsets); + void GetCharsets(FXFT_Face pFace, CFX_ArrayTemplate<uint16_t>& Charsets); void GetUSBCSB(FXFT_Face pFace, FX_DWORD* USB, FX_DWORD* CSB); FX_DWORD GetFlags(FXFT_Face pFace); CFX_FontDescriptors m_InstalledFonts; @@ -219,12 +219,12 @@ class CFX_FontMgrImp : public IFX_FontMgr { FX_BOOL VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode); int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2); int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, - FX_WORD wCodePage, + uint16_t wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE); diff --git a/xfa/fgas/layout/fgas_linebreak.cpp b/xfa/fgas/layout/fgas_linebreak.cpp index 8155af870a..4e5b405f5a 100644 --- a/xfa/fgas/layout/fgas_linebreak.cpp +++ b/xfa/fgas/layout/fgas_linebreak.cpp @@ -276,11 +276,11 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, FX_DWORD dwCur, dwNext; FX_WCHAR wch; wch = *pwsText++; - dwCur = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; iLength--; for (int32_t i = 0; i < iLength; i++) { wch = *pwsText++; - dwNext = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; if (dwNext == FX_CBP_SP) { pBrkType[i] = FX_LBT_PROHIBITED_BRK; } else { @@ -301,11 +301,11 @@ void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, FX_DWORD dwCur, dwNext; FX_WCHAR wch; wch = *pwsText++; - dwCur = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; iLength--; for (int32_t i = 0; i < iLength; i++) { wch = *pwsText++; - dwNext = kTextLayoutCodeProperties[(FX_WORD)wch] & 0x003F; + dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; if (dwNext == FX_CBP_SP) { eType = FX_LBT_PROHIBITED_BRK; } else { diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp index f57a1335fb..dd150a3002 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.cpp +++ b/xfa/fgas/layout/fgas_rtfbreak.cpp @@ -515,7 +515,7 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) { if (m_bCharCode) { return AppendChar_CharCode(wch); } - FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch]; + FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); CFX_RTFCharArray& tca = m_pCurLine->m_LineChars; CFX_RTFChar* pCurChar = tca.AddSpace(); diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index 0cc41980cb..f182a6d413 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -732,10 +732,10 @@ static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = { &CFX_TxtBreak::AppendChar_Others, &CFX_TxtBreak::AppendChar_Others, }; FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) { - FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch]; + FX_DWORD dwProps = kTextLayoutCodeProperties[(uint16_t)wch]; FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK); CFX_TxtChar* pCurChar = m_pCurLine->m_pLineChars->AddSpace(); - pCurChar->m_wCharCode = (FX_WORD)wch; + pCurChar->m_wCharCode = (uint16_t)wch; pCurChar->m_nRotation = m_iCharRotation; pCurChar->m_dwCharProps = dwProps; pCurChar->m_dwCharStyles = 0; @@ -1324,8 +1324,8 @@ void CFX_TxtBreak::Reset() { } struct FX_FORMCHAR { - FX_WORD wch; - FX_WORD wForm; + uint16_t wch; + uint16_t wForm; int32_t iWidth; }; diff --git a/xfa/fgas/localization/fgas_datetime.cpp b/xfa/fgas/localization/fgas_datetime.cpp index 34b8210fc3..ac5ee4a01d 100644 --- a/xfa/fgas/localization/fgas_datetime.cpp +++ b/xfa/fgas/localization/fgas_datetime.cpp @@ -124,14 +124,14 @@ static void FX_DaysToDate(int64_t iDays, } struct FXUT_SYSTEMTIME { - FX_WORD wYear; - FX_WORD wMonth; - FX_WORD wDayOfWeek; - FX_WORD wDay; - FX_WORD wHour; - FX_WORD wMinute; - FX_WORD wSecond; - FX_WORD wMilliseconds; + uint16_t wYear; + uint16_t wMonth; + uint16_t wDayOfWeek; + uint16_t wDay; + uint16_t wHour; + uint16_t wMinute; + uint16_t wSecond; + uint16_t wMilliseconds; }; void CFX_Unitime::Now() { @@ -160,7 +160,7 @@ void CFX_Unitime::Now() { #endif Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay, (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, - (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds); + (uint8_t)utLocal.wSecond, (uint16_t)utLocal.wMilliseconds); } void CFX_Unitime::SetGMTime() { FXUT_SYSTEMTIME utLocal; @@ -188,7 +188,7 @@ void CFX_Unitime::SetGMTime() { #endif Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay, (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, - (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds); + (uint8_t)utLocal.wSecond, (uint16_t)utLocal.wMilliseconds); } void CFX_Unitime::Set(int32_t year, uint8_t month, @@ -196,7 +196,7 @@ void CFX_Unitime::Set(int32_t year, uint8_t hour, uint8_t minute, uint8_t second, - FX_WORD millisecond) { + uint16_t millisecond) { FXSYS_assert(hour <= 23); FXSYS_assert(minute <= 59); FXSYS_assert(second <= 59); @@ -238,7 +238,7 @@ FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const { } return (FX_WEEKDAY)v; } -FX_WORD CFX_Unitime::GetDayOfYear() const { +uint16_t CFX_Unitime::GetDayOfYear() const { int32_t iYear; uint8_t iMonth, iDay; FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay); @@ -274,12 +274,12 @@ uint8_t CFX_Unitime::GetSecond() const { } return (uint8_t)(v / g_FXMillisecondsPerSecond); } -FX_WORD CFX_Unitime::GetMillisecond() const { +uint16_t CFX_Unitime::GetMillisecond() const { int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerSecond); if (v < 0) { v += g_FXMillisecondsPerSecond; } - return (FX_WORD)v; + return (uint16_t)v; } FX_BOOL CFX_Unitime::AddYears(int32_t iYears) { FX_UNITIME ut = m_iUnitime; @@ -350,7 +350,7 @@ FX_BOOL CFX_DateTime::Set(int32_t year, uint8_t hour, uint8_t minute, uint8_t second, - FX_WORD millisecond) { + uint16_t millisecond) { ASSERT(year != 0); ASSERT(month >= 1 && month <= 12); ASSERT(day >= 1 && day <= FX_DaysInMonth(year, month)); @@ -407,7 +407,7 @@ FX_WEEKDAY CFX_DateTime::GetDayOfWeek() const { } return (FX_WEEKDAY)v; } -FX_WORD CFX_DateTime::GetDayOfYear() const { +uint16_t CFX_DateTime::GetDayOfYear() const { return FX_DaysBeforeMonthInYear(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month) + m_DateTime.Date.sDate.day; @@ -425,7 +425,7 @@ uint8_t CFX_DateTime::GetMinute() const { uint8_t CFX_DateTime::GetSecond() const { return m_DateTime.Time.sTime.second; } -FX_WORD CFX_DateTime::GetMillisecond() const { +uint16_t CFX_DateTime::GetMillisecond() const { return m_DateTime.Time.sTime.millisecond; } FX_BOOL CFX_DateTime::AddYears(int32_t iYears) { @@ -542,7 +542,7 @@ FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds) { if (iMilliseconds < 0) { iSeconds--, iMilliseconds += g_FXMillisecondsPerSecond; } - m_DateTime.Time.sTime.millisecond = (FX_WORD)iMilliseconds; + m_DateTime.Time.sTime.millisecond = (uint16_t)iMilliseconds; if (iSeconds != 0) { AddSeconds(iSeconds); } diff --git a/xfa/fgas/localization/fgas_datetime.h b/xfa/fgas/localization/fgas_datetime.h index 4aa5093006..0a3d14d240 100644 --- a/xfa/fgas/localization/fgas_datetime.h +++ b/xfa/fgas/localization/fgas_datetime.h @@ -68,18 +68,18 @@ class CFX_Unitime { uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, - FX_WORD millisecond = 0); + uint16_t millisecond = 0); void Set(FX_UNITIME t); int32_t GetYear() const; uint8_t GetMonth() const; uint8_t GetDay() const; FX_WEEKDAY GetDayOfWeek() const; - FX_WORD GetDayOfYear() const; + uint16_t GetDayOfYear() const; int64_t GetDayOfAD() const; uint8_t GetHour() const; uint8_t GetMinute() const; uint8_t GetSecond() const; - FX_WORD GetMillisecond() const; + uint16_t GetMillisecond() const; FX_BOOL AddYears(int32_t iYears); FX_BOOL AddMonths(int32_t iMonths); FX_BOOL AddDays(int32_t iDays); @@ -177,7 +177,7 @@ struct FX_TIME { uint8_t hour; uint8_t minute; uint8_t second; - FX_WORD millisecond; + uint16_t millisecond; }; struct FX_TIMEZONE { @@ -199,7 +199,7 @@ struct FX_DATETIME { uint8_t hour; uint8_t minute; uint8_t second; - FX_WORD millisecond; + uint16_t millisecond; } sTime; FX_TIME aTime; } Time; @@ -221,7 +221,7 @@ struct FX_DATETIMEZONE { uint8_t hour; uint8_t minute; uint8_t second; - FX_WORD millisecond; + uint16_t millisecond; }; FX_TIME time; }; @@ -280,19 +280,19 @@ class CFX_DateTime { uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, - FX_WORD millisecond = 0); + uint16_t millisecond = 0); virtual FX_BOOL FromUnitime(FX_UNITIME t); virtual FX_UNITIME ToUnitime() const; virtual int32_t GetYear() const; virtual uint8_t GetMonth() const; virtual uint8_t GetDay() const; virtual FX_WEEKDAY GetDayOfWeek() const; - virtual FX_WORD GetDayOfYear() const; + virtual uint16_t GetDayOfYear() const; virtual int64_t GetDayOfAD() const; virtual uint8_t GetHour() const; virtual uint8_t GetMinute() const; virtual uint8_t GetSecond() const; - virtual FX_WORD GetMillisecond() const; + virtual uint16_t GetMillisecond() const; virtual FX_BOOL AddYears(int32_t iYears); virtual FX_BOOL AddMonths(int32_t iMonths); virtual FX_BOOL AddDays(int32_t iDays); diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index 6af9205d30..db94f766b5 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -629,14 +629,14 @@ FX_LOCALECATEGORY CFX_FormatString::GetCategory( } return eCategory; } -static FX_WORD FX_WStringToLCID(const FX_WCHAR* pstrLCID) { +static uint16_t FX_WStringToLCID(const FX_WCHAR* pstrLCID) { if (!pstrLCID) { return 0; } wchar_t* pEnd; - return (FX_WORD)wcstol((wchar_t*)pstrLCID, &pEnd, 16); + return (uint16_t)wcstol((wchar_t*)pstrLCID, &pEnd, 16); } -FX_WORD CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) { +uint16_t CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) { return FX_WStringToLCID(GetLocaleName(wsPattern)); } CFX_WideString CFX_FormatString::GetLocaleName( @@ -2386,7 +2386,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, } } else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '3')) { CFX_WideString wsMonthNameAbbr; - FX_WORD i = 0; + uint16_t i = 0; for (; i < 12; i++) { pLocale->GetMonthName(i, wsMonthNameAbbr, TRUE); if (wsMonthNameAbbr.IsEmpty()) { @@ -2403,7 +2403,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, } } else if (dwSymbol == FXBSTR_ID(0, 0, 'M', '4')) { CFX_WideString wsMonthName; - FX_WORD i = 0; + uint16_t i = 0; for (; i < 12; i++) { pLocale->GetMonthName(i, wsMonthName, FALSE); if (wsMonthName.IsEmpty()) { @@ -2422,7 +2422,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, cc += 1; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '3')) { CFX_WideString wsDayNameAbbr; - FX_WORD i = 0; + uint16_t i = 0; for (; i < 7; i++) { pLocale->GetDayName(i, wsDayNameAbbr, TRUE); if (wsDayNameAbbr.IsEmpty()) { @@ -2529,7 +2529,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, uint8_t hour = 0; uint8_t minute = 0; uint8_t second = 0; - FX_WORD millisecond = 0; + uint16_t millisecond = 0; int32_t ccf = 0; const FX_WCHAR* str = (const FX_WCHAR*)wsTime; int len = wsTime.GetLength(); @@ -3768,7 +3768,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, int32_t year = 1900; int32_t month = 1; int32_t day = 1; - FX_WORD wYear = 0; + uint16_t wYear = 0; int cc_start = 0, cc = 0; const FX_WCHAR* str = (const FX_WCHAR*)wsDate; int len = wsDate.GetLength(); @@ -3851,7 +3851,7 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime, uint8_t hour = 0; uint8_t minute = 0; uint8_t second = 0; - FX_WORD millisecond = 0; + uint16_t millisecond = 0; int cc_start = 0, cc = cc_start; const FX_WCHAR* str = (const FX_WCHAR*)wsTime.GetPtr(); int len = wsTime.GetLength(); @@ -3923,7 +3923,7 @@ FX_BOOL FX_TimeFromCanonical(const CFX_WideStringC& wsTime, datetime = datetime + ut; return TRUE; } -static FX_WORD FX_GetSolarMonthDays(FX_WORD year, FX_WORD month) { +static uint16_t FX_GetSolarMonthDays(uint16_t year, uint16_t month) { if (month % 2) { return 31; } else if (month == 2) { @@ -3931,9 +3931,9 @@ static FX_WORD FX_GetSolarMonthDays(FX_WORD year, FX_WORD month) { } return 30; } -static FX_WORD FX_GetWeekDay(FX_WORD year, FX_WORD month, FX_WORD day) { - FX_WORD g_month_day[] = {0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5}; - FX_WORD nDays = +static uint16_t FX_GetWeekDay(uint16_t year, uint16_t month, uint16_t day) { + uint16_t g_month_day[] = {0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5}; + uint16_t nDays = (year - 1) % 7 + (year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400; nDays += g_month_day[month - 1] + day; if (FX_IsLeapYear(year) && month > 2) { @@ -3941,9 +3941,9 @@ static FX_WORD FX_GetWeekDay(FX_WORD year, FX_WORD month, FX_WORD day) { } return nDays % 7; } -static FX_WORD FX_GetWeekOfMonth(FX_WORD year, FX_WORD month, FX_WORD day) { - FX_WORD week_day = FX_GetWeekDay(year, month, 1); - FX_WORD week_index = 0; +static uint16_t FX_GetWeekOfMonth(uint16_t year, uint16_t month, uint16_t day) { + uint16_t week_day = FX_GetWeekDay(year, month, 1); + uint16_t week_index = 0; week_index += day / 7; day = day % 7; if (week_day + day > 7) { @@ -3951,14 +3951,14 @@ static FX_WORD FX_GetWeekOfMonth(FX_WORD year, FX_WORD month, FX_WORD day) { } return week_index; } -static FX_WORD FX_GetWeekOfYear(FX_WORD year, FX_WORD month, FX_WORD day) { - FX_WORD nDays = 0; - for (FX_WORD i = 1; i < month; i++) { +static uint16_t FX_GetWeekOfYear(uint16_t year, uint16_t month, uint16_t day) { + uint16_t nDays = 0; + for (uint16_t i = 1; i < month; i++) { nDays += FX_GetSolarMonthDays(year, i); } nDays += day; - FX_WORD week_day = FX_GetWeekDay(year, 1, 1); - FX_WORD week_index = 1; + uint16_t week_day = FX_GetWeekDay(year, 1, 1); + uint16_t week_index = 1; week_index += nDays / 7; nDays = nDays % 7; if (week_day + nDays > 7) { @@ -4002,7 +4002,7 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsDay.Format(L"%02d", day); wsResult += wsDay; } else if (dwSymbol == FXBSTR_ID(0, 0, 'J', '1')) { - FX_WORD nDays = 0; + uint16_t nDays = 0; for (int i = 1; i < month; i++) { nDays += FX_GetSolarMonthDays(year, i); } @@ -4011,7 +4011,7 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsDays.Format(L"%d", nDays); wsResult += wsDays; } else if (dwSymbol == FXBSTR_ID(0, 0, 'J', '3')) { - FX_WORD nDays = 0; + uint16_t nDays = 0; for (int i = 1; i < month; i++) { nDays += FX_GetSolarMonthDays(year, i); } @@ -4036,24 +4036,24 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, pLocale->GetMonthName(month - 1, wsTemp, FALSE); wsResult += wsTemp; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '1')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); CFX_WideString wsWeekDay; wsWeekDay.Format(L"%d", wWeekDay + 1); wsResult += wsWeekDay; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '3')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); CFX_WideString wsTemp; pLocale->GetDayName(wWeekDay, wsTemp, TRUE); wsResult += wsTemp; } else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '4')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); if (pLocale) { CFX_WideString wsTemp; pLocale->GetDayName(wWeekDay, wsTemp, FALSE); wsResult += wsTemp; } } else if (dwSymbol == FXBSTR_ID(0, 0, 'e', '1')) { - FX_WORD wWeekDay = FX_GetWeekDay(year, month, day); + uint16_t wWeekDay = FX_GetWeekDay(year, month, day); CFX_WideString wsWeekDay; wsWeekDay.Format(L"%d", wWeekDay ? wWeekDay : 7); wsResult += wsWeekDay; @@ -4070,12 +4070,12 @@ static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, wsYear.Format(L"%d", year); wsResult += wsYear; } else if (dwSymbol == FXBSTR_ID(0, 0, 'w', '1')) { - FX_WORD week_index = FX_GetWeekOfMonth(year, month, day); + uint16_t week_index = FX_GetWeekOfMonth(year, month, day); CFX_WideString wsWeekInMonth; wsWeekInMonth.Format(L"%d", week_index); wsResult += wsWeekInMonth; } else if (dwSymbol == FXBSTR_ID(0, 0, 'W', '2')) { - FX_WORD week_index = FX_GetWeekOfYear(year, month, day); + uint16_t week_index = FX_GetWeekOfYear(year, month, day); CFX_WideString wsWeekInYear; wsWeekInYear.Format(L"%02d", week_index); wsResult += wsWeekInYear; @@ -4092,11 +4092,11 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern, uint8_t hour = datetime.GetHour(); uint8_t minute = datetime.GetMinute(); uint8_t second = datetime.GetSecond(); - FX_WORD millisecond = datetime.GetMillisecond(); + uint16_t millisecond = datetime.GetMillisecond(); int32_t ccf = 0; const FX_WCHAR* strf = (const FX_WCHAR*)wsTimePattern; int32_t lenf = wsTimePattern.GetLength(); - FX_WORD wHour = hour; + uint16_t wHour = hour; FX_BOOL bPM = FALSE; if (wsTimePattern.Find('A') != -1) { if (wHour >= 12) { diff --git a/xfa/fgas/localization/fgas_locale.h b/xfa/fgas/localization/fgas_locale.h index a7e14b3c26..3dd6c79fb7 100644 --- a/xfa/fgas/localization/fgas_locale.h +++ b/xfa/fgas/localization/fgas_locale.h @@ -87,13 +87,13 @@ class IFX_LocaleMgr { public: virtual ~IFX_LocaleMgr() {} virtual void Release() = 0; - virtual FX_WORD GetDefLocaleID() = 0; + virtual uint16_t GetDefLocaleID() = 0; virtual IFX_Locale* GetDefLocale() = 0; - virtual IFX_Locale* GetLocale(FX_WORD lcid) = 0; + virtual IFX_Locale* GetLocale(uint16_t lcid) = 0; virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName) = 0; }; IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, - FX_WORD wDefaultLCID); + uint16_t wDefaultLCID); void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult); FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime); @@ -109,7 +109,7 @@ class IFX_FormatString { virtual void SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns) = 0; virtual FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern) = 0; - virtual FX_WORD GetLCID(const CFX_WideString& wsPattern) = 0; + virtual uint16_t GetLCID(const CFX_WideString& wsPattern) = 0; virtual CFX_WideString GetLocaleName(const CFX_WideString& wsPattern) = 0; virtual FX_BOOL ParseText(const CFX_WideString& wsSrcText, const CFX_WideString& wsPattern, diff --git a/xfa/fgas/localization/fgas_localeimp.h b/xfa/fgas/localization/fgas_localeimp.h index f4b2b0ec8a..1eeaa418ca 100644 --- a/xfa/fgas/localization/fgas_localeimp.h +++ b/xfa/fgas/localization/fgas_localeimp.h @@ -52,7 +52,7 @@ class CFX_FormatString : public IFX_FormatString { virtual void SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns); virtual FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern); - virtual FX_WORD GetLCID(const CFX_WideString& wsPattern); + virtual uint16_t GetLCID(const CFX_WideString& wsPattern); virtual CFX_WideString GetLocaleName(const CFX_WideString& wsPattern); virtual FX_BOOL ParseText(const CFX_WideString& wsSrcText, const CFX_WideString& wsPattern, diff --git a/xfa/fgas/localization/fgas_localemgr.cpp b/xfa/fgas/localization/fgas_localemgr.cpp index 4ed8ddb79a..02061f75f3 100644 --- a/xfa/fgas/localization/fgas_localemgr.cpp +++ b/xfa/fgas/localization/fgas_localemgr.cpp @@ -9,7 +9,7 @@ #include "core/include/fxcrt/fx_xml.h" IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, - FX_WORD wDefaultLCID) { + uint16_t wDefaultLCID) { void* pPathHandle = FX_OpenFolder(pszLocalPath); if (!pPathHandle) { return NULL; @@ -53,7 +53,7 @@ IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath, FX_CloseFolder(pPathHandle); return pLocaleMgr; } -CFX_LocaleMgr::CFX_LocaleMgr(FX_WORD wDefLCID) : m_wDefLCID(wDefLCID) {} +CFX_LocaleMgr::CFX_LocaleMgr(uint16_t wDefLCID) : m_wDefLCID(wDefLCID) {} CFX_LocaleMgr::~CFX_LocaleMgr() { FX_POSITION ps = m_lcid2locale.GetStartPosition(); while (ps) { @@ -72,13 +72,13 @@ CFX_LocaleMgr::~CFX_LocaleMgr() { } m_lcid2xml.RemoveAll(); } -FX_WORD CFX_LocaleMgr::GetDefLocaleID() { +uint16_t CFX_LocaleMgr::GetDefLocaleID() { return m_wDefLCID; } IFX_Locale* CFX_LocaleMgr::GetDefLocale() { return GetLocale(m_wDefLCID); } -IFX_Locale* CFX_LocaleMgr::GetLocale(FX_WORD lcid) { +IFX_Locale* CFX_LocaleMgr::GetLocale(uint16_t lcid) { IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((void*)(uintptr_t)lcid); if (!pLocale) { diff --git a/xfa/fgas/localization/fgas_localemgr.h b/xfa/fgas/localization/fgas_localemgr.h index 5ae0d738cb..5f2647071b 100644 --- a/xfa/fgas/localization/fgas_localemgr.h +++ b/xfa/fgas/localization/fgas_localemgr.h @@ -11,18 +11,18 @@ class CFX_LocaleMgr : public IFX_LocaleMgr { public: - CFX_LocaleMgr(FX_WORD wDefLCID); + CFX_LocaleMgr(uint16_t wDefLCID); virtual void Release() { delete this; } - virtual FX_WORD GetDefLocaleID(); + virtual uint16_t GetDefLocaleID(); virtual IFX_Locale* GetDefLocale(); - virtual IFX_Locale* GetLocale(FX_WORD lcid); + virtual IFX_Locale* GetLocale(uint16_t lcid); virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName); CFX_MapPtrToPtr m_lcid2xml; protected: ~CFX_LocaleMgr(); CFX_MapPtrToPtr m_lcid2locale; - FX_WORD m_wDefLCID; + uint16_t m_wDefLCID; }; #endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALEMGR_H_ diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp index 86c78890d8..6bab12be53 100644 --- a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp +++ b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp @@ -606,7 +606,7 @@ FX_BOOL CFWL_ScrollBarImp::SendEvent() { return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); } if (m_iMouseWheel) { - FX_WORD dwCode = + uint16_t dwCode = m_iMouseWheel < 0 ? FWL_SCBCODE_StepForward : FWL_SCBCODE_StepBackward; DoScroll(dwCode, m_fTrackPos); } diff --git a/xfa/fwl/theme/widgettp.cpp b/xfa/fwl/theme/widgettp.cpp index 61b505f8d3..7d3f4626f6 100644 --- a/xfa/fwl/theme/widgettp.cpp +++ b/xfa/fwl/theme/widgettp.cpp @@ -676,13 +676,13 @@ FWLCOLOR CFWL_WidgetTP::BlendColor(FWLCOLOR srcColor, FWLCOLOR dstColor; uint8_t n = 255 - scale; dstColor.a = (uint8_t)( - ((FX_WORD)srcColor.a * n + (FX_WORD)renderColor.a * scale) >> 8); + ((uint16_t)srcColor.a * n + (uint16_t)renderColor.a * scale) >> 8); dstColor.r = (uint8_t)( - ((FX_WORD)srcColor.r * n + (FX_WORD)renderColor.r * scale) >> 8); + ((uint16_t)srcColor.r * n + (uint16_t)renderColor.r * scale) >> 8); dstColor.g = (uint8_t)( - ((FX_WORD)srcColor.g * n + (FX_WORD)renderColor.g * scale) >> 8); + ((uint16_t)srcColor.g * n + (uint16_t)renderColor.g * scale) >> 8); dstColor.b = (uint8_t)( - ((FX_WORD)srcColor.b * n + (FX_WORD)renderColor.b * scale) >> 8); + ((uint16_t)srcColor.b * n + (uint16_t)renderColor.b * scale) >> 8); return dstColor; } CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(NULL) { @@ -714,13 +714,13 @@ CFWL_FontData::~CFWL_FontData() { } FX_BOOL CFWL_FontData::Equal(const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { return m_wsFamily == wsFontFamily && m_dwStyles == dwFontStyles && m_dwCodePage == wCodePage; } FX_BOOL CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD dwCodePage) { + uint16_t dwCodePage) { m_wsFamily = wsFontFamily; m_dwStyles = dwFontStyles; m_dwCodePage = dwCodePage; @@ -751,7 +751,7 @@ CFWL_FontManager::CFWL_FontManager() {} CFWL_FontManager::~CFWL_FontManager() {} IFX_Font* CFWL_FontManager::FindFont(const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { for (const auto& pData : m_FontsArray) { if (pData->Equal(wsFontFamily, dwFontStyles, wCodePage)) return pData->GetFont(); diff --git a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index f091de08b5..1c20b7c8a1 100644 --- a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -183,20 +183,20 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, e = BCExceptionIllegalArgument; return (FX_WCHAR*)""; } - FX_WORD* ecc = FX_Alloc(FX_WORD, numECWords); - FXSYS_memset(ecc, 0, numECWords * sizeof(FX_WORD)); + uint16_t* ecc = FX_Alloc(uint16_t, numECWords); + FXSYS_memset(ecc, 0, numECWords * sizeof(uint16_t)); for (int32_t l = start; l < start + len; l++) { - FX_WORD m = ecc[numECWords - 1] ^ codewords.GetAt(l); + uint16_t m = ecc[numECWords - 1] ^ codewords.GetAt(l); for (int32_t k = numECWords - 1; k > 0; k--) { if (m != 0 && FACTORS[table][k] != 0) { - ecc[k] = (FX_WORD)(ecc[k - 1] ^ - ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]); + ecc[k] = (uint16_t)(ecc[k - 1] ^ + ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]); } else { ecc[k] = ecc[k - 1]; } } if (m != 0 && FACTORS[table][0] != 0) { - ecc[0] = (FX_WORD)ALOG[(LOG[m] + LOG[FACTORS[table][0]]) % 255]; + ecc[0] = (uint16_t)ALOG[(LOG[m] + LOG[FACTORS[table][0]]) % 255]; } else { ecc[0] = 0; } diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp b/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp index d52648c683..04246bd5d8 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp @@ -361,7 +361,7 @@ int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode, if (mode == BYTE_COMPACTION_MODE_LATCH) { int32_t count = 0; int64_t value = 0; - FX_WORD* decodedData = FX_Alloc(FX_WORD, 6); + uint16_t* decodedData = FX_Alloc(uint16_t, 6); CFX_Int32Array byteCompactedCodewords; byteCompactedCodewords.SetSize(6); FX_BOOL end = FALSE; @@ -383,7 +383,7 @@ int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode, if ((count % 5 == 0) && (count > 0)) { int32_t j = 0; for (; j < 6; ++j) { - decodedData[5 - j] = (FX_WORD)(value % 256); + decodedData[5 - j] = (uint16_t)(value % 256); value >>= 8; } for (j = 0; j < 6; ++j) { @@ -398,7 +398,7 @@ int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode, byteCompactedCodewords[count++] = nextCode; } for (int32_t i = 0; i < count; i++) { - result += (FX_CHAR)(FX_WORD)byteCompactedCodewords[i]; + result += (FX_CHAR)(uint16_t)byteCompactedCodewords[i]; } } else if (mode == BYTE_COMPACTION_MODE_LATCH_6) { int32_t count = 0; @@ -422,10 +422,10 @@ int32_t CBC_DecodedBitStreamPaser::byteCompaction(int32_t mode, } } if ((count % 5 == 0) && (count > 0)) { - FX_WORD* decodedData = FX_Alloc(FX_WORD, 6); + uint16_t* decodedData = FX_Alloc(uint16_t, 6); int32_t j = 0; for (; j < 6; ++j) { - decodedData[5 - j] = (FX_WORD)(value & 0xFF); + decodedData[5 - j] = (uint16_t)(value & 0xFF); value >>= 8; } for (j = 0; j < 6; ++j) { diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index d585e279ce..37d363f443 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -1310,7 +1310,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box, const CXFA_StrokeArray& strokes, CFX_RectF rtWidget, CFX_Path& fillPath, - FX_WORD dwFlags) { + uint16_t dwFlags) { if (box.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) { CXFA_Edge edge = box.GetEdge(0); FX_FLOAT fThickness = edge.GetThickness(); diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 5fc3ce97aa..25a291f093 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1765,7 +1765,7 @@ CXFA_DefFontMgr::~CXFA_DefFontMgr() { IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { CFX_WideString wsFontName = wsFontFamily; IFX_FontMgr* pFDEFontMgr = static_cast<CXFA_FFDoc*>(hDoc)->GetApp()->GetFDEFontMgr(); @@ -1809,7 +1809,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(IXFA_Doc* hDoc, IFX_Font* CXFA_DefFontMgr::GetDefaultFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { IFX_FontMgr* pFDEFontMgr = ((CXFA_FFDoc*)hDoc)->GetApp()->GetFDEFontMgr(); IFX_Font* pFont = pFDEFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage); @@ -2021,7 +2021,7 @@ CXFA_FontMgr::~CXFA_FontMgr() { IFX_Font* CXFA_FontMgr::GetFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage) { + uint16_t wCodePage) { FX_DWORD dwHash = FX_HashCode_String_GetW(wsFontFamily.GetPtr(), wsFontFamily.GetLength(), FALSE); CFX_ByteString bsKey; diff --git a/xfa/fxfa/app/xfa_fontmgr.h b/xfa/fxfa/app/xfa_fontmgr.h index 44360796e9..09d42931a5 100644 --- a/xfa/fxfa/app/xfa_fontmgr.h +++ b/xfa/fxfa/app/xfa_fontmgr.h @@ -20,8 +20,8 @@ struct XFA_FONTINFO { FX_DWORD dwFontNameHash; const FX_WCHAR* pPsName; const FX_WCHAR* pReplaceFont; - FX_WORD dwStyles; - FX_WORD wCodePage; + uint16_t dwStyles; + uint16_t wCodePage; }; class CXFA_DefFontMgr : public IXFA_FontMgr { @@ -33,11 +33,11 @@ class CXFA_DefFontMgr : public IXFA_FontMgr { IFX_Font* GetFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) override; + uint16_t wCodePage = 0xFFFF) override; IFX_Font* GetDefaultFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) override; + uint16_t wCodePage = 0xFFFF) override; protected: CFX_PtrArray m_CacheFonts; @@ -83,7 +83,7 @@ class CXFA_FontMgr { IFX_Font* GetFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF); + uint16_t wCodePage = 0xFFFF); void LoadDocFonts(IXFA_Doc* hDoc); void ReleaseDocFonts(IXFA_Doc* hDoc); diff --git a/xfa/fxfa/parser/xfa_basic_data.cpp b/xfa/fxfa/parser/xfa_basic_data.cpp index 58e71debd3..f8a26dc1cd 100644 --- a/xfa/fxfa/parser/xfa_basic_data.cpp +++ b/xfa/fxfa/parser/xfa_basic_data.cpp @@ -2242,7 +2242,7 @@ const XFA_ELEMENTHIERARCHY g_XFAElementChildrenIndex[] = { {228, 0}, {228, 2}, {230, 0}, {230, 0}, {230, 0}, {230, 0}, {230, 0}, {230, 0}, {230, 0}, {230, 0}, {230, 10}, }; -const FX_WORD g_XFAElementChildrenData[] = { +const uint16_t g_XFAElementChildrenData[] = { XFA_ELEMENT_Extras, XFA_ELEMENT_SubformSet, XFA_ELEMENT_BreakBefore, diff --git a/xfa/fxfa/parser/xfa_basic_data.h b/xfa/fxfa/parser/xfa_basic_data.h index 8d36650a87..9bc6dcb23b 100644 --- a/xfa/fxfa/parser/xfa_basic_data.h +++ b/xfa/fxfa/parser/xfa_basic_data.h @@ -26,7 +26,7 @@ extern const XFA_ELEMENTINFO g_XFAElementData[]; extern const int32_t g_iXFAElementCount; extern const XFA_ELEMENTHIERARCHY g_XFAElementChildrenIndex[]; -extern const FX_WORD g_XFAElementChildrenData[]; +extern const uint16_t g_XFAElementChildrenData[]; extern const XFA_ELEMENTHIERARCHY g_XFAElementAttributeIndex[]; extern const uint8_t g_XFAElementAttributeData[]; diff --git a/xfa/fxfa/parser/xfa_basic_imp.cpp b/xfa/fxfa/parser/xfa_basic_imp.cpp index a6d4fc069a..61e2ab629b 100644 --- a/xfa/fxfa/parser/xfa_basic_imp.cpp +++ b/xfa/fxfa/parser/xfa_basic_imp.cpp @@ -213,7 +213,7 @@ const XFA_ELEMENTINFO* XFA_GetElementByName(const CFX_WideStringC& wsName) { const XFA_ELEMENTINFO* XFA_GetElementByID(XFA_ELEMENT eName) { return (eName < g_iXFAElementCount) ? (g_XFAElementData + eName) : NULL; } -const FX_WORD* XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t& iCount) { +const uint16_t* XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t& iCount) { if (eElement >= g_iXFAElementCount) { return NULL; } @@ -252,11 +252,11 @@ const XFA_ELEMENTINFO* XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChild, FX_DWORD dwPacket) { int32_t iCount = 0; - const FX_WORD* pChild = XFA_GetElementChildren(eElement, iCount); + const uint16_t* pChild = XFA_GetElementChildren(eElement, iCount); if (pChild == NULL || iCount < 1) { return NULL; } - CFX_DSPATemplate<FX_WORD> search; + CFX_DSPATemplate<uint16_t> search; int32_t index = search.Lookup(eChild, pChild, iCount); if (index < 0) { return NULL; @@ -604,9 +604,9 @@ int32_t CXFA_WideTextRead::ReadString(FX_WCHAR* pStr, bEOS = IsEOF(); return iMaxLength; } -FX_WORD CXFA_WideTextRead::GetCodePage() const { +uint16_t CXFA_WideTextRead::GetCodePage() const { return (sizeof(FX_WCHAR) == 2) ? FX_CODEPAGE_UTF16LE : FX_CODEPAGE_UTF32LE; } -FX_WORD CXFA_WideTextRead::SetCodePage(FX_WORD wCodePage) { +uint16_t CXFA_WideTextRead::SetCodePage(uint16_t wCodePage) { return GetCodePage(); } diff --git a/xfa/fxfa/parser/xfa_basic_imp.h b/xfa/fxfa/parser/xfa_basic_imp.h index 7e67d2b96e..d0440face1 100644 --- a/xfa/fxfa/parser/xfa_basic_imp.h +++ b/xfa/fxfa/parser/xfa_basic_imp.h @@ -48,8 +48,8 @@ class CXFA_WideTextRead : public IFX_Stream { virtual FX_BOOL SetLength(int32_t iLength) { return FALSE; } virtual int32_t GetBOM(uint8_t bom[4]) const { return 0; } - virtual FX_WORD GetCodePage() const; - virtual FX_WORD SetCodePage(FX_WORD wCodePage); + virtual uint16_t GetCodePage() const; + virtual uint16_t SetCodePage(uint16_t wCodePage); virtual void Lock() {} virtual void Unlock() {} diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index c3ec203fa0..05706d4eb2 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1060,8 +1060,8 @@ static IFX_Locale* XFA_GetLocaleFromBuffer(const uint8_t* pBuf, int nBufLen) { } return NULL; } -static FX_WORD XFA_GetLanguage(CFX_WideString wsLanguage) { - FX_WORD dwLangueID = XFA_LANGID_en_US; +static uint16_t XFA_GetLanguage(CFX_WideString wsLanguage) { + uint16_t dwLangueID = XFA_LANGID_en_US; if (wsLanguage.GetLength() < 2) { return dwLangueID; } @@ -1147,7 +1147,7 @@ CXFA_LocaleMgr::~CXFA_LocaleMgr() { void CXFA_LocaleMgr::Release() { delete this; } -FX_WORD CXFA_LocaleMgr::GetDefLocaleID() { +uint16_t CXFA_LocaleMgr::GetDefLocaleID() { return m_dwDeflcid; } IFX_Locale* CXFA_LocaleMgr::GetDefLocale() { @@ -1163,7 +1163,7 @@ IFX_Locale* CXFA_LocaleMgr::GetDefLocale() { m_XMLLocaleArray.Add(m_pDefLocale); return m_pDefLocale; } -IFX_Locale* CXFA_LocaleMgr::GetLocale(FX_WORD lcid) { +IFX_Locale* CXFA_LocaleMgr::GetLocale(uint16_t lcid) { IFX_Locale* pLocal = NULL; switch (lcid) { case XFA_LANGID_zh_CN: @@ -1236,7 +1236,7 @@ IFX_Locale* CXFA_LocaleMgr::GetLocaleByName( return pLocale; } } - FX_WORD dwLangueID = XFA_GetLanguage(wsLocaleName); + uint16_t dwLangueID = XFA_GetLanguage(wsLocaleName); IFX_Locale* pLocale = GetLocale(dwLangueID); if (pLocale) m_XMLLocaleArray.Add(pLocale); diff --git a/xfa/fxfa/parser/xfa_localemgr.h b/xfa/fxfa/parser/xfa_localemgr.h index e296fc4663..a30d0cc1ad 100644 --- a/xfa/fxfa/parser/xfa_localemgr.h +++ b/xfa/fxfa/parser/xfa_localemgr.h @@ -35,9 +35,9 @@ class CXFA_LocaleMgr : public IFX_LocaleMgr { public: CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid); virtual void Release(); - virtual FX_WORD GetDefLocaleID(); + virtual uint16_t GetDefLocaleID(); virtual IFX_Locale* GetDefLocale(); - virtual IFX_Locale* GetLocale(FX_WORD lcid); + virtual IFX_Locale* GetLocale(uint16_t lcid); virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName); ~CXFA_LocaleMgr(); void SetDefLocale(IFX_Locale* pLocale); @@ -48,8 +48,8 @@ class CXFA_LocaleMgr : public IFX_LocaleMgr { CFX_PtrArray m_XMLLocaleArray; IFX_Locale* m_pDefLocale; CFX_WideString m_wsConfigLocale; - FX_WORD m_dwDeflcid; - FX_WORD m_dwLocaleFlags; + uint16_t m_dwDeflcid; + uint16_t m_dwLocaleFlags; }; class IXFA_TimeZoneProvider { diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index 8b3efa5951..b7ee9d48ad 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -591,16 +591,16 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalValue(const CFX_WideString& wsValue, } FX_BOOL CXFA_LocaleValue::ValidateCanonicalDate(const CFX_WideString& wsDate, CFX_Unitime& unDate) { - const FX_WORD LastDay[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - const FX_WORD wCountY = 4, wCountM = 2, wCountD = 2; + const uint16_t LastDay[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + const uint16_t wCountY = 4, wCountM = 2, wCountD = 2; int nLen = wsDate.GetLength(); if (nLen < wCountY || nLen > wCountY + wCountM + wCountD + 2) { return FALSE; } const bool bSymbol = wsDate.Find(0x2D) != -1; - FX_WORD wYear = 0; - FX_WORD wMonth = 0; - FX_WORD wDay = 0; + uint16_t wYear = 0; + uint16_t wMonth = 0; + uint16_t wDay = 0; const FX_WCHAR* pDate = (const FX_WCHAR*)wsDate; int nIndex = 0, nStart = 0; while (pDate[nIndex] != '\0' && nIndex < wCountY) { @@ -678,15 +678,15 @@ FX_BOOL CXFA_LocaleValue::ValidateCanonicalTime(const CFX_WideString& wsTime) { int nLen = wsTime.GetLength(); if (nLen < 2) return FALSE; - const FX_WORD wCountH = 2; - const FX_WORD wCountM = 2; - const FX_WORD wCountS = 2; - const FX_WORD wCountF = 3; + const uint16_t wCountH = 2; + const uint16_t wCountM = 2; + const uint16_t wCountS = 2; + const uint16_t wCountF = 3; const bool bSymbol = wsTime.Find(':') != -1; - FX_WORD wHour = 0; - FX_WORD wMinute = 0; - FX_WORD wSecond = 0; - FX_WORD wFraction = 0; + uint16_t wHour = 0; + uint16_t wMinute = 0; + uint16_t wSecond = 0; + uint16_t wFraction = 0; const FX_WCHAR* pTime = (const FX_WCHAR*)wsTime; int nIndex = 0; int nStart = 0; diff --git a/xfa/fxfa/parser/xfa_object.h b/xfa/fxfa/parser/xfa_object.h index 96dfeee39e..e50d6ab46f 100644 --- a/xfa/fxfa/parser/xfa_object.h +++ b/xfa/fxfa/parser/xfa_object.h @@ -585,7 +585,7 @@ class CXFA_Node : public CXFA_Object { XFA_ATTRIBUTE eAttribute); protected: - CXFA_Node(CXFA_Document* pDoc, FX_WORD ePacket, XFA_ELEMENT eElement); + CXFA_Node(CXFA_Document* pDoc, uint16_t ePacket, XFA_ELEMENT eElement); ~CXFA_Node(); friend class CXFA_Document; CXFA_Node* Deprecated_GetPrevSibling(); @@ -640,7 +640,7 @@ class CXFA_Node : public CXFA_Object { CXFA_Node* m_pParent; IFDE_XMLNode* m_pXMLNode; XFA_ELEMENT m_eNodeClass; - FX_WORD m_ePacket; + uint16_t m_ePacket; FX_DWORD m_dwNameHash; CXFA_Node* m_pAuxNode; XFA_MAPMODULEDATA* m_pMapModuleData; diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index f65e304066..368e919e11 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -85,7 +85,9 @@ static XFA_MAPDATABLOCKCALLBACKINFO deleteWideStringCallBack = { static XFA_OBJECTTYPE XFA_GetElementObjectType(XFA_ELEMENT eElement) { return (XFA_OBJECTTYPE)XFA_GetElementByID(eElement)->eObjectType; } -CXFA_Node::CXFA_Node(CXFA_Document* pDoc, FX_WORD ePacket, XFA_ELEMENT eElement) +CXFA_Node::CXFA_Node(CXFA_Document* pDoc, + uint16_t ePacket, + XFA_ELEMENT eElement) : CXFA_Object(pDoc, XFA_GetElementObjectType(eElement)), m_pNext(nullptr), m_pChild(nullptr), diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index f27e3a6c0f..638ce8b248 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -73,7 +73,7 @@ int32_t CXFA_SimpleParser::StartParse(IFX_FileRead* pStream, if (m_pStream == NULL) { return XFA_PARSESTATUS_StreamErr; } - FX_WORD wCodePage = m_pStream->GetCodePage(); + uint16_t wCodePage = m_pStream->GetCodePage(); if (wCodePage != FX_CODEPAGE_UTF16LE && wCodePage != FX_CODEPAGE_UTF16BE && wCodePage != FX_CODEPAGE_UTF8) { m_pStream->SetCodePage(FX_CODEPAGE_UTF8); diff --git a/xfa/fxfa/parser/xfa_parser_imp.h b/xfa/fxfa/parser/xfa_parser_imp.h index 136cae6744..f01ffa2123 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.h +++ b/xfa/fxfa/parser/xfa_parser_imp.h @@ -119,8 +119,8 @@ class CXFA_XMLParser : public IFDE_XMLParser { FX_FILESIZE m_nStart[2]; size_t m_nSize[2]; FX_FILESIZE m_nElementStart; - FX_WORD m_dwCheckStatus; - FX_WORD m_dwCurrentCheckStatus; + uint16_t m_dwCheckStatus; + uint16_t m_dwCurrentCheckStatus; protected: IFDE_XMLNode* m_pRoot; diff --git a/xfa/include/fwl/theme/widgettp.h b/xfa/include/fwl/theme/widgettp.h index b451d4f373..1585db9ce2 100644 --- a/xfa/include/fwl/theme/widgettp.h +++ b/xfa/include/fwl/theme/widgettp.h @@ -181,10 +181,10 @@ class CFWL_FontData { virtual ~CFWL_FontData(); FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage); + uint16_t wCodePage); FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage); + uint16_t wCodePage); IFX_Font* GetFont() const { return m_pFont; } protected: @@ -205,7 +205,7 @@ class CFWL_FontManager { IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD dwCodePage); + uint16_t dwCodePage); protected: CFWL_FontManager(); diff --git a/xfa/include/fxfa/fxfa.h b/xfa/include/fxfa/fxfa.h index 202d616f07..0015ae443d 100644 --- a/xfa/include/fxfa/fxfa.h +++ b/xfa/include/fxfa/fxfa.h @@ -296,11 +296,11 @@ class IXFA_FontMgr { virtual IFX_Font* GetFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) = 0; + uint16_t wCodePage = 0xFFFF) = 0; virtual IFX_Font* GetDefaultFont(IXFA_Doc* hDoc, const CFX_WideStringC& wsFontFamily, FX_DWORD dwFontStyles, - FX_WORD wCodePage = 0xFFFF) = 0; + uint16_t wCodePage = 0xFFFF) = 0; }; class IXFA_App { public: diff --git a/xfa/include/fxfa/fxfa_basic.h b/xfa/include/fxfa/fxfa_basic.h index dba3522dc4..5c0c5db935 100644 --- a/xfa/include/fxfa/fxfa_basic.h +++ b/xfa/include/fxfa/fxfa_basic.h @@ -969,20 +969,20 @@ CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket); struct XFA_ELEMENTHIERARCHY { - FX_WORD wStart; - FX_WORD wCount; + uint16_t wStart; + uint16_t wCount; }; struct XFA_SCRIPTHIERARCHY { - FX_WORD wMethodStart; - FX_WORD wMethodCount; - FX_WORD wAttributeStart; - FX_WORD wAttributeCount; + uint16_t wMethodStart; + uint16_t wMethodCount; + uint16_t wAttributeStart; + uint16_t wAttributeCount; int16_t wParentIndex; }; typedef XFA_SCRIPTHIERARCHY const* XFA_LPCSCRIPTHIERARCHY; -const FX_WORD* XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t& iCount); +const uint16_t* XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t& iCount); const uint8_t* XFA_GetElementAttributes(XFA_ELEMENT eElement, int32_t& iCount); const XFA_ELEMENTINFO* XFA_GetChildOfElement(XFA_ELEMENT eElement, XFA_ELEMENT eChild, @@ -993,7 +993,7 @@ const XFA_ATTRIBUTEINFO* XFA_GetAttributeOfElement(XFA_ELEMENT eElement, #define XFA_PROPERTYFLAG_OneOf 0x01 #define XFA_PROPERTYFLAG_DefaultOneOf 0x02 struct XFA_PROPERTY { - FX_WORD eName; + uint16_t eName; uint8_t uOccur; uint8_t uFlags; }; @@ -1070,7 +1070,7 @@ struct XFA_SCRIPTATTRIBUTEINFO { const FX_WCHAR* pName; XFA_ATTRIBUTE_CALLBACK lpfnCallback; int32_t eAttribute; - FX_WORD eValueType; + uint16_t eValueType; }; const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName( XFA_ELEMENT eElement, |