summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-08 00:23:10 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-08 00:32:20 +0100
commitebd0d0056d89a6a69d2cb75e28758132cb5c236b (patch)
treed4b31ab6b7916109d4bc6c4ef4e565698c67d9c5 /sw
parent8f60dd0223f8834224b196153f0d8601403d76dc (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 'sw')
-rw-r--r--sw/source/core/edit/acorrect.cxx9
-rw-r--r--sw/source/core/inc/acorrect.hxx2
2 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 33472cd0afc3..4d6c10e27d77 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -270,9 +270,9 @@ sal_Bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUStr
* corrected word was inserted. (Doesn't need to be the same paragraph!)
* @return text or 0, if previous paragraph does not exists or there are only blankness
*/
-OUString SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos )
+OUString const* SwAutoCorrDoc::GetPrevPara(bool const bAtNormalPos)
{
- OUString aStr;
+ OUString const* pStr(0);
if( bAtNormalPos || !pIdx )
pIdx = new SwNodeIndex( rCrsr.GetPoint()->nNode, -1 );
@@ -286,11 +286,12 @@ OUString SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos )
pTNd = pIdx->GetNode().GetTxtNode();
}
if( pTNd && 0 == pTNd->GetAttrOutlineLevel() )
- aStr = pTNd->GetTxt();
+ pStr = & pTNd->GetTxt();
if( bUndoIdInitialized )
bUndoIdInitialized = true;
- return aStr;
+
+ return pStr;
}
bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos,
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index 9a0f84e5f40e..4836319258f2 100644
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -72,7 +72,7 @@ public:
// - sal_True: paragraph before "normal" insertion position
// - sal_False: paragraph in that the corrected word was inserted
// (does not need to be the same paragraph)
- 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,