summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdxcgv.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-01-31 09:42:50 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-01-31 09:30:16 +0000
commitf4804a8fb60cc999c9b08bf451732749b44eb355 (patch)
treee7c04a7f723af3fb946eaafdf038ab9a9b60ec1c /svx/source/svdraw/svdxcgv.cxx
parent75c0d7827625c683d52a9e2f3a7c514df890107b (diff)
Some simplification after 743dd1d3c1142c1c99b0844cc26dd0be91a1de40
MapMode ctor taking origin and scales sets mbSimple to false, so avoid calling it when these are the defaults. Some calculations become unneeded when the fraction is (1, 1). Change-Id: I19a98ad2cac0a66b9bd7b72620180addb3f7fec4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146375 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx/source/svdraw/svdxcgv.cxx')
-rw-r--r--svx/source/svdraw/svdxcgv.cxx18
1 files changed, 5 insertions, 13 deletions
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 4c425a627bc5..19b06a9d4ca0 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -163,8 +163,7 @@ bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList*
pObj->FitFrameToTextSize();
Size aSiz(pObj->GetLogicRect().GetSize());
MapUnit eMap = GetModel().GetScaleUnit();
- Fraction aMap(1,1);
- ImpPasteObject(pObj.get(),*pLst,aPos,aSiz,MapMode(eMap,Point(0,0),aMap,aMap),nOptions);
+ ImpPasteObject(pObj.get(), *pLst, aPos, aSiz, MapMode(eMap), nOptions);
return true;
}
@@ -203,8 +202,7 @@ bool SdrExchangeView::Paste(SvStream& rInput, EETextFormat eFormat, const Point&
pObj->FitFrameToTextSize();
Size aSiz(pObj->GetLogicRect().GetSize());
MapUnit eMap = GetModel().GetScaleUnit();
- Fraction aMap(1,1);
- ImpPasteObject(pObj.get(),*pLst,aPos,aSiz,MapMode(eMap,Point(0,0),aMap,aMap),nOptions);
+ ImpPasteObject(pObj.get(), *pLst, aPos, aSiz, MapMode(eMap), nOptions);
// b4967543
if(pObj->GetOutlinerParaObject())
@@ -401,11 +399,8 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po
MapUnit eSrcMU=rMap.GetMapUnit();
MapUnit eDstMU = GetModel().GetScaleUnit();
FrPair aMapFact(GetMapFactor(eSrcMU,eDstMU));
- Fraction aDstFr(1,1);
- nSizX *= double(aMapFact.X() * rMap.GetScaleX() * aDstFr);
- nSizX *= aDstFr.GetDenominator();
+ nSizX *= double(aMapFact.X() * rMap.GetScaleX());
nSizY *= double(aMapFact.Y() * rMap.GetScaleY());
- nSizY /= aDstFr.GetNumerator();
tools::Long xs=nSizX;
tools::Long ys=nSizY;
// set the pos to 0, 0 for online case
@@ -530,7 +525,7 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co
{
tools::Rectangle aBound( GetMarkedObjBoundRect() );
Size aBoundSize( aBound.GetWidth(), aBound.GetHeight() );
- MapMode aMap(GetModel().GetScaleUnit(), Point(), Fraction(1,1), Fraction(1,1));
+ MapMode aMap(GetModel().GetScaleUnit());
if( bNoVDevIfOneMtfMarked )
{
@@ -648,10 +643,7 @@ Graphic SdrExchangeView::GetObjGraphic(const SdrObject& rSdrObject)
ScopedVclPtrInstance< VirtualDevice > pOut;
GDIMetaFile aMtf;
const tools::Rectangle aBoundRect(rSdrObject.GetCurrentBoundRect());
- const MapMode aMap(rSdrObject.getSdrModelFromSdrObject().GetScaleUnit(),
- Point(),
- Fraction(1,1),
- Fraction(1,1));
+ const MapMode aMap(rSdrObject.getSdrModelFromSdrObject().GetScaleUnit());
pOut->EnableOutput(false);
pOut->SetMapMode(aMap);