1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: galbrws1.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #include <tools/datetime.hxx>
35 #include <unotools/datetime.hxx>
36 #include <vcl/msgbox.hxx>
37 #include <ucbhelper/content.hxx>
38 #include <sfx2/app.hxx>
40 #include "gallery1.hxx"
41 #include "galtheme.hxx"
42 #include "galmisc.hxx"
44 #include "galbrws1.hxx"
45 #include <com/sun/star/util/DateTime.hpp>
49 #include <svx/svxdlg.hxx> //CHINA001
50 //CHINA001 #include <svx/dialogs.hrc> //CHINA001
56 using namespace ::rtl
;
57 using namespace ::com::sun::star
;
63 GalleryButton::GalleryButton( GalleryBrowser1
* pParent
, WinBits nWinBits
) :
64 PushButton( pParent
, nWinBits
)
68 // -----------------------------------------------------------------------------
70 GalleryButton::~GalleryButton()
74 // -----------------------------------------------------------------------------
76 void GalleryButton::KeyInput( const KeyEvent
& rKEvt
)
78 if( !static_cast< GalleryBrowser1
* >( GetParent() )->KeyInput( rKEvt
, this ) )
79 PushButton::KeyInput( rKEvt
);
82 // -----------------------
83 // - GalleryThemeListBox -
84 // -----------------------
86 GalleryThemeListBox::GalleryThemeListBox( GalleryBrowser1
* pParent
, WinBits nWinBits
) :
87 ListBox( pParent
, nWinBits
)
92 // -----------------------------------------------------------------------------
94 GalleryThemeListBox::~GalleryThemeListBox()
98 // ------------------------------------------------------------------------
100 void GalleryThemeListBox::InitSettings()
102 SetBackground( Wallpaper( GALLERY_BG_COLOR
) );
103 SetControlBackground( GALLERY_BG_COLOR
);
104 SetControlForeground( GALLERY_FG_COLOR
);
107 // -----------------------------------------------------------------------
109 void GalleryThemeListBox::DataChanged( const DataChangedEvent
& rDCEvt
)
111 if ( ( rDCEvt
.GetType() == DATACHANGED_SETTINGS
) && ( rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
114 ListBox::DataChanged( rDCEvt
);
117 // -----------------------------------------------------------------------------
119 long GalleryThemeListBox::PreNotify( NotifyEvent
& rNEvt
)
123 if( rNEvt
.GetType() == EVENT_COMMAND
)
125 const CommandEvent
* pCEvt
= rNEvt
.GetCommandEvent();
127 if( pCEvt
&& pCEvt
->GetCommand() == COMMAND_CONTEXTMENU
)
128 static_cast< GalleryBrowser1
* >( GetParent() )->ShowContextMenu();
130 else if( rNEvt
.GetType() == EVENT_KEYINPUT
)
132 const KeyEvent
* pKEvt
= rNEvt
.GetKeyEvent();
135 nDone
= static_cast< GalleryBrowser1
* >( GetParent() )->KeyInput( *pKEvt
, this );
138 return( nDone
? nDone
: ListBox::PreNotify( rNEvt
) );
141 // -------------------
142 // - GalleryBrowser1 -
143 // -------------------
145 GalleryBrowser1::GalleryBrowser1( GalleryBrowser
* pParent
, const ResId
& rResId
, Gallery
* pGallery
) :
146 Control ( pParent
, rResId
),
147 maNewTheme ( this, WB_3DLOOK
),
148 mpThemes ( new GalleryThemeListBox( this, WB_TABSTOP
| WB_3DLOOK
| WB_BORDER
| WB_HSCROLL
| WB_VSCROLL
| WB_AUTOHSCROLL
| WB_SORT
) ),
149 mpGallery ( pGallery
),
150 mpExchangeData ( new ExchangeData
),
151 mpThemePropsDlgItemSet( NULL
),
152 aImgNormal ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_NORMAL
) ),
153 aImgDefault ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_DEFAULT
) ),
154 aImgReadOnly ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_READONLY
) ),
155 aImgImported ( GalleryResGetBitmapEx( RID_SVXBMP_THEME_IMPORTED
) )
157 StartListening( *mpGallery
);
159 maNewTheme
.SetHelpId( HID_GALLERY_NEWTHEME
);
160 maNewTheme
.SetText( String( GAL_RESID( RID_SVXSTR_GALLERY_CREATETHEME
) ) );
161 maNewTheme
.SetClickHdl( LINK( this, GalleryBrowser1
, ClickNewThemeHdl
) );
163 // disable creation of new themes if a writable directory is not available
164 if( mpGallery
->GetUserURL().GetProtocol() == INET_PROT_NOT_VALID
)
165 maNewTheme
.Disable();
167 mpThemes
->SetHelpId( HID_GALLERY_THEMELIST
);
168 mpThemes
->SetSelectHdl( LINK( this, GalleryBrowser1
, SelectThemeHdl
) );
170 for( ULONG i
= 0, nCount
= mpGallery
->GetThemeCount(); i
< nCount
; i
++ )
171 ImplInsertThemeEntry( mpGallery
->GetThemeInfo( i
) );
173 ImplAdjustControls();
174 maNewTheme
.Show( TRUE
);
175 mpThemes
->Show( TRUE
);
178 // -----------------------------------------------------------------------------
180 GalleryBrowser1::~GalleryBrowser1()
182 EndListening( *mpGallery
);
185 delete mpExchangeData
;
186 mpExchangeData
= NULL
;
189 // -----------------------------------------------------------------------------
191 ULONG
GalleryBrowser1::ImplInsertThemeEntry( const GalleryThemeEntry
* pEntry
)
193 static const BOOL bShowHiddenThemes
= ( getenv( "GALLERY_SHOW_HIDDEN_THEMES" ) != NULL
);
195 ULONG nRet
= LISTBOX_ENTRY_NOTFOUND
;
197 if( pEntry
&& ( !pEntry
->IsHidden() || bShowHiddenThemes
) )
201 if( pEntry
->IsImported() )
202 pImage
= &aImgImported
;
203 else if( pEntry
->IsReadOnly() )
204 pImage
= &aImgReadOnly
;
205 else if( pEntry
->IsDefault() )
206 pImage
= &aImgDefault
;
208 pImage
= &aImgNormal
;
210 nRet
= mpThemes
->InsertEntry( pEntry
->GetThemeName(), *pImage
);
216 // -----------------------------------------------------------------------------
218 void GalleryBrowser1::ImplAdjustControls()
220 const Size
aOutSize( GetOutputSizePixel() );
221 const long nNewThemeHeight
= LogicToPixel( Size( 0, 14 ), MAP_APPFONT
).Height();
222 const long nStartY
= nNewThemeHeight
+ 4;
224 maNewTheme
.SetPosSizePixel( Point(),
225 Size( aOutSize
.Width(), nNewThemeHeight
) );
227 mpThemes
->SetPosSizePixel( Point( 0, nStartY
),
228 Size( aOutSize
.Width(), aOutSize
.Height() - nStartY
) );
231 // -----------------------------------------------------------------------------
233 void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme
* pThm
, ExchangeData
& rData
)
235 rData
.pTheme
= (GalleryTheme
*) pThm
;
236 rData
.aEditedTitle
= pThm
->GetName();
240 ::ucbhelper::Content
aCnt( pThm
->GetThmURL().GetMainURL( INetURLObject::NO_DECODE
), uno::Reference
< ucb::XCommandEnvironment
>() );
241 util::DateTime aDateTimeModified
;
244 aCnt
.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aDateTimeModified
;
245 ::utl::typeConvert( aDateTimeModified
, aDateTime
);
246 rData
.aThemeChangeDate
= aDateTime
;
247 rData
.aThemeChangeTime
= aDateTime
;
249 catch( const ucb::ContentCreationException
& )
252 catch( const uno::RuntimeException
& )
255 catch( const uno::Exception
& )
260 // -----------------------------------------------------------------------------
262 ::std::vector
< USHORT
> GalleryBrowser1::ImplGetExecuteVector()
264 ::std::vector
< USHORT
> aExecVector
;
265 GalleryTheme
* pTheme
= mpGallery
->AcquireTheme( GetSelectedTheme(), *this );
269 BOOL bUpdateAllowed
, bRenameAllowed
, bRemoveAllowed
;
270 static const BOOL bIdDialog
= ( getenv( "GALLERY_ENABLE_ID_DIALOG" ) != NULL
);
272 if( pTheme
->IsReadOnly() )
273 bUpdateAllowed
= bRenameAllowed
= bRemoveAllowed
= FALSE
;
274 else if( pTheme
->IsImported() )
276 bUpdateAllowed
= FALSE
;
277 bRenameAllowed
= bRemoveAllowed
= TRUE
;
279 else if( pTheme
->IsDefault() )
281 bUpdateAllowed
= bRenameAllowed
= TRUE
;
282 bRemoveAllowed
= FALSE
;
285 bUpdateAllowed
= bRenameAllowed
= bRemoveAllowed
= TRUE
;
287 if( bUpdateAllowed
&& pTheme
->GetObjectCount() )
288 aExecVector
.push_back( MN_ACTUALIZE
);
291 aExecVector
.push_back( MN_RENAME
);
294 aExecVector
.push_back( MN_DELETE
);
296 if( bIdDialog
&& !pTheme
->IsReadOnly() && !pTheme
->IsImported() )
297 aExecVector
.push_back( MN_ASSIGN_ID
);
299 aExecVector
.push_back( MN_PROPERTIES
);
301 mpGallery
->ReleaseTheme( pTheme
, *this );
307 // -----------------------------------------------------------------------------
309 void GalleryBrowser1::ImplGalleryThemeProperties( const String
& rThemeName
, bool bCreateNew
)
311 DBG_ASSERT(!mpThemePropsDlgItemSet
, "mpThemePropsDlgItemSet already set!");
312 mpThemePropsDlgItemSet
= new SfxItemSet( SFX_APP()->GetPool() );
313 GalleryTheme
* pTheme
= mpGallery
->AcquireTheme( rThemeName
, *this );
315 ImplFillExchangeData( pTheme
, *mpExchangeData
);
317 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
318 DBG_ASSERT(pFact
, "Got no AbstractDialogFactory!");
319 VclAbstractDialog2
* pThemeProps
= pFact
->CreateGalleryThemePropertiesDialog( NULL
, mpExchangeData
, mpThemePropsDlgItemSet
, RID_SVXTABDLG_GALLERYTHEME
);
320 DBG_ASSERT(pThemeProps
, "Got no GalleryThemePropertiesDialog!");
324 pThemeProps
->StartExecuteModal(
325 LINK( this, GalleryBrowser1
, EndNewThemePropertiesDlgHdl
) );
329 pThemeProps
->StartExecuteModal(
330 LINK( this, GalleryBrowser1
, EndThemePropertiesDlgHdl
) );
334 // -----------------------------------------------------------------------------
336 void GalleryBrowser1::ImplEndGalleryThemeProperties( VclAbstractDialog2
* pDialog
, bool bCreateNew
)
338 long nRet
= pDialog
->GetResult();
342 String
aName( mpExchangeData
->pTheme
->GetName() );
344 if( mpExchangeData
->aEditedTitle
.Len() && aName
!= mpExchangeData
->aEditedTitle
)
346 const String
aOldName( aName
);
347 String
aTitle( mpExchangeData
->aEditedTitle
);
350 while( mpGallery
->HasTheme( aTitle
) && ( nCount
++ < 16000 ) )
352 aTitle
= mpExchangeData
->aEditedTitle
;
354 aTitle
+= String::CreateFromInt32( nCount
);
357 mpGallery
->RenameTheme( aOldName
, aTitle
);
362 mpThemes
->SelectEntry( mpExchangeData
->pTheme
->GetName() );
363 SelectThemeHdl( NULL
);
367 String
aThemeName( mpExchangeData
->pTheme
->GetName() );
368 mpGallery
->ReleaseTheme( mpExchangeData
->pTheme
, *this );
370 if ( bCreateNew
&& ( nRet
!= RET_OK
) )
372 mpGallery
->RemoveTheme( aThemeName
);
375 // destroy mpThemeProps asynchronously
376 Application::PostUserEvent( LINK( this, GalleryBrowser1
, DestroyThemePropertiesDlgHdl
) );
379 // -----------------------------------------------------------------------------
381 IMPL_LINK( GalleryBrowser1
, EndNewThemePropertiesDlgHdl
, VclAbstractDialog2
*, pDialog
)
383 ImplEndGalleryThemeProperties( pDialog
, true );
387 // -----------------------------------------------------------------------------
389 IMPL_LINK( GalleryBrowser1
, EndThemePropertiesDlgHdl
, VclAbstractDialog2
*, pDialog
)
391 ImplEndGalleryThemeProperties( pDialog
, false );
395 // -----------------------------------------------------------------------------
397 IMPL_LINK( GalleryBrowser1
, DestroyThemePropertiesDlgHdl
, VclAbstractDialog2
*, pDialog
)
400 delete mpThemePropsDlgItemSet
;
401 mpThemePropsDlgItemSet
= 0;
405 // -----------------------------------------------------------------------------
407 void GalleryBrowser1::ImplExecute( USHORT nId
)
411 case( MN_ACTUALIZE
):
413 GalleryTheme
* pTheme
= mpGallery
->AcquireTheme( GetSelectedTheme(), *this );
414 //CHINA001 ActualizeProgress aActualizeProgress( this, pTheme );
415 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
418 VclAbstractRefreshableDialog
* aActualizeProgress
= pFact
->CreateActualizeProgressDialog( this, pTheme
, RID_SVXDLG_GALLERY_ACTUALIZE_PROGRESS
);
419 DBG_ASSERT(aActualizeProgress
, "Dialogdiet fail!");//CHINA001
421 aActualizeProgress
->Update(); //CHINA001 aActualizeProgress.Update();
422 aActualizeProgress
->Execute(); //CHINA001 aActualizeProgress.Execute();
423 mpGallery
->ReleaseTheme( pTheme
, *this );
424 delete aActualizeProgress
; //add CHINA001
431 if( QueryBox( NULL
, WB_YES_NO
, String( GAL_RESID( RID_SVXSTR_GALLERY_DELETETHEME
) ) ).Execute() == RET_YES
)
432 mpGallery
->RemoveTheme( mpThemes
->GetSelectEntry() );
438 GalleryTheme
* pTheme
= mpGallery
->AcquireTheme( GetSelectedTheme(), *this );
439 const String
aOldName( pTheme
->GetName() );
440 //CHINA001 TitleDialog aDlg( this, aOldName );
441 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
442 DBG_ASSERT(pFact
, "Dialogdiet fail!");//CHINA001
443 AbstractTitleDialog
* aDlg
= pFact
->CreateTitleDialog( this, aOldName
, RID_SVXDLG_GALLERY_TITLE
);
444 DBG_ASSERT(aDlg
, "Dialogdiet fail!");//CHINA001
446 if( aDlg
->Execute() == RET_OK
) //CHINA001 if( aDlg.Execute() == RET_OK )
448 const String
aNewName( aDlg
->GetTitle() ); //CHINA001 aDlg.GetTitle() );
450 if( aNewName
.Len() && ( aNewName
!= aOldName
) )
452 String
aName( aNewName
);
455 while( mpGallery
->HasTheme( aName
) && ( nCount
++ < 16000 ) )
459 aName
+= String::CreateFromInt32( nCount
);
462 mpGallery
->RenameTheme( aOldName
, aName
);
465 mpGallery
->ReleaseTheme( pTheme
, *this );
466 delete aDlg
; //add CHINA001
470 case( MN_ASSIGN_ID
):
472 GalleryTheme
* pTheme
= mpGallery
->AcquireTheme( GetSelectedTheme(), *this );
474 if( pTheme
&& !pTheme
->IsReadOnly() && !pTheme
->IsImported() )
476 //CHINA001 GalleryIdDialog aDlg( this, pTheme );
477 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
480 AbstractGalleryIdDialog
* aDlg
= pFact
->CreateGalleryIdDialog( this, pTheme
, RID_SVXDLG_GALLERY_THEMEID
);
481 DBG_ASSERT(aDlg
, "Dialogdiet fail!");//CHINA001
483 if( aDlg
->Execute() == RET_OK
) //CHINA001 if( aDlg.Execute() == RET_OK )
484 pTheme
->SetId( aDlg
->GetId(), TRUE
); //CHINA001 pTheme->SetId( aDlg.GetId(), TRUE );
485 delete aDlg
; //add CHINA001
489 mpGallery
->ReleaseTheme( pTheme
, *this );
493 case( MN_PROPERTIES
):
495 ImplGalleryThemeProperties( GetSelectedTheme(), false );
501 // -----------------------------------------------------------------------------
503 void GalleryBrowser1::Resize()
506 ImplAdjustControls();
509 // -----------------------------------------------------------------------------
511 void GalleryBrowser1::GetFocus()
515 mpThemes
->GrabFocus();
518 // -----------------------------------------------------------------------------
520 void GalleryBrowser1::Notify( SfxBroadcaster
&, const SfxHint
& rHint
)
522 const GalleryHint
& rGalleryHint
= (const GalleryHint
&) rHint
;
524 switch( rGalleryHint
.GetType() )
526 case( GALLERY_HINT_THEME_CREATED
):
527 ImplInsertThemeEntry( mpGallery
->GetThemeInfo( rGalleryHint
.GetThemeName() ) );
530 case( GALLERY_HINT_THEME_RENAMED
):
532 const USHORT nCurSelectPos
= mpThemes
->GetSelectEntryPos();
533 const USHORT nRenameEntryPos
= mpThemes
->GetEntryPos( rGalleryHint
.GetThemeName() );
535 mpThemes
->RemoveEntry( rGalleryHint
.GetThemeName() );
536 ImplInsertThemeEntry( mpGallery
->GetThemeInfo( rGalleryHint
.GetStringData() ) );
538 if( nCurSelectPos
== nRenameEntryPos
)
540 mpThemes
->SelectEntry( rGalleryHint
.GetStringData() );
541 SelectThemeHdl( NULL
);
546 case( GALLERY_HINT_THEME_REMOVED
):
548 mpThemes
->RemoveEntry( rGalleryHint
.GetThemeName() );
552 case( GALLERY_HINT_CLOSE_THEME
):
554 const USHORT nCurSelectPos
= mpThemes
->GetSelectEntryPos();
555 const USHORT nCloseEntryPos
= mpThemes
->GetEntryPos( rGalleryHint
.GetThemeName() );
557 if( nCurSelectPos
== nCloseEntryPos
)
559 if( nCurSelectPos
< ( mpThemes
->GetEntryCount() - 1 ) )
560 mpThemes
->SelectEntryPos( nCurSelectPos
+ 1 );
561 else if( nCurSelectPos
)
562 mpThemes
->SelectEntryPos( nCurSelectPos
- 1 );
564 mpThemes
->SetNoSelection();
566 SelectThemeHdl( NULL
);
576 // -----------------------------------------------------------------------------
578 void GalleryBrowser1::ShowContextMenu()
580 Application::PostUserEvent( LINK( this, GalleryBrowser1
, ShowContextMenuHdl
), this );
583 // -----------------------------------------------------------------------------
585 BOOL
GalleryBrowser1::KeyInput( const KeyEvent
& rKEvt
, Window
* pWindow
)
587 BOOL bRet
= static_cast< GalleryBrowser
* >( GetParent() )->KeyInput( rKEvt
, pWindow
);
591 ::std::vector
< USHORT
> aExecVector( ImplGetExecuteVector() );
592 USHORT nExecuteId
= 0;
593 BOOL bMod1
= rKEvt
.GetKeyCode().IsMod1();
595 switch( rKEvt
.GetKeyCode().GetCode() )
598 ClickNewThemeHdl( NULL
);
604 ClickNewThemeHdl( NULL
);
611 nExecuteId
= MN_ACTUALIZE
;
616 nExecuteId
= MN_DELETE
;
622 nExecuteId
= MN_DELETE
;
629 nExecuteId
= MN_RENAME
;
636 nExecuteId
= MN_PROPERTIES
;
641 if( nExecuteId
&& ( ::std::find( aExecVector
.begin(), aExecVector
.end(), nExecuteId
) != aExecVector
.end() ) )
643 ImplExecute( nExecuteId
);
651 // -----------------------------------------------------------------------------
653 IMPL_LINK( GalleryBrowser1
, ShowContextMenuHdl
, void*, EMPTYARG
)
655 ::std::vector
< USHORT
> aExecVector( ImplGetExecuteVector() );
657 if( aExecVector
.size() )
659 PopupMenu
aMenu( GAL_RESID( RID_SVXMN_GALLERY1
) );
661 aMenu
.EnableItem( MN_ACTUALIZE
, ::std::find( aExecVector
.begin(), aExecVector
.end(), MN_ACTUALIZE
) != aExecVector
.end() );
662 aMenu
.EnableItem( MN_RENAME
, ::std::find( aExecVector
.begin(), aExecVector
.end(), MN_RENAME
) != aExecVector
.end() );
663 aMenu
.EnableItem( MN_DELETE
, ::std::find( aExecVector
.begin(), aExecVector
.end(), MN_DELETE
) != aExecVector
.end() );
664 aMenu
.EnableItem( MN_ASSIGN_ID
, ::std::find( aExecVector
.begin(), aExecVector
.end(), MN_ASSIGN_ID
) != aExecVector
.end() );
665 aMenu
.EnableItem( MN_PROPERTIES
, ::std::find( aExecVector
.begin(), aExecVector
.end(), MN_PROPERTIES
) != aExecVector
.end() );
666 aMenu
.SetSelectHdl( LINK( this, GalleryBrowser1
, PopupMenuHdl
) );
667 aMenu
.RemoveDisabledEntries();
669 const Rectangle
aThemesRect( mpThemes
->GetPosPixel(), mpThemes
->GetOutputSizePixel() );
670 Point
aSelPos( mpThemes
->GetBoundingRectangle( mpThemes
->GetSelectEntryPos() ).Center() );
672 aSelPos
.X() = Max( Min( aSelPos
.X(), aThemesRect
.Right() ), aThemesRect
.Left() );
673 aSelPos
.Y() = Max( Min( aSelPos
.Y(), aThemesRect
.Bottom() ), aThemesRect
.Top() );
675 aMenu
.Execute( this, aSelPos
);
681 // -----------------------------------------------------------------------------
683 IMPL_LINK( GalleryBrowser1
, PopupMenuHdl
, Menu
*, pMenu
)
685 ImplExecute( pMenu
->GetCurItemId() );
689 // -----------------------------------------------------------------------------
691 IMPL_LINK( GalleryBrowser1
, SelectThemeHdl
, void*, EMPTYARG
)
693 ( (GalleryBrowser
*) GetParent() )->ThemeSelectionHasChanged();
697 // -----------------------------------------------------------------------------
699 IMPL_LINK( GalleryBrowser1
, ClickNewThemeHdl
, void*, EMPTYARG
)
701 String
aNewTheme( GAL_RESID( RID_SVXSTR_GALLERY_NEWTHEME
) );
702 String
aName( aNewTheme
);
705 while( mpGallery
->HasTheme( aName
) && ( nCount
++ < 16000 ) )
709 aName
+= String::CreateFromInt32( nCount
);
712 if( !mpGallery
->HasTheme( aName
) && mpGallery
->CreateTheme( aName
) )
714 ImplGalleryThemeProperties( aName
, true );