summaryrefslogtreecommitdiff
path: root/sw/inc/ndtxt.hxx
diff options
context:
space:
mode:
authorBalazs Santha <santha.balazs@simonyi.bme.hu>2021-02-26 08:06:03 -0500
committerLászló Németh <nemeth@numbertext.org>2021-03-24 15:08:18 +0100
commite463d239555d3a4dc61797eeb8c638b6442112a3 (patch)
treed736577b07a0b5cf968b4c30b2fc5de7c6ddb72c /sw/inc/ndtxt.hxx
parent4f3fb443cea4364b2ec8cb56515ec9bdfe6f5391 (diff)
tdf#140731: sw transliteration: avoid too many redlines
As a workaround for the performance regression from commit 2d3c77e9b10f20091ef338e262ba7756eb280ce9 (tdf#109266 sw change tracking: track transliteration), switch off redlining to avoid ~freezing, if a single transliteration could result too many (>~500) redlines. A single transliteration creates n redlines for n paragraphs of the selected text, except in the case of transliterating to title case, where it creates n redlines for n words. It's very easy to freeze Writer, because Writer's slowing down with n redlines is described by an O(n²) (quadratic) time complexity. Eg. in an experiment, title casing ~660 words was 6 sec, but ~3000 words was 85 sec, regarding to creating 660 vs 3000 redlines. Note: this is a partial revert of commit 2d3c77e9b10f20091ef338e262ba7756eb280ce9, if the selection contains more than 500 paragraphs (or in the case transliterating to title case, ~500 words). Change-Id: Iad98943cc9e1ed64aa9779e49ee3e941abad02ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111637 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc/ndtxt.hxx')
-rw-r--r--sw/inc/ndtxt.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 5dbbbc721f37..50986f3daca7 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -746,7 +746,7 @@ public:
/// change text to Upper/Lower/Hiragana/Katakana/...
void TransliterateText( utl::TransliterationWrapper& rTrans,
sal_Int32 nStart, sal_Int32 nEnd,
- SwUndoTransliterate* pUndo );
+ SwUndoTransliterate* pUndo, bool bUseRedlining = false );
/// count words in given range - returns true if we refreshed out count
bool CountWords( SwDocStat& rStat, sal_Int32 nStart, sal_Int32 nEnd ) const;