summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-01-31 07:53:54 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-01-31 07:53:54 +0000
commitaa118179831490748080b1b1a8017df1e4de5f4e (patch)
tree0f4b8c72c3844d4bd278b2df86d9e11a4638fdce
parent4e2453022f82074542811faf0cd051cf33151cf8 (diff)
INTEGRATION: CWS fwkbugfix05 (1.76.22); FILE MERGED
2005/01/25 12:24:38 mba 1.76.22.3: #i38912#: calling SetModified in dispose is dangerous and superfluous 2005/01/19 13:40:45 mba 1.76.22.2: RESYNC: (1.76-1.77); FILE MERGED 2005/01/06 15:25:58 mba 1.76.22.1: #i37381#: setting visarea through API at active objects must resize the window
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx37
1 files changed, 17 insertions, 20 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index ae48aad6df92..b96f4f315204 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sfxbasemodel.cxx,v $
*
- * $Revision: 1.79 $
+ * $Revision: 1.80 $
*
- * last change: $Author: kz $ $Date: 2005-01-21 17:34:23 $
+ * last change: $Author: rt $ $Date: 2005-01-31 08:53:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -879,7 +879,6 @@ void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeExcept
//m_pData->m_pObjectShellLock = SfxObjectShellLock();
}
- //pShellLock = SfxObjectShellLock();
SfxObjectShellClose_Impl( 0, (void*) pShell );
}
@@ -3530,27 +3529,25 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
if ( !m_pData->m_pObjectShell.Is() )
throw uno::Exception(); // TODO: error handling
- Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT );
-
-#if 0
- Window* pWindow = NULL;
- SfxViewFrame* pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
-
- if ( pWindow )
+ SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False );
+ if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame()->IsInPlace() )
{
- MapMode aInternalMapMode( pViewFrm->GetWindow().GetMapMode() );
- MapMode aExternalMapMode( m_pData->m_pObjectShell->GetMapUnit() );
-
- aTmpRect = OutputDevice::LogicToLogic( aTmpRect, aInternalMapMode, aExternalMapMode );
- aTmpRect.SetSize( Size( aSize.Width, aSize.Height ) );
- aTmpRect = OutputDevice::LogicToLogic( aTmpRect, aExternalMapMode, aInternalMapMode );
+ Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame()->GetFrameInterface()->getContainerWindow() );
+ Size aWinSize = pWindow->GetSizePixel();
+ awt::Size aCurrent = getVisualAreaSize( nAspect );
+ Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height );
+ Size aWrongDiff = OutputDevice::LogicToLogic( aDiff , m_pData->m_pObjectShell->GetMapUnit(), pWindow->GetMapMode() );
+ aDiff = pViewFrm->GetViewShell()->GetWindow()->LogicToPixel( aDiff );
+ aWinSize.Width() += aDiff.Width();
+ aWinSize.Height() += aDiff.Height();
+ pWindow->SetSizePixel( aWinSize );
}
else
-#endif
+ {
+ Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT );
aTmpRect.SetSize( Size( aSize.Width, aSize.Height ) );
-
- m_pData->m_pObjectShell->SetVisArea( aTmpRect );
+ m_pData->m_pObjectShell->SetVisArea( aTmpRect );
+ }
}
awt::Size SAL_CALL SfxBaseModel::getVisualAreaSize( sal_Int64 nAspect )