diff options
author | tsepez <tsepez@chromium.org> | 2016-05-13 17:51:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-13 17:51:27 -0700 |
commit | 71a452f8ce12e31cc4e0d8c7878567b0c7fc63c2 (patch) | |
tree | a0ee545eb67b14f9398df98196d88e5150893ce8 /fpdfsdk/fxedit/fxet_pageobjs.cpp | |
parent | afe94306e3c542f0d499e7f7706ee5dec4028d8a (diff) | |
download | pdfium-71a452f8ce12e31cc4e0d8c7878567b0c7fc63c2.tar.xz |
Make CFX_ByteString(const CFX_ByteStringC&) explicit.
Add missing helper function to CFX_ByteTextBuf to avoid the
anti-pattern CFX_ByteString(sBuf.AsStringC()), using the name
"Make" to indicate there's an allocation going on in this case.
Change some method arguments to take pre-existing ByteStrings where
possible.
Review-Url: https://codereview.chromium.org/1977093002
Diffstat (limited to 'fpdfsdk/fxedit/fxet_pageobjs.cpp')
-rw-r--r-- | fpdfsdk/fxedit/fxet_pageobjs.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fpdfsdk/fxedit/fxet_pageobjs.cpp b/fpdfsdk/fxedit/fxet_pageobjs.cpp index 1fe29af283..e8d9e2a371 100644 --- a/fpdfsdk/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/fxedit/fxet_pageobjs.cpp @@ -228,7 +228,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, - sTextBuf.AsStringC(), crOldFill, crTextStroke, nHorzScale); + sTextBuf.MakeString(), crOldFill, crTextStroke, nHorzScale); sTextBuf.Clear(); } @@ -253,10 +253,10 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, } if (sTextBuf.GetLength() > 0) { - DrawTextString(pDevice, - CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, - sTextBuf.AsStringC(), crOldFill, crTextStroke, nHorzScale); + DrawTextString( + pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), + pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, + sTextBuf.MakeString(), crOldFill, crTextStroke, nHorzScale); } } @@ -340,7 +340,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, pUser2Device, - sTextBuf.AsStringC(), crOld, 0, wp.nHorzScale); + sTextBuf.MakeString(), crOld, 0, wp.nHorzScale); sTextBuf.Clear(); } @@ -381,7 +381,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, DrawTextString( pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, pUser2Device, - sTextBuf.AsStringC(), crOld, 0, wp.nHorzScale); + sTextBuf.MakeString(), crOld, 0, wp.nHorzScale); } } @@ -483,7 +483,7 @@ void IFX_Edit::GeneratePageObjects( pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.AsStringC())); + sTextBuf.MakeString())); sTextBuf.Clear(); } @@ -502,7 +502,7 @@ void IFX_Edit::GeneratePageObjects( ObjArray.Add(AddTextObjToPageObjects( pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.AsStringC())); + sTextBuf.MakeString())); } } } @@ -551,7 +551,7 @@ void IFX_Edit::GenerateRichPageObjects( pObjectHolder, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.AsStringC())); + sTextBuf.MakeString())); sTextBuf.Clear(); } @@ -594,7 +594,7 @@ void IFX_Edit::GenerateRichPageObjects( pObjectHolder, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.AsStringC())); + sTextBuf.MakeString())); } } } |