diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-02-08 00:23:10 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-08 00:32:20 +0100 |
commit | ebd0d0056d89a6a69d2cb75e28758132cb5c236b (patch) | |
tree | d4b31ab6b7916109d4bc6c4ef4e565698c67d9c5 /editeng | |
parent | 8f60dd0223f8834224b196153f0d8601403d76dc (diff) |
fdo#74363: fix auto correct of initial capitals on start of first para
The GetPrevPara() method apparently has to return 0 when there is no
previous paragraph.
(regression from ac85b6cff11d193f5f71d11b1f3cc1c474653f59)
Change-Id: I09a3e1d3a3adb33562e4e03c0755447047cbd433
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.hxx | 2 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index bae28f4b32c7..2f7b7d83b040 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -267,10 +267,10 @@ private: //fprintf(stderr, "TestAutoCorrDoc::SetINetAttr\n"); return true; } - virtual OUString GetPrevPara( sal_Bool ) + virtual OUString const* GetPrevPara(bool) { //fprintf(stderr, "TestAutoCorrDoc::GetPrevPara\n"); - return OUString(); + return 0; } virtual bool ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, SvxAutoCorrect& rACorrect, diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 160a77ea8cc0..1ee9734ee686 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -696,7 +696,7 @@ sal_Bool EdtAutoCorrDoc::SetINetAttr(sal_Int32 nStt, sal_Int32 nEnd, return true; } -OUString EdtAutoCorrDoc::GetPrevPara( sal_Bool ) +OUString const* EdtAutoCorrDoc::GetPrevPara(bool const) { // Return previous paragraph, so that it can be determined, // whether the current word is at the beginning of a sentence. @@ -719,16 +719,16 @@ OUString EdtAutoCorrDoc::GetPrevPara( sal_Bool ) bBullet = true; } if ( bBullet ) - return OUString(); + return 0; for ( sal_Int32 n = nPos; n; ) { n--; ContentNode* pNode = rNodes[n]; if ( pNode->Len() ) - return pNode->GetString(); + return & pNode->GetString(); } - return OUString(); + return 0; } diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index 2af8d1f813eb..75e1ef04615d 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -147,7 +147,7 @@ public: virtual sal_Bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); virtual sal_Bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ); - virtual OUString GetPrevPara( sal_Bool bAtNormalPos ); + virtual OUString const* GetPrevPara(bool bAtNormalPos) SAL_OVERRIDE; virtual bool ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, SvxAutoCorrect& rACorrect, OUString* pPara ); diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 651b38076644..fcb91ddf2650 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -865,8 +865,8 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, { // Check out the previous paragraph, if it exists. // If so, then check to paragraph separator at the end. - OUString aPrevPara = rDoc.GetPrevPara( bNormalPos ); - if( !aPrevPara.isEmpty() ) + OUString const*const pPrevPara = rDoc.GetPrevPara(bNormalPos); + if (!pPrevPara) { // valid separator -> replace OUString sChar( *pWordStt ); @@ -875,7 +875,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, rDoc.ReplaceRange( pWordStt - pStart, 1, sChar ); } - aText = aPrevPara; + aText = *pPrevPara; bAtStart = sal_False; pStart = aText.getStr(); pStr = pStart + aText.getLength(); |