LibreOffice Module xmloff (master) 1
xmlstyle.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 <config_wasm_strip.h>
21
22#include <sal/config.h>
23
24#include <com/sun/star/frame/XModel.hpp>
25#include <com/sun/star/xml/sax/XAttributeList.hpp>
26#include <com/sun/star/container/XNameContainer.hpp>
27#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
28#include <com/sun/star/style/XAutoStylesSupplier.hpp>
29#include <com/sun/star/style/XAutoStyleFamily.hpp>
31#include <sal/log.hxx>
32#include <svl/style.hxx>
33#include <utility>
36#include <xmloff/xmltoken.hxx>
37
38#include <xmloff/families.hxx>
39#include <xmloff/xmlimp.hxx>
40#include <xmloff/xmlnumi.hxx>
41#include <xmloff/xmlimppr.hxx>
42#include <xmloff/xmlstyle.hxx>
43#include <xmloff/txtstyli.hxx>
44#include <xmloff/xmlnumfi.hxx>
48#include "FillStyleContext.hxx"
54
55#include <memory>
56#include <set>
57#include <string_view>
58#include <vector>
59
60using namespace ::com::sun::star;
61using namespace ::com::sun::star::uno;
62using namespace ::com::sun::star::container;
63using namespace ::com::sun::star::style;
64using namespace ::xmloff::token;
65
66constexpr OUStringLiteral gsParaStyleServiceName( u"com.sun.star.style.ParagraphStyle" );
67constexpr OUStringLiteral gsTextStyleServiceName( u"com.sun.star.style.CharacterStyle" );
68
69void SvXMLStyleContext::SetAttribute( sal_Int32 nElement,
70 const OUString& rValue )
71{
72 switch (nElement)
73 {
75 {
76 if( IsXMLToken( rValue, XML_PARAGRAPH ) )
77 mnFamily = XmlStyleFamily(SfxStyleFamily::Para);
78 else if( IsXMLToken( rValue, XML_TEXT ) )
79 mnFamily = XmlStyleFamily(SfxStyleFamily::Char);
80 break;
81 }
83 maName = rValue;
84 break;
86 maDisplayName = rValue;
87 break;
89 maParentName = rValue;
90 break;
92 maFollow = rValue;
93 break;
95 maLinked = rValue;
96 break;
98 mbHidden = rValue.toBoolean();
99 break;
100 case XML_ELEMENT(LO_EXT, XML_HIDDEN):
101 mbHidden = rValue.toBoolean();
102 break;
103 }
104}
105
106
108 SvXMLImport& rImp,
109 XmlStyleFamily nFam, bool bDefault ) :
110 SvXMLImportContext( rImp ),
111 mbHidden( false ),
112 mnFamily( nFam ),
113 mbValid( true ),
114 mbNew( true ),
115 mbDefaultStyle( bDefault )
116{
117}
118
120{
121}
122
124 sal_Int32 /*nElement*/,
125 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
126{
127 for( auto &it : sax_fastparser::castToFastAttributeList( xAttrList ) )
128 SetAttribute( it.getToken(), it.toString() );
129}
130
132{
133}
134
135void SvXMLStyleContext::CreateAndInsert( bool /*bOverwrite*/ )
136{
137}
138
139void SvXMLStyleContext::CreateAndInsertLate( bool /*bOverwrite*/ )
140{
141}
142
143void SvXMLStyleContext::Finish( bool /*bOverwrite*/ )
144{
145}
146
148{
149 return false;
150}
152namespace {
153
154class SvXMLStyleIndex_Impl
156 OUString sName;
157 XmlStyleFamily nFamily;
158 // we deliberately don't use a reference here, to avoid creating a ref-count-cycle
160
161public:
162
163 SvXMLStyleIndex_Impl( XmlStyleFamily nFam, OUString aName ) :
164 sName(std::move( aName )),
165 nFamily( nFam ),
166 mpStyle(nullptr)
167 {
168 }
169
170 SvXMLStyleIndex_Impl( const rtl::Reference<SvXMLStyleContext> &rStl ) :
171 sName( rStl->GetName() ),
172 nFamily( rStl->GetFamily() ),
173 mpStyle ( rStl.get() )
174 {
175 }
176
177 const OUString& GetName() const { return sName; }
178 XmlStyleFamily GetFamily() const { return nFamily; }
179 const SvXMLStyleContext *GetStyle() const { return mpStyle; }
180};
181
182struct SvXMLStyleIndexCmp_Impl
183{
184 bool operator()(const SvXMLStyleIndex_Impl& r1, const SvXMLStyleIndex_Impl& r2) const
185 {
186 sal_Int32 nRet;
187
188 if( r1.GetFamily() < r2.GetFamily() )
189 nRet = -1;
190 else if( r1.GetFamily() > r2.GetFamily() )
191 nRet = 1;
192 else
193 nRet = r1.GetName().compareTo( r2.GetName() );
194
195 return nRet < 0;
196 }
197};
198
199}
200
202{
203 typedef std::set<SvXMLStyleIndex_Impl, SvXMLStyleIndexCmp_Impl> IndicesType;
204
205 std::vector<rtl::Reference<SvXMLStyleContext>> aStyles;
206 mutable std::unique_ptr<IndicesType> pIndices;
208
209#if OSL_DEBUG_LEVEL > 0
210 mutable sal_uInt32 m_nIndexCreated;
211#endif
212
213 void FlushIndex() { pIndices.reset(); }
214
215public:
216 explicit SvXMLStylesContext_Impl( bool bAuto );
217
218 size_t GetStyleCount() const { return aStyles.size(); }
219
221 {
222 return i < aStyles.size() ? aStyles[ i ].get() : nullptr;
223 }
224
225 inline void AddStyle( SvXMLStyleContext *pStyle );
226 void dispose();
227
229 const OUString& rName,
230 bool bCreateIndex ) const;
231 bool IsAutomaticStyle() const { return bAutomaticStyle; }
232};
233
235 bAutomaticStyle( bAuto )
236#if OSL_DEBUG_LEVEL > 0
237 , m_nIndexCreated( 0 )
238#endif
239{}
240
242{
243#if OSL_DEBUG_LEVEL > 0
244// for (auto const & xStyle : aStyles)
245// if (xStyle->GetFamily() == pStyle->GetFamily() && xStyle->GetName() == pStyle->GetName())
246// assert(false && "duplicate style");
247#endif
248 aStyles.emplace_back(pStyle );
249
250 FlushIndex();
251}
252
254{
255 FlushIndex();
256 aStyles.clear();
257}
258
260 const OUString& rName,
261 bool bCreateIndex ) const
262{
263 const SvXMLStyleContext *pStyle = nullptr;
264
265 if( !pIndices && bCreateIndex && !aStyles.empty() )
266 {
267 pIndices = std::make_unique<IndicesType>(aStyles.begin(), aStyles.end());
268 SAL_WARN_IF(pIndices->size() != aStyles.size(), "xmloff.style", "Here is a duplicate Style");
269#if OSL_DEBUG_LEVEL > 0
270 SAL_WARN_IF(0 != m_nIndexCreated, "xmloff.style",
271 "Performance warning: sdbcx::Index created multiple times");
273#endif
274 }
275
276 if( pIndices )
277 {
278 SvXMLStyleIndex_Impl aIndex( nFamily, rName );
279 IndicesType::iterator aFind = pIndices->find(aIndex);
280 if( aFind != pIndices->end() )
281 pStyle = aFind->GetStyle();
282 }
283 else
284 {
285 for( size_t i = 0; !pStyle && i < aStyles.size(); i++ )
286 {
287 const SvXMLStyleContext *pS = aStyles[ i ].get();
288 if( pS->GetFamily() == nFamily &&
289 pS->GetName() == rName )
290 pStyle = pS;
291 }
292 }
293 return pStyle;
294}
295
296
298{
299 return mpImpl->GetStyleCount();
300}
301
303{
304 return mpImpl->GetStyle( i );
305}
306
308{
309 return mpImpl->GetStyle( i );
310}
311
313{
314 return mpImpl->IsAutomaticStyle();
315}
316
318 sal_Int32 nElement,
319 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
320{
321 SvXMLStyleContext *pStyle = nullptr;
322
323 if(GetImport().GetDataStylesImport())
324 {
326 xAttrList, *this);
327 if (pStyle)
328 return pStyle;
329 }
330
331 switch (nElement)
332 {
335 {
337 for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) )
338 {
339 if( aIter.getToken() == XML_ELEMENT(STYLE, XML_FAMILY) )
340 {
341 nFamily = GetFamily( aIter.toString() );
342 break;
343 }
344 }
345 pStyle = XML_ELEMENT(STYLE, XML_STYLE)==nElement
346 ? CreateStyleStyleChildContext( nFamily, nElement, xAttrList )
347 : CreateDefaultStyleStyleChildContext( nFamily, nElement, xAttrList );
348 break;
349 }
352 break;
355 GetImport(), nElement, xAttrList);
356 break;
359 break;
362 {
363 //there is not page family in ODF now, so I specify one for it
364 bool bDefaultStyle = XML_ELEMENT(STYLE, XML_DEFAULT_PAGE_LAYOUT) == nElement;
365 pStyle = new PageStyleContext( GetImport(), *this, bDefaultStyle );
366 }
367 break;
369 pStyle = new SvxXMLListStyleContext( GetImport() );
370 break;
372 pStyle = new SvxXMLListStyleContext( GetImport(), true );
373 break;
374
375 // FillStyles
376
378 {
379 pStyle = new XMLGradientStyleContext( GetImport(), nElement, xAttrList );
380 break;
381 }
383 {
384 pStyle = new XMLHatchStyleContext( GetImport(), nElement, xAttrList );
385 break;
386 }
388 {
389 pStyle = new XMLBitmapStyleContext( GetImport(), nElement, xAttrList );
390 break;
391 }
393 {
394 pStyle = new XMLTransGradientStyleContext( GetImport(), nElement, xAttrList );
395 break;
396 }
398 {
399 pStyle = new XMLMarkerStyleContext( GetImport(), nElement, xAttrList );
400 break;
401 }
403 {
404 pStyle = new XMLDashStyleContext( GetImport(), nElement, xAttrList );
405 break;
406 }
407 }
408
409 if (!pStyle)
410 SAL_WARN("xmloff", "Unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
411
412 return pStyle;
413}
414
416 XmlStyleFamily nFamily, sal_Int32 /*nElement*/,
417 const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
418{
419 SvXMLStyleContext *pStyle = nullptr;
420
421 switch( nFamily )
422 {
426 pStyle = new XMLTextStyleContext( GetImport(), *this, nFamily );
427 break;
428
430 pStyle = new XMLPropStyleContext( GetImport(), *this, nFamily );
431 break;
432#if !ENABLE_WASM_STRIP_CHART
433 // WASM_CHART change
435 pStyle = new XMLChartStyleContext( GetImport(), *this, nFamily );
436 break;
437#endif
441 pStyle = new XMLShapeStyleContext( GetImport(), *this, nFamily );
442 break;
443 default: break;
444 }
445
446 return pStyle;
447}
448
450 XmlStyleFamily /*nFamily*/, sal_Int32 /*nElement*/,
451 const uno::Reference< xml::sax::XFastAttributeList > & )
452{
453 return nullptr;
454}
455
457{
458 return true;
459}
460
462{
464 if( IsXMLToken( rValue, XML_PARAGRAPH ) )
465 {
467 }
468 else if( IsXMLToken( rValue, XML_TEXT ) )
469 {
471 }
472 else if( IsXMLToken( rValue, XML_DATA_STYLE ) )
473 {
475 }
476 else if ( IsXMLToken( rValue, XML_SECTION ) )
477 {
479 }
480 else if( IsXMLToken( rValue, XML_TABLE ) )
481 {
483 }
484 else if( IsXMLToken( rValue, XML_TABLE_COLUMN ) )
486 else if( IsXMLToken( rValue, XML_TABLE_ROW ) )
488 else if( IsXMLToken( rValue, XML_TABLE_CELL ) )
490 else if ( rValue == XML_STYLE_FAMILY_SD_GRAPHICS_NAME )
491 {
493 }
494 else if ( rValue == XML_STYLE_FAMILY_SD_PRESENTATION_NAME )
495 {
497 }
498 else if ( rValue == XML_STYLE_FAMILY_SD_POOL_NAME )
499 {
501 }
502 else if ( rValue == XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME )
503 {
505 }
506 else if ( rValue == XML_STYLE_FAMILY_SCH_CHART_NAME )
507 {
509 }
510 else if ( IsXMLToken( rValue, XML_RUBY ) )
511 {
513 }
514
515 return nFamily;
516}
517
519 XmlStyleFamily nFamily ) const
520{
522
523 switch( nFamily )
524 {
526 if( !mxParaImpPropMapper.is() )
527 {
528 SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
529 pThis->mxParaImpPropMapper =
530 pThis->GetImport().GetTextImport()
531 ->GetParaImportPropertySetMapper();
532 }
533 xMapper = mxParaImpPropMapper;
534 break;
536 if( !mxTextImpPropMapper.is() )
537 {
538 SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
539 pThis->mxTextImpPropMapper =
540 pThis->GetImport().GetTextImport()
541 ->GetTextImportPropertySetMapper();
542 }
543 xMapper = mxTextImpPropMapper;
544 break;
545
547 // don't cache section mapper, as it's rarely used
548 // *sigh*, cast to non-const, because this is a const method,
549 // but SvXMLImport::GetTextImport() isn't.
550 xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
551 GetSectionImportPropertySetMapper();
552 break;
553
555 // don't cache section mapper, as it's rarely used
556 // *sigh*, cast to non-const, because this is a const method,
557 // but SvXMLImport::GetTextImport() isn't.
558 xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
559 GetRubyImportPropertySetMapper();
560 break;
561
565 if(!mxShapeImpPropMapper.is())
566 {
567 rtl::Reference< XMLShapeImportHelper > aImpHelper = const_cast<SvXMLImport&>(GetImport()).GetShapeImport();
568 const_cast<SvXMLStylesContext*>(this)->mxShapeImpPropMapper =
569 aImpHelper->GetPropertySetMapper();
570 }
571 xMapper = mxShapeImpPropMapper;
572 break;
573#if !ENABLE_WASM_STRIP_CHART
574 // WASM_CHART change
576 if( ! mxChartImpPropMapper.is() )
577 {
578 XMLPropertySetMapper *const pPropMapper = new XMLChartPropertySetMapper(nullptr);
580 }
581 xMapper = mxChartImpPropMapper;
582 break;
583#endif
585 if( ! mxPageImpPropMapper.is() )
586 {
587 XMLPropertySetMapper *pPropMapper =
590 new PageMasterImportPropertyMapper( pPropMapper,
591 const_cast<SvXMLStylesContext*>(this)->GetImport() );
592 }
593 xMapper = mxPageImpPropMapper;
594 break;
595 default: break;
596 }
597
598 return xMapper;
599}
600
601Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily nFamily ) const
602{
603 Reference < XAutoStyleFamily > xAutoStyles;
605 {
606 bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily;
607 if( !bPara && mxTextAutoStyles.is() )
608 xAutoStyles = mxTextAutoStyles;
609 else if( bPara && mxParaAutoStyles.is() )
610 xAutoStyles = mxParaAutoStyles;
611 else
612 {
613 OUString sName(bPara ? std::u16string_view( u"ParagraphStyles" ): std::u16string_view( u"CharacterStyles" ));
614 Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY );
615 Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
616 if (xAutoStyleFamilies->hasByName(sName))
617 {
618 Any aAny = xAutoStyleFamilies->getByName( sName );
619 aAny >>= xAutoStyles;
620 if( bPara )
621 const_cast<SvXMLStylesContext *>(this)->mxParaAutoStyles = xAutoStyles;
622 else
623 const_cast<SvXMLStylesContext *>(this)->mxTextAutoStyles = xAutoStyles;
624 }
625 }
626 }
627 return xAutoStyles;
628}
629
630Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
631 XmlStyleFamily nFamily ) const
632{
633 Reference < XNameContainer > xStyles;
634 OUString sName;
635 switch( nFamily )
636 {
638 if( mxParaStyles.is() )
639 xStyles = mxParaStyles;
640 else
641 sName = "ParagraphStyles";
642 break;
643
645 if( mxTextStyles.is() )
646 xStyles = mxTextStyles;
647 else
648 sName = "CharacterStyles";
649 break;
650 default: break;
651 }
652 if( !xStyles.is() && !sName.isEmpty() )
653 {
654 Reference< XStyleFamiliesSupplier > xFamiliesSupp(
655 GetImport().GetModel(), UNO_QUERY );
656 if ( xFamiliesSupp.is() )
657 {
658 Reference< XNameAccess > xFamilies = xFamiliesSupp->getStyleFamilies();
659 if (xFamilies->hasByName(sName))
660 {
661 xStyles.set(xFamilies->getByName( sName ),uno::UNO_QUERY);
662
663 switch( nFamily )
664 {
666 const_cast<SvXMLStylesContext *>(this)->mxParaStyles = xStyles;
667 break;
668
670 const_cast<SvXMLStylesContext *>(this)->mxTextStyles = xStyles;
671 break;
672 default: break;
673 }
674 }
675 }
676 }
677
678 return xStyles;
679}
680
682{
683 OUString sServiceName;
684 switch( nFamily )
685 {
688 break;
691 break;
692 default: break;
693 }
694
695 return sServiceName;
696}
697
699 SvXMLImportContext( rImport ),
700 mpImpl( new SvXMLStylesContext_Impl( bAuto ) )
701{
702}
703
705{
706}
707
708css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLStylesContext::createFastChildContext(
709 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
710{
711 SvXMLStyleContext *pStyle =
712 CreateStyleChildContext( nElement, xAttrList );
713 if( pStyle )
714 {
715 if( !pStyle->IsTransient() )
716 mpImpl->AddStyle( pStyle );
717 return pStyle;
718 }
719
720 return nullptr;
721}
722
724{
725 mpImpl->AddStyle( &rNew );
726}
727
729{
730 mpImpl->dispose();
731}
732
734{
735 sal_uInt32 nCount = GetStyleCount();
736 sal_uInt32 i;
737 for( i = 0; i < nCount; i++ )
738 {
739 SvXMLStyleContext *pStyle = GetStyle( i );
740 if( !pStyle || ( pStyle->GetFamily() != XmlStyleFamily::TEXT_TEXT &&
743 continue;
744 pStyle->CreateAndInsert( false );
745 }
746}
747
749 bool bFinish )
750{
751 // pass 1: create text, paragraph and frame styles
752 sal_uInt32 nCount = GetStyleCount();
753 sal_uInt32 i;
754
755 for( i = 0; i < nCount; i++ )
756 {
757 SvXMLStyleContext *pStyle = GetStyle( i );
758 if( !pStyle )
759 continue;
760
761 if (pStyle->IsDefaultStyle())
762 {
763 if (bOverwrite) pStyle->SetDefaults();
764 }
765 else if( InsertStyleFamily( pStyle->GetFamily() ) )
766 pStyle->CreateAndInsert( bOverwrite );
767 }
768
769 // pass 2: create list styles (they require char styles)
770 for( i=0; i<nCount; i++ )
771 {
772 SvXMLStyleContext *pStyle = GetStyle( i );
773 if( !pStyle || pStyle->IsDefaultStyle())
774 continue;
775
776 if( InsertStyleFamily( pStyle->GetFamily() ) )
777 pStyle->CreateAndInsertLate( bOverwrite );
778 }
779
780 // pass3: finish creation of styles
781 if( bFinish )
782 FinishStyles( bOverwrite );
783}
784
785void SvXMLStylesContext::FinishStyles( bool bOverwrite )
786{
787 sal_uInt32 nCount = GetStyleCount();
788 for( sal_uInt32 i=0; i<nCount; i++ )
789 {
790 SvXMLStyleContext *pStyle = GetStyle( i );
791 if( !pStyle || !pStyle->IsValid() || pStyle->IsDefaultStyle() )
792 continue;
793
794 if( InsertStyleFamily( pStyle->GetFamily() ) )
795 pStyle->Finish( bOverwrite );
796 }
797}
798
800 XmlStyleFamily nFamily,
801 const OUString& rName,
802 bool bCreateIndex ) const
803{
804 return mpImpl->FindStyleChildContext( nFamily, rName, bCreateIndex );
805}
806
807/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * pS
constexpr OUStringLiteral sServiceName
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
SvXMLNumFmtHelper * GetDataStylesImport()
Definition: xmlimp.hxx:654
static OUString getPrefixAndNameFromToken(sal_Int32 nToken)
Definition: xmlimp.cxx:1957
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:602
SvXMLStyleContext * CreateChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, SvXMLStylesContext &rStyles)
Definition: xmlnumfi.cxx:2183
OUString maParentName
Definition: xmlstyle.hxx:45
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue)
Definition: xmlstyle.cxx:69
OUString maName
Definition: xmlstyle.hxx:42
OUString maFollow
Definition: xmlstyle.hxx:46
virtual void Finish(bool bOverwrite)
Definition: xmlstyle.cxx:143
virtual void CreateAndInsert(bool bOverwrite)
Definition: xmlstyle.cxx:135
virtual void CreateAndInsertLate(bool bOverwrite)
Definition: xmlstyle.cxx:139
XmlStyleFamily mnFamily
Definition: xmlstyle.hxx:50
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:85
virtual bool IsTransient() const
if this method returns true, its parent styles context should not add it to its container.
Definition: xmlstyle.cxx:147
OUString maLinked
Definition: xmlstyle.hxx:47
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
Definition: xmlstyle.cxx:123
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:110
virtual void SetDefaults()
Definition: xmlstyle.cxx:131
SvXMLStyleContext(SvXMLImport &rImport, XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, bool bDefaultStyle=false)
Definition: xmlstyle.cxx:107
bool IsValid() const
Definition: xmlstyle.hxx:87
OUString maDisplayName
Definition: xmlstyle.hxx:43
virtual ~SvXMLStyleContext() override
Definition: xmlstyle.cxx:119
std::vector< rtl::Reference< SvXMLStyleContext > > aStyles
Definition: xmlstyle.cxx:205
SvXMLStylesContext_Impl(bool bAuto)
Definition: xmlstyle.cxx:234
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:231
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex) const
Definition: xmlstyle.cxx:259
SvXMLStyleContext * GetStyle(size_t i)
Definition: xmlstyle.cxx:220
sal_uInt32 m_nIndexCreated
Definition: xmlstyle.cxx:210
std::set< SvXMLStyleIndex_Impl, SvXMLStyleIndexCmp_Impl > IndicesType
Definition: xmlstyle.cxx:203
void AddStyle(SvXMLStyleContext *pStyle)
Definition: xmlstyle.cxx:241
std::unique_ptr< IndicesType > pIndices
Definition: xmlstyle.cxx:206
size_t GetStyleCount() const
Definition: xmlstyle.cxx:218
static XmlStyleFamily GetFamily(std::u16string_view rFamily)
Definition: xmlstyle.cxx:461
sal_uInt32 GetStyleCount() const
Definition: xmlstyle.cxx:297
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
Definition: xmlstyle.cxx:799
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:630
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:449
std::unique_ptr< SvXMLStylesContext_Impl > mpImpl
Definition: xmlstyle.hxx:125
virtual ~SvXMLStylesContext() override
Definition: xmlstyle.cxx:704
virtual bool InsertStyleFamily(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:456
SvXMLStyleContext * GetStyle(sal_uInt32 i)
Definition: xmlstyle.cxx:302
void CopyStylesToDoc(bool bOverwrite, bool bFinish=true)
Definition: xmlstyle.cxx:748
css::uno::Reference< css::container::XNameContainer > mxTextStyles
Definition: xmlstyle.hxx:130
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:518
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:317
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:415
rtl::Reference< SvXMLImportPropertyMapper > mxPageImpPropMapper
Definition: xmlstyle.hxx:140
rtl::Reference< SvXMLImportPropertyMapper > mxParaImpPropMapper
Definition: xmlstyle.hxx:136
rtl::Reference< SvXMLImportPropertyMapper > mxChartImpPropMapper
Definition: xmlstyle.hxx:139
void FinishStyles(bool bOverwrite)
Definition: xmlstyle.cxx:785
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:312
css::uno::Reference< css::style::XAutoStyleFamily > mxParaAutoStyles
Definition: xmlstyle.hxx:132
virtual OUString GetServiceName(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:681
rtl::Reference< SvXMLImportPropertyMapper > mxShapeImpPropMapper
Definition: xmlstyle.hxx:138
SvXMLStylesContext(SvXMLStylesContext const &)=delete
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: xmlstyle.cxx:708
void CopyAutoStylesToDoc()
Definition: xmlstyle.cxx:733
css::uno::Reference< css::container::XNameContainer > mxParaStyles
Definition: xmlstyle.hxx:128
css::uno::Reference< css::style::XAutoStyleFamily > GetAutoStyles(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:601
void AddStyle(SvXMLStyleContext &rNew)
Definition: xmlstyle.cxx:723
css::uno::Reference< css::style::XAutoStyleFamily > mxTextAutoStyles
Definition: xmlstyle.hxx:134
rtl::Reference< SvXMLImportPropertyMapper > mxTextImpPropMapper
Definition: xmlstyle.hxx:137
import footnote and endnote configuration elements
import <text:linenumbering-configuration> elements
int nCount
virtual OUString GetName() const override
float u
std::deque< AttacherIndex_Impl > aIndex
XmlStyleFamily
Definition: families.hxx:50
#define XML_STYLE_FAMILY_SD_POOL_NAME
Definition: families.hxx:42
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_GRAPHICS_NAME
Definition: families.hxx:38
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME
Definition: families.hxx:43
constexpr OUStringLiteral XML_STYLE_FAMILY_SCH_CHART_NAME
Definition: families.hxx:45
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_PRESENTATION_NAME
Definition: families.hxx:40
DRAW
OUString aName
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
const char * sName
int i
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Handling of tokens in XML:
@ XML_BIBLIOGRAPHY_CONFIGURATION
Definition: xmltoken.hxx:326
@ XML_DEFAULT_PAGE_LAYOUT
Definition: xmltoken.hxx:2299
@ XML_LINENUMBERING_CONFIGURATION
Definition: xmltoken.hxx:1204
@ XML_NOTES_CONFIGURATION
Definition: xmltoken.hxx:2617
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3581
bool mbValid
TEXT
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:98
constexpr OUStringLiteral gsParaStyleServiceName(u"com.sun.star.style.ParagraphStyle")
constexpr OUStringLiteral gsTextStyleServiceName(u"com.sun.star.style.CharacterStyle")