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 OUString aName;
345 aAny[0] >>= aName;
347 }
348 }
349 }
350 }
351 }
352 else
353 {
354 const OUString& rName = GetDisplayName();
355 if( rName.isEmpty() || IsDefaultStyle() )
356 return;
357
358 Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() );
359 if( !xFamilies.is() )
360 {
361 SAL_WARN("xmloff", "no styles container for family " << static_cast<int>(GetFamily()));
362 return;
363 }
364
365 bool bNew = false;
366 if( xFamilies->hasByName( rName ) )
367 {
368 Any aAny = xFamilies->getByName( rName );
369 aAny >>= mxStyle;
370 }
371 else
372 {
373 mxStyle = Create();
374 if( !mxStyle.is() )
375 return;
376
377 xFamilies->insertByName( rName, Any(mxStyle) );
378 bNew = true;
379 }
380
381 Reference < XPropertySet > xPropSet( mxStyle, UNO_QUERY );
382 Reference< XPropertySetInfo > xPropSetInfo =
383 xPropSet->getPropertySetInfo();
384 if( !bNew && xPropSetInfo->hasPropertyByName( gsIsPhysical ) )
385 {
386 Any aAny = xPropSet->getPropertyValue( gsIsPhysical );
387 bNew = !*o3tl::doAccess<bool>(aAny);
388 }
389 SetNew( bNew );
390 if( rName != GetName() )
391 GetImport().AddStyleDisplayName( GetFamily(), GetName(), rName );
392
393
394 if( bOverwrite || bNew )
395 {
397 if( xImpPrMap.is() )
398 xPrMap = xImpPrMap->getPropertySetMapper();
399 if( xPrMap.is() )
400 {
401 Reference < XMultiPropertyStates > xMultiStates( xPropSet,
402 UNO_QUERY );
403 if( xMultiStates.is() )
404 {
405 xMultiStates->setAllPropertiesToDefault();
406 }
407 else
408 {
409 std::set < OUString > aNameSet;
410 sal_Int32 nCount = xPrMap->GetEntryCount();
411 sal_Int32 i;
412 for( i = 0; i < nCount; i++ )
413 {
414 const OUString& rPrName = xPrMap->GetEntryAPIName( i );
415 if( xPropSetInfo->hasPropertyByName( rPrName ) )
416 aNameSet.insert( rPrName );
417 }
418 Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
419 if (xPropState.is())
420 {
421 nCount = aNameSet.size();
422 Sequence<OUString> aNames( comphelper::containerToSequence(aNameSet) );
423 Sequence < PropertyState > aStates( xPropState->getPropertyStates(aNames) );
424 const PropertyState *pStates = aStates.getConstArray();
425 OUString* pNames = aNames.getArray();
426
427 for( i = 0; i < nCount; i++ )
428 {
429 if( PropertyState_DIRECT_VALUE == *pStates++ )
430 xPropState->setPropertyToDefault( pNames[i] );
431 }
432 }
433 }
434 }
435
436 if (mxStyle.is())
437 mxStyle->setParentStyle(OUString());
438
439 FillPropertySet( xPropSet );
440 }
441 else
442 {
443 SetValid( false );
444 }
445 }
446}
447
448void XMLPropStyleContext::Finish( bool bOverwrite )
449{
450 if( !mxStyle.is() || !(IsNew() || bOverwrite) )
451 return;
452
453 // The families container must exist
454 Reference < XNameContainer > xFamilies = mxStyles->GetStylesContainer( GetFamily() );
455 SAL_WARN_IF( !xFamilies.is(), "xmloff", "Families lost" );
456 if( !xFamilies.is() )
457 return;
458
459 // connect parent
460 OUString sParent( GetParentName() );
461 if( !sParent.isEmpty() )
462 sParent = GetImport().GetStyleDisplayName( GetFamily(), sParent );
463 if( !sParent.isEmpty() && !xFamilies->hasByName( sParent ) )
464 sParent.clear();
465
466 if( sParent != mxStyle->getParentStyle() )
467 {
468 // this may except if setting the parent style forms a
469 // circle in the style dependencies; especially if the parent
470 // style is the same as the current style
471 try
472 {
473 mxStyle->setParentStyle( sParent );
474 }
475 catch(const uno::Exception& e)
476 {
477 // according to the API definition, I would expect a
478 // container::NoSuchElementException. But it throws an
479 // uno::RuntimeException instead. I catch
480 // uno::Exception in order to process both of them.
481
482 // We can't set the parent style. For a proper
483 // Error-Message, we should pass in the name of the
484 // style, as well as the desired parent style.
485
486 // getName() throws no non-Runtime exception:
487 GetImport().SetError(
489 { mxStyle->getName(), sParent }, e.Message, nullptr );
490 }
491 }
492
493 // connect follow
494 OUString sFollow( GetFollow() );
495 if( !sFollow.isEmpty() )
496 sFollow = GetImport().GetStyleDisplayName( GetFamily(), sFollow );
497 if( sFollow.isEmpty() || !xFamilies->hasByName( sFollow ) )
498 sFollow = mxStyle->getName();
499
500 Reference < XPropertySet > xPropSet( mxStyle, UNO_QUERY );
501 Reference< XPropertySetInfo > xPropSetInfo =
502 xPropSet->getPropertySetInfo();
503 if( xPropSetInfo->hasPropertyByName( gsFollowStyle ) )
504 {
505 Any aAny = xPropSet->getPropertyValue( gsFollowStyle );
506 OUString sCurrFollow;
507 aAny >>= sCurrFollow;
508 if( sCurrFollow != sFollow )
509 {
510 xPropSet->setPropertyValue( gsFollowStyle, Any(sFollow) );
511 }
512 }
513
514 // Connect linked style.
515 OUString aLinked(GetLinked());
516 if (!aLinked.isEmpty())
517 {
519 {
520 aLinked = GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_TEXT, aLinked);
521 }
523 {
524 aLinked = GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_PARAGRAPH, aLinked);
525 }
526 }
527 if (!aLinked.isEmpty() && xPropSetInfo->hasPropertyByName("LinkStyle"))
528 {
529 uno::Any aAny = xPropSet->getPropertyValue("LinkStyle");
530 OUString aCurrentLinked;
531 aAny >>= aCurrentLinked;
532 if (aCurrentLinked != aLinked)
533 {
534 xPropSet->setPropertyValue("LinkStyle", uno::Any(aLinked));
535 }
536 }
537
538 if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
539 {
540 xPropSet->setPropertyValue( "Hidden", uno::Any( IsHidden( ) ) );
541 }
542
543}
544
546 std::u16string_view rFillStyleTag) const
547{
548 if(!maProperties.empty() && !rFillStyleTag.empty())
549 {
550 // no & to avoid non-obvious UAF due to the 2nd temp Reference
551 const rtl::Reference<XMLPropertySetMapper> rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
552
553 if(rMapper.is())
554 {
555 for(const auto& a : maProperties)
556 {
557 if(a.mnIndex != -1)
558 {
559 const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
560
561 if(rPropName == rFillStyleTag)
562 {
563 FillStyle eFillStyle(FillStyle_NONE);
564
565 if(a.maValue >>= eFillStyle)
566 {
567 // okay, type was good, FillStyle is set
568 }
569 else
570 {
571 // also try an int (see XFillStyleItem::PutValue)
572 sal_Int32 nFillStyle(0);
573
574 if(a.maValue >>= nFillStyle)
575 {
576 eFillStyle = static_cast< FillStyle >(nFillStyle);
577 }
578 }
579
580 // we found the entry, check it
581 return FillStyle_NONE != eFillStyle;
582 }
583 }
584 }
585 }
586 }
587
588 return false;
589}
590
592 const OldFillStyleDefinitionSet& rHashSetOfTags)
593{
594 if(rHashSetOfTags.empty() || maProperties.empty())
595 return;
596
597 const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
598
599 if(!rMapper.is())
600 return;
601
602 for(auto& a : maProperties)
603 {
604 if(a.mnIndex != -1)
605 {
606 const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
607
608 if(rHashSetOfTags.find(rPropName) != rHashSetOfTags.end())
609 {
610 // mark entry as inactive
611 a.mnIndex = -1;
612 }
613 }
614 }
615}
616
618{
619 if(maProperties.empty())
620 return;
621
622 const rtl::Reference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper();
623
624 if(!rMapper.is())
625 return;
626
627 static constexpr OUStringLiteral s_FillGradientName(u"FillGradientName");
628 static constexpr OUStringLiteral s_FillHatchName(u"FillHatchName");
629 static constexpr OUStringLiteral s_FillBitmapName(u"FillBitmapName");
630 static constexpr OUStringLiteral s_FillTransparenceGradientName(u"FillTransparenceGradientName");
631
632 for(auto& a : maProperties)
633 {
634 if(a.mnIndex != -1)
635 {
636 const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex);
638
639 if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName)
640 {
641 aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID;
642 }
643 else if(rPropName == s_FillHatchName)
644 {
645 aStyleFamily = XmlStyleFamily::SD_HATCH_ID;
646 }
647 else if(rPropName == s_FillBitmapName)
648 {
650 }
651
652 if(aStyleFamily != XmlStyleFamily::DATA_STYLE)
653 {
654 OUString sStyleName;
655
656 a.maValue >>= sStyleName;
657 sStyleName = GetImport().GetStyleDisplayName( aStyleFamily, sStyleName );
658 a.maValue <<= sStyleName;
659 }
660 }
661 }
662}
663
664/* 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:71
const OUString & GetName() const
Definition: xmlstyle.hxx:78
const OUString & GetFollow() const
Definition: xmlstyle.hxx:82
void SetAutoName(const OUString &rName)
Definition: xmlstyle.hxx:64
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
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:463
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:632
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:520
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:314
css::uno::Reference< css::style::XAutoStyleFamily > GetAutoStyles(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:603
virtual void SetDefaults() override
Definition: prstylei.cxx:232
bool doNewDrawingLayerFillStyleDefinitionsExist(std::u16string_view rFillStyleTag) const
Definition: prstylei.cxx:545
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:617
void deactivateOldFillStyleDefinitions(const OldFillStyleDefinitionSet &rHashSetOfTags)
Definition: prstylei.cxx:591
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:448
int nCount
float u
Reference< XSingleServiceFactory > xFactory
XmlStyleFamily
Definition: families.hxx:50
OUString aName
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:2634
@ XML_DRAWING_PAGE_PROPERTIES
Definition: xmltoken.hxx:2624
@ XML_SECTION_PROPERTIES
Definition: xmltoken.hxx:2630
@ XML_TABLE_COLUMN_PROPERTIES
Definition: xmltoken.hxx:2632
@ XML_PARAGRAPH_PROPERTIES
Definition: xmltoken.hxx:2628
@ XML_GRAPHIC_PROPERTIES
Definition: xmltoken.hxx:2623
@ XML_TABLE_ROW_PROPERTIES
Definition: xmltoken.hxx:2633
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