tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / framework / source / fwe / xml / statusbardocumenthandler.cxx
blob2294e7f51ea407be5e26a77180991aa40790ba5f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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\">";
76 namespace framework
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,
90 OUString& rHelpURL,
91 sal_Int16& rOffset,
92 sal_Int16& rStyle,
93 sal_Int16& rWidth )
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;
120 namespace {
122 struct StatusBarEntryProperty
124 OReadStatusBarDocumentHandler::StatusBar_XML_Namespace nNamespace;
125 OUString aEntryName;
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 )
149 // create hash map
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) );
158 else
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()
174 // XDocumentHandler
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() )
193 return;
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;
207 break;
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;
224 OUString aHelpURL;
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:
240 bCommandURL = true;
241 aCommandURL = xAttribs->getValueByIndex( n );
243 break;
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;
261 else
263 OUString aErrorMessage = getErrorLineString() + "Attribute statusbar:align must have one value of 'left','right' or 'center'!";
264 throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
267 break;
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;
285 else
287 OUString aErrorMessage = getErrorLineString() + "Attribute statusbar:autosize must have value 'true' or 'false'!";
288 throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
291 break;
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;
299 else
301 OUString aErrorMessage = getErrorLineString() + "Attribute statusbar:autosize must have value 'true' or 'false'!";
302 throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
305 break;
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;
313 else
315 OUString aErrorMessage = getErrorLineString() + "Attribute statusbar:ownerdraw must have value 'true' or 'false'!";
316 throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
319 break;
321 case SB_ATTRIBUTE_WIDTH:
323 nWidth = static_cast<sal_Int16>(xAttribs->getValueByIndex( n ).toInt32());
325 break;
327 case SB_ATTRIBUTE_OFFSET:
329 nOffset = static_cast<sal_Int16>(xAttribs->getValueByIndex( n ).toInt32());
331 break;
333 case SB_ATTRIBUTE_HELPURL:
335 aHelpURL = xAttribs->getValueByIndex( n );
337 break;
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;
345 else
347 OUString aErrorMessage = getErrorLineString() + "Attribute statusbar:mandatory must have value 'true' or 'false'!";
348 throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
351 break;
353 default:
354 break;
357 } // for
359 if ( !bCommandURL )
361 OUString aErrorMessage = getErrorLineString() + "Required attribute statusbar:url must have a value!";
362 throw SAXException( aErrorMessage, Reference< XInterface >(), Any() );
364 else
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 ) );
378 break;
380 default:
381 break;
385 void SAL_CALL OReadStatusBarDocumentHandler::endElement(const OUString& aName)
387 StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName );
388 if ( pStatusBarEntry == m_aStatusBarMap.end() )
389 return;
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;
403 break;
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;
415 break;
417 default: break;
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() ) + " - ";
444 else
445 return OUString();
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,
479 XMLNS_STATUSBAR );
481 pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK,
482 XMLNS_XLINK );
484 m_xWriteDocumentHandler->startElement( ELEMENT_NS_STATUSBAR, pList );
485 m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
487 sal_Int32 nItemCount = m_aStatusBarItems->getCount();
488 Any aAny;
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;
497 OUString aHelpURL;
498 sal_Int16 nStyle( ItemStyle::ALIGN_CENTER|ItemStyle::DRAW_IN3D );
499 sal_Int16 nWidth( 0 );
500 sal_Int16 nOffset( STATUSBAR_OFFSET );
502 ExtractStatusbarItemParameters(
503 aProps,
504 aCommandURL,
505 aHelpURL,
506 nOffset,
507 nStyle,
508 nWidth );
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,
525 sal_Int16 nOffset,
526 sal_Int16 nStyle,
527 sal_Int16 nWidth )
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 );
539 // alignment
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 );
550 else
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 );
582 // width (default 0)
583 if ( nWidth > 0 )
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: */