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