29#include <osl/diagnose.h>
42#if OSL_DEBUG_LEVEL > 0
53#if OSL_DEBUG_LEVEL > 0
64 std::vector<SwAutoCompleteClient>
77#if OSL_DEBUG_LEVEL > 0
88#if OSL_DEBUG_LEVEL > 0
92#if OSL_DEBUG_LEVEL > 0
98 m_pAutoCompleteWord(&rToTell),
102#if OSL_DEBUG_LEVEL > 0
109 m_pAutoCompleteWord(rClient.m_pAutoCompleteWord),
110 m_pDoc(rClient.m_pDoc)
113#if OSL_DEBUG_LEVEL > 0
120#if OSL_DEBUG_LEVEL > 0
143 switch(rHint.
GetId())
145 case SfxHintId::Dying:
148 case SfxHintId::SwLegacyModify:
151 switch(pLegacy->GetWhich())
183 const OUString& rStr, sal_Int32
const nLen)
186#if OSL_DEBUG_LEVEL > 0
193#if OSL_DEBUG_LEVEL > 0
220 editeng::SortedAutoCompleteStrings::size_type nWords, sal_uInt16 nMWrdLen ):
222 m_nMaxCount( nWords ),
223 m_nMinWordLen( nMWrdLen ),
224 m_bLockWordList( false )
231#if OSL_DEBUG_LEVEL > 0
234 OSL_ENSURE(!nStrings && !nClients,
"AutoComplete: clients or string count mismatch");
246 if ( rURL.
GetProtocol() == INetProtocol::VndSunStarHelp )
255 sal_Int32 nWrdLen = aNewWord.getLength();
256 while( nWrdLen &&
'.' == aNewWord[ nWrdLen-1 ])
263 std::pair<editeng::SortedAutoCompleteStrings::const_iterator, bool>
292 SwAutoCompleteStringPtrDeque::iterator it = std::find(
m_aLRUList.begin(),
m_aLRUList.end(), pNew );
293 OSL_ENSURE(
m_aLRUList.end() != it,
"String not found" );
305 editeng::SortedAutoCompleteStrings::size_type nNewMax )
310 SwAutoCompleteStringPtrDeque::size_type nLRUIndex = nNewMax-1;
314 OSL_ENSURE(
m_WordList.end() != it,
"String not found" );
336 SwAutoCompleteStringPtrDeque::iterator it = std::find(
m_aLRUList.begin(),
m_aLRUList.end(), pDel );
337 OSL_ENSURE(
m_aLRUList.end() != it,
"String not found" );
354 assert(rWords.empty());
356 return !rWords.empty();
362 size_t nMyLen =
m_WordList.size(), nNewLen = rNewLst.size();
363 size_t nMyPos = 0, nNewPos = 0;
365 for( ; nMyPos < nMyLen && nNewPos < nNewLen; ++nMyPos, ++nNewPos )
373 SwAutoCompleteStringPtrDeque::iterator it = std::find(
m_aLRUList.begin(),
m_aLRUList.end(), pDel );
374 OSL_ENSURE(
m_aLRUList.end() != it,
"String not found" );
377 if( nMyPos >= --nMyLen )
382 if( nMyPos >= nMyLen )
386 for( ; nNewPos < nMyLen; ++nNewPos )
390 SwAutoCompleteStringPtrDeque::iterator it = std::find(
m_aLRUList.begin(),
m_aLRUList.end(), pDel );
391 OSL_ENSURE(
m_aLRUList.end() != it,
"String not found" );
412 SwAutoCompleteStringPtrDeque::iterator it = std::find(
m_aLRUList.begin(),
m_aLRUList.end(), pCurrent );
413 OSL_ENSURE(
m_aLRUList.end() != it,
"word not found in LRU list" );
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
INetProtocol GetProtocol() const
const INetURLObject & GetURLObject() const
SfxMedium * GetMedium() const
void CopyAllBroadcasters(const SvtListener &r)
bool StartListening(SvtBroadcaster &rBroadcaster)
SvxAutoCorrect * GetAutoCorrect()
static SvxAutoCorrCfg & Get()
SvxSwAutoFormatFlags & GetSwFlags()
virtual void Notify(const SfxHint &) override
virtual ~SwAutoCompleteClient() override
SwAutoCompleteClient(SwAutoCompleteWord &rToTell, SwDoc &rSwDoc)
const SwDoc & GetDoc() const
static sal_uLong GetElementCount()
static sal_uLong s_nSwAutoCompleteClientCount
SwAutoCompleteClient & operator=(const SwAutoCompleteClient &rClient)
SwAutoCompleteWord * m_pAutoCompleteWord
static sal_uLong GetElementCount()
static sal_uLong s_nSwAutoCompleteStringCount
virtual ~SwAutoCompleteString() override
SwAutoCompleteString(const OUString &rStr, sal_Int32 nLen)
void AddDocument(const SwDoc &rDoc)
bool RemoveDocument(const SwDoc &rDoc)
std::vector< const SwDoc * > m_aSourceDocs
void RemoveDocument(const SwDoc &rDoc)
SwAutoCompleteWord_Impl(SwAutoCompleteWord &rParent)
void AddDocument(SwDoc &rDoc)
std::vector< SwAutoCompleteClient > m_aClientVector
SwAutoCompleteWord & m_rAutoCompleteWord
editeng::SortedAutoCompleteStrings::size_type m_nMaxCount
void SetMinWordLen(sal_uInt16 n)
SwAutoCompleteWord(editeng::SortedAutoCompleteStrings::size_type nWords, sal_uInt16 nMWrdLen)
void SetMaxCount(editeng::SortedAutoCompleteStrings::size_type n)
void CheckChangedList(const editeng::SortedAutoCompleteStrings &rNewLst)
editeng::SortedAutoCompleteStrings m_WordList
contains extended strings carrying source information
bool InsertWord(const OUString &rWord, SwDoc &rDoc)
editeng::Trie m_LookupTree
bool GetWordsMatching(std::u16string_view aMatch, std::vector< OUString > &aWords) const
Return all words matching a given prefix.
std::unique_ptr< SwAutoCompleteWord_Impl > m_pImpl
void DocumentDying(const SwDoc &rDoc)
SwAutoCompleteStringPtrDeque m_aLRUList
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
SwDocShell * GetDocShell()
void insert(std::u16string_view sInputString) const
void findSuggestions(std::u16string_view sWordPart, std::vector< OUString > &rSuggestionList) const
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN)
#define CH_TXTATR_BREAKWORD
double getLength(const B2DPolygon &rCandidate)
void copy(const fs::path &src, const fs::path &dest)
@ RES_POOLPAGE_STANDARD
Standard page.