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