LCOV - code coverage report
Current view: top level - xmlscript/source/xmldlg_imexp - xmldlg_expmodels.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 827 0.0 %
Date: 2014-04-14 Functions: 0 29 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "exp_share.hxx"
      21             : 
      22             : #include <com/sun/star/form/binding/XListEntrySink.hpp>
      23             : #include <com/sun/star/form/binding/XBindableValue.hpp>
      24             : #include <com/sun/star/form/binding/XValueBinding.hpp>
      25             : #include <com/sun/star/table/CellAddress.hpp>
      26             : #include <com/sun/star/table/CellRangeAddress.hpp>
      27             : #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
      28             : #include <com/sun/star/document/XStorageBasedDocument.hpp>
      29             : #include <com/sun/star/document/XGraphicObjectResolver.hpp>
      30             : #include <com/sun/star/lang/XServiceInfo.hpp>
      31             : 
      32             : using namespace ::com::sun::star;
      33             : using namespace ::com::sun::star::uno;
      34             : 
      35             : namespace xmlscript
      36             : {
      37             : 
      38           0 : static inline bool readBorderProps(
      39             :     ElementDescriptor * element, Style & style )
      40             : {
      41           0 :     if (element->readProp( &style._border, "Border" )) {
      42           0 :         if (style._border == BORDER_SIMPLE /* simple */)
      43             :         {
      44           0 :             if (element->readProp( &style._borderColor, "BorderColor" ))
      45           0 :                 style._border = BORDER_SIMPLE_COLOR;
      46             :         }
      47           0 :         return true;
      48             :     }
      49           0 :     return false;
      50             : }
      51             : 
      52           0 : static inline bool readFontProps( ElementDescriptor * element, Style & style )
      53             : {
      54             :     bool ret = element->readProp(
      55           0 :         &style._descr, "FontDescriptor" );
      56             :     ret |= element->readProp(
      57           0 :         &style._fontEmphasisMark, "FontEmphasisMark" );
      58             :     ret |= element->readProp(
      59           0 :         &style._fontRelief, "FontRelief" );
      60           0 :     return ret;
      61             : }
      62             : 
      63           0 : void ElementDescriptor::readMultiPageModel( StyleBag * all_styles )
      64             : {
      65             :     // collect styles
      66           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
      67           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
      68           0 :         aStyle._set |= 0x1;
      69           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
      70           0 :         aStyle._set |= 0x2;
      71           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
      72           0 :         aStyle._set |= 0x20;
      73           0 :     if (readFontProps( this, aStyle ))
      74           0 :         aStyle._set |= 0x8;
      75           0 :     if (aStyle._set)
      76             :     {
      77           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id" ,  all_styles->getStyleId( aStyle ) );
      78             :     }
      79             : 
      80             :     // collect elements
      81           0 :     readDefaults();
      82           0 :     readLongAttr( "MultiPageValue", XMLNS_DIALOGS_PREFIX ":value" );
      83           0 :     Any aDecorationAny( _xProps->getPropertyValue( "Decoration" ) );
      84           0 :     bool bDecoration = true;
      85           0 :     if ( (aDecorationAny >>= bDecoration) && !bDecoration )
      86           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":withtabs", "false" );
      87             : 
      88           0 :     readEvents();
      89           0 :     uno::Reference< container::XNameContainer > xPagesContainer( _xProps, uno::UNO_QUERY );
      90           0 :     if ( xPagesContainer.is() && xPagesContainer->getElementNames().getLength() )
      91             :     {
      92           0 :         ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
      93           0 :         pElem->readBullitinBoard( all_styles );
      94           0 :         addSubElement( pElem );
      95           0 :     }
      96           0 : }
      97             : 
      98           0 : void ElementDescriptor::readFrameModel( StyleBag * all_styles )
      99             : {
     100             :     // collect styles
     101           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
     102             : 
     103           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     104           0 :         aStyle._set |= 0x2;
     105           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     106           0 :         aStyle._set |= 0x20;
     107           0 :     if (readFontProps( this, aStyle ))
     108           0 :         aStyle._set |= 0x8;
     109           0 :     if (aStyle._set)
     110             :     {
     111           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id",  all_styles->getStyleId( aStyle ) );
     112             :     }
     113             : 
     114             :     // collect elements
     115           0 :     readDefaults();
     116           0 :     OUString aTitle;
     117             : 
     118           0 :     if ( readProp( "Label" ) >>= aTitle)
     119             :     {
     120           0 :         ElementDescriptor * title = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":title", _xDocument );
     121           0 :         title->addAttribute( XMLNS_DIALOGS_PREFIX ":value", aTitle );
     122           0 :         addSubElement( title );
     123             :     }
     124             : #ifdef SCROLLABLEFRAME
     125             :     readScrollableSettings();
     126             : #endif
     127           0 :     uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY );
     128           0 :     if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() )
     129             :     {
     130           0 :         ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
     131           0 :         pElem->readBullitinBoard( all_styles );
     132           0 :         addSubElement( pElem );
     133             :     }
     134           0 :     readEvents();
     135           0 : }
     136             : 
     137           0 : void ElementDescriptor::readPageModel( StyleBag * all_styles )
     138             : {
     139             :     // collect styles
     140           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
     141           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     142           0 :         aStyle._set |= 0x1;
     143           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     144           0 :         aStyle._set |= 0x2;
     145           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     146           0 :         aStyle._set |= 0x20;
     147           0 :     if (readFontProps( this, aStyle ))
     148           0 :         aStyle._set |= 0x8;
     149           0 :     if (aStyle._set)
     150             :     {
     151           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     152             :     }
     153             : 
     154             :     // collect elements
     155           0 :     readDefaults();
     156           0 :     readStringAttr( "Title", XMLNS_DIALOGS_PREFIX ":title" );
     157           0 :     uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY );
     158           0 :     if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() )
     159             :     {
     160           0 :         ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument );
     161           0 :         pElem->readBullitinBoard( all_styles );
     162           0 :         addSubElement( pElem );
     163             :     }
     164           0 :     readEvents();
     165           0 : }
     166             : 
     167           0 : void ElementDescriptor::readButtonModel( StyleBag * all_styles )
     168             :     SAL_THROW( (Exception) )
     169             : {
     170             :     // collect styles
     171           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
     172           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     173           0 :         aStyle._set |= 0x1;
     174           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     175           0 :         aStyle._set |= 0x2;
     176           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     177           0 :         aStyle._set |= 0x20;
     178           0 :     if (readFontProps( this, aStyle ))
     179           0 :         aStyle._set |= 0x8;
     180           0 :     if (aStyle._set)
     181             :     {
     182           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     183             :     }
     184             : 
     185             :     // collect elements
     186           0 :     readDefaults();
     187           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     188           0 :     readBoolAttr( "DefaultButton", XMLNS_DIALOGS_PREFIX ":default" );
     189           0 :     readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
     190           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     191           0 :     readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
     192           0 :     readButtonTypeAttr( "PushButtonType", XMLNS_DIALOGS_PREFIX ":button-type" );
     193           0 :     readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
     194             : 
     195           0 :     readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
     196           0 :     readImageAlignAttr( "ImageAlign", XMLNS_DIALOGS_PREFIX ":image-align" );
     197             : 
     198           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
     199           0 :         readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
     200             : 
     201           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Toggle" ) ))
     202           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":toggled", "1" );
     203             : 
     204           0 :     readBoolAttr( "FocusOnClick", XMLNS_DIALOGS_PREFIX ":grab-focus" );
     205           0 :     readBoolAttr( "MultiLine",XMLNS_DIALOGS_PREFIX ":multiline" );
     206             : 
     207             :     // State
     208           0 :     sal_Int16 nState = 0;
     209           0 :     if (readProp( "State" ) >>= nState)
     210             :     {
     211           0 :         switch (nState)
     212             :         {
     213             :         case 0:
     214           0 :             addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "false" );
     215           0 :             break;
     216             :         case 1:
     217           0 :             addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "true" );
     218           0 :             break;
     219             :         default:
     220             :             OSL_FAIL( "### unexpected radio state!" );
     221           0 :             break;
     222             :         }
     223             :     }
     224             : 
     225           0 :     readEvents();
     226           0 : }
     227             : 
     228           0 : void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
     229             :     SAL_THROW( (Exception) )
     230             : {
     231             :     // collect styles
     232           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
     233           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     234           0 :         aStyle._set |= 0x1;
     235           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     236           0 :         aStyle._set |= 0x2;
     237           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     238           0 :         aStyle._set |= 0x20;
     239           0 :     if (readFontProps( this, aStyle ))
     240           0 :         aStyle._set |= 0x8;
     241           0 :     if (readProp( "VisualEffect" ) >>= aStyle._visualEffect)
     242           0 :         aStyle._set |= 0x40;
     243           0 :     if (aStyle._set)
     244             :     {
     245           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     246             :     }
     247             : 
     248             :     // collect elements
     249           0 :     readDefaults();
     250           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     251           0 :     readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
     252           0 :     readAlignAttr( "Align",  XMLNS_DIALOGS_PREFIX ":align" );
     253           0 :     readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
     254           0 :     readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
     255           0 :     readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
     256           0 :     readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
     257             : 
     258           0 :     bool bTriState = false;
     259           0 :     if ((readProp( "TriState" ) >>= bTriState) && bTriState)
     260             :     {
     261           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":tristate", "true" );
     262             :     }
     263           0 :     sal_Int16 nState = 0;
     264           0 :     if (_xProps->getPropertyValue( "State" ) >>= nState)
     265             :     {
     266           0 :         switch (nState)
     267             :         {
     268             :         case 0:
     269           0 :             addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "false" );
     270           0 :             break;
     271             :         case 1:
     272           0 :             addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "true" );
     273           0 :             break;
     274             :         case 2: // tristate=true exported, checked omitted => dont know!
     275             :             OSL_ENSURE( bTriState, "### detected tristate value, but TriState is not set!" );
     276           0 :             break;
     277             :         default:
     278             :             OSL_FAIL( "### unexpected checkbox state!" );
     279           0 :             break;
     280             :         }
     281             :     }
     282           0 :     readEvents();
     283           0 : }
     284             : 
     285           0 : void ElementDescriptor::readComboBoxModel( StyleBag * all_styles )
     286             :     SAL_THROW( (Exception) )
     287             : {
     288             :     // collect styles
     289           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     290           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     291           0 :         aStyle._set |= 0x1;
     292           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     293           0 :         aStyle._set |= 0x2;
     294           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     295           0 :         aStyle._set |= 0x20;
     296           0 :     if (readBorderProps( this, aStyle ))
     297           0 :         aStyle._set |= 0x4;
     298           0 :     if (readFontProps( this, aStyle ))
     299           0 :         aStyle._set |= 0x8;
     300           0 :     if (aStyle._set)
     301             :     {
     302           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     303             :     }
     304             : 
     305             :     // collect elements
     306           0 :     readDefaults();
     307           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     308           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":value" );
     309           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     310           0 :     readBoolAttr( "Autocomplete", XMLNS_DIALOGS_PREFIX ":autocomplete" );
     311           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     312           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     313           0 :     readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX ":spin" );
     314           0 :     readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX ":maxlength" );
     315           0 :     readShortAttr( "LineCount", XMLNS_DIALOGS_PREFIX ":linecount" );
     316             :     // Cell Range, Ref Cell etc.
     317           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
     318           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":source-cell-range" );
     319             : 
     320             :     // string item list
     321           0 :     Sequence< OUString > itemValues;
     322           0 :     if ((readProp( "StringItemList" ) >>= itemValues) &&  itemValues.getLength() > 0)
     323             :     {
     324           0 :         ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
     325             : 
     326           0 :         OUString const * pItemValues = itemValues.getConstArray();
     327           0 :         for ( sal_Int32 nPos = 0; nPos < itemValues.getLength(); ++nPos )
     328             :         {
     329           0 :             ElementDescriptor * item = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument );
     330           0 :             item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", pItemValues[ nPos ] );
     331           0 :             popup->addSubElement( item );
     332             :         }
     333             : 
     334           0 :         addSubElement( popup );
     335             :     }
     336           0 :     readEvents();
     337           0 : }
     338             : 
     339           0 : void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
     340             :     SAL_THROW( (Exception) )
     341             : {
     342             :     // collect styles
     343           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     344           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     345           0 :         aStyle._set |= 0x1;
     346           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     347           0 :         aStyle._set |= 0x2;
     348           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     349           0 :         aStyle._set |= 0x20;
     350           0 :     if (readBorderProps( this, aStyle ))
     351           0 :         aStyle._set |= 0x4;
     352           0 :     if (readFontProps( this, aStyle ))
     353           0 :         aStyle._set |= 0x8;
     354           0 :     if (aStyle._set)
     355             :     {
     356           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     357             :     }
     358             : 
     359             :     // collect elements
     360           0 :     readDefaults();
     361           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     362           0 :     readBoolAttr( "MultiSelection", XMLNS_DIALOGS_PREFIX ":multiselection" );
     363           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     364           0 :     readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX ":spin" );
     365           0 :     readShortAttr( "LineCount", XMLNS_DIALOGS_PREFIX ":linecount" );
     366           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     367           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
     368           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":source-cell-range" );
     369             :     // string item list
     370           0 :     Sequence< OUString > itemValues;
     371           0 :     if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.getLength() > 0)
     372             :     {
     373           0 :         ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument );
     374             : 
     375           0 :         OUString const * pItemValues = itemValues.getConstArray();
     376             :         sal_Int32 nPos;
     377           0 :         for ( nPos = 0; nPos < itemValues.getLength(); ++nPos )
     378             :         {
     379           0 :             ElementDescriptor * item = new ElementDescriptor(_xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menuitem", _xDocument );
     380           0 :             item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", pItemValues[ nPos ] );
     381           0 :             popup->addSubElement( item );
     382             :         }
     383             : 
     384           0 :         Sequence< sal_Int16 > selected;
     385           0 :         if (readProp( "SelectedItems" ) >>= selected)
     386             :         {
     387           0 :             sal_Int16 const * pSelected = selected.getConstArray();
     388           0 :             for ( nPos = selected.getLength(); nPos--; )
     389             :             {
     390             :                 ElementDescriptor * item = static_cast< ElementDescriptor * >(
     391           0 :                     popup->getSubElement( pSelected[ nPos ] ).get() );
     392           0 :                 item->addAttribute( XMLNS_DIALOGS_PREFIX ":selected", "true" );
     393             :             }
     394             :         }
     395             : 
     396           0 :         addSubElement( popup );
     397             :     }
     398           0 :     readEvents();
     399           0 : }
     400             : 
     401           0 : void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles  )
     402             :     SAL_THROW( (Exception) )
     403             : {
     404             :     // collect styles
     405           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
     406           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     407           0 :         aStyle._set |= 0x1;
     408           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     409           0 :         aStyle._set |= 0x2;
     410           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     411           0 :         aStyle._set |= 0x20;
     412           0 :     if (readFontProps( this, aStyle ))
     413           0 :         aStyle._set |= 0x8;
     414           0 :     if (readProp( "VisualEffect" ) >>= aStyle._visualEffect)
     415           0 :         aStyle._set |= 0x40;
     416           0 :     if (aStyle._set)
     417             :     {
     418           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id" , all_styles->getStyleId( aStyle ) );
     419             :     }
     420             : 
     421             :     // collect elements
     422           0 :     readDefaults();
     423           0 :     readBoolAttr("Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     424           0 :     readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
     425           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     426           0 :     readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
     427           0 :     readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
     428           0 :     readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
     429           0 :     readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
     430           0 :     readStringAttr( "GroupName", XMLNS_DIALOGS_PREFIX ":group-name" );
     431             : 
     432           0 :     sal_Int16 nState = 0;
     433           0 :     if (readProp( "State" ) >>= nState)
     434             :     {
     435           0 :         switch (nState)
     436             :         {
     437             :         case 0:
     438           0 :             addAttribute(XMLNS_DIALOGS_PREFIX ":checked", "false" );
     439           0 :             break;
     440             :         case 1:
     441           0 :             addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "true" );
     442           0 :             break;
     443             :         default:
     444             :             OSL_FAIL( "### unexpected radio state!" );
     445           0 :             break;
     446             :         }
     447             :     }
     448           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
     449           0 :     readEvents();
     450           0 : }
     451             : 
     452           0 : void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
     453             :     SAL_THROW( (Exception) )
     454             : {
     455             :     // collect styles
     456           0 :     Style aStyle( 0x2 | 0x8 | 0x20 );
     457           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     458           0 :         aStyle._set |= 0x2;
     459           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     460           0 :         aStyle._set |= 0x20;
     461           0 :     if (readFontProps( this, aStyle ))
     462           0 :         aStyle._set |= 0x8;
     463           0 :     if (aStyle._set)
     464             :     {
     465           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     466             :     }
     467             : 
     468             :     // collect elements
     469           0 :     readDefaults();
     470             : 
     471           0 :     OUString aTitle;
     472           0 :     if (readProp( "Label" ) >>= aTitle)
     473             :     {
     474           0 :         ElementDescriptor * title = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":title", _xDocument );
     475           0 :         title->addAttribute( XMLNS_DIALOGS_PREFIX ":value", aTitle );
     476           0 :         addSubElement( title );
     477             :     }
     478             : 
     479           0 :     readEvents();
     480           0 : }
     481             : 
     482           0 : void ElementDescriptor::readFixedTextModel( StyleBag * all_styles )
     483             :     SAL_THROW( (Exception) )
     484             : {
     485             :     // collect styles
     486           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     487           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     488           0 :         aStyle._set |= 0x1;
     489           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     490           0 :         aStyle._set |= 0x2;
     491           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     492           0 :         aStyle._set |= 0x20;
     493           0 :     if (readBorderProps( this, aStyle ))
     494           0 :         aStyle._set |= 0x4;
     495           0 :     if (readFontProps( this, aStyle ))
     496           0 :         aStyle._set |= 0x8;
     497           0 :     if (aStyle._set)
     498             :     {
     499           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     500             :     }
     501             : 
     502             :     // collect elements
     503           0 :     readDefaults();
     504           0 :     readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
     505           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     506           0 :     readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
     507           0 :     readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
     508           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     509           0 :     readBoolAttr( "NoLabel", XMLNS_DIALOGS_PREFIX ":nolabel" );
     510           0 :     readEvents();
     511           0 : }
     512             : 
     513           0 : void ElementDescriptor::readFixedHyperLinkModel( StyleBag * all_styles )
     514             :     SAL_THROW( (Exception) )
     515             : {
     516             :     // collect styles
     517           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     518           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     519           0 :         aStyle._set |= 0x1;
     520           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     521           0 :         aStyle._set |= 0x2;
     522           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     523           0 :         aStyle._set |= 0x20;
     524           0 :     if (readBorderProps( this, aStyle ))
     525           0 :         aStyle._set |= 0x4;
     526           0 :     if (readFontProps( this, aStyle ))
     527           0 :         aStyle._set |= 0x8;
     528           0 :     if (aStyle._set)
     529             :     {
     530           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     531             :     }
     532             : 
     533             :     // collect elements
     534           0 :     readDefaults();
     535           0 :     readStringAttr( "Label",XMLNS_DIALOGS_PREFIX ":value" );
     536           0 :     readStringAttr( "URL", XMLNS_DIALOGS_PREFIX ":url" );
     537           0 :     readStringAttr( "Description", XMLNS_DIALOGS_PREFIX ":description" );
     538           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     539           0 :     readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX ":valign" );
     540           0 :     readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
     541           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     542           0 :     readBoolAttr( "NoLabel", XMLNS_DIALOGS_PREFIX ":nolabel" );
     543           0 :     readEvents();
     544           0 : }
     545             : 
     546           0 : void ElementDescriptor::readEditModel( StyleBag * all_styles )
     547             :     SAL_THROW( (Exception) )
     548             : {
     549             :     // collect styles
     550           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     551           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     552           0 :         aStyle._set |= 0x1;
     553           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     554           0 :         aStyle._set |= 0x2;
     555           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     556           0 :         aStyle._set |= 0x20;
     557           0 :     if (readBorderProps( this, aStyle ))
     558           0 :         aStyle._set |= 0x4;
     559           0 :     if (readFontProps( this, aStyle ))
     560           0 :         aStyle._set |= 0x8;
     561           0 :     if (aStyle._set)
     562             :     {
     563           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     564             :     }
     565             : 
     566             :     // collect elements
     567           0 :     readDefaults();
     568           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     569           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     570           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     571           0 :     readBoolAttr( "HardLineBreaks", XMLNS_DIALOGS_PREFIX ":hard-linebreaks" );
     572           0 :     readBoolAttr( "HScroll", XMLNS_DIALOGS_PREFIX ":hscroll" );
     573           0 :     readBoolAttr( "VScroll", XMLNS_DIALOGS_PREFIX ":vscroll" );
     574           0 :     readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX ":maxlength" );
     575           0 :     readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
     576           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     577           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":value" );
     578           0 :     readLineEndFormatAttr( "LineEndFormat", XMLNS_DIALOGS_PREFIX ":lineend-format" );
     579           0 :     sal_Int16 nEcho = 0;
     580           0 :     if (readProp( "EchoChar" ) >>= nEcho)
     581             :     {
     582           0 :         sal_Unicode cEcho = (sal_Unicode)nEcho;
     583           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":echochar", OUString( &cEcho, 1 ) );
     584             :     }
     585           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
     586           0 :     readEvents();
     587           0 : }
     588             : 
     589           0 : void ElementDescriptor::readImageControlModel( StyleBag * all_styles )
     590             :     SAL_THROW( (Exception) )
     591             : {
     592             :     // collect styles
     593           0 :     Style aStyle( 0x1 | 0x4 );
     594           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     595           0 :         aStyle._set |= 0x1;
     596           0 :     if (readBorderProps( this, aStyle ))
     597           0 :         aStyle._set |= 0x4;
     598           0 :     if (aStyle._set)
     599             :     {
     600           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     601             :     }
     602             : 
     603             :     // collect elements
     604           0 :     readDefaults();
     605           0 :     readBoolAttr( "ScaleImage", XMLNS_DIALOGS_PREFIX ":scale-image" );
     606           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     607           0 :     readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":src" );
     608           0 :     readEvents();
     609           0 : }
     610             : 
     611           0 : void ElementDescriptor::readFileControlModel( StyleBag * all_styles )
     612             :     SAL_THROW( (Exception) )
     613             : {
     614             :     // collect styles
     615           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     616           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     617           0 :         aStyle._set |= 0x1;
     618           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     619           0 :         aStyle._set |= 0x2;
     620           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     621           0 :         aStyle._set |= 0x20;
     622           0 :     if (readBorderProps( this, aStyle ))
     623           0 :         aStyle._set |= 0x4;
     624           0 :     if (readFontProps( this, aStyle ))
     625           0 :         aStyle._set |= 0x8;
     626           0 :     if (aStyle._set)
     627             :     {
     628           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     629             :     }
     630             : 
     631             :     // collect elements
     632           0 :     readDefaults();
     633           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     634           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     635           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":value" );
     636           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     637           0 :     readEvents();
     638           0 : }
     639             : 
     640           0 : void ElementDescriptor::readTreeControlModel( StyleBag * all_styles )
     641             :     SAL_THROW( (Exception) )
     642             : {
     643             :     // collect styles
     644           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     645           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     646           0 :         aStyle._set |= 0x1;
     647           0 :     if (readBorderProps( this, aStyle ))
     648           0 :         aStyle._set |= 0x4;
     649           0 :     if (aStyle._set)
     650             :     {
     651           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     652             :     }
     653             : 
     654             :     // collect elements
     655           0 :     readDefaults();
     656           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     657           0 :     readSelectionTypeAttr( "SelectionType", XMLNS_DIALOGS_PREFIX ":selectiontype" );
     658             : 
     659           0 :     readBoolAttr( "RootDisplayed", XMLNS_DIALOGS_PREFIX ":rootdisplayed" );
     660           0 :     readBoolAttr( "ShowsHandles", XMLNS_DIALOGS_PREFIX ":showshandles" );
     661           0 :     readBoolAttr( "ShowsRootHandles", XMLNS_DIALOGS_PREFIX ":showsroothandles" );
     662           0 :     readBoolAttr( "Editable", XMLNS_DIALOGS_PREFIX ":editable" );
     663           0 :     readBoolAttr( "InvokesStopNodeEditing", XMLNS_DIALOGS_PREFIX ":invokesstopnodeediting" );
     664           0 :     readLongAttr( "RowHeight", XMLNS_DIALOGS_PREFIX ":rowheight" );
     665           0 :     readEvents();
     666           0 : }
     667             : 
     668           0 : void ElementDescriptor::readCurrencyFieldModel( StyleBag * all_styles )
     669             :     SAL_THROW( (Exception) )
     670             : {
     671             :     // collect styles
     672           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     673           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     674           0 :         aStyle._set |= 0x1;
     675           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     676           0 :         aStyle._set |= 0x2;
     677           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     678           0 :         aStyle._set |= 0x20;
     679           0 :     if (readBorderProps( this, aStyle ))
     680           0 :         aStyle._set |= 0x4;
     681           0 :     if (readFontProps( this, aStyle ))
     682           0 :         aStyle._set |= 0x8;
     683           0 :     if (aStyle._set)
     684             :     {
     685           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     686             :     }
     687             : 
     688             :     // collect elements
     689           0 :     readDefaults();
     690           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     691           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     692           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     693           0 :     readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX ":strict-format" );
     694           0 :     readStringAttr( "CurrencySymbol", XMLNS_DIALOGS_PREFIX ":currency-symbol" );
     695           0 :     readShortAttr( "DecimalAccuracy", XMLNS_DIALOGS_PREFIX ":decimal-accuracy" );
     696           0 :     readBoolAttr( "ShowThousandsSeparator", XMLNS_DIALOGS_PREFIX ":thousands-separator" );
     697           0 :     readDoubleAttr( "Value", XMLNS_DIALOGS_PREFIX ":value" );
     698           0 :     readDoubleAttr( "ValueMin", XMLNS_DIALOGS_PREFIX ":value-min" );
     699           0 :     readDoubleAttr(  "ValueMax", XMLNS_DIALOGS_PREFIX ":value-max" );
     700           0 :     readDoubleAttr( "ValueStep", XMLNS_DIALOGS_PREFIX ":value-step" );
     701           0 :     readBoolAttr(  "Spin", XMLNS_DIALOGS_PREFIX ":spin" );
     702           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
     703           0 :         readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
     704           0 :     readBoolAttr("PrependCurrencySymbol", XMLNS_DIALOGS_PREFIX ":prepend-symbol" );
     705           0 :     readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX ":enforce-format" );
     706           0 :     readEvents();
     707           0 : }
     708             : 
     709           0 : void ElementDescriptor::readDateFieldModel( StyleBag * all_styles )
     710             :     SAL_THROW( (Exception) )
     711             : {
     712             :     // collect styles
     713           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     714           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     715           0 :         aStyle._set |= 0x1;
     716           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     717           0 :         aStyle._set |= 0x2;
     718           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     719           0 :         aStyle._set |= 0x20;
     720           0 :     if (readBorderProps( this, aStyle ))
     721           0 :         aStyle._set |= 0x4;
     722           0 :     if (readFontProps( this, aStyle ))
     723           0 :         aStyle._set |= 0x8;
     724           0 :     if (aStyle._set)
     725             :     {
     726           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     727             :     }
     728             : 
     729             :     // collect elements
     730           0 :     readDefaults();
     731           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     732           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     733           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     734           0 :     readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX ":strict-format" );
     735           0 :     readDateFormatAttr( "DateFormat", XMLNS_DIALOGS_PREFIX ":date-format" );
     736           0 :     readBoolAttr( "DateShowCentury", XMLNS_DIALOGS_PREFIX ":show-century" );
     737           0 :     readDateAttr( "Date", XMLNS_DIALOGS_PREFIX ":value" );
     738           0 :     readDateAttr( "DateMin", XMLNS_DIALOGS_PREFIX ":value-min" );
     739           0 :     readDateAttr( "DateMax", XMLNS_DIALOGS_PREFIX ":value-max" );
     740           0 :     readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX ":spin" );
     741           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
     742           0 :         readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
     743           0 :     readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX ":dropdown" );
     744           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":text" );
     745           0 :     readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX ":enforce-format" );
     746           0 :     readEvents();
     747           0 : }
     748             : 
     749           0 : void ElementDescriptor::readNumericFieldModel( StyleBag * all_styles )
     750             :     SAL_THROW( (Exception) )
     751             : {
     752             :     // collect styles
     753           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     754           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     755           0 :         aStyle._set |= 0x1;
     756           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     757           0 :         aStyle._set |= 0x2;
     758           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     759           0 :         aStyle._set |= 0x20;
     760           0 :     if (readBorderProps( this, aStyle ))
     761           0 :         aStyle._set |= 0x4;
     762           0 :     if (readFontProps( this, aStyle ))
     763           0 :         aStyle._set |= 0x8;
     764           0 :     if (aStyle._set)
     765             :     {
     766           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     767             :     }
     768             : 
     769             :     // collect elements
     770           0 :     readDefaults();
     771           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     772           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     773           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     774           0 :     readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX ":strict-format" );
     775           0 :     readShortAttr( "DecimalAccuracy", XMLNS_DIALOGS_PREFIX ":decimal-accuracy" );
     776           0 :     readBoolAttr( "ShowThousandsSeparator", XMLNS_DIALOGS_PREFIX ":thousands-separator" );
     777           0 :     readDoubleAttr( "Value", XMLNS_DIALOGS_PREFIX ":value" );
     778           0 :     readDoubleAttr( "ValueMin", XMLNS_DIALOGS_PREFIX ":value-min" );
     779           0 :     readDoubleAttr( "ValueMax", XMLNS_DIALOGS_PREFIX ":value-max" );
     780           0 :     readDoubleAttr( "ValueStep", XMLNS_DIALOGS_PREFIX ":value-step" );
     781           0 :     readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX ":spin" );
     782           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
     783           0 :         readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
     784           0 :     readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX ":enforce-format" );
     785           0 :     readEvents();
     786           0 : }
     787             : 
     788           0 : void ElementDescriptor::readTimeFieldModel( StyleBag * all_styles )
     789             :     SAL_THROW( (Exception) )
     790             : {
     791             :     // collect styles
     792           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     793           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     794           0 :         aStyle._set |= 0x1;
     795           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     796           0 :         aStyle._set |= 0x2;
     797           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     798           0 :         aStyle._set |= 0x20;
     799           0 :     if (readBorderProps( this, aStyle ))
     800           0 :         aStyle._set |= 0x4;
     801           0 :     if (readFontProps( this, aStyle ))
     802           0 :         aStyle._set |= 0x8;
     803           0 :     if (aStyle._set)
     804             :     {
     805           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     806             :     }
     807             : 
     808             :     // collect elements
     809           0 :     readDefaults();
     810           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop");
     811           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     812           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     813           0 :     readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX ":strict-format" );
     814           0 :     readTimeFormatAttr( "TimeFormat", XMLNS_DIALOGS_PREFIX ":time-format" );
     815           0 :     readTimeAttr( "Time", XMLNS_DIALOGS_PREFIX ":value" );
     816           0 :     readTimeAttr( "TimeMin", XMLNS_DIALOGS_PREFIX ":value-min" );
     817           0 :     readTimeAttr( "TimeMax", XMLNS_DIALOGS_PREFIX ":value-max" );
     818           0 :     readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX ":spin" );
     819           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
     820           0 :         readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
     821           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":text" );
     822           0 :     readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX ":enforce-format" );
     823           0 :     readEvents();
     824           0 : }
     825             : 
     826           0 : void ElementDescriptor::readPatternFieldModel( StyleBag * all_styles )
     827             :     SAL_THROW( (Exception) )
     828             : {
     829             :     // collect styles
     830           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     831           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     832           0 :         aStyle._set |= 0x1;
     833           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     834           0 :         aStyle._set |= 0x2;
     835           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     836           0 :         aStyle._set |= 0x20;
     837           0 :     if (readBorderProps( this, aStyle ))
     838           0 :         aStyle._set |= 0x4;
     839           0 :     if (readFontProps( this, aStyle ))
     840           0 :         aStyle._set |= 0x8;
     841           0 :     if (aStyle._set)
     842             :     {
     843           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     844             :     }
     845             : 
     846             :     // collect elements
     847           0 :     readDefaults();
     848           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     849           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     850           0 :     readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     851           0 :     readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX ":strict-format" );
     852           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":value" );
     853           0 :     readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX ":maxlength" );
     854           0 :     readStringAttr( "EditMask", XMLNS_DIALOGS_PREFIX ":edit-mask" );
     855           0 :     readStringAttr( "LiteralMask", XMLNS_DIALOGS_PREFIX ":literal-mask" );
     856           0 :     readEvents();
     857           0 : }
     858             : 
     859           0 : void ElementDescriptor::readFormattedFieldModel( StyleBag * all_styles )
     860             :     SAL_THROW( (Exception) )
     861             : {
     862             :     // collect styles
     863           0 :     Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
     864           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     865           0 :         aStyle._set |= 0x1;
     866           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     867           0 :         aStyle._set |= 0x2;
     868           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     869           0 :         aStyle._set |= 0x20;
     870           0 :     if (readBorderProps( this, aStyle ))
     871           0 :         aStyle._set |= 0x4;
     872           0 :     if (readFontProps( this, aStyle ))
     873           0 :         aStyle._set |= 0x8;
     874           0 :     if (aStyle._set)
     875             :     {
     876           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     877             :     }
     878             : 
     879             :     // collect elements
     880           0 :     readDefaults();
     881           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     882           0 :     readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX ":readonly" );
     883           0 :     readBoolAttr( "HideInactiveSelection",XMLNS_DIALOGS_PREFIX ":hide-inactive-selection" );
     884           0 :     readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX ":strict-format" );
     885           0 :     readStringAttr( "Text", XMLNS_DIALOGS_PREFIX ":text" );
     886           0 :     readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX ":align" );
     887           0 :     readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX ":maxlength" );
     888           0 :     readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX ":spin" );
     889           0 :     if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
     890           0 :         readLongAttr( "RepeatDelay",XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
     891             : 
     892           0 :     Any a( readProp( "EffectiveDefault" ) );
     893           0 :     switch (a.getValueTypeClass())
     894             :     {
     895             :     case TypeClass_DOUBLE:
     896           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", OUString::number( *(double const *)a.getValue() ) );
     897           0 :         break;
     898             :     case TypeClass_STRING:
     899           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", *(OUString const *)a.getValue() );
     900           0 :         break;
     901             :     default:
     902           0 :         break;
     903             :     }
     904           0 :     readDoubleAttr( "EffectiveMin", XMLNS_DIALOGS_PREFIX ":value-min" );
     905           0 :     readDoubleAttr( "EffectiveMax", XMLNS_DIALOGS_PREFIX ":value-max" );
     906           0 :     readDoubleAttr( "EffectiveValue", XMLNS_DIALOGS_PREFIX ":value" );
     907             : 
     908             :     // format spec
     909           0 :     sal_Int32 nKey = 0;
     910           0 :     if (readProp( "FormatKey" ) >>= nKey)
     911             :     {
     912           0 :         Reference< util::XNumberFormatsSupplier > xSupplier;
     913           0 :         if (readProp( "FormatsSupplier" ) >>= xSupplier)
     914             :         {
     915             :             addNumberFormatAttr(
     916           0 :                 xSupplier->getNumberFormats()->getByKey( nKey ) );
     917           0 :         }
     918             :     }
     919           0 :     readBoolAttr( "TreatAsNumber", XMLNS_DIALOGS_PREFIX ":treat-as-number" );
     920           0 :     readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX ":enforce-format" );
     921             : 
     922           0 :     readEvents();
     923           0 : }
     924             : 
     925           0 : void ElementDescriptor::readSpinButtonModel( StyleBag * all_styles )
     926             :     SAL_THROW( (Exception) )
     927             : {
     928             :     // collect styles
     929           0 :     Style aStyle( 0x1 | 0x4 );
     930           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     931           0 :         aStyle._set |= 0x1;
     932           0 :     if (readBorderProps( this, aStyle ))
     933           0 :         aStyle._set |= 0x4;
     934           0 :     if (aStyle._set)
     935             :     {
     936           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     937             :     }
     938             : 
     939             :     // collect elements
     940           0 :     readDefaults();
     941           0 :     readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX ":align" );
     942           0 :     readLongAttr( "SpinIncrement", XMLNS_DIALOGS_PREFIX ":increment" );
     943           0 :     readLongAttr( "SpinValue", XMLNS_DIALOGS_PREFIX ":curval" );
     944           0 :     readLongAttr( "SpinValueMax", XMLNS_DIALOGS_PREFIX ":maxval" );
     945           0 :     readLongAttr( "SpinValueMin", XMLNS_DIALOGS_PREFIX ":minval" );
     946           0 :     readLongAttr( "Repeat", XMLNS_DIALOGS_PREFIX ":repeat" );
     947           0 :     readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat-delay" );
     948           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
     949           0 :     readHexLongAttr( "SymbolColor", XMLNS_DIALOGS_PREFIX ":symbol-color" );
     950           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
     951           0 :     readEvents();
     952           0 : }
     953             : 
     954           0 : void ElementDescriptor::readFixedLineModel( StyleBag * all_styles )
     955             :     SAL_THROW( (Exception) )
     956             : {
     957             :     // collect styles
     958           0 :     Style aStyle( 0x2 | 0x8 | 0x20 );
     959           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
     960           0 :         aStyle._set |= 0x2;
     961           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
     962           0 :         aStyle._set |= 0x20;
     963           0 :     if (readFontProps( this, aStyle ))
     964           0 :         aStyle._set |= 0x8;
     965           0 :     if (aStyle._set)
     966             :     {
     967           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     968             :     }
     969             : 
     970             :     // collect elements
     971           0 :     readDefaults();
     972           0 :     readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
     973           0 :     readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX ":align" );
     974           0 :     readEvents();
     975           0 : }
     976           0 : void ElementDescriptor::readProgressBarModel( StyleBag * all_styles )
     977             :     SAL_THROW( (Exception) )
     978             : {
     979             :     // collect styles
     980           0 :     Style aStyle( 0x1 | 0x4 | 0x10 );
     981           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
     982           0 :         aStyle._set |= 0x1;
     983           0 :     if (readBorderProps( this, aStyle ))
     984           0 :         aStyle._set |= 0x4;
     985           0 :     if (readProp( "FillColor" ) >>= aStyle._descr)
     986           0 :         aStyle._set |= 0x10;
     987           0 :     if (aStyle._set)
     988             :     {
     989           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
     990             :     }
     991             : 
     992             :     // collect elements
     993           0 :     readDefaults();
     994           0 :     readLongAttr( "ProgressValue", XMLNS_DIALOGS_PREFIX ":value" );
     995           0 :     readLongAttr( "ProgressValueMin", XMLNS_DIALOGS_PREFIX ":value-min" );
     996           0 :     readLongAttr( "ProgressValueMax", XMLNS_DIALOGS_PREFIX ":value-max" );
     997           0 :     readEvents();
     998           0 : }
     999           0 : void ElementDescriptor::readScrollBarModel( StyleBag * all_styles )
    1000             :     SAL_THROW( (Exception) )
    1001             : {
    1002             :     // collect styles
    1003           0 :     Style aStyle( 0x1 | 0x4 );
    1004           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
    1005           0 :         aStyle._set |= 0x1;
    1006           0 :     if (readBorderProps( this, aStyle ))
    1007           0 :         aStyle._set |= 0x4;
    1008           0 :     if (aStyle._set)
    1009             :     {
    1010           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
    1011             :     }
    1012             : 
    1013             :     // collect elements
    1014           0 :     readDefaults();
    1015           0 :     readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX ":align" );
    1016           0 :     readLongAttr( "BlockIncrement", XMLNS_DIALOGS_PREFIX ":pageincrement" );
    1017           0 :     readLongAttr( "LineIncrement", XMLNS_DIALOGS_PREFIX ":increment" );
    1018           0 :     readLongAttr( "ScrollValue", XMLNS_DIALOGS_PREFIX ":curpos" );
    1019           0 :     readLongAttr( "ScrollValueMax", XMLNS_DIALOGS_PREFIX ":maxpos" );
    1020           0 :     readLongAttr( "ScrollValueMin", XMLNS_DIALOGS_PREFIX ":minpos" );
    1021           0 :     readLongAttr( "VisibleSize", XMLNS_DIALOGS_PREFIX ":visible-size" );
    1022           0 :     readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat" );
    1023           0 :     readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
    1024           0 :     readBoolAttr( "LiveScroll", XMLNS_DIALOGS_PREFIX ":live-scroll" );
    1025           0 :     readHexLongAttr( "SymbolColor", XMLNS_DIALOGS_PREFIX ":symbol-color" );
    1026           0 :     readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
    1027           0 :     readEvents();
    1028           0 : }
    1029           0 : void ElementDescriptor::readDialogModel( StyleBag * all_styles )
    1030             :     SAL_THROW( (Exception) )
    1031             : {
    1032             :     // collect elements
    1033           0 :     addAttribute( "xmlns:" XMLNS_DIALOGS_PREFIX, XMLNS_DIALOGS_URI );
    1034           0 :     addAttribute( "xmlns:" XMLNS_SCRIPT_PREFIX, XMLNS_SCRIPT_URI );
    1035             : 
    1036             :     // collect styles
    1037           0 :     Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
    1038           0 :     if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
    1039           0 :         aStyle._set |= 0x1;
    1040           0 :     if (readProp( "TextColor" ) >>= aStyle._textColor)
    1041           0 :         aStyle._set |= 0x2;
    1042           0 :     if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
    1043           0 :         aStyle._set |= 0x20;
    1044           0 :     if (readFontProps( this, aStyle ))
    1045           0 :         aStyle._set |= 0x8;
    1046           0 :     if (aStyle._set)
    1047             :     {
    1048           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
    1049             :     }
    1050             : 
    1051             :     // collect elements
    1052           0 :     readDefaults( false, false );
    1053           0 :     readBoolAttr("Closeable", XMLNS_DIALOGS_PREFIX ":closeable" );
    1054           0 :     readBoolAttr( "Moveable", XMLNS_DIALOGS_PREFIX ":moveable" );
    1055           0 :     readBoolAttr( "Sizeable", XMLNS_DIALOGS_PREFIX ":resizeable" );
    1056           0 :     readStringAttr( "Title", XMLNS_DIALOGS_PREFIX ":title" );
    1057             : 
    1058           0 :     readScrollableSettings();
    1059           0 :     Any aDecorationAny( _xProps->getPropertyValue( "Decoration" ) );
    1060           0 :     bool bDecoration = false;
    1061           0 :     if ( (aDecorationAny >>= bDecoration) && !bDecoration )
    1062           0 :         addAttribute( XMLNS_DIALOGS_PREFIX ":withtitlebar", "false" );
    1063           0 :     readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
    1064           0 :     readEvents();
    1065           0 : }
    1066             : 
    1067           0 : void ElementDescriptor::readBullitinBoard( StyleBag * all_styles )
    1068             :     SAL_THROW( (Exception) )
    1069             : {
    1070             :     // collect elements
    1071           0 :     ::std::vector< ElementDescriptor* > all_elements;
    1072             :     // read out all props
    1073           0 :     Reference<  container::XNameContainer > xDialogModel( _xProps, UNO_QUERY );
    1074           0 :     if ( !xDialogModel.is() )
    1075           0 :         return; // #TODO throw???
    1076           0 :     Sequence< OUString > aElements( xDialogModel->getElementNames() );
    1077           0 :     OUString const * pElements = aElements.getConstArray();
    1078             : 
    1079           0 :     ElementDescriptor * pRadioGroup = 0;
    1080             : 
    1081             :     sal_Int32 nPos;
    1082           0 :     for ( nPos = 0; nPos < aElements.getLength(); ++nPos )
    1083             :     {
    1084           0 :         Any aControlModel( xDialogModel->getByName( pElements[ nPos ] ) );
    1085           0 :         Reference< beans::XPropertySet > xProps;
    1086           0 :         OSL_VERIFY( aControlModel >>= xProps );
    1087           0 :         if (! xProps.is())
    1088           0 :             continue;
    1089           0 :         Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY );
    1090             :         OSL_ENSURE( xPropState.is(), "no XPropertyState!" );
    1091           0 :         if (! xPropState.is())
    1092           0 :             continue;
    1093           0 :         Reference< lang::XServiceInfo > xServiceInfo( xProps, UNO_QUERY );
    1094             :         OSL_ENSURE( xServiceInfo.is(), "no XServiceInfo!" );
    1095           0 :         if (! xServiceInfo.is())
    1096           0 :             continue;
    1097             : 
    1098           0 :         ElementDescriptor * pElem = 0;
    1099             : 
    1100             :         // group up radio buttons
    1101           0 :         if ( xServiceInfo->supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) )
    1102             :         {
    1103           0 :             if (! pRadioGroup) // open radiogroup
    1104             :             {
    1105           0 :                 pRadioGroup = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":radiogroup", _xDocument );
    1106           0 :                 all_elements.push_back( pRadioGroup );
    1107             :             }
    1108             : 
    1109           0 :             pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":radio", _xDocument );
    1110           0 :             pElem->readRadioButtonModel( all_styles );
    1111           0 :             pRadioGroup->addSubElement( pElem );
    1112             :         }
    1113             :         else // no radio
    1114             :         {
    1115           0 :             pRadioGroup = 0; // close radiogroup
    1116             : 
    1117           0 :             if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlButtonModel" ) )
    1118             :             {
    1119           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":button", _xDocument );
    1120           0 :                 pElem->readButtonModel( all_styles );
    1121             :             }
    1122           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) )
    1123             :             {
    1124           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":checkbox", _xDocument );
    1125           0 :                 pElem->readCheckBoxModel( all_styles );
    1126             :             }
    1127           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlComboBoxModel" ) )
    1128             :             {
    1129           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":combobox", _xDocument );
    1130           0 :                 pElem->readComboBoxModel( all_styles );
    1131             :             }
    1132           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlListBoxModel" ) )
    1133             :             {
    1134           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":menulist", _xDocument );
    1135           0 :                 pElem->readListBoxModel( all_styles );
    1136             :             }
    1137           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ) )
    1138             :             {
    1139           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":titledbox", _xDocument );
    1140           0 :                 pElem->readGroupBoxModel( all_styles );
    1141             :             }
    1142           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoMultiPageModel" ) )
    1143             :             {
    1144           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":multipage", _xDocument );
    1145           0 :                 pElem->readMultiPageModel( all_styles );
    1146             :             }
    1147           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoFrameModel" ) )
    1148             :             {
    1149           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":frame", _xDocument );
    1150           0 :                 pElem->readFrameModel( all_styles );
    1151             :             }
    1152           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
    1153             :             {
    1154           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":page", _xDocument );
    1155           0 :                 pElem->readPageModel( all_styles );
    1156             :             }
    1157           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ) )
    1158             :             {
    1159           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":text", _xDocument );
    1160           0 :                 pElem->readFixedTextModel( all_styles );
    1161             :             }
    1162           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlEditModel" ) )
    1163             :             {
    1164           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":textfield", _xDocument );
    1165           0 :                 pElem->readEditModel( all_styles );
    1166             :             }
    1167             :             // FixedHyperLink
    1168           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) )
    1169             :             {
    1170           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":linklabel", _xDocument );
    1171           0 :                 pElem->readFixedHyperLinkModel( all_styles );
    1172             :             }
    1173           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlImageControlModel" ) )
    1174             :             {
    1175           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":img", _xDocument );
    1176           0 :                 pElem->readImageControlModel( all_styles );
    1177             :             }
    1178           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFileControlModel" ) )
    1179             :             {
    1180           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":filecontrol", _xDocument );
    1181           0 :                 pElem->readFileControlModel( all_styles );
    1182             :             }
    1183           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.tree.TreeControlModel" ) )
    1184             :             {
    1185           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":treecontrol", _xDocument );
    1186           0 :                 pElem->readTreeControlModel( all_styles );
    1187             :             }
    1188           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" ) )
    1189             :             {
    1190           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":currencyfield", _xDocument );
    1191           0 :                 pElem->readCurrencyFieldModel( all_styles );
    1192             :             }
    1193           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlDateFieldModel" ) )
    1194             :             {
    1195           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":datefield", _xDocument );
    1196           0 :                 pElem->readDateFieldModel( all_styles );
    1197             :             }
    1198           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" ) )
    1199             :             {
    1200           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":numericfield", _xDocument );
    1201           0 :                 pElem->readNumericFieldModel( all_styles );
    1202             :             }
    1203           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" ) )
    1204             :             {
    1205           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":timefield", _xDocument);
    1206           0 :                 pElem->readTimeFieldModel( all_styles );
    1207             :             }
    1208           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" ) )
    1209             :             {
    1210           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":patternfield", _xDocument );
    1211           0 :                 pElem->readPatternFieldModel( all_styles );
    1212             :             }
    1213           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ) )
    1214             :             {
    1215           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":formattedfield", _xDocument );
    1216           0 :                 pElem->readFormattedFieldModel( all_styles );
    1217             :             }
    1218           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFixedLineModel" ) )
    1219             :             {
    1220           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":fixedline", _xDocument );
    1221           0 :                 pElem->readFixedLineModel( all_styles );
    1222             :             }
    1223           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlScrollBarModel" ) )
    1224             :             {
    1225           0 :                 pElem = new ElementDescriptor(xProps, xPropState, XMLNS_DIALOGS_PREFIX ":scrollbar", _xDocument );
    1226           0 :                 pElem->readScrollBarModel( all_styles );
    1227             :             }
    1228           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlSpinButtonModel" ) )
    1229             :             {
    1230           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":spinbutton", _xDocument );
    1231           0 :                 pElem->readSpinButtonModel( all_styles );
    1232             :              }
    1233           0 :             else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlProgressBarModel" ) )
    1234             :             {
    1235           0 :                 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":progressmeter", _xDocument );
    1236           0 :                 pElem->readProgressBarModel( all_styles );
    1237             :             }
    1238             : 
    1239           0 :             if (pElem)
    1240             :             {
    1241           0 :                 all_elements.push_back( pElem );
    1242             :             }
    1243             :             else
    1244             :             {
    1245             :                 OSL_FAIL( "unknown control type!" );
    1246           0 :                 continue;
    1247             :             }
    1248             :         }
    1249           0 :     }
    1250           0 :     if (! all_elements.empty())
    1251             :     {
    1252           0 :         for ( std::size_t n = 0; n < all_elements.size(); ++n )
    1253             :         {
    1254           0 :             addSubElement( all_elements[ n ] );
    1255             :         }
    1256           0 :     }
    1257             : }
    1258             : 
    1259             : }
    1260             : 
    1261             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10