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