LibreOffice Module xmloff (master)  1
txtstyli.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 
22 #include <xmloff/xmlnamespace.hxx>
24 #include <xmloff/families.hxx>
25 #include <xmloff/txtprmap.hxx>
26 #include <xmloff/txtstyli.hxx>
27 #include <xmloff/xmlimp.hxx>
28 #include <xmloff/xmltoken.hxx>
29 #include <xmloff/xmluconv.hxx>
30 #include <xmloff/maptype.hxx>
31 #include <xmloff/xmlimppr.hxx>
32 #include <xmloff/xmlement.hxx>
33 
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/container/XNameContainer.hpp>
36 #include <com/sun/star/document/XEventsSupplier.hpp>
37 #include <com/sun/star/frame/XModel.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <com/sun/star/style/ParagraphStyleCategory.hpp>
40 #include <com/sun/star/style/XStyle.hpp>
41 
42 #include <o3tl/any.hxx>
43 
44 #include <sax/tools/converter.hxx>
45 
46 #include <tools/debug.hxx>
47 #include <tools/diagnose_ex.h>
48 #include <sal/log.hxx>
49 
50 #include <vector>
51 
52 #include <xmlsdtypes.hxx>
53 #include <xmloff/xmlerror.hxx>
54 
55 
56 using namespace ::std;
57 using namespace ::com::sun::star;
58 using namespace ::com::sun::star::uno;
59 using namespace ::com::sun::star::xml::sax;
60 using namespace ::com::sun::star::style;
61 using namespace ::com::sun::star::beans;
62 using namespace ::com::sun::star::lang;
63 using namespace ::com::sun::star::container;
64 using namespace ::xmloff::token;
65 
67 {
68  { XML_TEXT, ParagraphStyleCategory::TEXT },
69  { XML_CHAPTER, ParagraphStyleCategory::CHAPTER },
70  { XML_LIST, ParagraphStyleCategory::LIST },
71  { XML_INDEX, ParagraphStyleCategory::INDEX },
72  { XML_EXTRA, ParagraphStyleCategory::EXTRA },
73  { XML_HTML, ParagraphStyleCategory::HTML },
74  { XML_TOKEN_INVALID, 0 }
75 };
76 
77 void XMLTextStyleContext::SetAttribute( sal_Int32 nElement,
78  const OUString& rValue )
79 {
80  switch (nElement)
81  {
83  {
84  if( IsXMLToken( rValue, XML_TRUE ) )
85  m_isAutoUpdate = true;
86  break;
87  }
89  {
91  // Inherited paragraph style lost information about unset numbering (#i69523#)
92  m_bListStyleSet = true;
93  break;
94  }
96  {
98  m_bHasMasterPageName = true;
99  break;
100  }
103  break;
104  case XML_ELEMENT(STYLE, XML_CLASS):
106  break;
108  {
109  sal_Int32 nTmp;
110  if (::sax::Converter::convertNumber( nTmp, rValue ) &&
111  0 <= nTmp && nTmp <= 10 )
112  {
113  m_nOutlineLevel = static_cast<sal_Int8>(nTmp);
114  }
115  break;
116  }
117  default:
118  XMLPropStyleContext::SetAttribute( nElement, rValue );
119  }
120 }
121 
123  SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
124  bool bDefaultStyle )
125 : XMLPropStyleContext( rImport, rStyles, nFamily, bDefaultStyle )
126 , m_nOutlineLevel( -1 )
127 , m_isAutoUpdate( false )
128 , m_bHasMasterPageName( false )
129 , m_bHasCombinedCharactersLetter( false )
130 // Inherited paragraph style lost information about unset numbering (#i69523#)
131 , m_bListStyleSet( false )
132 {
133 }
134 
136 {}
137 
138 css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextStyleContext::createFastChildContext(
139  sal_Int32 nElement,
140  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
141 {
142  if( IsTokenInNamespace(nElement, XML_NAMESPACE_STYLE) )
143  {
144  sal_Int32 nLocalName = nElement & TOKEN_MASK;
145  sal_uInt32 nFamily = 0;
146  if( nLocalName == XML_TEXT_PROPERTIES )
147  nFamily = XML_TYPE_PROP_TEXT;
148  else if( nLocalName == XML_PARAGRAPH_PROPERTIES )
149  nFamily = XML_TYPE_PROP_PARAGRAPH;
150  else if( nLocalName == XML_SECTION_PROPERTIES )
151  nFamily = XML_TYPE_PROP_SECTION;
152  else if( IsDefaultStyle() && nLocalName == XML_TABLE_PROPERTIES )
153  nFamily = XML_TYPE_PROP_TABLE;
154  else if( IsDefaultStyle() && nLocalName == XML_TABLE_ROW_PROPERTIES )
155  nFamily = XML_TYPE_PROP_TABLE_ROW;
156  if( nFamily )
157  {
160  if( xImpPrMap.is() )
161  return new XMLTextPropertySetContext( GetImport(), nElement, xAttrList,
162  nFamily,
163  GetProperties(),
164  xImpPrMap,
166  }
167  }
168  else if ( nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) )
169  {
170  // create and remember events import context
171  // (for delayed processing of events)
173  return m_xEventContext;
174  }
175 
176  return XMLPropStyleContext::createFastChildContext( nElement, xAttrList );
177 }
178 
180 {
182  Reference < XStyle > xStyle = GetStyle();
183  if( !xStyle.is() || !(bOverwrite || IsNew()) )
184  return;
185 
186  Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
187  Reference< XPropertySetInfo > xPropSetInfo =
188  xPropSet->getPropertySetInfo();
189 
190  OUString const sIsAutoUpdate("IsAutoUpdate");
191  if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) )
192  {
193  xPropSet->setPropertyValue( sIsAutoUpdate, Any(m_isAutoUpdate) );
194  }
195 
196  sal_uInt16 nCategory = ParagraphStyleCategory::TEXT;
198  !m_sCategoryVal.isEmpty() && xStyle->isUserDefined() &&
199  xPropSetInfo->hasPropertyByName("Category") &&
200  SvXMLUnitConverter::convertEnum( nCategory, m_sCategoryVal, aCategoryMap))
201  {
202  xPropSet->setPropertyValue("Category", Any(static_cast<sal_Int16>(nCategory)));
203  }
204 
205  // tell the style about it's events (if applicable)
206  if (m_xEventContext.is())
207  {
208  // pass events into event supplier
209  Reference<document::XEventsSupplier> xEventsSupplier(xStyle,UNO_QUERY);
210  m_xEventContext->SetEvents(xEventsSupplier);
211  m_xEventContext.clear();
212  }
213 
214  // XML import: reconstruction of assignment of paragraph style to outline levels (#i69629#)
215  if (m_nOutlineLevel > 0)
216  {
217  GetImport().GetTextImport()->AddOutlineStyleCandidate(m_nOutlineLevel,
218  GetDisplayName() );
219  }
220 }
221 
223 {
227  {
228  Reference < XMultiServiceFactory > xFactory ( GetImport().GetModel(), UNO_QUERY);
229  if (xFactory.is())
230  {
231  Reference < XInterface > xInt = xFactory->createInstance( "com.sun.star.text.Defaults" );
232  Reference < XPropertySet > xProperties ( xInt, UNO_QUERY );
233  if ( xProperties.is() )
234  FillPropertySet ( xProperties );
235  }
236  }
237 }
238 
239 void XMLTextStyleContext::Finish( bool bOverwrite )
240 {
241  XMLPropStyleContext::Finish( bOverwrite );
242 
243  Reference < XStyle > xStyle = GetStyle();
244  // Consider set empty list style (#i69523#)
245  if ( !( m_bListStyleSet ||
246  m_nOutlineLevel >= 0 ||
247  !m_sDropCapTextStyleName.isEmpty() ||
249  !xStyle.is() ||
250  !( bOverwrite || IsNew() ) )
251  return;
252 
253  Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
254  Reference< XPropertySetInfo > xPropSetInfo =
255  xPropSet->getPropertySetInfo();
256 
257  OUString const sOutlineLevel("OutlineLevel");
258  if( xPropSetInfo->hasPropertyByName( sOutlineLevel ))
259  {
260  if (m_nOutlineLevel >= 0)
261  {
262  xPropSet->setPropertyValue( sOutlineLevel, Any(m_nOutlineLevel) );
263  }
264  }
265 
266  // Consider set empty list style (#i69523#)
267  OUString const sNumberingStyleName("NumberingStyleName");
268  if (m_bListStyleSet &&
269  xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
270  {
271  /* Only for text document from version prior OOo 2.1 resp. SO 8 PU5:
272  - Do not apply list style, if paragraph style has a default outline
273  level > 0 and thus, will be assigned to the corresponding list
274  level of the outline style. (#i70223#)
275  */
276  bool bApplyListStyle( true );
277  if (m_nOutlineLevel > 0)
278  {
279  if ( GetImport().IsTextDocInOOoFileFormat() )
280  {
281  bApplyListStyle = false;
282  }
283  else
284  {
285  sal_Int32 nUPD( 0 );
286  sal_Int32 nBuild( 0 );
287  // Check explicitly on certain versions (#i86058#)
288  if ( GetImport().getBuildIds( nUPD, nBuild ) &&
289  ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
290  ( nUPD == 680 && nBuild <= 9073 ) ) ) // OOo 2.0 - OOo 2.0.4
291  {
292  bApplyListStyle = false;
293  }
294  }
295  }
296 
297  if ( bApplyListStyle )
298  {
299  if (m_sListStyleName.isEmpty())
300  {
301  xPropSet->setPropertyValue(sNumberingStyleName, Any(m_sListStyleName)); /* empty string */
302  }
303  else
304  {
305  // change list style name to display name
306  OUString sDisplayListStyleName(
307  GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_LIST,
309  // The families container must exist
310  const Reference < XNameContainer >& rNumStyles =
311  GetImport().GetTextImport()->GetNumberingStyles();
312  // if( rNumStyles.is() && rNumStyles->hasByName( sDisplayListStyleName ) &&
313  // xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
314  if ( rNumStyles.is() &&
315  rNumStyles->hasByName( sDisplayListStyleName ) )
316  {
317  xPropSet->setPropertyValue( sNumberingStyleName, Any(sDisplayListStyleName) );
318  }
319  }
320  }
321  }
322 
323  if (!m_sDropCapTextStyleName.isEmpty())
324  {
325  // change list style name to display name
326  OUString sDisplayDropCapTextStyleName(
327  GetImport().GetStyleDisplayName( XmlStyleFamily::TEXT_TEXT,
329  // The families container must exist
330  const Reference < XNameContainer >& rTextStyles =
331  GetImport().GetTextImport()->GetTextStyles();
332  if( rTextStyles.is() &&
333  rTextStyles->hasByName( sDisplayDropCapTextStyleName ) &&
334  xPropSetInfo->hasPropertyByName("DropCapCharStyleName"))
335  {
336  xPropSet->setPropertyValue("DropCapCharStyleName", Any(sDisplayDropCapTextStyleName));
337  }
338  }
339 
341  return;
342 
343  OUString sDisplayName(
344  GetImport().GetStyleDisplayName(
346  // The families container must exist
347  const Reference < XNameContainer >& rPageStyles =
348  GetImport().GetTextImport()->GetPageStyles();
349 
350  OUString const sPageDescName("PageDescName");
351  if( ( sDisplayName.isEmpty() ||
352  (rPageStyles.is() &&
353  rPageStyles->hasByName( sDisplayName )) ) &&
354  xPropSetInfo->hasPropertyByName( sPageDescName ) )
355  {
356  xPropSet->setPropertyValue( sPageDescName, Any(sDisplayName) );
357  }
358 }
359 
361  const Reference<XPropertySet > & rPropSet )
362 {
363  // imitate the FillPropertySet of the super class, so we get a chance to
364  // catch the combined characters attribute
365 
366  // imitate XMLPropStyleContext::FillPropertySet(...)
367  SvXMLStylesContext* pSvXMLStylesContext = GetStyles();
369  DBG_ASSERT(xImpPrMap.is(),"Where is the import prop mapper?");
370 
371  if(!xImpPrMap.is())
372  return;
373 
374  // imitate SvXMLImportPropertyMapper::FillPropertySet(...)
375  // The reason for this is that we have no other way to
376  // efficiently intercept the value of combined characters. To
377  // get that value, we could iterate through the map once more,
378  // but instead we chose to insert the code into this
379  // iteration. I haven't been able to come up with a much more
380  // intelligent solution.
381  struct ContextID_Index_Pair aContextIDs[] =
382  {
384  { CTF_KEEP_TOGETHER, -1 },
385  { CTF_BORDER_MODEL, -1 },
386  { CTF_TEXT_DISPLAY, -1 },
387  { CTF_FONTFAMILYNAME, -1 },
388  { CTF_FONTFAMILYNAME_CJK, -1 },
389  { CTF_FONTFAMILYNAME_CTL, -1 },
390 
391  //UUU need special handling for DrawingLayer FillStyle names
392  { CTF_FILLGRADIENTNAME, -1 },
393  { CTF_FILLTRANSNAME, -1 },
394  { CTF_FILLHATCHNAME, -1 },
395  { CTF_FILLBITMAPNAME, -1 },
396 
397  { -1, -1 }
398  };
399 
400  // the style families associated with the same index modulo 4
401  static const XmlStyleFamily aFamilies[] =
402  {
407  };
408 
409  // get property set info
410  Reference< XPropertySetInfo > xInfo;
412  bool bAutomatic = false;
413 
414  if(pSvXMLStylesContext->IsAutomaticStyle() &&
416  {
417  bAutomatic = true;
418 
419  if( !GetAutoName().isEmpty() )
420  {
421  OUString sAutoProp = ( GetFamily() == XmlStyleFamily::TEXT_TEXT ) ?
422  OUString( "CharAutoStyleName" ):
423  OUString( "ParaAutoStyleName" );
424 
425  try
426  {
427  if(!xInfo.is())
428  {
429  xInfo = rPropSet->getPropertySetInfo();
430  }
431 
432  if ( xInfo->hasPropertyByName( sAutoProp ) )
433  {
434  rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) );
435  }
436  else
437  {
438  bAutomatic = false;
439  }
440  }
441  catch( const RuntimeException& ) { throw; }
442  catch( const Exception& )
443  {
444  DBG_UNHANDLED_EXCEPTION("xmloff.text");
445  bAutomatic = false;
446  }
447  }
448  }
449 
450  if( bAutomatic )
451  {
452  xImpPrMap->CheckSpecialContext( GetProperties(), rPropSet, aContextIDs );
453  }
454  else
455  {
456  xImpPrMap->FillPropertySet( GetProperties(), rPropSet, aContextIDs );
457  }
458 
459  sal_Int32 nIndex = aContextIDs[0].nIndex;
460 
461  // have we found a combined characters
462  if ( nIndex != -1 )
463  {
464  Any& rAny = GetProperties()[nIndex].maValue;
465  bool bVal = *o3tl::doAccess<bool>(rAny);
467  }
468 
469  // keep-together: the application default is different from
470  // the file format default. Hence, if we always set this
471  // value; if we didn't find one, we'll set to false, the file
472  // format default.
473  // border-model: same
475  {
476  OUString sIsSplitAllowed("IsSplitAllowed");
477  SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), "xmloff", "property missing?" );
478  rPropSet->setPropertyValue(
479  sIsSplitAllowed,
480  (aContextIDs[1].nIndex == -1) ? makeAny( false ) : GetProperties()[aContextIDs[1].nIndex].maValue );
481  }
482 
484  {
485  OUString sCollapsingBorders("CollapsingBorders");
486  SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), "xmloff", "property missing?" );
487  rPropSet->setPropertyValue(
488  sCollapsingBorders,
489  (aContextIDs[2].nIndex == -1)
490  ? makeAny( false )
491  : GetProperties()[aContextIDs[2].nIndex].maValue );
492  }
493 
494 
495  // iterate over aContextIDs entries, start with 3, prev ones are already used above
496  for(sal_uInt16 i(3); aContextIDs[i].nContextID != -1; i++)
497  {
498  nIndex = aContextIDs[i].nIndex;
499 
500  if ( nIndex != -1 )
501  {
502  // Found!
503  struct XMLPropertyState& rState = GetProperties()[nIndex];
504 
505  switch(aContextIDs[i].nContextID)
506  {
508  case CTF_FILLTRANSNAME:
509  case CTF_FILLHATCHNAME:
510  case CTF_FILLBITMAPNAME:
511  {
512  // DrawingLayer FillStyle name needs to be mapped to DisplayName
513  OUString sStyleName;
514  rState.maValue >>= sStyleName;
515 
516  // translate the used name from ODF intern to the name used in the Model
517  sStyleName = GetImport().GetStyleDisplayName(aFamilies[i - 7], sStyleName);
518 
519  if(bAutomatic)
520  {
521  // in this case the rPropSet got not really filled since above the call to
522  // CheckSpecialContext was used and not FillPropertySet, thus the below call to
523  // setPropertyValue can fail/will not be useful (e.g. when the rPropSet
524  // is a SwXTextCursor).
525  // This happens for AutoStyles which are already filled in XMLPropStyleContext::CreateAndInsert,
526  // thus the whole mechanism based on _ContextID_Index_Pair will not work
527  // in that case. Thus the slots which need to be converted already get
528  // converted there (it's called first) and not here (see
529  // translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames)
530  // For convenience, still Write back the corrected value to the XMLPropertyState entry
531  rState.maValue <<= sStyleName;
532  break;
533  }
534 
535  // Still needed if it's not an AutomaticStyle (!)
536  try
537  {
538  if(!rPropMapper.is())
539  {
540  rPropMapper = xImpPrMap->getPropertySetMapper();
541  }
542 
543  // set property
544  const OUString& rPropertyName = rPropMapper->GetEntryAPIName(rState.mnIndex);
545 
546  if(!xInfo.is())
547  {
548  xInfo = rPropSet->getPropertySetInfo();
549  }
550 
551  if(xInfo->hasPropertyByName(rPropertyName))
552  {
553  rPropSet->setPropertyValue(rPropertyName,Any(sStyleName));
554  }
555  }
556  catch(css::lang::IllegalArgumentException& e)
557  {
558  Sequence<OUString> aSeq { sStyleName };
560  }
561  break;
562  }
563  default:
564  {
565  // check for StarBats and StarMath fonts
566  Any rAny = rState.maValue;
567  sal_Int32 nMapperIndex = rState.mnIndex;
568 
569  // Now check for font name in rState and set corrected value,
570  // if necessary.
571  OUString sFontName;
572  rAny >>= sFontName;
573 
574  if ( !sFontName.isEmpty() )
575  {
576  if ( sFontName.equalsIgnoreAsciiCase( "StarBats" ) ||
577  sFontName.equalsIgnoreAsciiCase( "StarMath" ) )
578  {
579  // construct new value
580  sFontName = "StarSymbol";
581  Any aAny(rAny);
582  aAny <<= sFontName;
583 
584  if(!rPropMapper.is())
585  {
586  rPropMapper = xImpPrMap->getPropertySetMapper();
587  }
588 
589  // set property
590  OUString rPropertyName(rPropMapper->GetEntryAPIName(nMapperIndex));
591 
592  if(!xInfo.is())
593  {
594  xInfo = rPropSet->getPropertySetInfo();
595  }
596 
597  if(xInfo->hasPropertyByName(rPropertyName))
598  {
599  rPropSet->setPropertyValue(rPropertyName,aAny);
600  }
601  }
602  // else: "normal" style name -> no correction is necessary
603  }
604  // else: no style name found -> illegal value -> ignore
605  }
606  }
607  }
608  }
609 
610 }
611 
612 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int16 nContextID
Definition: xmlimppr.hxx:58
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:83
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: prstylei.cxx:175
const SvXMLEnumMapEntry< sal_uInt16 > aCategoryMap[]
Definition: txtstyli.cxx:66
signed char sal_Int8
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: txtstyli.cxx:360
#define CTF_BORDER_MODEL
Definition: txtprmap.hxx:151
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:59
const css::uno::Reference< css::style::XStyle > & GetStyle() const
Definition: prstylei.hxx:106
bool IsNew() const
Definition: xmlstyle.hxx:88
sal_Int32 mnIndex
Definition: maptype.hxx:124
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:108
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3482
#define CTF_FONTFAMILYNAME_CJK
Definition: txtprmap.hxx:95
#define CTF_FILLGRADIENTNAME
Definition: xmlsdtypes.hxx:137
#define CTF_KEEP_TOGETHER
Definition: txtprmap.hxx:145
#define CTF_FILLTRANSNAME
Definition: xmlsdtypes.hxx:140
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:599
#define XML_TYPE_PROP_TABLE_ROW
Definition: xmltypes.hxx:104
#define CTF_FONTFAMILYNAME
Definition: txtprmap.hxx:58
OUString m_sListStyleName
Definition: txtstyli.hxx:30
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:306
OUString m_sMasterPageName
Definition: txtstyli.hxx:33
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
XmlStyleFamily
Definition: families.hxx:47
#define CTF_FILLBITMAPNAME
Definition: xmlsdtypes.hxx:139
#define XML_TYPE_PROP_PARAGRAPH
Definition: xmltypes.hxx:99
const OUString & GetAutoName() const
Definition: xmlstyle.hxx:79
sal_Int8 m_nOutlineLevel
Definition: txtstyli.hxx:36
#define XMLERROR_FLAG_WARNING
Definition: xmlerror.hxx:35
OUString m_sCategoryVal
Definition: txtstyli.hxx:31
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: txtstyli.cxx:138
#define DBG_UNHANDLED_EXCEPTION(...)
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:510
#define XMLERROR_STYLE_PROP_VALUE
Definition: xmlerror.hxx:68
#define DBG_ASSERT(sCon, aError)
const OUString & GetDisplayName() const
Definition: xmlstyle.hxx:78
int i
virtual void Finish(bool bOverwrite) override
Definition: txtstyli.cxx:239
virtual void CreateAndInsert(bool bOverwrite) override
Definition: txtstyli.cxx:179
OUString m_sDataStyleName
Definition: txtstyli.hxx:34
::std::vector< XMLPropertyState > & GetProperties()
Definition: prstylei.hxx:79
virtual void CreateAndInsert(bool bOverwrite) override
Definition: prstylei.cxx:257
#define XML_TYPE_PROP_TEXT
Definition: xmltypes.hxx:98
#define CTF_FILLHATCHNAME
Definition: xmlsdtypes.hxx:138
#define XML_TYPE_PROP_TABLE
Definition: xmltypes.hxx:102
virtual void Finish(bool bOverwrite) override
Definition: prstylei.cxx:446
OUString m_sDropCapTextStyleName
Definition: txtstyli.hxx:32
virtual void SetDefaults() override
Definition: txtstyli.cxx:222
css::uno::Any maValue
Definition: maptype.hxx:125
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
Definition: xmlimp.hxx:103
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1412
#define SAL_WARN_IF(condition, area, stream)
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: prstylei.cxx:57
#define CTF_COMBINED_CHARACTERS_FIELD
Definition: txtprmap.hxx:134
Handling of tokens in XML:
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: txtstyli.cxx:77
~XMLTextStyleContext() override
Definition: txtstyli.cxx:135
#define CTF_FONTFAMILYNAME_CTL
Definition: txtprmap.hxx:104
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:96
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
rtl::Reference< XMLEventsImportContext > m_xEventContext
Definition: txtstyli.hxx:46
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Definition: xmluconv.hxx:145
#define CTF_TEXT_DISPLAY
Definition: txtprmap.hxx:170
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams, const OUString &rExceptionMessage, const css::uno::Reference< css::xml::sax::XLocator > &rLocator)
Record an error condition that occurred during import.
Sequence< sal_Int8 > aSeq
SvXMLStylesContext * GetStyles()
Definition: prstylei.hxx:78
This struct is used as an optional parameter to the static _FillPropertySet() methods.
Definition: xmlimppr.hxx:56
Reference< XSingleServiceFactory > xFactory
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:93
XMLTextStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false)
Definition: txtstyli.cxx:122
#define XML_TYPE_PROP_SECTION
Definition: xmltypes.hxx:101
bool m_bHasCombinedCharactersLetter
Definition: txtstyli.hxx:41
constexpr sal_uInt16 XML_NAMESPACE_STYLE
double maValue
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
OUString sDisplayName
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)