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