summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJürgen Schmidt <jsc@apache.org>2011-10-19 09:35:16 +0000
committerJürgen Schmidt <jsc@apache.org>2011-10-19 09:35:16 +0000
commitc13162c59402230bdd8f46300bbfa8142c4e01b7 (patch)
treeb4056f4c6997a83842f319eeb3801b9309cad0b1 /svx
parent6bf17dc7ffa79f52458df707c9da798951e19b2e (diff)
#118524: apply patch, followup fixes to 118485, thanks to Armin Le Grand (alg)
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdoole2.hxx7
-rw-r--r--svx/source/svdraw/svdmrkv.cxx12
-rw-r--r--svx/source/svdraw/svdoole2.cxx36
3 files changed, 43 insertions, 12 deletions
diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index 0d95214d4121..8fdb3004890a 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -73,6 +73,8 @@ protected:
// wg. Kompatibilitaet erstmal am SdrTextObj
sal_Bool bFrame : 1;
sal_Bool bInDestruction : 1;
+ // #i118524#
+ bool mbSuppressSetVisAreaSize : 1;
mutable bool m_bTypeAsked;
mutable bool m_bChart;
@@ -98,6 +100,8 @@ public:
const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const { return xObjRef; }
sal_Int64 GetAspect() const { return xObjRef.GetViewAspect(); }
+ bool isInplaceActive() const;
+ bool isUiActive() const;
void SetAspect( sal_Int64 nAspect );
// Ein OLE-Zeichenobjekt kann eine StarView-Grafik beinhalten.
@@ -110,6 +114,9 @@ public:
// no conversion is done if no target mode is provided
Size GetOrigObjSize( MapMode* pTargetMapMode = NULL ) const;
+ // #i118524# Allow suppress SetVisAreaSize in changing methods when call
+ // comes from OLE client
+ void setSuppressSetVisAreaSize(bool bNew) { mbSuppressSetVisAreaSize = bNew; }
// OLE object has got a separate PersistName member now;
// !!! use ::SetPersistName( ... ) only, if you know what you do !!!
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index f9055fedcabc..407789306dac 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -731,7 +731,17 @@ void SdrMarkView::SetMarkHandles()
&& pMarkedObj->ISA(SdrTextObj)
&& ((SdrTextObj*)pMarkedObj)->IsInEditMode());
- if(!aRect.IsEmpty() && !bHideHandlesWhenInTextEdit)
+ // #i118524# if inplace activated OLE is selected,
+ // suppress handles
+ bool bHideHandlesWhenOleActive(false);
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pMarkedObj);
+
+ if(pSdrOle2Obj && (pSdrOle2Obj->isInplaceActive() || pSdrOle2Obj->isUiActive()))
+ {
+ bHideHandlesWhenOleActive = true;
+ }
+
+ if(!aRect.IsEmpty() && !bHideHandlesWhenInTextEdit && !bHideHandlesWhenOleActive)
{ // sonst nix gefunden
if( bSingleTextObjMark )
{
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 8cf88c20ffb4..3b1b6cc493a6 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -762,6 +762,7 @@ SdrOle2Obj::SdrOle2Obj(FASTBOOL bFrame_) : m_bTypeAsked(false)
{
DBG_CTOR( SdrOle2Obj,NULL);
bInDestruction = sal_False;
+ mbSuppressSetVisAreaSize = false;
Init();
bFrame=bFrame_;
}
@@ -774,6 +775,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, FASTBOOL bFram
{
DBG_CTOR( SdrOle2Obj,NULL);
bInDestruction = sal_False;
+ mbSuppressSetVisAreaSize = false;
Init();
bFrame=bFrame_;
@@ -795,6 +797,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubStrin
{
DBG_CTOR( SdrOle2Obj,NULL);
bInDestruction = sal_False;
+ mbSuppressSetVisAreaSize = false;
Init();
mpImpl->aPersistName = rNewObjName;
@@ -818,6 +821,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const XubStri
{
DBG_CTOR( SdrOle2Obj,NULL);
bInDestruction = sal_False;
+ mbSuppressSetVisAreaSize = false;
Init();
mpImpl->aPersistName = rNewObjName;
@@ -884,6 +888,18 @@ void SdrOle2Obj::SetAspect( sal_Int64 nAspect )
}
// -----------------------------------------------------------------------------
+bool SdrOle2Obj::isInplaceActive() const
+{
+ return xObjRef.is() && embed::EmbedStates::INPLACE_ACTIVE == xObjRef->getCurrentState();
+}
+
+// -----------------------------------------------------------------------------
+bool SdrOle2Obj::isUiActive() const
+{
+ return xObjRef.is() && embed::EmbedStates::UI_ACTIVE == xObjRef->getCurrentState();
+}
+
+// -----------------------------------------------------------------------------
void SdrOle2Obj::SetGraphic_Impl(const Graphic* pGrf)
{
@@ -1749,6 +1765,10 @@ void SdrOle2Obj::operator=(const SdrObject& rObj)
void SdrOle2Obj::ImpSetVisAreaSize()
{
+ // #i118524# do not again set VisAreaSize when the call comes from OLE client (e.g. ObjectAreaChanged)
+ if(mbSuppressSetVisAreaSize)
+ return;
+
// currently there is no need to recalculate scaling for iconified objects
// TODO/LATER: it might be needed in future when it is possible to change the icon
if ( GetAspect() == embed::Aspects::MSOLE_ICON )
@@ -1893,17 +1913,7 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
}
SdrRectObj::NbcResize(rRef,xFact,yFact);
- if (aGeo.nShearWink!=0 || aGeo.nDrehWink!=0) { // kleine Korrekturen
- if (aGeo.nDrehWink>=9000 && aGeo.nDrehWink<27000) {
- aRect.Move(aRect.Left()-aRect.Right(),aRect.Top()-aRect.Bottom());
- }
- aGeo.nDrehWink=0;
- aGeo.nShearWink=0;
- aGeo.nSin=0.0;
- aGeo.nCos=1.0;
- aGeo.nTan=0.0;
- SetRectsDirty();
- }
+
if( pModel && !pModel->isLocked() )
ImpSetVisAreaSize();
}
@@ -1913,6 +1923,7 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
{
SdrRectObj::SetGeoData(rGeo);
+
if( pModel && !pModel->isLocked() )
ImpSetVisAreaSize();
}
@@ -1922,6 +1933,7 @@ void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
{
SdrRectObj::NbcSetSnapRect(rRect);
+
if( pModel && !pModel->isLocked() )
ImpSetVisAreaSize();
@@ -1939,6 +1951,7 @@ void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
{
SdrRectObj::NbcSetLogicRect(rRect);
+
if( pModel && !pModel->isLocked() )
ImpSetVisAreaSize();
}
@@ -1968,6 +1981,7 @@ Size SdrOle2Obj::GetOrigObjSize( MapMode* pTargetMapMode ) const
void SdrOle2Obj::NbcMove(const Size& rSize)
{
SdrRectObj::NbcMove(rSize);
+
if( pModel && !pModel->isLocked() )
ImpSetVisAreaSize();
}