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