diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-07-10 18:21:24 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-07-10 18:21:24 +0200 |
commit | f24b1da07ebfbc95e76af93fc9c7133f7d52daa5 (patch) | |
tree | 1d666fcdca0e60613c321b05a1371ab53fdb6e88 /fpicker | |
parent | f8a801d058e39e89a71c85afdb0b1c1718f36b45 (diff) |
CWS changehid: #i111874#: change code to support HelpIds as byte strings
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/OfficeControlAccess.cxx | 22 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 74 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hrc | 32 |
3 files changed, 49 insertions, 79 deletions
diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index c51a326477fa..1e34b2eee840 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -205,32 +205,26 @@ namespace svt { String sHelpURL( _rURL ); if ( COMPARE_EQUAL == sHelpURL.CompareIgnoreCaseToAscii( "HID:", sizeof( "HID:" ) - 1 ) ) - { - // FIXME: HELPID - rtl::OString sID( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); - if ( _bFileView ) - // the file view "overloaded" the SetHelpId - static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); - else - _pControl->SetHelpId( sID ); - } + sHelpURL = sHelpURL.Copy( sizeof( "HID:" ) - 1 ); + + // URLs should always be UTF8 encoded and escaped + rtl::OString sID( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); + if ( _bFileView ) + // the file view "overloaded" the SetHelpId + static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); else - { - DBG_ERRORFILE( "OControlAccess::setHelpURL: unsupported help URL type!" ); - } + _pControl->SetHelpId( sID ); } //--------------------------------------------------------------------- ::rtl::OUString OControlAccess::getHelpURL( Window* _pControl, sal_Bool _bFileView ) { - // FIXME: HELPID rtl::OString aHelpId = _pControl->GetHelpId(); if ( _bFileView ) // the file view "overloaded" the SetHelpId aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); rtl::OUString sHelpURL( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); - return sHelpURL; } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 87df9e404b6a..c7a18050c3ff 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -600,8 +600,7 @@ void SvtFileDialog::Init_Impl bool bSaveMode = ( FILEDLG_MODE_SAVE == _pImp->_eMode ); pURLBox->SetNoURLSelection( bSaveMode ); - // FIXME: HELPID - _pImp->_pEdFileName->SetHelpId( ""/*HID_FILEDLG_AUTOCOMPLETEBOX*/ ); + _pImp->_pEdFileName->SetHelpId( HID_FILEDLG_AUTOCOMPLETEBOX ); _pImp->_pFtFileType = new FixedText( this, SvtResId( FT_EXPLORERFILE_FILETYPE ) ); _pImp->CreateFilterListControl( this, SvtResId( LB_EXPLORERFILE_FILETYPE ) ); @@ -650,8 +649,7 @@ void SvtFileDialog::Init_Impl _pFileView->SetUrlFilter( &m_aURLFilter ); _pFileView->EnableAutoResize(); - // FIXME: HELPID - _pFileView->SetHelpId( ""/*HID_FILEDLG_STANDARD*/ ); + _pFileView->SetHelpId( HID_FILEDLG_STANDARD ); _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP ); // Positionen und Groessen der Knoepfe bestimmen. @@ -703,8 +701,7 @@ void SvtFileDialog::Init_Impl if ( nStyle & SFXWB_READONLY ) { _pCbReadOnly = new CheckBox( this, SvtResId( CB_EXPLORERFILE_READONLY ) ); - // FIXME: HELPID - _pCbReadOnly->SetHelpId( ""/*HID_FILEOPEN_READONLY*/ ); + _pCbReadOnly->SetHelpId( HID_FILEOPEN_READONLY ); _pCbReadOnly->SetText( SvtResId( STR_SVT_FILEPICKER_READONLY ) ); AddControl( _pCbReadOnly ); ReleaseOwnerShip( _pCbReadOnly ); @@ -813,23 +810,15 @@ void SvtFileDialog::Init_Impl { // different help ids if in save-as mode // 90744 - 09.08.2001 - frank.schoenheit@sun.com - // FIXME: HELPID - SetHelpId( ""/*HID_FILESAVE_DIALOG*/ ); - - // FIXME: HELPID - _pImp->_pEdFileName->SetHelpId( ""/*HID_FILESAVE_FILEURL*/ ); - // FIXME: HELPID - _pImp->_pBtnFileOpen->SetHelpId( ""/*HID_FILESAVE_DOSAVE*/ ); - // FIXME: HELPID - _pImp->_pBtnNewFolder->SetHelpId( ""/*HID_FILESAVE_CREATEDIRECTORY*/ ); - // FIXME: HELPID - _pImp->_pBtnStandard->SetHelpId( ""/*HID_FILESAVE_DEFAULTDIRECTORY*/ ); - // FIXME: HELPID - _pImp->_pBtnUp->SetHelpId( ""/*HID_FILESAVE_LEVELUP*/ ); - // FIXME: HELPID - _pImp->GetFilterListControl()->SetHelpId( ""/*HID_FILESAVE_FILETYPE*/ ); - // FIXME: HELPID - _pFileView->SetHelpId( ""/*HID_FILESAVE_FILEVIEW*/ ); + SetHelpId( HID_FILESAVE_DIALOG ); + + _pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL ); + _pImp->_pBtnFileOpen->SetHelpId( HID_FILESAVE_DOSAVE ); + _pImp->_pBtnNewFolder->SetHelpId( HID_FILESAVE_CREATEDIRECTORY ); + _pImp->_pBtnStandard->SetHelpId( HID_FILESAVE_DEFAULTDIRECTORY ); + _pImp->_pBtnUp->SetHelpId( HID_FILESAVE_LEVELUP ); + _pImp->GetFilterListControl()->SetHelpId( HID_FILESAVE_FILETYPE ); + _pFileView->SetHelpId( HID_FILESAVE_FILEVIEW ); // formerly, there was only _pLbFileVersion, which was used for 3 different // use cases. For reasons of maintainability, I introduced extra members (_pLbTemplates, _pLbImageTemplates) @@ -838,23 +827,16 @@ void SvtFileDialog::Init_Impl // tests I made lead to a dialog where _no_ of the three list boxes was present. // 96930 - 15.08.2002 - fs@openoffice.org if ( _pImp->_pLbFileVersion ) - // FIXME: HELPID - _pImp->_pLbFileVersion->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); + _pImp->_pLbFileVersion->SetHelpId( HID_FILESAVE_TEMPLATE ); if ( _pImp->_pLbTemplates ) - // FIXME: HELPID - _pImp->_pLbTemplates->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); + _pImp->_pLbTemplates->SetHelpId( HID_FILESAVE_TEMPLATE ); if ( _pImp->_pLbImageTemplates ) - // FIXME: HELPID - _pImp->_pLbImageTemplates->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); + _pImp->_pLbImageTemplates->SetHelpId( HID_FILESAVE_TEMPLATE ); - // FIXME: HELPID - if ( _pImp->_pCbPassword ) _pImp->_pCbPassword->SetHelpId( ""/*HID_FILESAVE_SAVEWITHPASSWORD*/ ); - // FIXME: HELPID - if ( _pImp->_pCbAutoExtension ) _pImp->_pCbAutoExtension->SetHelpId( ""/*HID_FILESAVE_AUTOEXTENSION*/ ); - // FIXME: HELPID - if ( _pImp->_pCbOptions ) _pImp->_pCbOptions->SetHelpId( ""/*HID_FILESAVE_CUSTOMIZEFILTER*/ ); - // FIXME: HELPID - if ( _pCbSelection ) _pCbSelection->SetHelpId( ""/*HID_FILESAVE_SELECTION*/ ); + if ( _pImp->_pCbPassword ) _pImp->_pCbPassword->SetHelpId( HID_FILESAVE_SAVEWITHPASSWORD ); + if ( _pImp->_pCbAutoExtension ) _pImp->_pCbAutoExtension->SetHelpId( HID_FILESAVE_AUTOEXTENSION ); + if ( _pImp->_pCbOptions ) _pImp->_pCbOptions->SetHelpId( HID_FILESAVE_CUSTOMIZEFILTER ); + if ( _pCbSelection ) _pCbSelection->SetHelpId( HID_FILESAVE_SELECTION ); } // correct the z-order of the controls @@ -2999,8 +2981,7 @@ void SvtFileDialog::AddControls_Impl( ) { _pCbLinkBox = new CheckBox( this ); _pCbLinkBox ->SetText( SvtResId( STR_SVT_FILEPICKER_INSERT_AS_LINK ) ); - // FIXME: HELPID - _pCbLinkBox ->SetHelpId( ""/*HID_FILEDLG_LINK_CB*/ ); + _pCbLinkBox ->SetHelpId( HID_FILEDLG_LINK_CB ); AddControl( _pCbLinkBox ); ReleaseOwnerShip( _pCbLinkBox ); _pCbLinkBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); @@ -3017,8 +2998,7 @@ void SvtFileDialog::AddControls_Impl( ) // "Vorschau" _pCbPreviewBox = new CheckBox( this ); _pCbPreviewBox->SetText( SvtResId( STR_SVT_FILEPICKER_SHOW_PREVIEW ) ); - // FIXME: HELPID - _pCbPreviewBox->SetHelpId( ""/*HID_FILEDLG_PREVIEW_CB*/ ); + _pCbPreviewBox->SetHelpId( HID_FILEDLG_PREVIEW_CB ); AddControl( _pCbPreviewBox ); ReleaseOwnerShip( _pCbPreviewBox ); _pCbPreviewBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); @@ -3066,8 +3046,7 @@ void SvtFileDialog::AddControls_Impl( ) { _pPbPlay = new PushButton( this ); _pPbPlay->SetText( SvtResId( STR_SVT_FILEPICKER_PLAY ) ); - // FIXME: HELPID - _pPbPlay->SetHelpId( ""/*HID_FILESAVE_DOPLAY*/ ); + _pPbPlay->SetHelpId( HID_FILESAVE_DOPLAY ); AddControl( _pPbPlay ); ReleaseOwnerShip( _pPbPlay ); _pPbPlay->SetClickHdl( LINK( this, SvtFileDialog, PlayButtonHdl_Impl ) ); @@ -3079,8 +3058,7 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtFileVersion->SetText( SvtResId( STR_SVT_FILEPICKER_VERSION ) ); _pImp->_pLbFileVersion = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - // FIXME: HELPID - _pImp->_pLbFileVersion->SetHelpId( ""/*HID_FILEOPEN_VERSION*/ ); + _pImp->_pLbFileVersion->SetHelpId( HID_FILEOPEN_VERSION ); } else if ( _nExtraBits & SFX_EXTRA_TEMPLATES ) { @@ -3088,8 +3066,7 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_TEMPLATES ) ); _pImp->_pLbTemplates = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - // FIXME: HELPID - _pImp->_pLbTemplates->SetHelpId( ""/*HID_FILEOPEN_VERSION*/ ); + _pImp->_pLbTemplates->SetHelpId( HID_FILEOPEN_VERSION ); // This is strange. During the re-factoring during 96930, I discovered that this help id // is set in the "Templates mode". This was hidden in the previous implementation. // Shouldn't this be a more meaningfull help id. @@ -3101,8 +3078,7 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtImageTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_IMAGE_TEMPLATE ) ); _pImp->_pLbImageTemplates = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - // FIXME: HELPID - _pImp->_pLbImageTemplates->SetHelpId( ""/*HID_FILEOPEN_IMAGE_TEMPLATE*/ ); + _pImp->_pLbImageTemplates->SetHelpId( HID_FILEOPEN_IMAGE_TEMPLATE ); } } diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index 9f5997a4089c..e27ec2cbe3bc 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -86,22 +86,22 @@ #define SID_SFX_START 5000 #define SID_OPENURL (SID_SFX_START + 596) -#define HID_FILEDLG_STANDARD (HID_SFX_START + 27) -#define HID_FILEDLG_MANAGER (HID_SFX_START + 28) -#define HID_FILEDLG_URL (HID_SFX_START + 29) -#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31) -#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32) - -#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218) -#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219) -#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220) -#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221) -#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222) -#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223) -#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224) -#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225) -#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226) -#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227) +#define HID_FILEDLG_STANDARD "FPICKER_HID_FILEDLG_STANDARD" +#define HID_FILEDLG_MANAGER "FPICKER_HID_FILEDLG_MANAGER" +#define HID_FILEDLG_URL "FPICKER_HID_FILEDLG_URL" +#define HID_FILEDLG_USE_PASSWD "FPICKER_HID_FILEDLG_USE_PASSWD" +#define HID_FILEDLG_READ_ONLY "FPICKER_HID_FILEDLG_READ_ONLY" + +#define HID_FILEDLG_AUTOCOMPLETEBOX "FPICKER_HID_FILEDLG_AUTOCOMPLETEBOX" +#define HID_FILEDLG_SAVE_BTN "FPICKER_HID_FILEDLG_SAVE_BTN" +#define HID_FILEDLG_SAVE_FILENAME "FPICKER_HID_FILEDLG_SAVE_FILENAME" +#define HID_FILEDLG_SAVE_FILETYPE "FPICKER_HID_FILEDLG_SAVE_FILETYPE" +#define HID_FILEDLG_INSERT_BTN "FPICKER_HID_FILEDLG_INSERT_BTN" +#define HID_FILEDLG_PATH_BTN "FPICKER_HID_FILEDLG_PATH_BTN" +#define HID_FILEDLG_PATH_FILENAME "FPICKER_HID_FILEDLG_PATH_FILENAME" +#define HID_FILEDLG_FOLDER_BTN "FPICKER_HID_FILEDLG_FOLDER_BTN" +#define HID_FILEDLG_FOLDER_FILENAME "FPICKER_HID_FILEDLG_FOLDER_FILENAME" +#define HID_FILEDLG_SRCHFOLDER_BTN "FPICKER_HID_FILEDLG_SRCHFOLDER_BTN" #endif |