Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Unified Diff: xfa/fde/cfde_txtedttextset.cpp

Issue 2609423003: Properly ref-count CFGAS_GEFont with CFX_RetainPtr. (Closed)
Patch Set: comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fde/cfde_txtedttextset.cpp
diff --git a/xfa/fde/cfde_txtedttextset.cpp b/xfa/fde/cfde_txtedttextset.cpp
index 33da0c5a8f2f7c9f2b196042ebfbfaf6ea12eb8c..4149a6df200006a2757e8191ca8130372888226f 100644
--- a/xfa/fde/cfde_txtedttextset.cpp
+++ b/xfa/fde/cfde_txtedttextset.cpp
@@ -8,6 +8,7 @@
#include "xfa/fde/cfde_txtedtengine.h"
#include "xfa/fde/cfde_txtedtpage.h"
+#include "xfa/fgas/font/cfgas_gefont.h"
CFDE_TxtEdtTextSet::CFDE_TxtEdtTextSet(CFDE_TxtEdtPage* pPage)
: m_pPage(pPage) {}
@@ -25,14 +26,14 @@ void CFDE_TxtEdtTextSet::GetRect(FDE_TEXTEDITPIECE* pPiece, CFX_RectF& rt) {
int32_t CFDE_TxtEdtTextSet::GetString(FDE_TEXTEDITPIECE* pPiece,
CFX_WideString& wsText) {
FX_WCHAR* pBuffer = wsText.GetBuffer(pPiece->nCount);
- for (int32_t i = 0; i < pPiece->nCount; i++) {
+ for (int32_t i = 0; i < pPiece->nCount; i++)
pBuffer[i] = m_pPage->GetChar(pPiece, i);
- }
+
wsText.ReleaseBuffer(pPiece->nCount);
return pPiece->nCount;
}
-CFGAS_GEFont* CFDE_TxtEdtTextSet::GetFont() {
+CFX_RetainPtr<CFGAS_GEFont> CFDE_TxtEdtTextSet::GetFont() {
return m_pPage->GetEngine()->GetEditParams()->pFont;
}
« no previous file with comments | « xfa/fde/cfde_txtedttextset.h ('k') | xfa/fde/fde_gedevice.h » ('j') | xfa/fde/fde_gedevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698