incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1186077 - in /incubator/ooo/trunk/main: sc/source/ui/app/ sc/source/ui/view/ sd/source/ui/docshell/ svx/inc/svx/ svx/source/svdraw/
Date Wed, 19 Oct 2011 10:35:16 GMT
Author: jsc
Date: Wed Oct 19 10:35:16 2011
New Revision: 1186077

URL: http://svn.apache.org/viewvc?rev=1186077&view=rev
Log:
#118524: apply patch, followup fixes to 118485, thanks to Armin Le Grand (alg)

Modified:
    incubator/ooo/trunk/main/sc/source/ui/app/client.cxx
    incubator/ooo/trunk/main/sc/source/ui/view/tabview5.cxx
    incubator/ooo/trunk/main/sc/source/ui/view/tabvwshb.cxx
    incubator/ooo/trunk/main/sd/source/ui/docshell/sdclient.cxx
    incubator/ooo/trunk/main/svx/inc/svx/svdoole2.hxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdmrkv.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx

Modified: incubator/ooo/trunk/main/sc/source/ui/app/client.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/app/client.cxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/app/client.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/app/client.cxx Wed Oct 19 10:35:16 2011
@@ -169,7 +169,23 @@ void __EXPORT ScClient::ObjectAreaChange
 	SdrOle2Obj* pDrawObj = GetDrawObj();
 	if (pDrawObj)
 	{
-        pDrawObj->SetLogicRect( GetScaledObjArea() );
+        Rectangle aNewRectangle(GetScaledObjArea());
+
+        // #i118524# if sheared/rotated, center to non-rotated LogicRect
+        pDrawObj->setSuppressSetVisAreaSize(true);
+        
+        if(pDrawObj->GetGeoStat().nDrehWink || pDrawObj->GetGeoStat().nShearWink)
+        {
+            pDrawObj->SetLogicRect( aNewRectangle );
+
+            const Rectangle& rBoundRect = pDrawObj->GetCurrentBoundRect();
+            const Point aDelta(aNewRectangle.Center() - rBoundRect.Center());
+                
+            aNewRectangle.Move(aDelta.X(), aDelta.Y());
+        }
+
+        pDrawObj->SetLogicRect( aNewRectangle );
+        pDrawObj->setSuppressSetVisAreaSize(false);
 
         //  set document modified (SdrModel::SetChanged is not used)
         // TODO/LATER: is there a reason that this code is not executed in Draw?

Modified: incubator/ooo/trunk/main/sc/source/ui/view/tabview5.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/view/tabview5.cxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/view/tabview5.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/view/tabview5.cxx Wed Oct 19 10:35:16 2011
@@ -603,7 +603,10 @@ void ScTabView::DigitLanguageChanged()
 void ScTabView::ScrollToObject( SdrObject* pDrawObj )
 {
 	if ( pDrawObj )
-		MakeVisible( pDrawObj->GetLogicRect() );
+    {
+        // #i118524# use the BoundRect, this defines the visible area
+		MakeVisible(pDrawObj->GetCurrentBoundRect());
+    }
 }
 
 void ScTabView::MakeVisible( const Rectangle& rHMMRect )

Modified: incubator/ooo/trunk/main/sc/source/ui/view/tabvwshb.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/view/tabvwshb.cxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/view/tabvwshb.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/view/tabvwshb.cxx Wed Oct 19 10:35:16 2011
@@ -225,6 +225,11 @@ sal_Bool ScTabViewShell::ActivateObject(
 	if (nErr != ERRCODE_NONE && !bErrorShown)
 		ErrorHandler::HandleError(nErr);
 
+    // #i118524# refresh handles to suppress for activated OLE
+    if(GetSdrView())
+    {
+        GetSdrView()->AdjustMarkHdl();
+    }
 	//!	SetDocumentName sollte schon im Sfx passieren ???
     //TODO/LATER: how "SetDocumentName"?
     //xIPObj->SetDocumentName( GetViewData()->GetDocShell()->GetTitle() );

Modified: incubator/ooo/trunk/main/sd/source/ui/docshell/sdclient.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/docshell/sdclient.cxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/docshell/sdclient.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/docshell/sdclient.cxx Wed Oct 19 10:35:16 2011
@@ -142,10 +142,29 @@ void Client::ObjectAreaChanged()
 	if (rMarkList.GetMarkCount() == 1)
 	{
 		SdrMark* pMark = rMarkList.GetMark(0);
-		SdrObject* pObj = pMark->GetMarkedSdrObj();
+		SdrOle2Obj* pObj = dynamic_cast< SdrOle2Obj* >(pMark->GetMarkedSdrObj());
 
-        // no need to check for changes, this method is called only if the area really changed
-        pObj->SetLogicRect( GetScaledObjArea() );
+        if(pObj)
+        {
+            // no need to check for changes, this method is called only if the area really
changed
+            Rectangle aNewRectangle(GetScaledObjArea());
+
+            // #i118524# if sheared/rotated, center to non-rotated LogicRect
+            pObj->setSuppressSetVisAreaSize(true);
+
+            if(pObj->GetGeoStat().nDrehWink || pObj->GetGeoStat().nShearWink)
+            {
+                pObj->SetLogicRect( aNewRectangle );
+
+                const Rectangle& rBoundRect = pObj->GetCurrentBoundRect();
+                const Point aDelta(aNewRectangle.Center() - rBoundRect.Center());
+                
+                aNewRectangle.Move(aDelta.X(), aDelta.Y());
+            }
+
+            pObj->SetLogicRect( aNewRectangle );
+            pObj->setSuppressSetVisAreaSize(false);
+        }
 	}
 }
 

Modified: incubator/ooo/trunk/main/svx/inc/svx/svdoole2.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/inc/svx/svdoole2.hxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/inc/svx/svdoole2.hxx (original)
+++ incubator/ooo/trunk/main/svx/inc/svx/svdoole2.hxx Wed Oct 19 10:35:16 2011
@@ -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 !!!

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdmrkv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdmrkv.cxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdmrkv.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdmrkv.cxx Wed Oct 19 10:35:16 2011
@@ -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 )
                 {

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx?rev=1186077&r1=1186076&r2=1186077&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdoole2.cxx Wed Oct 19 10:35:16 2011
@@ -762,6 +762,7 @@ SdrOle2Obj::SdrOle2Obj(FASTBOOL bFrame_)
 {
     DBG_CTOR( SdrOle2Obj,NULL);
 	bInDestruction = sal_False;
+    mbSuppressSetVisAreaSize = false;
 	Init();
 	bFrame=bFrame_;
 }
@@ -774,6 +775,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::Embed
 {
     DBG_CTOR( SdrOle2Obj,NULL);
 	bInDestruction = sal_False;
+    mbSuppressSetVisAreaSize = false;
 	Init();
 
 	bFrame=bFrame_;
@@ -795,6 +797,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::Embed
 {
     DBG_CTOR( SdrOle2Obj,NULL);
 	bInDestruction = sal_False;
+    mbSuppressSetVisAreaSize = false;
 	Init();
 
 	mpImpl->aPersistName = rNewObjName;
@@ -818,6 +821,7 @@ SdrOle2Obj::SdrOle2Obj( const svt::Embed
 {
     DBG_CTOR( SdrOle2Obj,NULL);
 	bInDestruction = sal_False;
+    mbSuppressSetVisAreaSize = false;
 	Init();
 
 	mpImpl->aPersistName = rNewObjName;
@@ -884,6 +888,18 @@ void SdrOle2Obj::SetAspect( sal_Int64 nA
 }
 
 // -----------------------------------------------------------------------------
+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 SdrObje
 
 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,18 +1913,8 @@ void SdrOle2Obj::NbcResize(const Point& 
     }
 
 	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() )
+
+    if( pModel && !pModel->isLocked() )
 		ImpSetVisAreaSize();
 }
 
@@ -1913,7 +1923,8 @@ void SdrOle2Obj::NbcResize(const Point& 
 void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
 {
 	SdrRectObj::SetGeoData(rGeo);
-	if( pModel && !pModel->isLocked() )
+	
+    if( pModel && !pModel->isLocked() )
 		ImpSetVisAreaSize();
 }
 
@@ -1922,7 +1933,8 @@ void SdrOle2Obj::SetGeoData(const SdrObj
 void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
 {
 	SdrRectObj::NbcSetSnapRect(rRect);
-	if( pModel && !pModel->isLocked() )
+
+    if( pModel && !pModel->isLocked() )
 		ImpSetVisAreaSize();
 
     if ( xObjRef.is() && IsChart() )
@@ -1939,7 +1951,8 @@ void SdrOle2Obj::NbcSetSnapRect(const Re
 void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
 {
 	SdrRectObj::NbcSetLogicRect(rRect);
-	if( pModel && !pModel->isLocked() )
+	
+    if( pModel && !pModel->isLocked() )
 		ImpSetVisAreaSize();
 }
 
@@ -1968,7 +1981,8 @@ Size SdrOle2Obj::GetOrigObjSize( MapMode
 void SdrOle2Obj::NbcMove(const Size& rSize)
 {
 	SdrRectObj::NbcMove(rSize);
-	if( pModel && !pModel->isLocked() )
+
+    if( pModel && !pModel->isLocked() )
 		ImpSetVisAreaSize();
 }
 



Mime
View raw message