Modified: openoffice/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx Mon Nov 18 18:20:49 2013 @@ -475,10 +475,10 @@ SdrObject* SdrGrafObj::CloneSdrObject(Sd // ----------------------------------------------------------------------------- -bool SdrGrafObj::IsSdrGrafObj() const -{ - return true; -} +//bool SdrGrafObj::IsSdrGrafObj() const +//{ +// return true; +//} bool SdrGrafObj::DoesSupportTextIndentingOnLineWidthChange() const {
Modified: openoffice/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx Mon Nov 18 18:20:49 2013 @@ -66,21 +66,6 @@ void SdrTextObj::setSdrObjectTransformat // call parent SdrAttrObj::setSdrObjectTransformation(rTransformation); - // TTTT: check if the rebuild works - // - //sal_Int32 nHDist=GetTextLeftDistance()+GetTextRightDistance(); - //sal_Int32 nVDist=GetTextUpperDistance()+GetTextLowerDistance(); - //sal_Int32 nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0; - //sal_Int32 nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0; - //sal_Int32 nTWdt1=rRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0; - //sal_Int32 nTHgt1=rRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0; - // if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) SetMinTextFrameWidth(nTWdt1); - // if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) SetMinTextFrameHeight(nTHgt1); - // if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) { - // ResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0)); - // } - // AdjustTextFrameWidthAndHeight(); - // #115391# AdaptTextMinSize(); Modified: openoffice/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx Mon Nov 18 18:20:49 2013 @@ -322,10 +322,10 @@ SdrObject* SdrUnoObj::CloneSdrObject(Sdr return pClone; } -bool SdrUnoObj::IsSdrUnoObj() const -{ - return true; -} +//bool SdrUnoObj::IsSdrUnoObj() const +//{ +// return true; +//} void SdrUnoObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { Modified: openoffice/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx Mon Nov 18 18:20:49 2013 @@ -163,8 +163,8 @@ void SdrObjList::copyDataFromSdrObjList( if(pSrcEdge) { - SdrObject* pSrcNode1 = pSrcEdge->GetConnectedNode(true); - SdrObject* pSrcNode2 = pSrcEdge->GetConnectedNode(false); + SdrObject* pSrcNode1 = pSrcEdge->GetSdrObjectConnection(true); + SdrObject* pSrcNode2 = pSrcEdge->GetSdrObjectConnection(false); if(pSrcNode1 && pSrcNode1->getParentOfSdrObject() != pSrcEdge->getParentOfSdrObject()) { @@ -190,7 +190,7 @@ void SdrObjList::copyDataFromSdrObjList( if(pDstNode1) { // Sonst grober Fehler! - pDstEdge->ConnectToNode(true, pDstNode1); + pDstEdge->ConnectToSdrObject(true, pDstNode1); } else { @@ -206,7 +206,7 @@ void SdrObjList::copyDataFromSdrObjList( if(pDstNode2) { // Node war sonst wohl nicht markiert - pDstEdge->ConnectToNode(false, pDstNode2); + pDstEdge->ConnectToSdrObject(false, pDstNode2); } else { Modified: openoffice/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/svdraw/svdview.cxx Mon Nov 18 18:20:49 2013 @@ -58,6 +58,7 @@ #include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx> #include <svx/sdr/contact/viewcontact.hxx> #include <drawinglayer/processor2d/contourextractor2d.hxx> +#include <svx/svdogrp.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -2243,4 +2244,118 @@ void SdrView::MoveHandleByVector(const S } //////////////////////////////////////////////////////////////////////////////////////////////////// + +SdrObject* SdrView::FindConnector( + const basegfx::B2DPoint& rPosition, + sal_uInt32& o_rnID, + bool& o_rbBest, + bool& o_rbAuto, + const SdrEdgeObj* pAvoidConnectioWith) +{ + SdrObject* pRetval = 0; + SdrPageView* pSdrPageView = GetSdrPageView(); + + if(pSdrPageView) + { + SdrObjList* pOL = pSdrPageView->GetCurrentObjectList(); + + if(pOL) + { + const SetOfByte& rVisLayer = pSdrPageView->GetVisibleLayers(); + sal_uInt32 no(pOL->GetObjCount()); + + while(no && !pRetval) + { + SdrObject* pSdrObjectCandidate = pOL->GetObj(--no); + SdrObjGroup* pSdrObjGroup = dynamic_cast< SdrObjGroup* >(pSdrObjectCandidate); + + if(pSdrObjectCandidate && + (pSdrObjGroup || rVisLayer.IsSet(pSdrObjectCandidate->GetLayer())) && // GetLayer at groups is zero + (!pAvoidConnectioWith || pAvoidConnectioWith != pSdrObjectCandidate)) // no connections to pAvoidConnectioWith + { + basegfx::B2DRange aCandidateRange(pSdrObjectCandidate->getObjectRange(this)); + const double fHitToleranceDoubled(getHitTolLog() * 2.0); + + aCandidateRange.grow(fHitToleranceDoubled); + + if(aCandidateRange.isInside(rPosition)) + { + const sdr::glue::GluePointProvider& rProvider = pSdrObjectCandidate->GetGluePointProvider(); + const sdr::glue::GluePointVector aUserGluePointVector(rProvider.getUserGluePointVector()); + const sal_uInt32 nUserGluePointCount(aUserGluePointVector.size()); + sal_uInt32 a(0); + double fShortest(0.0); + + // check for UserGluePoint hit + for(a = 0; a < nUserGluePointCount; a++) + { + const sdr::glue::GluePoint* pGluePointCandidate = aUserGluePointVector[a]; + + if(pGluePointCandidate) + { + const basegfx::B2DPoint aPoint(pSdrObjectCandidate->getSdrObjectTransformation() * pGluePointCandidate->getUnitPosition()); + const double fDistance(basegfx::B2DVector(aPoint - rPosition).getLength()); + + if(fDistance < fHitToleranceDoubled && (basegfx::fTools::equalZero(fShortest) || fDistance < fShortest)) + { + fShortest = fDistance; + pRetval = pSdrObjectCandidate; + o_rnID = pGluePointCandidate->getID(); + o_rbBest = false; + o_rbAuto = false; + } + } + else + { + OSL_ENSURE(false, "Got sdr::glue::PointVector with empty entries (!)"); + } + } + + // check for AutoGluePoint hit + if(!pRetval) + { + const sal_uInt32 nAutoGluePointCount(rProvider.getAutoGluePointCount()); + + for(a = 0; a < nAutoGluePointCount; a++) + { + const sdr::glue::GluePoint aLocalPt(rProvider.getAutoGluePointByIndex(a)); + const basegfx::B2DPoint aPoint(pSdrObjectCandidate->getSdrObjectTransformation() * aLocalPt.getUnitPosition()); + const double fDistance(basegfx::B2DVector(aPoint - rPosition).getLength()); + + if(fDistance < fHitToleranceDoubled && (basegfx::fTools::equalZero(fShortest) || fDistance < fShortest)) + { + fShortest = fDistance; + pRetval = pSdrObjectCandidate; + o_rnID = a; + o_rbBest = false; + o_rbAuto = true; + } + } + } + + // check if object is hit and setBestConnection + if(!pRetval + && !dynamic_cast< const SdrEdgeObj* >(pSdrObjectCandidate) + && SdrObjectPrimitiveHit(*pSdrObjectCandidate, rPosition, fHitToleranceDoubled, *this, false, 0) + && (!pAvoidConnectioWith || !pAvoidConnectioWith->GetSuppressDefaultConnect())) + { + pRetval = pSdrObjectCandidate; + o_rnID = 0; + o_rbBest = true; + o_rbAuto = false; + } + } + } + } + } + else + { + OSL_ENSURE(false, "Empty current object list from PageView (!)"); + } + } + + return pRetval; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// // eof Modified: openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx Mon Nov 18 18:20:49 2013 @@ -496,7 +496,7 @@ void SAL_CALL SvxShapeConnector::connect { SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get()); OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)"); - pEdge->ConnectToNode( sal_True, pShape->mpObj.get() ); + pEdge->ConnectToSdrObject( true, pShape->mpObj.get() ); } if( mpModel ) @@ -516,7 +516,7 @@ void SAL_CALL SvxShapeConnector::connect { SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get()); OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)"); - pEdge->ConnectToNode( sal_False, pShape->mpObj.get() ); + pEdge->ConnectToSdrObject( false, pShape->mpObj.get() ); } if( mpModel ) @@ -533,7 +533,7 @@ void SAL_CALL SvxShapeConnector::disconn { SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get()); OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)"); - pEdge->DisconnectFromNode( sal_True ); + pEdge->ConnectToSdrObject(true); } if( mpModel ) @@ -550,7 +550,7 @@ void SAL_CALL SvxShapeConnector::disconn { SdrEdgeObj* pEdge = dynamic_cast< SdrEdgeObj* >(mpObj.get()); OSL_ENSURE(pEdge, "OOps, SvxShapeConnector without SdrEdgeObj (!)"); - pEdge->DisconnectFromNode( sal_False ); + pEdge->ConnectToSdrObject(false); } if( mpModel ) Modified: openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx (original) +++ openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx Mon Nov 18 18:20:49 2013 @@ -2477,7 +2477,7 @@ bool SvxShape::setPropertyValueImpl( con SdrObject* pNode = GetSdrObjectFromXShape( xShape ); if( pNode ) { - pEdgeObj->ConnectToNode( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode ); + pEdgeObj->ConnectToSdrObject( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, pNode ); pEdgeObj->setGluePointIndex( pProperty->nWID == OWN_ATTR_EDGE_START_OBJ, -1 ); return true; } @@ -2517,17 +2517,31 @@ bool SvxShape::setPropertyValueImpl( con } break; } - case OWN_ATTR_EDGE_POLYPOLYGONBEZIER: - { - drawing::PolyPolygonBezierCoords aPolyPoly; - if ( rValue >>= aPolyPoly ) - { - basegfx::B2DPolyPolygon aNewPolyPolygon(basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(aPolyPoly)); + case OWN_ATTR_EDGE_POLYPOLYGONBEZIER: + { + basegfx::B2DPolyPolygon aNewPolyPolygon; + + // #123616# be a little bit more flexible regardin gthe data type used + if( rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0)) + { + // get polygpon data from PointSequenceSequence + aNewPolyPolygon = basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon( + *(const drawing::PointSequenceSequence*)rValue.getValue()); + } + else if( rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0)) + { + // get polygpon data from PolyPolygonBezierCoords + aNewPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( + *(const drawing::PolyPolygonBezierCoords*)rValue.getValue()); + } + + if(aNewPolyPolygon.count()) + { ForceMetricToItemPoolMetric( aNewPolyPolygon ); - + if(isWriterAnchorUsed()) { - aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos())); + aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos())); } if(aNewPolyPolygon.count()) @@ -2537,9 +2551,9 @@ bool SvxShape::setPropertyValueImpl( con } return true; - } - } - } + } + } + } } break; } @@ -3031,7 +3045,7 @@ bool SvxShape::getPropertyValueImpl( con case OWN_ATTR_EDGE_START_OBJ: case OWN_ATTR_EDGE_END_OBJ: { - SdrObject* pNode = pEdgeObj->GetConnectedNode(pProperty->nWID == OWN_ATTR_EDGE_START_OBJ); + SdrObject* pNode = pEdgeObj->GetSdrObjectConnection(pProperty->nWID == OWN_ATTR_EDGE_START_OBJ); if(pNode) { Reference< drawing::XShape > xShape( GetXShapeForSdrObject( pNode ) ); Modified: openoffice/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx (original) +++ openoffice/branches/alg/aw080/main/sw/source/core/frmedt/feshview.cxx Mon Nov 18 18:20:49 2013 @@ -88,6 +88,7 @@ #include <svx/fmmodel.hxx> #include <svx/svdview.hxx> #include <switerator.hxx> +#include <svx/obj3d.hxx> #define SCROLLVAL 75 @@ -2252,7 +2253,7 @@ sal_Bool SwFEShell::IsGroupSelected() // Thus, use corresponding method instead of checking type. if ( pObj->getChildrenOfSdrObject() && // --> FME 2004-12-08 #i38505# No ungroup allowed for 3d objects - !pObj->IsE3dObject() && + !dynamic_cast< E3dObject* >(pObj) && // <-- FLY_AS_CHAR != ((SwDrawContact*)findConnectionToSdrObject(pObj))-> GetFmt()->GetAnchor().GetAnchorId() ) Modified: openoffice/branches/alg/aw080/main/sw/source/core/text/txtfly.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/sw/source/core/text/txtfly.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/sw/source/core/text/txtfly.cxx (original) +++ openoffice/branches/alg/aw080/main/sw/source/core/text/txtfly.cxx Mon Nov 18 18:20:49 2013 @@ -1147,7 +1147,7 @@ sal_Bool SwTxtFly::GetTop( const SwAncho if(pSdrEdgeObj) { - if(pSdrEdgeObj->GetConnectedNode(true) || pSdrEdgeObj->GetConnectedNode(false)) + if(pSdrEdgeObj->GetSdrObjectConnection(true) || pSdrEdgeObj->GetSdrObjectConnection(false)) { return sal_False; } Modified: openoffice/branches/alg/aw080/main/sw/source/core/text/txtio.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/sw/source/core/text/txtio.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/sw/source/core/text/txtio.cxx (original) +++ openoffice/branches/alg/aw080/main/sw/source/core/text/txtio.cxx Mon Nov 18 18:20:49 2013 @@ -178,7 +178,7 @@ void lcl_OutFrame( SvFileStream& rStr, c } else { - aTmp = pAnchoredObj->GetDrawObj()->IsSdrUnoObj() ? "UNO" : "Drw"; + aTmp = dynamic_cast< SdrUnoObj* >(pAnchoredObj->GetDrawObj()) ? "UNO" : "Drw"; rStr << aTmp; } // <-- @@ -205,7 +205,7 @@ void lcl_OutFrame( SvFileStream& rStr, c } else { - aTmp = pAnchoredObj->GetDrawObj()->IsSdrUnoObj() ? "UNO" : "Drw"; + aTmp = dynamic_cast< SdrUnoObj* >(pAnchoredObj->GetDrawObj()) ? "UNO" : "Drw"; rStr << aTmp; } if( i < nCnt - 1 ) Modified: openoffice/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx?rev=1543099&r1=1543098&r2=1543099&view=diff ============================================================================== --- openoffice/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx (original) +++ openoffice/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx Mon Nov 18 18:20:49 2013 @@ -77,6 +77,7 @@ #include <svx/svdpagv.hxx> #include <svx/extrusionbar.hxx> #include <vcl/svapp.hxx> +#include <svx/obj3d.hxx> using namespace ::com::sun::star; /*-------------------------------------------------------------------- @@ -745,7 +746,7 @@ sal_Bool SwView::HasDrwObj(SdrObject *pS if ((bRet = HasDrwObj(pList->GetObj(i))) == sal_True) break; } - else if (SdrInventor == pSdrObj->GetObjInventor() || pSdrObj->IsE3dObject()) + else if (SdrInventor == pSdrObj->GetObjInventor() || dynamic_cast< E3dObject* >(pSdrObj)) return sal_True; return bRet;
