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

Unified Diff: xfa/fxfa/parser/xfa_layout_itemlayout.cpp

Issue 1992033002: fgas/ code cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 7 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
« xfa/fxfa/app/xfa_ffdoc.cpp ('K') | « xfa/fxfa/app/xfa_ffdoc.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_layout_itemlayout.cpp
diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
index ef2df840c99bec14fe619f7d1384e61620195f37..8b85ba80750dfdfe1b6e438cdd105423e669ab82 100644
--- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp
@@ -9,7 +9,6 @@
#include <algorithm>
#include <memory>
-#include "xfa/fgas/crt/fgas_algorithm.h"
#include "xfa/fxfa/app/xfa_ffnotify.h"
#include "xfa/fxfa/fm2js/xfa_fm2jsapi.h"
#include "xfa/fxfa/parser/cxfa_occur.h"
@@ -25,6 +24,34 @@
#include "xfa/fxfa/parser/xfa_script.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+namespace {
+
+int32_t SeparateStringW(const FX_WCHAR* pStr,
+ int32_t iStrLen,
+ FX_WCHAR delimiter,
+ CFX_WideStringArray& pieces) {
+ if (!pStr)
+ return 0;
+ if (iStrLen < 0)
+ iStrLen = FXSYS_wcslen(pStr);
+
+ const FX_WCHAR* pToken = pStr;
+ const FX_WCHAR* pEnd = pStr + iStrLen;
+ while (TRUE) {
+ if (pStr >= pEnd || delimiter == *pStr) {
+ CFX_WideString sub(pToken, pStr - pToken);
+ pieces.Add(sub);
+ pToken = pStr + 1;
+ if (pStr >= pEnd)
+ break;
+ }
+ pStr++;
+ }
+ return pieces.GetSize();
+}
+
+} // namespace
+
CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode,
CXFA_LayoutPageMgr* pPageMgr)
: m_bKeepBreakFinish(FALSE),
@@ -1380,8 +1407,8 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
CFX_WideStringC wsColumnWidths;
if (pLayoutNode->TryCData(XFA_ATTRIBUTE_ColumnWidths, wsColumnWidths)) {
CFX_WideStringArray widths;
- if (FX_SeparateStringW(wsColumnWidths.c_str(), wsColumnWidths.GetLength(),
- L' ', widths) > 0) {
+ if (SeparateStringW(wsColumnWidths.c_str(), wsColumnWidths.GetLength(),
+ L' ', widths) > 0) {
int32_t iCols = widths.GetSize();
CFX_WideString wsWidth;
for (int32_t i = 0; i < iCols; i++) {
« xfa/fxfa/app/xfa_ffdoc.cpp ('K') | « xfa/fxfa/app/xfa_ffdoc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698