Rename FXTEXT_CHARPOS and FXTEXT_GLYPHPOS. To TextCharPos and TextGlyphPos, respectively. Change-Id: I303a90747fc064d2753049766e3a686e99698f64 Reviewed-on: https://pdfium-review.googlesource.com/c/50074 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp index 9e85fca..9c89ba4 100644 --- a/core/fpdfapi/render/cpdf_charposlist.cpp +++ b/core/fpdfapi/render/cpdf_charposlist.cpp
@@ -21,7 +21,7 @@ const std::vector<float>& charPos, CPDF_Font* pFont, float FontSize) { - m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, charCodes.size()); + m_pCharPos = FX_Alloc(TextCharPos, charCodes.size()); m_nChars = 0; CPDF_CIDFont* pCIDFont = pFont->AsCIDFont(); bool bVertWriting = pCIDFont && pCIDFont->IsVertWriting(); @@ -31,7 +31,7 @@ continue; bool bVert = false; - FXTEXT_CHARPOS& charpos = m_pCharPos[m_nChars++]; + TextCharPos& charpos = m_pCharPos[m_nChars++]; if (pCIDFont) charpos.m_bFontStyle = true; WideString unicode = pFont->UnicodeFromCharCode(CharCode);
diff --git a/core/fpdfapi/render/cpdf_charposlist.h b/core/fpdfapi/render/cpdf_charposlist.h index dd7c87b..f2c5f44 100644 --- a/core/fpdfapi/render/cpdf_charposlist.h +++ b/core/fpdfapi/render/cpdf_charposlist.h
@@ -12,7 +12,7 @@ #include "core/fxcrt/fx_system.h" class CPDF_Font; -class FXTEXT_CHARPOS; +class TextCharPos; class CPDF_CharPosList { public: @@ -25,7 +25,7 @@ float font_size); // TODO(thestig): Convert to unique_ptr or vector. - FXTEXT_CHARPOS* m_pCharPos = nullptr; + TextCharPos* m_pCharPos = nullptr; uint32_t m_nChars = 0; };
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index e7e4b4a..5af2af8 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1800,7 +1800,7 @@ FX_ARGB fill_argb = GetFillArgbForType3(textobj); int fill_alpha = FXARGB_A(fill_argb); int device_class = m_pDevice->GetDeviceClass(); - std::vector<FXTEXT_GLYPHPOS> glyphs; + std::vector<TextGlyphPos> glyphs; if (device_class == FXDC_DISPLAY) glyphs.resize(textobj->GetCharCodes().size()); else if (fill_alpha < 255) @@ -1823,7 +1823,7 @@ if (!pType3Char->LoadBitmap(m_pContext.Get())) { if (!glyphs.empty()) { for (size_t i = 0; i < iChar; ++i) { - const FXTEXT_GLYPHPOS& glyph = glyphs[i]; + const TextGlyphPos& glyph = glyphs[i]; if (!glyph.m_pGlyph) continue; @@ -1927,7 +1927,7 @@ return true; pBitmap->Clear(0); - for (const FXTEXT_GLYPHPOS& glyph : glyphs) { + for (const TextGlyphPos& glyph : glyphs) { if (!glyph.m_pGlyph) continue; @@ -1981,7 +1981,7 @@ CharPosList.Load(textobj->GetCharCodes(), textobj->GetCharPositions(), pFont, font_size); for (uint32_t i = 0; i < CharPosList.m_nChars; i++) { - FXTEXT_CHARPOS& charpos = CharPosList.m_pCharPos[i]; + TextCharPos& charpos = CharPosList.m_pCharPos[i]; auto* font = charpos.m_FallbackFontPosition == -1 ? pFont->GetFont() : pFont->GetFontFallback(charpos.m_FallbackFontPosition);
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 9bb159d..ea2a316 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -1144,7 +1144,7 @@ void CFX_AggDeviceDriver::DestroyPlatform() {} bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index 4983dc0..80fbf73 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h
@@ -92,7 +92,7 @@ bool ContinueDIBits(CFX_ImageRenderer* handle, PauseIndicatorIface* pPause) override; bool DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp index 072e489..5d385f8 100644 --- a/core/fxge/apple/fx_apple_platform.cpp +++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -32,7 +32,7 @@ bool CGDrawGlyphRun(CGContextRef pContext, int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -104,7 +104,7 @@ } bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp index 3118b93..a61f5fc 100644 --- a/core/fxge/cfx_renderdevice.cpp +++ b/core/fxge/cfx_renderdevice.cpp
@@ -29,19 +29,19 @@ namespace { -void AdjustGlyphSpace(std::vector<FXTEXT_GLYPHPOS>* pGlyphAndPos) { +void AdjustGlyphSpace(std::vector<TextGlyphPos>* pGlyphAndPos) { ASSERT(pGlyphAndPos->size() > 1); - std::vector<FXTEXT_GLYPHPOS>& glyphs = *pGlyphAndPos; + std::vector<TextGlyphPos>& glyphs = *pGlyphAndPos; bool bVertical = glyphs.back().m_Origin.x == glyphs.front().m_Origin.x; if (!bVertical && (glyphs.back().m_Origin.y != glyphs.front().m_Origin.y)) return; for (size_t i = glyphs.size() - 1; i > 1; --i) { - FXTEXT_GLYPHPOS& next = glyphs[i]; + TextGlyphPos& next = glyphs[i]; int next_origin = bVertical ? next.m_Origin.y : next.m_Origin.x; float next_origin_f = bVertical ? next.m_fOrigin.y : next.m_fOrigin.x; - FXTEXT_GLYPHPOS& current = glyphs[i - 1]; + TextGlyphPos& current = glyphs[i - 1]; int& current_origin = bVertical ? current.m_Origin.y : current.m_Origin.x; float current_origin_f = bVertical ? current.m_fOrigin.y : current.m_fOrigin.x; @@ -351,7 +351,7 @@ } // namespace -FXTEXT_CHARPOS::FXTEXT_CHARPOS() +TextCharPos::TextCharPos() : m_Unicode(0), m_GlyphIndex(0), m_FontCharWidth(0), @@ -363,9 +363,9 @@ m_bFontStyle(false) { } -FXTEXT_CHARPOS::FXTEXT_CHARPOS(const FXTEXT_CHARPOS&) = default; +TextCharPos::TextCharPos(const TextCharPos&) = default; -FXTEXT_CHARPOS::~FXTEXT_CHARPOS() = default; +TextCharPos::~TextCharPos() = default; CFX_RenderDevice::CFX_RenderDevice() = default; @@ -854,7 +854,7 @@ #endif bool CFX_RenderDevice::DrawNormalText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, float font_size, const CFX_Matrix* pText2Device, @@ -922,12 +922,12 @@ } } } - std::vector<FXTEXT_GLYPHPOS> glyphs(nChars); + std::vector<TextGlyphPos> glyphs(nChars); CFX_Matrix deviceCtm = char2device; for (size_t i = 0; i < glyphs.size(); ++i) { - FXTEXT_GLYPHPOS& glyph = glyphs[i]; - const FXTEXT_CHARPOS& charpos = pCharPos[i]; + TextGlyphPos& glyph = glyphs[i]; + const TextCharPos& charpos = pCharPos[i]; glyph.m_fOrigin = text2Device.Transform(charpos.m_Origin); if (anti_alias < FXFT_RENDER_MODE_LCD) @@ -967,7 +967,7 @@ if (!bitmap->Create(pixel_width, pixel_height, FXDIB_1bppMask)) return false; bitmap->Clear(0); - for (const FXTEXT_GLYPHPOS& glyph : glyphs) { + for (const TextGlyphPos& glyph : glyphs) { if (!glyph.m_pGlyph) continue; const RetainPtr<CFX_DIBitmap>& pGlyph = glyph.m_pGlyph->GetBitmap(); @@ -1003,7 +1003,7 @@ if (anti_alias == FXFT_RENDER_MODE_LCD) std::tie(a, r, g, b) = ArgbDecode(fill_color); - for (const FXTEXT_GLYPHPOS& glyph : glyphs) { + for (const TextGlyphPos& glyph : glyphs) { if (!glyph.m_pGlyph) continue; @@ -1057,7 +1057,7 @@ } bool CFX_RenderDevice::DrawTextPath(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, float font_size, const CFX_Matrix* pText2User, @@ -1068,7 +1068,7 @@ CFX_PathData* pClippingPath, int nFlag) { for (int iChar = 0; iChar < nChars; ++iChar) { - const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; + const TextCharPos& charpos = pCharPos[iChar]; CFX_Matrix matrix; if (charpos.m_bGlyphAdjust) { matrix = CFX_Matrix(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index d16188b..7327abb 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h
@@ -69,11 +69,11 @@ enum class FXPT_TYPE : uint8_t { LineTo, BezierTo, MoveTo }; -class FXTEXT_CHARPOS { +class TextCharPos { public: - FXTEXT_CHARPOS(); - FXTEXT_CHARPOS(const FXTEXT_CHARPOS&); - ~FXTEXT_CHARPOS(); + TextCharPos(); + TextCharPos(const TextCharPos&); + ~TextCharPos(); CFX_PointF m_Origin; uint32_t m_Unicode; @@ -217,14 +217,14 @@ bool ContinueDIBits(CFX_ImageRenderer* handle, PauseIndicatorIface* pPause); bool DrawNormalText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, float font_size, const CFX_Matrix* pText2Device, uint32_t fill_color, uint32_t text_flags); bool DrawTextPath(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, float font_size, const CFX_Matrix* pText2User,
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h index 2910a86..219fe9a 100644 --- a/core/fxge/fx_font.h +++ b/core/fxge/fx_font.h
@@ -81,18 +81,18 @@ RetainPtr<CFX_DIBitmap> m_pBitmap; }; -class FXTEXT_GLYPHPOS { +class TextGlyphPos { public: - FXTEXT_GLYPHPOS(); - FXTEXT_GLYPHPOS(const FXTEXT_GLYPHPOS&); - ~FXTEXT_GLYPHPOS(); + TextGlyphPos(); + TextGlyphPos(const TextGlyphPos&); + ~TextGlyphPos(); const CFX_GlyphBitmap* m_pGlyph; CFX_Point m_Origin; CFX_PointF m_fOrigin; }; -FX_RECT FXGE_GetGlyphsBBox(const std::vector<FXTEXT_GLYPHPOS>& glyphs, +FX_RECT FXGE_GetGlyphsBBox(const std::vector<TextGlyphPos>& glyphs, int anti_alias); ByteString GetNameFromTT(const uint8_t* name_table,
diff --git a/core/fxge/fx_ge_text.cpp b/core/fxge/fx_ge_text.cpp index 16e6d9c..df65e09 100644 --- a/core/fxge/fx_ge_text.cpp +++ b/core/fxge/fx_ge_text.cpp
@@ -28,11 +28,11 @@ } // namespace -FXTEXT_GLYPHPOS::FXTEXT_GLYPHPOS() : m_pGlyph(nullptr) {} +TextGlyphPos::TextGlyphPos() : m_pGlyph(nullptr) {} -FXTEXT_GLYPHPOS::FXTEXT_GLYPHPOS(const FXTEXT_GLYPHPOS&) = default; +TextGlyphPos::TextGlyphPos(const TextGlyphPos&) = default; -FXTEXT_GLYPHPOS::~FXTEXT_GLYPHPOS(){}; +TextGlyphPos::~TextGlyphPos() {} ScopedFontTransform::ScopedFontTransform(FT_Face face, FXFT_Matrix* matrix) : m_Face(face) { @@ -43,11 +43,11 @@ ResetTransform(m_Face); } -FX_RECT FXGE_GetGlyphsBBox(const std::vector<FXTEXT_GLYPHPOS>& glyphs, +FX_RECT FXGE_GetGlyphsBBox(const std::vector<TextGlyphPos>& glyphs, int anti_alias) { FX_RECT rect(0, 0, 0, 0); bool bStarted = false; - for (const FXTEXT_GLYPHPOS& glyph : glyphs) { + for (const TextGlyphPos& glyph : glyphs) { const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph; if (!pGlyph) continue;
diff --git a/core/fxge/renderdevicedriver_iface.cpp b/core/fxge/renderdevicedriver_iface.cpp index fbd4335..26b8e1d 100644 --- a/core/fxge/renderdevicedriver_iface.cpp +++ b/core/fxge/renderdevicedriver_iface.cpp
@@ -58,7 +58,7 @@ } bool RenderDeviceDriverIface::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h index 5282cbe..f63cca8 100644 --- a/core/fxge/renderdevicedriver_iface.h +++ b/core/fxge/renderdevicedriver_iface.h
@@ -14,16 +14,16 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxge/fx_dib.h" -class CFX_DIBitmap; class CFX_DIBBase; +class CFX_DIBitmap; class CFX_Font; class CFX_GraphStateData; class CFX_ImageRenderer; class CFX_Matrix; class CFX_PathData; class CPDF_ShadingPattern; -class FXTEXT_CHARPOS; class PauseIndicatorIface; +class TextCharPos; struct FX_RECT; class RenderDeviceDriverIface { @@ -89,7 +89,7 @@ virtual bool ContinueDIBits(CFX_ImageRenderer* handle, PauseIndicatorIface* pPause); virtual bool DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index d357e50..e638078 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp
@@ -781,14 +781,14 @@ } bool HasRSX(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, float* scaleXPtr, bool* oneAtATimePtr) { bool useRSXform = false; bool oneAtATime = false; float scaleX = 1; for (int index = 0; index < nChars; ++index) { - const FXTEXT_CHARPOS& cp = pCharPos[index]; + const TextCharPos& cp = pCharPos[index]; if (!cp.m_bGlyphAdjust) continue; bool upright = 0 == cp.m_AdjustMatrix[1] && 0 == cp.m_AdjustMatrix[2]; @@ -813,7 +813,7 @@ } bool DrawText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pMatrix, float font_size, @@ -860,7 +860,7 @@ if (pFont->IsVertical()) vFlip *= -1; for (int index = 0; index < nChars; ++index) { - const FXTEXT_CHARPOS& cp = pCharPos[index]; + const TextCharPos& cp = pCharPos[index]; m_positions[index + count] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip}; m_glyphs[index + count] = static_cast<uint16_t>(cp.m_GlyphIndex); @@ -876,7 +876,7 @@ } if (hasRSX) { for (int index = 0; index < nChars; ++index) { - const FXTEXT_CHARPOS& cp = pCharPos[index]; + const TextCharPos& cp = pCharPos[index]; SkRSXform* rsxform = &m_rsxform[index + count]; if (cp.m_bGlyphAdjust) { rsxform->fSCos = cp.m_AdjustMatrix[0]; @@ -1539,7 +1539,7 @@ } bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -1571,7 +1571,7 @@ bool useRSXform = false; bool oneAtATime = false; for (int index = 0; index < nChars; ++index) { - const FXTEXT_CHARPOS& cp = pCharPos[index]; + const TextCharPos& cp = pCharPos[index]; positions[index] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip}; if (cp.m_bGlyphAdjust) { useRSXform = true; @@ -1603,7 +1603,7 @@ SkTDArray<SkRSXform> xforms; xforms.setCount(nChars); for (int index = 0; index < nChars; ++index) { - const FXTEXT_CHARPOS& cp = pCharPos[index]; + const TextCharPos& cp = pCharPos[index]; SkRSXform* rsxform = &xforms[index]; if (cp.m_bGlyphAdjust) { rsxform->fSCos = cp.m_AdjustMatrix[0]; @@ -1621,7 +1621,7 @@ nullptr, paint); } else if (oneAtATime) { for (int index = 0; index < nChars; ++index) { - const FXTEXT_CHARPOS& cp = pCharPos[index]; + const TextCharPos& cp = pCharPos[index]; if (cp.m_bGlyphAdjust) { if (0 == cp.m_AdjustMatrix[1] && 0 == cp.m_AdjustMatrix[2] && 1 == cp.m_AdjustMatrix[3]) {
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 968e8c0..ebaa756 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h
@@ -14,13 +14,13 @@ #include "core/fxge/renderdevicedriver_iface.h" class CFX_ClipRgn; -class FXTEXT_CHARPOS; class SkCanvas; class SkMatrix; class SkPaint; class SkPath; class SkPictureRecorder; class SkiaState; +class TextCharPos; struct SkIRect; class CFX_SkiaDeviceDriver final : public RenderDeviceDriverIface { @@ -131,7 +131,7 @@ BlendMode blend_type); bool DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/skia/fx_skia_device_embeddertest.cpp b/core/fxge/skia/fx_skia_device_embeddertest.cpp index 0a3a8ec..26ab239 100644 --- a/core/fxge/skia/fx_skia_device_embeddertest.cpp +++ b/core/fxge/skia/fx_skia_device_embeddertest.cpp
@@ -35,7 +35,7 @@ } void CommonTest(CFX_SkiaDeviceDriver* driver, const State& state) { - FXTEXT_CHARPOS charPos[1]; + TextCharPos charPos[1]; charPos[0].m_Origin = CFX_PointF(0, 1); charPos[0].m_GlyphIndex = 1; charPos[0].m_FontCharWidth = 4u;
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index fbf4ebe..f2050c3 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -528,7 +528,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, - const FXTEXT_CHARPOS& charpos, + const TextCharPos& charpos, int* ps_fontnum, int* ps_glyphindex) { int i = 0; @@ -634,7 +634,7 @@ } bool CFX_PSRenderer::DrawText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/core/fxge/win32/cfx_psrenderer.h b/core/fxge/win32/cfx_psrenderer.h index 7ddbd41..ee95a4a 100644 --- a/core/fxge/win32/cfx_psrenderer.h +++ b/core/fxge/win32/cfx_psrenderer.h
@@ -25,7 +25,7 @@ class CFX_Matrix; class CFX_PathData; class CPSFont; -class FXTEXT_CHARPOS; +class TextCharPos; struct FXDIB_ResampleOptions; class CFX_PSRenderer { @@ -71,7 +71,7 @@ const CFX_Matrix& matrix, const FXDIB_ResampleOptions& options); bool DrawText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -84,7 +84,7 @@ void SetColor(uint32_t color); void FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, - const FXTEXT_CHARPOS& charpos, + const TextCharPos& charpos, int* ps_fontnum, int* ps_glyphindex); void WritePSBinary(const uint8_t* data, int len);
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index ab4a850..57cacdf 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp
@@ -198,7 +198,7 @@ } bool CGdiPrinterDriver::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -293,7 +293,7 @@ for (int i = 0; i < nChars; ++i) { // Only works with PDFs from Skia's PDF generator. Cannot handle arbitrary // values from PDFs. - const FXTEXT_CHARPOS& charpos = pCharPos[i]; + const TextCharPos& charpos = pCharPos[i]; ASSERT(charpos.m_AdjustMatrix[0] == 0); ASSERT(charpos.m_AdjustMatrix[1] == 0); ASSERT(charpos.m_AdjustMatrix[2] == 0); @@ -501,7 +501,7 @@ } bool CPSPrinterDriver::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -610,7 +610,7 @@ } bool CTextOnlyPrinterDriver::DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -643,7 +643,7 @@ for (int i = 0; i < nChars; ++i) { // Only works with PDFs from Skia's PDF generator. Cannot handle arbitrary // values from PDFs. - const FXTEXT_CHARPOS& charpos = pCharPos[i]; + const TextCharPos& charpos = pCharPos[i]; ASSERT(charpos.m_AdjustMatrix[0] == 0); ASSERT(charpos.m_AdjustMatrix[1] == 0); ASSERT(charpos.m_AdjustMatrix[2] == 0);
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index 5184bbd..75dff0c 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h
@@ -21,7 +21,7 @@ class CCodec_ModuleMgr; class CFX_ImageRenderer; -class FXTEXT_CHARPOS; +class TextCharPos; struct WINDIB_Open_Args_; RetainPtr<CFX_DIBitmap> FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, @@ -195,7 +195,7 @@ std::unique_ptr<CFX_ImageRenderer>* handle, BlendMode blend_type) override; bool DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -257,7 +257,7 @@ std::unique_ptr<CFX_ImageRenderer>* handle, BlendMode blend_type) override; bool DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size, @@ -320,7 +320,7 @@ std::unique_ptr<CFX_ImageRenderer>* handle, BlendMode blend_type) override; bool DrawDeviceText(int nChars, - const FXTEXT_CHARPOS* pCharPos, + const TextCharPos* pCharPos, CFX_Font* pFont, const CFX_Matrix* pObject2Device, float font_size,
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp index 591ed4c..b4d85b4 100644 --- a/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -103,7 +103,7 @@ } void CBC_OneDimWriter::CalcTextInfo(const ByteString& text, - FXTEXT_CHARPOS* charPos, + TextCharPos* charPos, CFX_Font* cFont, float geWidth, int32_t fontSize, @@ -152,7 +152,7 @@ const CFX_Matrix* matrix, const ByteString str, float geWidth, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, float locX, float locY, int32_t barWidth) { @@ -184,7 +184,7 @@ return false; ByteString str = FX_UTF8Encode(contents); - std::vector<FXTEXT_CHARPOS> charpos(str.GetLength()); + std::vector<TextCharPos> charpos(str.GetLength()); float charsLen = 0; float geWidth = 0; if (m_locTextLoc == BC_TEXT_LOC_ABOVEEMBED ||
diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h index b4dcd65..9a28479 100644 --- a/fxbarcode/oned/BC_OneDimWriter.h +++ b/fxbarcode/oned/BC_OneDimWriter.h
@@ -18,7 +18,7 @@ class CFX_Font; class CFX_PathData; class CFX_RenderDevice; -class FXTEXT_CHARPOS; +class TextCharPos; class CBC_OneDimWriter : public CBC_Writer { public: @@ -64,12 +64,12 @@ const CFX_Matrix* matrix, const ByteString str, float geWidth, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, float locX, float locY, int32_t barWidth); void CalcTextInfo(const ByteString& text, - FXTEXT_CHARPOS* charPos, + TextCharPos* charPos, CFX_Font* cFont, float geWidth, int32_t fontSize,
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp index f302f40..71b2b50 100644 --- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -136,7 +136,7 @@ int32_t leftPosition = 3 * multiple + leftPadding; ByteString str = FX_UTF8Encode(contents); size_t length = str.GetLength(); - std::vector<FXTEXT_CHARPOS> charpos(length); + std::vector<TextCharPos> charpos(length); int32_t iFontSize = (int32_t)fabs(m_fFontSize); int32_t iTextHeight = iFontSize + 1; ByteString tempStr = str.Mid(1, 6);
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 9e15157..b7b253a 100644 --- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -135,7 +135,7 @@ int32_t leftPosition = 3 * multiple; ByteString str = FX_UTF8Encode(contents); size_t iLength = str.GetLength(); - std::vector<FXTEXT_CHARPOS> charpos(iLength); + std::vector<TextCharPos> charpos(iLength); ByteString tempStr = str.Left(4); size_t iLen = tempStr.GetLength(); int32_t strWidth = 7 * multiple * 4;
diff --git a/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 36ce028..049f981 100644 --- a/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -114,7 +114,7 @@ int32_t leftPosition = 10 * multiple + leftPadding; ByteString str = FX_UTF8Encode(contents); size_t length = str.GetLength(); - std::vector<FXTEXT_CHARPOS> charpos(length); + std::vector<TextCharPos> charpos(length); ByteString tempStr = str.Mid(1, 5); float strWidth = (float)35 * multiple; float blank = 0.0;
diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp index 7610457..de797a4 100644 --- a/xfa/fde/cfde_texteditengine.cpp +++ b/xfa/fde/cfde_texteditengine.cpp
@@ -1054,10 +1054,10 @@ return text_break_.GetCharRects(&tr, false); } -std::vector<FXTEXT_CHARPOS> CFDE_TextEditEngine::GetDisplayPos( +std::vector<TextCharPos> CFDE_TextEditEngine::GetDisplayPos( const FDE_TEXTEDITPIECE& piece) { if (piece.nCount < 1) - return std::vector<FXTEXT_CHARPOS>(); + return std::vector<TextCharPos>(); CFX_TxtBreak::Run tr; tr.pEdtEngine = this; @@ -1069,7 +1069,7 @@ tr.dwCharStyles = piece.dwCharStyles; tr.pRect = &piece.rtPiece; - std::vector<FXTEXT_CHARPOS> data(text_break_.GetDisplayPos(&tr, nullptr)); + std::vector<TextCharPos> data(text_break_.GetDisplayPos(&tr, nullptr)); text_break_.GetDisplayPos(&tr, data.data()); return data; }
diff --git a/xfa/fde/cfde_texteditengine.h b/xfa/fde/cfde_texteditengine.h index 01adc3d..c50c2aa 100644 --- a/xfa/fde/cfde_texteditengine.h +++ b/xfa/fde/cfde_texteditengine.h
@@ -178,7 +178,7 @@ return text_piece_info_; } - std::vector<FXTEXT_CHARPOS> GetDisplayPos(const FDE_TEXTEDITPIECE& info); + std::vector<TextCharPos> GetDisplayPos(const FDE_TEXTEDITPIECE& info); void SetMaxEditOperationsForTesting(size_t max);
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp index abec976..43d533c 100644 --- a/xfa/fde/cfde_textout.cpp +++ b/xfa/fde/cfde_textout.cpp
@@ -37,7 +37,7 @@ bool CFDE_TextOut::DrawString(CFX_RenderDevice* device, FX_ARGB color, const RetainPtr<CFGAS_GEFont>& pFont, - pdfium::span<FXTEXT_CHARPOS> pCharPos, + pdfium::span<TextCharPos> pCharPos, float fFontSize, const CFX_Matrix* pMatrix) { ASSERT(pFont); @@ -64,7 +64,7 @@ #endif // _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ RetainPtr<CFGAS_GEFont> pCurFont; - FXTEXT_CHARPOS* pCurCP = nullptr; + TextCharPos* pCurCP = nullptr; int32_t iCurCount = 0; for (auto& pos : pCharPos) { RetainPtr<CFGAS_GEFont> pSTFont = @@ -505,7 +505,7 @@ ASSERT(pPiece->iChars >= 0); if (pdfium::CollectionSize<int32_t>(m_CharPos) < pPiece->iChars) - m_CharPos.resize(pPiece->iChars, FXTEXT_CHARPOS()); + m_CharPos.resize(pPiece->iChars, TextCharPos()); CFX_TxtBreak::Run tr; tr.wsStr = m_wsText + pPiece->iStartChar;
diff --git a/xfa/fde/cfde_textout.h b/xfa/fde/cfde_textout.h index b6b0127..9a386b7 100644 --- a/xfa/fde/cfde_textout.h +++ b/xfa/fde/cfde_textout.h
@@ -38,7 +38,7 @@ static bool DrawString(CFX_RenderDevice* device, FX_ARGB color, const RetainPtr<CFGAS_GEFont>& pFont, - pdfium::span<FXTEXT_CHARPOS> pCharPos, + pdfium::span<TextCharPos> pCharPos, float fFontSize, const CFX_Matrix* pMatrix); @@ -114,7 +114,7 @@ int32_t m_iCurLine = 0; int32_t m_iCurPiece = 0; int32_t m_iTotalLines = 0; - std::vector<FXTEXT_CHARPOS> m_CharPos; + std::vector<TextCharPos> m_CharPos; }; #endif // XFA_FDE_CFDE_TEXTOUT_H_
diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp index a872993..407d574 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak.cpp
@@ -716,7 +716,7 @@ } int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, bool bCharCode) const { if (!pText || pText->iLength < 1) return 0;
diff --git a/xfa/fgas/layout/cfx_rtfbreak.h b/xfa/fgas/layout/cfx_rtfbreak.h index ac29ef5..7af369f 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.h +++ b/xfa/fgas/layout/cfx_rtfbreak.h
@@ -17,7 +17,7 @@ #include "xfa/fxfa/cxfa_textuserdata.h" class CFGAS_GEFont; -class FXTEXT_CHARPOS; +class TextCharPos; enum class CFX_RTFLineAlignment { Left = 0, @@ -58,7 +58,7 @@ CFX_BreakType EndBreak(CFX_BreakType dwStatus); int32_t GetDisplayPos(const FX_RTFTEXTOBJ* pText, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, bool bCharCode) const; CFX_BreakType AppendChar(wchar_t wch);
diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp index 7824643..537de71 100644 --- a/xfa/fgas/layout/cfx_txtbreak.cpp +++ b/xfa/fgas/layout/cfx_txtbreak.cpp
@@ -657,7 +657,7 @@ }; size_t CFX_TxtBreak::GetDisplayPos(const Run* pTxtRun, - FXTEXT_CHARPOS* pCharPos) const { + TextCharPos* pCharPos) const { if (!pTxtRun || pTxtRun->iLength < 1) return 0;
diff --git a/xfa/fgas/layout/cfx_txtbreak.h b/xfa/fgas/layout/cfx_txtbreak.h index e9ed2d1..7f3d4ac 100644 --- a/xfa/fgas/layout/cfx_txtbreak.h +++ b/xfa/fgas/layout/cfx_txtbreak.h
@@ -15,7 +15,7 @@ #include "xfa/fgas/layout/cfx_char.h" class CFGAS_GEFont; -class FXTEXT_CHARPOS; +class TextCharPos; #define FX_TXTCHARSTYLE_ArabicShadda 0x0020 #define FX_TXTCHARSTYLE_OddBidiLevel 0x0040 @@ -69,7 +69,7 @@ void SetCombWidth(float fCombWidth); CFX_BreakType EndBreak(CFX_BreakType dwStatus); - size_t GetDisplayPos(const Run* pTxtRun, FXTEXT_CHARPOS* pCharPos) const; + size_t GetDisplayPos(const Run* pTxtRun, TextCharPos* pCharPos) const; std::vector<CFX_RectF> GetCharRects(const Run* pTxtRun, bool bCharBBox) const; CFX_BreakType AppendChar(wchar_t wch);
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index 96b4d97..f17457b 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp
@@ -459,7 +459,7 @@ if (!rtDocClip.IntersectWith(info.rtPiece)) continue; - std::vector<FXTEXT_CHARPOS> char_pos = m_EdtEngine.GetDisplayPos(info); + std::vector<TextCharPos> char_pos = m_EdtEngine.GetDisplayPos(info); if (char_pos.empty()) continue;
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index c0d867f..89ba07e 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -580,7 +580,7 @@ Layout(i); } - FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, 1); + TextCharPos* pCharPos = FX_Alloc(TextCharPos, 1); // TODO(thestig): Make this size_t. int32_t iCharCount = 1; size_t szLineStart = 0; @@ -603,10 +603,10 @@ const CXFA_TextPiece* pPiece = pPieceLine->m_textPieces[j].get(); int32_t iChars = pPiece->iChars; if (iCharCount < iChars) { - pCharPos = FX_Realloc(FXTEXT_CHARPOS, pCharPos, iChars); + pCharPos = FX_Realloc(TextCharPos, pCharPos, iChars); iCharCount = iChars; } - memset(pCharPos, 0, iCharCount * sizeof(FXTEXT_CHARPOS)); + memset(pCharPos, 0, iCharCount * sizeof(TextCharPos)); RenderString(pFxDevice, pPieceLine, j, pCharPos, tmDoc2Device); } for (size_t j = 0; j < pPieceLine->m_textPieces.size(); ++j) @@ -1126,7 +1126,7 @@ void CXFA_TextLayout::RenderString(CFX_RenderDevice* pDevice, CXFA_PieceLine* pPieceLine, size_t szPiece, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, const CFX_Matrix& tmDoc2Device) { const CXFA_TextPiece* pPiece = pPieceLine->m_textPieces[szPiece].get(); size_t szCount = GetDisplayPos(pPiece, pCharPos); @@ -1141,7 +1141,7 @@ void CXFA_TextLayout::RenderPath(CFX_RenderDevice* pDevice, CXFA_PieceLine* pPieceLine, size_t szPiece, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, const CFX_Matrix& tmDoc2Device) { CXFA_TextPiece* pPiece = pPieceLine->m_textPieces[szPiece].get(); bool bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2; @@ -1260,7 +1260,7 @@ } size_t CXFA_TextLayout::GetDisplayPos(const CXFA_TextPiece* pPiece, - FXTEXT_CHARPOS* pCharPos) { + TextCharPos* pCharPos) { if (!pPiece) return 0;
diff --git a/xfa/fxfa/cxfa_textlayout.h b/xfa/fxfa/cxfa_textlayout.h index 1739a72..c7fcf81 100644 --- a/xfa/fxfa/cxfa_textlayout.h +++ b/xfa/fxfa/cxfa_textlayout.h
@@ -27,7 +27,7 @@ class CXFA_TextPiece; class CXFA_TextProvider; class CXFA_TextTabstopsContext; -class FXTEXT_CHARPOS; +class TextCharPos; struct CXFA_LoaderContext; struct FX_RTFTEXTOBJ; @@ -104,14 +104,14 @@ void RenderString(CFX_RenderDevice* pDevice, CXFA_PieceLine* pPieceLine, size_t szPiece, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, const CFX_Matrix& tmDoc2Device); void RenderPath(CFX_RenderDevice* pDevice, CXFA_PieceLine* pPieceLine, size_t szPiece, - FXTEXT_CHARPOS* pCharPos, + TextCharPos* pCharPos, const CFX_Matrix& tmDoc2Device); - size_t GetDisplayPos(const CXFA_TextPiece* pPiece, FXTEXT_CHARPOS* pCharPos); + size_t GetDisplayPos(const CXFA_TextPiece* pPiece, TextCharPos* pCharPos); bool ToRun(const CXFA_TextPiece* pPiece, FX_RTFTEXTOBJ* tr); void DoTabstops(CFX_CSSComputedStyle* pStyle, CXFA_PieceLine* pPieceLine); bool Layout(int32_t iBlock);