Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:28:21 +0300
branchRCL_3
changeset 22 e3a25416bf1f
parent 20 326673dff2bf
child 32 b69cc3efe785
Revision: 201021 Kit: 2010123
csxhelp/HelpEngine/src/CSXHLegacyContentParser.cpp
csxhelp/HelpEngine/src/CSXHLegacyTOC1.cpp
csxhelp/src/CSXHLegacyTopicContainer.cpp
--- a/csxhelp/HelpEngine/src/CSXHLegacyContentParser.cpp	Tue May 25 12:28:46 2010 +0300
+++ b/csxhelp/HelpEngine/src/CSXHLegacyContentParser.cpp	Wed Jun 09 09:28:21 2010 +0300
@@ -156,6 +156,10 @@
         if(appName.Compare(aTopic->GetName())==0)
             break;
         }
+    if( nIndex == nCount )
+        {
+        return NULL;
+        }
     if(iTopic)
         {
         delete iTopic;
--- a/csxhelp/HelpEngine/src/CSXHLegacyTOC1.cpp	Tue May 25 12:28:46 2010 +0300
+++ b/csxhelp/HelpEngine/src/CSXHLegacyTOC1.cpp	Wed Jun 09 09:28:21 2010 +0300
@@ -70,8 +70,6 @@
 
 void CCSXHLegacyTOC1::InitChildList()
     {
-    if(iChildList != NULL)
-        return;
     ConstructChildList();
     
     TRAP_IGNORE(CCSXHHelpDataBase::GetInstance()->
--- a/csxhelp/src/CSXHLegacyTopicContainer.cpp	Tue May 25 12:28:46 2010 +0300
+++ b/csxhelp/src/CSXHLegacyTopicContainer.cpp	Wed Jun 09 09:28:21 2010 +0300
@@ -33,6 +33,7 @@
 #include <aknlayoutscalable_apps.cdl.h>
 #include <aknappui.h>
 #include <txtfrmat.h> 
+#include <cshelp.rsg>
 
 CCSXHLegacyTopicContainer* CCSXHLegacyTopicContainer::NewL(const TRect& 
 aRect,CCSXHDocument &aDocument,CCSXHLegacyTOC2 *aTopic)
@@ -69,12 +70,18 @@
     GetTextFormat();
 
     iEdwin = new(ELeave) CEikEdwin();
-    const TInt flags(CEikEdwin::EKeepDocument |
-                     CEikEdwin::EUserSuppliedText |
-                     CEikEdwin::ENoAutoSelection |
-                     CEikEdwin::EAvkonDisableCursor |
-                     CEikEdwin::EReadOnly |
-                     CEikEdwin::EDisplayOnly);
+    TInt flags(CEikEdwin::EKeepDocument |
+               CEikEdwin::EUserSuppliedText |
+               CEikEdwin::ENoAutoSelection |
+               CEikEdwin::EAvkonDisableCursor |
+               CEikEdwin::EReadOnly |
+               CEikEdwin::EDisplayOnly);
+
+    if ( iText == NULL )
+        {
+        flags = flags & ~CEikEdwin::EUserSuppliedText;
+        }
+
     iEdwin->SetContainerWindowL(*this);
 
     iEdwin->ConstructL(flags);
@@ -82,7 +89,10 @@
                                                  CEikScrollBarFrame::EOff,
                                                  CEikScrollBarFrame::EAuto);
     SetTextL(iText);
-    FormatRichTextL(*iText);
+    if( iText != NULL )
+        {
+        FormatRichTextL(*iText);
+        }
     SetRect(aRect);
     ActivateL();
     }
@@ -98,15 +108,26 @@
     iTopic = aTopic;
     iText = STATIC_CAST(CRichText*,iTopic->GetTopicContentL());
     SetTextL(iText);
-    FormatRichTextL(*iText);
+    if( iText != NULL )
+        {
+        FormatRichTextL(*iText);
+        }
     SizeChanged();
     }
 
 void CCSXHLegacyTopicContainer::SetTextL(CRichText* aText)
     {
-    iEdwin->SetDocumentContentL(*aText, CEikEdwin::EUseText);
-    iEdwin->SetCursorPosL(0, EFalse);
-    
+    if( aText == NULL )
+        {
+        HBufC* errorMessage = iCoeEnv->AllocReadResourceLC( R_TYPE_NO_HELP_TOPICS );
+        iEdwin->SetTextL( errorMessage );
+        CleanupStack::PopAndDestroy( errorMessage ); 
+        }
+    else
+        {
+        iEdwin->SetDocumentContentL(*aText, CEikEdwin::EUseText);
+        iEdwin->SetCursorPosL(0, EFalse);
+        }    
     }
 
 void CCSXHLegacyTopicContainer::FocusChanged(TDrawNow aDrawNow)