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/xmlnmspe.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 const OUStringLiteral gsIsPhysical( "IsPhysical" );
147 const OUStringLiteral gsFollowStyle( "FollowStyle" );
148 
150  sal_uInt16 nPrfx, const OUString& rLName,
151  const Reference< XAttributeList > & xAttrList,
152  SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
153  bool bDefault )
154 : SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily, bDefault )
155 , mxStyles( &rStyles )
156 {
157 }
158 
160 {
161 }
162 
164 {
165  return theStandardSet::get();
166 }
167 
169 {
170  return theHeaderSet::get();
171 }
172 
174 {
175  return theFooterSet::get();
176 }
177 
179  sal_uInt16 nPrefix,
180  const OUString& rLocalName,
181  const Reference< XAttributeList > & xAttrList )
182 {
183  SvXMLImportContextRef xContext;
184 
185  sal_uInt32 nFamily = 0;
186  if( XML_NAMESPACE_STYLE == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix )
187  {
188  if( IsXMLToken( rLocalName, XML_GRAPHIC_PROPERTIES ) )
189  nFamily = XML_TYPE_PROP_GRAPHIC;
190  else if( IsXMLToken( rLocalName, XML_DRAWING_PAGE_PROPERTIES ) )
191  nFamily = XML_TYPE_PROP_DRAWING_PAGE;
192  else if( IsXMLToken( rLocalName, XML_TEXT_PROPERTIES ) )
193  nFamily = XML_TYPE_PROP_TEXT;
194  else if( IsXMLToken( rLocalName, XML_PARAGRAPH_PROPERTIES ) )
195  nFamily = XML_TYPE_PROP_PARAGRAPH;
196  else if( IsXMLToken( rLocalName, XML_RUBY_PROPERTIES ) )
197  nFamily = XML_TYPE_PROP_RUBY;
198  else if( IsXMLToken( rLocalName, XML_SECTION_PROPERTIES ) )
199  nFamily = XML_TYPE_PROP_SECTION;
200  else if( IsXMLToken( rLocalName, XML_TABLE_PROPERTIES ) )
201  nFamily = XML_TYPE_PROP_TABLE;
202  else if( IsXMLToken( rLocalName, XML_TABLE_COLUMN_PROPERTIES ) )
203  nFamily = XML_TYPE_PROP_TABLE_COLUMN;
204  else if( IsXMLToken( rLocalName, XML_TABLE_ROW_PROPERTIES ) )
205  nFamily = XML_TYPE_PROP_TABLE_ROW;
206  else if( IsXMLToken( rLocalName, XML_TABLE_CELL_PROPERTIES ) )
207  nFamily = XML_TYPE_PROP_TABLE_CELL;
208  else if( IsXMLToken( rLocalName, XML_CHART_PROPERTIES ) )
209  nFamily = XML_TYPE_PROP_CHART;
210  }
211  if( nFamily )
212  {
214  static_cast<SvXMLStylesContext *>(mxStyles.get())->GetImportPropertyMapper(
215  GetFamily() );
216  if( xImpPrMap.is() )
217  xContext = new SvXMLPropertySetContext( GetImport(), nPrefix,
218  rLocalName, xAttrList,
219  nFamily,
220  maProperties,
221  xImpPrMap );
222  }
223 
224  if (!xContext)
225  xContext = SvXMLStyleContext::CreateChildContext( nPrefix, rLocalName,
226  xAttrList );
227 
228  return xContext;
229 }
230 
232  const Reference< XPropertySet > & rPropSet )
233 {
235  static_cast<SvXMLStylesContext *>(mxStyles.get())->GetImportPropertyMapper(
236  GetFamily() );
237  SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
238  if( xImpPrMap.is() )
239  xImpPrMap->FillPropertySet( maProperties, rPropSet );
240 }
241 
243 {
244 }
245 
246 Reference < XStyle > XMLPropStyleContext::Create()
247 {
248  Reference < XStyle > xNewStyle;
249 
250  OUString sServiceName(
251  static_cast<SvXMLStylesContext *>(mxStyles.get())->GetServiceName( GetFamily() ) );
252  if( !sServiceName.isEmpty() )
253  {
254  Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
255  UNO_QUERY );
256  if( xFactory.is() )
257  {
259  xFactory->createInstance( sServiceName );
260  if( xIfc.is() )
261  xNewStyle.set( xIfc, UNO_QUERY );
262  }
263  }
264 
265  return xNewStyle;
266 }
267 
269 {
270  SvXMLStylesContext* pSvXMLStylesContext = static_cast< SvXMLStylesContext* >(mxStyles.get());
272  OSL_ENSURE(xImpPrMap.is(), "There is no import prop mapper");
273 
274  // need to filter out old fill definitions when the new ones are used. The new
275  // ones are used when a FillStyle is defined
276  const bool bTakeCareOfDrawingLayerFillStyle(xImpPrMap.is() && GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH);
277  bool bDrawingLayerFillStylesUsed(false);
278 
279  if(bTakeCareOfDrawingLayerFillStyle)
280  {
281  // check if new FillStyles are used and if so mark old ones with -1
282  static OUString s_FillStyle("FillStyle");
283 
285  {
286  deactivateOldFillStyleDefinitions(theParaSet::get());
287  bDrawingLayerFillStylesUsed = true;
288  }
289  }
290 
291  if( pSvXMLStylesContext->IsAutomaticStyle()
293  {
294  // Need to translate StyleName from temp MapNames to names
295  // used in already imported items (already exist in the pool). This
296  // is required for AutomaticStyles since these do *not* use FillPropertySet
297  // and thus just trigger CheckSpecialContext in XMLTextStyleContext::FillPropertySet
298  // (which may be double action anyways). The mechanism there to use _ContextID_Index_Pair
299  // is not working for AutomaticStyles and is already too late, too (this
300  // method is already called before XMLTextStyleContext::FillPropertySet gets called)
301  if(bDrawingLayerFillStylesUsed)
302  {
304  }
305 
306  Reference < XAutoStyleFamily > xAutoFamily = pSvXMLStylesContext->GetAutoStyles( GetFamily() );
307  if( !xAutoFamily.is() )
308  return;
309  if( xImpPrMap.is() )
310  {
311  Sequence< PropertyValue > aValues;
312  xImpPrMap->FillPropertySequence( maProperties, aValues );
313 
314  sal_Int32 nLen = aValues.getLength();
315  if( nLen )
316  {
318  {
319  aValues.realloc( nLen + 2 );
320  PropertyValue *pProps = aValues.getArray() + nLen;
321  pProps->Name = "ParaStyleName";
322  OUString sParent( GetParentName() );
323  if( !sParent.isEmpty() )
324  {
325  sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent );
326  Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() );
327  if(xFamilies.is() && xFamilies->hasByName( sParent ) )
328  {
329  css::uno::Reference< css::style::XStyle > xStyle;
330  Any aAny = xFamilies->getByName( sParent );
331  aAny >>= xStyle;
332  sParent = xStyle->getName() ;
333  }
334  }
335  else
336  sParent = "Standard";
337  pProps->Value <<= sParent;
338  ++pProps;
339  pProps->Name = "ParaConditionalStyleName";
340  pProps->Value <<= sParent;
341  }
342 
343  Reference < XAutoStyle > xAutoStyle = xAutoFamily->insertStyle( aValues );
344  if( xAutoStyle.is() )
345  {
347  aPropNames[0] = GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ?
348  OUStringLiteral("ParaAutoStyleName") :
349  OUStringLiteral("CharAutoStyleName");
350  Sequence< Any > aAny = xAutoStyle->getPropertyValues( aPropNames );
351  if( aAny.hasElements() )
352  {
353  OUString aName;
354  aAny[0] >>= aName;
355  SetAutoName( aName );
356  }
357  }
358  }
359  }
360  }
361  else
362  {
363  const OUString& rName = GetDisplayName();
364  if( rName.isEmpty() || IsDefaultStyle() )
365  return;
366 
367  Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() );
368  if( !xFamilies.is() )
369  {
370  SAL_WARN("xmloff", "no styles container for family " << static_cast<int>(GetFamily()));
371  return;
372  }
373 
374  bool bNew = false;
375  if( xFamilies->hasByName( rName ) )
376  {
377  Any aAny = xFamilies->getByName( rName );
378  aAny >>= mxStyle;
379  }
380  else
381  {
382  mxStyle = Create();
383  if( !mxStyle.is() )
384  return;
385 
386  xFamilies->insertByName( rName, Any(mxStyle) );
387  bNew = true;
388  }
389 
390  Reference < XPropertySet > xPropSet( mxStyle, UNO_QUERY );
391  Reference< XPropertySetInfo > xPropSetInfo =
392  xPropSet->getPropertySetInfo();
393  if( !bNew && xPropSetInfo->hasPropertyByName( gsIsPhysical ) )
394  {
395  Any aAny = xPropSet->getPropertyValue( gsIsPhysical );
396  bNew = !*o3tl::doAccess<bool>(aAny);
397  }
398  SetNew( bNew );
399  if( rName != GetName() )
401 
402 
403  if( bOverwrite || bNew )
404  {
406  if( xImpPrMap.is() )
407  xPrMap = xImpPrMap->getPropertySetMapper();
408  if( xPrMap.is() )
409  {
410  Reference < XMultiPropertyStates > xMultiStates( xPropSet,
411  UNO_QUERY );
412  if( xMultiStates.is() )
413  {
414  xMultiStates->setAllPropertiesToDefault();
415  }
416  else
417  {
418  std::set < OUString > aNameSet;
419  sal_Int32 nCount = xPrMap->GetEntryCount();
420  sal_Int32 i;
421  for( i = 0; i < nCount; i++ )
422  {
423  const OUString& rPrName = xPrMap->GetEntryAPIName( i );
424  if( xPropSetInfo->hasPropertyByName( rPrName ) )
425  aNameSet.insert( rPrName );
426  }
427  Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
428  if (xPropState.is())
429  {
430  nCount = aNameSet.size();
432  Sequence < PropertyState > aStates( xPropState->getPropertyStates(aNames) );
433  const PropertyState *pStates = aStates.getConstArray();
434  OUString* pNames = aNames.getArray();
435 
436  for( i = 0; i < nCount; i++ )
437  {
438  if( PropertyState_DIRECT_VALUE == *pStates++ )
439  xPropState->setPropertyToDefault( pNames[i] );
440  }
441  }
442  }
443  }
444 
445  if (mxStyle.is())
446  mxStyle->setParentStyle(OUString());
447 
448  FillPropertySet( xPropSet );
449  }
450  else
451  {
452  SetValid( false );
453  }
454  }
455 }
456 
457 void XMLPropStyleContext::Finish( bool bOverwrite )
458 {
459  if( !mxStyle.is() || !(IsNew() || bOverwrite) )
460  return;
461 
462  // The families container must exist
463  Reference < XNameContainer > xFamilies =
464  static_cast<SvXMLStylesContext *>(mxStyles.get())->GetStylesContainer( GetFamily() );
465  SAL_WARN_IF( !xFamilies.is(), "xmloff", "Families lost" );
466  if( !xFamilies.is() )
467  return;
468 
469  // connect parent
470  OUString sParent( GetParentName() );
471  if( !sParent.isEmpty() )
472  sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent );
473  if( !sParent.isEmpty() && !xFamilies->hasByName( sParent ) )
474  sParent.clear();
475 
476  if( sParent != mxStyle->getParentStyle() )
477  {
478  // this may except if setting the parent style forms a
479  // circle in the style dependencies; especially if the parent
480  // style is the same as the current style
481  try
482  {
483  mxStyle->setParentStyle( sParent );
484  }
485  catch(const uno::Exception& e)
486  {
487  // according to the API definition, I would expect a
488  // container::NoSuchElementException. But it throws an
489  // uno::RuntimeException instead. I catch
490  // uno::Exception in order to process both of them.
491 
492  // We can't set the parent style. For a proper
493  // Error-Message, we should pass in the name of the
494  // style, as well as the desired parent style.
495  Sequence<OUString> aSequence(2);
496 
497  // getName() throws no non-Runtime exception:
498  aSequence[0] = mxStyle->getName();
499  aSequence[1] = sParent;
500 
503  aSequence, e.Message, nullptr );
504  }
505  }
506 
507  // connect follow
508  OUString sFollow( GetFollow() );
509  if( !sFollow.isEmpty() )
510  sFollow = GetImport().GetStyleDisplayName( GetFamily(), sFollow );
511  if( sFollow.isEmpty() || !xFamilies->hasByName( sFollow ) )
512  sFollow = mxStyle->getName();
513 
514  Reference < XPropertySet > xPropSet( mxStyle, UNO_QUERY );
515  Reference< XPropertySetInfo > xPropSetInfo =
516  xPropSet->getPropertySetInfo();
517  if( xPropSetInfo->hasPropertyByName( gsFollowStyle ) )
518  {
519  Any aAny = xPropSet->getPropertyValue( gsFollowStyle );
520  OUString sCurrFollow;
521  aAny >>= sCurrFollow;
522  if( sCurrFollow != sFollow )
523  {
524  xPropSet->setPropertyValue( gsFollowStyle, Any(sFollow) );
525  }
526  }
527 
528  if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
529  {
530  xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
531  }
532 
533 }
534 
536  const OUString& rFillStyleTag) const
537 {
538  if(!maProperties.empty() && rFillStyleTag.getLength())
539  {
540  // no & to avoid non-obvious UAF due to the 2nd temp Reference
541  const rtl::Reference<XMLPropertySetMapper> rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
542 
543  if(rMapper.is())
544  {
545  for(const auto& a : maProperties)
546  {
547  if(a.mnIndex != -1)
548  {
549  const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
550 
551  if(rPropName == rFillStyleTag)
552  {
553  FillStyle eFillStyle(FillStyle_NONE);
554 
555  if(a.maValue >>= eFillStyle)
556  {
557  // okay, type was good, FillStyle is set
558  }
559  else
560  {
561  // also try an int (see XFillStyleItem::PutValue)
562  sal_Int32 nFillStyle(0);
563 
564  if(a.maValue >>= nFillStyle)
565  {
566  eFillStyle = static_cast< FillStyle >(nFillStyle);
567  }
568  }
569 
570  // we found the entry, check it
571  return FillStyle_NONE != eFillStyle;
572  }
573  }
574  }
575  }
576  }
577 
578  return false;
579 }
580 
582  const OldFillStyleDefinitionSet& rHashSetOfTags)
583 {
584  if(!rHashSetOfTags.empty() && !maProperties.empty())
585  {
586  const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
587 
588  if(rMapper.is())
589  {
590  for(auto& a : maProperties)
591  {
592  if(a.mnIndex != -1)
593  {
594  const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
595 
596  if(rHashSetOfTags.find(rPropName) != rHashSetOfTags.end())
597  {
598  // mark entry as inactive
599  a.mnIndex = -1;
600  }
601  }
602  }
603  }
604  }
605 }
606 
608 {
609  if(!maProperties.empty())
610  {
611  const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
612 
613  if(rMapper.is())
614  {
615  static OUString s_FillGradientName("FillGradientName");
616  static OUString s_FillHatchName("FillHatchName");
617  static OUString s_FillBitmapName("FillBitmapName");
618  static OUString s_FillTransparenceGradientName("FillTransparenceGradientName");
619 
620  for(auto& a : maProperties)
621  {
622  if(a.mnIndex != -1)
623  {
624  const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
626 
627  if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName)
628  {
629  aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID;
630  }
631  else if(rPropName == s_FillHatchName)
632  {
633  aStyleFamily = XmlStyleFamily::SD_HATCH_ID;
634  }
635  else if(rPropName == s_FillBitmapName)
636  {
637  aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID;
638  }
639 
640  if(aStyleFamily != XmlStyleFamily::DATA_STYLE)
641  {
642  OUString sStyleName;
643 
644  a.maValue >>= sStyleName;
645  sStyleName = GetImport().GetStyleDisplayName( aStyleFamily, sStyleName );
646  a.maValue <<= sStyleName;
647  }
648  }
649  }
650  }
651  }
652 }
653 
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
Definition: xmlnmspe.hxx:80
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:112
bool IsXMLToken(const OUString &rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3427
constexpr sal_uInt16 XML_NAMESPACE_STYLE
Definition: xmlnmspe.hxx:30
const OUStringLiteral gsFollowStyle("FollowStyle")
std::unordered_set< OUString > OldFillStyleDefinitionSet
Definition: prstylei.hxx:38
static const OldFillStyleDefinitionSet & getStandardSet()
Definition: prstylei.cxx:163
void SetNew(bool b)
Definition: xmlstyle.hxx:118
#define XML_TYPE_PROP_RUBY
Definition: xmltypes.hxx:100
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:62
bool IsNew() const
Definition: xmlstyle.hxx:117
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:667
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:137
#define XML_TYPE_PROP_TABLE_ROW
Definition: xmltypes.hxx:104
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:359
#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:246
SvXMLImportContextRef mxStyles
Definition: prstylei.hxx:45
virtual ~XMLPropStyleContext() override
Definition: prstylei.cxx:159
bool doNewDrawingLayerFillStyleDefinitionsExist(const OUString &rFillStyleTag) const
Definition: prstylei.cxx:535
XMLPropStyleContext(XMLPropStyleContext const &)=delete
void deactivateOldFillStyleDefinitions(const OldFillStyleDefinitionSet &rHashSetOfTags)
Definition: prstylei.cxx:581
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:587
bool IsHidden() const
Definition: xmlstyle.hxx:120
const OUString & GetDisplayName() const
Definition: xmlstyle.hxx:107
int i
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Definition: prstylei.cxx:231
uno_Any a
virtual void CreateAndInsert(bool bOverwrite) override
Definition: prstylei.cxx:268
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.
Definition: prstylei.cxx:178
const OUStringLiteral gsIsPhysical("IsPhysical")
const PropertyStruct aPropNames[]
css::uno::Reference< css::style::XStyle > mxStyle
Definition: prstylei.hxx:44
#define XML_TYPE_PROP_TEXT
Definition: xmltypes.hxx:98
#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:242
void SetValid(bool b)
Definition: xmlstyle.hxx:115
virtual void Finish(bool bOverwrite) override
Definition: prstylei.cxx:457
static const OldFillStyleDefinitionSet & getHeaderSet()
Definition: prstylei.cxx:168
static const OldFillStyleDefinitionSet & getFooterSet()
Definition: prstylei.cxx:173
const OUString & GetParentName() const
Definition: xmlstyle.hxx:109
#define XML_TYPE_PROP_TABLE_CELL
Definition: xmltypes.hxx:105
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1496
#define SAL_WARN_IF(condition, area, stream)
const OUString & GetName() const
Definition: xmlstyle.hxx:106
::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
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
Create a children element context.
Definition: xmlictxt.cxx:51
#define XML_TYPE_PROP_DRAWING_PAGE
Definition: xmltypes.hxx:95
void translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames()
Definition: prstylei.cxx:607
virtual void SetAttribute(sal_uInt16 nPrefixKey, const OUString &rLocalName, const OUString &rValue)
Definition: xmlstyle.cxx:94
const OUString & GetFollow() const
Definition: xmlstyle.hxx:110
void AddStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName, const OUString &rDisplayName)
Definition: xmlimp.cxx:1465
#define SAL_WARN(area, stream)
Reference< XSingleServiceFactory > xFactory
static XmlStyleFamily GetFamily(const OUString &rFamily)
Definition: xmlstyle.cxx:530
const char sServiceName[]
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:697
#define XMLERROR_PARENT_STYLE_NOT_ALLOWED
Definition: xmlerror.hxx:55
#define XML_TYPE_PROP_SECTION
Definition: xmltypes.hxx:101