summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-05-10 16:52:09 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-05-10 16:52:09 +0000
commit0a191bbc594a2ea02c60b699de6ea2b58e4f2a9f (patch)
tree5b318e2e7ec57df4f4c25a8af8a6ec55de87c9e4 /embeddedobj
parent53248a9f072e58bafe33556be05fdf2d87ca426c (diff)
INTEGRATION: CWS fwkbugfix02 (1.6.10); FILE MERGED
2004/04/19 13:35:47 mav 1.6.10.3: #116056# interfaces review 2004/04/15 10:06:02 mav 1.6.10.2: #116368# allow to provide dispatch interceptor for outplace activation 2004/04/14 14:23:22 mav 1.6.10.1: #i22465# state change events
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/general/docholder.cxx83
1 files changed, 52 insertions, 31 deletions
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index 1e4884ede020..cfffc633ebf9 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docholder.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mav $ $Date: 2003-12-02 14:32:42 $
+ * last change: $Author: hr $ $Date: 2004-05-10 17:52:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -235,6 +235,7 @@ void DocumentHolder::CloseDocument( sal_Bool bDeliverOwnership, sal_Bool bWaitFo
uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
{
+ // the frame for outplace activation
if ( !m_xFrame.is() )
{
uno::Reference< frame::XFrame > xDesktopFrame(
@@ -260,6 +261,10 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
m_pInterceptor->acquire();
xInterception->registerDispatchProviderInterceptor( m_pInterceptor );
+
+ // register interceptor from outside
+ if ( m_xOutplaceInterceptor.is() )
+ xInterception->registerDispatchProviderInterceptor( m_xOutplaceInterceptor );
}
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
@@ -392,8 +397,8 @@ void DocumentHolder::SetTitle( const rtl::OUString& aDocumentName )
if( xPropSet.is() )
{
uno::Any aAny;
- static const sal_Unicode u[] = { ' ','( ',0 };
- static const sal_Unicode c[] = { ' )',0 };
+ static const sal_Unicode u[] = { ' ', '(', ' ', 0 };
+ static const sal_Unicode c[] = { ' ', ')',0 };
rtl::OUString aTotalName( aFilterName );
aTotalName += rtl::OUString( u );
aTotalName += aDocumentName;
@@ -428,6 +433,7 @@ void DocumentHolder::Hide()
m_xFrame->deactivate();
}
+#if 0
sal_Bool DocumentHolder::SetVisArea( const awt::Rectangle& aRect )
{
if ( m_xDocument.is() )
@@ -481,47 +487,62 @@ sal_Bool DocumentHolder::GetVisArea( awt::Rectangle *pRect )
return sal_False;
}
+#endif
-sal_Bool DocumentHolder::SetExtent( const awt::Size& aSize )
+sal_Bool DocumentHolder::SetExtent( sal_Int64 nAspect, const awt::Size& aSize )
{
- if ( m_xDocument.is() )
+ uno::Reference< embed::XVisualObject > xDocVis( m_xDocument, uno::UNO_QUERY );
+ if ( xDocVis.is() )
{
- uno::Sequence< beans::PropertyValue > aArgs = m_xDocument->getArgs();
- for ( sal_Int32 nInd = 0; nInd < aArgs.getLength(); nInd++ )
- if ( aArgs[nInd].Name.equalsAscii( "WinExtent" ) )
- {
- // should allways be there
- uno::Sequence< sal_Int32 > aRect;
- if ( ( aArgs[nInd].Value >>= aRect ) && aRect.getLength() == 4 )
- {
- aRect[2] = aRect[0] + aSize.Width;
- aRect[3] = aRect[1] + aSize.Height;
-
- aArgs[nInd].Value <<= aRect;
+ try
+ {
+ xDocVis->setVisualAreaSize( nAspect, aSize );
+ return sal_True;
+ }
+ catch( uno::Exception& )
+ {
+ // TODO: Error handling
+ }
+ }
- m_xDocument->attachResource( m_xDocument->getURL(), aArgs );
- return sal_True;
- }
- }
+ return sal_False;
+}
- OSL_ENSURE( sal_False, "WinExtent seems not to be implemented!\n" );
+sal_Bool DocumentHolder::GetExtent( sal_Int64 nAspect, awt::Size *pSize )
+{
+ uno::Reference< embed::XVisualObject > xDocVis( m_xDocument, uno::UNO_QUERY );
+ if ( pSize && xDocVis.is() )
+ {
+ try
+ {
+ *pSize = xDocVis->getVisualAreaSize( nAspect );
+ return sal_True;
+ }
+ catch( uno::Exception& )
+ {
+ // TODO: Error handling
+ }
}
return sal_False;
}
-sal_Bool DocumentHolder::GetExtent( awt::Size *pSize )
+sal_Int32 DocumentHolder::GetMapMode( sal_Int64 nAspect )
{
- awt::Rectangle aRect;
- if ( pSize && GetVisArea( &aRect ) )
+ uno::Reference< embed::XVisualObject > xDocVis( m_xDocument, uno::UNO_QUERY );
+ if ( xDocVis.is() )
{
- pSize->Width = aRect.Width;
- pSize->Height = aRect.Height;
-
- return sal_True;
+ try
+ {
+ return xDocVis->getMapMode( nAspect );
+ }
+ catch( uno::Exception& )
+ {
+ // TODO: Error handling
+ }
}
- return sal_False;
+ return 0;
}
void SAL_CALL DocumentHolder::disposing( const com::sun::star::lang::EventObject& aSource )