summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_textlayout.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-21 13:37:10 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 13:37:10 -0700
commitbc1cbabe8d8bfa74d25160c14afa30d5b40df335 (patch)
treebc8ba8fbf303f863ca62d71f0bad013bd622309a /xfa/fxfa/app/xfa_textlayout.h
parent5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf (diff)
downloadpdfium-bc1cbabe8d8bfa74d25160c14afa30d5b40df335.tar.xz
Remove IFDE_CSSTagProvider.
There is only one subsclass, use that instead. Remove the use of WideStringC in the API. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1911843002
Diffstat (limited to 'xfa/fxfa/app/xfa_textlayout.h')
-rw-r--r--xfa/fxfa/app/xfa_textlayout.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h
index 9c3184b48b..9cced6a65a 100644
--- a/xfa/fxfa/app/xfa_textlayout.h
+++ b/xfa/fxfa/app/xfa_textlayout.h
@@ -7,6 +7,8 @@
#ifndef XFA_FXFA_APP_XFA_TEXTLAYOUT_H_
#define XFA_FXFA_APP_XFA_TEXTLAYOUT_H_
+#include <map>
+
#include "xfa/fde/css/fde_css.h"
#include "xfa/fde/fde_gedevice.h"
#include "xfa/fgas/layout/fgas_rtfbreak.h"
@@ -20,28 +22,31 @@ class CXFA_Font;
class CXFA_TextProvider;
class CXFA_TextTabstopsContext;
-class CXFA_CSSTagProvider : public IFDE_CSSTagProvider {
+class CXFA_CSSTagProvider {
public:
CXFA_CSSTagProvider() : m_bTagAviliable(FALSE), m_bContent(FALSE) {}
- virtual ~CXFA_CSSTagProvider();
+ ~CXFA_CSSTagProvider() {}
+
+ CFX_WideString GetTagName() { return m_wsTagName; }
+
+ using AttributeMap = std::map<CFX_WideString, CFX_WideString>;
+ AttributeMap::iterator begin() { return m_Attributes.begin(); }
+ AttributeMap::iterator end() { return m_Attributes.end(); }
+
+ bool empty() const { return m_Attributes.empty(); }
- // Note: |this| must outlive the use of GetTagName()'s result.
- virtual CFX_WideStringC GetTagName() { return m_wsTagName.AsStringC(); }
- virtual FX_POSITION GetFirstAttribute() {
- return m_Attributes.GetStartPosition();
- }
- virtual void GetNextAttribute(FX_POSITION& pos,
- CFX_WideStringC& wsAttr,
- CFX_WideStringC& wsValue);
void SetTagNameObj(const CFX_WideString& wsName) { m_wsTagName = wsName; }
void SetAttribute(const CFX_WideString& wsAttr,
- const CFX_WideString& wsValue);
+ const CFX_WideString& wsValue) {
+ m_Attributes.insert({wsAttr, wsValue});
+ }
+
FX_BOOL m_bTagAviliable;
FX_BOOL m_bContent;
protected:
CFX_WideString m_wsTagName;
- CFX_MapPtrToPtr m_Attributes;
+ AttributeMap m_Attributes;
};
class CXFA_TextParseContext : public CFX_Target {