webengine/osswebengine/WebCore/platform/symbian/PopupMenuSymbian.cpp
changeset 10 a359256acfc6
parent 0 dd21522fd290
child 11 c8a366e56285
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    34 #include "brctl.h"
    34 #include "brctl.h"
    35 
    35 
    36 #include <e32base.h>
    36 #include <e32base.h>
    37 #include <BrCtlDialogsProvider.h>
    37 #include <BrCtlDialogsProvider.h>
    38 
    38 
       
    39 const TInt KDefaultSize(1);
    39 namespace WebCore {
    40 namespace WebCore {
    40 
    41 
    41 static void ResetAndDestroy(TAny *aPtr);
    42 static void ResetAndDestroy(TAny *aPtr);
    42 PopupMenu::PopupMenu(PopupMenuClient* client) : m_popupClient(client)
    43 PopupMenu::PopupMenu(PopupMenuClient* client) : m_popupClient(client)
    43 {
    44 {
    58         return;
    59         return;
    59     }
    60     }
    60     WebView* wv = kit(v->frame()->page());
    61     WebView* wv = kit(v->frame()->page());
    61     MBrCtlDialogsProvider* dialogs = wv->brCtl()->brCtlDialogsProvider();
    62     MBrCtlDialogsProvider* dialogs = wv->brCtl()->brCtlDialogsProvider();
    62     int size = client()->listSize();
    63     int size = client()->listSize();
    63     CArrayFix<TBrCtlSelectOptionData>* options = new CArrayFixFlat<TBrCtlSelectOptionData>(size);
    64     CArrayFix<TBrCtlSelectOptionData>* options = 
    64     RPointerArray<HBufC> items(size);
    65             new CArrayFixFlat<TBrCtlSelectOptionData>((size>0) ? size : KDefaultSize);
       
    66     RPointerArray<HBufC> items((size>0) ? size : KDefaultSize);
    65     CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&items));
    67     CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&items));
    66     
    68     
    67     for (int i = 0; i < size; i++) {
    69     for (int i = 0; i < size; i++) {
    68         // better separator
    70         // better separator
    69         if (client()->itemIsSeparator(i)) {
    71         if (client()->itemIsSeparator(i)) {
    95 
    97 
    96     if (index != newIndex && newIndex >= 0) {
    98     if (index != newIndex && newIndex >= 0) {
    97         m_popupClient->valueChanged(newIndex);
    99         m_popupClient->valueChanged(newIndex);
    98     }
   100     }
    99     delete options;
   101     delete options;
   100     
       
   101 }
   102 }
   102 
   103 
   103 void PopupMenu::hide()
   104 void PopupMenu::hide()
   104 {
   105 {
   105     // impossible
   106     // impossible