LibreOffice Module xmloff (master)  1
prstylei.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 <sal/config.h>
21 
22 #include <o3tl/any.hxx>
23 #include <osl/diagnose.h>
24 #include <sal/log.hxx>
25 #include <set>
26 #include <xmloff/xmlnamespace.hxx>
27 #include <xmloff/xmltoken.hxx>
28 #include <xmloff/xmlprcon.hxx>
29 #include <com/sun/star/frame/XModel.hpp>
30 #include <com/sun/star/style/XStyle.hpp>
31 #include <com/sun/star/style/XAutoStyleFamily.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <com/sun/star/beans/XPropertyState.hpp>
35 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <xmloff/xmlimp.hxx>
38 #include <xmloff/prstylei.hxx>
39 #include <xmloff/xmlerror.hxx>
40 #include <xmloff/xmltypes.hxx>
41 #include <xmloff/maptype.hxx>
42 #include <xmloff/xmlimppr.hxx>
43 #include <xmloff/xmlprmap.hxx>
44 #include <comphelper/sequence.hxx>
45 #include <com/sun/star/drawing/FillStyle.hpp>
46 
47 using namespace ::com::sun::star;
48 using namespace ::com::sun::star::uno;
49 using namespace ::com::sun::star::xml::sax;
50 using namespace ::com::sun::star::style;
51 using namespace ::com::sun::star::container;
52 using namespace ::com::sun::star::beans;
53 using namespace ::com::sun::star::lang;
54 using namespace ::xmloff::token;
55 using namespace com::sun::star::drawing;
56 
57 void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
58  const OUString& rLocalName,
59  const OUString& rValue )
60 {
61  if( XML_NAMESPACE_STYLE == nPrefixKey && IsXMLToken( rLocalName, XML_FAMILY ) )
62  {
63  SAL_WARN_IF( GetFamily() != SvXMLStylesContext::GetFamily( rValue ), "xmloff", "unexpected style family" );
64  }
65  else
66  {
67  SvXMLStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
68  }
69 }
70 
71 
72 namespace
73 {
74  struct theStandardSet :
75  public rtl::StaticWithInit<OldFillStyleDefinitionSet, theStandardSet>
76  {
77  OldFillStyleDefinitionSet operator () ()
78  {
80  aSet.insert("BackColorRGB");
81  aSet.insert("BackTransparent");
82  aSet.insert("BackColorTransparency");
83  aSet.insert("BackGraphic");
84  aSet.insert("BackGraphicFilter");
85  aSet.insert("BackGraphicLocation");
86  aSet.insert("BackGraphicTransparency");
87  return aSet;
88  }
89  };
90  struct theHeaderSet :
91  public rtl::StaticWithInit<OldFillStyleDefinitionSet, theHeaderSet>
92  {
93  OldFillStyleDefinitionSet operator () ()
94  {
96  aSet.insert("HeaderBackColorRGB");
97  aSet.insert("HeaderBackTransparent");
98  aSet.insert("HeaderBackColorTransparency");
99  aSet.insert("HeaderBackGraphic");
100  aSet.insert("HeaderBackGraphicFilter");
101  aSet.insert("HeaderBackGraphicLocation");
102  aSet.insert("HeaderBackGraphicTransparency");
103  return aSet;
104  }
105  };
106  struct theFooterSet :
107  public rtl::StaticWithInit<OldFillStyleDefinitionSet, theFooterSet>
108  {
109  OldFillStyleDefinitionSet operator () ()
110  {
112  aSet.insert("FooterBackColorRGB");
113  aSet.insert("FooterBackTransparent");
114  aSet.insert("FooterBackColorTransparency");
115  aSet.insert("FooterBackGraphic");
116  aSet.insert("FooterBackGraphicFilter");
117  aSet.insert("FooterBackGraphicLocation");
118  aSet.insert("FooterBackGraphicTransparency");
119  return aSet;
120  }
121  };
122  struct theParaSet :
123  public rtl::StaticWithInit<OldFillStyleDefinitionSet, theParaSet>
124  {
125  OldFillStyleDefinitionSet operator () ()
126  {
128  // Caution: here it is *not* 'ParaBackColorRGB' as it should be, but indeed
129  // 'ParaBackColor' is used, see aXMLParaPropMap definition (line 313)
130  aSet.insert("ParaBackColor");
131  aSet.insert("ParaBackTransparent");
132  aSet.insert("ParaBackGraphicLocation");
133  aSet.insert("ParaBackGraphicFilter");
134  aSet.insert("ParaBackGraphic");
135 
136  // These are not used in aXMLParaPropMap definition, thus not needed here
137  // aSet.insert("ParaBackColorTransparency");
138  // aSet.insert("ParaBackGraphicTransparency");
139  return aSet;
140  }
141  };
142 }
143 
144 
145 
146 constexpr OUStringLiteral gsIsPhysical( u"IsPhysical" );
147 constexpr OUStringLiteral gsFollowStyle( u"FollowStyle" );
148 
150  SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
151  bool bDefault )
152 : SvXMLStyleContext( rImport, nFamily, bDefault )
153 , mxStyles( &rStyles )
154 {
155 }
156 
158 {
159 }
160 
162 {
163  return theStandardSet::get();
164 }
165 
167 {
168  return theHeaderSet::get();
169 }
170 
172 {
173  return theFooterSet::get();
174 }
175 
176 css::uno::Reference< css::xml::sax::XFastContextHandler > XMLPropStyleContext::createFastChildContext(
177  sal_Int32 nElement,
178  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
179 {
180  sal_uInt32 nFamily = 0;
181  if( IsTokenInNamespace(nElement, XML_NAMESPACE_STYLE) ||
183  {
184  sal_Int32 nLocalName = nElement & TOKEN_MASK;
185  if( nLocalName == XML_GRAPHIC_PROPERTIES )
186  nFamily = XML_TYPE_PROP_GRAPHIC;
187  else if( nLocalName == XML_DRAWING_PAGE_PROPERTIES )
188  nFamily = XML_TYPE_PROP_DRAWING_PAGE;
189  else if( nLocalName == XML_TEXT_PROPERTIES )
190  nFamily = XML_TYPE_PROP_TEXT;
191  else if( nLocalName == XML_PARAGRAPH_PROPERTIES )
192  nFamily = XML_TYPE_PROP_PARAGRAPH;
193  else if( nLocalName == XML_RUBY_PROPERTIES )
194  nFamily = XML_TYPE_PROP_RUBY;
195  else if( nLocalName == XML_SECTION_PROPERTIES )
196  nFamily = XML_TYPE_PROP_SECTION;
197  else if( nLocalName == XML_TABLE_PROPERTIES )
198  nFamily = XML_TYPE_PROP_TABLE;
199  else if( nLocalName == XML_TABLE_COLUMN_PROPERTIES )
200  nFamily = XML_TYPE_PROP_TABLE_COLUMN;
201  else if( nLocalName ==XML_TABLE_ROW_PROPERTIES )
202  nFamily = XML_TYPE_PROP_TABLE_ROW;
203  else if( nLocalName == XML_TABLE_CELL_PROPERTIES )
204  nFamily = XML_TYPE_PROP_TABLE_CELL;
205  else if( nLocalName == XML_CHART_PROPERTIES )
206  nFamily = XML_TYPE_PROP_CHART;
207  }
208  if( nFamily )
209  {
211  mxStyles->GetImportPropertyMapper( GetFamily() );
212  if( xImpPrMap.is() )
213  return new SvXMLPropertySetContext( GetImport(), nElement,
214  xAttrList,
215  nFamily,
216  maProperties,
217  xImpPrMap );
218  }
219  SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
220  return nullptr;
221 }
222 
224  const Reference< XPropertySet > & rPropSet )
225 {
227  mxStyles->GetImportPropertyMapper( GetFamily() );
228  SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
229  if( xImpPrMap.is() )
230  xImpPrMap->FillPropertySet( maProperties, rPropSet );
231 }
232 
234 {
235 }
236 
237 Reference < XStyle > XMLPropStyleContext::Create()
238 {
239  Reference < XStyle > xNewStyle;
240 
241  OUString sServiceName = mxStyles->GetServiceName( GetFamily() );
242  if( !sServiceName.isEmpty() )
243  {
244  Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
245  UNO_QUERY );
246  if( xFactory.is() )
247  {
249  xFactory->createInstance( sServiceName );
250  if( xIfc.is() )
251  xNewStyle.set( xIfc, UNO_QUERY );
252  }
253  }
254 
255  return xNewStyle;
256 }
257 
259 {
260  SvXMLStylesContext* pSvXMLStylesContext = mxStyles.get();
262  OSL_ENSURE(xImpPrMap.is(), "There is no import prop mapper");
263 
264  // need to filter out old fill definitions when the new ones are used. The new
265  // ones are used when a FillStyle is defined
266  const bool bTakeCareOfDrawingLayerFillStyle(xImpPrMap.is() && GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH);
267  bool bDrawingLayerFillStylesUsed(false);
268 
269  if(bTakeCareOfDrawingLayerFillStyle)
270  {
271  // check if new FillStyles are used and if so mark old ones with -1
272  static OUString s_FillStyle("FillStyle");
273 
275  {
276  deactivateOldFillStyleDefinitions(theParaSet::get());
277  bDrawingLayerFillStylesUsed = true;
278  }
279  }
280 
281  if( pSvXMLStylesContext->IsAutomaticStyle()
283  {
284  // Need to translate StyleName from temp MapNames to names
285  // used in already imported items (already exist in the pool). This
286  // is required for AutomaticStyles since these do *not* use FillPropertySet
287  // and thus just trigger CheckSpecialContext in XMLTextStyleContext::FillPropertySet
288  // (which may be double action anyways). The mechanism there to use _ContextID_Index_Pair
289  // is not working for AutomaticStyles and is already too late, too (this
290  // method is already called before XMLTextStyleContext::FillPropertySet gets called)
291  if(bDrawingLayerFillStylesUsed)
292  {
294  }
295 
296  Reference < XAutoStyleFamily > xAutoFamily = pSvXMLStylesContext->GetAutoStyles( GetFamily() );
297  if( !xAutoFamily.is() )
298  return;
299  if( xImpPrMap.is() )
300  {
301  Sequence< PropertyValue > aValues;
302  xImpPrMap->FillPropertySequence( maProperties, aValues );
303 
304  sal_Int32 nLen = aValues.getLength();
305  if( nLen )
306  {
308  {
309  aValues.realloc( nLen + 2 );
310  PropertyValue *pProps = aValues.getArray() + nLen;
311  pProps->Name = "ParaStyleName";
312  OUString sParent( GetParentName() );
313  if( !sParent.isEmpty() )
314  {
315  sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent );
316  Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() );
317  if(xFamilies.is() && xFamilies->hasByName( sParent ) )
318  {
319  css::uno::Reference< css::style::XStyle > xStyle;
320  Any aAny = xFamilies->getByName( sParent );
321  aAny >>= xStyle;
322  sParent = xStyle->getName() ;
323  }
324  }
325  else
326  sParent = "Standard";
327  pProps->Value <<= sParent;
328  ++pProps;
329  pProps->Name = "ParaConditionalStyleName";
330  pProps->Value <<= sParent;
331  }
332 
333  Reference < XAutoStyle > xAutoStyle = xAutoFamily->insertStyle( aValues );
334  if( xAutoStyle.is() )
335  {
337  aPropNames[0] = GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ?
338  OUStringLiteral(u"ParaAutoStyleName") :
339  OUStringLiteral(u"CharAutoStyleName");
340  Sequence< Any > aAny = xAutoStyle->getPropertyValues( aPropNames );
341  if( aAny.hasElements() )
342  {
343  OUString aName;
344  aAny[0] >>= aName;
345  SetAutoName( aName );
346  }
347  }
348  }
349  }
350  }
351  else
352  {
353  const OUString& rName = GetDisplayName();
354  if( rName.isEmpty() || IsDefaultStyle() )
355  return;
356 
357  Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() );
358  if( !xFamilies.is() )
359  {
360  SAL_WARN("xmloff", "no styles container for family " << static_cast<int>(GetFamily()));
361  return;
362  }
363 
364  bool bNew = false;
365  if( xFamilies->hasByName( rName ) )
366  {
367  Any aAny = xFamilies->getByName( rName );
368  aAny >>= mxStyle;
369  }
370  else
371  {
372  mxStyle = Create();
373  if( !mxStyle.is() )
374  return;
375 
376  xFamilies->insertByName( rName, Any(mxStyle) );
377  bNew = true;
378  }
379 
380  Reference < XPropertySet > xPropSet( mxStyle, UNO_QUERY );
381  Reference< XPropertySetInfo > xPropSetInfo =
382  xPropSet->getPropertySetInfo();
383  if( !bNew && xPropSetInfo->hasPropertyByName( gsIsPhysical ) )
384  {
385  Any aAny = xPropSet->getPropertyValue( gsIsPhysical );
386  bNew = !*o3tl::doAccess<bool>(aAny);
387  }
388  SetNew( bNew );
389  if( rName != GetName() )
391 
392 
393  if( bOverwrite || bNew )
394  {
396  if( xImpPrMap.is() )
397  xPrMap = xImpPrMap->getPropertySetMapper();
398  if( xPrMap.is() )
399  {
400  Reference < XMultiPropertyStates > xMultiStates( xPropSet,
401  UNO_QUERY );
402  if( xMultiStates.is() )
403  {
404  xMultiStates->setAllPropertiesToDefault();
405  }
406  else
407  {
408  std::set < OUString > aNameSet;
409  sal_Int32 nCount = xPrMap->GetEntryCount();
410  sal_Int32 i;
411  for( i = 0; i < nCount; i++ )
412  {
413  const OUString& rPrName = xPrMap->GetEntryAPIName( i );
414  if( xPropSetInfo->hasPropertyByName( rPrName ) )
415  aNameSet.insert( rPrName );
416  }
417  Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
418  if (xPropState.is())
419  {
420  nCount = aNameSet.size();
422  Sequence < PropertyState > aStates( xPropState->getPropertyStates(aNames) );
423  const PropertyState *pStates = aStates.getConstArray();
424  OUString* pNames = aNames.getArray();
425 
426  for( i = 0; i < nCount; i++ )
427  {
428  if( PropertyState_DIRECT_VALUE == *pStates++ )
429  xPropState->setPropertyToDefault( pNames[i] );
430  }
431  }
432  }
433  }
434 
435  if (mxStyle.is())
436  mxStyle->setParentStyle(OUString());
437 
438  FillPropertySet( xPropSet );
439  }
440  else
441  {
442  SetValid( false );
443  }
444  }
445 }
446 
447 void XMLPropStyleContext::Finish( bool bOverwrite )
448 {
449  if( !mxStyle.is() || !(IsNew() || bOverwrite) )
450  return;
451 
452  // The families container must exist
453  Reference < XNameContainer > xFamilies = mxStyles->GetStylesContainer( GetFamily() );
454  SAL_WARN_IF( !xFamilies.is(), "xmloff", "Families lost" );
455  if( !xFamilies.is() )
456  return;
457 
458  // connect parent
459  OUString sParent( GetParentName() );
460  if( !sParent.isEmpty() )
461  sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent );
462  if( !sParent.isEmpty() && !xFamilies->hasByName( sParent ) )
463  sParent.clear();
464 
465  if( sParent != mxStyle->getParentStyle() )
466  {
467  // this may except if setting the parent style forms a
468  // circle in the style dependencies; especially if the parent
469  // style is the same as the current style
470  try
471  {
472  mxStyle->setParentStyle( sParent );
473  }
474  catch(const uno::Exception& e)
475  {
476  // according to the API definition, I would expect a
477  // container::NoSuchElementException. But it throws an
478  // uno::RuntimeException instead. I catch
479  // uno::Exception in order to process both of them.
480 
481  // We can't set the parent style. For a proper
482  // Error-Message, we should pass in the name of the
483  // style, as well as the desired parent style.
484  Sequence<OUString> aSequence(2);
485 
486  // getName() throws no non-Runtime exception:
487  aSequence[0] = mxStyle->getName();
488  aSequence[1] = sParent;
489 
492  aSequence, e.Message, nullptr );
493  }
494  }
495 
496  // connect follow
497  OUString sFollow( GetFollow() );
498  if( !sFollow.isEmpty() )
499  sFollow = GetImport().GetStyleDisplayName( GetFamily(), sFollow );
500  if( sFollow.isEmpty() || !xFamilies->hasByName( sFollow ) )
501  sFollow = mxStyle->getName();
502 
503  Reference < XPropertySet > xPropSet( mxStyle, UNO_QUERY );
504  Reference< XPropertySetInfo > xPropSetInfo =
505  xPropSet->getPropertySetInfo();
506  if( xPropSetInfo->hasPropertyByName( gsFollowStyle ) )
507  {
508  Any aAny = xPropSet->getPropertyValue( gsFollowStyle );
509  OUString sCurrFollow;
510  aAny >>= sCurrFollow;
511  if( sCurrFollow != sFollow )
512  {
513  xPropSet->setPropertyValue( gsFollowStyle, Any(sFollow) );
514  }
515  }
516 
517  if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
518  {
519  xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
520  }
521 
522 }
523 
525  const OUString& rFillStyleTag) const
526 {
527  if(!maProperties.empty() && rFillStyleTag.getLength())
528  {
529  // no & to avoid non-obvious UAF due to the 2nd temp Reference
530  const rtl::Reference<XMLPropertySetMapper> rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
531 
532  if(rMapper.is())
533  {
534  for(const auto& a : maProperties)
535  {
536  if(a.mnIndex != -1)
537  {
538  const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
539 
540  if(rPropName == rFillStyleTag)
541  {
542  FillStyle eFillStyle(FillStyle_NONE);
543 
544  if(a.maValue >>= eFillStyle)
545  {
546  // okay, type was good, FillStyle is set
547  }
548  else
549  {
550  // also try an int (see XFillStyleItem::PutValue)
551  sal_Int32 nFillStyle(0);
552 
553  if(a.maValue >>= nFillStyle)
554  {
555  eFillStyle = static_cast< FillStyle >(nFillStyle);
556  }
557  }
558 
559  // we found the entry, check it
560  return FillStyle_NONE != eFillStyle;
561  }
562  }
563  }
564  }
565  }
566 
567  return false;
568 }
569 
571  const OldFillStyleDefinitionSet& rHashSetOfTags)
572 {
573  if(rHashSetOfTags.empty() || maProperties.empty())
574  return;
575 
576  const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
577 
578  if(!rMapper.is())
579  return;
580 
581  for(auto& a : maProperties)
582  {
583  if(a.mnIndex != -1)
584  {
585  const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
586 
587  if(rHashSetOfTags.find(rPropName) != rHashSetOfTags.end())
588  {
589  // mark entry as inactive
590  a.mnIndex = -1;
591  }
592  }
593  }
594 }
595 
597 {
598  if(maProperties.empty())
599  return;
600 
601  const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
602 
603  if(!rMapper.is())
604  return;
605 
606  static OUString s_FillGradientName("FillGradientName");
607  static OUString s_FillHatchName("FillHatchName");
608  static OUString s_FillBitmapName("FillBitmapName");
609  static OUString s_FillTransparenceGradientName("FillTransparenceGradientName");
610 
611  for(auto& a : maProperties)
612  {
613  if(a.mnIndex != -1)
614  {
615  const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
617 
618  if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName)
619  {
620  aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID;
621  }
622  else if(rPropName == s_FillHatchName)
623  {
624  aStyleFamily = XmlStyleFamily::SD_HATCH_ID;
625  }
626  else if(rPropName == s_FillBitmapName)
627  {
628  aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID;
629  }
630 
631  if(aStyleFamily != XmlStyleFamily::DATA_STYLE)
632  {
633  OUString sStyleName;
634 
635  a.maValue >>= sStyleName;
636  sStyleName = GetImport().GetStyleDisplayName( aStyleFamily, sStyleName );
637  a.maValue <<= sStyleName;
638  }
639  }
640  }
641 }
642 
643 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:104
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:176
bool IsXMLToken(const OUString &rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3434
std::unordered_set< OUString > OldFillStyleDefinitionSet
Definition: prstylei.hxx:38
static const OldFillStyleDefinitionSet & getStandardSet()
Definition: prstylei.cxx:161
void SetNew(bool b)
Definition: xmlstyle.hxx:110
#define XML_TYPE_PROP_RUBY
Definition: xmltypes.hxx:100
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:62
bool IsNew() const
Definition: xmlstyle.hxx:109
virtual void SetAttribute(sal_uInt16 nPrefixKey, const OUString &rLocalName, const OUString &rValue) override
Definition: prstylei.cxx:57
css::uno::Reference< css::style::XAutoStyleFamily > GetAutoStyles(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:610
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:129
#define XML_TYPE_PROP_TABLE_ROW
Definition: xmltypes.hxx:104
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:326
#define XML_TYPE_PROP_TABLE_COLUMN
Definition: xmltypes.hxx:103
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
XmlStyleFamily
Definition: families.hxx:47
#define XML_TYPE_PROP_PARAGRAPH
Definition: xmltypes.hxx:99
int nCount
virtual css::uno::Reference< css::style::XStyle > Create()
Definition: prstylei.cxx:237
static OUString getPrefixAndNameFromToken(sal_Int32 nToken)
Definition: xmlimp.cxx:2000
virtual ~XMLPropStyleContext() override
Definition: prstylei.cxx:157
bool doNewDrawingLayerFillStyleDefinitionsExist(const OUString &rFillStyleTag) const
Definition: prstylei.cxx:524
XMLPropStyleContext(XMLPropStyleContext const &)=delete
void deactivateOldFillStyleDefinitions(const OldFillStyleDefinitionSet &rHashSetOfTags)
Definition: prstylei.cxx:570
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:530
bool IsHidden() const
Definition: xmlstyle.hxx:112
const OUString & GetDisplayName() const
Definition: xmlstyle.hxx:99
int i
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Definition: prstylei.cxx:223
uno_Any a
virtual void CreateAndInsert(bool bOverwrite) override
Definition: prstylei.cxx:258
float u
const PropertyStruct aPropNames[]
css::uno::Reference< css::style::XStyle > mxStyle
Definition: prstylei.hxx:44
#define XML_TYPE_PROP_TEXT
Definition: xmltypes.hxx:98
rtl::Reference< SvXMLStylesContext > mxStyles
Definition: prstylei.hxx:45
constexpr OUStringLiteral gsFollowStyle(u"FollowStyle")
#define XML_TYPE_PROP_CHART
Definition: xmltypes.hxx:107
#define XML_TYPE_PROP_TABLE
Definition: xmltypes.hxx:102
virtual void SetDefaults() override
Definition: prstylei.cxx:233
void SetValid(bool b)
Definition: xmlstyle.hxx:107
virtual void Finish(bool bOverwrite) override
Definition: prstylei.cxx:447
static const OldFillStyleDefinitionSet & getHeaderSet()
Definition: prstylei.cxx:166
static const OldFillStyleDefinitionSet & getFooterSet()
Definition: prstylei.cxx:171
const OUString & GetParentName() const
Definition: xmlstyle.hxx:101
#define XML_TYPE_PROP_TABLE_CELL
Definition: xmltypes.hxx:105
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
Definition: xmlimp.hxx:101
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1469
#define SAL_WARN_IF(condition, area, stream)
const OUString & GetName() const
Definition: xmlstyle.hxx:98
::std::vector< XMLPropertyState > maProperties
Definition: prstylei.hxx:43
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Handling of tokens in XML:
#define XML_TYPE_PROP_GRAPHIC
Definition: xmltypes.hxx:94
OUString aName
#define XMLERROR_FLAG_ERROR
Definition: xmlerror.hxx:36
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.
void SetAutoName(const OUString &rName)
Definition: xmlstyle.hxx:84
SvXMLStylesContext * GetStyles()
Definition: prstylei.hxx:80
#define XML_TYPE_PROP_DRAWING_PAGE
Definition: xmltypes.hxx:95
void translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames()
Definition: prstylei.cxx:596
virtual void SetAttribute(sal_uInt16 nPrefixKey, const OUString &rLocalName, const OUString &rValue)
Definition: xmlstyle.cxx:65
const OUString & GetFollow() const
Definition: xmlstyle.hxx:102
void AddStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName, const OUString &rDisplayName)
Definition: xmlimp.cxx:1438
#define SAL_WARN(area, stream)
Reference< XSingleServiceFactory > xFactory
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:91
static XmlStyleFamily GetFamily(const OUString &rFamily)
Definition: xmlstyle.cxx:473
const char sServiceName[]
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:639
constexpr OUStringLiteral gsIsPhysical(u"IsPhysical")
#define XMLERROR_PARENT_STYLE_NOT_ALLOWED
Definition: xmlerror.hxx:55
#define XML_TYPE_PROP_SECTION
Definition: xmltypes.hxx:101
constexpr sal_uInt16 XML_NAMESPACE_STYLE