diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-12-02 13:40:39 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-12-02 13:40:39 +0100 |
commit | b09ad35b40b9de8f3e9f1d57abb6533a209c3ebd (patch) | |
tree | 6893176bab1d99dac3a4f6b16c27930deccfc093 /sfx2 | |
parent | 726f87d603a38c988a8425d42f023b03bda725b1 (diff) | |
parent | 041210d90f162084e98b1fc0acbe744926ac8f60 (diff) |
merge with db33a
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 54ccd29a7dd7..2951ac3ef4a3 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -81,6 +81,7 @@ #include <vos/mutex.hxx> #include <osl/mutex.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/sequence.hxx> #include <rtl/ustrbuf.hxx> #include <toolkit/helper/convert.hxx> @@ -706,6 +707,29 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ; pActFrame->Enable( TRUE ); pActFrame->GetDispatcher()->Lock( FALSE ); + + if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL ) + && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + ) + { + SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame(); + if ( !pViewFrm->GetFrame()->IsInPlace() ) + { + // for outplace embedded objects, we want the layout manager to keep the content window + // size constant, if possible + try + { + uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xLayouterProps( + xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW ); + xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + } } } } |