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