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 = o3tl::toTwips(nVal, o3tl::Length::mm100);
845  if (nTmp > SAL_MAX_UINT16)
846  nTmp = SAL_MAX_UINT16;
847  aFontMetric.SetPosFromLeft(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 comphelper::UnoIdInit 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  return comphelper::getSomethingImpl(rId, this);
1031 }
1032 
1034 {
1035  return "SwXNumberingRules";
1036 }
1037 
1038 sal_Bool SwXNumberingRules::supportsService(const OUString& rServiceName)
1039 {
1040  return cppu::supportsService(this, rServiceName);
1041 }
1042 
1044 {
1045  Sequence<OUString> aRet { "com.sun.star.text.NumberingRules" };
1046  return aRet;
1047 }
1048 
1050  m_pImpl(new SwXNumberingRules::Impl(*this)),
1051  m_pDoc(doc),
1052  m_pDocShell(nullptr),
1053  m_pNumRule(new SwNumRule(rRule)),
1054  m_pPropertySet(GetNumberingRulesSet()),
1055  m_bOwnNumRuleCreated(true)
1056 {
1057  // first organize the document - it is dependent on the set character formats
1058  // if no format is set, it should work as well
1059  for( sal_uInt16 i = 0; i < MAXLEVEL; ++i)
1060  {
1061  SwNumFormat rFormat(m_pNumRule->Get(i));
1062  SwCharFormat* pCharFormat = rFormat.GetCharFormat();
1063  if(pCharFormat)
1064  {
1065  m_pDoc = pCharFormat->GetDoc();
1066  break;
1067  }
1068  }
1069  if(m_pDoc)
1070  m_pImpl->StartListening(GetPageDescNotifier(m_pDoc));
1071  for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
1072  {
1075  }
1076 }
1077 
1079  m_pImpl(new SwXNumberingRules::Impl(*this)),
1080  m_pDoc(nullptr),
1081  m_pDocShell(&rDocSh),
1082  m_pNumRule(nullptr),
1083  m_pPropertySet(GetNumberingRulesSet()),
1084  m_bOwnNumRuleCreated(false)
1085 {
1086  m_pImpl->StartListening(GetPageDescNotifier(m_pDocShell->GetDoc()));
1087 }
1088 
1090  m_pImpl(new SwXNumberingRules::Impl(*this)),
1091  m_pDoc(&rDoc),
1092  m_pDocShell(nullptr),
1093  m_pNumRule(nullptr),
1094  m_pPropertySet(GetNumberingRulesSet()),
1095  m_bOwnNumRuleCreated(false)
1096 {
1097  m_pImpl->StartListening(GetPageDescNotifier(&rDoc));
1099  rDoc.MakeNumRule( m_sCreatedNumRuleName, nullptr, false,
1100  // #i89178#
1102 }
1103 
1105 {
1106  SolarMutexGuard aGuard;
1107  if(m_pDoc && !m_sCreatedNumRuleName.isEmpty())
1109  if( m_bOwnNumRuleCreated )
1110  delete m_pNumRule;
1111 }
1112 
1113 void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElement)
1114 {
1115  SolarMutexGuard aGuard;
1116  if(nIndex < 0 || MAXLEVEL <= nIndex)
1117  throw lang::IndexOutOfBoundsException();
1118 
1119  auto rProperties = o3tl::tryAccess<uno::Sequence<beans::PropertyValue>>(
1120  rElement);
1121  if(!rProperties)
1122  throw lang::IllegalArgumentException();
1123  SwNumRule* pRule = nullptr;
1124  if(m_pNumRule)
1126  *rProperties, nIndex);
1127  else if(m_pDocShell)
1128  {
1129  // #i87650# - correction of cws warnings:
1130  SwNumRule aNumRule( *(m_pDocShell->GetDoc()->GetOutlineNumRule()) );
1132  *rProperties, nIndex);
1133  // set character format if needed
1134  // this code appears to be dead - except when a style is assigned for BITMAP numbering?
1135  const SwCharFormats* pFormats = m_pDocShell->GetDoc()->GetCharFormats();
1136  const size_t nChCount = pFormats->size();
1137  for(sal_uInt16 i = 0; i < MAXLEVEL;i++)
1138  {
1139  SwNumFormat aFormat(aNumRule.Get( i ));
1140  if (!m_sNewCharStyleNames[i].isEmpty() &&
1142  (!aFormat.GetCharFormat() || aFormat.GetCharFormat()->GetName()!= m_sNewCharStyleNames[i]))
1143  {
1144  SwCharFormat* pCharFormat = nullptr;
1145  for(size_t j = 0; j< nChCount; ++j)
1146  {
1147  SwCharFormat* pTmp = (*pFormats)[j];
1148  if(pTmp->GetName() == m_sNewCharStyleNames[i])
1149  {
1150  pCharFormat = pTmp;
1151  break;
1152  }
1153  }
1154  if(!pCharFormat)
1155  {
1156  SfxStyleSheetBase* pBase;
1158  SfxStyleFamily::Char);
1159  if(!pBase)
1160  pBase = &m_pDocShell->GetStyleSheetPool()->Make(m_sNewCharStyleNames[i], SfxStyleFamily::Char);
1161  pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
1162 
1163  }
1164  aFormat.SetCharFormat( pCharFormat );
1165  aNumRule.Set( i, aFormat );
1166  }
1167  }
1168  m_pDocShell->GetDoc()->SetOutlineNumRule( aNumRule );
1169  }
1170  else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty() &&
1171  nullptr != (pRule = m_pDoc->FindNumRulePtr( m_sCreatedNumRuleName )))
1172  {
1174  *rProperties, nIndex);
1175 
1176  pRule->Validate(*m_pDoc);
1177  }
1178  else
1179  throw uno::RuntimeException();
1180 }
1181 
1183 {
1184  return MAXLEVEL;
1185 }
1186 
1188 {
1189  SolarMutexGuard aGuard;
1190  if(nIndex < 0 || MAXLEVEL <= nIndex)
1191  throw lang::IndexOutOfBoundsException();
1192 
1193  uno::Any aVal;
1194  const SwNumRule* pRule = m_pNumRule;
1195  if(!pRule && m_pDoc && !m_sCreatedNumRuleName.isEmpty())
1197  if(pRule)
1198  {
1199  uno::Sequence<beans::PropertyValue> aRet = GetNumberingRuleByIndex(
1200  *pRule, nIndex);
1201  aVal <<= aRet;
1202 
1203  }
1204  else if(m_pDocShell)
1205  {
1206  uno::Sequence<beans::PropertyValue> aRet = GetNumberingRuleByIndex(
1207  *m_pDocShell->GetDoc()->GetOutlineNumRule(), nIndex);
1208  aVal <<= aRet;
1209  }
1210  else
1211  throw uno::RuntimeException();
1212  return aVal;
1213 }
1214 
1216 {
1218 }
1219 
1221 {
1222  return true;
1223 }
1224 
1227  STR_POOLCOLL_HEADLINE1,
1228  STR_POOLCOLL_HEADLINE2,
1229  STR_POOLCOLL_HEADLINE3,
1230  STR_POOLCOLL_HEADLINE4,
1231  STR_POOLCOLL_HEADLINE5,
1232  STR_POOLCOLL_HEADLINE6,
1233  STR_POOLCOLL_HEADLINE7,
1234  STR_POOLCOLL_HEADLINE8,
1235  STR_POOLCOLL_HEADLINE9,
1236  STR_POOLCOLL_HEADLINE10
1237 };
1238 
1239 uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
1240  const SwNumRule& rNumRule, sal_Int32 nIndex) const
1241 {
1242  SolarMutexGuard aGuard;
1243  OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
1244 
1245  const SwNumFormat& rFormat = rNumRule.Get( o3tl::narrowing<sal_uInt16>(nIndex) );
1246 
1247  SwCharFormat* pCharFormat = rFormat.GetCharFormat();
1248  OUString CharStyleName;
1249  if (pCharFormat)
1250  CharStyleName = pCharFormat->GetName();
1251 
1252  // Whether or not a style is present: the array entry overwrites this string
1253  if (!m_sNewCharStyleNames[nIndex].isEmpty() &&
1255  {
1256  CharStyleName = m_sNewCharStyleNames[nIndex];
1257  }
1258 
1259  OUString aUString;
1260  if (m_pDocShell) // -> Chapter Numbering
1261  {
1262  // template name
1263  OUString sValue(SwResId(STR_POOLCOLL_HEADLINE_ARY[nIndex]));
1265  const size_t nCount = pColls->size();
1266  for(size_t i = 0; i < nCount; ++i)
1267  {
1268  SwTextFormatColl &rTextColl = *pColls->operator[](i);
1269  if(rTextColl.IsDefault())
1270  continue;
1271 
1272  const sal_Int16 nOutLevel = rTextColl.IsAssignedToListLevelOfOutlineStyle()
1273  ? static_cast<sal_Int16>(rTextColl.GetAssignedOutlineStyleLevel())
1274  : MAXLEVEL;
1275  if ( nOutLevel == nIndex )
1276  {
1277  sValue = rTextColl.GetName();
1278  break; // the style for the level in question has been found
1279  }
1280  else if( sValue==rTextColl.GetName() )
1281  {
1282  // if the default for the level is existing, but its
1283  // level is different, then it cannot be the default.
1284  sValue.clear();
1285  }
1286  }
1288  }
1289 
1290  OUString referer;
1291  if (m_pDoc != nullptr) {
1292  auto const sh = m_pDoc->GetPersist();
1293  if (sh != nullptr && sh->HasName()) {
1294  referer = sh->GetMedium()->GetName();
1295  }
1296  }
1298  rFormat, CharStyleName, m_pDocShell ? & aUString : nullptr, referer);
1299 
1300 }
1301 
1302 uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat(
1303  const SwNumFormat& rFormat, OUString const& rCharFormatName,
1304  OUString const*const pHeadingStyleName, OUString const & referer)
1305 {
1306  bool bChapterNum = pHeadingStyleName != nullptr;
1307 
1308  std::vector<PropertyValue> aPropertyValues;
1309  aPropertyValues.reserve(32);
1310  //fill all properties into the array
1311 
1312  //adjust
1313  SvxAdjust eAdj = rFormat.GetNumAdjust();
1314  sal_Int16 nINT16 = aSvxToUnoAdjust[eAdj];
1315  aPropertyValues.push_back(comphelper::makePropertyValue("Adjust", nINT16));
1316 
1317  //parentnumbering
1318  nINT16 = rFormat.GetIncludeUpperLevels();
1319  aPropertyValues.push_back(comphelper::makePropertyValue("ParentNumbering", nINT16));
1320 
1321  //prefix
1322  OUString aUString = rFormat.GetPrefix();
1323  aPropertyValues.push_back(comphelper::makePropertyValue("Prefix", aUString));
1324 
1325  //suffix
1326  aUString = rFormat.GetSuffix();
1327  aPropertyValues.push_back(comphelper::makePropertyValue("Suffix", aUString));
1328 
1329  //listformat
1330  if (rFormat.HasListFormat())
1331  {
1332  aPropertyValues.push_back(comphelper::makePropertyValue("ListFormat", rFormat.GetListFormat()));
1333  }
1334 
1335  //char style name
1336  aUString.clear();
1337  SwStyleNameMapper::FillProgName( rCharFormatName, aUString, SwGetPoolIdFromName::ChrFmt);
1338  aPropertyValues.push_back(comphelper::makePropertyValue("CharStyleName", aUString));
1339 
1340  //startvalue
1341  nINT16 = rFormat.GetStart();
1342  aPropertyValues.push_back(comphelper::makePropertyValue("StartWith", nINT16));
1343 
1345  {
1346  //leftmargin
1347  sal_Int32 nINT32 = convertTwipToMm100(rFormat.GetAbsLSpace());
1348  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_LEFT_MARGIN, nINT32));
1349 
1350  //chartextoffset
1351  nINT32 = convertTwipToMm100(rFormat.GetCharTextDistance());
1352  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_SYMBOL_TEXT_DISTANCE, nINT32));
1353 
1354  //firstlineoffset
1355  nINT32 = convertTwipToMm100(rFormat.GetFirstLineOffset());
1356  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_FIRST_LINE_OFFSET, nINT32));
1357  }
1358 
1359  // PositionAndSpaceMode
1360  nINT16 = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION;
1362  {
1363  nINT16 = PositionAndSpaceMode::LABEL_ALIGNMENT;
1364  }
1365  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_POSITION_AND_SPACE_MODE, nINT16));
1366 
1368  {
1369  // LabelFollowedBy
1370  nINT16 = LabelFollow::LISTTAB;
1371  if ( rFormat.GetLabelFollowedBy() == SvxNumberFormat::SPACE )
1372  {
1373  nINT16 = LabelFollow::SPACE;
1374  }
1375  else if ( rFormat.GetLabelFollowedBy() == SvxNumberFormat::NOTHING )
1376  {
1377  nINT16 = LabelFollow::NOTHING;
1378  }
1379  else if ( rFormat.GetLabelFollowedBy() == SvxNumberFormat::NEWLINE )
1380  {
1381  nINT16 = LabelFollow::NEWLINE;
1382  }
1383  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_LABEL_FOLLOWED_BY, nINT16));
1384 
1385  // ListtabStopPosition
1386  sal_Int32 nINT32 = convertTwipToMm100(rFormat.GetListtabPos());
1387  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_LISTTAB_STOP_POSITION, nINT32));
1388 
1389  // FirstLineIndent
1390  nINT32 = convertTwipToMm100(rFormat.GetFirstLineIndent());
1391  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_FIRST_LINE_INDENT, nINT32));
1392 
1393  // IndentAt
1394  nINT32 = convertTwipToMm100(rFormat.GetIndentAt());
1395  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_INDENT_AT, nINT32));
1396  }
1397 
1398  //numberingtype
1399  nINT16 = rFormat.GetNumberingType();
1400  aPropertyValues.push_back(comphelper::makePropertyValue("NumberingType", nINT16));
1401 
1402  if(!bChapterNum)
1403  {
1404  if(SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1405  {
1406  sal_UCS4 cBullet = rFormat.GetBulletChar();
1407 
1408  //BulletId
1409  nINT16 = cBullet;
1410  aPropertyValues.push_back(comphelper::makePropertyValue("BulletId", nINT16));
1411 
1412  std::optional<vcl::Font> pFont = rFormat.GetBulletFont();
1413 
1414  //BulletChar
1415  aUString = OUString(&cBullet, 1);
1416  aPropertyValues.push_back(comphelper::makePropertyValue("BulletChar", aUString));
1417 
1418  //BulletFontName
1419  aUString = pFont ? pFont->GetStyleName() : OUString();
1420  aPropertyValues.push_back(comphelper::makePropertyValue("BulletFontName", aUString));
1421 
1422  //BulletFont
1423  if(pFont)
1424  {
1425  awt::FontDescriptor aDesc;
1426  SvxUnoFontDescriptor::ConvertFromFont( *pFont, aDesc );
1427  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_BULLET_FONT, aDesc));
1428  }
1429  }
1430  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1431  {
1432  const SvxBrushItem* pBrush = rFormat.GetBrush();
1433  const Graphic* pGraphic = pBrush ? pBrush->GetGraphic(referer) : nullptr;
1434  if (pGraphic)
1435  {
1436  //GraphicBitmap
1437  uno::Reference<awt::XBitmap> xBitmap(pGraphic->GetXGraphic(), uno::UNO_QUERY);
1438  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC_BITMAP, xBitmap));
1439  }
1440 
1441  Size aSize = rFormat.GetGraphicSize();
1442  // #i101131#
1443  // adjust conversion due to type mismatch between <Size> and <awt::Size>
1444  awt::Size aAwtSize(convertTwipToMm100(aSize.Width()), convertTwipToMm100(aSize.Height()));
1445  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC_SIZE, aAwtSize));
1446 
1447  const SwFormatVertOrient* pOrient = rFormat.GetGraphicOrientation();
1448  if(pOrient)
1449  {
1450  uno::Any any;
1451  pOrient->QueryValue(any);
1452  aPropertyValues.emplace_back(
1453  UNO_NAME_VERT_ORIENT, -1, any, PropertyState_DIRECT_VALUE);
1454  }
1455  }
1456  }
1457  else
1458  {
1459  aUString = *pHeadingStyleName;
1460  aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_HEADING_STYLE_NAME, aUString));
1461  }
1462 
1463  return ::comphelper::containerToSequence(aPropertyValues);
1464 }
1465 
1467  SwNumRule& rNumRule,
1468  const uno::Sequence<beans::PropertyValue>& rProperties, sal_Int32 nIndex)
1469 {
1470  SolarMutexGuard aGuard;
1471  OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
1472 
1473  SwNumFormat aFormat(rNumRule.Get( o3tl::narrowing<sal_uInt16>(nIndex) ));
1474 
1475  OUString sHeadingStyleName;
1476  OUString sParagraphStyleName;
1477 
1479  &m_sNewBulletFontNames[nIndex],
1480  &sHeadingStyleName, &sParagraphStyleName,
1481  m_pDoc, m_pDocShell, rProperties);
1482 
1483 
1484  if (m_pDoc && !sParagraphStyleName.isEmpty())
1485  {
1486  const SwTextFormatColls* pColls = m_pDoc->GetTextFormatColls();
1487  const size_t nCount = pColls->size();
1488  for (size_t k = 0; k < nCount; ++k)
1489  {
1490  SwTextFormatColl &rTextColl = *((*pColls)[k]);
1491  if (rTextColl.GetName() == sParagraphStyleName)
1492  rTextColl.SetFormatAttr( SwNumRuleItem( rNumRule.GetName()));
1493  }
1494  }
1495 
1496  if (!sHeadingStyleName.isEmpty())
1497  {
1498  assert(m_pDocShell);
1500  const size_t nCount = pColls->size();
1501  for (size_t k = 0; k < nCount; ++k)
1502  {
1503  SwTextFormatColl &rTextColl = *((*pColls)[k]);
1504  if (rTextColl.IsDefault())
1505  continue;
1506  if (rTextColl.IsAssignedToListLevelOfOutlineStyle() &&
1507  rTextColl.GetAssignedOutlineStyleLevel() == nIndex &&
1508  rTextColl.GetName() != sHeadingStyleName)
1509  {
1511  }
1512  else if (rTextColl.GetName() == sHeadingStyleName)
1513  {
1514  rTextColl.AssignToListLevelOfOutlineStyle( nIndex );
1515  }
1516  }
1517  }
1518 
1519  rNumRule.Set(o3tl::narrowing<sal_uInt16>(nIndex), aFormat);
1520 }
1521 
1523  SwNumFormat & aFormat,
1524  OUString & rCharStyleName, OUString *const pBulletFontName,
1525  OUString *const pHeadingStyleName,
1526  OUString *const pParagraphStyleName,
1527  SwDoc *const pDoc,
1528  SwDocShell *const pDocShell,
1529  const uno::Sequence<beans::PropertyValue>& rProperties)
1530 {
1531  assert(pDoc == nullptr || pDocShell == nullptr); // can't be both ordinary and chapter numbering
1532 
1533  bool bWrongArg = false;
1534  std::unique_ptr<SvxBrushItem> pSetBrush;
1535  std::unique_ptr<Size> pSetSize;
1536  std::unique_ptr<SwFormatVertOrient> pSetVOrient;
1537  bool bCharStyleNameSet = false;
1538 
1539  for (const beans::PropertyValue& rProp : rProperties)
1540  {
1541  if (rProp.Name == UNO_NAME_ADJUST)
1542  {
1543  sal_Int16 nValue = text::HoriOrientation::NONE;
1544  rProp.Value >>= nValue;
1545  if (nValue > text::HoriOrientation::NONE &&
1546  nValue <= text::HoriOrientation::LEFT &&
1547  USHRT_MAX != aUnoToSvxAdjust[nValue])
1548  {
1549  aFormat.SetNumAdjust(static_cast<SvxAdjust>(aUnoToSvxAdjust[nValue]));
1550  }
1551  else
1552  bWrongArg = true;
1553  }
1554  else if (rProp.Name == UNO_NAME_PARENT_NUMBERING)
1555  {
1556  sal_Int16 nSet = 0;
1557  rProp.Value >>= nSet;
1558  if(nSet >= 0 && MAXLEVEL >= nSet)
1559  aFormat.SetIncludeUpperLevels( static_cast< sal_uInt8 >(nSet) );
1560  }
1561  else if (rProp.Name == UNO_NAME_PREFIX)
1562  {
1563  OUString uTmp;
1564  rProp.Value >>= uTmp;
1565  aFormat.SetPrefix(uTmp);
1566  }
1567  else if (rProp.Name == UNO_NAME_SUFFIX)
1568  {
1569  OUString uTmp;
1570  rProp.Value >>= uTmp;
1571  aFormat.SetSuffix(uTmp);
1572  }
1573  else if (rProp.Name == UNO_NAME_CHAR_STYLE_NAME)
1574  {
1575  bCharStyleNameSet = true;
1576  OUString uTmp;
1577  rProp.Value >>= uTmp;
1578  OUString sCharFormatName;
1580  SwDoc *const pLocalDoc = pDocShell ? pDocShell->GetDoc() : pDoc;
1581  if (sCharFormatName == UNO_NAME_CHARACTER_FORMAT_NONE)
1582  {
1583  rCharStyleName = aInvalidStyle;
1584  aFormat.SetCharFormat(nullptr);
1585  }
1586  else if (pLocalDoc)
1587  {
1588  SwCharFormat* pCharFormat = nullptr;
1589  if (!sCharFormatName.isEmpty())
1590  {
1591  pCharFormat = pLocalDoc->FindCharFormatByName(sCharFormatName);
1592  if(!pCharFormat)
1593  {
1594 
1595  SfxStyleSheetBase* pBase;
1596  SfxStyleSheetBasePool* pPool = pLocalDoc->GetDocShell()->GetStyleSheetPool();
1597  pBase = pPool->Find(sCharFormatName, SfxStyleFamily::Char);
1598  if(!pBase)
1599  pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char);
1600  pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
1601  }
1602  }
1603  aFormat.SetCharFormat( pCharFormat );
1604  // #i51842#
1605  // If the character format has been found its name should not be in the
1606  // char style names array
1607  rCharStyleName.clear();
1608  }
1609  else
1610  rCharStyleName = sCharFormatName;
1611  }
1612  else if (rProp.Name == UNO_NAME_START_WITH)
1613  {
1614  sal_Int16 nVal = 0;
1615  rProp.Value >>= nVal;
1616  aFormat.SetStart(nVal);
1617  }
1618  else if (rProp.Name == UNO_NAME_LEFT_MARGIN)
1619  {
1620  sal_Int32 nValue = 0;
1621  rProp.Value >>= nValue;
1622  // #i23727# nValue can be negative
1624  }
1625  else if (rProp.Name == UNO_NAME_SYMBOL_TEXT_DISTANCE)
1626  {
1627  sal_Int32 nValue = 0;
1628  rProp.Value >>= nValue;
1629  if (nValue >= 0)
1631  else
1632  bWrongArg = true;
1633  }
1634  else if (rProp.Name == UNO_NAME_FIRST_LINE_OFFSET)
1635  {
1636  sal_Int32 nValue = 0;
1637  rProp.Value >>= nValue;
1638  // #i23727# nValue can be positive
1639  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1640  aFormat.SetFirstLineOffset(nValue);
1641  }
1642  else if (rProp.Name == UNO_NAME_POSITION_AND_SPACE_MODE)
1643  {
1644  sal_Int16 nValue = 0;
1645  rProp.Value >>= nValue;
1646  if ( nValue == 0 )
1647  {
1649  }
1650  else if ( nValue == 1 )
1651  {
1653  }
1654  else
1655  {
1656  bWrongArg = true;
1657  }
1658  }
1659  else if (rProp.Name == UNO_NAME_LABEL_FOLLOWED_BY)
1660  {
1661  sal_Int16 nValue = 0;
1662  rProp.Value >>= nValue;
1663  if ( nValue == LabelFollow::LISTTAB )
1664  {
1666  }
1667  else if ( nValue == LabelFollow::SPACE )
1668  {
1670  }
1671  else if ( nValue == LabelFollow::NOTHING )
1672  {
1674  }
1675  else if ( nValue == LabelFollow::NEWLINE )
1676  {
1678  }
1679  else
1680  {
1681  bWrongArg = true;
1682  }
1683  }
1684  else if (rProp.Name == UNO_NAME_LISTTAB_STOP_POSITION)
1685  {
1686  sal_Int32 nValue = 0;
1687  rProp.Value >>= nValue;
1688  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1689  if ( nValue >= 0 )
1690  {
1691  aFormat.SetListtabPos( nValue );
1692  }
1693  else
1694  {
1695  bWrongArg = true;
1696  }
1697  }
1698  else if (rProp.Name == UNO_NAME_FIRST_LINE_INDENT)
1699  {
1700  sal_Int32 nValue = 0;
1701  rProp.Value >>= nValue;
1702  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1703  aFormat.SetFirstLineIndent( nValue );
1704  }
1705  else if (rProp.Name == UNO_NAME_INDENT_AT)
1706  {
1707  sal_Int32 nValue = 0;
1708  rProp.Value >>= nValue;
1709  nValue = o3tl::toTwips(nValue, o3tl::Length::mm100);
1710  aFormat.SetIndentAt( nValue );
1711  }
1712  else if (rProp.Name == UNO_NAME_NUMBERING_TYPE)
1713  {
1714  sal_Int16 nSet = 0;
1715  rProp.Value >>= nSet;
1716  if(nSet >= 0)
1717  aFormat.SetNumberingType(static_cast<SvxNumType>(nSet));
1718  else
1719  bWrongArg = true;
1720  }
1721  else if (rProp.Name == UNO_NAME_PARAGRAPH_STYLE_NAME)
1722  {
1723  if (pParagraphStyleName)
1724  {
1725  OUString uTmp;
1726  rProp.Value >>= uTmp;
1727  OUString sStyleName;
1729  *pParagraphStyleName = sStyleName;
1730  }
1731  }
1732  else if (rProp.Name == UNO_NAME_BULLET_ID)
1733  {
1734  sal_Int16 nSet = 0;
1735  if( rProp.Value >>= nSet )
1736  aFormat.SetBulletChar(nSet);
1737  else
1738  bWrongArg = true;
1739  }
1740  else if (rProp.Name == UNO_NAME_BULLET_FONT)
1741  {
1742  awt::FontDescriptor desc;
1743  if (rProp.Value >>= desc)
1744  {
1745  // #i93725#
1746  // do not accept "empty" font
1747  if (!desc.Name.isEmpty())
1748  {
1749  vcl::Font aFont;
1751  aFormat.SetBulletFont(&aFont);
1752  }
1753  }
1754  else
1755  bWrongArg = true;
1756  }
1757  else if (rProp.Name == UNO_NAME_BULLET_FONT_NAME)
1758  {
1759  OUString sBulletFontName;
1760  rProp.Value >>= sBulletFontName;
1761  SwDocShell *const pLclDocShell = pDocShell ? pDocShell : pDoc ? pDoc->GetDocShell() : nullptr;
1762  if (!sBulletFontName.isEmpty() && pLclDocShell)
1763  {
1764  const SvxFontListItem* pFontListItem =
1765  static_cast<const SvxFontListItem* >(pLclDocShell
1766  ->GetItem( SID_ATTR_CHAR_FONTLIST ));
1767  const FontList* pList = pFontListItem->GetFontList();
1768  FontMetric aFontMetric = pList->Get(
1769  sBulletFontName, WEIGHT_NORMAL, ITALIC_NONE);
1770  vcl::Font aFont(aFontMetric);
1771  aFormat.SetBulletFont(&aFont);
1772  }
1773  else if (pBulletFontName)
1774  *pBulletFontName = sBulletFontName;
1775  }
1776  else if (rProp.Name == UNO_NAME_BULLET_CHAR)
1777  {
1778  OUString aChar;
1779  rProp.Value >>= aChar;
1780  if (aChar.isEmpty())
1781  {
1782  // If w:lvlText's value is null - set bullet char to zero
1783  aFormat.SetBulletChar(u'\0');
1784  }
1785  else
1786  {
1787  sal_Int32 nIndexUtf16 = 0;
1788  sal_UCS4 cBullet = aChar.iterateCodePoints(&nIndexUtf16);
1789  if (aChar.getLength() == nIndexUtf16)
1790  aFormat.SetBulletChar(cBullet);
1791  else
1792  bWrongArg = true;
1793  }
1794  }
1795  else if (rProp.Name == UNO_NAME_GRAPHIC)
1796  {
1797  uno::Reference<graphic::XGraphic> xGraphic;
1798  if (rProp.Value >>= xGraphic)
1799  {
1800  if (!pSetBrush)
1801  {
1802  const SvxBrushItem* pOrigBrush = aFormat.GetBrush();
1803  if(pOrigBrush)
1804  pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
1805  else
1806  pSetBrush.reset(new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND));
1807  }
1808  Graphic aGraphic(xGraphic);
1809  pSetBrush->SetGraphic(aGraphic);
1810  }
1811  else
1812  bWrongArg = true;
1813  }
1814  else if (rProp.Name == UNO_NAME_GRAPHIC_BITMAP)
1815  {
1816  uno::Reference<awt::XBitmap> xBitmap;
1817  if (rProp.Value >>= xBitmap)
1818  {
1819  if(!pSetBrush)
1820  {
1821  const SvxBrushItem* pOrigBrush = aFormat.GetBrush();
1822  if(pOrigBrush)
1823  pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
1824  else
1825  pSetBrush.reset(new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND));
1826  }
1827 
1828  uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1829  Graphic aGraphic(xGraphic);
1830  pSetBrush->SetGraphic(aGraphic);
1831  }
1832  else
1833  bWrongArg = true;
1834  }
1835  else if (rProp.Name == UNO_NAME_GRAPHIC_SIZE)
1836  {
1837  if(!pSetSize)
1838  pSetSize.reset(new Size);
1839  awt::Size size;
1840  if (rProp.Value >>= size)
1841  {
1842  pSetSize->setWidth(o3tl::toTwips(size.Width, o3tl::Length::mm100));
1843  pSetSize->setHeight(o3tl::toTwips(size.Height, o3tl::Length::mm100));
1844  }
1845  else
1846  bWrongArg = true;
1847  }
1848  else if (rProp.Name == UNO_NAME_VERT_ORIENT)
1849  {
1850  if(!pSetVOrient)
1851  {
1852  if(aFormat.GetGraphicOrientation())
1853  pSetVOrient.reset(aFormat.GetGraphicOrientation()->Clone());
1854  else
1855  pSetVOrient.reset(new SwFormatVertOrient);
1856  }
1857  pSetVOrient->PutValue(rProp.Value, MID_VERTORIENT_ORIENT);
1858  }
1859  else if (rProp.Name == UNO_NAME_HEADING_STYLE_NAME
1860  && pDocShell) // only on chapter numbering
1861  {
1862  if (pHeadingStyleName)
1863  {
1864  OUString uTmp;
1865  rProp.Value >>= uTmp;
1866  OUString sStyleName;
1868  *pHeadingStyleName = sStyleName;
1869  }
1870  }
1871  else if (rProp.Name == UNO_NAME_BULLET_REL_SIZE)
1872  {
1873  // BulletRelSize - unsupported - only available in Impress
1874  }
1875  else if (rProp.Name == UNO_NAME_BULLET_COLOR)
1876  {
1877  // BulletColor - ignored too
1878  }
1879  else if (rProp.Name == UNO_NAME_GRAPHIC_URL)
1880  {
1881  OUString aURL;
1882  if (rProp.Value >>= aURL)
1883  {
1884  if(!pSetBrush)
1885  {
1886  const SvxBrushItem* pOrigBrush = aFormat.GetBrush();
1887  if(pOrigBrush)
1888  pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
1889  else
1890  pSetBrush.reset(new SvxBrushItem(OUString(), OUString(), GPOS_AREA, RES_BACKGROUND));
1891  }
1892 
1893  Graphic aGraphic = vcl::graphic::loadFromURL(aURL);
1894  if (!aGraphic.IsNone())
1895  pSetBrush->SetGraphic(aGraphic);
1896  }
1897  else
1898  bWrongArg = true;
1899  }
1900  else if (rProp.Name == UNO_NAME_LIST_FORMAT)
1901  {
1902  OUString uTmp;
1903  rProp.Value >>= uTmp;
1904  aFormat.SetListFormat(uTmp);
1905  }
1906  else
1907  {
1908  // Invalid property name
1909  SAL_WARN("sw.uno", "Unknown/incorrect property " << rProp.Name << ", failing");
1910  throw uno::RuntimeException("Unknown/incorrect property " + rProp.Name);
1911  }
1912  }
1913  if(!bWrongArg && (pSetBrush || pSetSize || pSetVOrient))
1914  {
1915  if(!pSetBrush && aFormat.GetBrush())
1916  pSetBrush.reset(new SvxBrushItem(*aFormat.GetBrush()));
1917 
1918  if(pSetBrush)
1919  {
1920  if(!pSetVOrient && aFormat.GetGraphicOrientation())
1921  pSetVOrient.reset( new SwFormatVertOrient(*aFormat.GetGraphicOrientation()) );
1922 
1923  if(!pSetSize)
1924  {
1925  pSetSize.reset(new Size(aFormat.GetGraphicSize()));
1926  if(!pSetSize->Width() || !pSetSize->Height())
1927  {
1928  const Graphic* pGraphic = pSetBrush->GetGraphic();
1929  if(pGraphic)
1930  *pSetSize = ::GetGraphicSizeTwip(*pGraphic, nullptr);
1931  }
1932  }
1933  sal_Int16 eOrient = pSetVOrient ?
1934  pSetVOrient->GetVertOrient() : text::VertOrientation::NONE;
1935  aFormat.SetGraphicBrush( pSetBrush.get(), pSetSize.get(), text::VertOrientation::NONE == eOrient ? nullptr : &eOrient );
1936  }
1937  }
1938  if ((!bCharStyleNameSet || rCharStyleName.isEmpty())
1939  && aFormat.GetNumberingType() == NumberingType::BITMAP
1940  && !aFormat.GetCharFormat()
1941  && !SwXNumberingRules::isInvalidStyle(rCharStyleName))
1942  {
1943  OUString tmp;
1945  rCharStyleName = tmp;
1946  }
1947 
1948  if(bWrongArg)
1949  throw lang::IllegalArgumentException();
1950 }
1951 
1952 uno::Reference< XPropertySetInfo > SwXNumberingRules::getPropertySetInfo()
1953 {
1954  static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropertySet->getPropertySetInfo();
1955  return aRef;
1956 }
1957 
1958 void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
1959 {
1960  SolarMutexGuard aGuard;
1961  std::unique_ptr<SwNumRule> pDocRule;
1962  SwNumRule* pCreatedRule = nullptr;
1963  if(!m_pNumRule)
1964  {
1965  if(m_pDocShell)
1966  {
1967  pDocRule.reset(new SwNumRule(*m_pDocShell->GetDoc()->GetOutlineNumRule()));
1968  }
1969  else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty())
1970  {
1971  pCreatedRule = m_pDoc->FindNumRulePtr(m_sCreatedNumRuleName);
1972  }
1973 
1974  }
1975  if(!m_pNumRule && !pDocRule && !pCreatedRule)
1976  throw RuntimeException();
1977 
1978  if(rPropertyName == UNO_NAME_IS_AUTOMATIC)
1979  {
1980  bool bVal = *o3tl::doAccess<bool>(rValue);
1981  if(!pCreatedRule)
1982  pDocRule ? pDocRule->SetAutoRule(bVal) : m_pNumRule->SetAutoRule(bVal);
1983  }
1984  else if(rPropertyName == UNO_NAME_IS_CONTINUOUS_NUMBERING)
1985  {
1986  bool bVal = *o3tl::doAccess<bool>(rValue);
1987  pDocRule ? pDocRule->SetContinusNum(bVal) :
1988  pCreatedRule ? pCreatedRule->SetContinusNum(bVal) : m_pNumRule->SetContinusNum(bVal);
1989  }
1990  else if(rPropertyName == UNO_NAME_NAME)
1991  {
1992  throw IllegalArgumentException();
1993  }
1994  else if(rPropertyName == UNO_NAME_IS_ABSOLUTE_MARGINS)
1995  {
1996  bool bVal = *o3tl::doAccess<bool>(rValue);
1997  pDocRule ? pDocRule->SetAbsSpaces(bVal) :
1998  pCreatedRule ? pCreatedRule->SetAbsSpaces(bVal) : m_pNumRule->SetAbsSpaces(bVal);
1999  }
2000  else if(rPropertyName == UNO_NAME_NUMBERING_IS_OUTLINE)
2001  {
2002  bool bVal = *o3tl::doAccess<bool>(rValue);
2003  SwNumRuleType eNumRuleType = bVal ? OUTLINE_RULE : NUM_RULE;
2004  pDocRule ? pDocRule->SetRuleType(eNumRuleType) :
2005  pCreatedRule ? pCreatedRule->SetRuleType(eNumRuleType) : m_pNumRule->SetRuleType(eNumRuleType);
2006  }
2007  else if(rPropertyName == UNO_NAME_DEFAULT_LIST_ID)
2008  {
2009  throw IllegalArgumentException();
2010  }
2011  else
2012  throw UnknownPropertyException(rPropertyName);
2013 
2014  if(pDocRule)
2015  {
2016  assert(m_pDocShell);
2017  m_pDocShell->GetDoc()->SetOutlineNumRule(*pDocRule);
2018  pDocRule.reset();
2019  }
2020  else if(pCreatedRule)
2021  {
2022  pCreatedRule->Validate(*m_pDoc);
2023  }
2024 }
2025 
2026 Any SwXNumberingRules::getPropertyValue( const OUString& rPropertyName )
2027 {
2028  Any aRet;
2029  const SwNumRule* pRule = m_pNumRule;
2030  if(!pRule && m_pDocShell)
2031  pRule = m_pDocShell->GetDoc()->GetOutlineNumRule();
2032  else if(m_pDoc && !m_sCreatedNumRuleName.isEmpty())
2034  if(!pRule)
2035  throw RuntimeException();
2036 
2037  if(rPropertyName == UNO_NAME_IS_AUTOMATIC)
2038  {
2039  aRet <<= pRule->IsAutoRule();
2040  }
2041  else if(rPropertyName == UNO_NAME_IS_CONTINUOUS_NUMBERING)
2042  {
2043  aRet <<= pRule->IsContinusNum();
2044  }
2045  else if(rPropertyName == UNO_NAME_NAME)
2046  aRet <<= pRule->GetName();
2047  else if(rPropertyName == UNO_NAME_IS_ABSOLUTE_MARGINS)
2048  {
2049  aRet <<= pRule->IsAbsSpaces();
2050  }
2051  else if(rPropertyName == UNO_NAME_NUMBERING_IS_OUTLINE)
2052  {
2053  aRet <<= pRule->IsOutlineRule();
2054  }
2055  else if(rPropertyName == UNO_NAME_DEFAULT_LIST_ID)
2056  {
2057  OSL_ENSURE( !pRule->GetDefaultListId().isEmpty(),
2058  "<SwXNumberingRules::getPropertyValue(..)> - no default list id found. Serious defect." );
2059  aRet <<= pRule->GetDefaultListId();
2060  }
2061  else
2062  throw UnknownPropertyException(rPropertyName);
2063  return aRet;
2064 }
2065 
2067  const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
2068 {
2069 }
2070 
2072  const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
2073 {
2074 }
2075 
2077  const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
2078 {
2079 }
2080 
2082  const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
2083 {
2084 }
2085 
2087 {
2088  if(m_pNumRule)
2089  {
2090  OUString aString;
2092  return aString;
2093  }
2094  // consider chapter numbering <SwXNumberingRules>
2095  if ( m_pDocShell )
2096  {
2097  OUString aString;
2099  aString, SwGetPoolIdFromName::NumRule );
2100  return aString;
2101  }
2102  return m_sCreatedNumRuleName;
2103 }
2104 
2105 void SwXNumberingRules::setName(const OUString& /*rName*/)
2106 {
2107  RuntimeException aExcept;
2108  aExcept.Message = "readonly";
2109  throw aExcept;
2110 }
2111 
2113 {
2114  if(rHint.GetId() == SfxHintId::Dying)
2115  {
2117  delete m_rParent.m_pNumRule;
2118  m_rParent.m_pNumRule = nullptr;
2119  m_rParent.m_pDoc = nullptr;
2120  }
2121 }
2122 
2124 {
2125  return "SwXChapterNumbering";
2126 }
2127 
2128 sal_Bool SwXChapterNumbering::supportsService(const OUString& rServiceName)
2129 {
2130  return cppu::supportsService(this, rServiceName);
2131 }
2132 
2134 {
2135  return { "com.sun.star.text.ChapterNumbering", "com.sun.star.text.NumberingRules" };
2136 }
2137 
2139  SwXNumberingRules(rDocSh)
2140 {
2141 }
2142 
2144 {
2145 }
2146 
2147 /* 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:338
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:613
const TranslateId STR_POOLCOLL_HEADLINE_ARY[]
Definition: unosett.cxx:1226
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:1033
#define WID_COUNT_LINES_IN_FRAMES
Definition: unosett.cxx:113
sal_UCS4 GetBulletChar() const
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
Definition: docftn.cxx:294
bool IsDefault() const
Definition: format.hxx:113
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: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 & 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:47
void SetPositionAndSpaceMode(SvxNumPositionAndSpaceMode ePositionAndSpaceMode)
#define UNO_NAME_GRAPHIC_BITMAP
Definition: unoprnms.hxx:45
#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:412
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:307
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:173
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:182
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosett.cxx:2066
constexpr OUStringLiteral UNO_NAME_CHAR_STYLE_NAME
virtual ~SwXFootnoteProperties() override
Definition: unosett.cxx:289
Definition: doc.hxx:188
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:93
void SetContinusNum(bool bFlag)
Definition: numrule.hxx:237
SwXEndnoteProperties(SwDoc *pDoc)
Definition: unosett.cxx:563
#define UNO_NAME_NUMBER_POSITION
Definition: unoprnms.hxx:168
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:146
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:115
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
Definition: docnum.cxx:2494
#define WID_PARAGRAPH_STYLE
Definition: unosett.cxx:99
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:1038
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:2133
#define UNO_NAME_VERT_ORIENT
Definition: unoprnms.hxx:330
#define WID_IS_AUTOMATIC
Definition: unomap.hxx:299
#define WID_NUMBERING_TYPE
Definition: unosett.cxx:96
#define UNO_NAME_GRAPHIC
Definition: unoprnms.hxx:161
#define UNO_NAME_PARAGRAPH_STYLE_NAME
Definition: unoprnms.hxx:829
void Validate(const SwDoc &rDoc)
Definition: number.cxx:1037
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:343
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:2071
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
#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
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
constexpr tools::Long Width() const
#define UNO_NAME_IS_CONTINUOUS_NUMBERING
Definition: unoprnms.hxx:467
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:308
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:1104
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Definition: unosett.cxx:1187
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:1388
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
static const SfxItemPropertySet * GetFootnoteSet()
Definition: unosett.cxx:117
#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:2076
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
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
Definition: unosett.cxx:1113
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:303
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:1466
#define UNO_NAME_IS_ABSOLUTE_MARGINS
Definition: unoprnms.hxx:469
const OUString & GetSuffix() const
virtual void Notify(const SfxHint &) override
Definition: unosett.cxx:2112
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:458
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
const css::uno::Sequence< sal_Int8 > & getSeq() const
#define UNO_NAME_NUMBERING_IS_OUTLINE
Definition: unoprnms.hxx:750
virtual ~SwXChapterNumbering() override
Definition: unosett.cxx:2143
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:2105
sal_uInt16 GetPosFromLeft() const
Definition: lineinfo.hxx:71
SwFootnoteNum m_eNum
Definition: ftninfo.hxx:98
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2416
static SwCharFormat * lcl_getCharFormat(SwDoc *pDoc, const uno::Any &aValue)
Definition: unosett.cxx:194
#define UNO_NAME_ANCHOR_CHAR_STYLE_NAME
Definition: unoprnms.hxx:79
OUString GetListFormat(bool bIncludePrefixSuffix=true) const
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:1958
constexpr OUStringLiteral UNO_NAME_PARENT_NUMBERING
LabelFollowedBy GetLabelFollowedBy() const
virtual SwFormatVertOrient * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrfrm.cxx:1383
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:156
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:248
bool HasCharFormat() const
Definition: lineinfo.hxx:92
SwXChapterNumbering(SwDocShell &rDocSh)
Definition: unosett.cxx:2138
const Any & any
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosett.cxx:1043
#define UNO_NAME_FOOTNOTE_COUNTING
Definition: unoprnms.hxx:255
virtual OUString SAL_CALL getName() override
Definition: unosett.cxx:2086
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:82
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1142
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
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
size
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:647
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:1302
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:1522
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:2128
#define UNO_NAME_SEPARATOR_INTERVAL
Definition: unoprnms.hxx:203
Represents the style of a text portion.
Definition: charfmt.hxx:26
#define UNO_NAME_INTERVAL
Definition: unoprnms.hxx:274
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:2081
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
#define UNO_NAME_ADJUST
Definition: unoprnms.hxx:473
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:145
size_t size() const
Definition: charformats.hxx:71
virtual OUString SAL_CALL getImplementationName() override
Definition: unosett.cxx:2123
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:620
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:151
const SfxItemPropertySet * m_pPropertySet
Definition: unosett.hxx:55
static void ConvertFromFont(const vcl::Font &rFont, css::awt::FontDescriptor &rDesc)
constexpr OUStringLiteral aInvalidStyle
Definition: unosett.cxx:1001
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:102
SwXLineNumberingProperties(SwDoc *pDoc)
Definition: unosett.cxx:765
#define UNO_NAME_SEPARATOR_TEXT
Definition: unoprnms.hxx:167
virtual sal_Int32 SAL_CALL getCount() override
Definition: unosett.cxx:1182
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:365
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unosett.cxx:1215
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosett.cxx:1952
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:603
#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:1220
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:1500
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:68
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
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: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:639
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:468
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:2450
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:754
#define UNO_NAME_BULLET_FONT_NAME
Definition: unoprnms.hxx:51
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosett.cxx:2026
#define UNO_NAME_SYMBOL_TEXT_DISTANCE
Definition: unoprnms.hxx:413
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: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:311
#define WID_INTERVAL
Definition: unosett.cxx:110
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
#define UNO_NAME_COUNT_EMPTY_LINES
Definition: unoprnms.hxx:242
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:46
css::uno::Sequence< css::beans::PropertyValue > GetNumberingRuleByIndex(const SwNumRule &rNumRule, sal_Int32 nIndex) const
Definition: unosett.cxx:1239
const OUString & GetDivider() const
Definition: lineinfo.hxx:66
#define WID_POSITION_END_OF_DOC
Definition: unosett.cxx:102
#define WID_CONTINUOUS
Definition: unomap.hxx:300
#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:1060
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
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:49
SwXNumberingRules(SwDocShell &rDocSh)
Definition: unosett.cxx:1078
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:114
Standard page.
Definition: poolfmt.hxx:170
#define UNO_NAME_RESTART_AT_EACH_PAGE
Definition: unoprnms.hxx:243
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosett.cxx:552
#define UNO_NAME_PAGE_STYLE_NAME
Definition: unoprnms.hxx:169
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:302
#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:304
#define UNO_NAME_NAME
Definition: unoprnms.hxx:77
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:301
virtual ~SwXEndnoteProperties() override
Definition: unosett.cxx:569
OUString m_sCreatedNumRuleName
Definition: unosett.hxx:153
const std::optional< vcl::Font > & GetBulletFont() const
Size GetGraphicSizeTwip(const Graphic &rGraphic, vcl::RenderContext *pOutDev)
Definition: swtypes.cxx:28
SfxMedium * GetMedium() const