LibreOffice Module xmloff (master)  1
xmlnumi.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 <com/sun/star/beans/PropertyValue.hpp>
21 #include <com/sun/star/beans/XPropertySet.hpp>
22 #include <com/sun/star/awt/Size.hpp>
23 #include <com/sun/star/frame/XModel.hpp>
24 #include <com/sun/star/graphic/XGraphic.hpp>
25 #include <com/sun/star/awt/FontDescriptor.hpp>
26 #include <com/sun/star/text/HoriOrientation.hpp>
27 #include <com/sun/star/text/VertOrientation.hpp>
28 #include <com/sun/star/text/PositionAndSpaceMode.hpp>
29 #include <com/sun/star/text/LabelFollow.hpp>
30 #include <com/sun/star/container/XNameContainer.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/style/XStyle.hpp>
33 #include <com/sun/star/io/XOutputStream.hpp>
34 #include <com/sun/star/awt/XBitmap.hpp>
35 #include <com/sun/star/style/NumberingType.hpp>
36 #include <com/sun/star/container/XIndexReplace.hpp>
37 
38 #include <o3tl/any.hxx>
39 #include <rtl/ustrbuf.hxx>
40 #include <sal/log.hxx>
41 #include <tools/diagnose_ex.h>
42 
43 #include <tools/fontenum.hxx>
44 #include <tools/color.hxx>
45 
46 #include <sax/tools/converter.hxx>
47 
48 #include <vcl/vclenum.hxx>
49 
50 #include <xmloff/xmltkmap.hxx>
51 #include <xmloff/namespacemap.hxx>
52 #include <xmloff/xmlnamespace.hxx>
53 #include <xmloff/xmlimp.hxx>
55 #include <xmloff/xmltoken.hxx>
56 
57 #include <xmloff/xmluconv.hxx>
58 #include "fonthdl.hxx"
60 #include <xmloff/families.hxx>
61 #include <xmloff/maptype.hxx>
62 
63 #include <xmloff/xmlnumi.hxx>
64 
65 using namespace ::com::sun::star;
66 using namespace ::com::sun::star::uno;
67 using namespace ::com::sun::star::style;
68 using namespace ::com::sun::star::text;
69 using namespace ::com::sun::star::beans;
70 using namespace ::com::sun::star::container;
71 using namespace ::com::sun::star::lang;
72 using namespace ::com::sun::star::frame;
73 using namespace ::xmloff::token;
74 using namespace ::com::sun::star::io;
75 
77 
78 namespace {
79 
81 {
83 
84 public:
85 
87  SvXMLImport& rImport, sal_Int32 nElement,
88  const Reference< xml::sax::XFastAttributeList >& xAttrList,
90 
91  virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/,
92  const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {}
93  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
94  sal_Int32 nElement,
95  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
96 };
97 
98 class SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl : public SvXMLImportContext
99 {
100 public:
101 
102  SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl(
103  SvXMLImport& rImport, sal_Int32 nElement,
104  const Reference< xml::sax::XFastAttributeList >& xAttrList,
106 };
107 
109 {
110  XML_TOK_TEXT_LEVEL_ATTR_LEVEL,
111  XML_TOK_TEXT_LEVEL_ATTR_STYLE_NAME,
112  XML_TOK_TEXT_LEVEL_ATTR_BULLET_CHAR,
113  XML_TOK_TEXT_LEVEL_ATTR_HREF,
114  XML_TOK_TEXT_LEVEL_ATTR_TYPE,
115  XML_TOK_TEXT_LEVEL_ATTR_SHOW,
116  XML_TOK_TEXT_LEVEL_ATTR_ACTUATE,
117  XML_TOK_TEXT_LEVEL_ATTR_NUM_FORMAT,
118  XML_TOK_TEXT_LEVEL_ATTR_NUM_PREFIX,
119  XML_TOK_TEXT_LEVEL_ATTR_NUM_SUFFIX,
120  XML_TOK_TEXT_LEVEL_ATTR_NUM_LETTER_SYNC,
121  XML_TOK_TEXT_LEVEL_ATTR_START_VALUE,
122  XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS
123 };
124 
125 }
126 
128 {
130 
131  OUString sPrefix;
132  OUString sSuffix;
133  OUString sTextStyleName;
134  OUString sNumFormat;
135  OUString sNumLetterSync;
136  OUString sBulletFontName;
138  OUString sImageURL;
139 
140  Reference < XOutputStream > xBase64Stream;
141 
142  sal_Int32 nLevel;
143  sal_Int32 nSpaceBefore;
144  sal_Int32 nMinLabelWidth;
145  sal_Int32 nMinLabelDist;
146  sal_Int32 nImageWidth;
147  sal_Int32 nImageHeight;
148  sal_Int16 nNumStartValue;
149  sal_Int16 nNumDisplayLevels;
150 
151  sal_Int16 eAdjust;
152  sal_Int16 eBulletFontFamily;
153  sal_Int16 eBulletFontPitch;
154  rtl_TextEncoding eBulletFontEncoding;
155  sal_Int16 eImageVertOrient;
156 
158 
159  sal_Int16 nRelSize;
161 
162  sal_Int16 ePosAndSpaceMode;
163  sal_Int16 eLabelFollowedBy;
165  sal_Int32 nFirstLineIndent;
166  sal_Int32 nIndentAt;
167 
168  bool bBullet : 1;
169  bool bImage : 1;
170  bool bNum : 1;
171  bool bHasColor : 1;
172 
173  void SetRelSize( sal_Int16 nRel ) { nRelSize = nRel; }
174  void SetColor( Color nColor )
175  { m_nColor = nColor; bHasColor = true; }
176  void SetSpaceBefore( sal_Int32 nSet ) { nSpaceBefore = nSet; }
177  void SetMinLabelWidth( sal_Int32 nSet ) { nMinLabelWidth = nSet; }
178  void SetMinLabelDist( sal_Int32 nSet ) { nMinLabelDist = nSet; }
179  void SetAdjust( sal_Int16 eSet ) { eAdjust = eSet; }
180 
181  void SetBulletFontName( const OUString& rSet ) { sBulletFontName = rSet; }
182  void SetBulletFontStyleName( const OUString& rSet )
183  { sBulletFontStyleName = rSet; }
184  void SetBulletFontFamily( sal_Int16 eSet ) { eBulletFontFamily = eSet; }
185  void SetBulletFontPitch( sal_Int16 eSet ) { eBulletFontPitch = eSet; }
186  void SetBulletFontEncoding( rtl_TextEncoding eSet )
187  { eBulletFontEncoding = eSet; }
188 
189  void SetImageWidth( sal_Int32 nSet ) { nImageWidth = nSet; }
190  void SetImageHeight( sal_Int32 nSet ) { nImageHeight = nSet; }
191  void SetImageVertOrient( sal_Int16 eSet )
192  { eImageVertOrient = eSet; }
193 
194 public:
195 
197  SvXMLImport& rImport, sal_Int32 nElement,
198  const Reference< xml::sax::XFastAttributeList > & xAttrList );
199 
200  virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/,
201  const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {}
202  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
203  sal_Int32 nElement,
204  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
205 
206  sal_Int32 GetLevel() const { return nLevel; }
208 
209  void SetPosAndSpaceMode( sal_Int16 eValue )
210  {
211  ePosAndSpaceMode = eValue;
212  }
213  void SetLabelFollowedBy( sal_Int16 eValue )
214  {
215  eLabelFollowedBy = eValue;
216  }
217  void SetListtabStopPosition( sal_Int32 nValue )
218  {
219  nListtabStopPosition = nValue;
220  }
221  void SetFirstLineIndent( sal_Int32 nValue )
222  {
223  nFirstLineIndent = nValue;
224  }
225  void SetIndentAt( sal_Int32 nValue )
226  {
227  nIndentAt = nValue;
228  }
229 };
230 
231 constexpr OUStringLiteral gsStarBats( u"StarBats" );
232 constexpr OUStringLiteral gsStarMath( u"StarMath" );
233 
235  SvXMLImport& rImport, sal_Int32 nElement,
236  const Reference< xml::sax::XFastAttributeList > & xAttrList )
237 
238 : SvXMLImportContext( rImport )
239 , sNumFormat( "1" )
240 , nLevel( -1 )
241 , nSpaceBefore( 0 )
242 , nMinLabelWidth( 0 )
243 , nMinLabelDist( 0 )
244 , nImageWidth( 0 )
245 , nImageHeight( 0 )
246 , nNumStartValue( 1 )
247 , nNumDisplayLevels( 1 )
248 , eAdjust( HoriOrientation::LEFT )
249 , eBulletFontFamily( FAMILY_DONTKNOW )
250 , eBulletFontPitch( PITCH_DONTKNOW )
251 , eBulletFontEncoding( RTL_TEXTENCODING_DONTKNOW )
252 , eImageVertOrient(0)
253 , cBullet( 0 )
254 , nRelSize(0)
255 , m_nColor(0)
256 , ePosAndSpaceMode( PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION )
257 , eLabelFollowedBy( LabelFollow::LISTTAB )
258 , nListtabStopPosition( 0 )
259 , nFirstLineIndent( 0 )
260 , nIndentAt( 0 )
261 , bBullet( false )
262 , bImage( false )
263 , bNum( false )
264 , bHasColor( false )
265 {
266  switch (nElement & TOKEN_MASK)
267  {
270  bNum = true;
271  break;
273  bBullet = true;
274  break;
276  bImage = true;
277  break;
278  }
279 
280  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
281  {
282  const OUString sValue = aIter.toString();
283  switch( aIter.getToken() )
284  {
285  case XML_ELEMENT(TEXT, XML_LEVEL):
286  nLevel = sValue.toInt32();
287  if( nLevel >= 1 )
288  nLevel--;
289  else
290  nLevel = 0;
291  break;
293  sTextStyleName = sValue;
294  break;
296  if (!sValue.isEmpty())
297  {
298  sal_Int32 nIndexUtf16 = 0;
299  cBullet = sValue.iterateCodePoints(&nIndexUtf16);
300  }
301  break;
302  case XML_ELEMENT(XLINK, XML_HREF):
303  if( bImage )
304  sImageURL = sValue;
305  break;
306  case XML_ELEMENT(XLINK, XML_TYPE):
307  case XML_ELEMENT(XLINK, XML_SHOW):
308  case XML_ELEMENT(XLINK, XML_ACTUATE):
309  // This properties will be ignored
310  break;
312  if( bNum )
313  sNumFormat = sValue;
314  break;
316  sPrefix = sValue;
317  break;
319  sSuffix = sValue;
320  break;
322  if( bNum )
323  sNumLetterSync = sValue;
324  break;
326  if( bNum )
327  {
328  sal_Int32 nTmp = sValue.toInt32();
330  (nTmp < 0) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX
331  : static_cast<sal_Int16>(nTmp) );
332  }
333  break;
335  if( bNum )
336  {
337  sal_Int32 nTmp = sValue.toInt32();
339  (nTmp < 1) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX
340  : static_cast<sal_Int16>(nTmp) );
341  }
342  break;
343  default:
344  SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
345  }
346  }
347 }
348 
349 css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLListLevelStyleContext_Impl::createFastChildContext(
350  sal_Int32 nElement,
351  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
352 {
353  if( nElement == XML_ELEMENT(STYLE, XML_LIST_LEVEL_PROPERTIES) ||
354  nElement == XML_ELEMENT(STYLE, XML_TEXT_PROPERTIES) )
355  {
357  nElement,
358  xAttrList,
359  *this );
360  }
361  else if( nElement == XML_ELEMENT(OFFICE, XML_BINARY_DATA) )
362  {
363  if( bImage && sImageURL.isEmpty() && !xBase64Stream.is() )
364  {
366  if( xBase64Stream.is() )
368  }
369  }
370  SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
371  return nullptr;
372 }
373 
375 {
376  sal_Int16 eType = NumberingType::NUMBER_NONE;
377 
378  sal_Int32 nCount = 0;
379  if( bBullet )
380  {
381  eType = NumberingType::CHAR_SPECIAL;
382  nCount = 15; // 'cBullet' will be written anyway if 'bBullet' is true
383  }
384  if( bImage )
385  {
386  eType = NumberingType::BITMAP;
387  nCount = 15;
388 
389  if( !sImageURL.isEmpty() || xBase64Stream.is() )
390  nCount++;
391  }
392  if( bNum )
393  {
394  eType = NumberingType::ARABIC;
396  eType, sNumFormat, sNumLetterSync, true );
397  nCount = 15;
398  }
399 
400  if( ( bBullet || bNum ) && nRelSize )
401  nCount++;
402 
403  if( !bImage && bHasColor )
404  {
405  nCount++;
406  }
407 
408  if (bBullet && !sSuffix.isEmpty())
409  {
410  sal_uInt16 const nVersion(GetImport().getGeneratorVersion());
411  sal_Int32 nUPD;
412  sal_Int32 nBuildId;
413  if (GetImport().getBuildIds(nUPD, nBuildId)
414  && ( (SvXMLImport::OOo_1x == nVersion)
415  || (SvXMLImport::OOo_2x == nVersion)
416  || (310 == nUPD) || (320 == nUPD) || (330 == nUPD)
417  || ((300 == nUPD) && (nBuildId <= 9573))))
418  {
419  // #i93908# OOo < 3.4 wrote a bogus suffix for bullet chars
420  sSuffix.clear(); // clear it
421  }
422  }
423 
424  Sequence<beans::PropertyValue> aPropSeq( nCount );
425  if( nCount > 0 )
426  {
427  beans::PropertyValue *pProps = aPropSeq.getArray();
428  sal_Int32 nPos = 0;
429  pProps[nPos].Name = "NumberingType";
430  pProps[nPos++].Value <<= eType ;
431 
432  pProps[nPos].Name = "Prefix";
433  pProps[nPos++].Value <<= sPrefix;
434 
435  pProps[nPos].Name = "Suffix";
436  pProps[nPos++].Value <<= sSuffix;
437 
438  pProps[nPos].Name = "Adjust";
439  pProps[nPos++].Value <<= eAdjust;
440 
442  pProps[nPos].Name = "LeftMargin";
443  pProps[nPos++].Value <<= nLeftMargin;
444 
445  sal_Int32 nFirstLineOffset = -nMinLabelWidth;
446 
447  pProps[nPos].Name = "FirstLineOffset";
448  pProps[nPos++].Value <<= nFirstLineOffset;
449 
450  pProps[nPos].Name = "SymbolTextDistance";
451  pProps[nPos++].Value <<= static_cast<sal_Int16>(nMinLabelDist);
452 
453  pProps[nPos].Name = "PositionAndSpaceMode";
454  pProps[nPos++].Value <<= ePosAndSpaceMode;
455  pProps[nPos].Name = "LabelFollowedBy";
456  pProps[nPos++].Value <<= eLabelFollowedBy;
457  pProps[nPos].Name = "ListtabStopPosition";
458  pProps[nPos++].Value <<= nListtabStopPosition;
459  pProps[nPos].Name = "FirstLineIndent";
460  pProps[nPos++].Value <<= nFirstLineIndent;
461  pProps[nPos].Name = "IndentAt";
462  pProps[nPos++].Value <<= nIndentAt;
463 
464  OUString sDisplayTextStyleName = GetImport().GetStyleDisplayName(
466  pProps[nPos].Name = "CharStyleName";
467  pProps[nPos++].Value <<= sDisplayTextStyleName;
468 
469  if( bBullet )
470  {
471  awt::FontDescriptor aFDesc;
472  aFDesc.Name = sBulletFontName;
473  if( !sBulletFontName.isEmpty() )
474  {
475  aFDesc.StyleName = sBulletFontStyleName;
476  aFDesc.Family = eBulletFontFamily;
477  aFDesc.Pitch = eBulletFontPitch;
478  aFDesc.CharSet = eBulletFontEncoding;
479  aFDesc.Weight = WEIGHT_DONTKNOW;
480  bool bStarSymbol = false;
481  if( aFDesc.Name.equalsIgnoreAsciiCase( gsStarBats ) )
482  {
484  bStarSymbol = true;
485  }
486  else if( aFDesc.Name.equalsIgnoreAsciiCase( gsStarMath ) )
487  {
489  bStarSymbol = true;
490  }
491  if( bStarSymbol )
492  aFDesc.Name = "StarSymbol" ;
493  }
494 
495  // Must append 'cBullet' even if it is zero
496  // if 'bBullet' is true and 'cBullet' is zero - BulletChar property must be 0.
497  pProps[nPos].Name = "BulletChar";
498  pProps[nPos++].Value <<= OUString(&cBullet, 1);
499 
500  pProps[nPos].Name = "BulletFont";
501  pProps[nPos++].Value <<= aFDesc;
502 
503  }
504 
505  if( bImage )
506  {
507  uno::Reference<graphic::XGraphic> xGraphic;
508  if (!sImageURL.isEmpty())
509  {
510  xGraphic = GetImport().loadGraphicByURL(sImageURL);
511  }
512  else if( xBase64Stream.is() )
513  {
515  }
516 
517  uno::Reference<awt::XBitmap> xBitmap;
518  if (xGraphic.is())
519  xBitmap.set(xGraphic, uno::UNO_QUERY);
520 
521  if (xBitmap.is())
522  {
523  pProps[nPos].Name = "GraphicBitmap";
524  pProps[nPos++].Value <<= xBitmap;
525  }
526 
527  awt::Size aSize(nImageWidth, nImageHeight);
528  pProps[nPos].Name = "GraphicSize";
529  pProps[nPos++].Value <<= aSize;
530 
531  pProps[nPos].Name = "VertOrient";
532  pProps[nPos++].Value <<= eImageVertOrient;
533  }
534 
535  if( bNum )
536  {
537  pProps[nPos].Name = "StartWith";
538  pProps[nPos++].Value <<= nNumStartValue;
539 
540  pProps[nPos].Name = "ParentNumbering";
541  pProps[nPos++].Value <<= nNumDisplayLevels;
542  }
543 
544  if( ( bNum || bBullet ) && nRelSize )
545  {
546  pProps[nPos].Name = "BulletRelSize";
547  pProps[nPos++].Value <<= nRelSize;
548  }
549 
550  if( !bImage && bHasColor )
551  {
552  pProps[nPos].Name = "BulletColor";
553  pProps[nPos++].Value <<= m_nColor;
554  }
555 
556  SAL_WARN_IF( nPos != nCount, "xmloff", "array under/overflow" );
557  }
558 
559  return aPropSeq;
560 }
561 
562 namespace {
563 
565 {
566  XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE,
567  XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_WIDTH,
568  XML_TOK_STYLE_ATTRIBUTES_ATTR_MIN_LABEL_DIST,
569  XML_TOK_STYLE_ATTRIBUTES_ATTR_TEXT_ALIGN,
570  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_NAME,
571  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY,
572  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_FAMILY_GENERIC,
573  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_STYLENAME,
574  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_PITCH,
575  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_CHARSET,
576  XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_POS,
577  XML_TOK_STYLE_ATTRIBUTES_ATTR_VERTICAL_REL,
578  XML_TOK_STYLE_ATTRIBUTES_ATTR_WIDTH,
579  XML_TOK_STYLE_ATTRIBUTES_ATTR_HEIGHT,
580  XML_TOK_STYLE_ATTRIBUTES_ATTR_COLOR,
581  XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR,
582  XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE,
583  XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE
584 };
585 
586 }
587 
588 SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
589  SvXMLImport& rImport, sal_Int32 /*nElement*/,
590  const Reference< xml::sax::XFastAttributeList > & xAttrList,
592  SvXMLImportContext( rImport ),
593  rListLevel( rLLevel )
594 {
595  SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
596 
597  OUString sFontName, sFontFamily, sFontStyleName, sFontFamilyGeneric,
598  sFontPitch, sFontCharset;
599  OUString sVerticalPos, sVerticalRel;
600 
601  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
602  {
603  const OUString sValue = aIter.toString();
604  sal_Int32 nVal;
605  switch( aIter.getToken() )
606  {
607  case XML_ELEMENT(TEXT, XML_SPACE_BEFORE):
608  if (rUnitConv.convertMeasureToCore(nVal, sValue, SHRT_MIN, SHRT_MAX))
609  rListLevel.SetSpaceBefore( nVal );
610  break;
611  case XML_ELEMENT(TEXT, XML_MIN_LABEL_WIDTH):
612  if (rUnitConv.convertMeasureToCore( nVal, sValue, 0, SHRT_MAX ))
613  rListLevel.SetMinLabelWidth( nVal );
614  break;
616  if (rUnitConv.convertMeasureToCore( nVal, sValue, 0, USHRT_MAX ))
617  rListLevel.SetMinLabelDist( nVal );
618  break;
619  case XML_ELEMENT(FO, XML_TEXT_ALIGN):
620  case XML_ELEMENT(FO_COMPAT, XML_TEXT_ALIGN):
621  if( !sValue.isEmpty() )
622  {
623  sal_Int16 eAdjust = HoriOrientation::LEFT;
624  if( IsXMLToken( sValue, XML_CENTER ) )
625  eAdjust = HoriOrientation::CENTER;
626  else if( IsXMLToken( sValue, XML_END ) )
627  eAdjust = HoriOrientation::RIGHT;
628  rListLevel.SetAdjust( eAdjust );
629  }
630  break;
631  case XML_ELEMENT(STYLE, XML_FONT_NAME):
632  sFontName = sValue;
633  break;
634  case XML_ELEMENT(FO, XML_FONT_FAMILY):
635  case XML_ELEMENT(FO_COMPAT, XML_FONT_FAMILY):
636  sFontFamily = sValue;
637  break;
639  sFontFamilyGeneric = sValue;
640  break;
641  case XML_ELEMENT(STYLE, XML_FONT_STYLE_NAME):
642  sFontStyleName = sValue;
643  break;
644  case XML_ELEMENT(STYLE, XML_FONT_PITCH):
645  sFontPitch = sValue;
646  break;
647  case XML_ELEMENT(STYLE, XML_FONT_CHARSET):
648  sFontCharset = sValue;
649  break;
650  case XML_ELEMENT(STYLE, XML_VERTICAL_POS):
651  sVerticalPos = sValue;
652  break;
653  case XML_ELEMENT(STYLE, XML_VERTICAL_REL):
654  sVerticalRel = sValue;
655  break;
656  case XML_ELEMENT(FO, XML_WIDTH):
657  case XML_ELEMENT(FO_COMPAT, XML_WIDTH):
658  if (rUnitConv.convertMeasureToCore(nVal, sValue))
659  rListLevel.SetImageWidth( nVal );
660  break;
661  case XML_ELEMENT(FO, XML_HEIGHT):
662  case XML_ELEMENT(FO_COMPAT, XML_HEIGHT):
663  if (rUnitConv.convertMeasureToCore(nVal, sValue))
664  rListLevel.SetImageHeight( nVal );
665  break;
666  case XML_ELEMENT(FO, XML_COLOR):
667  case XML_ELEMENT(FO_COMPAT, XML_COLOR):
668  {
669  sal_Int32 nColor(0);
670  if (::sax::Converter::convertColor( nColor, sValue ))
671  {
672  rListLevel.SetColor( Color(nColor) );
673  }
674  }
675  break;
677  {
678  if( IsXMLToken( sValue, XML_TRUE ) )
679  rListLevel.SetColor( Color(0xffffffff) );
680  }
681  break;
682  case XML_ELEMENT(FO, XML_FONT_SIZE):
683  case XML_ELEMENT(FO_COMPAT, XML_FONT_SIZE):
684  if (::sax::Converter::convertPercent( nVal, sValue ))
685  rListLevel.SetRelSize( static_cast<sal_Int16>(nVal) );
686  break;
688  {
689  sal_Int16 ePosAndSpaceMode = PositionAndSpaceMode::LABEL_WIDTH_AND_POSITION;
690  if( IsXMLToken( sValue, XML_LABEL_ALIGNMENT ) )
691  ePosAndSpaceMode = PositionAndSpaceMode::LABEL_ALIGNMENT;
692  rListLevel.SetPosAndSpaceMode( ePosAndSpaceMode );
693  }
694  break;
695  default:
696  SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
697  }
698  }
699 
700  if( !sFontName.isEmpty() )
701  {
702  const XMLFontStylesContext *pFontDecls =
703  GetImport().GetFontDecls();
704  if( pFontDecls )
705  {
706  ::std::vector < XMLPropertyState > aProps;
707  if( pFontDecls->FillProperties( sFontName, aProps, 0, 1, 2, 3, 4 ) )
708  {
709  OUString sTmp;
710  sal_Int16 nTmp = 0;
711  for( const auto& rProp : aProps )
712  {
713  switch( rProp.mnIndex )
714  {
715  case 0:
716  rProp.maValue >>= sTmp;
717  rListLevel.SetBulletFontName( sTmp);
718  break;
719  case 1:
720  rProp.maValue >>= sTmp;
721  rListLevel.SetBulletFontStyleName( sTmp );
722  break;
723  case 2:
724  rProp.maValue >>= nTmp;
725  rListLevel.SetBulletFontFamily( nTmp );
726  break;
727  case 3:
728  rProp.maValue >>= nTmp;
729  rListLevel.SetBulletFontPitch( nTmp );
730  break;
731  case 4:
732  rProp.maValue >>= nTmp;
733  rListLevel.SetBulletFontEncoding( nTmp );
734  break;
735  }
736  }
737  }
738  }
739  }
740  if( !sFontFamily.isEmpty() )
741  {
742  Any aAny;
743 
744  XMLFontFamilyNamePropHdl aFamilyNameHdl;
745  if( aFamilyNameHdl.importXML( sFontFamily, aAny, rUnitConv ) )
746  {
747  OUString sTmp;
748  aAny >>= sTmp;
749  rListLevel.SetBulletFontName( sTmp);
750  }
751 
752  XMLFontFamilyPropHdl aFamilyHdl;
753  if( !sFontFamilyGeneric.isEmpty() &&
754  aFamilyHdl.importXML( sFontFamilyGeneric, aAny, rUnitConv ) )
755  {
756  sal_Int16 nTmp = 0;
757  aAny >>= nTmp;
758  rListLevel.SetBulletFontFamily( nTmp );
759  }
760 
761  if( !sFontStyleName.isEmpty() )
762  rListLevel.SetBulletFontStyleName( sFontStyleName );
763 
764  XMLFontPitchPropHdl aPitchHdl;
765  if( !sFontPitch.isEmpty() &&
766  aPitchHdl.importXML( sFontPitch, aAny, rUnitConv ) )
767  {
768  sal_Int16 nTmp = 0;
769  aAny >>= nTmp;
770  rListLevel.SetBulletFontPitch( nTmp );
771  }
772 
773  XMLFontEncodingPropHdl aEncHdl;
774  if( !sFontCharset.isEmpty() &&
775  aEncHdl.importXML( sFontCharset, aAny, rUnitConv ) )
776  {
777  sal_Int16 nTmp = 0;
778  aAny >>= nTmp;
779  rListLevel.SetBulletFontEncoding( nTmp );
780  }
781  }
782 
783  sal_Int16 eVertOrient = VertOrientation::LINE_CENTER;
784  if( !sVerticalPos.isEmpty() )
785  {
786  if( IsXMLToken( sVerticalPos, XML_TOP ) )
787  eVertOrient = VertOrientation::LINE_TOP;
788  else if( IsXMLToken( sVerticalPos, XML_BOTTOM ) )
789  eVertOrient = VertOrientation::LINE_BOTTOM;
790  }
791  if( !sVerticalRel.isEmpty() )
792  {
793  if( IsXMLToken( sVerticalRel, XML_BASELINE ) )
794  {
795  // TOP and BOTTOM are exchanged for a baseline relation
796  switch( eVertOrient )
797  {
798  case VertOrientation::LINE_TOP:
799  eVertOrient = VertOrientation::BOTTOM;
800  break;
801  case VertOrientation::LINE_CENTER:
802  eVertOrient = VertOrientation::CENTER;
803  break;
804  case VertOrientation::LINE_BOTTOM:
805  eVertOrient = VertOrientation::TOP;
806  break;
807  }
808  }
809  else if( IsXMLToken( sVerticalRel, XML_CHAR ) )
810  {
811  switch( eVertOrient )
812  {
813  case VertOrientation::LINE_TOP:
814  eVertOrient = VertOrientation::CHAR_TOP;
815  break;
816  case VertOrientation::LINE_CENTER:
817  eVertOrient = VertOrientation::CHAR_CENTER;
818  break;
819  case VertOrientation::LINE_BOTTOM:
820  eVertOrient = VertOrientation::CHAR_BOTTOM;
821  break;
822  }
823  }
824  }
825  rListLevel.SetImageVertOrient( eVertOrient );
826 }
827 
828 css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLListLevelStyleAttrContext_Impl::createFastChildContext(
829  sal_Int32 nElement,
830  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
831 {
832  if ( nElement == XML_ELEMENT(STYLE, XML_LIST_LEVEL_LABEL_ALIGNMENT) )
833  {
834  return new SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl( GetImport(),
835  nElement,
836  xAttrList,
837  rListLevel );
838  }
839  SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
840  return nullptr;
841 }
842 
843 namespace {
844 
846 {
847  XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY,
848  XML_TOK_STYLE_ATTRIBUTES_ATTR_LISTTAB_STOP_POSITION,
849  XML_TOK_STYLE_ATTRIBUTES_ATTR_FIRST_LINE_INDENT,
850  XML_TOK_STYLE_ATTRIBUTES_ATTR_INDENT_AT
851 };
852 
853 }
854 
855 SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl(
856  SvXMLImport& rImport, sal_Int32 /*nElement*/,
857  const Reference< xml::sax::XFastAttributeList > & xAttrList,
859  SvXMLImportContext( rImport )
860 {
861  SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
862 
863  sal_Int16 eLabelFollowedBy = LabelFollow::LISTTAB;
864  for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
865  {
866  const OUString sValue = aIter.toString();
867 
868  sal_Int32 nVal;
869  switch( aIter.getToken() )
870  {
872  case XML_ELEMENT(LO_EXT, XML_LABEL_FOLLOWED_BY):
873  {
874  if( eLabelFollowedBy == LabelFollow::NEWLINE)
875  //NewLine from LO_EXT has precedence over other values of the Non LO_EXT namespace
876  break;
877  if( IsXMLToken( sValue, XML_SPACE ) )
878  eLabelFollowedBy = LabelFollow::SPACE;
879  else if( IsXMLToken( sValue, XML_NOTHING ) )
880  eLabelFollowedBy = LabelFollow::NOTHING;
881  else if( IsXMLToken( sValue, XML_NEWLINE ) )
882  eLabelFollowedBy = LabelFollow::NEWLINE;
883  }
884  break;
886  if (rUnitConv.convertMeasureToCore(nVal, sValue, 0, SHRT_MAX))
887  rLLevel.SetListtabStopPosition( nVal );
888  break;
889  case XML_ELEMENT(FO, XML_TEXT_INDENT):
890  case XML_ELEMENT(FO_COMPAT, XML_TEXT_INDENT):
891  if (rUnitConv.convertMeasureToCore(nVal, sValue, SHRT_MIN, SHRT_MAX))
892  rLLevel.SetFirstLineIndent( nVal );
893  break;
894  case XML_ELEMENT(FO, XML_MARGIN_LEFT):
895  case XML_ELEMENT(FO_COMPAT, XML_MARGIN_LEFT):
896  if (rUnitConv.convertMeasureToCore(nVal, sValue, SHRT_MIN, SHRT_MAX))
897  rLLevel.SetIndentAt( nVal );
898  break;
899  default:
900  SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
901  }
902  }
903  rLLevel.SetLabelFollowedBy( eLabelFollowedBy );
904 }
905 
906 void SvxXMLListStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
907  const OUString& rLocalName,
908  const OUString& rValue )
909 {
910  if( XML_NAMESPACE_TEXT == nPrefixKey &&
911  IsXMLToken( rLocalName, XML_CONSECUTIVE_NUMBERING ) )
912  {
913  bConsecutive = IsXMLToken( rValue, XML_TRUE );
914  }
915  else
916  {
917  SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
918  }
919 }
920 
921 constexpr OUStringLiteral sIsPhysical( u"IsPhysical" );
922 constexpr OUStringLiteral sNumberingRules( u"NumberingRules" );
923 constexpr OUStringLiteral sIsContinuousNumbering( u"IsContinuousNumbering" );
924 
926  bool bOutl )
928 , bConsecutive( false )
929 , bOutline( bOutl )
930 {
931 }
932 
934 
935 css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLListStyleContext::createFastChildContext(
936  sal_Int32 nElement,
937  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
938 {
939  if( bOutline
941  : ( nElement == XML_ELEMENT(TEXT, XML_LIST_LEVEL_STYLE_NUMBER) ||
943  nElement == XML_ELEMENT(TEXT, XML_LIST_LEVEL_STYLE_IMAGE ) ) )
944  {
946  new SvxXMLListLevelStyleContext_Impl( GetImport(), nElement, xAttrList )};
947  if( !pLevelStyles )
948  pLevelStyles = std::make_unique<SvxXMLListStyle_Impl>();
949  pLevelStyles->push_back( xLevelStyle );
950 
951  return xLevelStyle.get();
952  }
953  SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
954  return nullptr;
955 }
956 
958  const Reference<container::XIndexReplace> & rNumRule) const
959 {
960  try
961  {
962  if( pLevelStyles && rNumRule.is() )
963  {
964  sal_Int32 l_nLevels = rNumRule->getCount();
965  for (const auto& pLevelStyle : *pLevelStyles)
966  {
967  sal_Int32 nLevel = pLevelStyle->GetLevel();
968  if( nLevel >= 0 && nLevel < l_nLevels )
969  {
971  pLevelStyle->GetProperties();
972  rNumRule->replaceByIndex( nLevel, Any(aProps) );
973  }
974  }
975  }
976 
977  Reference < XPropertySet > xPropSet( rNumRule, UNO_QUERY );
978  Reference< XPropertySetInfo > xPropSetInfo;
979  if (xPropSet.is())
980  xPropSetInfo = xPropSet->getPropertySetInfo();
981  if( xPropSetInfo.is() &&
982  xPropSetInfo->hasPropertyByName( sIsContinuousNumbering ) )
983  {
984  xPropSet->setPropertyValue( sIsContinuousNumbering, Any(bConsecutive) );
985  }
986  }
987  catch (const Exception&)
988  {
989  TOOLS_WARN_EXCEPTION("xmloff.style", "" );
990  }
991 }
992 
994 {
995  if( bOutline )
996  {
997  if( bOverwrite )
998  {
999  const Reference< XIndexReplace >& rNumRule =
1000  GetImport().GetTextImport()->GetChapterNumbering();
1001  // We don't set xNumberingRules here, to avoid using them
1002  // as numbering rules.
1003  if( rNumRule.is() )
1004  FillUnoNumRule(rNumRule);
1005  }
1006  }
1007  else
1008  {
1009  Reference < XStyle > xStyle;
1010  const OUString& rName = GetDisplayName();
1011  if( rName.isEmpty() )
1012  {
1013  SetValid( false );
1014  return;
1015  }
1016 
1017  const Reference < XNameContainer >& rNumStyles =
1018  GetImport().GetTextImport()->GetNumberingStyles();
1019  if( !rNumStyles.is() )
1020  {
1021  SetValid( false );
1022  return;
1023  }
1024 
1025  bool bNew = false;
1026  if( rNumStyles->hasByName( rName ) )
1027  {
1028  Any aAny = rNumStyles->getByName( rName );
1029  aAny >>= xStyle;
1030  }
1031  else
1032  {
1033  Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
1034  UNO_QUERY );
1035  SAL_WARN_IF( !xFactory.is(), "xmloff", "no factory" );
1036  if( !xFactory.is() )
1037  return;
1038 
1039  Reference < XInterface > xIfc = xFactory->createInstance("com.sun.star.style.NumberingStyle");
1040  if( !xIfc.is() )
1041  return;
1042  Reference < XStyle > xTmp( xIfc, UNO_QUERY );
1043  xStyle = xTmp;
1044  if( !xStyle.is() )
1045  return;
1046 
1047  rNumStyles->insertByName( rName, Any(xStyle) );
1048  bNew = true;
1049  }
1050 
1051  Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
1052  Reference< XPropertySetInfo > xPropSetInfo =
1053  xPropSet->getPropertySetInfo();
1054  if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) )
1055  {
1056  Any aAny = xPropSet->getPropertyValue( sIsPhysical );
1057  bNew = !*o3tl::doAccess<bool>(aAny);
1058  }
1059 
1060  if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
1061  xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
1062 
1063  if( rName != GetName() )
1065  GetName(), rName );
1066 
1067  Any aAny = xPropSet->getPropertyValue( sNumberingRules );
1068  aAny >>= xNumRules;
1069  if( bOverwrite || bNew )
1070  {
1072  xPropSet->setPropertyValue( sNumberingRules, Any(xNumRules) );
1073  }
1074  else
1075  {
1076  SetValid( false );
1077  }
1078 
1079  SetNew( bNew );
1080  }
1081 }
1082 
1084 {
1085  SAL_WARN_IF( bOutline, "xmloff", "Outlines cannot be inserted here" );
1086  SAL_WARN_IF( xNumRules.is(), "xmloff", "Numbering Rule is existing already" );
1087 
1088  const OUString& rName = GetName();
1089  if( bOutline || xNumRules.is() || rName.isEmpty() )
1090  {
1091  const_cast<SvxXMLListStyleContext *>(this)->SetValid( false );
1092  return;
1093  }
1094 
1095  const_cast<SvxXMLListStyleContext *>(this)->xNumRules = CreateNumRule(
1096  GetImport().GetModel() );
1097 
1099 }
1100 
1101 Reference < XIndexReplace > SvxXMLListStyleContext::CreateNumRule(
1102  const Reference < XModel > & rModel )
1103 {
1104  Reference<XIndexReplace> xNumRule;
1105 
1106  Reference< XMultiServiceFactory > xFactory( rModel, UNO_QUERY );
1107  SAL_WARN_IF( !xFactory.is(), "xmloff", "no factory" );
1108  if( !xFactory.is() )
1109  return xNumRule;
1110 
1111  Reference < XInterface > xIfc = xFactory->createInstance("com.sun.star.text.NumberingRules");
1112  if( !xIfc.is() )
1113  return xNumRule;
1114 
1115  xNumRule.set( xIfc, UNO_QUERY );
1116  SAL_WARN_IF( !xNumRule.is(), "xmloff", "go no numbering rule" );
1117 
1118  return xNumRule;
1119 }
1120 
1122  const Reference < XIndexReplace > & rNumRule,
1123  sal_Int16 nLevel,
1124  bool bOrdered )
1125 {
1126  Sequence<beans::PropertyValue> aPropSeq( bOrdered ? 1 : 4 );
1127  beans::PropertyValue *pProps = aPropSeq.getArray();
1128 
1129  pProps->Name = "NumberingType";
1130  (pProps++)->Value <<= static_cast<sal_Int16>(bOrdered ? NumberingType::ARABIC
1131  : NumberingType::CHAR_SPECIAL );
1132  if( !bOrdered )
1133  {
1134  // TODO: Bullet-Font
1135  awt::FontDescriptor aFDesc;
1136  aFDesc.Name =
1137 #ifdef _WIN32
1138  "StarBats"
1139 #else
1140  "starbats"
1141 #endif
1142  ;
1143  aFDesc.Family = FAMILY_DONTKNOW ;
1144  aFDesc.Pitch = PITCH_DONTKNOW ;
1145  aFDesc.CharSet = RTL_TEXTENCODING_SYMBOL ;
1146  aFDesc.Weight = WEIGHT_DONTKNOW;
1147  pProps->Name = "BulletFont";
1148  (pProps++)->Value <<= aFDesc;
1149 
1150  pProps->Name = "BulletChar";
1151  (pProps++)->Value <<= OUString(sal_Unicode(0xF000 + 149));
1152  pProps->Name = "CharStyleName";
1153  (pProps++)->Value <<= OUString( "Numbering Symbols" );
1154  }
1155 
1156  rNumRule->replaceByIndex( nLevel, Any(aPropSeq) );
1157 }
1158 
1159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: xmlnumi.cxx:935
bool IsXMLToken(const OUString &rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3434
SvxXMLListLevelStyleContext_Impl(SvXMLImport &rImport, sal_Int32 nElement, const Reference< xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlnumi.cxx:234
css::uno::Reference< css::graphic::XGraphic > loadGraphicFromBase64(css::uno::Reference< css::io::XOutputStream > const &rxOutputStream)
Definition: xmlimp.cxx:1381
bool FillProperties(const OUString &rName,::std::vector< XMLPropertyState > &rProps, sal_Int32 nFamilyNameIdx, sal_Int32 nStyleNameIdx, sal_Int32 nFamilyIdx, sal_Int32 nPitchIdx, sal_Int32 nCharsetIdx) const
void SetRelSize(sal_Int16 nRel)
Definition: xmlnumi.cxx:173
sal_uInt32 sal_UCS4
PropertyHandler for the XML-data-type:
Definition: fonthdl.hxx:64
void SetMinLabelWidth(sal_Int32 nSet)
Definition: xmlnumi.cxx:177
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class...
Definition: fonthdl.cxx:197
bool convertNumFormat(sal_Int16 &rType, const OUString &rNumFormat, const OUString &rNumLetterSync, bool bNumberNone=false) const
convert num-format and num-letter-sync values to NumberingType
Definition: xmluconv.cxx:574
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:77
void SetNew(bool b)
Definition: xmlstyle.hxx:110
void FillUnoNumRule(const css::uno::Reference< css::container::XIndexReplace > &rNumRule) const
Definition: xmlnumi.cxx:957
virtual void CreateAndInsertLate(bool bOverwrite) override
Definition: xmlnumi.cxx:993
FAMILY_DONTKNOW
sal_Unicode ConvStarMathCharToStarSymbol(sal_Unicode c)
Definition: xmlimp.cxx:1795
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:62
void SetIndentAt(sal_Int32 nValue)
Definition: xmlnumi.cxx:225
void SetBulletFontStyleName(const OUString &rSet)
Definition: xmlnumi.cxx:182
void SetSpaceBefore(sal_Int32 nSet)
Definition: xmlnumi.cxx:176
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
constexpr OUStringLiteral sIsPhysical(u"IsPhysical")
css::uno::Reference< css::graphic::XGraphic > loadGraphicByURL(OUString const &rURL)
Definition: xmlimp.cxx:1359
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:600
sal_Int32 nFirstLineOffset
constexpr OUStringLiteral sIsContinuousNumbering(u"IsContinuousNumbering")
Sequence< beans::PropertyValue > GetProperties()
Definition: xmlnumi.cxx:374
~SvxXMLListStyleContext() override
Definition: xmlnumi.cxx:933
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class...
Definition: fonthdl.cxx:262
Value
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
XmlStyleFamily
Definition: families.hxx:47
sal_uInt16 sal_Unicode
SvxXMLListStyleContext(SvXMLImport &rImport, bool bOutl=false)
Definition: xmlnumi.cxx:925
static const sal_uInt16 OOo_2x
Definition: xmlimp.hxx:542
void CreateAndInsertAuto() const
Definition: xmlnumi.cxx:1083
int nCount
std::unique_ptr< SvxXMLListStyle_Impl > pLevelStyles
Definition: xmlnumi.hxx:41
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class...
Definition: fonthdl.cxx:231
static OUString getPrefixAndNameFromToken(sal_Int32 nToken)
Definition: xmlimp.cxx:2025
css::uno::Reference< css::io::XOutputStream > GetStreamForGraphicObjectURLFromBase64() const
Definition: xmlimp.cxx:1393
sal_Int32 GetLevel() const
Definition: xmlnumi.cxx:206
PropertyHandler for the XML-data-type:
Definition: fonthdl.hxx:28
static css::uno::Reference< css::container::XIndexReplace > CreateNumRule(const css::uno::Reference< css::frame::XModel > &rModel)
Definition: xmlnumi.cxx:1101
DocumentType eType
WEIGHT_DONTKNOW
PropertyHandler for the XML-data-type:
Definition: fonthdl.hxx:52
#define TOOLS_WARN_EXCEPTION(area, stream)
css::uno::Reference< css::container::XIndexReplace > xNumRules
Definition: xmlnumi.hxx:39
constexpr OUStringLiteral sNumberingRules(u"NumberingRules")
bool IsHidden() const
Definition: xmlstyle.hxx:112
const OUString & GetDisplayName() const
Definition: xmlstyle.hxx:99
void SetBulletFontFamily(sal_Int16 eSet)
Definition: xmlnumi.cxx:184
void SetBulletFontName(const OUString &rSet)
Definition: xmlnumi.cxx:181
sal_Unicode ConvStarBatsCharToStarSymbol(sal_Unicode c)
Definition: xmlimp.cxx:1778
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class...
Definition: fonthdl.cxx:67
void SetLabelFollowedBy(sal_Int16 eValue)
Definition: xmlnumi.cxx:213
constexpr sal_uInt16 XML_NAMESPACE_TEXT
void SetBulletFontPitch(sal_Int16 eSet)
Definition: xmlnumi.cxx:185
void SetPosAndSpaceMode(sal_Int16 eValue)
Definition: xmlnumi.cxx:209
SvxXMLStyleAttributesAttrTokens
Definition: xmlnumi.cxx:564
rtl_TextEncoding eBulletFontEncoding
Definition: xmlnumi.cxx:154
void SetListtabStopPosition(sal_Int32 nValue)
Definition: xmlnumi.cxx:217
void SetMinLabelDist(sal_Int32 nSet)
Definition: xmlnumi.cxx:178
PITCH_DONTKNOW
constexpr OUStringLiteral gsStarMath(u"StarMath")
SvxXMLStyleAttributesLabelAlignmentAttrTokens
Definition: xmlnumi.cxx:845
sal_Int16 nVersion
void SetValid(bool b)
Definition: xmlstyle.hxx:107
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlnumi.cxx:349
const sal_uInt32 LEFT
void SetImageHeight(sal_Int32 nSet)
Definition: xmlnumi.cxx:190
long const nLeftMargin
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1494
#define SAL_WARN_IF(condition, area, stream)
const OUString & GetName() const
Definition: xmlstyle.hxx:98
static bool convertColor(sal_Int32 &rColor, const OUString &rValue)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Handling of tokens in XML:
void SetBulletFontEncoding(rtl_TextEncoding eSet)
Definition: xmlnumi.cxx:186
static const sal_uInt16 OOo_1x
Definition: xmlimp.hxx:541
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:94
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlimp.hxx:404
const css::uno::Reference< css::frame::XModel > & GetModel() const
Definition: xmlimp.hxx:408
Reference< XOutputStream > xBase64Stream
Definition: xmlnumi.cxx:140
SvxXMLTextListLevelStyleAttrTokens
Definition: xmlnumi.cxx:108
virtual void SetAttribute(sal_uInt16 nPrefixKey, const OUString &rLocalName, const OUString &rValue)
Definition: xmlstyle.cxx:65
void AddStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName, const OUString &rDisplayName)
Definition: xmlimp.cxx:1463
void SetImageWidth(sal_Int32 nSet)
Definition: xmlnumi.cxx:189
#define SAL_WARN(area, stream)
Reference< XSingleServiceFactory > xFactory
virtual SAL_DLLPRIVATE void SetAttribute(sal_uInt16 nPrefixKey, const OUString &rLocalName, const OUString &rValue) override
Definition: xmlnumi.cxx:906
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:91
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
static void SetDefaultStyle(const css::uno::Reference< css::container::XIndexReplace > &rNumRule, sal_Int16 nLevel, bool bOrdered)
Definition: xmlnumi.cxx:1121
PropertyHandler for the XML-data-type:
Definition: fonthdl.hxx:40
void SetImageVertOrient(sal_Int16 eSet)
Definition: xmlnumi.cxx:191
Reference< XGraphic > xGraphic
TEXT
void SetFirstLineIndent(sal_Int32 nValue)
Definition: xmlnumi.cxx:221
void SetAdjust(sal_Int16 eSet)
Definition: xmlnumi.cxx:179
sal_uInt16 nPos
void SetColor(Color nColor)
Definition: xmlnumi.cxx:174
constexpr OUStringLiteral gsStarBats(u"StarBats")
virtual void SAL_CALL startFastElement(sal_Int32, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
Definition: xmlnumi.cxx:200