LibreOffice Module sw (master)  1
atrfrm.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 <com/sun/star/text/WrapTextMode.hpp>
21 #include <com/sun/star/text/TextContentAnchorType.hpp>
22 #include <com/sun/star/container/XIndexContainer.hpp>
23 #include <com/sun/star/text/TextGridMode.hpp>
24 #include <sal/log.hxx>
25 #include <o3tl/any.hxx>
26 #include <o3tl/safeint.hxx>
27 #include <svtools/unoimap.hxx>
28 #include <vcl/imap.hxx>
29 #include <vcl/imapobj.hxx>
30 #include <unotools/intlwrapper.hxx>
31 #include <unotools/syslocale.hxx>
32 #include <frmfmt.hxx>
33 #include <unocoll.hxx>
34 #include <unosett.hxx>
35 #include <unostyle.hxx>
36 #include <fmtclds.hxx>
37 #include <fmtornt.hxx>
38 #include <fmthdft.hxx>
39 #include <fmtpdsc.hxx>
40 #include <fmtcntnt.hxx>
41 #include <fmtfsize.hxx>
42 #include <fmtfordr.hxx>
43 #include <fmtsrnd.hxx>
44 #include <fmtlsplt.hxx>
45 #include <fmtrowsplt.hxx>
46 #include <fmtftntx.hxx>
47 #include <fmteiro.hxx>
48 #include <fmturl.hxx>
49 #include <fmtcnct.hxx>
50 #include <section.hxx>
51 #include <fmtline.hxx>
52 #include <tgrditem.hxx>
53 #include <hfspacingitem.hxx>
55 #include <IDocumentUndoRedo.hxx>
58 #include <pagefrm.hxx>
59 #include <rootfrm.hxx>
60 #include <cntfrm.hxx>
61 #include <notxtfrm.hxx>
62 #include <txtfrm.hxx>
63 #include <crsrsh.hxx>
64 #include <dflyobj.hxx>
65 #include <dcontact.hxx>
66 #include <frmtool.hxx>
67 #include <flyfrms.hxx>
68 #include <pagedesc.hxx>
69 #include <grfatr.hxx>
70 #include <ndnotxt.hxx>
71 #include <docary.hxx>
72 #include <node2lay.hxx>
73 #include <fmtclbl.hxx>
74 #include <swunohelper.hxx>
75 #include <unoframe.hxx>
76 #include <unotextbodyhf.hxx>
77 #include <SwStyleNameMapper.hxx>
78 #include <editeng/brushitem.hxx>
79 #include <vcl/GraphicObject.hxx>
80 #include <unomid.h>
81 #include <strings.hrc>
82 #include <svx/svdundo.hxx>
83 #include <sortedobjs.hxx>
84 #include <HandleAnchorNodeChg.hxx>
85 #include <calbck.hxx>
86 #include <pagedeschint.hxx>
87 #include <drawdoc.hxx>
88 #include <hints.hxx>
89 
90 #ifndef NDEBUG
91 #include <ndtxt.hxx>
92 #endif
93 
95 #include <svx/xfillit0.hxx>
96 #include <svl/itemiter.hxx>
97 
98 using namespace ::com::sun::star;
99 
100 
102 
103 static sal_Int16 lcl_IntToRelation(const uno::Any& rVal)
104 {
105  sal_Int16 nVal = text::RelOrientation::FRAME;
106  if (!(rVal >>= nVal))
107  SAL_WARN("sw.core", "lcl_IntToRelation: read from Any failed!");
108  return nVal;
109 }
110 
111 static void lcl_DelHFFormat( SwClient *pToRemove, SwFrameFormat *pFormat )
112 {
113  //If the client is the last one who uses this format, then we have to delete
114  //it - before this is done, we may need to delete the content-section.
115  SwDoc* pDoc = pFormat->GetDoc();
116  pFormat->Remove( pToRemove );
117  if( pDoc->IsInDtor() )
118  {
119  delete pFormat;
120  return;
121  }
122 
123  // Anything other than frames registered?
124  bool bDel = true;
125  {
126  // nested scope because DTOR of SwClientIter resets the flag bTreeChg.
127  // It's suboptimal if the format is deleted beforehand.
128  SwIterator<SwClient,SwFrameFormat> aIter(*pFormat);
129  for(SwClient* pLast = aIter.First(); bDel && pLast; pLast = aIter.Next())
130  if (dynamic_cast<const SwFrame*>(pLast) == nullptr)
131  bDel = false;
132  }
133 
134  if ( bDel )
135  {
136  // If there is a Cursor registered in one of the nodes, we need to call the
137  // ParkCursor in an (arbitrary) shell.
138  SwFormatContent& rCnt = const_cast<SwFormatContent&>(pFormat->GetContent());
139  if ( rCnt.GetContentIdx() )
140  {
141  SwNode *pNode = nullptr;
142  {
143  // #i92993#
144  // Begin with start node of page header/footer to assure that
145  // complete content is checked for cursors and the complete content
146  // is deleted on below made method call <pDoc->getIDocumentContentOperations().DeleteSection(pNode)>
147  SwNodeIndex aIdx( *rCnt.GetContentIdx(), 0 );
148  // If there is a Cursor registered in one of the nodes, we need to call the
149  // ParkCursor in an (arbitrary) shell.
150  pNode = & aIdx.GetNode();
151  sal_uInt32 nEnd = pNode->EndOfSectionIndex();
152  while ( aIdx < nEnd )
153  {
154  if ( pNode->IsContentNode() &&
155  static_cast<SwContentNode*>(pNode)->HasWriterListeners() )
156  {
157  SwCursorShell *pShell = SwIterator<SwCursorShell,SwContentNode>( *static_cast<SwContentNode*>(pNode) ).First();
158  if( pShell )
159  {
160  pShell->ParkCursor( aIdx );
161  aIdx = nEnd-1;
162  }
163  }
164  ++aIdx;
165  pNode = & aIdx.GetNode();
166  }
167  }
168  rCnt.SetNewContentIdx( nullptr );
169 
170  // When deleting a header/footer-format, we ALWAYS need to disable
171  // the undo function (Bug 31069)
172  ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
173 
174  OSL_ENSURE( pNode, "A big problem." );
176  }
177  delete pFormat;
178  }
179 }
180 
181 void SwFormatFrameSize::ScaleMetrics(long lMult, long lDiv) {
182  // Don't inherit the SvxSizeItem override (might or might not be relevant; added "just in case"
183  // when changing SwFormatFrameSize to derive from SvxSizeItem instead of directly from
184  // SfxPoolItem):
185  return SfxPoolItem::ScaleMetrics(lMult, lDiv);
186 }
187 
189  // Don't inherit the SvxSizeItem override (might or might not be relevant; added "just in case"
190  // when changing SwFormatFrameSize to derive from SvxSizeItem instead of directly from
191  // SfxPoolItem):
192  return SfxPoolItem::HasMetrics();
193 }
194 
195 // Partially implemented inline in hxx
197  : SvxSizeItem( RES_FRM_SIZE, {nWidth, nHeight} ),
198  m_eFrameHeightType( eSize ),
199  m_eFrameWidthType( ATT_FIX_SIZE )
200 {
201  m_nWidthPercent = m_eWidthPercentRelation = m_nHeightPercent = m_eHeightPercentRelation = 0;
202 }
203 
204 bool SwFormatFrameSize::operator==( const SfxPoolItem& rAttr ) const
205 {
206  assert(SfxPoolItem::operator==(rAttr));
207  return( m_eFrameHeightType == static_cast<const SwFormatFrameSize&>(rAttr).m_eFrameHeightType &&
208  m_eFrameWidthType == static_cast<const SwFormatFrameSize&>(rAttr).m_eFrameWidthType &&
209  SvxSizeItem::operator==(rAttr)&&
210  m_nWidthPercent == static_cast<const SwFormatFrameSize&>(rAttr).GetWidthPercent() &&
211  m_eWidthPercentRelation == static_cast<const SwFormatFrameSize&>(rAttr).GetWidthPercentRelation() &&
212  m_nHeightPercent == static_cast<const SwFormatFrameSize&>(rAttr).GetHeightPercent() &&
213  m_eHeightPercentRelation == static_cast<const SwFormatFrameSize&>(rAttr).GetHeightPercentRelation() );
214 }
215 
217 {
218  return new SwFormatFrameSize( *this );
219 }
220 
221 bool SwFormatFrameSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
222 {
223  // here we convert always!
224  nMemberId &= ~CONVERT_TWIPS;
225  switch ( nMemberId )
226  {
227  case MID_FRMSIZE_SIZE:
228  {
229  awt::Size aTmp;
230  aTmp.Height = convertTwipToMm100(GetHeight());
231  aTmp.Width = convertTwipToMm100(GetWidth());
232  rVal <<= aTmp;
233  }
234  break;
236  rVal <<= static_cast<sal_Int16>(GetHeightPercent() != SwFormatFrameSize::SYNCED ? GetHeightPercent() : 0);
237  break;
239  rVal <<= GetHeightPercentRelation();
240  break;
242  rVal <<= static_cast<sal_Int16>(GetWidthPercent() != SwFormatFrameSize::SYNCED ? GetWidthPercent() : 0);
243  break;
245  rVal <<= GetWidthPercentRelation();
246  break;
249  break;
252  break;
253  case MID_FRMSIZE_WIDTH :
254  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetWidth()));
255  break;
256  case MID_FRMSIZE_HEIGHT:
257  // #95848# returned size should never be zero.
258  // (there was a bug that allowed for setting height to 0.
259  // Thus there some documents existing with that not allowed
260  // attribute value which may cause problems on import.)
261  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetHeight() < MINLAY ? MINLAY : GetHeight() ));
262  break;
264  rVal <<= static_cast<sal_Int16>(GetHeightSizeType());
265  break;
267  rVal <<= ATT_FIX_SIZE != GetHeightSizeType();
268  break;
270  rVal <<= static_cast<sal_Int16>(GetWidthSizeType());
271  break;
272  }
273  return true;
274 }
275 
276 bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
277 {
278  bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
279  nMemberId &= ~CONVERT_TWIPS;
280  bool bRet = true;
281  switch ( nMemberId )
282  {
283  case MID_FRMSIZE_SIZE:
284  {
285  awt::Size aVal;
286  if(!(rVal >>= aVal))
287  bRet = false;
288  else
289  {
290  Size aTmp(aVal.Width, aVal.Height);
291  if(bConvert)
292  {
293  aTmp.setHeight( convertMm100ToTwip(aTmp.Height()) );
294  aTmp.setWidth( convertMm100ToTwip(aTmp.Width()) );
295  }
296  SetSize(aTmp);
297  }
298  }
299  break;
301  {
302  sal_Int16 nSet = 0;
303  rVal >>= nSet;
304  if(nSet >= 0 && nSet < SwFormatFrameSize::SYNCED)
305  SetHeightPercent(static_cast<sal_uInt8>(nSet));
306  else
307  bRet = false;
308  }
309  break;
311  {
312  sal_Int16 eSet = 0;
313  rVal >>= eSet;
315  }
316  break;
318  {
319  sal_Int16 nSet = 0;
320  rVal >>= nSet;
321  if(nSet >= 0 && nSet < SwFormatFrameSize::SYNCED)
322  SetWidthPercent(static_cast<sal_uInt8>(nSet));
323  else
324  bRet = false;
325  }
326  break;
328  {
329  sal_Int16 eSet = 0;
330  rVal >>= eSet;
332  }
333  break;
335  {
336  bool bSet = *o3tl::doAccess<bool>(rVal);
337  if(bSet)
340  SetHeightPercent( 0 );
341  }
342  break;
344  {
345  bool bSet = *o3tl::doAccess<bool>(rVal);
346  if(bSet)
349  SetWidthPercent(0);
350  }
351  break;
352  case MID_FRMSIZE_WIDTH :
353  {
354  sal_Int32 nWd = 0;
355  if(rVal >>= nWd)
356  {
357  if(bConvert)
358  nWd = convertMm100ToTwip(nWd);
359  if(nWd < MINLAY)
360  nWd = MINLAY;
361  SetWidth(nWd);
362  }
363  else
364  bRet = false;
365  }
366  break;
367  case MID_FRMSIZE_HEIGHT:
368  {
369  sal_Int32 nHg = 0;
370  if(rVal >>= nHg)
371  {
372  if(bConvert)
373  nHg = convertMm100ToTwip(nHg);
374  if(nHg < MINLAY)
375  nHg = MINLAY;
376  SetHeight(nHg);
377  }
378  else
379  bRet = false;
380  }
381  break;
383  {
384  sal_Int16 nType = 0;
385  if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE )
386  {
387  SetHeightSizeType(static_cast<SwFrameSize>(nType));
388  }
389  else
390  bRet = false;
391  }
392  break;
394  {
395  bool bSet = *o3tl::doAccess<bool>(rVal);
397  }
398  break;
400  {
401  sal_Int16 nType = 0;
402  if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE )
403  {
404  SetWidthSizeType(static_cast<SwFrameSize>(nType));
405  }
406  else
407  bRet = false;
408  }
409  break;
410  default:
411  bRet = false;
412  }
413  return bRet;
414 }
415 
417 {
418  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatFrameSize"));
419  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
420 
421  std::stringstream aSize;
422  aSize << GetSize();
423  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(aSize.str().c_str()));
424 
425  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameHeightType"), BAD_CAST(OString::number(m_eFrameHeightType).getStr()));
426  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameWidthType"), BAD_CAST(OString::number(m_eFrameWidthType).getStr()));
427  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthPercent"), BAD_CAST(OString::number(m_nWidthPercent).getStr()));
428  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eWidthPercentRelation"), BAD_CAST(OString::number(m_eWidthPercentRelation).getStr()));
429  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nHeightPercent"), BAD_CAST(OString::number(m_nHeightPercent).getStr()));
430  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eHeightPercentRelation"), BAD_CAST(OString::number(m_eHeightPercentRelation).getStr()));
431 
432  xmlTextWriterEndElement(pWriter);
433 }
434 
435 // Partially implemented inline in hxx
437  : SfxEnumItem( RES_FILL_ORDER, nFO )
438 {}
440 {
441  return new SwFormatFillOrder( GetValue() );
442 }
443 
445 {
447 }
448 
449 // Partially implemented inline in hxx
451  : SfxPoolItem( RES_HEADER ),
452  SwClient( pHeaderFormat ),
453  m_bActive( pHeaderFormat )
454 {
455 }
456 
458  : SfxPoolItem( RES_HEADER ),
459  SwClient( const_cast<SwModify*>(rCpy.GetRegisteredIn()) ),
460  m_bActive( rCpy.IsActive() )
461 {
462 }
463 
465  : SfxPoolItem( RES_HEADER ),
466  SwClient( nullptr ),
467  m_bActive( bOn )
468 {
469 }
470 
472 {
473  if ( GetHeaderFormat() )
474  lcl_DelHFFormat( this, GetHeaderFormat() );
475 }
476 
477 bool SwFormatHeader::operator==( const SfxPoolItem& rAttr ) const
478 {
479  assert(SfxPoolItem::operator==(rAttr));
480  return ( GetRegisteredIn() == static_cast<const SwFormatHeader&>(rAttr).GetRegisteredIn() &&
481  m_bActive == static_cast<const SwFormatHeader&>(rAttr).IsActive() );
482 }
483 
485 {
486  return new SwFormatHeader( *this );
487 }
488 
490 {
491  rFormat.Add(this);
492 }
493 
494 // Partially implemented inline in hxx
496  : SfxPoolItem( RES_FOOTER ),
497  SwClient( pFooterFormat ),
498  m_bActive( pFooterFormat )
499 {
500 }
501 
503  : SfxPoolItem( RES_FOOTER ),
504  SwClient( const_cast<SwModify*>(rCpy.GetRegisteredIn()) ),
505  m_bActive( rCpy.IsActive() )
506 {
507 }
508 
510  : SfxPoolItem( RES_FOOTER ),
511  SwClient( nullptr ),
512  m_bActive( bOn )
513 {
514 }
515 
517 {
518  if ( GetFooterFormat() )
519  lcl_DelHFFormat( this, GetFooterFormat() );
520 }
521 
523 {
524  rFormat.Add(this);
525 }
526 
527 bool SwFormatFooter::operator==( const SfxPoolItem& rAttr ) const
528 {
529  assert(SfxPoolItem::operator==(rAttr));
530  return ( GetRegisteredIn() == static_cast<const SwFormatFooter&>(rAttr).GetRegisteredIn() &&
531  m_bActive == static_cast<const SwFormatFooter&>(rAttr).IsActive() );
532 }
533 
535 {
536  return new SwFormatFooter( *this );
537 }
538 
539 // Partially implemented inline in hxx
542 {
543  m_pStartNode.reset( rCpy.GetContentIdx() ?
544  new SwNodeIndex( *rCpy.GetContentIdx() ) : nullptr);
545 }
546 
549 {
550  m_pStartNode.reset( pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr);
551 }
552 
554 {
555 }
556 
558 {
559  m_pStartNode.reset( pIdx ? new SwNodeIndex( *pIdx ) : nullptr );
560 }
561 
562 bool SwFormatContent::operator==( const SfxPoolItem& rAttr ) const
563 {
564  assert(SfxPoolItem::operator==(rAttr));
565  if( static_cast<bool>(m_pStartNode) != static_cast<bool>(static_cast<const SwFormatContent&>(rAttr).m_pStartNode) )
566  return false;
567  if( m_pStartNode )
568  return ( *m_pStartNode == *static_cast<const SwFormatContent&>(rAttr).GetContentIdx() );
569  return true;
570 }
571 
573 {
574  return new SwFormatContent( *this );
575 }
576 
578 {
579  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatContent"));
580  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
581  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("startNode"), BAD_CAST(OString::number(m_pStartNode->GetNode().GetIndex()).getStr()));
582  xmlTextWriterEndElement(pWriter);
583 }
584 
585 // Partially implemented inline in hxx
588  SwClient( const_cast<SwPageDesc*>(rCpy.GetPageDesc()) ),
589  m_oNumOffset( rCpy.m_oNumOffset ),
590  m_pDefinedIn( nullptr )
591 {
592 }
593 
596  SwClient( const_cast<SwPageDesc*>(pDesc) ),
597  m_pDefinedIn( nullptr )
598 {
599 }
600 
602 {
603  if(this == &rCpy)
604  return *this;
605 
606  if (rCpy.GetPageDesc())
607  RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc()));
608  m_oNumOffset = rCpy.m_oNumOffset;
609  m_pDefinedIn = nullptr;
610 
611  return *this;
612 }
613 
615 
617 {
618  return (GetRegisteredIn() != nullptr);
619 }
620 
621 bool SwFormatPageDesc::operator==( const SfxPoolItem& rAttr ) const
622 {
623  assert(SfxPoolItem::operator==(rAttr));
624  return ( m_pDefinedIn == static_cast<const SwFormatPageDesc&>(rAttr).m_pDefinedIn ) &&
625  ( m_oNumOffset == static_cast<const SwFormatPageDesc&>(rAttr).m_oNumOffset ) &&
626  ( GetPageDesc() == static_cast<const SwFormatPageDesc&>(rAttr).GetPageDesc() );
627 }
628 
630 {
631  return new SwFormatPageDesc( *this );
632 }
633 
634 void SwFormatPageDesc::SwClientNotify( const SwModify& rModify, const SfxHint& rHint )
635 {
636  SwClient::SwClientNotify(rModify, rHint);
637  const SwPageDescHint* pHint = dynamic_cast<const SwPageDescHint*>(&rHint);
638  if ( pHint )
639  {
640  // mba: shouldn't that be broadcasted also?
641  SwFormatPageDesc aDfltDesc( pHint->GetPageDesc() );
642  SwPageDesc* pDesc = pHint->GetPageDesc();
643  const SwModify* pMod = GetDefinedIn();
644  if ( pMod )
645  {
646  if( auto pContentNode = dynamic_cast<const SwContentNode*>( pMod) )
647  const_cast<SwContentNode*>(pContentNode)->SetAttr( aDfltDesc );
648  else if( auto pFormat = dynamic_cast<const SwFormat*>( pMod) )
649  const_cast<SwFormat*>(pFormat)->SetFormatAttr( aDfltDesc );
650  else
651  {
652  OSL_FAIL( "What kind of SwModify is this?" );
653  RegisterToPageDesc( *pDesc );
654  }
655  }
656  else
657  // there could be an Undo-copy
658  RegisterToPageDesc( *pDesc );
659  }
660 }
661 
663 {
664  rDesc.Add( this );
665 }
666 
667 void SwFormatPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
668 {
669  if( !m_pDefinedIn )
670  return;
671 
672  const sal_uInt16 nWhichId = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
673  switch( nWhichId )
674  {
675  case RES_OBJECTDYING:
676  //The Pagedesc where I'm registered dies, therefore I unregister
677  //from that format. During this I get deleted!
678  if( typeid(SwFormat) == typeid( m_pDefinedIn ))
679  {
680  bool const bResult =
681  static_cast<SwFormat*>(m_pDefinedIn)->ResetFormatAttr(RES_PAGEDESC);
682  OSL_ENSURE( bResult, "FormatPageDesc not deleted" );
683  }
684  else if( typeid(SwContentNode) == typeid( m_pDefinedIn ))
685  {
686  bool const bResult = static_cast<SwContentNode*>(m_pDefinedIn)
687  ->ResetAttr(RES_PAGEDESC);
688  OSL_ENSURE( bResult, "FormatPageDesc not deleted" );
689  }
690  break;
691 
692  default:
693  /* do nothing */;
694  }
695 }
696 
697 bool SwFormatPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
698 {
699  // here we convert always!
700  nMemberId &= ~CONVERT_TWIPS;
701  bool bRet = true;
702  switch ( nMemberId )
703  {
705  {
707  if (oOffset)
708  {
709  rVal <<= static_cast<sal_Int16>(oOffset.get());
710  }
711  else
712  {
713  rVal.clear();
714  }
715  }
716  break;
717 
719  {
720  const SwPageDesc* pDesc = GetPageDesc();
721  if( pDesc )
722  {
723  OUString aString;
725  rVal <<= aString;
726  }
727  else
728  rVal.clear();
729  }
730  break;
731  default:
732  OSL_ENSURE( false, "unknown MemberId" );
733  bRet = false;
734  }
735  return bRet;
736 }
737 
738 bool SwFormatPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
739 {
740  // here we convert always!
741  nMemberId &= ~CONVERT_TWIPS;
742  bool bRet = true;
743  switch ( nMemberId )
744  {
746  {
747  sal_Int16 nOffset = 0;
748  if (!rVal.hasValue())
749  {
750  SetNumOffset(boost::none);
751  }
752  else if (rVal >>= nOffset)
753  SetNumOffset( nOffset );
754  else
755  bRet = false;
756  }
757  break;
758 
760  /* Doesn't work, because the attribute doesn't need the name but a
761  * pointer to the PageDesc (it's a client of it). The pointer can
762  * only be requested from the document using the name.
763  */
764  default:
765  OSL_ENSURE( false, "unknown MemberId" );
766  bRet = false;
767  }
768  return bRet;
769 }
770 
772 {
773  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatPageDesc"));
774  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
775  if (m_oNumOffset)
776  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST(OString::number(*m_oNumOffset).getStr()));
777  else
778  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("oNumOffset"), BAD_CAST("none"));
779  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pPageDesc"), "%p", GetPageDesc());
780  if (const SwPageDesc* pPageDesc = GetPageDesc())
781  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(pPageDesc->GetName().toUtf8().getStr()));
782  xmlTextWriterEndElement(pWriter);
783 }
784 
785 // class SwFormatCol
786 // Partially implemented inline in hxx
787 
789  m_nWish ( 0 ),
790  m_nLeft ( 0 ),
791  m_nRight( 0 )
792 {
793 }
794 
795 bool SwColumn::operator==( const SwColumn &rCmp ) const
796 {
797  return m_nWish == rCmp.GetWishWidth() &&
798  GetLeft() == rCmp.GetLeft() &&
799  GetRight() == rCmp.GetRight();
800 }
801 
803 {
804  xmlTextWriterStartElement(pWriter, BAD_CAST("SwColumn"));
805  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWish"), BAD_CAST(OString::number(m_nWish).getStr()));
806  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUpper"), BAD_CAST(OString::number(0).getStr()));
807  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLower"), BAD_CAST(OString::number(0).getStr()));
808  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLeft"), BAD_CAST(OString::number(m_nLeft).getStr()));
809  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRight"), BAD_CAST(OString::number(m_nRight).getStr()));
810  xmlTextWriterEndElement(pWriter);
811 }
812 
814  : SfxPoolItem( RES_COL ),
815  m_eLineStyle( rCpy.m_eLineStyle ),
816  m_nLineWidth( rCpy.m_nLineWidth),
817  m_aLineColor( rCpy.m_aLineColor),
818  m_nLineHeight( rCpy.GetLineHeight() ),
819  m_eAdj( rCpy.GetLineAdj() ),
820  m_nWidth( rCpy.GetWishWidth() ),
821  m_aWidthAdjustValue( rCpy.m_aWidthAdjustValue ),
822  m_bOrtho( rCpy.IsOrtho() )
823 {
824  m_aColumns.reserve(rCpy.GetNumCols());
825  for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
826  {
827  m_aColumns.emplace_back(rCpy.GetColumns()[i] );
828  }
829 }
830 
832 
834 {
835  if (this != &rCpy)
836  {
837  m_eLineStyle = rCpy.m_eLineStyle;
838  m_nLineWidth = rCpy.m_nLineWidth;
839  m_aLineColor = rCpy.m_aLineColor;
840  m_nLineHeight = rCpy.GetLineHeight();
841  m_eAdj = rCpy.GetLineAdj();
842  m_nWidth = rCpy.GetWishWidth();
844  m_bOrtho = rCpy.IsOrtho();
845 
846  m_aColumns.clear();
847  for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
848  {
849  m_aColumns.emplace_back(rCpy.GetColumns()[i] );
850  }
851  }
852  return *this;
853 }
854 
856  : SfxPoolItem( RES_COL )
857  , m_eLineStyle( SvxBorderLineStyle::NONE)
858  ,
859  m_nLineWidth(0),
860  m_nLineHeight( 100 ),
861  m_eAdj( COLADJ_NONE ),
862  m_nWidth( USHRT_MAX ),
863  m_aWidthAdjustValue( 0 ),
864  m_bOrtho( true )
865 {
866 }
867 
868 bool SwFormatCol::operator==( const SfxPoolItem& rAttr ) const
869 {
870  assert(SfxPoolItem::operator==(rAttr));
871  const SwFormatCol &rCmp = static_cast<const SwFormatCol&>(rAttr);
872  if( !(m_eLineStyle == rCmp.m_eLineStyle &&
873  m_nLineWidth == rCmp.m_nLineWidth &&
874  m_aLineColor == rCmp.m_aLineColor &&
875  m_nLineHeight == rCmp.GetLineHeight() &&
876  m_eAdj == rCmp.GetLineAdj() &&
877  m_nWidth == rCmp.GetWishWidth() &&
878  m_bOrtho == rCmp.IsOrtho() &&
879  m_aColumns.size() == rCmp.GetNumCols() &&
881  ) )
882  return false;
883 
884  for ( size_t i = 0; i < m_aColumns.size(); ++i )
885  if ( !(m_aColumns[i] == rCmp.GetColumns()[i]) )
886  return false;
887 
888  return true;
889 }
890 
892 {
893  return new SwFormatCol( *this );
894 }
895 
896 sal_uInt16 SwFormatCol::GetGutterWidth( bool bMin ) const
897 {
898  sal_uInt16 nRet = 0;
899  if ( m_aColumns.size() == 2 )
900  nRet = m_aColumns[0].GetRight() + m_aColumns[1].GetLeft();
901  else if ( m_aColumns.size() > 2 )
902  {
903  bool bSet = false;
904  for ( size_t i = 1; i+1 < m_aColumns.size(); ++i )
905  {
906  const sal_uInt16 nTmp = m_aColumns[i].GetRight() + m_aColumns[i+1].GetLeft();
907  if ( bSet )
908  {
909  if ( nTmp != nRet )
910  {
911  if ( !bMin )
912  return USHRT_MAX;
913  if ( nRet > nTmp )
914  nRet = nTmp;
915  }
916  }
917  else
918  {
919  bSet = true;
920  nRet = nTmp;
921  }
922  }
923  }
924  return nRet;
925 }
926 
927 void SwFormatCol::SetGutterWidth( sal_uInt16 nNew, sal_uInt16 nAct )
928 {
929  if ( m_bOrtho )
930  Calc( nNew, nAct );
931  else
932  {
933  sal_uInt16 nHalf = nNew / 2;
934  for (size_t i = 0; i < m_aColumns.size(); ++i)
935  {
936  SwColumn &rCol = m_aColumns[i];
937  rCol.SetLeft(nHalf);
938  rCol.SetRight(nHalf);
939  if ( i == 0 )
940  rCol.SetLeft(0);
941  else if ( i+1 == m_aColumns.size() )
942  rCol.SetRight(0);
943  }
944  }
945 }
946 
947 void SwFormatCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct )
948 {
949  // Deleting seems to be a bit radical on the first sight; but otherwise we
950  // have to initialize all values of the remaining SwColumns.
951  m_aColumns.clear();
952  for ( sal_uInt16 i = 0; i < nNumCols; ++i )
953  {
954  m_aColumns.emplace_back( );
955  }
956  m_bOrtho = true;
958  if( nNumCols )
959  Calc( nGutterWidth, nAct );
960 }
961 
962 void SwFormatCol::SetOrtho( bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct )
963 {
964  m_bOrtho = bNew;
965  if ( bNew && !m_aColumns.empty() )
966  Calc( nGutterWidth, nAct );
967 }
968 
969 sal_uInt16 SwFormatCol::CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
970 {
971  assert(nCol < m_aColumns.size());
972  if ( m_nWidth != nAct )
973  {
974  long nW = m_aColumns[nCol].GetWishWidth();
975  nW *= nAct;
976  nW /= m_nWidth;
977  return sal_uInt16(nW);
978  }
979  else
980  return m_aColumns[nCol].GetWishWidth();
981 }
982 
983 sal_uInt16 SwFormatCol::CalcPrtColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
984 {
985  assert(nCol < m_aColumns.size());
986  sal_uInt16 nRet = CalcColWidth( nCol, nAct );
987  const SwColumn *pCol = &m_aColumns[nCol];
988  nRet = nRet - pCol->GetLeft();
989  nRet = nRet - pCol->GetRight();
990  return nRet;
991 }
992 
993 void SwFormatCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct )
994 {
995  if (!GetNumCols())
996  return;
997 
998  //First set the column widths with the current width, then calculate the
999  //column's requested width using the requested total width.
1000  const sal_uInt16 nGutterHalf = nGutterWidth ? nGutterWidth / 2 : 0;
1001 
1002  //Width of PrtAreas is totalwidth - spacings / count
1003  sal_uInt16 nSpacings;
1004  bool bFail = o3tl::checked_multiply<sal_uInt16>(GetNumCols() - 1, nGutterWidth, nSpacings);
1005  if (bFail)
1006  {
1007  SAL_WARN("sw.core", "SwFormatVertOrient::Calc: overflow");
1008  return;
1009  }
1010 
1011  const sal_uInt16 nPrtWidth = (nAct - nSpacings) / GetNumCols();
1012  sal_uInt16 nAvail = nAct;
1013 
1014  //The first column is PrtWidth + (gap width / 2)
1015  const sal_uInt16 nLeftWidth = nPrtWidth + nGutterHalf;
1016  SwColumn &rFirstCol = m_aColumns.front();
1017  rFirstCol.SetWishWidth(nLeftWidth);
1018  rFirstCol.SetRight(nGutterHalf);
1019  rFirstCol.SetLeft(0);
1020  nAvail = nAvail - nLeftWidth;
1021 
1022  //Column 2 to n-1 is PrtWidth + gap width
1023  const sal_uInt16 nMidWidth = nPrtWidth + nGutterWidth;
1024 
1025  for (sal_uInt16 i = 1; i < GetNumCols()-1; ++i)
1026  {
1027  SwColumn &rCol = m_aColumns[i];
1028  rCol.SetWishWidth(nMidWidth);
1029  rCol.SetLeft(nGutterHalf);
1030  rCol.SetRight(nGutterHalf);
1031  nAvail = nAvail - nMidWidth;
1032  }
1033 
1034  //The last column is equivalent to the first one - to compensate rounding
1035  //errors we add the remaining space of the other columns to the last one.
1036  SwColumn &rLastCol = m_aColumns.back();
1037  rLastCol.SetWishWidth(nAvail);
1038  rLastCol.SetLeft(nGutterHalf);
1039  rLastCol.SetRight(0);
1040 
1041  //Convert the current width to the requested width.
1042  for (SwColumn &rCol: m_aColumns)
1043  {
1044  long nTmp = rCol.GetWishWidth();
1045  nTmp *= GetWishWidth();
1046  nTmp /= nAct;
1047  rCol.SetWishWidth(sal_uInt16(nTmp));
1048  }
1049 }
1050 
1051 bool SwFormatCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1052 {
1053  // here we convert always!
1054  nMemberId &= ~CONVERT_TWIPS;
1055  if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
1056  {
1057  OSL_FAIL("not implemented");
1058  }
1059  else
1060  {
1061  uno::Reference< text::XTextColumns > xCols = new SwXTextColumns(*this);
1062  rVal <<= xCols;
1063  }
1064  return true;
1065 }
1066 
1067 bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1068 {
1069  // here we convert always!
1070  nMemberId &= ~CONVERT_TWIPS;
1071  bool bRet = false;
1072  if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
1073  {
1074  OSL_FAIL("not implemented");
1075  }
1076  else
1077  {
1078  uno::Reference< text::XTextColumns > xCols;
1079  rVal >>= xCols;
1080  if(xCols.is())
1081  {
1082  uno::Sequence<text::TextColumn> aSetColumns = xCols->getColumns();
1083  const text::TextColumn* pArray = aSetColumns.getConstArray();
1084  m_aColumns.clear();
1085  //max count is 64k here - this is something the array can't do
1086  sal_uInt16 nCount = std::min( static_cast<sal_uInt16>(aSetColumns.getLength()),
1087  sal_uInt16(0x3fff) );
1088  sal_uInt16 nWidthSum = 0;
1089  // #101224# one column is no column
1090 
1091  if(nCount > 1)
1092  for(sal_uInt16 i = 0; i < nCount; i++)
1093  {
1094  SwColumn aCol;
1095  aCol.SetWishWidth(pArray[i].Width );
1096  nWidthSum = nWidthSum + pArray[i].Width;
1097  aCol.SetLeft (convertMm100ToTwip(pArray[i].LeftMargin));
1098  aCol.SetRight(convertMm100ToTwip(pArray[i].RightMargin));
1099  m_aColumns.insert(m_aColumns.begin() + i, aCol);
1100  }
1101  bRet = true;
1102  m_nWidth = nWidthSum;
1103  m_bOrtho = false;
1104 
1105  uno::Reference<lang::XUnoTunnel> xNumTunnel(xCols, uno::UNO_QUERY);
1106  SwXTextColumns* pSwColums = nullptr;
1107  if(xNumTunnel.is())
1108  {
1109  pSwColums = reinterpret_cast< SwXTextColumns * >(
1110  sal::static_int_cast< sal_IntPtr >(
1111  xNumTunnel->getSomething( SwXTextColumns::getUnoTunnelId() )));
1112  }
1113  if(pSwColums)
1114  {
1115  m_bOrtho = pSwColums->IsAutomaticWidth();
1116  m_nLineWidth = pSwColums->GetSepLineWidth();
1117  m_aLineColor = pSwColums->GetSepLineColor();
1118  m_nLineHeight = pSwColums->GetSepLineHeightRelative();
1119  switch ( pSwColums->GetSepLineStyle() )
1120  {
1121  default:
1122  case 0: m_eLineStyle = SvxBorderLineStyle::NONE; break;
1123  case 1: m_eLineStyle = SvxBorderLineStyle::SOLID; break;
1124  case 2: m_eLineStyle = SvxBorderLineStyle::DOTTED; break;
1125  case 3: m_eLineStyle = SvxBorderLineStyle::DASHED; break;
1126  }
1127  if(!pSwColums->GetSepLineIsOn())
1128  m_eAdj = COLADJ_NONE;
1129  else switch(pSwColums->GetSepLineVertAlign())
1130  {
1131  case style::VerticalAlignment_TOP: m_eAdj = COLADJ_TOP; break;
1132  case style::VerticalAlignment_MIDDLE: m_eAdj = COLADJ_CENTER; break;
1133  case style::VerticalAlignment_BOTTOM: m_eAdj = COLADJ_BOTTOM; break;
1134  default: OSL_ENSURE( false, "unknown alignment" ); break;
1135  }
1136  }
1137  }
1138  }
1139  return bRet;
1140 }
1141 
1143 {
1144  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatCol"));
1145  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1146  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eLineStyle"), BAD_CAST(OString::number(static_cast<sal_Int16>(m_eLineStyle)).getStr()));
1147  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLineWidth"), BAD_CAST(OString::number(m_nLineWidth).getStr()));
1148  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aLineColor"), BAD_CAST(m_aLineColor.AsRGBHexString().toUtf8().getStr()));
1149  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLineHeight"), BAD_CAST(OString::number(m_nLineHeight).getStr()));
1150  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eAdj"), BAD_CAST(OString::number(m_eAdj).getStr()));
1151  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidth"), BAD_CAST(OString::number(m_nWidth).getStr()));
1152  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthAdjustValue"), BAD_CAST(OString::number(m_aWidthAdjustValue).getStr()));
1153  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bOrtho"), BAD_CAST(OString::boolean(m_bOrtho).getStr()));
1154 
1155  xmlTextWriterStartElement(pWriter, BAD_CAST("aColumns"));
1156  for (const SwColumn& rColumn : m_aColumns)
1157  rColumn.dumpAsXml(pWriter);
1158  xmlTextWriterEndElement(pWriter);
1159 
1160  xmlTextWriterEndElement(pWriter);
1161 }
1162 
1163 // Partially implemented inline in hxx
1164 SwFormatSurround::SwFormatSurround( css::text::WrapTextMode eFly ) :
1165  SfxEnumItem( RES_SURROUND, eFly )
1166 {
1167  bAnchorOnly = bContour = bOutside = false;
1168 }
1169 
1170 bool SwFormatSurround::operator==( const SfxPoolItem& rAttr ) const
1171 {
1172  assert(SfxPoolItem::operator==(rAttr));
1173  return ( GetValue() == static_cast<const SwFormatSurround&>(rAttr).GetValue() &&
1174  bAnchorOnly== static_cast<const SwFormatSurround&>(rAttr).bAnchorOnly &&
1175  bContour== static_cast<const SwFormatSurround&>(rAttr).bContour &&
1176  bOutside== static_cast<const SwFormatSurround&>(rAttr).bOutside );
1177 }
1178 
1180 {
1181  return new SwFormatSurround( *this );
1182 }
1183 
1185 {
1186  return 6;
1187 }
1188 
1189 bool SwFormatSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1190 {
1191  // here we convert always!
1192  nMemberId &= ~CONVERT_TWIPS;
1193  bool bRet = true;
1194  switch ( nMemberId )
1195  {
1197  rVal <<= GetSurround();
1198  break;
1200  rVal <<= IsAnchorOnly();
1201  break;
1202  case MID_SURROUND_CONTOUR:
1203  rVal <<= IsContour();
1204  break;
1206  rVal <<= IsOutside();
1207  break;
1208  default:
1209  OSL_ENSURE( false, "unknown MemberId" );
1210  bRet = false;
1211  }
1212  return bRet;
1213 }
1214 
1215 bool SwFormatSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1216 {
1217  // here we convert always!
1218  nMemberId &= ~CONVERT_TWIPS;
1219  bool bRet = true;
1220  switch ( nMemberId )
1221  {
1223  {
1224  css::text::WrapTextMode eVal = static_cast<css::text::WrapTextMode>(SWUnoHelper::GetEnumAsInt32( rVal ));
1225  if( eVal >= css::text::WrapTextMode_NONE && eVal <= css::text::WrapTextMode_RIGHT )
1226  SetValue( eVal );
1227  else {
1228  //exception
1229  ;
1230  }
1231  }
1232  break;
1233 
1235  SetAnchorOnly( *o3tl::doAccess<bool>(rVal) );
1236  break;
1237  case MID_SURROUND_CONTOUR:
1238  SetContour( *o3tl::doAccess<bool>(rVal) );
1239  break;
1241  SetOutside( *o3tl::doAccess<bool>(rVal) );
1242  break;
1243  default:
1244  OSL_ENSURE( false, "unknown MemberId" );
1245  bRet = false;
1246  }
1247  return bRet;
1248 }
1249 
1251 {
1252  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatSurround"));
1253  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1254  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(static_cast<sal_Int32>(GetValue())).getStr()));
1255 
1256  OUString aPresentation;
1257  IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1258  GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation, aIntlWrapper);
1259  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
1260 
1261  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bAnchorOnly"), BAD_CAST(OString::boolean(bAnchorOnly).getStr()));
1262  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bContour"), BAD_CAST(OString::boolean(bContour).getStr()));
1263  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bOutside"), BAD_CAST(OString::boolean(bOutside).getStr()));
1264 
1265  xmlTextWriterEndElement(pWriter);
1266 }
1267 
1268 // Partially implemented inline in hxx
1270  sal_Int16 eRel )
1272  m_nYPos( nY ),
1273  m_eOrient( eVert ),
1274  m_eRelation( eRel )
1275 {}
1276 
1278 {
1279  assert(SfxPoolItem::operator==(rAttr));
1280  return ( m_nYPos == static_cast<const SwFormatVertOrient&>(rAttr).m_nYPos &&
1281  m_eOrient == static_cast<const SwFormatVertOrient&>(rAttr).m_eOrient &&
1282  m_eRelation == static_cast<const SwFormatVertOrient&>(rAttr).m_eRelation );
1283 }
1284 
1286 {
1287  return new SwFormatVertOrient( *this );
1288 }
1289 
1290 bool SwFormatVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1291 {
1292  // here we convert always!
1293  nMemberId &= ~CONVERT_TWIPS;
1294  bool bRet = true;
1295  switch ( nMemberId )
1296  {
1297  case MID_VERTORIENT_ORIENT:
1298  {
1299  rVal <<= m_eOrient;
1300  }
1301  break;
1303  rVal <<= m_eRelation;
1304  break;
1306  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetPos()));
1307  break;
1308  default:
1309  OSL_ENSURE( false, "unknown MemberId" );
1310  bRet = false;
1311  }
1312  return bRet;
1313 }
1314 
1315 bool SwFormatVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1316 {
1317  bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
1318  nMemberId &= ~CONVERT_TWIPS;
1319  bool bRet = true;
1320  switch ( nMemberId )
1321  {
1322  case MID_VERTORIENT_ORIENT:
1323  {
1324  sal_uInt16 nVal = text::VertOrientation::NONE;
1325  rVal >>= nVal;
1326  m_eOrient = nVal;
1327  }
1328  break;
1330  {
1332  }
1333  break;
1335  {
1336  sal_Int32 nVal = 0;
1337  rVal >>= nVal;
1338  if(bConvert)
1339  nVal = convertMm100ToTwip(nVal);
1340  SetPos( nVal );
1341  }
1342  break;
1343  default:
1344  OSL_ENSURE( false, "unknown MemberId" );
1345  bRet = false;
1346  }
1347  return bRet;
1348 }
1349 
1351 {
1352  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatVertOrient"));
1353  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1354  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nYPos"), BAD_CAST(OString::number(m_nYPos).getStr()));
1355  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eOrient"), BAD_CAST(OString::number(m_eOrient).getStr()));
1356  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eRelation"), BAD_CAST(OString::number(m_eRelation).getStr()));
1357  xmlTextWriterEndElement(pWriter);
1358 }
1359 
1360 // Partially implemented inline in hxx
1362  sal_Int16 eRel, bool bPos )
1364  m_nXPos( nX ),
1365  m_eOrient( eHori ),
1366  m_eRelation( eRel ),
1367  m_bPosToggle( bPos )
1368 {}
1369 
1371 {
1372  assert(SfxPoolItem::operator==(rAttr));
1373  return ( m_nXPos == static_cast<const SwFormatHoriOrient&>(rAttr).m_nXPos &&
1374  m_eOrient == static_cast<const SwFormatHoriOrient&>(rAttr).m_eOrient &&
1375  m_eRelation == static_cast<const SwFormatHoriOrient&>(rAttr).m_eRelation &&
1376  m_bPosToggle == static_cast<const SwFormatHoriOrient&>(rAttr).m_bPosToggle );
1377 }
1378 
1380 {
1381  return new SwFormatHoriOrient( *this );
1382 }
1383 
1384 bool SwFormatHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1385 {
1386  // here we convert always!
1387  nMemberId &= ~CONVERT_TWIPS;
1388  bool bRet = true;
1389  switch ( nMemberId )
1390  {
1391  case MID_HORIORIENT_ORIENT:
1392  {
1393  rVal <<= m_eOrient;
1394  }
1395  break;
1397  rVal <<= m_eRelation;
1398  break;
1400  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(GetPos()));
1401  break;
1403  rVal <<= IsPosToggle();
1404  break;
1405  default:
1406  OSL_ENSURE( false, "unknown MemberId" );
1407  bRet = false;
1408  }
1409  return bRet;
1410 }
1411 
1412 bool SwFormatHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1413 {
1414  bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
1415  nMemberId &= ~CONVERT_TWIPS;
1416  bool bRet = true;
1417  switch ( nMemberId )
1418  {
1419  case MID_HORIORIENT_ORIENT:
1420  {
1421  sal_Int16 nVal = text::HoriOrientation::NONE;
1422  rVal >>= nVal;
1423  m_eOrient = nVal;
1424  }
1425  break;
1427  {
1429  }
1430  break;
1432  {
1433  sal_Int32 nVal = 0;
1434  if(!(rVal >>= nVal))
1435  bRet = false;
1436  if(bConvert)
1437  nVal = convertMm100ToTwip(nVal);
1438  SetPos( nVal );
1439  }
1440  break;
1442  SetPosToggle( *o3tl::doAccess<bool>(rVal));
1443  break;
1444  default:
1445  OSL_ENSURE( false, "unknown MemberId" );
1446  bRet = false;
1447  }
1448  return bRet;
1449 }
1450 
1452 {
1453  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatHoriOrient"));
1454  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1455  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nXPos"), BAD_CAST(OString::number(m_nXPos).getStr()));
1456  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eOrient"), BAD_CAST(OString::number(m_eOrient).getStr()));
1457  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eRelation"), BAD_CAST(OString::number(m_eRelation).getStr()));
1458  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bPosToggle"), BAD_CAST(OString::boolean(m_bPosToggle).getStr()));
1459  xmlTextWriterEndElement(pWriter);
1460 }
1461 
1462 // Partially implemented inline in hxx
1464  : SfxPoolItem( RES_ANCHOR ),
1465  m_eAnchorId( nRnd ),
1466  m_nPageNumber( nPage ),
1467  // OD 2004-05-05 #i28701# - get always new increased order number
1468  m_nOrder( ++m_nOrderCounter )
1469 {}
1470 
1472  : SfxPoolItem( RES_ANCHOR )
1473  , m_pContentAnchor( (rCpy.GetContentAnchor())
1474  ? new SwPosition( *rCpy.GetContentAnchor() ) : nullptr )
1475  , m_eAnchorId( rCpy.GetAnchorId() )
1476  , m_nPageNumber( rCpy.GetPageNum() )
1477  // OD 2004-05-05 #i28701# - get always new increased order number
1478  , m_nOrder( ++m_nOrderCounter )
1479 {
1480 }
1481 
1483 {
1484 }
1485 
1487 {
1488  // anchor only to paragraphs, or start nodes in case of RndStdIds::FLY_AT_FLY
1489  // also allow table node, this is used when a table is selected and is converted to a frame by the UI
1490  assert(!pPos
1491  || ((RndStdIds::FLY_AT_FLY == m_eAnchorId) &&
1492  dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode()))
1493  || (RndStdIds::FLY_AT_PARA == m_eAnchorId && dynamic_cast<SwTableNode*>(&pPos->nNode.GetNode()))
1494  || dynamic_cast<SwTextNode*>(&pPos->nNode.GetNode()));
1495  m_pContentAnchor .reset( pPos ? new SwPosition( *pPos ) : nullptr );
1496  // Flys anchored AT paragraph should not point into the paragraph content
1497  if (m_pContentAnchor &&
1498  ((RndStdIds::FLY_AT_PARA == m_eAnchorId) || (RndStdIds::FLY_AT_FLY == m_eAnchorId)))
1499  {
1500  m_pContentAnchor->nContent.Assign( nullptr, 0 );
1501  }
1502 }
1503 
1505 {
1506  if (this != &rAnchor)
1507  {
1508  m_eAnchorId = rAnchor.GetAnchorId();
1509  m_nPageNumber = rAnchor.GetPageNum();
1510  // OD 2004-05-05 #i28701# - get always new increased order number
1512 
1513  m_pContentAnchor.reset( (rAnchor.GetContentAnchor())
1514  ? new SwPosition(*(rAnchor.GetContentAnchor()))
1515  : nullptr );
1516  }
1517  return *this;
1518 }
1519 
1520 bool SwFormatAnchor::operator==( const SfxPoolItem& rAttr ) const
1521 {
1522  assert(SfxPoolItem::operator==(rAttr));
1523  SwFormatAnchor const& rFormatAnchor(static_cast<SwFormatAnchor const&>(rAttr));
1524  // OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
1525  return ( m_eAnchorId == rFormatAnchor.GetAnchorId() &&
1526  m_nPageNumber == rFormatAnchor.GetPageNum() &&
1527  // compare anchor: either both do not point into a textnode or
1528  // both do (valid m_pContentAnchor) and the positions are equal
1529  ((m_pContentAnchor.get() == rFormatAnchor.m_pContentAnchor.get()) ||
1530  (m_pContentAnchor && rFormatAnchor.GetContentAnchor() &&
1531  (*m_pContentAnchor == *rFormatAnchor.GetContentAnchor()))));
1532 }
1533 
1535 {
1536  return new SwFormatAnchor( *this );
1537 }
1538 
1539 // OD 2004-05-05 #i28701#
1540 sal_uInt32 SwFormatAnchor::m_nOrderCounter = 0;
1541 
1542 // OD 2004-05-05 #i28701#
1543 
1544 bool SwFormatAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1545 {
1546  // here we convert always!
1547  nMemberId &= ~CONVERT_TWIPS;
1548  bool bRet = true;
1549  switch ( nMemberId )
1550  {
1551  case MID_ANCHOR_ANCHORTYPE:
1552 
1553  text::TextContentAnchorType eRet;
1554  switch (GetAnchorId())
1555  {
1556  case RndStdIds::FLY_AT_CHAR:
1557  eRet = text::TextContentAnchorType_AT_CHARACTER;
1558  break;
1559  case RndStdIds::FLY_AT_PAGE:
1560  eRet = text::TextContentAnchorType_AT_PAGE;
1561  break;
1562  case RndStdIds::FLY_AT_FLY:
1563  eRet = text::TextContentAnchorType_AT_FRAME;
1564  break;
1565  case RndStdIds::FLY_AS_CHAR:
1566  eRet = text::TextContentAnchorType_AS_CHARACTER;
1567  break;
1568  //case RndStdIds::FLY_AT_PARA:
1569  default:
1570  eRet = text::TextContentAnchorType_AT_PARAGRAPH;
1571  }
1572  rVal <<= eRet;
1573  break;
1574  case MID_ANCHOR_PAGENUM:
1575  rVal <<= static_cast<sal_Int16>(GetPageNum());
1576  break;
1578  {
1579  if (m_pContentAnchor && RndStdIds::FLY_AT_FLY == m_eAnchorId)
1580  {
1581  SwFrameFormat* pFormat = m_pContentAnchor->nNode.GetNode().GetFlyFormat();
1582  if(pFormat)
1583  {
1584  uno::Reference<text::XTextFrame> const xRet(
1585  SwXTextFrame::CreateXTextFrame(*pFormat->GetDoc(), pFormat));
1586  rVal <<= xRet;
1587  }
1588  }
1589  }
1590  break;
1591  default:
1592  OSL_ENSURE( false, "unknown MemberId" );
1593  bRet = false;
1594  }
1595  return bRet;
1596 }
1597 
1598 bool SwFormatAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1599 {
1600  // here we convert always!
1601  nMemberId &= ~CONVERT_TWIPS;
1602  bool bRet = true;
1603  switch ( nMemberId )
1604  {
1605  case MID_ANCHOR_ANCHORTYPE:
1606  {
1607  RndStdIds eAnchor;
1608  switch( static_cast<text::TextContentAnchorType>(SWUnoHelper::GetEnumAsInt32( rVal )) )
1609  {
1610  case text::TextContentAnchorType_AS_CHARACTER:
1611  eAnchor = RndStdIds::FLY_AS_CHAR;
1612  break;
1613  case text::TextContentAnchorType_AT_PAGE:
1614  eAnchor = RndStdIds::FLY_AT_PAGE;
1615  if( GetPageNum() > 0 )
1616  {
1617  // If the anchor type is page and a valid page number
1618  // has been set, the content position isn't required
1619  // any longer.
1620  m_pContentAnchor.reset();
1621  }
1622  break;
1623  case text::TextContentAnchorType_AT_FRAME:
1624  eAnchor = RndStdIds::FLY_AT_FLY;
1625  break;
1626  case text::TextContentAnchorType_AT_CHARACTER:
1627  eAnchor = RndStdIds::FLY_AT_CHAR;
1628  break;
1629  //case text::TextContentAnchorType_AT_PARAGRAPH:
1630  default:
1631  eAnchor = RndStdIds::FLY_AT_PARA;
1632  break;
1633  }
1634  SetType( eAnchor );
1635  }
1636  break;
1637  case MID_ANCHOR_PAGENUM:
1638  {
1639  sal_Int16 nVal = 0;
1640  if((rVal >>= nVal) && nVal > 0)
1641  {
1642  SetPageNum( nVal );
1643  if (RndStdIds::FLY_AT_PAGE == GetAnchorId())
1644  {
1645  // If the anchor type is page and a valid page number
1646  // is set, the content position has to be deleted to not
1647  // confuse the layout (frmtool.cxx). However, if the
1648  // anchor type is not page, any content position will
1649  // be kept.
1650  m_pContentAnchor.reset();
1651  }
1652  }
1653  else
1654  bRet = false;
1655  }
1656  break;
1658  //no break here!;
1659  default:
1660  OSL_ENSURE( false, "unknown MemberId" );
1661  bRet = false;
1662  }
1663  return bRet;
1664 }
1665 
1667 {
1668  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatAnchor"));
1669  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1670 
1671  if (m_pContentAnchor)
1672  {
1673  std::stringstream aContentAnchor;
1674  aContentAnchor << *m_pContentAnchor;
1675  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_pContentAnchor"), BAD_CAST(aContentAnchor.str().c_str()));
1676  }
1677  else
1678  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("m_pContentAnchor"), "%p", m_pContentAnchor.get());
1679  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_eAnchorType"), BAD_CAST(OString::number(static_cast<int>(m_eAnchorId)).getStr()));
1680  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nPageNumber"), BAD_CAST(OString::number(m_nPageNumber).getStr()));
1681  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nOrder"), BAD_CAST(OString::number(m_nOrder).getStr()));
1682  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nOrderCounter"), BAD_CAST(OString::number(m_nOrderCounter).getStr()));
1683  OUString aPresentation;
1684  IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1685  GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation, aIntlWrapper);
1686  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
1687 
1688  xmlTextWriterEndElement(pWriter);
1689 }
1690 
1691 // Partially implemented inline in hxx
1693  SfxPoolItem( RES_URL ),
1694  m_bIsServerMap( false )
1695 {
1696 }
1697 
1699  SfxPoolItem( RES_URL ),
1700  m_sTargetFrameName( rURL.GetTargetFrameName() ),
1701  m_sURL( rURL.GetURL() ),
1702  m_sName( rURL.GetName() ),
1703  m_bIsServerMap( rURL.IsServerMap() )
1704 {
1705  if (rURL.GetMap())
1706  m_pMap.reset( new ImageMap( *rURL.GetMap() ) );
1707 }
1708 
1710 {
1711 }
1712 
1713 bool SwFormatURL::operator==( const SfxPoolItem &rAttr ) const
1714 {
1715  assert(SfxPoolItem::operator==(rAttr));
1716  const SwFormatURL &rCmp = static_cast<const SwFormatURL&>(rAttr);
1717  bool bRet = m_bIsServerMap == rCmp.IsServerMap() &&
1718  m_sURL == rCmp.GetURL() &&
1720  m_sName == rCmp.GetName();
1721  if ( bRet )
1722  {
1723  if ( m_pMap && rCmp.GetMap() )
1724  bRet = *m_pMap == *rCmp.GetMap();
1725  else
1726  bRet = m_pMap.get() == rCmp.GetMap();
1727  }
1728  return bRet;
1729 }
1730 
1732 {
1733  return new SwFormatURL( *this );
1734 }
1735 
1736 void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap)
1737 {
1738  m_sURL = rURL;
1739  m_bIsServerMap = bServerMap;
1740 }
1741 
1743 {
1744  m_pMap.reset( pM ? new ImageMap( *pM ) : nullptr);
1745 }
1746 
1747 bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1748 {
1749  // here we convert always!
1750  nMemberId &= ~CONVERT_TWIPS;
1751  bool bRet = true;
1752  switch ( nMemberId )
1753  {
1754  case MID_URL_URL:
1755  rVal <<= GetURL();
1756  break;
1757  case MID_URL_TARGET:
1758  rVal <<= GetTargetFrameName();
1759  break;
1760  case MID_URL_HYPERLINKNAME:
1761  rVal <<= GetName();
1762  break;
1763  case MID_URL_CLIENTMAP:
1764  {
1765  uno::Reference< uno::XInterface > xInt;
1766  if(m_pMap)
1767  {
1769  }
1770  else
1771  {
1774  }
1775  uno::Reference< container::XIndexContainer > xCont(xInt, uno::UNO_QUERY);
1776  rVal <<= xCont;
1777  }
1778  break;
1779  case MID_URL_SERVERMAP:
1780  rVal <<= IsServerMap();
1781  break;
1782  default:
1783  OSL_ENSURE( false, "unknown MemberId" );
1784  bRet = false;
1785  }
1786  return bRet;
1787 }
1788 
1789 bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1790 {
1791  // here we convert always!
1792  nMemberId &= ~CONVERT_TWIPS;
1793  bool bRet = true;
1794  switch ( nMemberId )
1795  {
1796  case MID_URL_URL:
1797  {
1798  OUString sTmp;
1799  rVal >>= sTmp;
1800  SetURL( sTmp, m_bIsServerMap );
1801  }
1802  break;
1803  case MID_URL_TARGET:
1804  {
1805  OUString sTmp;
1806  rVal >>= sTmp;
1807  SetTargetFrameName( sTmp );
1808  }
1809  break;
1810  case MID_URL_HYPERLINKNAME:
1811  {
1812  OUString sTmp;
1813  rVal >>= sTmp;
1814  SetName( sTmp );
1815  }
1816  break;
1817  case MID_URL_CLIENTMAP:
1818  {
1819  uno::Reference<container::XIndexContainer> xCont;
1820  if(!rVal.hasValue())
1821  m_pMap.reset();
1822  else if(rVal >>= xCont)
1823  {
1824  if(!m_pMap)
1825  m_pMap.reset(new ImageMap);
1826  bRet = SvUnoImageMap_fillImageMap( xCont, *m_pMap );
1827  }
1828  else
1829  bRet = false;
1830  }
1831  break;
1832  case MID_URL_SERVERMAP:
1833  m_bIsServerMap = *o3tl::doAccess<bool>(rVal);
1834  break;
1835  default:
1836  OSL_ENSURE( false, "unknown MemberId" );
1837  bRet = false;
1838  }
1839  return bRet;
1840 }
1841 
1843 {
1844  return new SwFormatEditInReadonly( *this );
1845 }
1846 
1848 {
1849  return new SwFormatLayoutSplit( *this );
1850 }
1851 
1853 {
1854  return new SwFormatRowSplit( *this );
1855 }
1856 
1858 {
1859  return new SwFormatNoBalancedColumns( *this );
1860 }
1861 
1863 {
1864  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatNoBalancedColumns"));
1865  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1866  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::boolean(GetValue()).getStr()));
1867  xmlTextWriterEndElement(pWriter);
1868 }
1869 
1870 // class SwFormatFootnoteEndAtTextEnd
1871 
1873 {
1874  return sal_uInt16( FTNEND_ATTXTEND_END );
1875 }
1876 
1878  const SwFormatFootnoteEndAtTextEnd& rAttr )
1879 {
1880  SfxEnumItem::SetValue( rAttr.GetValue() );
1881  m_aFormat = rAttr.m_aFormat;
1882  m_nOffset = rAttr.m_nOffset;
1883  m_sPrefix = rAttr.m_sPrefix;
1884  m_sSuffix = rAttr.m_sSuffix;
1885  return *this;
1886 }
1887 
1889 {
1890  const SwFormatFootnoteEndAtTextEnd& rAttr = static_cast<const SwFormatFootnoteEndAtTextEnd&>(rItem);
1891  return SfxEnumItem::operator==( rAttr ) &&
1893  m_nOffset == rAttr.m_nOffset &&
1894  m_sPrefix == rAttr.m_sPrefix &&
1895  m_sSuffix == rAttr.m_sSuffix;
1896 }
1897 
1899 {
1900  nMemberId &= ~CONVERT_TWIPS;
1901  switch(nMemberId)
1902  {
1903  case MID_COLLECT :
1904  rVal <<= GetValue() >= FTNEND_ATTXTEND;
1905  break;
1906  case MID_RESTART_NUM :
1907  rVal <<= GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ;
1908  break;
1909  case MID_NUM_START_AT: rVal <<= static_cast<sal_Int16>(m_nOffset); break;
1910  case MID_OWN_NUM :
1911  rVal <<= GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT;
1912  break;
1913  case MID_NUM_TYPE : rVal <<= static_cast<sal_Int16>(m_aFormat.GetNumberingType()); break;
1914  case MID_PREFIX : rVal <<= m_sPrefix; break;
1915  case MID_SUFFIX : rVal <<= m_sSuffix; break;
1916  default: return false;
1917  }
1918  return true;
1919 }
1920 
1922 {
1923  bool bRet = true;
1924  nMemberId &= ~CONVERT_TWIPS;
1925  switch(nMemberId)
1926  {
1927  case MID_COLLECT :
1928  {
1929  bool bVal = *o3tl::doAccess<bool>(rVal);
1930  if(!bVal && GetValue() >= FTNEND_ATTXTEND)
1932  else if(bVal && GetValue() < FTNEND_ATTXTEND)
1934  }
1935  break;
1936  case MID_RESTART_NUM :
1937  {
1938  bool bVal = *o3tl::doAccess<bool>(rVal);
1939  if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ)
1941  else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMSEQ)
1943  }
1944  break;
1945  case MID_NUM_START_AT:
1946  {
1947  sal_Int16 nVal = 0;
1948  rVal >>= nVal;
1949  if(nVal >= 0)
1950  m_nOffset = nVal;
1951  else
1952  bRet = false;
1953  }
1954  break;
1955  case MID_OWN_NUM :
1956  {
1957  bool bVal = *o3tl::doAccess<bool>(rVal);
1958  if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT)
1960  else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMANDFMT)
1962  }
1963  break;
1964  case MID_NUM_TYPE :
1965  {
1966  sal_Int16 nVal = 0;
1967  rVal >>= nVal;
1968  if(nVal >= 0 &&
1969  (nVal <= SVX_NUM_ARABIC ||
1970  SVX_NUM_CHARS_UPPER_LETTER_N == nVal ||
1971  SVX_NUM_CHARS_LOWER_LETTER_N == nVal ))
1972  m_aFormat.SetNumberingType(static_cast<SvxNumType>(nVal));
1973  else
1974  bRet = false;
1975  }
1976  break;
1977  case MID_PREFIX :
1978  {
1979  OUString sVal; rVal >>= sVal;
1980  m_sPrefix = sVal;
1981  }
1982  break;
1983  case MID_SUFFIX :
1984  {
1985  OUString sVal; rVal >>= sVal;
1986  m_sSuffix = sVal;
1987  }
1988  break;
1989  default: bRet = false;
1990  }
1991  return bRet;
1992 }
1993 
1994 // class SwFormatFootnoteAtTextEnd
1995 
1997 {
1998  return new SwFormatFootnoteAtTextEnd(*this);
1999 }
2000 
2001 // class SwFormatEndAtTextEnd
2002 
2004 {
2005  return new SwFormatEndAtTextEnd(*this);
2006 }
2007 
2008 //class SwFormatChain
2009 
2010 bool SwFormatChain::operator==( const SfxPoolItem &rAttr ) const
2011 {
2012  assert(SfxPoolItem::operator==(rAttr));
2013 
2014  return GetPrev() == static_cast<const SwFormatChain&>(rAttr).GetPrev() &&
2015  GetNext() == static_cast<const SwFormatChain&>(rAttr).GetNext();
2016 }
2017 
2020 {
2021  SetPrev( rCpy.GetPrev() );
2022  SetNext( rCpy.GetNext() );
2023 }
2024 
2026 {
2027  SwFormatChain *pRet = new SwFormatChain;
2028  pRet->SetPrev( GetPrev() );
2029  pRet->SetNext( GetNext() );
2030  return pRet;
2031 }
2032 
2034 {
2035  if ( pFormat )
2036  pFormat->Add( &m_aPrev );
2037  else
2039 }
2040 
2042 {
2043  if ( pFormat )
2044  pFormat->Add( &m_aNext );
2045  else
2047 }
2048 
2049 bool SwFormatChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2050 {
2051  // here we convert always!
2052  nMemberId &= ~CONVERT_TWIPS;
2053  bool bRet = true;
2054  OUString aRet;
2055  switch ( nMemberId )
2056  {
2057  case MID_CHAIN_PREVNAME:
2058  if ( GetPrev() )
2059  aRet = GetPrev()->GetName();
2060  break;
2061  case MID_CHAIN_NEXTNAME:
2062  if ( GetNext() )
2063  aRet = GetNext()->GetName();
2064  break;
2065  default:
2066  OSL_ENSURE( false, "unknown MemberId" );
2067  bRet = false;
2068  }
2069  rVal <<= aRet;
2070  return bRet;
2071 }
2072 
2075 {
2076  nStartValue = 0;
2077  bCountLines = true;
2078 }
2079 
2081 {
2082 }
2083 
2085 {
2086  assert(SfxPoolItem::operator==(rAttr));
2087 
2088  return nStartValue == static_cast<const SwFormatLineNumber&>(rAttr).GetStartValue() &&
2089  bCountLines == static_cast<const SwFormatLineNumber&>(rAttr).IsCount();
2090 }
2091 
2093 {
2094  return new SwFormatLineNumber( *this );
2095 }
2096 
2097 bool SwFormatLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2098 {
2099  // here we convert always!
2100  nMemberId &= ~CONVERT_TWIPS;
2101  bool bRet = true;
2102  switch ( nMemberId )
2103  {
2104  case MID_LINENUMBER_COUNT:
2105  rVal <<= IsCount();
2106  break;
2108  rVal <<= static_cast<sal_Int32>(GetStartValue());
2109  break;
2110  default:
2111  OSL_ENSURE( false, "unknown MemberId" );
2112  bRet = false;
2113  }
2114  return bRet;
2115 }
2116 
2117 bool SwFormatLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2118 {
2119  // here we convert always!
2120  nMemberId &= ~CONVERT_TWIPS;
2121  bool bRet = true;
2122  switch ( nMemberId )
2123  {
2124  case MID_LINENUMBER_COUNT:
2125  SetCountLines( *o3tl::doAccess<bool>(rVal) );
2126  break;
2128  {
2129  sal_Int32 nVal = 0;
2130  if(rVal >>= nVal)
2131  SetStartValue( nVal );
2132  else
2133  bRet = false;
2134  }
2135  break;
2136  default:
2137  OSL_ENSURE( false, "unknown MemberId" );
2138  bRet = false;
2139  }
2140  return bRet;
2141 }
2142 
2144  : SfxPoolItem( RES_TEXTGRID ), m_aColor( COL_LIGHTGRAY ), m_nLines( 20 )
2145  , m_nBaseHeight( 400 ), m_nRubyHeight( 200 ), m_eGridType( GRID_NONE )
2146  , m_bRubyTextBelow( false ), m_bPrintGrid( true ), m_bDisplayGrid( true )
2147  , m_nBaseWidth(400), m_bSnapToChars( true ), m_bSquaredMode(true)
2148 {
2149 }
2150 
2152 {
2153 }
2154 
2155 bool SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const
2156 {
2157  assert(SfxPoolItem::operator==(rAttr));
2158  SwTextGridItem const& rOther(static_cast<SwTextGridItem const&>(rAttr));
2159  return m_eGridType == rOther.GetGridType()
2160  && m_nLines == rOther.GetLines()
2161  && m_nBaseHeight == rOther.GetBaseHeight()
2162  && m_nRubyHeight == rOther.GetRubyHeight()
2163  && m_bRubyTextBelow == rOther.GetRubyTextBelow()
2164  && m_bDisplayGrid == rOther.GetDisplayGrid()
2165  && m_bPrintGrid == rOther.GetPrintGrid()
2166  && m_aColor == rOther.GetColor()
2167  && m_nBaseWidth == rOther.GetBaseWidth()
2168  && m_bSnapToChars == rOther.GetSnapToChars()
2169  && m_bSquaredMode == rOther.GetSquaredMode();
2170 }
2171 
2173 {
2174  return new SwTextGridItem( *this );
2175 }
2176 
2177 bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2178 {
2179  bool bRet = true;
2180 
2181  switch( nMemberId & ~CONVERT_TWIPS )
2182  {
2183  case MID_GRID_COLOR:
2184  rVal <<= GetColor();
2185  break;
2186  case MID_GRID_LINES:
2187  rVal <<= GetLines();
2188  break;
2189  case MID_GRID_RUBY_BELOW:
2190  rVal <<= m_bRubyTextBelow;
2191  break;
2192  case MID_GRID_PRINT:
2193  rVal <<= m_bPrintGrid;
2194  break;
2195  case MID_GRID_DISPLAY:
2196  rVal <<= m_bDisplayGrid;
2197  break;
2198  case MID_GRID_BASEHEIGHT:
2199  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2200  "This value needs TWIPS-MM100 conversion" );
2201  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nBaseHeight));
2202  break;
2203  case MID_GRID_BASEWIDTH:
2204  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2205  "This value needs TWIPS-MM100 conversion" );
2206  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nBaseWidth));
2207  break;
2208  case MID_GRID_RUBYHEIGHT:
2209  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2210  "This value needs TWIPS-MM100 conversion" );
2211  rVal <<= static_cast<sal_Int32>(convertTwipToMm100(m_nRubyHeight));
2212  break;
2213  case MID_GRID_TYPE:
2214  switch( GetGridType() )
2215  {
2216  case GRID_NONE:
2217  rVal <<= text::TextGridMode::NONE;
2218  break;
2219  case GRID_LINES_ONLY:
2220  rVal <<= text::TextGridMode::LINES;
2221  break;
2222  case GRID_LINES_CHARS:
2223  rVal <<= text::TextGridMode::LINES_AND_CHARS;
2224  break;
2225  default:
2226  OSL_FAIL("unknown SwTextGrid value");
2227  bRet = false;
2228  break;
2229  }
2230  break;
2231  case MID_GRID_SNAPTOCHARS:
2232  rVal <<= m_bSnapToChars;
2233  break;
2235  rVal <<= !m_bSquaredMode;
2236  break;
2237  default:
2238  OSL_FAIL("Unknown SwTextGridItem member");
2239  bRet = false;
2240  break;
2241  }
2242 
2243  return bRet;
2244 }
2245 
2246 bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2247 {
2248  bool bRet = true;
2249  switch( nMemberId & ~CONVERT_TWIPS )
2250  {
2251  case MID_GRID_COLOR:
2252  {
2253  sal_Int32 nTmp = 0;
2254  bRet = (rVal >>= nTmp);
2255  if( bRet )
2256  SetColor( Color(nTmp) );
2257  }
2258  break;
2259  case MID_GRID_LINES:
2260  {
2261  sal_Int16 nTmp = 0;
2262  bRet = (rVal >>= nTmp);
2263  if( bRet && (nTmp >= 0) )
2264  SetLines( static_cast<sal_uInt16>(nTmp) );
2265  else
2266  bRet = false;
2267  }
2268  break;
2269  case MID_GRID_RUBY_BELOW:
2270  SetRubyTextBelow( *o3tl::doAccess<bool>(rVal) );
2271  break;
2272  case MID_GRID_PRINT:
2273  SetPrintGrid( *o3tl::doAccess<bool>(rVal) );
2274  break;
2275  case MID_GRID_DISPLAY:
2276  SetDisplayGrid( *o3tl::doAccess<bool>(rVal) );
2277  break;
2278  case MID_GRID_BASEHEIGHT:
2279  case MID_GRID_BASEWIDTH:
2280  case MID_GRID_RUBYHEIGHT:
2281  {
2282  OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
2283  "This value needs TWIPS-MM100 conversion" );
2284  sal_Int32 nTmp = 0;
2285  bRet = (rVal >>= nTmp);
2286  nTmp = convertMm100ToTwip( nTmp );
2287  if( bRet && (nTmp >= 0) && ( nTmp <= SAL_MAX_UINT16) )
2288  {
2289  // rhbz#1043551 round up to 5pt -- 0 causes divide-by-zero
2290  // in layout; 1pt ties the painting code up in knots for
2291  // minutes with bazillion lines...
2292 #define MIN_TEXTGRID_SIZE 100
2293  if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEHEIGHT )
2294  {
2295  nTmp = std::max<sal_Int32>(nTmp, MIN_TEXTGRID_SIZE);
2296  SetBaseHeight( static_cast<sal_uInt16>(nTmp) );
2297  }
2298  else if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEWIDTH )
2299  {
2300  nTmp = std::max<sal_Int32>(nTmp, MIN_TEXTGRID_SIZE);
2301  SetBaseWidth( static_cast<sal_uInt16>(nTmp) );
2302  }
2303  else
2304  SetRubyHeight( static_cast<sal_uInt16>(nTmp) );
2305  }
2306  else
2307  bRet = false;
2308  }
2309  break;
2310  case MID_GRID_TYPE:
2311  {
2312  sal_Int16 nTmp = 0;
2313  bRet = (rVal >>= nTmp);
2314  if( bRet )
2315  {
2316  switch( nTmp )
2317  {
2320  break;
2321  case text::TextGridMode::LINES:
2323  break;
2324  case text::TextGridMode::LINES_AND_CHARS:
2326  break;
2327  default:
2328  bRet = false;
2329  break;
2330  }
2331  }
2332  break;
2333  }
2334  case MID_GRID_SNAPTOCHARS:
2335  SetSnapToChars( *o3tl::doAccess<bool>(rVal) );
2336  break;
2338  {
2339  bool bStandard = *o3tl::doAccess<bool>(rVal);
2340  SetSquaredMode( !bStandard );
2341  break;
2342  }
2343  default:
2344  OSL_FAIL("Unknown SwTextGridItem member");
2345  bRet = false;
2346  }
2347 
2348  return bRet;
2349 }
2350 
2352 {
2353  if (bNew == m_bSquaredMode)
2354  {
2355  //same paper mode, not switch
2356  return;
2357  }
2358 
2359  // use default value when grid is disable
2360  if (m_eGridType == GRID_NONE)
2361  {
2362  m_bSquaredMode = bNew;
2363  Init();
2364  return;
2365  }
2366 
2367  if (m_bSquaredMode)
2368  {
2369  //switch from "squared mode" to "standard mode"
2372  m_nRubyHeight = 0;
2373  }
2374  else
2375  {
2376  //switch from "standard mode" to "squared mode"
2380  }
2382 }
2383 
2385 {
2386  if (m_bSquaredMode)
2387  {
2388  m_nLines = 20;
2389  m_nBaseHeight = 400;
2390  m_nRubyHeight = 200;
2392  m_bRubyTextBelow = false;
2393  m_bPrintGrid = true;
2394  m_bDisplayGrid = true;
2395  m_bSnapToChars = true;
2396  m_nBaseWidth = 400;
2397  }
2398  else
2399  {
2400  m_nLines = 44;
2401  m_nBaseHeight = 312;
2402  m_nRubyHeight = 0;
2404  m_bRubyTextBelow = false;
2405  m_bPrintGrid = true;
2406  m_bDisplayGrid = true;
2407  m_nBaseWidth = 210;
2408  m_bSnapToChars = true;
2409  }
2410 }
2411 
2413 {
2414  return new SwHeaderAndFooterEatSpacingItem( Which(), GetValue() );
2415 }
2416 
2417 
2419  SwAttrPool& rPool,
2420  const sal_Char* pFormatNm,
2421  SwFrameFormat *pDrvdFrame,
2422  sal_uInt16 nFormatWhich,
2423  const sal_uInt16* pWhichRange)
2424 : SwFormat(rPool, pFormatNm, (pWhichRange ? pWhichRange : aFrameFormatSetRange), pDrvdFrame, nFormatWhich),
2425  m_wXObject(),
2426  maFillAttributes(),
2427  m_ffList(nullptr),
2428  m_pOtherTextBoxFormat(nullptr)
2429 {
2430 }
2431 
2433  SwAttrPool& rPool,
2434  const OUString &rFormatNm,
2435  SwFrameFormat *pDrvdFrame,
2436  sal_uInt16 nFormatWhich,
2437  const sal_uInt16* pWhichRange)
2438 : SwFormat(rPool, rFormatNm, (pWhichRange ? pWhichRange : aFrameFormatSetRange), pDrvdFrame, nFormatWhich),
2439  m_wXObject(),
2440  maFillAttributes(),
2441  m_ffList(nullptr),
2442  m_pOtherTextBoxFormat(nullptr)
2443 {
2444 }
2445 
2447 {
2448  if( !GetDoc()->IsInDtor())
2449  {
2450  const SwFormatAnchor& rAnchor = GetAnchor();
2451  if (rAnchor.GetContentAnchor() != nullptr)
2452  {
2453  rAnchor.GetContentAnchor()->nNode.GetNode().RemoveAnchoredFly(this);
2454  }
2455  }
2456 
2457  if( nullptr != m_pOtherTextBoxFormat )
2458  {
2460  m_pOtherTextBoxFormat = nullptr;
2461  }
2462 }
2463 
2464 void SwFrameFormat::SetName( const OUString& rNewName, bool bBroadcast )
2465 {
2466  if (m_ffList != nullptr) {
2467  SwFrameFormats::iterator it = m_ffList->find( this );
2468  assert( m_ffList->end() != it );
2469  SAL_INFO_IF(m_aFormatName == rNewName, "sw.core", "SwFrmFmt not really renamed, as both names are equal");
2470 
2472  // As it's a non-unique list, rename should never fail!
2473  bool const renamed =
2474  m_ffList->m_PosIndex.modify( it,
2475  change_name( rNewName ), change_name( m_aFormatName ) );
2476  assert(renamed);
2477  (void)renamed; // unused in NDEBUG
2478  if (bBroadcast) {
2479  SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName );
2480  ModifyNotification( &aOld, &aNew );
2481  }
2482  }
2483  else
2484  SwFormat::SetName( rNewName, bBroadcast );
2485 }
2486 
2488 {
2489  if( nullptr != pFormat )
2490  {
2491  assert( (Which() == RES_DRAWFRMFMT && pFormat->Which() == RES_FLYFRMFMT)
2492  || (Which() == RES_FLYFRMFMT && pFormat->Which() == RES_DRAWFRMFMT) );
2493  assert( nullptr == m_pOtherTextBoxFormat );
2494  }
2495  else
2496  {
2497  assert( nullptr != m_pOtherTextBoxFormat );
2498  }
2499  m_pOtherTextBoxFormat = pFormat;
2500 }
2501 
2503 {
2504  return true;
2505 }
2506 
2507 void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
2508 {
2509  if (pNew)
2510  {
2511  SwFormatHeader const *pH = nullptr;
2512  SwFormatFooter const *pF = nullptr;
2513 
2514  const sal_uInt16 nWhich = pNew->Which();
2515 
2516  if( RES_ATTRSET_CHG == nWhich )
2517  {
2518  static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState(
2519  RES_HEADER, false, reinterpret_cast<const SfxPoolItem**>(&pH) );
2520  static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState(
2521  RES_FOOTER, false, reinterpret_cast<const SfxPoolItem**>(&pF) );
2522 
2523  // reset fill information
2525  {
2526  SfxItemIter aIter(*static_cast<const SwAttrSetChg*>(pNew)->GetChgSet());
2527  bool bReset(false);
2528 
2529  for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem && !bReset; pItem = aIter.NextItem())
2530  {
2531  bReset = !IsInvalidItem(pItem) && pItem->Which() >= XATTR_FILL_FIRST && pItem->Which() <= XATTR_FILL_LAST;
2532  }
2533 
2534  if(bReset)
2535  {
2536  maFillAttributes.reset();
2537  }
2538  }
2539  }
2540  else if(RES_FMT_CHG == nWhich)
2541  {
2542  // reset fill information on format change (e.g. style changed)
2544  {
2545  maFillAttributes.reset();
2546  }
2547  }
2548  else if( RES_HEADER == nWhich )
2549  pH = static_cast<const SwFormatHeader*>(pNew);
2550  else if( RES_FOOTER == nWhich )
2551  pF = static_cast<const SwFormatFooter*>(pNew);
2552 
2553  if( pH && pH->IsActive() && !pH->GetHeaderFormat() )
2554  { //If he doesn't have one, I'll add one
2555  SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::HEADER, nullptr );
2556  const_cast<SwFormatHeader *>(pH)->RegisterToFormat( *pFormat );
2557  }
2558 
2559  if( pF && pF->IsActive() && !pF->GetFooterFormat() )
2560  { //If he doesn't have one, I'll add one
2561  SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::FOOTER, nullptr );
2562  const_cast<SwFormatFooter *>(pF)->RegisterToFormat( *pFormat );
2563  }
2564  }
2565 
2566  SwFormat::Modify( pOld, pNew );
2567 
2568  if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
2569  { // invalidate cached uno object
2570  SetXObject(uno::Reference<uno::XInterface>(nullptr));
2571  }
2572 
2573  const SwPosition* oldAnchorPosition = nullptr;
2574  const SwPosition* newAnchorPosition = nullptr;
2575  if( pNew && pNew->Which() == RES_ATTRSET_CHG )
2576  {
2577  const SfxPoolItem* tmp = nullptr;
2578  static_cast< const SwAttrSetChg* >(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false, &tmp );
2579  if( tmp )
2580  {
2581  newAnchorPosition = static_cast< const SwFormatAnchor* >( tmp )->GetContentAnchor();
2582  assert(newAnchorPosition == nullptr || // style's set must not contain position!
2583  static_cast<SwAttrSetChg const*>(pNew)->GetTheChgdSet() == &m_aSet);
2584  }
2585  }
2586  if( pNew && pNew->Which() == RES_ANCHOR )
2587  newAnchorPosition = static_cast< const SwFormatAnchor* >( pNew )->GetContentAnchor();
2588  if( pOld && pOld->Which() == RES_ATTRSET_CHG )
2589  {
2590  const SfxPoolItem* tmp = nullptr;
2591  static_cast< const SwAttrSetChg* >(pOld)->GetChgSet()->GetItemState( RES_ANCHOR, false, &tmp );
2592  if( tmp )
2593  {
2594  oldAnchorPosition = static_cast< const SwFormatAnchor* >( tmp )->GetContentAnchor();
2595  assert(oldAnchorPosition == nullptr || // style's set must not contain position!
2596  static_cast<SwAttrSetChg const*>(pOld)->GetTheChgdSet() == &m_aSet);
2597  }
2598  }
2599  if( pOld && pOld->Which() == RES_ANCHOR )
2600  oldAnchorPosition = static_cast< const SwFormatAnchor* >( pOld )->GetContentAnchor();
2601  if( oldAnchorPosition != nullptr && ( newAnchorPosition == nullptr || oldAnchorPosition->nNode.GetIndex() != newAnchorPosition->nNode.GetIndex()))
2602  {
2603  oldAnchorPosition->nNode.GetNode().RemoveAnchoredFly(this);
2604  }
2605  if( newAnchorPosition != nullptr && ( oldAnchorPosition == nullptr || oldAnchorPosition->nNode.GetIndex() != newAnchorPosition->nNode.GetIndex()))
2606  {
2607  newAnchorPosition->nNode.GetNode().AddAnchoredFly(this);
2608  }
2609 }
2610 
2612 {
2613  rFormat.Add( this );
2614 }
2615 
2618 {
2619  SwIterator<SwFrame,SwFormat> aIter( *this );
2620  SwFrame * pLast = aIter.First();
2621  if( pLast )
2622  do {
2623  pLast->Cut();
2624  SwFrame::DestroyFrame(pLast);
2625  } while( nullptr != ( pLast = aIter.Next() ));
2626 }
2627 
2629 {
2630  assert(false); // unimplemented in base class
2631 }
2632 
2633 SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) const
2634 {
2635  SwRect aRet;
2636  SwFrame *pFrame = nullptr;
2637  if( dynamic_cast<const SwSectionFormat*>( this ) != nullptr )
2638  {
2639  // get the Frame using Node2Layout
2640  const SwSectionNode* pSectNd = static_cast<const SwSectionFormat*>(this)->GetSectionNode();
2641  if( pSectNd )
2642  {
2643  SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 );
2644  pFrame = aTmp.NextFrame();
2645 
2646  if( pFrame && !pFrame->KnowsFormat(*this) )
2647  {
2648  // the Section doesn't have his own Frame, so if someone
2649  // needs the real size, we have to implement this by requesting
2650  // the matching Frame from the end.
2651  // PROBLEM: what happens if SectionFrames overlaps multiple
2652  // pages?
2653  if( bPrtArea )
2654  aRet = pFrame->getFramePrintArea();
2655  else
2656  {
2657  aRet = pFrame->getFrameArea();
2658  aRet.Pos().AdjustY( -1 );
2659  }
2660  pFrame = nullptr; // the rect is finished by now
2661  }
2662  }
2663  }
2664  else
2665  {
2666  const SwFrameType nFrameType = RES_FLYFRMFMT == Which() ? SwFrameType::Fly : FRM_ALL;
2667  std::pair<Point, bool> tmp;
2668  if (pPoint)
2669  {
2670  tmp.first = *pPoint;
2671  tmp.second = false;
2672  }
2673  pFrame = ::GetFrameOfModify(nullptr, *this, nFrameType, nullptr, pPoint ? &tmp : nullptr);
2674  }
2675 
2676  if( pFrame )
2677  {
2678  if( bPrtArea )
2679  aRet = pFrame->getFramePrintArea();
2680  else
2681  aRet = pFrame->getFrameArea();
2682  }
2683  return aRet;
2684 }
2685 
2687 {
2688  if( RES_FLYFRMFMT == Which() )
2689  {
2690  Point aNullPt;
2691  std::pair<Point, bool> const tmp(aNullPt, false);
2692  SwFlyFrame* pFly = static_cast<SwFlyFrame*>(::GetFrameOfModify( nullptr, *this, SwFrameType::Fly,
2693  nullptr, &tmp));
2694  return pFly ? pFly->GetVirtDrawObj() : nullptr;
2695  }
2696  return FindSdrObject();
2697 }
2698 
2699 bool SwFrameFormat::IsLowerOf( const SwFrameFormat& rFormat ) const
2700 {
2701  //Also linking from inside to outside or from outside to inside is not
2702  //allowed.
2704  if( pSFly )
2705  {
2706  SwFlyFrame *pAskFly = SwIterator<SwFlyFrame,SwFormat>(rFormat).First();
2707  if( pAskFly )
2708  return pSFly->IsLowerOf( pAskFly );
2709  }
2710 
2711  // let's try it using the node positions
2712  const SwFormatAnchor* pAnchor = &rFormat.GetAnchor();
2713  if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor())
2714  {
2715  const SwFrameFormats& rFormats = *GetDoc()->GetSpzFrameFormats();
2716  const SwNode* pFlyNd = pAnchor->GetContentAnchor()->nNode.GetNode().
2717  FindFlyStartNode();
2718  while( pFlyNd )
2719  {
2720  // then we walk up using the anchor
2721  size_t n;
2722  for( n = 0; n < rFormats.size(); ++n )
2723  {
2724  const SwFrameFormat* pFormat = rFormats[ n ];
2725  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2726  if( pIdx && pFlyNd == &pIdx->GetNode() )
2727  {
2728  if( pFormat == this )
2729  return true;
2730 
2731  pAnchor = &pFormat->GetAnchor();
2732  if ((RndStdIds::FLY_AT_PAGE == pAnchor->GetAnchorId()) ||
2733  !pAnchor->GetContentAnchor() )
2734  {
2735  return false;
2736  }
2737 
2738  pFlyNd = pAnchor->GetContentAnchor()->nNode.GetNode().
2739  FindFlyStartNode();
2740  break;
2741  }
2742  }
2743  if( n >= rFormats.size() )
2744  {
2745  OSL_ENSURE( false, "Fly section but no format found" );
2746  return false;
2747  }
2748  }
2749  }
2750  return false;
2751 }
2752 
2753 // #i31698#
2755 {
2756  return SwFrameFormat::HORI_L2R;
2757 }
2758 
2760 {
2761  // empty body, because default implementation does nothing
2762 }
2763 
2764 // #i28749#
2766 {
2767  return text::PositionLayoutDir::PositionInLayoutDirOfAnchor;
2768 }
2770 {
2771  // empty body, because default implementation does nothing
2772 }
2773 
2775 {
2776  return SwResId(STR_FRAME);
2777 }
2778 
2780 {
2781  xmlTextWriterStartElement(pWriter, BAD_CAST("SwFrameFormat"));
2782  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
2783  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
2784  xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
2785 
2786  const char* pWhich = nullptr;
2787  switch (Which())
2788  {
2789  case RES_FLYFRMFMT:
2790  pWhich = "fly frame format";
2791  break;
2792  case RES_DRAWFRMFMT:
2793  pWhich = "draw frame format";
2794  break;
2795  }
2796  if (pWhich)
2797  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("which"), BAD_CAST(pWhich));
2798 
2799  GetAttrSet().dumpAsXml(pWriter);
2800 
2801  if (const SdrObject* pSdrObject = FindSdrObject())
2802  pSdrObject->dumpAsXml(pWriter);
2803 
2804  xmlTextWriterEndElement(pWriter);
2805 }
2806 
2807 void SwFrameFormats::dumpAsXml(xmlTextWriterPtr pWriter, const char* pName) const
2808 {
2809  xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
2810  for (const SwFrameFormat *pFormat : m_PosIndex)
2811  pFormat->dumpAsXml(pWriter);
2812  xmlTextWriterEndElement(pWriter);
2813 }
2814 
2815 
2816 SwFlyFrameFormat::SwFlyFrameFormat( SwAttrPool& rPool, const OUString &rFormatNm, SwFrameFormat *pDrvdFrame )
2817  : SwFrameFormat( rPool, rFormatNm, pDrvdFrame, RES_FLYFRMFMT )
2818 {}
2819 
2821 {
2822  SwIterator<SwFlyFrame,SwFormat> aIter( *this );
2823  SwFlyFrame * pLast = aIter.First();
2824  if( pLast )
2825  do
2826  {
2827  SwFrame::DestroyFrame(pLast);
2828  } while( nullptr != ( pLast = aIter.Next() ));
2829 
2830 }
2831 
2833 {
2834  if(!m_pContact)
2835  {
2836  SwDrawModel* pDrawModel(GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel());
2837  m_pContact.reset(new SwFlyDrawContact(this, *pDrawModel));
2838  }
2839 
2840  return m_pContact.get();
2841 }
2842 
2846 {
2847  // is there a layout?
2848  if( !GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() )
2849  return;
2850 
2851  SwModify *pModify = nullptr;
2852  // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
2853  SwFormatAnchor aAnchorAttr( GetAnchor() );
2854  switch( aAnchorAttr.GetAnchorId() )
2855  {
2856  case RndStdIds::FLY_AS_CHAR:
2857  case RndStdIds::FLY_AT_PARA:
2858  case RndStdIds::FLY_AT_CHAR:
2859  if( aAnchorAttr.GetContentAnchor() )
2860  {
2861  pModify = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode();
2862  }
2863  break;
2864 
2865  case RndStdIds::FLY_AT_FLY:
2866  if( aAnchorAttr.GetContentAnchor() )
2867  {
2868  //First search in the content because this is O(1)
2869  //This can go wrong for linked frames because in this case it's
2870  //possible, that no Frame exists for this content.
2871  //In such a situation we also need to search from StartNode to
2872  //FrameFormat.
2873  SwNodeIndex aIdx( aAnchorAttr.GetContentAnchor()->nNode );
2874  SwContentNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
2875  // #i105535#
2876  if ( pCNd == nullptr )
2877  {
2878  pCNd = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode();
2879  }
2880  if ( pCNd )
2881  {
2883  {
2884  pModify = pCNd;
2885  }
2886  }
2887  // #i105535#
2888  if ( pModify == nullptr )
2889  {
2890  const SwNodeIndex &rIdx = aAnchorAttr.GetContentAnchor()->nNode;
2891  SwFrameFormats& rFormats = *GetDoc()->GetSpzFrameFormats();
2892  for( size_t i = 0; i < rFormats.size(); ++i )
2893  {
2894  SwFrameFormat* pFlyFormat = rFormats[i];
2895  if( pFlyFormat->GetContent().GetContentIdx() &&
2896  rIdx == *pFlyFormat->GetContent().GetContentIdx() )
2897  {
2898  pModify = pFlyFormat;
2899  break;
2900  }
2901  }
2902  }
2903  }
2904  break;
2905 
2906  case RndStdIds::FLY_AT_PAGE:
2907  {
2908  sal_uInt16 nPgNum = aAnchorAttr.GetPageNum();
2910  if( nPgNum == 0 && aAnchorAttr.GetContentAnchor() )
2911  {
2912  SwContentNode *pCNd = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode();
2914  for ( SwFrame* pFrame = aIter.First(); pFrame != nullptr; pFrame = aIter.Next() )
2915  {
2916  pPage = pFrame->FindPageFrame();
2917  if( pPage )
2918  {
2919  nPgNum = pPage->GetPhyPageNum();
2920  aAnchorAttr.SetPageNum( nPgNum );
2921  aAnchorAttr.SetAnchor( nullptr );
2922  SetFormatAttr( aAnchorAttr );
2923  break;
2924  }
2925  }
2926  }
2927  while ( pPage )
2928  {
2929  if ( pPage->GetPhyPageNum() == nPgNum )
2930  {
2931  // #i50432# - adjust synopsis of <PlaceFly(..)>
2932  pPage->PlaceFly( nullptr, this );
2933  break;
2934  }
2935  pPage = static_cast<SwPageFrame*>(pPage->GetNext());
2936  }
2937  }
2938  break;
2939  default:
2940  break;
2941  }
2942 
2943  if( pModify )
2944  {
2946  for( SwFrame *pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
2947  {
2948  bool bAdd = !pFrame->IsContentFrame() ||
2949  !static_cast<SwContentFrame*>(pFrame)->IsFollow();
2950 
2951  if ( RndStdIds::FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrame->IsFlyFrame() )
2952  {
2953  SwFrame* pFlyFrame = pFrame->FindFlyFrame();
2954  if ( pFlyFrame )
2955  {
2956  pFrame = pFlyFrame;
2957  }
2958  else
2959  {
2960  aAnchorAttr.SetType( RndStdIds::FLY_AT_PARA );
2961  SetFormatAttr( aAnchorAttr );
2962  MakeFrames();
2963  return;
2964  }
2965  }
2966 
2967  if (bAdd)
2968  {
2969  switch (aAnchorAttr.GetAnchorId())
2970  {
2971  case RndStdIds::FLY_AS_CHAR:
2972  case RndStdIds::FLY_AT_PARA:
2973  case RndStdIds::FLY_AT_CHAR:
2974  {
2975  assert(pFrame->IsTextFrame());
2976  bAdd = IsAnchoredObjShown(*static_cast<SwTextFrame*>(pFrame), aAnchorAttr);
2977  }
2978  break;
2979  default:
2980  break;
2981  }
2982  }
2983 
2984  if (bAdd && pFrame->GetDrawObjs())
2985  {
2986  // #i28701# - new type <SwSortedObjs>
2987  SwSortedObjs &rObjs = *pFrame->GetDrawObjs();
2988  for(SwAnchoredObject* pObj : rObjs)
2989  {
2990  // #i28701# - consider changed type of
2991  // <SwSortedObjs> entries.
2992  if( dynamic_cast<const SwFlyFrame*>( pObj) != nullptr &&
2993  (&pObj->GetFrameFormat()) == this )
2994  {
2995  bAdd = false;
2996  break;
2997  }
2998  }
2999  }
3000 
3001  if( bAdd )
3002  {
3003  SwFlyFrame *pFly = nullptr; // avoid warnings
3004  switch( aAnchorAttr.GetAnchorId() )
3005  {
3006  case RndStdIds::FLY_AT_FLY:
3007  pFly = new SwFlyLayFrame( this, pFrame, pFrame );
3008  break;
3009 
3010  case RndStdIds::FLY_AT_PARA:
3011  case RndStdIds::FLY_AT_CHAR:
3012  pFly = new SwFlyAtContentFrame( this, pFrame, pFrame );
3013  break;
3014 
3015  case RndStdIds::FLY_AS_CHAR:
3016  pFly = new SwFlyInContentFrame( this, pFrame, pFrame );
3017  break;
3018 
3019  default:
3020  assert(false && "New anchor type" );
3021  }
3022  pFrame->AppendFly( pFly );
3023  pFly->GetFormat()->SetObjTitle(GetObjTitle());
3025  SwPageFrame *pPage = pFly->FindPageFrame();
3026  if( pPage )
3027  ::RegistFlys( pPage, pFly );
3028  }
3029  }
3030  }
3031 }
3032 
3034 {
3035  std::pair<Point, bool> tmp;
3036  if (pPoint)
3037  {
3038  tmp.first = *pPoint;
3039  tmp.second = false;
3040  }
3041  return static_cast<SwFlyFrame*>(::GetFrameOfModify( nullptr, *this, SwFrameType::Fly,
3042  nullptr, &tmp));
3043 }
3044 
3046 {
3047  SwFlyFrame* pFlyFrame( GetFrame() );
3048  if ( pFlyFrame )
3049  {
3050  return dynamic_cast<SwAnchoredObject*>(pFlyFrame);
3051  }
3052  else
3053  {
3054  return nullptr;
3055  }
3056 }
3057 
3059 {
3060  bool bRet = true;
3061  switch( rInfo.Which() )
3062  {
3063  case RES_CONTENT_VISIBLE:
3064  {
3065  static_cast<SwPtrMsgPoolItem&>(rInfo).pObject = SwIterator<SwFrame,SwFormat>( *this ).First();
3066  }
3067  bRet = false;
3068  break;
3069 
3070  default:
3071  bRet = SwFrameFormat::GetInfo( rInfo );
3072  break;
3073  }
3074  return bRet;
3075 }
3076 
3077 // #i73249#
3078 void SwFlyFrameFormat::SetObjTitle( const OUString& rTitle, bool bBroadcast )
3079 {
3080  SdrObject* pMasterObject = FindSdrObject();
3081  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetObjTitle(..)> - missing <SdrObject> instance" );
3082  msTitle = rTitle;
3083  if ( !pMasterObject )
3084  {
3085  return;
3086  }
3087 
3088  if( bBroadcast )
3089  {
3090  SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() );
3091  SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle );
3092  pMasterObject->SetTitle( rTitle );
3093  ModifyNotification( &aOld, &aNew );
3094  }
3095  else
3096  {
3097  pMasterObject->SetTitle( rTitle );
3098  }
3099 }
3100 
3102 {
3103  const SdrObject* pMasterObject = FindSdrObject();
3104  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::GetObjTitle(..)> - missing <SdrObject> instance" );
3105  if ( !pMasterObject )
3106  {
3107  return msTitle;
3108  }
3109  if (!pMasterObject->GetTitle().isEmpty())
3110  return pMasterObject->GetTitle();
3111  else
3112  return msTitle;
3113 }
3114 
3115 void SwFlyFrameFormat::SetObjDescription( const OUString& rDescription, bool bBroadcast )
3116 {
3117  SdrObject* pMasterObject = FindSdrObject();
3118  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::SetDescription(..)> - missing <SdrObject> instance" );
3119  msDesc = rDescription;
3120  if ( !pMasterObject )
3121  {
3122  return;
3123  }
3124 
3125  if( bBroadcast )
3126  {
3128  SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
3129  pMasterObject->SetDescription( rDescription );
3130  ModifyNotification( &aOld, &aNew );
3131  }
3132  else
3133  {
3134  pMasterObject->SetDescription( rDescription );
3135  }
3136 }
3137 
3139 {
3140  const SdrObject* pMasterObject = FindSdrObject();
3141  OSL_ENSURE( pMasterObject, "<SwFlyFrameFormat::GetDescription(..)> - missing <SdrObject> instance" );
3142  if ( !pMasterObject )
3143  {
3144  return msDesc;
3145  }
3146  if (!pMasterObject->GetDescription().isEmpty())
3147  return pMasterObject->GetDescription();
3148  else
3149  return msDesc;
3150 }
3151 
3162 {
3164  {
3165  return getSdrAllFillAttributesHelper()->isTransparent();
3166  }
3167 
3168  // NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT)
3169  // and there is no background graphic, it "inherites" the background
3170  // from its anchor.
3171  std::shared_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
3172  if ( aBackground &&
3173  (aBackground->GetColor().GetTransparency() != 0) &&
3174  (aBackground->GetColor() != COL_TRANSPARENT)
3175  )
3176  {
3177  return true;
3178  }
3179  else
3180  {
3181  const GraphicObject *pTmpGrf = aBackground->GetGraphicObject();
3182  if ( pTmpGrf &&
3183  (pTmpGrf->GetAttr().GetTransparency() != 0)
3184  )
3185  {
3186  return true;
3187  }
3188  }
3189 
3190  return false;
3191 }
3192 
3204 {
3206  {
3207  return !getSdrAllFillAttributesHelper()->isUsed();
3208  }
3209  else
3210  {
3211  std::shared_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
3212  if ( aBackground &&
3213  (aBackground->GetColor() == COL_TRANSPARENT) &&
3214  !(aBackground->GetGraphicObject()) )
3215  {
3216  return true;
3217  }
3218  }
3219 
3220  return false;
3221 }
3222 
3224  const SwFormatAnchor& _rNewAnchorFormat,
3225  SwFlyFrame const * _pKeepThisFlyFrame )
3226  : mrFlyFrameFormat( _rFlyFrameFormat ),
3227  mbAnchorNodeChanged( false )
3228 {
3229  const RndStdIds nNewAnchorType( _rNewAnchorFormat.GetAnchorId() );
3230  if ( ((nNewAnchorType == RndStdIds::FLY_AT_PARA) ||
3231  (nNewAnchorType == RndStdIds::FLY_AT_CHAR)) &&
3232  _rNewAnchorFormat.GetContentAnchor() &&
3233  _rNewAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode() )
3234  {
3235  const SwFormatAnchor& aOldAnchorFormat( _rFlyFrameFormat.GetAnchor() );
3236  if ( aOldAnchorFormat.GetAnchorId() == nNewAnchorType &&
3237  aOldAnchorFormat.GetContentAnchor() &&
3238  aOldAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode() &&
3239  aOldAnchorFormat.GetContentAnchor()->nNode !=
3240  _rNewAnchorFormat.GetContentAnchor()->nNode )
3241  {
3242  // determine 'old' number of anchor frames
3243  sal_uInt32 nOldNumOfAnchFrame( 0 );
3245  *(aOldAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode()) );
3246  for( SwFrame* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() )
3247  {
3248  ++nOldNumOfAnchFrame;
3249  }
3250  // determine 'new' number of anchor frames
3251  sal_uInt32 nNewNumOfAnchFrame( 0 );
3253  *(_rNewAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode()) );
3254  for( SwFrame* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() )
3255  {
3256  ++nNewNumOfAnchFrame;
3257  }
3258  if ( nOldNumOfAnchFrame != nNewNumOfAnchFrame )
3259  {
3260  // delete existing fly frames except <_pKeepThisFlyFrame>
3262  SwFrame* pFrame = aIter.First();
3263  if ( pFrame )
3264  {
3265  do {
3266  if ( pFrame != _pKeepThisFlyFrame )
3267  {
3268  pFrame->Cut();
3269  SwFrame::DestroyFrame(pFrame);
3270  }
3271  } while( nullptr != ( pFrame = aIter.Next() ));
3272  }
3273  // indicate, that re-creation of fly frames necessary
3274  mbAnchorNodeChanged = true;
3275  }
3276  }
3277  }
3278 }
3279 
3281 {
3282  if ( mbAnchorNodeChanged )
3283  {
3285  }
3286 }
3287 
3288 namespace sw
3289 {
3301 }
3302 
3304 {
3306 }
3307 
3309 {
3311 }
3312 
3314 {
3316 }
3317 
3318 // #i31698#
3320 {
3321  return meLayoutDir;
3322 }
3323 
3325 {
3326  meLayoutDir = _eLayoutDir;
3327 }
3328 
3329 // #i28749#
3331 {
3332  return mnPositionLayoutDir;
3333 }
3334 void SwDrawFrameFormat::SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir )
3335 {
3336  switch ( _nPositionLayoutDir )
3337  {
3338  case text::PositionLayoutDir::PositionInHoriL2R:
3339  case text::PositionLayoutDir::PositionInLayoutDirOfAnchor:
3340  {
3341  mnPositionLayoutDir = _nPositionLayoutDir;
3342  }
3343  break;
3344  default:
3345  {
3346  OSL_FAIL( "<SwDrawFrameFormat::SetPositionLayoutDir(..)> - invalid attribute value." );
3347  }
3348  }
3349 }
3350 
3352 {
3353  OUString aResult;
3354  const SdrObject * pSdrObj = FindSdrObject();
3355 
3356  if (pSdrObj)
3357  {
3358  if (pSdrObj != m_pSdrObjectCached)
3359  {
3361  m_pSdrObjectCached = pSdrObj;
3362  }
3363 
3364  aResult = m_sSdrObjectCachedComment;
3365  }
3366  else
3367  aResult = SwResId(STR_GRAPHIC);
3368 
3369  return aResult;
3370 }
3371 
3373  const SwFlyFrame *pFly ) const
3374 {
3375  const SwFormatURL &rURL = GetURL();
3376  if( !rURL.GetMap() )
3377  return nullptr;
3378 
3379  if( !pFly )
3380  {
3381  pFly = SwIterator<SwFlyFrame,SwFormat>( *this ).First();
3382  if( !pFly )
3383  return nullptr;
3384  }
3385 
3386  //Original size for OLE and graphic is TwipSize, otherwise the size of
3387  //FrameFormat of the Fly.
3388  const SwFrame *pRef;
3389  const SwNoTextNode *pNd = nullptr;
3390  Size aOrigSz;
3391  if( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
3392  {
3393  pRef = pFly->Lower();
3394  pNd = static_cast<const SwNoTextFrame*>(pRef)->GetNode()->GetNoTextNode();
3395  aOrigSz = pNd->GetTwipSize();
3396  }
3397  else
3398  {
3399  pRef = pFly;
3400  aOrigSz = pFly->GetFormat()->GetFrameSize().GetSize();
3401  }
3402 
3403  if( aOrigSz.Width() != 0 && aOrigSz.Height() != 0 )
3404  {
3405  Point aPos( rPoint );
3406  Size aActSz ( pRef == pFly ? pFly->getFrameArea().SSize() : pRef->getFramePrintArea().SSize() );
3407  const MapMode aSrc ( MapUnit::MapTwip );
3408  const MapMode aDest( MapUnit::Map100thMM );
3409  aOrigSz = OutputDevice::LogicToLogic( aOrigSz, aSrc, aDest );
3410  aActSz = OutputDevice::LogicToLogic( aActSz, aSrc, aDest );
3411  aPos -= pRef->getFrameArea().Pos();
3412  aPos -= pRef->getFramePrintArea().Pos();
3413  aPos = OutputDevice::LogicToLogic( aPos, aSrc, aDest );
3414  sal_uInt32 nFlags = 0;
3415  if ( pFly != pRef && pNd->IsGrfNode() )
3416  {
3417  const MirrorGraph nMirror = pNd->GetSwAttrSet().
3418  GetMirrorGrf().GetValue();
3419  if ( MirrorGraph::Both == nMirror )
3421  else if ( MirrorGraph::Vertical == nMirror )
3422  nFlags = IMAP_MIRROR_VERT;
3423  else if ( MirrorGraph::Horizontal == nMirror )
3424  nFlags = IMAP_MIRROR_HORZ;
3425 
3426  }
3427  return const_cast<ImageMap*>(rURL.GetMap())->GetHitIMapObject( aOrigSz,
3428  aActSz, aPos, nFlags );
3429  }
3430 
3431  return nullptr;
3432 }
3433 
3435 {
3437  {
3438  // create FillAttributes on demand
3439  if(!maFillAttributes.get())
3440  {
3442  }
3443  }
3444  else
3445  {
3446  // FALLBACKBREAKHERE assert wrong usage
3447  OSL_ENSURE(false, "getSdrAllFillAttributesHelper() call only valid for RES_FLYFRMFMT and RES_FRMFMT (!)");
3448  }
3449 
3450  return maFillAttributes;
3451 }
3452 
3453 namespace sw {
3454 
3456 {
3457  const SwFlyFrameFormat* pFlyFrameFormat = dynamic_cast<const SwFlyFrameFormat*>(&rFormat);
3458  if (!pFlyFrameFormat)
3459  return false;
3460  SwFlyFrame* pFlyFrame = pFlyFrameFormat->GetFrame();
3461  if (!pFlyFrame) // fdo#54648: "hidden" drawing object has no layout frame
3462  {
3463  return false;
3464  }
3465  SwPageFrame* pPageFrame = pFlyFrame->FindPageFrameOfAnchor();
3466  SwFrame* pHeader = pPageFrame->Lower();
3467  if (pHeader->GetType() == SwFrameType::Header)
3468  {
3469  const SwFrame* pFrame = pFlyFrame->GetAnchorFrame();
3470  while (pFrame)
3471  {
3472  if (pFrame == pHeader)
3473  return true;
3474  pFrame = pFrame->GetUpper();
3475  }
3476  }
3477  return false;
3478 }
3479 
3481 {
3482 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
3483  SwNodes const& rNodes(rDoc.GetNodes());
3484  sal_uLong const count(rNodes.Count());
3485  for (sal_uLong i = 0; i != count; ++i)
3486  {
3487  SwNode const*const pNode(rNodes[i]);
3488  std::vector<SwFrameFormat*> const*const pFlys(pNode->GetAnchoredFlys());
3489  if (pFlys)
3490  {
3491  for (const auto& rpFly : *pFlys)
3492  {
3493  SwFormatAnchor const& rAnchor((*rpFly).GetAnchor(false));
3494  assert(&rAnchor.GetContentAnchor()->nNode.GetNode() == pNode);
3495  }
3496  }
3497  }
3498  SwFrameFormats const*const pSpzFrameFormats(rDoc.GetSpzFrameFormats());
3499  if (pSpzFrameFormats)
3500  {
3501  for (auto it = pSpzFrameFormats->begin(); it != pSpzFrameFormats->end(); ++it)
3502  {
3503  SwFormatAnchor const& rAnchor((**it).GetAnchor(false));
3504  if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId())
3505  {
3506  assert(!rAnchor.GetContentAnchor()
3507  // for invalid documents that lack text:anchor-page-number
3508  // it may have an anchor before MakeFrames() is called
3510  }
3511  else
3512  {
3513  SwNode & rNode(rAnchor.GetContentAnchor()->nNode.GetNode());
3514  std::vector<SwFrameFormat*> const*const pFlys(rNode.GetAnchoredFlys());
3515  assert(std::find(pFlys->begin(), pFlys->end(), *it) != pFlys->end());
3516  switch (rAnchor.GetAnchorId())
3517  {
3518  case RndStdIds::FLY_AT_FLY:
3519  assert(rNode.IsStartNode());
3520  break;
3521  case RndStdIds::FLY_AT_PARA:
3522  assert(rNode.IsTextNode() || rNode.IsTableNode());
3523  break;
3524  case RndStdIds::FLY_AS_CHAR:
3525  case RndStdIds::FLY_AT_CHAR:
3526  assert(rNode.IsTextNode());
3527  break;
3528  default:
3529  assert(false);
3530  break;
3531  }
3532  }
3533  }
3534  }
3535 #else
3536  (void) rDoc;
3537 #endif
3538 }
3539 
3540 } // namespace sw
3541 
3542 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SwFormatURL() override
Definition: atrfrm.cxx:1709
OUString AsRGBHexString() const
sal_uInt16 m_nWish
Desired width, borders included.
Definition: fmtclds.hxx:35
SwFormatAnchor & operator=(const SwFormatAnchor &)
Definition: atrfrm.cxx:1504
SwFormatSurround(css::text::WrapTextMode eNew=css::text::WrapTextMode_PARALLEL)
Definition: atrfrm.cxx:1164
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:216
#define MID_GRID_SNAPTOCHARS
Definition: unomid.h:129
virtual ~FindSdrObjectHint() override
Definition: atrfrm.cxx:3297
bool GetValue() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:433
SvxNumType GetNumberingType() const
long Width() const
virtual ~DrawFormatLayoutCopyHint() override
Definition: atrfrm.cxx:3293
Starts a section of nodes in the document model.
Definition: node.hxx:303
bool IsContour() const
Definition: fmtsrnd.hxx:53
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:572
const SwVirtFlyDrawObj * GetVirtDrawObj() const
Definition: fly.cxx:2725
Base class of the Writer layout elements.
Definition: frame.hxx:295
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1250
SwFrameFormats * m_ffList
Definition: frmfmt.hxx:73
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: atrfrm.cxx:634
SVX_NUM_CHARS_UPPER_LETTER_N
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:439
const size_t count(pCandidateA->getBorderLines().size())
sal_uLong GetIndex() const
Definition: node.hxx:282
#define RES_FRM_SIZE
Definition: hintids.hxx:194
#define RES_COL
Definition: hintids.hxx:214
SwFlyDrawContact * GetOrCreateContact()
Definition: atrfrm.cxx:2832
bool hasValue()
void Add(SwClient *pDepend)
Definition: calbck.cxx:217
std::unique_ptr< SwPosition > m_pContentAnchor
0 for page-bound frames.
Definition: fmtanchr.hxx:36
virtual const SwFlyFrameFormat * GetFormat() const override
Definition: fly.cxx:2814
#define RES_URL
Definition: hintids.hxx:216
#define MID_SURROUND_SURROUNDTYPE
Definition: unomid.h:29
SwTextGrid m_eGridType
Definition: tgrditem.hxx:39
#define MID_PREFIX
Definition: unomid.h:99
void SetWidthPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:96
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1384
Marks a position in the document model.
Definition: pam.hxx:35
void dumpAsXml(xmlTextWriterPtr pWriter) const
Color GetSepLineColor() const
Definition: unosett.hxx:298
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:756
#define RES_HEADER
Definition: hintids.hxx:201
bool IsGrfNode() const
Definition: node.hxx:656
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
OUString GetObjDescription() const
Definition: atrfrm.cxx:3138
sal_Int16 mnPositionLayoutDir
Definition: frmfmt.hxx:362
bool IsOrtho() const
Definition: fmtclds.hxx:121
bool bCountLines
Also count lines of paragraph.
Definition: fmtline.hxx:32
SwFlyFrameFormat & mrFlyFrameFormat
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:96
virtual SwFrameFormat * MakeLayoutFormat(RndStdIds eRequest, const SfxItemSet *pSet)=0
#define RES_ATTRSET_CHG
Definition: hintids.hxx:285
bool m_bOrtho
Only if this flag is set, the setting of GutterWidth will be accompanied by a "visual rearrangement"...
Definition: fmtclds.hxx:82
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:62
void dumpAsXml(xmlTextWriterPtr pWriter, const char *pName) const
Definition: atrfrm.cxx:2807
bool IsLowerOf(const SwLayoutFrame *pUpper) const
Definition: fly.cxx:2113
virtual const SwRootFrame * GetCurrentLayout() const =0
#define IMAP_MIRROR_HORZ
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1789
SwPageDesc * GetPageDesc() const
bool GetDisplayGrid() const
Definition: tgrditem.hxx:93
sal_Int16 m_eRelation
Definition: fmtornt.hxx:69
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:629
sal_uInt16 GetBaseWidth() const
Definition: tgrditem.hxx:97
virtual ~CheckDrawFrameFormatLayerHint() override
Definition: atrfrm.cxx:3291
#define RES_HORI_ORIENT
Definition: hintids.hxx:208
OUString msDesc
Definition: frmfmt.hxx:189
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
#define MID_FRMSIZE_SIZE_TYPE
Definition: unomid.h:76
long Height() const
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
css::style::VerticalAlignment GetSepLineVertAlign() const
Definition: unosett.hxx:300
const_iterator find(const value_type &x) const
Definition: docfmt.cxx:2077
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2049
SwNodeIndex nNode
Definition: pam.hxx:37
long GetWidth() const
virtual bool HasMetrics() const
SwFrameType GetType() const
Definition: frame.hxx:498
bool m_bRubyTextBelow
Definition: tgrditem.hxx:40
#define MID_SUFFIX
Definition: unomid.h:100
SwFrameSize m_eFrameWidthType
Definition: fmtfsize.hxx:46
virtual ~GetZOrderHint() override
Definition: atrfrm.cxx:3299
#define MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT
Definition: unomid.h:84
#define MID_FRMSIZE_REL_WIDTH
Definition: unomid.h:72
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
virtual Size GetTwipSize() const =0
SwFormatFillOrder(SwFillOrder=ATT_TOP_DOWN)
Definition: atrfrm.cxx:436
SwTwips GetPos() const
Definition: fmtornt.hxx:92
sal_uIntPtr sal_uLong
#define SAL_INFO_IF(condition, area, stream)
-""- and with own numberformat
Definition: fmtftntx.hxx:33
sal_Int16 m_eRelation
Definition: fmtornt.hxx:37
OUString m_aFormatName
Definition: format.hxx:47
const SwRect & getFramePrintArea() const
Definition: frame.hxx:176
OUString GetDescription() const
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
Definition: atrfrm.cxx:2633
#define MINLAY
Definition: swtypes.hxx:66
sal_uInt16 m_nLeft
Left border.
Definition: fmtclds.hxx:38
#define RES_CONTENT_VISIBLE
Definition: hintids.hxx:308
#define RES_SURROUND
Definition: hintids.hxx:206
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
bool IsAnchoredObjShown(SwTextFrame const &rFrame, SwFormatAnchor const &rAnchor)
Definition: frmtool.cxx:1207
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2025
#define MID_VERTORIENT_RELATION
Definition: unomid.h:35
#define MID_URL_HYPERLINKNAME
Definition: unomid.h:47
virtual OUString GetDescription() const
Definition: atrfrm.cxx:2774
ByPos & m_PosIndex
Definition: docary.hxx:210
Definition: doc.hxx:185
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:802
#define MID_PAGEDESC_PAGENUMOFFSET
Definition: unomid.h:27
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNewValue) override
Definition: atrfrm.cxx:2507
TElementType * Next()
Definition: calbck.hxx:376
void SetRubyHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:79
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1315
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:276
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1534
bool SvUnoImageMap_fillImageMap(const Reference< XInterface > &xImageMap, ImageMap &rMap)
SwFormatRowSplit(bool bSplit=true)
Definition: fmtrowsplt.hxx:32
SwAnchoredObject * GetAnchoredObj() const
Definition: atrfrm.cxx:3045
#define MIN_TEXTGRID_SIZE
sal_uInt16 sal_Char sal_Char * pDesc
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:771
sal_uInt8 m_nHeightPercent
Definition: fmtfsize.hxx:49
bool GetRubyTextBelow() const
Definition: tgrditem.hxx:85
virtual ~SwFlyFrameFormat() override
Definition: atrfrm.cxx:2820
Color m_aLineColor
Color of the separator line.
Definition: fmtclds.hxx:71
#define MID_NUM_START_AT
Definition: unomid.h:96
SwNode & GetNode() const
Definition: ndindex.hxx:118
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:738
MirrorGraph
Definition: grfatr.hxx:31
long SwTwips
Definition: swtypes.hxx:49
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:382
virtual ~SwTextGridItem() override
Definition: atrfrm.cxx:2151
void Pos(const Point &rNew)
Definition: swrect.hxx:167
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual method" of SfxPoolItem
Definition: atrfrm.cxx:1842
#define MID_SURROUND_ANCHORONLY
Definition: unomid.h:30
#define IMAP_MIRROR_VERT
Dialog to specify the properties of drop-down form field.
Definition: accframe.hxx:34
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:108
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
SwFrameSize m_eFrameHeightType
Definition: fmtfsize.hxx:45
SwColLineAdj m_eAdj
Line will be adjusted top, centered or bottom.
Definition: fmtclds.hxx:76
SwAttrSet m_aSet
Definition: format.hxx:48
void SetPrev(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2033
#define MID_PAGEDESC_PAGEDESCNAME
Definition: unomid.h:26
SwClient * Remove(SwClient *pDepend)
Definition: calbck.cxx:259
const_iterator end() const
Definition: docary.hxx:257
sal_Int8 GetSepLineHeightRelative() const
Definition: unosett.hxx:299
#define RES_REMOVE_UNO_OBJECT
Definition: hintids.hxx:304
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:534
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:72
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
#define RES_CNTNT
Definition: hintids.hxx:200
virtual ~SwDrawFrameFormat() override
Definition: atrfrm.cxx:3303
virtual ~CreatePortionHint() override
Definition: atrfrm.cxx:3296
SwHandleAnchorNodeChg(SwFlyFrameFormat &_rFlyFrameFormat, const SwFormatAnchor &_rNewAnchorFormat, SwFlyFrame const *_pKeepThisFlyFrame=nullptr)
checks, if re-creation of fly frames for an anchor node change at the given fly frame format is neces...
Definition: atrfrm.cxx:3223
void SetOutside(bool bNew)
Definition: fmtsrnd.hxx:58
virtual bool GetInfo(SfxPoolItem &) const override
Definition: calbck.cxx:206
void SetContour(bool bNew)
Definition: fmtsrnd.hxx:57
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1847
#define MID_ANCHOR_PAGENUM
Definition: unomid.h:44
const SfxPoolItem * FirstItem()
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1747
::boost::optional< sal_uInt16 > m_oNumOffset
Offset page number.
Definition: fmtpdsc.hxx:37
#define MID_COLLECT
Definition: unomid.h:94
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:738
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:557
void SetDisplayGrid(bool bNew)
Definition: tgrditem.hxx:94
void SetOrtho(bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This too re-arranges columns automatically if flag is set.
Definition: atrfrm.cxx:962
const OUString & GetName() const
Definition: pagedesc.hxx:186
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1379
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:1888
bool m_bPrintGrid
Definition: tgrditem.hxx:41
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1285
bool IsActive() const
Definition: fmthdft.hxx:89
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1731
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:189
void AddAnchoredFly(SwFrameFormat *)
Definition: node.cxx:2067
virtual bool operator==(SfxPoolItem const &other) const override
virtual ~SwFormatHeader() override
Definition: atrfrm.cxx:471
void SetTargetFrameName(const OUString &rStr)
Definition: fmturl.hxx:61
SvxBorderLineStyle
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
bool IsAutomaticWidth() const
Definition: unosett.hxx:304
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
#define MID_FRMSIZE_HEIGHT
Definition: unomid.h:75
#define RES_CHAIN
Definition: hintids.hxx:219
bool GetSnapToChars() const
Definition: tgrditem.hxx:101
wrapper class for the positioning of Writer fly frames and drawing objects
void SetRubyTextBelow(bool bNew)
Definition: tgrditem.hxx:86
Value in Var-direction gives minimum (can be exceeded but not be less).
Definition: fmtfsize.hxx:39
#define XATTR_FILL_LAST
FUNC_TYPE const nType
#define MID_FRMSIZE_SIZE
Definition: unomid.h:70
void SetBaseWidth(sal_uInt16 nNew)
Definition: tgrditem.hxx:98
const SvXMLTokenMapEntry aEmptyMap[1]
virtual ~RestoreFlyAnchorHint() override
Definition: atrfrm.cxx:3295
const SwRect & getFrameArea() const
Definition: frame.hxx:175
#define SAL_MAX_UINT16
#define XATTR_FILL_FIRST
virtual ~SwFormatFooter() override
Definition: atrfrm.cxx:516
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1290
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1666
#define MID_GRID_STANDARD_MODE
Definition: unomid.h:130
void SetOtherTextBoxFormat(SwFrameFormat *pFormat)
Definition: atrfrm.cxx:2487
SwFlyFrameFormat(const SwFlyFrameFormat &rCpy)=delete
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1067
char sal_Char
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1215
virtual sal_Int16 GetPositionLayoutDir() const override
Definition: atrfrm.cxx:3330
const OUString & GetName() const
Definition: format.hxx:111
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:577
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
at page or document end
Definition: fmtftntx.hxx:30
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
sal_Int16 m_eWidthPercentRelation
Definition: fmtfsize.hxx:48
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1142
SVX_NUM_ARABIC
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2464
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:38
bool IsAnchorOnly() const
Definition: fmtsrnd.hxx:52
std::vector< SwFrameFormat * > const * GetAnchoredFlys() const
Definition: node.hxx:288
void SetNumOffset(const ::boost::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:66
static sal_Int16 lcl_IntToRelation(const uno::Any &rVal)
Definition: atrfrm.cxx:103
#define FRM_ALL
Definition: frame.hxx:100
virtual ~CollectTextObjectsHint() override
Definition: atrfrm.cxx:3298
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:1170
sal_uLong GetStartValue() const
Definition: fmtline.hxx:56
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: atrfrm.cxx:667
OUString GetObjTitle() const
Definition: atrfrm.cxx:3101
#define MID_LINENUMBER_STARTVALUE
Definition: unomid.h:61
SwFormatFootnoteAtTextEnd(SwFootnoteEndPosEnum ePos=FTNEND_ATPGORDOCEND)
Definition: fmtftntx.hxx:87
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::uno::XInterface > const &xObject)
Definition: frmfmt.hxx:169
bool m_bSquaredMode
Definition: tgrditem.hxx:47
OUString m_sURL
SwFlyFrame * FindFlyFrame()
Definition: frame.hxx:1087
bool const m_bActive
Only for controlling (creation of content).
Definition: fmthdft.hxx:35
void SetColor(const Color &rCol)
Definition: tgrditem.hxx:70
void SetMap(const ImageMap *pM)
Pointer will be copied.
Definition: atrfrm.cxx:1742
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1051
sal_Int16 m_eOrient
Definition: fmtornt.hxx:36
sal_Int16 m_eOrient
Definition: fmtornt.hxx:68
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir) override
Definition: atrfrm.cxx:3334
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1713
SwColumns m_aColumns
Information concerning the columns.
Definition: fmtclds.hxx:78
bool HasMetrics() const override
Definition: atrfrm.cxx:188
sal_uInt16 m_nBaseWidth
Definition: tgrditem.hxx:45
bool IsBackgroundBrushInherited() const
SwFlyFrameFormat::IsBackgroundBrushInherited.
Definition: atrfrm.cxx:3203
sal_uInt32 m_nOrder
#i28701# - getting anchor positions ordered
Definition: fmtanchr.hxx:43
const OUString & GetName() const
Definition: fmturl.hxx:71
virtual void ModifyNotification(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.hxx:154
Specific frame formats (frames, DrawObjects).
Definition: docary.hxx:200
#define MID_COLUMN_SEPARATOR_LINE
Definition: unomid.h:91
#define MID_SURROUND_CONTOUR
Definition: unomid.h:31
void SetWidth(long n)
void EndListeningAll()
Definition: calbck.cxx:124
Base class for various Writer styles.
Definition: format.hxx:43
void SetHeightPercentRelation(sal_Int16 n)
Definition: fmtfsize.hxx:94
void PlaceFly(SwFlyFrame *pFly, SwFlyFrameFormat *pFormat)
Definition: flylay.cxx:1123
ContactObject for connection between frames (or their formats respectively) in SwClient and the drawo...
Definition: dcontact.hxx:175
virtual void Cut()=0
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
#define MID_FRMSIZE_WIDTH
Definition: unomid.h:74
OUString m_sTargetFrameName
Target frame for URL.
Definition: fmturl.hxx:35
#define MID_CHAIN_NEXTNAME
Definition: unomid.h:57
sal_uLong nStartValue
Starting value for the paragraph. 0 == no starting value.
Definition: fmtline.hxx:31
virtual bool IsBackgroundTransparent() const override
SwFlyFrameFormat::IsBackgroundTransparent.
Definition: atrfrm.cxx:3161
const ::boost::optional< sal_uInt16 > & GetNumOffset() const
Definition: fmtpdsc.hxx:65
#define MID_NUM_TYPE
Definition: unomid.h:98
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1862
struct _xmlTextWriter * xmlTextWriterPtr
#define RES_FILL_ORDER
Definition: hintids.hxx:193
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2177
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:2010
#define MID_ANCHOR_ANCHORTYPE
Definition: unomid.h:43
bool m_bIsServerMap
A ServerSideImageMap with the URL.
Definition: fmturl.hxx:41
Style of a layout element.
Definition: frmfmt.hxx:57
virtual void MakeFrames() override
Register DrawObjects in the arrays at layout.
Definition: atrfrm.cxx:3308
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:444
#define RES_TITLE_CHANGED
Definition: hintids.hxx:311
SwFormatAnchor(RndStdIds eRnd=RndStdIds::FLY_AT_PAGE, sal_uInt16 nPageNum=0)
Definition: atrfrm.cxx:1463
#define MID_GRID_LINES
Definition: unomid.h:121
#define MID_HORIORIENT_POSITION
Definition: unomid.h:40
#define MID_URL_CLIENTMAP
Definition: unomid.h:48
#define MID_GRID_BASEHEIGHT
Definition: unomid.h:122
#define RES_ANCHOR
Definition: hintids.hxx:209
SwTwips m_nYPos
Contains always the current RelPos.
Definition: fmtornt.hxx:35
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1544
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:204
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
SwFormatFrameSize(SwFrameSize eSize=ATT_VAR_SIZE, SwTwips nWidth=0, SwTwips nHeight=0)
Definition: atrfrm.cxx:196
#define MID_URL_URL
Definition: unomid.h:50
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir) override
Definition: atrfrm.cxx:3324
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
#define MID_FRMSIZE_WIDTH_TYPE
Definition: unomid.h:86
SwFrameType
Definition: frame.hxx:72
void SetValue(css::text::WrapTextMode nTheValue)
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: format.cxx:762
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const
Definition: atrfrm.cxx:2754
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
#define MID_GRID_RUBYHEIGHT
Definition: unomid.h:123
#define MID_GRID_PRINT
Definition: unomid.h:126
const GraphicAttr & GetAttr() const
virtual ~SwFormatPageDesc() override
Definition: atrfrm.cxx:614
virtual bool GetInfo(SfxPoolItem &rInfo) const override
Definition: atrfrm.cxx:3058
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
void ParkCursor(const SwNodeIndex &rIdx)
Remove selections and additional cursors of all shells.
Definition: crsrsh.cxx:2754
#define RES_VERT_ORIENT
Definition: hintids.hxx:207
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
#define MID_VERTORIENT_POSITION
Definition: unomid.h:36
const SwFrame * Lower() const
Definition: layfrm.hxx:100
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:896
TElementType * First()
Definition: calbck.hxx:345
int i
bool const m_bActive
Definition: fmthdft.hxx:66
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:60
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:621
SwContentNode * GetContentNode()
Definition: node.hxx:615
FlyAnchors.
Definition: fmtanchr.hxx:34
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1898
sal_uInt16 CalcColWidth(sal_uInt16 nCol, sal_uInt16 nAct) const
Calculates current width of column nCol.
Definition: atrfrm.cxx:969
const SfxPoolItem * NextItem()
void SetWidthSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:84
SwClient m_aNext
Next SwFlyFrameFormat (if existent).
Definition: fmtcnct.hxx:33
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:96
SwFrameFormat(SwAttrPool &rPool, const sal_Char *pFormatNm, SwFrameFormat *pDrvdFrame, sal_uInt16 nFormatWhich=RES_FRMFMT, const sal_uInt16 *pWhichRange=nullptr)
Definition: atrfrm.cxx:2418
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
SwTwips m_nXPos
Contains always the current RelPos.
Definition: fmtornt.hxx:67
const SwFormatURL & GetURL(bool=true) const
Definition: fmturl.hxx:78
sal_uInt16 m_nPageNumber
Page number for page-bound frames.
Definition: fmtanchr.hxx:40
SwLayoutFrame * GetUpper()
Definition: frame.hxx:656
virtual void SetName(const OUString &rNewName, bool bBroadcast=false)
Definition: format.cxx:153
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1412
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
std::shared_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:784
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1370
OUString GetTitle() const
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1520
SwFormatPageDesc(const SwPageDesc *pDesc=nullptr)
Definition: atrfrm.cxx:594
SwFrameSize GetWidthSizeType() const
Definition: fmtfsize.hxx:83
sal_Int16 m_aWidthAdjustValue
Definition: fmtclds.hxx:80
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:1184
static sal_uInt32 m_nOrderCounter
Definition: fmtanchr.hxx:44
sal_uInt16 m_nWidth
Total desired width of all columns.
Definition: fmtclds.hxx:79
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
bool KnowsPageDesc() const
Definition: atrfrm.cxx:616
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1598
void SetBaseHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:76
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:31
SwFrameSize
Definition: fmtfsize.hxx:35
Marks a node in the document model.
Definition: ndindex.hxx:31
#define RES_LINENUMBER
Definition: hintids.hxx:221
sal_uInt16 sal_Char * pName
#define MID_SURROUND_CONTOUROUTSIDE
Definition: unomid.h:32
sal_uInt16 m_nLineHeight
Percentile height of lines.
Definition: fmtclds.hxx:73
static SfxPoolItem * CreateDefault()
Definition: atrfrm.cxx:101
static void lcl_DelHFFormat(SwClient *pToRemove, SwFrameFormat *pFormat)
Definition: atrfrm.cxx:111
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
SwFrameFormat * m_pOtherTextBoxFormat
Definition: frmfmt.hxx:75
virtual OUString GetDescription() const override
Definition: atrfrm.cxx:3351
RndStdIds m_eAnchorId
Definition: fmtanchr.hxx:39
void SetURL(const OUString &rURL, bool bServerMap)
Definition: atrfrm.cxx:1736
#define MID_FRMSIZE_IS_AUTO_HEIGHT
Definition: unomid.h:77
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
SAL_DLLPRIVATE void Calc(sal_uInt16 nGutterWidth, sal_uInt16 nAct)
Definition: atrfrm.cxx:993
void SSize(const Size &rNew)
Definition: swrect.hxx:176
sal_Int32 GetSepLineWidth() const
Definition: unosett.hxx:297
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: atrfrm.cxx:2779
SwFormatVertOrient(SwTwips nY=0, sal_Int16 eVert=css::text::VertOrientation::NONE, sal_Int16 eRel=css::text::RelOrientation::PRINT_AREA)
Definition: atrfrm.cxx:1269
#define RES_DESCRIPTION_CHANGED
Definition: hintids.hxx:312
#define RES_FMT_CHG
Definition: hintids.hxx:284
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:522
A page of the document layout.
Definition: pagefrm.hxx:40
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2412
SVX_NUM_CHARS_LOWER_LETTER_N
void SetAnchorOnly(bool bNew)
Definition: fmtsrnd.hxx:56
const SwModify * GetDefinedIn() const
Query / set where attribute is anchored.
Definition: fmtpdsc.hxx:69
static sal_uInt16 nPgNum
Definition: viewport.cxx:63
void SetCountLines(bool b)
Definition: fmtline.hxx:60
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
sal_uInt16 GetLines() const
Definition: tgrditem.hxx:72
SwFlyFrameFormat * GetNext() const
Definition: fmtcnct.hxx:54
virtual bool operator==(const SfxPoolItem &) const override
Definition: atrfrm.cxx:2155
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unosett.cxx:2548
sal_uInt16 m_nBaseHeight
Definition: tgrditem.hxx:37
std::unique_ptr< ImageMap > m_pMap
ClientSide images.
Definition: fmturl.hxx:39
at end of the current text end
Definition: fmtftntx.hxx:31
IMapObject * GetIMapObject(const Point &rPoint, const SwFlyFrame *pFly=nullptr) const
Definition: atrfrm.cxx:3372
OUString m_sURL
Simple URL.
Definition: fmturl.hxx:36
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:484
sal_Int16 GetHeightPercentRelation() const
Definition: fmtfsize.hxx:89
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const override
Definition: atrfrm.cxx:3434
#define RES_FOOTER
Definition: hintids.hxx:202
sal_uInt16 const aFrameFormatSetRange[]
Definition: init.cxx:229
virtual ~DrawFrameFormatHint() override
Definition: atrfrm.cxx:3290
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
void SetHeightPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:93
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:2097
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1189
SwFormatHoriOrient(SwTwips nX=0, sal_Int16 eHori=css::text::HoriOrientation::NONE, sal_Int16 eRel=css::text::RelOrientation::PRINT_AREA, bool bPos=false)
Definition: atrfrm.cxx:1361
sal_Int16 GetAdjustValue() const
Definition: fmtclds.hxx:95
SwColumn()
Definition: atrfrm.cxx:788
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:416
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
const SdrObject * m_pSdrObjectCached
Definition: frmfmt.hxx:354
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:677
virtual ~SwFormatContent() override
Definition: atrfrm.cxx:553
SwFormatContent(const SwStartNode *pStartNode=nullptr)
Definition: atrfrm.cxx:547
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
#define MID_HORIORIENT_ORIENT
Definition: unomid.h:38
bool IsFlyFrameFormatInHeader(const SwFrameFormat &rFormat)
Definition: atrfrm.cxx:3455
virtual void DelFrames() override
DrawObjects are removed from the arrays at the layout.
Definition: atrfrm.cxx:3313
SwClient m_aPrev
Previous SwFlyFrameFormat (if existent).
Definition: fmtcnct.hxx:33
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1921
#define MID_FRMSIZE_REL_HEIGHT_RELATION
Definition: unomid.h:88
virtual void MakeFrames() override
Creates the views.
Definition: atrfrm.cxx:2845
bool IsPosToggle() const
Definition: fmtornt.hxx:95
SwFillOrder
Definition: fmtfordr.hxx:26
virtual ~WW8AnchorConvHint() override
Definition: atrfrm.cxx:3294
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2117
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:2246
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1350
virtual ~GetObjectConnectedHint() override
Definition: atrfrm.cxx:3300
#define MID_ANCHOR_ANCHORFRAME
Definition: unomid.h:45
#define MID_CHAIN_PREVNAME
Definition: unomid.h:56
#define MID_GRID_DISPLAY
Definition: unomid.h:127
#define RES_TEXTGRID
Definition: hintids.hxx:220
sal_uInt16 CalcPrtColWidth(sal_uInt16 nCol, sal_uInt16 nAct) const
As above except that it.
Definition: atrfrm.cxx:983
sal_uLong m_nLineWidth
Width of the separator line.
Definition: fmtclds.hxx:70
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
sal_uInt16 GetRight() const
Definition: fmtclds.hxx:52
OUString msTitle
Definition: frmfmt.hxx:188
bool IsLowerOf(const SwFrameFormat &rFormat) const
Definition: atrfrm.cxx:2699
SwPageFrame * FindPageFrameOfAnchor()
method to determine the page frame, on which the 'anchor' of the given anchored object is...
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
#define MID_OWN_NUM
Definition: unomid.h:97
void SwitchPaperMode(bool bNew)
Definition: atrfrm.cxx:2351
~SwHandleAnchorNodeChg()
calls , if re-creation of fly frames is necessary.
Definition: atrfrm.cxx:3280
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2172
#define MID_VERTORIENT_ORIENT
Definition: unomid.h:34
unsigned char sal_uInt8
sal_Int8 GetSepLineStyle() const
Definition: unosett.hxx:302
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1852
void SetName(const OUString &rNm)
Definition: fmturl.hxx:72
#define MID_GRID_TYPE
Definition: unomid.h:124
bool m_bSnapToChars
Definition: tgrditem.hxx:46
void SetSnapToChars(bool bNew)
Definition: tgrditem.hxx:102
SwTwips GetPos() const
Definition: fmtornt.hxx:59
SwFormatHeader(bool bOn=false)
Definition: atrfrm.cxx:464
void SetWidthPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:95
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:259
const OUString & GetTargetFrameName() const
Definition: fmturl.hxx:65
#define MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH
Definition: unomid.h:85
#define MID_FRMSIZE_REL_WIDTH_RELATION
Definition: unomid.h:87
virtual sal_Int16 GetPositionLayoutDir() const
Definition: atrfrm.cxx:2765
SwFormatNoBalancedColumns(bool bFlag=false)
Definition: fmtclbl.hxx:31
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:697
#define MID_GRID_BASEWIDTH
Definition: unomid.h:128
const Color & GetColor() const
Definition: tgrditem.hxx:69
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:891
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:477
bool IsNoTextFrame() const
Definition: frame.hxx:1214
virtual void MakeFrames()
Creates the views.
Definition: atrfrm.cxx:2628
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNewValue) override
Definition: format.cxx:246
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:527
virtual sal_uInt16 GetValueCount() const override
Definition: atrfrm.cxx:1872
void RemoveAnchoredFly(SwFrameFormat *)
Definition: node.cxx:2080
SwHeaderAndFooterEatSpacingItem(sal_uInt16 nId=RES_HEADER_FOOTER_EAT_SPACING, bool bPrt=false)
std::unique_ptr< SwNodeIndex > m_pStartNode
Definition: fmtcntnt.hxx:33
SwFormatEditInReadonly(sal_uInt16 nId=RES_EDIT_IN_READONLY, bool bPrt=false)
Definition: fmteiro.hxx:32
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3110
void SetDescription(const OUString &rStr)
#define RES_NAME_CHANGED
Definition: hintids.hxx:310
void SetSize(const Size &rSize)
virtual bool operator==(const SfxPoolItem &) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:868
void SetHeight(long n)
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:2084
bool operator==(const SwColumn &) const
Definition: atrfrm.cxx:795
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:2611
sal_uInt16 m_nLines
Definition: tgrditem.hxx:36
bool GetSepLineIsOn() const
Definition: unosett.hxx:301
SwModify * m_pDefinedIn
Points to the object in which the attribute was set (ContentNode/Format).
Definition: fmtpdsc.hxx:38
ColumnDescriptor.
Definition: fmtclds.hxx:33
virtual bool supportsFullDrawingLayerFillAttributeSet() const override
Definition: atrfrm.cxx:2502
bool m_bDisplayGrid
Definition: tgrditem.hxx:42
SwFormatPageDesc & operator=(const SwFormatPageDesc &rCpy)
Definition: atrfrm.cxx:601
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const override
Definition: atrfrm.cxx:3319
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
Color m_aColor
Definition: tgrditem.hxx:35
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:723
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:376
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrfrm.cxx:1451
-""- and with own number sequence
Definition: fmtftntx.hxx:32
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:93
#define MID_HORIORIENT_PAGETOGGLE
Definition: unomid.h:41
#define MID_HORIORIENT_RELATION
Definition: unomid.h:39
SwFormatFootnoteEndAtTextEnd & operator=(const SwFormatFootnoteEndAtTextEnd &rAttr)
Definition: atrfrm.cxx:1877
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
#define MID_FRMSIZE_REL_HEIGHT
Definition: unomid.h:71
#define RES_OBJECTDYING
Definition: hintids.hxx:283
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
bool IsInDtor() const
Definition: doc.hxx:398
Reference< XInterface > SvUnoImageMap_createInstance()
std::unique_ptr< SwFlyDrawContact > m_pContact
Definition: frmfmt.hxx:196
ByPos::iterator iterator
Definition: docary.hxx:207
#define SAL_WARN(area, stream)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
"pure virtual methods" of SfxPoolItem
Definition: atrfrm.cxx:1857
void SetNext(SwFlyFrameFormat *pFormat)
Definition: atrfrm.cxx:2041
RndStdIds
SvxBorderLineStyle m_eLineStyle
style of the separator line
Definition: fmtclds.hxx:69
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1996
sal_uInt8 m_nWidthPercent
Definition: fmtfsize.hxx:47
void SetStartValue(sal_uLong nNew)
Definition: fmtline.hxx:59
bool GetSquaredMode() const
Definition: tgrditem.hxx:105
size_t size() const
Definition: docary.hxx:224
#define MID_URL_TARGET
Definition: unomid.h:51
virtual OUString GetComment() const override
SwFormatCol & operator=(const SwFormatCol &)
Definition: atrfrm.cxx:833
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
virtual void ScaleMetrics(long lMult, long lDiv)
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:2905
void SetObjTitle(const OUString &rTitle, bool bBroadcast=false)
Definition: atrfrm.cxx:3078
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:562
bool IsOutside() const
Definition: fmtsrnd.hxx:54
void ScaleMetrics(long lMult, long lDiv) override
Definition: atrfrm.cxx:181
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2092
#define MID_GRID_RUBY_BELOW
Definition: unomid.h:125
const SwFrame * GetAnchorFrame() const
OUString m_sName
Name of the anchor.
Definition: fmturl.hxx:37
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrfrm.cxx:1277
bool IsCount() const
Definition: fmtline.hxx:57
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
#define MID_URL_SERVERMAP
Definition: unomid.h:49
void SetPrintGrid(bool bNew)
Definition: tgrditem.hxx:90
void SetNumberingType(SvxNumType nSet)
SwFormatEndAtTextEnd(SwFootnoteEndPosEnum ePos=FTNEND_ATPGORDOCEND)
Definition: fmtftntx.hxx:97
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:2003
bool IsActive() const
Definition: fmthdft.hxx:58
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
bool IsInvalidItem(const SfxPoolItem *pItem)
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: attrdesc.cxx:297
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:947
SwFrameFormat::tLayoutDir meLayoutDir
Definition: frmfmt.hxx:360
#define RES_PAGEDESC
Definition: hintids.hxx:198
drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFillAttributes
Definition: frmfmt.hxx:70
bool m_bPosToggle
Flip position on even pages.
Definition: fmtornt.hxx:70
long GetHeight() const
virtual ~SwFormatLineNumber() override
Definition: atrfrm.cxx:2080
sal_uInt16 m_nRubyHeight
Definition: tgrditem.hxx:38
SwFlyFrameFormat * GetPrev() const
Definition: fmtcnct.hxx:53
virtual ~ContactChangedHint() override
Definition: atrfrm.cxx:3292
sal_Int16 m_eHeightPercentRelation
Definition: fmtfsize.hxx:50
virtual ~SwFormatAnchor() override
Definition: atrfrm.cxx:1482
bool IsServerMap() const
Definition: fmturl.hxx:67
void RegisterToPageDesc(SwPageDesc &)
Definition: atrfrm.cxx:662
class for collecting anchored objects
Definition: sortedobjs.hxx:48
void SetHeightSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:81
virtual ~SwFrameFormat() override
Definition: atrfrm.cxx:2446
void setWidth(long nWidth)
void SetGutterWidth(sal_uInt16 nNew, sal_uInt16 nAct)
Adjusts borders for columns in aColumns.
Definition: atrfrm.cxx:927
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:221
#define MID_GRID_COLOR
Definition: unomid.h:120
const SvEventDescription * sw_GetSupportedMacroItems()
Definition: unocoll.cxx:462
Frame is variable in Var-direction.
Definition: fmtfsize.hxx:37
void SetObjDescription(const OUString &rDescription, bool bBroadcast=false)
Definition: atrfrm.cxx:3115
void SetTitle(const OUString &rStr)
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
virtual void SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir)
Definition: atrfrm.cxx:2769
sal_Int16 GetWidthPercentRelation() const
Definition: fmtfsize.hxx:92
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:137
virtual void SetLayoutDir(const SwFrameFormat::tLayoutDir _eLayoutDir)
Definition: atrfrm.cxx:2759
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
bool GetPrintGrid() const
Definition: tgrditem.hxx:89
#define MID_RESTART_NUM
Definition: unomid.h:95
sal_uInt16 Which() const
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2686
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
Definition: swunohelper.cxx:49
SwFormatFooter(bool bOn=false)
Definition: atrfrm.cxx:509
void RegisterToFormat(SwFormat &rFormat)
Definition: atrfrm.cxx:489
void SetGridType(SwTextGrid eNew)
Definition: tgrditem.hxx:82
const Size & GetSize() const
SwFrame * GetFrameOfModify(const SwRootFrame *pLayout, SwModify const &, SwFrameType const nFrameType, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr)
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
sal_uInt8 GetTransparency() const
OUString m_sSdrObjectCachedComment
Definition: frmfmt.hxx:355
void SetLines(sal_uInt16 nNew)
Definition: tgrditem.hxx:73
sal_uInt16 m_nRight
Right border.
Definition: fmtclds.hxx:39
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1179
SwFlyFrame * GetFrame(const Point *pDocPos=nullptr) const
Definition: atrfrm.cxx:3033
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: format.cxx:760
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
virtual ~SwFormatCol() override
Definition: atrfrm.cxx:831
#define CONVERT_TWIPS
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
const OUString & GetURL() const
Definition: fmturl.hxx:66
SwFormatLayoutSplit(bool bSplit=true)
Definition: fmtlsplt.hxx:32
void CheckAnchoredFlyConsistency(SwDoc const &rDoc)
Definition: atrfrm.cxx:3480
SwFrame * GetNext()
Definition: frame.hxx:654
SwFillOrder GetValue() const
Base class of the Writer document model elements.
Definition: node.hxx:79
void setHeight(long nHeight)
#define MID_LINENUMBER_COUNT
Definition: unomid.h:60
const OUString m_sName
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo