diff options
author | npm <npm@chromium.org> | 2016-10-13 11:10:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-13 11:10:03 -0700 |
commit | aeb44f8c4675141e170329d5093b251fbfad8023 (patch) | |
tree | 5aa3077a0f03695cbac969588a51756e1bc85a4e /xfa/fgas/font | |
parent | a4060a324d606d5a8e1d2a16d3b55a6d14a0ddbf (diff) | |
download | pdfium-aeb44f8c4675141e170329d5093b251fbfad8023.tar.xz |
Clean up fx_basic_util a little
- Nit fixes.
- Remove unused methods.
- Replace FX_BOOL with bool.
Review-Url: https://codereview.chromium.org/2419433004
Diffstat (limited to 'xfa/fgas/font')
-rw-r--r-- | xfa/fgas/font/fgas_stdfontmgr.cpp | 24 | ||||
-rw-r--r-- | xfa/fgas/font/fgas_stdfontmgr.h | 2 |
2 files changed, 9 insertions, 17 deletions
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index de72628760..59bd272a93 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 = + FX_FileHandle* 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,31 @@ 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) { - if (!FX_GetNextFile(pCurHandle, bsName, bFolder)) { + 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) { - return ""; - } else { - goto Restart; - } + return m_FolderPaths.GetSize() != 0 ? GetNextFile() : ""; } 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; diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h index 9d5cb68070..785a47f854 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.h +++ b/xfa/fgas/font/fgas_stdfontmgr.h @@ -122,7 +122,7 @@ struct FX_HandleParentPath { pFileHandle = x.pFileHandle; bsParentPath = x.bsParentPath; } - void* pFileHandle; + FX_FileHandle* pFileHandle; CFX_ByteString bsParentPath; }; |