LibreOffice Module sw (master)  1
docdesc.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 <cmdid.h>
21 #include <init.hxx>
22 #include <editeng/lrspitem.hxx>
23 #include <editeng/ulspitem.hxx>
24 #include <editeng/paperinf.hxx>
25 #include <editeng/frmdiritem.hxx>
26 #include <sfx2/bindings.hxx>
27 #include <sfx2/dispatch.hxx>
28 #include <tools/globname.hxx>
29 #include <sal/log.hxx>
31 #include <fmtfsize.hxx>
32 #include <fmthdft.hxx>
33 #include <fmtcntnt.hxx>
34 #include <ftninfo.hxx>
35 #include <fesh.hxx>
36 #include <ndole.hxx>
37 #include <mdiexp.hxx>
38 #include <doc.hxx>
39 #include <IDocumentUndoRedo.hxx>
42 #include <IDocumentState.hxx>
44 #include <rootfrm.hxx>
45 #include <poolfmt.hxx>
46 #include <docsh.hxx>
47 #include <ftnidx.hxx>
48 #include <fmtftn.hxx>
49 #include <txtftn.hxx>
50 #include <fldbas.hxx>
51 #include <GetMetricVal.hxx>
52 #include <strings.hrc>
53 #include <hints.hxx>
54 #include <SwUndoPageDesc.hxx>
55 #include <pagedeschint.hxx>
56 #include <tgrditem.hxx>
57 #include <unotools/configmgr.hxx>
58 #include <unotools/syslocale.hxx>
59 #include <svx/swframetypes.hxx>
60 #include <svx/svxids.hrc>
61 #include <com/sun/star/embed/XEmbeddedObject.hpp>
62 
63 using namespace com::sun::star;
64 
65 static void lcl_DefaultPageFormat( sal_uInt16 nPoolFormatId,
66  SwFrameFormat &rFormat1,
67  SwFrameFormat &rFormat2,
68  SwFrameFormat &rFormat3,
69  SwFrameFormat &rFormat4)
70 {
71  // --> #i41075# Printer on demand
72  // This function does not require a printer anymore.
73  // The default page size is obtained from the application
74  //locale
75 
77  const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize();
78  aFrameSize.SetSize( aPhysSize );
79 
80  // Prepare for default margins.
81  // Margins have a default minimum size.
82  // If the printer forces a larger margins, that's ok too.
83  // The HTML page desc had A4 as page size always.
84  // This has been changed to take the page size from the printer.
85  // Unfortunately, the margins of the HTML page desc are smaller than
86  // the margins used here in general, so one extra case is required.
87  // In the long term, this needs to be changed to always keep the
88  // margins from the page desc.
89  sal_Int32 nMinTop, nMinBottom, nMinLeft, nMinRight;
90  if( RES_POOLPAGE_HTML == nPoolFormatId )
91  {
92  nMinRight = nMinTop = nMinBottom = GetMetricVal( CM_1 );
93  nMinLeft = nMinRight * 2;
94  }
95  else if (!utl::ConfigManager::IsFuzzing() && MeasurementSystem::Metric == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() )
96  {
97  nMinTop = nMinBottom = nMinLeft = nMinRight = 1134; // 2 centimeters
98  }
99  else
100  {
101  nMinTop = nMinBottom = 1440; // as in MS Word: 1 Inch
102  nMinLeft = nMinRight = 1800; // 1,25 Inch
103  }
104 
105  // set margins
108 
109  aUL.SetUpper( static_cast<sal_uInt16>(nMinTop) );
110  aUL.SetLower( static_cast<sal_uInt16>(nMinBottom) );
111  aLR.SetRight( nMinRight );
112  aLR.SetLeft( nMinLeft );
113 
114  rFormat1.SetFormatAttr( aFrameSize );
115  rFormat1.SetFormatAttr( aLR );
116  rFormat1.SetFormatAttr( aUL );
117 
118  rFormat2.SetFormatAttr( aFrameSize );
119  rFormat2.SetFormatAttr( aLR );
120  rFormat2.SetFormatAttr( aUL );
121 
122  rFormat3.SetFormatAttr( aFrameSize );
123  rFormat3.SetFormatAttr( aLR );
124  rFormat3.SetFormatAttr( aUL );
125 
126  rFormat4.SetFormatAttr( aFrameSize );
127  rFormat4.SetFormatAttr( aLR );
128  rFormat4.SetFormatAttr( aUL );
129 }
130 
131 static void lcl_DescSetAttr( const SwFrameFormat &rSource, SwFrameFormat &rDest,
132  const bool bPage = true )
133 {
134  // We should actually use ItemSet's Intersect here, but that doesn't work
135  // correctly if we have different WhichRanges.
136 
137  // Take over the attributes which are of interest.
138  sal_uInt16 const aIdArr[] = {
139  RES_FRM_SIZE, RES_UL_SPACE, // [83..86
140  RES_BACKGROUND, RES_SHADOW, // [99..101
141  RES_COL, RES_COL, // [103
142  RES_TEXTGRID, RES_TEXTGRID, // [109
143  RES_FRAMEDIR, RES_FRAMEDIR, // [114
146 
147  // take over DrawingLayer FillStyles
149 
150  0};
151 
152  const SfxPoolItem* pItem;
153  for( sal_uInt16 n = 0; aIdArr[ n ]; n += 2 )
154  {
155  for( sal_uInt16 nId = aIdArr[ n ]; nId <= aIdArr[ n+1]; ++nId )
156  {
157  // #i45539#
158  // bPage == true:
159  // All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
160  // bPage == false:
161  // All in aIdArr except from RES_COL and RES_PAPER_BIN:
162  bool bExecuteId(true);
163 
164  if(bPage)
165  {
166  // When Page
167  switch(nId)
168  {
169  // All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
171  // take out SvxBrushItem; it's the result of the fallback
172  // at SwFormat::GetItemState and not really in state SfxItemState::SET
173  case RES_BACKGROUND:
174  bExecuteId = false;
175  break;
176  default:
177  break;
178  }
179  }
180  else
181  {
182  // When not Page
183  switch(nId)
184  {
185  // When not Page: All in aIdArr except from RES_COL and RES_PAPER_BIN:
186  case RES_COL:
187  case RES_PAPER_BIN:
188  bExecuteId = false;
189  break;
190  default:
191  break;
192  }
193  }
194 
195  if(bExecuteId)
196  {
197  if (SfxItemState::SET == rSource.GetItemState(nId, false, &pItem))
198  {
199  rDest.SetFormatAttr(*pItem);
200  }
201  else
202  {
203  rDest.ResetFormatAttr(nId);
204  }
205  }
206  }
207  }
208 
209  // Transmit pool and help IDs too
210  rDest.SetPoolFormatId( rSource.GetPoolFormatId() );
211  rDest.SetPoolHelpId( rSource.GetPoolHelpId() );
212  rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() );
213 }
214 
215 namespace
216 {
217  SwFrameFormat& getFrameFormat(SwPageDesc &rDesc, bool bLeft, bool bFirst)
218  {
219  if (bFirst)
220  {
221  if (bLeft)
222  return rDesc.GetFirstLeft();
223  return rDesc.GetFirstMaster();
224  }
225  return rDesc.GetLeft();
226  }
227 
228  const SwFrameFormat& getConstFrameFormat(const SwPageDesc &rDesc, bool bLeft, bool bFirst)
229  {
230  return getFrameFormat(const_cast<SwPageDesc&>(rDesc), bLeft, bFirst);
231  }
232 }
233 
234 void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHead, SwPageDesc &rDesc, bool bLeft, bool bFirst)
235 {
236  assert(bLeft || bFirst);
237  SwFrameFormat& rDescFrameFormat = getFrameFormat(rDesc, bLeft, bFirst);
238  if (bFirst && bLeft)
239  {
240  // special case: always shared with something
241  rDescFrameFormat.SetFormatAttr( rChged.IsFirstShared()
242  ? rDesc.GetLeft().GetHeader()
243  : rDesc.GetFirstMaster().GetHeader());
244  }
245  else if ((bFirst ? rChged.IsFirstShared() : rChged.IsHeaderShared())
246  || !rHead.IsActive())
247  {
248  // Left or first shares the header with the Master.
249  rDescFrameFormat.SetFormatAttr( rDesc.GetMaster().GetHeader() );
250  }
251  else if ( rHead.IsActive() )
252  { // Left or first gets its own header if the Format doesn't already have one.
253  // If it already has one and it points to the same Section as the
254  // Right one, it needs to get an own Header.
255  // The content is evidently copied.
256  const SwFormatHeader &rFormatHead = rDescFrameFormat.GetHeader();
257  if ( !rFormatHead.IsActive() )
258  {
259  SwFormatHeader aHead( getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::HEADERL, nullptr ) );
260  rDescFrameFormat.SetFormatAttr( aHead );
261  // take over additional attributes (margins, borders ...)
262  ::lcl_DescSetAttr( *rHead.GetHeaderFormat(), *aHead.GetHeaderFormat(), false);
263  }
264  else
265  {
266  const SwFrameFormat *pRight = rHead.GetHeaderFormat();
267  const SwFormatContent &aRCnt = pRight->GetContent();
268  const SwFormatContent &aCnt = rFormatHead.GetHeaderFormat()->GetContent();
269 
270  if (!aCnt.GetContentIdx())
271  {
272  const SwFrameFormat& rChgedFrameFormat = getConstFrameFormat(rChged, bLeft, bFirst);
273  rDescFrameFormat.SetFormatAttr( rChgedFrameFormat.GetHeader() );
274  }
275  else if ((*aRCnt.GetContentIdx() == *aCnt.GetContentIdx()) ||
276  // The ContentIdx is _always_ different when called from
277  // SwDocStyleSheet::SetItemSet, because it deep-copies the
278  // PageDesc. So check if it was previously shared.
279  (bFirst ? rDesc.IsFirstShared() : rDesc.IsHeaderShared()))
280  {
281  SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
282  bFirst ? "First header" : "Left header",
283  GetDfltFrameFormat() );
284  ::lcl_DescSetAttr( *pRight, *pFormat, false );
285  // The section which the right header attribute is pointing
286  // is copied, and the Index to the StartNode is set to
287  // the left or first header attribute.
288  SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() );
290  SwNodeRange aRange( aRCnt.GetContentIdx()->GetNode(), 0,
291  *aRCnt.GetContentIdx()->GetNode().EndOfSectionNode() );
292  aTmp = *pSttNd->EndOfSectionNode();
293  GetNodes().Copy_( aRange, aTmp, false );
294  aTmp = *pSttNd;
295  GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp);
296  SwPaM const source(aRange.aStart, aRange.aEnd);
297  SwPosition dest(aTmp);
298  sw::CopyBookmarks(source, dest);
299  pFormat->SetFormatAttr( SwFormatContent( pSttNd ) );
300  rDescFrameFormat.SetFormatAttr( SwFormatHeader( pFormat ) );
301  }
302  else
303  ::lcl_DescSetAttr( *pRight,
304  *const_cast<SwFrameFormat*>(rFormatHead.GetHeaderFormat()), false );
305  }
306  }
307 }
308 
309 void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFoot, SwPageDesc &rDesc, bool bLeft, bool bFirst)
310 {
311  assert(bLeft || bFirst);
312  SwFrameFormat& rDescFrameFormat = getFrameFormat(rDesc, bLeft, bFirst);
313  if (bFirst && bLeft)
314  {
315  // special case: always shared with something
316  rDescFrameFormat.SetFormatAttr( rChged.IsFirstShared()
317  ? rDesc.GetLeft().GetFooter()
318  : rDesc.GetFirstMaster().GetFooter());
319  }
320  else if ((bFirst ? rChged.IsFirstShared() : rChged.IsFooterShared())
321  || !rFoot.IsActive())
322  {
323  // Left or first shares the Header with the Master.
324  rDescFrameFormat.SetFormatAttr( rDesc.GetMaster().GetFooter() );
325  }
326  else if ( rFoot.IsActive() )
327  { // Left or first gets its own Footer if the Format does not already have one.
328  // If the Format already has a Footer and it points to the same section as the Right one,
329  // it needs to get an own one.
330  // The content is evidently copied.
331  const SwFormatFooter &rFormatFoot = rDescFrameFormat.GetFooter();
332  if ( !rFormatFoot.IsActive() )
333  {
334  SwFormatFooter aFoot( getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::FOOTER, nullptr ) );
335  rDescFrameFormat.SetFormatAttr( aFoot );
336  // Take over additional attributes (margins, borders ...).
337  ::lcl_DescSetAttr( *rFoot.GetFooterFormat(), *aFoot.GetFooterFormat(), false);
338  }
339  else
340  {
341  const SwFrameFormat *pRight = rFoot.GetFooterFormat();
342  const SwFormatContent &aRCnt = pRight->GetContent();
343  const SwFormatContent &aLCnt = rFormatFoot.GetFooterFormat()->GetContent();
344  if( !aLCnt.GetContentIdx() )
345  {
346  const SwFrameFormat& rChgedFrameFormat = getConstFrameFormat(rChged, bLeft, bFirst);
347  rDescFrameFormat.SetFormatAttr( rChgedFrameFormat.GetFooter() );
348  }
349  else if ((*aRCnt.GetContentIdx() == *aLCnt.GetContentIdx()) ||
350  // The ContentIdx is _always_ different when called from
351  // SwDocStyleSheet::SetItemSet, because it deep-copies the
352  // PageDesc. So check if it was previously shared.
353  (bFirst ? rDesc.IsFirstShared() : rDesc.IsFooterShared()))
354  {
355  SwFrameFormat *pFormat = new SwFrameFormat( GetAttrPool(),
356  bFirst ? "First footer" : "Left footer",
357  GetDfltFrameFormat() );
358  ::lcl_DescSetAttr( *pRight, *pFormat, false );
359  // The section to which the right footer attribute is pointing
360  // is copied, and the Index to the StartNode is set to
361  // the left footer attribute.
362  SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() );
364  SwNodeRange aRange( aRCnt.GetContentIdx()->GetNode(), 0,
365  *aRCnt.GetContentIdx()->GetNode().EndOfSectionNode() );
366  aTmp = *pSttNd->EndOfSectionNode();
367  GetNodes().Copy_( aRange, aTmp, false );
368  aTmp = *pSttNd;
369  GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp);
370  SwPaM const source(aRange.aStart, aRange.aEnd);
371  SwPosition dest(aTmp);
372  sw::CopyBookmarks(source, dest);
373  pFormat->SetFormatAttr( SwFormatContent( pSttNd ) );
374  rDescFrameFormat.SetFormatAttr( SwFormatFooter( pFormat ) );
375  }
376  else
377  ::lcl_DescSetAttr( *pRight,
378  *const_cast<SwFrameFormat*>(rFormatFoot.GetFooterFormat()), false );
379  }
380  }
381 }
382 
383 void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
384 {
385  assert(i < m_PageDescs.size() && "PageDescs is out of range.");
386 
387  SwPageDesc& rDesc = *m_PageDescs[i];
388  SwRootFrame* pTmpRoot = getIDocumentLayoutAccess().GetCurrentLayout();
389 
390  if (GetIDocumentUndoRedo().DoesUndo())
391  {
392  GetIDocumentUndoRedo().AppendUndo(
393  std::make_unique<SwUndoPageDesc>(rDesc, rChged, this));
394  }
395  ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
396 
397  // Mirror at first if needed.
398  if ( rChged.GetUseOn() == UseOnPage::Mirror )
399  const_cast<SwPageDesc&>(rChged).Mirror();
400  else
401  {
402  // Or else transfer values from Master to Left
403  ::lcl_DescSetAttr(rChged.GetMaster(),
404  const_cast<SwPageDesc&>(rChged).GetLeft());
405  }
406  ::lcl_DescSetAttr(rChged.GetMaster(),
407  const_cast<SwPageDesc&>(rChged).GetFirstMaster());
408  ::lcl_DescSetAttr(rChged.GetLeft(),
409  const_cast<SwPageDesc&>(rChged).GetFirstLeft());
410 
411  // Take over NumType.
412  if( rChged.GetNumType().GetNumberingType() != rDesc.GetNumType().GetNumberingType() )
413  {
414  rDesc.SetNumType( rChged.GetNumType() );
415  // Notify page number fields that NumFormat has changed
416  getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::PageNumber )->UpdateFields();
417  getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::RefPageGet )->UpdateFields();
418 
419  // If the numbering scheme has changed we could have QuoVadis/ErgoSum texts
420  // that refer to a changed page, so we invalidate foot notes.
421  SwFootnoteIdxs& rFootnoteIdxs = GetFootnoteIdxs();
422  for( SwFootnoteIdxs::size_type nPos = 0; nPos < rFootnoteIdxs.size(); ++nPos )
423  {
424  SwTextFootnote *pTextFootnote = rFootnoteIdxs[ nPos ];
425  const SwFormatFootnote &rFootnote = pTextFootnote->GetFootnote();
426  pTextFootnote->SetNumber(rFootnote.GetNumber(), rFootnote.GetNumberRLHidden(), rFootnote.GetNumStr());
427  }
428  }
429 
430  // Take over orientation
431  rDesc.SetLandscape( rChged.GetLandscape() );
432 
433  // #i46909# no undo if header or footer changed
434  bool bHeaderFooterChanged = false;
435 
436  // Synch header.
437  const SwFormatHeader &rHead = rChged.GetMaster().GetHeader();
438  if (undoGuard.UndoWasEnabled())
439  {
440  // #i46909# no undo if header or footer changed
441  // Did something change in the nodes?
442  const SwFormatHeader &rOldHead = rDesc.GetMaster().GetHeader();
443  bHeaderFooterChanged |=
444  ( rHead.IsActive() != rOldHead.IsActive() ||
445  rChged.IsHeaderShared() != rDesc.IsHeaderShared() ||
446  rChged.IsFirstShared() != rDesc.IsFirstShared() );
447  }
448  rDesc.GetMaster().SetFormatAttr( rHead );
449  CopyMasterHeader(rChged, rHead, rDesc, true, false); // Copy left header
450  CopyMasterHeader(rChged, rHead, rDesc, false, true); // Copy first master
451  CopyMasterHeader(rChged, rHead, rDesc, true, true); // Copy first left
452  rDesc.ChgHeaderShare( rChged.IsHeaderShared() );
453 
454  // Synch Footer.
455  const SwFormatFooter &rFoot = rChged.GetMaster().GetFooter();
456  if (undoGuard.UndoWasEnabled())
457  {
458  // #i46909# no undo if header or footer changed
459  // Did something change in the Nodes?
460  const SwFormatFooter &rOldFoot = rDesc.GetMaster().GetFooter();
461  bHeaderFooterChanged |=
462  ( rFoot.IsActive() != rOldFoot.IsActive() ||
463  rChged.IsFooterShared() != rDesc.IsFooterShared() );
464  }
465  rDesc.GetMaster().SetFormatAttr( rFoot );
466  CopyMasterFooter(rChged, rFoot, rDesc, true, false); // Copy left footer
467  CopyMasterFooter(rChged, rFoot, rDesc, false, true); // Copy first master
468  CopyMasterFooter(rChged, rFoot, rDesc, true, true); // Copy first left
469  rDesc.ChgFooterShare( rChged.IsFooterShared() );
470  // there is just one first shared flag for both header and footer?
471  rDesc.ChgFirstShare( rChged.IsFirstShared() );
472 
473  if ( rDesc.GetName() != rChged.GetName() )
474  rDesc.SetName( rChged.GetName() );
475 
476  // A RegisterChange is triggered, if necessary
477  rDesc.SetRegisterFormatColl( rChged.GetRegisterFormatColl() );
478 
479  // If UseOn or the Follow change, the paragraphs need to know about it.
480  bool bUseOn = false;
481  bool bFollow = false;
482  if (rDesc.GetUseOn() != rChged.GetUseOn())
483  {
484  rDesc.SetUseOn( rChged.GetUseOn() );
485  bUseOn = true;
486  }
487  if (rDesc.GetFollow() != rChged.GetFollow())
488  {
489  if (rChged.GetFollow() == &rChged)
490  {
491  if (rDesc.GetFollow() != &rDesc)
492  {
493  rDesc.SetFollow( &rDesc );
494  bFollow = true;
495  }
496  }
497  else
498  {
499  rDesc.SetFollow( rChged.m_pFollow );
500  bFollow = true;
501  }
502  }
503 
504  if ( (bUseOn || bFollow) && pTmpRoot)
505  // Inform layout!
506  {
507  for( auto aLayout : GetAllLayouts() )
508  aLayout->AllCheckPageDescs();
509  }
510 
511  // Take over the page attributes.
512  ::lcl_DescSetAttr( rChged.GetMaster(), rDesc.GetMaster() );
513  ::lcl_DescSetAttr( rChged.GetLeft(), rDesc.GetLeft() );
514  ::lcl_DescSetAttr( rChged.GetFirstMaster(), rDesc.GetFirstMaster() );
515  ::lcl_DescSetAttr( rChged.GetFirstLeft(), rDesc.GetFirstLeft() );
516 
517  // If the FootnoteInfo changes, the pages are triggered.
518  if( !(rDesc.GetFootnoteInfo() == rChged.GetFootnoteInfo()) )
519  {
520  rDesc.SetFootnoteInfo( rChged.GetFootnoteInfo() );
521  sw::PageFootnoteHint aHint;
522  rDesc.GetMaster().CallSwClientNotify(aHint);
523  rDesc.GetLeft().CallSwClientNotify(aHint);
524  rDesc.GetFirstMaster().CallSwClientNotify(aHint);
525  rDesc.GetFirstLeft().CallSwClientNotify(aHint);
526  }
527  getIDocumentState().SetModified();
528 
529  // #i46909# no undo if header or footer changed
530  if( bHeaderFooterChanged )
531  {
532  GetIDocumentUndoRedo().DelAllUndoObj();
533  }
534 
535  SfxBindings* pBindings =
536  ( GetDocShell() && GetDocShell()->GetDispatcher() ) ? GetDocShell()->GetDispatcher()->GetBindings() : nullptr;
537  if ( pBindings )
538  {
539  pBindings->Invalidate( SID_ATTR_PAGE_COLUMN );
540  pBindings->Invalidate( SID_ATTR_PAGE );
541  pBindings->Invalidate( SID_ATTR_PAGE_SIZE );
542  pBindings->Invalidate( SID_ATTR_PAGE_ULSPACE );
543  pBindings->Invalidate( SID_ATTR_PAGE_LRSPACE );
544  }
545 
546  //h/f of first-left page must not be unique but same as first master or left
547  assert((rDesc.IsFirstShared())
548  ? rDesc.GetFirstLeft().GetHeader().GetHeaderFormat() == rDesc.GetLeft().GetHeader().GetHeaderFormat()
549  : rDesc.GetFirstLeft().GetHeader().GetHeaderFormat() == rDesc.GetFirstMaster().GetHeader().GetHeaderFormat());
550  assert((rDesc.IsFirstShared())
551  ? rDesc.GetFirstLeft().GetFooter().GetFooterFormat() == rDesc.GetLeft().GetFooter().GetFooterFormat()
552  : rDesc.GetFirstLeft().GetFooter().GetFooterFormat() == rDesc.GetFirstMaster().GetFooter().GetFooterFormat());
553 }
554 
556 // #i7983#
558 {
559  if (nullptr == pDel)
560  return;
561 
562  // mba: test iteration as clients are removed while iteration
563  SwPageDescHint aHint( m_PageDescs[0] );
564  pDel->CallSwClientNotify( aHint );
565 
566  bool bHasLayout = getIDocumentLayoutAccess().HasLayout();
567  if ( mpFootnoteInfo->DependsOn( pDel ) )
568  {
569  mpFootnoteInfo->ChgPageDesc( m_PageDescs[0] );
570  if ( bHasLayout )
571  {
572  for( auto aLayout : GetAllLayouts() )
573  aLayout->CheckFootnotePageDescs(false);
574  }
575  }
576  else if ( mpEndNoteInfo->DependsOn( pDel ) )
577  {
578  mpEndNoteInfo->ChgPageDesc( m_PageDescs[0] );
579  if ( bHasLayout )
580  {
581  for( auto aLayout : GetAllLayouts() )
582  aLayout->CheckFootnotePageDescs(true);
583  }
584  }
585 
586  for (SwPageDesc* pPageDesc : m_PageDescs)
587  {
588  if (pPageDesc->GetFollow() == pDel)
589  {
590  pPageDesc->SetFollow(nullptr);
591  if( bHasLayout )
592  {
593  for( auto aLayout : GetAllLayouts() )
594  aLayout->AllCheckPageDescs();
595  }
596  }
597  }
598 }
599 
600 void SwDoc::BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamily,
601  SfxHintId nOp)
602 {
603  if (mpDocShell)
604  {
605  SfxStyleSheetBasePool * pPool = mpDocShell->GetStyleSheetPool();
606 
607  if (pPool)
608  {
609  SfxStyleSheetBase* pBase = pPool->Find(rName, eFamily);
610 
611  if (pBase != nullptr)
612  pPool->Broadcast(SfxStyleSheetHint( nOp, *pBase ));
613  }
614  }
615 }
616 
617 void SwDoc::DelPageDesc( size_t i, bool bBroadcast )
618 {
619  OSL_ENSURE(i < m_PageDescs.size(), "PageDescs is out of range.");
620  OSL_ENSURE( i != 0, "You cannot delete the default Pagedesc.");
621  if ( i == 0 )
622  return;
623 
624  SwPageDesc &rDel = *m_PageDescs[i];
625 
626  if (bBroadcast)
627  BroadcastStyleOperation(rDel.GetName(), SfxStyleFamily::Page,
628  SfxHintId::StyleSheetErased);
629 
630  if (GetIDocumentUndoRedo().DoesUndo())
631  {
632  GetIDocumentUndoRedo().AppendUndo(
633  std::make_unique<SwUndoPageDescDelete>(rDel, this));
634  }
635 
636  PreDelPageDesc(&rDel); // #i7983#
637 
638  m_PageDescs.erase(m_PageDescs.begin() + i);
639  getIDocumentState().SetModified();
640 }
641 
642 SwPageDesc* SwDoc::MakePageDesc(const OUString &rName, const SwPageDesc *pCpy,
643  bool bRegardLanguage, bool bBroadcast)
644 {
645  SwPageDesc *pNew;
646  if( pCpy )
647  {
648  pNew = new SwPageDesc( *pCpy );
649  pNew->SetName( rName );
650  if( rName != pCpy->GetName() )
651  {
652  pNew->SetPoolFormatId( USHRT_MAX );
653  pNew->SetPoolHelpId( USHRT_MAX );
654  pNew->SetPoolHlpFileId( UCHAR_MAX );
655  }
656  }
657  else
658  {
659  pNew = new SwPageDesc( rName, GetDfltFrameFormat(), this );
660  // Set the default page format.
661  lcl_DefaultPageFormat( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft(), pNew->GetFirstMaster(), pNew->GetFirstLeft() );
662 
663  SvxFrameDirection aFrameDirection = bRegardLanguage ?
665  : SvxFrameDirection::Horizontal_LR_TB;
666 
667  pNew->GetMaster().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
668  pNew->GetLeft().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
669  pNew->GetFirstMaster().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
670  pNew->GetFirstLeft().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
671  }
672 
673  std::pair<SwPageDescs::const_iterator, bool> res = m_PageDescs.push_back( pNew );
674  SAL_WARN_IF(!res.second, "sw", "MakePageDesc called with existing name" );
675 
676  if (bBroadcast)
677  BroadcastStyleOperation(rName, SfxStyleFamily::Page,
678  SfxHintId::StyleSheetCreated);
679 
680  if (GetIDocumentUndoRedo().DoesUndo())
681  {
682  GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoPageDescCreate>(pNew, this));
683  }
684 
685  getIDocumentState().SetModified();
686  return pNew;
687 }
688 
689 void SwDoc::PrtOLENotify( bool bAll )
690 {
691  SwFEShell *pShell = nullptr;
692  {
693  SwViewShell *pSh = getIDocumentLayoutAccess().GetCurrentViewShell();
694  if ( pSh )
695  {
696  for(SwViewShell& rShell : pSh->GetRingContainer())
697  {
698  if(dynamic_cast<const SwFEShell*>( &rShell) != nullptr)
699  {
700  pShell = static_cast<SwFEShell*>(&rShell);
701  break;
702  }
703  }
704  }
705  }
706  if ( !pShell )
707  {
708  // This doesn't make sense without a Shell and thus without a client, because
709  // the communication about size changes is implemented by these components.
710  // Because we don't have a Shell we remember this unfortunate situation
711  // in the document,
712  // which is made up for later on when creating the first Shell.
713  mbOLEPrtNotifyPending = true;
714  if ( bAll )
715  mbAllOLENotify = true;
716  }
717  else
718  {
719  if ( mbAllOLENotify )
720  bAll = true;
721 
722  mbOLEPrtNotifyPending = mbAllOLENotify = false;
723 
724  std::unique_ptr<SwOLENodes> pNodes = SwContentNode::CreateOLENodesArray( *GetDfltGrfFormatColl(), !bAll );
725  if ( pNodes )
726  {
727  ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
728  0, pNodes->size(), GetDocShell());
729  getIDocumentLayoutAccess().GetCurrentLayout()->StartAllAction();
730 
731  for( SwOLENodes::size_type i = 0; i < pNodes->size(); ++i )
732  {
733  ::SetProgressState( i, GetDocShell() );
734 
735  SwOLENode* pOLENd = (*pNodes)[i];
736  pOLENd->SetOLESizeInvalid( false );
737 
738  // At first load the Infos and see if it's not already in the exclude list.
740 
741  svt::EmbeddedObjectRef& xObj = pOLENd->GetOLEObj().GetObject();
742  if ( xObj.is() )
743  aName = SvGlobalName( xObj->getClassID() );
744  else // Not yet loaded
745  {
746  // TODO/LATER: retrieve ClassID of an unloaded object
747  // aName = ????
748  }
749 
750  bool bFound = false;
751  for ( std::vector<SvGlobalName>::size_type j = 0;
752  j < pGlobalOLEExcludeList->size() && !bFound;
753  ++j )
754  {
755  bFound = (*pGlobalOLEExcludeList)[j] == aName;
756  }
757  if ( bFound )
758  continue;
759 
760  // We don't know it, so the object has to be loaded.
761  // If it doesn't want to be informed
762  if ( xObj.is() )
763  {
764  pGlobalOLEExcludeList->push_back( aName );
765  }
766  }
767  pNodes.reset();
768  getIDocumentLayoutAccess().GetCurrentLayout()->EndAllAction();
769  ::EndProgress( GetDocShell() );
770  }
771  }
772 }
773 
774 IMPL_LINK_NOARG( SwDoc, DoUpdateModifiedOLE, Timer *, void )
775 {
776  SwFEShell* pSh = static_cast<SwFEShell*>(GetEditShell());
777  if( !pSh )
778  return;
779 
780  mbOLEPrtNotifyPending = mbAllOLENotify = false;
781 
782  std::unique_ptr<SwOLENodes> pNodes = SwContentNode::CreateOLENodesArray( *GetDfltGrfFormatColl(), true );
783  if( !pNodes )
784  return;
785 
786  ::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
787  0, pNodes->size(), GetDocShell());
788  getIDocumentLayoutAccess().GetCurrentLayout()->StartAllAction();
789  SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
790 
791  for( SwOLENodes::size_type i = 0; i < pNodes->size(); ++i )
792  {
793  ::SetProgressState( i, GetDocShell() );
794 
795  SwOLENode* pOLENd = (*pNodes)[i];
796  pOLENd->SetOLESizeInvalid( false );
797 
798  // We don't know it, so the object has to be loaded.
799  // If it doesn't want to be informed
800  if( pOLENd->GetOLEObj().GetOleRef().is() ) // Broken?
801  {
802  pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
803  }
804  }
805  getIDocumentLayoutAccess().GetCurrentLayout()->EndAllAction();
806  ::EndProgress( GetDocShell() );
807 }
808 
809 static SwPageDesc* lcl_FindPageDesc( const SwPageDescs *pPageDescs,
810  size_t *pPos, const OUString &rName )
811 {
812  SwPageDesc* res = nullptr;
813  SwPageDescs::const_iterator it = pPageDescs->find( rName );
814  if( it != pPageDescs->end() )
815  {
816  res = *it;
817  if( pPos )
818  *pPos = std::distance( pPageDescs->begin(), it );
819  }
820  else if( pPos )
821  *pPos = SIZE_MAX;
822  return res;
823 }
824 
825 SwPageDesc* SwDoc::FindPageDesc( const OUString & rName, size_t* pPos ) const
826 {
827  return lcl_FindPageDesc( &m_PageDescs, pPos, rName );
828 }
829 
830 bool SwDoc::ContainsPageDesc( const SwPageDesc *pDesc, size_t* pPos ) const
831 {
832  if( pDesc == nullptr )
833  return false;
834  if( !m_PageDescs.contains( const_cast <SwPageDesc*>( pDesc ) ) ) {
835  if( pPos )
836  *pPos = SIZE_MAX;
837  return false;
838  }
839  if( ! pPos )
840  return true;
841 
843  &m_PageDescs, pPos, pDesc->GetName() );
844  SAL_WARN_IF( desc != pDesc, "sw", "SwPageDescs container is broken!" );
845  return true;
846 }
847 
848 void SwDoc::DelPageDesc( const OUString & rName, bool bBroadcast )
849 {
850  size_t nI;
851 
852  if (FindPageDesc(rName, &nI))
853  DelPageDesc(nI, bBroadcast);
854 }
855 
856 void SwDoc::ChgPageDesc( const OUString & rName, const SwPageDesc & rDesc)
857 {
858  size_t nI;
859 
860  if (FindPageDesc(rName, &nI))
861  ChgPageDesc(nI, rDesc);
862 }
863 
864 /*
865  * The HTML import cannot resist changing the page descriptions, I don't
866  * know why. This function is meant to check the page descriptors for invalid
867  * values.
868  */
870 {
871  for ( size_t i = 0; i < GetPageDescCnt(); ++i )
872  {
873  SwPageDesc& rDesc = GetPageDesc( i );
874 
875  SwFrameFormat& rMaster = rDesc.GetMaster();
876  SwFrameFormat& rLeft = rDesc.GetLeft();
877 
878  const SwFormatFrameSize& rMasterSize = rMaster.GetFrameSize();
879  const SwFormatFrameSize& rLeftSize = rLeft.GetFrameSize();
880 
881  const bool bSetSize = INVALID_TWIPS == rMasterSize.GetWidth() ||
882  INVALID_TWIPS == rMasterSize.GetHeight() ||
883  INVALID_TWIPS == rLeftSize.GetWidth() ||
884  INVALID_TWIPS == rLeftSize.GetHeight();
885 
886  if ( bSetSize )
887  lcl_DefaultPageFormat( rDesc.GetPoolFormatId(), rDesc.GetMaster(), rDesc.GetLeft(), rDesc.GetFirstMaster(), rDesc.GetFirstLeft() );
888  }
889 }
890 
891 void SwDoc::SetDefaultPageMode(bool bSquaredPageMode)
892 {
893  if( !bSquaredPageMode == !IsSquaredPageMode() )
894  return;
895 
896  const SwTextGridItem& rGrid = GetDefault( RES_TEXTGRID );
897  SwTextGridItem aNewGrid = rGrid;
898  aNewGrid.SetSquaredMode(bSquaredPageMode);
899  aNewGrid.Init();
900  SetDefault(aNewGrid);
901 
902  for ( size_t i = 0; i < GetPageDescCnt(); ++i )
903  {
904  SwPageDesc& rDesc = GetPageDesc( i );
905 
906  SwFrameFormat& rMaster = rDesc.GetMaster();
907  SwFrameFormat& rLeft = rDesc.GetLeft();
908 
909  SwTextGridItem aGrid(rMaster.GetFormatAttr(RES_TEXTGRID));
910  aGrid.SwitchPaperMode( bSquaredPageMode );
911  rMaster.SetFormatAttr(aGrid);
912  rLeft.SetFormatAttr(aGrid);
913  }
914 }
915 
917 {
918  const SwTextGridItem& rGrid = GetDefault( RES_TEXTGRID );
919  return rGrid.IsSquaredMode();
920 }
921 
922 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxNumType GetNumberingType() const
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
Starts a section of nodes in the document model.
Definition: node.hxx:303
static void lcl_DescSetAttr(const SwFrameFormat &rSource, SwFrameFormat &rDest, const bool bPage=true)
Definition: docdesc.cxx:131
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
bool UndoWasEnabled() const
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
static std::unique_ptr< SwOLENodes > CreateOLENodesArray(const SwFormatColl &rColl, bool bOnlyWithInvalidSize)
Definition: node.cxx:2082
bool ContainsPageDesc(const SwPageDesc *pDesc, size_t *pPos) const
Definition: docdesc.cxx:830
SfxHintId
constexpr TypedWhichId< SwHeaderAndFooterEatSpacingItem > RES_HEADER_FOOTER_EAT_SPACING(121)
static void lcl_DefaultPageFormat(sal_uInt16 nPoolFormatId, SwFrameFormat &rFormat1, SwFrameFormat &rFormat2, SwFrameFormat &rFormat3, SwFrameFormat &rFormat4)
Definition: docdesc.cxx:65
const_iterator end() const
Definition: pagedesc.hxx:435
Marks a position in the document model.
Definition: pam.hxx:35
const_iterator begin() const
Definition: pagedesc.hxx:434
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:218
virtual void ModifyNotification(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: node.hxx:475
#define SID_ATTR_PAGE_COLUMN
Definition: cmdid.h:856
void SetPoolHelpId(sal_uInt16 nId)
Definition: format.hxx:148
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
const_iterator find(const OUString &name) const
Definition: pagedesc.hxx:428
void SetPoolHelpId(sal_uInt16 const nId)
Definition: pagedesc.hxx:257
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
void CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHead, SwPageDesc &pDesc, bool bLeft, bool bFirst)
Definition: docdesc.cxx:234
void DelPageDesc(const OUString &rName, bool bBroadcast=false)
Definition: docdesc.cxx:848
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
sal_uInt16 char char * pDesc
long GetWidth() const
constexpr TypedWhichId< SwUpdateAttr > RES_UPDATE_ATTR(165)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:219
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:913
sal_Int64 n
Definition: doc.hxx:184
sal_Int16 nId
SwNode & GetNode() const
Definition: ndindex.hxx:119
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
void EndProgress(SwDocShell const *pDocShell)
Definition: mainwn.cxx:92
SvxFrameDirection
void Invalidate(sal_uInt16 nId)
#define INVALID_TWIPS
Definition: swtypes.hxx:52
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
UseOnPage GetUseOn() const
Definition: pagedesc.hxx:332
const OUString & GetName() const
Definition: pagedesc.hxx:187
bool IsActive() const
Definition: fmthdft.hxx:89
std::vector< SvGlobalName > * pGlobalOLEExcludeList
Definition: init.cxx:438
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:196
void SetLeft(const long nL, const sal_uInt16 nProp=100)
void StartProgress(const char *pMessResId, long nStartValue, long nEndValue, SwDocShell *pDocShell)
Definition: mainwn.cxx:52
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:144
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:254
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:689
ByPos::const_iterator const_iterator
Definition: pagedesc.hxx:410
IMPL_LINK_NOARG(SwDoc, DoUpdateModifiedOLE, Timer *, void)
Definition: docdesc.cxx:774
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:965
static bool IsFuzzing()
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
void SetPoolHlpFileId(sal_uInt8 nId)
Definition: format.hxx:150
bool IsSquaredMode() const
Definition: tgrditem.hxx:104
void SetPoolHlpFileId(sal_uInt8 const nId)
Definition: pagedesc.hxx:259
const OUString & GetNumStr() const
Definition: fmtftn.hxx:71
SfxStyleFamily
size_type size() const
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:143
void SetProgressState(long nPosition, SwDocShell const *pDocShell)
Definition: mainwn.cxx:82
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:825
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
void SetNumber(sal_uInt16 nNumber, sal_uInt16 nNumberRLHidden, const OUString &sNumStr)
Definition: atrftn.cxx:357
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool IsHeaderShared() const
Definition: pagedesc.hxx:298
void CheckDefaultPageFormat()
The html import sometimes overwrites the page sizes set in the page descriptions. ...
Definition: docdesc.cxx:869
void SetRight(const long nR, const sal_uInt16 nProp=100)
Style of a layout element.
Definition: frmfmt.hxx:57
SfxBindings * GetBindings() const
int i
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
bool GetLandscape() const
Definition: pagedesc.hxx:190
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:642
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:73
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
sal_uInt8 GetPoolHlpFileId() const
Definition: format.hxx:149
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
virtual void CallSwClientNotify(const SfxHint &rHint) const
Definition: calbck.cxx:369
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
Definition: pagedesc.cxx:204
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
Definition: docdesc.cxx:856
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:396
Marks a node in the document model.
Definition: ndindex.hxx:31
bool IsFooterShared() const
Definition: pagedesc.hxx:302
ring_container GetRingContainer()
Definition: ring.hxx:240
void CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFoot, SwPageDesc &pDesc, bool bLeft, bool bFirst)
Definition: docdesc.cxx:309
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:255
void SetDefaultPageMode(bool bSquaredPageMode)
Definition: docdesc.cxx:891
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:200
#define CM_1
Frame cannot be moved in Var-direction.
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:246
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
void Broadcast(const SfxHint &rHint)
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:650
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(115)
bool IsSquaredPageMode() const
Definition: docdesc.cxx:916
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
sal_uInt16 GetPoolHelpId() const
Get and set Help-IDs for document templates.
Definition: format.hxx:147
#define SAL_WARN_IF(condition, area, stream)
static SwPageDesc * lcl_FindPageDesc(const SwPageDescs *pPageDescs, size_t *pPos, const OUString &rName)
Definition: docdesc.cxx:809
void SwitchPaperMode(bool bNew)
Definition: atrfrm.cxx:2381
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:220
OUString aName
LanguageType GetAppLanguage()
Definition: init.cxx:728
SwPageDesc * m_pFollow
Definition: pagedesc.hxx:154
void SetSize(const Size &rSize)
bool SetName(const OUString &rNewName)
Definition: pagedesc.cxx:129
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Definition: poolfmt.cxx:77
void SetOLESizeInvalid(bool b)
Definition: ndole.hxx:134
SfxDispatcher * GetDispatcher() const
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
bool IsFirstShared() const
Definition: pagedesc.cxx:376
bool IsActive() const
Definition: fmthdft.hxx:58
std::vector< SwTextFootnote * >::size_type size_type
void PreDelPageDesc(SwPageDesc const *pDel)
All descriptors whose Follow point to the to-be-deleted have to be adapted.
Definition: docdesc.cxx:557
sal_uInt16 GetMetricVal(int n)
long GetHeight() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:72
void CopyBookmarks(const SwPaM &rPam, SwPosition &rCpyPam)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
Definition: docdesc.cxx:600
static SwPageDesc * FindPageDesc(SwDoc *pDoc, sal_uInt16 nPoolId)
Definition: htmlcss1.cxx:1327
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
sal_uInt16 nPos
const LocaleDataWrapper & GetLocaleData()
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Definition: nodes.cxx:1875
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:193