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