summaryrefslogtreecommitdiff
path: root/xfa/fde/css/fde_csssyntax.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-18 08:58:25 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-18 14:29:07 +0000
commitbe591066c781850caf13d2b7a7070c6da4eda467 (patch)
tree380c8752fce9e38c68e6d5222306e5e2e3137bc3 /xfa/fde/css/fde_csssyntax.h
parent9dbc3c4fe51f890ef4e18b3dbe6b231e39d024c8 (diff)
downloadpdfium-be591066c781850caf13d2b7a7070c6da4eda467.tar.xz
Convert CSS mode stack to std::stack
This CL converts the css syntax parser to use a std::stack instead of a custom CFX stack. Change-Id: I650c8340693d3608b9264bbf887f1d14847cb68f Reviewed-on: https://pdfium-review.googlesource.com/2218 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_csssyntax.h')
-rw-r--r--xfa/fde/css/fde_csssyntax.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/xfa/fde/css/fde_csssyntax.h b/xfa/fde/css/fde_csssyntax.h
index b29cf23886..81475cb58a 100644
--- a/xfa/fde/css/fde_csssyntax.h
+++ b/xfa/fde/css/fde_csssyntax.h
@@ -7,6 +7,8 @@
#ifndef XFA_FDE_CSS_FDE_CSSSYNTAX_H_
#define XFA_FDE_CSS_FDE_CSSSYNTAX_H_
+#include <stack>
+
#include "core/fxcrt/cfx_retain_ptr.h"
#include "xfa/fde/css/fde_css.h"
#include "xfa/fgas/crt/fgas_stream.h"
@@ -66,19 +68,19 @@ class CFDE_CSSTextBuf {
#define FDE_CSSSYNTAXCHECK_AllowCharset 1
#define FDE_CSSSYNTAXCHECK_AllowImport 2
-enum FDE_CSSSYNTAXMODE {
- FDE_CSSSYNTAXMODE_RuleSet,
- FDE_CSSSYNTAXMODE_Comment,
- FDE_CSSSYNTAXMODE_AtRule,
- FDE_CSSSYNTAXMODE_UnknownRule,
- FDE_CSSSYNTAXMODE_Charset,
- FDE_CSSSYNTAXMODE_Import,
- FDE_CSSSYNTAXMODE_MediaRule,
- FDE_CSSSYNTAXMODE_URI,
- FDE_CSSSYNTAXMODE_MediaType,
- FDE_CSSSYNTAXMODE_Selector,
- FDE_CSSSYNTAXMODE_PropertyName,
- FDE_CSSSYNTAXMODE_PropertyValue,
+enum class FDE_CSSSyntaxMode {
+ RuleSet,
+ Comment,
+ AtRule,
+ UnknownRule,
+ Charset,
+ Import,
+ MediaRule,
+ URI,
+ MediaType,
+ Selector,
+ PropertyName,
+ PropertyValue,
};
class CFDE_CSSSyntaxParser {
@@ -95,7 +97,7 @@ class CFDE_CSSSyntaxParser {
protected:
void Reset(bool bOnlyDeclaration);
- void SwitchMode(FDE_CSSSYNTAXMODE eMode);
+ void SwitchMode(FDE_CSSSyntaxMode eMode);
int32_t SwitchToComment();
bool RestoreMode();
@@ -112,9 +114,9 @@ class CFDE_CSSSyntaxParser {
CFDE_CSSTextBuf m_TextPlane;
int32_t m_iTextDatLen;
uint32_t m_dwCheck;
- FDE_CSSSYNTAXMODE m_eMode;
+ FDE_CSSSyntaxMode m_eMode;
FDE_CSSSyntaxStatus m_eStatus;
- CFX_StackTemplate<FDE_CSSSYNTAXMODE> m_ModeStack;
+ std::stack<FDE_CSSSyntaxMode> m_ModeStack;
};
#endif // XFA_FDE_CSS_FDE_CSSSYNTAX_H_