1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmldlg_expmodels.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmlscript.hxx"
33 #include "exp_share.hxx"
35 #include <com/sun/star/form/binding/XListEntrySink.hpp>
36 #include <com/sun/star/form/binding/XBindableValue.hpp>
37 #include <com/sun/star/form/binding/XValueBinding.hpp>
38 #include <com/sun/star/table/CellAddress.hpp>
39 #include <com/sun/star/table/CellRangeAddress.hpp>
40 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
41 #include <com/sun/star/document/XStorageBasedDocument.hpp>
42 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
43 #include <comphelper/componentcontext.hxx>
44 #include <comphelper/processfactory.hxx>
47 using namespace ::com::sun::star
;
48 using namespace ::com::sun::star::uno
;
49 using ::rtl::OUString
;
54 void lclExportBindableAndListSourceBits( Reference
< frame::XModel
> const & xDocument
, const Reference
< beans::XPropertySet
>& _xProps
, ElementDescriptor
& rModel
)
56 Reference
< lang::XMultiServiceFactory
> xFac
;
58 xFac
.set( xDocument
, uno::UNO_QUERY
);
60 Reference
< form::binding::XBindableValue
> xBinding( _xProps
, UNO_QUERY
);
62 if ( xFac
.is() && xBinding
.is() )
66 Reference
< beans::XPropertySet
> xConvertor( xFac
->createInstance( OUSTR( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY
);
67 Reference
< beans::XPropertySet
> xBindable( xBinding
->getValueBinding(), UNO_QUERY
);
70 table::CellAddress aAddress
;
71 xBindable
->getPropertyValue( OUSTR("BoundCell") ) >>= aAddress
;
72 xConvertor
->setPropertyValue( OUSTR("Address"), makeAny( aAddress
) );
73 rtl::OUString sAddress
;
74 xConvertor
->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress
;
75 if ( sAddress
.getLength() > 0 )
76 rModel
.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX
":linked-cell"), sAddress
);
78 OSL_TRACE( "*** Bindable value %s", rtl::OUStringToOString( sAddress
, RTL_TEXTENCODING_UTF8
).getStr() );
82 catch( uno::Exception
& )
86 Reference
< form::binding::XListEntrySink
> xEntrySink( _xProps
, UNO_QUERY
);
87 if ( xEntrySink
.is() )
89 Reference
< beans::XPropertySet
> xListSource( xEntrySink
->getListEntrySource(), UNO_QUERY
);
90 if ( xListSource
.is() )
94 Reference
< beans::XPropertySet
> xConvertor( xFac
->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY
);
96 table::CellRangeAddress aAddress
;
97 xListSource
->getPropertyValue( OUSTR( "CellRange" ) ) >>= aAddress
;
99 rtl::OUString sAddress
;
100 xConvertor
->setPropertyValue( OUSTR("Address"), makeAny( aAddress
) );
101 xConvertor
->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress
;
102 OSL_TRACE("**** cell range source list %s",
103 rtl::OUStringToOString( sAddress
, RTL_TEXTENCODING_UTF8
).getStr() );
104 if ( sAddress
.getLength() > 0 );
105 rModel
.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX
":source-cell-range"), sAddress
);
107 catch( uno::Exception
& )
114 static inline bool readBorderProps(
115 ElementDescriptor
* element
, Style
& style
)
117 if (element
->readProp( &style
._border
, OUSTR("Border") )) {
118 if (style
._border
== BORDER_SIMPLE
/* simple */)
120 if (element
->readProp( &style
._borderColor
, OUSTR("BorderColor") ))
121 style
._border
= BORDER_SIMPLE_COLOR
;
128 static inline bool readFontProps( ElementDescriptor
* element
, Style
& style
)
130 bool ret
= element
->readProp(
131 &style
._descr
, OUSTR("FontDescriptor") );
132 ret
|= element
->readProp(
133 &style
._fontEmphasisMark
, OUSTR("FontEmphasisMark") );
134 ret
|= element
->readProp(
135 &style
._fontRelief
, OUSTR("FontRelief") );
139 //__________________________________________________________________________________________________
140 void ElementDescriptor::readMultiPageModel( StyleBag
* all_styles
)
143 Style
aStyle( 0x2 | 0x8 | 0x20 );
144 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
146 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
148 if (readFontProps( this, aStyle
))
152 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
153 all_styles
->getStyleId( aStyle
) );
158 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ),
159 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
160 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ),
161 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
164 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle
)
166 ElementDescriptor
* title
= new ElementDescriptor(
167 _xProps
, _xPropState
,
168 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":title") ) );
169 title
->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ),
171 addSubElement( title
);
176 void ElementDescriptor::readButtonModel( StyleBag
* all_styles
)
177 SAL_THROW( (Exception
) )
180 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
181 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
183 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
185 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
187 if (readFontProps( this, aStyle
))
191 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
192 all_styles
->getStyleId( aStyle
) );
197 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
198 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
199 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultButton") ),
200 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":default") ) );
201 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
202 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
203 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
204 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
205 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
206 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":valign") ) );
207 readButtonTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("PushButtonType") ),
208 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":button-type") ) );
209 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
210 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-src") ) );
211 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ),
212 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-position") ) );
213 readImageAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageAlign") ),
214 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-align") ) );
215 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Repeat") ) ))
216 readLongAttr( OUSTR("RepeatDelay"),
217 OUSTR(XMLNS_DIALOGS_PREFIX
":repeat"), true /* force */ );
218 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Toggle") ) ))
219 addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX
":toggled"), OUSTR("1") );
220 readBoolAttr( OUSTR("FocusOnClick"),
221 OUSTR(XMLNS_DIALOGS_PREFIX
":grab-focus") );
222 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
223 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiline") ) );
227 sal_Int16 nState
= 0;
228 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState
)
233 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":checked") ),
234 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
237 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":checked") ),
238 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
241 OSL_ENSURE( 0, "### unexpected radio state!" );
248 //__________________________________________________________________________________________________
249 void ElementDescriptor::readCheckBoxModel( StyleBag
* all_styles
)
250 SAL_THROW( (Exception
) )
253 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
254 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
256 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
258 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
260 if (readFontProps( this, aStyle
))
262 if (readProp( OUSTR("VisualEffect") ) >>= aStyle
._visualEffect
)
266 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
267 all_styles
->getStyleId( aStyle
) );
272 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
273 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
274 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
275 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
276 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
277 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
278 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
279 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":valign") ) );
280 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
281 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-src") ) );
282 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ),
283 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-position") ) );
284 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
285 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiline") ) );
287 sal_Bool bTriState
= sal_False
;
288 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TriState") ) ) >>= bTriState
) && bTriState
)
290 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tristate") ),
291 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
293 sal_Int16 nState
= 0;
294 if (_xProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState
)
299 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":checked") ),
300 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
303 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":checked") ),
304 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
306 case 2: // tristate=true exported, checked omitted => dont know!
307 OSL_ENSURE( bTriState
, "### detected tristate value, but TriState is not set!" );
310 OSL_ENSURE( 0, "### unexpected checkbox state!" );
316 //__________________________________________________________________________________________________
317 void ElementDescriptor::readComboBoxModel( StyleBag
* all_styles
, Reference
< frame::XModel
> const & xDocument
)
318 SAL_THROW( (Exception
) )
321 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
322 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
324 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
326 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
328 if (readBorderProps( this, aStyle
))
330 if (readFontProps( this, aStyle
))
334 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
335 all_styles
->getStyleId( aStyle
) );
340 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
341 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
342 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
343 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
344 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
345 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
346 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Autocomplete") ),
347 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":autocomplete") ) );
348 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
349 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
350 readBoolAttr( OUSTR("HideInactiveSelection"),
351 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
352 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ),
353 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
354 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
355 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":maxlength") ) );
356 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ),
357 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":linecount") ) );
358 // Cell Range, Ref Cell etc.
359 lclExportBindableAndListSourceBits( xDocument
, _xProps
, *this );
361 Sequence
< OUString
> itemValues
;
362 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues
) &&
363 itemValues
.getLength() > 0)
365 ElementDescriptor
* popup
= new ElementDescriptor(
366 _xProps
, _xPropState
,
367 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":menupopup") ) );
369 OUString
const * pItemValues
= itemValues
.getConstArray();
370 for ( sal_Int32 nPos
= 0; nPos
< itemValues
.getLength(); ++nPos
)
372 ElementDescriptor
* item
= new ElementDescriptor(
373 _xProps
, _xPropState
,
374 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":menuitem") ) );
375 item
->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ),
376 pItemValues
[ nPos
] );
377 popup
->addSubElement( item
);
380 addSubElement( popup
);
384 //__________________________________________________________________________________________________
385 void ElementDescriptor::readListBoxModel( StyleBag
* all_styles
, Reference
< frame::XModel
> const & xDocument
)
386 SAL_THROW( (Exception
) )
389 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
390 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
392 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
394 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
396 if (readBorderProps( this, aStyle
))
398 if (readFontProps( this, aStyle
))
402 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
403 all_styles
->getStyleId( aStyle
) );
408 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
409 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
410 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiSelection") ),
411 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiselection") ) );
412 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
413 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
414 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ),
415 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
416 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ),
417 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":linecount") ) );
418 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
419 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
420 lclExportBindableAndListSourceBits( xDocument
, _xProps
, *this );
422 Sequence
< OUString
> itemValues
;
423 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues
) &&
424 itemValues
.getLength() > 0)
426 ElementDescriptor
* popup
= new ElementDescriptor(
427 _xProps
, _xPropState
,
428 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":menupopup") ) );
430 OUString
const * pItemValues
= itemValues
.getConstArray();
432 for ( nPos
= 0; nPos
< itemValues
.getLength(); ++nPos
)
434 ElementDescriptor
* item
= new ElementDescriptor(
435 _xProps
, _xPropState
,
436 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":menuitem") ) );
437 item
->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ),
438 pItemValues
[ nPos
] );
439 popup
->addSubElement( item
);
442 Sequence
< sal_Int16
> selected
;
443 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ) ) >>= selected
)
445 sal_Int16
const * pSelected
= selected
.getConstArray();
446 for ( nPos
= selected
.getLength(); nPos
--; )
448 ElementDescriptor
* item
= static_cast< ElementDescriptor
* >(
449 popup
->getSubElement( pSelected
[ nPos
] ).get() );
450 item
->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":selected") ),
451 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
455 addSubElement( popup
);
459 //__________________________________________________________________________________________________
460 void ElementDescriptor::readRadioButtonModel( StyleBag
* all_styles
, Reference
< frame::XModel
> const & xDocument
)
461 SAL_THROW( (Exception
) )
464 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
465 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
467 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
469 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
471 if (readFontProps( this, aStyle
))
473 if (readProp( OUSTR("VisualEffect") ) >>= aStyle
._visualEffect
)
477 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
478 all_styles
->getStyleId( aStyle
) );
483 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
484 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
485 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
486 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
487 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
488 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
489 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
490 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":valign") ) );
491 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
492 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-src") ) );
493 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ),
494 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-position") ) );
495 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
496 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiline") ) );
497 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ),
498 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":group-name") ) );
500 sal_Int16 nState
= 0;
501 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState
)
506 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":checked") ),
507 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
510 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":checked") ),
511 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
514 OSL_ENSURE( 0, "### unexpected radio state!" );
518 lclExportBindableAndListSourceBits( xDocument
, _xProps
, *this );
521 //__________________________________________________________________________________________________
522 void ElementDescriptor::readGroupBoxModel( StyleBag
* all_styles
)
523 SAL_THROW( (Exception
) )
526 Style
aStyle( 0x2 | 0x8 | 0x20 );
527 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
529 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
531 if (readFontProps( this, aStyle
))
535 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
536 all_styles
->getStyleId( aStyle
) );
543 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle
)
545 ElementDescriptor
* title
= new ElementDescriptor(
546 _xProps
, _xPropState
,
547 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":title") ) );
548 title
->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ),
550 addSubElement( title
);
555 //__________________________________________________________________________________________________
556 void ElementDescriptor::readFixedTextModel( StyleBag
* all_styles
)
557 SAL_THROW( (Exception
) )
560 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
561 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
563 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
565 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
567 if (readBorderProps( this, aStyle
))
569 if (readFontProps( this, aStyle
))
573 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
574 all_styles
->getStyleId( aStyle
) );
579 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
580 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
581 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
582 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
583 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
584 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":valign") ) );
585 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
586 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiline") ) );
587 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
588 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
589 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("NoLabel") ),
590 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":nolabel") ) );
593 //__________________________________________________________________________________________________
594 void ElementDescriptor::readFixedHyperLinkModel( StyleBag
* all_styles
)
595 SAL_THROW( (Exception
) )
598 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
599 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
601 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
603 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
605 if (readBorderProps( this, aStyle
))
607 if (readFontProps( this, aStyle
))
611 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
612 all_styles
->getStyleId( aStyle
) );
617 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
618 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
619 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("URL") ),
620 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":url") ) );
621 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Description") ),
622 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":description") ) );
623 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
624 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
625 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
626 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":valign") ) );
627 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
628 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiline") ) );
629 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
630 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
631 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("NoLabel") ),
632 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":nolabel") ) );
635 //__________________________________________________________________________________________________
636 void ElementDescriptor::readEditModel( StyleBag
* all_styles
)
637 SAL_THROW( (Exception
) )
640 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
641 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
643 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
645 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
647 if (readBorderProps( this, aStyle
))
649 if (readFontProps( this, aStyle
))
653 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
654 all_styles
->getStyleId( aStyle
) );
659 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
660 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
661 readBoolAttr( OUSTR("HideInactiveSelection"),
662 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
663 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
664 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
665 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HardLineBreaks") ),
666 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":hard-linebreaks") ) );
667 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HScroll") ),
668 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":hscroll") ) );
669 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VScroll") ),
670 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":vscroll") ) );
671 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
672 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":maxlength") ) );
673 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
674 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":multiline") ) );
675 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
676 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
677 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
678 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
679 readLineEndFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineEndFormat") ),
680 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":lineend-format") ) );
682 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EchoChar") ) ) >>= nEcho
)
684 sal_Unicode cEcho
= (sal_Unicode
)nEcho
;
685 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":echochar") ),
686 OUString( &cEcho
, 1 ) );
690 //__________________________________________________________________________________________________
691 void ElementDescriptor::readImageControlModel( StyleBag
* all_styles
, com::sun::star::uno::Reference
< com::sun::star::frame::XModel
> const & xDocument
)
692 SAL_THROW( (Exception
) )
695 Style
aStyle( 0x1 | 0x4 );
696 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
698 if (readBorderProps( this, aStyle
))
702 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
703 all_styles
->getStyleId( aStyle
) );
708 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleImage") ),
709 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":scale-image") ) );
711 _xProps
->getPropertyValue( OUSTR("ImageURL") ) >>= sURL
;
713 if ( sURL
.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ) ) == 0 )
715 Reference
< document::XStorageBasedDocument
> xDocStorage( xDocument
, UNO_QUERY
);
717 if ( xDocStorage
.is() )
719 uno::Sequence
< Any
> aArgs( 1 );
720 aArgs
[ 0 ] <<= xDocStorage
->getDocumentStorage();
722 ::comphelper::ComponentContext
aContext( ::comphelper::getProcessServiceFactory() );
723 uno::Reference
< document::XGraphicObjectResolver
> xGraphicResolver
;
724 aContext
.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicExportHelper" ), aArgs
, xGraphicResolver
);
725 if ( xGraphicResolver
.is() )
727 sURL
= xGraphicResolver
->resolveGraphicObjectURL( sURL
);
731 if ( sURL
.getLength() > 0 )
733 addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX
":src"), sURL
);
735 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
736 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
739 //__________________________________________________________________________________________________
740 void ElementDescriptor::readFileControlModel( StyleBag
* all_styles
)
741 SAL_THROW( (Exception
) )
744 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
745 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
747 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
749 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
751 if (readBorderProps( this, aStyle
))
753 if (readFontProps( this, aStyle
))
757 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
758 all_styles
->getStyleId( aStyle
) );
763 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
764 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
765 readBoolAttr( OUSTR("HideInactiveSelection"),
766 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
767 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
768 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
769 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
770 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
773 //__________________________________________________________________________________________________
774 void ElementDescriptor::readTreeControlModel( StyleBag
* all_styles
)
775 SAL_THROW( (Exception
) )
778 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
779 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
781 if (readBorderProps( this, aStyle
))
785 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
786 all_styles
->getStyleId( aStyle
) );
791 readSelectionTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectionType") ),
792 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":selectiontype") ) );
794 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("RootDisplayed") ),
795 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":rootdisplayed") ) );
796 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowsHandles") ),
797 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":showshandles") ) );
798 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowsRootHandles") ),
799 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":showsroothandles") ) );
800 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Editable") ),
801 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":editable") ) );
802 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("InvokesStopNodeEditing") ),
803 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":invokesstopnodeediting") ) );
804 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("RowHeight") ),
805 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":rowheight") ) );
808 //__________________________________________________________________________________________________
809 void ElementDescriptor::readCurrencyFieldModel( StyleBag
* all_styles
)
810 SAL_THROW( (Exception
) )
813 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
814 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
816 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
818 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
820 if (readBorderProps( this, aStyle
))
822 if (readFontProps( this, aStyle
))
826 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
827 all_styles
->getStyleId( aStyle
) );
832 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
833 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
834 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
835 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
836 readBoolAttr( OUSTR("HideInactiveSelection"),
837 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
838 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
839 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":strict-format") ) );
840 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("CurrencySymbol") ),
841 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":currency-symbol") ) );
842 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy") ),
843 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":decimal-accuracy") ) );
844 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowThousandsSeparator") ),
845 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":thousands-separator") ) );
846 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Value") ),
847 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
848 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMin") ),
849 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
850 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMax") ),
851 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
852 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueStep") ),
853 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-step") ) );
854 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
855 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
856 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Repeat") ) ))
857 readLongAttr( OUSTR("RepeatDelay"),
858 OUSTR(XMLNS_DIALOGS_PREFIX
":repeat"), true /* force */ );
860 OUString( RTL_CONSTASCII_USTRINGPARAM("PrependCurrencySymbol") ),
861 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":prepend-symbol") ) );
862 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
863 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":enforce-format") ) );
866 //__________________________________________________________________________________________________
867 void ElementDescriptor::readDateFieldModel( StyleBag
* all_styles
)
868 SAL_THROW( (Exception
) )
871 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
872 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
874 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
876 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
878 if (readBorderProps( this, aStyle
))
880 if (readFontProps( this, aStyle
))
884 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
885 all_styles
->getStyleId( aStyle
) );
890 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
891 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
892 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
893 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
894 readBoolAttr( OUSTR("HideInactiveSelection"),
895 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
896 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
897 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":strict-format") ) );
898 readDateFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateFormat") ),
899 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":date-format") ) );
900 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateShowCentury") ),
901 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":show-century") ) );
902 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Date") ),
903 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
904 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateMin") ),
905 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
906 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateMax") ),
907 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
908 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
909 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
910 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Repeat") ) ))
911 readLongAttr( OUSTR("RepeatDelay"),
912 OUSTR(XMLNS_DIALOGS_PREFIX
":repeat"), true /* force */ );
913 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ),
914 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":dropdown") ) );
915 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
916 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":text") ) );
917 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
918 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":enforce-format") ) );
921 //__________________________________________________________________________________________________
922 void ElementDescriptor::readNumericFieldModel( StyleBag
* all_styles
)
923 SAL_THROW( (Exception
) )
926 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
927 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
929 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
931 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
933 if (readBorderProps( this, aStyle
))
935 if (readFontProps( this, aStyle
))
939 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
940 all_styles
->getStyleId( aStyle
) );
945 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
946 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
947 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
948 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
949 readBoolAttr( OUSTR("HideInactiveSelection"),
950 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
951 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
952 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":strict-format") ) );
953 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy") ),
954 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":decimal-accuracy") ) );
955 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowThousandsSeparator") ),
956 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":thousands-separator") ) );
957 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Value") ),
958 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
959 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMin") ),
960 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
961 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMax") ),
962 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
963 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueStep") ),
964 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-step") ) );
965 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
966 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
967 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Repeat") ) ))
968 readLongAttr( OUSTR("RepeatDelay"),
969 OUSTR(XMLNS_DIALOGS_PREFIX
":repeat"), true /* force */ );
970 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
971 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":enforce-format") ) );
974 //__________________________________________________________________________________________________
975 void ElementDescriptor::readTimeFieldModel( StyleBag
* all_styles
)
976 SAL_THROW( (Exception
) )
979 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
980 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
982 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
984 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
986 if (readBorderProps( this, aStyle
))
988 if (readFontProps( this, aStyle
))
992 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
993 all_styles
->getStyleId( aStyle
) );
998 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
999 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
1000 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
1001 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
1002 readBoolAttr( OUSTR("HideInactiveSelection"),
1003 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
1004 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
1005 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":strict-format") ) );
1006 readTimeFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeFormat") ),
1007 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":time-format") ) );
1008 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Time") ),
1009 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
1010 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeMin") ),
1011 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
1012 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeMax") ),
1013 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
1014 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
1015 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
1016 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Repeat") ) ))
1017 readLongAttr( OUSTR("RepeatDelay"),
1018 OUSTR(XMLNS_DIALOGS_PREFIX
":repeat"), true /* force */ );
1019 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
1020 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":text") ) );
1021 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
1022 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":enforce-format") ) );
1025 //__________________________________________________________________________________________________
1026 void ElementDescriptor::readPatternFieldModel( StyleBag
* all_styles
)
1027 SAL_THROW( (Exception
) )
1030 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1031 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
1033 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
1035 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
1036 aStyle
._set
|= 0x20;
1037 if (readBorderProps( this, aStyle
))
1039 if (readFontProps( this, aStyle
))
1043 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1044 all_styles
->getStyleId( aStyle
) );
1049 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1050 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
1051 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
1052 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
1053 readBoolAttr( OUSTR("HideInactiveSelection"),
1054 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
1055 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
1056 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":strict-format") ) );
1057 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
1058 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
1059 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
1060 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":maxlength") ) );
1061 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EditMask") ),
1062 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":edit-mask") ) );
1063 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LiteralMask") ),
1064 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":literal-mask") ) );
1067 //__________________________________________________________________________________________________
1068 void ElementDescriptor::readFormattedFieldModel( StyleBag
* all_styles
)
1069 SAL_THROW( (Exception
) )
1072 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1073 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
1075 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
1077 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
1078 aStyle
._set
|= 0x20;
1079 if (readBorderProps( this, aStyle
))
1081 if (readFontProps( this, aStyle
))
1085 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1086 all_styles
->getStyleId( aStyle
) );
1091 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1092 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
1093 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
1094 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":readonly") ) );
1095 readBoolAttr( OUSTR("HideInactiveSelection"),
1096 OUSTR(XMLNS_DIALOGS_PREFIX
":hide-inactive-selection") );
1097 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
1098 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":strict-format") ) );
1099 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
1100 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":text") ) );
1101 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
1102 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
1103 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
1104 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":maxlength") ) );
1105 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
1106 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":spin") ) );
1107 if (extract_throw
<bool>( _xProps
->getPropertyValue( OUSTR("Repeat") ) ))
1108 readLongAttr( OUSTR("RepeatDelay"),
1109 OUSTR(XMLNS_DIALOGS_PREFIX
":repeat"), true /* force */ );
1111 Any
a( readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveDefault") ) ) );
1112 switch (a
.getValueTypeClass())
1114 case TypeClass_DOUBLE
:
1116 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-default") ),
1117 OUString::valueOf( *(double const *)a
.getValue() ) );
1119 case TypeClass_STRING
:
1121 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-default") ),
1122 *(OUString
const *)a
.getValue() );
1127 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveMin") ),
1128 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
1129 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveMax") ),
1130 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
1131 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveValue") ),
1132 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
1136 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FormatKey") ) ) >>= nKey
)
1138 Reference
< util::XNumberFormatsSupplier
> xSupplier
;
1139 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FormatsSupplier") ) ) >>= xSupplier
)
1141 addNumberFormatAttr(
1142 xSupplier
->getNumberFormats()->getByKey( nKey
),
1143 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
1147 OUString( RTL_CONSTASCII_USTRINGPARAM("TreatAsNumber") ),
1148 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":treat-as-number") ) );
1149 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
1150 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":enforce-format") ) );
1154 //__________________________________________________________________________________________________
1155 void ElementDescriptor::readFixedLineModel( StyleBag
* all_styles
)
1156 SAL_THROW( (Exception
) )
1159 Style
aStyle( 0x2 | 0x8 | 0x20 );
1160 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
1162 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
1163 aStyle
._set
|= 0x20;
1164 if (readFontProps( this, aStyle
))
1168 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1169 all_styles
->getStyleId( aStyle
) );
1174 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
1175 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
1176 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
1177 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
1180 //__________________________________________________________________________________________________
1181 void ElementDescriptor::readProgressBarModel( StyleBag
* all_styles
)
1182 SAL_THROW( (Exception
) )
1185 Style
aStyle( 0x1 | 0x4 | 0x10 );
1186 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
1188 if (readBorderProps( this, aStyle
))
1190 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ) ) >>= aStyle
._descr
)
1191 aStyle
._set
|= 0x10;
1194 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1195 all_styles
->getStyleId( aStyle
) );
1200 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ),
1201 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value") ) );
1202 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMin") ),
1203 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-min") ) );
1204 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ),
1205 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":value-max") ) );
1208 //__________________________________________________________________________________________________
1209 void ElementDescriptor::readScrollBarModel( StyleBag
* all_styles
, Reference
< frame::XModel
> const & xDocument
)
1210 SAL_THROW( (Exception
) )
1213 Style
aStyle( 0x1 | 0x4 );
1214 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
1216 if (readBorderProps( this, aStyle
))
1220 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1221 all_styles
->getStyleId( aStyle
) );
1226 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
1227 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
1228 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") ),
1229 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":pageincrement") ) );
1230 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") ),
1231 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":increment") ) );
1232 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") ),
1233 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":curpos") ) );
1234 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") ),
1235 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":maxpos") ) );
1236 readLongAttr( OUSTR("ScrollValueMin"),
1237 OUSTR(XMLNS_DIALOGS_PREFIX
":minpos") );
1238 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VisibleSize") ),
1239 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":visible-size") ) );
1240 readLongAttr( OUSTR("RepeatDelay"), OUSTR(XMLNS_DIALOGS_PREFIX
":repeat") );
1241 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1242 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
1243 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LiveScroll") ),
1244 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":live-scroll") ) );
1245 readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
1246 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":symbol-color") ) );
1247 // Cell Range, Ref Cell etc.
1248 lclExportBindableAndListSourceBits( xDocument
, _xProps
, *this );
1251 //__________________________________________________________________________________________________
1252 void ElementDescriptor::readSpinButtonModel( StyleBag
* all_styles
, Reference
< frame::XModel
> const & xDocument
)
1253 SAL_THROW( (Exception
) )
1256 Style
aStyle( 0x1 | 0x4 );
1257 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
1259 if (readBorderProps( this, aStyle
))
1263 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1264 all_styles
->getStyleId( aStyle
) );
1269 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
1270 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":align") ) );
1271 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinIncrement") ),
1272 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":increment") ) );
1273 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValue") ),
1274 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":curval") ) );
1275 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") ),
1276 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":maxval") ) );
1277 readLongAttr( OUSTR("SpinValueMin"),
1278 OUSTR(XMLNS_DIALOGS_PREFIX
":minval") );
1279 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Repeat") ),
1280 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":repeat") ) );
1281 readLongAttr( OUSTR("RepeatDelay"), OUSTR(XMLNS_DIALOGS_PREFIX
":repeat-delay") );
1282 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1283 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":tabstop") ) );
1284 readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
1285 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":symbol-color") ) );
1286 // Cell Range, Ref Cell etc.
1287 lclExportBindableAndListSourceBits( xDocument
, _xProps
, *this );
1290 //__________________________________________________________________________________________________
1291 void ElementDescriptor::readDialogModel( StyleBag
* all_styles
)
1292 SAL_THROW( (Exception
) )
1295 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX
) ),
1296 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI
) ) );
1297 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_SCRIPT_PREFIX
) ),
1298 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_URI
) ) );
1301 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
1302 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle
._backgroundColor
)
1304 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle
._textColor
)
1306 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle
._textLineColor
)
1307 aStyle
._set
|= 0x20;
1308 if (readFontProps( this, aStyle
))
1312 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":style-id") ),
1313 all_styles
->getStyleId( aStyle
) );
1317 readDefaults( false );
1319 OUString( RTL_CONSTASCII_USTRINGPARAM("Closeable") ),
1320 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":closeable") ) );
1322 OUString( RTL_CONSTASCII_USTRINGPARAM("Moveable") ),
1323 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":moveable") ) );
1325 OUString( RTL_CONSTASCII_USTRINGPARAM("Sizeable") ),
1326 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":resizeable") ) );
1328 OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ),
1329 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":title") ) );
1331 Any
aDecorationAny( _xProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ) ) );
1332 bool bDecoration
= sal_False
;
1333 if ( (aDecorationAny
>>= bDecoration
) && !bDecoration
)
1334 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":withtitlebar") ),
1335 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
1337 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
1338 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX
":image-src") ) );