LibreOffice Module xmloff (master) 1
StyleOOoTContext.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 <com/sun/star/xml/sax/SAXException.hpp>
21#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
22#include <com/sun/star/xml/sax/XAttributeList.hpp>
23
25
27#include <xmloff/xmltoken.hxx>
29#include "PropType.hxx"
30#include "DeepTContext.hxx"
32#include "ActionMapTypesOOo.hxx"
33#include "MutableAttrList.hxx"
36#include "TransformerBase.hxx"
37
38#include "StyleOOoTContext.hxx"
39#include <xmloff/xmluconv.hxx>
40#include <rtl/math.hxx>
41#include <rtl/ustrbuf.hxx>
42#include <osl/diagnose.h>
43#include <sal/log.hxx>
44#include <array>
45
46using namespace ::xmloff::token;
47using namespace ::com::sun::star::uno;
48using namespace ::com::sun::star::xml::sax;
49
50const sal_uInt16 MAX_PROP_TYPES = 4;
51#define ENTRY4(a,b,c,d) \
52 { a, b, c, d }
53#define ENTRY3(a,b,c) \
54 { a, b, c, XML_PROP_TYPE_END }
55#define ENTRY2(a,b) \
56 { a, b, XML_PROP_TYPE_END, XML_PROP_TYPE_END }
57#define ENTRY1(a) \
58 { a, XML_PROP_TYPE_END, XML_PROP_TYPE_END, XML_PROP_TYPE_END }
59
60const std::array<XMLPropType,MAX_PROP_TYPES> aPropTypes[XML_FAMILY_TYPE_END] =
61{
63 ENTRY3( XML_PROP_TYPE_GRAPHIC, XML_PROP_TYPE_PARAGRAPH, XML_PROP_TYPE_TEXT ), // XML_FAMILY_TYPE_PRESENTATION,
64 ENTRY1( XML_PROP_TYPE_DRAWING_PAGE ), // XML_FAMILY_TYPE_DRAWING_PAGE,
65 ENTRY1( XML_PROP_TYPE_END ), // XML_FAMILY_TYPE_MASTER_PAGE
66 ENTRY1( XML_PROP_TYPE_PAGE_LAYOUT ), // XML_FAMILY_TYPE_PAGE_LAYOUT,
67 ENTRY1( XML_PROP_TYPE_HEADER_FOOTER ), // XML_FAMILY_TYPE_HEADER_FOOTER
68 ENTRY1( XML_PROP_TYPE_TEXT ), // XML_FAMILY_TYPE_TEXT,
69 ENTRY2( XML_PROP_TYPE_PARAGRAPH, XML_PROP_TYPE_TEXT ), // XML_FAMILY_TYPE_PARAGRAPH,
70 ENTRY1( XML_PROP_TYPE_RUBY ), // XML_FAMILY_TYPE_RUBY,
71 ENTRY1( XML_PROP_TYPE_SECTION ), // XML_FAMILY_TYPE_SECTION,
72 ENTRY1( XML_PROP_TYPE_TABLE ), // XML_FAMILY_TYPE_TABLE,
73 ENTRY1( XML_PROP_TYPE_TABLE_COLUMN ), // XML_FAMILY_TYPE_TABLE_COLUMN,
74 ENTRY1( XML_PROP_TYPE_TABLE_ROW ), // XML_FAMILY_TYPE_TABLE_ROW,
76 ENTRY1( XML_PROP_TYPE_LIST_LEVEL ), // XML_FAMILY_TYPE_LIST,
78 ENTRY1( XML_PROP_TYPE_TEXT ), // XML_FAMILY_TYPE_DATA,
79 ENTRY1( XML_PROP_TYPE_END ), // XML_FAMILY_TYPE_GRADIENT,
80 ENTRY1( XML_PROP_TYPE_END ), // XML_FAMILY_TYPE_HATCH,
81 ENTRY1( XML_PROP_TYPE_END ), // XML_FAMILY_TYPE_FILL_IMAGE,
82 ENTRY1( XML_PROP_TYPE_END ), // XML_FAMILY_TYPE_STROKE_DASH,
83 ENTRY1( XML_PROP_TYPE_END ), // XML_FAMILY_TYPE_MARKER,
84};
85
87{
102};
103
105{
112 MAX_OOO_PROP_ACTIONS, // RUBY
120};
121
123{
138};
139
140namespace {
141
142class XMLTypedPropertiesOOoTContext_Impl : public XMLPersElemContentTContext
143{
144 css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList;
145
146public:
147 XMLTypedPropertiesOOoTContext_Impl( XMLTransformerBase& rTransformer,
148 const OUString& rQName );
149
151 void AddAttribute( const OUString &sName ,
152 const OUString &sValue );
153 void AddAttribute( sal_uInt16 nPrefix, XMLTokenEnum eToken,
154 const OUString &sValue );
155
156 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& rAttrList ) override;
157
158 virtual void Export() override;
159};
160
161}
162
163XMLTypedPropertiesOOoTContext_Impl::XMLTypedPropertiesOOoTContext_Impl(
164 XMLTransformerBase& rImp,
165 const OUString& rQName ) :
166 XMLPersElemContentTContext( rImp, rQName ),
167 m_xAttrList( new XMLMutableAttributeList() )
168{
169}
170
171void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
172 const OUString &sName ,
173 const OUString &sValue )
174{
175 static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
176 ->AddAttribute( sName, sValue );
177}
178
179void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
180 sal_uInt16 nPrefix, XMLTokenEnum eToken,
181 const OUString &sValue )
182{
183 OUString sName(
184 GetTransformer().GetNamespaceMap().GetQNameByKey(
185 nPrefix, ::xmloff::token::GetXMLToken( eToken ) ) );
186 static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
187 ->AddAttribute( sName, sValue );
188}
189
190void XMLTypedPropertiesOOoTContext_Impl::StartElement(
191 const Reference< XAttributeList >& )
192{
193 // empty, ignore even the attribute list
194}
195
196void XMLTypedPropertiesOOoTContext_Impl::Export()
197{
198 if( m_xAttrList->getLength() || HasElementContent() )
199 {
200 GetTransformer().GetDocHandler()->startElement( GetQName(), m_xAttrList );
201 ExportContent();
202 GetTransformer().GetDocHandler()->endElement( GetQName() );
203 }
204}
205
206namespace {
207
208class XMLPropertiesOOoTContext_Impl : public XMLTransformerContext
209{
211 m_aPropContexts[MAX_PROP_TYPES];
212
213 using XMLPropTypes = std::array<XMLPropType, MAX_PROP_TYPES>;
214
215 XMLPropTypes const & m_rPropTypes;
216
217 bool const m_bPersistent;
218
219 XMLTypedPropertiesOOoTContext_Impl *GetPropContextAndAction(
220 TransformerAction_Impl& rAction,
221 sal_uInt16 nPrefix, const OUString& rLocalName,
222 bool bElem );
223
224 XMLTypedPropertiesOOoTContext_Impl *GetPropContext(
225 XMLPropType eType );
226
227public:
228 XMLPropertiesOOoTContext_Impl( XMLTransformerBase& rTransformer,
229 const OUString& rQName,
230 const XMLPropTypes& rTypes,
231 bool bPersistent );
232
234 sal_uInt16 nPrefix,
235 const OUString& rLocalName,
236 const OUString& rQName,
237 const Reference< XAttributeList >& rAttrList ) override;
238
239 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& rAttrList ) override;
240
241 virtual void EndElement() override;
242
243 virtual void Characters( const OUString& rChars ) override;
244
245 virtual void Export() override;
246
247 virtual bool IsPersistent() const override;
248};
249
250}
251
252XMLTypedPropertiesOOoTContext_Impl
253 *XMLPropertiesOOoTContext_Impl::GetPropContext(
254 XMLPropType eType )
255{
256 sal_uInt16 nIndex = MAX_PROP_TYPES;
257 for( sal_uInt16 i=0; i< MAX_PROP_TYPES; i++ )
258 {
259 if( m_rPropTypes[i] == eType )
260 {
261 nIndex = i;
262 break;
263 }
264 }
265 if( MAX_PROP_TYPES == nIndex )
266 return nullptr;
267
268 if( !m_aPropContexts[nIndex].is() )
269 {
270 m_aPropContexts[nIndex] =
271 new XMLTypedPropertiesOOoTContext_Impl(
272 GetTransformer(),
273 GetTransformer().GetNamespaceMap().GetQNameByKey(
276 aPropTokens[m_rPropTypes[nIndex]] ) ));
277 }
278
279 return m_aPropContexts[nIndex].get();
280}
281
282XMLTypedPropertiesOOoTContext_Impl
283 *XMLPropertiesOOoTContext_Impl::GetPropContextAndAction(
284 TransformerAction_Impl& rAction,
285 sal_uInt16 nPrefix, const OUString& rLocalName,
286 bool bElem )
287{
289 sal_uInt16 nIndex = 0;
290
291 XMLTransformerActions::key_type aKey( nPrefix, rLocalName );
292 sal_uInt16 i=0;
293 while( i < MAX_PROP_TYPES && XML_PROP_TYPE_END!=m_rPropTypes[i])
294 {
295 sal_uInt16 nActionMap =
296 (bElem ? aElemActionMaps : aAttrActionMaps)[m_rPropTypes[i]];
297 if( nActionMap < MAX_OOO_PROP_ACTIONS )
298 {
299 XMLTransformerActions *pActions =
300 GetTransformer().GetUserDefinedActions( nActionMap );
301 OSL_ENSURE( pActions, "go no actions" );
302 if( pActions )
303 {
304 XMLTransformerActions::const_iterator aIter =
305 pActions->find( aKey );
306
307 if( aIter != pActions->end() )
308 {
309 rAction = (*aIter).second;
310 nIndex = i;
311 break;
312 }
313 }
314 }
315 ++i;
316 }
317
318#ifdef DBG_UTIL
319 if( !( XML_NAMESPACE_NONE == nPrefix ||
320 (XML_NAMESPACE_UNKNOWN_FLAG & nPrefix) ||
321 XML_PROP_TYPE_END==m_rPropTypes[1] ||
322 (i<MAX_PROP_TYPES && XML_PROP_TYPE_END!=m_rPropTypes[i]) ) )
323 {
324 SAL_WARN("xmloff", "Didn't find property: "
325 << GetTransformer().GetNamespaceMap().GetPrefixByKey( nPrefix )
326 << ":"
327 << rLocalName
328 << ", assuming <style:"
329 << ::xmloff::token::GetXMLToken( aPropTokens[m_rPropTypes[0]] )
330 << ">" );
331 }
332#endif
333
334 if( !m_aPropContexts[nIndex].is() )
335 {
336 m_aPropContexts[nIndex] =
337 new XMLTypedPropertiesOOoTContext_Impl(
338 GetTransformer(),
339 GetTransformer().GetNamespaceMap().GetQNameByKey(
342 aPropTokens[m_rPropTypes[nIndex]] ) ));
343 }
344
345 return m_aPropContexts[nIndex].get();
346}
347
348XMLPropertiesOOoTContext_Impl::XMLPropertiesOOoTContext_Impl(
349 XMLTransformerBase& rImp,
350 const OUString& rQName,
351 const XMLPropTypes& rTypes,
352 bool bPersistent ) :
353 XMLTransformerContext( rImp, rQName ),
354 // remember the types that belong to the attribute and element lists
355 m_rPropTypes(rTypes),
356 m_bPersistent( bPersistent )
357{
358}
359
360rtl::Reference<XMLTransformerContext> XMLPropertiesOOoTContext_Impl::CreateChildContext(
361 sal_uInt16 nPrefix,
362 const OUString& rLocalName,
363 const OUString& rQName,
364 const Reference< XAttributeList >& rAttrList )
365{
367 return GetPropContextAndAction( aAction, nPrefix, rLocalName, true )
368 ->CreateChildContext( nPrefix, rLocalName, rQName, rAttrList );
369}
370
371void XMLPropertiesOOoTContext_Impl::StartElement(
372 const Reference< XAttributeList >& rAttrList )
373{
374 XMLTypedPropertiesOOoTContext_Impl * pIntervalMinorDivisorContext = nullptr;
375 double fIntervalMajor = 0.0;
376 double fIntervalMinor = 0.0;
377 bool bMoveProtect = false;
378 bool bSizeProtect = false;
379 OUString aProtectAttrValue;
380 XMLTypedPropertiesOOoTContext_Impl * pProtectContext = nullptr;
381
382 /* Attribute <style:mirror> has to be priority over attribute <style:draw>.
383 The filter from OpenDocument file format to OpenOffice.org file format
384 produces styles with both attributes. (#i49139#)
385 */
386 bool bExistStyleMirror( false );
387 OUStringBuffer aStyleMirrorAttrValue;
388 bool bExistDrawMirror( false );
389 OUString aDrawMirrorAttrValue;
390 XMLTypedPropertiesOOoTContext_Impl* pMirrorContext( nullptr );
391
392 sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
393 for( sal_Int16 i=0; i < nAttrCount; i++ )
394 {
395 const OUString sAttrName = rAttrList->getNameByIndex( i );
396 const OUString sAttrValue = rAttrList->getValueByIndex( i );
397 OUString aLocalName;
398 sal_uInt16 nPrefix =
399 GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName,
400 &aLocalName );
402 XMLTypedPropertiesOOoTContext_Impl *pContext =
403 GetPropContextAndAction( aAction, nPrefix, aLocalName, false );
404 switch( aAction.m_nActionType )
405 {
407 break;
409 pContext->AddAttribute( sAttrName, sAttrValue );
410 break;
412 {
413 pContext->AddAttribute( sAttrName, sAttrValue );
414 XMLTypedPropertiesOOoTContext_Impl *pContext2 =
415 GetPropContext( static_cast<XMLPropType>(aAction.m_nParam1) );
416 if( pContext2 )
417 pContext2->AddAttribute( sAttrName, sAttrValue );
418 }
419 break;
421 {
422 pContext->AddAttribute( aAction.GetQNamePrefixFromParam1(),
423 aAction.GetQNameTokenFromParam1(),
424 sAttrValue );
425 }
426 break;
428 {
429 OUString aAttrValue( sAttrValue );
430 GetTransformer().EncodeStyleName(aAttrValue);
431 pContext->AddAttribute( sAttrName, aAttrValue );
432 }
433 break;
435 {
436 OUString aAttrValue( sAttrValue );
437 GetTransformer().EncodeStyleName(aAttrValue);
438 pContext->AddAttribute( aAction.GetQNamePrefixFromParam1(),
439 aAction.GetQNameTokenFromParam1(),
440 aAttrValue );
441 }
442 break;
444 {
445 OUString aAttrValue( sAttrValue );
447 pContext->AddAttribute( sAttrName, aAttrValue );
448 }
449 break;
451 {
452 OUString aAttrValue( sAttrValue );
454 pContext->AddAttribute( aAction.GetQNamePrefixFromParam1(),
455 aAction.GetQNameTokenFromParam1(),
456 aAttrValue );
457 }
458 break;
460 {
461 OUString aAttrValue( sAttrValue );
463 pContext->AddAttribute( sAttrName, aAttrValue );
464 }
465 break;
467 {
468 OUString aAttrValue( sAttrValue );
470 pContext->AddAttribute( sAttrName, aAttrValue );
471 XMLTypedPropertiesOOoTContext_Impl *pContext2 =
472 GetPropContext( static_cast<XMLPropType>(aAction.m_nParam1) );
473 if( pContext2 )
474 pContext2->AddAttribute( sAttrName, aAttrValue );
475 }
476 break;
478 {
479 OUString aAttrValue( sAttrValue );
481 pContext->AddAttribute( sAttrName, aAttrValue );
482 }
483 break;
485 {
486 const OUString& aAttrValue( GetXMLToken(
487 IsXMLToken( sAttrValue, XML_TRUE )
490 OUString aAttrQName(
491 GetTransformer().GetNamespaceMap().GetQNameByKey(
494 pContext->AddAttribute( aAttrQName, aAttrValue );
495
496 aAttrQName =
497 GetTransformer().GetNamespaceMap().GetQNameByKey(
500 pContext->AddAttribute( aAttrQName, aAttrValue );
501 }
502 break;
504 {
505 const OUString& aAttrValue( GetXMLToken(
506 IsXMLToken( sAttrValue, XML_TRUE )
507 ? XML_ALWAYS
508 : XML_AUTO) );
509 pContext->AddAttribute( sAttrName, aAttrValue );
510 }
511 break;
513 {
514 XMLTokenEnum eToken = GetTransformer().GetToken( sAttrValue );
515 bool bBold = false, bDouble = false;
516 switch( eToken )
517 {
518 case XML_SINGLE:
520 break;
521 case XML_DOUBLE:
523 bDouble = true;
524 break;
525 case XML_BOLD:
527 bBold = true;
528 break;
529 case XML_BOLD_DOTTED:
531 bBold = true;
532 break;
533 case XML_BOLD_DASH:
535 bBold = true;
536 break;
539 bBold = true;
540 break;
543 bBold = true;
544 break;
547 bBold = true;
548 break;
549 case XML_BOLD_WAVE:
551 bBold = true;
552 break;
553 case XML_DOUBLE_WAVE:
555 bDouble = true;
556 break;
557 case XML_NONE:
559 bDouble = false;
560 break;
561 default:
562 OSL_FAIL( "xmloff::XMLPropertiesOOoTContext_Impl::StartElement(), unknown underline token!" );
563 break;
564 }
565 pContext->AddAttribute(
566 GetTransformer().GetNamespaceMap().GetQNameByKey(
570 : sAttrValue );
571 if( bDouble )
572 pContext->AddAttribute(
573 GetTransformer().GetNamespaceMap().GetQNameByKey(
577 if( bBold )
578 pContext->AddAttribute(
579 GetTransformer().GetNamespaceMap().GetQNameByKey(
583 }
584 break;
586 {
587 XMLTokenEnum eToken = GetTransformer().GetToken( sAttrValue );
588 bool bBold = false, bDouble = false;
589 sal_Unicode c = 0;
590 switch( eToken )
591 {
592 case XML_SINGLE_LINE:
594 break;
595 case XML_DOUBLE_LINE:
597 bDouble = true;
598 break;
599 case XML_THICK_LINE:
601 bBold = true;
602 break;
603 case XML_SLASH:
605 c = '/';
606 break;
607 case XML_uX:
609 c = 'X';
610 break;
611 default:
612 break;
613 }
614 pContext->AddAttribute(
615 GetTransformer().GetNamespaceMap().GetQNameByKey(
619 : sAttrValue );
620 if( bDouble )
621 pContext->AddAttribute(
622 GetTransformer().GetNamespaceMap().GetQNameByKey(
626 if( bBold )
627 pContext->AddAttribute(
628 GetTransformer().GetNamespaceMap().GetQNameByKey(
632 if( c )
633 pContext->AddAttribute(
634 GetTransformer().GetNamespaceMap().GetQNameByKey(
637 OUString( c ) );
638 }
639 break;
641 {
642 sal_Int32 nSplineType = sAttrValue.toInt32();
643 OUString aNewAttrName = GetTransformer().GetNamespaceMap().GetQNameByKey(
645
646 switch( nSplineType )
647 {
648 // straight lines
649 case 0:
650 pContext->AddAttribute(
651 aNewAttrName, GetXMLToken( XML_NONE ));
652 break;
653 // cubic spline
654 case 1:
655 pContext->AddAttribute(
656 aNewAttrName, GetXMLToken( XML_CUBIC_SPLINE ));
657 break;
658 // B-spline
659 case 2:
660 pContext->AddAttribute(
661 aNewAttrName, GetXMLToken( XML_B_SPLINE ));
662 break;
663
664 default:
665 OSL_FAIL( "invalid spline type" );
666 pContext->AddAttribute(
667 aNewAttrName, GetXMLToken( XML_NONE ));
668 break;
669 }
670 }
671 break;
673 pContext->AddAttribute( sAttrName, sAttrValue );
674 ::sax::Converter::convertDouble( fIntervalMajor, sAttrValue );
675 break;
677 ::sax::Converter::convertDouble( fIntervalMinor, sAttrValue );
678 pIntervalMinorDivisorContext = pContext;
679 break;
681 {
682 sal_Int32 nSymbolType = sAttrValue.toInt32();
683 OUString aNewAttrName = GetTransformer().GetNamespaceMap().GetQNameByKey(
685
686 if( nSymbolType >= 0 )
687 {
688 pContext->AddAttribute( aNewAttrName, GetXMLToken( XML_NAMED_SYMBOL ));
690 switch( nSymbolType )
691 {
692 // SYMBOL0
693 case 0:
694 // "square" has an awkward token name
696 break;
697 // SYMBOL1
698 case 1:
700 break;
701 // SYMBOL2
702 case 2:
704 break;
705 // SYMBOL3
706 case 3:
708 break;
709 // SYMBOL4
710 case 4:
712 break;
713 // SYMBOL5
714 case 5:
716 break;
717 // SYMBOL6
718 case 6:
720 break;
721 // SYMBOL7
722 case 7:
724 break;
725 case 8:
727 break;
728 case 9:
730 break;
731 case 10:
732 eToken = XML_X;
733 break;
734 case 11:
736 break;
737 case 12:
739 break;
740 case 13:
742 break;
743 case 14:
745 break;
746 default:
747 OSL_FAIL( "invalid named symbol" );
748 break;
749 }
750
752 {
753 pContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey(
756 }
757 }
758 else
759 {
760 switch( nSymbolType )
761 {
762 // NONE
763 case -3:
764 pContext->AddAttribute(
765 aNewAttrName, GetXMLToken( XML_NONE ));
766 break;
767 // AUTO
768 case -2:
769 pContext->AddAttribute(
770 aNewAttrName, GetXMLToken( XML_AUTOMATIC ));
771 break;
772 // BITMAPURL
773 case -1:
774 pContext->AddAttribute(
775 aNewAttrName, GetXMLToken( XML_IMAGE ));
776 break;
777 default:
778 OSL_FAIL( "invalid symbol type" );
779 pContext->AddAttribute(
780 aNewAttrName, GetXMLToken( XML_NONE ));
781 break;
782 }
783 }
784 }
785 break;
787 {
788 // create an xlink:href element for URI attribute
789 XMLPersAttrListTContext *pSymbolImageContext = new XMLPersAttrListTContext(
790 GetTransformer(), GetTransformer().GetNamespaceMap().GetQNameByKey(
792 rtl::Reference<XMLTransformerContext> xSymbolImageContext(pSymbolImageContext);
793
794 OUString aAttrValue( sAttrValue );
795 if( GetTransformer().ConvertURIToOASIS( aAttrValue, true ))
796 {
797 pSymbolImageContext->AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aAttrValue );
798 pContext->AddContent(xSymbolImageContext);
799 }
800 }
801 break;
802
803 // #i25616#
805 {
806 OUString aAttrValue( sAttrValue );
808 pContext->AddAttribute( XML_NAMESPACE_DRAW,
810 aAttrValue );
811 pContext->AddAttribute( XML_NAMESPACE_DRAW,
813 aAttrValue );
814 }
815 break;
816
818 {
819 pContext->AddAttribute(
822 IsXMLToken( sAttrValue, XML_COLUMNSPLIT_AVOID )
823 ? XML_ALWAYS
824 : XML_AUTO ) );
825 }
826 break;
828 {
829 OUString aAttrValue( sAttrValue );
830 if( aAttrValue.indexOf( '%' ) != -1 )
831 {
832 sal_Int32 nValue = 0;
833 ::sax::Converter::convertPercent( nValue, sAttrValue );
834 if( nValue )
835 {
836 nValue /= 100;
837 OUStringBuffer aOut;
838 ::sax::Converter::convertPercent( aOut, nValue );
839 aAttrValue = aOut.makeStringAndClear();
840 }
841 }
842 else
843 {
845 }
846
847 pContext->AddAttribute( sAttrName, aAttrValue );
848 }
849 break;
851 bMoveProtect = IsXMLToken( sAttrValue, XML_TRUE );
852 pProtectContext = pContext;
853 break;
855 bSizeProtect = IsXMLToken( sAttrValue, XML_TRUE );
856 pProtectContext = pContext;
857 break;
859 aProtectAttrValue = sAttrValue;
860 pProtectContext = pContext;
861 break;
862 case XML_ATACTION_DRAW_MIRROR_OOO: // renames draw:mirror to style:mirror and adapts values
863 {
864 // OpenDocument file format: attribute value of <style:mirror> wrong (#i49139#)
865 aDrawMirrorAttrValue =
866 GetXMLToken( IsXMLToken( sAttrValue, XML_TRUE )
868 bExistDrawMirror = true;
869 pMirrorContext = pContext;
870 }
871 break;
872 // OpenDocument file format: attribute value of <style:mirror> wrong (#i49139#)
873 case XML_ATACTION_STYLE_MIRROR_OOO: // adapts style:mirror values
874 {
875 SvXMLTokenEnumerator aTokenEnum( sAttrValue );
876 std::u16string_view aToken;
877 while( aTokenEnum.getNextToken( aToken ) )
878 {
879 if ( !aStyleMirrorAttrValue.isEmpty() )
880 {
881 aStyleMirrorAttrValue.append(" ");
882 }
883
885 {
886 aStyleMirrorAttrValue.append(GetXMLToken( XML_HORIZONTAL_ON_EVEN ));
887 }
888 else if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_RIGHT_PAGES ) )
889 {
890 aStyleMirrorAttrValue.append(GetXMLToken( XML_HORIZONTAL_ON_ODD ));
891 }
892 else
893 {
894 aStyleMirrorAttrValue.append(aToken);
895 }
896 }
897 bExistStyleMirror = true;
898 pMirrorContext = pContext;
899 }
900 break;
901 case XML_ATACTION_GAMMA_OOO: // converts double value to percentage
902 {
903 double fValue = sAttrValue.toDouble();
904 sal_Int32 nValue = static_cast<sal_Int32>((fValue * 100.0) + ( fValue > 0 ? 0.5 : - 0.5 ) );
905
906 OUStringBuffer aOut;
907 ::sax::Converter::convertPercent( aOut, nValue );
908 OUString aAttrValue( aOut.makeStringAndClear() );
909 pContext->AddAttribute( sAttrName, aAttrValue );
910 }
911 break;
913 {
914 sal_Int32 nValue;
915 if( sAttrValue.indexOf( '%' ) != -1 )
916 {
917 ::sax::Converter::convertPercent( nValue, sAttrValue );
918 }
919 else
920 {
921 nValue = sal_Int32( sAttrValue.toDouble() * 100.0 );
922 }
923 nValue = 100 - nValue;
924
925 OUStringBuffer aOut;
926 ::sax::Converter::convertPercent( aOut, nValue );
927 pContext->AddAttribute( sAttrName, aOut.makeStringAndClear() );
928 }
929 break;
930 default:
931 OSL_ENSURE( false, "unknown action" );
932 break;
933 }
934 }
935
936 // OpenDocument file format: attribute value of <style:mirror> wrong (#i49139#)
937 if ( bExistStyleMirror )
938 {
939 pMirrorContext->AddAttribute(
940 GetTransformer().GetNamespaceMap().GetQNameByKey(
942 aStyleMirrorAttrValue.makeStringAndClear());
943 }
944 else if ( bExistDrawMirror )
945 {
946 pMirrorContext->AddAttribute(
947 GetTransformer().GetNamespaceMap().GetQNameByKey(
949 aDrawMirrorAttrValue);
950 }
951
952 if (bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty())
953 {
954 if( (bMoveProtect ||bSizeProtect) && IsXMLToken( aProtectAttrValue, XML_NONE ) )
955 aProtectAttrValue.clear();
956
957 const OUString& rPosition = GetXMLToken( XML_POSITION );
958 if( bMoveProtect && -1 == aProtectAttrValue.indexOf( rPosition ) )
959 {
960 if( !aProtectAttrValue.isEmpty() )
961 aProtectAttrValue += " ";
962 aProtectAttrValue += rPosition;
963 }
964
965 const OUString& rSize = GetXMLToken( XML_SIZE );
966 if( bSizeProtect && -1 == aProtectAttrValue.indexOf( rSize ) )
967 {
968 if( !aProtectAttrValue.isEmpty() )
969 aProtectAttrValue += " ";
970 aProtectAttrValue += rSize;
971 }
972
973 assert(pProtectContext && "coverity[var_deref_model] - pProtectContext should be assigned in a superset of the enclosing if condition entry logic");
974 pProtectContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE, GetXMLToken( XML_PROTECT ) ), aProtectAttrValue );
975 }
976
977 if( !pIntervalMinorDivisorContext )
978 return;
979
980 if( fIntervalMinor != 0.0 )
981 {
982 sal_Int32 nIntervalMinorDivisor = static_cast< sal_Int32 >(
983 ::rtl::math::round( fIntervalMajor / fIntervalMinor ));
984
985 pIntervalMinorDivisorContext->AddAttribute(
986 GetTransformer().GetNamespaceMap().GetQNameByKey(
989 OUString::number( nIntervalMinorDivisor ));
990 }
991}
992
993void XMLPropertiesOOoTContext_Impl::EndElement()
994{
995 if( !m_bPersistent )
996 Export();
997}
998
999void XMLPropertiesOOoTContext_Impl::Characters( const OUString& )
1000{
1001 // ignore them
1002}
1003
1004void XMLPropertiesOOoTContext_Impl::Export()
1005{
1006
1007 for(rtl::Reference<XMLTypedPropertiesOOoTContext_Impl> & rPropContext : m_aPropContexts)
1008 {
1009 if( rPropContext.is() )
1010 rPropContext->Export();
1011 }
1012}
1013
1014bool XMLPropertiesOOoTContext_Impl::IsPersistent() const
1015{
1016 return m_bPersistent;
1017}
1018
1020 const OUString& rQName,
1021 XMLFamilyType eT,
1022 bool bPersistent ) :
1023 XMLPersElemContentTContext( rImp, rQName ),
1024 m_eFamily( eT ),
1025 m_bPersistent( bPersistent )
1026{
1027}
1028
1030 XMLTransformerBase& rImp,
1031 const OUString& rQName,
1032 XMLFamilyType eT,
1033 sal_uInt16 nPrefix,
1035 bool bPersistent ) :
1036 XMLPersElemContentTContext( rImp, rQName, nPrefix, eToken ),
1037 m_eFamily( eT ),
1038 m_bPersistent( bPersistent )
1039{
1040}
1041
1043{
1044}
1045
1047 sal_uInt16 nPrefix,
1048 const OUString& rLocalName,
1049 const OUString& rQName,
1050 const Reference< XAttributeList >& rAttrList )
1051{
1053
1054 if( XML_NAMESPACE_STYLE == nPrefix &&
1055 IsXMLToken( rLocalName, XML_PROPERTIES ) )
1056 {
1058 {
1059 OSL_ENSURE( false, "unexpected properties element" );
1060 pContext = m_bPersistent
1062 nPrefix, rLocalName, rQName, rAttrList )
1064 nPrefix, rLocalName, rQName, rAttrList );
1065 }
1066 else if( aPropTypes[m_eFamily][1] == XML_PROP_TYPE_END )
1067 {
1068 sal_uInt16 nActionMap =
1070 if( nActionMap < MAX_OOO_PROP_ACTIONS )
1071 {
1072 pContext.set(new XMLPropertiesOOoTContext_Impl(
1073 GetTransformer(), rQName,
1075 }
1076 else
1077 {
1078 if( m_bPersistent )
1079 pContext.set(new XMLPersElemContentTContext(
1080 GetTransformer(), rQName,
1083 else
1084 pContext.set(new XMLRenameElemTransformerContext(
1085 GetTransformer(), rQName,
1088 }
1089 }
1090 else
1091 {
1092 pContext.set(new XMLPropertiesOOoTContext_Impl(
1093 GetTransformer(), rQName,
1095 }
1096
1097 if( m_bPersistent )
1098 AddContent( pContext );
1099 }
1100 else
1101 {
1102 pContext = m_bPersistent
1104 nPrefix, rLocalName, rQName, rAttrList )
1106 nPrefix, rLocalName, rQName, rAttrList );
1107 }
1108
1109 return pContext;
1110}
1111
1113 const Reference< XAttributeList >& rAttrList )
1114{
1115 XMLTransformerActions *pActions =
1117 OSL_ENSURE( pActions, "go no actions" );
1118
1119 Reference< XAttributeList > xAttrList( rAttrList );
1121 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1122 for( sal_Int16 i=0; i < nAttrCount; i++ )
1123 {
1124 const OUString sAttrName = xAttrList->getNameByIndex( i );
1125 OUString aLocalName;
1126 sal_uInt16 nPrefix =
1128 &aLocalName );
1129 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1130 XMLTransformerActions::const_iterator aIter =
1131 pActions->find( aKey );
1132 if( aIter != pActions->end() )
1133 {
1134 if( !pMutableAttrList )
1135 {
1136 pMutableAttrList =
1137 new XMLMutableAttributeList( xAttrList );
1138 xAttrList = pMutableAttrList;
1139 }
1140 const OUString sAttrValue = xAttrList->getValueByIndex( i );
1141 switch( (*aIter).second.m_nActionType )
1142 {
1144 {
1145 bool bControl = false;
1147 {
1148 if( IsXMLToken( sAttrValue, XML_GRAPHICS ) )
1150 else if( IsXMLToken( sAttrValue, XML_PRESENTATION ) )
1152 else if( IsXMLToken( sAttrValue, XML_DRAWING_PAGE ) )
1154 else if( IsXMLToken( sAttrValue, XML_TEXT) )
1156 else if( IsXMLToken( sAttrValue, XML_PARAGRAPH) )
1158 else if( IsXMLToken( sAttrValue, XML_RUBY) )
1160 else if( IsXMLToken( sAttrValue, XML_SECTION) )
1162 else if( IsXMLToken( sAttrValue, XML_TABLE) )
1164 else if( IsXMLToken( sAttrValue, XML_TABLE_COLUMN) )
1166 else if( IsXMLToken( sAttrValue, XML_TABLE_ROW) )
1168 else if( IsXMLToken( sAttrValue, XML_TABLE_CELL) )
1170 else if( IsXMLToken( sAttrValue, XML_CHART) )
1172 else if( IsXMLToken( sAttrValue, XML_CONTROL) )
1173 {
1175 bControl = true;
1176 }
1177 }
1179 {
1180 pMutableAttrList->SetValueByIndex( i,
1182 }
1183 else if( bControl )
1184 {
1185 pMutableAttrList->SetValueByIndex( i,
1187 }
1188 }
1189 break;
1191 {
1192 OUString aAttrValue( sAttrValue );
1194 aAttrValue ) )
1195 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1196 }
1197 break;
1199 {
1200 OUString aAttrValue( sAttrValue );
1201 if( GetTransformer().EncodeStyleName(aAttrValue) )
1202 {
1203 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1204 OUString aNewAttrQName(
1205 GetTransformer().GetNamespaceMap().
1206 GetQNameByKey(
1208 XML_DISPLAY_NAME ) ) );
1209 pMutableAttrList->AddAttribute( aNewAttrQName,
1210 sAttrValue );
1211 }
1212 }
1213 break;
1215 {
1216 OUString aAttrValue( sAttrValue );
1217 if( GetTransformer().EncodeStyleName(aAttrValue) )
1218 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1219 }
1220 break;
1222 {
1223 OUString aAttrValue( sAttrValue );
1224 if( XMLTransformerBase::NegPercent(aAttrValue) )
1225 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1226 }
1227 break;
1229 {
1230 OUString aAttrValue( sAttrValue );
1231 if( GetTransformer().ConvertURIToOASIS( aAttrValue,
1232 static_cast< bool >((*aIter).second.m_nParam1)))
1233 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1234 }
1235 break;
1236 default:
1237 OSL_ENSURE( false, "unknown action" );
1238 break;
1239 }
1240 }
1241 }
1244 if( m_bPersistent )
1246 else
1247 GetTransformer().GetDocHandler()->startElement( GetExportQName(), xAttrList );
1248}
1249
1251{
1252 if( m_bPersistent )
1254 else
1255 GetTransformer().GetDocHandler()->endElement( GetExportQName() );
1256}
1257
1258void XMLStyleOOoTContext::Characters( const OUString& )
1259{
1260 // element content only:
1261}
1262
1264{
1265 return m_bPersistent;
1266}
1267
1269 sal_uInt16 nType )
1270{
1271 XMLTransformerActionInit const *pInit = nullptr;
1272
1273 switch( nType )
1274 {
1277 break;
1280 break;
1283 break;
1286 break;
1289 break;
1292 break;
1295 break;
1298 break;
1301 break;
1304 break;
1307 break;
1310 break;
1313 break;
1316 break;
1319 break;
1322 break;
1325 break;
1328 break;
1329 }
1330
1331 XMLTransformerActions *pActions = nullptr;
1332 if( pInit )
1333 pActions = new XMLTransformerActions( pInit );
1334
1335 return pActions;
1336}
1337
1338/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ PROP_OOO_PARAGRAPH_ELEM_ACTIONS
@ PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS
@ PROP_OOO_GRAPHIC_ATTR_ACTIONS
@ PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS
@ PROP_OOO_GRAPHIC_ELEM_ACTIONS
@ MAX_OOO_PROP_ACTIONS
@ PROP_OOO_CHART_ELEM_ACTIONS
@ PROP_OOO_SECTION_ATTR_ACTIONS
@ PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS
@ PROP_OOO_TABLE_CELL_ATTR_ACTIONS
@ PROP_OOO_TEXT_ATTR_ACTIONS
@ PROP_OOO_LIST_LEVEL_ATTR_ACTIONS
@ PROP_OOO_TABLE_CELL_ELEM_ACTIONS
@ PROP_OOO_TABLE_ROW_ATTR_ACTIONS
@ OOO_STYLE_ACTIONS
@ PROP_OOO_TEXT_ELEM_ACTIONS
@ PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS
@ PROP_OOO_CHART_ATTR_ACTIONS
@ PROP_OOO_TABLE_ATTR_ACTIONS
@ PROP_OOO_PARAGRAPH_ATTR_ACTIONS
@ XML_ATACTION_REMOVE
@ XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF
@ XML_ATACTION_URI_OOO
@ XML_ATACTION_STYLE_MIRROR_OOO
@ XML_ATACTION_GAMMA_OOO
@ XML_ATACTION_ENCODE_STYLE_NAME
@ XML_ATACTION_DRAW_MIRROR_OOO
@ XML_ATACTION_RENAME_NEG_PERCENT
@ XML_ATACTION_ENCODE_STYLE_NAME_REF
@ XML_ATACTION_INCH2IN
@ XML_ATACTION_INCHS2INS
@ XML_ATACTION_OPACITY_FIX
@ XML_ATACTION_RENAME
@ XML_ATACTION_STYLE_FAMILY
@ XML_ATACTION_COPY
@ XML_ATACTION_NEG_PERCENT
XMLFamilyType
Definition: FamilyType.hxx:23
@ XML_FAMILY_TYPE_TABLE_COLUMN
Definition: FamilyType.hxx:35
@ XML_FAMILY_TYPE_TABLE_ROW
Definition: FamilyType.hxx:36
@ XML_FAMILY_TYPE_TABLE_CELL
Definition: FamilyType.hxx:37
@ XML_FAMILY_TYPE_TEXT
Definition: FamilyType.hxx:30
@ XML_FAMILY_TYPE_END
Definition: FamilyType.hxx:46
@ XML_FAMILY_TYPE_GRAPHIC
Definition: FamilyType.hxx:24
@ XML_FAMILY_TYPE_RUBY
Definition: FamilyType.hxx:32
@ XML_FAMILY_TYPE_TABLE
Definition: FamilyType.hxx:34
@ XML_FAMILY_TYPE_PARAGRAPH
Definition: FamilyType.hxx:31
@ XML_FAMILY_TYPE_PRESENTATION
Definition: FamilyType.hxx:25
@ XML_FAMILY_TYPE_SECTION
Definition: FamilyType.hxx:33
@ XML_FAMILY_TYPE_CHART
Definition: FamilyType.hxx:39
@ XML_FAMILY_TYPE_DRAWING_PAGE
Definition: FamilyType.hxx:26
XMLPropType
Definition: PropType.hxx:23
@ XML_PROP_TYPE_TABLE_ROW
Definition: PropType.hxx:34
@ XML_PROP_TYPE_PAGE_LAYOUT
Definition: PropType.hxx:26
@ XML_PROP_TYPE_TEXT
Definition: PropType.hxx:28
@ XML_PROP_TYPE_RUBY
Definition: PropType.hxx:30
@ XML_PROP_TYPE_TABLE_COLUMN
Definition: PropType.hxx:33
@ XML_PROP_TYPE_SECTION
Definition: PropType.hxx:31
@ XML_PROP_TYPE_TABLE_CELL
Definition: PropType.hxx:35
@ XML_PROP_TYPE_TABLE
Definition: PropType.hxx:32
@ XML_PROP_TYPE_CHART
Definition: PropType.hxx:37
@ XML_PROP_TYPE_PARAGRAPH
Definition: PropType.hxx:29
@ XML_PROP_TYPE_LIST_LEVEL
Definition: PropType.hxx:36
@ XML_PROP_TYPE_GRAPHIC
Definition: PropType.hxx:24
@ XML_PROP_TYPE_HEADER_FOOTER
Definition: PropType.hxx:27
@ XML_PROP_TYPE_DRAWING_PAGE
Definition: PropType.hxx:25
@ XML_PROP_TYPE_END
Definition: PropType.hxx:38
XMLTransformerActionInit const aListLevelPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aTextPropertyOOoElemActionTable[]
XMLTransformerActionInit const aTableCellPropertyOOoElemActionTable[]
XMLTransformerActionInit const aGraphicPropertyOOoElemActionTable[]
XMLTransformerActionInit const aParagraphPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aSectionPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aParagraphPropertyOOoElemActionTable[]
XMLTransformerActionInit const aChartPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aGraphicPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aPageLayoutPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aTablePropertyOOoAttrActionTable[]
XMLTransformerActionInit const aTableRowPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aHeaderFooterPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aTextPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aTableCellPropertyOOoAttrActionTable[]
XMLTransformerActionInit const aChartPropertyOOoElemActionTable[]
XMLTransformerActionInit const aDrawingPagePropertyOOoAttrActionTable[]
XMLTransformerActionInit const aTableColumnPropertyOOoAttrActionTable[]
@ XML_PTACTION_UNDERLINE
@ XML_PTACTION_SPLINES
@ XML_ATACTION_COPY_DUPLICATE
@ XML_ATACTION_MOVE_PROTECT
@ XML_ATACTION_CAPTION_ESCAPE_OOO
@ XML_PTACTION_SYMBOL
@ XML_PTACTION_INTERVAL_MINOR
@ XML_ATACTION_SIZE_PROTECT
@ XML_PTACTION_TRANSPARENCY
@ XML_ATACTION_INCH2IN_DUPLICATE
@ XML_ATACTION_PROTECT
@ XML_PTACTION_LINETHROUGH
@ XML_PTACTION_LINE_MODE
@ XML_PTACTION_INTERVAL_MAJOR
@ XML_PTACTION_KEEP_WITH_NEXT
@ XML_PTACTION_BREAK_INSIDE
@ XML_PTACTION_SYMBOL_IMAGE_NAME
#define ENTRY1(a)
const XMLTokenEnum aPropTokens[XML_PROP_TYPE_END]
const sal_uInt16 aAttrActionMaps[XML_PROP_TYPE_END]
#define ENTRY3(a, b, c)
#define ENTRY4(a, b, c, d)
const sal_uInt16 MAX_PROP_TYPES
const sal_uInt16 aElemActionMaps[XML_PROP_TYPE_END]
#define ENTRY2(a, b)
const std::array< XMLPropType, MAX_PROP_TYPES > aPropTypes[XML_FAMILY_TYPE_END]
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList
const OUString & GetExportQName() const
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void Export() override
void AddAttribute(sal_uInt16 nAPrefix, ::xmloff::token::XMLTokenEnum eAToken, ::xmloff::token::XMLTokenEnum eVToken)
virtual void EndElement() override
void AddContent(rtl::Reference< XMLTransformerContext > const &pContent)
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
XMLPersElemContentTContext(XMLTransformerBase &rTransformer, const OUString &rQName)
XMLStyleOOoTContext(XMLTransformerBase &rTransformer, const OUString &rQName, XMLFamilyType eType, bool bPersistent)
virtual bool IsPersistent() const override
static XMLTransformerActions * CreateTransformerActions(sal_uInt16 nType)
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void Characters(const OUString &rChars) override
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
virtual void EndElement() override
virtual ~XMLStyleOOoTContext() override
virtual XMLTransformerActions * GetUserDefinedActions(sal_uInt16 n)
static bool ReplaceInchWithIn(OUString &rValue)
SvXMLNamespaceMap & GetNamespaceMap()
static bool ReplaceSingleInchWithIn(OUString &rValue)
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler() const
static bool NegPercent(OUString &rValue)
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
virtual void Characters(const OUString &rChars)
XMLTransformerBase & GetTransformer()
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
virtual bool IsPersistent() const
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
sal_Int16 nValue
OUString sName
sal_Int32 nIndex
#define SAL_WARN(area, stream)
int i
const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG
const sal_uInt16 XML_NAMESPACE_NONE
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50
@ XML_TEXT_LINE_THROUGH_TEXT
Definition: xmltoken.hxx:2679
@ XML_TABLE_CELL_PROPERTIES
Definition: xmltoken.hxx:2640
@ XML_TEXT_LINE_THROUGH_STYLE
Definition: xmltoken.hxx:2676
@ XML_LIST_LEVEL_PROPERTIES
Definition: xmltoken.hxx:2641
@ XML_DRAWING_PAGE_PROPERTIES
Definition: xmltoken.hxx:2630
@ XML_GRADIENTSTYLE_SQUARE
Definition: xmltoken.hxx:988
@ XML_HEADER_FOOTER_PROPERTIES
Definition: xmltoken.hxx:2632
@ XML_TEXT_LINE_THROUGH_MODE
Definition: xmltoken.hxx:2647
@ XML_TEXT_UNDERLINE_MODE
Definition: xmltoken.hxx:2646
@ XML_HORIZONTAL_ON_RIGHT_PAGES
Definition: xmltoken.hxx:1037
@ XML_HORIZONTAL_ON_LEFT_PAGES
Definition: xmltoken.hxx:1036
@ XML_TEXT_UNDERLINE_TYPE
Definition: xmltoken.hxx:2667
@ XML_SECTION_PROPERTIES
Definition: xmltoken.hxx:2636
@ XML_TEXT_UNDERLINE_STYLE
Definition: xmltoken.hxx:2666
@ XML_TABLE_COLUMN_PROPERTIES
Definition: xmltoken.hxx:2638
@ XML_COLUMNSPLIT_AVOID
Definition: xmltoken.hxx:475
@ XML_PARAGRAPH_PROPERTIES
Definition: xmltoken.hxx:2634
@ XML_GRAPHIC_PROPERTIES
Definition: xmltoken.hxx:2629
@ XML_HORIZONTAL_ON_EVEN
Definition: xmltoken.hxx:3138
@ XML_TEXT_UNDERLINE_WIDTH
Definition: xmltoken.hxx:2668
@ XML_INTERVAL_MINOR_DIVISOR
Definition: xmltoken.hxx:2663
@ XML_TEXT_LINE_THROUGH_TYPE
Definition: xmltoken.hxx:2677
@ XML_PAGE_LAYOUT_PROPERTIES
Definition: xmltoken.hxx:2631
@ XML_TEXT_LINE_THROUGH_WIDTH
Definition: xmltoken.hxx:2678
@ XML_TABLE_ROW_PROPERTIES
Definition: xmltoken.hxx:2639
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3597
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3541
QPRO_FUNC_TYPE nType
sal_uInt16 GetQNamePrefixFromParam1() const
::xmloff::token::XMLTokenEnum GetQNameTokenFromParam1() const
sal_uInt16 sal_Unicode
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_CHART
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_FO
XMLTokenEnum eToken
Definition: xmltoken.cxx:40