# SPDX-License-Identifier: GPL-2.0 # # Kbuild for top-level directory of the kernel # Prepare global headers and check sanity before descending into sub-directories # --------------------------------------------------------------------------- # Generate bounds.h bounds-file := include/generated/bounds.h targets := kernel/bounds.s $(bounds-file): kernel/bounds.s FORCE $(call filechk,offsets,__LINUX_BOUNDS_H__) # Generate timeconst.h timeconst-file := include/generated/timeconst.h filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $< $(timeconst-file): kernel/time/timeconst.bc FORCE $(call filechk,gentimeconst) # Generate asm-offsets.h offsets-file := include/generated/asm-offsets.h targets += arch/$(SRCARCH)/kernel/asm-offsets.s arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file) $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE $(call filechk,offsets,__ASM_OFFSETS_H__) # Check for missing system calls quiet_cmd_syscalls = CALL $< cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags) PHONY += missing-syscalls missing-syscalls: scripts/checksyscalls.sh $(offsets-file) $(call cmd,syscalls) # Check the manual modification of atomic headers quiet_cmd_check_sha1 = CHKSHA1 $< cmd_check_sha1 = \ if ! command -v sha1sum >/dev/null; then \ echo "warning: cannot check the header due to sha1sum missing"; \ exit 0; \ fi; \ if [ "$$(sed -n '$$s:// ::p' $<)" != \ "$$(sed '$$d' $< | sha1sum | sed 's/ .*//')" ]; then \ echo "error: $< has been modified." >&2; \ exit 1; \ fi; \ touch $@ atomic-checks += $(addprefix $(obj)/.checked-, \ atomic-arch-fallback.h \ atomic-instrumented.h \ atomic-long.h) targets += $(atomic-checks) $(atomic-checks): $(obj)/.checked-%: include/linux/atomic/% FORCE $(call if_changed,check_sha1) # A phony target that depends on all the preparation targets PHONY += prepare prepare: $(offsets-file) missing-syscalls $(atomic-checks) @: # Ordinary directory descending # --------------------------------------------------------------------------- obj-y += init/ obj-y += usr/ obj-y += arch/$(SRCARCH)/ obj-y += $(ARCH_CORE) obj-y += kernel/ obj-y += certs/ obj-y += mm/ obj-y += fs/ obj-y += ipc/ obj-y += security/ obj-y += crypto/ obj-$(CONFIG_BLOCK) += block/ obj-$(CONFIG_IO_URING) += io_uring/ obj-$(CONFIG_RUST) += rust/ obj-y += $(ARCH_LIB) obj-y += drivers/ obj-y += sound/ obj-$(CONFIG_SAMPLES) += samples/ obj-$(CONFIG_NET) += net/ obj-y += virt/ obj-y += $(ARCH_DRIVERS) o/collabora/cd-5.3-3.4 main, development code repositoryroot
summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-23 17:23:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-08-27 15:40:08 +0200
commit206c70eef30f7b6f538b88f7fb9505f397bef073 (patch)
treed311561f2eb90b57aeed5c1642882a90ddbd4c6a /embeddedobj
parent7634d064adc2c773288cec751674ff691de20b2b (diff)
fdo#46808, Adapt TempFile UNO service to new style
Change-Id: Ia448d6d74201e2be487c6d8317f94be3745808aa
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx92
-rw-r--r--embeddedobj/source/msole/olecomponent.cxx8
-rw-r--r--embeddedobj/source/msole/oleembed.cxx5
-rw-r--r--embeddedobj/source/msole/olepersist.cxx16
-rw-r--r--embeddedobj/source/msole/ownview.cxx3
5 files changed, 60 insertions, 64 deletions
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index a7780dde30b3..4cd67ef22b18 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/embed/XOptimizedStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/EmbedUpdateModes.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
@@ -53,6 +54,7 @@
#include <com/sun/star/beans/IllegalTypeException.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/fileformat.h>
#include <comphelper/storagehelper.hxx>
#include <comphelper/mimeconfighelper.hxx>
@@ -132,57 +134,53 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor(
uno::Reference< io::XInputStream > xResult;
- const ::rtl::OUString aServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.io.TempFile" ) );
- uno::Reference < io::XStream > xTempStream = uno::Reference < io::XStream > (
- xFactory->createInstance ( aServiceName ),
- uno::UNO_QUERY );
- if ( xTempStream.is() )
- {
- uno::Reference < lang::XSingleServiceFactory > xStorageFactory(
- xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.StorageFactory" )) ),
- uno::UNO_QUERY );
+ uno::Reference < io::XStream > xTempStream( io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW );
- uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[0] <<= xTempStream;
- aArgs[1] <<= embed::ElementModes::READWRITE;
- uno::Reference< embed::XStorage > xTempStorage( xStorageFactory->createInstanceWithArguments( aArgs ),
- uno::UNO_QUERY );
- if ( !xTempStorage.is() )
- throw uno::RuntimeException(); // TODO:
+ uno::Reference < lang::XSingleServiceFactory > xStorageFactory(
+ xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.StorageFactory" )) ),
+ uno::UNO_QUERY );
- try
- {
- xStorage->copyToStorage( xTempStorage );
- } catch( const uno::Exception& e )
- {
- throw embed::StorageWrappedTargetException(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't copy storage!" )),
- uno::Reference< uno::XInterface >(),
- uno::makeAny( e ) );
- }
+ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[0] <<= xTempStream;
+ aArgs[1] <<= embed::ElementModes::READWRITE;
+ uno::Reference< embed::XStorage > xTempStorage( xStorageFactory->createInstanceWithArguments( aArgs ),
+ uno::UNO_QUERY );
+ if ( !xTempStorage.is() )
+ throw uno::RuntimeException(); // TODO:
- try {
- uno::Reference< lang::XComponent > xComponent( xTempStorage, uno::UNO_QUERY );
- OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" );
- if ( xComponent.is() )
- xComponent->dispose();
- }
- catch ( const uno::Exception& )
- {
- }
+ try
+ {
+ xStorage->copyToStorage( xTempStorage );
+ } catch( const uno::Exception& e )
+ {
+ throw embed::StorageWrappedTargetException(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't copy storage!" )),
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny( e ) );
+ }
- try {
- uno::Reference< io::XOutputStream > xTempOut = xTempStream->getOutputStream();
- if ( xTempOut.is() )
- xTempOut->closeOutput();
- }
- catch ( const uno::Exception& )
- {
- }
+ try {
+ uno::Reference< lang::XComponent > xComponent( xTempStorage, uno::UNO_QUERY );
+ OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" );
+ if ( xComponent.is() )
+ xComponent->dispose();
+ }
+ catch ( const uno::Exception& )
+ {
+ }
- xResult = xTempStream->getInputStream();
+ try {
+ uno::Reference< io::XOutputStream > xTempOut = xTempStream->getOutputStream();
+ if ( xTempOut.is() )
+ xTempOut->closeOutput();
+ }
+ catch ( const uno::Exception& )
+ {
}
+ xResult = xTempStream->getInputStream();
+
return xResult;
}
@@ -587,11 +585,11 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr
const ::rtl::OUString& aHierarchName )
{
uno::Reference < io::XOutputStream > xTempOut(
- m_xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" )) ),
- uno::UNO_QUERY );
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW );
uno::Reference< io::XInputStream > aResult( xTempOut, uno::UNO_QUERY );
- if ( !xTempOut.is() || !aResult.is() )
+ if ( !aResult.is() )
throw uno::RuntimeException(); // TODO:
uno::Reference< frame::XStorable > xStorable;
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index 8893091299d2..e785aaaf33e9 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/embed/UnreachableStateException.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XTruncate.hpp>
#include <com/sun/star/awt/XRequestCallback.hpp>
@@ -1596,11 +1597,8 @@ uno::Any SAL_CALL OleComponent::getTransferData( const datatransfer::DataFlavor&
// allow to retrieve stream-representation of the object persistence
bSupportedFlavor = sal_True;
uno::Reference < io::XStream > xTempFileStream(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
- uno::UNO_QUERY );
-
- if ( !xTempFileStream.is() )
- throw uno::RuntimeException(); // TODO
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xTempOutStream = xTempFileStream->getOutputStream();
uno::Reference< io::XInputStream > xTempInStream = xTempFileStream->getInputStream();
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 087fb2a328d5..1a65e1a5efdb 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/embed/StateChangeInProgressException.hpp>
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/XEmbedObjectCreator.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -705,8 +706,8 @@ namespace
// the solution is only active for Unix systems
#ifndef WNT
uno::Reference <beans::XPropertySet> xNativeTempFile(
- xFactory->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile"))), uno::UNO_QUERY_THROW);
+ io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW);
uno::Reference < io::XStream > xStream(xNativeTempFile, uno::UNO_QUERY_THROW);
uno::Sequence< uno::Any > aArgs( 2 );
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 2d74cb858f09..7939ad527499 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/io/XTruncate.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -91,11 +92,8 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang:
::rtl::OUString aResult;
uno::Reference < beans::XPropertySet > xTempFile(
- xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
- uno::UNO_QUERY );
-
- if ( !xTempFile.is() )
- throw uno::RuntimeException(); // TODO
+ io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
+ uno::UNO_QUERY_THROW );
try {
xTempFile->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RemoveFile" )), uno::makeAny( sal_False ) );
@@ -172,7 +170,7 @@ sal_Bool KillFile_Impl( const ::rtl::OUString& aURL, const uno::Reference< lang:
try
{
uno::Reference < beans::XPropertySet > xTempFile(
- xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(xFactory).getUNOContext()),
uno::UNO_QUERY );
uno::Reference < io::XStream > xTempStream( xTempFile, uno::UNO_QUERY_THROW );
@@ -278,7 +276,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::GetNewFilledTempStream_Impl( co
OSL_ENSURE( xInStream.is(), "Wrong parameter is provided!\n" );
uno::Reference < io::XStream > xTempFile(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference< io::XOutputStream > xTempOutStream = xTempFile->getOutputStream();
@@ -355,7 +353,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl(
{
// this is either a bitmap or a metafile clipboard format, retrieve the pure stream
uno::Reference < io::XStream > xResult(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference < io::XSeekable > xResultSeek( xResult, uno::UNO_QUERY_THROW );
uno::Reference < io::XOutputStream > xResultOut = xResult->getOutputStream();
@@ -403,7 +401,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
xCachedSeek->seek( 0 );
uno::Reference < io::XStream > xTempFile(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference< io::XSeekable > xTempSeek( xTempFile, uno::UNO_QUERY_THROW );
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index 354ff11e3ece..c5bb43ad9b11 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
+#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
@@ -276,7 +277,7 @@ sal_Bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io
// create m_aNativeTempURL
::rtl::OUString aNativeTempURL;
uno::Reference < beans::XPropertySet > xNativeTempFile(
- m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TempFile" ) )),
+ io::TempFile::create(comphelper::ComponentContext(m_xFactory).getUNOContext()),
uno::UNO_QUERY_THROW );
uno::Reference < io::XStream > xNativeTempStream( xNativeTempFile, uno::UNO_QUERY_THROW );
uno::Reference < io::XOutputStream > xNativeOutTemp = xNativeTempStream->getOutputStream();