summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/MSWorksImportFilter.cxx
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-03-01 23:01:28 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-03-01 23:03:16 +0100
commit866ebf66b3a50b2d601825e4533898949d5b86c8 (patch)
treebc911d28b8b10aeb4b5928c9f9d42fecbb072882 /writerperfect/source/writer/MSWorksImportFilter.cxx
parent6ee08cc0f1e3b38f21bd4d1cc47412ce38bb13e6 (diff)
Simplify a bit the boilerplate code
The XInputStream is guaranteed to be there always and if it is not there, do not try to create it. Change-Id: Ie133489dfcb3d9cec0c4efe78740348a1efa2423
Diffstat (limited to 'writerperfect/source/writer/MSWorksImportFilter.cxx')
-rw-r--r--writerperfect/source/writer/MSWorksImportFilter.cxx24
1 files changed, 1 insertions, 23 deletions
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 0c15e302c7a1..4ef2b0e0c51f 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -19,7 +19,6 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <comphelper/componentcontext.hxx>
#include <xmloff/attrlist.hxx>
@@ -36,7 +35,6 @@
#include <iostream>
using namespace ::com::sun::star::uno;
-using rtl::OString;
using rtl::OUString;
using com::sun::star::uno::Sequence;
using com::sun::star::uno::Reference;
@@ -72,16 +70,12 @@ throw (RuntimeException)
{
if ( pValue[i].Name == "InputStream" )
pValue[i].Value >>= xInputStream;
- else if ( pValue[i].Name == "URL" )
- pValue[i].Value >>= sURL;
}
if ( !xInputStream.is() )
{
OSL_ASSERT( 0 );
return sal_False;
}
- OString sFileName;
- sFileName = OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
// An XML import service: what we push sax messages to..
OUString sXMLImportService ( "com.sun.star.comp.Writer.XMLOasisImporter" );
@@ -142,26 +136,10 @@ throw( com::sun::star::uno::RuntimeException )
location=i;
else if ( pValue[i].Name == "InputStream" )
pValue[i].Value >>= xInputStream;
- else if ( pValue[i].Name == "URL" )
- pValue[i].Value >>= sURL;
}
- Reference< com::sun::star::ucb::XCommandEnvironment > xEnv;
if (!xInputStream.is())
- {
- try
- {
- ::ucbhelper::Content aContent(sURL, xEnv, mxContext);
- xInputStream = aContent.openStream();
- }
- catch ( ... )
- {
- return ::rtl::OUString();
- }
-
- if (!xInputStream.is())
- return ::rtl::OUString();
- }
+ return ::rtl::OUString();
WPXSvInputStream input( xInputStream );