diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-10-24 06:38:34 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-10-24 06:38:34 +0000 |
commit | 3cf15c02e0ec4bfd3534b028126bc9703ce75c1b (patch) | |
tree | 2c58dc0fe3101a7a657dbb0d3a8e8f2213db5cac /forms/source/xforms/submission/submission_get.cxx | |
parent | 6c930968e3f9a41ab99942421585eaa4471fc009 (diff) |
INTEGRATION: CWS eformspp1 (1.3.2); FILE MERGED
2005/10/17 18:32:38 lo 1.3.2.2: RESYNC: (1.3-1.4); FILE MERGED
2005/09/15 15:35:29 lo 1.3.2.1: fix get to file
Diffstat (limited to 'forms/source/xforms/submission/submission_get.cxx')
-rw-r--r-- | forms/source/xforms/submission/submission_get.cxx | 70 |
1 files changed, 29 insertions, 41 deletions
diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx index de4ee4ecb7ff..26b7bdba8f2d 100644 --- a/forms/source/xforms/submission/submission_get.cxx +++ b/forms/source/xforms/submission/submission_get.cxx @@ -4,9 +4,9 @@ * * $RCSfile: submission_get.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2005-09-08 23:25:43 $ + * last change: $Author: rt $ $Date: 2005-10-24 07:38:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -84,50 +84,38 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference< // UCB has ownership of environment... Reference< XCommandEnvironment > aEnvironment(pHelper); - if (m_aURLObj.GetProtocol() == INET_PROT_FILE) - { - // write the serialized content to a file - try { - ucb::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment); - // insert serialized data to content -> PUT + // append query string to the URL + try { + OStringBuffer aUTF8QueryURL(OUStringToOString(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), + RTL_TEXTENCODING_UTF8)); + OStringBuffer aQueryString; - aContent.writeStream(aInStream, sal_True); - } catch (Exception& e) + const sal_Int32 size = 1024; + sal_Int32 n = 0; + Sequence< sal_Int8 > aByteBuffer(size); + while ((n = aInStream->readSomeBytes(aByteBuffer, size-1)) != 0) + aQueryString.append((sal_Char*)aByteBuffer.getArray(), n); + if (aQueryString.getLength() > 0 && m_aURLObj.GetProtocol() != INET_PROT_FILE) { - // XXX - OSL_ENSURE(sal_False, "Exception during UCB operatration."); - return UNKNOWN_ERROR; + aUTF8QueryURL.append('?'); + aUTF8QueryURL.append(aQueryString.makeStringAndClear()); } - } - else - { - // append query string to the URL + OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8); + ucb::Content aContent(aQueryURL, aEnvironment); + Reference< XOutputStream > aPipe(m_aFactory->createInstance( + OUString::createFromAscii("com.sun.star.io.Pipe")), UNO_QUERY_THROW); + aContent.openStream(aPipe); + // get reply try { - OStringBuffer aUTF8QueryURL(OUStringToOString(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), - RTL_TEXTENCODING_UTF8)); - aUTF8QueryURL.append('?'); - const sal_Int32 size = 1024; - sal_Int32 n = 0; - Sequence< sal_Int8 > aByteBuffer(size); - while ((n = aInStream->readSomeBytes(aByteBuffer, size-1)) != 0) - aUTF8QueryURL.append((sal_Char*)aByteBuffer.getArray(), n); - OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8); - ucb::Content aContent(aQueryURL, aEnvironment); - Reference< XOutputStream > aPipe(m_aFactory->createInstance( - OUString::createFromAscii("com.sun.star.io.Pipe")), UNO_QUERY_THROW); - aContent.openStream(aPipe); - // get reply - try { - m_aResultStream = aContent.openStream(); - } catch (Exception& oe) { - OSL_ENSURE(sal_False, "Cannot open reply stream from content"); - } - } catch (Exception& e) - { - // XXX - OSL_ENSURE(sal_False, "Exception during UCB operatration."); - return UNKNOWN_ERROR; + m_aResultStream = aContent.openStream(); + } catch (Exception& oe) { + OSL_ENSURE(sal_False, "Cannot open reply stream from content"); } + } catch (Exception& e) + { + // XXX + OSL_ENSURE(sal_False, "Exception during UCB operatration."); + return UNKNOWN_ERROR; } return SUCCESS; |