1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <xml/statusbardocumenthandler.hxx>
22 #include <com/sun/star/xml/sax/SAXException.hpp>
23 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
24 #include <com/sun/star/ui/ItemStyle.hpp>
25 #include <com/sun/star/ui/ItemType.hpp>
26 #include <com/sun/star/beans/PropertyValue.hpp>
27 #include <com/sun/star/container/XIndexAccess.hpp>
28 #include <com/sun/star/container/XIndexContainer.hpp>
30 #include <vcl/status.hxx>
32 #include <comphelper/propertyvalue.hxx>
34 using namespace ::com::sun::star::uno
;
35 using namespace ::com::sun::star::beans
;
36 using namespace ::com::sun::star::xml::sax
;
37 using namespace ::com::sun::star::ui
;
38 using namespace ::com::sun::star::container
;
40 constexpr OUString XMLNS_STATUSBAR
= u
"http://openoffice.org/2001/statusbar"_ustr
;
41 constexpr OUString XMLNS_XLINK
= u
"http://www.w3.org/1999/xlink"_ustr
;
42 constexpr OUStringLiteral XMLNS_STATUSBAR_PREFIX
= u
"statusbar:";
43 constexpr OUStringLiteral XMLNS_XLINK_PREFIX
= u
"xlink:";
45 constexpr OUString XMLNS_FILTER_SEPARATOR
= u
"^"_ustr
;
47 constexpr OUString ATTRIBUTE_ALIGN
= u
"align"_ustr
;
48 constexpr OUString ATTRIBUTE_STYLE
= u
"style"_ustr
;
49 constexpr OUString ATTRIBUTE_URL
= u
"href"_ustr
;
50 constexpr OUString ATTRIBUTE_WIDTH
= u
"width"_ustr
;
51 constexpr OUString ATTRIBUTE_OFFSET
= u
"offset"_ustr
;
52 constexpr OUString ATTRIBUTE_AUTOSIZE
= u
"autosize"_ustr
;
53 constexpr OUString ATTRIBUTE_OWNERDRAW
= u
"ownerdraw"_ustr
;
54 constexpr OUString ATTRIBUTE_HELPURL
= u
"helpid"_ustr
;
55 constexpr OUString ATTRIBUTE_MANDATORY
= u
"mandatory"_ustr
;
57 constexpr OUString ELEMENT_NS_STATUSBAR
= u
"statusbar:statusbar"_ustr
;
58 constexpr OUString ELEMENT_NS_STATUSBARITEM
= u
"statusbar:statusbaritem"_ustr
;
60 constexpr OUStringLiteral ATTRIBUTE_XMLNS_STATUSBAR
= u
"xmlns:statusbar";
61 constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK
= u
"xmlns:xlink";
63 constexpr OUString ATTRIBUTE_BOOLEAN_TRUE
= u
"true"_ustr
;
64 constexpr OUString ATTRIBUTE_BOOLEAN_FALSE
= u
"false"_ustr
;
66 constexpr OUString ATTRIBUTE_ALIGN_LEFT
= u
"left"_ustr
;
67 constexpr OUString ATTRIBUTE_ALIGN_RIGHT
= u
"right"_ustr
;
68 constexpr OUString ATTRIBUTE_ALIGN_CENTER
= u
"center"_ustr
;
70 constexpr OUStringLiteral ATTRIBUTE_STYLE_IN
= u
"in";
71 constexpr OUString ATTRIBUTE_STYLE_OUT
= u
"out"_ustr
;
72 constexpr OUString ATTRIBUTE_STYLE_FLAT
= u
"flat"_ustr
;
74 constexpr OUStringLiteral STATUSBAR_DOCTYPE
= u
"<!DOCTYPE statusbar:statusbar PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"statusbar.dtd\">";
79 // Property names of a menu/menu item ItemDescriptor
80 constexpr OUString ITEM_DESCRIPTOR_COMMANDURL
= u
"CommandURL"_ustr
;
81 constexpr OUString ITEM_DESCRIPTOR_HELPURL
= u
"HelpURL"_ustr
;
82 constexpr OUString ITEM_DESCRIPTOR_OFFSET
= u
"Offset"_ustr
;
83 constexpr OUString ITEM_DESCRIPTOR_STYLE
= u
"Style"_ustr
;
84 constexpr OUString ITEM_DESCRIPTOR_WIDTH
= u
"Width"_ustr
;
85 constexpr OUString ITEM_DESCRIPTOR_TYPE
= u
"Type"_ustr
;
87 static void ExtractStatusbarItemParameters(
88 const Sequence
< PropertyValue
>& rProp
,
89 OUString
& rCommandURL
,
95 for ( const PropertyValue
& rEntry
: rProp
)
97 if ( rEntry
.Name
== ITEM_DESCRIPTOR_COMMANDURL
)
99 rEntry
.Value
>>= rCommandURL
;
101 else if ( rEntry
.Name
== ITEM_DESCRIPTOR_HELPURL
)
103 rEntry
.Value
>>= rHelpURL
;
105 else if ( rEntry
.Name
== ITEM_DESCRIPTOR_OFFSET
)
107 rEntry
.Value
>>= rOffset
;
109 else if ( rEntry
.Name
== ITEM_DESCRIPTOR_STYLE
)
111 rEntry
.Value
>>= rStyle
;
113 else if ( rEntry
.Name
== ITEM_DESCRIPTOR_WIDTH
)
115 rEntry
.Value
>>= rWidth
;
122 struct StatusBarEntryProperty
124 OReadStatusBarDocumentHandler::StatusBar_XML_Namespace nNamespace
;
130 StatusBarEntryProperty
constexpr StatusBarEntries
[OReadStatusBarDocumentHandler::SB_XML_ENTRY_COUNT
] =
132 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, u
"statusbar"_ustr
},
133 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, u
"statusbaritem"_ustr
},
134 { OReadStatusBarDocumentHandler::SB_NS_XLINK
, ATTRIBUTE_URL
},
135 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_ALIGN
},
136 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_STYLE
},
137 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_AUTOSIZE
},
138 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_OWNERDRAW
},
139 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_WIDTH
},
140 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_OFFSET
},
141 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_HELPURL
},
142 { OReadStatusBarDocumentHandler::SB_NS_STATUSBAR
, ATTRIBUTE_MANDATORY
}
145 OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler(
146 const Reference
< XIndexContainer
>& rStatusBarItems
) :
147 m_aStatusBarItems( rStatusBarItems
)
150 for ( int i
= 0; i
< SB_XML_ENTRY_COUNT
; i
++ )
152 if ( StatusBarEntries
[i
].nNamespace
== SB_NS_STATUSBAR
)
154 OUString temp
= XMLNS_STATUSBAR
+ XMLNS_FILTER_SEPARATOR
+
155 StatusBarEntries
[i
].aEntryName
;
156 m_aStatusBarMap
.emplace( temp
, static_cast<StatusBar_XML_Entry
>(i
) );
160 OUString temp
= XMLNS_XLINK
+ XMLNS_FILTER_SEPARATOR
+
161 StatusBarEntries
[i
].aEntryName
;
162 m_aStatusBarMap
.emplace( temp
, static_cast<StatusBar_XML_Entry
>(i
) );
166 m_bStatusBarStartFound
= false;
167 m_bStatusBarItemStartFound
= false;
170 OReadStatusBarDocumentHandler::~OReadStatusBarDocumentHandler()
175 void SAL_CALL
OReadStatusBarDocumentHandler::startDocument()
179 void SAL_CALL
OReadStatusBarDocumentHandler::endDocument()
181 if ( m_bStatusBarStartFound
)
183 OUString aErrorMessage
= getErrorLineString() + "No matching start or end element 'statusbar' found!";
184 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
188 void SAL_CALL
OReadStatusBarDocumentHandler::startElement(
189 const OUString
& aName
, const Reference
< XAttributeList
> &xAttribs
)
191 StatusBarHashMap::const_iterator pStatusBarEntry
= m_aStatusBarMap
.find( aName
);
192 if ( pStatusBarEntry
== m_aStatusBarMap
.end() )
195 switch ( pStatusBarEntry
->second
)
197 case SB_ELEMENT_STATUSBAR
:
199 if ( m_bStatusBarStartFound
)
201 OUString aErrorMessage
= getErrorLineString() + "Element 'statusbar:statusbar' cannot be embedded into 'statusbar:statusbar'!";
202 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
205 m_bStatusBarStartFound
= true;
209 case SB_ELEMENT_STATUSBARITEM
:
211 if ( !m_bStatusBarStartFound
)
213 OUString aErrorMessage
= getErrorLineString() + "Element 'statusbar:statusbaritem' must be embedded into element 'statusbar:statusbar'!";
214 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
217 if ( m_bStatusBarItemStartFound
)
219 OUString aErrorMessage
= getErrorLineString() + "Element statusbar:statusbaritem is not a container!";
220 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
223 OUString aCommandURL
;
225 sal_Int16
nItemBits( ItemStyle::ALIGN_CENTER
|ItemStyle::DRAW_IN3D
|ItemStyle::MANDATORY
);
226 sal_Int16
nWidth( 0 );
227 sal_Int16
nOffset( STATUSBAR_OFFSET
);
228 bool bCommandURL( false );
230 m_bStatusBarItemStartFound
= true;
231 for ( sal_Int16 n
= 0; n
< xAttribs
->getLength(); n
++ )
233 pStatusBarEntry
= m_aStatusBarMap
.find( xAttribs
->getNameByIndex( n
) );
234 if ( pStatusBarEntry
!= m_aStatusBarMap
.end() )
236 switch ( pStatusBarEntry
->second
)
238 case SB_ATTRIBUTE_URL
:
241 aCommandURL
= xAttribs
->getValueByIndex( n
);
245 case SB_ATTRIBUTE_ALIGN
:
247 if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_ALIGN_LEFT
)
249 nItemBits
|= ItemStyle::ALIGN_LEFT
;
250 nItemBits
&= ~ItemStyle::ALIGN_CENTER
;
252 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_ALIGN_CENTER
)
254 nItemBits
|= ItemStyle::ALIGN_CENTER
;
255 nItemBits
&= ~ItemStyle::ALIGN_LEFT
;
257 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_ALIGN_RIGHT
)
259 nItemBits
|= ItemStyle::ALIGN_RIGHT
;
263 OUString aErrorMessage
= getErrorLineString() + "Attribute statusbar:align must have one value of 'left','right' or 'center'!";
264 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
269 case SB_ATTRIBUTE_STYLE
:
271 if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_STYLE_IN
)
273 nItemBits
|= ItemStyle::DRAW_IN3D
;
274 nItemBits
&= ~ItemStyle::DRAW_OUT3D
;
276 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_STYLE_OUT
)
278 nItemBits
|= ItemStyle::DRAW_OUT3D
;
279 nItemBits
&= ~ItemStyle::DRAW_IN3D
;
281 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_STYLE_FLAT
)
283 nItemBits
|= ItemStyle::DRAW_FLAT
;
287 OUString aErrorMessage
= getErrorLineString() + "Attribute statusbar:autosize must have value 'true' or 'false'!";
288 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
293 case SB_ATTRIBUTE_AUTOSIZE
:
295 if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_BOOLEAN_TRUE
)
296 nItemBits
|= ItemStyle::AUTO_SIZE
;
297 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_BOOLEAN_FALSE
)
298 nItemBits
&= ~ItemStyle::AUTO_SIZE
;
301 OUString aErrorMessage
= getErrorLineString() + "Attribute statusbar:autosize must have value 'true' or 'false'!";
302 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
307 case SB_ATTRIBUTE_OWNERDRAW
:
309 if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_BOOLEAN_TRUE
)
310 nItemBits
|= ItemStyle::OWNER_DRAW
;
311 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_BOOLEAN_FALSE
)
312 nItemBits
&= ~ItemStyle::OWNER_DRAW
;
315 OUString aErrorMessage
= getErrorLineString() + "Attribute statusbar:ownerdraw must have value 'true' or 'false'!";
316 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
321 case SB_ATTRIBUTE_WIDTH
:
323 nWidth
= static_cast<sal_Int16
>(xAttribs
->getValueByIndex( n
).toInt32());
327 case SB_ATTRIBUTE_OFFSET
:
329 nOffset
= static_cast<sal_Int16
>(xAttribs
->getValueByIndex( n
).toInt32());
333 case SB_ATTRIBUTE_HELPURL
:
335 aHelpURL
= xAttribs
->getValueByIndex( n
);
339 case SB_ATTRIBUTE_MANDATORY
:
341 if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_BOOLEAN_TRUE
)
342 nItemBits
|= ItemStyle::MANDATORY
;
343 else if ( xAttribs
->getValueByIndex( n
) == ATTRIBUTE_BOOLEAN_FALSE
)
344 nItemBits
&= ~ItemStyle::MANDATORY
;
347 OUString aErrorMessage
= getErrorLineString() + "Attribute statusbar:mandatory must have value 'true' or 'false'!";
348 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
361 OUString aErrorMessage
= getErrorLineString() + "Required attribute statusbar:url must have a value!";
362 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
366 Sequence
< PropertyValue
> aStatusbarItemProp
{
367 comphelper::makePropertyValue(ITEM_DESCRIPTOR_COMMANDURL
, aCommandURL
),
368 comphelper::makePropertyValue(ITEM_DESCRIPTOR_HELPURL
, aHelpURL
),
369 comphelper::makePropertyValue(ITEM_DESCRIPTOR_OFFSET
, nOffset
),
370 comphelper::makePropertyValue(ITEM_DESCRIPTOR_STYLE
, nItemBits
),
371 comphelper::makePropertyValue(ITEM_DESCRIPTOR_WIDTH
, nWidth
),
372 comphelper::makePropertyValue(ITEM_DESCRIPTOR_TYPE
, css::ui::ItemType::DEFAULT
)
375 m_aStatusBarItems
->insertByIndex( m_aStatusBarItems
->getCount(), Any( aStatusbarItemProp
) );
385 void SAL_CALL
OReadStatusBarDocumentHandler::endElement(const OUString
& aName
)
387 StatusBarHashMap::const_iterator pStatusBarEntry
= m_aStatusBarMap
.find( aName
);
388 if ( pStatusBarEntry
== m_aStatusBarMap
.end() )
391 switch ( pStatusBarEntry
->second
)
393 case SB_ELEMENT_STATUSBAR
:
395 if ( !m_bStatusBarStartFound
)
397 OUString aErrorMessage
= getErrorLineString() + "End element 'statusbar' found, but no start element 'statusbar'";
398 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
401 m_bStatusBarStartFound
= false;
405 case SB_ELEMENT_STATUSBARITEM
:
407 if ( !m_bStatusBarItemStartFound
)
409 OUString aErrorMessage
= getErrorLineString() + "End element 'statusbar:statusbaritem' found, but no start element 'statusbar:statusbaritem'";
410 throw SAXException( aErrorMessage
, Reference
< XInterface
>(), Any() );
413 m_bStatusBarItemStartFound
= false;
421 void SAL_CALL
OReadStatusBarDocumentHandler::characters(const OUString
&)
425 void SAL_CALL
OReadStatusBarDocumentHandler::ignorableWhitespace(const OUString
&)
429 void SAL_CALL
OReadStatusBarDocumentHandler::processingInstruction(
430 const OUString
& /*aTarget*/, const OUString
& /*aData*/ )
434 void SAL_CALL
OReadStatusBarDocumentHandler::setDocumentLocator(
435 const Reference
< XLocator
> &xLocator
)
437 m_xLocator
= xLocator
;
440 OUString
OReadStatusBarDocumentHandler::getErrorLineString()
442 if ( m_xLocator
.is() )
443 return "Line: " + OUString::number( m_xLocator
->getLineNumber() ) + " - ";
448 // OWriteStatusBarDocumentHandler
450 OWriteStatusBarDocumentHandler::OWriteStatusBarDocumentHandler(
451 const Reference
< XIndexAccess
>& aStatusBarItems
,
452 const Reference
< XDocumentHandler
>& rWriteDocumentHandler
) :
453 m_aStatusBarItems( aStatusBarItems
),
454 m_xWriteDocumentHandler( rWriteDocumentHandler
)
456 m_aXMLXlinkNS
= XMLNS_XLINK_PREFIX
;
457 m_aXMLStatusBarNS
= XMLNS_STATUSBAR_PREFIX
;
460 OWriteStatusBarDocumentHandler::~OWriteStatusBarDocumentHandler()
464 void OWriteStatusBarDocumentHandler::WriteStatusBarDocument()
466 m_xWriteDocumentHandler
->startDocument();
468 // write DOCTYPE line!
469 Reference
< XExtendedDocumentHandler
> xExtendedDocHandler( m_xWriteDocumentHandler
, UNO_QUERY
);
470 if ( xExtendedDocHandler
.is() )
472 xExtendedDocHandler
->unknown( STATUSBAR_DOCTYPE
);
473 m_xWriteDocumentHandler
->ignorableWhitespace( OUString() );
476 rtl::Reference
<::comphelper::AttributeList
> pList
= new ::comphelper::AttributeList
;
478 pList
->AddAttribute( ATTRIBUTE_XMLNS_STATUSBAR
,
481 pList
->AddAttribute( ATTRIBUTE_XMLNS_XLINK
,
484 m_xWriteDocumentHandler
->startElement( ELEMENT_NS_STATUSBAR
, pList
);
485 m_xWriteDocumentHandler
->ignorableWhitespace( OUString() );
487 sal_Int32 nItemCount
= m_aStatusBarItems
->getCount();
490 for ( sal_Int32 nItemPos
= 0; nItemPos
< nItemCount
; nItemPos
++ )
492 Sequence
< PropertyValue
> aProps
;
493 aAny
= m_aStatusBarItems
->getByIndex( nItemPos
);
494 if ( aAny
>>= aProps
)
496 OUString aCommandURL
;
498 sal_Int16
nStyle( ItemStyle::ALIGN_CENTER
|ItemStyle::DRAW_IN3D
);
499 sal_Int16
nWidth( 0 );
500 sal_Int16
nOffset( STATUSBAR_OFFSET
);
502 ExtractStatusbarItemParameters(
510 if ( !aCommandURL
.isEmpty() )
511 WriteStatusBarItem( aCommandURL
, nOffset
, nStyle
, nWidth
);
515 m_xWriteDocumentHandler
->ignorableWhitespace( OUString() );
516 m_xWriteDocumentHandler
->endElement( ELEMENT_NS_STATUSBAR
);
517 m_xWriteDocumentHandler
->ignorableWhitespace( OUString() );
518 m_xWriteDocumentHandler
->endDocument();
521 // protected member functions
523 void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
524 const OUString
& rCommandURL
,
529 rtl::Reference
<::comphelper::AttributeList
> pList
= new ::comphelper::AttributeList
;
531 if (m_aAttributeURL
.isEmpty() )
533 m_aAttributeURL
= m_aXMLXlinkNS
+ ATTRIBUTE_URL
;
536 // save required attribute (URL)
537 pList
->AddAttribute( m_aAttributeURL
, rCommandURL
);
540 if ( nStyle
& ItemStyle::ALIGN_RIGHT
)
542 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_ALIGN
,
543 ATTRIBUTE_ALIGN_RIGHT
);
545 else if ( nStyle
& ItemStyle::ALIGN_CENTER
)
547 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_ALIGN
,
548 ATTRIBUTE_ALIGN_CENTER
);
552 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_ALIGN
,
553 ATTRIBUTE_ALIGN_LEFT
);
556 // style ( StatusBarItemBits::In is default )
557 if ( nStyle
& ItemStyle::DRAW_FLAT
)
559 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_STYLE
,
560 ATTRIBUTE_STYLE_FLAT
);
562 else if ( nStyle
& ItemStyle::DRAW_OUT3D
)
564 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_STYLE
,
565 ATTRIBUTE_STYLE_OUT
);
568 // autosize (default sal_False)
569 if ( nStyle
& ItemStyle::AUTO_SIZE
)
571 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_AUTOSIZE
,
572 ATTRIBUTE_BOOLEAN_TRUE
);
575 // ownerdraw (default sal_False)
576 if ( nStyle
& ItemStyle::OWNER_DRAW
)
578 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_OWNERDRAW
,
579 ATTRIBUTE_BOOLEAN_TRUE
);
585 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_WIDTH
,
586 OUString::number( nWidth
) );
589 // offset (default STATUSBAR_OFFSET)
590 if ( nOffset
!= STATUSBAR_OFFSET
)
592 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_OFFSET
,
593 OUString::number( nOffset
) );
596 // mandatory (default sal_True)
597 if ( !( nStyle
& ItemStyle::MANDATORY
) )
599 pList
->AddAttribute( m_aXMLStatusBarNS
+ ATTRIBUTE_MANDATORY
,
600 ATTRIBUTE_BOOLEAN_FALSE
);
603 m_xWriteDocumentHandler
->ignorableWhitespace( OUString() );
604 m_xWriteDocumentHandler
->startElement( ELEMENT_NS_STATUSBARITEM
, pList
);
605 m_xWriteDocumentHandler
->ignorableWhitespace( OUString() );
606 m_xWriteDocumentHandler
->endElement( ELEMENT_NS_STATUSBARITEM
);
609 } // namespace framework
611 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */