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

convert sfx2/source/dialog/* from String to OUString

Change-Id: Ifa4c7ac957ea0c329cbe867c116465bcfb4f314e
üst f9e78cd4
...@@ -99,16 +99,16 @@ class DisposeListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang:: ...@@ -99,16 +99,16 @@ class DisposeListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize ) sal_Bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize )
{ {
if ( comphelper::string::getTokenCount(rStr, '/') != 4 ) if ( comphelper::string::getTokenCount(rStr, '/') != 4 )
return sal_False; return sal_False;
sal_Int32 nIdx = 0; sal_Int32 nIdx = 0;
rPos.X() = rStr.GetToken(0, '/', nIdx).ToInt32(); rPos.X() = rStr.getToken(0, '/', nIdx).toInt32();
rPos.Y() = rStr.GetToken(0, '/', nIdx).ToInt32(); rPos.Y() = rStr.getToken(0, '/', nIdx).toInt32();
rSize.Width() = rStr.GetToken(0, '/', nIdx).ToInt32(); rSize.Width() = rStr.getToken(0, '/', nIdx).toInt32();
rSize.Height() = rStr.GetToken(0, '/', nIdx).ToInt32(); rSize.Height() = rStr.getToken(0, '/', nIdx).toInt32();
// negative sizes are invalid // negative sizes are invalid
if ( rSize.Width() < 0 || rSize.Height() < 0 ) if ( rSize.Width() < 0 || rSize.Height() < 0 )
...@@ -117,19 +117,19 @@ sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize ) ...@@ -117,19 +117,19 @@ sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize )
return sal_True; return sal_True;
} }
sal_Bool GetSplitSizeFromString( const String& rStr, Size& rSize ) sal_Bool GetSplitSizeFromString( const OUString& rStr, Size& rSize )
{ {
xub_StrLen nIndex = rStr.Search( ',' ); sal_Int32 nIndex = rStr.indexOf( ',' );
if ( nIndex != STRING_NOTFOUND ) if ( nIndex != -1 )
{ {
String aStr = rStr.Copy( nIndex+1 ); OUString aStr = rStr.copy( nIndex+1 );
sal_Int32 nCount = comphelper::string::getTokenCount(aStr, ';'); sal_Int32 nCount = comphelper::string::getTokenCount(aStr, ';');
if ( nCount != 2 ) if ( nCount != 2 )
return sal_False; return sal_False;
rSize.Width() = aStr.GetToken(0, ';' ).ToInt32(); rSize.Width() = aStr.getToken(0, ';' ).toInt32();
rSize.Height() = aStr.GetToken(1, ';' ).ToInt32(); rSize.Height() = aStr.getToken(1, ';' ).toInt32();
// negative sizes are invalid // negative sizes are invalid
if ( rSize.Width() < 0 || rSize.Height() < 0 ) if ( rSize.Width() < 0 || rSize.Height() < 0 )
......
...@@ -124,7 +124,7 @@ void SfxModalDialog::GetDialogData_Impl() ...@@ -124,7 +124,7 @@ void SfxModalDialog::GetDialogData_Impl()
Any aUserItem = aDlgOpt.GetUserItem( USERITEM_NAME ); Any aUserItem = aDlgOpt.GetUserItem( USERITEM_NAME );
OUString aTemp; OUString aTemp;
if ( aUserItem >>= aTemp ) if ( aUserItem >>= aTemp )
aExtraData = String( aTemp ); aExtraData = aTemp;
} }
} }
...@@ -686,7 +686,7 @@ IMPL_LINK_NOARG(SfxSingleTabDialogBase, OKHdl_Impl) ...@@ -686,7 +686,7 @@ IMPL_LINK_NOARG(SfxSingleTabDialogBase, OKHdl_Impl)
{ {
// Save user data in IniManager. // Save user data in IniManager.
pImpl->m_pSfxPage->FillUserData(); pImpl->m_pSfxPage->FillUserData();
String sData( pImpl->m_pSfxPage->GetUserData() ); OUString sData( pImpl->m_pSfxPage->GetUserData() );
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) ); SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( sData ) ) ); aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( sData ) ) );
EndDialog( RET_OK ); EndDialog( RET_OK );
...@@ -855,11 +855,11 @@ void SfxNoLayoutSingleTabDialog::SetTabPage( SfxTabPage* pTabPage, ...@@ -855,11 +855,11 @@ void SfxNoLayoutSingleTabDialog::SetTabPage( SfxTabPage* pTabPage,
{ {
// First obtain the user data, only then Reset() // First obtain the user data, only then Reset()
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) ); SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
String sUserData; OUString sUserData;
Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
OUString aTemp; OUString aTemp;
if ( aUserItem >>= aTemp ) if ( aUserItem >>= aTemp )
sUserData = String( aTemp ); sUserData = aTemp;
pImpl->m_pSfxPage->SetUserData( sUserData ); pImpl->m_pSfxPage->SetUserData( sUserData );
pImpl->m_pSfxPage->Reset( *GetInputItemSet() ); pImpl->m_pSfxPage->Reset( *GetInputItemSet() );
pImpl->m_pSfxPage->Show(); pImpl->m_pSfxPage->Show();
......
This diff is collapsed.
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
using namespace ::com::sun::star; using namespace ::com::sun::star;
// implemented in 'sfx2/source/appl/childwin.cxx' // implemented in 'sfx2/source/appl/childwin.cxx'
extern sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize ); extern sal_Bool GetPosSizeFromString( const OUString& rStr, Point& rPos, Size& rSize );
extern sal_Bool GetSplitSizeFromString( const String& rStr, Size& rSize ); extern sal_Bool GetSplitSizeFromString( const OUString& rStr, Size& rSize );
// If you want to change the number you also have to: // If you want to change the number you also have to:
// - Add new slot ids to sfxsids.hrc // - Add new slot ids to sfxsids.hrc
......
...@@ -454,7 +454,7 @@ namespace sfx2 ...@@ -454,7 +454,7 @@ namespace sfx2
::std::vector< OUString > aWildCards; ::std::vector< OUString > aWildCards;
public: public:
AppendWildcardToDescriptor( const String& _rWildCard ); AppendWildcardToDescriptor( const OUString& _rWildCard );
// operate on a single class entry // operate on a single class entry
void operator() ( const FilterGroupEntryReferrer::value_type& _rClassReference ) void operator() ( const FilterGroupEntryReferrer::value_type& _rClassReference )
...@@ -469,17 +469,17 @@ namespace sfx2 ...@@ -469,17 +469,17 @@ namespace sfx2
}; };
//==================================================================== //====================================================================
AppendWildcardToDescriptor::AppendWildcardToDescriptor( const String& _rWildCard ) AppendWildcardToDescriptor::AppendWildcardToDescriptor( const OUString& _rWildCard )
{ {
DBG_ASSERT( _rWildCard.Len(), DBG_ASSERT( !_rWildCard.isEmpty(),
"AppendWildcardToDescriptor::AppendWildcardToDescriptor: invalid wildcard!" ); "AppendWildcardToDescriptor::AppendWildcardToDescriptor: invalid wildcard!" );
DBG_ASSERT( _rWildCard.GetBuffer()[0] != s_cWildcardSeparator, DBG_ASSERT( _rWildCard[0] != s_cWildcardSeparator,
"AppendWildcardToDescriptor::AppendWildcardToDescriptor: wildcard already separated!" ); "AppendWildcardToDescriptor::AppendWildcardToDescriptor: wildcard already separated!" );
aWildCards.reserve( comphelper::string::getTokenCount(_rWildCard, s_cWildcardSeparator) ); aWildCards.reserve( comphelper::string::getTokenCount(_rWildCard, s_cWildcardSeparator) );
const sal_Unicode* pTokenLoop = _rWildCard.GetBuffer(); const sal_Unicode* pTokenLoop = _rWildCard.getStr();
const sal_Unicode* pTokenLoopEnd = pTokenLoop + _rWildCard.Len(); const sal_Unicode* pTokenLoopEnd = pTokenLoop + _rWildCard.getLength();
const sal_Unicode* pTokenStart = pTokenLoop; const sal_Unicode* pTokenStart = pTokenLoop;
for ( ; pTokenLoop != pTokenLoopEnd; ++pTokenLoop ) for ( ; pTokenLoop != pTokenLoopEnd; ++pTokenLoop )
{ {
...@@ -610,9 +610,9 @@ namespace sfx2 ...@@ -610,9 +610,9 @@ namespace sfx2
// the group which we currently work with // the group which we currently work with
GroupedFilterList::iterator aCurrentGroup = _rAllFilters.end(); // no current group GroupedFilterList::iterator aCurrentGroup = _rAllFilters.end(); // no current group
// the filter container of the current group - if this changes between two filters, a new group is reached // the filter container of the current group - if this changes between two filters, a new group is reached
String aCurrentServiceName; OUString aCurrentServiceName;
String sFilterWildcard; OUString sFilterWildcard;
OUString sFilterName; OUString sFilterName;
// loop through all the filters // loop through all the filters
for ( const SfxFilter* pFilter = _rFilterMatcher.First(); pFilter; pFilter = _rFilterMatcher.Next() ) for ( const SfxFilter* pFilter = _rFilterMatcher.First(); pFilter; pFilter = _rFilterMatcher.Next() )
...@@ -621,11 +621,11 @@ namespace sfx2 ...@@ -621,11 +621,11 @@ namespace sfx2
sFilterWildcard = pFilter->GetWildcard().getGlob(); sFilterWildcard = pFilter->GetWildcard().getGlob();
AppendWildcardToDescriptor aExtendWildcard( sFilterWildcard ); AppendWildcardToDescriptor aExtendWildcard( sFilterWildcard );
DBG_ASSERT( sFilterWildcard.Len(), "sfx2::lcl_GroupAndClassify: invalid wildcard of this filter!" ); DBG_ASSERT( !sFilterWildcard.isEmpty(), "sfx2::lcl_GroupAndClassify: invalid wildcard of this filter!" );
// =========================================================== // ===========================================================
// check for a change in the group // check for a change in the group
String aServiceName = pFilter->GetServiceName(); OUString aServiceName = pFilter->GetServiceName();
if ( aServiceName != aCurrentServiceName ) if ( aServiceName != aCurrentServiceName )
{ // we reached a new group { // we reached a new group
...@@ -692,7 +692,7 @@ namespace sfx2 ...@@ -692,7 +692,7 @@ namespace sfx2
// within the "real" group (aCollectedLocals is only temporary) // within the "real" group (aCollectedLocals is only temporary)
// -> do this now (as we just encountered the first filter belonging to this local class // -> do this now (as we just encountered the first filter belonging to this local class
// add a new entry which is the "real" group entry // add a new entry which is the "real" group entry
aCurrentGroup->push_back( FilterDescriptor( aBelongsToLocal->second->First, String() ) ); aCurrentGroup->push_back( FilterDescriptor( aBelongsToLocal->second->First, OUString() ) );
// the position where we inserted the entry // the position where we inserted the entry
FilterGroup::iterator aInsertPos = aCurrentGroup->end(); FilterGroup::iterator aInsertPos = aCurrentGroup->end();
--aInsertPos; --aInsertPos;
...@@ -750,7 +750,7 @@ namespace sfx2 ...@@ -750,7 +750,7 @@ namespace sfx2
// operate on a single filter // operate on a single filter
void operator() ( const FilterDescriptor& _rFilterEntry ) void operator() ( const FilterDescriptor& _rFilterEntry )
{ {
String sDisplayText = m_bAddExtension OUString sDisplayText = m_bAddExtension
? addExtension( _rFilterEntry.First, _rFilterEntry.Second, sal_True, *m_pFileDlgImpl ) ? addExtension( _rFilterEntry.First, _rFilterEntry.Second, sal_True, *m_pFileDlgImpl )
: _rFilterEntry.First; : _rFilterEntry.First;
m_xFilterManager->appendFilter( sDisplayText, _rFilterEntry.Second ); m_xFilterManager->appendFilter( sDisplayText, _rFilterEntry.Second );
...@@ -762,7 +762,7 @@ namespace sfx2 ...@@ -762,7 +762,7 @@ namespace sfx2
// ======================================================================= // =======================================================================
//-------------------------------------------------------------------- //--------------------------------------------------------------------
sal_Bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, String& /* [out] */ _rAllFilterName ) sal_Bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, OUString& /* [out] */ _rAllFilterName )
{ {
sal_Bool bHasAll = sal_False; sal_Bool bHasAll = sal_False;
_rAllFilterName = SfxResId( STR_SFX_FILTERNAME_ALL ).toString(); _rAllFilterName = SfxResId( STR_SFX_FILTERNAME_ALL ).toString();
...@@ -781,7 +781,7 @@ namespace sfx2 ...@@ -781,7 +781,7 @@ namespace sfx2
void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rFilters ) void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rFilters )
{ {
// =============================================================== // ===============================================================
String sAllFilterName; OUString sAllFilterName;
if ( !lcl_hasAllFilesFilter( _rFilterMatcher, sAllFilterName ) ) if ( !lcl_hasAllFilesFilter( _rFilterMatcher, sAllFilterName ) )
{ {
// get the first group of filters (by definition, this group contains the global classes) // get the first group of filters (by definition, this group contains the global classes)
...@@ -1182,7 +1182,7 @@ namespace sfx2 ...@@ -1182,7 +1182,7 @@ namespace sfx2
if ( sRet.indexOf( sAllFilter ) == -1 ) if ( sRet.indexOf( sAllFilter ) == -1 )
{ {
String sExt = _rExtension; OUString sExt = _rExtension;
if ( !_bForOpen ) if ( !_bForOpen )
{ {
// show '*' in extensions only when opening a document // show '*' in extensions only when opening a document
......
...@@ -930,15 +930,15 @@ sal_Bool CreateFromAddress_Impl( OUString& rFrom ) ...@@ -930,15 +930,15 @@ sal_Bool CreateFromAddress_Impl( OUString& rFrom )
{ {
SvtUserOptions aUserCFG; SvtUserOptions aUserCFG;
String aName = aUserCFG.GetLastName (); OUString aName = aUserCFG.GetLastName ();
String aFirstName = aUserCFG.GetFirstName (); OUString aFirstName = aUserCFG.GetFirstName ();
if ( aFirstName.Len() || aName.Len() ) if ( !aFirstName.isEmpty() || !aName.isEmpty() )
{ {
if ( aFirstName.Len() ) if ( !aFirstName.isEmpty() )
{ {
rFrom = comphelper::string::strip(aFirstName, ' '); rFrom = comphelper::string::strip(aFirstName, ' ');
if ( aName.Len() ) if ( !aName.isEmpty() )
rFrom += " "; rFrom += " ";
} }
rFrom += comphelper::string::strip(aName, ' '); rFrom += comphelper::string::strip(aName, ' ');
...@@ -947,13 +947,13 @@ sal_Bool CreateFromAddress_Impl( OUString& rFrom ) ...@@ -947,13 +947,13 @@ sal_Bool CreateFromAddress_Impl( OUString& rFrom )
rFrom = comphelper::string::remove(rFrom, '>'); rFrom = comphelper::string::remove(rFrom, '>');
rFrom = comphelper::string::remove(rFrom, '@'); rFrom = comphelper::string::remove(rFrom, '@');
} }
String aEmailName = aUserCFG.GetEmail(); OUString aEmailName = aUserCFG.GetEmail();
// remove illegal characters // remove illegal characters
aEmailName = comphelper::string::remove(aEmailName, '<'); aEmailName = comphelper::string::remove(aEmailName, '<');
aEmailName = comphelper::string::remove(aEmailName, '>'); aEmailName = comphelper::string::remove(aEmailName, '>');
if ( aEmailName.Len() ) if ( !aEmailName.isEmpty() )
{ {
if ( !rFrom.isEmpty() ) if ( !rFrom.isEmpty() )
rFrom += " "; rFrom += " ";
......
...@@ -89,9 +89,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS ...@@ -89,9 +89,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS
if ( pStyle->GetName().isEmpty() && pPool ) if ( pStyle->GetName().isEmpty() && pPool )
{ {
// NullString as Name -> generate Name // NullString as Name -> generate Name
String aNoName( SfxResId(STR_NONAME).toString() ); OUString aNoName( SfxResId(STR_NONAME).toString() );
sal_uInt16 nNo = 1; sal_uInt16 nNo = 1;
String aNo( aNoName ); OUString aNo( aNoName );
aNoName += OUString::number( nNo ); aNoName += OUString::number( nNo );
while ( pPool->Find( aNoName ) ) while ( pPool->Find( aNoName ) )
{ {
...@@ -147,7 +147,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS ...@@ -147,7 +147,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemS
while ( pPoolStyle ) while ( pPoolStyle )
{ {
const String aStr( pPoolStyle->GetName() ); const OUString aStr( pPoolStyle->GetName() );
// own name as base template // own name as base template
if ( aStr != aName ) if ( aStr != aName )
m_pBaseLb->InsertEntry( aStr ); m_pBaseLb->InsertEntry( aStr );
...@@ -336,7 +336,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit ) ...@@ -336,7 +336,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
*/ */
{ {
const String aStr(comphelper::string::stripStart(pEdit->GetText(), ' ')); const OUString aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
pEdit->SetText( aStr ); pEdit->SetText( aStr );
// Update the Listbox of the base template if possible // Update the Listbox of the base template if possible
if ( aStr != aBuf ) if ( aStr != aBuf )
...@@ -411,7 +411,7 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet& /*rAttrSet*/ ) ...@@ -411,7 +411,7 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet& /*rAttrSet*/ )
{ {
bModified = sal_False; bModified = sal_False;
String sCmp( pStyle->GetName() ); OUString sCmp( pStyle->GetName() );
if ( sCmp != aName ) if ( sCmp != aName )
pStyle->SetName( aName ); pStyle->SetName( aName );
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl ) IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl )
{ {
(void)pControl; //unused (void)pControl; //unused
const String aName( aColBox.GetText() ); const OUString aName( aColBox.GetText() );
SfxStyleSheetBase* pStyle = rPool.Find( aName, rPool.GetSearchFamily(), SFXSTYLEBIT_ALL ); SfxStyleSheetBase* pStyle = rPool.Find( aName, rPool.GetSearchFamily(), SFXSTYLEBIT_ALL );
if ( pStyle ) if ( pStyle )
{ {
......
...@@ -96,7 +96,7 @@ namespace ...@@ -96,7 +96,7 @@ namespace
static short lcl_GetPassword( static short lcl_GetPassword(
Window *pParent, Window *pParent,
bool bProtect, bool bProtect,
/*out*/String &rPassword ) /*out*/OUString &rPassword )
{ {
bool bRes = false; bool bRes = false;
SfxPasswordDialog aPasswdDlg( pParent ); SfxPasswordDialog aPasswdDlg( pParent );
...@@ -112,7 +112,7 @@ static short lcl_GetPassword( ...@@ -112,7 +112,7 @@ static short lcl_GetPassword(
} }
static bool lcl_IsPasswordCorrect( const String &rPassword ) static bool lcl_IsPasswordCorrect( const OUString &rPassword )
{ {
bool bRes = false; bool bRes = false;
...@@ -144,9 +144,9 @@ struct SfxSecurityPage_Impl ...@@ -144,9 +144,9 @@ struct SfxSecurityPage_Impl
bool m_bOrigPasswordIsConfirmed; bool m_bOrigPasswordIsConfirmed;
bool m_bNewPasswordIsValid; bool m_bNewPasswordIsValid;
String m_aNewPassword; OUString m_aNewPassword;
String m_aEndRedliningWarning; OUString m_aEndRedliningWarning;
bool m_bEndRedliningWarningDone; bool m_bEndRedliningWarningDone;
DECL_LINK( RecordChangesCBToggleHdl, void* ); DECL_LINK( RecordChangesCBToggleHdl, void* );
...@@ -203,8 +203,8 @@ sal_Bool SfxSecurityPage_Impl::FillItemSet_Impl( SfxItemSet & ) ...@@ -203,8 +203,8 @@ sal_Bool SfxSecurityPage_Impl::FillItemSet_Impl( SfxItemSet & )
// sanity checks // sanity checks
DBG_ASSERT( bDoRecordChanges || !bDoChangeProtection, "no change recording should imply no change protection" ); DBG_ASSERT( bDoRecordChanges || !bDoChangeProtection, "no change recording should imply no change protection" );
DBG_ASSERT( bDoChangeProtection || !bDoRecordChanges, "no change protection should imply no change recording" ); DBG_ASSERT( bDoChangeProtection || !bDoRecordChanges, "no change protection should imply no change recording" );
DBG_ASSERT( !bDoChangeProtection || m_aNewPassword.Len() > 0, "change protection should imply password length is > 0" ); DBG_ASSERT( !bDoChangeProtection || !m_aNewPassword.isEmpty(), "change protection should imply password length is > 0" );
DBG_ASSERT( bDoChangeProtection || m_aNewPassword.Len() == 0, "no change protection should imply password length is 0" ); DBG_ASSERT( bDoChangeProtection || m_aNewPassword.isEmpty(), "no change protection should imply password length is 0" );
// change recording // change recording
if (bDoRecordChanges != pCurDocShell->IsChangeRecording()) if (bDoRecordChanges != pCurDocShell->IsChangeRecording())
...@@ -348,7 +348,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl) ...@@ -348,7 +348,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
&& m_pProtectPB->IsVisible(); && m_pProtectPB->IsVisible();
if (!bAlreadyDone && bNeedPasssword) if (!bAlreadyDone && bNeedPasssword)
{ {
String aPasswordText; OUString aPasswordText;
// dialog canceled or no password provided // dialog canceled or no password provided
if (!lcl_GetPassword( m_rMyTabPage.GetParent(), false, aPasswordText )) if (!lcl_GetPassword( m_rMyTabPage.GetParent(), false, aPasswordText ))
...@@ -368,7 +368,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl) ...@@ -368,7 +368,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
// remember required values to change protection and change recording in // remember required values to change protection and change recording in
// FillItemSet_Impl later on if password was correct. // FillItemSet_Impl later on if password was correct.
m_bNewPasswordIsValid = true; m_bNewPasswordIsValid = true;
m_aNewPassword = String(); m_aNewPassword = "";
m_pProtectPB->Show(); m_pProtectPB->Show();
m_pUnProtectPB->Hide(); m_pUnProtectPB->Hide();
} }
...@@ -387,7 +387,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl) ...@@ -387,7 +387,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl)
const bool bCurrentProtection = m_pUnProtectPB->IsVisible(); const bool bCurrentProtection = m_pUnProtectPB->IsVisible();
// ask user for password (if still necessary) // ask user for password (if still necessary)
String aPasswordText; OUString aPasswordText;
bool bNewProtection = !bCurrentProtection; bool bNewProtection = !bCurrentProtection;
const bool bNeedPassword = bNewProtection || !m_bOrigPasswordIsConfirmed; const bool bNeedPassword = bNewProtection || !m_bOrigPasswordIsConfirmed;
if (bNeedPassword) if (bNeedPassword)
...@@ -410,7 +410,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl) ...@@ -410,7 +410,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl)
// remember required values to change protection and change recording in // remember required values to change protection and change recording in
// FillItemSet_Impl later on if password was correct. // FillItemSet_Impl later on if password was correct.
m_bNewPasswordIsValid = true; m_bNewPasswordIsValid = true;
m_aNewPassword = bNewProtection? aPasswordText : String(); m_aNewPassword = bNewProtection? aPasswordText : OUString();
m_pRecordChangesCB->Check( bNewProtection ); m_pRecordChangesCB->Check( bNewProtection );
......
...@@ -264,34 +264,34 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl, ...@@ -264,34 +264,34 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
if ( bWithButtons ) if ( bWithButtons )
{ {
// Read Configuration // Read Configuration
String aWindowId = OUString("SplitWindow"); OUString aWindowId("SplitWindow");
aWindowId += OUString::number( (sal_Int32) eTbxAlign ); aWindowId += OUString::number( (sal_Int32) eTbxAlign );
SvtViewOptions aWinOpt( E_WINDOW, aWindowId ); SvtViewOptions aWinOpt( E_WINDOW, aWindowId );
String aWinData; OUString aWinData;
Any aUserItem = aWinOpt.GetUserItem( USERITEM_NAME ); Any aUserItem = aWinOpt.GetUserItem( USERITEM_NAME );
OUString aTemp; OUString aTemp;
if ( aUserItem >>= aTemp ) if ( aUserItem >>= aTemp )
aWinData = String( aTemp ); aWinData = aTemp;
if ( aWinData.Len() && aWinData.GetChar( (sal_uInt16) 0 ) == 'V' ) if ( !aWinData.isEmpty() && aWinData[0] == 'V' )
{ {
pEmptyWin->nState = (sal_uInt16) aWinData.GetToken( 1, ',' ).ToInt32(); pEmptyWin->nState = (sal_uInt16) aWinData.getToken( 1, ',' ).toInt32();
if ( pEmptyWin->nState & 2 ) if ( pEmptyWin->nState & 2 )
pEmptyWin->bFadeIn = sal_True; pEmptyWin->bFadeIn = sal_True;
bPinned = sal_True; // always assume pinned - floating mode not used anymore bPinned = sal_True; // always assume pinned - floating mode not used anymore
sal_uInt16 i=2; sal_uInt16 i=2;
sal_uInt16 nCount = (sal_uInt16) aWinData.GetToken(i++, ',').ToInt32(); sal_uInt16 nCount = (sal_uInt16) aWinData.getToken(i++, ',').toInt32();
for ( sal_uInt16 n=0; n<nCount; n++ ) for ( sal_uInt16 n=0; n<nCount; n++ )
{ {
SfxDock_Impl *pDock = new SfxDock_Impl; SfxDock_Impl *pDock = new SfxDock_Impl;
pDock->pWin = 0; pDock->pWin = 0;
pDock->bNewLine = sal_False; pDock->bNewLine = sal_False;
pDock->bHide = sal_True; pDock->bHide = sal_True;
pDock->nType = (sal_uInt16) aWinData.GetToken(i++, ',').ToInt32(); pDock->nType = (sal_uInt16) aWinData.getToken(i++, ',').toInt32();
if ( !pDock->nType ) if ( !pDock->nType )
{ {
// could mean NewLine // could mean NewLine
pDock->nType = (sal_uInt16) aWinData.GetToken(i++, ',').ToInt32(); pDock->nType = (sal_uInt16) aWinData.getToken(i++, ',').toInt32();
if ( !pDock->nType ) if ( !pDock->nType )
{ {
// Read error // Read error
...@@ -367,7 +367,7 @@ void SfxSplitWindow::SaveConfig_Impl() ...@@ -367,7 +367,7 @@ void SfxSplitWindow::SaveConfig_Impl()
aWinData.append(static_cast<sal_Int32>(pDock->nType)); aWinData.append(static_cast<sal_Int32>(pDock->nType));
} }
String aWindowId = OUString("SplitWindow"); OUString aWindowId("SplitWindow");
aWindowId += OUString::number( (sal_Int32) GetAlign() ); aWindowId += OUString::number( (sal_Int32) GetAlign() );
SvtViewOptions aWinOpt( E_WINDOW, aWindowId ); SvtViewOptions aWinOpt( E_WINDOW, aWindowId );
aWinOpt.SetUserItem( USERITEM_NAME, makeAny( aWinData.makeStringAndClear() ) ); aWinOpt.SetUserItem( USERITEM_NAME, makeAny( aWinData.makeStringAndClear() ) );
......
...@@ -87,18 +87,18 @@ void SearchDialog::LoadConfig() ...@@ -87,18 +87,18 @@ void SearchDialog::LoadConfig()
OUString aTemp; OUString aTemp;
if ( aUserItem >>= aTemp ) if ( aUserItem >>= aTemp )
{ {
String sUserData( aTemp ); OUString sUserData( aTemp );
DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" ); DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" );
sal_Int32 nIdx = 0; sal_Int32 nIdx = 0;
String sSearchText = sUserData.GetToken( 0, ';', nIdx ); OUString sSearchText = sUserData.getToken( 0, ';', nIdx );
m_aWholeWordsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); m_aWholeWordsBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
m_aMatchCaseBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); m_aMatchCaseBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
m_aWrapAroundBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); m_aWrapAroundBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
m_aBackwardsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); m_aBackwardsBox.Check( sUserData.getToken( 0, ';', nIdx ).toInt32() == 1 );
nIdx = 0; nIdx = 0;
while ( nIdx != -1 ) while ( nIdx != -1 )
m_aSearchEdit.InsertEntry( sSearchText.GetToken( 0, '\t', nIdx ) ); m_aSearchEdit.InsertEntry( sSearchText.getToken( 0, '\t', nIdx ) );
m_aSearchEdit.SelectEntryPos(0); m_aSearchEdit.SelectEntryPos(0);
} }
} }
...@@ -110,21 +110,21 @@ void SearchDialog::SaveConfig() ...@@ -110,21 +110,21 @@ void SearchDialog::SaveConfig()
{ {
SvtViewOptions aViewOpt( E_DIALOG, m_sConfigName ); SvtViewOptions aViewOpt( E_DIALOG, m_sConfigName );
aViewOpt.SetWindowState(OStringToOUString(m_sWinState, RTL_TEXTENCODING_ASCII_US)); aViewOpt.SetWindowState(OStringToOUString(m_sWinState, RTL_TEXTENCODING_ASCII_US));
String sUserData; OUString sUserData;
sal_uInt16 i = 0, nCount = std::min( m_aSearchEdit.GetEntryCount(), MAX_SAVE_COUNT ); sal_uInt16 i = 0, nCount = std::min( m_aSearchEdit.GetEntryCount(), MAX_SAVE_COUNT );
for ( ; i < nCount; ++i ) for ( ; i < nCount; ++i )
{ {
sUserData += m_aSearchEdit.GetEntry(i); sUserData += m_aSearchEdit.GetEntry(i);
sUserData += '\t'; sUserData += "\t";
} }
sUserData = comphelper::string::stripStart(sUserData, '\t'); sUserData = comphelper::string::stripStart(sUserData, '\t');
sUserData += ';'; sUserData += ";";
sUserData += OUString::number( m_aWholeWordsBox.IsChecked() ? 1 : 0 ); sUserData += OUString::number( m_aWholeWordsBox.IsChecked() ? 1 : 0 );
sUserData += ';'; sUserData += ";";
sUserData += OUString::number( m_aMatchCaseBox.IsChecked() ? 1 : 0 ); sUserData += OUString::number( m_aMatchCaseBox.IsChecked() ? 1 : 0 );
sUserData += ';'; sUserData += ";";
sUserData += OUString::number( m_aWrapAroundBox.IsChecked() ? 1 : 0 ); sUserData += OUString::number( m_aWrapAroundBox.IsChecked() ? 1 : 0 );
sUserData += ';'; sUserData += ";";
sUserData += OUString::number( m_aBackwardsBox.IsChecked() ? 1 : 0 ); sUserData += OUString::number( m_aBackwardsBox.IsChecked() ? 1 : 0 );
Any aUserItem = makeAny( OUString( sUserData ) ); Any aUserItem = makeAny( OUString( sUserData ) );
...@@ -133,7 +133,7 @@ void SearchDialog::SaveConfig() ...@@ -133,7 +133,7 @@ void SearchDialog::SaveConfig()
IMPL_LINK_NOARG(SearchDialog, FindHdl) IMPL_LINK_NOARG(SearchDialog, FindHdl)
{ {
String sSrchTxt = m_aSearchEdit.GetText(); OUString sSrchTxt = m_aSearchEdit.GetText();
sal_uInt16 nPos = m_aSearchEdit.GetEntryPos( sSrchTxt ); sal_uInt16 nPos = m_aSearchEdit.GetEntryPos( sSrchTxt );
if ( nPos > 0 && nPos != COMBOBOX_ENTRY_NOTFOUND ) if ( nPos > 0 && nPos != COMBOBOX_ENTRY_NOTFOUND )
m_aSearchEdit.RemoveEntryAt(nPos); m_aSearchEdit.RemoveEntryAt(nPos);
...@@ -145,7 +145,7 @@ IMPL_LINK_NOARG(SearchDialog, FindHdl) ...@@ -145,7 +145,7 @@ IMPL_LINK_NOARG(SearchDialog, FindHdl)
IMPL_LINK_NOARG(SearchDialog, ToggleHdl) IMPL_LINK_NOARG(SearchDialog, ToggleHdl)
{ {
String sTemp = m_aWrapAroundBox.GetText(); OUString sTemp = m_aWrapAroundBox.GetText();
m_aWrapAroundBox.SetText( m_sToggleText ); m_aWrapAroundBox.SetText( m_sToggleText );
m_sToggleText = sTemp; m_sToggleText = sTemp;
return 0; return 0;
......
...@@ -495,8 +495,8 @@ SfxTabDialog::~SfxTabDialog() ...@@ -495,8 +495,8 @@ SfxTabDialog::~SfxTabDialog()
{ {
// save settings of all pages (user data) // save settings of all pages (user data)
pDataObject->pTabPage->FillUserData(); pDataObject->pTabPage->FillUserData();
String aPageData( pDataObject->pTabPage->GetUserData() ); OUString aPageData( pDataObject->pTabPage->GetUserData() );
if ( aPageData.Len() ) if ( !aPageData.isEmpty() )
{ {
// save settings of all pages (user data) // save settings of all pages (user data)
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) ); SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
...@@ -864,8 +864,8 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) ...@@ -864,8 +864,8 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )
if ( pDataObject->pTabPage ) if ( pDataObject->pTabPage )
{ {
pDataObject->pTabPage->FillUserData(); pDataObject->pTabPage->FillUserData();
String aPageData( pDataObject->pTabPage->GetUserData() ); OUString aPageData( pDataObject->pTabPage->GetUserData() );
if ( aPageData.Len() ) if ( !aPageData.isEmpty() )
{ {
// save settings of this page (user data) // save settings of this page (user data)
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) ); SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
...@@ -1302,11 +1302,11 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) ...@@ -1302,11 +1302,11 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
pDataObject->pTabPage = pTabPage; pDataObject->pTabPage = pTabPage;
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) ); SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( pDataObject->nId ) );
String sUserData; OUString sUserData;
Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
OUString aTemp; OUString aTemp;
if ( aUserItem >>= aTemp ) if ( aUserItem >>= aTemp )
sUserData = String( aTemp ); sUserData = aTemp;
pTabPage->SetUserData( sUserData ); pTabPage->SetUserData( sUserData );
Size aSiz = pTabPage->GetSizePixel(); Size aSiz = pTabPage->GetSizePixel();
......
...@@ -869,7 +869,7 @@ namespace sfx2 ...@@ -869,7 +869,7 @@ namespace sfx2
); );
virtual ~TaskPaneController_Impl(); virtual ~TaskPaneController_Impl();
void SetDefaultTitle( const String& i_rTitle ); void SetDefaultTitle( const OUString& i_rTitle );
void ActivateToolPanel( const OUString& i_rPanelURL ); void ActivateToolPanel( const OUString& i_rPanelURL );
protected: protected:
...@@ -971,7 +971,7 @@ namespace sfx2 ...@@ -971,7 +971,7 @@ namespace sfx2
} }
// ----------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------
void TaskPaneController_Impl::SetDefaultTitle( const String& i_rTitle ) void TaskPaneController_Impl::SetDefaultTitle( const OUString& i_rTitle )
{ {
m_sDefaultTitle = i_rTitle; m_sDefaultTitle = i_rTitle;
impl_updateDockingWindowTitle(); impl_updateDockingWindowTitle();
......
This diff is collapsed.
...@@ -50,9 +50,9 @@ using ::std::vector; ...@@ -50,9 +50,9 @@ using ::std::vector;
// ************************************************************************** // **************************************************************************
struct SfxVersionInfo struct SfxVersionInfo
{ {
String aName; OUString aName;
String aComment; OUString aComment;
String aAuthor; OUString aAuthor;
DateTime aCreationDate; DateTime aCreationDate;
SfxVersionInfo(); SfxVersionInfo();
...@@ -265,8 +265,8 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer ...@@ -265,8 +265,8 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer
// set dialog title (filename or docinfo title) // set dialog title (filename or docinfo title)
String sText = GetText(); OUString sText = GetText();
( sText += ' ' ) += pViewFrame->GetObjectShell()->GetTitle(); sText = sText + " " + pViewFrame->GetObjectShell()->GetTitle();
SetText( sText ); SetText( sText );
Init_Impl(); Init_Impl();
...@@ -274,28 +274,28 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer ...@@ -274,28 +274,28 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer
m_pVersionBox->setColSizes(); m_pVersionBox->setColSizes();
} }
String ConvertWhiteSpaces_Impl( const String& rText ) String ConvertWhiteSpaces_Impl( const OUString& rText )
{ {
// converted linebreaks and tabs to blanks; it's necessary for the display // converted linebreaks and tabs to blanks; it's necessary for the display
String sConverted; OUStringBuffer sConverted;
const sal_Unicode* pChars = rText.GetBuffer(); const sal_Unicode* pChars = rText.getStr();
while ( *pChars ) while ( *pChars )
{ {
switch ( *pChars ) switch ( *pChars )
{ {
case '\n' : case '\n' :
case '\t' : case '\t' :
sConverted += ' '; sConverted.append(' ');
break; break;
default: default:
sConverted += *pChars; sConverted.append(*pChars);
} }
++pChars; ++pChars;
} }
return sConverted; return sConverted.makeStringAndClear();
} }
void SfxVersionDialog::Init_Impl() void SfxVersionDialog::Init_Impl()
...@@ -309,10 +309,10 @@ void SfxVersionDialog::Init_Impl() ...@@ -309,10 +309,10 @@ void SfxVersionDialog::Init_Impl()
for ( size_t n = 0; n < m_pTable->size(); ++n ) for ( size_t n = 0; n < m_pTable->size(); ++n )
{ {
SfxVersionInfo *pInfo = m_pTable->at( n ); SfxVersionInfo *pInfo = m_pTable->at( n );
String aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper()); OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
aEntry += '\t'; aEntry += "\t";
aEntry += pInfo->aAuthor; aEntry += pInfo->aAuthor;
aEntry += '\t'; aEntry += "\t";
aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment ); aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry ); SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
pEntry->SetUserData( pInfo ); pEntry->SetUserData( pInfo );
......
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