summaryrefslogtreecommitdiff
path: root/xfa/fde/css/fde_csscache.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-19 10:27:58 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-19 15:49:07 +0000
commit95bec8046a28928df627ce4d48eee8b209b3e36e (patch)
tree46913cf24aacfc88a89bb55edcce8e3a2e724c4b /xfa/fde/css/fde_csscache.cpp
parentdd533baad22f5143c093b98e98463a0dc62899ea (diff)
downloadpdfium-95bec8046a28928df627ce4d48eee8b209b3e36e.tar.xz
Split fde/css files into individual class files.
This CL splits the files in xfa/fde/css into class per file and renames any needed files to match the class names. Update some of the classes to use std::stack. Change-Id: I4eca0fb3556d949a15a873bb0f0fd732f47e4fb1 Reviewed-on: https://pdfium-review.googlesource.com/2253 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde/css/fde_csscache.cpp')
-rw-r--r--xfa/fde/css/fde_csscache.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/xfa/fde/css/fde_csscache.cpp b/xfa/fde/css/fde_csscache.cpp
deleted file mode 100644
index bf4176b787..0000000000
--- a/xfa/fde/css/fde_csscache.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fde/css/fde_csscache.h"
-
-#include <algorithm>
-
-#include "core/fxcrt/fx_ext.h"
-#include "xfa/fxfa/app/cxfa_csstagprovider.h"
-
-FDE_CSSTagCache::FDE_CSSTagCache(FDE_CSSTagCache* parent,
- CXFA_CSSTagProvider* tag)
- : pTag(tag),
- pParent(parent),
- dwIDHash(0),
- dwTagHash(0),
- iClassIndex(0),
- dwClassHashs(1) {
- static const uint32_t s_dwIDHash = FX_HashCode_GetW(L"id", true);
- static const uint32_t s_dwClassHash = FX_HashCode_GetW(L"class", true);
- dwTagHash = FX_HashCode_GetW(pTag->GetTagName().AsStringC(), true);
-
- for (auto it : *pTag) {
- CFX_WideString wsValue = it.first;
- CFX_WideString wsName = it.second;
- uint32_t dwNameHash = FX_HashCode_GetW(wsName.AsStringC(), true);
- if (dwNameHash == s_dwClassHash) {
- uint32_t dwHash = FX_HashCode_GetW(wsValue.AsStringC(), false);
- dwClassHashs.Add(dwHash);
- } else if (dwNameHash == s_dwIDHash) {
- dwIDHash = FX_HashCode_GetW(wsValue.AsStringC(), false);
- }
- }
-}
-
-FDE_CSSTagCache::FDE_CSSTagCache(const FDE_CSSTagCache& it)
- : pTag(it.pTag),
- pParent(it.pParent),
- dwIDHash(it.dwIDHash),
- dwTagHash(it.dwTagHash),
- iClassIndex(0),
- dwClassHashs(1) {
- if (it.dwClassHashs.GetSize() > 0)
- dwClassHashs.Copy(it.dwClassHashs, 0, -1);
-}
-
-FDE_CSSTagCache::~FDE_CSSTagCache() {}
-
-CFDE_CSSAccelerator::CFDE_CSSAccelerator() : m_Stack(100) {}
-
-CFDE_CSSAccelerator::~CFDE_CSSAccelerator() {}
-
-void CFDE_CSSAccelerator::OnEnterTag(CXFA_CSSTagProvider* pTag) {
- FDE_CSSTagCache* pTop = GetTopElement();
- FDE_CSSTagCache item(pTop, pTag);
- m_Stack.Push(item);
-}
-
-void CFDE_CSSAccelerator::OnLeaveTag(CXFA_CSSTagProvider* pTag) {
- ASSERT(m_Stack.GetTopElement());
- ASSERT(m_Stack.GetTopElement()->GetTag() == pTag);
- m_Stack.Pop();
-}