mediadescriptor.cxx (dde7d3fa) mediadescriptor.cxx (49b34792)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 582 unchanged lines hidden (view full) ---

591 css::uno::Reference< css::io::XInputStream > xPostData;
592 rPostData >>= xPostData;
593
594 return impl_openStreamWithPostData( xPostData );
595 }
596
597 // b) ... or we must get it from the given URL
598 ::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 582 unchanged lines hidden (view full) ---

591 css::uno::Reference< css::io::XInputStream > xPostData;
592 rPostData >>= xPostData;
593
594 return impl_openStreamWithPostData( xPostData );
595 }
596
597 // b) ... or we must get it from the given URL
598 ::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
599 if (!sURL.getLength())
599 if ( sURL.isEmpty() )
600 throw css::uno::Exception(
601 ::rtl::OUString::createFromAscii("Found no URL."),
602 css::uno::Reference< css::uno::XInterface >());
603
604 // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
605 ::rtl::OUString sNormalizedURL = impl_normalizeURL( sURL );
606 return impl_openStreamWithURL( sNormalizedURL, bLockFile );
607 }

--- 32 unchanged lines hidden (view full) ---

640 MediaDescriptor::PROP_INTERACTIONHANDLER(),
641 css::uno::Reference< css::task::XInteractionHandler >());
642 css::uno::Reference< css::ucb::XProgressHandler > xProgress;
643 ::ucbhelper::CommandEnvironment* pCommandEnv = new ::ucbhelper::CommandEnvironment(xInteraction, xProgress);
644 css::uno::Reference< css::ucb::XCommandEnvironment > xCommandEnv(static_cast< css::ucb::XCommandEnvironment* >(pCommandEnv), css::uno::UNO_QUERY);
645
646 // media type
647 ::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString());
600 throw css::uno::Exception(
601 ::rtl::OUString::createFromAscii("Found no URL."),
602 css::uno::Reference< css::uno::XInterface >());
603
604 // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
605 ::rtl::OUString sNormalizedURL = impl_normalizeURL( sURL );
606 return impl_openStreamWithURL( sNormalizedURL, bLockFile );
607 }

--- 32 unchanged lines hidden (view full) ---

640 MediaDescriptor::PROP_INTERACTIONHANDLER(),
641 css::uno::Reference< css::task::XInteractionHandler >());
642 css::uno::Reference< css::ucb::XProgressHandler > xProgress;
643 ::ucbhelper::CommandEnvironment* pCommandEnv = new ::ucbhelper::CommandEnvironment(xInteraction, xProgress);
644 css::uno::Reference< css::ucb::XCommandEnvironment > xCommandEnv(static_cast< css::ucb::XCommandEnvironment* >(pCommandEnv), css::uno::UNO_QUERY);
645
646 // media type
647 ::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString());
648 if (!sMediaType.getLength())
648 if ( sMediaType.isEmpty() )
649 {
650 sMediaType = ::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
651 (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
652 }
653
654 // url
655 ::rtl::OUString sURL( getUnpackedValueOrDefault( PROP_URL(), ::rtl::OUString() ) );
656

--- 220 unchanged lines hidden ---
649 {
650 sMediaType = ::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
651 (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
652 }
653
654 // url
655 ::rtl::OUString sURL( getUnpackedValueOrDefault( PROP_URL(), ::rtl::OUString() ) );
656

--- 220 unchanged lines hidden ---