summaryrefslogtreecommitdiff
path: root/cui/source/customize/cfg.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-07-10 18:21:24 +0200
committerMathias Bauer <mba@openoffice.org>2010-07-10 18:21:24 +0200
commit75f7d31fe224ab156058f131cfb0730faeaf7416 (patch)
tree3f05d017867c58bdfef6ac9caeddd8f28c1d7b21 /cui/source/customize/cfg.cxx
parent76890aea2c521cef54592aacf5b8f37ef2d8c714 (diff)
CWS changehid: #i111874#: change code to support HelpIds as byte strings
Diffstat (limited to 'cui/source/customize/cfg.cxx')
-rw-r--r--cui/source/customize/cfg.cxx112
1 files changed, 21 insertions, 91 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 4a90a5ccb..373c96457 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -112,7 +112,6 @@
#define ENTRY_HEIGHT 16
static const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL";
-static const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL";
static const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer";
static const char ITEM_DESCRIPTOR_LABEL[] = "Label";
static const char ITEM_DESCRIPTOR_TYPE[] = "Type";
@@ -518,7 +517,6 @@ bool GetMenuItemData(
const uno::Reference< container::XIndexAccess >& rItemContainer,
sal_Int32 nIndex,
OUString& rCommandURL,
- OUString& rHelpURL,
OUString& rLabel,
sal_uInt16& rType,
uno::Reference< container::XIndexAccess >& rSubMenu )
@@ -534,10 +532,6 @@ bool GetMenuItemData(
{
aProp[i].Value >>= rCommandURL;
}
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL ))
- {
- aProp[i].Value >>= rHelpURL;
- }
else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_CONTAINER ))
{
aProp[i].Value >>= rSubMenu;
@@ -566,7 +560,6 @@ bool GetToolbarItemData(
const uno::Reference< container::XIndexAccess >& rItemContainer,
sal_Int32 nIndex,
OUString& rCommandURL,
- OUString& rHelpURL,
OUString& rLabel,
sal_uInt16& rType,
sal_Bool& rIsVisible,
@@ -588,10 +581,6 @@ bool GetToolbarItemData(
{
aProp[i].Value >>= rStyle;
}
- else if ( aProp[i].Name.equalsAscii( ITEM_DESCRIPTOR_HELPURL ))
- {
- aProp[i].Value >>= rHelpURL;
- }
else if (aProp[i].Name.equalsAscii(ITEM_DESCRIPTOR_CONTAINER))
{
aProp[i].Value >>= rSubMenu;
@@ -634,13 +623,10 @@ ConvertSvxConfigEntry(
static const OUString aDescriptorLabel(
RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) );
- static const OUString aDescriptorHelpURL(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) );
-
static const OUString aDescriptorContainer(
RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) );
- uno::Sequence< beans::PropertyValue > aPropSeq( 4 );
+ uno::Sequence< beans::PropertyValue > aPropSeq( 3 );
aPropSeq[0].Name = aDescriptorCommandURL;
aPropSeq[0].Value <<= rtl::OUString( pEntry->GetCommand() );
@@ -698,9 +684,6 @@ ConvertSvxConfigEntry(
aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() );
}
- aPropSeq[3].Name = aDescriptorHelpURL;
- aPropSeq[3].Value <<= rtl::OUString( pEntry->GetHelpURL() );
-
return aPropSeq;
}
@@ -718,16 +701,13 @@ ConvertToolbarEntry(
static const OUString aDescriptorLabel(
RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ) );
- static const OUString aDescriptorHelpURL(
- RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ) );
-
static const OUString aDescriptorContainer(
RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ) );
static const OUString aIsVisible(
RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_ISVISIBLE ) );
- uno::Sequence< beans::PropertyValue > aPropSeq( 5 );
+ uno::Sequence< beans::PropertyValue > aPropSeq( 4 );
aPropSeq[0].Name = aDescriptorCommandURL;
aPropSeq[0].Value <<= rtl::OUString( pEntry->GetCommand() );
@@ -785,11 +765,8 @@ ConvertToolbarEntry(
aPropSeq[2].Value <<= rtl::OUString( pEntry->GetName() );
}
- aPropSeq[3].Name = aDescriptorHelpURL;
- aPropSeq[3].Value <<= rtl::OUString( pEntry->GetHelpURL() );
-
- aPropSeq[4].Name = aIsVisible;
- aPropSeq[4].Value <<= pEntry->IsVisible();
+ aPropSeq[3].Name = aIsVisible;
+ aPropSeq[3].Value <<= pEntry->IsVisible();
return aPropSeq;
}
@@ -1183,14 +1160,13 @@ bool MenuSaveInData::LoadSubMenus(
{
uno::Reference< container::XIndexAccess > xSubMenu;
OUString aCommandURL;
- OUString aHelpURL;
OUString aLabel;
bool bIsUserDefined = TRUE;
sal_uInt16 nType( css::ui::ItemType::DEFAULT );
bool bItem = GetMenuItemData( xMenuSettings, nIndex,
- aCommandURL, aHelpURL, aLabel, nType, xSubMenu );
+ aCommandURL, aLabel, nType, xSubMenu );
if ( bItem )
{
@@ -1232,7 +1208,6 @@ bool MenuSaveInData::LoadSubMenus(
aLabel, aCommandURL, TRUE );
pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
pEntries->push_back( pEntry );
@@ -1257,7 +1232,6 @@ bool MenuSaveInData::LoadSubMenus(
SvxConfigEntry* pEntry = new SvxConfigEntry(
aLabel, aCommandURL, FALSE );
pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
pEntries->push_back( pEntry );
}
}
@@ -2154,7 +2128,6 @@ SvLBoxEntry* SvxConfigPage::AddFunction(
SvxConfigEntry* pNewEntryData =
new SvxConfigEntry( aDisplayName, aURL, FALSE );
pNewEntryData->SetUserDefined( TRUE );
- pNewEntryData->SetHelpURL( aURL );
// check that this function is not already in the menu
SvxConfigEntry* pParent = GetTopLevelSelection();
@@ -2629,8 +2602,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
String aDesc = CUI_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- // FIXME: HELPID
- pNameDialog->SetHelpId( ""/*HID_SVX_CONFIG_RENAME_MENU*/ );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
bool ret = pNameDialog->Execute();
@@ -2688,8 +2660,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
String aDesc = CUI_RESSSTR( RID_SVXSTR_SUBMENU_NAME );
SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- // FIXME: HELPID
- pNameDialog->SetHelpId( ""/*HID_SVX_CONFIG_NAME_SUBMENU*/ );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
bool ret = pNameDialog->Execute();
@@ -2735,8 +2706,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
String aDesc = CUI_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- // FIXME: HELPID
- pNameDialog->SetHelpId( ""/*HID_SVX_CONFIG_RENAME_MENU_ITEM*/ );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
bool ret = pNameDialog->Execute();
@@ -3073,7 +3043,6 @@ SvxConfigEntry::SvxConfigEntry(
pEntries( 0 )
{
sal_uInt16 nType( css::ui::ItemType::DEFAULT );
- OUString aHelpURL_;
for ( sal_Int32 i = 0; i < rProperties.getLength(); i++ )
{
@@ -3081,10 +3050,6 @@ SvxConfigEntry::SvxConfigEntry(
{
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;
@@ -3132,26 +3097,9 @@ SvxConfigEntry::GetHelpText()
{
if ( aHelpText.getLength() == 0 )
{
- #if 0
- OUString helpid = OUString::createFromAscii( "helpid:" );
- if ( aHelpURL.indexOf( helpid ) != -1 )
- {
- aHelpURL = aHelpURL.copy( helpid.getLength() );
- }
- #endif
-
- Help* pHelp = Application::GetHelp();
- #if 0
- if ( aHelpURL.toInt32() != 0 )
- #endif
- {
- // FIXME: HELPID
- aHelpText = pHelp->GetHelpText( aHelpURL/*.toInt32()*/, NULL );
- }
-
- if ( aHelpText.getLength() == 0 && aCommand.getLength() != 0 )
+ if ( aCommand.getLength() )
{
- aHelpText = pHelp->GetHelpText( aCommand, NULL );
+ aHelpText = Application::GetHelp()->GetHelpText( aCommand, NULL );
}
}
@@ -3182,10 +3130,7 @@ SvxConfigEntry::GetProperties(
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 );
+ uno::Sequence< beans::PropertyValue > aPropSeq( 3 );
aPropSeq[0].Name = aDescriptorCommandURL;
aPropSeq[0].Value <<= rtl::OUString( GetCommand() );
@@ -3243,9 +3188,6 @@ SvxConfigEntry::GetProperties(
aPropSeq[2].Value <<= rtl::OUString( GetName() );
}
- aPropSeq[3].Name = aDescriptorHelpURL;
- aPropSeq[3].Value <<= rtl::OUString( GetHelpURL() );
-
return aPropSeq;
}
@@ -3351,26 +3293,19 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(
:
SvxConfigPage( pParent, rSet )
{
- // FIXME: HELPID
- SetHelpId( ""/*HID_SVX_CONFIG_TOOLBAR*/ );
+ SetHelpId( HID_SVX_CONFIG_TOOLBAR );
aContentsListBox = new SvxToolbarEntriesListBox(this, CUI_RES(BOX_ENTRIES));
FreeResource();
PositionContentsListBox();
aContentsListBox->SetZOrder( &aAddCommandsButton, WINDOW_ZORDER_BEFOR );
- // FIXME: HELPID
- aContentsListBox->SetHelpId( ""/*HID_SVX_CONFIG_TOOLBAR_CONTENTS*/ );
- // FIXME: HELPID
- aNewTopLevelButton.SetHelpId( ""/*HID_SVX_NEW_TOOLBAR*/ );
- // FIXME: HELPID
- aModifyTopLevelButton.SetHelpId( ""/*HID_SVX_MODIFY_TOOLBAR*/ );
- // FIXME: HELPID
- aAddCommandsButton.SetHelpId( ""/*HID_SVX_NEW_TOOLBAR_ITEM*/ );
- // FIXME: HELPID
- aModifyCommandButton.SetHelpId( ""/*HID_SVX_MODIFY_TOOLBAR_ITEM*/ );
- // FIXME: HELPID
- aSaveInListBox.SetHelpId( ""/*HID_SVX_SAVE_IN*/ );
+ aContentsListBox->SetHelpId( HID_SVX_CONFIG_TOOLBAR_CONTENTS );
+ aNewTopLevelButton.SetHelpId( HID_SVX_NEW_TOOLBAR );
+ aModifyTopLevelButton.SetHelpId( HID_SVX_MODIFY_TOOLBAR );
+ aAddCommandsButton.SetHelpId( HID_SVX_NEW_TOOLBAR_ITEM );
+ aModifyCommandButton.SetHelpId( HID_SVX_MODIFY_TOOLBAR_ITEM );
+ aSaveInListBox.SetHelpId( HID_SVX_SAVE_IN );
aTopLevelSeparator.SetText(
CUI_RES ( RID_SVXSTR_PRODUCTNAME_TOOLBARS ) );
@@ -3586,8 +3521,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
String aDesc = CUI_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- // FIXME: HELPID
- pNameDialog->SetHelpId( ""/*HID_SVX_CONFIG_RENAME_TOOLBAR*/ );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
bool ret = pNameDialog->Execute();
@@ -3678,8 +3612,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
String aDesc = CUI_RESSSTR( RID_SVXSTR_LABEL_NEW_NAME );
SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
- // FIXME: HELPID
- pNameDialog->SetHelpId( ""/*HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM*/ );
+ pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
bool ret = pNameDialog->Execute();
@@ -4767,7 +4700,6 @@ bool ToolbarSaveInData::LoadToolbar(
{
uno::Reference< container::XIndexAccess > xSubMenu;
OUString aCommandURL;
- OUString aHelpURL;
OUString aLabel;
bool bIsUserDefined = TRUE;
sal_Bool bIsVisible;
@@ -4776,7 +4708,7 @@ bool ToolbarSaveInData::LoadToolbar(
sal_uInt16 nType( css::ui::ItemType::DEFAULT );
bool bItem = GetToolbarItemData( xToolbarSettings, nIndex, aCommandURL,
- aHelpURL, aLabel, nType, bIsVisible, nStyle, xSubMenu );
+ aLabel, nType, bIsVisible, nStyle, xSubMenu );
if ( bItem )
{
@@ -4817,7 +4749,6 @@ bool ToolbarSaveInData::LoadToolbar(
aLabel, aCommandURL, TRUE );
pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
pEntry->SetVisible( bIsVisible );
pEntries->push_back( pEntry );
@@ -4829,7 +4760,6 @@ bool ToolbarSaveInData::LoadToolbar(
SvxConfigEntry* pEntry = new SvxConfigEntry(
aLabel, aCommandURL, FALSE );
pEntry->SetUserDefined( bIsUserDefined );
- pEntry->SetHelpURL( aHelpURL );
pEntry->SetVisible( bIsVisible );
pEntry->SetStyle( nStyle );
pEntries->push_back( pEntry );