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