INTEGRATION: CWS mav09 (1.1.2); FILE MERGED
2004/06/18 14:18:11 mba 1.1.2.7: #i27773#: special objects implementation 2004/05/28 16:19:07 mba 1.1.2.6: #27773#: some wrong MediaTypes 2004/05/24 09:02:52 mba 1.1.2.5: #i27773#: some changes about MapUnit 2004/05/18 12:34:41 mav 1.1.2.4: #i27773# solve resync problems 2004/05/17 18:24:36 mav 1.1.2.3: RESYNC: (1.1-1.2); FILE MERGED 2004/05/12 10:12:28 mav 1.1.2.2: #i27773# graphical replacement and persistance setting related changes 2004/01/23 17:39:46 mav 1.1.2.1: #115011# set title
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: visobj.cxx,v $
|
* $RCSfile: visobj.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*
|
*
|
||||||
* last change: $Author: hr $ $Date: 2004-05-10 17:51:36 $
|
* last change: $Author: kz $ $Date: 2004-10-04 19:50:21 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -122,7 +122,7 @@ awt::Size SAL_CALL OCommonEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect )
|
|||||||
return aResult;
|
return aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Int32 SAL_CALL OCommonEmbeddedObject::getMapMode( sal_Int64 nAspect )
|
sal_Int32 SAL_CALL OCommonEmbeddedObject::getMapUnit( sal_Int64 nAspect )
|
||||||
throw ( uno::Exception,
|
throw ( uno::Exception,
|
||||||
uno::RuntimeException)
|
uno::RuntimeException)
|
||||||
{
|
{
|
||||||
@@ -134,46 +134,44 @@ sal_Int32 SAL_CALL OCommonEmbeddedObject::getMapMode( sal_Int64 nAspect )
|
|||||||
throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The own object has no model!\n" ),
|
throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The own object has no model!\n" ),
|
||||||
uno::Reference< uno::XInterface >( reinterpret_cast< ::cppu::OWeakObject* >(this) ) );
|
uno::Reference< uno::XInterface >( reinterpret_cast< ::cppu::OWeakObject* >(this) ) );
|
||||||
|
|
||||||
sal_Int32 nResult = m_pDocHolder->GetMapMode( nAspect );
|
sal_Int32 nResult = m_pDocHolder->GetMapUnit( nAspect );
|
||||||
if ( !nResult )
|
if ( nResult < 0 )
|
||||||
throw uno::Exception(); // TODO:
|
throw uno::Exception(); // TODO:
|
||||||
|
|
||||||
return nResult;
|
return nResult;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
embed::VisualRepresentation SAL_CALL OCommonEmbeddedObject::getPreferredVisualRepresentation( sal_Int64 nAspect )
|
||||||
#if 0
|
throw ( lang::IllegalArgumentException,
|
||||||
// Probably will be removed!!!
|
embed::WrongStateException,
|
||||||
uno::Any SAL_CALL OCommonEmbeddedObject::getVisualCache( sal_Int64 nAspect )
|
uno::Exception,
|
||||||
throw ( uno::Exception,
|
|
||||||
uno::RuntimeException )
|
uno::RuntimeException )
|
||||||
{
|
{
|
||||||
::osl::MutexGuard aGuard( m_aMutex );
|
::osl::MutexGuard aGuard( m_aMutex );
|
||||||
if ( m_bDisposed )
|
if ( m_bDisposed )
|
||||||
throw lang::DisposedException(); // TODO
|
throw lang::DisposedException(); // TODO
|
||||||
|
|
||||||
|
// TODO: if object is in loaded state it should switch itself to the running state
|
||||||
if ( m_nObjectState == -1 || m_nObjectState == embed::EmbedStates::LOADED )
|
if ( m_nObjectState == -1 || m_nObjectState == embed::EmbedStates::LOADED )
|
||||||
throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The own object has no model!\n" ),
|
throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The own object has no model!\n" ),
|
||||||
uno::Reference< uno::XInterface >( reinterpret_cast< ::cppu::OWeakObject* >(this) ) );
|
uno::Reference< uno::XInterface >( reinterpret_cast< ::cppu::OWeakObject* >(this) ) );
|
||||||
OSL_ENSURE( m_xDocument.is(), "Running or Active object has no model!\n" );
|
OSL_ENSURE( m_pDocHolder->GetComponent().is(), "Running or Active object has no component!\n" );
|
||||||
|
|
||||||
if ( m_xDocument.is() )
|
// TODO: return for the aspect of the document
|
||||||
{
|
embed::VisualRepresentation aVisualRepresentation;
|
||||||
// TODO: return for the aspect of the document
|
uno::Reference< datatransfer::XTransferable > xTransferable( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
|
||||||
uno::Reference< datatransfer::XTransferable > xTransferable( m_xDocument, uno::UNO_QUERY );
|
if ( !xTransferable.is() )
|
||||||
if ( xTransferable.is() )
|
throw uno::RuntimeException();
|
||||||
{
|
|
||||||
datatransfer::DataFlavor aDataFlavor(
|
|
||||||
::rtl::OUString::createFromAscii( "application/x-openoffice;windows_formatname=\"Image EMF\"" ),
|
|
||||||
::rtl::OUString::createFromAscii( "Image EMF" ),
|
|
||||||
::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) );
|
|
||||||
|
|
||||||
return xTransferable->getTransferData( aDataFlavor );
|
datatransfer::DataFlavor aDataFlavor(
|
||||||
}
|
::rtl::OUString::createFromAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ),
|
||||||
}
|
::rtl::OUString::createFromAscii( "GDIMetaFile" ),
|
||||||
|
::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) );
|
||||||
|
|
||||||
return uno::makeAny( uno::Sequence< sal_Int8 >() );
|
aVisualRepresentation.Data = xTransferable->getTransferData( aDataFlavor );
|
||||||
|
aVisualRepresentation.Flavor = aDataFlavor;
|
||||||
|
|
||||||
|
return aVisualRepresentation;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user