summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/edws.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/edit/edws.cxx')
-rw-r--r--sw/source/core/edit/edws.cxx26
1 files changed, 19 insertions, 7 deletions
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index eae129280c10..ac8775d3d78c 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -276,23 +276,35 @@ void SwEditShell::SetNewDoc()
GetDoc()->getIDocumentState().SetNewDoc(true);
}
-bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect const & rACorr, OUString& rWord )
+OUString SwEditShell::GetPrevAutoCorrWord(SvxAutoCorrect& rACorr)
{
SET_CURR_SHELL( this );
- bool bRet;
+ OUString sRet;
SwPaM* pCursor = getShellCursor( true );
const sal_Int32 nPos = pCursor->GetPoint()->nContent.GetIndex();
SwTextNode* pTNd = pCursor->GetNode().GetTextNode();
if( pTNd && nPos )
{
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCursor, 0 );
- bRet = rACorr.GetPrevAutoCorrWord( aSwAutoCorrDoc,
- pTNd->GetText(), nPos, rWord );
+ sRet = rACorr.GetPrevAutoCorrWord(aSwAutoCorrDoc, pTNd->GetText(), nPos);
}
- else
- bRet = false;
- return bRet;
+ return sRet;
+}
+
+std::vector<OUString> SwEditShell::GetChunkForAutoText()
+{
+ SET_CURR_SHELL(this);
+
+ std::vector<OUString> aRet;
+ SwPaM* pCursor = getShellCursor(true);
+ const sal_Int32 nPos = pCursor->GetPoint()->nContent.GetIndex();
+ SwTextNode* pTNd = pCursor->GetNode().GetTextNode();
+ if (pTNd && nPos)
+ {
+ aRet = SvxAutoCorrect::GetChunkForAutoText(pTNd->GetText(), nPos);
+ }
+ return aRet;
}
SwAutoCompleteWord& SwEditShell::GetAutoCompleteWords()