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