diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-04-21 18:58:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-04-21 19:16:38 +0200 |
commit | 22eb78b6eee38e11aec32909b6983becb309ce13 (patch) | |
tree | 7e50b720f77bb8039a3fa0437ee6fd7fa51d3347 /writerfilter/source/rtftok/rtfcontrolwords.hxx | |
parent | da07d3a7bdb75efb34448dfb5ebca8b8b6135546 (diff) |
fdo#44736 speed up RTF import a bit by sorting keywords
If we sort the keywords once in the constructor, then we can do binary
search when looking up RTF keywords, and that speeds up the import by
about 20% using the first testcase from the bug.
Diffstat (limited to 'writerfilter/source/rtftok/rtfcontrolwords.hxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfcontrolwords.hxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx index 5afb8c6c3992..477ddb5fb062 100644 --- a/writerfilter/source/rtftok/rtfcontrolwords.hxx +++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx @@ -1866,6 +1866,10 @@ struct RTFSymbol const char *sKeyword; int nControlType; RTFKeyword nIndex; + + bool operator<(const RTFSymbol& rOther) const; + RTFSymbol(const char* pKeyword); + RTFSymbol(const char *pKeyword, int pControlType, RTFKeyword pIndex); }; extern RTFSymbol aRTFControlWords[]; |