summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-06-08 10:06:23 +0200
committerCaolán McNamara <caolanm@redhat.com>2011-06-08 13:50:48 +0100
commit73a9de430716486d4bd7d535df257fb50889a12b (patch)
treead6f2c80c24e3f774bd8a97c71c13cce4ff9a9f7
parent43e429a19f39274eb93122507463d719980c96a8 (diff)
fdo#37584: Make a real copy of the text where to count words
Const-casting a reference doesn't create a copy of it and then the spaces replacement made by the WordCount was also made on the actual text node. Use String::Copy() to actually copy the text and safely operate on it. (cherry picked from commit 135cf4fdbec71e8d93edc0339e8617d50766f151) Signed-off-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/txtnode/txtedt.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index d4c02b6528..08d0c6b67b 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1814,7 +1814,7 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
}
// make a copy of the text
- String& rTextCopy = const_cast<String&>(m_Text);
+ String rTextCopy = m_Text.Copy( );
// mask out the redlined and hidden text with ' '
const xub_Unicode cChar(' ');