OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fde/css/fde_csscache.h" | 7 #include "xfa/fde/css/fde_csscache.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "core/fxcrt/include/fx_ext.h" | 11 #include "core/fxcrt/include/fx_ext.h" |
12 #include "xfa/fxfa/app/xfa_textlayout.h" | 12 #include "xfa/fxfa/app/xfa_textlayout.h" |
13 | 13 |
14 FDE_CSSCacheItem::FDE_CSSCacheItem(IFDE_CSSStyleSheet* p) | 14 FDE_CSSCacheItem::FDE_CSSCacheItem(IFDE_CSSStyleSheet* p) |
15 : pStylesheet(p), dwActivity(0) { | 15 : pStylesheet(p), dwActivity(0) { |
16 ASSERT(pStylesheet); | 16 pStylesheet->Retain(); |
17 pStylesheet->AddRef(); | |
18 } | 17 } |
19 | 18 |
20 FDE_CSSCacheItem::~FDE_CSSCacheItem() { | 19 FDE_CSSCacheItem::~FDE_CSSCacheItem() { |
21 pStylesheet->Release(); | 20 pStylesheet->Release(); |
22 } | 21 } |
23 | 22 |
24 FDE_CSSTagCache::FDE_CSSTagCache(FDE_CSSTagCache* parent, | 23 FDE_CSSTagCache::FDE_CSSTagCache(FDE_CSSTagCache* parent, |
25 CXFA_CSSTagProvider* tag) | 24 CXFA_CSSTagProvider* tag) |
26 : pTag(tag), | 25 : pTag(tag), |
27 pParent(parent), | 26 pParent(parent), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 FDE_CSSTagCache* pTop = GetTopElement(); | 60 FDE_CSSTagCache* pTop = GetTopElement(); |
62 FDE_CSSTagCache item(pTop, pTag); | 61 FDE_CSSTagCache item(pTop, pTag); |
63 m_Stack.Push(item); | 62 m_Stack.Push(item); |
64 } | 63 } |
65 | 64 |
66 void CFDE_CSSAccelerator::OnLeaveTag(CXFA_CSSTagProvider* pTag) { | 65 void CFDE_CSSAccelerator::OnLeaveTag(CXFA_CSSTagProvider* pTag) { |
67 ASSERT(m_Stack.GetTopElement()); | 66 ASSERT(m_Stack.GetTopElement()); |
68 ASSERT(m_Stack.GetTopElement()->GetTag() == pTag); | 67 ASSERT(m_Stack.GetTopElement()->GetTag() == pTag); |
69 m_Stack.Pop(); | 68 m_Stack.Pop(); |
70 } | 69 } |
OLD | NEW |