summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfcontrolwords.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-04-21 18:58:31 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-04-21 19:16:38 +0200
commit22eb78b6eee38e11aec32909b6983becb309ce13 (patch)
tree7e50b720f77bb8039a3fa0437ee6fd7fa51d3347 /writerfilter/source/rtftok/rtfcontrolwords.hxx
parentda07d3a7bdb75efb34448dfb5ebca8b8b6135546 (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.hxx4
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[];