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 <calc.hxx>
34 #include <node.hxx>
35 #include <numrule.hxx>
36 #include <paratr.hxx>
37 #include <calbck.hxx>
38 #include <svl/intitem.hxx>
39 
41 {
42  // #i71574#
44  SwFormat* pFormat,
45  const SwNumRuleItem* pNewNumRuleItem )
46  {
47  SwTextFormatColl* pTextFormatColl = dynamic_cast<SwTextFormatColl*>(pFormat);
48  if ( !pTextFormatColl )
49  {
50  OSL_FAIL( "<TextFormatCollFunc::CheckTextFormatCollFuncForDeletionOfAssignmentToOutlineStyle> - misuse of method - it's only for instances of <SwTextFormatColl>" );
51  return;
52  }
53 
54  // #i73790#
55  if ( !pTextFormatColl->StayAssignedToListLevelOfOutlineStyle() &&
56  pTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
57  {
58  if (!pNewNumRuleItem)
59  {
60  (void)pTextFormatColl->GetItemState(RES_PARATR_NUMRULE, false, reinterpret_cast<const SfxPoolItem**>(&pNewNumRuleItem));
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  }
74 
75  SwNumRule* GetNumRule( SwTextFormatColl& rTextFormatColl )
76  {
77  SwNumRule* pNumRule( nullptr );
78 
79  const SwNumRuleItem* pNumRuleItem(nullptr);
80  (void)rTextFormatColl.GetItemState(RES_PARATR_NUMRULE, false, reinterpret_cast<const SfxPoolItem**>(&pNumRuleItem));
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 
112 void SwTextFormatColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
113 {
114  if( GetDoc()->IsInDtor() )
115  {
116  SwFormatColl::Modify( pOld, pNew );
117  return;
118  }
119 
120  bool bNewParent( false ); // #i66431# - adjust type of <bNewParent>
121  const SvxULSpaceItem *pNewULSpace = nullptr, *pOldULSpace = nullptr;
122  const SvxLRSpaceItem *pNewLRSpace = nullptr, *pOldLRSpace = nullptr;
123  const SvxFontHeightItem* aFontSizeArr[3] = {nullptr,nullptr,nullptr};
124  // #i70223#
125  const bool bAssignedToListLevelOfOutlineStyle(IsAssignedToListLevelOfOutlineStyle());
126  const SwNumRuleItem* pNewNumRuleItem( nullptr );
127 
128  const SwAttrSetChg *pNewChgSet = nullptr, *pOldChgSet = nullptr;
129 
130  switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
131  {
132  case RES_ATTRSET_CHG:
133  // Only recalculate if we're not the sender!
134  pNewChgSet = static_cast<const SwAttrSetChg*>(pNew);
135  pOldChgSet = static_cast<const SwAttrSetChg*>(pOld);
136  pNewChgSet->GetChgSet()->GetItemState(
137  RES_LR_SPACE, false, reinterpret_cast<const SfxPoolItem**>(&pNewLRSpace) );
138  pNewChgSet->GetChgSet()->GetItemState(
139  RES_UL_SPACE, false, reinterpret_cast<const SfxPoolItem**>(&pNewULSpace) );
141  false, reinterpret_cast<const SfxPoolItem**>(&(aFontSizeArr[0])) );
143  false, reinterpret_cast<const SfxPoolItem**>(&(aFontSizeArr[1])) );
145  false, reinterpret_cast<const SfxPoolItem**>(&(aFontSizeArr[2])) );
146  // #i70223#, #i84745#
147  // check, if attribute set is applied to this paragraph style
148  if ( bAssignedToListLevelOfOutlineStyle &&
149  pNewChgSet->GetTheChgdSet() == &GetAttrSet() )
150  {
151  pNewChgSet->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, false,
152  reinterpret_cast<const SfxPoolItem**>(&pNewNumRuleItem) );
153  }
154 
155  break;
156 
157  case RES_FMT_CHG:
158  if( GetAttrSet().GetParent() )
159  {
160  const SfxItemSet* pParent = GetAttrSet().GetParent();
161  pNewLRSpace = &pParent->Get( RES_LR_SPACE );
162  pNewULSpace = &pParent->Get( RES_UL_SPACE );
163  aFontSizeArr[0] = &pParent->Get( RES_CHRATR_FONTSIZE );
164  aFontSizeArr[1] = &pParent->Get( RES_CHRATR_CJK_FONTSIZE );
165  aFontSizeArr[2] = &pParent->Get( RES_CHRATR_CTL_FONTSIZE );
166  // #i66431# - modify has to be propagated, because of new parent format.
167  bNewParent = true;
168  }
169  break;
170 
171  case RES_LR_SPACE:
172  pNewLRSpace = static_cast<const SvxLRSpaceItem*>(pNew);
173  break;
174  case RES_UL_SPACE:
175  pNewULSpace = static_cast<const SvxULSpaceItem*>(pNew);
176  break;
177  case RES_CHRATR_FONTSIZE:
178  aFontSizeArr[0] = static_cast<const SvxFontHeightItem*>(pNew);
179  break;
181  aFontSizeArr[1] = static_cast<const SvxFontHeightItem*>(pNew);
182  break;
184  aFontSizeArr[2] = static_cast<const SvxFontHeightItem*>(pNew);
185  break;
186  // #i70223#
187  case RES_PARATR_NUMRULE:
188  if (bAssignedToListLevelOfOutlineStyle)
189  {
190  pNewNumRuleItem = static_cast<const SwNumRuleItem*>(pNew);
191  }
192  break;
193  default:
194  break;
195  }
196 
197  // #i70223#
198  if ( bAssignedToListLevelOfOutlineStyle && pNewNumRuleItem )
199  {
201  this, pNewNumRuleItem );
202  }
203 
204  bool bContinue = true;
205 
206  // Check against the own attributes
207  if( pNewLRSpace && SfxItemState::SET == GetItemState( RES_LR_SPACE, false,
208  reinterpret_cast<const SfxPoolItem**>(&pOldLRSpace) ))
209  {
210  if( pOldLRSpace != pNewLRSpace ) // Avoid recursion (SetAttr!)
211  {
212  bool bChg = false;
213  SvxLRSpaceItem aNew( *pOldLRSpace );
214  // We had a relative value -> recalculate
215  if( 100 != aNew.GetPropLeft() )
216  {
217  long nTmp = aNew.GetLeft(); // keep so that we can compare
218  aNew.SetLeft( pNewLRSpace->GetLeft(), aNew.GetPropLeft() );
219  bChg |= nTmp != aNew.GetLeft();
220  }
221  // We had a relative value -> recalculate
222  if( 100 != aNew.GetPropRight() )
223  {
224  long nTmp = aNew.GetRight(); // keep so that we can compare
225  aNew.SetRight( pNewLRSpace->GetRight(), aNew.GetPropRight() );
226  bChg |= nTmp != aNew.GetRight();
227  }
228  // We had a relative value -> recalculate
229  if( 100 != aNew.GetPropTextFirstLineOfst() )
230  {
231  short nTmp = aNew.GetTextFirstLineOfst(); // keep so that we can compare
232  aNew.SetTextFirstLineOfst( pNewLRSpace->GetTextFirstLineOfst(),
233  aNew.GetPropTextFirstLineOfst() );
234  bChg |= nTmp != aNew.GetTextFirstLineOfst();
235  }
236  if( bChg )
237  {
238  SetFormatAttr( aNew );
239  bContinue = nullptr != pOldChgSet || bNewParent;
240  }
241  // We set it to absolute -> do not propagate it further, unless
242  // we set it!
243  else if( pNewChgSet )
244  bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
245  }
246  }
247 
248  if( pNewULSpace && SfxItemState::SET == GetItemState(
249  RES_UL_SPACE, false, reinterpret_cast<const SfxPoolItem**>(&pOldULSpace) ) &&
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::Modify( pOld, pNew );
317 }
318 
320 {
322  const SwNodes& rNds = GetDoc()->GetNodes();
323  for( SwContentNode* pNode = aIter.First(); pNode; pNode = aIter.Next() )
324  if( &(pNode->GetNodes()) == &rNds )
325  return true;
326 
327  return false;
328 }
329 
331 {
332  const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE;
333  if ( bIsNumRuleItem )
334  {
336  }
337 
338  const bool bRet = SwFormatColl::SetFormatAttr( rAttr );
339 
340  if ( bIsNumRuleItem )
341  {
343  }
344 
345  return bRet;
346 }
347 
349 {
350  const bool bIsNumRuleItemAffected =
351  rSet.GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET;
352  if ( bIsNumRuleItemAffected )
353  {
355  }
356 
357  const bool bRet = SwFormatColl::SetFormatAttr( rSet );
358 
359  if ( bIsNumRuleItemAffected )
360  {
362  }
363 
364  return bRet;
365 }
366 
367 bool SwTextFormatColl::ResetFormatAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
368 {
369  const bool bIsNumRuleItemAffected =
370  ( nWhich2 != 0 && nWhich2 > nWhich1 )
371  ? ( nWhich1 <= RES_PARATR_NUMRULE &&
372  RES_PARATR_NUMRULE <= nWhich2 )
373  : nWhich1 == RES_PARATR_NUMRULE;
374  if ( bIsNumRuleItemAffected )
375  {
377  }
378 
379  const bool bRet = SwFormatColl::ResetFormatAttr( nWhich1, nWhich2 );
380 
381  return bRet;
382 }
383 
384 // #i73790#
386 {
387  const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
389  // #i70748#
390  // Outline level is no longer a member, it is a attribute now.
391  // Thus, it needs to be restored, if the paragraph style is assigned
392  // to the outline style
393  const int nAssignedOutlineStyleLevel = IsAssignedToListLevelOfOutlineStyle()
395  : -1;
396 
397  sal_uInt16 nRet = SwFormatColl::ResetAllFormatAttr();
398 
399  // #i70748#
400  if ( nAssignedOutlineStyleLevel != -1 )
401  {
402  AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
403  }
404 
406 
407  return nRet;
408 }
409 
411 {
412  bool bAreListLevelIndentsApplicable( true );
413 
414  if ( GetItemState( RES_PARATR_NUMRULE ) != SfxItemState::SET )
415  {
416  // no list style applied to paragraph style
417  bAreListLevelIndentsApplicable = false;
418  }
419  else if ( GetItemState( RES_LR_SPACE, false ) == SfxItemState::SET )
420  {
421  // paragraph style has hard-set indent attributes
422  bAreListLevelIndentsApplicable = false;
423  }
424  else if ( GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET )
425  {
426  // list style is directly applied to paragraph style and paragraph
427  // style has no hard-set indent attributes
428  bAreListLevelIndentsApplicable = true;
429  }
430  else
431  {
432  // list style is applied through one of the parent paragraph styles and
433  // paragraph style has no hard-set indent attributes
434 
435  // check parent paragraph styles
436  const SwTextFormatColl* pColl = dynamic_cast<const SwTextFormatColl*>(DerivedFrom());
437  while ( pColl )
438  {
439  if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, false ) == SfxItemState::SET )
440  {
441  // indent attributes found in the paragraph style hierarchy.
442  bAreListLevelIndentsApplicable = false;
443  break;
444  }
445 
446  if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET )
447  {
448  // paragraph style with the list style found and until now no
449  // indent attributes are found in the paragraph style hierarchy.
450  bAreListLevelIndentsApplicable = true;
451  break;
452  }
453 
454  pColl = dynamic_cast<const SwTextFormatColl*>(pColl->DerivedFrom());
455  OSL_ENSURE( pColl,
456  "<SwTextFormatColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
457  }
458  }
459 
460  return bAreListLevelIndentsApplicable;
461 }
462 
464 {
465  xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFormatColl"));
466  xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
467  GetAttrSet().dumpAsXml(pWriter);
468  xmlTextWriterEndElement(pWriter);
469 }
470 
472 {
473  xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFormatColls"));
474  for (size_t i = 0; i < size(); ++i)
475  GetFormat(i)->dumpAsXml(pWriter);
476  xmlTextWriterEndElement(pWriter);
477 }
478 
479 //FEATURE::CONDCOLL
480 
482  sal_uLong nSubCond )
483  : SwClient( pColl ), m_nCondition( nMasterCond ),
484  m_nSubCondition( nSubCond )
485 {
486 }
487 
489  : SwClient( const_cast<SwModify*>(rCopy.GetRegisteredIn()) ),
490  m_nCondition( rCopy.m_nCondition ),
491  m_nSubCondition( rCopy.m_nSubCondition )
492 {
493 }
494 
496 {
497 }
498 
500 {
501  rFormat.Add( this );
502 }
503 
505 {
506  return ( m_nCondition == rCmp.m_nCondition )
507  && ( m_nSubCondition == rCmp.m_nSubCondition );
508 }
509 
511 {
512  m_nCondition = nCond;
513  m_nSubCondition = nSubCond;
514 }
515 
517 {
518 }
519 
521  const SwCollCondition& rCond ) const
522 {
523  for (const auto &rpFnd : m_CondColls)
524  {
525  if (*rpFnd == rCond)
526  return rpFnd.get();
527  }
528 
529  return nullptr;
530 }
531 
533 {
534  for (SwFormatCollConditions::size_type n = 0; n < m_CondColls.size(); ++n)
535  {
536  if (*m_CondColls[ n ] == rCond)
537  {
538  m_CondColls.erase( m_CondColls.begin() + n );
539  break;
540  }
541  }
542 
543  // Not found -> so insert it
544  m_CondColls.push_back( std::make_unique<SwCollCondition> (rCond) );
545 }
546 
548 {
549  for (SwFormatCollConditions::size_type n = 0; n < m_CondColls.size(); ++n)
550  {
551  if (*m_CondColls[ n ] == rCond)
552  {
553  m_CondColls.erase( m_CondColls.begin() + n );
554  }
555  }
556 }
557 
559 {
560  // Copy the Conditions, but first delete the old ones
561  m_CondColls.clear();
562  SwDoc& rDoc = *GetDoc();
563  for (const auto &rpFnd : rCndClls)
564  {
565  SwTextFormatColl *const pTmpColl = rpFnd->GetTextFormatColl()
566  ? rDoc.CopyTextColl( *rpFnd->GetTextFormatColl() )
567  : nullptr;
568  std::unique_ptr<SwCollCondition> pNew;
569  pNew.reset(new SwCollCondition( pTmpColl, rpFnd->GetCondition(),
570  rpFnd->GetSubCondition() ));
571  m_CondColls.push_back( std::move(pNew) );
572  }
573 }
574 
575 // FEATURE::CONDCOLL
577 {
578  OSL_ENSURE( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTextFormatColl: Level Out Of Range" );
580  static_cast<sal_uInt16>(nLevel) ) );
581 }
582 
584 {
585  return GetFormatAttr(RES_PARATR_OUTLINELEVEL).GetValue();
586 }
587 
589 {
591  "<SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method");
592  return GetAttrOutlineLevel() - 1;
593 }
594 
595 void SwTextFormatColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
596 {
598  SetAttrOutlineLevel(nAssignedListLevel+1);
599 
600  // #i100277#
602  SwTextFormatColl* pDerivedTextFormatColl = aIter.First();
603  while ( pDerivedTextFormatColl != nullptr )
604  {
605  if ( !pDerivedTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
606  {
607  if ( pDerivedTextFormatColl->GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::DEFAULT )
608  {
609  SwNumRuleItem aItem;
610  pDerivedTextFormatColl->SetFormatAttr( aItem );
611  }
612  if ( pDerivedTextFormatColl->GetItemState( RES_PARATR_OUTLINELEVEL, false ) == SfxItemState::DEFAULT )
613  {
614  pDerivedTextFormatColl->SetAttrOutlineLevel( 0 );
615  }
616  }
617 
618  pDerivedTextFormatColl = aIter.Next();
619  }
620 }
621 
623 {
624  mbAssignedToOutlineStyle = false;
626 }
627 
628 /* 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:997
void Add(SwClient *pDepend)
Definition: calbck.cxx:217
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:588
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:76
#define RES_ATTRSET_CHG
Definition: hintids.hxx:285
SwCollCondition(SwTextFormatColl *pColl, Master_CollCondition nMasterCond, sal_uLong nSubCond)
Definition: fmtcol.cxx:481
short GetTextFirstLineOfst() const
virtual ~SwConditionTextFormatColl() override
Definition: fmtcol.cxx:516
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:43
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:1008
TElementType * Next()
Definition: calbck.hxx:376
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:91
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:330
virtual sal_uInt16 ResetAllFormatAttr() override
Override to stay assigned to list level of outline style.
Definition: fmtcol.cxx:385
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:96
const OUString & GetName() const
Definition: format.hxx:111
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fmtcol.cxx:463
#define RES_UL_SPACE
Definition: hintids.hxx:197
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
Definition: docfmt.cxx:1188
#define RES_PARATR_NUMRULE
Definition: hintids.hxx:170
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fmtcol.cxx:471
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
virtual sal_uInt16 ResetAllFormatAttr()
Takes all hints from Delta-Array,.
Definition: format.cxx:685
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:319
struct _xmlTextWriter * xmlTextWriterPtr
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2423
void SetRight(const long nR, const sal_uInt16 nProp=100)
const SfxItemSet * GetParent() const
void InsertCondition(const SwCollCondition &rCond)
Definition: fmtcol.cxx:532
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetCondition(Master_CollCondition nCond, sal_uLong nSubCond)
Definition: fmtcol.cxx:510
TElementType * First()
Definition: calbck.hxx:345
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:520
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:398
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:622
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:284
std::vector< std::unique_ptr< SwCollCondition >> SwFormatCollConditions
Definition: fmtcol.hxx:200
void SetConditions(const SwFormatCollConditions &)
Definition: fmtcol.cxx:558
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:174
#define RES_LR_SPACE
Definition: hintids.hxx:196
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:595
virtual SwTextFormatColl * GetFormat(size_t idx) const override
Definition: docary.hxx:161
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
SwFormat * DerivedFrom() const
Definition: format.hxx:108
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:652
void RemoveFromNumRule(SwTextFormatColl &rTextFormatColl)
removes the given paragraph style from the directly set list style
Definition: fmtcol.cxx:102
sal_uInt32 GetHeight() const
void SetTextFirstLineOfst(const short nF, const sal_uInt16 nProp=100)
bool AreListLevelIndentsApplicable() const
Definition: fmtcol.cxx:410
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:246
SwNodes & GetNodes()
Definition: doc.hxx:403
bool operator==(const SwCollCondition &rCmp) const
Definition: fmtcol.cxx:504
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:379
void SetAttrOutlineLevel(int)
Definition: fmtcol.cxx:576
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:367
long GetRight() const
virtual ~SwCollCondition() override
Definition: fmtcol.cxx:495
sal_uInt16 GetPropTextFirstLineOfst() const
#define RES_PARATR_OUTLINELEVEL
Definition: hintids.hxx:177
void RemoveCondition(const SwCollCondition &rCond)
Definition: fmtcol.cxx:547
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
int GetAttrOutlineLevel() const
Definition: fmtcol.cxx:583
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:75
virtual void Modify(const SfxPoolItem *, const SfxPoolItem *) override
To get UL- / LR- / FontHeight-changes.
Definition: fmtcol.cxx:112
sal_uInt16 Which() const
void RegisterToFormat(SwFormat &)
Definition: fmtcol.cxx:499
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1013
sal_uInt16 GetUpper() const
sal_uInt16 GetPropUpper() const
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo