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