diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-09-20 15:40:11 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-09-22 00:31:48 +0200 |
commit | 3aa99295a72d6129b72ce22805f03da3edb64432 (patch) | |
tree | fbb1c72849d887826c4496ade46eea6c8c8e44c2 /svtools | |
parent | 4bc2d7c39c1c5c1cff05665c07330ce9f9395010 (diff) |
html: add applyEvents to HTML output
Change-Id: I8cc2d752673254c0f23f63030a8fa7d4d288c0a9
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/svhtml/htmlout.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index da58dc31012c..003889d7f26b 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -1001,4 +1001,29 @@ void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, const OString &aAttri rHtmlWriter.attribute(aAttributeName, sBuffer.makeStringAndClear()); } + +void HtmlWriterHelper::applyEvents(HtmlWriter& rHtmlWriter, const SvxMacroTableDtor& rMacroTable, const HTMLOutEvent* pEventTable, bool bOutStarBasic) +{ + sal_uInt16 i = 0; + while (pEventTable[i].pBasicName || pEventTable[i].pJavaName) + { + const SvxMacro* pMacro = rMacroTable.Get(pEventTable[i].nEvent); + + if (pMacro && pMacro->HasMacro() && (JAVASCRIPT == pMacro->GetScriptType() || bOutStarBasic)) + { + const sal_Char* pAttributeName = NULL; + if (STARBASIC == pMacro->GetScriptType()) + pAttributeName = pEventTable[i].pBasicName; + else + pAttributeName = pEventTable[i].pJavaName; + + if (pAttributeName) + { + rHtmlWriter.attribute(pAttributeName, OUStringToOString(pMacro->GetMacName(), RTL_TEXTENCODING_UTF8)); + } + } + i++; + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |