From ef88e44fbbabca4102b07fd6fbae5f0c10eac6fb Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Wed, 16 Jul 2008 17:43:50 +0200
Subject: [PATCH] Set help-id from xml.

---
 offapi/com/sun/star/awt/XDialog2.idl |    3 ++-
 toolkit/source/awt/vclxdialog.cxx    |    9 +++++++++
 toolkit/source/awt/vclxdialog.hxx    |    1 +
 toolkit/source/layout/import.cxx     |    6 ++++++
 4 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/offapi/com/sun/star/awt/XDialog2.idl b/offapi/com/sun/star/awt/XDialog2.idl
index a9b99dc..3cde809 100644
--- a/offapi/com/sun/star/awt/XDialog2.idl
+++ b/offapi/com/sun/star/awt/XDialog2.idl
@@ -12,11 +12,12 @@ module com {  module sun {  module star {  module awt {
  
 //============================================================================= 
  
-/** Makes it possible to end a dialog.
+/** Makes it possible to end a dialog and set a help id.
  */
 published interface XDialog2: com::sun::star::awt::XDialog
 { 
     void endDialog ( [in] long Result );
+    void setHelpId ( [in] long Id );
 }; 
  
 //============================================================================= 
diff --git a/toolkit/source/awt/vclxdialog.cxx b/toolkit/source/awt/vclxdialog.cxx
index f54996b..f72500c 100644
--- a/toolkit/source/awt/vclxdialog.cxx
+++ b/toolkit/source/awt/vclxdialog.cxx
@@ -215,6 +215,15 @@ void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star
         pWindow->SetText( Title );
 }
 
+void VCLXDialog::setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException)
+{
+    ::vos::OGuard aGuard( GetMutex() );
+
+    Window* pWindow = GetWindow();
+    if ( pWindow )
+        pWindow->SetHelpId( id );
+}
+
 ::rtl::OUString VCLXDialog::getTitle() throw(::com::sun::star::uno::RuntimeException)
 {
     ::vos::OGuard aGuard( GetMutex() );
diff --git a/toolkit/source/awt/vclxdialog.hxx b/toolkit/source/awt/vclxdialog.hxx
index c270e63..64a90f6 100644
--- a/toolkit/source/awt/vclxdialog.hxx
+++ b/toolkit/source/awt/vclxdialog.hxx
@@ -106,6 +106,7 @@ public:
 
     // ::com::sun::star::awt::XDialog2
     void SAL_CALL endDialog( sal_Int32 nResult ) throw(::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setHelpId( sal_Int32 id ) throw(::com::sun::star::uno::RuntimeException);
 
 };
 
diff --git a/toolkit/source/layout/import.cxx b/toolkit/source/layout/import.cxx
index 87b3a32..0fd436c 100644
--- a/toolkit/source/layout/import.cxx
+++ b/toolkit/source/layout/import.cxx
@@ -104,6 +104,12 @@ SAL_THROW (())
         OUString aTitle;
         if ( findAndRemove( "title", aProps, aTitle ) )
             xDialog->setTitle( aTitle );
+        OUString aHelpId;
+        if ( findAndRemove( "help-id", aProps, aHelpId ) )
+        {
+            OSL_TRACE("Setting help-id: %s", OUSTRING_CSTR( aHelpId ) );
+            xDialog->setHelpId( aHelpId.toInt32 () );
+        }
     } // DEBUG:
     else if ( pParent == NULL )
     {
-- 
1.5.6.3.317.g5d44c9.dirty


