diff options
Diffstat (limited to 'sc/source/ui/view/tabvwshb.cxx')
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 7f0542420d39..d697e7b5934f 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -75,25 +75,25 @@ void ScTabViewShell::ConnectObject( const SdrOle2Obj* pObj ) // when already connected do not execute SetObjArea/SetSizeScale again SfxInPlaceClient* pClient = FindIPClient( xObj, pWin ); - if ( !pClient ) - { - pClient = new ScClient( this, pWin, GetScDrawView()->GetModel(), pObj ); - tools::Rectangle aRect = pObj->GetLogicRect(); - Size aDrawSize = aRect.GetSize(); - - Size aOleSize = pObj->GetOrigObjSize(); - - Fraction aScaleWidth (aDrawSize.Width(), aOleSize.Width() ); - Fraction aScaleHeight(aDrawSize.Height(), aOleSize.Height() ); - aScaleWidth.ReduceInaccurate(10); // compatible with SdrOle2Obj - aScaleHeight.ReduceInaccurate(10); - pClient->SetSizeScale(aScaleWidth,aScaleHeight); - - // visible section is only changed inplace! - // the object area must be set after the scaling since it triggers the resizing - aRect.SetSize( aOleSize ); - pClient->SetObjArea( aRect ); - } + if ( pClient ) + return; + + pClient = new ScClient( this, pWin, GetScDrawView()->GetModel(), pObj ); + tools::Rectangle aRect = pObj->GetLogicRect(); + Size aDrawSize = aRect.GetSize(); + + Size aOleSize = pObj->GetOrigObjSize(); + + Fraction aScaleWidth (aDrawSize.Width(), aOleSize.Width() ); + Fraction aScaleHeight(aDrawSize.Height(), aOleSize.Height() ); + aScaleWidth.ReduceInaccurate(10); // compatible with SdrOle2Obj + aScaleHeight.ReduceInaccurate(10); + pClient->SetSizeScale(aScaleWidth,aScaleHeight); + + // visible section is only changed inplace! + // the object area must be set after the scaling since it triggers the resizing + aRect.SetSize( aOleSize ); + pClient->SetObjArea( aRect ); } namespace { @@ -113,29 +113,29 @@ public: virtual void SAL_CALL notify(const css::uno::Any& aData) override { uno::Sequence<beans::PropertyValue> aProperties; - if (aData >>= aProperties) - { - awt::Rectangle xRectangle; - sal_Int32 dimensionIndex = 0; - OUString sPivotTableName("DataPilot1"); + if (!(aData >>= aProperties)) + return; - for (beans::PropertyValue const & rProperty : std::as_const(aProperties)) - { - if (rProperty.Name == "Rectangle") - rProperty.Value >>= xRectangle; - if (rProperty.Name == "DimensionIndex") - rProperty.Value >>= dimensionIndex; - if (rProperty.Name == "PivotTableName") - rProperty.Value >>= sPivotTableName; - } + awt::Rectangle xRectangle; + sal_Int32 dimensionIndex = 0; + OUString sPivotTableName("DataPilot1"); + + for (beans::PropertyValue const & rProperty : std::as_const(aProperties)) + { + if (rProperty.Name == "Rectangle") + rProperty.Value >>= xRectangle; + if (rProperty.Name == "DimensionIndex") + rProperty.Value >>= dimensionIndex; + if (rProperty.Name == "PivotTableName") + rProperty.Value >>= sPivotTableName; + } - tools::Rectangle aChartRect = m_pObject->GetLogicRect(); + tools::Rectangle aChartRect = m_pObject->GetLogicRect(); - Point aPoint(xRectangle.X + aChartRect.Left(), xRectangle.Y + aChartRect.Top()); - Size aSize(xRectangle.Width, xRectangle.Height); + Point aPoint(xRectangle.X + aChartRect.Left(), xRectangle.Y + aChartRect.Top()); + Size aSize(xRectangle.Width, xRectangle.Height); - m_pViewShell->DoDPFieldPopup(sPivotTableName, dimensionIndex, aPoint, aSize); - } + m_pViewShell->DoDPFieldPopup(sPivotTableName, dimensionIndex, aPoint, aSize); } }; |