summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-06-06 20:51:05 +0200
committerMichael Stahl <mstahl@redhat.com>2013-06-07 00:11:49 +0200
commit1af2f810624c0e772880d5fafd27cdefa6c88d2c (patch)
treef4838ae817a45553cff1ba964d5308220b3c2059 /sw
parent63a43711ac1e85b15f6912f568d0a5fb021da920 (diff)
sw: fix AutoCorrect bold/underline regression
The horrible SvxAutoCorrect::AutoCorrect() inserts the character into the document half-way through, and then _expects_ this inserted character to show up in its rTxt parameter. This broke in Writer when SwTxtNode::m_Text was converted to OUString, because now a temporary String copy is created. Work around this disaster area for now. (regression from 0295c8a34e39326414c1b98cf4da905802f061b0) Change-Id: I1cb11a20cb0c2577036176e605426105631f3311 (cherry picked from commit e2b9946022c2a286ebac625ccb45f5ddddd5a5d6)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/edit/edws.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index c99ea28290e9..48a7eaba531f 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -308,8 +308,10 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Bool bInsert,
SwTxtNode* pTNd = pCrsr->GetNode()->GetTxtNode();
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar );
- rACorr.AutoCorrect( aSwAutoCorrDoc,
- pTNd->GetTxt(), pCrsr->GetPoint()->nContent.GetIndex(),
+ // FIXME: this _must_ be called with reference to the actual node text!
+ String const& rNodeText(reinterpret_cast<String const&>(pTNd->GetTxt()));
+ rACorr.DoAutoCorrect( aSwAutoCorrDoc,
+ rNodeText, pCrsr->GetPoint()->nContent.GetIndex(),
cChar, bInsert, GetWin() );
if( cChar )
SaveTblBoxCntnt( pCrsr->GetPoint() );