Kaydet (Commit) b879adc3 authored tarafından Noel Grandin's avatar Noel Grandin

convert UUI module from String to OUString

Change-Id: I0dfcdb0b95112b5ee18b05d0c496059292be65c4
üst c82d9325
......@@ -20,7 +20,7 @@
#include "ids.hrc"
#include "alreadyopen.hxx"
AlreadyOpenQueryBox::AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage, sal_Bool bIsStoring ) :
AlreadyOpenQueryBox::AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const OUString& aMessage, sal_Bool bIsStoring ) :
MessBox(pParent, 0,
ResId(STR_ALREADYOPEN_TITLE, *pResMgr).toString(),
aMessage )
......
......@@ -24,7 +24,7 @@
class AlreadyOpenQueryBox : public MessBox
{
public:
AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage, sal_Bool bIsStoring );
AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const OUString& aMessage, sal_Bool bIsStoring );
~AlreadyOpenQueryBox();
};
......
......@@ -76,7 +76,7 @@ FilterDialog::FilterDialog( Window* pParentWindow ,
@onerror -
@threadsafe no
*//*-*************************************************************************************************************/
void FilterDialog::SetURL( const String& sURL )
void FilterDialog::SetURL( const OUString& sURL )
{
// convert it and use given pure string as fallback if conversion failed
m_ftURL.SetText( impl_buildUIFileName(sURL) );
......@@ -142,8 +142,8 @@ bool FilterDialog::AskForFilter( FilterNameListPtr& pSelectedItem )
{
if( ModalDialog::Execute() == RET_OK )
{
String sEntry = m_lbFilters.GetSelectEntry();
if( sEntry.Len() > 0 )
OUString sEntry = m_lbFilters.GetSelectEntry();
if( !sEntry.isEmpty() )
{
int nPos = m_lbFilters.GetSelectEntryPos();
if( nPos < (int)(m_pFilterNames->size()) )
......@@ -183,7 +183,7 @@ class StringCalculator : public ::cppu::WeakImplHelper1< ::com::sun::star::util:
sal_Int32 SAL_CALL queryStringWidth( const OUString& sString ) throw( ::com::sun::star::uno::RuntimeException )
{
return (sal_Int32)(m_pDevice->GetTextWidth(String(sString)));
return (sal_Int32)(m_pDevice->GetTextWidth(sString));
}
private:
......@@ -204,7 +204,7 @@ class StringCalculator : public ::cppu::WeakImplHelper1< ::com::sun::star::util:
@onerror We return given name without any changes.
@threadsafe no
*//*-*************************************************************************************************************/
String FilterDialog::impl_buildUIFileName( const String& sName )
OUString FilterDialog::impl_buildUIFileName( const OUString& sName )
{
OUString sShortName( sName );
......
......@@ -36,8 +36,8 @@ namespace uui
struct FilterNamePair
{
String sInternal;
String sUI ;
OUString sInternal;
OUString sUI ;
};
typedef ::std::vector< FilterNamePair > FilterNameList ;
......@@ -49,14 +49,14 @@ class FilterDialog : public ModalDialog
public:
FilterDialog ( Window* pParentWindow ,
ResMgr* pResMgr );
void SetURL ( const String& sURL );
void SetURL ( const OUString& sURL );
void ChangeFilters( const FilterNameList* pFilterNames );
bool AskForFilter ( FilterNameListPtr& pSelectedItem );
// helper (or hided functions!)
private:
short Execute() { return RET_CANCEL; };
String impl_buildUIFileName( const String& sURL );
OUString impl_buildUIFileName( const OUString& sURL );
// member
private:
......
......@@ -72,9 +72,9 @@ executeLoginDialog(
bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials();
sal_uInt16 nFlags = 0;
if (rInfo.GetPath().Len() == 0)
if (rInfo.GetPath().isEmpty())
nFlags |= LF_NO_PATH;
if (rInfo.GetErrorText().Len() == 0)
if (rInfo.GetErrorText().isEmpty())
nFlags |= LF_NO_ERRORTEXT;
if (!bAccount)
nFlags |= LF_NO_ACCOUNT;
......@@ -90,7 +90,7 @@ executeLoginDialog(
boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui"));
boost::scoped_ptr< LoginDialog > xDialog(
new LoginDialog( pParent, nFlags, rInfo.GetServer(), rRealm, xManager.get()));
if (rInfo.GetErrorText().Len() != 0)
if (!rInfo.GetErrorText().isEmpty())
xDialog->SetErrorText(rInfo.GetErrorText());
xDialog->SetName(rInfo.GetUserName());
if (bAccount)
......@@ -353,12 +353,12 @@ handleAuthenticationRequest_(
}
}
// Empty user name can not be valid:
else if (aInfo.GetUserName().Len() != 0)
else if (!aInfo.GetUserName().isEmpty())
{
uno::Sequence< OUString >
aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2);
aPassList(aInfo.GetAccount().isEmpty() ? 1 : 2);
aPassList[0] = aInfo.GetPassword();
if (aInfo.GetAccount().Len() != 0)
if (!aInfo.GetAccount().isEmpty())
aPassList[1] = aInfo.GetAccount();
if (aInfo.GetIsRememberPassword())
......@@ -552,8 +552,8 @@ executePasswordDialog(
pDialog->SetMinLen(0);
rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
rInfo.SetPassword( bIsPasswordToModify ? String() : pDialog->GetPassword() );
rInfo.SetPasswordToModify( bIsPasswordToModify ? pDialog->GetPassword() : String() );
rInfo.SetPassword( bIsPasswordToModify ? OUString() : pDialog->GetPassword() );
rInfo.SetPasswordToModify( bIsPasswordToModify ? pDialog->GetPassword() : OUString() );
}
}
catch (std::bad_alloc const &)
......
......@@ -148,7 +148,7 @@ handleNoSuchFilterRequest_(
OUString("Name"), OUString());
aPair.sUI = lProps.getUnpackedValueOrDefault(
OUString("UIName"), OUString());
if ( (!aPair.sInternal.Len()) || (!aPair.sUI.Len() ) )
if ( aPair.sInternal.isEmpty() || aPair.sUI.isEmpty() )
{
continue;
}
......
......@@ -52,23 +52,25 @@ using namespace com::sun::star;
namespace {
String
getContentPart( const String& _rRawString )
OUString
getContentPart( const OUString& _rRawString )
{
// search over some parts to find a string
static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };
String sPart;
OUString sPart;
int i = 0;
while ( aIDs[i] )
{
String sPartId = OUString::createFromAscii( aIDs[i++] );
xub_StrLen nContStart = _rRawString.Search( sPartId );
if ( nContStart != STRING_NOTFOUND )
OUString sPartId = OUString::createFromAscii( aIDs[i++] );
sal_Int32 nContStart = _rRawString.indexOf( sPartId );
if ( nContStart != -1 )
{
nContStart = nContStart + sPartId.Len();
xub_StrLen nContEnd
= _rRawString.Search( sal_Unicode( ',' ), nContStart );
sPart = String( _rRawString, nContStart, nContEnd - nContStart );
nContStart = nContStart + sPartId.getLength();
sal_Int32 nContEnd = _rRawString.indexOf( sal_Unicode( ',' ), nContStart );
if ( nContEnd != -1 )
sPart = _rRawString.copy( nContStart, nContEnd - nContStart );
else
sPart = _rRawString.copy( nContStart );
break;
}
}
......
......@@ -315,7 +315,7 @@ void LoginDialog::SetUseSystemCredentials( sal_Bool bUse )
void LoginDialog::ClearPassword()
{
aPasswordED.SetText( String() );
aPasswordED.SetText( OUString() );
if ( aNameED.GetText().isEmpty() )
aNameED.GrabFocus();
......@@ -325,7 +325,7 @@ void LoginDialog::ClearPassword()
void LoginDialog::ClearAccount()
{
aAccountED.SetText( String() );
aAccountED.SetText( OUString() );
aAccountED.GrabFocus();
};
......
......@@ -77,21 +77,21 @@ public:
ResMgr * pResMgr );
virtual ~LoginDialog();
String GetPath() const { return aPathED.GetText(); }
void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); }
String GetName() const { return aNameED.GetText(); }
void SetName( const String& rNewName ) { aNameED.SetText( rNewName ); }
String GetPassword() const { return aPasswordED.GetText(); }
void SetPassword( const String& rNew ) { aPasswordED.SetText( rNew ); }
String GetAccount() const { return aAccountED.GetText(); }
void SetAccount( const String& rNew ) { aAccountED.SetText( rNew ); }
OUString GetPath() const { return aPathED.GetText(); }
void SetPath( const OUString& rNewPath ) { aPathED.SetText( rNewPath ); }
OUString GetName() const { return aNameED.GetText(); }
void SetName( const OUString& rNewName ) { aNameED.SetText( rNewName ); }
OUString GetPassword() const { return aPasswordED.GetText(); }
void SetPassword( const OUString& rNew ) { aPasswordED.SetText( rNew ); }
OUString GetAccount() const { return aAccountED.GetText(); }
void SetAccount( const OUString& rNew ) { aAccountED.SetText( rNew ); }
sal_Bool IsSavePassword() const { return aSavePasswdBtn.IsChecked(); }
void SetSavePassword( sal_Bool bSave ) { aSavePasswdBtn.Check( bSave ); }
void SetSavePasswordText( const String& rTxt ) { aSavePasswdBtn.SetText( rTxt ); }
void SetSavePasswordText( const OUString& rTxt ) { aSavePasswdBtn.SetText( rTxt ); }
sal_Bool IsUseSystemCredentials() const { return aUseSysCredsCB.IsChecked(); }
void SetUseSystemCredentials( sal_Bool bUse );
void SetErrorText( const String& rTxt ) { aErrorInfo.SetText( rTxt ); }
void SetLoginRequestText( const String& rTxt ) { aRequestInfo.SetText( rTxt ); }
void SetErrorText( const OUString& rTxt ) { aErrorInfo.SetText( rTxt ); }
void SetLoginRequestText( const OUString& rTxt ) { aRequestInfo.SetText( rTxt ); }
void ClearPassword();
void ClearAccount();
};
......
......@@ -35,14 +35,14 @@
class LoginErrorInfo
{
private:
String m_aTitle;
String m_aServer;
String m_aAccount;
String m_aUserName;
String m_aPassword;
String m_aPasswordToModify;
String m_aPath;
String m_aErrorText;
OUString m_aTitle;
OUString m_aServer;
OUString m_aAccount;
OUString m_aUserName;
OUString m_aPassword;
OUString m_aPasswordToModify;
OUString m_aPath;
OUString m_aErrorText;
sal_uInt8 m_nFlags;
sal_uInt16 m_nRet;
bool m_bRecommendToOpenReadonly;
......@@ -54,15 +54,15 @@ public:
{
}
const String& GetTitle() const { return m_aTitle; }
const String& GetServer() const { return m_aServer; }
const String& GetAccount() const { return m_aAccount; }
const String& GetUserName() const { return m_aUserName; }
const String& GetPassword() const { return m_aPassword; }
const String& GetPasswordToModify() const { return m_aPasswordToModify; }
bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
const String& GetPath() const { return m_aPath; }
const String& GetErrorText() const { return m_aErrorText; }
const OUString& GetTitle() const { return m_aTitle; }
const OUString& GetServer() const { return m_aServer; }
const OUString& GetAccount() const { return m_aAccount; }
const OUString& GetUserName() const { return m_aUserName; }
const OUString& GetPassword() const { return m_aPassword; }
const OUString& GetPasswordToModify() const { return m_aPasswordToModify; }
bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; }
const OUString& GetPath() const { return m_aPath; }
const OUString& GetErrorText() const { return m_aErrorText; }
sal_Bool GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); }
sal_Bool GetIsRememberPersistent() const { return ( m_nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); }
sal_Bool GetIsRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); }
......@@ -75,23 +75,23 @@ public:
sal_uInt8 GetFlags() const { return m_nFlags; }
sal_uInt16 GetResult() const { return m_nRet; }
void SetTitle( const String& aTitle )
void SetTitle( const OUString& aTitle )
{ m_aTitle = aTitle; }
void SetServer( const String& aServer )
void SetServer( const OUString& aServer )
{ m_aServer = aServer; }
void SetAccount( const String& aAccount )
void SetAccount( const OUString& aAccount )
{ m_aAccount = aAccount; }
void SetUserName( const String& aUserName )
void SetUserName( const OUString& aUserName )
{ m_aUserName = aUserName; }
void SetPassword( const String& aPassword )
void SetPassword( const OUString& aPassword )
{ m_aPassword = aPassword; }
void SetPasswordToModify( const String& aPassword )
void SetPasswordToModify( const OUString& aPassword )
{ m_aPasswordToModify = aPassword; }
void SetRecommendToOpenReadonly( bool bVal )
{ m_bRecommendToOpenReadonly = bVal; }
void SetPath( const String& aPath )
void SetPath( const OUString& aPath )
{ m_aPath = aPath; }
void SetErrorText( const String& aErrorText )
void SetErrorText( const OUString& aErrorText )
{ m_aErrorText = aErrorText; }
void SetFlags( sal_uInt8 nFlags )
{ m_nFlags = nFlags; }
......
......@@ -42,11 +42,11 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl)
EndDialog( RET_OK );
else
{
String aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
OUString aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
aErrorBox.Execute();
m_pEDMasterPasswordCrt->SetText( String() );
m_pEDMasterPasswordRepeat->SetText( String() );
m_pEDMasterPasswordCrt->SetText( OUString() );
m_pEDMasterPasswordRepeat->SetText( OUString() );
m_pEDMasterPasswordCrt->GrabFocus();
}
return 1;
......
......@@ -48,7 +48,7 @@ MasterPasswordDialog::MasterPasswordDialog
get(m_pOKBtn, "ok");
if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
{
String aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
OUString aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
ErrorBox aErrorBox( pParent, WB_OK, aErrorMsg );
aErrorBox.Execute();
}
......
......@@ -71,7 +71,7 @@ NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr,
maBtnRename.SetClickHdl( aLink );
maBtnCancel.SetClickHdl( aLink );
String aInfo;
OUString aInfo;
if ( bAllowOverwrite )
{
aInfo = ResId(STR_RENAME_OR_REPLACE, *pResMgr).toString();
......@@ -88,8 +88,8 @@ NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr,
maSameName = ResId(STR_SAME_NAME_USED, *pResMgr).toString();
aInfo.SearchAndReplaceAscii( "%NAME", rClashingName );
aInfo.SearchAndReplaceAscii( "%FOLDER", aPath );
aInfo = aInfo.replaceFirst( "%NAME", rClashingName );
aInfo = aInfo.replaceFirst( "%FOLDER", aPath );
maFTMessage.SetText( aInfo );
if ( !rProposedNewName.isEmpty() )
maEDNewName.SetText( rProposedNewName );
......
......@@ -20,7 +20,7 @@
#include "ids.hrc"
#include "openlocked.hxx"
OpenLockedQueryBox::OpenLockedQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage ) :
OpenLockedQueryBox::OpenLockedQueryBox( Window* pParent, ResMgr* pResMgr, const OUString& aMessage ) :
MessBox(pParent, 0,
ResId(STR_OPENLOCKED_TITLE, *pResMgr).toString(),
aMessage )
......
......@@ -24,7 +24,7 @@
class OpenLockedQueryBox : public MessBox
{
public:
OpenLockedQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage );
OpenLockedQueryBox( Window* pParent, ResMgr* pResMgr, const OUString& aMessage );
~OpenLockedQueryBox();
};
......
......@@ -40,8 +40,8 @@ class PasswordDialog : public ModalDialog
CancelButton aCancelBtn;
HelpButton aHelpBtn;
FixedLine aFixedLine1;
sal_uInt16 nMinLen;
String aPasswdMismatch;
sal_uInt16 nMinLen;
OUString aPasswdMismatch;
DECL_LINK(OKHdl_Impl, void *);
......@@ -51,7 +51,7 @@ public:
bool bOpenToModify = false, bool bIsSimplePasswordRequest = false );
void SetMinLen( sal_uInt16 nMin ) { nMinLen = nMin; }
String GetPassword() const { return aEDPassword.GetText(); }
OUString GetPassword() const { return aEDPassword.GetText(); }
private:
::com::sun::star::task::PasswordRequestMode nDialogMode;
......
......@@ -45,19 +45,22 @@ using namespace ::com::sun::star;
namespace
{
String GetContentPart( const String& _rRawString, const String& _rPartId )
OUString GetContentPart( const OUString& _rRawString, const OUString& _rPartId )
{
String s;
OUString s;
xub_StrLen nContStart = _rRawString.Search( _rPartId );
if( nContStart != STRING_NOTFOUND )
sal_Int32 nContStart = _rRawString.indexOf( _rPartId );
if( nContStart != -1 )
{
nContStart = nContStart + _rPartId.Len();
nContStart = nContStart + _rPartId.getLength();
++nContStart; // now it's start of content, directly after Id
xub_StrLen nContEnd = _rRawString.Search( sal_Unicode( ',' ), nContStart );
sal_Int32 nContEnd = _rRawString.indexOf( sal_Unicode( ',' ), nContStart );
s = String( _rRawString, nContStart, nContEnd - nContStart );
if ( nContEnd != -1 )
s = _rRawString.copy( nContStart, nContEnd - nContStart );
else
s = _rRawString.copy( nContStart );
}
return s;
......@@ -103,7 +106,7 @@ short MacroWarning::Execute()
return ModalDialog::Execute();
}
void MacroWarning::SetDocumentURL( const String& rDocURL )
void MacroWarning::SetDocumentURL( const OUString& rDocURL )
{
maDocNameFI.SetText( rDocURL );
}
......@@ -222,10 +225,10 @@ void MacroWarning::InitControls()
}
// check if some buttontexts are to wide
String sText = maViewSignsBtn.GetText();
OUString sText = maViewSignsBtn.GetText();
long nTxtW = maViewSignsBtn.GetTextWidth( sText );
const long nOffset = 12;
if ( sText.Search( '~' ) == STRING_NOTFOUND )
if ( sText.indexOf( '~' ) == -1 )
nTxtW += nOffset;
long nBtnW = maViewSignsBtn.GetSizePixel().Width();
if ( nTxtW >= nBtnW )
......@@ -245,13 +248,13 @@ void MacroWarning::InitControls()
maSignsFI.SetSizePixel( aNewSize );
}
// if the button text (we compare with the longest of both) is too wide, then broaden the buttons
String sText1 = maEnableBtn.GetText();
OUString sText1 = maEnableBtn.GetText();
long nTxtW1 = maEnableBtn.GetTextWidth( sText1 );
if ( sText1.Search( '~' ) == STRING_NOTFOUND )
if ( sText1.indexOf( '~' ) == -1 )
nTxtW1 += nOffset;
String sText2 = maDisableBtn.GetText();
OUString sText2 = maDisableBtn.GetText();
long nTxtW2 = maDisableBtn.GetTextWidth( sText2 );
if ( sText2.Search( '~' ) == STRING_NOTFOUND )
if ( sText2.indexOf( '~' ) == -1 )
nTxtW2 += nOffset;
nTxtW = std::max( nTxtW1, nTxtW2 );
nBtnW = maEnableBtn.GetSizePixel().Width();
......@@ -334,12 +337,12 @@ void MacroWarning::SetStorage( const css::uno::Reference < css::embed::XStorage
{
mpInfos = &rInfos;
OUString aCN_Id("CN");
String s;
OUString s;
s = GetContentPart( rInfos[ 0 ].Signer->getSubjectName(), aCN_Id );
for( sal_Int32 i = 1 ; i < nCnt ; ++i )
{
s.AppendAscii( "\n" );
s += "\n";
s += GetContentPart( rInfos[ i ].Signer->getSubjectName(), aCN_Id );
}
......@@ -354,7 +357,7 @@ void MacroWarning::SetCertificate( const css::uno::Reference< css::security::XCe
if( mxCert.is() )
{
OUString aCN_Id("CN");
String s;
OUString s;
s = GetContentPart( mxCert->getSubjectName(), aCN_Id );
maSignsFI.SetText( s );
maViewSignsBtn.Enable();
......
......@@ -77,7 +77,7 @@ public:
virtual short Execute();
void SetDocumentURL( const String& rDocURL );
void SetDocumentURL( const OUString& rDocURL );
void SetStorage( const cssu::Reference < css::embed::XStorage >& rxStore,
const OUString& aODFVersion,
......
......@@ -20,7 +20,7 @@
#include "ids.hrc"
#include "trylater.hxx"
TryLaterQueryBox::TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage ) :
TryLaterQueryBox::TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const OUString& aMessage ) :
MessBox(pParent, 0,
ResId(STR_TRYLATER_TITLE, *pResMgr).toString(),
aMessage )
......
......@@ -24,7 +24,7 @@
class TryLaterQueryBox : public MessBox
{
public:
TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage );
TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const OUString& aMessage );
~TryLaterQueryBox();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment