Kaydet (Commit) c0af96e3 authored tarafından npcdoom's avatar npcdoom Kaydeden (comit) Luboš Luňák

Remove deprecated List for std::vector<String>.

Signed-off-by: 's avatarLuboš Luňák <l.lunak@suse.cz>
üst ae8530c5
...@@ -96,18 +96,10 @@ void GetPreferedExtension( String &rExt, const Graphic &rGrf ) ...@@ -96,18 +96,10 @@ void GetPreferedExtension( String &rExt, const Graphic &rGrf )
SwReadOnlyPopup::~SwReadOnlyPopup() SwReadOnlyPopup::~SwReadOnlyPopup()
{ {
String *pDel = (String*)aThemeList.First();
while ( pDel )
{
delete pDel;
pDel = (String*)aThemeList.Next();
}
delete pImageMap; delete pImageMap;
delete pTargetURL; delete pTargetURL;
} }
void SwReadOnlyPopup::Check( USHORT nMID, USHORT nSID, SfxDispatcher &rDis ) void SwReadOnlyPopup::Check( USHORT nMID, USHORT nSID, SfxDispatcher &rDis )
{ {
SfxPoolItem *_pItem = 0; SfxPoolItem *_pItem = 0;
...@@ -180,22 +172,22 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : ...@@ -180,22 +172,22 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
} }
} }
BOOL bEnableGraphicToGallery; bool bEnableGraphicToGallery = bLink;
if ( TRUE == (bEnableGraphicToGallery = bLink) ) if ( bEnableGraphicToGallery )
{ {
GalleryExplorer::FillThemeList( aThemeList ); if (GalleryExplorer::FillThemeList( aThemeList ))
if ( aThemeList.Count() )
{ {
PopupMenu *pMenu = GetPopupMenu(MN_READONLY_GRAPHICTOGALLERY); PopupMenu *pMenu = GetPopupMenu(MN_READONLY_GRAPHICTOGALLERY);
pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk );
pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk );
for ( USHORT i=0; i < aThemeList.Count(); ++i )
pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, for (string_const_iterator_t it = aThemeList.begin(); it != aThemeList.end(); ++it)
*(String*)aThemeList.GetObject( i ) ); pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3,*it);
} }
else else
bEnableGraphicToGallery = FALSE; bEnableGraphicToGallery = false;
} }
EnableItem( MN_READONLY_GRAPHICTOGALLERY, bEnableGraphicToGallery ); EnableItem( MN_READONLY_GRAPHICTOGALLERY, bEnableGraphicToGallery );
SfxViewFrame * pVFrame = rV.GetViewFrame(); SfxViewFrame * pVFrame = rV.GetViewFrame();
...@@ -210,17 +202,18 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : ...@@ -210,17 +202,18 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
bEnableBack = TRUE; bEnableBack = TRUE;
if ( pItem->GetGraphicLink() ) if ( pItem->GetGraphicLink() )
{ {
if ( !aThemeList.Count() ) if ( aThemeList.empty() )
GalleryExplorer::FillThemeList( aThemeList ); GalleryExplorer::FillThemeList( aThemeList );
if ( aThemeList.Count() )
if ( !aThemeList.empty() )
{ {
PopupMenu *pMenu = GetPopupMenu(MN_READONLY_BACKGROUNDTOGALLERY); PopupMenu *pMenu = GetPopupMenu(MN_READONLY_BACKGROUNDTOGALLERY);
pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk );
pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk );
bEnableBackGallery = TRUE; bEnableBackGallery = TRUE;
for ( USHORT i=0; i < aThemeList.Count(); ++i )
pMenu->InsertItem( MN_READONLY_BACKGROUNDTOGALLERY+i + 3, for (string_const_iterator_t it = aThemeList.begin(); it != aThemeList.end(); ++it)
*(String*)aThemeList.GetObject( i ) ); pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3,*it);
} }
} }
} }
...@@ -310,10 +303,8 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) ...@@ -310,10 +303,8 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId )
sTmp = SaveGraphic( nSaveId ); sTmp = SaveGraphic( nSaveId );
if ( sTmp.Len() ) if ( sTmp.Len() )
{ GalleryExplorer::InsertURL( aThemeList[nId], sTmp );
String sThemeName( *(String*)aThemeList.GetObject( nId ));
GalleryExplorer::InsertURL( sThemeName, sTmp );
}
return; return;
} }
......
...@@ -41,6 +41,9 @@ class INetImage; ...@@ -41,6 +41,9 @@ class INetImage;
class SwReadOnlyPopup : public PopupMenu class SwReadOnlyPopup : public PopupMenu
{ {
typedef std::vector<String>::iterator theme_iterator_t;
typedef std::vector<String>::const_iterator theme_const_iterator_t;
SwView &rView; SwView &rView;
const SvxBrushItem *pItem; const SvxBrushItem *pItem;
const Point &rDocPos; const Point &rDocPos;
...@@ -49,7 +52,7 @@ class SwReadOnlyPopup : public PopupMenu ...@@ -49,7 +52,7 @@ class SwReadOnlyPopup : public PopupMenu
sTargetFrameName, sTargetFrameName,
sDescription, sDescription,
sGrfName; sGrfName;
List aThemeList; std::vector<String> aThemeList;
BOOL bGrfToGalleryAsLnk; BOOL bGrfToGalleryAsLnk;
ImageMap* pImageMap; ImageMap* pImageMap;
INetImage* pTargetURL; INetImage* pTargetURL;
......
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