LibreOffice Module sw (master) 1
fmtcol.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 <memory>
21#include <libxml/xmlwriter.h>
22#include <editeng/fhgtitem.hxx>
23#include <editeng/lrspitem.hxx>
24#include <editeng/ulspitem.hxx>
25#include <osl/diagnose.h>
26#include <sal/macros.h>
27#include <svl/intitem.hxx>
28#include <calbck.hxx>
29#include <doc.hxx>
30#include <fmtcol.hxx>
31#include <fmtcolfunc.hxx>
32#include <hintids.hxx>
33#include <hints.hxx>
34#include <node.hxx>
35#include <numrule.hxx>
36#include <paratr.hxx>
37#include <swfntcch.hxx>
38
40{
41 // #i71574#
43 SwFormat* pFormat,
44 const SwNumRuleItem* pNewNumRuleItem )
45 {
46 SwTextFormatColl* pTextFormatColl = dynamic_cast<SwTextFormatColl*>(pFormat);
47 if ( !pTextFormatColl )
48 {
49 OSL_FAIL( "<TextFormatCollFunc::CheckTextFormatCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTextFormatColl>" );
50 return;
51 }
52
53 // #i73790#
54 if ( pTextFormatColl->StayAssignedToListLevelOfOutlineStyle() ||
55 !pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
56 return;
57
58 if (!pNewNumRuleItem)
59 {
60 pNewNumRuleItem = pTextFormatColl->GetItemIfSet(RES_PARATR_NUMRULE, false);
61 }
62 if (pNewNumRuleItem)
63 {
64 const OUString& sNumRuleName = pNewNumRuleItem->GetValue();
65 if ( sNumRuleName.isEmpty() ||
66 sNumRuleName != pTextFormatColl->GetDoc()->GetOutlineNumRule()->GetName() )
67 {
68 // delete assignment of paragraph style to list level of outline style.
70 }
71 }
72 }
73
75 {
76 SwNumRule* pNumRule( nullptr );
77
78 const SwNumRuleItem* pNumRuleItem = rTextFormatColl.GetItemIfSet(RES_PARATR_NUMRULE, false);
79 if (pNumRuleItem)
80 {
81 const OUString& sNumRuleName = pNumRuleItem->GetValue();
82 if ( !sNumRuleName.isEmpty() )
83 {
84 pNumRule = rTextFormatColl.GetDoc()->FindNumRulePtr( sNumRuleName );
85 }
86 }
87
88 return pNumRule;
89 }
90
91 void AddToNumRule( SwTextFormatColl& rTextFormatColl )
92 {
93 SwNumRule* pNumRule = GetNumRule( rTextFormatColl );
94 if ( pNumRule )
95 {
96 pNumRule->AddParagraphStyle( rTextFormatColl );
97 }
98 }
99
100 void RemoveFromNumRule( SwTextFormatColl& rTextFormatColl )
101 {
102 SwNumRule* pNumRule = GetNumRule( rTextFormatColl );
103 if ( pNumRule )
104 {
105 pNumRule->RemoveParagraphStyle( rTextFormatColl );
106 }
107 }
108} // end of namespace TextFormatCollFunc
109
111{
113 pSwFontCache->Delete( this );
114
115 if (GetDoc()->IsInDtor())
116 {
117 return;
118 }
119
120 for (const auto& pCharFormat : *GetDoc()->GetCharFormats())
121 {
122 if (pCharFormat->GetLinkedParaFormat() == this)
123 {
124 pCharFormat->SetLinkedParaFormat(nullptr);
125 }
126 }
127}
128void SwTextFormatColl::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
129{
130 if (rHint.GetId() != SfxHintId::SwLegacyModify)
131 return;
132 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
133 if(GetDoc()->IsInDtor())
134 {
135 SwFormatColl::SwClientNotify(rModify, rHint);
136 return;
137 }
138 bool bNewParent( false ); // #i66431# - adjust type of <bNewParent>
139 const SvxULSpaceItem *pNewULSpace = nullptr, *pOldULSpace = nullptr;
140 const SvxLRSpaceItem *pNewLRSpace = nullptr, *pOldLRSpace = nullptr;
141 const SvxFontHeightItem* aFontSizeArr[3] = {nullptr,nullptr,nullptr};
142 // #i70223#
143 const bool bAssignedToListLevelOfOutlineStyle(IsAssignedToListLevelOfOutlineStyle());
144 const SwNumRuleItem* pNewNumRuleItem( nullptr );
145
146 const SwAttrSetChg *pNewChgSet = nullptr, *pOldChgSet = nullptr;
147 const auto pOld = pLegacy->m_pOld;
148 const auto pNew = pLegacy->m_pNew;
149 switch( pLegacy->GetWhich() )
150 {
151 case RES_ATTRSET_CHG:
152 // Only recalculate if we're not the sender!
153 pNewChgSet = &pNew->StaticWhichCast(RES_ATTRSET_CHG);
154 pOldChgSet = &pOld->StaticWhichCast(RES_ATTRSET_CHG);
155 pNewLRSpace = pNewChgSet->GetChgSet()->GetItemIfSet( RES_LR_SPACE, false );
156 pNewULSpace = pNewChgSet->GetChgSet()->GetItemIfSet( RES_UL_SPACE, false );
157 aFontSizeArr[0] = pNewChgSet->GetChgSet()->GetItemIfSet( RES_CHRATR_FONTSIZE, false );
158 aFontSizeArr[1] = pNewChgSet->GetChgSet()->GetItemIfSet( RES_CHRATR_CJK_FONTSIZE, false );
159 aFontSizeArr[2] = pNewChgSet->GetChgSet()->GetItemIfSet( RES_CHRATR_CTL_FONTSIZE, false );
160 // #i70223#, #i84745#
161 // check, if attribute set is applied to this paragraph style
162 if ( bAssignedToListLevelOfOutlineStyle &&
163 pNewChgSet->GetTheChgdSet() == &GetAttrSet() )
164 {
165 pNewNumRuleItem = pNewChgSet->GetChgSet()->GetItemIfSet( RES_PARATR_NUMRULE, false );
166 }
167
168 break;
169
170 case RES_FMT_CHG:
171 if( GetAttrSet().GetParent() )
172 {
173 const SfxItemSet* pParent = GetAttrSet().GetParent();
174 pNewLRSpace = &pParent->Get( RES_LR_SPACE );
175 pNewULSpace = &pParent->Get( RES_UL_SPACE );
176 aFontSizeArr[0] = &pParent->Get( RES_CHRATR_FONTSIZE );
177 aFontSizeArr[1] = &pParent->Get( RES_CHRATR_CJK_FONTSIZE );
178 aFontSizeArr[2] = &pParent->Get( RES_CHRATR_CTL_FONTSIZE );
179 // #i66431# - modify has to be propagated, because of new parent format.
180 bNewParent = true;
181 }
182 break;
183
184 case RES_LR_SPACE:
185 pNewLRSpace = &pNew->StaticWhichCast(RES_LR_SPACE);
186 break;
187 case RES_UL_SPACE:
188 pNewULSpace = &pNew->StaticWhichCast(RES_UL_SPACE);
189 break;
191 aFontSizeArr[0] = &pNew->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE);
192 break;
194 aFontSizeArr[1] = &pNew->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE);
195 break;
197 aFontSizeArr[2] = &pNew->StaticWhichCast(RES_CHRATR_CTL_FONTSIZE);
198 break;
199 // #i70223#
201 if (bAssignedToListLevelOfOutlineStyle)
202 {
203 pNewNumRuleItem = &pNew->StaticWhichCast(RES_PARATR_NUMRULE);
204 }
205 break;
206 default:
207 break;
208 }
209
210 // #i70223#
211 if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
212 {
214 this, pNewNumRuleItem );
215 }
216
217 bool bContinue = true;
218
219 // Check against the own attributes
220 if( pNewLRSpace && (pOldLRSpace = GetItemIfSet( RES_LR_SPACE, false)) )
221 {
222 if( pOldLRSpace != pNewLRSpace ) // Avoid recursion (SetAttr!)
223 {
224 bool bChg = false;
225 SvxLRSpaceItem aNew( *pOldLRSpace );
226 // We had a relative value -> recalculate
227 if( 100 != aNew.GetPropLeft() )
228 {
229 tools::Long nTmp = aNew.GetLeft(); // keep so that we can compare
230 aNew.SetLeft( pNewLRSpace->GetLeft(), aNew.GetPropLeft() );
231 bChg |= nTmp != aNew.GetLeft();
232 }
233 // We had a relative value -> recalculate
234 if( 100 != aNew.GetPropRight() )
235 {
236 tools::Long nTmp = aNew.GetRight(); // keep so that we can compare
237 aNew.SetRight( pNewLRSpace->GetRight(), aNew.GetPropRight() );
238 bChg |= nTmp != aNew.GetRight();
239 }
240 // We had a relative value -> recalculate
241 if( 100 != aNew.GetPropTextFirstLineOffset() )
242 {
243 short nTmp = aNew.GetTextFirstLineOffset(); // keep so that we can compare
246 bChg |= nTmp != aNew.GetTextFirstLineOffset();
247 }
248 if( bChg )
249 {
250 SetFormatAttr( aNew );
251 bContinue = nullptr != pOldChgSet || bNewParent;
252 }
253 // We set it to absolute -> do not propagate it further, unless
254 // we set it!
255 else if( pNewChgSet )
256 bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
257 }
258 }
259
260 if( pNewULSpace && (pOldULSpace = GetItemIfSet(RES_UL_SPACE, false)) &&
261 pOldULSpace != pNewULSpace ) // Avoid recursion (SetAttr!)
262 {
263 SvxULSpaceItem aNew( *pOldULSpace );
264 bool bChg = false;
265 // We had a relative value -> recalculate
266 if( 100 != aNew.GetPropUpper() )
267 {
268 sal_uInt16 nTmp = aNew.GetUpper(); // keep so that we can compare
269 aNew.SetUpper( pNewULSpace->GetUpper(), aNew.GetPropUpper() );
270 bChg |= nTmp != aNew.GetUpper();
271 }
272 // We had a relative value -> recalculate
273 if( 100 != aNew.GetPropLower() )
274 {
275 sal_uInt16 nTmp = aNew.GetLower(); // keep so that we can compare
276 aNew.SetLower( pNewULSpace->GetLower(), aNew.GetPropLower() );
277 bChg |= nTmp != aNew.GetLower();
278 }
279 if( bChg )
280 {
281 SetFormatAttr( aNew );
282 bContinue = nullptr != pOldChgSet || bNewParent;
283 }
284 // We set it to absolute -> do not propagate it further, unless
285 // we set it!
286 else if( pNewChgSet )
287 bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
288 }
289
290 for( int nC = 0; nC < int(SAL_N_ELEMENTS(aFontSizeArr)); ++nC )
291 {
292 const SvxFontHeightItem *pFSize = aFontSizeArr[ nC ], *pOldFSize;
293 if( pFSize && (SfxItemState::SET == GetItemState(
294 pFSize->Which(), false, reinterpret_cast<const SfxPoolItem**>(&pOldFSize) )) &&
295 // Avoid recursion (SetAttr!)
296 pFSize != pOldFSize )
297 {
298 if( 100 == pOldFSize->GetProp() &&
299 MapUnit::MapRelative == pOldFSize->GetPropUnit() )
300 {
301 // We set it to absolute -> do not propagate it further, unless
302 // we set it!
303 if( pNewChgSet )
304 bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
305 }
306 else
307 {
308 // We had a relative value -> recalculate
309 sal_uInt32 nTmp = pOldFSize->GetHeight(); // keep so that we can compare
310 SvxFontHeightItem aNew(240 , 100, pFSize->Which());
311 aNew.SetHeight( pFSize->GetHeight(), pOldFSize->GetProp(),
312 pOldFSize->GetPropUnit() );
313 if( nTmp != aNew.GetHeight() )
314 {
315 SetFormatAttr( aNew );
316 bContinue = nullptr != pOldChgSet || bNewParent;
317 }
318 // We set it to absolute -> do not propagate it further, unless
319 // we set it!
320 else if( pNewChgSet )
321 bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
322 }
323 }
324 }
325
326 if( bContinue )
327 SwFormatColl::SwClientNotify(rModify, rHint);
328}
329
331
333
335{
337 const SwNodes& rNds = GetDoc()->GetNodes();
338 for( SwContentNode* pNode = aIter.First(); pNode; pNode = aIter.Next() )
339 if( &(pNode->GetNodes()) == &rNds )
340 return true;
341
342 return false;
343}
344
346{
347 const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE;
348 if ( bIsNumRuleItem )
349 {
351 }
352
353 const bool bRet = SwFormatColl::SetFormatAttr( rAttr );
354
355 if ( bIsNumRuleItem )
356 {
358 }
359
360 return bRet;
361}
362
364{
365 const bool bIsNumRuleItemAffected =
366 rSet.GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET;
367 if ( bIsNumRuleItemAffected )
368 {
370 }
371
372 const bool bRet = SwFormatColl::SetFormatAttr( rSet );
373
374 if ( bIsNumRuleItemAffected )
375 {
377 }
378
379 return bRet;
380}
381
382bool SwTextFormatColl::ResetFormatAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
383{
384 const bool bIsNumRuleItemAffected =
385 ( nWhich2 != 0 && nWhich2 > nWhich1 )
386 ? ( nWhich1 <= RES_PARATR_NUMRULE &&
387 RES_PARATR_NUMRULE <= nWhich2 )
388 : nWhich1 == RES_PARATR_NUMRULE;
389 if ( bIsNumRuleItemAffected )
390 {
392 }
393
394 const bool bRet = SwFormatColl::ResetFormatAttr( nWhich1, nWhich2 );
395
396 return bRet;
397}
398
399// #i73790#
401{
402 const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
404 // #i70748#
405 // Outline level is no longer a member, it is an attribute now.
406 // Thus, it needs to be restored, if the paragraph style is assigned
407 // to the outline style
408 const int nAssignedOutlineStyleLevel = IsAssignedToListLevelOfOutlineStyle()
410 : -1;
411
412 sal_uInt16 nRet = SwFormatColl::ResetAllFormatAttr();
413
414 // #i70748#
415 if ( nAssignedOutlineStyleLevel != -1 )
416 {
417 AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
418 }
419
421
422 return nRet;
423}
424
426{
427 bool bAreListLevelIndentsApplicable( true );
428
429 if ( GetItemState( RES_PARATR_NUMRULE ) != SfxItemState::SET )
430 {
431 // no list style applied to paragraph style
432 bAreListLevelIndentsApplicable = false;
433 }
434 else if ( GetItemState( RES_LR_SPACE, false ) == SfxItemState::SET )
435 {
436 // paragraph style has hard-set indent attributes
437 bAreListLevelIndentsApplicable = false;
438 }
439 else if ( GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET )
440 {
441 // list style is directly applied to paragraph style and paragraph
442 // style has no hard-set indent attributes
443 bAreListLevelIndentsApplicable = true;
444 }
445 else
446 {
447 // list style is applied through one of the parent paragraph styles and
448 // paragraph style has no hard-set indent attributes
449
450 // check parent paragraph styles
451 const SwTextFormatColl* pColl = dynamic_cast<const SwTextFormatColl*>(DerivedFrom());
452 while ( pColl )
453 {
454 if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, false ) == SfxItemState::SET )
455 {
456 // indent attributes found in the paragraph style hierarchy.
457 bAreListLevelIndentsApplicable = false;
458 break;
459 }
460
461 if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET )
462 {
463 // paragraph style with the list style found and until now no
464 // indent attributes are found in the paragraph style hierarchy.
465 bAreListLevelIndentsApplicable = true;
466 break;
467 }
468
469 pColl = dynamic_cast<const SwTextFormatColl*>(pColl->DerivedFrom());
470 OSL_ENSURE( pColl,
471 "<SwTextFormatColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
472 }
473 }
474
475 return bAreListLevelIndentsApplicable;
476}
477
479{
480 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFormatColl"));
481 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
482 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name()));
483 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
485 {
486 (void)xmlTextWriterWriteAttribute(
487 pWriter, BAD_CAST("next"), BAD_CAST(mpNextTextFormatColl->GetName().toUtf8().getStr()));
488 }
490 {
491 (void)xmlTextWriterWriteAttribute(
492 pWriter, BAD_CAST("linked"), BAD_CAST(mpLinkedCharFormat->GetName().toUtf8().getStr()));
493 }
494 GetAttrSet().dumpAsXml(pWriter);
495 (void)xmlTextWriterEndElement(pWriter);
496}
497
499{
500 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFormatColls"));
501 for (size_t i = 0; i < size(); ++i)
502 GetFormat(i)->dumpAsXml(pWriter);
503 (void)xmlTextWriterEndElement(pWriter);
504}
505
506//FEATURE::CONDCOLL
507
509 sal_uInt32 nSubCond )
510 : SwClient( pColl ), m_nCondition( nMasterCond ),
511 m_nSubCondition( nSubCond )
512{
513}
514
516 : SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCopy.GetRegisteredIn())) ),
517 m_nCondition( rCopy.m_nCondition ),
518 m_nSubCondition( rCopy.m_nSubCondition )
519{
520}
521
523{
524}
525
527{
528 rFormat.Add( this );
529}
530
532{
533 return ( m_nCondition == rCmp.m_nCondition )
534 && ( m_nSubCondition == rCmp.m_nSubCondition );
535}
536
537void SwCollCondition::SetCondition( Master_CollCondition nCond, sal_uInt32 nSubCond )
538{
539 m_nCondition = nCond;
540 m_nSubCondition = nSubCond;
541}
542
544{
545}
546
548 const SwCollCondition& rCond ) const
549{
550 for (const auto &rpFnd : m_CondColls)
551 {
552 if (*rpFnd == rCond)
553 return rpFnd.get();
554 }
555
556 return nullptr;
557}
558
560{
561 for (SwFormatCollConditions::size_type n = 0; n < m_CondColls.size(); ++n)
562 {
563 if (*m_CondColls[ n ] == rCond)
564 {
565 m_CondColls.erase( m_CondColls.begin() + n );
566 break;
567 }
568 }
569
570 // Not found -> so insert it
571 m_CondColls.push_back( std::make_unique<SwCollCondition> (rCond) );
572}
573
575{
576 for (SwFormatCollConditions::size_type n = 0; n < m_CondColls.size(); ++n)
577 {
578 if (*m_CondColls[ n ] == rCond)
579 {
580 m_CondColls.erase( m_CondColls.begin() + n );
581 }
582 }
583}
584
586{
587 // Copy the Conditions, but first delete the old ones
588 m_CondColls.clear();
589 SwDoc& rDoc = *GetDoc();
590 for (const auto &rpFnd : rCndClls)
591 {
592 SwTextFormatColl *const pTmpColl = rpFnd->GetTextFormatColl()
593 ? rDoc.CopyTextColl( *rpFnd->GetTextFormatColl() )
594 : nullptr;
595 std::unique_ptr<SwCollCondition> pNew;
596 pNew.reset(new SwCollCondition( pTmpColl, rpFnd->GetCondition(),
597 rpFnd->GetSubCondition() ));
598 m_CondColls.push_back( std::move(pNew) );
599 }
600}
601
603{
604 OSL_ENSURE( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTextFormatColl: Level Out Of Range" );
606 o3tl::narrowing<sal_uInt16>(nLevel) ) );
607}
608
610{
611 return GetFormatAttr(RES_PARATR_OUTLINELEVEL).GetValue();
612}
613
615{
617 "<SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method");
618 return GetAttrOutlineLevel() - 1;
619}
620
622{
624 SetAttrOutlineLevel(nAssignedListLevel+1);
625
626 // #i100277#
628 SwTextFormatColl* pDerivedTextFormatColl = aIter.First();
629 while ( pDerivedTextFormatColl != nullptr )
630 {
631 if ( !pDerivedTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
632 {
633 if ( pDerivedTextFormatColl->GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::DEFAULT )
634 {
635 SwNumRuleItem aItem;
636 pDerivedTextFormatColl->SetFormatAttr( aItem );
637 }
638 if ( pDerivedTextFormatColl->GetItemState( RES_PARATR_OUTLINELEVEL, false ) == SfxItemState::DEFAULT )
639 {
640 pDerivedTextFormatColl->SetAttrOutlineLevel( 0 );
641 }
642 }
643
644 pDerivedTextFormatColl = aIter.Next();
645 }
646}
647
649{
652}
653
654/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
const OUString & GetValue() const
SfxHintId GetId() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
T & StaticWhichCast(TypedWhichId< T > nId)
sal_uInt16 Which() const
sal_uInt32 GetHeight() const
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
sal_uInt16 GetPropLeft() const
sal_uInt16 GetPropRight() const
short GetTextFirstLineOffset() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
tools::Long GetLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
sal_uInt16 GetPropTextFirstLineOffset() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLower() const
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
sal_uInt16 GetPropUpper() const
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:321
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:317
void Delete(const void *pOwner, sal_uInt16 nIndex)
Definition: swcache.cxx:322
Represents the style of a text portion.
Definition: charfmt.hxx:27
void RegisterToFormat(SwFormat &)
Definition: fmtcol.cxx:526
void SetCondition(Master_CollCondition nCond, sal_uInt32 nSubCond)
Definition: fmtcol.cxx:537
Master_CollCondition m_nCondition
Definition: fmtcol.hxx:211
SwCollCondition(SwTextFormatColl *pColl, Master_CollCondition nMasterCond, sal_uInt32 nSubCond)
Definition: fmtcol.cxx:508
bool operator==(const SwCollCondition &rCmp) const
Definition: fmtcol.cxx:531
virtual ~SwCollCondition() override
Definition: fmtcol.cxx:522
sal_uInt32 m_nSubCondition
Definition: fmtcol.hxx:212
SwFormatCollConditions m_CondColls
Definition: fmtcol.hxx:244
void InsertCondition(const SwCollCondition &rCond)
Definition: fmtcol.cxx:559
void RemoveCondition(const SwCollCondition &rCond)
Definition: fmtcol.cxx:574
virtual ~SwConditionTextFormatColl() override
Definition: fmtcol.cxx:543
void SetConditions(const SwFormatCollConditions &)
Definition: fmtcol.cxx:585
const SwCollCondition * HasCondition(const SwCollCondition &rCond) const
Definition: fmtcol.cxx:547
Definition: doc.hxx:195
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
Definition: docfmt.cxx:1173
bool IsInDtor() const
Definition: doc.hxx:413
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2441
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1033
SwNodes & GetNodes()
Definition: doc.hxx:418
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
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:618
const OUString & GetName() const
Definition: format.hxx:131
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:385
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
SwFormat * DerivedFrom() const
Definition: format.hxx:128
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
virtual sal_uInt16 ResetAllFormatAttr()
Takes all hints from Delta-Array,.
Definition: format.cxx:646
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
Templatized version of GetItemState() to directly return the correct type.
Definition: format.hxx:111
virtual SwTextFormatColl * GetFormat(size_t idx) const override
Definition: docary.hxx:158
TElementType * Next()
Definition: calbck.hxx:373
TElementType * First()
Definition: calbck.hxx:365
void AddParagraphStyle(SwTextFormatColl &rTextFormatColl)
Definition: number.cxx:1098
void RemoveParagraphStyle(SwTextFormatColl &rTextFormatColl)
Definition: number.cxx:1109
const OUString & GetName() const
Definition: numrule.hxx:224
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
void SetAttrOutlineLevel(int)
Definition: fmtcol.cxx:602
SwCharFormat * mpLinkedCharFormat
Definition: fmtcol.hxx:75
bool mbAssignedToOutlineStyle
Definition: fmtcol.hxx:69
bool AreListLevelIndentsApplicable() const
Definition: fmtcol.cxx:425
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:382
bool m_bInSwFntCache
Definition: fmtcol.hxx:71
bool StayAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:141
void SetLinkedCharFormat(SwCharFormat *pLink)
Definition: fmtcol.cxx:330
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:122
virtual ~SwTextFormatColl()
Definition: fmtcol.cxx:110
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fmtcol.cxx:478
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:648
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:345
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:621
SwTextFormatColl * mpNextTextFormatColl
Definition: fmtcol.hxx:73
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
To get UL- / LR- / FontHeight-changes.
Definition: fmtcol.cxx:128
virtual sal_uInt16 ResetAllFormatAttr() override
Override <ResetAllFormatAttr()> to stay assigned to list level of outline style.
Definition: fmtcol.cxx:400
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:614
bool IsAtDocNodeSet() const
Definition: fmtcol.cxx:334
const SwCharFormat * GetLinkedCharFormat() const
Definition: fmtcol.cxx:332
int GetAttrOutlineLevel() const
Definition: fmtcol.cxx:609
bool mbStayAssignedToListLevelOfOutlineStyle
Definition: fmtcol.hxx:67
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fmtcol.cxx:498
Master_CollCondition
Conditional styles.
Definition: fmtcol.hxx:195
std::vector< std::unique_ptr< SwCollCondition > > SwFormatCollConditions
Definition: fmtcol.hxx:237
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
sal_Int64 n
SvBaseLink * pLink
#define SAL_N_ELEMENTS(arr)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:74
void RemoveFromNumRule(SwTextFormatColl &rTextFormatColl)
removes the given paragraph style from the directly set list style
Definition: fmtcol.cxx:100
void CheckTextFormatCollForDeletionOfAssignmentToOutlineStyle(SwFormat *pFormat, const SwNumRuleItem *pNewNumRuleItem)
Checks, if assignment of paragraph style to list level of outline style has to be deleted,...
Definition: fmtcol.cxx:42
void AddToNumRule(SwTextFormatColl &rTextFormatColl)
adds the given paragraph style at the directly set list style
Definition: fmtcol.cxx:91
int i
Dialog to specify the properties of date form field.
long Long
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
static SfxItemSet & rSet
SwFontCache * pSwFontCache
Definition: swfntcch.cxx:33
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92