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

Unified Diff: xfa/fgas/font/fgas_stdfontmgr.cpp

Issue 2419433004: Clean up fx_basic_util a little (Closed)
Patch Set: Another method deletion Created 4 years, 2 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
« core/fxcrt/fx_stream.h ('K') | « core/fxge/ge/cfx_folderfontinfo.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/font/fgas_stdfontmgr.cpp
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index de726287603135c50151d19b8921f9128ba142dd..64c5f9cc75f0dda4771dbffe92e7fbdb78e09bec 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -486,15 +486,13 @@ CFX_FontSourceEnum_File::CFX_FontSourceEnum_File() {
CFX_FontSourceEnum_File::~CFX_FontSourceEnum_File() {}
CFX_ByteString CFX_FontSourceEnum_File::GetNextFile() {
-Restart:
void* pCurHandle =
m_FolderQueue.GetSize() != 0
? m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->pFileHandle
: nullptr;
if (!pCurHandle) {
- if (m_FolderPaths.GetSize() < 1) {
+ if (m_FolderPaths.GetSize() < 1)
return "";
- }
pCurHandle =
FX_OpenFolder(m_FolderPaths[m_FolderPaths.GetSize() - 1].c_str());
FX_HandleParentPath hpp;
@@ -503,37 +501,34 @@ Restart:
m_FolderQueue.Add(hpp);
}
CFX_ByteString bsName;
- FX_BOOL bFolder;
+ bool bFolder;
CFX_ByteString bsFolderSpearator =
CFX_ByteString::FromUnicode(CFX_WideString(FX_GetFolderSeparator()));
- while (TRUE) {
+ while (true) {
if (!FX_GetNextFile(pCurHandle, bsName, bFolder)) {
FX_CloseFolder(pCurHandle);
m_FolderQueue.RemoveAt(m_FolderQueue.GetSize() - 1);
if (m_FolderQueue.GetSize() == 0) {
m_FolderPaths.RemoveAt(m_FolderPaths.GetSize() - 1);
- if (m_FolderPaths.GetSize() == 0) {
+ if (m_FolderPaths.GetSize() == 0)
return "";
- } else {
- goto Restart;
- }
+ else
+ return GetNextFile();
dsinclair 2016/10/12 20:43:23 return m_FolderPaths.GetSize() != 0 ? GetNextFile(
npm 2016/10/12 22:13:19 Done.
}
pCurHandle =
m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->pFileHandle;
continue;
}
- if (bsName == "." || bsName == "..") {
+ if (bsName == "." || bsName == "..")
continue;
- }
if (bFolder) {
FX_HandleParentPath hpp;
hpp.bsParentPath =
m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->bsParentPath +
bsFolderSpearator + bsName;
hpp.pFileHandle = FX_OpenFolder(hpp.bsParentPath.c_str());
- if (!hpp.pFileHandle) {
+ if (!hpp.pFileHandle)
continue;
- }
m_FolderQueue.Add(hpp);
pCurHandle = hpp.pFileHandle;
continue;
« core/fxcrt/fx_stream.h ('K') | « core/fxge/ge/cfx_folderfontinfo.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698