diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-11-11 13:37:10 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2018-11-11 13:37:10 (GMT) |
commit | 79c7a88dba9e7f136ab87b824414d47fa6ae94fe (patch) | |
tree | 681a7466e3b479e91497f6c094891b1496d161e1 /src/rtfdocvisitor.cpp | |
parent | 9440d7ce0b31749b6bbb13e70e2f7ed501505c7e (diff) | |
parent | e7fde5d604faf27dec989c8894e949d48676e0c1 (diff) | |
download | Doxygen-79c7a88dba9e7f136ab87b824414d47fa6ae94fe.zip Doxygen-79c7a88dba9e7f136ab87b824414d47fa6ae94fe.tar.gz Doxygen-79c7a88dba9e7f136ab87b824414d47fa6ae94fe.tar.bz2 |
Merge branch 'feature/issue_6517' of https://github.com/albert-github/doxygen into albert-github-feature/issue_6517
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r-- | src/rtfdocvisitor.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 0be2266..c72c951 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -34,6 +34,7 @@ #include "filedef.h" #include "config.h" #include "htmlentity.h" +#include "emoji.h" #include "plantuml.h" //#define DBG_RTF(x) m_t << x @@ -136,6 +137,48 @@ void RTFDocVisitor::visit(DocSymbol *s) m_lastIsPara=FALSE; } +void RTFDocVisitor::visit(DocEmoji *s) +{ + if (m_hide) return; + DBG_RTF("{\\comment RTFDocVisitor::visit(DocEmoji)}\n"); + const char *res = EmojiEntityMapper::instance()->rtf(s->emoji()); + if (res) + { + const char *p = res; + int val = 0; + int val1 = 0; + while (*p) + { + switch(*p) + { + case '&': case '#': case 'x': + break; + case ';': + val1 = val; + val = 0xd800 + ( ( val1 - 0x10000 ) & 0xffc00 ) / 0x400 - 0x10000; + m_t << "\\u" << val << "?"; + val = 0xdC00 + ( ( val1 - 0x10000 ) & 0x3ff ) - 0x10000 ; + m_t << "\\u" << val << "?"; + val = 0; + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + val = val * 16 + *p - '0'; + break; + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + val = val * 16 + *p - 'a' + 10; + break; + } + p++; + } + } + else + { + err("RTF: non supported Emoji-entity found: %s\n",EmojiEntityMapper::instance()->html(s->emoji())); + } + m_lastIsPara=FALSE; +} + void RTFDocVisitor::visit(DocURL *u) { if (m_hide) return; |