summaryrefslogtreecommitdiff
path: root/include/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-29 13:25:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-29 12:30:31 +0000
commitb6853991fce5b4129d0bedf4a7b74fd9e3898bc2 (patch)
treed08a450d9312f56eb3002f76fd74dcbf51da946a /include/editeng
parent5ddef1648005756cfb811f9e6261851d4df712c2 (diff)
split ImportState enum into RtfImportState and HtmlImportState
and convert to scoped enum Change-Id: I23e44e78ce96ed5fc19374e3e069e1cdc2166a35 Reviewed-on: https://gerrit.libreoffice.org/35840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/editeng')
-rw-r--r--include/editeng/editdata.hxx52
-rw-r--r--include/editeng/editeng.hxx13
2 files changed, 45 insertions, 20 deletions
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx
index fe184d818853..b50cff44c4e3 100644
--- a/include/editeng/editdata.hxx
+++ b/include/editeng/editdata.hxx
@@ -29,6 +29,7 @@ class SfxItemSet;
class SfxPoolItem;
class SvParser;
class SvxFieldItem;
+class SvxRTFItemStackType;
enum EETextFormat { EE_FORMAT_TEXT = 0x20, EE_FORMAT_RTF, EE_FORMAT_BIN = 0x31, EE_FORMAT_HTML, EE_FORMAT_XML };
enum EEHorizontalTextDirection { EE_HTEXTDIR_DEFAULT, EE_HTEXTDIR_L2R, EE_HTEXTDIR_R2L };
@@ -201,34 +202,53 @@ struct EDITENG_DLLPUBLIC EFieldInfo
EFieldInfo& operator= ( const EFieldInfo& );
};
-enum ImportState {
- RTFIMP_START, RTFIMP_END, // only pParser, nPara, nIndex
- RTFIMP_NEXTTOKEN, RTFIMP_UNKNOWNATTR, // nToken+nTokenValue
- RTFIMP_SETATTR, // pAttrs
- RTFIMP_INSERTTEXT, // aText
- RTFIMP_INSERTPARA, // -
- HTMLIMP_START, HTMLIMP_END, // only pParser, nPara, nIndex
- HTMLIMP_NEXTTOKEN, HTMLIMP_UNKNOWNATTR, // nToken
- HTMLIMP_SETATTR, // pAttrs
- HTMLIMP_INSERTTEXT, // aText
- HTMLIMP_INSERTPARA, HTMLIMP_INSERTFIELD // -
+enum class RtfImportState {
+ Start, End, // only pParser, nPara, nIndex
+ NextToken, UnknownAttr, // nToken+nTokenValue
+ SetAttr, // pAttrs
+ InsertText, // aText
+ InsertPara, // -
};
+enum class HtmlImportState {
+ Start, End, // only pParser, nPara, nIndex
+ NextToken, // nToken
+ SetAttr, // pAttrs
+ InsertText, // aText
+ InsertPara, InsertField // -
+ };
+
+struct HtmlImportInfo
+{
+ SvParser* pParser;
+ ESelection aSelection;
+ HtmlImportState eState;
+
+ int nToken;
+ short nTokenValue;
+
+ OUString aText;
+
+ SfxItemSet* pAttrs;
+
+ HtmlImportInfo( HtmlImportState eState, SvParser* pPrsrs, const ESelection& rSel );
+ ~HtmlImportInfo();
+};
-struct ImportInfo
+struct RtfImportInfo
{
SvParser* pParser;
ESelection aSelection;
- ImportState eState;
+ RtfImportState eState;
int nToken;
short nTokenValue;
OUString aText;
- void* pAttrs; // RTF: SvxRTFItemStackType*, HTML: SfxItemSet*
+ SvxRTFItemStackType* pAttrs;
- ImportInfo( ImportState eState, SvParser* pPrsrs, const ESelection& rSel );
- ~ImportInfo();
+ RtfImportInfo( RtfImportState eState, SvParser* pPrsrs, const ESelection& rSel );
+ ~RtfImportInfo();
};
struct ParagraphInfos
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 342666691a34..69d2d61b5951 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -380,8 +380,11 @@ public:
void SetNotifyHdl( const Link<EENotify&,void>& rLink );
Link<EENotify&,void> GetNotifyHdl() const;
- void SetImportHdl( const Link<ImportInfo&,void>& rLink );
- const Link<ImportInfo&,void>& GetImportHdl() const;
+ void SetRtfImportHdl( const Link<RtfImportInfo&,void>& rLink );
+ const Link<RtfImportInfo&,void>& GetRtfImportHdl() const;
+
+ void SetHtmlImportHdl( const Link<HtmlImportInfo&,void>& rLink );
+ const Link<HtmlImportInfo&,void>& GetHtmlImportHdl() const;
// Do not evaluate font formatting => For Outliner
bool IsFlatMode() const;
@@ -543,10 +546,12 @@ public:
const ParaPortionList& GetParaPortions() const;
bool IsFormatted() const;
- bool IsImportHandlerSet() const;
+ bool IsHtmlImportHandlerSet() const;
+ bool IsRtfImportHandlerSet() const;
bool IsImportRTFStyleSheetsSet() const;
- void CallImportHandler(ImportInfo& rInfo);
+ void CallRtfImportHandler(RtfImportInfo& rInfo);
+ void CallHtmlImportHandler(HtmlImportInfo& rInfo);
void ParaAttribsToCharAttribs(ContentNode* pNode);