summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-04-23 15:27:47 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-24 16:50:17 +0000
commit66ca78799975d1855ba794a75d3ecabf53cef10b (patch)
tree8204f43df8457c0df82196a40ed7c22796518513 /sw/source/core
parent1035150cea85678075583deda612dde52867c125 (diff)
fdo#62643 sw: fix autocomplate wrt. adding to a partially finished word
This partially reverts commits 1eee77f2c2b4fa5f693708218c74a8f3909649a6 and 51f9e894f46e718200a14bcd61e9e44c64bc5396. (cherry picked from commit d92932744fdbaa78cec8dd8b991d5f442f6eef4b) Conflicts: sw/source/core/doc/acmplwrd.cxx sw/source/ui/docvw/edtwin.cxx Change-Id: Ie6a1202e139a0eb30cac482a2bb528ef70c7797f Reviewed-on: https://gerrit.libreoffice.org/3580 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/acmplwrd.cxx42
1 files changed, 7 insertions, 35 deletions
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 85485455b00f..3588290cc576 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -346,44 +346,16 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
nMinWrdLen = n;
}
-// Resets the current position within the tree to its root node.
-void SwAutoCompleteWord::returnToRoot()
-{
- m_LookupTree->returnToRoot();
-}
-
-// Advances to a given node within the AutoComplete tree.
-void SwAutoCompleteWord::gotoNode(OUString sNode)
-{
- m_LookupTree->gotoNode( sNode );
-}
-
-// Advances from the current position towards the node keyed with cKey.
-void SwAutoCompleteWord::advance(const sal_Unicode cKey)
-{
- m_LookupTree->advance( cKey );
-}
-
-// Goes back one char within the tree, except if the current node is already the root node.
-void SwAutoCompleteWord::goBack()
-{
- m_LookupTree->goBack();
-}
-
-// Returns all words matching a given prefix aMatch. If bIgnoreCurrentPos is set, the current
-// position within the tree is ignored and replaced by aMatch.
-bool SwAutoCompleteWord::GetWordsMatching(String aMatch, std::vector<String>& aWords, bool bIgnoreCurrentPos) const
+/** Return all words matching a given prefix
+ *
+ * @param aMatch the prefix to search for
+ * @param aWords the words to search in
+ */
+bool SwAutoCompleteWord::GetWordsMatching(String aMatch, std::vector<String>& aWords) const
{
OUString aStringRoot = OUString( aMatch );
- // The lookup tree already contains the information about the root keyword in most cases. Only if we don't trust that
- // information (e.g. if we need some autocompletion for a place other than the main writing area), the location within
- // the tree needs to be refreshed.
- if (bIgnoreCurrentPos)
- {
- m_LookupTree->gotoNode( aStringRoot );
- }
-
+ m_LookupTree->gotoNode( aStringRoot );
OUString aAutocompleteWord = m_LookupTree->suggestAutoCompletion();
if (aAutocompleteWord.isEmpty())
{