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 
22 #include <svl/listener.hxx>
23 #include <vcl/svapp.hxx>
24 #include <SwSmartTagMgr.hxx>
25 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
26 #include <com/sun/star/text/TextMarkupType.hpp>
27 #include <com/sun/star/text/TextMarkupDescriptor.hpp>
28 #include <com/sun/star/container/ElementExistException.hpp>
29 #include <com/sun/star/container/XStringKeyMap.hpp>
30 #include <ndtxt.hxx>
31 #include <SwGrammarMarkUp.hxx>
32 
33 #include <IGrammarContact.hxx>
34 
35 #include <com/sun/star/lang/XUnoTunnel.hpp>
36 #include <com/sun/star/text/XTextRange.hpp>
37 
38 #include <pam.hxx>
39 
40 #include <unotextrange.hxx>
41 #include <unotextcursor.hxx>
42 #include <modeltoviewhelper.hxx>
43 
44 using namespace ::com::sun::star;
45 
47  : public SvtListener
48 {
51 
52  Impl(SwTextNode* const pTextNode, const ModelToViewHelper& rMap)
53  : m_pTextNode(pTextNode)
54  , m_ConversionMap(rMap)
55  {
56  if(m_pTextNode)
57  StartListening(pTextNode->GetNotifier());
58  }
59 
60  virtual void Notify(const SfxHint& rHint) override;
61 };
62 
64  SwTextNode *const pTextNode, const ModelToViewHelper& rMap)
65  : m_pImpl(new Impl(pTextNode, rMap))
66 {
67 }
68 
70 {
71 }
72 
74 {
75  return m_pImpl->m_pTextNode;
76 }
77 
79 {
80  m_pImpl->m_pTextNode = nullptr;
81  m_pImpl->EndListeningAll();
82 }
83 
85 {
86  return m_pImpl->m_ConversionMap;
87 }
88 
89 uno::Reference< container::XStringKeyMap > SAL_CALL SwXTextMarkup::getMarkupInfoContainer()
90 {
91  SolarMutexGuard aGuard;
92 
93  uno::Reference< container::XStringKeyMap > xProp = new SwXStringKeyMap;
94  return xProp;
95 }
96 
97 void 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  SwXTextRange* pRange = nullptr;
107  OTextCursorHelper* pCursor = nullptr;
108 
109  if(xRangeTunnel.is())
110  {
111  pRange = reinterpret_cast<SwXTextRange*>( sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething(SwXTextRange::getUnoTunnelId())));
112  pCursor = reinterpret_cast<OTextCursorHelper*>( sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething(OTextCursorHelper::getUnoTunnelId())));
113  }
114 
115  if (pRange)
116  {
117  SwDoc& rDoc = pRange->GetDoc();
118 
119  SwUnoInternalPaM aPam(rDoc);
120 
121  ::sw::XTextRangeToSwPaM(aPam, xRange);
122 
123  SwPosition* startPos = aPam.Start();
124  SwPosition* endPos = aPam.End();
125 
126  commitStringMarkup (nType, aIdentifier, startPos->nContent.GetIndex(), endPos->nContent.GetIndex() - startPos->nContent.GetIndex(), xMarkupInfoContainer);
127  }
128  else if (pCursor)
129  {
130  SwPaM & rPam(*pCursor->GetPaM());
131 
132  SwPosition* startPos = rPam.Start();
133  SwPosition* endPos = rPam.End();
134 
135  commitStringMarkup (nType, aIdentifier, startPos->nContent.GetIndex(), endPos->nContent.GetIndex() - startPos->nContent.GetIndex(), xMarkupInfoContainer);
136  }
137 }
138 
140  ::sal_Int32 nType,
141  const OUString & rIdentifier,
142  ::sal_Int32 nStart,
143  ::sal_Int32 nLength,
144  const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
145 {
146  SolarMutexGuard aGuard;
147 
148  // paragraph already dead or modified?
149  if (!m_pImpl->m_pTextNode || nLength <= 0)
150  return;
151 
152  if ( nType == text::TextMarkupType::SMARTTAG &&
153  !SwSmartTagMgr::Get().IsSmartTagTypeEnabled( rIdentifier ) )
154  return;
155 
156  // get appropriate list to use...
157  SwWrongList* pWList = nullptr;
158  bool bRepaint = false;
159  if ( nType == text::TextMarkupType::SPELLCHECK )
160  {
161  pWList = m_pImpl->m_pTextNode->GetWrong();
162  if ( !pWList )
163  {
164  pWList = new SwWrongList( WRONGLIST_SPELL );
165  m_pImpl->m_pTextNode->SetWrong( pWList );
166  }
167  }
168  else if ( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE )
169  {
170  IGrammarContact *pGrammarContact = getGrammarContact(*m_pImpl->m_pTextNode);
171  if( pGrammarContact )
172  {
173  pWList = pGrammarContact->getGrammarCheck(*m_pImpl->m_pTextNode, true);
174  OSL_ENSURE( pWList, "GrammarContact _has_ to deliver a wrong list" );
175  }
176  else
177  {
178  pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
179  if ( !pWList )
180  {
181  m_pImpl->m_pTextNode->SetGrammarCheck( new SwGrammarMarkUp() );
182  pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
183  }
184  }
185  bRepaint = pWList == m_pImpl->m_pTextNode->GetGrammarCheck();
186  if( pWList->GetBeginInv() < COMPLETE_STRING )
187  static_cast<SwGrammarMarkUp*>(pWList)->ClearGrammarList();
188  }
189  else if ( nType == text::TextMarkupType::SMARTTAG )
190  {
191  pWList = m_pImpl->m_pTextNode->GetSmartTags();
192  if ( !pWList )
193  {
194  pWList = new SwWrongList( WRONGLIST_SMARTTAG );
195  m_pImpl->m_pTextNode->SetSmartTags( pWList );
196  }
197  }
198  else
199  {
200  OSL_FAIL( "Unknown mark-up type" );
201  return;
202  }
203 
204  const ModelToViewHelper::ModelPosition aStartPos =
205  m_pImpl->m_ConversionMap.ConvertToModelPosition( nStart );
206  const ModelToViewHelper::ModelPosition aEndPos =
207  m_pImpl->m_ConversionMap.ConvertToModelPosition( nStart + nLength - 1);
208 
209  const bool bStartInField = aStartPos.mbIsField;
210  const bool bEndInField = aEndPos.mbIsField;
211  bool bCommit = false;
212 
213  if ( bStartInField && bEndInField && aStartPos.mnPos == aEndPos.mnPos )
214  {
215  nStart = aStartPos.mnSubPos;
216  const sal_Int32 nFieldPosModel = aStartPos.mnPos;
217  const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
218 
219  SwWrongList* pSubList = pWList->SubList( nInsertPos );
220  if ( !pSubList )
221  {
222  if( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE )
223  pSubList = new SwGrammarMarkUp();
224  else
225  pSubList = new SwWrongList( pWList->GetWrongListType() );
226  pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
227  }
228 
229  pWList = pSubList;
230  bCommit = true;
231  }
232  else if ( !bStartInField && !bEndInField )
233  {
234  nStart = aStartPos.mnPos;
235  bCommit = true;
236  nLength = aEndPos.mnPos + 1 - aStartPos.mnPos;
237  }
238  else if( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE )
239  {
240  bCommit = true;
241  nStart = aStartPos.mnPos;
242  sal_Int32 nEnd = aEndPos.mnPos;
243  if( bStartInField && nType != text::TextMarkupType::SENTENCE )
244  {
245  const sal_Int32 nFieldPosModel = aStartPos.mnPos;
246  const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
247  SwWrongList* pSubList = pWList->SubList( nInsertPos );
248  if ( !pSubList )
249  {
250  pSubList = new SwGrammarMarkUp();
251  pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
252  }
253  const sal_Int32 nTmpStart =
254  m_pImpl->m_ConversionMap.ConvertToViewPosition(aStartPos.mnPos);
255  const sal_Int32 nTmpLen =
256  m_pImpl->m_ConversionMap.ConvertToViewPosition(aStartPos.mnPos + 1)
257  - nTmpStart - aStartPos.mnSubPos;
258  if( nTmpLen > 0 )
259  {
260  pSubList->Insert( rIdentifier, xMarkupInfoContainer, aStartPos.mnSubPos, nTmpLen );
261  }
262  ++nStart;
263  }
264  if( bEndInField && nType != text::TextMarkupType::SENTENCE )
265  {
266  const sal_Int32 nFieldPosModel = aEndPos.mnPos;
267  const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
268  SwWrongList* pSubList = pWList->SubList( nInsertPos );
269  if ( !pSubList )
270  {
271  pSubList = new SwGrammarMarkUp();
272  pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
273  }
274  const sal_Int32 nTmpLen = aEndPos.mnSubPos + 1;
275  pSubList->Insert( rIdentifier, xMarkupInfoContainer, 0, nTmpLen );
276  }
277  else
278  ++nEnd;
279  if( nEnd > nStart )
280  nLength = nEnd - nStart;
281  else
282  bCommit = false;
283  }
284 
285  if ( bCommit )
286  {
287  if( nType == text::TextMarkupType::SENTENCE )
288  static_cast<SwGrammarMarkUp*>(pWList)->setSentence( nStart );
289  else
290  pWList->Insert( rIdentifier, xMarkupInfoContainer, nStart, nLength );
291  }
292 
293  if( bRepaint )
294  finishGrammarCheck(*m_pImpl->m_pTextNode);
295 }
296 
298  const ModelToViewHelper& rConversionMap,
299  SwGrammarMarkUp* pWList,
300  ::sal_Int32 nType,
301  const OUString & rIdentifier,
302  ::sal_Int32 nStart,
303  ::sal_Int32 nLength,
304  const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer)
305 {
306  OSL_ENSURE( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE, "Wrong mark-up type" );
307  const ModelToViewHelper::ModelPosition aStartPos =
308  rConversionMap.ConvertToModelPosition( nStart );
309  const ModelToViewHelper::ModelPosition aEndPos =
310  rConversionMap.ConvertToModelPosition( nStart + nLength - 1);
311 
312  const bool bStartInField = aStartPos.mbIsField;
313  const bool bEndInField = aEndPos.mbIsField;
314  bool bCommit = false;
315 
316  if ( bStartInField && bEndInField && aStartPos.mnPos == aEndPos.mnPos )
317  {
318  nStart = aStartPos.mnSubPos;
319  const sal_Int32 nFieldPosModel = aStartPos.mnPos;
320  const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
321 
322  SwGrammarMarkUp* pSubList = static_cast<SwGrammarMarkUp*>(pWList->SubList( nInsertPos ));
323  if ( !pSubList )
324  {
325  pSubList = new SwGrammarMarkUp();
326  pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
327  }
328 
329  pWList = pSubList;
330  bCommit = true;
331  }
332  else if ( !bStartInField && !bEndInField )
333  {
334  nStart = aStartPos.mnPos;
335  bCommit = true;
336  nLength = aEndPos.mnPos + 1 - aStartPos.mnPos;
337  }
338  else
339  {
340  bCommit = true;
341  nStart = aStartPos.mnPos;
342  sal_Int32 nEnd = aEndPos.mnPos;
343  if( bStartInField && nType != text::TextMarkupType::SENTENCE )
344  {
345  const sal_Int32 nFieldPosModel = aStartPos.mnPos;
346  const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
347  SwGrammarMarkUp* pSubList = static_cast<SwGrammarMarkUp*>(pWList->SubList( nInsertPos ));
348  if ( !pSubList )
349  {
350  pSubList = new SwGrammarMarkUp();
351  pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
352  }
353  const sal_Int32 nTmpStart = rConversionMap.ConvertToViewPosition( aStartPos.mnPos );
354  const sal_Int32 nTmpLen = rConversionMap.ConvertToViewPosition( aStartPos.mnPos + 1 )
355  - nTmpStart - aStartPos.mnSubPos;
356  if( nTmpLen > 0 )
357  pSubList->Insert( rIdentifier, xMarkupInfoContainer, aStartPos.mnSubPos, nTmpLen );
358  ++nStart;
359  }
360  if( bEndInField && nType != text::TextMarkupType::SENTENCE )
361  {
362  const sal_Int32 nFieldPosModel = aEndPos.mnPos;
363  const sal_uInt16 nInsertPos = pWList->GetWrongPos( nFieldPosModel );
364  SwGrammarMarkUp* pSubList = static_cast<SwGrammarMarkUp*>(pWList->SubList( nInsertPos ));
365  if ( !pSubList )
366  {
367  pSubList = new SwGrammarMarkUp();
368  pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList );
369  }
370  const sal_Int32 nTmpLen = aEndPos.mnSubPos + 1;
371  pSubList->Insert( rIdentifier, xMarkupInfoContainer, 0, nTmpLen );
372  }
373  else
374  ++nEnd;
375  if( nEnd > nStart )
376  nLength = nEnd - nStart;
377  else
378  bCommit = false;
379  }
380 
381  if ( bCommit )
382  {
383  if( nType == text::TextMarkupType::SENTENCE )
384  pWList->setSentence( nStart+nLength );
385  else
386  pWList->Insert( rIdentifier, xMarkupInfoContainer, nStart, nLength );
387  }
388 }
389 
391  const uno::Sequence< text::TextMarkupDescriptor > &rMarkups )
392 {
393  SolarMutexGuard aGuard;
394 
395  // paragraph already dead or modified?
396  if (!m_pImpl->m_pTextNode)
397  return;
398 
399  // for grammar checking there should be exactly one sentence markup
400  // and 0..n grammar markups.
401  // Different markups are not expected but may be applied anyway since
402  // that should be no problem...
403  // but it has to be implemented, at the moment only this function is for
404  // grammar markups and sentence markup only!
405  const text::TextMarkupDescriptor *pSentenceMarkUp = nullptr;
406  for( const text::TextMarkupDescriptor &rDesc : rMarkups )
407  {
408  if (rDesc.nType == text::TextMarkupType::SENTENCE)
409  {
410  if (pSentenceMarkUp != nullptr)
411  throw lang::IllegalArgumentException(); // there is already one sentence markup
412  pSentenceMarkUp = &rDesc;
413  }
414  else if( rDesc.nType != text::TextMarkupType::PROOFREADING )
415  return;
416  }
417 
418  if( pSentenceMarkUp == nullptr )
419  return;
420 
421  // get appropriate list to use...
422  SwGrammarMarkUp* pWList = nullptr;
423  bool bRepaint = false;
424  IGrammarContact *pGrammarContact = getGrammarContact(*m_pImpl->m_pTextNode);
425  if( pGrammarContact )
426  {
427  pWList = pGrammarContact->getGrammarCheck(*m_pImpl->m_pTextNode, true);
428  OSL_ENSURE( pWList, "GrammarContact _has_ to deliver a wrong list" );
429  }
430  else
431  {
432  pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
433  if ( !pWList )
434  {
435  m_pImpl->m_pTextNode->SetGrammarCheck( new SwGrammarMarkUp() );
436  pWList = m_pImpl->m_pTextNode->GetGrammarCheck();
437  pWList->SetInvalid( 0, COMPLETE_STRING );
438  }
439  }
440  bRepaint = pWList == m_pImpl->m_pTextNode->GetGrammarCheck();
441 
442  bool bAcceptGrammarError = false;
443  if( pWList->GetBeginInv() < COMPLETE_STRING )
444  {
445  const ModelToViewHelper::ModelPosition aSentenceEnd =
446  m_pImpl->m_ConversionMap.ConvertToModelPosition(
447  pSentenceMarkUp->nOffset + pSentenceMarkUp->nLength );
448  bAcceptGrammarError = aSentenceEnd.mnPos > pWList->GetBeginInv();
449  pWList->ClearGrammarList( aSentenceEnd.mnPos );
450  }
451 
452  if( bAcceptGrammarError )
453  {
454  for( const text::TextMarkupDescriptor &rDesc : rMarkups )
455  {
456  lcl_commitGrammarMarkUp(m_pImpl->m_ConversionMap, pWList, rDesc.nType,
457  rDesc.aIdentifier, rDesc.nOffset, rDesc.nLength, rDesc.xMarkupInfoContainer );
458  }
459  }
460  else
461  {
462  bRepaint = false;
463  const text::TextMarkupDescriptor &rDesc = *pSentenceMarkUp;
464  lcl_commitGrammarMarkUp(m_pImpl->m_ConversionMap, pWList, rDesc.nType,
465  rDesc.aIdentifier, rDesc.nOffset, rDesc.nLength, rDesc.xMarkupInfoContainer );
466  }
467 
468  if( bRepaint )
469  finishGrammarCheck(*m_pImpl->m_pTextNode);
470 }
471 
473 {
475  if(rHint.GetId() == SfxHintId::Dying)
476  {
477  m_pTextNode = nullptr;
478  }
479 }
480 
482 {
483 }
484 
485 uno::Any SAL_CALL SwXStringKeyMap::getValue(const OUString & aKey)
486 {
487  std::map< OUString, uno::Any >::const_iterator aIter = maMap.find( aKey );
488  if ( aIter == maMap.end() )
489  throw container::NoSuchElementException();
490 
491  return (*aIter).second;
492 }
493 
494 sal_Bool SAL_CALL SwXStringKeyMap::hasValue(const OUString & aKey)
495 {
496  return maMap.find( aKey ) != maMap.end();
497 }
498 
499 void SAL_CALL SwXStringKeyMap::insertValue(const OUString & aKey, const uno::Any & aValue)
500 {
501  std::map< OUString, uno::Any >::const_iterator aIter = maMap.find( aKey );
502  if ( aIter != maMap.end() )
503  throw container::ElementExistException();
504 
505  maMap[ aKey ] = aValue;
506 }
507 
508 ::sal_Int32 SAL_CALL SwXStringKeyMap::getCount()
509 {
510  return maMap.size();
511 }
512 
513 OUString SAL_CALL SwXStringKeyMap::getKeyByIndex(::sal_Int32 nIndex)
514 {
515  if ( static_cast<sal_uInt32>(nIndex) >= maMap.size() )
516  throw lang::IndexOutOfBoundsException();
517 
518  return OUString();
519 }
520 
521 uno::Any SAL_CALL SwXStringKeyMap::getValueByIndex(::sal_Int32 nIndex)
522 {
523  if ( static_cast<sal_uInt32>(nIndex) >= maMap.size() )
524  throw lang::IndexOutOfBoundsException();
525 
526  return uno::Any();
527 }
528 
529 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Marks a position in the document model.
Definition: pam.hxx:35
virtual css::uno::Any SAL_CALL getValue(const OUString &aKey) override
virtual SwGrammarMarkUp * getGrammarCheck(SwTextNode &rTextNode, bool bCreate)=0
getGrammarCheck checks if the given text node is blocked by the current cursor if not...
void Insert(const OUString &rType, css::uno::Reference< css::container::XStringKeyMap > const &xPropertyBag, sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere)
Definition: wrong.hxx:329
virtual sal_Bool SAL_CALL hasValue(const OUString &aKey) override
Definition: doc.hxx:185
virtual OUString SAL_CALL getKeyByIndex(::sal_Int32 nIndex) override
void InsertSubList(sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere, SwWrongList *pSubList)
Definition: wrong.cxx:522
SwTextNode * GetTextNode()
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
This struct defines a position in the model string.
SfxHintId GetId() const
void ClearTextNode()
virtual ~SwXTextMarkup() override
IGrammarContact * getGrammarContact(const SwTextNode &rTextNode)
getGrammarContact() delivers the grammar contact of the document (for a given textnode) ...
Definition: docnew.cxx:797
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:790
SwWrongList * SubList(sal_uInt16 nIdx) const
Definition: wrong.hxx:346
SwIndex nContent
Definition: pam.hxx:38
sal_Int32 ConvertToViewPosition(sal_Int32 nModelPos) const
Converts a model position into a view position.
void finishGrammarCheck(SwTextNode &rTextNode)
finishGrammarCheck() calls the same function of the grammar contact of the document (for a given text...
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange)
Definition: unoobj2.cxx:1009
virtual void SAL_CALL commitMultiTextMarkup(const css::uno::Sequence< css::text::TextMarkupDescriptor > &aMarkups) override
virtual css::uno::Any SAL_CALL getValueByIndex(::sal_Int32 nIndex) override
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
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
static SwSmartTagMgr & Get()
SwXTextMarkup(SwTextNode *const rTextNode, const ModelToViewHelper &rConversionMap)
Implementation of the css::container::XStringKeyMap interface.
const ModelToViewHelper & GetConversionMap()
SwTextNode * m_pTextNode
unsigned char sal_Bool
Impl(SwTextNode *const pTextNode, const ModelToViewHelper &rMap)
::sw::UnoImplPtr< Impl > m_pImpl
bool StartListening(SvtBroadcaster &rBroadcaster)
const SwPosition * Start() const
Definition: pam.hxx:212
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:93
virtual const SwPaM * GetPaM() const =0
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoobj2.cxx:851
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
WrongListType GetWrongListType() const
Definition: wrong.hxx:291
sal_Int32 GetBeginInv() const
Definition: wrong.hxx:292
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
sal_uInt16 GetWrongPos(sal_Int32 nValue) const
Find the first position that is greater or equal to the given value.
Definition: wrong.cxx:190
sal_Int32 GetIndex() const
Definition: index.hxx:95
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
const SwPosition * End() const
Definition: pam.hxx:217
ModelPosition ConvertToModelPosition(sal_Int32 nViewPos) const
Converts a view position into a model position.
Organizer of the contact between SwTextNodes and grammar checker.
void ClearGrammarList(sal_Int32 nSentenceEnd=COMPLETE_STRING)
void setSentence(sal_Int32 nStart)
#define DBG_TESTSOLARMUTEX()
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)
ModelToViewHelper const m_ConversionMap
void Insert(sal_uInt16 nWhere, std::vector< SwWrongArea >::iterator startPos, std::vector< SwWrongArea >::iterator const &endPos)
Definition: wrong.cxx:537
const sal_Int32 COMPLETE_STRING
Definition: swtypes.hxx:61
void SetInvalid(sal_Int32 nBegin, sal_Int32 nEnd)
Definition: wrong.cxx:253
virtual ::sal_Int32 SAL_CALL getCount() override
virtual void Notify(const SfxHint &rHint) override