LibreOffice Module sw (master)  1
docglbl.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 <osl/diagnose.h>
21 #include <unotools/tempfile.hxx>
22 #include <svl/stritem.hxx>
23 #include <svl/eitem.hxx>
24 #include <sfx2/docfile.hxx>
25 #include <sfx2/docfilt.hxx>
26 #include <sfx2/fcontnr.hxx>
27 #include <sfx2/bindings.hxx>
28 #include <sfx2/request.hxx>
29 #include <sfx2/sfxsids.hrc>
30 #include <sfx2/viewfrm.hxx>
31 #include <tools/datetime.hxx>
32 #include <fmtinfmt.hxx>
33 #include <fmtanchr.hxx>
34 #include <doc.hxx>
35 #include <IDocumentUndoRedo.hxx>
40 #include <docary.hxx>
41 #include <pam.hxx>
42 #include <ndtxt.hxx>
43 #include <docsh.hxx>
44 #include <section.hxx>
45 #include <calbck.hxx>
46 #include <iodetect.hxx>
47 #include <memory>
48 #include <com/sun/star/uno/Reference.h>
49 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
50 #include <com/sun/star/document/XDocumentProperties.hpp>
51 
52 using namespace ::com::sun::star;
53 
55 {
58 };
59 
60 bool SwDoc::GenerateGlobalDoc( const OUString& rPath,
61  const SwTextFormatColl* pSplitColl )
62 {
63  return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, false, pSplitColl );
64 }
65 
66 bool SwDoc::GenerateGlobalDoc( const OUString& rPath, int nOutlineLevel )
67 {
68  return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, true, nullptr, nOutlineLevel );
69 }
70 
71 bool SwDoc::GenerateHTMLDoc( const OUString& rPath, int nOutlineLevel )
72 {
73  return SplitDoc( SPLITDOC_TO_HTML, rPath, true, nullptr, nOutlineLevel );
74 }
75 
76 bool SwDoc::GenerateHTMLDoc( const OUString& rPath,
77  const SwTextFormatColl* pSplitColl )
78 {
79  return SplitDoc( SPLITDOC_TO_HTML, rPath, false, pSplitColl );
80 }
81 
82 // two helpers for outline mode
83 static SwNodePtr GetStartNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type* nOutl )
84 {
85  SwNodePtr pNd;
86 
87  for( ; *nOutl < pOutlNds->size(); ++(*nOutl) )
88  if( ( pNd = (*pOutlNds)[ *nOutl ])->GetTextNode()->GetAttrOutlineLevel() == nOutlineLevel && !pNd->FindTableNode() )
89  {
90  return pNd;
91  }
92 
93  return nullptr;
94 }
95 
96 static SwNodePtr GetEndNode( SwOutlineNodes const * pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type* nOutl )
97 {
98  SwNodePtr pNd;
99 
100  for( ++(*nOutl); (*nOutl) < pOutlNds->size(); ++(*nOutl) )
101  {
102  pNd = (*pOutlNds)[ *nOutl ];
103 
104  const int nLevel = pNd->GetTextNode()->GetAttrOutlineLevel();
105 
106  if( ( 0 < nLevel && nLevel <= nOutlineLevel ) &&
107  !pNd->FindTableNode() )
108  {
109  return pNd;
110  }
111  }
112  return nullptr;
113 }
114 
115 // two helpers for collection mode
116 static SwNodePtr GetStartNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* pSplitColl, SwOutlineNodes::size_type* nOutl )
117 {
118  SwNodePtr pNd;
119  for( ; *nOutl < pOutlNds->size(); ++(*nOutl) )
120  if( ( pNd = (*pOutlNds)[ *nOutl ])->GetTextNode()->
121  GetTextColl() == pSplitColl &&
122  !pNd->FindTableNode() )
123  {
124  return pNd;
125  }
126  return nullptr;
127 }
128 
129 static SwNodePtr GetEndNode( const SwOutlineNodes* pOutlNds, const SwTextFormatColl* pSplitColl, SwOutlineNodes::size_type* nOutl )
130 {
131  SwNodePtr pNd;
132 
133  for( ++(*nOutl); *nOutl < pOutlNds->size(); ++(*nOutl) )
134  {
135  pNd = (*pOutlNds)[ *nOutl ];
136  SwTextFormatColl* pTColl = pNd->GetTextNode()->GetTextColl();
137 
138  if( ( pTColl == pSplitColl ||
139  ( pSplitColl->GetAttrOutlineLevel() > 0 &&
140  pTColl->GetAttrOutlineLevel() > 0 &&
141  pTColl->GetAttrOutlineLevel() <
142  pSplitColl->GetAttrOutlineLevel() )) &&
143  !pNd->FindTableNode() )
144  {
145  return pNd;
146  }
147  }
148  return nullptr;
149 }
150 
151 bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, const SwTextFormatColl* pSplitColl, int nOutlineLevel )
152 {
153  // Iterate over all the template's Nodes, creating an own
154  // document for every single one and replace linked sections (GlobalDoc) for links (HTML).
155  // Finally, we save this document as a GlobalDoc/HTMLDoc.
156  if( !mpDocShell || !mpDocShell->GetMedium() ||
158  return false;
159 
160  SwOutlineNodes::size_type nOutl = 0;
161  SwOutlineNodes* pOutlNds = const_cast<SwOutlineNodes*>(&GetNodes().GetOutLineNds());
162  std::unique_ptr<SwOutlineNodes> xTmpOutlNds;
163  SwNodePtr pStartNd;
164 
165  if ( !bOutline) {
166  if( pSplitColl )
167  {
168  // If it isn't an OutlineNumbering, then use an own array and collect the Nodes.
169  if( pSplitColl->GetAttrOutlineLevel() == 0 )
170  {
171  xTmpOutlNds.reset(new SwOutlineNodes);
172  pOutlNds = xTmpOutlNds.get();
173  SwIterator<SwTextNode,SwFormatColl> aIter( *pSplitColl );
174  for( SwTextNode* pTNd = aIter.First(); pTNd; pTNd = aIter.Next() )
175  if( pTNd->GetNodes().IsDocNodes() )
176  pOutlNds->insert( pTNd );
177 
178  if( pOutlNds->empty() )
179  return false;
180  }
181  }
182  else
183  {
184  // Look for the 1st level OutlineTemplate
185  const SwTextFormatColls& rFormatColls =*GetTextFormatColls();
186  for( SwTextFormatColls::size_type n = rFormatColls.size(); n; )
187  if ( rFormatColls[ --n ]->GetAttrOutlineLevel() == 1 )
188  {
189  pSplitColl = rFormatColls[ n ];
190  break;
191  }
192 
193  if( !pSplitColl )
194  return false;
195  }
196  }
197 
198  std::shared_ptr<const SfxFilter> pFilter;
199  switch( eDocType )
200  {
201  case SPLITDOC_TO_HTML:
202  pFilter = SwIoSystem::GetFilterOfFormat("HTML");
203  break;
204 
205  default:
207  eDocType = SPLITDOC_TO_GLOBALDOC;
208  break;
209  }
210 
211  if( !pFilter )
212  return false;
213 
214  // Deactivate Undo/Redline in any case
215  GetIDocumentUndoRedo().DoUndo(false);
217 
218  OUString sExt = pFilter->GetSuffixes().getToken(0, ',');
219  if( sExt.isEmpty() )
220  {
221  sExt = ".sxw";
222  }
223  else
224  {
225  if( '.' != sExt[ 0 ] )
226  {
227  sExt = "." + sExt;
228  }
229  }
230 
231  INetURLObject aEntry(rPath);
232  OUString sLeading(aEntry.GetBase());
233  aEntry.removeSegment();
234  OUString sPath = aEntry.GetMainURL( INetURLObject::DecodeMechanism::NONE );
235  utl::TempFile aTemp(sLeading, true, &sExt, &sPath);
236  aTemp.EnableKillingFile();
237 
238  DateTime aTmplDate( DateTime::SYSTEM );
239  {
240  tools::Time a2Min( 0 ); a2Min.SetMin( 2 );
241  aTmplDate += a2Min;
242  }
243 
244  // Skip all invalid ones
245  while( nOutl < pOutlNds->size() &&
246  (*pOutlNds)[ nOutl ]->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() )
247  ++nOutl;
248 
249  do {
250  if( bOutline )
251  pStartNd = GetStartNode( pOutlNds, nOutlineLevel, &nOutl );
252  else
253  pStartNd = GetStartNode( pOutlNds, pSplitColl, &nOutl );
254 
255  if( pStartNd )
256  {
257  SwNodePtr pEndNd;
258  if( bOutline )
259  pEndNd = GetEndNode( pOutlNds, nOutlineLevel, &nOutl );
260  else
261  pEndNd = GetEndNode( pOutlNds, pSplitColl, &nOutl );
262  SwNodeIndex aEndIdx( pEndNd ? *pEndNd
263  : GetNodes().GetEndOfContent() );
264 
265  // Write out the Nodes completely
266  OUString sFileName;
267  if( pStartNd->GetIndex() + 1 < aEndIdx.GetIndex() )
268  {
269  SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::INTERNAL ));
270  if( xDocSh->DoInitNew() )
271  {
272  SwDoc* pDoc = static_cast<SwDocShell*>(&xDocSh)->GetDoc();
273 
274  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
275  static_cast<SwDocShell*>(&xDocSh)->GetModel(),
276  uno::UNO_QUERY_THROW);
277  uno::Reference<document::XDocumentProperties> xDocProps(
278  xDPS->getDocumentProperties());
279  OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
280  // the GlobalDoc is the template
281  xDocProps->setTemplateName(OUString());
282  ::util::DateTime uDT = aTmplDate.GetUNODateTime();
283  xDocProps->setTemplateDate(uDT);
284  xDocProps->setTemplateURL(rPath);
285  // Set the new doc's title to the text of the "split para".
286  // If the current doc has a title, insert it at the begin.
287  OUString sTitle( xDocProps->getTitle() );
288  if (!sTitle.isEmpty())
289  sTitle += ": ";
290  sTitle += pStartNd->GetTextNode()->GetExpandText(nullptr);
291  xDocProps->setTitle( sTitle );
292 
293  // Replace template
294  pDoc->ReplaceStyles( *this );
295 
296  // Take over chapter numbering
297  if( mpOutlineRule )
299 
300  SwNodeRange aRg( *pStartNd, 0, aEndIdx.GetNode() );
301  SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() );
302  GetNodes().Copy_( aRg, aTmpIdx, false );
303 
304  // Delete the initial TextNode
305  SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 );
306  if( aIdx.GetIndex() + 1 !=
307  pDoc->GetNodes().GetEndOfContent().GetIndex() )
308  pDoc->GetNodes().Delete( aIdx );
309 
310  // All Flys in the section
312 
313  // And what's with all the Bookmarks?
314  // ?????
315 
316  utl::TempFile aTempFile2(sLeading, true, &sExt, &sPath);
317  sFileName = aTempFile2.GetURL();
318  SfxMedium* pTmpMed = new SfxMedium( sFileName,
319  StreamMode::STD_READWRITE );
320  pTmpMed->SetFilter( pFilter );
321 
322  // We need to have a Layout for the HTMLFilter, so that
323  // TextFrames/Controls/OLE objects can be exported correctly as graphics.
324  if( SPLITDOC_TO_HTML == eDocType &&
325  !pDoc->GetSpzFrameFormats()->empty() )
326  {
328  }
329  xDocSh->DoSaveAs( *pTmpMed );
330  xDocSh->DoSaveCompleted( pTmpMed );
331 
332  // do not insert a FileLinkSection in case of error
333  if( xDocSh->GetError() )
334  sFileName.clear();
335  }
336  xDocSh->DoClose();
337  }
338 
339  // We can now insert the section
340  if( !sFileName.isEmpty() )
341  {
342  switch( eDocType )
343  {
344  case SPLITDOC_TO_HTML:
345  {
346  // Delete all nodes in the section and, in the "start node",
347  // set the Link to the saved document.
348  sal_uLong nNodeDiff = aEndIdx.GetIndex() -
349  pStartNd->GetIndex() - 1;
350  if( nNodeDiff )
351  {
352  SwPaM aTmp( *pStartNd, aEndIdx.GetNode(), 1, -1 );
353  aTmp.GetPoint()->nContent.Assign( nullptr, 0 );
354  aTmp.GetMark()->nContent.Assign( nullptr, 0 );
355  SwNodeIndex aSIdx( aTmp.GetMark()->nNode );
356  SwNodeIndex aEIdx( aTmp.GetPoint()->nNode );
357 
358  // Try to move past the end
359  if( !aTmp.Move( fnMoveForward, GoInNode ) )
360  {
361  // well then, back to the beginning
362  aTmp.Exchange();
363  if( !aTmp.Move( fnMoveBackward, GoInNode ))
364  {
365  OSL_FAIL( "no more Nodes!" );
366  }
367  }
368  // Move Bookmarks and so forth
369  CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), true);
370 
371  // If FlyFrames are still around, delete these too
372  for( SwFrameFormats::size_type n = 0; n < GetSpzFrameFormats()->size(); ++n )
373  {
374  SwFrameFormat* pFly = (*GetSpzFrameFormats())[n];
375  const SwFormatAnchor* pAnchor = &pFly->GetAnchor();
376  SwPosition const*const pAPos =
377  pAnchor->GetContentAnchor();
378  if (pAPos &&
379  ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) ||
380  (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) &&
381  aSIdx <= pAPos->nNode &&
382  pAPos->nNode < aEIdx )
383  {
385  --n;
386  }
387  }
388 
389  GetNodes().Delete( aSIdx, nNodeDiff );
390  }
391 
392  // set the link in the StartNode
393  SwFormatINetFormat aINet( sFileName , OUString() );
394  SwTextNode* pTNd = pStartNd->GetTextNode();
395  pTNd->InsertItem(aINet, 0, pTNd->GetText().getLength());
396 
397  // If the link cannot be found anymore,
398  // it has to be a bug!
399  if( !pOutlNds->Seek_Entry( pStartNd, &nOutl ))
400  pStartNd = nullptr;
401  ++nOutl ;
402  }
403  break;
404 
405  default:
406  {
407  const OUString sNm(INetURLObject(sFileName).GetLastName());
408  SwSectionData aSectData( FILE_LINK_SECTION,
409  GetUniqueSectionName( &sNm ));
410  SwSectionFormat* pFormat = MakeSectionFormat();
411  aSectData.SetLinkFileName(sFileName);
412  aSectData.SetProtectFlag(true);
413 
414  --aEndIdx; // in the InsertSection the end is inclusive
415  while( aEndIdx.GetNode().IsStartNode() )
416  --aEndIdx;
417 
418  // If any Section ends or starts in the new sectionrange,
419  // they must end or start before or after the range!
420  SwSectionNode* pSectNd = pStartNd->FindSectionNode();
421  while( pSectNd && pSectNd->EndOfSectionIndex()
422  <= aEndIdx.GetIndex() )
423  {
424  const SwNode* pSectEnd = pSectNd->EndOfSectionNode();
425  if( pSectNd->GetIndex() + 1 ==
426  pStartNd->GetIndex() )
427  {
428  bool bMvIdx = aEndIdx == *pSectEnd;
429  DelSectionFormat( pSectNd->GetSection().GetFormat() );
430  if( bMvIdx )
431  --aEndIdx;
432  }
433  else
434  {
435  SwNodeRange aRg( *pStartNd, *pSectEnd );
436  SwNodeIndex aIdx( *pSectEnd, 1 );
437  GetNodes().MoveNodes( aRg, GetNodes(), aIdx );
438  }
439  pSectNd = pStartNd->FindSectionNode();
440  }
441 
442  pSectNd = aEndIdx.GetNode().FindSectionNode();
443  while( pSectNd && pSectNd->GetIndex() >
444  pStartNd->GetIndex() )
445  {
446  // #i15712# don't attempt to split sections if
447  // they are fully enclosed in [pSectNd,aEndIdx].
448  if( aEndIdx < pSectNd->EndOfSectionIndex() )
449  {
450  SwNodeRange aRg( *pSectNd, 1, aEndIdx, 1 );
451  SwNodeIndex aIdx( *pSectNd );
452  GetNodes().MoveNodes( aRg, GetNodes(), aIdx );
453  }
454 
455  pSectNd = pStartNd->FindSectionNode();
456  }
457 
458  // -> #i26762#
459  // Ensure order of start and end of section is sane.
460  SwNodeIndex aStartIdx(*pStartNd);
461 
462  if (aEndIdx >= aStartIdx)
463  {
464  pSectNd = GetNodes().InsertTextSection(aStartIdx,
465  *pFormat, aSectData, nullptr, &aEndIdx, false);
466  }
467  else
468  {
469  pSectNd = GetNodes().InsertTextSection(aEndIdx,
470  *pFormat, aSectData, nullptr, &aStartIdx, false);
471  }
472  // <- #i26762#
473 
474  pSectNd->GetSection().CreateLink( CREATE_CONNECT );
475  }
476  break;
477  }
478  }
479  }
480  } while( pStartNd );
481 
482  xTmpOutlNds.reset();
483 
484  switch( eDocType )
485  {
486  case SPLITDOC_TO_HTML:
488  {
489  // save all remaining sections
490  while( !GetSections().empty() )
491  DelSectionFormat( GetSections().front() );
492 
494  pFilter = pFCntnr->GetFilter4EA( pFilter->GetTypeName(), SfxFilterFlags::EXPORT );
495  }
496  break;
497 
498  default:
499  // save the Globaldoc
502  }
503 
504  // The medium isn't locked after reopening the document.
505  SfxRequest aReq( SID_SAVEASDOC, SfxCallMode::SYNCHRON, GetAttrPool() );
506  aReq.AppendItem( SfxStringItem( SID_FILE_NAME, rPath ) );
507  aReq.AppendItem( SfxBoolItem( SID_SAVETO, true ) );
508  if(pFilter)
509  aReq.AppendItem( SfxStringItem( SID_FILTER_NAME, pFilter->GetName() ) );
510  const SfxBoolItem *pRet = static_cast<const SfxBoolItem*>(mpDocShell->ExecuteSlot( aReq ));
511 
512  return pRet && pRet->GetValue();
513 }
514 
515 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SwSplitDocType
Definition: docglbl.cxx:54
bool GetValue() const
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Definition: ndsect.cxx:955
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
SwSectionNode * InsertTextSection(SwNodeIndex const &rNdIdx, SwSectionFormat &rSectionFormat, SwSectionData const &, SwTOXBase const *const pTOXBase, SwNodeIndex const *const pEnde, bool const bInsAtStart=true, bool const bCreateFrames=true)
Insert a new SwSection.
Definition: ndsect.cxx:779
sal_uLong GetIndex() const
Definition: node.hxx:282
virtual SfxObjectFactory & GetFactory() const =0
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
Marks a position in the document model.
Definition: pam.hxx:35
virtual bool DoSaveCompleted(SfxMedium *pNewStor=nullptr, bool bRegisterRecent=true)
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
Definition: section.hxx:106
void SetLinkFileName(OUString const &rNew)
Definition: section.hxx:118
const OUString & GetText() const
Definition: ndtxt.hxx:210
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
Definition: ndsect.cxx:512
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
SwNodeIndex nNode
Definition: pam.hxx:37
std::shared_ptr< const SfxFilter > GetFilter4EA(const OUString &rEA, SfxFilterFlags nMust=SfxFilterFlags::IMPORT, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
sal_uIntPtr sal_uLong
bool GenerateHTMLDoc(const OUString &rPath, const SwTextFormatColl *pSplitColl)
Definition: docglbl.cxx:76
void CreateLink(LinkCreateType eType)
Definition: section.cxx:1481
Definition: doc.hxx:185
TElementType * Next()
Definition: calbck.hxx:373
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
Definition: ndsect.cxx:1351
virtual void set(DocumentSettingId id, bool value) override
Set the specified document setting.
SwNode & GetNode() const
Definition: ndindex.hxx:119
SwSectionFormat * GetFormat()
Definition: section.hxx:336
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:143
void Copy_(const SwNodeRange &rRg, const SwNodeIndex &rInsPos, bool bNewFrames=true) const
Definition: ndarr.hxx:177
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:737
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
Definition: docfmt.cxx:1520
int GetAttrOutlineLevel() const
Returns outline level of this text node.
Definition: ndtxt.cxx:4029
const SwSection & GetSection() const
Definition: node.hxx:541
OUString GetBase() const
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
Definition: nodes.cxx:1061
constexpr auto SFX_INTERFACE_NONE
SwIndex nContent
Definition: pam.hxx:38
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
bool IsStartNode() const
Definition: node.hxx:624
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
Definition: thints.cxx:1221
SwDocShell * mpDocShell
Definition: doc.hxx:257
bool empty() const
Definition: docary.hxx:224
RedlineFlags on.
SwSectionFormat * MakeSectionFormat()
Definition: ndsect.cxx:505
size_type size() const
bool SplitDoc(sal_uInt16 eDocType, const OUString &rPath, bool bOutline, const SwTextFormatColl *pSplitColl, int nOutlineLevel=0)
Create sub-documents according to the given collection.
Definition: docglbl.cxx:151
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
css::util::DateTime GetUNODateTime() const
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
static SwNodePtr GetStartNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
Definition: docglbl.cxx:83
static SW_DLLPUBLIC std::shared_ptr< const SfxFilter > GetFilterOfFormat(const OUString &rFormat, const SfxFilterContainer *pCnt=nullptr)
find for an internal format name the corresponding filter entry
Definition: iodetect.cxx:68
Style of a layout element.
Definition: frmfmt.hxx:57
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:892
const SwPosition * GetPoint() const
Definition: pam.hxx:207
std::vector< SwTextFormatColl * >::size_type size_type
Definition: docary.hxx:70
OUString const & GetURL() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:324
TElementType * First()
Definition: calbck.hxx:342
FlyAnchors.
Definition: fmtanchr.hxx:34
size_t size() const
Definition: docary.hxx:91
SwNumRule * mpOutlineRule
Definition: doc.hxx:251
size
void CopyFlyInFlyImpl(const SwNodeRange &rRg, SwPaM const *const pCopiedPaM, const SwNodeIndex &rStartIdx, const bool bCopyFlyAtFly=false) const
Marks a node in the document model.
Definition: ndindex.hxx:31
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:234
bool empty() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
void SetOutlineNumRule(const SwNumRule &rRule)
Definition: docnum.cxx:112
bool GenerateGlobalDoc(const OUString &rPath, const SwTextFormatColl *pSplitColl)
Definition: docglbl.cxx:60
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:677
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
bool DoSaveAs(SfxMedium &rNewStor)
OUString GetExpandText(SwRootFrame const *pLayout, const sal_Int32 nIdx=0, const sal_Int32 nLen=-1, const bool bWithNum=false, const bool bAddSpaceAfterListLabelStr=false, const bool bWithSpacesForLevel=false, const ExpandMode eAdditionalMode=ExpandMode::ExpandFootnote) const
add 4th optional parameter indicating, when that a spa...
Definition: ndtxt.cxx:3380
void CorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
Definition: doccorr.cxx:162
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:774
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
#define FILTER_XML
XML filter.
Definition: iodetect.hxx:35
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
bool DoInitNew(SfxMedium *pMedium=nullptr)
SwNodes & GetNodes()
Definition: doc.hxx:402
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:185
void SetMin(sal_uInt16 nNewMin)
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:349
ErrCode GetError() const
static SwNodePtr GetEndNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
Definition: docglbl.cxx:96
const sw::mark::IMark * GetMark() const
Definition: index.hxx:104
void AppendItem(const SfxPoolItem &)
size_t size() const
Definition: docary.hxx:225
SwFrameFormatsBase::size_type size_type
Definition: docary.hxx:217
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
Definition: ndnum.cxx:32
SfxFilterContainer * GetFilterContainer() const
std::pair< const_iterator, bool > insert(Value &&x)
int GetAttrOutlineLevel() const
Definition: fmtcol.cxx:582
std::vector< SwNode * >::size_type size_type
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:162
SwSectionFormats & GetSections()
Definition: doc.hxx:1328
void SetFilter(const std::shared_ptr< const SfxFilter > &pFilter)
void EnableKillingFile(bool bEnable=true)
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1309
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
bool MoveNodes(const SwNodeRange &, SwNodes &rNodes, const SwNodeIndex &, bool bNewFrames=true)
move the node pointer
Definition: nodes.cxx:394
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
Base class of the Writer document model elements.
Definition: node.hxx:79
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:836
SfxMedium * GetMedium() const