summaryrefslogtreecommitdiff
path: root/forms/source/component
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-07-24 11:15:35 +0000
committerFrank Schönheit <fs@openoffice.org>2001-07-24 11:15:35 +0000
commite4032e5849a52cf5e9c988f307923a5ea5198b0f (patch)
treef245e290f360a151ad781d3db1dfa41b467b313f /forms/source/component
parentc0f1c76aa30e41071ac4e3d8590df48903912d63 (diff)
#85600# when posting, use a XInputStream name 'PostData' instead of PostString
Diffstat (limited to 'forms/source/component')
-rw-r--r--forms/source/component/DatabaseForm.cxx37
1 files changed, 29 insertions, 8 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 800b36c9512e..686ecfe0cccc 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DatabaseForm.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: fs $ $Date: 2001-07-17 07:30:30 $
+ * last change: $Author: fs $ $Date: 2001-07-24 12:15:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -197,6 +197,9 @@
#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
#endif
+#ifndef _COMPHELPER_SEQSTREAM_HXX
+#include <comphelper/seqstream.hxx>
+#endif
#ifndef _COMPHELPER_ENUMHELPER_HXX_
#include <comphelper/enumhelper.hxx>
#endif
@@ -266,7 +269,8 @@ enum DatabaseCursorType
#define DATABASEFORM_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.forms.ODatabaseForm")
-using namespace dbtools;
+using namespace ::dbtools;
+using namespace ::comphelper;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
@@ -2649,8 +2653,15 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const MouseE
Sequence<PropertyValue> aArgs(2);
aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer");
aArgs.getArray()[0].Value <<= aReferer;
- aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostString");
- aArgs.getArray()[1].Value <<= aData;
+
+ // build a sequence from the to-be-submitted string
+ ByteString a8BitData(aData.getStr(), (sal_uInt16)aData.getLength(), RTL_TEXTENCODING_MS_1252);
+ // always ANSI #58641
+ Sequence< sal_Int8 > aPostData((sal_Int8*)a8BitData.GetBuffer(), a8BitData.Len());
+ Reference< XInputStream > xPostData = new SequenceInputStream(aPostData);
+
+ aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostData");
+ aArgs.getArray()[1].Value <<= xPostData;
xDisp->dispatch(aURL, aArgs);
}
@@ -2686,8 +2697,12 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const MouseE
aArgs.getArray()[0].Value <<= aReferer;
aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("ContentType");
aArgs.getArray()[1].Value <<= aContentType;
+
+ // build a sequence from the to-be-submitted string
+ Reference< XInputStream > xPostData = new SequenceInputStream(aData);
+
aArgs.getArray()[2].Name = ::rtl::OUString::createFromAscii("PostData");
- aArgs.getArray()[2].Value <<= aData;
+ aArgs.getArray()[2].Value <<= xPostData;
xDisp->dispatch(aURL, aArgs);
}
@@ -2718,8 +2733,14 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const MouseE
Sequence<PropertyValue> aArgs(2);
aArgs.getArray()[0].Name = ::rtl::OUString::createFromAscii("Referer");
aArgs.getArray()[0].Value <<= aReferer;
- aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostString");
- aArgs.getArray()[1].Value <<= aData;
+
+ // build a sequence from the to-be-submitted string
+ ByteString aSystemEncodedData(aData.getStr(), (sal_uInt16)aData.getLength(), osl_getThreadTextEncoding());
+ Sequence< sal_Int8 > aPostData((sal_Int8*)aSystemEncodedData.GetBuffer(), aSystemEncodedData.Len());
+ Reference< XInputStream > xPostData = new SequenceInputStream(aPostData);
+
+ aArgs.getArray()[1].Name = ::rtl::OUString::createFromAscii("PostData");
+ aArgs.getArray()[1].Value <<= xPostData;
xDisp->dispatch(aURL, aArgs);
}