summaryrefslogtreecommitdiff
path: root/cui/source/customize
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/customize')
-rw-r--r--cui/source/customize/acccfg.cxx158
-rw-r--r--cui/source/customize/cfg.cxx250
-rw-r--r--cui/source/customize/cfgutil.cxx107
-rw-r--r--cui/source/customize/selector.cxx42
4 files changed, 4 insertions, 553 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index a75a7cf1f24d..ad5c8b1b3201 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1366,133 +1366,6 @@ IMPL_LINK( SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, EMPTYARG
return 0;
}
-::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL )
-{
- ::rtl::OUString aLabel;
- if ( aCmdURL.getLength() )
- {
- try
- {
- uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY );
- if ( xNameAccess.is() )
- {
- uno::Reference< container::XNameAccess > xUICommandLabels;
- const ::rtl::OUString aModule( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) );
- uno::Any a = xNameAccess->getByName( aModule );
- uno::Reference< container::XNameAccess > xUICommands;
- a >>= xUICommandLabels;
- rtl::OUString aStr;
- uno::Sequence< beans::PropertyValue > aPropSeq;
- a = xUICommandLabels->getByName( aCmdURL );
- if ( a >>= aPropSeq )
- {
- for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name.equalsAscii( "Name" ))
- {
- aPropSeq[i].Value >>= aStr;
- break;
- }
- }
- }
- aLabel = aStr;
- }
- }
- catch ( uno::Exception& )
- {
- }
- }
-
- return aLabel;
-}
-
-
-//-----------------------------------------------
-String SfxAcceleratorConfigPage::GetFunctionName(KeyFuncType eType) const
-{
- ::rtl::OUStringBuffer sName(256);
- sName.appendAscii("\"");
- switch(eType)
- {
- case KEYFUNC_NEW :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:NewDoc") ) );
- break;
-
- case KEYFUNC_OPEN :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Open") ) );
- break;
-
- case KEYFUNC_SAVE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Save") ) );
- break;
-
- case KEYFUNC_SAVEAS :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:SaveAs") ) );
- break;
-
- case KEYFUNC_PRINT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Print") ) );
- break;
-
- case KEYFUNC_CLOSE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Close") ) );
- break;
-
- case KEYFUNC_QUIT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Quit") ) );
- break;
-
- case KEYFUNC_CUT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Cut") ) );
- break;
-
- case KEYFUNC_COPY :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Copy") ) );
- break;
-
- case KEYFUNC_PASTE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Paste") ) );
- break;
-
- case KEYFUNC_UNDO :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Undo") ) );
- break;
-
- case KEYFUNC_REDO :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Redo") ) );
- break;
-
- case KEYFUNC_DELETE :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Delete") ) );
- break;
-
- case KEYFUNC_REPEAT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Repeat") ) );
- break;
-
- case KEYFUNC_FIND :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Search") ) );
- break;
-
- case KEYFUNC_FINDBACKWARD :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:SearchBackwards") ) );
- break;
-
- case KEYFUNC_PROPERTIES :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Options") ) );
- break;
-
- case KEYFUNC_FRONT :
- sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:ToFront") ) );
- break;
-
- default:
- break;
- }
- sName.appendAscii("\"");
- return String(sName.makeStringAndClear());
-}
-
//-----------------------------------------------
void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle )
{
@@ -1575,37 +1448,6 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet )
}
//-----------------------------------------------
-void SfxAcceleratorConfigPage::SelectMacro(const SfxMacroInfoItem *pItem)
-{
- m_pMacroInfoItem = pItem;
- pGroupLBox->SelectMacro( pItem );
-}
-
-//-----------------------------------------------
-void SfxAcceleratorConfigPage::CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr,
- const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr)
-{
- const css::uno::Sequence< css::awt::KeyEvent > lKeys = xSourceAccMgr->getAllKeyEvents();
- sal_Int32 c = lKeys.getLength();
- sal_Int32 i = 0;
- for (i=0; i<c; ++i)
- {
- const css::awt::KeyEvent& rKey = lKeys[i];
- ::rtl::OUString sCommand = xSourceAccMgr->getCommandByKeyEvent(rKey);
- xTargetAccMgr->setKeyEvent(rKey, sCommand);
- }
-}
-
-//-----------------------------------------------
-KeyCode SfxAcceleratorConfigPage::MapPosToKeyCode(USHORT nPos) const
-{
- TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
- KeyCode aCode(KEYCODE_ARRAY[pEntry->m_nKeyPos] & 0xFFF ,
- KEYCODE_ARRAY[pEntry->m_nKeyPos] & (KEY_SHIFT | KEY_MOD2));
- return aCode;
-}
-
-//-----------------------------------------------
USHORT SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const
{
USHORT nCode1 = aKey.GetCode()+aKey.GetModifier();
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 )
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 952de1f9275e..da294a4526b0 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -376,40 +376,6 @@ void SfxConfigFunctionListBox_Impl::ClearAll()
Clear();
}
-SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName )
-/* Beschreibung
- Ermittelt den SvLBoxEntry zu einem "ubergebenen String. Das setzt voraus, da\s
- die Namen eindeutig sind.
-*/
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- if ( GetEntryText( pEntry ) == rName )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId )
-/* Beschreibung
- Ermittelt den SvLBoxEntry zu einer "ubergebenen Id.
-*/
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pData && pData->nOrd == nId )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
SfxMacroInfo* SfxConfigFunctionListBox_Impl::GetMacroInfo()
/* Beschreibung
Gibt die MacroInfo des selektierten Entry zur"uck ( sofern vorhanden ).
@@ -451,60 +417,6 @@ String SfxConfigFunctionListBox_Impl::GetCurLabel()
return pData->sCommand;
}
-USHORT SfxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry )
-/* Beschreibung
- Gibt die Ordnungsnummer ( SlotId oder Macro-Nummer ) des Eintrags zur"uck.
-*/
-{
- SfxGroupInfo_Impl *pData = pEntry ?
- (SfxGroupInfo_Impl*) pEntry->GetUserData() : 0;
- if ( pData )
- return pData->nOrd;
- return 0;
-}
-
-/*
-String SfxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry )
-{
- // Information zum selektierten Entry aus den Userdaten holen
- SfxGroupInfo_Impl *pInfo = pEntry ? (SfxGroupInfo_Impl*) pEntry->GetUserData(): 0;
- if ( pInfo )
- {
- switch ( pInfo->nKind )
- {
- case SFX_CFGGROUP_FUNCTION :
- case SFX_CFGFUNCTION_SLOT :
- {
- // Eintrag ist eine Funktion, Hilfe aus der Office-Hilfe
- USHORT nId = pInfo->nOrd;
- String aText = Application::GetHelp()->GetHelpText( nId, this );
-
- if ( !aText.Len() )
- aText = SFX_SLOTPOOL().GetSlotHelpText_Impl( nId );
- return aText;
- }
-
- case SFX_CFGGROUP_SCRIPTCONTAINER :
- case SFX_CFGFUNCTION_SCRIPT :
- case SFX_CFGGROUP_BASICMGR :
- case SFX_CFGGROUP_DOCBASICMGR :
- case SFX_CFGGROUP_BASICLIB :
- case SFX_CFGGROUP_BASICMOD :
- case SFX_CFGFUNCTION_MACRO :
- {
- // Eintrag ist ein Macro, Hilfe aus der MacroInfo
- SfxMacroInfo *pMacInfo = (SfxMacroInfo*) pInfo->pObject;
- return pMacInfo->GetHelpText();
- }
-
- case SFX_CFGGROUP_STYLES :
- return String();
- }
- }
-
- return String();
-}*/
-
void SfxConfigFunctionListBox_Impl::FunctionSelected()
/* Beschreibung
Setzt die Balloonhelp zur"uck, da diese immer den Helptext des selektierten
@@ -1247,25 +1159,6 @@ SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xC
return xModel;
}
-::rtl::OUString SfxConfigGroupListBox_Impl::parseLocationName( const ::rtl::OUString& location )
-{
- // strip out the last leaf of location name
- // e.g. file://dir1/dir2/Blah.sxw - > Blah.sxw
- ::rtl::OUString temp = location;
- sal_Int32 lastSlashIndex = temp.lastIndexOf( ::rtl::OUString::createFromAscii( "/" ) );
-
- if ( ( lastSlashIndex + 1 ) < temp.getLength() )
- {
- temp = temp.copy( lastSlashIndex + 1 );
- }
- // maybe we should throw here!!!
- else
- {
- OSL_TRACE("Something wrong with name, perhaps we should throw an exception");
- }
- return temp;
-}
-
//-----------------------------------------------
::rtl::OUString SfxConfigGroupListBox_Impl::MapCommand2UIName(const ::rtl::OUString& sCommand)
{
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 3e99f3e95b5f..833dc0f32c82 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -154,42 +154,6 @@ void SvxConfigFunctionListBox_Impl::ClearAll()
Clear();
}
-SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName )
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- if ( GetEntryText( pEntry ) == rName )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId )
-{
- SvLBoxEntry *pEntry = First();
- while ( pEntry )
- {
- SvxGroupInfo_Impl *pData = (SvxGroupInfo_Impl*) pEntry->GetUserData();
- if ( pData && pData->nOrd == nId )
- return pEntry;
- pEntry = Next( pEntry );
- }
-
- return NULL;
-}
-
-USHORT SvxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry )
-{
- SvxGroupInfo_Impl *pData = pEntry ?
- (SvxGroupInfo_Impl*) pEntry->GetUserData() : 0;
- if ( pData )
- return pData->nOrd;
- return 0;
-}
-
String SvxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry )
{
// Information zum selektierten Entry aus den Userdaten holen
@@ -1214,12 +1178,6 @@ SvxScriptSelectorDialog::SetDialogDescription( const String& rDescription )
aDialogDescription.SetText( rDescription );
}
-USHORT
-SvxScriptSelectorDialog::GetSelectedId()
-{
- return aCommands.GetId( aCommands.GetLastSelectedEntry() );
-}
-
String
SvxScriptSelectorDialog::GetScriptURL() const
{