summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_edit_impl.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-04 21:13:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-04 21:13:59 +0000
commit7cabaf136b2aa671768c9d8ee3645c9444afc700 (patch)
tree4aec57e31e1a7207e8009e9d33c9b738a3e8288b /fpdfsdk/pwl/cpwl_edit_impl.cpp
parentce6eb642dbaf96fc2a9d4e97a205a0a12e7154a4 (diff)
downloadpdfium-7cabaf136b2aa671768c9d8ee3645c9444afc700.tar.xz
CPDF_VariableText::m_nHorzScale is always 100
Remove the member and simplify logic in all the places this is passed. Change-Id: I39b979793fe84f0dc460261223655dd7f50555cc Reviewed-on: https://pdfium-review.googlesource.com/c/43474 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_edit_impl.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_edit_impl.cpp34
1 files changed, 9 insertions, 25 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index fb0e8afa16..c0eccfec8e 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -43,26 +43,17 @@ void DrawTextString(CFX_RenderDevice* pDevice,
float fFontSize,
const CFX_Matrix& mtUser2Device,
const ByteString& str,
- FX_ARGB crTextFill,
- int32_t nHorzScale) {
+ FX_ARGB crTextFill) {
if (!pFont)
return;
CFX_PointF pos = mtUser2Device.Transform(pt);
- CFX_Matrix mt;
- if (nHorzScale == 100) {
- mt = mtUser2Device;
- } else {
- mt = CFX_Matrix(nHorzScale / 100.0f, 0, 0, 1, 0, 0);
- mt.Concat(mtUser2Device);
- }
-
CPDF_RenderOptions ro;
ro.SetFlags(RENDER_CLEARTYPE);
-
ro.SetColorMode(CPDF_RenderOptions::kNormal);
CPDF_TextRenderer::DrawTextString(pDevice, pos.x, pos.y, pFont, fFontSize,
- &mt, str, crTextFill, nullptr, &ro);
+ mtUser2Device, str, crTextFill, nullptr,
+ &ro);
}
} // namespace
@@ -437,11 +428,8 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice,
uint16_t SubWord = pEdit->GetPasswordChar();
float fFontSize = pEdit->GetFontSize();
CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
- int32_t nHorzScale = pEdit->GetHorzScale();
-
FX_COLORREF crCurFill = crTextFill;
FX_COLORREF crOldFill = crCurFill;
-
bool bSelect = false;
const FX_COLORREF crWhite = ArgbEncode(255, 255, 255, 255);
const FX_COLORREF crSelBK = ArgbEncode(255, 0, 51, 113);
@@ -504,10 +492,10 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice,
if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex ||
crOldFill != crCurFill) {
if (sTextBuf.tellp() > 0) {
- DrawTextString(
- pDevice, CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
- pFontMap->GetPDFFont(nFontIndex), fFontSize, mtUser2Device,
- ByteString(sTextBuf), crOldFill, nHorzScale);
+ DrawTextString(pDevice,
+ CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
+ pFontMap->GetPDFFont(nFontIndex), fFontSize,
+ mtUser2Device, ByteString(sTextBuf), crOldFill);
sTextBuf.str("");
}
@@ -524,7 +512,7 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice,
CFX_PointF(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y),
pFontMap->GetPDFFont(word.nFontIndex), fFontSize, mtUser2Device,
pEdit->GetPDFWordString(word.nFontIndex, word.Word, SubWord),
- crCurFill, nHorzScale);
+ crCurFill);
}
oldplace = place;
}
@@ -534,7 +522,7 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice,
DrawTextString(pDevice,
CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
pFontMap->GetPDFFont(nFontIndex), fFontSize, mtUser2Device,
- ByteString(sTextBuf), crOldFill, nHorzScale);
+ ByteString(sTextBuf), crOldFill);
}
}
@@ -829,10 +817,6 @@ CFX_FloatRect CPWL_EditImpl::GetContentRect() const {
return VTToEdit(m_pVT->GetContentRect());
}
-int32_t CPWL_EditImpl::GetHorzScale() const {
- return m_pVT->GetHorzScale();
-}
-
float CPWL_EditImpl::GetCharSpace() const {
return m_pVT->GetCharSpace();
}