convert includes/sfx2/frame.hxx from String to OUString

Change-Id: Ia69548250beb2896cab8c19fe2e635fdc9162f4d
This commit is contained in:
Noel Grandin
2013-08-27 10:07:54 +02:00
parent aca6fd6512
commit b4824c8915
13 changed files with 16 additions and 47 deletions

View File

@@ -65,7 +65,7 @@ URLDlg::URLDlg( Window* pWindow, const String& rURL, const String& rAlternativeT
m_pEdtName->SetText( rName ); m_pEdtName->SetText( rName );
for( size_t i = 0, n = rTargetList.size(); i < n; ++i ) for( size_t i = 0, n = rTargetList.size(); i < n; ++i )
m_pCbbTargets->InsertEntry( *rTargetList[ i ] ); m_pCbbTargets->InsertEntry( rTargetList[ i ] );
if( !rTarget.Len() ) if( !rTarget.Len() )
m_pCbbTargets->SetText( OUString("_self") ); m_pCbbTargets->SetText( OUString("_self") );

View File

@@ -58,11 +58,7 @@ SvxFramesComboBox::SvxFramesComboBox ( Window* pParent, const ResId& rResId,
size_t i; size_t i;
for ( i = 0; i < nCount; i++ ) for ( i = 0; i < nCount; i++ )
{ {
InsertEntry( *pList->at( i ) ); InsertEntry( pList->at( i ) );
}
for ( i = nCount; i; )
{
delete pList->at( --i );
} }
} }
} }

View File

@@ -81,7 +81,7 @@ class SystemWindow;
class SfxFrame; class SfxFrame;
typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl; typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl;
typedef ::std::vector< String* > TargetList; typedef ::std::vector<OUString> TargetList;
#define SFXFRAME_HASTITLE 0x0001 #define SFXFRAME_HASTITLE 0x0001

View File

@@ -51,7 +51,7 @@ class ImageMap;
\************************************************************************/ \************************************************************************/
class Graphic; class Graphic;
typedef ::std::vector< String* > TargetList; typedef ::std::vector< OUString > TargetList;
class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow
{ {

View File

@@ -54,7 +54,7 @@ class Graphic;
class SdrObject; class SdrObject;
class SvxSpellWrapper; class SvxSpellWrapper;
typedef ::std::vector< String* > TargetList; typedef ::std::vector< OUString > TargetList;
namespace svx{ class SpellDialogChildWindow;} namespace svx{ class SpellDialogChildWindow;}

View File

@@ -219,10 +219,6 @@ void ScDrawView::UpdateIMap( SdrObject* pObj )
} }
ScIMapDlgSet( aGraphic, pImageMap, &aTargetList, pObj ); // aus imapwrap ScIMapDlgSet( aGraphic, pImageMap, &aTargetList, pObj ); // aus imapwrap
// TargetListe kann von uns wieder geloescht werden
for ( size_t i = 0, n = aTargetList.size(); i < n; ++i )
delete aTargetList[ i ];
} }
} }

View File

@@ -350,8 +350,6 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
// We can delete the target list // We can delete the target list
if ( pTargetList ) if ( pTargetList )
{ {
for ( size_t i = 0, n = pTargetList->size(); i < n; ++i )
delete pTargetList->at( i );
delete pTargetList; delete pTargetList;
} }
} }

View File

@@ -467,11 +467,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const
if ( !GetParentFrame() ) if ( !GetParentFrame() )
{ {
// An empty string for 'No Target' // An empty string for 'No Target'
rList.push_back( new String() ); rList.push_back( String() );
rList.push_back( new String( "_top" ) ); rList.push_back( String( "_top" ) );
rList.push_back( new String( "_parent" ) ); rList.push_back( String( "_parent" ) );
rList.push_back( new String( "_blank" ) ); rList.push_back( String( "_blank" ) );
rList.push_back( new String( "_self" ) ); rList.push_back( String( "_self" ) );
} }
SfxViewFrame* pView = GetCurrentViewFrame(); SfxViewFrame* pView = GetCurrentViewFrame();

View File

@@ -284,7 +284,7 @@ void SvxIMapDlg::SetTargetList( const TargetList& rTargetList )
maCbbTarget.Clear(); maCbbTarget.Clear();
for ( size_t i = 0, n = aNewList.size(); i < n; ++i ) for ( size_t i = 0, n = aNewList.size(); i < n; ++i )
maCbbTarget.InsertEntry( *aNewList[ i ] ); maCbbTarget.InsertEntry( aNewList[ i ] );
} }
void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap, void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap,
@@ -301,8 +301,6 @@ void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap,
// Delete UpdateTargetList, because this method can still be called several // Delete UpdateTargetList, because this method can still be called several
// times before the update timer is turned on // times before the update timer is turned on
for ( size_t i = 0, n = pOwnData->aUpdateTargetList.size(); i < n; ++i )
delete pOwnData->aUpdateTargetList[ i ];
pOwnData->aUpdateTargetList.clear(); pOwnData->aUpdateTargetList.clear();
// TargetList must be copied, since it is owned by the caller and can be // TargetList must be copied, since it is owned by the caller and can be
@@ -313,7 +311,7 @@ void SvxIMapDlg::Update( const Graphic& rGraphic, const ImageMap* pImageMap,
TargetList aTargetList( *pTargetList ); TargetList aTargetList( *pTargetList );
for ( size_t i = 0, n = aTargetList.size(); i < n; ++i ) for ( size_t i = 0, n = aTargetList.size(); i < n; ++i )
pOwnData->aUpdateTargetList.push_back( new String( *aTargetList[ i ] ) ); pOwnData->aUpdateTargetList.push_back( aTargetList[ i ] );
} }
pOwnData->aTimer.Start(); pOwnData->aTimer.Start();
@@ -746,8 +744,6 @@ IMPL_LINK_NOARG(SvxIMapDlg, UpdateHdl)
} }
// Delete the copied list again in the Update method // Delete the copied list again in the Update method
for ( size_t i = 0, n = pOwnData->aUpdateTargetList.size(); i < n; ++i )
delete pOwnData->aUpdateTargetList[ i ];
pOwnData->aUpdateTargetList.clear(); pOwnData->aUpdateTargetList.clear();
GetBindings().Invalidate( SID_IMAP_EXEC ); GetBindings().Invalidate( SID_IMAP_EXEC );

View File

@@ -70,10 +70,6 @@ IMapWindow::IMapWindow( Window* pParent, const ResId& rResId, const Reference< X
IMapWindow::~IMapWindow() IMapWindow::~IMapWindow()
{ {
// Delete Liste
for ( size_t i = 0, n = aTargetList.size(); i < n; ++i )
delete aTargetList[ i ];
SfxItemPool::Free(pIMapPool); SfxItemPool::Free(pIMapPool);
delete[] pItemInfo; delete[] pItemInfo;
} }
@@ -165,13 +161,11 @@ const ImageMap& IMapWindow::GetImageMap()
void IMapWindow::SetTargetList( TargetList& rTargetList ) void IMapWindow::SetTargetList( TargetList& rTargetList )
{ {
// Delete old List // Delete old List
for( size_t i = 0, n = aTargetList.size(); i < n; ++i )
delete aTargetList[ i ];
aTargetList.clear(); aTargetList.clear();
// Fill with the provided list // Fill with the provided list
for( size_t i = 0, n = rTargetList.size(); i < n; ++i ) for( size_t i = 0, n = rTargetList.size(); i < n; ++i )
aTargetList.push_back( new String( *rTargetList[ i ] ) ); aTargetList.push_back( rTargetList[ i ] );
pModel->SetChanged( sal_False ); pModel->SetChanged( sal_False );
} }

View File

@@ -177,15 +177,10 @@ SwCharURLPage::SwCharURLPage(Window* pParent, const SfxItemSet& rCoreSet)
if ( !pList->empty() ) if ( !pList->empty() )
{ {
size_t nCount = pList->size(); size_t nCount = pList->size();
size_t i;
for ( i = 0; i < nCount; i++ ) for ( size_t i = 0; i < nCount; i++ )
{ {
m_pTargetFrmLB->InsertEntry( *pList->at( i ) ); m_pTargetFrmLB->InsertEntry( pList->at( i ) );
}
for ( i = nCount; i; )
{
delete pList->at( --i );
} }
} }
delete pList; delete pList;

View File

@@ -2709,11 +2709,7 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet )
size_t nCount = pList->size(); size_t nCount = pList->size();
for ( size_t i = 0; i < nCount; i++ ) for ( size_t i = 0; i < nCount; i++ )
{ {
pFrameCB->InsertEntry( *pList->at( i ) ); pFrameCB->InsertEntry( pList->at( i ) );
}
for ( size_t i = nCount; i; )
{
delete pList->at( --i );
} }
} }
delete pList; delete pList;

View File

@@ -166,8 +166,6 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
SvxIMapDlgChildWindow::UpdateIMapDlg( SvxIMapDlgChildWindow::UpdateIMapDlg(
aGrf, rURL.GetMap(), pList, pEditObj ); aGrf, rURL.GetMap(), pList, pEditObj );
for ( size_t i = 0, n = pList->size(); i < n; ++i )
delete pList->at( i );
delete pList; delete pList;
} }