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