Tag: cws_src680_reportdesign02
User: oj      
Date: 2007-10-26 11:04:15+0000
Modified:
   dba/connectivity/inc/connectivity/dbtools.hxx
   dba/connectivity/source/commontools/dbtools2.cxx

Log:
 #i82914# new function to ask for the report engine service name

File Changes:

Directory: /dba/connectivity/inc/connectivity/
==============================================

File [changed]: dbtools.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/dbtools.hxx?r1=1.32&r2=1.32.114.1
Delta lines:  +5 -3
-------------------
--- dbtools.hxx 2006-12-13 16:11:42+0000        1.32
+++ dbtools.hxx 2007-10-26 11:04:12+0000        1.32.114.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtools.hxx,v $
  *
- *  $Revision: 1.32 $
+ *  $Revision: 1.32.114.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/12/13 16:11:42 $
+ *  last change: $Author: oj $ $Date: 2007/10/26 11:04:12 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -353,6 +353,8 @@
                                                                                
,const ::rtl::OUString& _sProperty,
                                                                                
sal_Bool _bDefault = sal_False);
 
+    ::rtl::OUString getDefaultReportEngineServiceName(const 
::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
+
        /** quote the given name with the given quote string.
        */
        ::rtl::OUString quoteName(const ::rtl::OUString& _rQuote, const 
::rtl::OUString& _rName);

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: dbtools2.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools2.cxx?r1=1.23&r2=1.23.54.1
Delta lines:  +51 -4
--------------------
--- dbtools2.cxx        2007-06-12 05:27:13+0000        1.23
+++ dbtools2.cxx        2007-10-26 11:04:13+0000        1.23.54.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtools2.cxx,v $
  *
- *  $Revision: 1.23 $
+ *  $Revision: 1.23.54.1 $
  *
- *  last change: $Author: obo $ $Date: 2007/06/12 05:27:13 $
+ *  last change: $Author: oj $ $Date: 2007/10/26 11:04:13 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -43,7 +43,7 @@
 #ifndef _DBHELPER_DBCHARSET_HXX_
 #include "connectivity/dbcharset.hxx"
 #endif
-
+#include <unotools/confignode.hxx>
 #ifndef CONNECTIVITY_SHAREDRESOURCES_HXX
 #include "resource/sharedresources.hxx"
 #endif
@@ -105,6 +105,7 @@
 
 #include <tools/diagnose_ex.h>
 #include <unotools/sharedunocomponent.hxx>
+#include <comphelper/configurationhelper.hxx>
 
 //.........................................................................
 namespace dbtools
@@ -922,6 +923,52 @@
 
    return nLen;
 }
+::rtl::OUString lcl_getReportEngines()
+{
+       static ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/ReportEngines"));
+       return s_sNodeName;
+}
+// 
-----------------------------------------------------------------------------
+::rtl::OUString lcl_getDefaultReportEngine()
+{
+       static ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DefaultReportEngine"));
+       return s_sNodeName;
+}
+// 
-----------------------------------------------------------------------------
+::rtl::OUString lcl_getReportEngineNames()
+{
+       static ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("ReportEngineNames"));
+       return s_sNodeName;
+}
+// 
-----------------------------------------------------------------------------
+::rtl::OUString getDefaultReportEngineServiceName(const Reference< 
XMultiServiceFactory >& _rxORB)
+{
+       ::utl::OConfigurationTreeRoot aReportEngines = 
::utl::OConfigurationTreeRoot::createWithServiceFactory(
+               _rxORB, lcl_getReportEngines(), -1, 
::utl::OConfigurationTreeRoot::CM_READONLY);
+
+       if ( aReportEngines.isValid() )
+       {
+               ::rtl::OUString sDefaultReportEngineName;
+               aReportEngines.getNodeValue(lcl_getDefaultReportEngine()) >>= 
sDefaultReportEngineName;
+        if ( sDefaultReportEngineName.getLength() )
+        {
+                   ::utl::OConfigurationNode aReportEngineNames = 
aReportEngines.openNode(lcl_getReportEngineNames());
+                   if ( aReportEngineNames.isValid() )
+                   {
+                           ::utl::OConfigurationNode aReportEngine = 
aReportEngineNames.openNode(sDefaultReportEngineName);
+                           if ( aReportEngine.isValid() )
+                           {
+                    ::rtl::OUString sRet;
+                           const static ::rtl::OUString 
s_sService(RTL_CONSTASCII_USTRINGPARAM("ServiceName"));
+                           aReportEngine.getNodeValue(s_sService) >>= sRet;
+                                   return sRet;
+                           }
+                   }
+        }
+       }
+       return ::rtl::OUString();
+}
+// 
-----------------------------------------------------------------------------
 //.........................................................................
 }      // namespace dbtools
 //.........................................................................




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to