[Libreoffice-commits] core.git: dbaccess/source editeng/source filter/source include/editeng include/svtools sc/source svtools/source sw/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri May 5 06:39:10 UTC 2017
dbaccess/source/ui/inc/DExport.hxx | 3
dbaccess/source/ui/inc/HtmlReader.hxx | 4
dbaccess/source/ui/inc/RtfReader.hxx | 2
dbaccess/source/ui/inc/WExtendPages.hxx | 6
dbaccess/source/ui/inc/WTypeSelect.hxx | 4
dbaccess/source/ui/misc/HtmlReader.cxx | 91 +--
dbaccess/source/ui/misc/WExtendPages.cxx | 14
dbaccess/source/ui/misc/WTypeSelect.cxx | 8
editeng/source/editeng/eehtml.cxx | 397 ++++++-------
editeng/source/editeng/eehtml.hxx | 6
editeng/source/editeng/eertfpar.cxx | 7
editeng/source/rtf/svxrtf.cxx | 4
filter/source/textfilterdetect/filterdetect.cxx | 2
include/editeng/editdata.hxx | 13
include/svtools/htmltokn.h | 465 ++++++++-------
include/svtools/parhtml.hxx | 20
include/svtools/parrtf.hxx | 2
include/svtools/svparser.hxx | 89 +--
sc/source/filter/html/htmlpars.cxx | 157 ++---
sc/source/filter/inc/eeparser.hxx | 3
sc/source/filter/rtf/eeimpars.cxx | 4
sc/source/filter/rtf/rtfparse.cxx | 22
svtools/source/svhtml/htmlkywd.cxx | 248 ++++----
svtools/source/svhtml/parhtml.cxx | 477 ++++++++--------
svtools/source/svrtf/parrtf.cxx | 2
svtools/source/svrtf/svparser.cxx | 109 ++-
sw/source/filter/html/htmlatr.cxx | 42 -
sw/source/filter/html/htmlcss1.cxx | 94 +--
sw/source/filter/html/htmlctxt.cxx | 4
sw/source/filter/html/htmlflywriter.cxx | 5
sw/source/filter/html/htmlform.cxx | 14
sw/source/filter/html/htmlgrin.cxx | 6
sw/source/filter/html/htmlnumreader.cxx | 54 -
sw/source/filter/html/htmlnumwriter.cxx | 4
sw/source/filter/html/htmlsect.cxx | 19
sw/source/filter/html/htmltab.cxx | 279 ++++-----
sw/source/filter/html/htmltabw.cxx | 2
sw/source/filter/html/svxcss1.cxx | 4
sw/source/filter/html/swcss1.hxx | 2
sw/source/filter/html/swhtml.cxx | 710 ++++++++++++------------
sw/source/filter/html/swhtml.hxx | 57 -
sw/source/filter/html/wrthtml.cxx | 11
sw/source/filter/html/wrthtml.hxx | 4
sw/source/uibase/docvw/srcedtw.cxx | 4
44 files changed, 1773 insertions(+), 1701 deletions(-)
New commits:
commit 57f1934bdaa747f6e671419aa040e140d235f937
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Apr 21 14:31:00 2017 +0200
convert HTML_TOKEN_IDS to scoped enum
Change-Id: I525506e0103e4f17e5b8b95f15c1285d65b93de9
Reviewed-on: https://gerrit.libreoffice.org/37220
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx
index 20c4a696be5f..7fc704a83bc2 100644
--- a/dbaccess/source/ui/inc/DExport.hxx
+++ b/dbaccess/source/ui/inc/DExport.hxx
@@ -107,9 +107,8 @@ namespace dbaui
bool m_bAppendFirstLine;
- virtual bool CreateTable(int nToken) = 0;
virtual TypeSelectionPageFactory
- getTypeSelectionPageFactory() = 0;
+ getTypeSelectionPageFactory() = 0;
void CreateDefaultColumn(const OUString& _rColumnName);
sal_Int16 CheckString(const OUString& aToken, sal_Int16 _nOldNumberFormat);
diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx
index 2ba3f9e9911a..c7bd1d53badf 100644
--- a/dbaccess/source/ui/inc/HtmlReader.hxx
+++ b/dbaccess/source/ui/inc/HtmlReader.hxx
@@ -39,8 +39,8 @@ namespace dbaui
bool m_bSDNum;
protected:
- virtual void NextToken( int nToken ) override; // base class
- virtual bool CreateTable(int nToken) override;
+ virtual void NextToken( HtmlTokenId nToken ) override; // base class
+ bool CreateTable( HtmlTokenId nToken );
virtual TypeSelectionPageFactory
getTypeSelectionPageFactory() override;
diff --git a/dbaccess/source/ui/inc/RtfReader.hxx b/dbaccess/source/ui/inc/RtfReader.hxx
index 50f9f3387a49..9b61853e9fa6 100644
--- a/dbaccess/source/ui/inc/RtfReader.hxx
+++ b/dbaccess/source/ui/inc/RtfReader.hxx
@@ -32,7 +32,7 @@ namespace dbaui
std::vector<sal_Int32> m_vecColor;
protected:
- virtual bool CreateTable(int nToken) override;
+ bool CreateTable(int nToken);
virtual void NextToken( int nToken ) override; // base class
virtual TypeSelectionPageFactory
getTypeSelectionPageFactory() override;
diff --git a/dbaccess/source/ui/inc/WExtendPages.hxx b/dbaccess/source/ui/inc/WExtendPages.hxx
index b1a4a9782b43..3efb77d9ddf5 100644
--- a/dbaccess/source/ui/inc/WExtendPages.hxx
+++ b/dbaccess/source/ui/inc/WExtendPages.hxx
@@ -28,7 +28,7 @@ namespace dbaui
class OWizHTMLExtend : public OWizTypeSelect
{
protected:
- virtual SvParser* createReader(sal_Int32 _nRows) override;
+ virtual void createReaderAndCallParser(sal_Int32 _nRows) override;
public:
OWizHTMLExtend(vcl::Window* pParent, SvStream& _rStream)
: OWizTypeSelect( pParent, &_rStream )
@@ -41,7 +41,7 @@ namespace dbaui
class OWizRTFExtend : public OWizTypeSelect
{
protected:
- virtual SvParser* createReader(sal_Int32 _nRows) override;
+ virtual void createReaderAndCallParser(sal_Int32 _nRows) override;
public:
OWizRTFExtend(vcl::Window* pParent,SvStream& _rStream)
: OWizTypeSelect( pParent, &_rStream )
@@ -55,7 +55,7 @@ namespace dbaui
class OWizNormalExtend : public OWizTypeSelect
{
protected:
- virtual SvParser* createReader(sal_Int32 _nRows) override;
+ virtual void createReaderAndCallParser(sal_Int32 _nRows) override;
public:
OWizNormalExtend(vcl::Window* pParent);
};
diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx
index f9f9c6183ea7..24b9b72bccbd 100644
--- a/dbaccess/source/ui/inc/WTypeSelect.hxx
+++ b/dbaccess/source/ui/inc/WTypeSelect.hxx
@@ -29,7 +29,7 @@
#include <vcl/lstbox.hxx>
class SvStream;
-class SvParser;
+
namespace dbaui
{
class OTableDesignHelpBar;
@@ -109,7 +109,7 @@ namespace dbaui
bool m_bAutoIncrementEnabled;
bool m_bDuplicateName;
- virtual SvParser* createReader(sal_Int32 _nRows) = 0;
+ virtual void createReaderAndCallParser(sal_Int32 _nRows) = 0;
void EnableAuto(bool bEnable);
public:
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 43c96c8aba4e..2cbf3202735e 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -117,18 +117,18 @@ SvParserState OHTMLReader::CallParser()
return m_bFoundTable ? eParseState : SvParserState::Error;
}
-void OHTMLReader::NextToken( int nToken )
+void OHTMLReader::NextToken( HtmlTokenId nToken )
{
if(m_bError || !m_nRows) // if there is an error or no more rows to check, return immediately
return;
- if ( nToken == HTML_META )
+ if ( nToken == HtmlTokenId::META )
setTextEncoding();
if(m_xConnection.is()) // names, which CTOR was called and hence, if a table should be created
{
switch(nToken)
{
- case HTML_TABLE_ON:
+ case HtmlTokenId::TABLE_ON:
++m_nTableCount;
{ // can also be TD or TH, if there was no TABLE before
const HTMLOptions& rHtmlOptions = GetOptions();
@@ -141,8 +141,8 @@ void OHTMLReader::NextToken( int nToken )
}
}
SAL_FALLTHROUGH;
- case HTML_THEAD_ON:
- case HTML_TBODY_ON:
+ case HtmlTokenId::THEAD_ON:
+ case HtmlTokenId::TBODY_ON:
{
sal_uInt64 const nTell = rInput.Tell(); // perhaps alters position of the stream
if ( !m_xTable.is() )
@@ -153,13 +153,13 @@ void OHTMLReader::NextToken( int nToken )
}
}
break;
- case HTML_TABLE_OFF:
+ case HtmlTokenId::TABLE_OFF:
if(!--m_nTableCount)
{
m_xTable = nullptr;
}
break;
- case HTML_TABLEROW_ON:
+ case HtmlTokenId::TABLEROW_ON:
if ( m_pUpdateHelper.get() )
{
try
@@ -175,21 +175,21 @@ void OHTMLReader::NextToken( int nToken )
else
m_bError = true;
break;
- case HTML_TEXTTOKEN:
- case HTML_SINGLECHAR:
+ case HtmlTokenId::TEXTTOKEN:
+ case HtmlTokenId::SINGLECHAR:
if ( m_bInTbl ) //&& !m_bSDNum ) // important, as otherwise we also get the names of the fonts
m_sTextToken += aToken;
break;
- case HTML_PARABREAK_OFF:
+ case HtmlTokenId::PARABREAK_OFF:
m_sCurrent += m_sTextToken;
break;
- case HTML_PARABREAK_ON:
+ case HtmlTokenId::PARABREAK_ON:
m_sTextToken.clear();
break;
- case HTML_TABLEDATA_ON:
+ case HtmlTokenId::TABLEDATA_ON:
fetchOptions();
break;
- case HTML_TABLEDATA_OFF:
+ case HtmlTokenId::TABLEDATA_OFF:
{
if ( !m_sCurrent.isEmpty() )
m_sTextToken = m_sCurrent;
@@ -208,7 +208,7 @@ void OHTMLReader::NextToken( int nToken )
m_bSDNum = m_bInTbl = false;
}
break;
- case HTML_TABLEROW_OFF:
+ case HtmlTokenId::TABLEROW_OFF:
if ( !m_pUpdateHelper.get() )
{
m_bError = true;
@@ -228,39 +228,40 @@ void OHTMLReader::NextToken( int nToken )
}
m_nColumnPos = 0;
break;
+ default: break;
}
}
else // branch only valid for type checking
{
switch(nToken)
{
- case HTML_THEAD_ON:
- case HTML_TBODY_ON:
+ case HtmlTokenId::THEAD_ON:
+ case HtmlTokenId::TBODY_ON:
// The head of the column is not included
if(m_bHead)
{
do
{}
- while(GetNextToken() != HTML_TABLEROW_OFF);
+ while(GetNextToken() != HtmlTokenId::TABLEROW_OFF);
m_bHead = false;
}
break;
- case HTML_TABLEDATA_ON:
- case HTML_TABLEHEADER_ON:
+ case HtmlTokenId::TABLEDATA_ON:
+ case HtmlTokenId::TABLEHEADER_ON:
fetchOptions();
break;
- case HTML_TEXTTOKEN:
- case HTML_SINGLECHAR:
+ case HtmlTokenId::TEXTTOKEN:
+ case HtmlTokenId::SINGLECHAR:
if ( m_bInTbl ) // && !m_bSDNum ) // important, as otherwise we also get the names of the fonts
m_sTextToken += aToken;
break;
- case HTML_PARABREAK_OFF:
+ case HtmlTokenId::PARABREAK_OFF:
m_sCurrent += m_sTextToken;
break;
- case HTML_PARABREAK_ON:
+ case HtmlTokenId::PARABREAK_ON:
m_sTextToken.clear();
break;
- case HTML_TABLEDATA_OFF:
+ case HtmlTokenId::TABLEDATA_OFF:
if ( !m_sCurrent.isEmpty() )
m_sTextToken = m_sCurrent;
adjustFormat();
@@ -268,7 +269,7 @@ void OHTMLReader::NextToken( int nToken )
m_bSDNum = m_bInTbl = false;
m_sCurrent.clear();
break;
- case HTML_TABLEROW_OFF:
+ case HtmlTokenId::TABLEROW_OFF:
if ( !m_sCurrent.isEmpty() )
m_sTextToken = m_sCurrent;
adjustFormat();
@@ -276,6 +277,7 @@ void OHTMLReader::NextToken( int nToken )
m_nRows--;
m_sCurrent.clear();
break;
+ default: break;
}
}
}
@@ -398,7 +400,7 @@ sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption& rOption )
}
}
-bool OHTMLReader::CreateTable(int nToken)
+bool OHTMLReader::CreateTable(HtmlTokenId nToken)
{
OUString aTempName(ModuleRes(STR_TBL_TITLE));
aTempName = aTempName.getToken(0,' ');
@@ -416,26 +418,26 @@ bool OHTMLReader::CreateTable(int nToken)
{
switch (nToken)
{
- case HTML_TEXTTOKEN:
- case HTML_SINGLECHAR:
+ case HtmlTokenId::TEXTTOKEN:
+ case HtmlTokenId::SINGLECHAR:
if(bTableHeader)
aColumnName += aToken;
if(bCaption)
aTableName += aToken;
break;
- case HTML_PARABREAK_OFF:
+ case HtmlTokenId::PARABREAK_OFF:
m_sCurrent += aColumnName;
break;
- case HTML_PARABREAK_ON:
+ case HtmlTokenId::PARABREAK_ON:
m_sTextToken.clear();
break;
- case HTML_TABLEDATA_ON:
- case HTML_TABLEHEADER_ON:
+ case HtmlTokenId::TABLEDATA_ON:
+ case HtmlTokenId::TABLEHEADER_ON:
TableDataOn(eVal);
bTableHeader = true;
break;
- case HTML_TABLEDATA_OFF:
- case HTML_TABLEHEADER_OFF:
+ case HtmlTokenId::TABLEDATA_OFF:
+ case HtmlTokenId::TABLEHEADER_OFF:
{
aColumnName = comphelper::string::strip(aColumnName, ' ' );
if (aColumnName.isEmpty() || m_bAppendFirstLine )
@@ -453,12 +455,12 @@ bool OHTMLReader::CreateTable(int nToken)
}
break;
- case HTML_TITLE_ON:
- case HTML_CAPTION_ON:
+ case HtmlTokenId::TITLE_ON:
+ case HtmlTokenId::CAPTION_ON:
bCaption = true;
break;
- case HTML_TITLE_OFF:
- case HTML_CAPTION_OFF:
+ case HtmlTokenId::TITLE_OFF:
+ case HtmlTokenId::CAPTION_OFF:
aTableName = comphelper::string::strip(aTableName, ' ');
if(aTableName.isEmpty())
aTableName = ::dbtools::createUniqueName(m_xTables, aTableName);
@@ -466,25 +468,26 @@ bool OHTMLReader::CreateTable(int nToken)
aTableName = aTempName;
bCaption = false;
break;
- case HTML_FONT_ON:
+ case HtmlTokenId::FONT_ON:
TableFontOn(aFont,nTextColor);
break;
- case HTML_BOLD_ON:
+ case HtmlTokenId::BOLD_ON:
aFont.Weight = css::awt::FontWeight::BOLD;
break;
- case HTML_ITALIC_ON:
+ case HtmlTokenId::ITALIC_ON:
aFont.Slant = css::awt::FontSlant_ITALIC;
break;
- case HTML_UNDERLINE_ON:
+ case HtmlTokenId::UNDERLINE_ON:
aFont.Underline = css::awt::FontUnderline::SINGLE;
break;
- case HTML_STRIKE_ON:
+ case HtmlTokenId::STRIKE_ON:
aFont.Strikeout = css::awt::FontStrikeout::SINGLE;
break;
+ default: break;
}
nToken = GetNextToken();
}
- while (nToken != HTML_TABLEROW_OFF);
+ while (nToken != HtmlTokenId::TABLEROW_OFF);
if ( !m_sCurrent.isEmpty() )
aColumnName = m_sCurrent;
diff --git a/dbaccess/source/ui/misc/WExtendPages.cxx b/dbaccess/source/ui/misc/WExtendPages.cxx
index 0cbe34343250..1a330f0d3a83 100644
--- a/dbaccess/source/ui/misc/WExtendPages.cxx
+++ b/dbaccess/source/ui/misc/WExtendPages.cxx
@@ -24,9 +24,10 @@
using namespace dbaui;
using namespace com::sun::star;
-SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows)
+
+void OWizHTMLExtend::createReaderAndCallParser(sal_Int32 _nRows)
{
- return new OHTMLReader(*m_pParserStream,
+ tools::SvRef<OHTMLReader> xParser = new OHTMLReader(*m_pParserStream,
_nRows,
m_pParent->GetColumnPositions(),
m_pParent->GetFormatter(),
@@ -34,11 +35,12 @@ SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows)
&m_pParent->getDestVector(),
&m_pParent->getTypeInfo(),
m_pParent->shouldCreatePrimaryKey());
+ xParser->CallParser();
}
-SvParser* OWizRTFExtend::createReader(sal_Int32 _nRows)
+void OWizRTFExtend::createReaderAndCallParser(sal_Int32 _nRows)
{
- return new ORTFReader(*m_pParserStream,
+ tools::SvRef<ORTFReader> xParser = new ORTFReader(*m_pParserStream,
_nRows,
m_pParent->GetColumnPositions(),
m_pParent->GetFormatter(),
@@ -46,6 +48,7 @@ SvParser* OWizRTFExtend::createReader(sal_Int32 _nRows)
&m_pParent->getDestVector(),
&m_pParent->getTypeInfo(),
m_pParent->shouldCreatePrimaryKey());
+ xParser->CallParser();
}
OWizNormalExtend::OWizNormalExtend(vcl::Window* pParent) : OWizTypeSelect( pParent )
@@ -53,9 +56,8 @@ OWizNormalExtend::OWizNormalExtend(vcl::Window* pParent) : OWizTypeSelect( pPare
EnableAuto(false);
}
-SvParser* OWizNormalExtend::createReader(sal_Int32 /*_nRows*/)
+void OWizNormalExtend::createReaderAndCallParser(sal_Int32 /*_nRows*/)
{
- return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 429339e3899a..b0512911f518 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -356,13 +356,7 @@ IMPL_LINK_NOARG( OWizTypeSelect, ButtonClickHdl, Button *, void )
{
sal_uInt64 const nTell = m_pParserStream->Tell(); // might change seek position of stream
- SvParser *pReader = createReader(nRows);
- if(pReader)
- {
- pReader->AddFirstRef();
- pReader->CallParser();
- pReader->ReleaseRef();
- }
+ createReaderAndCallParser(nRows);
m_pParserStream->Seek(nTell);
}
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 8831e472569e..e625669aea00 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -99,11 +99,11 @@ SvParserState EditHTMLParser::CallParser(EditEngine* pEE, const EditPaM& rPaM)
return _eState;
}
-void EditHTMLParser::NextToken( int nToken )
+void EditHTMLParser::NextToken( HtmlTokenId nToken )
{
switch( nToken )
{
- case HTML_META:
+ case HtmlTokenId::META:
{
const HTMLOptions& aOptions = GetOptions();
size_t nArrLen = aOptions.size();
@@ -134,33 +134,33 @@ void EditHTMLParser::NextToken( int nToken )
}
break;
- case HTML_PLAINTEXT_ON:
- case HTML_PLAINTEXT2_ON:
+ case HtmlTokenId::PLAINTEXT_ON:
+ case HtmlTokenId::PLAINTEXT2_ON:
bInPara = true;
break;
- case HTML_PLAINTEXT_OFF:
- case HTML_PLAINTEXT2_OFF:
+ case HtmlTokenId::PLAINTEXT_OFF:
+ case HtmlTokenId::PLAINTEXT2_OFF:
bInPara = false;
break;
- case HTML_LINEBREAK:
- case HTML_NEWPARA:
+ case HtmlTokenId::LINEBREAK:
+ case HtmlTokenId::NEWPARA:
{
if ( ( bInPara || nInTable ) &&
- ( ( nToken == HTML_LINEBREAK ) || HasTextInCurrentPara() ) )
+ ( ( nToken == HtmlTokenId::LINEBREAK ) || HasTextInCurrentPara() ) )
{
ImpInsertParaBreak();
}
}
break;
- case HTML_HORZRULE:
+ case HtmlTokenId::HORZRULE:
{
if ( HasTextInCurrentPara() )
ImpInsertParaBreak();
ImpInsertParaBreak();
}
break;
- case HTML_NONBREAKSPACE:
+ case HtmlTokenId::NONBREAKSPACE:
{
if ( bInPara )
{
@@ -168,7 +168,7 @@ void EditHTMLParser::NextToken( int nToken )
}
}
break;
- case HTML_RAWDATA:
+ case HtmlTokenId::RAWDATA:
if (IsReadStyle() && !aToken.isEmpty())
{
// Each token represents a single line.
@@ -176,7 +176,7 @@ void EditHTMLParser::NextToken( int nToken )
maStyleSource.append('\n');
}
break;
- case HTML_TEXTTOKEN:
+ case HtmlTokenId::TEXTTOKEN:
{
// #i110937# for <title> content, call aImportHdl (no SkipGroup), but don't insert the text into the EditEngine
if (!bInTitle)
@@ -210,98 +210,98 @@ void EditHTMLParser::NextToken( int nToken )
}
break;
- case HTML_CENTER_ON:
- case HTML_CENTER_OFF:
+ case HtmlTokenId::CENTER_ON:
+ case HtmlTokenId::CENTER_OFF:
{
sal_Int32 nNode = mpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() );
SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() );
aItems.ClearItem( EE_PARA_JUST );
- if ( nToken == HTML_CENTER_ON )
+ if ( nToken == HtmlTokenId::CENTER_ON )
aItems.Put( SvxAdjustItem( SvxAdjust::Center, EE_PARA_JUST ) );
mpEditEngine->SetParaAttribsOnly(nNode, aItems);
}
break;
- case HTML_ANCHOR_ON: AnchorStart();
+ case HtmlTokenId::ANCHOR_ON: AnchorStart();
break;
- case HTML_ANCHOR_OFF: AnchorEnd();
+ case HtmlTokenId::ANCHOR_OFF: AnchorEnd();
break;
- case HTML_PARABREAK_ON:
+ case HtmlTokenId::PARABREAK_ON:
if( bInPara && HasTextInCurrentPara() )
EndPara();
StartPara( true );
break;
- case HTML_PARABREAK_OFF:
+ case HtmlTokenId::PARABREAK_OFF:
if( bInPara )
EndPara();
break;
- case HTML_HEAD1_ON:
- case HTML_HEAD2_ON:
- case HTML_HEAD3_ON:
- case HTML_HEAD4_ON:
- case HTML_HEAD5_ON:
- case HTML_HEAD6_ON:
+ case HtmlTokenId::HEAD1_ON:
+ case HtmlTokenId::HEAD2_ON:
+ case HtmlTokenId::HEAD3_ON:
+ case HtmlTokenId::HEAD4_ON:
+ case HtmlTokenId::HEAD5_ON:
+ case HtmlTokenId::HEAD6_ON:
{
HeadingStart( nToken );
}
break;
- case HTML_HEAD1_OFF:
- case HTML_HEAD2_OFF:
- case HTML_HEAD3_OFF:
- case HTML_HEAD4_OFF:
- case HTML_HEAD5_OFF:
- case HTML_HEAD6_OFF:
+ case HtmlTokenId::HEAD1_OFF:
+ case HtmlTokenId::HEAD2_OFF:
+ case HtmlTokenId::HEAD3_OFF:
+ case HtmlTokenId::HEAD4_OFF:
+ case HtmlTokenId::HEAD5_OFF:
+ case HtmlTokenId::HEAD6_OFF:
{
HeadingEnd();
}
break;
- case HTML_PREFORMTXT_ON:
- case HTML_XMP_ON:
- case HTML_LISTING_ON:
+ case HtmlTokenId::PREFORMTXT_ON:
+ case HtmlTokenId::XMP_ON:
+ case HtmlTokenId::LISTING_ON:
{
StartPara( true );
ImpSetStyleSheet( STYLE_PRE );
}
break;
- case HTML_DEFLIST_ON:
+ case HtmlTokenId::DEFLIST_ON:
{
nDefListLevel++;
}
break;
- case HTML_DEFLIST_OFF:
+ case HtmlTokenId::DEFLIST_OFF:
{
if( nDefListLevel )
nDefListLevel--;
}
break;
- case HTML_TABLE_ON: nInTable++;
+ case HtmlTokenId::TABLE_ON: nInTable++;
break;
- case HTML_TABLE_OFF: DBG_ASSERT( nInTable, "Not in Table, but TABLE_OFF?" );
+ case HtmlTokenId::TABLE_OFF: DBG_ASSERT( nInTable, "Not in Table, but TABLE_OFF?" );
nInTable--;
break;
- case HTML_TABLEHEADER_ON:
- case HTML_TABLEDATA_ON:
+ case HtmlTokenId::TABLEHEADER_ON:
+ case HtmlTokenId::TABLEDATA_ON:
nInCell++;
SAL_FALLTHROUGH;
- case HTML_BLOCKQUOTE_ON:
- case HTML_BLOCKQUOTE_OFF:
- case HTML_BLOCKQUOTE30_ON:
- case HTML_BLOCKQUOTE30_OFF:
- case HTML_LISTHEADER_ON:
- case HTML_LI_ON:
- case HTML_DD_ON:
- case HTML_DT_ON:
- case HTML_ORDERLIST_ON:
- case HTML_UNORDERLIST_ON:
+ case HtmlTokenId::BLOCKQUOTE_ON:
+ case HtmlTokenId::BLOCKQUOTE_OFF:
+ case HtmlTokenId::BLOCKQUOTE30_ON:
+ case HtmlTokenId::BLOCKQUOTE30_OFF:
+ case HtmlTokenId::LISTHEADER_ON:
+ case HtmlTokenId::LI_ON:
+ case HtmlTokenId::DD_ON:
+ case HtmlTokenId::DT_ON:
+ case HtmlTokenId::ORDERLIST_ON:
+ case HtmlTokenId::UNORDERLIST_ON:
{
bool bHasText = HasTextInCurrentPara();
if ( bHasText )
@@ -310,182 +310,182 @@ void EditHTMLParser::NextToken( int nToken )
}
break;
- case HTML_TABLEHEADER_OFF:
- case HTML_TABLEDATA_OFF:
+ case HtmlTokenId::TABLEHEADER_OFF:
+ case HtmlTokenId::TABLEDATA_OFF:
{
if ( nInCell )
nInCell--;
SAL_FALLTHROUGH;
}
- case HTML_LISTHEADER_OFF:
- case HTML_LI_OFF:
- case HTML_DD_OFF:
- case HTML_DT_OFF:
- case HTML_ORDERLIST_OFF:
- case HTML_UNORDERLIST_OFF: EndPara();
+ case HtmlTokenId::LISTHEADER_OFF:
+ case HtmlTokenId::LI_OFF:
+ case HtmlTokenId::DD_OFF:
+ case HtmlTokenId::DT_OFF:
+ case HtmlTokenId::ORDERLIST_OFF:
+ case HtmlTokenId::UNORDERLIST_OFF: EndPara();
break;
- case HTML_TABLEROW_ON:
- case HTML_TABLEROW_OFF: // A RETURN only after a CELL, for Calc
+ case HtmlTokenId::TABLEROW_ON:
+ case HtmlTokenId::TABLEROW_OFF: // A RETURN only after a CELL, for Calc
- case HTML_COL_ON:
- case HTML_COLGROUP_ON:
- case HTML_COLGROUP_OFF: break;
+ case HtmlTokenId::COL_ON:
+ case HtmlTokenId::COLGROUP_ON:
+ case HtmlTokenId::COLGROUP_OFF: break;
- case HTML_FONT_ON:
+ case HtmlTokenId::FONT_ON:
break;
- case HTML_FONT_OFF:
+ case HtmlTokenId::FONT_OFF:
break;
- case HTML_TITLE_ON:
+ case HtmlTokenId::TITLE_ON:
bInTitle = true;
break;
- case HTML_TITLE_OFF:
+ case HtmlTokenId::TITLE_OFF:
bInTitle = false;
break;
// globals
- case HTML_HTML_ON:
- case HTML_HTML_OFF:
- case HTML_STYLE_ON:
- case HTML_STYLE_OFF:
- case HTML_BODY_ON:
- case HTML_BODY_OFF:
- case HTML_HEAD_ON:
- case HTML_HEAD_OFF:
- case HTML_FORM_ON:
- case HTML_FORM_OFF:
- case HTML_THEAD_ON:
- case HTML_THEAD_OFF:
- case HTML_TBODY_ON:
- case HTML_TBODY_OFF:
+ case HtmlTokenId::HTML_ON:
+ case HtmlTokenId::HTML_OFF:
+ case HtmlTokenId::STYLE_ON:
+ case HtmlTokenId::STYLE_OFF:
+ case HtmlTokenId::BODY_ON:
+ case HtmlTokenId::BODY_OFF:
+ case HtmlTokenId::HEAD_ON:
+ case HtmlTokenId::HEAD_OFF:
+ case HtmlTokenId::FORM_ON:
+ case HtmlTokenId::FORM_OFF:
+ case HtmlTokenId::THEAD_ON:
+ case HtmlTokenId::THEAD_OFF:
+ case HtmlTokenId::TBODY_ON:
+ case HtmlTokenId::TBODY_OFF:
// inline elements, structural markup
// HTML 3.0
- case HTML_BANNER_ON:
- case HTML_BANNER_OFF:
- case HTML_DIVISION_ON:
- case HTML_DIVISION_OFF:
-// case HTML_LISTHEADER_ON: //! special handling
-// case HTML_LISTHEADER_OFF:
- case HTML_NOTE_ON:
- case HTML_NOTE_OFF:
+ case HtmlTokenId::BANNER_ON:
+ case HtmlTokenId::BANNER_OFF:
+ case HtmlTokenId::DIVISION_ON:
+ case HtmlTokenId::DIVISION_OFF:
+// case HtmlTokenId::LISTHEADER_ON: //! special handling
+// case HtmlTokenId::LISTHEADER_OFF:
+ case HtmlTokenId::NOTE_ON:
+ case HtmlTokenId::NOTE_OFF:
// inline elements, logical markup
// HTML 2.0
- case HTML_ADDRESS_ON:
- case HTML_ADDRESS_OFF:
-// case HTML_BLOCKQUOTE_ON: //! special handling
-// case HTML_BLOCKQUOTE_OFF:
- case HTML_CITIATION_ON:
- case HTML_CITIATION_OFF:
- case HTML_CODE_ON:
- case HTML_CODE_OFF:
- case HTML_DEFINSTANCE_ON:
- case HTML_DEFINSTANCE_OFF:
- case HTML_EMPHASIS_ON:
- case HTML_EMPHASIS_OFF:
- case HTML_KEYBOARD_ON:
- case HTML_KEYBOARD_OFF:
- case HTML_SAMPLE_ON:
- case HTML_SAMPLE_OFF:
- case HTML_STRIKE_ON:
- case HTML_STRIKE_OFF:
- case HTML_STRONG_ON:
- case HTML_STRONG_OFF:
- case HTML_VARIABLE_ON:
- case HTML_VARIABLE_OFF:
+ case HtmlTokenId::ADDRESS_ON:
+ case HtmlTokenId::ADDRESS_OFF:
+// case HtmlTokenId::BLOCKQUOTE_ON: //! special handling
+// case HtmlTokenId::BLOCKQUOTE_OFF:
+ case HtmlTokenId::CITIATION_ON:
+ case HtmlTokenId::CITIATION_OFF:
+ case HtmlTokenId::CODE_ON:
+ case HtmlTokenId::CODE_OFF:
+ case HtmlTokenId::DEFINSTANCE_ON:
+ case HtmlTokenId::DEFINSTANCE_OFF:
+ case HtmlTokenId::EMPHASIS_ON:
+ case HtmlTokenId::EMPHASIS_OFF:
+ case HtmlTokenId::KEYBOARD_ON:
+ case HtmlTokenId::KEYBOARD_OFF:
+ case HtmlTokenId::SAMPLE_ON:
+ case HtmlTokenId::SAMPLE_OFF:
+ case HtmlTokenId::STRIKE_ON:
+ case HtmlTokenId::STRIKE_OFF:
+ case HtmlTokenId::STRONG_ON:
+ case HtmlTokenId::STRONG_OFF:
+ case HtmlTokenId::VARIABLE_ON:
+ case HtmlTokenId::VARIABLE_OFF:
// HTML 3.0
- case HTML_ABBREVIATION_ON:
- case HTML_ABBREVIATION_OFF:
- case HTML_ACRONYM_ON:
- case HTML_ACRONYM_OFF:
- case HTML_AUTHOR_ON:
- case HTML_AUTHOR_OFF:
-// case HTML_BLOCKQUOTE30_ON: //! special handling
-// case HTML_BLOCKQUOTE30_OFF:
- case HTML_DELETEDTEXT_ON:
- case HTML_DELETEDTEXT_OFF:
- case HTML_INSERTEDTEXT_ON:
- case HTML_INSERTEDTEXT_OFF:
- case HTML_LANGUAGE_ON:
- case HTML_LANGUAGE_OFF:
- case HTML_PERSON_ON:
- case HTML_PERSON_OFF:
- case HTML_SHORTQUOTE_ON:
- case HTML_SHORTQUOTE_OFF:
- case HTML_SUBSCRIPT_ON:
- case HTML_SUBSCRIPT_OFF:
- case HTML_SUPERSCRIPT_ON:
- case HTML_SUPERSCRIPT_OFF:
+ case HtmlTokenId::ABBREVIATION_ON:
+ case HtmlTokenId::ABBREVIATION_OFF:
+ case HtmlTokenId::ACRONYM_ON:
+ case HtmlTokenId::ACRONYM_OFF:
+ case HtmlTokenId::AUTHOR_ON:
+ case HtmlTokenId::AUTHOR_OFF:
+// case HtmlTokenId::BLOCKQUOTE30_ON: //! special handling
+// case HtmlTokenId::BLOCKQUOTE30_OFF:
+ case HtmlTokenId::DELETEDTEXT_ON:
+ case HtmlTokenId::DELETEDTEXT_OFF:
+ case HtmlTokenId::INSERTEDTEXT_ON:
+ case HtmlTokenId::INSERTEDTEXT_OFF:
+ case HtmlTokenId::LANGUAGE_ON:
+ case HtmlTokenId::LANGUAGE_OFF:
+ case HtmlTokenId::PERSON_ON:
+ case HtmlTokenId::PERSON_OFF:
+ case HtmlTokenId::SHORTQUOTE_ON:
+ case HtmlTokenId::SHORTQUOTE_OFF:
+ case HtmlTokenId::SUBSCRIPT_ON:
+ case HtmlTokenId::SUBSCRIPT_OFF:
+ case HtmlTokenId::SUPERSCRIPT_ON:
+ case HtmlTokenId::SUPERSCRIPT_OFF:
// inline elements, visual markup
// HTML 2.0
- case HTML_BOLD_ON:
- case HTML_BOLD_OFF:
- case HTML_ITALIC_ON:
- case HTML_ITALIC_OFF:
- case HTML_TELETYPE_ON:
- case HTML_TELETYPE_OFF:
- case HTML_UNDERLINE_ON:
- case HTML_UNDERLINE_OFF:
+ case HtmlTokenId::BOLD_ON:
+ case HtmlTokenId::BOLD_OFF:
+ case HtmlTokenId::ITALIC_ON:
+ case HtmlTokenId::ITALIC_OFF:
+ case HtmlTokenId::TELETYPE_ON:
+ case HtmlTokenId::TELETYPE_OFF:
+ case HtmlTokenId::UNDERLINE_ON:
+ case HtmlTokenId::UNDERLINE_OFF:
// HTML 3.0
- case HTML_BIGPRINT_ON:
- case HTML_BIGPRINT_OFF:
- case HTML_STRIKETHROUGH_ON:
- case HTML_STRIKETHROUGH_OFF:
- case HTML_SMALLPRINT_ON:
- case HTML_SMALLPRINT_OFF:
+ case HtmlTokenId::BIGPRINT_ON:
+ case HtmlTokenId::BIGPRINT_OFF:
+ case HtmlTokenId::STRIKETHROUGH_ON:
+ case HtmlTokenId::STRIKETHROUGH_OFF:
+ case HtmlTokenId::SMALLPRINT_ON:
+ case HtmlTokenId::SMALLPRINT_OFF:
// figures
- case HTML_FIGURE_ON:
- case HTML_FIGURE_OFF:
- case HTML_CAPTION_ON:
- case HTML_CAPTION_OFF:
- case HTML_CREDIT_ON:
- case HTML_CREDIT_OFF:
+ case HtmlTokenId::FIGURE_ON:
+ case HtmlTokenId::FIGURE_OFF:
+ case HtmlTokenId::CAPTION_ON:
+ case HtmlTokenId::CAPTION_OFF:
+ case HtmlTokenId::CREDIT_ON:
+ case HtmlTokenId::CREDIT_OFF:
// misc
- case HTML_DIRLIST_ON:
- case HTML_DIRLIST_OFF:
- case HTML_FOOTNOTE_ON: //! land so im Text
- case HTML_FOOTNOTE_OFF:
- case HTML_MENULIST_ON:
- case HTML_MENULIST_OFF:
-// case HTML_PLAINTEXT_ON: //! special handling
-// case HTML_PLAINTEXT_OFF:
-// case HTML_PREFORMTXT_ON: //! special handling
-// case HTML_PREFORMTXT_OFF:
- case HTML_SPAN_ON:
- case HTML_SPAN_OFF:
+ case HtmlTokenId::DIRLIST_ON:
+ case HtmlTokenId::DIRLIST_OFF:
+ case HtmlTokenId::FOOTNOTE_ON: //! land so im Text
+ case HtmlTokenId::FOOTNOTE_OFF:
+ case HtmlTokenId::MENULIST_ON:
+ case HtmlTokenId::MENULIST_OFF:
+// case HtmlTokenId::PLAINTEXT_ON: //! special handling
+// case HtmlTokenId::PLAINTEXT_OFF:
+// case HtmlTokenId::PREFORMTXT_ON: //! special handling
+// case HtmlTokenId::PREFORMTXT_OFF:
+ case HtmlTokenId::SPAN_ON:
+ case HtmlTokenId::SPAN_OFF:
// obsolete
-// case HTML_XMP_ON: //! special handling
-// case HTML_XMP_OFF:
-// case HTML_LISTING_ON: //! special handling
-// case HTML_LISTING_OFF:
+// case HtmlTokenId::XMP_ON: //! special handling
+// case HtmlTokenId::XMP_OFF:
+// case HtmlTokenId::LISTING_ON: //! special handling
+// case HtmlTokenId::LISTING_OFF:
// Netscape
- case HTML_BLINK_ON:
- case HTML_BLINK_OFF:
- case HTML_NOBR_ON:
- case HTML_NOBR_OFF:
- case HTML_NOEMBED_ON:
- case HTML_NOEMBED_OFF:
- case HTML_NOFRAMES_ON:
- case HTML_NOFRAMES_OFF:
+ case HtmlTokenId::BLINK_ON:
+ case HtmlTokenId::BLINK_OFF:
+ case HtmlTokenId::NOBR_ON:
+ case HtmlTokenId::NOBR_OFF:
+ case HtmlTokenId::NOEMBED_ON:
+ case HtmlTokenId::NOEMBED_OFF:
+ case HtmlTokenId::NOFRAMES_ON:
+ case HtmlTokenId::NOFRAMES_OFF:
// Internet Explorer
- case HTML_MARQUEE_ON:
- case HTML_MARQUEE_OFF:
-// case HTML_PLAINTEXT2_ON: //! special handling
-// case HTML_PLAINTEXT2_OFF:
+ case HtmlTokenId::MARQUEE_ON:
+ case HtmlTokenId::MARQUEE_OFF:
+// case HtmlTokenId::PLAINTEXT2_ON: //! special handling
+// case HtmlTokenId::PLAINTEXT2_OFF:
break;
default:
{
- if ( nToken & HTML_TOKEN_ONOFF )
+ if ( nToken >= HtmlTokenId::ONOFF_START )
{
- if ( ( nToken == HTML_UNKNOWNCONTROL_ON ) || ( nToken == HTML_UNKNOWNCONTROL_OFF ) )
+ if ( ( nToken == HtmlTokenId::UNKNOWNCONTROL_ON ) || ( nToken == HtmlTokenId::UNKNOWNCONTROL_OFF ) )
{
;
}
- else if ( !(nToken & 1) )
+ else if ( !isOffToken(nToken) )
{
- DBG_ASSERT( !( nToken & 1 ), "No Start-Token ?!" );
- SkipGroup( nToken + 1 );
+ DBG_ASSERT( !isOffToken( nToken ), "No Start-Token ?!" );
+ SkipGroup( static_cast<HtmlTokenId>((int)nToken + 1) );
}
}
}
@@ -496,9 +496,9 @@ void EditHTMLParser::NextToken( int nToken )
HtmlImportInfo aImportInfo(HtmlImportState::NextToken, this, mpEditEngine->CreateESelection(aCurSel));
aImportInfo.nToken = nToken;
aImportInfo.nTokenValue = (short)nTokenValue;
- if ( nToken == HTML_TEXTTOKEN )
+ if ( nToken == HtmlTokenId::TEXTTOKEN )
aImportInfo.aText = aToken;
- else if (nToken == HTML_STYLE_OFF)
+ else if (nToken == HtmlTokenId::STYLE_OFF)
aImportInfo.aText = maStyleSource.makeStringAndClear();
mpEditEngine->CallHtmlImportHandler(aImportInfo);
}
@@ -669,26 +669,27 @@ void EditHTMLParser::ImpInsertText( const OUString& rText )
aCurSel = mpEditEngine->InsertText(aCurSel, rText);
}
-void EditHTMLParser::SkipGroup( int nEndToken )
+void EditHTMLParser::SkipGroup( HtmlTokenId nEndToken )
{
// groups in cells are closed upon leaving the cell, because those
// ******* web authors don't know their job
// for example: <td><form></td> lacks a closing </form>
sal_uInt8 nCellLevel = nInCell;
- int nToken;
- while( nCellLevel <= nInCell && ( (nToken = GetNextToken() ) != nEndToken ) && nToken )
+ HtmlTokenId nToken;
+ while( nCellLevel <= nInCell && ( (nToken = GetNextToken() ) != nEndToken ) && nToken != HtmlTokenId::NONE )
{
switch ( nToken )
{
- case HTML_TABLEHEADER_ON:
- case HTML_TABLEDATA_ON:
+ case HtmlTokenId::TABLEHEADER_ON:
+ case HtmlTokenId::TABLEDATA_ON:
nInCell++;
break;
- case HTML_TABLEHEADER_OFF:
- case HTML_TABLEDATA_OFF:
+ case HtmlTokenId::TABLEHEADER_OFF:
+ case HtmlTokenId::TABLEDATA_OFF:
if ( nInCell )
nInCell--;
break;
+ default: break;
}
}
}
@@ -793,7 +794,7 @@ void EditHTMLParser::AnchorEnd()
}
}
-void EditHTMLParser::HeadingStart( int nToken )
+void EditHTMLParser::HeadingStart( HtmlTokenId nToken )
{
bWasInPara = bInPara;
StartPara( false );
@@ -802,7 +803,7 @@ void EditHTMLParser::HeadingStart( int nToken )
ImpInsertParaBreak();
sal_uInt16 nId = sal::static_int_cast< sal_uInt16 >(
- 1 + ( ( nToken - HTML_HEAD1_ON ) / 2 ) );
+ 1 + ( ( (int)nToken - (int)HtmlTokenId::HEAD1_ON ) / 2 ) );
DBG_ASSERT( (nId >= 1) && (nId <= 9), "HeadingStart: ID can not be correct!" );
ImpSetStyleSheet( nId );
}
diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index 8b611b019857..4c68f0dcc69f 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -56,9 +56,9 @@ private:
void EndPara();
void AnchorStart();
void AnchorEnd();
- void HeadingStart( int nToken );
+ void HeadingStart( HtmlTokenId nToken );
void HeadingEnd();
- void SkipGroup( int nEndToken );
+ void SkipGroup( HtmlTokenId nEndToken );
bool ThrowAwayBlank();
bool HasTextInCurrentPara();
@@ -68,7 +68,7 @@ private:
void ImpSetStyleSheet( sal_uInt16 nHeadingLevel );
protected:
- virtual void NextToken( int nToken ) override;
+ virtual void NextToken( HtmlTokenId nToken ) override;
public:
EditHTMLParser(SvStream& rIn, const OUString& rBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs);
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 95e41042008a..88c0499eb9c2 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -33,15 +33,16 @@
#include "editeng/editeng.hxx"
#include <svtools/rtftoken.h>
+#include <svtools/htmltokn.h>
using namespace com::sun::star;
-HtmlImportInfo::HtmlImportInfo( HtmlImportState eSt, SvParser* pPrsrs, const ESelection& rSel )
+HtmlImportInfo::HtmlImportInfo( HtmlImportState eSt, SvParser<HtmlTokenId>* pPrsrs, const ESelection& rSel )
: aSelection( rSel )
{
pParser = pPrsrs;
eState = eSt;
- nToken = 0;
+ nToken = HtmlTokenId::NONE;
nTokenValue = 0;
pAttrs = nullptr;
}
@@ -50,7 +51,7 @@ HtmlImportInfo::~HtmlImportInfo()
{
}
-RtfImportInfo::RtfImportInfo( RtfImportState eSt, SvParser* pPrsrs, const ESelection& rSel )
+RtfImportInfo::RtfImportInfo( RtfImportState eSt, SvParser<int>* pPrsrs, const ESelection& rSel )
: aSelection( rSel )
{
pParser = pPrsrs;
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index ad244b97e66a..3eb72a55e656 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -1071,8 +1071,8 @@ void SvxRTFParser::BuildWhichTable()
// Building a Which-Map 'rWhichMap' from an array of
// 'pWhichIds' from Which-Ids. It has the long 'nWhichIds'.
// The Which-Map is not going to be deleted.
- SvParser::BuildWhichTable( aWhichMap, reinterpret_cast<sal_uInt16*>(&aPardMap), sizeof(aPardMap) / sizeof(sal_uInt16) );
- SvParser::BuildWhichTable( aWhichMap, reinterpret_cast<sal_uInt16*>(&aPlainMap), sizeof(aPlainMap) / sizeof(sal_uInt16) );
+ ::BuildWhichTable( aWhichMap, reinterpret_cast<sal_uInt16*>(&aPardMap), sizeof(aPardMap) / sizeof(sal_uInt16) );
+ ::BuildWhichTable( aWhichMap, reinterpret_cast<sal_uInt16*>(&aPlainMap), sizeof(aPlainMap) / sizeof(sal_uInt16) );
}
const SfxItemSet& SvxRTFParser::GetRTFDefaults()
diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx
index 6a392ca79230..ee93d28ddbed 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -108,7 +108,7 @@ bool IsHTMLStream( const uno::Reference<io::XInputStream>& xInStream )
// The string following '<' has to be a known HTML token.
OString aToken = sHeader.copy( nStartOfTagIndex, i - nStartOfTagIndex );
- return GetHTMLToken( OStringToOUString( aToken.toAsciiLowerCase(), RTL_TEXTENCODING_ASCII_US ) ) != 0;
+ return GetHTMLToken( OStringToOUString( aToken.toAsciiLowerCase(), RTL_TEXTENCODING_ASCII_US ) ) != HtmlTokenId::NONE;
}
}
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx
index 00e8a2d65ac0..a13ecf822fcc 100644
--- a/include/editeng/editdata.hxx
+++ b/include/editeng/editdata.hxx
@@ -27,9 +27,10 @@
class SfxItemSet;
class SfxPoolItem;
-class SvParser;
+template<typename T> class SvParser;
class SvxFieldItem;
class SvxRTFItemStackType;
+enum class HtmlTokenId : sal_Int16;
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 };
@@ -219,24 +220,24 @@ enum class HtmlImportState {
struct HtmlImportInfo
{
- SvParser* pParser;
+ SvParser<HtmlTokenId>* pParser;
ESelection aSelection;
HtmlImportState eState;
- int nToken;
+ HtmlTokenId nToken;
short nTokenValue;
OUString aText;
SfxItemSet* pAttrs;
- HtmlImportInfo( HtmlImportState eState, SvParser* pPrsrs, const ESelection& rSel );
+ HtmlImportInfo( HtmlImportState eState, SvParser<HtmlTokenId>* pPrsrs, const ESelection& rSel );
~HtmlImportInfo();
};
struct RtfImportInfo
{
- SvParser* pParser;
+ SvParser<int>* pParser;
ESelection aSelection;
RtfImportState eState;
@@ -247,7 +248,7 @@ struct RtfImportInfo
SvxRTFItemStackType* pAttrs;
- RtfImportInfo( RtfImportState eState, SvParser* pPrsrs, const ESelection& rSel );
+ RtfImportInfo( RtfImportState eState, SvParser<int>* pPrsrs, const ESelection& rSel );
~RtfImportInfo();
};
diff --git a/include/svtools/htmltokn.h b/include/svtools/htmltokn.h
index 8673d466c155..26706c5fc43d 100644
--- a/include/svtools/htmltokn.h
+++ b/include/svtools/htmltokn.h
@@ -22,17 +22,20 @@
#include <svtools/svtdllapi.h>
#include <sal/types.h>
+#include <cassert>
+#include <stdexcept>
namespace rtl {
class OUString;
};
enum class HtmlOptionId;
+enum class HtmlTokenId : sal_Int16;
// search the char for the CharName
sal_Unicode GetHTMLCharName( const rtl::OUString& rName );
// search the TokenID for the token
-SVT_DLLPUBLIC int GetHTMLToken( const rtl::OUString& rName );
+SVT_DLLPUBLIC HtmlTokenId GetHTMLToken( const rtl::OUString& rName );
// search the TokenId for an attribute token
HtmlOptionId GetHTMLOption( const rtl::OUString& rName );
@@ -40,243 +43,257 @@ HtmlOptionId GetHTMLOption( const rtl::OUString& rName );
// search the 24-bit color for a color name (not found = ULONG_MAX)
SVT_DLLPUBLIC sal_uInt32 GetHTMLColor( const rtl::OUString& rName );
-// always starting from 256 on, greater than a char
-const int HTML_TOKEN_START = 0x100;
-const int HTML_TOKEN_ONOFF = 0x200;
-const int HTML_TOKEN_MICROSOFT = 0x1000;
-
-enum HTML_TOKEN_IDS
+enum class HtmlTokenId : sal_Int16
{
- HTML_TEXTTOKEN = HTML_TOKEN_START,
- HTML_SINGLECHAR,
- HTML_NEWPARA,
- HTML_TABCHAR,
- HTML_RAWDATA,
- HTML_LINEFEEDCHAR,
+ INVALID = -1,
+ NONE = 0,
+// always starting from 256 on, greater than a char
+ TEXTTOKEN = 0x100,
+ SINGLECHAR,
+ NEWPARA,
+ TABCHAR,
+ RAWDATA,
+ LINEFEEDCHAR,
// these will only be turned on
- HTML_AREA, // Netscape 2.0
- HTML_BASE, // HTML 3.0
- HTML_COMMENT,
- HTML_DOCTYPE,
- HTML_EMBED, // Netscape 2.0 ignore </EMBED>
- HTML_HORZRULE, // ignore </HR>
- HTML_IMAGE, // ignore </IMG>
- HTML_INPUT, // ignore </INPUT>
- HTML_LINEBREAK, // </BR> -> <BR>
- HTML_LINK, // HTML 3.0
- HTML_META, // HTML 3.0 ignore </META>
- HTML_OPTION, // ignore </OPTION>
- HTML_PARAM, // HotJava
- HTML_SPACER, // Netscape 3.0b5 // ignore </SPACER>
+ AREA, // Netscape 2.0
+ BASE, // HTML 3.0
+ COMMENT,
+ DOCTYPE,
+ EMBED, // Netscape 2.0 ignore </EMBED>
+ HORZRULE, // ignore </HR>
+ IMAGE, // ignore </IMG>
+ INPUT, // ignore </INPUT>
+ LINEBREAK, // </BR> -> <BR>
+ LINK, // HTML 3.0
+ META, // HTML 3.0 ignore </META>
+ OPTION, // ignore </OPTION>
+ PARAM, // HotJava
+ SPACER, // Netscape 3.0b5 // ignore </SPACER>
// tokens recognised using HTML character
- HTML_NONBREAKSPACE,
- HTML_SOFTHYPH,
+ NONBREAKSPACE,
+ SOFTHYPH,
// these will be turned back off,
// the off value is always located behind (+1) !!
- HTML_ABBREVIATION_ON = HTML_TOKEN_ONOFF, // HTML 3.0
- HTML_ABBREVIATION_OFF, // HTML 3.0
- HTML_ACRONYM_ON, // HTML 3.0
- HTML_ACRONYM_OFF, // HTML 3.0
- HTML_ADDRESS_ON,
- HTML_ADDRESS_OFF,
- HTML_ANCHOR_ON,
- HTML_ANCHOR_OFF,
- HTML_APPLET_ON, // HotJava
- HTML_APPLET_OFF, // HotJava
- HTML_AUTHOR_ON, // HTML 3.0
- HTML_AUTHOR_OFF, // HTML 3.0
- HTML_BANNER_ON, // HTML 3.0
- HTML_BANNER_OFF, // HTML 3.0
- HTML_BASEFONT_ON, // Netscape
- HTML_BASEFONT_OFF, // Netscape
- HTML_BIGPRINT_ON, // HTML 3.0
- HTML_BIGPRINT_OFF, // HTML 3.0
- HTML_BLINK_ON, // Netscape
- HTML_BLINK_OFF, // Netscape
- HTML_BLOCKQUOTE30_ON, // HTML 3.0
- HTML_BLOCKQUOTE30_OFF, // HTML 3.0
- HTML_BLOCKQUOTE_ON,
- HTML_BLOCKQUOTE_OFF,
- HTML_BODY_ON,
- HTML_BODY_OFF,
- HTML_BOLD_ON,
- HTML_BOLD_OFF,
- HTML_CAPTION_ON, // HTML 3.0
- HTML_CAPTION_OFF, // HTML 3.0
- HTML_CENTER_ON, // Netscape
- HTML_CENTER_OFF, // Netscape
- HTML_CITIATION_ON,
- HTML_CITIATION_OFF,
- HTML_CODE_ON,
- HTML_CODE_OFF,
- HTML_COL_ON, // HTML3 Table Model Draft
- HTML_COL_OFF, // HTML3 Table Model Draft
- HTML_COLGROUP_ON, // HTML3 Table Model Draft
- HTML_COLGROUP_OFF, // HTML3 Table Model Draft
- HTML_CREDIT_ON, // HTML 3.0
- HTML_CREDIT_OFF, // HTML 3.0
- HTML_DD_ON,
- HTML_DD_OFF,
- HTML_DEFLIST_ON,
- HTML_DEFLIST_OFF,
- HTML_DELETEDTEXT_ON, // HTML 3.0
- HTML_DELETEDTEXT_OFF, // HTML 3.0
- HTML_DIRLIST_ON,
- HTML_DIRLIST_OFF,
- HTML_DIVISION_ON, // HTML 3.0
- HTML_DIVISION_OFF, // HTML 3.0
- HTML_DT_ON,
- HTML_DT_OFF,
- HTML_EMPHASIS_ON,
- HTML_EMPHASIS_OFF,
- HTML_FIGURE_ON, // HTML 3.0
- HTML_FIGURE_OFF, // HTML 3.0
- HTML_FONT_ON, // Netscape
- HTML_FONT_OFF, // Netscape
- HTML_FOOTNOTE_ON, // HTML 3.0
- HTML_FOOTNOTE_OFF, // HTML 3.0
- HTML_FORM_ON,
- HTML_FORM_OFF,
- HTML_FRAME_ON, // Netscape 2.0
- HTML_FRAME_OFF, // Netscape 2.0
- HTML_FRAMESET_ON, // Netscape 2.0
- HTML_FRAMESET_OFF, // Netscape 2.0
- HTML_HEAD1_ON,
- HTML_HEAD1_OFF,
- HTML_HEAD2_ON,
- HTML_HEAD2_OFF,
- HTML_HEAD3_ON,
- HTML_HEAD3_OFF,
- HTML_HEAD4_ON,
- HTML_HEAD4_OFF,
- HTML_HEAD5_ON,
- HTML_HEAD5_OFF,
- HTML_HEAD6_ON,
- HTML_HEAD6_OFF,
- HTML_HEAD_ON,
- HTML_HEAD_OFF,
- HTML_HTML_ON,
- HTML_HTML_OFF,
- HTML_IFRAME_ON, // IE 3.0b2
- HTML_IFRAME_OFF, // IE 3.0b2
- HTML_INSERTEDTEXT_ON, // HTML 3.0
- HTML_INSERTEDTEXT_OFF, // HTML 3.0
- HTML_ITALIC_ON,
- HTML_ITALIC_OFF,
- HTML_KEYBOARD_ON,
- HTML_KEYBOARD_OFF,
- HTML_LANGUAGE_ON, // HTML 3.0
- HTML_LANGUAGE_OFF, // HTML 3.0
- HTML_LISTHEADER_ON, // HTML 3.0
- HTML_LISTHEADER_OFF, // HTML 3.0
- HTML_LI_ON,
- HTML_LI_OFF,
- HTML_MAP_ON, // Netscape 2.0
- HTML_MAP_OFF, // Netscape 2.0
- HTML_MENULIST_ON,
- HTML_MENULIST_OFF,
- HTML_MULTICOL_ON, // Netscape 3.0b5
- HTML_MULTICOL_OFF, // Netscape 3.0b5
- HTML_NOBR_ON, // Netscape
- HTML_NOBR_OFF, // Netscape
- HTML_NOEMBED_ON, // Netscape 2.0
- HTML_NOEMBED_OFF, // Netscape 2.0
- HTML_NOFRAMES_ON, // Netscape 2.0
- HTML_NOFRAMES_OFF, // Netscape 2.0
- HTML_NOSCRIPT_ON, // Netscape 2.0
- HTML_NOSCRIPT_OFF, // Netscape 3.0
- HTML_NOTE_ON, // HTML 3.0
- HTML_NOTE_OFF, // HTML 3.0
- HTML_OBJECT_ON, // HotJava
- HTML_OBJECT_OFF, // HotJava
- HTML_ORDERLIST_ON,
- HTML_ORDERLIST_OFF,
- HTML_PARABREAK_ON,
- HTML_PARABREAK_OFF,
- HTML_PERSON_ON, // HTML 3.0
- HTML_PERSON_OFF, // HTML 3.0
- HTML_PLAINTEXT_ON, // HTML 3.0
- HTML_PLAINTEXT_OFF, // HTML 3.0
- HTML_PREFORMTXT_ON,
- HTML_PREFORMTXT_OFF,
- HTML_SAMPLE_ON,
- HTML_SAMPLE_OFF,
- HTML_SCRIPT_ON, // HTML 3.2
- HTML_SCRIPT_OFF, // HTML 3.2
- HTML_SELECT_ON,
- HTML_SELECT_OFF,
- HTML_SHORTQUOTE_ON, // HTML 3.0
- HTML_SHORTQUOTE_OFF, // HTML 3.0
- HTML_SMALLPRINT_ON, // HTML 3.0
- HTML_SMALLPRINT_OFF, // HTML 3.0
- HTML_SPAN_ON, // Style Sheets
- HTML_SPAN_OFF, // Style Sheets
- HTML_STRIKETHROUGH_ON, // HTML 3.0
- HTML_STRIKETHROUGH_OFF, // HTML 3.0
- HTML_STRONG_ON,
- HTML_STRONG_OFF,
- HTML_STYLE_ON, // HTML 3.0
- HTML_STYLE_OFF, // HTML 3.0
- HTML_SUBSCRIPT_ON, // HTML 3.0
- HTML_SUBSCRIPT_OFF, // HTML 3.0
- HTML_SUPERSCRIPT_ON, // HTML 3.0
- HTML_SUPERSCRIPT_OFF, // HTML 3.0
- HTML_TABLE_ON, // HTML 3.0
- HTML_TABLE_OFF, // HTML 3.0
- HTML_TABLEDATA_ON, // HTML 3.0
- HTML_TABLEDATA_OFF, // HTML 3.0
- HTML_TABLEHEADER_ON, // HTML 3.0
- HTML_TABLEHEADER_OFF, // HTML 3.0
- HTML_TABLEROW_ON, // HTML 3.0
- HTML_TABLEROW_OFF, // HTML 3.0
- HTML_TBODY_ON, // HTML3 Table Model Draft
- HTML_TBODY_OFF, // HTML3 Table Model Draft
- HTML_TELETYPE_ON,
- HTML_TELETYPE_OFF,
- HTML_TEXTAREA_ON,
- HTML_TEXTAREA_OFF,
- HTML_TFOOT_ON, // HTML3 Table Model Draft
- HTML_TFOOT_OFF, // HTML3 Table Model Draft
- HTML_THEAD_ON, // HTML3 Table Model Draft
- HTML_THEAD_OFF, // HTML3 Table Model Draft
- HTML_TITLE_ON,
- HTML_TITLE_OFF,
- HTML_UNDERLINE_ON,
- HTML_UNDERLINE_OFF,
- HTML_UNORDERLIST_ON,
- HTML_UNORDERLIST_OFF,
- HTML_VARIABLE_ON,
- HTML_VARIABLE_OFF,
+ ONOFF_START,
+ ABBREVIATION_ON = ONOFF_START, // HTML 3.0
+ ABBREVIATION_OFF, // HTML 3.0
+ ACRONYM_ON, // HTML 3.0
+ ACRONYM_OFF, // HTML 3.0
+ ADDRESS_ON,
+ ADDRESS_OFF,
+ ANCHOR_ON,
+ ANCHOR_OFF,
+ APPLET_ON, // HotJava
+ APPLET_OFF, // HotJava
+ AUTHOR_ON, // HTML 3.0
+ AUTHOR_OFF, // HTML 3.0
+ BANNER_ON, // HTML 3.0
+ BANNER_OFF, // HTML 3.0
+ BASEFONT_ON, // Netscape
+ BASEFONT_OFF, // Netscape
+ BIGPRINT_ON, // HTML 3.0
+ BIGPRINT_OFF, // HTML 3.0
+ BLINK_ON, // Netscape
+ BLINK_OFF, // Netscape
+ BLOCKQUOTE30_ON, // HTML 3.0
+ BLOCKQUOTE30_OFF, // HTML 3.0
+ BLOCKQUOTE_ON,
+ BLOCKQUOTE_OFF,
+ BODY_ON,
+ BODY_OFF,
+ BOLD_ON,
+ BOLD_OFF,
+ CAPTION_ON, // HTML 3.0
+ CAPTION_OFF, // HTML 3.0
+ CENTER_ON, // Netscape
+ CENTER_OFF, // Netscape
+ CITIATION_ON,
+ CITIATION_OFF,
+ CODE_ON,
+ CODE_OFF,
+ COL_ON, // HTML3 Table Model Draft
+ COL_OFF, // HTML3 Table Model Draft
+ COLGROUP_ON, // HTML3 Table Model Draft
+ COLGROUP_OFF, // HTML3 Table Model Draft
+ CREDIT_ON, // HTML 3.0
+ CREDIT_OFF, // HTML 3.0
+ DD_ON,
+ DD_OFF,
+ DEFLIST_ON,
+ DEFLIST_OFF,
+ DELETEDTEXT_ON, // HTML 3.0
+ DELETEDTEXT_OFF, // HTML 3.0
+ DIRLIST_ON,
+ DIRLIST_OFF,
+ DIVISION_ON, // HTML 3.0
+ DIVISION_OFF, // HTML 3.0
+ DT_ON,
+ DT_OFF,
+ EMPHASIS_ON,
+ EMPHASIS_OFF,
+ FIGURE_ON, // HTML 3.0
+ FIGURE_OFF, // HTML 3.0
+ FONT_ON, // Netscape
+ FONT_OFF, // Netscape
+ FOOTNOTE_ON, // HTML 3.0
+ FOOTNOTE_OFF, // HTML 3.0
+ FORM_ON,
+ FORM_OFF,
+ FRAME_ON, // Netscape 2.0
+ FRAME_OFF, // Netscape 2.0
+ FRAMESET_ON, // Netscape 2.0
+ FRAMESET_OFF, // Netscape 2.0
+ HEAD1_ON,
+ HEAD1_OFF,
+ HEAD2_ON,
+ HEAD2_OFF,
+ HEAD3_ON,
+ HEAD3_OFF,
+ HEAD4_ON,
+ HEAD4_OFF,
+ HEAD5_ON,
+ HEAD5_OFF,
+ HEAD6_ON,
+ HEAD6_OFF,
+ HEAD_ON,
+ HEAD_OFF,
+ HTML_ON,
+ HTML_OFF,
+ IFRAME_ON, // IE 3.0b2
+ IFRAME_OFF, // IE 3.0b2
+ INSERTEDTEXT_ON, // HTML 3.0
+ INSERTEDTEXT_OFF, // HTML 3.0
+ ITALIC_ON,
+ ITALIC_OFF,
+ KEYBOARD_ON,
+ KEYBOARD_OFF,
+ LANGUAGE_ON, // HTML 3.0
+ LANGUAGE_OFF, // HTML 3.0
+ LISTHEADER_ON, // HTML 3.0
+ LISTHEADER_OFF, // HTML 3.0
+ LI_ON,
+ LI_OFF,
+ MAP_ON, // Netscape 2.0
+ MAP_OFF, // Netscape 2.0
+ MENULIST_ON,
+ MENULIST_OFF,
+ MULTICOL_ON, // Netscape 3.0b5
+ MULTICOL_OFF, // Netscape 3.0b5
+ NOBR_ON, // Netscape
+ NOBR_OFF, // Netscape
+ NOEMBED_ON, // Netscape 2.0
+ NOEMBED_OFF, // Netscape 2.0
+ NOFRAMES_ON, // Netscape 2.0
+ NOFRAMES_OFF, // Netscape 2.0
+ NOSCRIPT_ON, // Netscape 2.0
+ NOSCRIPT_OFF, // Netscape 3.0
+ NOTE_ON, // HTML 3.0
+ NOTE_OFF, // HTML 3.0
+ OBJECT_ON, // HotJava
+ OBJECT_OFF, // HotJava
+ ORDERLIST_ON,
+ ORDERLIST_OFF,
+ PARABREAK_ON,
+ PARABREAK_OFF,
+ PERSON_ON, // HTML 3.0
+ PERSON_OFF, // HTML 3.0
+ PLAINTEXT_ON, // HTML 3.0
+ PLAINTEXT_OFF, // HTML 3.0
+ PREFORMTXT_ON,
+ PREFORMTXT_OFF,
+ SAMPLE_ON,
+ SAMPLE_OFF,
+ SCRIPT_ON, // HTML 3.2
+ SCRIPT_OFF, // HTML 3.2
+ SELECT_ON,
+ SELECT_OFF,
+ SHORTQUOTE_ON, // HTML 3.0
+ SHORTQUOTE_OFF, // HTML 3.0
+ SMALLPRINT_ON, // HTML 3.0
+ SMALLPRINT_OFF, // HTML 3.0
+ SPAN_ON, // Style Sheets
+ SPAN_OFF, // Style Sheets
+ STRIKETHROUGH_ON, // HTML 3.0
+ STRIKETHROUGH_OFF, // HTML 3.0
+ STRONG_ON,
+ STRONG_OFF,
+ STYLE_ON, // HTML 3.0
+ STYLE_OFF, // HTML 3.0
+ SUBSCRIPT_ON, // HTML 3.0
+ SUBSCRIPT_OFF, // HTML 3.0
+ SUPERSCRIPT_ON, // HTML 3.0
+ SUPERSCRIPT_OFF, // HTML 3.0
+ TABLE_ON, // HTML 3.0
+ TABLE_OFF, // HTML 3.0
+ TABLEDATA_ON, // HTML 3.0
+ TABLEDATA_OFF, // HTML 3.0
+ TABLEHEADER_ON, // HTML 3.0
+ TABLEHEADER_OFF, // HTML 3.0
+ TABLEROW_ON, // HTML 3.0
+ TABLEROW_OFF, // HTML 3.0
+ TBODY_ON, // HTML3 Table Model Draft
+ TBODY_OFF, // HTML3 Table Model Draft
+ TELETYPE_ON,
+ TELETYPE_OFF,
+ TEXTAREA_ON,
+ TEXTAREA_OFF,
+ TFOOT_ON, // HTML3 Table Model Draft
+ TFOOT_OFF, // HTML3 Table Model Draft
+ THEAD_ON, // HTML3 Table Model Draft
+ THEAD_OFF, // HTML3 Table Model Draft
+ TITLE_ON,
+ TITLE_OFF,
+ UNDERLINE_ON,
+ UNDERLINE_OFF,
+ UNORDERLIST_ON,
+ UNORDERLIST_OFF,
+ VARIABLE_ON,
+ VARIABLE_OFF,
// obsolete features
- HTML_XMP_ON,
- HTML_XMP_OFF,
- HTML_LISTING_ON,
- HTML_LISTING_OFF,
+ XMP_ON,
+ XMP_OFF,
+ LISTING_ON,
+ LISTING_OFF,
// proposed features
- HTML_DEFINSTANCE_ON,
- HTML_DEFINSTANCE_OFF,
- HTML_STRIKE_ON,
- HTML_STRIKE_OFF,
-
- HTML_UNKNOWNCONTROL_ON,
- HTML_UNKNOWNCONTROL_OFF,
-
- HTML_COMMENT2_ON = HTML_TOKEN_MICROSOFT|HTML_TOKEN_ONOFF, // HTML 2.0 ?
- HTML_COMMENT2_OFF, // HTML 2.0 ?
- HTML_MARQUEE_ON,
- HTML_MARQUEE_OFF,
- HTML_PLAINTEXT2_ON, // HTML 2.0 ?
- HTML_PLAINTEXT2_OFF, // HTML 2.0 ?
-
- HTML_SDFIELD_ON,
- HTML_SDFIELD_OFF
+ DEFINSTANCE_ON,
+ DEFINSTANCE_OFF,
+ STRIKE_ON,
+ STRIKE_OFF,
+
+ UNKNOWNCONTROL_ON,
+ UNKNOWNCONTROL_OFF,
+
+ // Microsoft features
+ COMMENT2_ON, // HTML 2.0 ?
+ COMMENT2_OFF, // HTML 2.0 ?
+ MARQUEE_ON,
+ MARQUEE_OFF,
+ PLAINTEXT2_ON, // HTML 2.0 ?
+ PLAINTEXT2_OFF, // HTML 2.0 ?
+
+ SDFIELD_ON,
+ SDFIELD_OFF
};
+constexpr bool isOffToken(HtmlTokenId nToken)
+{
+ return (nToken == HtmlTokenId::NONE || nToken >= HtmlTokenId::ONOFF_START)
+ ? (1 & (int)nToken)
+ : throw std::logic_error("Assertion failed!"); // C++11 does not do assert in constexpr
+}
+
+constexpr HtmlTokenId getOnToken(HtmlTokenId nToken)
+{
+ return (nToken == HtmlTokenId::NONE || nToken >= HtmlTokenId::ONOFF_START)
+ ? HtmlTokenId(~1 & (int)nToken)
+ : throw std::logic_error("Assertion failed!"); // C++11 does not do assert in constexpr
+}
+
// HTML attribute token (=Options)
enum class HtmlOptionId
diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx
index b6e7260b235c..89a0d5aeedf1 100644
--- a/include/svtools/parhtml.hxx
+++ b/include/svtools/parhtml.hxx
@@ -142,7 +142,7 @@ public:
typedef ::std::vector<HTMLOption> HTMLOptions;
-class SVT_DLLPUBLIC HTMLParser : public SvParser
+class SVT_DLLPUBLIC HTMLParser : public SvParser<HtmlTokenId>
{
private:
mutable HTMLOptions maOptions; // options of the start tag
@@ -164,19 +164,19 @@ private:
sal_uInt32 nPre_LinePos; // Pos in the line in the PRE-Tag
- int mnPendingOffToken; ///< OFF token pending for a <XX.../> ON/OFF ON token
+ HtmlTokenId mnPendingOffToken; ///< OFF token pending for a <XX.../> ON/OFF ON token
OUString aEndToken;
protected:
OUString sSaveToken; // the read tag as string
- int ScanText( const sal_Unicode cBreak = 0U );
+ HtmlTokenId ScanText( const sal_Unicode cBreak = 0U );
- int GetNextRawToken();
+ HtmlTokenId GetNextRawToken();
// scan next token
- virtual int GetNextToken_() override;
+ virtual HtmlTokenId GetNextToken_() override;
virtual ~HTMLParser() override;
@@ -198,15 +198,15 @@ public:
// start PRE-/LISTING or XMP mode or filter tags respectively
inline void StartPRE();
void FinishPRE() { bReadPRE = false; }
- int FilterPRE( int nToken );
+ HtmlTokenId FilterPRE( HtmlTokenId nToken );
inline void StartListing();
void FinishListing() { bReadListing = false; }
- int FilterListing( int nToken );
+ HtmlTokenId FilterListing( HtmlTokenId nToken );
inline void StartXMP();
void FinishXMP() { bReadXMP = false; }
- int FilterXMP( int nToken );
+ HtmlTokenId FilterXMP( HtmlTokenId nToken );
void FinishTextArea() { bReadTextArea = false; }
@@ -217,7 +217,7 @@ public:
// (PRE, XMP, ...) and set the flags. Is called by Continue before
// NextToken is called. If you implement own loops or call
// NextToken yourself, you should call this method beforehand.
- int FilterToken( int nToken );
+ HtmlTokenId FilterToken( HtmlTokenId nToken );
void ReadRawData( const OUString &rEndToken ) { aEndToken = rEndToken; }
@@ -230,7 +230,7 @@ public:
const HTMLOptions& GetOptions( HtmlOptionId *pNoConvertToken=nullptr );
// for asynchronous reading from the SvStream
- virtual void Continue( int nToken ) override;
+ virtual void Continue( HtmlTokenId nToken ) override;
protected:
diff --git a/include/svtools/parrtf.hxx b/include/svtools/parrtf.hxx
index 05baf76e57f9..0e870f685c89 100644
--- a/include/svtools/parrtf.hxx
+++ b/include/svtools/parrtf.hxx
@@ -34,7 +34,7 @@ struct RtfParserState_Impl
{}
};
-class SVT_DLLPUBLIC SvRTFParser : public SvParser
+class SVT_DLLPUBLIC SvRTFParser : public SvParser<int>
{
std::stack< RtfParserState_Impl > aParserStates;
int nOpenBrakets;
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index 67f77ee2ab28..136eb3a42573 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVTOOLS_SVPARSER_HXX
#include <svtools/svtdllapi.h>
+#include <svtools/htmltokn.h>
#include <tools/link.hxx>
#include <tools/ref.hxx>
#include <tools/solar.h>
@@ -29,7 +30,7 @@
#include <vector>
#include <memory>
-struct SvParser_Impl;
+template<typename T> struct SvParser_Impl;
class SvStream;
enum class SvParserState
@@ -41,6 +42,7 @@ enum class SvParserState
Error
};
+template<typename T>
class SVT_DLLPUBLIC SvParser : public SvRefBase
{
DECL_LINK( NewDataRead, LinkParamNone*, void );
@@ -51,20 +53,18 @@ protected:
sal_uLong nlLineNr; // current line number
sal_uLong nlLinePos; // current column number
- std::unique_ptr<SvParser_Impl> pImplData; // internal data
+ std::unique_ptr<SvParser_Impl<T>> pImplData; // internal data
long nTokenValue; // additional value (RTF)
bool bTokenHasValue; // indicates whether nTokenValue is valid
SvParserState eState; // status also in derived classes
- rtl_TextEncoding eSrcEnc; // Source encoding
-
- sal_uLong nNextChPos;
- sal_uInt32 nNextCh; // current character codepoint in UTF32 for the "lex"
+ rtl_TextEncoding eSrcEnc; // Source encoding
+ sal_uLong nNextChPos;
+ sal_uInt32 nNextCh; // current character codepoint in UTF32 for the "lex"
bool bUCS2BSrcEnc : 1; // or as big-endian UCS2
bool bSwitchToUCS2 : 1; // switching is allowed
-
bool bRTF_InTextRead : 1; // only for RTF-Parser!!!
struct TokenStackType
@@ -72,28 +72,23 @@ protected:
OUString sToken;
long nTokenValue;
bool bTokenHasValue;
- int nTokenId;
-
- TokenStackType()
- : nTokenValue(0)
- , bTokenHasValue(false)
- , nTokenId(0)
- {
- }
+ T nTokenId;
+
+ TokenStackType();
};
// methods for Token stack
- int SkipToken( short nCnt = -1 ); // "skip" n Tokens back
+ T SkipToken( short nCnt = -1 ); // "skip" n Tokens back
TokenStackType* GetStackPtr( short nCnt );
// scan the next token:
// work off Token stack and call GetNextToken_() if necessary.
// That one is responsible for the recognition of new Tokens.
- int GetNextToken();
- virtual int GetNextToken_() = 0;
+ T GetNextToken();
+ virtual T GetNextToken_() = 0;
// is called for each Token that is recognized in CallParser
- virtual void NextToken( int nToken );
+ virtual void NextToken( T nToken );
// at times of SvRefBase derivation, not everybody may delete
virtual ~SvParser() override;
@@ -110,63 +105,49 @@ public:
virtual SvParserState CallParser() = 0; // calling of the parser
- SvParserState GetStatus() const { return eState; } // StatusInfo
+ SvParserState GetStatus() const; // StatusInfo
- sal_uLong GetLineNr() const { return nlLineNr; }
- sal_uLong GetLinePos() const { return nlLinePos; }
- void IncLineNr() { ++nlLineNr; }
- sal_uLong IncLinePos() { return ++nlLinePos; }
- inline void SetLineNr( sal_uLong nlNum ); // inline bottom
- inline void SetLinePos( sal_uLong nlPos ); // inline bottom
+ sal_uLong GetLineNr() const;
+ sal_uLong GetLinePos() const;
+ void IncLineNr();
+ sal_uLong IncLinePos();
+ void SetLineNr( sal_uLong nlNum );
+ void SetLinePos( sal_uLong nlPos );
sal_uInt32 GetNextChar(); // Return next Unicode codepoint in UTF32.
void RereadLookahead();
- bool IsParserWorking() const { return SvParserState::Working == eState; }
+ bool IsParserWorking() const;
- Link<LinkParamNone*,void> GetAsynchCallLink() const
- { return LINK( const_cast<SvParser*>(this), SvParser, NewDataRead ); }
+ Link<LinkParamNone*,void> GetAsynchCallLink() const;
// for asynchronous reading from the SvStream
- void SaveState( int nToken );
+ void SaveState( T nToken );
void RestoreState();
- virtual void Continue( int nToken );
+ virtual void Continue( T nToken );
// Set/get source encoding. The UCS2BEncoding flag is valid if source
// encoding is UCS2. It specifies a big endian encoding.
void SetSrcEncoding( rtl_TextEncoding eSrcEnc );
- rtl_TextEncoding GetSrcEncoding() const { return eSrcEnc; }
+ rtl_TextEncoding GetSrcEncoding() const;
// May the character set be switched to UCS/2, if a BOM
// is in the first two characters of the stream?
- void SetSwitchToUCS2( bool bSet ) { bSwitchToUCS2 = bSet; }
- bool IsSwitchToUCS2() const { return bSwitchToUCS2; }
+ void SetSwitchToUCS2( bool bSet );
+ bool IsSwitchToUCS2() const;
// how many bytes a character consists of
- inline sal_uInt16 GetCharSize() const;
+ sal_uInt16 GetCharSize() const;
- int GetSaveToken() const;
+ T GetSaveToken() const;
+};
- // build a Which-Map 'rWhichMap' from an array of WhichIds
- // 'pWhichIds'. It has the length 'nWhichIds'.
- // The WhichMap is not deleted.
- static void BuildWhichTable( std::vector<sal_uInt16> &rWhichMap,
+// build a Which-Map 'rWhichMap' from an array of WhichIds
+// 'pWhichIds'. It has the length 'nWhichIds'.
+// The WhichMap is not deleted.
+SVT_DLLPUBLIC void BuildWhichTable( std::vector<sal_uInt16> &rWhichMap,
sal_uInt16 *pWhichIds,
sal_uInt16 nWhichIds );
-};
-
-
-inline void SvParser::SetLineNr( sal_uLong nlNum )
-{ nlLineNr = nlNum; }
-
-inline void SvParser::SetLinePos( sal_uLong nlPos )
-{ nlLinePos = nlPos; }
-
-inline sal_uInt16 SvParser::GetCharSize() const
-{
- return (RTL_TEXTENCODING_UCS2 == eSrcEnc) ? 2 : 1;
-}
-
/*========================================================================
*
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index b1f5f408bdc6..9d768d53cee3 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -949,7 +949,7 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo )
TableOn( pInfo );
}
bInCell = true;
- bool bHorJustifyCenterTH = (pInfo->nToken == HTML_TABLEHEADER_ON);
+ bool bHorJustifyCenterTH = (pInfo->nToken == HtmlTokenId::TABLEHEADER_ON);
const HTMLOptions& rOptions = static_cast<HTMLParser*>(pInfo->pParser)->GetOptions();
for (const auto & rOption : rOptions)
{
@@ -1070,7 +1070,7 @@ void ScHTMLLayoutParser::TableOn( HtmlImportInfo* pInfo )
nTableWidth = nLastWidth / static_cast<sal_uInt16>((nMaxCol - nColCntStart));
}
nLastWidth = nTableWidth;
- if ( pInfo->nToken == HTML_TABLE_ON )
+ if ( pInfo->nToken == HtmlTokenId::TABLE_ON )
{ // It can still be TD or TH, if we didn't have a TABLE earlier
const HTMLOptions& rOptions = static_cast<HTMLParser*>(pInfo->pParser)->GetOptions();
for (const auto & rOption : rOptions)
@@ -1129,7 +1129,7 @@ void ScHTMLLayoutParser::TableOn( HtmlImportInfo* pInfo )
if (nMaxTable > 0)
nOffsetTolerance = SC_HTML_OFFSET_TOLERANCE_LARGE;
nTableWidth = 0;
- if ( pInfo->nToken == HTML_TABLE_ON )
+ if ( pInfo->nToken == HtmlTokenId::TABLE_ON )
{
// It can still be TD or TH, if we didn't have a TABLE earlier
const HTMLOptions& rOptions = static_cast<HTMLParser*>(pInfo->pParser)->GetOptions();
@@ -1524,7 +1524,7 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
bool bSetLastToken = true;
switch ( pInfo->nToken )
{
- case HTML_META:
+ case HtmlTokenId::META:
{
HTMLParser* pParser = static_cast<HTMLParser*>(pInfo->pParser);
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
@@ -1534,13 +1534,13 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
mpDoc->GetDocumentShell()->GetHeaderAttributes() );
}
break;
- case HTML_TITLE_ON:
+ case HtmlTokenId::TITLE_ON:
{
bInTitle = true;
aString.clear();
}
break;
- case HTML_TITLE_OFF:
+ case HtmlTokenId::TITLE_OFF:
{
if ( bInTitle && !aString.isEmpty() )
{
@@ -1554,17 +1554,17 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
bInTitle = false;
}
break;
- case HTML_TABLE_ON:
+ case HtmlTokenId::TABLE_ON:
{
TableOn( pInfo );
}
break;
- case HTML_COL_ON:
+ case HtmlTokenId::COL_ON:
{
ColOn( pInfo );
}
break;
- case HTML_TABLEHEADER_ON: // Opens row
+ case HtmlTokenId::TABLEHEADER_ON: // Opens row
{
if ( bInCell )
CloseEntry( pInfo );
@@ -1573,54 +1573,54 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
SvxWeightItem( WEIGHT_BOLD, ATTR_FONT_WEIGHT) );
SAL_FALLTHROUGH;
}
- case HTML_TABLEDATA_ON: // Opens cell
+ case HtmlTokenId::TABLEDATA_ON: // Opens cell
{
TableDataOn( pInfo );
}
break;
- case HTML_TABLEHEADER_OFF:
- case HTML_TABLEDATA_OFF: // Closes cell
+ case HtmlTokenId::TABLEHEADER_OFF:
+ case HtmlTokenId::TABLEDATA_OFF: // Closes cell
{
TableDataOff( pInfo );
}
break;
- case HTML_TABLEROW_ON: // Before first cell in row
+ case HtmlTokenId::TABLEROW_ON: // Before first cell in row
{
TableRowOn( pInfo );
}
break;
- case HTML_TABLEROW_OFF: // After last cell in row
+ case HtmlTokenId::TABLEROW_OFF: // After last cell in row
{
TableRowOff( pInfo );
}
break;
- case HTML_TABLE_OFF:
+ case HtmlTokenId::TABLE_OFF:
{
TableOff( pInfo );
}
break;
- case HTML_IMAGE:
+ case HtmlTokenId::IMAGE:
{
Image( pInfo );
}
break;
- case HTML_PARABREAK_OFF:
+ case HtmlTokenId::PARABREAK_OFF:
{ // We continue vertically after an image
if ( pActEntry->maImageList.size() > 0 )
pActEntry->maImageList.back()->nDir = nVertical;
}
break;
- case HTML_ANCHOR_ON:
+ case HtmlTokenId::ANCHOR_ON:
{
AnchorOn( pInfo );
}
break;
- case HTML_FONT_ON :
+ case HtmlTokenId::FONT_ON :
{
FontOn( pInfo );
}
break;
- case HTML_BIGPRINT_ON :
+ case HtmlTokenId::BIGPRINT_ON :
{
// TODO: Remember current font size and increase by 1
if ( IsAtBeginningOfText( pInfo ) )
@@ -1628,7 +1628,7 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
maFontHeights[3], 100, ATTR_FONT_HEIGHT ) );
}
break;
- case HTML_SMALLPRINT_ON :
+ case HtmlTokenId::SMALLPRINT_ON :
{
// TODO: Remember current font size and decrease by 1
if ( IsAtBeginningOfText( pInfo ) )
@@ -1636,28 +1636,28 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
maFontHeights[0], 100, ATTR_FONT_HEIGHT ) );
}
break;
- case HTML_BOLD_ON :
- case HTML_STRONG_ON :
+ case HtmlTokenId::BOLD_ON :
+ case HtmlTokenId::STRONG_ON :
{
if ( IsAtBeginningOfText( pInfo ) )
pActEntry->aItemSet.Put( SvxWeightItem( WEIGHT_BOLD,
ATTR_FONT_WEIGHT ) );
}
break;
- case HTML_ITALIC_ON :
- case HTML_EMPHASIS_ON :
- case HTML_ADDRESS_ON :
- case HTML_BLOCKQUOTE_ON :
- case HTML_BLOCKQUOTE30_ON :
- case HTML_CITIATION_ON :
- case HTML_VARIABLE_ON :
+ case HtmlTokenId::ITALIC_ON :
+ case HtmlTokenId::EMPHASIS_ON :
+ case HtmlTokenId::ADDRESS_ON :
+ case HtmlTokenId::BLOCKQUOTE_ON :
+ case HtmlTokenId::BLOCKQUOTE30_ON :
+ case HtmlTokenId::CITIATION_ON :
+ case HtmlTokenId::VARIABLE_ON :
{
if ( IsAtBeginningOfText( pInfo ) )
pActEntry->aItemSet.Put( SvxPostureItem( ITALIC_NORMAL,
ATTR_FONT_POSTURE ) );
}
break;
- case HTML_DEFINSTANCE_ON :
+ case HtmlTokenId::DEFINSTANCE_ON :
{
if ( IsAtBeginningOfText( pInfo ) )
{
@@ -1668,26 +1668,26 @@ void ScHTMLLayoutParser::ProcToken( HtmlImportInfo* pInfo )
}
}
break;
- case HTML_UNDERLINE_ON :
+ case HtmlTokenId::UNDERLINE_ON :
{
if ( IsAtBeginningOfText( pInfo ) )
pActEntry->aItemSet.Put( SvxUnderlineItem( LINESTYLE_SINGLE,
ATTR_FONT_UNDERLINE ) );
}
break;
- case HTML_TEXTTOKEN:
+ case HtmlTokenId::TEXTTOKEN:
{
if ( bInTitle )
aString += pInfo->aText;
}
break;
default:
- { // Don't set nLastToken!
+ { // Don't set nHtmlLastToken!
bSetLastToken = false;
}
}
if ( bSetLastToken )
- nLastToken = pInfo->nToken;
+ nHtmlLastToken = pInfo->nToken;
}
// HTML DATA QUERY PARSER
@@ -2335,7 +2335,7 @@ bool ScHTMLTable::IsEmptyCell() const
bool ScHTMLTable::IsSpaceCharInfo( const HtmlImportInfo& rInfo )
{
- return (rInfo.nToken == HTML_TEXTTOKEN) && (rInfo.aText.getLength() == 1) && (rInfo.aText[ 0 ] == ' ');
+ return (rInfo.nToken == HtmlTokenId::TEXTTOKEN) && (rInfo.aText.getLength() == 1) && (rInfo.aText[ 0 ] == ' ');
}
ScHTMLTable::ScHTMLEntryPtr ScHTMLTable::CreateEntry() const
@@ -2531,7 +2531,7 @@ void ScHTMLTable::ImplDataOff()
void ScHTMLTable::ProcessFormatOptions( SfxItemSet& rItemSet, const HtmlImportInfo& rInfo )
{
// special handling for table header cells
- if( rInfo.nToken == HTML_TABLEHEADER_ON )
+ if( rInfo.nToken == HtmlTokenId::TABLEHEADER_ON )
{
rItemSet.Put( SvxWeightItem( WEIGHT_BOLD, ATTR_FONT_WEIGHT ) );
rItemSet.Put( SvxHorJustifyItem( SvxCellHorJustify::Center, ATTR_HOR_JUSTIFY ) );
@@ -2876,80 +2876,81 @@ void ScHTMLQueryParser::ProcessToken( const HtmlImportInfo& rInfo )
switch( rInfo.nToken )
{
// --- meta data ---
- case HTML_META: MetaOn( rInfo ); break; // <meta>
+ case HtmlTokenId::META: MetaOn( rInfo ); break; // <meta>
// --- title handling ---
- case HTML_TITLE_ON: TitleOn( rInfo ); break; // <title>
- case HTML_TITLE_OFF: TitleOff( rInfo ); break; // </title>
+ case HtmlTokenId::TITLE_ON: TitleOn( rInfo ); break; // <title>
+ case HtmlTokenId::TITLE_OFF: TitleOff( rInfo ); break; // </title>
- case HTML_STYLE_ON: break;
- case HTML_STYLE_OFF: ParseStyle(rInfo.aText); break;
+ case HtmlTokenId::STYLE_ON: break;
+ case HtmlTokenId::STYLE_OFF: ParseStyle(rInfo.aText); break;
// --- body handling ---
- case HTML_BODY_ON: mpCurrTable->BodyOn( rInfo ); break; // <body>
- case HTML_BODY_OFF: mpCurrTable->BodyOff( rInfo ); break; // </body>
+ case HtmlTokenId::BODY_ON: mpCurrTable->BodyOn( rInfo ); break; // <body>
+ case HtmlTokenId::BODY_OFF: mpCurrTable->BodyOff( rInfo ); break; // </body>
// --- insert text ---
- case HTML_TEXTTOKEN: InsertText( rInfo ); break; // any text
- case HTML_LINEBREAK: mpCurrTable->BreakOn(); break; // <br>
- case HTML_HEAD1_ON: // <h1>
- case HTML_HEAD2_ON: // <h2>
- case HTML_HEAD3_ON: // <h3>
- case HTML_HEAD4_ON: // <h4>
- case HTML_HEAD5_ON: // <h5>
- case HTML_HEAD6_ON: // <h6>
- case HTML_PARABREAK_ON: mpCurrTable->HeadingOn(); break; // <p>
+ case HtmlTokenId::TEXTTOKEN: InsertText( rInfo ); break; // any text
+ case HtmlTokenId::LINEBREAK: mpCurrTable->BreakOn(); break; // <br>
+ case HtmlTokenId::HEAD1_ON: // <h1>
+ case HtmlTokenId::HEAD2_ON: // <h2>
+ case HtmlTokenId::HEAD3_ON: // <h3>
+ case HtmlTokenId::HEAD4_ON: // <h4>
+ case HtmlTokenId::HEAD5_ON: // <h5>
+ case HtmlTokenId::HEAD6_ON: // <h6>
+ case HtmlTokenId::PARABREAK_ON: mpCurrTable->HeadingOn(); break; // <p>
// --- misc. contents ---
- case HTML_ANCHOR_ON: mpCurrTable->AnchorOn(); break; // <a>
+ case HtmlTokenId::ANCHOR_ON: mpCurrTable->AnchorOn(); break; // <a>
// --- table handling ---
- case HTML_TABLE_ON: TableOn( rInfo ); break; // <table>
- case HTML_TABLE_OFF: TableOff( rInfo ); break; // </table>
- case HTML_TABLEROW_ON: mpCurrTable->RowOn( rInfo ); break; // <tr>
- case HTML_TABLEROW_OFF: mpCurrTable->RowOff( rInfo ); break; // </tr>
- case HTML_TABLEHEADER_ON: // <th>
- case HTML_TABLEDATA_ON: mpCurrTable->DataOn( rInfo ); break; // <td>
- case HTML_TABLEHEADER_OFF: // </th>
- case HTML_TABLEDATA_OFF: mpCurrTable->DataOff( rInfo ); break; // </td>
- case HTML_PREFORMTXT_ON: PreOn( rInfo ); break; // <pre>
- case HTML_PREFORMTXT_OFF: PreOff( rInfo ); break; // </pre>
+ case HtmlTokenId::TABLE_ON: TableOn( rInfo ); break; // <table>
+ case HtmlTokenId::TABLE_OFF: TableOff( rInfo ); break; // </table>
+ case HtmlTokenId::TABLEROW_ON: mpCurrTable->RowOn( rInfo ); break; // <tr>
+ case HtmlTokenId::TABLEROW_OFF: mpCurrTable->RowOff( rInfo ); break; // </tr>
+ case HtmlTokenId::TABLEHEADER_ON: // <th>
+ case HtmlTokenId::TABLEDATA_ON: mpCurrTable->DataOn( rInfo ); break; // <td>
+ case HtmlTokenId::TABLEHEADER_OFF: // </th>
+ case HtmlTokenId::TABLEDATA_OFF: mpCurrTable->DataOff( rInfo ); break; // </td>
+ case HtmlTokenId::PREFORMTXT_ON: PreOn( rInfo ); break; // <pre>
+ case HtmlTokenId::PREFORMTXT_OFF: PreOff( rInfo ); break; // </pre>
// --- formatting ---
- case HTML_FONT_ON: FontOn( rInfo ); break; // <font>
+ case HtmlTokenId::FONT_ON: FontOn( rInfo ); break; // <font>
- case HTML_BIGPRINT_ON: // <big>
+ case HtmlTokenId::BIGPRINT_ON: // <big>
//! TODO: store current font size, use following size
mpCurrTable->PutItem( SvxFontHeightItem( maFontHeights[ 3 ], 100, ATTR_FONT_HEIGHT ) );
break;
- case HTML_SMALLPRINT_ON: // <small>
+ case HtmlTokenId::SMALLPRINT_ON: // <small>
//! TODO: store current font size, use preceding size
mpCurrTable->PutItem( SvxFontHeightItem( maFontHeights[ 0 ], 100, ATTR_FONT_HEIGHT ) );
break;
- case HTML_BOLD_ON: // <b>
- case HTML_STRONG_ON: // <strong>
+ case HtmlTokenId::BOLD_ON: // <b>
+ case HtmlTokenId::STRONG_ON: // <strong>
mpCurrTable->PutItem( SvxWeightItem( WEIGHT_BOLD, ATTR_FONT_WEIGHT ) );
break;
- case HTML_ITALIC_ON: // <i>
- case HTML_EMPHASIS_ON: // <em>
- case HTML_ADDRESS_ON: // <address>
- case HTML_BLOCKQUOTE_ON: // <blockquote>
- case HTML_BLOCKQUOTE30_ON: // <bq>
- case HTML_CITIATION_ON: // <cite>
- case HTML_VARIABLE_ON: // <var>
+ case HtmlTokenId::ITALIC_ON: // <i>
+ case HtmlTokenId::EMPHASIS_ON: // <em>
+ case HtmlTokenId::ADDRESS_ON: // <address>
+ case HtmlTokenId::BLOCKQUOTE_ON: // <blockquote>
+ case HtmlTokenId::BLOCKQUOTE30_ON: // <bq>
+ case HtmlTokenId::CITIATION_ON: // <cite>
+ case HtmlTokenId::VARIABLE_ON: // <var>
mpCurrTable->PutItem( SvxPostureItem( ITALIC_NORMAL, ATTR_FONT_POSTURE ) );
break;
- case HTML_DEFINSTANCE_ON: // <dfn>
+ case HtmlTokenId::DEFINSTANCE_ON: // <dfn>
mpCurrTable->PutItem( SvxWeightItem( WEIGHT_BOLD, ATTR_FONT_WEIGHT ) );
mpCurrTable->PutItem( SvxPostureItem( ITALIC_NORMAL, ATTR_FONT_POSTURE ) );
break;
- case HTML_UNDERLINE_ON: // <u>
+ case HtmlTokenId::UNDERLINE_ON: // <u>
mpCurrTable->PutItem( SvxUnderlineItem( LINESTYLE_SINGLE, ATTR_FONT_UNDERLINE ) );
break;
+ default: break;
}
}
diff --git a/sc/source/filter/inc/eeparser.hxx b/sc/source/filter/inc/eeparser.hxx
index 88105a159f9f..b60e633fd9ba 100644
--- a/sc/source/filter/inc/eeparser.hxx
+++ b/sc/source/filter/inc/eeparser.hxx
@@ -105,7 +105,8 @@ protected:
::std::vector< ScEEParseEntry* > maList;
ScEEParseEntry* pActEntry;
ColWidthsMap maColWidths;
- int nLastToken;
+ int nRtfLastToken;
+ HtmlTokenId nHtmlLastToken;
SCCOL nColCnt;
SCROW nRowCnt;
SCCOL nColMax;
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 28bb57bde052..0e6eab3bc56c 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -31,6 +31,7 @@
#include <svtools/htmlcfg.hxx>
#include <sfx2/sfxhtml.hxx>
#include <svtools/parhtml.hxx>
+#include <svtools/htmltokn.h>
#include <svl/zforlist.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
@@ -610,7 +611,8 @@ ScEEParser::ScEEParser( EditEngine* pEditP ) :
pEdit( pEditP ),
pPool( EditEngine::CreatePool() ),
pDocPool( new ScDocumentPool ),
- nLastToken(0),
+ nRtfLastToken(0),
+ nHtmlLastToken(HtmlTokenId::NONE),
nColCnt(0),
nRowCnt(0),
nColMax(0),
diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 321bf8ec728b..d5262fd13a16 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -60,7 +60,7 @@ sal_uLong ScRTFParser::Read( SvStream& rStream, const OUString& rBaseURL )
Link<RtfImportInfo&,void> aOldLink = pEdit->GetRtfImportHdl();
pEdit->SetRtfImportHdl( LINK( this, ScRTFParser, RTFImportHdl ) );
sal_uLong nErr = pEdit->Read( rStream, rBaseURL, EE_FORMAT_RTF );
- if ( nLastToken == RTF_PAR )
+ if ( nRtfLastToken == RTF_PAR )
{
if ( !maList.empty() )
{
@@ -274,14 +274,14 @@ void ScRTFParser::ProcToken( RtfImportInfo* pInfo )
nColCnt = 0;
maDefaultList.clear();
pDefMerge = nullptr;
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
mnCurPos = 0;
}
break;
case RTF_CLMGF: // The first cell of cells to be merged
{
pDefMerge = pInsDefault;
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
break;
case RTF_CLMRG: // A cell to be merged with the preceding cell
@@ -295,7 +295,7 @@ void ScRTFParser::ProcToken( RtfImportInfo* pInfo )
if ( pDefMerge ) // Else broken RTF
pDefMerge->nColOverlap++; // multiple successive ones possible
pInsDefault->nColOverlap = 0; // Flag: ignore these
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
break;
case RTF_CELLX: // closes cell default
@@ -308,17 +308,17 @@ void ScRTFParser::ProcToken( RtfImportInfo* pInfo )
pInsDefault = new ScRTFCellDefault( pPool );
if ( ++nColCnt > nColMax )
nColMax = nColCnt;
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
break;
case RTF_INTBL: // before the first RTF_CELL
{
// Once over NextToken and once over UnknownAttrToken
// or e.g. \intbl ... \cell \pard \intbl ... \cell
- if ( nLastToken != RTF_INTBL && nLastToken != RTF_CELL && nLastToken != RTF_PAR )
+ if ( nRtfLastToken != RTF_INTBL && nRtfLastToken != RTF_CELL && nRtfLastToken != RTF_PAR )
{
NewCellRow( pInfo );
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
}
break;
@@ -360,13 +360,13 @@ void ScRTFParser::ProcToken( RtfImportInfo* pInfo )
if (!maDefaultList.empty() && (mnCurPos+1) < maDefaultList.size())
pActDefault = maDefaultList[++mnCurPos].get();
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
break;
case RTF_ROW: // denotes the end of a row
{
NextRow();
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
break;
case RTF_PAR: // Paragraph
@@ -381,11 +381,11 @@ void ScRTFParser::ProcToken( RtfImportInfo* pInfo )
NewActEntry( pActEntry ); // new pActEntry
NextRow();
}
- nLastToken = pInfo->nToken;
+ nRtfLastToken = pInfo->nToken;
}
break;
default:
- { // do not set nLastToken
+ { // do not set nRtfLastToken
switch ( pInfo->nToken & ~(0xff | RTF_TABLEDEF) )
{
case RTF_SHADINGDEF:
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx
index 599a3c205586..339cb36c0737 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -34,128 +34,128 @@ struct HTML_TokenEntry
const sal_Char *sToken;
const OUString *pUToken;
};
- int nToken;
+ HtmlTokenId nToken;
};
// Flag: RTF token table has already been sorted
static bool bSortKeyWords = false;
static HTML_TokenEntry aHTMLTokenTab[] = {
- {{OOO_STRING_SVTOOLS_HTML_area}, HTML_AREA}, // Netscape 2.0
- {{OOO_STRING_SVTOOLS_HTML_base}, HTML_BASE}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_comment}, HTML_COMMENT},
- {{OOO_STRING_SVTOOLS_HTML_doctype}, HTML_DOCTYPE},
- {{OOO_STRING_SVTOOLS_HTML_embed}, HTML_EMBED}, // Netscape 2.0
- {{OOO_STRING_SVTOOLS_HTML_horzrule}, HTML_HORZRULE},
- {{OOO_STRING_SVTOOLS_HTML_image}, HTML_IMAGE},
- {{OOO_STRING_SVTOOLS_HTML_input}, HTML_INPUT},
- {{OOO_STRING_SVTOOLS_HTML_linebreak}, HTML_LINEBREAK},
- {{OOO_STRING_SVTOOLS_HTML_link}, HTML_LINK}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_meta}, HTML_META}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_option}, HTML_OPTION},
- {{OOO_STRING_SVTOOLS_HTML_param}, HTML_PARAM}, // HotJava
- {{OOO_STRING_SVTOOLS_HTML_spacer}, HTML_SPACER}, // Netscape 3.0b5
-
- {{OOO_STRING_SVTOOLS_HTML_abbreviation}, HTML_ABBREVIATION_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_acronym}, HTML_ACRONYM_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_address}, HTML_ADDRESS_ON},
- {{OOO_STRING_SVTOOLS_HTML_anchor}, HTML_ANCHOR_ON},
- {{OOO_STRING_SVTOOLS_HTML_applet}, HTML_APPLET_ON}, // HotJava
- {{OOO_STRING_SVTOOLS_HTML_author}, HTML_AUTHOR_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_banner}, HTML_BANNER_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_basefont}, HTML_BASEFONT_ON}, // Netscape
- {{OOO_STRING_SVTOOLS_HTML_bigprint}, HTML_BIGPRINT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_blink}, HTML_BLINK_ON}, // Netscape
- {{OOO_STRING_SVTOOLS_HTML_blockquote}, HTML_BLOCKQUOTE_ON},
- {{OOO_STRING_SVTOOLS_HTML_blockquote30}, HTML_BLOCKQUOTE30_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_body}, HTML_BODY_ON},
- {{OOO_STRING_SVTOOLS_HTML_bold}, HTML_BOLD_ON},
- {{OOO_STRING_SVTOOLS_HTML_caption}, HTML_CAPTION_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_center}, HTML_CENTER_ON}, // Netscape
- {{OOO_STRING_SVTOOLS_HTML_citiation}, HTML_CITIATION_ON},
- {{OOO_STRING_SVTOOLS_HTML_col}, HTML_COL_ON}, // HTML 3 Table Model Draft
- {{OOO_STRING_SVTOOLS_HTML_colgroup}, HTML_COLGROUP_ON}, // HTML 3 Table Model Draft
- {{OOO_STRING_SVTOOLS_HTML_code}, HTML_CODE_ON},
- {{OOO_STRING_SVTOOLS_HTML_credit}, HTML_CREDIT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_dd}, HTML_DD_ON},
- {{OOO_STRING_SVTOOLS_HTML_deflist}, HTML_DEFLIST_ON},
- {{OOO_STRING_SVTOOLS_HTML_deletedtext}, HTML_DELETEDTEXT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_dirlist}, HTML_DIRLIST_ON},
- {{OOO_STRING_SVTOOLS_HTML_division}, HTML_DIVISION_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_dt}, HTML_DT_ON},
- {{OOO_STRING_SVTOOLS_HTML_emphasis}, HTML_EMPHASIS_ON},
- {{OOO_STRING_SVTOOLS_HTML_figure}, HTML_FIGURE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_font}, HTML_FONT_ON}, // Netscape
- {{OOO_STRING_SVTOOLS_HTML_footnote}, HTML_FOOTNOTE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_form}, HTML_FORM_ON},
- {{OOO_STRING_SVTOOLS_HTML_frame}, HTML_FRAME_ON}, // Netscape 2.0
- {{OOO_STRING_SVTOOLS_HTML_frameset}, HTML_FRAMESET_ON}, // Netscape 2.0
- {{OOO_STRING_SVTOOLS_HTML_head}, HTML_HEAD_ON},
- {{OOO_STRING_SVTOOLS_HTML_head1}, HTML_HEAD1_ON},
- {{OOO_STRING_SVTOOLS_HTML_head2}, HTML_HEAD2_ON},
- {{OOO_STRING_SVTOOLS_HTML_head3}, HTML_HEAD3_ON},
- {{OOO_STRING_SVTOOLS_HTML_head4}, HTML_HEAD4_ON},
- {{OOO_STRING_SVTOOLS_HTML_head5}, HTML_HEAD5_ON},
- {{OOO_STRING_SVTOOLS_HTML_head6}, HTML_HEAD6_ON},
- {{OOO_STRING_SVTOOLS_HTML_html}, HTML_HTML_ON},
- {{OOO_STRING_SVTOOLS_HTML_iframe}, HTML_IFRAME_ON}, // IE 3.0b2
- {{OOO_STRING_SVTOOLS_HTML_insertedtext}, HTML_INSERTEDTEXT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_italic}, HTML_ITALIC_ON},
- {{OOO_STRING_SVTOOLS_HTML_keyboard}, HTML_KEYBOARD_ON},
- {{OOO_STRING_SVTOOLS_HTML_language}, HTML_LANGUAGE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_li}, HTML_LI_ON},
- {{OOO_STRING_SVTOOLS_HTML_listheader}, HTML_LISTHEADER_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_map}, HTML_MAP_ON}, // Netscape 2.0
- {{OOO_STRING_SVTOOLS_HTML_menulist}, HTML_MENULIST_ON},
- {{OOO_STRING_SVTOOLS_HTML_multicol}, HTML_MULTICOL_ON}, // Netscape 3.0b5
- {{OOO_STRING_SVTOOLS_HTML_nobr}, HTML_NOBR_ON}, // Netscape
- {{OOO_STRING_SVTOOLS_HTML_noembed}, HTML_NOEMBED_ON}, // Netscape 2.0 ???
- {{OOO_STRING_SVTOOLS_HTML_noframe}, HTML_NOFRAMES_ON}, // Netscape 2.0 ???
- {{OOO_STRING_SVTOOLS_HTML_noframes}, HTML_NOFRAMES_ON}, // Netscape 2.0
- {{OOO_STRING_SVTOOLS_HTML_noscript}, HTML_NOSCRIPT_ON}, // Netscape 3.0
- {{OOO_STRING_SVTOOLS_HTML_note}, HTML_NOTE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_object}, HTML_OBJECT_ON},
- {{OOO_STRING_SVTOOLS_HTML_orderlist}, HTML_ORDERLIST_ON},
- {{OOO_STRING_SVTOOLS_HTML_parabreak}, HTML_PARABREAK_ON},
- {{OOO_STRING_SVTOOLS_HTML_person}, HTML_PERSON_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_plaintext}, HTML_PLAINTEXT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_preformtxt}, HTML_PREFORMTXT_ON},
- {{OOO_STRING_SVTOOLS_HTML_sample}, HTML_SAMPLE_ON},
- {{OOO_STRING_SVTOOLS_HTML_script}, HTML_SCRIPT_ON}, // HTML 3.2
- {{OOO_STRING_SVTOOLS_HTML_select}, HTML_SELECT_ON},
- {{OOO_STRING_SVTOOLS_HTML_shortquote}, HTML_SHORTQUOTE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_smallprint}, HTML_SMALLPRINT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_span}, HTML_SPAN_ON}, // Style Sheets
- {{OOO_STRING_SVTOOLS_HTML_strikethrough},HTML_STRIKETHROUGH_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_strong}, HTML_STRONG_ON},
- {{OOO_STRING_SVTOOLS_HTML_style}, HTML_STYLE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_subscript}, HTML_SUBSCRIPT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_superscript}, HTML_SUPERSCRIPT_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_table}, HTML_TABLE_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_tabledata}, HTML_TABLEDATA_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_tableheader}, HTML_TABLEHEADER_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_tablerow}, HTML_TABLEROW_ON}, // HTML 3.0
- {{OOO_STRING_SVTOOLS_HTML_tbody}, HTML_TBODY_ON}, // HTML 3 Table Model Draft
- {{OOO_STRING_SVTOOLS_HTML_teletype}, HTML_TELETYPE_ON},
- {{OOO_STRING_SVTOOLS_HTML_textarea}, HTML_TEXTAREA_ON},
- {{OOO_STRING_SVTOOLS_HTML_tfoot}, HTML_TFOOT_ON}, // HTML 3 Table Model Draft
- {{OOO_STRING_SVTOOLS_HTML_thead}, HTML_THEAD_ON}, // HTML 3 Table Model Draft
- {{OOO_STRING_SVTOOLS_HTML_title}, HTML_TITLE_ON},
- {{OOO_STRING_SVTOOLS_HTML_underline}, HTML_UNDERLINE_ON},
- {{OOO_STRING_SVTOOLS_HTML_unorderlist}, HTML_UNORDERLIST_ON},
- {{OOO_STRING_SVTOOLS_HTML_variable}, HTML_VARIABLE_ON},
-
- {{OOO_STRING_SVTOOLS_HTML_xmp}, HTML_XMP_ON},
- {{OOO_STRING_SVTOOLS_HTML_listing}, HTML_LISTING_ON},
-
- {{OOO_STRING_SVTOOLS_HTML_definstance}, HTML_DEFINSTANCE_ON},
- {{OOO_STRING_SVTOOLS_HTML_strike}, HTML_STRIKE_ON},
-
- {{OOO_STRING_SVTOOLS_HTML_comment2}, HTML_COMMENT2_ON},
- {{OOO_STRING_SVTOOLS_HTML_marquee}, HTML_MARQUEE_ON},
- {{OOO_STRING_SVTOOLS_HTML_plaintext2}, HTML_PLAINTEXT2_ON},
-
- {{OOO_STRING_SVTOOLS_HTML_sdfield}, HTML_SDFIELD_ON}
+ {{OOO_STRING_SVTOOLS_HTML_area}, HtmlTokenId::AREA}, // Netscape 2.0
+ {{OOO_STRING_SVTOOLS_HTML_base}, HtmlTokenId::BASE}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_comment}, HtmlTokenId::COMMENT},
+ {{OOO_STRING_SVTOOLS_HTML_doctype}, HtmlTokenId::DOCTYPE},
+ {{OOO_STRING_SVTOOLS_HTML_embed}, HtmlTokenId::EMBED}, // Netscape 2.0
+ {{OOO_STRING_SVTOOLS_HTML_horzrule}, HtmlTokenId::HORZRULE},
+ {{OOO_STRING_SVTOOLS_HTML_image}, HtmlTokenId::IMAGE},
+ {{OOO_STRING_SVTOOLS_HTML_input}, HtmlTokenId::INPUT},
+ {{OOO_STRING_SVTOOLS_HTML_linebreak}, HtmlTokenId::LINEBREAK},
+ {{OOO_STRING_SVTOOLS_HTML_link}, HtmlTokenId::LINK}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_meta}, HtmlTokenId::META}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_option}, HtmlTokenId::OPTION},
+ {{OOO_STRING_SVTOOLS_HTML_param}, HtmlTokenId::PARAM}, // HotJava
+ {{OOO_STRING_SVTOOLS_HTML_spacer}, HtmlTokenId::SPACER}, // Netscape 3.0b5
+
+ {{OOO_STRING_SVTOOLS_HTML_abbreviation}, HtmlTokenId::ABBREVIATION_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_acronym}, HtmlTokenId::ACRONYM_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_address}, HtmlTokenId::ADDRESS_ON},
+ {{OOO_STRING_SVTOOLS_HTML_anchor}, HtmlTokenId::ANCHOR_ON},
+ {{OOO_STRING_SVTOOLS_HTML_applet}, HtmlTokenId::APPLET_ON}, // HotJava
+ {{OOO_STRING_SVTOOLS_HTML_author}, HtmlTokenId::AUTHOR_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_banner}, HtmlTokenId::BANNER_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_basefont}, HtmlTokenId::BASEFONT_ON}, // Netscape
+ {{OOO_STRING_SVTOOLS_HTML_bigprint}, HtmlTokenId::BIGPRINT_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_blink}, HtmlTokenId::BLINK_ON}, // Netscape
+ {{OOO_STRING_SVTOOLS_HTML_blockquote}, HtmlTokenId::BLOCKQUOTE_ON},
+ {{OOO_STRING_SVTOOLS_HTML_blockquote30}, HtmlTokenId::BLOCKQUOTE30_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_body}, HtmlTokenId::BODY_ON},
+ {{OOO_STRING_SVTOOLS_HTML_bold}, HtmlTokenId::BOLD_ON},
+ {{OOO_STRING_SVTOOLS_HTML_caption}, HtmlTokenId::CAPTION_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_center}, HtmlTokenId::CENTER_ON}, // Netscape
+ {{OOO_STRING_SVTOOLS_HTML_citiation}, HtmlTokenId::CITIATION_ON},
+ {{OOO_STRING_SVTOOLS_HTML_col}, HtmlTokenId::COL_ON}, // HTML 3 Table Model Draft
+ {{OOO_STRING_SVTOOLS_HTML_colgroup}, HtmlTokenId::COLGROUP_ON}, // HTML 3 Table Model Draft
+ {{OOO_STRING_SVTOOLS_HTML_code}, HtmlTokenId::CODE_ON},
+ {{OOO_STRING_SVTOOLS_HTML_credit}, HtmlTokenId::CREDIT_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_dd}, HtmlTokenId::DD_ON},
+ {{OOO_STRING_SVTOOLS_HTML_deflist}, HtmlTokenId::DEFLIST_ON},
+ {{OOO_STRING_SVTOOLS_HTML_deletedtext}, HtmlTokenId::DELETEDTEXT_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_dirlist}, HtmlTokenId::DIRLIST_ON},
+ {{OOO_STRING_SVTOOLS_HTML_division}, HtmlTokenId::DIVISION_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_dt}, HtmlTokenId::DT_ON},
+ {{OOO_STRING_SVTOOLS_HTML_emphasis}, HtmlTokenId::EMPHASIS_ON},
+ {{OOO_STRING_SVTOOLS_HTML_figure}, HtmlTokenId::FIGURE_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_font}, HtmlTokenId::FONT_ON}, // Netscape
+ {{OOO_STRING_SVTOOLS_HTML_footnote}, HtmlTokenId::FOOTNOTE_ON}, // HTML 3.0
+ {{OOO_STRING_SVTOOLS_HTML_form}, HtmlTokenId::FORM_ON},
+ {{OOO_STRING_SVTOOLS_HTML_frame}, HtmlTokenId::FRAME_ON}, // Netscape 2.0
+ {{OOO_STRING_SVTOOLS_HTML_frameset}, HtmlTokenId::FRAMESET_ON}, // Netscape 2.0
+ {{OOO_STRING_SVTOOLS_HTML_head}, HtmlTokenId::HEAD_ON},
+ {{OOO_STRING_SVTOOLS_HTML_head1}, HtmlTokenId::HEAD1_ON},
+ {{OOO_STRING_SVTOOLS_HTML_head2}, HtmlTokenId::HEAD2_ON},
+ {{OOO_STRING_SVTOOLS_HTML_head3}, HtmlTokenId::HEAD3_ON},
+ {{OOO_STRING_SVTOOLS_HTML_head4}, HtmlTokenId::HEAD4_ON},
+ {{OOO_STRING_SVTOOLS_HTML_head5}, HtmlTokenId::HEAD5_ON},
+ {{OOO_STRING_SVTOOLS_HTML_head6}, HtmlTokenId::HEAD6_ON},
+ {{OOO_STRING_SVTOOLS_HTML_html}, HtmlTokenId::HTML_ON},
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list