LibreOffice Module sw (master)  1
unosett.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 <editeng/editids.hrc>
21 #include <swtypes.hxx>
22 #include <unomid.h>
23 #include <hintids.hxx>
24 #include <strings.hrc>
25 #include <poolfmt.hxx>
26 #include <fmtcol.hxx>
27 #include <unomap.hxx>
28 #include <unosett.hxx>
29 #include <unoprnms.hxx>
30 #include <ftninfo.hxx>
31 #include <doc.hxx>
32 #include <pagedesc.hxx>
34 #include <charfmt.hxx>
35 #include <lineinfo.hxx>
36 #include <docsh.hxx>
37 #include <docary.hxx>
38 #include <docstyle.hxx>
39 #include <editeng/brushitem.hxx>
40 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
41 #include <com/sun/star/text/FootnoteNumbering.hpp>
42 #include <com/sun/star/text/HoriOrientation.hpp>
43 #include <com/sun/star/style/LineNumberPosition.hpp>
44 #include <com/sun/star/awt/FontDescriptor.hpp>
45 #include <com/sun/star/awt/XBitmap.hpp>
46 #include <com/sun/star/graphic/XGraphic.hpp>
47 #include <com/sun/star/beans/PropertyAttribute.hpp>
48 #include <o3tl/any.hxx>
49 #include <o3tl/enumarray.hxx>
50 #include <tools/UnitConversion.hxx>
51 #include <vcl/font.hxx>
52 #include <editeng/flstitem.hxx>
53 #include <vcl/metric.hxx>
54 #include <vcl/graph.hxx>
55 #include <vcl/GraphicLoader.hxx>
56 #include <sfx2/docfile.hxx>
57 #include <svtools/ctrltool.hxx>
58 #include <vcl/svapp.hxx>
59 #include <editeng/unofdesc.hxx>
60 #include <fmtornt.hxx>
61 #include <SwStyleNameMapper.hxx>
62 #include <com/sun/star/text/PositionAndSpaceMode.hpp>
63 #include <com/sun/star/text/LabelFollow.hpp>
64 #include <numrule.hxx>
66 #include <comphelper/sequence.hxx>
69 #include <svl/itemprop.hxx>
70 #include <svl/listener.hxx>
71 #include <paratr.hxx>
72 #include <sal/log.hxx>
73 
74 using namespace ::com::sun::star;
75 using namespace ::com::sun::star::uno;
76 using namespace ::com::sun::star::lang;
77 using namespace ::com::sun::star::beans;
78 using namespace ::com::sun::star::text;
79 using namespace ::com::sun::star::style;
80 
81 
82 namespace
83 {
84  SvtBroadcaster& GetPageDescNotifier(SwDoc* pDoc)
85  {
87  }
88 }
89 
90 #define WID_PREFIX 0
91 #define WID_SUFFIX 1
92 #define WID_NUMBERING_TYPE 2
93 #define WID_START_AT 3
94 #define WID_FOOTNOTE_COUNTING 4
95 #define WID_PARAGRAPH_STYLE 5
96 #define WID_PAGE_STYLE 6
97 #define WID_CHARACTER_STYLE 7
98 #define WID_POSITION_END_OF_DOC 8
99 #define WID_END_NOTICE 9
100 #define WID_BEGIN_NOTICE 10
101 #define WID_ANCHOR_CHARACTER_STYLE 11
102 #define WID_NUM_ON 12
103 #define WID_SEPARATOR_INTERVAL 13
104 #define WID_NUMBER_POSITION 14
105 #define WID_DISTANCE 15
106 #define WID_INTERVAL 16
107 #define WID_SEPARATOR_TEXT 17
108 #define WID_COUNT_EMPTY_LINES 18
109 #define WID_COUNT_LINES_IN_FRAMES 19
110 #define WID_RESTART_AT_EACH_PAGE 20
111 
112 
114 {
115  static const SfxItemPropertyMapEntry aFootnoteMap_Impl[] =
116  {
129  { u"", 0, css::uno::Type(), 0, 0 }
130  };
131  static const SfxItemPropertySet aFootnoteSet_Impl(aFootnoteMap_Impl);
132  return &aFootnoteSet_Impl;
133 }
134 
136 {
137  static const SfxItemPropertyMapEntry aEndnoteMap_Impl[] =
138  {
147  { u"", 0, css::uno::Type(), 0, 0 }
148  };
149  static const SfxItemPropertySet aEndnoteSet_Impl(aEndnoteMap_Impl);
150  return &aEndnoteSet_Impl;
151 }
152 
154 {
155  static const SfxItemPropertyMapEntry aNumberingRulesMap_Impl[] =
156  {
160  { u"" UNO_NAME_NAME, WID_RULE_NAME , ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0},
162  { u"" UNO_NAME_DEFAULT_LIST_ID, WID_DEFAULT_LIST_ID, ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0},
163  { u"", 0, css::uno::Type(), 0, 0 }
164  };
165  static const SfxItemPropertySet aNumberingRulesSet_Impl( aNumberingRulesMap_Impl );
166  return &aNumberingRulesSet_Impl;
167 }
168 
170 {
171  static const SfxItemPropertyMapEntry aLineNumberingMap_Impl[] =
172  {
184  { u"", 0, css::uno::Type(), 0, 0 }
185  };
186  static const SfxItemPropertySet aLineNumberingSet_Impl(aLineNumberingMap_Impl);
187  return &aLineNumberingSet_Impl;
188 }
189 
190 static SwCharFormat* lcl_getCharFormat(SwDoc* pDoc, const uno::Any& aValue)
191 {
192  SwCharFormat* pRet = nullptr;
193  OUString uTmp;
194  aValue >>= uTmp;
195  OUString sCharFormat;
197  if (sCharFormat != SwResId(STR_POOLCHR_STANDARD))
198  {
199  pRet = pDoc->FindCharFormatByName( sCharFormat );
200  }
201  if(!pRet)
202  {
204  if(USHRT_MAX != nId)
206  }
207  return pRet;
208 }
209 
210 static SwTextFormatColl* lcl_GetParaStyle(SwDoc* pDoc, const uno::Any& aValue)
211 {
212  OUString uTmp;
213  aValue >>= uTmp;
214  OUString sParaStyle;
216  SwTextFormatColl* pRet = pDoc->FindTextFormatCollByName( sParaStyle );
217  if( !pRet )
218  {
220  if( USHRT_MAX != nId )
221  pRet = pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( nId );
222  }
223  return pRet;
224 }
225 
226 static SwPageDesc* lcl_GetPageDesc(SwDoc* pDoc, const uno::Any& aValue)
227 {
228  OUString uTmp;
229  aValue >>= uTmp;
230  OUString sPageDesc;
232  SwPageDesc* pRet = pDoc->FindPageDesc( sPageDesc );
233  if(!pRet)
234  {
236  if(USHRT_MAX != nId)
237  pRet = pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool( nId );
238  }
239  return pRet;
240 }
241 
242 // Numbering
244 {
245  text::HoriOrientation::LEFT, //3
246  text::HoriOrientation::RIGHT, //1
247  USHRT_MAX,
248  text::HoriOrientation::CENTER, //2
249  USHRT_MAX,
250  USHRT_MAX
251 };
252 
253 const unsigned short aUnoToSvxAdjust[] =
254 {
255  USHRT_MAX,
256  static_cast<unsigned short>(SvxAdjust::Right), // 1
257  static_cast<unsigned short>(SvxAdjust::Center), // 3
258  static_cast<unsigned short>(SvxAdjust::Left), // 0
259  USHRT_MAX,
260  USHRT_MAX
261 };
262 
264 {
265  return "SwXFootnoteProperties";
266 }
267 
269 {
270  return cppu::supportsService(this, rServiceName);
271 }
272 
274 {
275  Sequence<OUString> aRet { "com.sun.star.text.FootnoteSettings" };
276  return aRet;
277 }
278 
280  m_pDoc(pDc),
281  m_pPropertySet(GetFootnoteSet())
282 {
283 }
284 
286 {
287 
288 }
289 
290 uno::Reference< beans::XPropertySetInfo > SwXFootnoteProperties::getPropertySetInfo()
291 {
292  static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
293  return aRef;
294 }
295 
296 void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
297 {
298  SolarMutexGuard aGuard;
299  if(!m_pDoc)
300  throw uno::RuntimeException();
301 
302  const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName );
303  if(!pEntry)
304  throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
305 
306  if ( pEntry->nFlags & PropertyAttribute::READONLY)
307  throw PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
308  SwFootnoteInfo aFootnoteInfo(m_pDoc->GetFootnoteInfo());
309  switch(pEntry->nWID)
310  {
311  case WID_PREFIX:
312  {
313  OUString uTmp;
314  aValue >>= uTmp;
315  aFootnoteInfo.SetPrefix(uTmp);
316  }
317  break;
318  case WID_SUFFIX:
319  {
320  OUString uTmp;
321  aValue >>= uTmp;
322  aFootnoteInfo.SetSuffix(uTmp);
323  }
324  break;
325  case WID_NUMBERING_TYPE:
326  {
327  sal_Int16 nTmp = 0;
328  aValue >>= nTmp;
329  if(!(nTmp >= 0 &&
330  (nTmp <= SVX_NUM_ARABIC ||
331  nTmp > SVX_NUM_BITMAP)))
332  throw lang::IllegalArgumentException();
333 
334  aFootnoteInfo.m_aFormat.SetNumberingType(static_cast<SvxNumType>(nTmp));
335 
336  }
337  break;
338  case WID_START_AT:
339  {
340  sal_Int16 nTmp = 0;
341  aValue >>= nTmp;
342  aFootnoteInfo.m_nFootnoteOffset = nTmp;
343  }
344  break;
346  {
347  sal_Int16 nTmp = 0;
348  aValue >>= nTmp;
349  switch(nTmp)
350  {
351  case FootnoteNumbering::PER_PAGE:
352  aFootnoteInfo.m_eNum = FTNNUM_PAGE;
353  break;
354  case FootnoteNumbering::PER_CHAPTER:
355  aFootnoteInfo.m_eNum = FTNNUM_CHAPTER;
356  break;
357  case FootnoteNumbering::PER_DOCUMENT:
358  aFootnoteInfo.m_eNum = FTNNUM_DOC;
359  break;
360  }
361  }
362  break;
363  case WID_PARAGRAPH_STYLE:
364  {
365  SwTextFormatColl* pColl = lcl_GetParaStyle(m_pDoc, aValue);
366  if(pColl)
367  aFootnoteInfo.SetFootnoteTextColl(*pColl);
368  }
369  break;
370  case WID_PAGE_STYLE:
371  {
373  if(pDesc)
374  aFootnoteInfo.ChgPageDesc( pDesc );
375  }
376  break;
378  case WID_CHARACTER_STYLE:
379  {
380  SwCharFormat* pFormat = lcl_getCharFormat(m_pDoc, aValue);
381  if(pFormat)
382  {
383  if(pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE)
384  aFootnoteInfo.SetAnchorCharFormat(pFormat);
385  else
386  aFootnoteInfo.SetCharFormat(pFormat);
387  }
388  }
389  break;
391  {
392  bool bVal = *o3tl::doAccess<bool>(aValue);
393  aFootnoteInfo.m_ePos = bVal ? FTNPOS_CHAPTER : FTNPOS_PAGE;
394  }
395  break;
396  case WID_END_NOTICE:
397  {
398  OUString uTmp;
399  aValue >>= uTmp;
400  aFootnoteInfo.m_aQuoVadis = uTmp;
401  }
402  break;
403  case WID_BEGIN_NOTICE:
404  {
405  OUString uTmp;
406  aValue >>= uTmp;
407  aFootnoteInfo.m_aErgoSum = uTmp;
408  }
409  break;
410  }
411  m_pDoc->SetFootnoteInfo(aFootnoteInfo);
412 
413 
414 }
415 
416 uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName)
417 {
418  SolarMutexGuard aGuard;
419  uno::Any aRet;
420  if(!m_pDoc)
421  throw uno::RuntimeException();
422 
423  const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName );
424  if(!pEntry)
425  throw UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
426 
427  const SwFootnoteInfo& rFootnoteInfo = m_pDoc->GetFootnoteInfo();
428  switch(pEntry->nWID)
429  {
430  case WID_PREFIX:
431  {
432  aRet <<= rFootnoteInfo.GetPrefix();
433  }
434  break;
435  case WID_SUFFIX:
436  {
437  aRet <<= rFootnoteInfo.GetSuffix();
438  }
439  break;
440  case WID_NUMBERING_TYPE :
441  {
442  aRet <<= static_cast<sal_Int16>(rFootnoteInfo.m_aFormat.GetNumberingType());
443  }
444  break;
445  case WID_START_AT:
446  aRet <<= static_cast<sal_Int16>(rFootnoteInfo.m_nFootnoteOffset);
447  break;
448  case WID_FOOTNOTE_COUNTING :
449  {
450  sal_Int16 nRet = 0;
451  switch(rFootnoteInfo.m_eNum)
452  {
453  case FTNNUM_PAGE:
454  nRet = FootnoteNumbering::PER_PAGE;
455  break;
456  case FTNNUM_CHAPTER:
457  nRet = FootnoteNumbering::PER_CHAPTER;
458  break;
459  case FTNNUM_DOC:
460  nRet = FootnoteNumbering::PER_DOCUMENT;
461  break;
462  }
463  aRet <<= nRet;
464  }
465  break;
466  case WID_PARAGRAPH_STYLE :
467  {
468  SwTextFormatColl* pColl = rFootnoteInfo.GetFootnoteTextColl();
469  OUString aString;
470  if(pColl)
471  aString = pColl->GetName();
473  aRet <<= aString;
474  }
475  break;
476  case WID_PAGE_STYLE :
477  {
478  OUString aString;
479  if( rFootnoteInfo.KnowsPageDesc() )
480  {
482  rFootnoteInfo.GetPageDesc( *m_pDoc )->GetName(),
483  aString,
485  }
486  aRet <<= aString;
487  }
488  break;
490  case WID_CHARACTER_STYLE:
491  {
492  OUString aString;
493  const SwCharFormat* pCharFormat = rFootnoteInfo.GetCurrentCharFormat(pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE);
494  if( pCharFormat )
495  {
497  pCharFormat->GetName(),
498  aString,
500  }
501  aRet <<= aString;
502  }
503  break;
505  aRet <<= FTNPOS_CHAPTER == rFootnoteInfo.m_ePos;
506  break;
507  case WID_END_NOTICE :
508  aRet <<= rFootnoteInfo.m_aQuoVadis;
509  break;
510  case WID_BEGIN_NOTICE :
511  aRet <<= rFootnoteInfo.m_aErgoSum;
512  break;
513  }
514 
515 
516  return aRet;
517 }
518 
520  const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
521 {
522  OSL_FAIL("not implemented");
523 }
524 
526  const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
527 {
528  OSL_FAIL("not implemented");
529 }
530 
532  const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
533 {
534  OSL_FAIL("not implemented");
535 }
536 
538  const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
539 {
540  OSL_FAIL("not implemented");
541 }
542 
544 {
545  return "SwXEndnoteProperties";
546 }
547 
548 sal_Bool SwXEndnoteProperties::supportsService(const OUString& rServiceName)
549 {
550  return cppu::supportsService(this, rServiceName);
551 }
552 
554 {
555  Sequence<OUString> aRet { "com.sun.star.text.FootnoteSettings" };
556  return aRet;
557 }
558 
560  m_pDoc(pDc),
561  m_pPropertySet(GetEndnoteSet())
562 {
563 }
564 
566 {
567 }
568 
569 uno::Reference< beans::XPropertySetInfo > SwXEndnoteProperties::getPropertySetInfo()
570 {
571  static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
572  return aRef;
573 }
574 
575 void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
576 {
577  SolarMutexGuard aGuard;
578  if(!m_pDoc)
579  return;
580 
581  const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName );
582  if(!pEntry)
583  throw UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
584 
585  if ( pEntry->nFlags & PropertyAttribute::READONLY)
586  throw PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
587  SwEndNoteInfo aEndInfo(m_pDoc->GetEndNoteInfo());
588  switch(pEntry->nWID)
589  {
590  case WID_PREFIX:
591  {
592  OUString uTmp;
593  aValue >>= uTmp;
594  aEndInfo.SetPrefix(uTmp);
595  }
596  break;
597  case WID_SUFFIX:
598  {
599  OUString uTmp;
600  aValue >>= uTmp;
601  aEndInfo.SetSuffix(uTmp);
602  }
603  break;
604  case WID_NUMBERING_TYPE :
605  {
606  sal_Int16 nTmp = 0;
607  aValue >>= nTmp;
608  aEndInfo.m_aFormat.SetNumberingType(static_cast<SvxNumType>(nTmp));
609  }
610  break;
611  case WID_START_AT:
612  {
613  sal_Int16 nTmp = 0;
614  aValue >>= nTmp;
615  aEndInfo.m_nFootnoteOffset = nTmp;
616  }
617  break;
618  case WID_PARAGRAPH_STYLE :
619  {
620  SwTextFormatColl* pColl = lcl_GetParaStyle(m_pDoc, aValue);
621  if(pColl)
622  aEndInfo.SetFootnoteTextColl(*pColl);
623  }
624  break;
625  case WID_PAGE_STYLE :
626  {
628  if(pDesc)
629  aEndInfo.ChgPageDesc( pDesc );
630  }
631  break;
633  case WID_CHARACTER_STYLE :
634  {
635  SwCharFormat* pFormat = lcl_getCharFormat(m_pDoc, aValue);
636  if(pFormat)
637  {
638  if(pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE)
639  aEndInfo.SetAnchorCharFormat(pFormat);
640  else
641  aEndInfo.SetCharFormat(pFormat);
642  }
643  }
644  break;
645  }
646  m_pDoc->SetEndNoteInfo(aEndInfo);
647 }
648 
649 uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName)
650 {
651  SolarMutexGuard aGuard;
652  uno::Any aRet;
653  if(m_pDoc)
654  {
655  const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName );
656  if(!pEntry)
657  throw UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
658 
659  const SwEndNoteInfo& rEndInfo = m_pDoc->GetEndNoteInfo();
660  switch(pEntry->nWID)
661  {
662  case WID_PREFIX:
663  aRet <<= rEndInfo.GetPrefix();
664  break;
665  case WID_SUFFIX:
666  aRet <<= rEndInfo.GetSuffix();
667  break;
668  case WID_NUMBERING_TYPE :
669  aRet <<= static_cast<sal_Int16>(rEndInfo.m_aFormat.GetNumberingType());
670  break;
671  case WID_START_AT:
672  aRet <<= static_cast<sal_Int16>(rEndInfo.m_nFootnoteOffset);
673  break;
674  case WID_PARAGRAPH_STYLE :
675  {
676  SwTextFormatColl* pColl = rEndInfo.GetFootnoteTextColl();
677  OUString aString;
678  if(pColl)
679  aString = pColl->GetName();
681  aString,
682  aString,
684  aRet <<= aString;
685 
686  }
687  break;
688  case WID_PAGE_STYLE :
689  {
690  OUString aString;
691  if( rEndInfo.KnowsPageDesc() )
692  {
694  rEndInfo.GetPageDesc( *m_pDoc )->GetName(),
695  aString,
697  }
698  aRet <<= aString;
699  }
700  break;
702  case WID_CHARACTER_STYLE:
703  {
704  OUString aString;
705  const SwCharFormat* pCharFormat = rEndInfo.GetCurrentCharFormat( pEntry->nWID == WID_ANCHOR_CHARACTER_STYLE );
706  if( pCharFormat )
707  {
709  pCharFormat->GetName(),
710  aString,
712  }
713  aRet <<= aString;
714  }
715  break;
716  }
717 
718  }
719  return aRet;
720 }
721 
723  const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
724 {
725  OSL_FAIL("not implemented");
726 }
727 
728 void SwXEndnoteProperties::removePropertyChangeListener(const OUString& /*PropertyName*/,
729  const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/)
730 {
731  OSL_FAIL("not implemented");
732 }
733 
734 void SwXEndnoteProperties::addVetoableChangeListener(const OUString& /*PropertyName*/,
735  const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
736 {
737  OSL_FAIL("not implemented");
738 }
739 
740 void SwXEndnoteProperties::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
741 {
742  OSL_FAIL("not implemented");
743 }
744 
746 {
747  return "SwXLineNumberingProperties";
748 }
749 
751 {
752  return cppu::supportsService(this, rServiceName);
753 }
754 
756 {
757  Sequence<OUString> aRet { "com.sun.star.text.LineNumberingProperties" };
758  return aRet;
759 }
760 
762  m_pDoc(pDc),
763  m_pPropertySet(GetLineNumberingSet())
764 {
765 }
766 
768 {
769 }
770 
771 uno::Reference< beans::XPropertySetInfo > SwXLineNumberingProperties::getPropertySetInfo()
772 {
773  static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
774  return aRef;
775 }
776 
778  const OUString& rPropertyName, const Any& aValue)
779 {
780  SolarMutexGuard aGuard;
781  if(!m_pDoc)
782  throw uno::RuntimeException();
783 
784  const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName );
785  if(!pEntry)
786  throw UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
787 
788  if ( pEntry->nFlags & PropertyAttribute::READONLY)
789  throw PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
790  SwLineNumberInfo aFontMetric(m_pDoc->GetLineNumberInfo());
791  switch(pEntry->nWID)
792  {
793  case WID_NUM_ON:
794  {
795  bool bVal = *o3tl::doAccess<bool>(aValue);
796  aFontMetric.SetPaintLineNumbers(bVal);
797  }
798  break;
799  case WID_CHARACTER_STYLE :
800  {
801  SwCharFormat* pFormat = lcl_getCharFormat(m_pDoc, aValue);
802  if(pFormat)
803  aFontMetric.SetCharFormat(pFormat);
804  }
805  break;
806  case WID_NUMBERING_TYPE :
807  {
808  SvxNumberType aNumType(aFontMetric.GetNumType());
809  sal_Int16 nTmp = 0;
810  aValue >>= nTmp;
811  aNumType.SetNumberingType(static_cast<SvxNumType>(nTmp));
812  aFontMetric.SetNumType(aNumType);
813  }
814  break;
815  case WID_NUMBER_POSITION :
816  {
817  sal_Int16 nTmp = 0;
818  aValue >>= nTmp;
819  switch(nTmp)
820  {
821  case style::LineNumberPosition::LEFT:
822  aFontMetric.SetPos(LINENUMBER_POS_LEFT);
823  break;
824  case style::LineNumberPosition::RIGHT :
825  aFontMetric.SetPos(LINENUMBER_POS_RIGHT);
826  break;
827  case style::LineNumberPosition::INSIDE:
828  aFontMetric.SetPos(LINENUMBER_POS_INSIDE);
829  break;
830  case style::LineNumberPosition::OUTSIDE:
831  aFontMetric.SetPos(LINENUMBER_POS_OUTSIDE);
832  break;
833  }
834  }
835  break;
836  case WID_DISTANCE :
837  {
838  sal_Int32 nVal = 0;
839  aValue >>= nVal;
840  sal_Int32 nTmp = o3tl::toTwips(nVal, o3tl::Length::mm100);
841  if (nTmp > SAL_MAX_UINT16)
842  nTmp = SAL_MAX_UINT16;
843  aFontMetric.SetPosFromLeft(nTmp);
844  }
845  break;
846  case WID_INTERVAL :
847  {
848  sal_Int16 nTmp = 0;
849  aValue >>= nTmp;
850  if( nTmp > 0)
851  aFontMetric.SetCountBy(nTmp);
852  }
853  break;
854  case WID_SEPARATOR_TEXT :
855  {
856  OUString uTmp;
857  aValue >>= uTmp;
858  aFontMetric.SetDivider(uTmp);
859  }
860  break;
862  {
863  sal_Int16 nTmp = 0;
864  aValue >>= nTmp;
865  if( nTmp >= 0)
866  aFontMetric.SetDividerCountBy(nTmp);
867  }
868  break;
869  case WID_COUNT_EMPTY_LINES :
870  {
871  bool bVal = *o3tl::doAccess<bool>(aValue);
872  aFontMetric.SetCountBlankLines(bVal);
873  }
874  break;
876  {
877  bool bVal = *o3tl::doAccess<bool>(aValue);
878  aFontMetric.SetCountInFlys(bVal);
879  }
880  break;
882  {
883  bool bVal = *o3tl::doAccess<bool>(aValue);
884  aFontMetric.SetRestartEachPage(bVal);
885  }
886  break;
887  }
888  m_pDoc->SetLineNumberInfo(aFontMetric);
889 }
890 
891 Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
892 {
893  SolarMutexGuard aGuard;
894  Any aRet;
895  if(!m_pDoc)
896  throw uno::RuntimeException();
897 
898  const SfxItemPropertyMapEntry* pEntry = m_pPropertySet->getPropertyMap().getByName( rPropertyName );
899  if(!pEntry)
900  throw UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
901 
902  const SwLineNumberInfo& rInfo = m_pDoc->GetLineNumberInfo();
903  switch(pEntry->nWID)
904  {
905  case WID_NUM_ON:
906  aRet <<= rInfo.IsPaintLineNumbers();
907  break;
908  case WID_CHARACTER_STYLE :
909  {
910  OUString aString;
911  // return empty string if no char format is set
912  // otherwise it would be created here
913  if(rInfo.HasCharFormat())
914  {
917  aString,
919  }
920  aRet <<= aString;
921  }
922  break;
923  case WID_NUMBERING_TYPE :
924  aRet <<= static_cast<sal_Int16>(rInfo.GetNumType().GetNumberingType());
925  break;
926  case WID_NUMBER_POSITION :
927  {
928  sal_Int16 nRet = 0;
929  switch(rInfo.GetPos())
930  {
931  case LINENUMBER_POS_LEFT:
932  nRet = style::LineNumberPosition::LEFT;
933  break;
934  case LINENUMBER_POS_RIGHT :
935  nRet = style::LineNumberPosition::RIGHT ;
936  break;
938  nRet = style::LineNumberPosition::INSIDE ;
939  break;
941  nRet = style::LineNumberPosition::OUTSIDE ;
942  break;
943  }
944  aRet <<= nRet;
945  }
946  break;
947  case WID_DISTANCE :
948  {
949  sal_uInt32 nPos = rInfo.GetPosFromLeft();
950  if(USHRT_MAX == nPos)
951  nPos = 0;
952  aRet <<= static_cast < sal_Int32 >(convertTwipToMm100(nPos));
953  }
954  break;
955  case WID_INTERVAL :
956  aRet <<= static_cast<sal_Int16>(rInfo.GetCountBy());
957  break;
958  case WID_SEPARATOR_TEXT :
959  aRet <<= rInfo.GetDivider();
960  break;
962  aRet <<= static_cast<sal_Int16>(rInfo.GetDividerCountBy());
963  break;
964  case WID_COUNT_EMPTY_LINES :
965  aRet <<= rInfo.IsCountBlankLines();
966  break;
968  aRet <<= rInfo.IsCountInFlys();
969  break;
971  aRet <<= rInfo.IsRestartEachPage();
972  break;
973  }
974  return aRet;
975 }
976 
977 void SwXLineNumberingProperties::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/)
978 {
979 OSL_FAIL("not implemented");
980 }
981 
982 void SwXLineNumberingProperties::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/)
983 {
984 OSL_FAIL("not implemented");
985 }
986 
987 void SwXLineNumberingProperties::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
988 {
989 OSL_FAIL("not implemented");
990 }
991 
992 void SwXLineNumberingProperties::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
993 {
994 OSL_FAIL("not implemented");
995 }
996 
997 constexpr OUStringLiteral aInvalidStyle = u"__XXX___invalid";
998 
1000  : public SvtListener
1001 {
1003  virtual void Notify(const SfxHint&) override;
1004  public:
1005  explicit Impl(SwXNumberingRules& rParent) : m_rParent(rParent) {}
1006 };
1007 
1008 bool SwXNumberingRules::isInvalidStyle(std::u16string_view rName)
1009 {
1010  return rName == aInvalidStyle;
1011 }
1012 
1013 namespace
1014 {
1015 }
1016 
1017 const uno::Sequence< sal_Int8 > & SwXNumberingRules::getUnoTunnelId()
1018 {
1019  static const comphelper::UnoIdInit theSwXNumberingRulesUnoTunnelId;
1020  return theSwXNumberingRulesUnoTunnelId.getSeq();
1021 }
1022 
1023 // return implementation specific data
1024 sal_Int64 SwXNumberingRules::getSomething( const uno::Sequence< sal_Int8 > & rId )
1025 {
1026  return comphelper::getSomethingImpl(rId, this);
1027 }
1028 
1030 {
1031  return "SwXNumberingRules";
1032 }
1033 
1034 sal_Bool SwXNumberingRules::supportsService(const OUString& rServiceName)
1035 {
1036  return cppu::supportsService(this, rServiceName);
1037 }
1038 
1040 {
1041  Sequence<OUString> aRet { "com.sun.star.text.NumberingRules" };
1042  return aRet;
1043 }
1044 
1046  m_pImpl(new SwXNumberingRules::Impl(*this)),
1047  m_pDoc(doc),
1048  m_pDocShell(nullptr),
1049  m_pNumRule(new SwNumRule(rRule)),
1050  m_pPropertySet(GetNumberingRulesSet()),
1051  m_bOwnNumRuleCreated(true)
1052 {
1053  // first organize the document - it is dependent on the set character formats
1054  // if no format is set, it should work as well
1055  for( sal_uInt16 i = 0; i < MAXLEVEL; ++i)
1056  {
1057  SwNumFormat rFormat(m_pNumRule->Get(i));
1058  SwCharFormat* pCharFormat = rFormat.GetCharFormat();
1059  if(pCharFormat)
1060  {
1061  m_pDoc = pCharFormat->GetDoc();
1062  break;
1063  }
1064  }
1065  if(m_pDoc)
1066  m_pImpl->StartListening(GetPageDescNotifier(m_pDoc));
1067  for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
1068  {
1071  }
1072 }
1073 
1075  m_pImpl(new SwXNumberingRules::Impl(*this)),
1076  m_pDoc(nullptr),
1077  m_pDocShell(&rDocSh),
1078  m_pNumRule(nullptr),
1079  m_pPropertySet(GetNumberingRulesSet()),
1080  m_bOwnNumRuleCreated(false)
1081 {
1082  m_pImpl->StartListening(GetPageDescNotifier(m_pDocShell->GetDoc()));
1083 }
1084 
1086  m_pImpl(new SwXNumberingRules::Impl(*this)),
1087  m_pDoc(&rDoc),
1088  m_pDocShell(nullptr),
1089  m_pNumRule(nullptr),
1090  m_pPropertySet(GetNumberingRulesSet()),
1091  m_bOwnNumRuleCreated(false)
1092 {
1093  m_pImpl->StartListening(GetPageDescNotifier(&rDoc));
1095  rDoc.MakeNumRule( m_sCreatedNumRuleName, nullptr, false,
1096  // #i89178#
1098 }
1099 
1101 {
1102  SolarMutexGuard aGuard;
1103  if(m_pDoc && !m_sCreatedNumRuleName.isEmpty())
1105  if( m_bOwnNumRuleCreated )
1106  delete m_pNumRule;
1107 }
1108 
1109 void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElement)
1110 {
1111  SolarMutexGuard aGuard;
1112  if(nIndex < 0 || MAXLEVEL <= nIndex)
1113  throw lang::IndexOutOfBoundsException();
1114 
1115  auto rProperties = o3tl::tryAccess<uno::Sequence<beans::PropertyValue>>(
1116  rElement);
1117  if(!rProperties)
1118  throw lang::IllegalArgumentException();
1119  SwNumRule* pRule = nullptr;
1120  if(m_pNumRule)
1122  *rProperties, nIndex);
1123  else if(m_pDocShell)
1124  {
1125  // #i87650# - correction of cws warnings:
1126  SwNumRule aNumRule( *(m_pDocShell->GetDoc()->GetOutlineNumRule()) );
1128  *rProperties, nIndex);
1129  // set character format if needed
1130  // this code appears to be dead - except when a style is assigned for BITMAP numbering?
1131  const SwCharFormats* pFormats = m_pDocShell->GetDoc()->GetCharFormats();
1132  const size_t nChCount = pFormats->size();
1133  for(sal_uInt16 i = 0; i < MAXLEVEL;i++)
1134  {
1135  SwNumFormat aFormat(aNumRule.Get( i ));
1136  if (!m_sNewCharStyleNames[i].isEmpty() &&
1138  (!aFormat.GetCharFormat() || aFormat.GetCharFormat()->GetName()!= m_sNewCharStyleNames[i]))
1139  {
1140  SwCharFormat* pCharFormat = nullptr;
1141  for(size_t j = 0; j< nChCount; ++j)
1142  {
1143  SwCharFormat* pTmp = (*pFormats)[j];
1144  if(pTmp->GetName() == m_sNewCharStyleNames[i])
1145  {
1146  pCharFormat = pTmp;
1147  break;
1148  }
1149  }
1150  if(!pCharFormat)
1151  {
1152  SfxStyleSheetBase* pBase;
1154  SfxStyleFamily::Char);
1155  if(!pBase)
1156  pBase = &m_pDocShell->GetStyleSheetPool()->Make(m_sNewCharStyleNames[i], SfxStyleFamily::Char);
1157  pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
1158 
1159  }
1160  aFormat.SetCharFormat( pCharFormat );
1161  aNumRule.Set( i, aFormat );
1162  }
1163  }
1164  m_pDocShell->GetDoc()->SetOutlineNumRule( aNumRule );
1165  }
1166  else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty() &&
1167  nullptr != (pRule = m_pDoc->FindNumRulePtr( m_sCreatedNumRuleName )))
1168  {
1170  *rProperties, nIndex);
1171 
1172  pRule->Validate(*m_pDoc);
1173  }
1174  else
1175  throw uno::RuntimeException();
1176 }
1177 
1179 {
1180  return MAXLEVEL;
1181 }
1182 
1184 {
1185  SolarMutexGuard aGuard;
1186  if(nIndex < 0 || MAXLEVEL <= nIndex)
1187  throw lang::IndexOutOfBoundsException();
1188 
1189  uno::Any aVal;
1190  const SwNumRule* pRule = m_pNumRule;
1191  if(!pRule && m_pDoc && !m_sCreatedNumRuleName.isEmpty())
1193  if(pRule)
1194  {
1195  uno::Sequence<beans::PropertyValue> aRet = GetNumberingRuleByIndex(
1196  *pRule, nIndex);
1197  aVal <<= aRet;
1198 
1199  }
1200  else if(m_pDocShell)
1201  {
1202  uno::Sequence<beans::PropertyValue> aRet = GetNumberingRuleByIndex(
1203  *m_pDocShell->GetDoc()->GetOutlineNumRule(), nIndex);
1204  aVal <<= aRet;
1205  }
1206  else
1207  throw uno::RuntimeException();
1208  return aVal;
1209 }
1210 
1212 {
1214 }
1215 
1217 {
1218  return true;
1219 }
1220 
1223  STR_POOLCOLL_HEADLINE1,
1224  STR_POOLCOLL_HEADLINE2,
1225  STR_POOLCOLL_HEADLINE3,
1226  STR_POOLCOLL_HEADLINE4,
1227  STR_POOLCOLL_HEADLINE5,
1228  STR_POOLCOLL_HEADLINE6,
1229  STR_POOLCOLL_HEADLINE7,
1230  STR_POOLCOLL_HEADLINE8,
1231  STR_POOLCOLL_HEADLINE9,
1232  STR_POOLCOLL_HEADLINE10
1233 };
1234 
1235 uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
1236  const SwNumRule& rNumRule, sal_Int32 nIndex) const
1237 {
1238  SolarMutexGuard aGuard;
1239  OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
1240 
1241  const SwNumFormat& rFormat = rNumRule.Get( o3tl::narrowing<sal_uInt16>(nIndex) );
1242 
1243  SwCharFormat* pCharFormat = rFormat.GetCharFormat();
1244  OUString CharStyleName;
1245  if (pCharFormat)
1246  CharStyleName = pCharFormat->GetName();
1247 
1248  // Whether or not a style is present: the array entry overwrites this string
1249  if (!m_sNewCharStyleNames[nIndex].isEmpty() &&
1251  {
1252  CharStyleName = m_sNewCharStyleNames[nIndex];
1253  }
1254 
1255  OUString aUString;
1256  if (m_pDocShell) // -> Chapter Numbering
1257  {
1258  // template name
1259  OUString sValue(SwResId(STR_POOLCOLL_HEADLINE_ARY[nIndex]));
1261  const size_t nCount = pColls->size();
1262  for(size_t i = 0; i < nCount; ++i)
1263  {
1264  SwTextFormatColl &rTextColl = *pColls->operator[](i);
1265  if(rTextColl.IsDefault())
1266  continue;
1267 
1268  const sal_Int16 nOutLevel = rTextColl.IsAssignedToListLevelOfOutlineStyle()
1269  ? static_cast<sal_Int16>(rTextColl.GetAssignedOutlineStyleLevel())
1270  : MAXLEVEL;
1271  if ( nOutLevel == nIndex )
1272  {
1273  sValue = rTextColl.GetName();
1274  break; // the style for the level in question has been found
1275  }
1276  else if( sValue==rTextColl.GetName() )
1277  {
1278  // if the default for the level is existing, but its
1279  // level is different, then it cannot be the default.
1280  sValue.clear();
1281  }
1282  }
1284  }
1285 
1286  OUString referer;
1287  if (m_pDoc != nullptr) {
1288  auto const sh = m_pDoc->GetPersist();
1289  if (sh != nullptr && sh->HasName()) {
1290  referer = sh->GetMedium()->GetName();
1291  }
1292  }
1294  rFormat, CharStyleName, m_pDocShell ? & aUString : nullptr, referer);
1295 
1296 }
1297 
1298 uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat(
1299  const SwNumFormat& rFormat, OUString const& rCharFormatName,
1300  OUString const*const pHeadingStyleName, OUString const & referer)
1301 {
1302  bool bChapterNum = pHeadingStyleName != nullptr;
1303 
1304  std::vector<PropertyValue> aPropertyValues;
1305  aPropertyValues.reserve(32);
1306  //fill all properties into the array
1307 
1308  //adjust
1309  SvxAdjust eAdj = rFormat.GetNumAdjust();
1310  sal_Int16 nINT16 = aSvxToUnoAdjust[eAdj];
1311  aPropertyValues.push_back(comphelper::makePropertyValue("Adjust", nINT16));
1312 
1313  //parentnumbering
1314  nINT16 = rFormat.GetIncludeUpperLevels();
1315  aPropertyValues.push_back(comphelper::makePropertyValue("ParentNumbering", nINT16));
1316 
1317  //prefix
1318  OUString aUString = rFormat.GetPrefix();
1319  aPropertyValues.push_back(comphelper::makePropertyValue("Prefix", aUString));
1320 
1321  //suffix
1322  aUString = rFormat.GetSuffix();
1323  aPropertyValues.push_back(comphelper::makePropertyValue("Suffix", aUString));
1324 
1325  //listformat
1326  if (rFormat.HasListFormat())
1327  {
1328  aPropertyValues.push_back(comphelper::makePropertyValue("ListFormat", rFormat.GetListFormat()));
1329  }
1330 
1331  //char style name
1332  aUString.clear();
1333  SwStyleNameMapper::FillProgName( rCharFormatName, aUString, SwGetPoolIdFromName::ChrFmt);
1334  aPropertyValues.push_back(comphelper::makePropertyValue("CharStyleName", aUString));
1335 
1336  //startvalue
1337  nINT16 = rFormat.GetStart();
1338  aPropertyValues.push_back(comphelper::makePropertyValue("StartWith", nINT16));
1339 
1341  {
1342  //leftmargin
1343  sal_Int32 nINT32 = convertTwipToMm100(rFormat.GetAbsLSpace());
1344  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_LEFT_MARGIN, nINT32));
1345 
1346  //chartextoffset
1347  nINT32 = convertTwipToMm100(rFormat.GetCharTextDistance());
1348  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_SYMBOL_TEXT_DISTANCE, nINT32));
1349 
1350  //firstlineoffset
1351  nINT32 = convertTwipToMm100(rFormat.GetFirstLineOffset());
1352  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_FIRST_LINE_OFFSET, nINT32));
1353  }
1354 
1355  // PositionAndSpaceMode
1356  nINT16 = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION;
1358  {
1359  nINT16 = PositionAndSpaceMode::LABEL_ALIGNMENT;
1360  }
1361  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_POSITION_AND_SPACE_MODE, nINT16));
1362 
1364  {
1365  // LabelFollowedBy
1366  nINT16 = LabelFollow::LISTTAB;
1367  if ( rFormat.GetLabelFollowedBy() == SvxNumberFormat::SPACE )
1368  {
1369  nINT16 = LabelFollow::SPACE;
1370  }
1371  else if ( rFormat.GetLabelFollowedBy() == SvxNumberFormat::NOTHING )
1372  {
1373  nINT16 = LabelFollow::NOTHING;
1374  }
1375  else if ( rFormat.GetLabelFollowedBy() == SvxNumberFormat::NEWLINE )
1376  {
1377  nINT16 = LabelFollow::NEWLINE;
1378  }
1379  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_LABEL_FOLLOWED_BY, nINT16));
1380 
1381  // ListtabStopPosition
1382  sal_Int32 nINT32 = convertTwipToMm100(rFormat.GetListtabPos());
1383  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_LISTTAB_STOP_POSITION, nINT32));
1384 
1385  // FirstLineIndent
1386  nINT32 = convertTwipToMm100(rFormat.GetFirstLineIndent());
1387  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_FIRST_LINE_INDENT, nINT32));
1388 
1389  // IndentAt
1390  nINT32 = convertTwipToMm100(rFormat.GetIndentAt());
1391  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_INDENT_AT, nINT32));
1392  }
1393 
1394  //numberingtype
1395  nINT16 = rFormat.GetNumberingType();
1396  aPropertyValues.push_back(comphelper::makePropertyValue("NumberingType", nINT16));
1397 
1398  if(!bChapterNum)
1399  {
1400  if(SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1401  {
1402  sal_UCS4 cBullet = rFormat.GetBulletChar();
1403 
1404  //BulletId
1405  nINT16 = cBullet;
1406  aPropertyValues.push_back(comphelper::makePropertyValue("BulletId", nINT16));
1407 
1408  std::optional<vcl::Font> pFont = rFormat.GetBulletFont();
1409 
1410  //BulletChar
1411  aUString = OUString(&cBullet, 1);
1412  aPropertyValues.push_back(comphelper::makePropertyValue("BulletChar", aUString));
1413 
1414  //BulletFontName
1415  aUString = pFont ? pFont->GetStyleName() : OUString();
1416  aPropertyValues.push_back(comphelper::makePropertyValue("BulletFontName", aUString));
1417 
1418  //BulletFont
1419  if(pFont)
1420  {
1421  awt::FontDescriptor aDesc;
1422  SvxUnoFontDescriptor::ConvertFromFont( *pFont, aDesc );
1423  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_BULLET_FONT, aDesc));
1424  }
1425  }
1426  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1427  {
1428  const SvxBrushItem* pBrush = rFormat.GetBrush();
1429  const Graphic* pGraphic = pBrush ? pBrush->GetGraphic(referer) : nullptr;
1430  if (pGraphic)
1431  {
1432  //GraphicBitmap
1433  uno::Reference<awt::XBitmap> xBitmap(pGraphic->GetXGraphic(), uno::UNO_QUERY);
1434  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC_BITMAP, xBitmap));
1435  }
1436 
1437  Size aSize = rFormat.GetGraphicSize();
1438  // #i101131#
1439  // adjust conversion due to type mismatch between <Size> and <awt::Size>
1440  awt::Size aAwtSize(convertTwipToMm100(aSize.Width()), convertTwipToMm100(aSize.Height()));
1441  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC_SIZE, aAwtSize));
1442 
1443  const SwFormatVertOrient* pOrient = rFormat.GetGraphicOrientation();
1444  if(pOrient)
1445  {
1446  uno::Any any;
1447  pOrient->QueryValue(any);
1448  aPropertyValues.emplace_back(
1449  UNO_NAME_VERT_ORIENT, -1, any, PropertyState_DIRECT_VALUE);
1450  }
1451  }
1452  }
1453  else
1454  {
1455  aUString = *pHeadingStyleName;
1456  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_HEADING_STYLE_NAME, aUString));
1457  }
1458 
1459  return ::comphelper::containerToSequence(aPropertyValues);
1460 }
1461 
1463  SwNumRule& rNumRule,
1464  const uno::Sequence<beans::PropertyValue>& rProperties, sal_Int32 nIndex)
1465 {
1466  SolarMutexGuard aGuard;
1467  OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
1468 
1469  SwNumFormat aFormat(rNumRule.Get( o3tl::narrowing<sal_uInt16>(nIndex) ));
1470 
1471  OUString sHeadingStyleName;
1472  OUString sParagraphStyleName;
1473 
1475  &m_sNewBulletFontNames[nIndex],
1476  &sHeadingStyleName, &sParagraphStyleName,
1477  m_pDoc, m_pDocShell, rProperties);
1478 
1479 
1480  if (m_pDoc && !sParagraphStyleName.isEmpty())
1481  {
1482  const SwTextFormatColls* pColls = m_pDoc->GetTextFormatColls();
1483  const size_t nCount = pColls->size();
1484  for (size_t k = 0; k < nCount; ++k)
1485  {
1486  SwTextFormatColl &rTextColl = *((*pColls)[k]);
1487  if (rTextColl.GetName() == sParagraphStyleName)
1488  rTextColl.SetFormatAttr( SwNumRuleItem( rNumRule.GetName()));
1489  }
1490  }
1491 
1492  if (!sHeadingStyleName.isEmpty())
1493  {
1494  assert(m_pDocShell);
1496  const size_t nCount = pColls->size();
1497  for (size_t k = 0; k < nCount; ++k)
1498  {
1499  SwTextFormatColl &rTextColl = *((*pColls)[k]);
1500  if (rTextColl.IsDefault())
1501  continue;
1502  if (rTextColl.IsAssignedToListLevelOfOutlineStyle() &&
1503  rTextColl.GetAssignedOutlineStyleLevel() == nIndex &&
1504  rTextColl.GetName() != sHeadingStyleName)
1505  {
1507  }
1508  else if (rTextColl.GetName() == sHeadingStyleName)
1509  {
1510  rTextColl.AssignToListLevelOfOutlineStyle( nIndex );
1511  }
1512  }
1513  }
1514 
1515  rNumRule.Set(o3tl::narrowing<sal_uInt16>(nIndex), aFormat);
1516 }
1517 
1519  SwNumFormat & aFormat,
1520  OUString & rCharStyleName, OUString *const pBulletFontName,
1521  OUString *const pHeadingStyleName,
1522  OUString *const pParagraphStyleName,
1523  SwDoc *const pDoc,
1524  SwDocShell *const pDocShell,
1525  const uno::Sequence<beans::PropertyValue>& rProperties)
1526 {
1527  assert(pDoc == nullptr || pDocShell == nullptr); // can't be both ordinary and chapter numbering
1528 
1529  bool bWrongArg = false;
1530  std::unique_ptr<SvxBrushItem> pSetBrush;
1531  std::unique_ptr<Size> pSetSize;
1532  std::unique_ptr<SwFormatVertOrient> pSetVOrient;
1533  bool bCharStyleNameSet = false;
1534 
1535  for (const beans::PropertyValue& rProp : rProperties)
1536  {
1537  if (rProp.Name == UNO_NAME_ADJUST)
1538  {
1539  sal_Int16 nValue = text::HoriOrientation::NONE;
1540  rProp.Value >>= nValue;
1541  if (nValue > text::HoriOrientation::NONE &&
1542  nValue <= text::HoriOrientation::LEFT &&
1543  USHRT_MAX != aUnoToSvxAdjust[nValue])
1544  {
1545  aFormat.SetNumAdjust(static_cast<SvxAdjust>(aUnoToSvxAdjust[nValue]));
1546  }
1547  else
1548  bWrongArg = true;
1549  }
1550  else if (rProp.Name == UNO_NAME_PARENT_NUMBERING)
1551  {
1552  sal_Int16 nSet = 0;
1553  rProp.Value >>= nSet;
1554  if(nSet >= 0 && MAXLEVEL >= nSet)
1555  aFormat.SetIncludeUpperLevels( static_cast< sal_uInt8 >(nSet) );
1556  }
1557  else if (rProp.Name == UNO_NAME_PREFIX)
1558  {
1559  OUString uTmp;
1560  rProp.Value >>= uTmp;
1561  aFormat.SetPrefix(uTmp);
1562  }
1563  else if (rProp.Name == UNO_NAME_SUFFIX)
1564  {
1565  OUString uTmp;
1566  rProp.Value >>= uTmp;
1567  aFormat.SetSuffix(uTmp);
1568  }
1569  else if (rProp.Name == UNO_NAME_CHAR_STYLE_NAME)
1570  {
1571  bCharStyleNameSet = true;
1572  OUString uTmp;
1573  rProp.Value >>= uTmp;
1574  OUString sCharFormatName;
1576  SwDoc *const pLocalDoc = pDocShell ? pDocShell->GetDoc() : pDoc;
1577  if (sCharFormatName == UNO_NAME_CHARACTER_FORMAT_NONE)
1578  {
1579  rCharStyleName = aInvalidStyle;
1580  aFormat.SetCharFormat(nullptr);
1581  }
1582  else if (pLocalDoc)
1583  {
1584  SwCharFormat* pCharFormat = nullptr;
1585  if (!sCharFormatName.isEmpty())
1586  {
1587  pCharFormat = pLocalDoc->FindCharFormatByName(sCharFormatName);
1588  if(!pCharFormat)
1589  {
1590 
1591  SfxStyleSheetBase* pBase;
1592  SfxStyleSheetBasePool* pPool = pLocalDoc->GetDocShell()->GetStyleSheetPool();
1593  pBase = pPool->Find(sCharFormatName, SfxStyleFamily::Char);
1594  if(!pBase)
1595  pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char);
1596  pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
1597  }
1598  }
1599  aFormat.SetCharFormat( pCharFormat );
1600  // #i51842#
1601  // If the character format has been found its name should not be in the
1602  // char style names array
1603  rCharStyleName.clear();
1604  }
1605  else
1606  rCharStyleName = sCharFormatName;
1607  }
1608  else if (rProp.Name == UNO_NAME_START_WITH)
1609  {
1610  sal_Int16 nVal = 0;
1611  rProp.Value >>= nVal;
1612  aFormat.SetStart(nVal);
1613  }
1614  else if (rProp.Name == UNO_NAME_LEFT_MARGIN)
1615  {
1616  sal_Int32 nValue = 0;
1617  rProp.Value >>= nValue;
1618  // #i23727# nValue can be negative
1620  }
1621  else if (rProp.Name == UNO_NAME_SYMBOL_TEXT_DISTANCE)
1622  {
1623  sal_Int32 nValue = 0;
1624  rProp.Value >>= nValue;
1625  if (nValue >= 0)
1627  else
1628  bWrongArg = true;
1629  }
1630  else if (rProp.Name == UNO_NAME_FIRST_LINE_OFFSET)
1631  {
1632  sal_Int32 nValue = 0;
1633  rProp.Value >>= nValue;
1634  // #i23727# nValue can be positive
1635  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1636  aFormat.SetFirstLineOffset(nValue);
1637  }
1638  else if (rProp.Name == UNO_NAME_POSITION_AND_SPACE_MODE)
1639  {
1640  sal_Int16 nValue = 0;
1641  rProp.Value >>= nValue;
1642  if ( nValue == 0 )
1643  {
1645  }
1646  else if ( nValue == 1 )
1647  {
1649  }
1650  else
1651  {
1652  bWrongArg = true;
1653  }
1654  }
1655  else if (rProp.Name == UNO_NAME_LABEL_FOLLOWED_BY)
1656  {
1657  sal_Int16 nValue = 0;
1658  rProp.Value >>= nValue;
1659  if ( nValue == LabelFollow::LISTTAB )
1660  {
1662  }
1663  else if ( nValue == LabelFollow::SPACE )
1664  {
1666  }
1667  else if ( nValue == LabelFollow::NOTHING )
1668  {
1670  }
1671  else if ( nValue == LabelFollow::NEWLINE )
1672  {
1674  }
1675  else
1676  {
1677  bWrongArg = true;
1678  }
1679  }
1680  else if (rProp.Name == UNO_NAME_LISTTAB_STOP_POSITION)
1681  {
1682  sal_Int32 nValue = 0;
1683  rProp.Value >>= nValue;
1684  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1685  if ( nValue >= 0 )
1686  {
1687  aFormat.SetListtabPos( nValue );
1688  }
1689  else
1690  {
1691  bWrongArg = true;
1692  }
1693  }
1694  else if (rProp.Name == UNO_NAME_FIRST_LINE_INDENT)
1695  {
1696  sal_Int32 nValue = 0;
1697  rProp.Value >>= nValue;
1698  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1699  aFormat.SetFirstLineIndent( nValue );
1700  }
1701  else if (rProp.Name == UNO_NAME_INDENT_AT)
1702  {
1703  sal_Int32 nValue = 0;
1704  rProp.Value >>= nValue;
1705  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1706  aFormat.SetIndentAt( nValue );
1707  }
1708  else if (rProp.Name == UNO_NAME_NUMBERING_TYPE)
1709  {
1710  sal_Int16 nSet = 0;
1711  rProp.Value >>= nSet;
1712  if(nSet >= 0)
1713  aFormat.SetNumberingType(static_cast<SvxNumType>(nSet));
1714  else
1715  bWrongArg = true;
1716  }
1717  else if (rProp.Name == UNO_NAME_PARAGRAPH_STYLE_NAME)
1718  {
1719  if (pParagraphStyleName)
1720  {
1721  OUString uTmp;
1722  rProp.Value >>= uTmp;
1723  OUString sStyleName;
1725  *pParagraphStyleName = sStyleName;
1726  }
1727  }
1728  else if (rProp.Name == UNO_NAME_BULLET_ID)
1729  {
1730  sal_Int16 nSet = 0;
1731  if( rProp.Value >>= nSet )
1732  aFormat.SetBulletChar(nSet);
1733  else
1734  bWrongArg = true;
1735  }
1736  else if (rProp.Name == UNO_NAME_BULLET_FONT)
1737  {
1738  awt::FontDescriptor desc;
1739  if (rProp.Value >>= desc)
1740  {
1741  // #i93725#
1742  // do not accept "empty" font
1743  if (!desc.Name.isEmpty())
1744  {
1745  vcl::Font aFont;
1747  aFormat.SetBulletFont(&aFont);
1748  }
1749  }
1750  else
1751  bWrongArg = true;
1752  }
1753  else if (rProp.Name == UNO_NAME_BULLET_FONT_NAME)
1754  {
1755  OUString sBulletFontName;
1756  rProp.Value >>= sBulletFontName;
1757  SwDocShell *const pLclDocShell = pDocShell ? pDocShell : pDoc ? pDoc->GetDocShell() : nullptr;
1758  if (!sBulletFontName.isEmpty() && pLclDocShell)
1759  {
1760  const SvxFontListItem* pFontListItem =
1761  static_cast<const SvxFontListItem* >(pLclDocShell
1762  ->GetItem( SID_ATTR_CHAR_FONTLIST ));
1763  const FontList* pList = pFontListItem->GetFontList();
1764  FontMetric aFontMetric = pList->Get(
1765  sBulletFontName, WEIGHT_NORMAL, ITALIC_NONE);
1766  vcl::Font aFont(aFontMetric);
1767  aFormat.SetBulletFont(&aFont);
1768  }
1769  else if (pBulletFontName)
1770  *pBulletFontName = sBulletFontName;
1771  }
1772  else if (rProp.Name == UNO_NAME_BULLET_CHAR)
1773  {
1774  OUString aChar;
1775  rProp.Value >>= aChar;
1776  if (aChar.isEmpty())
1777  {
1778  // If w:lvlText's value is null - set bullet char to zero
1779  aFormat.SetBulletChar(u'\0');
1780  }
1781  else
1782  {
1783  sal_Int32 nIndexUtf16 = 0;
1784  sal_UCS4 cBullet = aChar.iterateCodePoints(&nIndexUtf16);
1785  if (aChar.getLength() == nIndexUtf16)
1786  aFormat.SetBulletChar(cBullet);
1787  else
1788  bWrongArg = true;
1789  }
1790  }
1791  else if (rProp.Name == UNO_NAME_GRAPHIC)
1792  {
1793  uno::Reference<graphic::XGraphic> xGraphic;
1794  if (rProp.Value >>= xGraphic)
1795  {
1796  if (!pSetBrush)
1797  {
1798  const SvxBrushItem* pOrigBrush = aFormat.GetBrush();
1799  if(pOrigBrush)
1800  pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
1801  else
1802  pSetBrush.reset(new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND));
1803  }
1804  Graphic aGraphic(xGraphic);
1805  pSetBrush->SetGraphic(aGraphic);
1806  }
1807  else
1808  bWrongArg = true;
1809  }
1810  else if (rProp.Name == UNO_NAME_GRAPHIC_BITMAP)
1811  {
1812  uno::Reference<awt::XBitmap> xBitmap;
1813  if (rProp.Value >>= xBitmap)
1814  {
1815  if(!pSetBrush)
1816  {
1817  const SvxBrushItem* pOrigBrush = aFormat.GetBrush();
1818  if(pOrigBrush)
1819  pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
1820  else
1821  pSetBrush.reset(new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND));
1822  }
1823 
1824  uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1825  Graphic aGraphic(xGraphic);
1826  pSetBrush->SetGraphic(aGraphic);
1827  }
1828  else
1829  bWrongArg = true;
1830  }
1831  else if (rProp.Name == UNO_NAME_GRAPHIC_SIZE)
1832  {
1833  if(!pSetSize)
1834  pSetSize.reset(new Size);
1835  awt::Size size;
1836  if (rProp.Value >>= size)
1837  {
1838  pSetSize->setWidth(o3tl::toTwips(size.Width, o3tl::Length::mm100));
1839  pSetSize->setHeight(o3tl::toTwips(size.Height, o3tl::Length::mm100));
1840  }
1841  else
1842  bWrongArg = true;
1843  }
1844  else if (rProp.Name == UNO_NAME_VERT_ORIENT)
1845  {
1846  if(!pSetVOrient)
1847  {
1848  if(aFormat.GetGraphicOrientation())
1849  pSetVOrient.reset(aFormat.GetGraphicOrientation()->Clone());
1850  else
1851  pSetVOrient.reset(new SwFormatVertOrient);
1852  }
1853  pSetVOrient->PutValue(rProp.Value, MID_VERTORIENT_ORIENT);
1854  }
1855  else if (rProp.Name == UNO_NAME_HEADING_STYLE_NAME
1856  && pDocShell) // only on chapter numbering
1857  {
1858  if (pHeadingStyleName)
1859  {
1860  OUString uTmp;
1861  rProp.Value >>= uTmp;
1862  OUString sStyleName;
1864  *pHeadingStyleName = sStyleName;
1865  }
1866  }
1867  else if (rProp.Name == UNO_NAME_BULLET_REL_SIZE)
1868  {
1869  // BulletRelSize - unsupported - only available in Impress
1870  }
1871  else if (rProp.Name == UNO_NAME_BULLET_COLOR)
1872  {
1873  // BulletColor - ignored too
1874  }
1875  else if (rProp.Name == UNO_NAME_GRAPHIC_URL)
1876  {
1877  OUString aURL;
1878  if (rProp.Value >>= aURL)
1879  {
1880  if(!pSetBrush)
1881  {
1882  const SvxBrushItem* pOrigBrush = aFormat.GetBrush();
1883  if(pOrigBrush)
1884  pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
1885  else
1886  pSetBrush.reset(new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND));
1887  }
1888 
1889  Graphic aGraphic = vcl::graphic::loadFromURL(aURL);
1890  if (!aGraphic.IsNone())
1891  pSetBrush->SetGraphic(aGraphic);
1892  }
1893  else
1894  bWrongArg = true;
1895  }
1896  else if (rProp.Name == UNO_NAME_LIST_FORMAT)
1897  {
1898  OUString uTmp;
1899  rProp.Value >>= uTmp;
1900  aFormat.SetListFormat(uTmp);
1901  }
1902  else
1903  {
1904  // Invalid property name
1905  SAL_WARN("sw.uno", "Unknown/incorrect property " << rProp.Name << ", failing");
1906  throw uno::RuntimeException("Unknown/incorrect property " + rProp.Name);
1907  }
1908  }
1909  if(!bWrongArg && (pSetBrush || pSetSize || pSetVOrient))
1910  {
1911  if(!pSetBrush && aFormat.GetBrush())
1912  pSetBrush.reset(new SvxBrushItem(*aFormat.GetBrush()));
1913 
1914  if(pSetBrush)
1915  {
1916  if(!pSetVOrient && aFormat.GetGraphicOrientation())
1917  pSetVOrient.reset( new SwFormatVertOrient(*aFormat.GetGraphicOrientation()) );
1918 
1919  if(!pSetSize)
1920  {
1921  pSetSize.reset(new Size(aFormat.GetGraphicSize()));
1922  if(!pSetSize->Width() || !pSetSize->Height())
1923  {
1924  const Graphic* pGraphic = pSetBrush->GetGraphic();
1925  if(pGraphic)
1926  *pSetSize = ::GetGraphicSizeTwip(*pGraphic, nullptr);
1927  }
1928  }
1929  sal_Int16 eOrient = pSetVOrient ?
1930  pSetVOrient->GetVertOrient() : text::VertOrientation::NONE;
1931  aFormat.SetGraphicBrush( pSetBrush.get(), pSetSize.get(), text::VertOrientation::NONE == eOrient ? nullptr : &eOrient );
1932  }
1933  }
1934  if ((!bCharStyleNameSet || rCharStyleName.isEmpty())
1935  && aFormat.GetNumberingType() == NumberingType::BITMAP
1936  && !aFormat.GetCharFormat()
1937  && !SwXNumberingRules::isInvalidStyle(rCharStyleName))
1938  {
1939  OUString tmp;
1941  rCharStyleName = tmp;
1942  }
1943 
1944  if(bWrongArg)
1945  throw lang::IllegalArgumentException();
1946 }
1947 
1948 uno::Reference< XPropertySetInfo > SwXNumberingRules::getPropertySetInfo()
1949 {
1950  static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
1951  return aRef;
1952 }
1953 
1954 void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
1955 {
1956  SolarMutexGuard aGuard;
1957  std::unique_ptr<SwNumRule> pDocRule;
1958  SwNumRule* pCreatedRule = nullptr;
1959  if(!m_pNumRule)
1960  {
1961  if(m_pDocShell)
1962  {
1963  pDocRule.reset(new SwNumRule(*m_pDocShell->GetDoc()->GetOutlineNumRule()));
1964  }
1965  else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty())
1966  {
1967  pCreatedRule = m_pDoc->FindNumRulePtr(m_sCreatedNumRuleName);
1968  }
1969 
1970  }
1971  if(!m_pNumRule && !pDocRule && !pCreatedRule)
1972  throw RuntimeException();
1973 
1974  if(rPropertyName == UNO_NAME_IS_AUTOMATIC)
1975  {
1976  bool bVal = *o3tl::doAccess<bool>(rValue);
1977  if(!pCreatedRule)
1978  pDocRule ? pDocRule->SetAutoRule(bVal) : m_pNumRule->SetAutoRule(bVal);
1979  }
1980  else if(rPropertyName == UNO_NAME_IS_CONTINUOUS_NUMBERING)
1981  {
1982  bool bVal = *o3tl::doAccess<bool>(rValue);
1983  pDocRule ? pDocRule->SetContinusNum(bVal) :
1984  pCreatedRule ? pCreatedRule->SetContinusNum(bVal) : m_pNumRule->SetContinusNum(bVal);
1985  }
1986  else if(rPropertyName == UNO_NAME_NAME)
1987  {
1988  throw IllegalArgumentException();
1989  }
1990  else if(rPropertyName == UNO_NAME_IS_ABSOLUTE_MARGINS)
1991  {
1992  bool bVal = *o3tl::doAccess<bool>(rValue);
1993  pDocRule ? pDocRule->SetAbsSpaces(bVal) :
1994  pCreatedRule ? pCreatedRule->SetAbsSpaces(bVal) : m_pNumRule->SetAbsSpaces(bVal);
1995  }
1996  else if(rPropertyName == UNO_NAME_NUMBERING_IS_OUTLINE)
1997  {
1998  bool bVal = *o3tl::doAccess<bool>(rValue);
1999  SwNumRuleType eNumRuleType = bVal ? OUTLINE_RULE : NUM_RULE;
2000  pDocRule ? pDocRule->SetRuleType(eNumRuleType) :
2001  pCreatedRule ? pCreatedRule->SetRuleType(eNumRuleType) : m_pNumRule->SetRuleType(eNumRuleType);
2002  }
2003  else if(rPropertyName == UNO_NAME_DEFAULT_LIST_ID)
2004  {
2005  throw IllegalArgumentException();
2006  }
2007  else
2008  throw UnknownPropertyException(rPropertyName);
2009 
2010  if(pDocRule)
2011  {
2012  assert(m_pDocShell);
2013  m_pDocShell->GetDoc()->SetOutlineNumRule(*pDocRule);
2014  pDocRule.reset();
2015  }
2016  else if(pCreatedRule)
2017  {
2018  pCreatedRule->Validate(*m_pDoc);
2019  }
2020 }
2021 
2022 Any SwXNumberingRules::getPropertyValue( const OUString& rPropertyName )
2023 {
2024  Any aRet;
2025  const SwNumRule* pRule = m_pNumRule;
2026  if(!pRule && m_pDocShell)
2027  pRule = m_pDocShell->GetDoc()->GetOutlineNumRule();
2028  else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty())
2030  if(!pRule)
2031  throw RuntimeException();
2032 
2033  if(rPropertyName == UNO_NAME_IS_AUTOMATIC)
2034  {
2035  aRet <<= pRule->IsAutoRule();
2036  }
2037  else if(rPropertyName == UNO_NAME_IS_CONTINUOUS_NUMBERING)
2038  {
2039  aRet <<= pRule->IsContinusNum();
2040  }
2041  else if(rPropertyName == UNO_NAME_NAME)
2042  aRet <<= pRule->GetName();
2043  else if(rPropertyName == UNO_NAME_IS_ABSOLUTE_MARGINS)
2044  {
2045  aRet <<= pRule->IsAbsSpaces();
2046  }
2047  else if(rPropertyName == UNO_NAME_NUMBERING_IS_OUTLINE)
2048  {
2049  aRet <<= pRule->IsOutlineRule();
2050  }
2051  else if(rPropertyName == UNO_NAME_DEFAULT_LIST_ID)
2052  {
2053  OSL_ENSURE( !pRule->GetDefaultListId().isEmpty(),
2054  "<SwXNumberingRules::getPropertyValue(..)> - no default list id found. Serious defect." );
2055  aRet <<= pRule->GetDefaultListId();
2056  }
2057  else
2058  throw UnknownPropertyException(rPropertyName);
2059  return aRet;
2060 }
2061 
2063  const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
2064 {
2065 }
2066 
2068  const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
2069 {
2070 }
2071 
2073  const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
2074 {
2075 }
2076 
2078  const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
2079 {
2080 }
2081 
2083 {
2084  if(m_pNumRule)
2085  {
2086  OUString aString;
2088  return aString;
2089  }
2090  // consider chapter numbering <SwXNumberingRules>
2091  if ( m_pDocShell )
2092  {
2093  OUString aString;
2095  aString, SwGetPoolIdFromName::NumRule );
2096  return aString;
2097  }
2098  return m_sCreatedNumRuleName;
2099 }
2100 
2101 void SwXNumberingRules::setName(const OUString& /*rName*/)
2102 {
2103  RuntimeException aExcept;
2104  aExcept.Message = "readonly";
2105  throw aExcept;
2106 }
2107 
2109 {
2110  if(rHint.GetId() == SfxHintId::Dying)
2111  {
2113  delete m_rParent.m_pNumRule;
2114  m_rParent.m_pNumRule = nullptr;
2115  m_rParent.m_pDoc = nullptr;
2116  }
2117 }
2118 
2120 {
2121  return "SwXChapterNumbering";
2122 }
2123 
2124 sal_Bool SwXChapterNumbering::supportsService(const OUString& rServiceName)
2125 {
2126  return cppu::supportsService(this, rServiceName);
2127 }
2128 
2130 {
2131  return { "com.sun.star.text.ChapterNumbering", "com.sun.star.text.NumberingRules" };
2132 }
2133 
2135  SwXNumberingRules(rDocSh)
2136 {
2137 }
2138 
2140 {
2141 }
2142 
2143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
SvxNumType GetNumberingType() const
#define UNO_NAME_CHARACTER_FORMAT_NONE
Definition: unoprnms.hxx:340
SwXFootnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:279
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:771
static SwTextFormatColl * lcl_GetParaStyle(SwDoc *pDoc, const uno::Any &aValue)
Definition: unosett.cxx:210
tools::Long GetFirstLineIndent() const
URL aURL
void SetLabelFollowedBy(const LabelFollowedBy eLabelFollowedBy)
#define UNO_NAME_POSITION_AND_SPACE_MODE
Definition: unoprnms.hxx:794
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:604
const TranslateId STR_POOLCOLL_HEADLINE_ARY[]
Definition: unosett.cxx:1222
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:273
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:1029
#define WID_COUNT_LINES_IN_FRAMES
Definition: unosett.cxx:109
sal_UCS4 GetBulletChar() const
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
Definition: docftn.cxx:294
bool IsDefault() const
Definition: format.hxx:129
constexpr auto toTwips(N number, Length from)
sal_uInt32 sal_UCS4
SwCharFormat * GetCurrentCharFormat(const bool bAnchor) const
Definition: docftn.cxx:205
const SwLineNumberInfo & GetLineNumberInfo() const
Definition: lineinfo.cxx:49
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:263
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
void SetAutoRule(bool bFlag)
Definition: numrule.hxx:230
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:416
const OUString & GetSuffix() const
Definition: ftninfo.hxx:71
bool IsNone() const
#define WID_NUM_ON
Definition: unosett.cxx:102
#define WID_PREFIX
Definition: unosett.cxx:90
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
sal_uInt16 GetCountBy() const
Definition: lineinfo.hxx:74
#define UNO_NAME_BULLET_ID
Definition: unoprnms.hxx:47
void SetPositionAndSpaceMode(SvxNumPositionAndSpaceMode ePositionAndSpaceMode)
#define UNO_NAME_GRAPHIC_BITMAP
Definition: unoprnms.hxx:45
#define WID_CHARACTER_STYLE
Definition: unosett.cxx:97
sal_uInt16 char char * pDesc
const SvxBrushItem * GetBrush() const
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:798
#define UNO_NAME_FIRST_LINE_OFFSET
Definition: unoprnms.hxx:414
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:891
const OUString & GetName() const
#define WID_SEPARATOR_INTERVAL
Definition: unosett.cxx:103
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
#define WID_PAGE_STYLE
Definition: unosett.cxx:96
#define UNO_NAME_START_AT
Definition: unoprnms.hxx:309
void SetPrefix(const OUString &rSet)
#define UNO_NAME_INDENT_AT
Definition: unoprnms.hxx:798
const OUString & GetDefaultListId() const
Definition: numrule.hxx:194
#define UNO_NAME_PARA_STYLE_NAME
Definition: unoprnms.hxx:175
bool IsAutoRule() const
Definition: numrule.hxx:229
#define WID_SEPARATOR_TEXT
Definition: unosett.cxx:107
#define UNO_NAME_POSITION_END_OF_DOC
Definition: unoprnms.hxx:184
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:2062
constexpr OUStringLiteral UNO_NAME_CHAR_STYLE_NAME
virtual ~SwXFootnoteProperties() override
Definition: unosett.cxx:285
Definition: doc.hxx:187
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
void SetContinusNum(bool bFlag)
Definition: numrule.hxx:236
SwXEndnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:559
#define UNO_NAME_NUMBER_POSITION
Definition: unoprnms.hxx:170
sal_Int16 nId
sal_uInt8 GetIncludeUpperLevels() const
SwNumRuleType
Definition: numrule.hxx:92
tools::Long GetListtabPos() const
const OUString & GetName() const
Definition: numrule.hxx:224
#define UNO_NAME_BEGIN_NOTICE
Definition: unoprnms.hxx:147
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:112
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
Definition: docnum.cxx:2551
#define WID_PARAGRAPH_STYLE
Definition: unosett.cxx:95
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:1034
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:2129
#define UNO_NAME_VERT_ORIENT
Definition: unoprnms.hxx:332
#define WID_IS_AUTOMATIC
Definition: unomap.hxx:301
#define WID_NUMBERING_TYPE
Definition: unosett.cxx:92
#define UNO_NAME_GRAPHIC
Definition: unoprnms.hxx:162
#define UNO_NAME_PARAGRAPH_STYLE_NAME
Definition: unoprnms.hxx:832
void Validate(const SwDoc &rDoc)
Definition: number.cxx:1071
void SetIncludeUpperLevels(sal_uInt8 nSet)
#define UNO_NAME_LABEL_FOLLOWED_BY
Definition: unoprnms.hxx:795
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:334
bool IsCountBlankLines() const
Definition: lineinfo.hxx:83
bool IsCountInFlys() const
Definition: lineinfo.hxx:86
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:2067
Graphic loadFromURL(OUString const &rURL, weld::Window *pParentWin)
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
void SetAbsSpaces(bool bFlag)
Definition: numrule.hxx:239
SfxHintId GetId() const
#define UNO_NAME_FIRST_LINE_INDENT
Definition: unoprnms.hxx:797
void SetIndentAt(const tools::Long nIndentAt)
bool HasListFormat() const
const OUString & GetName() const
Definition: pagedesc.hxx:196
SwTextFormatColl * GetFootnoteTextColl() const
Definition: ftninfo.hxx:55
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
constexpr auto convertTwipToMm100(N n)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:569
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
constexpr tools::Long Width() const
#define UNO_NAME_IS_CONTINUOUS_NUMBERING
Definition: unoprnms.hxx:469
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:537
#define UNO_NAME_START_WITH
Definition: unoprnms.hxx:310
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
constexpr OUStringLiteral UNO_NAME_NUMBERING_TYPE
bool IsRestartEachPage() const
Definition: lineinfo.hxx:89
virtual ~SwXNumberingRules() override
Definition: unosett.cxx:1100
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unosett.cxx:1183
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unosett.cxx:1024
#define WID_BEGIN_NOTICE
Definition: unosett.cxx:100
#define SAL_MAX_UINT16
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:575
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: atrfrm.cxx:1389
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
static const SfxItemPropertySet * GetFootnoteSet()
Definition: unosett.cxx:113
#define UNO_NAME_GRAPHIC_SIZE
Definition: unoprnms.hxx:44
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2072
const OUString & GetName() const
Definition: format.hxx:131
int nCount
bool m_bOwnNumRuleCreated
Definition: unosett.hxx:155
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SVX_NUM_ARABIC
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:82
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:977
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
Definition: unosett.cxx:1109
FontMetric Get(const OUString &rName, const OUString &rStyleName) const
short GetCharTextDistance() const
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
#define WID_IS_OUTLINE
Definition: unomap.hxx:305
Impl(SwXNumberingRules &rParent)
Definition: unosett.cxx:1005
constexpr OUStringLiteral UNO_NAME_BULLET_CHAR
const Graphic * GetGraphic(OUString const &referer=OUString()) const
virtual OUString GetName() const override
#define WID_SUFFIX
Definition: unosett.cxx:91
const OUString & GetPrefix() const
void SetNumberingRuleByIndex(SwNumRule &rNumRule, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, sal_Int32 nIndex)
Definition: unosett.cxx:1462
#define UNO_NAME_IS_ABSOLUTE_MARGINS
Definition: unoprnms.hxx:471
const OUString & GetSuffix() const
virtual void Notify(const SfxHint &) override
Definition: unosett.cxx:2108
bool KnowsPageDesc() const
Definition: docftn.cxx:116
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:992
#define UNO_NAME_HEADING_STYLE_NAME
Definition: unoprnms.hxx:460
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
#define WID_FOOTNOTE_COUNTING
Definition: unosett.cxx:94
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:941
const css::uno::Sequence< sal_Int8 > & getSeq() const
#define UNO_NAME_NUMBERING_IS_OUTLINE
Definition: unoprnms.hxx:753
virtual ~SwXChapterNumbering() override
Definition: unosett.cxx:2139
bool IsContinusNum() const
Definition: numrule.hxx:235
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:525
SVX_NUM_BITMAP
void SetNumAdjust(SvxAdjust eSet)
SVX_NUM_CHAR_SPECIAL
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
static const SfxItemPropertySet * GetNumberingRulesSet()
Definition: unosett.cxx:153
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
const SwFormatVertOrient * GetGraphicOrientation() const
Definition: number.cxx:351
virtual void SAL_CALL setName(const OUString &Name_) override
Definition: unosett.cxx:2101
sal_uInt16 GetPosFromLeft() const
Definition: lineinfo.hxx:71
SwFootnoteNum m_eNum
Definition: ftninfo.hxx:98
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2473
static SwCharFormat * lcl_getCharFormat(SwDoc *pDoc, const uno::Any &aValue)
Definition: unosett.cxx:190
#define UNO_NAME_ANCHOR_CHAR_STYLE_NAME
Definition: unoprnms.hxx:80
OUString GetListFormat(bool bIncludePrefixSuffix=true) const
OUString m_sNewCharStyleNames[MAXLEVEL]
Definition: unosett.hxx:148
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:296
SvxAdjust
int i
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:1954
constexpr OUStringLiteral UNO_NAME_PARENT_NUMBERING
LabelFollowedBy GetLabelFollowedBy() const
virtual SwFormatVertOrient * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1384
OUString m_sNewBulletFontNames[MAXLEVEL]
Definition: unosett.hxx:149
void SetBulletFont(const vcl::Font *pFont)
sal_Int32 GetAbsLSpace() const
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:740
#define UNO_NAME_DISTANCE
Definition: unoprnms.hxx:157
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
#define UNO_NAME_BULLET_FONT
Definition: unoprnms.hxx:50
sal_uInt16 m_nFootnoteOffset
Definition: ftninfo.hxx:47
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust
Definition: unosett.cxx:244
bool HasCharFormat() const
Definition: lineinfo.hxx:92
SwXChapterNumbering(SwDocShell &rDocSh)
Definition: unosett.cxx:2134
const Any & any
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:1039
#define UNO_NAME_FOOTNOTE_COUNTING
Definition: unoprnms.hxx:257
virtual OUString SAL_CALL getName() override
Definition: unosett.cxx:2082
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:722
#define UNO_NAME_LIST_FORMAT
Definition: unoprnms.hxx:83
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1154
WEIGHT_NORMAL
#define UNO_NAME_DEFAULT_LIST_ID
Definition: unoprnms.hxx:804
float u
size_t size() const
Definition: docary.hxx:87
unsigned char sal_Bool
const SfxItemPropertyMap & getPropertyMap() const
void SetRuleType(SwNumRuleType eNew)
Definition: numrule.hxx:212
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:519
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
size
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:638
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:745
css::uno::Type const & get()
constexpr OUStringLiteral UNO_NAME_PREFIX
SvxAdjust GetNumAdjust() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:553
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:543
OUString sBulletFontName
static css::uno::Sequence< css::beans::PropertyValue > GetPropertiesForNumFormat(const SwNumFormat &rFormat, OUString const &rCharFormatName, OUString const *pHeadingStyleName, OUString const &referer)
Definition: unosett.cxx:1298
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unosett.cxx:1017
sal_uInt16 GetStart() const
PropertyValueVector_t aPropertyValues
ITALIC_NONE
#define WID_DISTANCE
Definition: unosett.cxx:105
GPOS_AREA
static const SfxItemPropertySet * GetLineNumberingSet()
Definition: unosett.cxx:169
void SetCharTextDistance(short nSet)
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
static void SetPropertiesToNumFormat(SwNumFormat &aFormat, OUString &rCharStyleName, OUString *const pBulletFontName, OUString *const pHeadingStyleName, OUString *const pParagraphStyleName, SwDoc *const pDoc, SwDocShell *const pDocShell, css::uno::Sequence< css::beans::PropertyValue > const &rProperties)
Definition: unosett.cxx:1518
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:2124
#define UNO_NAME_SEPARATOR_INTERVAL
Definition: unoprnms.hxx:205
Represents the style of a text portion.
Definition: charfmt.hxx:26
#define UNO_NAME_INTERVAL
Definition: unoprnms.hxx:276
void SetOutlineNumRule(const SwNumRule &rRule)
Definition: docnum.cxx:116
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:2077
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
#define UNO_NAME_ADJUST
Definition: unoprnms.hxx:475
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:734
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:987
#define UNO_NAME_END_NOTICE
Definition: unoprnms.hxx:146
size_t size() const
Definition: charformats.hxx:71
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:2119
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:611
void SetBulletChar(sal_UCS4 cSet)
static void ConvertToFont(const css::awt::FontDescriptor &rDesc, vcl::Font &rFont)
#define UNO_NAME_COUNT_LINES_IN_FRAMES
Definition: unoprnms.hxx:152
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:52
static void ConvertFromFont(const vcl::Font &rFont, css::awt::FontDescriptor &rDesc)
constexpr OUStringLiteral aInvalidStyle
Definition: unosett.cxx:997
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:101
SwXLineNumberingProperties(SwDoc *pDoc)
Definition: unosett.cxx:761
#define UNO_NAME_SEPARATOR_TEXT
Definition: unoprnms.hxx:169
virtual sal_Int32 SAL_CALL getCount() override
Definition: unosett.cxx:1178
const OUString & GetPrefix() const
Definition: ftninfo.hxx:70
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:86
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: doc.hxx:770
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
Definition: docftn.cxx:365
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unosett.cxx:1211
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:1948
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosett.cxx:531
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:617
#define WID_NUMBER_POSITION
Definition: unosett.cxx:104
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:280
const Size & GetGraphicSize() const
virtual sal_Bool SAL_CALL hasElements() override
Definition: unosett.cxx:1216
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:739
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1557
SwPageDesc * GetPageDesc(SwDoc &rDoc) const
Definition: docftn.cxx:105
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:755
SwXNumberingRules & m_rParent
Definition: unosett.cxx:1002
#define PROPERTY_NONE
#define UNO_NAME_LEFT_MARGIN
Definition: unoprnms.hxx:68
constexpr OUStringLiteral UNO_NAME_SUFFIX
bool IsPaintLineNumbers() const
Definition: lineinfo.hxx:80
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:777
constexpr tools::Long Height() const
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosett.cxx:777
#define MID_VERTORIENT_ORIENT
Definition: unomid.h:34
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:154
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:290
void SetFirstLineOffset(sal_Int32 nSet)
#define WID_START_AT
Definition: unosett.cxx:93
#define WID_ANCHOR_CHARACTER_STYLE
Definition: unosett.cxx:101
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
virtual ~SwXLineNumberingProperties() override
Definition: unosett.cxx:767
#define UNO_NAME_IS_ON
Definition: unoprnms.hxx:530
LineNumberPosition GetPos() const
Definition: lineinfo.hxx:77
static const SfxItemPropertySet * GetEndnoteSet()
Definition: unosett.cxx:135
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:639
SwCharFormat * GetCharFormat(IDocumentStylePoolAccess &rIDSPA) const
Definition: lineinfo.cxx:99
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:649
#define UNO_NAME_IS_AUTOMATIC
Definition: unoprnms.hxx:470
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
Definition: docnum.cxx:2507
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:750
#define UNO_NAME_BULLET_FONT_NAME
Definition: unoprnms.hxx:51
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:2022
#define UNO_NAME_SYMBOL_TEXT_DISTANCE
Definition: unoprnms.hxx:415
void SetSuffix(const OUString &rSet)
sal_Int32 GetFirstLineOffset() const
static SwPageDesc * lcl_GetPageDesc(SwDoc *pDoc, const uno::Any &aValue)
Definition: unosett.cxx:226
SwNumRule * m_pNumRule
Definition: unosett.hxx:153
void SetStart(sal_uInt16 nSet)
void SetLineNumberInfo(const SwLineNumberInfo &rInfo)
Definition: lineinfo.cxx:30
#define UNO_NAME_BULLET_COLOR
Definition: unoprnms.hxx:52
OUString m_aQuoVadis
Definition: ftninfo.hxx:95
virtual void SetGraphicBrush(const SvxBrushItem *pBrushItem, const Size *pSize=nullptr, const sal_Int16 *pOrient=nullptr) override
Definition: number.cxx:318
#define WID_INTERVAL
Definition: unosett.cxx:106
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
#define UNO_NAME_COUNT_EMPTY_LINES
Definition: unoprnms.hxx:244
const unsigned short aUnoToSvxAdjust[]
Definition: unosett.cxx:253
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:268
bool IsAbsSpaces() const
Definition: numrule.hxx:238
#define SAL_WARN(area, stream)
SwFootnotePos m_ePos
Definition: ftninfo.hxx:97
void SetAbsLSpace(sal_Int32 nSet)
#define UNO_NAME_GRAPHIC_URL
Definition: unoprnms.hxx:46
css::uno::Sequence< css::beans::PropertyValue > GetNumberingRuleByIndex(const SwNumRule &rNumRule, sal_Int32 nIndex) const
Definition: unosett.cxx:1235
const OUString & GetDivider() const
Definition: lineinfo.hxx:66
#define WID_POSITION_END_OF_DOC
Definition: unosett.cxx:98
#define WID_CONTINUOUS
Definition: unomap.hxx:302
#define WID_COUNT_EMPTY_LINES
Definition: unosett.cxx:108
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:982
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
Definition: docnum.cxx:1060
const FontList * GetFontList() const
static bool isInvalidStyle(std::u16string_view rName)
Definition: unosett.cxx:1008
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unosett.hxx:145
const SvxNumberType & GetNumType() const
Definition: lineinfo.hxx:63
sal_uInt16 GetDividerCountBy() const
Definition: lineinfo.hxx:68
void SetNumberingType(SvxNumType nSet)
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosett.cxx:728
#define UNO_NAME_BULLET_REL_SIZE
Definition: unoprnms.hxx:49
SwXNumberingRules(SwDocShell &rDocSh)
Definition: unosett.cxx:1074
void SetFirstLineIndent(const tools::Long nFirstLineIndent)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
tools::Long GetIndentAt() const
#define WID_RESTART_AT_EACH_PAGE
Definition: unosett.cxx:110
Standard page.
Definition: poolfmt.hxx:170
#define UNO_NAME_RESTART_AT_EACH_PAGE
Definition: unoprnms.hxx:245
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:548
#define UNO_NAME_PAGE_STYLE_NAME
Definition: unoprnms.hxx:171
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:629
void SetListFormat(const OUString &rPrefix, const OUString &rSuffix, int nLevel)
#define WID_IS_ABS_MARGINS
Definition: unomap.hxx:304
#define UNO_NAME_LISTTAB_STOP_POSITION
Definition: unoprnms.hxx:796
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:631
bool IsOutlineRule() const
Definition: numrule.hxx:241
OUString m_aErgoSum
Definition: ftninfo.hxx:96
#define WID_DEFAULT_LIST_ID
Definition: unomap.hxx:306
#define UNO_NAME_NAME
Definition: unoprnms.hxx:78
sal_uInt16 nPos
SwDocShell * m_pDocShell
Definition: unosett.hxx:152
void SetListtabPos(const tools::Long nListtabPos)
#define WID_END_NOTICE
Definition: unosett.cxx:99
sal_Int16 nValue
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1023
#define WID_RULE_NAME
Definition: unomap.hxx:303
bool m_bDetectedRangeSegmentation false
virtual ~SwXEndnoteProperties() override
Definition: unosett.cxx:565
OUString m_sCreatedNumRuleName
Definition: unosett.hxx:150
const std::optional< vcl::Font > & GetBulletFont() const
Size GetGraphicSizeTwip(const Graphic &rGraphic, vcl::RenderContext *pOutDev)
Definition: swtypes.cxx:28
SfxMedium * GetMedium() const