diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-23 10:42:05 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-23 10:42:05 +0000 |
commit | 11498c64d60d55240f440f28dbf563888668f3c0 (patch) | |
tree | db59da06bc745f2a094ec0fd6be9c4f05834429c /forms/source/xforms | |
parent | 7c68f16f21a42f539eff87cb6c247873217b5675 (diff) |
CWS-TOOLING: integrate CWS dbaperf1
2009-04-02 09:12:25 +0200 oj r270372 : CWS-TOOLING: rebase CWS dbaperf1 to trunk@270033 (milestone: DEV300:m45)
2009-03-17 10:20:34 +0100 oj r269577 : add parameter
2009-03-17 10:20:05 +0100 oj r269576 : add parameter
2009-03-12 12:32:24 +0100 oj r269387 : add missing ++
2009-03-11 12:53:35 +0100 oj r269315 : compile error
2009-03-06 08:52:11 +0100 oj r268968 : #i99264# remove duplicate code
2009-03-06 08:20:08 +0100 oj r268966 : add missingheader
2009-03-06 08:17:41 +0100 oj r268965 : add header
2009-03-06 08:15:07 +0100 oj r268964 : #i99708# remove duplicate code
2009-03-06 07:24:11 +0100 oj r268963 : #i99708# remove duplicate code
2009-03-06 07:22:24 +0100 oj r268962 : #i99708# use tenary operator
2009-03-06 07:19:21 +0100 oj r268961 : remove unused rtl_logs
2009-03-06 07:15:55 +0100 oj r268960 : #i99708# extract getLength from for loop
2009-03-06 07:15:35 +0100 oj r268959 : #i99708# extract getLength from for loop
2009-03-06 07:14:57 +0100 oj r268958 : remove unused rtl_logs
2009-03-06 07:13:01 +0100 oj r268957 : insert DBG_ helper
2009-03-06 07:12:17 +0100 oj r268956 : remove unused rtl_logs
2009-03-06 07:10:26 +0100 oj r268955 : remove unused rtl_logs
2009-03-06 07:04:51 +0100 oj r268954 : #i99708# use tenary operator
2009-03-05 12:04:46 +0100 oj r268895 : comment RTL_LOG out
2009-03-05 09:05:07 +0100 oj r268874 : add rtl logfile
2009-03-04 14:21:18 +0100 oj r268828 : #i99708# make static inplace and some method calls in for loop removed
2009-03-04 14:20:34 +0100 oj r268827 : #i99708# impl double check pattern for getInfohelper
2009-03-02 09:31:42 +0100 oj r268636 : add rtl logfile
2009-03-02 08:18:37 +0100 oj r268633 : add rtl logfile
2009-02-27 11:22:16 +0100 oj r268570 : #i99709# change algorithm for marking objects
2009-02-27 11:17:04 +0100 oj r268568 : #i99708# some improvements to load forms, controls faster and replacement of size() call with !empty() which is much faster
2009-02-24 10:09:35 +0100 sb r268383 : #i99290# no longer care to set a sensible context class loader for native threads attached to the VM
2009-02-23 13:44:04 +0100 oj r268354 : #i76606# seekrow changes
2009-02-23 12:27:30 +0100 oj r268349 : deleted
2009-02-20 15:14:23 +0100 oj r268325 : #i76606# some code changes
2009-02-19 14:15:25 +0100 oj r268284 : #i76606# use of simple prep stmt instead of full blown rowset, when source and dest connection are the same use insert into ... ( select ... )
2009-02-19 11:27:55 +0100 oj r268265 : #i76606# insert some RTL_LOG and setObject impl
2009-02-18 14:45:37 +0100 oj r268222 : #i99363# insert RTL_LOG
2009-02-18 14:45:18 +0100 oj r268221 : #i99363# insert RTL_LOG
2009-02-18 11:14:54 +0100 oj r268207 : #i99363# call some impl_ methods to avoid duplicate cechCache calls
2009-02-18 11:10:47 +0100 oj r268206 : #i99363# make isCount inline
2009-02-18 10:33:22 +0100 oj r268203 : #i99363# use bookmarkable if available and inserted some RTL_LOG
2009-02-18 10:32:57 +0100 oj r268202 : #i99363# use bookmarkable if available and inserted some RTL_LOG
2009-02-17 07:29:05 +0100 oj r267843 : #i96897# remove some dll public
2009-02-16 15:01:04 +0100 oj r267816 : #i96897# remove some dll public
2009-02-16 14:25:53 +0100 oj r267810 : #i99264# remove duplicate code
2009-02-16 14:25:33 +0100 oj r267809 : #i99264# remove duplicate code
2009-02-16 14:24:59 +0100 oj r267808 : #i99264# remove duplicate code
2009-02-13 10:56:17 +0100 oj r267703 : #i99191# comment the contextclassloader
2009-02-13 10:32:40 +0100 oj r267700 : reduce call to resultset meta data
2009-02-13 10:27:31 +0100 oj r267699 : reduce call to resultset meta data
2009-02-13 10:27:08 +0100 oj r267698 : reduce call to resultset meta data
Diffstat (limited to 'forms/source/xforms')
-rw-r--r-- | forms/source/xforms/submission/replace.cxx | 30 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission.hxx | 17 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission_get.cxx | 1 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission_post.cxx | 19 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission_post.hxx | 4 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission_put.cxx | 22 | ||||
-rw-r--r-- | forms/source/xforms/submission/submission_put.hxx | 2 |
7 files changed, 46 insertions, 49 deletions
diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx index e0504973f7ac..9c54d6e7164a 100644 --- a/forms/source/xforms/submission/replace.cxx +++ b/forms/source/xforms/submission/replace.cxx @@ -30,8 +30,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" - +#include <memory> #include "submission.hxx" +#include "serialization_app_xml.hxx" #include <rtl/ustring.hxx> #include <rtl/string.hxx> @@ -44,11 +45,14 @@ #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <ucbhelper/content.hxx> using namespace com::sun::star::uno; +using namespace com::sun::star::ucb; using namespace com::sun::star::frame; using namespace com::sun::star::lang; using namespace com::sun::star::beans; +using namespace com::sun::star::task; using namespace com::sun::star::xml::dom; CSubmission::SubmissionResult CSubmission::replace(const ::rtl::OUString& aReplace, const Reference<XDocument>& aDocument, const Reference<XFrame>& aFrame) @@ -116,5 +120,29 @@ CSubmission::SubmissionResult CSubmission::replace(const ::rtl::OUString& aRepla } return CSubmission::UNKNOWN_ERROR; } +::std::auto_ptr< CSerialization > CSubmission::createSerialization(const Reference< XInteractionHandler >& _xHandler,Reference<XCommandEnvironment>& _rOutEnv) +{ + // PUT always uses application/xml + ::std::auto_ptr< CSerialization > apSerialization(new CSerializationAppXML()); + apSerialization->setSource(m_aFragment); + apSerialization->serialize(); + + // create a commandEnvironment and use the default interaction handler + CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper; + if( _xHandler.is() ) + pHelper->m_aInteractionHandler = _xHandler; + else + pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance( + ::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); + OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler"); + + CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; + pHelper->m_aProgressHandler = Reference< XProgressHandler >(pProgressHelper); + + // UCB has ownership of environment... + _rOutEnv = pHelper; + return apSerialization; +} + diff --git a/forms/source/xforms/submission/submission.hxx b/forms/source/xforms/submission/submission.hxx index a435d7c7fc15..c146282903c4 100644 --- a/forms/source/xforms/submission/submission.hxx +++ b/forms/source/xforms/submission/submission.hxx @@ -35,12 +35,14 @@ #include <rtl/ustring.h> #include <osl/conditn.hxx> #include <osl/mutex.hxx> +#include <unotools/processfactory.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Exception.hpp> #include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/xml/xpath/XXPathObject.hpp> #include <com/sun/star/xml/dom/XDocumentFragment.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> @@ -66,10 +68,12 @@ class CCommandEnvironmentHelper : public cppu::WeakImplHelper1< CSS::ucb::XComma friend class CSubmissionPut; friend class CSubmissionPost; friend class CSubmissionGet; + friend class CSubmission; protected: - CSS::uno::Reference< CSS::task::XInteractionHandler > m_aInteractionHandler; - CSS::uno::Reference< CSS::ucb::XProgressHandler > m_aProgressHandler; + CSS::uno::Reference< CSS::task::XInteractionHandler > m_aInteractionHandler; + CSS::uno::Reference< CSS::ucb::XProgressHandler > m_aProgressHandler; + public: virtual CSS::uno::Reference< CSS::task::XInteractionHandler > SAL_CALL getInteractionHandler() throw (CSS::uno::RuntimeException) { @@ -118,11 +122,15 @@ class CSubmission protected: INetURLObject m_aURLObj; - CSS::uno::Reference< CSS::xml::xpath::XXPathObject > m_aXPathObject; + CSS::uno::Reference< CSS::xml::xpath::XXPathObject > m_aXPathObject; CSS::uno::Reference< CSS::xml::dom::XDocumentFragment > m_aFragment; - CSS::uno::Reference< CSS::io::XInputStream > m_aResultStream; + CSS::uno::Reference< CSS::io::XInputStream > m_aResultStream; + CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; rtl::OUString m_aEncoding; + ::std::auto_ptr< CSerialization > createSerialization(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler + ,com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment>& _rOutEnv); + public: enum SubmissionResult { SUCCESS, @@ -136,6 +144,7 @@ public: CSubmission(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : m_aURLObj(aURL) , m_aFragment(aFragment) + , m_aFactory(::utl::getProcessServiceFactory()) {} virtual ~CSubmission() {} diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index 9ca195be946f..c310be9fc82f 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -55,7 +55,6 @@ using namespace std; CSubmissionGet::CSubmissionGet(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : CSubmission(aURL, aFragment) - , m_aFactory(utl::getProcessServiceFactory()) { } diff --git a/forms/source/xforms/submission/submission_post.cxx b/forms/source/xforms/submission/submission_post.cxx index 53047c7036e9..8142fec3df05 100644 --- a/forms/source/xforms/submission/submission_post.cxx +++ b/forms/source/xforms/submission/submission_post.cxx @@ -55,29 +55,14 @@ using namespace std; CSubmissionPost::CSubmissionPost(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : CSubmission(aURL, aFragment) - , m_aFactory(utl::getProcessServiceFactory()) { } CSubmission::SubmissionResult CSubmissionPost::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) { // PUT always uses application/xml - auto_ptr< CSerialization > apSerialization(new CSerializationAppXML()); - apSerialization->setSource(m_aFragment); - apSerialization->serialize(); - - // create a commandEnvironment and use the default interaction handler - CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper; - if( aInteractionHandler.is() ) - pHelper->m_aInteractionHandler = aInteractionHandler; - else - pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance( - OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); - OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler"); - CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; - pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper); - // UCB has ownership of environment... - CSS::uno::Reference< XCommandEnvironment > aEnvironment(pHelper); + CSS::uno::Reference< XCommandEnvironment > aEnvironment; + auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment)); try { ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment); diff --git a/forms/source/xforms/submission/submission_post.hxx b/forms/source/xforms/submission/submission_post.hxx index d812c0bec858..a3c109033664 100644 --- a/forms/source/xforms/submission/submission_post.hxx +++ b/forms/source/xforms/submission/submission_post.hxx @@ -31,14 +31,10 @@ #ifndef __SUBMISSION_POST_HXX #define __SUBMISSION_POST_HXX -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - #include "submission.hxx" class CSubmissionPost : public CSubmission { -private: - CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; public: CSubmissionPost(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment); virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler); diff --git a/forms/source/xforms/submission/submission_put.cxx b/forms/source/xforms/submission/submission_put.cxx index 50d80880b07a..10bc0e2b0896 100644 --- a/forms/source/xforms/submission/submission_put.cxx +++ b/forms/source/xforms/submission/submission_put.cxx @@ -53,31 +53,13 @@ using namespace std; CSubmissionPut::CSubmissionPut(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment) : CSubmission(aURL, aFragment) - , m_aFactory(utl::getProcessServiceFactory()) { } CSubmission::SubmissionResult CSubmissionPut::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) { - // PUT always uses application/xml - auto_ptr< CSerialization > apSerialization(new CSerializationAppXML()); - apSerialization->setSource(m_aFragment); - apSerialization->serialize(); - - // create a commandEnvironment and use the default interaction handler - CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper; - if( aInteractionHandler.is() ) - pHelper->m_aInteractionHandler = aInteractionHandler; - else - pHelper->m_aInteractionHandler = CSS::uno::Reference< XInteractionHandler >(m_aFactory->createInstance( - OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY); - OSL_ENSURE(pHelper->m_aInteractionHandler.is(), "failed to create IntreractionHandler"); - - CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper; - pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper); - - // UCB has ownership of environment... - CSS::uno::Reference< XCommandEnvironment > aEnvironment(pHelper); + CSS::uno::Reference< XCommandEnvironment > aEnvironment; + auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment)); try { ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment); diff --git a/forms/source/xforms/submission/submission_put.hxx b/forms/source/xforms/submission/submission_put.hxx index da95f926ebaf..3bf3d2fd92a1 100644 --- a/forms/source/xforms/submission/submission_put.hxx +++ b/forms/source/xforms/submission/submission_put.hxx @@ -38,8 +38,6 @@ class CSubmissionPut : public CSubmission { -private: - CSS::uno::Reference< CSS::lang::XMultiServiceFactory > m_aFactory; public: CSubmissionPut(const rtl::OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment); virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler); |