LibreOffice Module sw (master) 1
unotextmarkup.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <unotextmarkup.hxx>
21
23#include <o3tl/safeint.hxx>
24#include <osl/diagnose.h>
25#include <svl/listener.hxx>
26#include <utility>
27#include <vcl/svapp.hxx>
28#include <SwSmartTagMgr.hxx>
29#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30#include <com/sun/star/text/TextMarkupType.hpp>
31#include <com/sun/star/text/TextMarkupDescriptor.hpp>
32#include <com/sun/star/container/ElementExistException.hpp>
33#include <com/sun/star/container/XStringKeyMap.hpp>
34#include <ndtxt.hxx>
35#include <SwGrammarMarkUp.hxx>
36#include <TextCursorHelper.hxx>
37#include <GrammarContact.hxx>
38
39#include <com/sun/star/lang/XUnoTunnel.hpp>
40#include <com/sun/star/text/XTextRange.hpp>
41
42#include <pam.hxx>
43
44#include <unotextrange.hxx>
45#include <modeltoviewhelper.hxx>
46
47using namespace ::com::sun::star;
48
50 : public SvtListener
51{
54
55 Impl(SwTextNode* const pTextNode, ModelToViewHelper aMap)
56 : m_pTextNode(pTextNode)
57 , m_ConversionMap(std::move(aMap))
58 {
59 if(m_pTextNode)
60 StartListening(pTextNode->GetNotifier());
61 }
62
63 virtual void Notify(const SfxHint& rHint) override;
64};
65
67 SwTextNode *const pTextNode, const ModelToViewHelper& rMap)
68 : m_pImpl(new Impl(pTextNode, rMap))
69{
71
73{
74}
75
77{
78 return m_pImpl->m_pTextNode;
79}
80
82{
83 m_pImpl->m_pTextNode = nullptr;
84 m_pImpl->EndListeningAll();
85}
86
88{
89 return m_pImpl->m_ConversionMap;
90}
91
92uno::Reference< container::XStringKeyMap > SAL_CALL SwXTextMarkup::getMarkupInfoContainer()
93{
94 return new SwXStringKeyMap;
95}
96
97void SAL_CALL SwXTextMarkup::commitTextRangeMarkup(::sal_Int32 nType, const OUString & aIdentifier, const uno::Reference< text::XTextRange> & xRange,
98 const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
99{
100 SolarMutexGuard aGuard;
101
102 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xRange, uno::UNO_QUERY);
103
104 if(!xRangeTunnel.is()) return;
105
106 if (auto pRange = comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel))
107 {
108 SwDoc& rDoc = pRange->GetDoc();
109
110 SwUnoInternalPaM aPam(rDoc);
111
112 ::sw::XTextRangeToSwPaM(aPam, xRange);
113
114 auto [startPos, endPos] = aPam.StartEnd(); // SwPosition*
115
116 commitStringMarkup (nType, aIdentifier, startPos->GetContentIndex(), endPos->GetContentIndex() - startPos->GetContentIndex(), xMarkupInfoContainer);
117 }
118 else if (auto pCursor = comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel))
119 {
120 SwPaM & rPam(*pCursor->GetPaM());
121
122 auto [startPos, endPos] = rPam.StartEnd(); // SwPosition*
123
124 commitStringMarkup (nType, aIdentifier, startPos->GetContentIndex(), endPos->GetContentIndex() - startPos->GetContentIndex(), xMarkupInfoContainer);
125 }
126}
127
129 ::sal_Int32 nType,
130 const OUString & rIdentifier,
131 ::sal_Int32 nStart,
132 ::sal_Int32 nLength,
133 const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
134{
135 SolarMutexGuard aGuard;
136
137 // paragraph already dead or modified?
138 if (!m_pImpl->m_pTextNode || nLength <= 0)
139 return;
140
141 if ( nType == text::TextMarkupType::SMARTTAG &&
142 !SwSmartTagMgr::Get().IsSmartTagTypeEnabled( rIdentifier ) )
143 return;
144
145 // get appropriate list to use...
146 SwWrongList* pWList = nullptr;
147 bool bRepaint = false;
148 if ( nType == text::TextMarkupType::SPELLCHECK )
149 {
150 pWList = m_pImpl->m_pTextNode->GetWrong();
151 if ( !pWList )
152 {
153 pWList = new SwWrongList( WRONGLIST_SPELL );
154 m_pImpl->m_pTextNode->SetWrong( std::unique_ptr<SwWrongList>(pWList) );
155 }
156 }
157 else if ( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE )
158 {
159 sw::GrammarContact* pGrammarContact = sw::getGrammarContactFor(*m_pImpl->m_pTextNode);
160 if( pGrammarContact )
161 {
162 pWList = pGrammarContact->getGrammarCheck(*m_pImpl->m_pTextNode, true);
163 OSL_ENSURE( pWList, "GrammarContact _has_ to deliver a wrong list" );
164 }
165 else
166 {
167 pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
168 if ( !pWList )
169 {
170 m_pImpl->m_pTextNode->SetGrammarCheck( std::make_unique<SwGrammarMarkUp>() );
171 pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
172 }
173 }
174 bRepaint = pWList == m_pImpl->m_pTextNode->GetGrammarCheck();
175 if( pWList->GetBeginInv() < COMPLETE_STRING )
176 static_cast<SwGrammarMarkUp*>(pWList)->ClearGrammarList();
177 }
178 else if ( nType == text::TextMarkupType::SMARTTAG )
179 {
180 pWList = m_pImpl->m_pTextNode->GetSmartTags();
181 if ( !pWList )
182 {
183 pWList = new SwWrongList( WRONGLIST_SMARTTAG );
184 m_pImpl->m_pTextNode->SetSmartTags( std::unique_ptr<SwWrongList>(pWList) );
185 }
186 }
187 else
188 {
189 OSL_FAIL( "Unknown mark-up type" );
190 return;
191 }
192
193 const ModelToViewHelper::ModelPosition aStartPos =
194 m_pImpl->m_ConversionMap.ConvertToModelPosition( nStart );
196 m_pImpl->m_ConversionMap.ConvertToModelPosition( nStart + nLength - 1);
197
198 const bool bStartInField = aStartPos.mbIsField;
199 const bool bEndInField = aEndPos.mbIsField;
200 bool bCommit = false;
201
202 if ( bStartInField && bEndInField && aStartPos.mnPos == aEndPos.mnPos )
203 {
204 nStart = aStartPos.mnSubPos;
205 const sal_Int32 nFieldPosModel = aStartPos.mnPos;
206 const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
207
208 SwWrongList* pSubList = pWList->SubList( nInsertPos );
209 if ( !pSubList )
210 {
211 if( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE )
212 pSubList = new SwGrammarMarkUp();
213 else
214 pSubList = new SwWrongList( pWList->GetWrongListType() );
215 pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
216 }
217
218 pWList = pSubList;
219 bCommit = true;
220 }
221 else if ( !bStartInField && !bEndInField )
222 {
223 nStart = aStartPos.mnPos;
224 bCommit = true;
225 nLength = aEndPos.mnPos + 1 - aStartPos.mnPos;
226 }
227 else if( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE )
228 {
229 bCommit = true;
230 nStart = aStartPos.mnPos;
231 sal_Int32 nEnd = aEndPos.mnPos;
232 if( bStartInField && nType != text::TextMarkupType::SENTENCE )
233 {
234 const sal_Int32 nFieldPosModel = aStartPos.mnPos;
235 const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
236 SwWrongList* pSubList = pWList->SubList( nInsertPos );
237 if ( !pSubList )
238 {
239 pSubList = new SwGrammarMarkUp();
240 pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
241 }
242 const sal_Int32 nTmpStart =
243 m_pImpl->m_ConversionMap.ConvertToViewPosition(aStartPos.mnPos);
244 const sal_Int32 nTmpLen =
245 m_pImpl->m_ConversionMap.ConvertToViewPosition(aStartPos.mnPos + 1)
246 - nTmpStart - aStartPos.mnSubPos;
247 if( nTmpLen > 0 )
248 {
249 pSubList->Insert( rIdentifier, xMarkupInfoContainer, aStartPos.mnSubPos, nTmpLen );
250 }
251 ++nStart;
252 }
253 if( bEndInField && nType != text::TextMarkupType::SENTENCE )
254 {
255 const sal_Int32 nFieldPosModel = aEndPos.mnPos;
256 const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
257 SwWrongList* pSubList = pWList->SubList( nInsertPos );
258 if ( !pSubList )
259 {
260 pSubList = new SwGrammarMarkUp();
261 pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
262 }
263 const sal_Int32 nTmpLen = aEndPos.mnSubPos + 1;
264 pSubList->Insert( rIdentifier, xMarkupInfoContainer, 0, nTmpLen );
265 }
266 else
267 ++nEnd;
268 if( nEnd > nStart )
269 nLength = nEnd - nStart;
270 else
271 bCommit = false;
272 }
273
274 if ( bCommit )
275 {
276 if( nType == text::TextMarkupType::SENTENCE )
277 static_cast<SwGrammarMarkUp*>(pWList)->setSentence( nStart );
278 else
279 pWList->Insert( rIdentifier, xMarkupInfoContainer, nStart, nLength );
280 }
281
282 if( bRepaint )
283 sw::finishGrammarCheckFor(*m_pImpl->m_pTextNode);
284}
285
287 const ModelToViewHelper& rConversionMap,
288 SwGrammarMarkUp* pWList,
289 ::sal_Int32 nType,
290 const OUString & rIdentifier,
291 ::sal_Int32 nStart,
292 ::sal_Int32 nLength,
293 const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
294{
295 OSL_ENSURE( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE, "Wrong mark-up type" );
296 const ModelToViewHelper::ModelPosition aStartPos =
297 rConversionMap.ConvertToModelPosition( nStart );
299 rConversionMap.ConvertToModelPosition( nStart + nLength - 1);
300
301 const bool bStartInField = aStartPos.mbIsField;
302 const bool bEndInField = aEndPos.mbIsField;
303 bool bCommit = false;
304
305 if ( bStartInField && bEndInField && aStartPos.mnPos == aEndPos.mnPos )
306 {
307 nStart = aStartPos.mnSubPos;
308 const sal_Int32 nFieldPosModel = aStartPos.mnPos;
309 const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
310
311 SwGrammarMarkUp* pSubList = static_cast<SwGrammarMarkUp*>(pWList->SubList( nInsertPos ));
312 if ( !pSubList )
313 {
314 pSubList = new SwGrammarMarkUp();
315 pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
316 }
317
318 pWList = pSubList;
319 bCommit = true;
320 }
321 else if ( !bStartInField && !bEndInField )
322 {
323 nStart = aStartPos.mnPos;
324 bCommit = true;
325 nLength = aEndPos.mnPos + 1 - aStartPos.mnPos;
326 }
327 else
328 {
329 bCommit = true;
330 nStart = aStartPos.mnPos;
331 sal_Int32 nEnd = aEndPos.mnPos;
332 if( bStartInField && nType != text::TextMarkupType::SENTENCE )
333 {
334 const sal_Int32 nFieldPosModel = aStartPos.mnPos;
335 const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
336 SwGrammarMarkUp* pSubList = static_cast<SwGrammarMarkUp*>(pWList->SubList( nInsertPos ));
337 if ( !pSubList )
338 {
339 pSubList = new SwGrammarMarkUp();
340 pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
341 }
342 const sal_Int32 nTmpStart = rConversionMap.ConvertToViewPosition( aStartPos.mnPos );
343 const sal_Int32 nTmpLen = rConversionMap.ConvertToViewPosition( aStartPos.mnPos + 1 )
344 - nTmpStart - aStartPos.mnSubPos;
345 if( nTmpLen > 0 )
346 pSubList->Insert( rIdentifier, xMarkupInfoContainer, aStartPos.mnSubPos, nTmpLen );
347 ++nStart;
348 }
349 if( bEndInField && nType != text::TextMarkupType::SENTENCE )
350 {
351 const sal_Int32 nFieldPosModel = aEndPos.mnPos;
352 const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
353 SwGrammarMarkUp* pSubList = static_cast<SwGrammarMarkUp*>(pWList->SubList( nInsertPos ));
354 if ( !pSubList )
355 {
356 pSubList = new SwGrammarMarkUp();
357 pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
358 }
359 const sal_Int32 nTmpLen = aEndPos.mnSubPos + 1;
360 pSubList->Insert( rIdentifier, xMarkupInfoContainer, 0, nTmpLen );
361 }
362 else
363 ++nEnd;
364 if( nEnd > nStart )
365 nLength = nEnd - nStart;
366 else
367 bCommit = false;
368 }
369
370 if ( bCommit )
371 {
372 if( nType == text::TextMarkupType::SENTENCE )
373 pWList->setSentence( nStart+nLength );
374 else
375 pWList->Insert( rIdentifier, xMarkupInfoContainer, nStart, nLength );
376 }
377}
378
380 const uno::Sequence< text::TextMarkupDescriptor > &rMarkups )
381{
382 SolarMutexGuard aGuard;
383
384 // paragraph already dead or modified?
385 if (!m_pImpl->m_pTextNode)
386 return;
387
388 // for grammar checking there should be exactly one sentence markup
389 // and 0..n grammar markups.
390 // Different markups are not expected but may be applied anyway since
391 // that should be no problem...
392 // but it has to be implemented, at the moment only this function is for
393 // grammar markups and sentence markup only!
394 const text::TextMarkupDescriptor *pSentenceMarkUp = nullptr;
395 for( const text::TextMarkupDescriptor &rDesc : rMarkups )
396 {
397 if (rDesc.nType == text::TextMarkupType::SENTENCE)
398 {
399 if (pSentenceMarkUp != nullptr)
400 throw lang::IllegalArgumentException(); // there is already one sentence markup
401 pSentenceMarkUp = &rDesc;
402 }
403 else if( rDesc.nType != text::TextMarkupType::PROOFREADING )
404 return;
405 }
406
407 if( pSentenceMarkUp == nullptr )
408 return;
409
410 // get appropriate list to use...
411 SwGrammarMarkUp* pWList = nullptr;
412 bool bRepaint = false;
413 sw::GrammarContact* pGrammarContact = sw::getGrammarContactFor(*m_pImpl->m_pTextNode);
414 if( pGrammarContact )
415 {
416 pWList = pGrammarContact->getGrammarCheck(*m_pImpl->m_pTextNode, true);
417 OSL_ENSURE( pWList, "GrammarContact _has_ to deliver a wrong list" );
418 }
419 else
420 {
421 pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
422 if ( !pWList )
423 {
424 m_pImpl->m_pTextNode->SetGrammarCheck( std::make_unique<SwGrammarMarkUp>() );
425 pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
426 pWList->SetInvalid( 0, COMPLETE_STRING );
427 }
428 }
429 bRepaint = pWList == m_pImpl->m_pTextNode->GetGrammarCheck();
430
431 bool bAcceptGrammarError = false;
432 if( pWList->GetBeginInv() < COMPLETE_STRING )
433 {
434 const ModelToViewHelper::ModelPosition aSentenceEnd =
435 m_pImpl->m_ConversionMap.ConvertToModelPosition(
436 pSentenceMarkUp->nOffset + pSentenceMarkUp->nLength );
437 bAcceptGrammarError = aSentenceEnd.mnPos > pWList->GetBeginInv();
438 pWList->ClearGrammarList( aSentenceEnd.mnPos );
439 }
440
441 if( bAcceptGrammarError )
442 {
443 for( const text::TextMarkupDescriptor &rDesc : rMarkups )
444 {
445 lcl_commitGrammarMarkUp(m_pImpl->m_ConversionMap, pWList, rDesc.nType,
446 rDesc.aIdentifier, rDesc.nOffset, rDesc.nLength, rDesc.xMarkupInfoContainer );
447 }
448 }
449 else
450 {
451 bRepaint = false;
452 const text::TextMarkupDescriptor &rDesc = *pSentenceMarkUp;
453 lcl_commitGrammarMarkUp(m_pImpl->m_ConversionMap, pWList, rDesc.nType,
454 rDesc.aIdentifier, rDesc.nOffset, rDesc.nLength, rDesc.xMarkupInfoContainer );
455 }
456
457 if( bRepaint )
458 sw::finishGrammarCheckFor(*m_pImpl->m_pTextNode);
459}
460
462{
464 if(rHint.GetId() == SfxHintId::Dying)
465 {
466 m_pTextNode = nullptr;
467 }
468}
469
471{
472}
473
474uno::Any SAL_CALL SwXStringKeyMap::getValue(const OUString & aKey)
475{
476 std::map< OUString, uno::Any >::const_iterator aIter = maMap.find( aKey );
477 if ( aIter == maMap.end() )
478 throw container::NoSuchElementException();
479
480 return (*aIter).second;
481}
482
483sal_Bool SAL_CALL SwXStringKeyMap::hasValue(const OUString & aKey)
484{
485 return maMap.find( aKey ) != maMap.end();
486}
487
488void SAL_CALL SwXStringKeyMap::insertValue(const OUString & aKey, const uno::Any & aValue)
489{
490 std::map< OUString, uno::Any >::const_iterator aIter = maMap.find( aKey );
491 if ( aIter != maMap.end() )
492 throw container::ElementExistException();
493
494 maMap[ aKey ] = aValue;
495}
496
497::sal_Int32 SAL_CALL SwXStringKeyMap::getCount()
498{
499 return maMap.size();
500}
501
502OUString SAL_CALL SwXStringKeyMap::getKeyByIndex(::sal_Int32 nIndex)
503{
504 if ( o3tl::make_unsigned(nIndex) >= maMap.size() )
505 throw lang::IndexOutOfBoundsException();
506
507 return OUString();
508}
509
510uno::Any SAL_CALL SwXStringKeyMap::getValueByIndex(::sal_Int32 nIndex)
511{
512 if ( o3tl::make_unsigned(nIndex) >= maMap.size() )
513 throw lang::IndexOutOfBoundsException();
514
515 return uno::Any();
516}
517
518/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
ModelPosition ConvertToModelPosition(sal_Int32 nViewPos) const
Converts a view position into a model position.
sal_Int32 ConvertToViewPosition(sal_Int32 nModelPos) const
Converts a model position into a view position.
SfxHintId GetId() const
bool StartListening(SvtBroadcaster &rBroadcaster)
Definition: doc.hxx:194
void ClearGrammarList(sal_Int32 nSentenceEnd=COMPLETE_STRING)
void setSentence(sal_Int32 nStart)
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
Definition: pam.hxx:277
static SwSmartTagMgr & Get()
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
WrongListType GetWrongListType() const
Definition: wrong.hxx:287
void InsertSubList(sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere, SwWrongList *pSubList)
Definition: wrong.cxx:523
sal_uInt16 GetWrongPos(sal_Int32 nValue) const
Find the first position that is greater or equal to the given value.
Definition: wrong.cxx:191
void SetInvalid(sal_Int32 nBegin, sal_Int32 nEnd)
Definition: wrong.cxx:254
SwWrongList * SubList(sal_uInt16 nIdx) const
Definition: wrong.hxx:342
void Insert(sal_uInt16 nWhere, std::vector< SwWrongArea >::iterator startPos, std::vector< SwWrongArea >::iterator const &endPos)
Definition: wrong.cxx:538
sal_Int32 GetBeginInv() const
Definition: wrong.hxx:288
Implementation of the css::container::XStringKeyMap interface.
virtual sal_Bool SAL_CALL hasValue(const OUString &aKey) override
virtual css::uno::Any SAL_CALL getValue(const OUString &aKey) override
virtual ::sal_Int32 SAL_CALL getCount() override
virtual css::uno::Any SAL_CALL getValueByIndex(::sal_Int32 nIndex) override
virtual OUString SAL_CALL getKeyByIndex(::sal_Int32 nIndex) override
virtual void SAL_CALL insertValue(const OUString &aKey, const css::uno::Any &aValue) override
virtual void SAL_CALL commitStringMarkup(::sal_Int32 nType, const OUString &aIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const css::uno::Reference< css::container::XStringKeyMap > &xMarkupInfoContainer) override
::sw::UnoImplPtr< Impl > m_pImpl
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
const ModelToViewHelper & GetConversionMap() const
virtual void SAL_CALL commitMultiTextMarkup(const css::uno::Sequence< css::text::TextMarkupDescriptor > &aMarkups) override
SwXTextMarkup(SwTextNode *const rTextNode, const ModelToViewHelper &rConversionMap)
virtual ~SwXTextMarkup() override
virtual void SAL_CALL commitTextRangeMarkup(::sal_Int32 nType, const OUString &aIdentifier, const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::container::XStringKeyMap > &xMarkupInfoContainer) override
void ClearTextNode()
SwTextNode * GetTextNode()
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:102
This class is responsible for the delayed display of grammar checks when a paragraph is edited It's a...
SwGrammarMarkUp * getGrammarCheck(SwTextNode &rTextNode, bool bCreate)
getGrammarCheck checks if the given text node is blocked by the current cursor if not,...
#define DBG_TESTSOLARMUTEX()
sal_Int32 nIndex
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sw::GrammarContact * getGrammarContactFor(const SwTextNode &rTextNode)
getGrammarContact() delivers the grammar contact of the document (for a given textnode)
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange, ::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1103
void finishGrammarCheckFor(SwTextNode &rTextNode)
finishGrammarCheck() calls the same function of the grammar contact of the document (for a given text...
HashMap_OWString_Interface aMap
QPRO_FUNC_TYPE nType
This struct defines a position in the model string.
virtual void Notify(const SfxHint &rHint) override
SwTextNode * m_pTextNode
Impl(SwTextNode *const pTextNode, ModelToViewHelper aMap)
ModelToViewHelper const m_ConversionMap
constexpr sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:57
unsigned char sal_Bool
static void lcl_commitGrammarMarkUp(const ModelToViewHelper &rConversionMap, SwGrammarMarkUp *pWList, ::sal_Int32 nType, const OUString &rIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const uno::Reference< container::XStringKeyMap > &xMarkupInfoContainer)
@ WRONGLIST_SPELL
Definition: wrong.hxx:58
@ WRONGLIST_SMARTTAG
Definition: wrong.hxx:60
sal_Int32 nLength