diff options
Diffstat (limited to 'cui/source/customize/cfg.cxx')
-rw-r--r-- | cui/source/customize/cfg.cxx | 250 |
1 files changed, 4 insertions, 246 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d9f730e0224f..c706e2f8a6a8 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -144,6 +144,8 @@ namespace container = com::sun::star::container; namespace beans = com::sun::star::beans; namespace graphic = com::sun::star::graphic; +#if OSL_DEBUG_LEVEL > 1 + void printPropertySet( const OUString& prefix, const uno::Reference< beans::XPropertySet >& xPropSet ) @@ -208,6 +210,8 @@ void printEntries(SvxEntries* entries) } } +#endif + OUString stripHotKey( const OUString& str ) { @@ -918,11 +922,6 @@ void SvxConfigDialog::PageCreated( USHORT nId, SfxTabPage& rPage ) } } -void SvxConfigDialog::ActivateTabPage( USHORT nSlotId ) -{ - (void)nSlotId; -} - /****************************************************************************** * * The SaveInData class is used to hold data for entries in the Save In @@ -3055,75 +3054,6 @@ SvxConfigEntry* SvxMainMenuOrganizerDialog::GetSelectedEntry() return (SvxConfigEntry*)aMenuListBox.FirstSelected()->GetUserData(); } -SvxConfigEntry::SvxConfigEntry( - const uno::Sequence< beans::PropertyValue >& rProperties, - const uno::Reference< container::XNameAccess >& rCommandToLabelMap ) - : - nId( 1 ), - bPopUp( FALSE ), - bStrEdited( FALSE ), - bIsUserDefined( FALSE ), - bIsMain( FALSE ), - bIsParentData( FALSE ), - bIsVisible( TRUE ), - nStyle( 0 ), - pEntries( 0 ) -{ - sal_uInt16 nType( css::ui::ItemType::DEFAULT ); - OUString aHelpURL_; - - for ( sal_Int32 i = 0; i < rProperties.getLength(); i++ ) - { - if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_COMMANDURL )) - { - rProperties[i].Value >>= aCommand; - } - else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL )) - { - rProperties[i].Value >>= aHelpURL_; - } - else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL )) - { - rProperties[i].Value >>= aLabel; - } - else if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_TYPE )) - { - rProperties[i].Value >>= nType; - } - } - - if ( nType == css::ui::ItemType::DEFAULT ) - { - uno::Any a; - try - { - a = rCommandToLabelMap->getByName( aCommand ); - bIsUserDefined = FALSE; - } - catch ( container::NoSuchElementException& ) - { - bIsUserDefined = TRUE; - } - - // If custom label not set retrieve it from the command to info service - if ( aLabel.equals( OUString() ) ) - { - uno::Sequence< beans::PropertyValue > aPropSeq; - if ( a >>= aPropSeq ) - { - for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) - { - if ( aPropSeq[i].Name.equalsAscii( ITEM_DESCRIPTOR_LABEL ) ) - { - aPropSeq[i].Value >>= aLabel; - break; - } - } - } - } - } -} - const OUString& SvxConfigEntry::GetHelpText() { @@ -3150,133 +3080,6 @@ SvxConfigEntry::GetHelpText() return aHelpText; } -uno::Sequence< beans::PropertyValue > -SvxConfigEntry::GetProperties( - const uno::Reference< container::XNameAccess >& rCommandToLabelMap ) -{ - if ( IsSeparator() ) - { - uno::Sequence< beans::PropertyValue > aPropSeq( 1 ); - - aPropSeq[0].Name = OUString( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) ); - aPropSeq[0].Value <<= css::ui::ItemType::SEPARATOR_LINE; - - return aPropSeq; - } - - static const OUString aDescriptorCommandURL ( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ) ); - - static const OUString aDescriptorType( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ) ); - - static const OUString aDescriptorLabel( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) ); - - static const OUString aDescriptorHelpURL( - RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) ); - - uno::Sequence< beans::PropertyValue > aPropSeq( 4 ); - - aPropSeq[0].Name = aDescriptorCommandURL; - aPropSeq[0].Value <<= rtl::OUString( GetCommand() ); - - aPropSeq[1].Name = aDescriptorType; - aPropSeq[1].Value <<= css::ui::ItemType::DEFAULT; - - // If the name has not been changed and the name is the same as - // in the default command to label map then the label can be stored - // as an empty string. - // It will be initialised again later using the command to label map. - aPropSeq[2].Name = aDescriptorLabel; - if ( HasChangedName() == FALSE && GetCommand().getLength() ) - { - BOOL isDefaultName = FALSE; - try - { - uno::Any a( rCommandToLabelMap->getByName( GetCommand() ) ); - uno::Sequence< beans::PropertyValue > tmpPropSeq; - if ( a >>= tmpPropSeq ) - { - for ( sal_Int32 i = 0; i < tmpPropSeq.getLength(); i++ ) - { - if ( tmpPropSeq[i].Name.equals( aDescriptorLabel ) ) - { - OUString tmpLabel; - tmpPropSeq[i].Value >>= tmpLabel; - - if ( tmpLabel.equals( GetName() ) ) - { - isDefaultName = TRUE; - } - - break; - } - } - } - } - catch ( container::NoSuchElementException& ) - { - // isDefaultName is left as FALSE - } - - if ( isDefaultName ) - { - aPropSeq[2].Value <<= rtl::OUString(); - } - else - { - aPropSeq[2].Value <<= rtl::OUString( GetName() ); - } - } - else - { - aPropSeq[2].Value <<= rtl::OUString( GetName() ); - } - - aPropSeq[3].Name = aDescriptorHelpURL; - aPropSeq[3].Value <<= rtl::OUString( GetHelpURL() ); - - return aPropSeq; -} - -/* -SvxMenuConfigEntry::SvxMenuConfigEntry( - const uno::Sequence< beans::PropertyValue >& rProperties, - const uno::Reference< container::XNameAccess >& rCommandToLabelMap ) - : - SvxConfigEntry( rProperties, rCommandToLabelMap ) -{ - uno::Reference< container::XIndexAccess > aChildren; - - for ( sal_Int32 i = 0; i < rProperties.getLength(); i++ ) - { - if ( rProperties[i].Name.equalsAscii( ITEM_DESCRIPTOR_CONTAINER )) - { - rProperties[i].Value >>= aChildren; - } - } - - if ( aChildren.is() ) - { - SetPopup( TRUE ); - SetEntries( new SvxEntries() ); - - uno::Sequence< beans::PropertyValue > aProps; - for ( sal_Int32 i = 0; i < aChildren->getCount(); i++ ) - { - if ( aChildren->getByIndex( i ) >>= aProps ) - { - SvxConfigEntry* pEntry = - new SvxMenuConfigEntry( aProps, rCommandToLabelMap ); - GetEntries()->push_back( pEntry ); - } - } - } -} -*/ - SvxConfigEntry::SvxConfigEntry( const OUString& rDisplayName, const OUString& rCommandURL, bool bPopup, bool bParentData ) : nId( 1 ) @@ -4695,51 +4498,6 @@ void ToolbarSaveInData::RestoreToolbar( SvxConfigEntry* pToolbar ) } } -void ToolbarSaveInData::ReloadToolbar( const OUString& rResourceURL ) -{ - SvxEntries::const_iterator iter = GetEntries()->begin(); - SvxConfigEntry* pToolbar = NULL; - - for ( ; iter != GetEntries()->end(); iter++ ) - { - SvxConfigEntry* pEntry = *iter; - - if ( pEntry->GetCommand().equals( rResourceURL ) ) - { - pToolbar = pEntry; - break; - } - } - - if ( pToolbar != NULL ) - { - delete pToolbar->GetEntries(); - - try - { - uno::Reference< container::XIndexAccess > xToolbarSettings; - - if ( pToolbar->IsParentData() ) - { - xToolbarSettings = GetParentConfigManager()->getSettings( - pToolbar->GetCommand(), sal_False); - } - else - { - xToolbarSettings = GetConfigManager()->getSettings( - pToolbar->GetCommand(), sal_False); - } - - LoadToolbar( xToolbarSettings, pToolbar ); - } - catch ( container::NoSuchElementException& ) - { - // toolbar not found for some reason - // it will not appear in the toolbar list - } - } -} - bool ToolbarSaveInData::LoadToolbar( const uno::Reference< container::XIndexAccess >& xToolbarSettings, SvxConfigEntry* pParentData ) |