diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-06 20:51:05 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-06-07 00:09:34 +0200 |
commit | e2b9946022c2a286ebac625ccb45f5ddddd5a5d6 (patch) | |
tree | a52de2d64d3fe3ef7b0776864a096cd49887b79b /sw/source/core/edit/edws.cxx | |
parent | f62cb42d060b50cf7015ee8e2031c45f7631669a (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
Diffstat (limited to 'sw/source/core/edit/edws.cxx')
-rw-r--r-- | sw/source/core/edit/edws.cxx | 6 |
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() ); |