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