Skip to content

Commit

Permalink
convert CUI module from String to OUString
Browse files Browse the repository at this point in the history
Change-Id: I79bdab414d448a0d619b80857d7b31633c116f81
  • Loading branch information
Noel Grandin committed Oct 1, 2013
1 parent 183f260 commit ea2c80b
Show file tree
Hide file tree
Showing 123 changed files with 1,357 additions and 1,359 deletions.
42 changes: 21 additions & 21 deletions cui/source/customize/acccfg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ class SfxAccCfgLBoxString_Impl : public SvLBoxString
public:
SfxAccCfgLBoxString_Impl( SvTreeListEntry* pEntry,
sal_uInt16 nFlags,
const String& sText );
const OUString& sText );

virtual ~SfxAccCfgLBoxString_Impl();

Expand All @@ -629,7 +629,7 @@ class SfxAccCfgLBoxString_Impl : public SvLBoxString
//-----------------------------------------------
SfxAccCfgLBoxString_Impl::SfxAccCfgLBoxString_Impl( SvTreeListEntry* pEntry,
sal_uInt16 nFlags,
const String& sText )
const OUString& sText )
: SvLBoxString(pEntry, nFlags, sText)
{
}
Expand Down Expand Up @@ -745,7 +745,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt
{
FreeResource();

aFilterAllStr = String( SfxResId( STR_SFX_FILTERNAME_ALL ) );
aFilterAllStr = SfxResId( STR_SFX_FILTERNAME_ALL );

// install handler functions
aChangeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, ChangeHdl ));
Expand Down Expand Up @@ -870,8 +870,8 @@ void SfxAcceleratorConfigPage::InitAccCfg()
original SvTabListBox!
*/
void SfxAcceleratorConfigPage::CreateCustomItems( SvTreeListEntry* pEntry,
const String& sCol1 ,
const String& sCol2 )
const OUString& sCol1 ,
const OUString& sCol2 )
{
SfxAccCfgLBoxString_Impl* pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol1);
pEntry->ReplaceItem(pStringItem, 1);
Expand Down Expand Up @@ -910,8 +910,8 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler
for (i1=0; i1<c1; ++i1)
{
KeyCode aKey = KEYCODE_ARRAY[i1];
String sKey = aKey.GetName();
if (!sKey.Len())
OUString sKey = aKey.GetName();
if (sKey.isEmpty())
continue;
TAccInfo* pEntry = new TAccInfo(i1, nListPos, aKey);
SvTreeListEntry* pLBEntry = aEntriesBox.InsertEntryToColumn(sKey, 0L, LIST_APPEND, 0xFFFF);
Expand All @@ -928,7 +928,7 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler
{
const css::awt::KeyEvent& aAWTKey = lKeys[i2];
OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey);
String sLabel = GetLabel4Command(sCommand);
OUString sLabel = GetLabel4Command(sCommand);
KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey);
sal_uInt16 nPos = MapKeyCodeToPos(aKeyCode);

Expand Down Expand Up @@ -961,7 +961,7 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler
TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData();

pEntry->m_bIsConfigurable = sal_False;
CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), String());
CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), OUString());
}
}

Expand Down Expand Up @@ -1046,9 +1046,9 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, ChangeHdl)
{
sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
String sNewCommand = pFunctionBox->GetCurCommand();
String sLabel = pFunctionBox->GetCurLabel();
if (!sLabel.Len())
OUString sNewCommand = pFunctionBox->GetCurCommand();
OUString sLabel = pFunctionBox->GetCurLabel();
if (sLabel.isEmpty())
sLabel = GetLabel4Command(sNewCommand);

pEntry->m_sCommand = sNewCommand;
Expand All @@ -1068,7 +1068,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RemoveHdl)

// remove function name from selected entry
sal_uInt16 nCol = aEntriesBox.TabCount() - 1;
aEntriesBox.SetEntryText( String(), nPos, nCol );
aEntriesBox.SetEntryText( OUString(), nPos, nCol );
pEntry->m_sCommand = OUString();

((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
Expand All @@ -1079,7 +1079,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RemoveHdl)
IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox )
{
// disable help
Help::ShowBalloon( this, Point(), String() );
Help::ShowBalloon( this, Point(), OUString() );
if ( pListBox == &aEntriesBox )
{
sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
Expand Down Expand Up @@ -1384,7 +1384,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl)
}

//-----------------------------------------------
void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle )
void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const OUString& rTitle )
{
bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS );
short nDialogType = bSave ? css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION
Expand Down Expand Up @@ -1429,8 +1429,8 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet )

// change te description of the radio button, which switch to the module
// dependend accelerator configuration
String sButtonText = aModuleButton.GetText();
sButtonText.SearchAndReplace(OUString("$(MODULE)"), m_sModuleUIName);
OUString sButtonText = aModuleButton.GetText();
sButtonText = sButtonText.replaceFirst("$(MODULE)", m_sModuleUIName);
aModuleButton.SetText(sButtonText);

if (m_xModule.is())
Expand Down Expand Up @@ -1495,8 +1495,8 @@ OUString SfxAcceleratorConfigPage::GetLabel4Command(const OUString& sCommand)
if (xModuleConf.is())
{
::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
String sLabel = String(lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, OUString()));
if (sLabel.Len())
OUString sLabel = lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, OUString());
if (!sLabel.isEmpty())
return sLabel;
}
}
Expand All @@ -1515,7 +1515,7 @@ OUString SfxAcceleratorConfigPage::GetLabel4Command(const OUString& sCommand)
}
else
{
String aRet(OUString("Symbols: "));
OUString aRet("Symbols: ");
sal_Int32 nPos = sCommand.indexOf(".uno:InsertSymbol?Symbols:string=");
if ( nPos == 0 )
{
Expand All @@ -1533,7 +1533,7 @@ SfxTabPage* SfxAcceleratorConfigPage::Create( Window* pParent, const SfxItemSet&
}

//-----------------------------------------------
css::uno::Reference< css::frame::XModel > SfxAcceleratorConfigPage::SearchForAlreadyLoadedDoc(const String& /*sName*/)
css::uno::Reference< css::frame::XModel > SfxAcceleratorConfigPage::SearchForAlreadyLoadedDoc(const OUString& /*sName*/)
{
return css::uno::Reference< css::frame::XModel >();
}
Expand Down
71 changes: 33 additions & 38 deletions cui/source/customize/cfg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,12 @@ MenuSaveInData::GetEntries()

if ( m_xMenuSettings.is() )
{
LoadSubMenus( m_xMenuSettings, String(), pRootEntry );
LoadSubMenus( m_xMenuSettings, OUString(), pRootEntry );
}
else if ( GetDefaultData() != NULL )
{
// If the doc has no config settings use module config settings
LoadSubMenus( GetDefaultData()->m_xMenuSettings, String(), pRootEntry );
LoadSubMenus( GetDefaultData()->m_xMenuSettings, OUString(), pRootEntry );
}
}

Expand Down Expand Up @@ -1349,7 +1349,7 @@ MenuSaveInData::Reset()
class PopupPainter : public SvLBoxString
{
public:
PopupPainter( SvTreeListEntry* pEntry, const String& rStr )
PopupPainter( SvTreeListEntry* pEntry, const OUString& rStr )
: SvLBoxString( pEntry, 0, rStr )
{ }

Expand Down Expand Up @@ -1560,11 +1560,11 @@ SvxDescriptionEdit::SvxDescriptionEdit( Window* pParent, const ResId& _rId ) :

// -----------------------------------------------------------------------

void SvxDescriptionEdit::SetNewText( const String& _rText )
void SvxDescriptionEdit::SetNewText( const OUString& _rText )
{
String sTemp( _rText );
OUString sTemp( _rText );
sal_Bool bShow = sal_False;
if ( sTemp.Len() > 0 )
if ( !sTemp.isEmpty() )
{
// detect if a scrollbar is necessary
Rectangle aRect = GetTextRect( m_aRealRect, sTemp, TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE );
Expand All @@ -1575,7 +1575,7 @@ void SvxDescriptionEdit::SetNewText( const String& _rText )
GetVScrollBar()->Show( bShow );

if ( bShow )
sTemp += '\n';
sTemp += "\n";

SetText( sTemp );
}
Expand Down Expand Up @@ -1615,8 +1615,8 @@ SvxConfigPage::SvxConfigPage(
aDescriptionField.SetAutoScroll( sal_True );
aDescriptionField.EnableCursor( sal_False );

aMoveUpButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_UP)));
aMoveDownButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_DOWN)));
aMoveUpButton.SetAccessibleName(CUI_RES(BUTTON_STR_UP));
aMoveDownButton.SetAccessibleName(CUI_RES(BUTTON_STR_DOWN));
aMoveUpButton.SetAccessibleRelationMemberOf(&aContentsSeparator);
aMoveDownButton.SetAccessibleRelationMemberOf(&aContentsSeparator);
aNewTopLevelButton.SetAccessibleRelationMemberOf(&aTopLevelSeparator);
Expand Down Expand Up @@ -2000,7 +2000,7 @@ void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect )
}

void SvxConfigPage::AddSubMenusToUI(
const String& rBaseTitle, SvxConfigEntry* pParentData )
const OUString& rBaseTitle, SvxConfigEntry* pParentData )
{
SvxEntries::const_iterator iter = pParentData->GetEntries()->begin();
SvxEntries::const_iterator end = pParentData->GetEntries()->end();
Expand Down Expand Up @@ -2054,10 +2054,10 @@ SvxEntries* SvxConfigPage::FindParentForChild(
SvTreeListEntry* SvxConfigPage::AddFunction(
SvTreeListEntry* pTarget, bool bFront, bool bAllowDuplicates )
{
String aDisplayName = pSelectorDlg->GetSelectedDisplayName();
String aURL = pSelectorDlg->GetScriptURL();
OUString aDisplayName = pSelectorDlg->GetSelectedDisplayName();
OUString aURL = pSelectorDlg->GetScriptURL();

if ( !aURL.Len() )
if ( aURL.isEmpty() )
{
return NULL;
}
Expand Down Expand Up @@ -2192,7 +2192,7 @@ SvTreeListEntry* SvxConfigPage::InsertEntryIntoUI(
return pNewEntry;
}

IMPL_LINK( SvxConfigPage, AsyncInfoMsg, String*, pMsg )
IMPL_LINK( SvxConfigPage, AsyncInfoMsg, OUString*, pMsg )
{
(void)pMsg;

Expand Down Expand Up @@ -2479,10 +2479,9 @@ bool SvxMenuConfigPage::DeleteSelectedContent()

short SvxMenuConfigPage::QueryReset()
{
String msg =
String( CUI_RES( RID_SVXSTR_CONFIRM_MENU_RESET ) );
OUString msg = CUI_RES( RID_SVXSTR_CONFIRM_MENU_RESET );

String saveInName = aSaveInListBox.GetEntry(
OUString saveInName = aSaveInListBox.GetEntry(
aSaveInListBox.GetSelectEntryPos() );

OUString label = replaceSaveInName( msg, saveInName );
Expand Down Expand Up @@ -2536,7 +2535,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
SvxConfigEntry* pMenuData = GetTopLevelSelection();

OUString aNewName( stripHotKey( pMenuData->GetName() ) );
String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );

SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU );
Expand Down Expand Up @@ -2594,7 +2593,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
case ID_ADD_SUBMENU:
{
OUString aNewName;
String aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );

SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
Expand Down Expand Up @@ -2640,7 +2639,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
(SvxConfigEntry*) pActEntry->GetUserData();

OUString aNewName( stripHotKey( pEntry->GetName() ) );
String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );

SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM );
Expand Down Expand Up @@ -2719,8 +2718,7 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton )
pSelectorDlg->SetAddHdl(
LINK( this, SvxMenuConfigPage, AddFunctionHdl ) );

pSelectorDlg->SetDialogDescription( String(
CUI_RES( RID_SVXSTR_MENU_ADDCOMMANDS_DESCRIPTION ) ) );
pSelectorDlg->SetDialogDescription( CUI_RES( RID_SVXSTR_MENU_ADDCOMMANDS_DESCRIPTION ) );
}

// Position the Script Selector over the Add button so it is
Expand Down Expand Up @@ -2790,8 +2788,7 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
if ( bCreateMenu )
{
// Generate custom name for new menu
String prefix =
String( CUI_RES( RID_SVXSTR_NEW_MENU ) );
OUString prefix = CUI_RES( RID_SVXSTR_NEW_MENU );

OUString newname = generateCustomName( prefix, entries );
OUString newurl = generateCustomMenuURL( pEntries );
Expand Down Expand Up @@ -2857,8 +2854,8 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
aMoveDownButton.SetClickHdl (
LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );

aMoveUpButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_UP)));
aMoveDownButton.SetAccessibleName(String(CUI_RES(BUTTON_STR_DOWN)));
aMoveUpButton.SetAccessibleName(CUI_RES(BUTTON_STR_UP));
aMoveDownButton.SetAccessibleName(CUI_RES(BUTTON_STR_DOWN));
}

IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
Expand Down Expand Up @@ -3273,7 +3270,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
case ID_RENAME:
{
OUString aNewName( stripHotKey( pToolbar->GetName() ) );
String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );

SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
Expand Down Expand Up @@ -3364,7 +3361,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
(SvxConfigEntry*) pActEntry->GetUserData();

OUString aNewName( stripHotKey( pEntry->GetName() ) );
String aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );

SvxNameDialog* pNameDialog = new SvxNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
Expand Down Expand Up @@ -4539,10 +4536,9 @@ void SvxToolbarConfigPage::UpdateButtonStates()

short SvxToolbarConfigPage::QueryReset()
{
String msg =
String( CUI_RES( RID_SVXSTR_CONFIRM_TOOLBAR_RESET ) );
OUString msg = CUI_RES( RID_SVXSTR_CONFIRM_TOOLBAR_RESET );

String saveInName = aSaveInListBox.GetEntry(
OUString saveInName = aSaveInListBox.GetEntry(
aSaveInListBox.GetSelectEntryPos() );

OUString label = replaceSaveInName( msg, saveInName );
Expand Down Expand Up @@ -4630,8 +4626,7 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton )
{
(void)pButton;

String prefix =
String( CUI_RES( RID_SVXSTR_NEW_TOOLBAR ) );
OUString prefix = CUI_RES( RID_SVXSTR_NEW_TOOLBAR );

OUString aNewName =
generateCustomName( prefix, GetSaveInData()->GetEntries() );
Expand Down Expand Up @@ -5261,7 +5256,7 @@ IMPL_LINK( SvxIconSelectorDialog, DeleteHdl, PushButton *, pButton )
{
(void)pButton;

OUString message = String( CUI_RES( RID_SVXSTR_DELETE_ICON_CONFIRM ) );
OUString message = CUI_RES( RID_SVXSTR_DELETE_ICON_CONFIRM );
bool ret = WarningBox( this, WinBits(WB_OK_CANCEL), message ).Execute();

if ( ret == RET_OK )
Expand Down Expand Up @@ -5560,22 +5555,22 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL )
SvxIconReplacementDialog :: SvxIconReplacementDialog(
Window *pWindow, const OUString& aMessage, bool /*bYestoAll*/ )
:
MessBox( pWindow, WB_DEF_YES, String( CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ) ), String( CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) ) )
MessBox( pWindow, WB_DEF_YES, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) )

{
SetImage( WarningBox::GetStandardImage() );
SetMessText( ReplaceIconName( aMessage ) );
RemoveButton( 1 );
AddButton( BUTTON_YES, 2, 0 );
AddButton( String( CUI_RES( RID_SVXSTR_YESTOALL ) ), 5, 0 );
AddButton( CUI_RES( RID_SVXSTR_YESTOALL ), 5, 0 );
AddButton( BUTTON_NO, 3, 0 );
AddButton( BUTTON_CANCEL, 4, 0 );
}

SvxIconReplacementDialog :: SvxIconReplacementDialog(
Window *pWindow, const OUString& aMessage )
:
MessBox( pWindow, WB_YES_NO_CANCEL, String( CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ) ), String( CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) ) )
MessBox( pWindow, WB_YES_NO_CANCEL, CUI_RES( RID_SVXSTR_REPLACE_ICON_CONFIRM ), CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) )
{
SetImage( WarningBox::GetStandardImage() );
SetMessText( ReplaceIconName( aMessage ));
Expand All @@ -5584,7 +5579,7 @@ MessBox( pWindow, WB_YES_NO_CANCEL, String( CUI_RES( RID_SVXSTR_REPLACE_ICON_CON
OUString SvxIconReplacementDialog :: ReplaceIconName( const OUString& rMessage )
{
OUString name;
OUString message = String( CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING ) );
OUString message = CUI_RES( RID_SVXSTR_REPLACE_ICON_WARNING );
OUString placeholder("%ICONNAME" );
sal_Int32 pos = message.indexOf( placeholder );
if ( pos != -1 )
Expand Down
Loading

0 comments on commit ea2c80b

Please sign in to comment.