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/26 09:57:43 UTC
svn commit: r1330691 - in /incubator/ooo/branches/alg/aw080/main:
editeng/inc/editeng/ sc/source/ui/unoobj/ sd/source/core/
sd/source/filter/eppt/ sd/source/ui/view/ svx/source/svdraw/
svx/source/unodraw/ sw/source/core/frmedt/ sw/source/filter/ww8/ sw...
Author: alg
Date: Thu Apr 26 07:57:42 2012
New Revision: 1330691
URL: http://svn.apache.org/viewvc?rev=1330691&view=rev
Log:
aw080: further adaptions to double precision
Modified:
incubator/ooo/branches/alg/aw080/main/editeng/inc/editeng/unoviwou.hxx
incubator/ooo/branches/alg/aw080/main/sc/source/ui/unoobj/shapeuno.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/core/CustomAnimationEffect.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/epptso.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview3.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview4.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/UnoGraphicExporter.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fefly1.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf2.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx
Modified: incubator/ooo/branches/alg/aw080/main/editeng/inc/editeng/unoviwou.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/editeng/inc/editeng/unoviwou.hxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/editeng/inc/editeng/unoviwou.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/editeng/inc/editeng/unoviwou.hxx Thu Apr 26 07:57:42 2012
@@ -49,6 +49,7 @@ public:
virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
+ // pure virtual methods from SvxEditViewForwarder
virtual sal_Bool GetSelection( ESelection& rSelection ) const;
virtual sal_Bool SetSelection( const ESelection& rSelection );
virtual sal_Bool Copy();
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/ui/unoobj/shapeuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/ui/unoobj/shapeuno.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/ui/unoobj/shapeuno.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/ui/unoobj/shapeuno.cxx Thu Apr 26 07:57:42 2012
@@ -1019,26 +1019,26 @@ uno::Reference<text::XTextRange> SAL_CAL
ScDrawLayer& rModel = static_cast< ScDrawLayer& >(pObj->getSdrModelFromSdrObject());
SdrPage* pPage = pObj->getSdrPageFromSdrObject();
ScDocument* pDoc = rModel.GetDocument();
- if ( pDoc )
- {
- SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
+
+ if ( pDoc )
+ {
+ SfxObjectShell* pObjSh = pDoc->GetDocumentShell();
ScDocShell* pDocSh = dynamic_cast< ScDocShell* >(pObjSh);
if ( pDocSh )
{
- SCTAB nTab = 0;
+ SCTAB nTab = 0;
if ( lcl_GetPageNum( pPage, rModel, nTab ) )
- {
+ {
Point aPos(sdr::legacy::GetBoundRect(*pObj).TopLeft());
- ScRange aRange(pDoc->GetRange( nTab, Rectangle( aPos, aPos ) ));
+ ScRange aRange(pDoc->GetRange( nTab, Rectangle( aPos, aPos ) ));
- // anchor is always the cell
-
- xRet.set(new ScCellObj( pDocSh, aRange.aStart ));
- }
+ // anchor is always the cell
+ xRet.set(new ScCellObj( pDocSh, aRange.aStart ));
}
}
}
+ }
return xRet;
}
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/core/CustomAnimationEffect.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/core/CustomAnimationEffect.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/core/CustomAnimationEffect.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/core/CustomAnimationEffect.cxx Thu Apr 26 07:57:42 2012
@@ -1727,24 +1727,24 @@ void CustomAnimationEffect::updateSdrPat
void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj )
{
- ::basegfx::B2DPolyPolygon xPolyPoly( rPathObj.getB2DPolyPolygonInObjectCoordinates() );
-
- SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() );
- if( pObj )
+ basegfx::B2DPolyPolygon aPolyPolygon(rPathObj.getB2DPolyPolygonInObjectCoordinates());
+ SdrObject* pObj = GetSdrObjectFromXShape(getTargetShape());
+
+ if(pObj)
{
- const Rectangle aBoundRect( sdr::legacy::GetBoundRect(*pObj) );
- const Point aCenter( aBoundRect.Center() );
+ const basegfx::B2DPoint aCenter(pObj->getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
- xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
+ aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.getX(), -aCenter.getY()));
SdrPage* pPage = pObj->getSdrPageFromSdrObject();
- if( pPage )
+
+ if( pPage )
{
- xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(1.0 / pPage->GetPageScale()));
+ aPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(1.0 / pPage->GetPageScale()));
}
}
- setPath( ::basegfx::tools::exportToSvgD( xPolyPoly ) );
+ setPath(::basegfx::tools::exportToSvgD(aPolyPolygon));
}
// ====================================================================
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/epptso.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/epptso.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/epptso.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/epptso.cxx Thu Apr 26 07:57:42 2012
@@ -4324,10 +4324,15 @@ void PPTWriter::ImplWritePage( const PHL
SdrObject* pObj = GetSdrObjectFromXShape( mXShape );
if ( pObj )
{
- Rectangle aBound = sdr::legacy::GetBoundRect(*pObj);
- maPosition = ImplMapPoint( ::com::sun::star::awt::Point( aBound.Left(), aBound.Top() ) );
- maSize = ImplMapSize( ::com::sun::star::awt::Size ( aBound.GetWidth(), aBound.GetHeight() ) );
- maRange = basegfx::B2DRange(maPosition.X, maPosition.Y, maPosition.X + maSize.Width, maPosition.Y + maSize.Height);
+ maRange = pObj->getObjectRange(0);
+ maPosition = ImplMapPoint(
+ ::com::sun::star::awt::Point(
+ basegfx::fround(maRange.getMinX()),
+ basegfx::fround(maRange.getMinY())));
+ maSize = ImplMapSize(
+ ::com::sun::star::awt::Size(
+ basegfx::fround(maRange.getWidth()),
+ basegfx::fround(maRange.getHeight())));
mnAngle = 0;
}
}
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview3.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview3.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview3.cxx Thu Apr 26 07:57:42 2012
@@ -700,7 +700,7 @@ bool View::InsertData( const Transferabl
{
if( bReturn )
{
- if( pModel->GetSdPage( 0, PK_STANDARD )->GetObjCount() == 1 )
+ if(1 == pModel->GetSdPage( 0, PK_STANDARD )->GetObjCount())
{
// only one object
SdrObject* pObj = pModel->GetSdPage( 0, PK_STANDARD )->GetObj( 0 );
@@ -711,26 +711,17 @@ bool View::InsertData( const Transferabl
{
// replace object
SdrPage& rWorkPage = GetSdrPageView()->getSdrPageFromSdrPageView();
- SdrObject* pNewObj = pObj->CloneSdrObject(&rWorkPage.getSdrModelFromSdrPage());
- Rectangle aPickObjRect( sdr::legacy::GetBoundRect(*pPickObj2) );
- Size aPickObjSize( aPickObjRect.GetSize() );
- Point aVec( aPickObjRect.TopLeft() );
- Rectangle aObjRect( sdr::legacy::GetBoundRect(*pNewObj) );
- Size aObjSize( aObjRect.GetSize() );
-
- Fraction aScaleWidth( aPickObjSize.Width(), aObjSize.Width() );
- Fraction aScaleHeight( aPickObjSize.Height(), aObjSize.Height() );
- sdr::legacy::ResizeSdrObject(*pNewObj, aObjRect.TopLeft(), aScaleWidth, aScaleHeight );
+ SdrObject* pNewObj = pObj->CloneSdrObject(&rWorkPage.getSdrModelFromSdrPage());
- aVec -= aObjRect.TopLeft();
- sdr::legacy::MoveSdrObject(*pNewObj, Size( aVec.X(), aVec.Y() ) );
+ // copy transformation and layer
+ pNewObj->setSdrObjectTransformation(pPickObj2->getSdrObjectTransformation());
+ pNewObj->SetLayer( pPickObj2->GetLayer() );
const bool bUndo = IsUndoEnabled();
if( bUndo )
BegUndo( String( SdResId(STR_UNDO_DRAGDROP ) ) );
- pNewObj->SetLayer( pPickObj->GetLayer() );
rWorkPage.InsertObjectToSdrObjList( pNewObj );
if( bUndo )
@@ -747,7 +738,7 @@ bool View::InsertData( const Transferabl
}
else
{
- deleteSdrObjectSafeAndClearPointer(pPickObj2 );
+ deleteSdrObjectSafeAndClearPointer(pPickObj2);
}
bChanged = true;
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview4.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview4.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview4.cxx Thu Apr 26 07:57:42 2012
@@ -243,31 +243,25 @@ SdrGrafObj* View::InsertGraphic( const G
if (pImageMap)
pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap));
- Rectangle aPickObjRect(sdr::legacy::GetBoundRect(*pPickObj));
- Size aPickObjSize(aPickObjRect.GetSize());
- Rectangle aObjRect(sdr::legacy::GetBoundRect(*pNewGrafObj));
- Size aObjSize(aObjRect.GetSize());
-
- Fraction aScaleWidth(aPickObjSize.Width(), aObjSize.Width());
- Fraction aScaleHeight(aPickObjSize.Height(), aObjSize.Height());
- sdr::legacy::ResizeSdrObject(*pNewGrafObj, aObjRect.TopLeft(), aScaleWidth, aScaleHeight);
-
- Point aVec = aPickObjRect.TopLeft() - aObjRect.TopLeft();
- sdr::legacy::MoveSdrObject(*pNewGrafObj, Size(aVec.X(), aVec.Y()));
+ // copy transformation and layer
+ pNewGrafObj->setSdrObjectTransformation(pPickObj->getSdrObjectTransformation());
+ pNewGrafObj->SetLayer(pPickObj->GetLayer());
const bool bUndo = IsUndoEnabled();
if( bUndo )
BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
- pNewGrafObj->SetLayer(pPickObj->GetLayer());
+
SdrPage& rP = pPV->getSdrPageFromSdrPageView();
rP.InsertObjectToSdrObjList(pNewGrafObj);
- if( bUndo )
+
+ if( bUndo )
{
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoNewObject(*pNewGrafObj));
AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pPickObj));
}
- rP.RemoveObjectFromSdrObjList(pPickObj->GetNavigationPosition());
+
+ rP.RemoveObjectFromSdrObjList(pPickObj->GetNavigationPosition());
if( bUndo )
{
@@ -277,7 +271,8 @@ SdrGrafObj* View::InsertGraphic( const G
{
deleteSdrObjectSafeAndClearPointer(pPickObj);
}
- mnAction = DND_ACTION_COPY;
+
+ mnAction = DND_ACTION_COPY;
}
else
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx Thu Apr 26 07:57:42 2012
@@ -37,9 +37,16 @@ namespace sdr
{
const basegfx::B2DRange& rRange = rObject.getObjectRange(pSdrView);
- return Rectangle(
+ if(rRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
(sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()),
(sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY()));
+ }
}
basegfx::B2DRange GetAllObjBoundRange(const SdrObjectVector& rObjVec, const SdrView* pSdrView)
@@ -60,9 +67,16 @@ namespace sdr
{
const basegfx::B2DRange aBoundRange(GetAllObjBoundRange(rObjVec, pSdrView));
- return Rectangle(
- (sal_Int32)floor(aBoundRange.getMinX()), (sal_Int32)floor(aBoundRange.getMinY()),
+ if(aBoundRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aBoundRange.getMinX()), (sal_Int32)floor(aBoundRange.getMinY()),
(sal_Int32)ceil(aBoundRange.getMaxX()), (sal_Int32)ceil(aBoundRange.getMaxY()));
+ }
}
basegfx::B2DRange GetSnapRange(const SdrObject& rObject)
@@ -75,9 +89,16 @@ namespace sdr
{
const basegfx::B2DRange aSnapRange(GetSnapRange(rObject));
- return Rectangle(
- (sal_Int32)floor(aSnapRange.getMinX()), (sal_Int32)floor(aSnapRange.getMinY()),
- (sal_Int32)ceil(aSnapRange.getMaxX()), (sal_Int32)ceil(aSnapRange.getMaxY()));
+ if(aSnapRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aSnapRange.getMinX()), (sal_Int32)floor(aSnapRange.getMinY()),
+ (sal_Int32)ceil(aSnapRange.getMaxX()), (sal_Int32)ceil(aSnapRange.getMaxY()));
+ }
}
void SetSnapRange(SdrObject& rObject, const basegfx::B2DRange& rRange)
@@ -164,9 +185,16 @@ namespace sdr
{
const basegfx::B2DRange aSnapRange(GetAllObjSnapRange(rObjVec));
- return Rectangle(
+ if(aSnapRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
(sal_Int32)floor(aSnapRange.getMinX()), (sal_Int32)floor(aSnapRange.getMinY()),
(sal_Int32)ceil(aSnapRange.getMaxX()), (sal_Int32)ceil(aSnapRange.getMaxY()));
+ }
}
basegfx::B2DRange GetLogicRange(const SdrObject& rObject)
@@ -189,20 +217,18 @@ namespace sdr
Rectangle GetLogicRect(const SdrObject& rObject)
{
- const basegfx::B2DHomMatrix& rObjectMatrix(rObject.getSdrObjectTransformation());
-
- if(rObjectMatrix.isIdentity())
- {
- return Rectangle();
- }
- else
- {
- const basegfx::B2DRange aLogicRange(GetLogicRange(rObject));
+ const basegfx::B2DRange aLogicRange(GetLogicRange(rObject));
- return Rectangle(
- (sal_Int32)floor(aLogicRange.getMinX()), (sal_Int32)floor(aLogicRange.getMinY()),
- (sal_Int32)ceil(aLogicRange.getMaxX()), (sal_Int32)ceil(aLogicRange.getMaxY()));
- }
+ if(aLogicRange.isEmpty())
+ {
+ return Rectangle();
+ }
+ else
+ {
+ return Rectangle(
+ (sal_Int32)floor(aLogicRange.getMinX()), (sal_Int32)floor(aLogicRange.getMinY()),
+ (sal_Int32)ceil(aLogicRange.getMaxX()), (sal_Int32)ceil(aLogicRange.getMaxY()));
+ }
}
void SetLogicRange(SdrObject& rObject, const basegfx::B2DRange& rRange)
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/UnoGraphicExporter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/UnoGraphicExporter.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/UnoGraphicExporter.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/UnoGraphicExporter.cxx Thu Apr 26 07:57:42 2012
@@ -218,7 +218,7 @@ namespace svx
/** creates a bitmap that is optionaly transparent from a metafile
*/
- BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, sal_Bool bTransparent, const Size* pSize )
+ BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, bool bTransparent, const Size aSize)
{
Graphic aGraphic( rMtf );
BitmapEx aBmpEx;
@@ -227,7 +227,7 @@ namespace svx
// rasterconverted to a bitmap
const SvtOptionsDrawinglayer aDrawinglayerOpt;
const GraphicConversionParameters aParameters(
- pSize ? *pSize : Size(0, 0),
+ aSize,
true, // allow unlimited size
aDrawinglayerOpt.IsAntiAliasing(),
aDrawinglayerOpt.IsSnapHorVerLinesToDiscrete());
@@ -251,11 +251,8 @@ namespace svx
return aBmpEx;
}
- Size* CalcSize( sal_Int32 nWidth, sal_Int32 nHeight, const Size& aBoundSize, Size& aOutSize )
+ Size CalcSize( sal_Int32 nWidth, sal_Int32 nHeight, const Size& aBoundSize)
{
- if( (nWidth == 0) && (nHeight == 0) )
- return NULL;
-
if( (nWidth == 0) && (nHeight != 0) && (aBoundSize.Height() != 0) )
{
nWidth = ( nHeight * aBoundSize.Width() ) / aBoundSize.Height();
@@ -265,10 +262,7 @@ namespace svx
nHeight = ( nWidth * aBoundSize.Height() ) / aBoundSize.Width();
}
- aOutSize.Width() = nWidth;
- aOutSize.Height() = nHeight;
-
- return &aOutSize;
+ return Size(nWidth, nHeight);
}
}
@@ -791,8 +785,10 @@ bool GraphicExporter::GetGraphic( Export
if( rSettings.mbTranslucent )
{
- Size aOutSize;
- aGraphic = GetBitmapFromMetaFile( aGraphic.GetGDIMetaFile(), sal_True, CalcSize( rSettings.mnWidth, rSettings.mnHeight, aNewSize, aOutSize ) );
+ aGraphic = GetBitmapFromMetaFile(
+ aGraphic.GetGDIMetaFile(),
+ true,
+ CalcSize(rSettings.mnWidth, rSettings.mnHeight, aNewSize));
}
}
}
@@ -922,41 +918,31 @@ bool GraphicExporter::GetGraphic( Export
if( !bSingleGraphic )
{
// create a metafile for all shapes
- VirtualDevice aOut;
+ VirtualDevice aOut;
+ GDIMetaFile aMtf;
+ MapMode aOutMap(aMap);
+ const basegfx::B2DRange aRange(sdr::legacy::GetAllObjBoundRange(aShapes));
+ const Size aBoundSize(basegfx::fround(aRange.getWidth()), basegfx::fround(aRange.getHeight()));
+ sdr::contact::DisplayInfo aDisplayInfo;
- // calculate bound rect for all shapes
- Rectangle aBound;
+ aOut.EnableOutput( sal_False );
+ aOut.SetMapMode( aMap );
+ if(rSettings.mbUseHighContrast)
{
- SdrObjectVector::iterator aIter = aShapes.begin();
- const SdrObjectVector::const_iterator aEnd = aShapes.end();
-
- while( aIter != aEnd )
- {
- const SdrObject* pObj = (*aIter++);
- Rectangle aR1(sdr::legacy::GetBoundRect(*pObj));
- if (aBound.IsEmpty())
- aBound=aR1;
- else
- aBound.Union(aR1);
- }
+ aOut.SetDrawMode(
+ aVDev.GetDrawMode() |
+ DRAWMODE_SETTINGSLINE |
+ DRAWMODE_SETTINGSFILL |
+ DRAWMODE_SETTINGSTEXT |
+ DRAWMODE_SETTINGSGRADIENT);
}
- aOut.EnableOutput( sal_False );
- aOut.SetMapMode( aMap );
- if( rSettings.mbUseHighContrast )
- aOut.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
-
- GDIMetaFile aMtf;
aMtf.Clear();
aMtf.Record( &aOut );
-
- MapMode aOutMap( aMap );
- aOutMap.SetOrigin( Point( -aBound.TopLeft().X(), -aBound.TopLeft().Y() ) );
+ aOutMap.SetOrigin(Point(-basegfx::fround(aRange.getMinX()), -basegfx::fround(aRange.getMinY())));
aOut.SetRelativeMapMode( aOutMap );
- sdr::contact::DisplayInfo aDisplayInfo;
-
if(mpCurrentPage)
{
if(mpCurrentPage->TRG_HasMasterPage() && pPage->IsMasterPage())
@@ -969,29 +955,25 @@ bool GraphicExporter::GetGraphic( Export
if(!aShapes.empty())
{
- // more effective way to paint a vector of SdrObjects. Hand over the processed page
- // to have it in the
+ // more effective way to paint a vector of SdrObjects
sdr::contact::ObjectContactOfObjListPainter aMultiObjectPainter(aOut, aShapes, mpCurrentPage);
ImplExportCheckVisisbilityRedirector aCheckVisibilityRedirector(mpCurrentPage);
- aMultiObjectPainter.SetViewObjectContactRedirector(&aCheckVisibilityRedirector);
+ aMultiObjectPainter.SetViewObjectContactRedirector(&aCheckVisibilityRedirector);
aMultiObjectPainter.ProcessDisplay(aDisplayInfo);
}
aMtf.Stop();
aMtf.WindStart();
-
- const Size aExtSize( aOut.PixelToLogic( Size( 0, 0 ) ) );
- Size aBoundSize( aBound.GetWidth() + ( aExtSize.Width() ),
- aBound.GetHeight() + ( aExtSize.Height() ) );
-
- aMtf.SetPrefMapMode( aMap );
- aMtf.SetPrefSize( aBoundSize );
+ aMtf.SetPrefMapMode(aMap);
+ aMtf.SetPrefSize(aBoundSize);
if( !bVectorType )
{
- Size aOutSize;
- aGraphic = GetBitmapFromMetaFile( aMtf, rSettings.mbTranslucent, CalcSize( rSettings.mnWidth, rSettings.mnHeight, aBoundSize, aOutSize ) );
+ aGraphic = GetBitmapFromMetaFile(
+ aMtf,
+ rSettings.mbTranslucent,
+ CalcSize(rSettings.mnWidth, rSettings.mnHeight, aBoundSize));
}
else
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx Thu Apr 26 07:57:42 2012
@@ -838,12 +838,9 @@ uno::Any SvxShape::GetBitmap( sal_Bool b
SdrObject *pTempObj = mpObj.get();
pView->MarkObj(*pTempObj);
- Rectangle aRect(sdr::legacy::GetBoundRect(*pTempObj));
- aRect.Justify();
- Size aSize(aRect.GetSize());
-
GDIMetaFile aMtf( pView->GetMarkedObjMetaFile() );
- if( bMetaFile )
+
+ if( bMetaFile )
{
SvMemoryStream aDestStrm( 65535, 65535 );
ConvertGDIMetaFileToWMF( aMtf, aDestStrm, NULL, sal_False );
@@ -854,8 +851,10 @@ uno::Any SvxShape::GetBitmap( sal_Bool b
}
else
{
+ const basegfx::B2DVector aObjectScale(basegfx::absolute(pTempObj->getSdrObjectScale()));
Graphic aGraph(aMtf);
- aGraph.SetPrefSize(aSize);
+
+ aGraph.SetPrefSize(Size(basegfx::fround(aObjectScale.getX()), basegfx::fround(aObjectScale.getY())));
aGraph.SetPrefMapMode(MAP_100TH_MM);
Reference< awt::XBitmap > xBmp( aGraph.GetXGraphic(), UNO_QUERY );
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx Thu Apr 26 07:57:42 2012
@@ -778,10 +778,12 @@ SvxDrawOutlinerViewForwarder* SvxTextEdi
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mpObject );
if( pTextObj )
{
- Rectangle aBoundRect( sdr::legacy::GetBoundRect(*pTextObj) );
+ const basegfx::B2DRange aRange(pTextObj->getObjectRange(mpView));
OutlinerView& rOutlView = *mpView->GetTextEditOutlinerView();
- return new SvxDrawOutlinerViewForwarder( rOutlView, aBoundRect.TopLeft() );
+ return new SvxDrawOutlinerViewForwarder(
+ rOutlView,
+ Point(basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY())));
}
}
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fecopy.cxx Thu Apr 26 07:57:42 2012
@@ -1424,24 +1424,22 @@ void SwFEShell::Paste( SvStream& rStrm,
}
SdrObject* pNewObj = pClpObj->CloneSdrObject(&pView->getSdrModelFromSdrView());
- Rectangle aOldObjRect( sdr::legacy::GetBoundRect(*pOldObj) );
- Size aOldObjSize( aOldObjRect.GetSize() );
- Rectangle aNewRect( sdr::legacy::GetBoundRect(*pNewObj) );
- Size aNewSize( aNewRect.GetSize() );
-
- Fraction aScaleWidth( aOldObjSize.Width(), aNewSize.Width() );
- Fraction aScaleHeight( aOldObjSize.Height(), aNewSize.Height());
- sdr::legacy::ResizeSdrObject(*pNewObj, aNewRect.TopLeft(), aScaleWidth, aScaleHeight);
- Point aVec = aOldObjRect.TopLeft() - aNewRect.TopLeft();
- sdr::legacy::transformSdrObject(*pNewObj, basegfx::tools::createTranslateB2DHomMatrix(aVec.X(), aVec.Y()));
+ // copy transformation
+ pNewObj->setSdrObjectTransformation(pOldObj->getSdrObjectTransformation());
if( dynamic_cast< SdrUnoObj* >(pNewObj) )
+ {
pNewObj->SetLayer( GetDoc()->GetControlsId() );
+ }
else if( dynamic_cast< SdrUnoObj* >(pOldObj) )
+ {
pNewObj->SetLayer( GetDoc()->GetHeavenId() );
+ }
else
+ {
pNewObj->SetLayer( pOldObj->GetLayer() );
+ }
if( dynamic_cast< SwVirtFlyDrawObj* >(pOldObj) )
{
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fefly1.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fefly1.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fefly1.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/core/frmedt/fefly1.cxx Thu Apr 26 07:57:42 2012
@@ -356,7 +356,8 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
return ((SwFlyFrm*)pFly)->GetFmt();
}
- Point aTmpPos = sdr::legacy::GetBoundRect(*pObj).TopLeft();
+ const basegfx::B2DPoint aTopLeft(pObj->getObjectRange(Imp()->GetDrawView()).getMinimum());
+ Point aTmpPos(basegfx::fround(aTopLeft.getX()), basegfx::fround(aTopLeft.getY()));
SwFrm *pTxtFrm;
{
@@ -1768,7 +1769,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj
SdrObject* pObj;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
- sal_uInt16 nOld = pDView->GetHitTolerancePixel();
+ const sal_uInt16 nOld(pDView->GetHitTolerancePixel());
// Tattergrenze fuer Drawing-SS
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
@@ -1776,11 +1777,18 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj
{
// dann teste mal was es ist:
if ( dynamic_cast< SwVirtFlyDrawObj* >(pObj) )
+ {
pRet = ((SwVirtFlyDrawObj*)pObj)->GetFmt();
+ }
else if ( findConnectionToSdrObjectDirect(pObj) ) //nicht fuer Gruppenobjekte
+ {
pRet = ((SwDrawContact*)findConnectionToSdrObjectDirect(pObj))->GetFmt();
- if(pRet && pRectToFill)
+ }
+
+ if(pRet && pRectToFill)
+ {
**pRectToFill = sdr::legacy::GetBoundRect(*pObj);
+ }
}
pDView->SetHitTolerancePixel( nOld );
}
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf.cxx Thu Apr 26 07:57:42 2012
@@ -1113,8 +1113,8 @@ SwFrmFmt* SwWW8ImplReader::InsertTxbxTex
GrafikCtor();
- //pNew->SetModel( pDrawModel );
- sdr::legacy::SetLogicRect(*pNew, sdr::legacy::GetBoundRect(*pTextObj) );
+ // copy transformation and layer
+ pNew->setSdrObjectTransformation(pTextObj->getSdrObjectTransformation());
pNew->SetLayer( pTextObj->GetLayer() );
pTextObj->GetParentSdrObject()->getChildrenOfSdrObject()->ReplaceObjectInSdrObjList(
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf2.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/ww8graf2.cxx Thu Apr 26 07:57:42 2012
@@ -365,7 +365,8 @@ void SwWW8ImplReader::ReplaceObj(const S
{
SdrObjList* pObjectList = pGroupObject->getChildrenOfSdrObject();
- sdr::legacy::SetLogicRect(rSubObj, sdr::legacy::GetBoundRect(rReplaceObj));
+ // copy transformation and layer
+ rSubObj->setSdrObjectTransformation(rReplaceObj->getSdrObjectTransformation());
rSubObj.SetLayer(rReplaceObj.GetLayer());
// altes Objekt raus aus Gruppen-Liste und neues rein
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx?rev=1330691&r1=1330690&r2=1330691&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx Thu Apr 26 07:57:42 2012
@@ -152,18 +152,24 @@ void SwView::ExecDraw(SfxRequest& rReq)
{
Size aDocSize(pWrtShell->GetDocSize());
const SwRect& rVisArea = pWrtShell->VisArea();
- Point aStartPos = rVisArea.Center();
+ Point aStartPos(rVisArea.Center());
+
if(rVisArea.Width() > aDocSize.Width())
+ {
aStartPos.X() = aDocSize.Width() / 2 + rVisArea.Left();
+ }
+
if(rVisArea.Height() > aDocSize.Height())
+ {
aStartPos.Y() = aDocSize.Height() / 2 + rVisArea.Top();
+ }
//determine the size of the object
if(pObj->getChildrenOfSdrObject())
{
- const Rectangle& rBoundRect = sdr::legacy::GetBoundRect(*((SdrObjGroup*)pObj));
- aStartPos.X() -= rBoundRect.GetWidth()/2;
- aStartPos.Y() -= rBoundRect.GetHeight()/2;
+ const basegfx::B2DRange aRange(pObj->getObjectRange(pSdrView));
+ aStartPos.X() -= basegfx::fround(aRange.getWidth() * 0.5);
+ aStartPos.Y() -= basegfx::fround(aRange.getHeight() * 0.5);
}
// TODO: unmark all other