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  if (rHint.GetId() != SfxHintId::SwLegacyModify)
121  return;
122  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
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 
333 {
335  const SwNodes& rNds = GetDoc()->GetNodes();
336  for( SwContentNode* pNode = aIter.First(); pNode; pNode = aIter.Next() )
337  if( &(pNode->GetNodes()) == &rNds )
338  return true;
339 
340  return false;
341 }
342 
344 {
345  const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE;
346  if ( bIsNumRuleItem )
347  {
349  }
350 
351  const bool bRet = SwFormatColl::SetFormatAttr( rAttr );
352 
353  if ( bIsNumRuleItem )
354  {
356  }
357 
358  return bRet;
359 }
360 
362 {
363  const bool bIsNumRuleItemAffected =
364  rSet.GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET;
365  if ( bIsNumRuleItemAffected )
366  {
368  }
369 
370  const bool bRet = SwFormatColl::SetFormatAttr( rSet );
371 
372  if ( bIsNumRuleItemAffected )
373  {
375  }
376 
377  return bRet;
378 }
379 
380 bool SwTextFormatColl::ResetFormatAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
381 {
382  const bool bIsNumRuleItemAffected =
383  ( nWhich2 != 0 && nWhich2 > nWhich1 )
384  ? ( nWhich1 <= RES_PARATR_NUMRULE &&
385  RES_PARATR_NUMRULE <= nWhich2 )
386  : nWhich1 == RES_PARATR_NUMRULE;
387  if ( bIsNumRuleItemAffected )
388  {
390  }
391 
392  const bool bRet = SwFormatColl::ResetFormatAttr( nWhich1, nWhich2 );
393 
394  return bRet;
395 }
396 
397 // #i73790#
399 {
400  const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
402  // #i70748#
403  // Outline level is no longer a member, it is an attribute now.
404  // Thus, it needs to be restored, if the paragraph style is assigned
405  // to the outline style
406  const int nAssignedOutlineStyleLevel = IsAssignedToListLevelOfOutlineStyle()
408  : -1;
409 
410  sal_uInt16 nRet = SwFormatColl::ResetAllFormatAttr();
411 
412  // #i70748#
413  if ( nAssignedOutlineStyleLevel != -1 )
414  {
415  AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
416  }
417 
419 
420  return nRet;
421 }
422 
424 {
425  bool bAreListLevelIndentsApplicable( true );
426 
427  if ( GetItemState( RES_PARATR_NUMRULE ) != SfxItemState::SET )
428  {
429  // no list style applied to paragraph style
430  bAreListLevelIndentsApplicable = false;
431  }
432  else if ( GetItemState( RES_LR_SPACE, false ) == SfxItemState::SET )
433  {
434  // paragraph style has hard-set indent attributes
435  bAreListLevelIndentsApplicable = false;
436  }
437  else if ( GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET )
438  {
439  // list style is directly applied to paragraph style and paragraph
440  // style has no hard-set indent attributes
441  bAreListLevelIndentsApplicable = true;
442  }
443  else
444  {
445  // list style is applied through one of the parent paragraph styles and
446  // paragraph style has no hard-set indent attributes
447 
448  // check parent paragraph styles
449  const SwTextFormatColl* pColl = dynamic_cast<const SwTextFormatColl*>(DerivedFrom());
450  while ( pColl )
451  {
452  if ( pColl->GetAttrSet().GetItemState( RES_LR_SPACE, false ) == SfxItemState::SET )
453  {
454  // indent attributes found in the paragraph style hierarchy.
455  bAreListLevelIndentsApplicable = false;
456  break;
457  }
458 
459  if ( pColl->GetAttrSet().GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::SET )
460  {
461  // paragraph style with the list style found and until now no
462  // indent attributes are found in the paragraph style hierarchy.
463  bAreListLevelIndentsApplicable = true;
464  break;
465  }
466 
467  pColl = dynamic_cast<const SwTextFormatColl*>(pColl->DerivedFrom());
468  OSL_ENSURE( pColl,
469  "<SwTextFormatColl::AreListLevelIndentsApplicable()> - something wrong in paragraph style hierarchy. The applied list style is not found." );
470  }
471  }
472 
473  return bAreListLevelIndentsApplicable;
474 }
475 
477 {
478  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFormatColl"));
479  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
480  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name()));
481  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
483  {
484  (void)xmlTextWriterWriteAttribute(
485  pWriter, BAD_CAST("next"), BAD_CAST(mpNextTextFormatColl->GetName().toUtf8().getStr()));
486  }
487  if (mpLinkedCharFormat)
488  {
489  (void)xmlTextWriterWriteAttribute(
490  pWriter, BAD_CAST("linked"), BAD_CAST(mpLinkedCharFormat->GetName().toUtf8().getStr()));
491  }
492  GetAttrSet().dumpAsXml(pWriter);
493  (void)xmlTextWriterEndElement(pWriter);
494 }
495 
497 {
498  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFormatColls"));
499  for (size_t i = 0; i < size(); ++i)
500  GetFormat(i)->dumpAsXml(pWriter);
501  (void)xmlTextWriterEndElement(pWriter);
502 }
503 
504 //FEATURE::CONDCOLL
505 
507  sal_uLong nSubCond )
508  : SwClient( pColl ), m_nCondition( nMasterCond ),
509  m_nSubCondition( nSubCond )
510 {
511 }
512 
514  : SwClient( const_cast<sw::BroadcastingModify*>(static_cast<const sw::BroadcastingModify*>(rCopy.GetRegisteredIn())) ),
515  m_nCondition( rCopy.m_nCondition ),
516  m_nSubCondition( rCopy.m_nSubCondition )
517 {
518 }
519 
521 {
522 }
523 
525 {
526  rFormat.Add( this );
527 }
528 
530 {
531  return ( m_nCondition == rCmp.m_nCondition )
532  && ( m_nSubCondition == rCmp.m_nSubCondition );
533 }
534 
536 {
537  m_nCondition = nCond;
538  m_nSubCondition = nSubCond;
539 }
540 
542 {
543 }
544 
546  const SwCollCondition& rCond ) const
547 {
548  for (const auto &rpFnd : m_CondColls)
549  {
550  if (*rpFnd == rCond)
551  return rpFnd.get();
552  }
553 
554  return nullptr;
555 }
556 
558 {
559  for (SwFormatCollConditions::size_type n = 0; n < m_CondColls.size(); ++n)
560  {
561  if (*m_CondColls[ n ] == rCond)
562  {
563  m_CondColls.erase( m_CondColls.begin() + n );
564  break;
565  }
566  }
567 
568  // Not found -> so insert it
569  m_CondColls.push_back( std::make_unique<SwCollCondition> (rCond) );
570 }
571 
573 {
574  for (SwFormatCollConditions::size_type n = 0; n < m_CondColls.size(); ++n)
575  {
576  if (*m_CondColls[ n ] == rCond)
577  {
578  m_CondColls.erase( m_CondColls.begin() + n );
579  }
580  }
581 }
582 
584 {
585  // Copy the Conditions, but first delete the old ones
586  m_CondColls.clear();
587  SwDoc& rDoc = *GetDoc();
588  for (const auto &rpFnd : rCndClls)
589  {
590  SwTextFormatColl *const pTmpColl = rpFnd->GetTextFormatColl()
591  ? rDoc.CopyTextColl( *rpFnd->GetTextFormatColl() )
592  : nullptr;
593  std::unique_ptr<SwCollCondition> pNew;
594  pNew.reset(new SwCollCondition( pTmpColl, rpFnd->GetCondition(),
595  rpFnd->GetSubCondition() ));
596  m_CondColls.push_back( std::move(pNew) );
597  }
598 }
599 
600 // FEATURE::CONDCOLL
602 {
603  OSL_ENSURE( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTextFormatColl: Level Out Of Range" );
605  o3tl::narrowing<sal_uInt16>(nLevel) ) );
606 }
607 
609 {
610  return GetFormatAttr(RES_PARATR_OUTLINELEVEL).GetValue();
611 }
612 
614 {
616  "<SwTextFormatColl::GetAssignedOutlineStyleLevel()> - misuse of method");
617  return GetAttrOutlineLevel() - 1;
618 }
619 
620 void SwTextFormatColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
621 {
623  SetAttrOutlineLevel(nAssignedListLevel+1);
624 
625  // #i100277#
627  SwTextFormatColl* pDerivedTextFormatColl = aIter.First();
628  while ( pDerivedTextFormatColl != nullptr )
629  {
630  if ( !pDerivedTextFormatColl->IsAssignedToListLevelOfOutlineStyle() )
631  {
632  if ( pDerivedTextFormatColl->GetItemState( RES_PARATR_NUMRULE, false ) == SfxItemState::DEFAULT )
633  {
634  SwNumRuleItem aItem;
635  pDerivedTextFormatColl->SetFormatAttr( aItem );
636  }
637  if ( pDerivedTextFormatColl->GetItemState( RES_PARATR_OUTLINELEVEL, false ) == SfxItemState::DEFAULT )
638  {
639  pDerivedTextFormatColl->SetAttrOutlineLevel( 0 );
640  }
641  }
642 
643  pDerivedTextFormatColl = aIter.Next();
644  }
645 }
646 
648 {
649  mbAssignedToOutlineStyle = false;
651 }
652 
653 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SwAttrSet * GetChgSet() const
What has changed.
Definition: hints.hxx:299
void SetLinkedCharFormat(SwCharFormat &rLink)
Definition: fmtcol.cxx:328
void AddParagraphStyle(SwTextFormatColl &rTextFormatColl)
Definition: number.cxx:1060
void Add(SwClient *pDepend)
Definition: calbck.cxx:173
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:613
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:506
bool m_bInSwFntCache
Definition: fmtcol.hxx:69
constexpr TypedWhichId< SwFormatChg > RES_FMT_CHG(162)
SwCharFormat * mpLinkedCharFormat
Definition: fmtcol.hxx:73
virtual ~SwConditionTextFormatColl() override
Definition: fmtcol.cxx:541
void CheckTextFormatCollForDeletionOfAssignmentToOutlineStyle(SwFormat *pFormat, const SwNumRuleItem *pNewNumRuleItem)
Checks, if assignment of paragraph style to list level of outline style has to be deleted...
Definition: fmtcol.cxx:44
sal_uIntPtr sal_uLong
long Long
tools::Long GetRight() const
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
SwFormatCollConditions m_CondColls
Definition: fmtcol.hxx:242
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
sal_Int64 n
Definition: doc.hxx:188
Master_CollCondition
Conditional styles.
Definition: fmtcol.hxx:192
void RemoveParagraphStyle(SwTextFormatColl &rTextFormatColl)
Definition: number.cxx:1071
TElementType * Next()
Definition: calbck.hxx:365
sal_uInt16 GetPropTextFirstLineOffset() const
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:93
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:225
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:343
virtual sal_uInt16 ResetAllFormatAttr() override
Override to stay assigned to list level of outline style.
Definition: fmtcol.cxx:398
sal_uInt16 GetPropLower() const
SfxHintId GetId() const
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
bool mbAssignedToOutlineStyle
Definition: fmtcol.hxx:67
const OUString & GetName() const
Definition: format.hxx:115
const SwCharFormat * GetLinkedCharFormat() const
Definition: fmtcol.cxx:330
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fmtcol.cxx:476
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
Definition: docfmt.cxx:1177
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: format.cxx:227
virtual ~SwTextFormatColl()
Definition: fmtcol.cxx:113
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fmtcol.cxx:496
SwTextFormatColl * mpNextTextFormatColl
Definition: fmtcol.hxx:71
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
virtual sal_uInt16 ResetAllFormatAttr()
Takes all hints from Delta-Array,.
Definition: format.cxx:652
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:332
struct _xmlTextWriter * xmlTextWriterPtr
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2416
const SfxItemSet * GetParent() const
void InsertCondition(const SwCollCondition &rCond)
Definition: fmtcol.cxx:557
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:535
TElementType * First()
Definition: calbck.hxx:357
const OUString & GetValue() const
sal_uInt16 GetPropLeft() const
tools::Long GetLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
sal_uLong m_nSubCondition
Definition: fmtcol.hxx:210
const SwCollCondition * HasCondition(const SwCollCondition &rCond) const
Definition: fmtcol.cxx:545
short GetTextFirstLineOffset() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:388
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:647
const SwAttrSet * GetTheChgdSet() const
Where it has changed.
Definition: hints.hxx:303
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:123
Represents the style of a text portion.
Definition: charfmt.hxx:26
std::vector< std::unique_ptr< SwCollCondition >> SwFormatCollConditions
Definition: fmtcol.hxx:235
void SetConditions(const SwFormatCollConditions &)
Definition: fmtcol.cxx:583
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:209
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:620
virtual SwTextFormatColl * GetFormat(size_t idx) const override
Definition: docary.hxx:159
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
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:624
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:423
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool StayAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:139
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
To get UL- / LR- / FontHeight-changes.
Definition: fmtcol.cxx:118
SwNodes & GetNodes()
Definition: doc.hxx:409
bool operator==(const SwCollCondition &rCmp) const
Definition: fmtcol.cxx:529
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:369
void SetAttrOutlineLevel(int)
Definition: fmtcol.cxx:601
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:380
virtual ~SwCollCondition() override
Definition: fmtcol.cxx:520
bool IsInDtor() const
Definition: doc.hxx:404
void RemoveCondition(const SwCollCondition &rCond)
Definition: fmtcol.cxx:572
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
int GetAttrOutlineLevel() const
Definition: fmtcol.cxx:608
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:524
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1024
sal_uInt16 GetUpper() const
sal_uInt16 GetPropUpper() const
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo