summaryrefslogtreecommitdiff
path: root/cui/source/customize/cfg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/customize/cfg.cxx')
-rw-r--r--cui/source/customize/cfg.cxx33
1 files changed, 31 insertions, 2 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 7513fcf2d42c..9c339e395cbe 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1136,6 +1136,9 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
get(m_pCommandCategoryListBox, "commandcategorylist");
get(m_pFunctions, "functions");
+ get(m_pAddCommandButton, "add");
+ get(m_pRemoveCommandButton, "remove");
+
get(m_pTopLevelListBox, "toplevellist");
get(m_pContents, "contents");
get(m_pMoveUpButton, "up");
@@ -1166,6 +1169,8 @@ void SvxConfigPage::dispose()
m_pContents.clear();
m_pEntries.clear();
m_pFunctions.clear();
+ m_pAddCommandButton.clear();
+ m_pRemoveCommandButton.clear();
m_pMoveUpButton.clear();
m_pMoveDownButton.clear();
m_pSaveInListBox.clear();
@@ -1442,6 +1447,30 @@ OUString SvxConfigPage::GetFrameWithDefaultAndIdentify( uno::Reference< frame::X
return sModuleID;
}
+OUString SvxConfigPage::GetScriptURL() const
+{
+ OUString result;
+
+ SvTreeListEntry *pEntry = m_pFunctions->FirstSelected();
+ if ( pEntry )
+ {
+ SfxGroupInfo_Impl *pData = static_cast<SfxGroupInfo_Impl*>(pEntry->GetUserData());
+ if ( ( pData->nKind == SfxCfgKind::FUNCTION_SLOT ) ||
+ ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT ) ||
+ ( pData->nKind == SfxCfgKind::GROUP_STYLES ) )
+ {
+ result = pData->sCommand;
+ }
+ }
+
+ return result;
+}
+
+OUString SvxConfigPage::GetSelectedDisplayName()
+{
+ return m_pFunctions->GetEntryText( m_pFunctions->FirstSelected() );
+}
+
bool SvxConfigPage::FillItemSet( SfxItemSet* )
{
bool result = false;
@@ -1555,7 +1584,7 @@ SvxEntries* SvxConfigPage::FindParentForChild(
SvTreeListEntry* SvxConfigPage::AddFunction(
SvTreeListEntry* pTarget, bool bFront, bool bAllowDuplicates )
{
- OUString aURL = m_pSelectorDlg->GetScriptURL();
+ OUString aURL = GetScriptURL();
if ( aURL.isEmpty() )
{
@@ -1577,7 +1606,7 @@ SvTreeListEntry* SvxConfigPage::AddFunction(
pNewEntryData->SetUserDefined();
if ( aDisplayName.isEmpty() )
- pNewEntryData->SetName( m_pSelectorDlg->GetSelectedDisplayName() );
+ pNewEntryData->SetName( GetSelectedDisplayName() );
// check that this function is not already in the menu
SvxConfigEntry* pParent = GetTopLevelSelection();