LibreOffice Module sw (master)  1
unoflatpara.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 <unobaseclass.hxx>
21 #include <unocrsrhelper.hxx>
22 #include <unoflatpara.hxx>
23 
24 #include <o3tl/safeint.hxx>
25 #include <vcl/svapp.hxx>
26 #include <com/sun/star/text/TextMarkupType.hpp>
27 #include <com/sun/star/beans/PropertyAttribute.hpp>
28 #include <unotextmarkup.hxx>
29 #include <ndtxt.hxx>
30 #include <doc.hxx>
33 #include <viewsh.hxx>
34 #include <viewimp.hxx>
35 #include <breakit.hxx>
36 #include <pam.hxx>
37 #include <unotextrange.hxx>
38 #include <pagefrm.hxx>
39 #include <cntfrm.hxx>
40 #include <txtfrm.hxx>
41 #include <rootfrm.hxx>
42 #include <poolfmt.hxx>
43 #include <pagedesc.hxx>
44 #include <IGrammarContact.hxx>
45 #include <viewopt.hxx>
48 #include <comphelper/sequence.hxx>
49 #include <sal/log.hxx>
50 
51 #include <com/sun/star/lang/XUnoTunnel.hpp>
52 #include <com/sun/star/text/XTextRange.hpp>
53 
54 using namespace ::com::sun::star;
55 
56 namespace SwUnoCursorHelper {
57 
58 uno::Reference<text::XFlatParagraphIterator>
59 CreateFlatParagraphIterator(SwDoc & rDoc, sal_Int32 const nTextMarkupType,
60  bool const bAutomatic)
61 {
62  return new SwXFlatParagraphIterator(rDoc, nTextMarkupType, bAutomatic);
63 }
64 
65 }
66 
67 SwXFlatParagraph::SwXFlatParagraph( SwTextNode& rTextNode, const OUString& aExpandText, const ModelToViewHelper& rMap )
68  : SwXFlatParagraph_Base(& rTextNode, rMap)
69  , maExpandText(aExpandText)
70 {
71 }
72 
74 {
75 }
76 
77 
78 // XPropertySet
79 uno::Reference< beans::XPropertySetInfo > SAL_CALL
81 {
82  static comphelper::PropertyMapEntry s_Entries[] = {
83  { OUString("FieldPositions"), -1, ::cppu::UnoType<uno::Sequence<sal_Int32>>::get(), beans::PropertyAttribute::READONLY, 0 },
84  { OUString("FootnotePositions"), -1, ::cppu::UnoType<uno::Sequence<sal_Int32>>::get(), beans::PropertyAttribute::READONLY, 0 },
85  { OUString(), -1, css::uno::Type(), 0, 0 }
86  };
87  return new comphelper::PropertySetInfo(s_Entries);
88 }
89 
90 void SAL_CALL
92 {
93  throw lang::IllegalArgumentException("no values can be set",
94  static_cast< ::cppu::OWeakObject*>(this), 0);
95 }
96 
97 uno::Any SAL_CALL
98 SwXFlatParagraph::getPropertyValue(const OUString& rPropertyName)
99 {
100  SolarMutexGuard g;
101 
102  if (rPropertyName == "FieldPositions")
103  {
104  return uno::makeAny( comphelper::containerToSequence( GetConversionMap().getFieldPositions() ) );
105  }
106  else if (rPropertyName == "FootnotePositions")
107  {
108  return uno::makeAny( comphelper::containerToSequence( GetConversionMap().getFootnotePositions() ) );
109  }
110  return uno::Any();
111 }
112 
113 void SAL_CALL
115  const OUString& /*rPropertyName*/,
116  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
117 {
118  SAL_WARN("sw.uno",
119  "SwXFlatParagraph::addPropertyChangeListener(): not implemented");
120 }
121 
122 void SAL_CALL
124  const OUString& /*rPropertyName*/,
125  const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/)
126 {
127  SAL_WARN("sw.uno",
128  "SwXFlatParagraph::removePropertyChangeListener(): not implemented");
129 }
130 
131 void SAL_CALL
133  const OUString& /*rPropertyName*/,
134  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
135 {
136  SAL_WARN("sw.uno",
137  "SwXFlatParagraph::addVetoableChangeListener(): not implemented");
138 }
139 
140 void SAL_CALL
142  const OUString& /*rPropertyName*/,
143  const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/)
144 {
145  SAL_WARN("sw.uno",
146  "SwXFlatParagraph::removeVetoableChangeListener(): not implemented");
147 }
148 
149 
150 css::uno::Reference< css::container::XStringKeyMap > SAL_CALL SwXFlatParagraph::getMarkupInfoContainer()
151 {
153 }
154 
155 void SAL_CALL SwXFlatParagraph::commitTextRangeMarkup(::sal_Int32 nType, const OUString & aIdentifier, const uno::Reference< text::XTextRange> & xRange,
156  const css::uno::Reference< css::container::XStringKeyMap > & xMarkupInfoContainer)
157 {
158  SolarMutexGuard aGuard;
159  SwXTextMarkup::commitTextRangeMarkup( nType, aIdentifier, xRange, xMarkupInfoContainer );
160 }
161 
162 void SAL_CALL SwXFlatParagraph::commitStringMarkup(::sal_Int32 nType, const OUString & rIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const css::uno::Reference< css::container::XStringKeyMap > & rxMarkupInfoContainer)
163 {
164  SolarMutexGuard aGuard;
165  SwXTextMarkup::commitStringMarkup( nType, rIdentifier, nStart, nLength, rxMarkupInfoContainer );
166 }
167 
168 // text::XFlatParagraph:
169 OUString SAL_CALL SwXFlatParagraph::getText()
170 {
171  return maExpandText;
172 }
173 
174 // text::XFlatParagraph:
175 void SAL_CALL SwXFlatParagraph::setChecked( ::sal_Int32 nType, sal_Bool bVal )
176 {
177  SolarMutexGuard aGuard;
178 
179  if (!GetTextNode())
180  return;
181 
182  if ( text::TextMarkupType::SPELLCHECK == nType )
183  {
184  GetTextNode()->SetWrongDirty(
186  }
187  else if ( text::TextMarkupType::SMARTTAG == nType )
188  GetTextNode()->SetSmartTagDirty( !bVal );
189  else if( text::TextMarkupType::PROOFREADING == nType )
190  {
191  GetTextNode()->SetGrammarCheckDirty( !bVal );
192  if( bVal )
193  ::finishGrammarCheck( *GetTextNode() );
194  }
195 }
196 
197 // text::XFlatParagraph:
198 sal_Bool SAL_CALL SwXFlatParagraph::isChecked( ::sal_Int32 nType )
199 {
200  SolarMutexGuard aGuard;
201  if (GetTextNode())
202  {
203  if ( text::TextMarkupType::SPELLCHECK == nType )
204  return !GetTextNode()->IsWrongDirty();
205  else if ( text::TextMarkupType::PROOFREADING == nType )
206  return !GetTextNode()->IsGrammarCheckDirty();
207  else if ( text::TextMarkupType::SMARTTAG == nType )
208  return !GetTextNode()->IsSmartTagDirty();
209  }
210 
211  return true;
212 }
213 
214 // text::XFlatParagraph:
216 {
217  SolarMutexGuard aGuard;
218  return nullptr == GetTextNode();
219 }
220 
221 // text::XFlatParagraph:
222 lang::Locale SAL_CALL SwXFlatParagraph::getLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen)
223 {
224  SolarMutexGuard aGuard;
225  if (!GetTextNode())
227 
228  const lang::Locale aLocale( SW_BREAKITER()->GetLocale( GetTextNode()->GetLang(nPos, nLen) ) );
229  return aLocale;
230 }
231 
232 // text::XFlatParagraph:
233 lang::Locale SAL_CALL SwXFlatParagraph::getPrimaryLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen)
234 {
235  SolarMutexGuard aGuard;
236 
237  if (!GetTextNode())
239 
240  const lang::Locale aLocale( SW_BREAKITER()->GetLocale( GetTextNode()->GetLang(nPos, nLen) ) );
241  return aLocale;
242 }
243 
244 // text::XFlatParagraph:
245 void SAL_CALL SwXFlatParagraph::changeText(::sal_Int32 nPos, ::sal_Int32 nLen, const OUString & aNewText, const css::uno::Sequence< css::beans::PropertyValue > & aAttributes)
246 {
247  SolarMutexGuard aGuard;
248 
249  if (!GetTextNode())
250  return;
251 
252  SwTextNode *const pOldTextNode = GetTextNode();
253 
254  if (nPos < 0 || pOldTextNode->Len() < nPos || nLen < 0 || o3tl::make_unsigned(pOldTextNode->Len()) < static_cast<sal_uInt32>(nPos) + nLen)
255  {
256  throw lang::IllegalArgumentException();
257  }
258 
259  SwPaM aPaM( *GetTextNode(), nPos, *GetTextNode(), nPos+nLen );
260 
261  UnoActionContext aAction( &GetTextNode()->GetDoc() );
262 
263  const uno::Reference< text::XTextRange > xRange =
265  GetTextNode()->GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() );
266  uno::Reference< beans::XPropertySet > xPropSet( xRange, uno::UNO_QUERY );
267  if ( xPropSet.is() )
268  {
269  for ( const auto& rAttribute : aAttributes )
270  xPropSet->setPropertyValue( rAttribute.Name, rAttribute.Value );
271  }
272 
274  rIDCO.ReplaceRange( aPaM, aNewText, false );
275 
276  ClearTextNode(); // TODO: is this really needed?
277 }
278 
279 // text::XFlatParagraph:
280 void SAL_CALL SwXFlatParagraph::changeAttributes(::sal_Int32 nPos, ::sal_Int32 nLen, const css::uno::Sequence< css::beans::PropertyValue > & aAttributes)
281 {
282  SolarMutexGuard aGuard;
283 
284  if (!GetTextNode())
285  return;
286 
287  if (nPos < 0 || GetTextNode()->Len() < nPos || nLen < 0 || o3tl::make_unsigned(GetTextNode()->Len()) < static_cast<sal_uInt32>(nPos) + nLen)
288  {
289  throw lang::IllegalArgumentException();
290  }
291 
292  SwPaM aPaM( *GetTextNode(), nPos, *GetTextNode(), nPos+nLen );
293 
294  UnoActionContext aAction( &GetTextNode()->GetDoc() );
295 
296  const uno::Reference< text::XTextRange > xRange =
298  GetTextNode()->GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() );
299  uno::Reference< beans::XPropertySet > xPropSet( xRange, uno::UNO_QUERY );
300  if ( xPropSet.is() )
301  {
302  for ( const auto& rAttribute : aAttributes )
303  xPropSet->setPropertyValue( rAttribute.Name, rAttribute.Value );
304  }
305 
306  ClearTextNode(); // TODO: is this really needed?
307 }
308 
309 // text::XFlatParagraph:
310 css::uno::Sequence< ::sal_Int32 > SAL_CALL SwXFlatParagraph::getLanguagePortions()
311 {
312  return css::uno::Sequence< ::sal_Int32>();
313 }
314 
315 namespace
316 {
317  class theSwXFlatParagraphUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFlatParagraphUnoTunnelId > {};
318 }
319 
320 const uno::Sequence< sal_Int8 >&
322 {
323  return theSwXFlatParagraphUnoTunnelId::get().getSeq();
324 }
325 
326 sal_Int64 SAL_CALL
328  const uno::Sequence< sal_Int8 >& rId)
329 {
330  return sw::UnoTunnelImpl(rId, this);
331 }
332 
333 SwXFlatParagraphIterator::SwXFlatParagraphIterator( SwDoc& rDoc, sal_Int32 nType, bool bAutomatic )
334  : mpDoc( &rDoc ),
335  mnType( nType ),
336  mbAutomatic( bAutomatic ),
337  mnCurrentNode( 0 ),
338  mnEndNode( rDoc.GetNodes().Count() )
339 {
340  //mnStartNode = mnCurrentNode = get node from current cursor TODO!
341 
342  // register as listener and get notified when document is closed
344 }
345 
347 {
348  SolarMutexGuard aGuard;
349  EndListeningAll();
350 }
351 
353 {
354  if(rHint.GetId() == SfxHintId::Dying)
355  {
356  SolarMutexGuard aGuard;
357  mpDoc = nullptr;
358  }
359 }
360 
361 uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getFirstPara()
362 {
363  return getNextPara(); // TODO
364 }
365 
366 uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
367 {
368  SolarMutexGuard aGuard;
369 
370  uno::Reference< text::XFlatParagraph > xRet;
371  if (!mpDoc)
372  return xRet;
373 
374  SwTextNode* pRet = nullptr;
375  if ( mbAutomatic )
376  {
378 
379  SwPageFrame* pCurrentPage = pViewShell ? pViewShell->Imp()->GetFirstVisPage(pViewShell->GetOut()) : nullptr;
380  SwPageFrame* pStartPage = pCurrentPage;
381  SwPageFrame* pStopPage = nullptr;
382 
383  while ( pCurrentPage && pCurrentPage != pStopPage )
384  {
385  if (mnType != text::TextMarkupType::SPELLCHECK || pCurrentPage->IsInvalidSpelling() )
386  {
387  // this method is supposed to return an empty paragraph in case Online Checking is disabled
388  if ( ( mnType == text::TextMarkupType::PROOFREADING || mnType == text::TextMarkupType::SPELLCHECK )
389  && !pViewShell->GetViewOptions()->IsOnlineSpell() )
390  return xRet;
391 
392  // search for invalid content:
393  SwContentFrame* pCnt = pCurrentPage->ContainsContent();
394 
395  while( pCnt && pCurrentPage->IsAnLower( pCnt ) )
396  {
397  if (pCnt->IsTextFrame())
398  {
399  SwTextFrame const*const pText(static_cast<SwTextFrame const*>(pCnt));
400  if (sw::MergedPara const*const pMergedPara = pText->GetMergedPara()
401  )
402  {
403  SwTextNode * pTextNode(nullptr);
404  for (auto const& e : pMergedPara->extents)
405  {
406  if (e.pNode != pTextNode)
407  {
408  pTextNode = e.pNode;
409  if ((mnType == text::TextMarkupType::SPELLCHECK
410  && pTextNode->IsWrongDirty()) ||
411  (mnType == text::TextMarkupType::PROOFREADING
412  && pTextNode->IsGrammarCheckDirty()))
413  {
414  pRet = pTextNode;
415  break;
416  }
417  }
418  }
419  }
420  else
421  {
422  SwTextNode const*const pTextNode(pText->GetTextNodeFirst());
423  if ((mnType == text::TextMarkupType::SPELLCHECK
424  && pTextNode->IsWrongDirty()) ||
425  (mnType == text::TextMarkupType::PROOFREADING
426  && pTextNode->IsGrammarCheckDirty()))
427 
428  {
429  pRet = const_cast<SwTextNode*>(pTextNode);
430  }
431  }
432 
433  if (pRet)
434  {
435  break;
436  }
437  }
438 
439  pCnt = pCnt->GetNextContentFrame();
440  }
441  }
442 
443  if ( pRet )
444  break;
445 
446  // if there is no invalid text node on the current page,
447  // we validate the page
448  pCurrentPage->ValidateSpelling();
449 
450  // proceed with next page, wrap at end of document if required:
451  pCurrentPage = static_cast<SwPageFrame*>(pCurrentPage->GetNext());
452 
453  if ( !pCurrentPage && !pStopPage )
454  {
455  pStopPage = pStartPage;
456  pCurrentPage = static_cast<SwPageFrame*>(pViewShell->GetLayout()->Lower());
457  }
458  }
459  }
460  else // non-automatic checking
461  {
462  const SwNodes& rNodes = mpDoc->GetNodes();
463  const sal_uLong nMaxNodes = rNodes.Count();
464 
465  while ( mnCurrentNode < mnEndNode && mnCurrentNode < nMaxNodes )
466  {
467  SwNode* pNd = rNodes[ mnCurrentNode ];
468 
469  ++mnCurrentNode;
470 
471  pRet = dynamic_cast<SwTextNode*>(pNd);
472  if ( pRet )
473  break;
474 
475  if ( mnCurrentNode == mnEndNode )
476  {
477  mnCurrentNode = 0;
478  mnEndNode = 0;
479  }
480  }
481  }
482 
483  if ( pRet )
484  {
485  // Expand the string:
486  const ModelToViewHelper aConversionMap(*pRet, mpDoc->getIDocumentLayoutAccess().GetCurrentLayout());
487  const OUString& aExpandText = aConversionMap.getViewText();
488 
489  xRet = new SwXFlatParagraph( *pRet, aExpandText, aConversionMap );
490  // keep hard references...
491  m_aFlatParaList.insert( xRet );
492  }
493 
494  return xRet;
495 }
496 
497 uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getLastPara()
498 {
499  return getNextPara();
500 }
501 
502 uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaAfter(const uno::Reference< text::XFlatParagraph > & xPara)
503 {
504  SolarMutexGuard aGuard;
505 
506  uno::Reference< text::XFlatParagraph > xRet;
507  if (!mpDoc)
508  return xRet;
509 
510  const uno::Reference<lang::XUnoTunnel> xFPTunnel(xPara, uno::UNO_QUERY);
511  SAL_WARN_IF(!xFPTunnel.is(), "sw.core", "invalid argument");
512  SwXFlatParagraph* const pFlatParagraph(sw::UnoTunnelGetImplementation<SwXFlatParagraph>(xFPTunnel));
513 
514  if ( !pFlatParagraph )
515  return xRet;
516 
517  SwTextNode const*const pCurrentNode = pFlatParagraph->GetTextNode();
518 
519  if ( !pCurrentNode )
520  return xRet;
521 
522  SwTextNode* pNextTextNode = nullptr;
523  const SwNodes& rNodes = pCurrentNode->GetDoc().GetNodes();
524 
525  for( sal_uLong nCurrentNode = pCurrentNode->GetIndex() + 1; nCurrentNode < rNodes.Count(); ++nCurrentNode )
526  {
527  SwNode* pNd = rNodes[ nCurrentNode ];
528  pNextTextNode = dynamic_cast<SwTextNode*>(pNd);
529  if ( pNextTextNode )
530  break;
531  }
532 
533  if ( pNextTextNode )
534  {
535  // Expand the string:
536  const ModelToViewHelper aConversionMap(*pNextTextNode, mpDoc->getIDocumentLayoutAccess().GetCurrentLayout());
537  const OUString& aExpandText = aConversionMap.getViewText();
538 
539  xRet = new SwXFlatParagraph( *pNextTextNode, aExpandText, aConversionMap );
540  // keep hard references...
541  m_aFlatParaList.insert( xRet );
542  }
543 
544  return xRet;
545 }
546 
547 uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getParaBefore(const uno::Reference< text::XFlatParagraph > & xPara )
548 {
549  SolarMutexGuard aGuard;
550 
551  uno::Reference< text::XFlatParagraph > xRet;
552  if (!mpDoc)
553  return xRet;
554 
555  const uno::Reference<lang::XUnoTunnel> xFPTunnel(xPara, uno::UNO_QUERY);
556 
557  SAL_WARN_IF(!xFPTunnel.is(), "sw.core", "invalid argument");
558  SwXFlatParagraph* const pFlatParagraph(sw::UnoTunnelGetImplementation<SwXFlatParagraph>(xFPTunnel));
559 
560  if ( !pFlatParagraph )
561  return xRet;
562 
563  SwTextNode const*const pCurrentNode = pFlatParagraph->GetTextNode();
564 
565  if ( !pCurrentNode )
566  return xRet;
567 
568  SwTextNode* pPrevTextNode = nullptr;
569  const SwNodes& rNodes = pCurrentNode->GetDoc().GetNodes();
570 
571  for( sal_uLong nCurrentNode = pCurrentNode->GetIndex() - 1; nCurrentNode > 0; --nCurrentNode )
572  {
573  SwNode* pNd = rNodes[ nCurrentNode ];
574  pPrevTextNode = dynamic_cast<SwTextNode*>(pNd);
575  if ( pPrevTextNode )
576  break;
577  }
578 
579  if ( pPrevTextNode )
580  {
581  // Expand the string:
582  const ModelToViewHelper aConversionMap(*pPrevTextNode, mpDoc->getIDocumentLayoutAccess().GetCurrentLayout());
583  const OUString& aExpandText = aConversionMap.getViewText();
584 
585  xRet = new SwXFlatParagraph( *pPrevTextNode, aExpandText, aConversionMap );
586  // keep hard references...
587  m_aFlatParaList.insert( xRet );
588  }
589 
590  return xRet;
591 }
592 
593 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:206
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
#define LANGUAGE_NONE
sal_uLong GetIndex() const
Definition: node.hxx:290
OUString maExpandText
sal_uLong Count() const
Definition: ndarr.hxx:142
SwContentFrame * GetNextContentFrame() const
Definition: cntfrm.hxx:98
uno::Reference< text::XFlatParagraphIterator > CreateFlatParagraphIterator(SwDoc &rDoc, sal_Int32 const nTextMarkupType, bool const bAutomatic)
Definition: unoflatpara.cxx:59
SwViewShellImp * Imp()
Definition: viewsh.hxx:182
virtual const SwRootFrame * GetCurrentLayout() const =0
bool IsWrongDirty() const
Definition: txtedt.cxx:2255
virtual OUString SAL_CALL getText() override
SwXFlatParagraphIterator(SwDoc &rDoc, sal_Int32 nType, bool bAutomatic)
void ValidateSpelling() const
Definition: pagefrm.hxx:408
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL changeText(::sal_Int32 nPos,::sal_Int32 nLen, const OUString &aNewText, const css::uno::Sequence< css::beans::PropertyValue > &aAttributes) override
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > &xPara) override
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:275
sal_uIntPtr sal_uLong
const SwPosition * GetMark() const
Definition: pam.hxx:209
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
sw::MergedPara * GetMergedPara()
Definition: txtfrm.hxx:441
Definition: doc.hxx:186
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual sal_Bool SAL_CALL isModified() override
#define SW_BREAKITER()
Definition: breakit.hxx:121
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
sal_Int64 UnoTunnelImpl(const css::uno::Sequence< sal_Int8 > &rId, C *const pThis)
virtual void Notify(const SfxHint &) override
SfxHintId GetId() const
::cppu::ImplInheritanceHelper< SwXTextMarkup, css::beans::XPropertySet, css::text::XFlatParagraph, css::lang::XUnoTunnel > SwXFlatParagraph_Base
Definition: unoflatpara.hxx:39
const SwPageFrame * GetFirstVisPage(OutputDevice const *pRenderContext) const
Management of the first visible Page.
Definition: viewimp.cxx:270
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > &xPara) override
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
std::set< css::uno::Reference< css::text::XFlatParagraph > > m_aFlatParaList
bool IsTextFrame() const
Definition: frame.hxx:1215
bool IsInvalidSpelling() const
Definition: pagefrm.hxx:223
void finishGrammarCheck(SwTextNode &rTextNode)
finishGrammarCheck() calls the same function of the grammar contact of the document (for a given text...
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:947
virtual ~SwXFlatParagraphIterator() override
virtual void SAL_CALL changeAttributes(::sal_Int32 nPos,::sal_Int32 nLen, const css::uno::Sequence< css::beans::PropertyValue > &aAttributes) override
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
void EndListeningAll()
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
SwTextNode * GetTextNodeFirst()
Definition: txtfrm.hxx:448
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
const OUString & getViewText() const
SwDoc & GetDoc()
Definition: node.hxx:211
const SwPosition * GetPoint() const
Definition: pam.hxx:207
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getLastPara() 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
sal_Int32 mnType
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the document content operations interface.
Definition: node.cxx:2129
Count
const SwFrame * Lower() const
Definition: layfrm.hxx:101
virtual css::lang::Locale SAL_CALL getLanguageOfText(::sal_Int32 nPos,::sal_Int32 nLen) override
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getFirstPara() override
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
unsigned char sal_Bool
virtual bool ReplaceRange(SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace)=0
Replace selected range in a TextNode with string.
bool IsOnlineSpell() const
Definition: viewopt.hxx:357
Text operation/manipulation interface.
bool StartListening(SvtBroadcaster &rBroadcaster)
A page of the document layout.
Definition: pagefrm.hxx:41
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
virtual sal_Bool SAL_CALL isChecked(::sal_Int32 nType) override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
const sal_Int32 mnType
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:96
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
#define SAL_WARN_IF(condition, area, stream)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
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
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
SwNodes & GetNodes()
Definition: doc.hxx:405
SwXFlatParagraph(SwTextNode &rTextNode, const OUString &aExpandText, const ModelToViewHelper &rConversionMap)
Definition: unoflatpara.cxx:67
virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getLanguagePortions() override
virtual css::lang::Locale SAL_CALL getPrimaryLanguageOfText(::sal_Int32 nPos,::sal_Int32 nLen) override
virtual ~SwXFlatParagraph() override
Definition: unoflatpara.cxx:73
#define SAL_WARN(area, stream)
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unoflatpara.cxx:98
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1054
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:66
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2072
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unoflatpara.cxx:91
Standard page.
Definition: poolfmt.hxx:170
virtual void SAL_CALL setChecked(::sal_Int32 nType, sal_Bool bVal) override
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getNextPara() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoflatpara.cxx:80
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:845
bool IsGrammarCheckDirty() const
Definition: txtedt.cxx:2268
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 css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
SwFrame * GetNext()
Definition: frame.hxx:659
Base class of the Writer document model elements.
Definition: node.hxx:79