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