summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2006-11-02 08:51:10 +0000
committerVladimir Glazounov <vg@openoffice.org>2006-11-02 08:51:10 +0000
commitcf78900fdb15a0f71fbd50f37bcdf474ba424213 (patch)
tree7dbfee63d338f0d633f147b8a7cda5059840d0b7 /svx
parentc1ccb9a1c47a50e0e703ce4b531047aa4840b1b5 (diff)
INTEGRATION: CWS inplaceobjects (1.68.34); FILE MERGED
2006/09/28 17:29:28 mba 1.68.34.2: RESYNC: (1.68-1.70); FILE MERGED 2006/07/10 13:20:47 mba 1.68.34.1: #i66239#: missing updates for object area
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdoole2.cxx29
1 files changed, 22 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index e9d1b7985393..20eabf7defb0 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: svdoole2.cxx,v $
*
- * $Revision: 1.71 $
+ * $Revision: 1.72 $
*
- * last change: $Author: obo $ $Date: 2006-10-13 11:23:44 $
+ * last change: $Author: vg $ $Date: 2006-11-02 09:51:10 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1531,6 +1531,7 @@ void SdrOle2Obj::ImpSetVisAreaSize()
if ( GetAspect() == embed::Aspects::MSOLE_ICON )
return;
+ // the object area of an embedded object was changed, e.g. by user interaction an a selected object
GetObjRef();
if ( xObjRef.is() )
{
@@ -1545,7 +1546,11 @@ void SdrOle2Obj::ImpSetVisAreaSize()
if ( pClient || bHasOwnClient )
{
- if ( (nMiscStatus & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) && svt::EmbeddedObjectRef::TryRunningState( xObjRef.GetObject() ) )
+ // TODO/LATER: IMHO we need to do similar things when object is UIActive or OutplaceActive?! (MBA)
+ if ( (nMiscStatus & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) &&
+ svt::EmbeddedObjectRef::TryRunningState( xObjRef.GetObject() )
+ || xObjRef->getCurrentState() == embed::EmbedStates::INPLACE_ACTIVE
+ )
{
Fraction aScaleWidth;
Fraction aScaleHeight;
@@ -1560,8 +1565,11 @@ void SdrOle2Obj::ImpSetVisAreaSize()
aScaleHeight = mpImpl->pLightClient->GetScaleHeight();
}
- // server wants to resize itself (f.e. Chart wants to recalculate the layout)
- // the scaling should not change, but it might exist already and must be used in calculations
+ // The object wants to resize itself (f.e. Chart wants to recalculate the layout)
+ // or object is inplace active and so has a window that must be resized also
+ // In these cases the change in the object area size will be reflected in a change of the
+ // objects' visual area. The scaling will not change, but it might exist already and must
+ // be used in calculations
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
Size aVisSize( (long)( Fraction( aRect.GetWidth() ) / aScaleWidth ),
(long)( Fraction( aRect.GetHeight() ) / aScaleHeight ) );
@@ -1584,16 +1592,23 @@ void SdrOle2Obj::ImpSetVisAreaSize()
(long)( Fraction( long( aSz.Height ) ) * aScaleHeight ) ) );
if (aVisSize != aAcceptedVisArea.GetSize())
{
- // server changed VisArea to its liking
+ // server changed VisArea to its liking and the VisArea is different than the suggested one
+ // store the new value as given by the object
MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObjRef->getMapUnit( GetAspect() ) );
aRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, pModel->GetScaleUnit()));
}
+ // make the new object area known to the client
+ // compared to the "else" branch aRect might have been changed by the object and no additional scaling was applied
+ pClient->SetObjArea(aRect);
+
+ // we need a new replacement image as the object has resized itself
xObjRef.UpdateReplacement();
}
else
{
- // change object scaling
+ // The object isn't active and does not want to resize itself so the changed object area size
+ // will be reflected in a changed object scaling
Fraction aScaleWidth;
Fraction aScaleHeight;
Size aObjAreaSize;