diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-09-26 14:43:26 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-09-26 14:43:26 +0000 |
commit | bfb17e5e5a62a628f6fe4a98ad082fe37b776987 (patch) | |
tree | c58638b9d4fd08ceb7dc7709231da72c561ce8f7 /sw | |
parent | 8bd0c1383687d15be58384af44ee986ea4a3ba83 (diff) |
CWS-TOOLING: integrate CWS mav39_DEV300
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/fesh.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 32 | ||||
-rw-r--r-- | sw/source/ui/inc/wrtsh.hxx | 1 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh1.cxx | 24 |
5 files changed, 64 insertions, 1 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index ada7e46a250b..f4572a024eb5 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -397,6 +397,9 @@ public: // The return value is the applied size. Size RequestObjectResize( const SwRect &rRect, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ); + //The layout has been changed, so the active object has to be moved after that + virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ); + //Der Client fuer das OleObject muss bezueglich der Scalierung auf dem //neuesten Stand gehalten werden. Impl in der WrtShell. //Wird ein Pointer auf eine Size uebergeben, so ist diese die aktuelle diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 98695a7507ef..13e6a5e732b3 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -1292,3 +1292,8 @@ BOOL SwFEShell::IsFrmVertical(BOOL bEnvironment, BOOL& bRTL) const return bVert; } +void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& ) +{ + // does not do anything, only avoids crash if the method is used for wrong shell +} + diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index a476ea031e51..1f818f4fa1fb 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -31,7 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include <com/sun/star/embed/EmbedStates.hpp> +#include <ndole.hxx> #include <docary.hxx> #include <svtools/itemiter.hxx> #include <fmtfsize.hxx> @@ -2017,6 +2018,35 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset ) SwFlyFrm* pFlyFrm( static_cast<SwFlyFrm*>(pAnchoredObj) ); lcl_MoveAllLowers( pFlyFrm, rOffset ); pFlyFrm->NotifyDrawObj(); + // --> let the active embedded object be moved + if ( pFlyFrm->Lower() ) + { + if ( pFlyFrm->Lower()->IsNoTxtFrm() ) + { + SwCntntFrm* pCntntFrm = static_cast<SwCntntFrm*>(pFlyFrm->Lower()); + ViewShell *pSh = pFlyFrm->Lower()->GetShell(); + if ( pSh ) + { + SwOLENode* pNode = pCntntFrm->GetNode()->GetOLENode(); + if ( pNode ) + { + svt::EmbeddedObjectRef& xObj = pNode->GetOLEObj().GetObject(); + if ( xObj.is() ) + { + ViewShell* pTmp = pSh; + do + { + SwFEShell* pFEShell = dynamic_cast< SwFEShell* >( pTmp ); + if ( pFEShell ) + pFEShell->MoveObjectIfActive( xObj, rOffset ); + pTmp = static_cast<ViewShell*>( pTmp->GetNext() ); + } while( pTmp != pSh ); + } + } + } + } + } + // <-- } else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) ) { diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 1d4ba3e565e2..0cef2075de20 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -341,6 +341,7 @@ typedef BOOL (SwWrtShell:: *FNSimpleMove)(); BOOL InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrmFmt **pFlyFrmFmt = 0 ); void LaunchOLEObj( long nVerb = 0 ); // Server starten BOOL IsOLEObj() const { return GetCntType() == CNT_OLE;} + virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ); virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect = 0, const SwRect *pFlyFrmRect = 0 ); diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index d3f53b8a4370..5d10463062f9 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/embed/XVisualObject.hpp> #include <com/sun/star/embed/EmbedMisc.hpp> +#include <com/sun/star/embed/EmbedStates.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> @@ -664,6 +665,29 @@ void SwWrtShell::LaunchOLEObj( long nVerb ) } +void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ) +{ + try + { + sal_Int32 nState = xObj->getCurrentState(); + if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE + || nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE ) + { + SfxInPlaceClient* pCli = + GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) ); + if ( pCli ) + { + Rectangle aArea = pCli->GetObjArea(); + aArea += rOffset; + pCli->SetObjArea( aArea ); + } + } + } + catch( uno::Exception& ) + {} +} + + void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect, const SwRect *pFlyFrmRect ) |