You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/04/25 13:38:41 UTC
svn commit: r1330215 - in /incubator/ooo/branches/alg/aw080/main:
filter/source/svg/ sc/source/filter/html/ sd/source/core/ sd/source/ui/dlg/
svx/inc/svx/ svx/source/engine3d/ svx/source/form/ svx/source/inc/
svx/source/svdraw/ svx/source/table/ sw/inc...
Author: alg
Date: Wed Apr 25 11:38:39 2012
New Revision: 1330215
URL: http://svn.apache.org/viewvc?rev=1330215&view=rev
Log:
aw080: further adaptions of sdr::legacy::GetBoundRect usages to double, cleanups, 3D stabilization
Modified:
incubator/ooo/branches/alg/aw080/main/filter/source/svg/svgexport.cxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/html/htmlexp2.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/core/sdpage.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/ui/dlg/animobjs.cxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdxcgv.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/view3d.hxx
incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/form/fmpage.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/form/formcontrolfactory.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/inc/formcontrolfactory.hxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdobj.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx
incubator/ooo/branches/alg/aw080/main/sw/inc/dcontact.hxx
incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dcontact.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dflyobj.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx
Modified: incubator/ooo/branches/alg/aw080/main/filter/source/svg/svgexport.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/filter/source/svg/svgexport.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/filter/source/svg/svgexport.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/filter/source/svg/svgexport.cxx Wed Apr 25 11:38:39 2012
@@ -1016,14 +1016,11 @@ sal_Bool SVGFilter::implCreateObjectsFro
if( pObj )
{
- const MapMode aMap(pObj->getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(),
- pObj->getSdrModelFromSdrObject().GetExchangeObjectScale(),
- pObj->getSdrModelFromSdrObject().GetExchangeObjectScale());
- Graphic aGraphic( SdrExchangeView::GetObjGraphic( aMap, *pObj ) );
+ const Graphic aGraphic(GetObjGraphic(*pObj));
- if( aGraphic.GetType() != GRAPHIC_NONE )
+ if(GRAPHIC_NONE != aGraphic.GetType())
{
- if( aGraphic.GetType() == GRAPHIC_BITMAP )
+ if(GRAPHIC_BITMAP == aGraphic.GetType())
{
GDIMetaFile aMtf;
const basegfx::B2DRange& rRange = pObj->getObjectRange(0);
@@ -1037,7 +1034,9 @@ sal_Bool SVGFilter::implCreateObjectsFro
(*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aMtf );
}
else
+ {
(*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aGraphic.GetGDIMetaFile() );
+ }
bRet = sal_True;
}
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/html/htmlexp2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/html/htmlexp2.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/html/htmlexp2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/html/htmlexp2.cxx Wed Apr 25 11:38:39 2012
@@ -184,11 +184,7 @@ void ScHTMLExport::WriteGraphEntry( ScHT
break;
default:
{
- SdrModel* pOwningModel = pDoc->GetDrawLayer();
- const MapMode aMap(pOwningModel->GetExchangeObjectUnit(), Point(),
- pOwningModel->GetExchangeObjectScale(),
- pOwningModel->GetExchangeObjectScale());
- const Graphic aGraph(SdrExchangeView::GetObjGraphic(aMap, *pObject));
+ const Graphic aGraph(GetObjGraphic(*pObject));
String aLinkName;
WriteImage( aLinkName, aGraph, aOpt );
pE->bWritten = sal_True;
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/core/sdpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/core/sdpage.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/core/sdpage.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/core/sdpage.cxx Wed Apr 25 11:38:39 2012
@@ -962,6 +962,13 @@ void SdPage::CreateTitleAndLayout(bool b
pUndoManager->AddUndoAction(rDrawDocument.GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
pMasterPage->RemoveObjectFromSdrObjList(pObj->GetNavigationPosition());
+
+ if(getSdrModelFromSdrPage().isLocked())
+ {
+ // remove self when model is locked (during load), else the
+ // broadcast of object removal will do that
+ pMasterPage->RemovePresObj(pObj);
+ }
}
std::vector< basegfx::B2DRange > aAreas;
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/dlg/animobjs.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/dlg/animobjs.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/dlg/animobjs.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/dlg/animobjs.cxx Wed Apr 25 11:38:39 2012
@@ -953,27 +953,20 @@ void AnimationWindow::AddObj (::sd::View
{
SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( nObject );
OSL_ENSURE(pSnapShot, "zero SdrObject* in SdrObjList (!)");
- const MapMode aMap(pSnapShot->getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(),
- pSnapShot->getSdrModelFromSdrObject().GetExchangeObjectScale(),
- pSnapShot->getSdrModelFromSdrObject().GetExchangeObjectScale());
-
- pBitmapEx = new BitmapEx(
- SdrExchangeView::GetObjGraphic(
- aMap,
- *pSnapShot
- ).GetBitmapEx() );
- aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
- // Time
- Time* pTime = new Time( aTimeField.GetTime() );
- aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 );
+ pBitmapEx = new BitmapEx(GetObjGraphic(*pSnapShot).GetBitmapEx());
+ aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
- // Clone
+ // Time
+ Time* pTime = new Time( aTimeField.GetTime() );
+ aTimeList.Insert( pTime, aBmpExList.GetCurPos() + 1 );
+
+ // Clone
pPage->InsertObjectToSdrObjList( pSnapShot->CloneSdrObject(), aBmpExList.GetCurPos() + 1 );
- // Weiterschalten der BitmapListe
- aBmpExList.Next();
- }
+ // Weiterschalten der BitmapListe
+ aBmpExList.Next();
+ }
}
bAnimObj = true;
}
@@ -1005,15 +998,8 @@ void AnimationWindow::AddObj (::sd::View
{
// Clone
SdrObject* pObject = aSelection[nObject];
- const MapMode aMap(pObject->getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(),
- pObject->getSdrModelFromSdrObject().GetExchangeObjectScale(),
- pObject->getSdrModelFromSdrObject().GetExchangeObjectScale());
-
- pBitmapEx = new BitmapEx(
- SdrExchangeView::GetObjGraphic(
- aMap,
- *pObject
- ).GetBitmapEx() );
+
+ pBitmapEx = new BitmapEx(GetObjGraphic(*pObject).GetBitmapEx());
aBmpExList.Insert( pBitmapEx, aBmpExList.GetCurPos() + 1 );
// Time
Modified: incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdxcgv.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdxcgv.hxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdxcgv.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdxcgv.hxx Wed Apr 25 11:38:39 2012
@@ -30,6 +30,19 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
+/** Generate a Graphic for the given draw object in the given model
+
+ @param pObj
+ The object (can also be a group object) to retrieve a Graphic
+ for. Must not be NULL.
+
+ @return a graphical representation of the given object, as it
+ appears on screen (e.g. with rotation, if any, applied).
+ */
+Graphic SVX_DLLPUBLIC GetObjGraphic(const SdrObject& rObj);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
class SVX_DLLPUBLIC SdrExchangeView: public SdrObjEditView
{
protected:
@@ -71,21 +84,6 @@ public:
Graphic GetAllMarkedGraphic() const;
SdrModel* GetAllMarkedModel() const { return GetMarkedObjModel(); }
- /** Generate a Graphic for the given draw object in the given model
-
- @param pModel
- Must not be NULL. Denotes the draw model the object is a part
- of.
-
- @param pObj
- The object (can also be a group object) to retrieve a Graphic
- for. Must not be NULL.
-
- @return a graphical representation of the given object, as it
- appears on screen (e.g. with rotation, if any, applied).
- */
- static Graphic GetObjGraphic( const MapMode& rMap, const SdrObject& rObj );
-
// Bestimmung des View-Mittelpunktes, z.B. zum Pasten
basegfx::B2DPoint GetViewCenter(const OutputDevice* pOut = 0) const;
Modified: incubator/ooo/branches/alg/aw080/main/svx/inc/svx/view3d.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/inc/svx/view3d.hxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/inc/svx/view3d.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/inc/svx/view3d.hxx Wed Apr 25 11:38:39 2012
@@ -257,8 +257,6 @@ public:
return bDoubleSided;
}
- void MergeScenes();
-
SfxItemSet Get3DAttributes(E3dScene* pInScene = NULL) const;
void Set3DAttributes(const SfxItemSet& rAttr, E3dScene* pInScene = NULL, bool bOnly3DAttr=false);
};
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx Wed Apr 25 11:38:39 2012
@@ -1785,102 +1785,6 @@ void E3dView::BreakSingle3DObj(E3dObject
/*************************************************************************
|*
-|* Szenen mischen
-|*
-\************************************************************************/
-
-void E3dView::MergeScenes ()
-{
- const SdrObjectVector aSelection(getSelectedSdrObjectVectorFromSdrMarkView());
-
- if(aSelection.size())
- {
- sal_uInt32 nObj(0);
- SdrObject *pObj = aSelection[0];
- E3dScene *pScene = new E3dScene(
- getSdrModelFromSdrView(),
- Get3DDefaultAttributes());
- basegfx::B3DRange aBoundVol;
- const Rectangle aAllBoundRect(sdr::legacy::GetAllObjBoundRect(aSelection)); // TTTT
- Point aCenter (aAllBoundRect.Center());
-
- while (pObj)
- {
- E3dScene* pE3dScene = dynamic_cast< E3dScene* >(pObj);
-
- if (pE3dScene)
- {
- /**********************************************************
- * Es ist eine 3D-Scene oder 3D-PolyScene
- **********************************************************/
- SdrObjList* pSubList = pE3dScene->getChildrenOfSdrObject();
-
- if(pSubList)
- {
- SdrObjListIter aIter(*pSubList, IM_FLAT);
-
- while (aIter.IsMore())
- {
- /******************************************************
- * LatheObjekte suchen
- ******************************************************/
- SdrObject* pSubObj = aIter.Next();
- E3dObject* pNewObj = static_cast< E3dObject* >(
- pSubObj->CloneSdrObject(&getSdrModelFromSdrView()));
-
- Rectangle aBoundRect = sdr::legacy::GetBoundRect(*pSubObj);
- basegfx::B3DHomMatrix aMatrix;
- aMatrix.translate(aBoundRect.Left() - aCenter.getX(), aCenter.getY(), 0.0);
- pNewObj->SetB3DTransform(aMatrix * pNewObj->GetB3DTransform()); // #112587#
-
- if (pNewObj)
- aBoundVol.expand(pNewObj->GetBoundVolume());
-
- pScene->Insert3DObj (pNewObj);
- }
- }
- }
-
- nObj++;
-
- if (nObj < aSelection.size())
- {
- pObj = aSelection[nObj];
- }
- else
- {
- pObj = 0;
- }
- }
-
- double fW = aAllBoundRect.GetWidth();
- double fH = aAllBoundRect.GetHeight();
- Rectangle aRect(0,0, (sal_Int32) fW, (sal_Int32) fH);
-
- InitScene(pScene, fW, fH, aBoundVol.getMaxZ() + + ((fW + fH) / 4.0));
- sdr::legacy::SetSnapRect(*pScene, aRect);
-
- Camera3D &aCamera = (Camera3D&) pScene->GetCamera ();
- basegfx::B3DPoint aMinVec(aBoundVol.getMinimum());
- basegfx::B3DPoint aMaxVec(aBoundVol.getMaximum());
- double fDeepth(fabs(aMaxVec.getZ() - aMinVec.getZ()));
-
- aCamera.SetPRP(basegfx::B3DPoint(0.0, 0.0, 1000.0));
- double fDefaultCamPosZ(GetDefaultCamPosZ());
- aCamera.SetPosition(basegfx::B3DPoint(0.0, 0.0, fDefaultCamPosZ + fDeepth / 2.0));
- aCamera.SetFocalLength(GetDefaultCamFocal());
- pScene->SetCamera (aCamera);
-
- // SnapRects der Objekte ungueltig
- InsertObjectAtView(*pScene);
-
- // SnapRects der Objekte ungueltig
- pScene->ActionChanged();
- }
-}
-
-/*************************************************************************
-|*
|* Possibilities, hauptsaechlich gruppieren/ungruppieren
|*
\************************************************************************/
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/form/fmpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/form/fmpage.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/form/fmpage.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/form/fmpage.cxx Wed Apr 25 11:38:39 2012
@@ -218,18 +218,21 @@ sal_Bool FmFormPage::RequestHelp( Window
if ( aHelpText.Len() != 0 )
{
// Hilfe anzeigen
- Rectangle aItemRect = sdr::legacy::GetBoundRect(*pObj);
- aItemRect = pWindow->LogicToPixel( aItemRect );
- Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
- aItemRect.Left() = aPt.X();
- aItemRect.Top() = aPt.Y();
- aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
- aItemRect.Right() = aPt.X();
- aItemRect.Bottom() = aPt.Y();
- if( rEvt.GetMode() == HELPMODE_BALLOON )
- Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
+ const basegfx::B2DRange aDiscreteRange(pWindow->GetInverseViewTransformation() * pObj->getObjectRange(pView));
+ const Point aTopLeft(basegfx::fround(aDiscreteRange.getMinX()), aDiscreteRange.getMinY());
+ const Point aBottomRight(basegfx::fround(aDiscreteRange.getMaxX()), aDiscreteRange.getMaxY());
+ const Rectangle aItemRectangle(
+ pWindow->OutputToScreenPixel(aTopLeft),
+ pWindow->OutputToScreenPixel(aBottomRight));
+
+ if(HELPMODE_BALLOON == rEvt.GetMode())
+ {
+ Help::ShowBalloon(pWindow, aItemRectangle.Center(), aItemRectangle, aHelpText);
+ }
else
- Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
+ {
+ Help::ShowQuickHelp(pWindow, aItemRectangle, aHelpText);
+ }
}
#endif
return sal_True;
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/form/formcontrolfactory.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/form/formcontrolfactory.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/form/formcontrolfactory.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/form/formcontrolfactory.cxx Wed Apr 25 11:38:39 2012
@@ -136,7 +136,7 @@ namespace svxform
return initializeControlModel(
_eDocType,
Reference< XPropertySet >( _rObject.GetUnoControlModel(), UNO_QUERY ),
- sdr::legacy::GetBoundRect(_rObject)
+ _rObject.getObjectRange(0)
);
}
@@ -144,7 +144,7 @@ namespace svxform
sal_Int16 FormControlFactory::initializeControlModel( const DocumentType _eDocType, const Reference< XPropertySet >& _rxControlModel )
{
return initializeControlModel(
- _eDocType, _rxControlModel, Rectangle()
+ _eDocType, _rxControlModel, basegfx::B2DRange()
);
}
@@ -397,7 +397,7 @@ namespace svxform
//--------------------------------------------------------------------
sal_Int16 FormControlFactory::initializeControlModel( const DocumentType _eDocType, const Reference< XPropertySet >& _rxControlModel,
- const Rectangle& _rControlBoundRect )
+ const basegfx::B2DRange& _rControlBoundRange )
{
sal_Int16 nClassId = FormComponentType::CONTROL;
@@ -419,7 +419,7 @@ namespace svxform
case FormComponentType::SPINBUTTON:
{
sal_Int32 eOrientation = ScrollBarOrientation::HORIZONTAL;
- if ( !_rControlBoundRect.IsEmpty() && ( _rControlBoundRect.GetWidth() < _rControlBoundRect.GetHeight() ) )
+ if ( !_rControlBoundRange.isEmpty() && ( _rControlBoundRange.getWidth() < _rControlBoundRange.getHeight() ) )
eOrientation = ScrollBarOrientation::VERTICAL;
_rxControlModel->setPropertyValue( FM_PROP_ORIENTATION, makeAny( eOrientation ) );
}
@@ -428,7 +428,7 @@ namespace svxform
case FormComponentType::LISTBOX:
case FormComponentType::COMBOBOX:
{
- sal_Bool bDropDown = !_rControlBoundRect.IsEmpty() && ( _rControlBoundRect.GetWidth() >= 3 * _rControlBoundRect.GetHeight() );
+ sal_Bool bDropDown = !_rControlBoundRange.isEmpty() && ( _rControlBoundRange.getWidth() >= 3.0 * _rControlBoundRange.getHeight() );
if ( xPSI->hasPropertyByName( FM_PROP_DROPDOWN ) )
_rxControlModel->setPropertyValue( FM_PROP_DROPDOWN, makeAny( (sal_Bool)bDropDown ) );
_rxControlModel->setPropertyValue( FM_PROP_LINECOUNT, makeAny( sal_Int16( 20 ) ) );
@@ -440,8 +440,8 @@ namespace svxform
initializeTextFieldLineEnds( _rxControlModel );
lcl_initializeCharacterAttributes( _rxControlModel );
- if ( !_rControlBoundRect.IsEmpty()
- && !( _rControlBoundRect.GetWidth() > 4 * _rControlBoundRect.GetHeight() )
+ if ( !_rControlBoundRange.isEmpty()
+ && !( _rControlBoundRange.getWidth() > 4.0 * _rControlBoundRange.getHeight() )
)
{
if ( xPSI->hasPropertyByName( FM_PROP_MULTILINE ) )
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/inc/formcontrolfactory.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/inc/formcontrolfactory.hxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/inc/formcontrolfactory.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/inc/formcontrolfactory.hxx Wed Apr 25 11:38:39 2012
@@ -44,6 +44,8 @@ namespace comphelper {
class ComponentContext;
}
+namespace basegfx { class B2DRange; }
+
//........................................................................
namespace svxform
{
@@ -74,7 +76,7 @@ namespace svxform
sal_Int16 initializeControlModel(
const DocumentType _eDocType,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControlModel,
- const Rectangle& _rControlBoundRect
+ const basegfx::B2DRange& _rControlBoundRange
);
sal_Int16 initializeControlModel( const DocumentType _eDocType, const SdrUnoObj& _rObject );
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx Wed Apr 25 11:38:39 2012
@@ -97,7 +97,6 @@ void SdrEditView::MovMarkedToTop()
}
const sal_uInt32 nNowPos(pObj->GetNavigationPosition());
- const Rectangle aBR(sdr::legacy::GetBoundRect(*pObj));
sal_uInt32 nCmpPos(nNowPos + 1);
SdrObject* pMaxObj=GetMaxToTopObj(pObj);
@@ -122,6 +121,7 @@ void SdrEditView::MovMarkedToTop()
}
bool bEnd(false);
+ const basegfx::B2DRange aBoundRange(pObj->getObjectRange(getAsSdrView()));
while (nCmpPos<nNewPos && !bEnd)
{
@@ -138,7 +138,7 @@ void SdrEditView::MovMarkedToTop()
nNewPos--;
bEnd = true;
}
- else if(aBR.IsOver(sdr::legacy::GetBoundRect(*pCmpObj)))
+ else if(aBoundRange.overlaps(pCmpObj->getObjectRange(getAsSdrView())))
{
nNewPos=nCmpPos;
bEnd = true;
@@ -202,7 +202,6 @@ void SdrEditView::MovMarkedToBtm()
}
const sal_uInt32 nNowPos(pObj->GetNavigationPosition());
- const Rectangle aBR(sdr::legacy::GetBoundRect(*pObj));
sal_uInt32 nCmpPos(nNowPos);
if(nCmpPos > 0)
@@ -228,6 +227,7 @@ void SdrEditView::MovMarkedToBtm()
}
bool bEnd(false);
+ const basegfx::B2DRange aBoundRange(pObj->getObjectRange(getAsSdrView()));
// nNewPos ist an dieser Stelle noch die maximale Position,
// an der das Obj hinruecken darf, ohne seinen Vorgaenger
// (Mehrfachselektion) zu ueberholen.
@@ -247,7 +247,7 @@ void SdrEditView::MovMarkedToBtm()
nNewPos++;
bEnd = true;
}
- else if(aBR.IsOver(sdr::legacy::GetBoundRect(*pCmpObj)))
+ else if(aBoundRange.overlaps(pCmpObj->getObjectRange(getAsSdrView())))
{
nNewPos=nCmpPos;
bEnd = true;
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdobj.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdobj.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdobj.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdobj.cxx Wed Apr 25 11:38:39 2012
@@ -499,9 +499,9 @@ void SdrObject::ActionChanged() const
SdrPage* SdrObject::getSdrPageFromSdrObject() const
{
- if(mpParentOfSdrObject)
+ if(getParentOfSdrObject())
{
- return mpParentOfSdrObject->getSdrPageFromSdrObjList();
+ return getParentOfSdrObject()->getSdrPageFromSdrObjList();
}
return 0;
@@ -528,7 +528,7 @@ void SdrObject::SetOrdNum(sal_uInt32 nNe
void SdrObject::setParentOfSdrObject(SdrObjList* pNew)
{
- if(mpParentOfSdrObject != pNew)
+ if(getParentOfSdrObject() != pNew)
{
// remember current page
SdrPage* pOldPage = getSdrPageFromSdrObject();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdouno.cxx Wed Apr 25 11:38:39 2012
@@ -439,16 +439,12 @@ SdrObject* SdrUnoObj::getFullDragClone()
if(bHandleSpecial)
{
- const MapMode aMap(getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(),
- getSdrModelFromSdrObject().GetExchangeObjectScale(),
- getSdrModelFromSdrObject().GetExchangeObjectScale());
-
// special handling for SdrUnoObj (FormControl). Create a SdrGrafObj
// for drag containing the graphical representation. This does not work too
// well, so the default is to simply clone
pRetval = new SdrGrafObj(
getSdrModelFromSdrObject(),
- SdrDragView::GetObjGraphic(aMap, *this),
+ GetObjGraphic(*this),
getSdrObjectTransformation());
}
else
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx Wed Apr 25 11:38:39 2012
@@ -58,6 +58,75 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
+Graphic GetObjGraphic(const SdrObject& rObj)
+{
+ Graphic aRet;
+
+ // try to get a graphic from the object first
+ const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&rObj);
+ const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&rObj);
+
+ if(pSdrGrafObj)
+ {
+ if(pSdrGrafObj->isEmbeddedSvg())
+ {
+ // get Metafile for Svg content
+ aRet = pSdrGrafObj->getMetafileFromEmbeddedSvg();
+ }
+ else
+ {
+ // #110981# Make behaviour coherent with metafile
+ // recording below (which of course also takes
+ // view-transformed objects)
+ aRet = pSdrGrafObj->GetTransformedGraphic();
+ }
+ }
+ else if(pSdrOle2Obj)
+ {
+ if ( pSdrOle2Obj->GetGraphic() )
+ {
+ aRet = *pSdrOle2Obj->GetGraphic();
+ }
+ }
+
+ if(GRAPHIC_NONE == aRet.GetType() || GRAPHIC_DEFAULT == aRet.GetType())
+ {
+ // if graphic could not be retrieved => go the hard way and create a MetaFile
+ const SdrModel& rSdrModel = rObj.getSdrModelFromSdrObject();
+ const MapMode aMap(
+ rSdrModel.GetExchangeObjectUnit(),
+ Point(),
+ rSdrModel.GetExchangeObjectScale(),
+ rSdrModel.GetExchangeObjectScale());
+ VirtualDevice aOut;
+ GDIMetaFile aMtf;
+ const basegfx::B2DRange aBoundRange(rObj.getObjectRange(0));
+
+ aOut.EnableOutput(false);
+ aOut.SetMapMode(aMap);
+ aMtf.Record(&aOut);
+ rObj.SingleObjectPainter(aOut);
+ aMtf.Stop();
+ aMtf.WindStart();
+
+ if(aMtf.GetActionCount())
+ {
+ // #i99268# replace the original offset from using XOutDev's SetOffset
+ // NOT (as tried with #i92760#) with another MapMode which gets recorded
+ // by the Metafile itself (what always leads to problems), but by
+ // translating the result the hard way
+ aMtf.Move(-basegfx::fround(aBoundRange.getMinX()), -basegfx::fround(aBoundRange.getMinY()));
+ aMtf.SetPrefMapMode(aMap);
+ aMtf.SetPrefSize(Size(basegfx::fround(aBoundRange.getWidth()), basegfx::fround(aBoundRange.getHeight())));
+ aRet = aMtf;
+ }
+ }
+
+ return aRet;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
SdrExchangeView::SdrExchangeView(SdrModel& rModel1, OutputDevice* pOut)
: SdrObjEditView(rModel1, pOut)
{
@@ -710,11 +779,7 @@ Graphic SdrExchangeView::GetAllMarkedGra
if(pSingleSelected)
{
- const MapMode aMap(getSdrModelFromSdrView().GetExchangeObjectUnit(), Point(),
- getSdrModelFromSdrView().GetExchangeObjectScale(),
- getSdrModelFromSdrView().GetExchangeObjectScale());
-
- aRet = SdrExchangeView::GetObjGraphic(aMap, *pSingleSelected);
+ aRet = GetObjGraphic(*pSingleSelected);
}
else
{
@@ -727,71 +792,6 @@ Graphic SdrExchangeView::GetAllMarkedGra
// -----------------------------------------------------------------------------
-Graphic SdrExchangeView::GetObjGraphic(const MapMode& rMap, const SdrObject& rObj)
-{
- Graphic aRet;
-
- // try to get a graphic from the object first
- const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(&rObj);
- const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(&rObj);
-
- if(pSdrGrafObj)
- {
- if(pSdrGrafObj->isEmbeddedSvg())
- {
- // get Metafile for Svg content
- aRet = pSdrGrafObj->getMetafileFromEmbeddedSvg();
- }
- else
- {
- // #110981# Make behaviour coherent with metafile
- // recording below (which of course also takes
- // view-transformed objects)
- aRet = pSdrGrafObj->GetTransformedGraphic();
- }
- }
- else if(pSdrOle2Obj)
- {
- if ( pSdrOle2Obj->GetGraphic() )
- {
- aRet = *pSdrOle2Obj->GetGraphic();
- }
- }
-
- // if graphic could not be retrieved => go the hard way and create a MetaFile
- if( ( GRAPHIC_NONE == aRet.GetType() ) || ( GRAPHIC_DEFAULT == aRet.GetType() ) )
- {
- VirtualDevice aOut;
- GDIMetaFile aMtf;
- const Rectangle aBoundRect(sdr::legacy::GetBoundRect(rObj));
-
- aOut.EnableOutput(false);
- aOut.SetMapMode(rMap);
- aMtf.Record( &aOut );
- rObj.SingleObjectPainter(aOut); // #110094#-17
- aMtf.Stop();
- aMtf.WindStart();
-
- // #i99268# replace the original offset from using XOutDev's SetOffset
- // NOT (as tried with #i92760#) with another MapMode which gets recorded
- // by the Metafile itself (what always leads to problems), but by hardly
- // moving the result
- aMtf.Move(-aBoundRect.Left(), -aBoundRect.Top());
-
- aMtf.SetPrefMapMode(rMap);
- aMtf.SetPrefSize( aBoundRect.GetSize() );
-
- if( aMtf.GetActionCount() )
- {
- aRet = aMtf;
- }
- }
-
- return aRet;
-}
-
-// -----------------------------------------------------------------------------
-
void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const
{
if(areSdrObjectsSelected())
@@ -879,13 +879,9 @@ SdrModel* SdrExchangeView::GetMarkedObjM
{
// convert SdrPageObj's to a graphic representation, because
// virtual connection to referenced page gets lost in new model
- const MapMode aMap(getSdrModelFromSdrView().GetExchangeObjectUnit(), Point(),
- getSdrModelFromSdrView().GetExchangeObjectScale(),
- getSdrModelFromSdrView().GetExchangeObjectScale());
-
pNeuObj = new SdrGrafObj(
*pNeuMod,
- GetObjGraphic(aMap, *pObj),
+ GetObjGraphic(*pObj),
pObj->getSdrObjectTransformation());
}
else
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx Wed Apr 25 11:38:39 2012
@@ -2490,7 +2490,9 @@ SdrTableObj* SdrTableObj::CloneRange( co
}
pNewTableObj->ReformatText();
- sdr::legacy::SetLogicRect(*pNewTableObj, sdr::legacy::GetBoundRect(*pNewTableObj) );
+
+ // TTTT: Needed? Check...
+ sdr::legacy::SetLogicRange(*pNewTableObj, pNewTableObj->getObjectRange(0) );
return pNewTableObj;
}
Modified: incubator/ooo/branches/alg/aw080/main/sw/inc/dcontact.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/inc/dcontact.hxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/inc/dcontact.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/inc/dcontact.hxx Wed Apr 25 11:38:39 2012
@@ -268,22 +268,22 @@ public:
// drawing object to its referenced object.
class SwDrawVirtObj : public SdrObject
{
- private:
- // data for connection to writer layout
- // OD 2004-03-25 #i26791# - anchored drawing object instance for the
- // 'virtual' drawing object
- SwAnchoredDrawObject maAnchoredDrawObj;
-
- // writer-drawing contact object the 'virtual' drawing object is controlled by.
- // This object is also the <UserCall> of the drawing object, if it's
- // inserted into the drawing layer.
- SwDrawContact& mrDrawContact;
-
- protected:
- // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
- // not used but something own (top left of new SnapRect minus top left
- // of original SnapRect)
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+private:
+ // data for connection to writer layout
+ // OD 2004-03-25 #i26791# - anchored drawing object instance for the
+ // 'virtual' drawing object
+ SwAnchoredDrawObject maAnchoredDrawObj;
+
+ // writer-drawing contact object the 'virtual' drawing object is controlled by.
+ // This object is also the <UserCall> of the drawing object, if it's
+ // inserted into the drawing layer.
+ SwDrawContact& mrDrawContact;
+
+protected:
+ // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
+ // not used but something own (top left of new SnapRect minus top left
+ // of original SnapRect)
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
// original Notify from SdrVirtObj
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
@@ -292,7 +292,7 @@ class SwDrawVirtObj : public SdrObject
SdrObject& rRefObj;
Rectangle aSnapRect;
- virtual ~SwDrawVirtObj();
+ virtual ~SwDrawVirtObj();
/// method to copy all data from given source
virtual void copyDataFromSdrObject(const SdrObject& rSource);
@@ -305,29 +305,29 @@ public:
virtual bool IsClosedObj() const;
- // access to offset
- // OD 30.06.2003 #108784# - virtual!!!
+ // access to offset
+ // OD 30.06.2003 #108784# - virtual!!!
virtual const basegfx::B2DPoint GetOffset() const;
- // connection to writer layout
- // OD 2004-03-29 #i26791#
- const SwAnchoredObject* GetAnchoredObj() const;
- SwAnchoredObject* AnchoredObj();
- const SwFrm* GetAnchorFrm() const;
- SwFrm* AnchorFrm();
- void RemoveFromWriterLayout();
-
- // connection to drawing layer
- void AddToDrawingPage();
- void RemoveFromDrawingPage();
-
- // is 'virtual' drawing object connected to writer layout and
- // to drawing layer.
- bool IsConnected() const;
-
- // #108784#
- // All overloaded methods which need to use the offset
- virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
+ // connection to writer layout
+ // OD 2004-03-29 #i26791#
+ const SwAnchoredObject* GetAnchoredObj() const;
+ SwAnchoredObject* AnchoredObj();
+ const SwFrm* GetAnchorFrm() const;
+ SwFrm* AnchorFrm();
+ void RemoveFromWriterLayout();
+
+ // connection to drawing layer
+ void AddToDrawingPage();
+ void RemoveFromDrawingPage();
+
+ // is 'virtual' drawing object connected to writer layout and
+ // to drawing layer.
+ bool IsConnected() const;
+
+ // #108784#
+ // All overloaded methods which need to use the offset
+ virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
virtual void AddToHdlList(SdrHdlList& rHdlList) const;
virtual void GetPlusHdl(SdrHdlList& rHdlList, SdrObject& rSdrObject, const SdrHdl& rHdl, sal_uInt32 nPlNum) const;
virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const;
@@ -337,14 +337,14 @@ public:
// #108784#
virtual bool HasTextEdit() const;
- // OD 17.06.2003 #108784# - overload 'layer' methods
- virtual SdrLayerID GetLayer() const;
+ // OD 17.06.2003 #108784# - overload 'layer' methods
+ virtual SdrLayerID GetLayer() const;
//virtual void NbcSetLayer(SdrLayerID nLayer);
- virtual void SetLayer(SdrLayerID nLayer);
+ virtual void SetLayer(SdrLayerID nLayer);
- // FullDrag support
- virtual bool supportsFullDrag() const;
- virtual SdrObject* getFullDragClone() const;
+ // FullDrag support
+ virtual bool supportsFullDrag() const;
+ virtual SdrObject* getFullDragClone() const;
//////////////////////////////////////////////////////////////////////////
// methods which were missing from SdrVirtObj which do something
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dcontact.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dcontact.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dcontact.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dcontact.cxx Wed Apr 25 11:38:39 2012
@@ -2659,13 +2659,10 @@ bool SwDrawVirtObj::supportsFullDrag() c
SdrObject* SwDrawVirtObj::getFullDragClone() const
{
SdrObject& rReferencedObject = const_cast< SdrObject& >(GetReferencedObj());
- const MapMode aMap(getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(),
- getSdrModelFromSdrObject().GetExchangeObjectScale(),
- getSdrModelFromSdrObject().GetExchangeObjectScale());
- return new SdrGrafObj(
+ return new SdrGrafObj(
getSdrModelFromSdrObject(),
- SdrDragView::GetObjGraphic(aMap, rReferencedObject),
+ GetObjGraphic(rReferencedObject),
getSdrObjectTransformation());
}
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dflyobj.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dflyobj.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dflyobj.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/draw/dflyobj.cxx Wed Apr 25 11:38:39 2012
@@ -902,13 +902,10 @@ bool SwVirtFlyDrawObj::supportsFullDrag(
SdrObject* SwVirtFlyDrawObj::getFullDragClone() const
{
SdrObject& rReferencedObject = const_cast< SdrObject& >(GetReferencedObj());
- const MapMode aMap(getSdrModelFromSdrObject().GetExchangeObjectUnit(), Point(),
- getSdrModelFromSdrObject().GetExchangeObjectScale(),
- getSdrModelFromSdrObject().GetExchangeObjectScale());
return new SdrGrafObj(
getSdrModelFromSdrObject(),
- SdrDragView::GetObjGraphic(aMap, rReferencedObject),
+ GetObjGraphic(rReferencedObject),
getSdrObjectTransformation());
}
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx?rev=1330215&r1=1330214&r2=1330215&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx Wed Apr 25 11:38:39 2012
@@ -2666,18 +2666,7 @@ void SwEscherEx::WriteOCXControl( const
if (const SdrObject* pSdrObj = rFmt.FindRealSdrObject())
{
OpenContainer( ESCHER_SpContainer );
-
- SdrModel *pModel = rWrt.pDoc->GetDrawModel();
- OutputDevice *pDevice = Application::GetDefaultDevice();
- ASSERT(pModel && pDevice, "no model or device");
-
- // #i71538# use complete SdrViews
- // SdrExchangeView aExchange(pModel, pDevice);
- SdrView aExchange(*pModel, pDevice);
- const MapMode aMap(pModel->GetExchangeObjectUnit(), Point(),
- pModel->GetExchangeObjectScale(),
- pModel->GetExchangeObjectScale());
- Graphic aGraphic(aExchange.GetObjGraphic(aMap, *pSdrObj));
+ Graphic aGraphic(GetObjGraphic(*pSdrObj));
EscherPropertyContainer aPropOpt;
WriteOLEPicture(aPropOpt, 0xa00 | SHAPEFLAG_OLESHAPE, aGraphic,