LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/forms/source/component - navigationbar.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 201 224 89.7 %
Date: 2013-07-09 Functions: 23 24 95.8 %
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 "navigationbar.hxx"
      21             : #include "frm_module.hxx"
      22             : 
      23             : #include <com/sun/star/text/WritingMode2.hpp>
      24             : 
      25             : #include <comphelper/streamsection.hxx>
      26             : #include <comphelper/basicio.hxx>
      27             : #include <comphelper/processfactory.hxx>
      28             : 
      29             : //--------------------------------------------------------------------------
      30          15 : extern "C" void SAL_CALL createRegistryInfo_ONavigationBarModel()
      31             : {
      32          15 :     static ::frm::OMultiInstanceAutoRegistration< ::frm::ONavigationBarModel > aAutoRegistration;
      33          15 : }
      34             : 
      35             : //.........................................................................
      36             : namespace frm
      37             : {
      38             : //.........................................................................
      39             : 
      40             :     using namespace ::com::sun::star::uno;
      41             :     using namespace ::com::sun::star::beans;
      42             :     using namespace ::com::sun::star::form;
      43             :     using namespace ::com::sun::star::awt;
      44             :     using namespace ::com::sun::star::io;
      45             :     using namespace ::com::sun::star::lang;
      46             :     using namespace ::com::sun::star::util;
      47             :     using namespace ::com::sun::star::container;
      48             :     using namespace ::comphelper;
      49             : 
      50             :     namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
      51             : 
      52             : #define REGISTER_VOID_PROP( prop, memberAny, type ) \
      53             :     registerMayBeVoidProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT | PropertyAttribute::MAYBEVOID, \
      54             :         &memberAny, ::getCppuType( static_cast< type* >( NULL ) ) );
      55             : 
      56             :     //==================================================================
      57             :     // ONavigationBarModel
      58             :     //==================================================================
      59             :     DBG_NAME( ONavigationBarModel )
      60             :     //------------------------------------------------------------------
      61          10 :     ONavigationBarModel::ONavigationBarModel( const Reference< XComponentContext >& _rxFactory )
      62             :         :OControlModel( _rxFactory, OUString() )
      63          10 :         ,FontControlModel( true )
      64             :     {
      65             :         DBG_CTOR( ONavigationBarModel, NULL );
      66             : 
      67          10 :         m_nClassId = FormComponentType::NAVIGATIONBAR;
      68          10 :         implInitPropertyContainer();
      69             : 
      70          10 :         getPropertyDefaultByHandle( PROPERTY_ID_DEFAULTCONTROL          ) >>= m_sDefaultControl;
      71          10 :         getPropertyDefaultByHandle( PROPERTY_ID_ICONSIZE                ) >>= m_nIconSize;
      72          10 :         getPropertyDefaultByHandle( PROPERTY_ID_BORDER                  ) >>= m_nBorder;
      73          10 :         getPropertyDefaultByHandle( PROPERTY_ID_DELAY                   ) >>= m_nDelay;
      74          10 :         getPropertyDefaultByHandle( PROPERTY_ID_ENABLED                 ) >>= m_bEnabled;
      75          10 :         getPropertyDefaultByHandle( PROPERTY_ID_ENABLEVISIBLE           ) >>= m_bEnableVisible;
      76          10 :         getPropertyDefaultByHandle( PROPERTY_ID_SHOW_POSITION           ) >>= m_bShowPosition;
      77          10 :         getPropertyDefaultByHandle( PROPERTY_ID_SHOW_NAVIGATION         ) >>= m_bShowNavigation;
      78          10 :         getPropertyDefaultByHandle( PROPERTY_ID_SHOW_RECORDACTIONS      ) >>= m_bShowActions;
      79          10 :         getPropertyDefaultByHandle( PROPERTY_ID_SHOW_FILTERSORT         ) >>= m_bShowFilterSort;
      80          10 :         getPropertyDefaultByHandle( PROPERTY_ID_WRITING_MODE            ) >>= m_nWritingMode;
      81          10 :         getPropertyDefaultByHandle( PROPERTY_ID_CONTEXT_WRITING_MODE    ) >>= m_nContextWritingMode;
      82          10 :     }
      83             : 
      84             :     //------------------------------------------------------------------
      85           1 :     ONavigationBarModel::ONavigationBarModel( const ONavigationBarModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
      86             :         :OControlModel( _pOriginal, _rxFactory )
      87           1 :         ,FontControlModel( _pOriginal )
      88             :     {
      89             :         DBG_CTOR( ONavigationBarModel, NULL );
      90             : 
      91           1 :         implInitPropertyContainer();
      92             : 
      93           1 :         m_aTabStop              = _pOriginal->m_aTabStop;
      94           1 :         m_aBackgroundColor      = _pOriginal->m_aBackgroundColor;
      95           1 :         m_sDefaultControl       = _pOriginal->m_sDefaultControl;
      96           1 :         m_sHelpText             = _pOriginal->m_sHelpText;
      97           1 :         m_sHelpURL              = _pOriginal->m_sHelpURL;
      98           1 :         m_bEnabled              = _pOriginal->m_bEnabled;
      99           1 :         m_bEnableVisible        = _pOriginal->m_bEnableVisible;
     100           1 :         m_nIconSize             = _pOriginal->m_nIconSize;
     101           1 :         m_nBorder               = _pOriginal->m_nBorder;
     102           1 :         m_nDelay                = _pOriginal->m_nDelay;
     103           1 :         m_bShowPosition         = _pOriginal->m_bShowPosition;
     104           1 :         m_bShowNavigation       = _pOriginal->m_bShowNavigation;
     105           1 :         m_bShowActions          = _pOriginal->m_bShowActions;
     106           1 :         m_bShowFilterSort       = _pOriginal->m_bShowFilterSort;
     107           1 :         m_nWritingMode          = _pOriginal->m_nWritingMode;
     108           1 :         m_nContextWritingMode   = _pOriginal->m_nContextWritingMode;
     109           1 :     }
     110             : 
     111             :     //------------------------------------------------------------------
     112          11 :     void ONavigationBarModel::implInitPropertyContainer()
     113             :     {
     114          11 :         REGISTER_PROP_2( DEFAULTCONTROL,      m_sDefaultControl,        BOUND, MAYBEDEFAULT );
     115          11 :         REGISTER_PROP_2( HELPTEXT,            m_sHelpText,              BOUND, MAYBEDEFAULT );
     116          11 :         REGISTER_PROP_2( HELPURL,             m_sHelpURL,               BOUND, MAYBEDEFAULT );
     117          11 :         REGISTER_PROP_2( ENABLED,             m_bEnabled,               BOUND, MAYBEDEFAULT );
     118          11 :         REGISTER_PROP_2( ENABLEVISIBLE,       m_bEnableVisible,         BOUND, MAYBEDEFAULT );
     119          11 :         REGISTER_PROP_2( ICONSIZE,            m_nIconSize,              BOUND, MAYBEDEFAULT );
     120          11 :         REGISTER_PROP_2( BORDER,              m_nBorder,                BOUND, MAYBEDEFAULT );
     121          11 :         REGISTER_PROP_2( DELAY,               m_nDelay,                 BOUND, MAYBEDEFAULT );
     122          11 :         REGISTER_PROP_2( SHOW_POSITION,       m_bShowPosition,          BOUND, MAYBEDEFAULT );
     123          11 :         REGISTER_PROP_2( SHOW_NAVIGATION,     m_bShowNavigation,        BOUND, MAYBEDEFAULT );
     124          11 :         REGISTER_PROP_2( SHOW_RECORDACTIONS,  m_bShowActions,           BOUND, MAYBEDEFAULT );
     125          11 :         REGISTER_PROP_2( SHOW_FILTERSORT,     m_bShowFilterSort,        BOUND, MAYBEDEFAULT );
     126          11 :         REGISTER_PROP_2( WRITING_MODE,        m_nWritingMode,           BOUND, MAYBEDEFAULT );
     127          11 :         REGISTER_PROP_3( CONTEXT_WRITING_MODE,m_nContextWritingMode,    BOUND, MAYBEDEFAULT, TRANSIENT );
     128             : 
     129          11 :         REGISTER_VOID_PROP( TABSTOP,         m_aTabStop,         sal_Bool );
     130          11 :         REGISTER_VOID_PROP( BACKGROUNDCOLOR, m_aBackgroundColor, sal_Int32 );
     131          11 :     }
     132             : 
     133             :     //------------------------------------------------------------------
     134          33 :     ONavigationBarModel::~ONavigationBarModel()
     135             :     {
     136          11 :         if ( !OComponentHelper::rBHelper.bDisposed )
     137             :         {
     138           0 :             acquire();
     139           0 :             dispose();
     140             :         }
     141             : 
     142             :         DBG_DTOR( ONavigationBarModel, NULL );
     143          22 :     }
     144             : 
     145             :     //------------------------------------------------------------------
     146        3475 :     Any SAL_CALL ONavigationBarModel::queryAggregation( const Type& _rType ) throw ( RuntimeException )
     147             :     {
     148        3475 :         Any aReturn = ONavigationBarModel_BASE::queryInterface( _rType );
     149             : 
     150        3475 :         if ( !aReturn.hasValue() )
     151        1209 :             aReturn = OControlModel::queryAggregation( _rType );
     152             : 
     153        3475 :         return aReturn;
     154             :     }
     155             : 
     156             :     //------------------------------------------------------------------
     157           2 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( ONavigationBarModel, OControlModel, ONavigationBarModel_BASE )
     158             : 
     159             :     //------------------------------------------------------------------------------
     160           1 :     IMPLEMENT_DEFAULT_CLONING( ONavigationBarModel )
     161             : 
     162             :     //------------------------------------------------------------------
     163           6 :     OUString SAL_CALL ONavigationBarModel::getImplementationName()  throw(RuntimeException)
     164             :     {
     165           6 :         return getImplementationName_Static();
     166             :     }
     167             : 
     168             :     //------------------------------------------------------------------
     169           5 :     Sequence< OUString > SAL_CALL ONavigationBarModel::getSupportedServiceNames()  throw(RuntimeException)
     170             :     {
     171           5 :         return getSupportedServiceNames_Static();
     172             :     }
     173             : 
     174             :     //------------------------------------------------------------------
     175          36 :     OUString SAL_CALL ONavigationBarModel::getImplementationName_Static()
     176             :     {
     177          36 :         return OUString( "com.sun.star.comp.form.ONavigationBarModel" );
     178             :     }
     179             : 
     180             :     //------------------------------------------------------------------
     181          20 :     Sequence< OUString > SAL_CALL ONavigationBarModel::getSupportedServiceNames_Static()
     182             :     {
     183          20 :         Sequence< OUString > aSupported = OControlModel::getSupportedServiceNames_Static();
     184          20 :         aSupported.realloc( aSupported.getLength() + 2 );
     185             : 
     186          20 :         OUString* pArray = aSupported.getArray();
     187          20 :         pArray[ aSupported.getLength() - 2 ] = OUString( "com.sun.star.awt.UnoControlModel" );
     188          20 :         pArray[ aSupported.getLength() - 1 ] = FRM_SUN_COMPONENT_NAVTOOLBAR;
     189          20 :         return aSupported;
     190             :     }
     191             : 
     192             :     //------------------------------------------------------------------
     193          10 :     Reference< XInterface > SAL_CALL ONavigationBarModel::Create( const Reference< XMultiServiceFactory >& _rxFactory )
     194             :     {
     195          10 :         return *( new ONavigationBarModel( comphelper::getComponentContext(_rxFactory) ) );
     196             :     }
     197             : 
     198             :     //------------------------------------------------------------------
     199          11 :     void SAL_CALL ONavigationBarModel::disposing()
     200             :     {
     201          11 :         OControlModel::disposing( );
     202          11 :     }
     203             : 
     204             :     //------------------------------------------------------------------
     205           1 :     OUString SAL_CALL ONavigationBarModel::getServiceName() throw ( RuntimeException )
     206             :     {
     207           1 :         return OUString(FRM_SUN_COMPONENT_NAVTOOLBAR);
     208             :     }
     209             : 
     210             :     //------------------------------------------------------------------
     211             :     #define PERSIST_TABSTOP         0x0001
     212             :     #define PERSIST_BACKGROUND      0x0002
     213             :     #define PERSIST_TEXTCOLOR       0x0004
     214             :     #define PERSIST_TEXTLINECOLOR   0x0008
     215             : 
     216             :     #define PERSIST_ENABLED         0x0001
     217             :     #define PERSIST_LARGEICONS      0x0002
     218             :         // leaf a leap here - this will allow for two more icon size values to be stored compatibly
     219             :     #define PERSIST_SHOW_POSITION   0x0008
     220             :     #define PERSIST_SHOW_NAVIGATION 0x0010
     221             :     #define PERSIST_SHOW_ACTIONS    0x0020
     222             :     #define PERSIST_SHOW_FILTERSORT 0x0040
     223             : 
     224             :     //------------------------------------------------------------------
     225           1 :     void SAL_CALL ONavigationBarModel::write( const Reference< XObjectOutputStream >& _rxOutStream ) throw ( IOException, RuntimeException )
     226             :     {
     227             :         // open a section for compatibility - if we later on write additional members,
     228             :         // then older versions can skip them
     229           1 :         OStreamSection aEnsureBlockCompat( _rxOutStream );
     230             : 
     231             :         // base class
     232           1 :         OControlModel::write( _rxOutStream );
     233             : 
     234             :         {
     235           1 :             OStreamSection aEnsureCompat( _rxOutStream );
     236             :             // determine which properties are not void and need to be written
     237           1 :             sal_Int32 nNonVoids = 0;
     238           1 :             if ( m_aTabStop.hasValue() )
     239           0 :                 nNonVoids |= PERSIST_TABSTOP;
     240           1 :             if ( m_aBackgroundColor.hasValue() )
     241           0 :                 nNonVoids |= PERSIST_BACKGROUND;
     242           1 :             if ( hasTextColor() )
     243           0 :                 nNonVoids |= PERSIST_TEXTCOLOR;
     244           1 :             if ( hasTextLineColor() )
     245           0 :                 nNonVoids |= PERSIST_TEXTLINECOLOR;
     246             : 
     247           1 :             _rxOutStream->writeLong( nNonVoids );
     248             : 
     249             :             // the maybeboid anys
     250           1 :             if ( nNonVoids & PERSIST_TABSTOP )
     251             :             {
     252           0 :                 sal_Bool bTabStop( sal_False );
     253           0 :                 m_aTabStop >>= bTabStop;
     254           0 :                 _rxOutStream->writeBoolean( bTabStop );
     255             :             }
     256           1 :             if ( nNonVoids & PERSIST_BACKGROUND )
     257             :             {
     258           0 :                 sal_Int32 nBackgroundColor = 0;
     259           0 :                 m_aBackgroundColor >>= nBackgroundColor;
     260           0 :                 _rxOutStream->writeLong( nBackgroundColor );
     261             :             }
     262           1 :             if ( nNonVoids & PERSIST_TEXTCOLOR )
     263             :             {
     264           0 :                _rxOutStream->writeLong( getTextColor() );
     265             :             }
     266           1 :             if ( nNonVoids & PERSIST_TEXTLINECOLOR )
     267             :             {
     268           0 :                 _rxOutStream->writeLong( getTextLineColor() );
     269           1 :             }
     270             :         }
     271             : 
     272             :         {
     273           1 :             OStreamSection aEnsureCompat( _rxOutStream );
     274           1 :             ::comphelper::operator<<( _rxOutStream, getFont() );
     275             :         }
     276             : 
     277             :         // our boolean flags
     278           1 :         sal_Int32 nFlags = 0;
     279           1 :         if ( m_bEnabled        ) nFlags |= PERSIST_ENABLED;
     280           1 :         if ( m_nIconSize       ) nFlags |= PERSIST_LARGEICONS;   // at the moment, this is quasi boolean
     281           1 :         if ( m_bShowPosition   ) nFlags |= PERSIST_SHOW_POSITION;
     282           1 :         if ( m_bShowNavigation ) nFlags |= PERSIST_SHOW_NAVIGATION;
     283           1 :         if ( m_bShowActions    ) nFlags |= PERSIST_SHOW_ACTIONS;
     284           1 :         if ( m_bShowFilterSort ) nFlags |= PERSIST_SHOW_FILTERSORT;
     285           1 :         _rxOutStream->writeLong( nFlags );
     286             : 
     287             :         // our strings
     288           1 :         _rxOutStream->writeUTF( m_sHelpText       );
     289           1 :         _rxOutStream->writeUTF( m_sHelpURL        );
     290           1 :         _rxOutStream->writeUTF( m_sDefaultControl );
     291             : 
     292             :         // misc
     293           1 :         _rxOutStream->writeShort( m_nBorder );
     294           1 :         _rxOutStream->writeLong ( m_nDelay  );
     295           1 :     }
     296             : 
     297             :     //------------------------------------------------------------------
     298           1 :     void SAL_CALL ONavigationBarModel::read( const Reference< XObjectInputStream >& _rxInStream ) throw ( IOException, RuntimeException )
     299             :     {
     300           1 :         OStreamSection aEnsureBlockCompat( _rxInStream );
     301             : 
     302             :         // base class
     303           1 :         OControlModel::read( _rxInStream );
     304             : 
     305             :         {
     306           1 :             OStreamSection aEnsureCompat( _rxInStream );
     307             :             // determine which properties were non-void
     308           1 :             sal_Int32 nNonVoids = _rxInStream->readLong( );
     309             : 
     310             :             // the maybeboid anys
     311           1 :             if ( nNonVoids & PERSIST_TABSTOP )
     312           0 :                 m_aTabStop = makeAny( _rxInStream->readBoolean() );
     313             :             else
     314           1 :                 m_aTabStop.clear();
     315             : 
     316           1 :             if ( nNonVoids & PERSIST_BACKGROUND )
     317           0 :                 m_aBackgroundColor = makeAny( _rxInStream->readLong() );
     318             :             else
     319           1 :                 m_aBackgroundColor.clear();
     320             : 
     321           1 :             if ( nNonVoids & PERSIST_TEXTCOLOR )
     322           0 :                 setTextColor( _rxInStream->readLong() );
     323             :             else
     324           1 :                 clearTextColor();
     325             : 
     326           1 :             if ( nNonVoids & PERSIST_TEXTLINECOLOR )
     327           0 :                 setTextLineColor( _rxInStream->readLong() );
     328             :             else
     329           1 :                 clearTextLineColor();
     330             :         }
     331             : 
     332             :         {
     333           1 :             OStreamSection aEnsureCompat( _rxInStream );
     334           2 :             FontDescriptor aFont;
     335           1 :             ::comphelper::operator>>( _rxInStream, aFont );
     336           2 :             setFont( aFont );
     337             :         }
     338             : 
     339             :         // our boolean flags
     340           1 :         sal_Int32 nFlags = _rxInStream->readLong( );
     341           1 :         m_bEnabled        = ( nFlags & PERSIST_ENABLED         ) ? sal_True : sal_False;
     342           1 :         m_nIconSize       = ( nFlags & PERSIST_LARGEICONS      ) ?        1 :         0;
     343           1 :         m_bShowPosition   = ( nFlags & PERSIST_SHOW_POSITION   ) ? sal_True : sal_False;
     344           1 :         m_bShowNavigation = ( nFlags & PERSIST_SHOW_NAVIGATION ) ? sal_True : sal_False;
     345           1 :         m_bShowActions    = ( nFlags & PERSIST_SHOW_ACTIONS    ) ? sal_True : sal_False;
     346           1 :         m_bShowFilterSort = ( nFlags & PERSIST_SHOW_FILTERSORT ) ? sal_True : sal_False;
     347             : 
     348             :         // our strings
     349           1 :         m_sHelpText       = _rxInStream->readUTF( );
     350           1 :         m_sHelpURL        = _rxInStream->readUTF( );
     351           1 :         m_sDefaultControl = _rxInStream->readUTF( );
     352             : 
     353             :         // misc
     354           1 :         m_nBorder = _rxInStream->readShort();
     355           1 :         m_nDelay  = _rxInStream->readLong();
     356           1 :     }
     357             : 
     358             :     //------------------------------------------------------------------
     359        2271 :     void SAL_CALL ONavigationBarModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const
     360             :     {
     361        2271 :         if ( isRegisteredProperty( _nHandle ) )
     362             :         {
     363         946 :             OPropertyContainerHelper::getFastPropertyValue( _rValue, _nHandle );
     364             :         }
     365        1325 :         else if ( isFontRelatedProperty( _nHandle ) )
     366             :         {
     367         647 :             FontControlModel::getFastPropertyValue( _rValue, _nHandle );
     368             :         }
     369             :         else
     370             :         {
     371         678 :             OControlModel::getFastPropertyValue( _rValue, _nHandle );
     372             :         }
     373        2271 :     }
     374             : 
     375             :     //------------------------------------------------------------------
     376         769 :     sal_Bool SAL_CALL ONavigationBarModel::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue,
     377             :         sal_Int32 _nHandle, const Any& _rValue ) throw( IllegalArgumentException )
     378             :     {
     379         769 :         sal_Bool bModified = sal_False;
     380             : 
     381         769 :         if ( isRegisteredProperty( _nHandle ) )
     382             :         {
     383         455 :             bModified = OPropertyContainerHelper::convertFastPropertyValue( _rConvertedValue, _rOldValue, _nHandle, _rValue );
     384             :         }
     385         314 :         else if ( isFontRelatedProperty( _nHandle ) )
     386             :         {
     387         114 :             bModified = FontControlModel::convertFastPropertyValue( _rConvertedValue, _rOldValue, _nHandle, _rValue );
     388             :         }
     389             :         else
     390             :         {
     391         200 :             bModified = OControlModel::convertFastPropertyValue( _rConvertedValue, _rOldValue, _nHandle, _rValue );
     392             :         }
     393             : 
     394         768 :         return bModified;
     395             :     }
     396             : 
     397             :     //------------------------------------------------------------------
     398         243 :     void SAL_CALL ONavigationBarModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue ) throw ( Exception )
     399             :     {
     400         243 :         if ( isRegisteredProperty( _nHandle ) )
     401             :         {
     402         127 :             OPropertyContainerHelper::setFastPropertyValue( _nHandle, _rValue );
     403             :         }
     404         116 :         else if ( isFontRelatedProperty( _nHandle ) )
     405             :         {
     406          48 :             FontDescriptor aOldFont( getFont() );
     407             : 
     408          48 :             FontControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue );
     409             : 
     410          48 :             if ( isFontAggregateProperty( _nHandle ) )
     411          33 :                 firePropertyChange( PROPERTY_ID_FONT, makeAny( getFont() ), makeAny( aOldFont ) );
     412             :         }
     413             :         else
     414             :         {
     415          68 :             OControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue );
     416             :         }
     417         243 :     }
     418             : 
     419             :     //------------------------------------------------------------------
     420         124 :     Any ONavigationBarModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
     421             :     {
     422         124 :         Any aDefault;
     423             : 
     424         124 :         switch ( _nHandle )
     425             :         {
     426             :         case PROPERTY_ID_TABSTOP:
     427             :         case PROPERTY_ID_BACKGROUNDCOLOR:
     428             :             /* void */
     429           4 :             break;
     430             :         case PROPERTY_ID_WRITING_MODE:
     431             :         case PROPERTY_ID_CONTEXT_WRITING_MODE:
     432          20 :             aDefault <<= WritingMode2::CONTEXT;
     433          20 :             break;
     434             : 
     435             :         case PROPERTY_ID_ENABLED:
     436             :         case PROPERTY_ID_ENABLEVISIBLE:
     437             :         case PROPERTY_ID_SHOW_POSITION:
     438             :         case PROPERTY_ID_SHOW_NAVIGATION:
     439             :         case PROPERTY_ID_SHOW_RECORDACTIONS:
     440             :         case PROPERTY_ID_SHOW_FILTERSORT:
     441          60 :             aDefault <<= (sal_Bool)sal_True;
     442          60 :             break;
     443             : 
     444             :         case PROPERTY_ID_ICONSIZE:
     445          10 :             aDefault <<= (sal_Int16)0;
     446          10 :             break;
     447             : 
     448             :         case PROPERTY_ID_DEFAULTCONTROL:
     449          10 :             aDefault <<= OUString( "com.sun.star.form.control.NavigationToolBar" );
     450          10 :             break;
     451             : 
     452             :         case PROPERTY_ID_HELPTEXT:
     453             :         case PROPERTY_ID_HELPURL:
     454           0 :             aDefault <<= OUString();
     455           0 :             break;
     456             : 
     457             :         case PROPERTY_ID_BORDER:
     458          10 :             aDefault <<= (sal_Int16)0;
     459          10 :             break;
     460             : 
     461             :         case PROPERTY_ID_DELAY:
     462          10 :             aDefault <<= (sal_Int32)20;
     463          10 :             break;
     464             : 
     465             :         default:
     466           0 :             if ( isFontRelatedProperty( _nHandle ) )
     467           0 :                 aDefault = FontControlModel::getPropertyDefaultByHandle( _nHandle );
     468             :             else
     469           0 :                 aDefault = OControlModel::getPropertyDefaultByHandle( _nHandle );
     470             :         }
     471         124 :         return aDefault;
     472             :     }
     473             : 
     474             :     //------------------------------------------------------------------
     475          12 :     void ONavigationBarModel::describeFixedProperties( Sequence< Property >& _rProps ) const
     476             :     {
     477          12 :         BEGIN_DESCRIBE_PROPERTIES( 1, OControlModel )
     478          12 :             DECL_PROP2( TABINDEX,           sal_Int16,          BOUND, MAYBEDEFAULT );
     479             :         END_DESCRIBE_PROPERTIES();
     480             : 
     481             :         // properties which the OPropertyContainerHelper is responsible for
     482          12 :         Sequence< Property > aContainedProperties;
     483          12 :         describeProperties( aContainedProperties );
     484             : 
     485             :         // properties which the FontControlModel is responsible for
     486          24 :         Sequence< Property > aFontProperties;
     487          12 :         describeFontRelatedProperties( aFontProperties );
     488             : 
     489          24 :         _rProps = concatSequences(
     490             :             aContainedProperties,
     491             :             aFontProperties,
     492             :             _rProps
     493          24 :         );
     494          12 :     }
     495             : 
     496             : //.........................................................................
     497             : }   // namespace frm
     498             : //.........................................................................
     499             : 
     500             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10