Generalize basegfx::fround for templated return type

And use it when assigning to tools::Long

Change-Id: I0814d7bac9cdd48191ba69c64e3b12a4973b3417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166071
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2024-04-14 12:50:42 +05:00
parent 1dc92b9e99
commit 690526f95e
64 changed files with 297 additions and 271 deletions

View File

@ -1011,33 +1011,33 @@ namespace basegfx
if(maControlPointA == maStartPoint)
{
maControlPointA = maStartPoint = basegfx::B2DPoint(
basegfx::fround(maStartPoint.getX()),
basegfx::fround(maStartPoint.getY()));
std::round(maStartPoint.getX()),
std::round(maStartPoint.getY()));
}
else
{
maStartPoint = basegfx::B2DPoint(
basegfx::fround(maStartPoint.getX()),
basegfx::fround(maStartPoint.getY()));
std::round(maStartPoint.getX()),
std::round(maStartPoint.getY()));
maControlPointA = basegfx::B2DPoint(
basegfx::fround(maControlPointA.getX()),
basegfx::fround(maControlPointA.getY()));
std::round(maControlPointA.getX()),
std::round(maControlPointA.getY()));
}
if(maControlPointB == maEndPoint)
{
maControlPointB = maEndPoint = basegfx::B2DPoint(
basegfx::fround(maEndPoint.getX()),
basegfx::fround(maEndPoint.getY()));
std::round(maEndPoint.getX()),
std::round(maEndPoint.getY()));
}
else
{
maEndPoint = basegfx::B2DPoint(
basegfx::fround(maEndPoint.getX()),
basegfx::fround(maEndPoint.getY()));
std::round(maEndPoint.getX()),
std::round(maEndPoint.getY()));
maControlPointB = basegfx::B2DPoint(
basegfx::fround(maControlPointB.getX()),
basegfx::fround(maControlPointB.getY()));
std::round(maControlPointB.getX()),
std::round(maControlPointB.getY()));
}
}
} // end of namespace basegfx

View File

@ -112,7 +112,7 @@ namespace dxcanvas
vcl::Font aFont(
rFontRequest.FontDescription.FamilyName,
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
Size( 0, ::basegfx::fround<::tools::Long>(rFontRequest.CellSize)));
aFont.SetAlignment( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
@ -256,7 +256,7 @@ namespace dxcanvas
vcl::Font aFont(
rFontRequest.FontDescription.FamilyName,
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
Size( 0, ::basegfx::fround<::tools::Long>(rFontRequest.CellSize)));
aFont.SetAlignment( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );

View File

@ -690,7 +690,7 @@ namespace oglcanvas
vcl::Font aFont(
rFontRequest.FontDescription.FamilyName,
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
Size( 0, ::basegfx::fround<tools::Long>(rFontRequest.CellSize)));
aFont.SetAlignment( ALIGN_BASELINE );
aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );

View File

@ -117,8 +117,7 @@ namespace canvas
basegfx::B2DHomMatrix aTransform(basegfx::utils::createTranslateB2DHomMatrix(
maSourceOffset.getX(), maSourceOffset.getY()));
aTransform = aTransform * rTransform;
aTransform.translate(::basegfx::fround(rPos.getX()),
::basegfx::fround(rPos.getY()));
aTransform.translate(rPos);
/*
######################################
@ -237,8 +236,7 @@ namespace canvas
// 3) translation to output position [rPos]
basegfx::B2DHomMatrix aTransform(basegfx::utils::createTranslateB2DHomMatrix(aPos1.getX(), aPos1.getY()));
aTransform = aTransform * rTransform;
aTransform.translate(::basegfx::fround(rPos.getX()),
::basegfx::fround(rPos.getY()));
aTransform.translate(rPos);
/*
@ -333,8 +331,7 @@ namespace canvas
// be calculated from the result, and this is why we need to use
// integer coordinates here...
basegfx::B2DHomMatrix aTransform = rTransform;
aTransform.translate(::basegfx::fround(rPos.getX()),
::basegfx::fround(rPos.getY()));
aTransform.translate(rPos);
/*
######################################

View File

@ -43,7 +43,7 @@ namespace vclcanvas
const OutDevProviderSharedPtr& rOutDevProvider ) :
maFont( vcl::Font( rFontRequest.FontDescription.FamilyName,
rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize) ) ) ),
Size( 0, ::basegfx::fround<::tools::Long>(rFontRequest.CellSize) ) ) ),
maFontRequest( rFontRequest ),
mpRefDevice( &rDevice ),
mpOutDevProvider( rOutDevProvider ),

View File

@ -842,8 +842,8 @@ namespace vclcanvas
// output GraphicObject
const ::Point aPt( vcl::unotools::pointFromB2DPoint( aOutputPos ) );
const ::Size aSz( ::basegfx::fround( aScale.getX() * aBmpSize.Width() ),
::basegfx::fround( aScale.getY() * aBmpSize.Height() ) );
const ::Size aSz( ::basegfx::fround<::tools::Long>( aScale.getX() * aBmpSize.Width() ),
::basegfx::fround<::tools::Long>( aScale.getY() * aBmpSize.Height() ) );
pGrfObj->Draw(mpOutDevProvider->getOutDev(),
aPt,

View File

@ -211,12 +211,12 @@ namespace vclcanvas
// loop below, we set the _right_ edge here, which will be
// readily copied into the left edge in the loop below
const ::basegfx::B2DPoint& rPoint1( aLeftTop - 2.0*nDiagonalLength*aDirection );
aTempPoly[1] = ::Point( ::basegfx::fround( rPoint1.getX() ),
::basegfx::fround( rPoint1.getY() ) );
aTempPoly[1] = ::Point( ::basegfx::fround<::tools::Long>( rPoint1.getX() ),
::basegfx::fround<::tools::Long>( rPoint1.getY() ) );
const ::basegfx::B2DPoint& rPoint2( aLeftBottom - 2.0*nDiagonalLength*aDirection );
aTempPoly[2] = ::Point( ::basegfx::fround( rPoint2.getX() ),
::basegfx::fround( rPoint2.getY() ) );
aTempPoly[2] = ::Point( ::basegfx::fround<::tools::Long>( rPoint2.getX() ),
::basegfx::fround<::tools::Long>( rPoint2.getY() ) );
// iteratively render all other strips
@ -258,14 +258,14 @@ namespace vclcanvas
const ::basegfx::B2DPoint& rPoint3(
(nStepCount - i-1)/double(nStepCount)*aLeftTop +
(i+1)/double(nStepCount)*aRightTop );
aTempPoly[1] = ::Point( ::basegfx::fround( rPoint3.getX() ),
::basegfx::fround( rPoint3.getY() ) );
aTempPoly[1] = ::Point( ::basegfx::fround<::tools::Long>( rPoint3.getX() ),
::basegfx::fround<::tools::Long>( rPoint3.getY() ) );
const ::basegfx::B2DPoint& rPoint4(
(nStepCount - i-1)/double(nStepCount)*aLeftBottom +
(i+1)/double(nStepCount)*aRightBottom );
aTempPoly[2] = ::Point( ::basegfx::fround( rPoint4.getX() ),
::basegfx::fround( rPoint4.getY() ) );
aTempPoly[2] = ::Point( ::basegfx::fround<::tools::Long>( rPoint4.getX() ),
::basegfx::fround<::tools::Long>( rPoint4.getY() ) );
rOutDev.DrawPolygon( aTempPoly );
}
@ -283,12 +283,12 @@ namespace vclcanvas
// gradient rect two times the bound rect's diagonal to
// the 'right'.
const ::basegfx::B2DPoint& rPoint3( aRightTop + 2.0*nDiagonalLength*aDirection );
aTempPoly[0] = aTempPoly[4] = ::Point( ::basegfx::fround( rPoint3.getX() ),
::basegfx::fround( rPoint3.getY() ) );
aTempPoly[0] = aTempPoly[4] = ::Point( ::basegfx::fround<::tools::Long>( rPoint3.getX() ),
::basegfx::fround<::tools::Long>( rPoint3.getY() ) );
const ::basegfx::B2DPoint& rPoint4( aRightBottom + 2.0*nDiagonalLength*aDirection );
aTempPoly[3] = ::Point( ::basegfx::fround( rPoint4.getX() ),
::basegfx::fround( rPoint4.getY() ) );
aTempPoly[3] = ::Point( ::basegfx::fround<::tools::Long>( rPoint4.getX() ),
::basegfx::fround<::tools::Long>( rPoint4.getY() ) );
rOutDev.SetFillColor( rColors.back() );
@ -418,8 +418,8 @@ namespace vclcanvas
const ::basegfx::B2DPoint& rInnerPoint( aInnerPoly.getB2DPoint(p) );
aTempPoly[static_cast<sal_uInt16>(p)] = ::Point(
basegfx::fround( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
basegfx::fround( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
basegfx::fround<::tools::Long>( fT*rInnerPoint.getX() + (1-fT)*rOuterPoint.getX() ),
basegfx::fround<::tools::Long>( fT*rInnerPoint.getY() + (1-fT)*rOuterPoint.getY() ) );
}
// close polygon explicitly
@ -898,15 +898,15 @@ namespace vclcanvas
const ::Point aPtRepeat( vcl::unotools::pointFromB2DPoint(
aSingleDeviceTextureRect.getMinimum() ) );
const ::Size aSz( ::basegfx::fround( aScale.getX() * aBmpSize.Width ),
::basegfx::fround( aScale.getY() * aBmpSize.Height ) );
const ::Size aSz( ::basegfx::fround<::tools::Long>( aScale.getX() * aBmpSize.Width ),
::basegfx::fround<::tools::Long>( aScale.getY() * aBmpSize.Height ) );
const ::Size aIntegerNextTileX( vcl::unotools::sizeFromB2DSize(aNextTileX) );
const ::Size aIntegerNextTileY( vcl::unotools::sizeFromB2DSize(aNextTileY) );
const ::Point aPt( textures[0].RepeatModeX == rendering::TexturingMode::NONE ?
::basegfx::fround( aOutputPos.getX() ) : aPtRepeat.X(),
::basegfx::fround<::tools::Long>( aOutputPos.getX() ) : aPtRepeat.X(),
textures[0].RepeatModeY == rendering::TexturingMode::NONE ?
::basegfx::fround( aOutputPos.getY() ) : aPtRepeat.Y() );
::basegfx::fround<::tools::Long>( aOutputPos.getY() ) : aPtRepeat.Y() );
const sal_Int32 nTilesX( textures[0].RepeatModeX == rendering::TexturingMode::NONE ?
1 : nX2 - nX1 );
const sal_Int32 nTilesY( textures[0].RepeatModeX == rendering::TexturingMode::NONE ?

View File

@ -123,14 +123,14 @@ namespace vclcanvas::tools
if( !::rtl::math::approxEqual(aScale.getY(), 1.0) )
{
const sal_Int32 nFontHeight( io_rVCLFont.GetFontHeight() );
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
io_rVCLFont.SetFontHeight( ::basegfx::fround<::tools::Long>(nFontHeight * aScale.getY()) );
}
io_rVCLFont.SetOrientation( Degree10( ::basegfx::fround(-basegfx::rad2deg<10>(fmod(nRotate, 2*M_PI))) ) );
// TODO(F2): Missing functionality in VCL: shearing
o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) );
o_rPoint.setY( ::basegfx::fround(aTranslate.getY()) );
o_rPoint.setX( ::basegfx::fround<::tools::Long>(aTranslate.getX()) );
o_rPoint.setY( ::basegfx::fround<::tools::Long>(aTranslate.getY()) );
return true;
}
@ -154,7 +154,7 @@ namespace vclcanvas::tools
if (!::basegfx::fTools::equalZero(fDividend))
fStretch /= fDividend;
const ::tools::Long nNewWidth = ::basegfx::fround(aSize.Width() * fStretch);
const ::tools::Long nNewWidth = ::basegfx::fround<::tools::Long>(aSize.Width() * fStretch);
rFont.SetAverageFontWidth(nNewWidth);

View File

@ -598,7 +598,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList )
for( sal_uInt32 nM = 0; nM < aPolygon.count(); nM++)
{
const ::basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(nM));
rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())), SdrHdlKind::Poly));
rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround<tools::Long>(aPoint.getX()), basegfx::fround<tools::Long>(aPoint.getY())), SdrHdlKind::Poly));
}
}
return true;

View File

@ -246,8 +246,8 @@ namespace cppcanvas::internal
}
// output size of metafile
::Size aOutputSizePixel( ::basegfx::fround( aScale.getX() * maDstSize.getWidth() ),
::basegfx::fround( aScale.getY() * maDstSize.getHeight() ) );
::Size aOutputSizePixel( ::basegfx::fround<::tools::Long>( aScale.getX() * maDstSize.getWidth() ),
::basegfx::fround<::tools::Long>( aScale.getY() * maDstSize.getHeight() ) );
sal_Int32 nBitmapExtra;
if ( bHasTextActions )

View File

@ -1140,8 +1140,8 @@ DeactivateRC SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
GetTopLeftPosition(fX, fY, maRange);
const ::tools::Rectangle aOutRectangle(
basegfx::fround(fX), basegfx::fround(fY),
basegfx::fround(fX + maRange.getWidth()), basegfx::fround(fY + maRange.getHeight()));
basegfx::fround<tools::Long>(fX), basegfx::fround<tools::Long>(fY),
basegfx::fround<tools::Long>(fX + maRange.getWidth()), basegfx::fround<tools::Long>(fY + maRange.getHeight()));
_pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle));
_pSet->Put(SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_POS,
m_xTsbPosProtect->get_state() == TRISTATE_TRUE ));

View File

@ -154,7 +154,7 @@ namespace drawinglayer::unorenderer
if(!aBitmapEx.IsEmpty())
{
aBitmapEx.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
aBitmapEx.SetPrefSize(Size(basegfx::fround(fWidth), basegfx::fround(fHeight)));
aBitmapEx.SetPrefSize(Size(basegfx::fround<tools::Long>(fWidth), basegfx::fround<tools::Long>(fHeight)));
XBitmap = vcl::unotools::xBitmapFromBitmapEx(aBitmapEx);
}
}

View File

@ -55,7 +55,8 @@ void takeCareOfOffsetXY(
{
const Size& rSize(rTarget.GetSizePixel());
const tools::Long w(rSize.Width());
const tools::Long a(basegfx::fround(w * (1.0 - rFillGraphicAttribute.getOffsetX())));
const tools::Long a(
basegfx::fround<tools::Long>(w * (1.0 - rFillGraphicAttribute.getOffsetX())));
if (0 != a && w != a)
{
@ -98,7 +99,8 @@ void takeCareOfOffsetXY(
{
const Size& rSize(rTarget.GetSizePixel());
const tools::Long h(rSize.Height());
const tools::Long a(basegfx::fround(h * (1.0 - rFillGraphicAttribute.getOffsetY())));
const tools::Long a(
basegfx::fround<tools::Long>(h * (1.0 - rFillGraphicAttribute.getOffsetY())));
if (0 != a && h != a)
{

View File

@ -50,8 +50,10 @@ bool renderWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWron
* basegfx::B2DPoint(rWrongSpellCandidate.getStart(), 0.0));
const basegfx::B2DPoint aStop(aLocalTransform
* basegfx::B2DPoint(rWrongSpellCandidate.getStop(), 0.0));
const Point aVclStart(basegfx::fround(aStart.getX()), basegfx::fround(aStart.getY()));
const Point aVclStop(basegfx::fround(aStop.getX()), basegfx::fround(aStop.getY()));
const Point aVclStart(basegfx::fround<tools::Long>(aStart.getX()),
basegfx::fround<tools::Long>(aStart.getY()));
const Point aVclStop(basegfx::fround<tools::Long>(aStop.getX()),
basegfx::fround<tools::Long>(aStop.getY()));
// #i101075# draw it. Do not forget to use the evtl. offsetted origin of the target device,
// e.g. when used with mask/transparence buffer device

View File

@ -226,8 +226,10 @@ VclMetafileProcessor2D::impDumpToMetaFile(const primitive2d::Primitive2DContaine
aPrimitiveRange.transform(maCurrentTransformation);
const tools::Rectangle aPrimitiveRectangle(
basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
basegfx::fround<tools::Long>(aPrimitiveRange.getMinX()),
basegfx::fround<tools::Long>(aPrimitiveRange.getMinY()),
basegfx::fround<tools::Long>(aPrimitiveRange.getMaxX()),
basegfx::fround<tools::Long>(aPrimitiveRange.getMaxY()));
ScopedVclPtrInstance<VirtualDevice> aContentVDev;
MapMode aNewMapMode(pLastOutputDevice->GetMapMode());
@ -1183,9 +1185,10 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::NonStructElement);
mpPDFExtOutDevData->SetStructureAttribute(vcl::PDFWriter::Placement, vcl::PDFWriter::Block);
auto const range(rControlPrimitive.getB2DRange(getViewInformation2D()));
tools::Rectangle const aLogicRect(
basegfx::fround(range.getMinX()), basegfx::fround(range.getMinY()),
basegfx::fround(range.getMaxX()), basegfx::fround(range.getMaxY()));
tools::Rectangle const aLogicRect(basegfx::fround<tools::Long>(range.getMinX()),
basegfx::fround<tools::Long>(range.getMinY()),
basegfx::fround<tools::Long>(range.getMaxX()),
basegfx::fround<tools::Long>(range.getMaxY()));
mpPDFExtOutDevData->SetStructureBoundingBox(aLogicRect);
OUString const& rAltText(rControlPrimitive.GetAltText());
if (!rAltText.isEmpty() && !bDecorative)
@ -1641,7 +1644,7 @@ void VclMetafileProcessor2D::processPolygonStrokePrimitive2D(
// use the transformed line width
LineInfo aLineInfo(LineStyle::Solid,
basegfx::fround(getTransformedLineWidth(rLine.getWidth())));
std::round(getTransformedLineWidth(rLine.getWidth())));
aLineInfo.SetLineJoin(rLine.getLineJoin());
aLineInfo.SetLineCap(rLine.getLineCap());
@ -1971,7 +1974,7 @@ void VclMetafileProcessor2D::processPolyPolygonHatchPrimitive2D(
aToolsPolyPolygon,
Hatch(aHatchStyle,
Color(maBColorModifierStack.getModifiedColor(rFillHatchAttribute.getColor())),
basegfx::fround(rFillHatchAttribute.getDistance()),
basegfx::fround<tools::Long>(rFillHatchAttribute.getDistance()),
Degree10(basegfx::fround(basegfx::rad2deg<10>(rFillHatchAttribute.getAngle())))));
impEndSvtGraphicFill(pSvtGraphicFill.get());
@ -2526,10 +2529,11 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
basegfx::fround(aDiscreteRange.getHeight()), nMaximumQuadraticPixels));
// add to target metafile (will create MetaFloatTransparentAction)
mpOutputDevice->DrawBitmapEx(
Point(basegfx::fround(aLogicRange.getMinX()), basegfx::fround(aLogicRange.getMinY())),
Size(basegfx::fround(aLogicRange.getWidth()), basegfx::fround(aLogicRange.getHeight())),
aBitmapEx);
mpOutputDevice->DrawBitmapEx(Point(basegfx::fround<tools::Long>(aLogicRange.getMinX()),
basegfx::fround<tools::Long>(aLogicRange.getMinY())),
Size(basegfx::fround<tools::Long>(aLogicRange.getWidth()),
basegfx::fround<tools::Long>(aLogicRange.getHeight())),
aBitmapEx);
}
void VclMetafileProcessor2D::processStructureTagPrimitive2D(
@ -2597,8 +2601,10 @@ void VclMetafileProcessor2D::processStructureTagPrimitive2D(
{
auto const range(rStructureTagCandidate.getB2DRange(getViewInformation2D()));
tools::Rectangle const aLogicRect(
basegfx::fround(range.getMinX()), basegfx::fround(range.getMinY()),
basegfx::fround(range.getMaxX()), basegfx::fround(range.getMaxY()));
basegfx::fround<tools::Long>(range.getMinX()),
basegfx::fround<tools::Long>(range.getMinY()),
basegfx::fround<tools::Long>(range.getMaxX()),
basegfx::fround<tools::Long>(range.getMaxY()));
mpPDFExtOutDevData->SetStructureBoundingBox(aLogicRect);
break;
}

View File

@ -372,8 +372,9 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
fIgnoreShearX);
const Point aOrigin(
basegfx::fround(aCurrentTranslate.getX() / aCurrentScaling.getX()),
basegfx::fround(aCurrentTranslate.getY() / aCurrentScaling.getY()));
basegfx::fround<tools::Long>(aCurrentTranslate.getX() / aCurrentScaling.getX()),
basegfx::fround<tools::Long>(aCurrentTranslate.getY()
/ aCurrentScaling.getY()));
Fraction aScaleX(aCurrentScaling.getX());
if (!aScaleX.IsValid())
@ -394,7 +395,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
if (fCurrentRotate)
aTextTranslate *= basegfx::utils::createRotateB2DHomMatrix(fCurrentRotate);
aStartPoint = Point(aTextTranslate.getX(), aTextTranslate.getY());
aStartPoint = Point(basegfx::fround<tools::Long>(aTextTranslate.getX()),
basegfx::fround<tools::Long>(aTextTranslate.getY()));
bChangeMapMode = aMapMode != mpOutputDevice->GetMapMode();
if (bChangeMapMode)
@ -406,7 +408,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
else
{
const basegfx::B2DPoint aPoint(aLocalTransform * basegfx::B2DPoint(0.0, 0.0));
aStartPoint = Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()));
aStartPoint = Point(basegfx::fround<tools::Long>(aPoint.getX()),
basegfx::fround<tools::Long>(aPoint.getY()));
}
// tdf#152990 set the font after the MapMode is (potentially) set so canvas uses the desired
@ -1060,8 +1063,8 @@ void VclProcessor2D::RenderMarkerArrayPrimitive2D(
{
const basegfx::B2DPoint aDiscreteTopLeft((maCurrentTransformation * pos)
- aDiscreteHalfSize);
const Point aDiscretePoint(basegfx::fround(aDiscreteTopLeft.getX()),
basegfx::fround(aDiscreteTopLeft.getY()));
const Point aDiscretePoint(basegfx::fround<tools::Long>(aDiscreteTopLeft.getX()),
basegfx::fround<tools::Long>(aDiscreteTopLeft.getY()));
mpOutputDevice->DrawBitmapEx(aDiscretePoint + aOrigin, rMarker);
}
@ -1081,8 +1084,8 @@ void VclProcessor2D::RenderPointArrayPrimitive2D(
for (auto const& pos : rPositions)
{
const basegfx::B2DPoint aViewPosition(maCurrentTransformation * pos);
const Point aPos(basegfx::fround(aViewPosition.getX()),
basegfx::fround(aViewPosition.getY()));
const Point aPos(basegfx::fround<tools::Long>(aViewPosition.getX()),
basegfx::fround<tools::Long>(aViewPosition.getY()));
mpOutputDevice->DrawPixel(aPos, aVCLColor);
}

View File

@ -362,7 +362,7 @@ BitmapEx convertPrimitive2DContainerToBitmapEx(primitive2d::Primitive2DContainer
if (aBitmapEx.IsEmpty())
return BitmapEx();
aBitmapEx.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
aBitmapEx.SetPrefSize(Size(basegfx::fround(fWidth), basegfx::fround(fHeight)));
aBitmapEx.SetPrefSize(Size(basegfx::fround<tools::Long>(fWidth), basegfx::fround<tools::Long>(fHeight)));
return aBitmapEx;
}

View File

@ -1070,7 +1070,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// consider scaling
double fFontScalingX = maScalingParameters.fFontX;
if (maStatus.DoStretch() && (fFontScalingX != 1.0))
nCurPos = basegfx::fround(double(nCurPos) / std::max(fFontScalingX, 0.01));
nCurPos = basegfx::fround<tools::Long>(double(nCurPos) / std::max(fFontScalingX, 0.01));
short nAllSpaceBeforeText = short(rLRItem.GetTextLeft());
aCurrentTab.aTabStop = pNode->GetContentAttribs().FindTabStop( nCurPos - nAllSpaceBeforeText , maEditDoc.GetDefTab() );
@ -3090,7 +3090,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
double fHeightRounded = roundToNearestPt(aRealSz.Height());
double fNewHeight = fHeightRounded * maScalingParameters.fFontY;
fNewHeight = roundToNearestPt(fNewHeight);
aRealSz.setHeight(basegfx::fround(fNewHeight));
aRealSz.setHeight(basegfx::fround<tools::Long>(fNewHeight));
}
if (maScalingParameters.fFontX != 1.0)
{
@ -3105,7 +3105,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
double fWidthRounded = roundToNearestPt(aRealSz.Width());
double fNewWidth = fWidthRounded * fFontX;
fNewWidth = roundToNearestPt(fNewWidth);
aRealSz.setWidth(basegfx::fround(fNewWidth));
aRealSz.setWidth(basegfx::fround<tools::Long>(fNewWidth));
// Also the Kerning: (long due to handle Interim results)
tools::Long nKerning = rFont.GetFixKerning();

View File

@ -3139,8 +3139,7 @@ double ImpEditEngine::roundToNearestPt(double fInput) const
if (mbRoundToNearestPt)
{
double fInputPt = o3tl::convert(fInput, o3tl::Length::mm100, o3tl::Length::pt);
auto nInputRounded = basegfx::fround(fInputPt);
return o3tl::convert(double(nInputRounded), o3tl::Length::pt, o3tl::Length::mm100);
return o3tl::convert(std::round(fInputPt), o3tl::Length::pt, o3tl::Length::mm100);
}
else
{

View File

@ -891,8 +891,8 @@ void Outliner::PaintBullet(sal_Int32 nPara, const Point& rStartPos, const Point&
double fSpacingFactorX = getScalingParameters().fSpacingX;
tools::Long nStretchBulletX = basegfx::fround(double(aBulletArea.Left()) * fSpacingFactorX);
tools::Long nStretchBulletWidth = basegfx::fround(double(aBulletArea.GetWidth()) * fSpacingFactorX);
tools::Long nStretchBulletX = basegfx::fround<tools::Long>(double(aBulletArea.Left()) * fSpacingFactorX);
tools::Long nStretchBulletWidth = basegfx::fround<tools::Long>(double(aBulletArea.GetWidth()) * fSpacingFactorX);
aBulletArea = tools::Rectangle(Point(nStretchBulletX, aBulletArea.Top()),
Size(nStretchBulletWidth, aBulletArea.GetHeight()) );

View File

@ -588,7 +588,7 @@ namespace emfio
fX2 -= mrclFrame.Left();
fY2 -= mrclFrame.Top();
}
return Point(basegfx::fround(fX2), basegfx::fround(fY2));
return Point(basegfx::fround<tools::Long>(fX2), basegfx::fround<tools::Long>(fY2));
}
else
return Point();
@ -677,7 +677,7 @@ namespace emfio
break;
}
}
return Size(basegfx::fround(fWidth), basegfx::fround(fHeight));
return Size(basegfx::fround<tools::Long>(fWidth), basegfx::fround<tools::Long>(fHeight));
}
else
return Size();
@ -1672,7 +1672,7 @@ namespace emfio
const Size aSizeY(ImplMap(Size(0, nSumY)));
const basegfx::B2DVector aVectorY(aSizeY.Width(), aSizeY.Height());
// Reverse Y
pDYArry[i] = basegfx::fround(aVectorY.getLength());
pDYArry[i] = basegfx::fround<tools::Long>(aVectorY.getLength());
pDYArry[i] *= (nSumY >= 0 ? -1 : 1);
}
}

View File

@ -2863,7 +2863,7 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
if ( rrProp.Value >>= fExtrusionShininess )
{
// ODF to MS Office conversion invers to msdffimp.cxx
fExtrusionShininess = basegfx::fround(fExtrusionShininess / 10.0);
fExtrusionShininess = std::round(fExtrusionShininess / 10.0);
AddOpt( DFF_Prop_c3DShininess, static_cast<sal_Int32>(fExtrusionShininess) );
}
}

View File

@ -1156,8 +1156,8 @@ void ImplEESdrObject::Init()
{
// if it's a group, the unrotated range is needed for that group
const basegfx::B2DRange aUnrotatedRange(getUnrotatedGroupBoundRange(mXShape));
const Point aNewP(basegfx::fround(aUnrotatedRange.getMinX()), basegfx::fround(aUnrotatedRange.getMinY()));
const Size aNewS(basegfx::fround(aUnrotatedRange.getWidth()), basegfx::fround(aUnrotatedRange.getHeight()));
const Point aNewP(basegfx::fround<tools::Long>(aUnrotatedRange.getMinX()), basegfx::fround<tools::Long>(aUnrotatedRange.getMinY()));
const Size aNewS(basegfx::fround<tools::Long>(aUnrotatedRange.getWidth()), basegfx::fround<tools::Long>(aUnrotatedRange.getHeight()));
SetRect(ImplEESdrWriter::ImplMapPoint(aNewP), ImplEESdrWriter::ImplMapSize(aNewS));
}

View File

@ -395,7 +395,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto
static_cast< double >(pTargetSdrPage->GetRightBorder()) / aPageSize.Width() +
static_cast< double >(pTargetSdrPage->GetUpperBorder()) / aPageSize.Height() +
static_cast< double >(pTargetSdrPage->GetLowerBorder()) / aPageSize.Height()) / 4.0);
const tools::Long nAllBorder(basegfx::fround((aGraphicSize.Width() + aGraphicSize.Height()) * fBorderRelation * 0.5));
const tools::Long nAllBorder(basegfx::fround<tools::Long>((aGraphicSize.Width() + aGraphicSize.Height()) * fBorderRelation * 0.5));
// Adapt PageSize and Border stuff. To get all MasterPages and PresObjs
// correctly adapted, do not just use

View File

@ -35,7 +35,7 @@ namespace basegfx
@return the nearest integer
*/
inline sal_Int32 fround( double fVal )
inline sal_Int32 fround32( double fVal )
{
if (fVal >= 0.0)
{
@ -57,6 +57,20 @@ namespace basegfx
return fVal > 0.0 ? static_cast<sal_Int64>( fVal + .5 ) : -static_cast<sal_Int64>( -fVal + .5 );
}
/** Round double to nearest integer
@return the nearest integer
*/
template <class Int = sal_Int32>
requires std::is_integral_v<Int> && std::is_signed_v<Int>
inline Int fround(double fVal)
{
if constexpr (sizeof(Int) == sizeof(sal_Int64))
return fround64(fVal);
else
return fround32(fVal);
}
/** Prune a small epsilon range around zero.
Use this method e.g. for calculating scale values. There, it

View File

@ -31,11 +31,11 @@ namespace TransfrmHelper
inline void ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit)
{
const basegfx::B2DPoint aTopLeft(
static_cast<double>(vcl::ConvertValue(basegfx::fround(rRange.getMinX()), nDigits, ePoolUnit, eDlgUnit)),
static_cast<double>(vcl::ConvertValue(basegfx::fround(rRange.getMinY()), nDigits, ePoolUnit, eDlgUnit)));
static_cast<double>(vcl::ConvertValue(basegfx::fround64(rRange.getMinX()), nDigits, ePoolUnit, eDlgUnit)),
static_cast<double>(vcl::ConvertValue(basegfx::fround64(rRange.getMinY()), nDigits, ePoolUnit, eDlgUnit)));
const basegfx::B2DPoint aBottomRight(
static_cast<double>(vcl::ConvertValue(basegfx::fround(rRange.getMaxX()), nDigits, ePoolUnit, eDlgUnit)),
static_cast<double>(vcl::ConvertValue(basegfx::fround(rRange.getMaxY()), nDigits, ePoolUnit, eDlgUnit)));
static_cast<double>(vcl::ConvertValue(basegfx::fround64(rRange.getMaxX()), nDigits, ePoolUnit, eDlgUnit)),
static_cast<double>(vcl::ConvertValue(basegfx::fround64(rRange.getMaxY()), nDigits, ePoolUnit, eDlgUnit)));
rRange = basegfx::B2DRange(aTopLeft, aBottomRight);
}

View File

@ -594,7 +594,7 @@ bool DrawingML::WriteSchemeColor(OUString const& rPropertyName, const uno::Refer
void DrawingML::WriteGradientStop(double fOffset, const basegfx::BColor& rColor, const basegfx::BColor& rAlpha)
{
mpFS->startElementNS(XML_a, XML_gs, XML_pos, OString::number(basegfx::fround(fOffset * 100000)));
mpFS->startElementNS(XML_a, XML_gs, XML_pos, OString::number(basegfx::fround64(fOffset * 100000)));
WriteColor(
::Color(rColor),
basegfx::fround((1.0 - rAlpha.luminance()) * oox::drawingml::MAX_PERCENT));

View File

@ -956,8 +956,8 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData&
// apply to aRect
aRect = tools::Rectangle(
basegfx::fround(aNewRange.getMinX()), basegfx::fround(aNewRange.getMinY()),
basegfx::fround(aNewRange.getMaxX()), basegfx::fround(aNewRange.getMaxY()));
basegfx::fround<tools::Long>(aNewRange.getMinX()), basegfx::fround<tools::Long>(aNewRange.getMinY()),
basegfx::fround<tools::Long>(aNewRange.getMaxX()), basegfx::fround<tools::Long>(aNewRange.getMaxY()));
}
}
}

View File

@ -249,7 +249,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
Size aStrSize;
sal_uInt16 nFmtIndex = GetFormatIndex( nCol, nRow );
const basegfx::B2DRange cellRange(maArray.GetCellRange( nCol, nRow ));
Point aPos(basegfx::fround(cellRange.getMinX()), basegfx::fround(cellRange.getMinY()));
Point aPos(basegfx::fround<tools::Long>(cellRange.getMinX()), basegfx::fround<tools::Long>(cellRange.getMinY()));
sal_uInt16 nRightX = 0;
bool bJustify = pCurData->GetIncludeJustify();
SvxCellHorJustify eJustification;
@ -269,7 +269,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
MakeFonts(rRenderContext, nFmtIndex, aFont, aCJKFont, aCTLFont);
theMaxStrSize = Size(basegfx::fround(cellRange.getWidth()), basegfx::fround(cellRange.getHeight()));
theMaxStrSize = Size(basegfx::fround<tools::Long>(cellRange.getWidth()), basegfx::fround<tools::Long>(cellRange.getHeight()));
theMaxStrSize.AdjustWidth( -(FRAME_OFFSET) );
theMaxStrSize.AdjustHeight( -(FRAME_OFFSET) );
@ -375,8 +375,8 @@ void ScAutoFmtPreview::DrawBackground(vcl::RenderContext& rRenderContext)
const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow ));
rRenderContext.DrawRect(
tools::Rectangle(
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())));
basegfx::fround<tools::Long>(aCellRange.getMinX()), basegfx::fround<tools::Long>(aCellRange.getMinY()),
basegfx::fround<tools::Long>(aCellRange.getMaxX()), basegfx::fround<tools::Long>(aCellRange.getMaxY())));
rRenderContext.Pop();
}

View File

@ -1064,8 +1064,8 @@ bool ScDrawView::calculateGridOffsetForB2DRange(
// the object as we want to maintain page anchoring )
ScDrawObjData aAnchor;
const tools::Rectangle aRectangle(
basegfx::fround(rB2DRange.getMinX()), basegfx::fround(rB2DRange.getMinY()),
basegfx::fround(rB2DRange.getMaxX()), basegfx::fround(rB2DRange.getMaxY()));
basegfx::fround<tools::Long>(rB2DRange.getMinX()), basegfx::fround<tools::Long>(rB2DRange.getMinY()),
basegfx::fround<tools::Long>(rB2DRange.getMaxX()), basegfx::fround<tools::Long>(rB2DRange.getMaxY()));
ScDrawLayer::GetCellAnchorFromPosition(
aRectangle,
aAnchor,

View File

@ -109,10 +109,10 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf128212)
xmlDocUniquePtr pXmlDoc = load("pptx/tdf128212.pptx");
// Without the fix in place, this test would have failed with
// - Expected: 7792
// - Expected: 7793
// - Actual : 12068
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "x"_ostr, "4520");
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "y"_ostr, "7792");
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "x"_ostr, "4521");
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "y"_ostr, "7793");
}
CPPUNIT_TEST_FIXTURE(SdLayoutTest, testColumnsLayout)

View File

@ -1430,19 +1430,19 @@ static void CalcAutoLayoutRectangles( SdPage const & rPage,::tools::Rectangle* r
if(count == 0)
{
Size aSize ( aTitleRect.GetSize() );
aSize.setHeight( basegfx::fround(aSize.Height() * propvalue[0]) );
aSize.setWidth( basegfx::fround(aSize.Width() * propvalue[1]) );
Point aPos( basegfx::fround(aTitlePos.X() +(aSize.Width() * propvalue[2])),
basegfx::fround(aTitlePos.Y() + (aSize.Height() * propvalue[3])) );
aSize.setHeight( basegfx::fround<::tools::Long>(aSize.Height() * propvalue[0]) );
aSize.setWidth( basegfx::fround<::tools::Long>(aSize.Width() * propvalue[1]) );
Point aPos( basegfx::fround<::tools::Long>(aTitlePos.X() +(aSize.Width() * propvalue[2])),
basegfx::fround<::tools::Long>(aTitlePos.Y() + (aSize.Height() * propvalue[3])) );
rRectangle[count] = ::tools::Rectangle(aPos, aSize);
count = count+1;
}
else
{
Size aSize( basegfx::fround(aLayoutSize.Width() * propvalue[1]),
basegfx::fround(aLayoutSize.Height() * propvalue[0]) );
Point aPos( basegfx::fround(aLayoutPos.X() +(aSize.Width() * propvalue[2])),
basegfx::fround(aLayoutPos.Y() + (aSize.Height() * propvalue[3])) );
Size aSize( basegfx::fround<::tools::Long>(aLayoutSize.Width() * propvalue[1]),
basegfx::fround<::tools::Long>(aLayoutSize.Height() * propvalue[0]) );
Point aPos( basegfx::fround<::tools::Long>(aLayoutPos.X() +(aSize.Width() * propvalue[2])),
basegfx::fround<::tools::Long>(aLayoutPos.Y() + (aSize.Height() * propvalue[3])) );
rRectangle[count] = ::tools::Rectangle (aPos, aSize);
count = count+1;
}

View File

@ -595,8 +595,8 @@ EventMultiplexerImpl::toNormalPoint(const uno::Reference<presentation::XSlideSho
basegfx::B2DHomMatrix aMatrix((*aIter)->getTransformation());
aPosition *= aMatrix;
aPosition.setX(basegfx::fround(aPosition.getX()));
aPosition.setY(basegfx::fround(aPosition.getY()));
aPosition.setX(std::round(aPosition.getX()));
aPosition.setY(std::round(aPosition.getY()));
return aPosition;
}
@ -621,8 +621,8 @@ EventMultiplexerImpl::toMatrixPoint(const uno::Reference<presentation::XSlideSho
" view matrix singular");
aPosition *= aMatrix;
aPosition.setX(basegfx::fround(aPosition.getX()));
aPosition.setY(basegfx::fround(aPosition.getY()));
aPosition.setX(std::round(aPosition.getX()));
aPosition.setY(std::round(aPosition.getY()));
return aPosition;
}

View File

@ -523,8 +523,8 @@ private:
// translation when aTmpRect was not properly initialized.
if ( ! aTmpRect.isEmpty())
{
aMatrix.translate( -basegfx::fround(aTmpRect.getMinX()),
-basegfx::fround(aTmpRect.getMinY()) );
aMatrix.translate( -std::round(aTmpRect.getMinX()),
-std::round(aTmpRect.getMinY()) );
}
return aMatrix;

View File

@ -510,7 +510,7 @@ rtl::Reference<SdrObject> EnhancedCustomShape3d::Create3DObject(
}
const basegfx::B2DRange aTempRange(basegfx::utils::getRange(aPolyPoly));
const tools::Rectangle aBoundRect(basegfx::fround(aTempRange.getMinX()), basegfx::fround(aTempRange.getMinY()), basegfx::fround(aTempRange.getMaxX()), basegfx::fround(aTempRange.getMaxY()));
const tools::Rectangle aBoundRect(basegfx::fround<tools::Long>(aTempRange.getMinX()), basegfx::fround<tools::Long>(aTempRange.getMinY()), basegfx::fround<tools::Long>(aTempRange.getMaxX()), basegfx::fround<tools::Long>(aTempRange.getMaxY()));
aTotalPolyPoly.append(aPolyPoly);
aBoundRect2d.Union( aBoundRect );

View File

@ -429,12 +429,12 @@ void FrameSelectorImpl::InitBorderGeometry()
{
const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow ));
const tools::Rectangle aRect(
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY()));
basegfx::fround<tools::Long>(aCellRange.getMinX()), basegfx::fround<tools::Long>(aCellRange.getMinY()),
basegfx::fround<tools::Long>(aCellRange.getMaxX()), basegfx::fround<tools::Long>(aCellRange.getMaxY()));
const double fHorDiagAngle(atan2(fabs(aCellRange.getHeight()), fabs(aCellRange.getWidth())));
const double fVerDiagAngle(fHorDiagAngle > 0.0 ? M_PI_2 - fHorDiagAngle : 0.0);
const tools::Long nDiagFocusOffsX(basegfx::fround(-mnFocusOffs / tan(fHorDiagAngle) + mnFocusOffs / sin(fHorDiagAngle)));
const tools::Long nDiagFocusOffsY(basegfx::fround(-mnFocusOffs / tan(fVerDiagAngle) + mnFocusOffs / sin(fVerDiagAngle)));
const tools::Long nDiagFocusOffsX(basegfx::fround<tools::Long>(-mnFocusOffs / tan(fHorDiagAngle) + mnFocusOffs / sin(fHorDiagAngle)));
const tools::Long nDiagFocusOffsY(basegfx::fround<tools::Long>(-mnFocusOffs / tan(fVerDiagAngle) + mnFocusOffs / sin(fVerDiagAngle)));
std::vector< Point > aFocusVec;
aFocusVec.emplace_back( aRect.Left() - mnFocusOffs, aRect.Top() + nDiagFocusOffsY );
@ -489,8 +489,8 @@ void FrameSelectorImpl::InitBorderGeometry()
// the usable area between horizontal/vertical frame borders of current quadrant
const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow ));
const tools::Rectangle aRect(
basegfx::fround(aCellRange.getMinX()) + nClV + 1, basegfx::fround(aCellRange.getMinY()) + nClH + 1,
basegfx::fround(aCellRange.getMaxX()) - nClV + 1, basegfx::fround(aCellRange.getMaxY()) - nClH + 1);
basegfx::fround<tools::Long>(aCellRange.getMinX()) + nClV + 1, basegfx::fround<tools::Long>(aCellRange.getMinY()) + nClH + 1,
basegfx::fround<tools::Long>(aCellRange.getMaxX()) - nClV + 1, basegfx::fround<tools::Long>(aCellRange.getMaxY()) - nClH + 1);
/* Both diagonal frame borders enabled. */
if( mbTLBR && mbBLTR )

View File

@ -529,7 +529,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
// to 2d world coor
aPos2D *= rVCScene.getObjectTransformation();
rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround(aPos2D.getX()), basegfx::fround(aPos2D.getY())), SdrHdlKind::BezierWeight));
rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround<tools::Long>(aPos2D.getX()), basegfx::fround<tools::Long>(aPos2D.getY())), SdrHdlKind::BezierWeight));
}
}
}

View File

@ -1332,12 +1332,12 @@ void E3dView::Start3DCreation()
}
basegfx::B2DPoint aCenter(aR.getCenter());
tools::Long nMarkHgt = basegfx::fround(aR.getHeight()) - 1;
tools::Long nMarkHgt = basegfx::fround<tools::Long>(aR.getHeight()) - 1;
tools::Long nHgt = nMarkHgt + nObjDst * 2;
if (nHgt < nMinLen) nHgt = nMinLen;
tools::Long nY1 = basegfx::fround(aCenter.getY()) - (nHgt + 1) / 2;
tools::Long nY1 = basegfx::fround<tools::Long>(aCenter.getY()) - (nHgt + 1) / 2;
tools::Long nY2 = nY1 + nHgt;
if (pOut && (nMinLen > nOutHgt)) nMinLen = nOutHgt;
@ -1355,7 +1355,7 @@ void E3dView::Start3DCreation()
}
}
maRef1.setX( basegfx::fround(aR.getMinX()) ); // Initial move axis 2/100mm to the left
maRef1.setX( basegfx::fround<tools::Long>(aR.getMinX()) ); // Initial move axis 2/100mm to the left
maRef1.setY( nY1 );
maRef2.setX( maRef1.X() );
maRef2.setY( nY2 );

View File

@ -650,8 +650,8 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
if(getPossibleGridOffsetForSdrObject(aGridOffset, pObj.get(), mpCreatePV))
{
const Size aOffset(
basegfx::fround(-aGridOffset.getX()),
basegfx::fround(-aGridOffset.getY()));
basegfx::fround<tools::Long>(-aGridOffset.getX()),
basegfx::fround<tools::Long>(-aGridOffset.getY()));
pObj->NbcMove(aOffset);
}

View File

@ -3770,15 +3770,15 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
// extract the old Rectangle structures
tools::Rectangle aOldRect(
basegfx::fround(aRangeOriginalNoShearNoRotate.getMinX()),
basegfx::fround(aRangeOriginalNoShearNoRotate.getMinY()),
basegfx::fround(aRangeOriginalNoShearNoRotate.getMaxX()),
basegfx::fround(aRangeOriginalNoShearNoRotate.getMaxY()));
basegfx::fround<tools::Long>(aRangeOriginalNoShearNoRotate.getMinX()),
basegfx::fround<tools::Long>(aRangeOriginalNoShearNoRotate.getMinY()),
basegfx::fround<tools::Long>(aRangeOriginalNoShearNoRotate.getMaxX()),
basegfx::fround<tools::Long>(aRangeOriginalNoShearNoRotate.getMaxY()));
tools::Rectangle aNewRect(
basegfx::fround(aRangeNewNoShearNoRotate.getMinX()),
basegfx::fround(aRangeNewNoShearNoRotate.getMinY()),
basegfx::fround(aRangeNewNoShearNoRotate.getMaxX()),
basegfx::fround(aRangeNewNoShearNoRotate.getMaxY()));
basegfx::fround<tools::Long>(aRangeNewNoShearNoRotate.getMinX()),
basegfx::fround<tools::Long>(aRangeNewNoShearNoRotate.getMinY()),
basegfx::fround<tools::Long>(aRangeNewNoShearNoRotate.getMaxX()),
basegfx::fround<tools::Long>(aRangeNewNoShearNoRotate.getMaxY()));
// continue with the old original stuff
if (!aOldRect.GetWidth() || !aOldRect.GetHeight())

View File

@ -123,8 +123,8 @@ void SdrDragView::TakeActionRect(tools::Rectangle& rRect) const
else
{
rRect = tools::Rectangle(
basegfx::fround(aBoundRange.getMinX()), basegfx::fround(aBoundRange.getMinY()),
basegfx::fround(aBoundRange.getMaxX()), basegfx::fround(aBoundRange.getMaxY()));
basegfx::fround<tools::Long>(aBoundRange.getMinX()), basegfx::fround<tools::Long>(aBoundRange.getMinY()),
basegfx::fround<tools::Long>(aBoundRange.getMaxX()), basegfx::fround<tools::Long>(aBoundRange.getMaxY()));
}
}
}
@ -164,8 +164,8 @@ bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, bool bTR ) const
{
// drag the whole Object (Move, Resize, ...)
const basegfx::B2DPoint aTransformed(mpCurrentSdrDragMethod->getCurrentTransformation() * basegfx::B2DPoint(aPt.X(), aPt.Y()));
rPos.setX( basegfx::fround(aTransformed.getX()) );
rPos.setY( basegfx::fround(aTransformed.getY()) );
rPos.setX( basegfx::fround<tools::Long>(aTransformed.getX()) );
rPos.setY( basegfx::fround<tools::Long>(aTransformed.getY()) );
}
}
}
@ -216,8 +216,8 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
GetSdrPageView())))
{
aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
aPnt.AdjustX(basegfx::fround<tools::Long>(-aGridOffset.getX()));
aPnt.AdjustY(basegfx::fround<tools::Long>(-aGridOffset.getY()));
}
if(pHdl == nullptr
@ -520,8 +520,8 @@ void SdrDragView::MovDragObj(const Point& rPnt)
basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
GetSdrPageView())))
{
aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
aPnt.AdjustX(basegfx::fround<tools::Long>(-aGridOffset.getX()));
aPnt.AdjustY(basegfx::fround<tools::Long>(-aGridOffset.getY()));
}
ImpLimitToWorkArea(aPnt);

View File

@ -347,8 +347,8 @@ void SdrObjEditView::ModelHasChanged()
basegfx::B2DVector aGridOffset(0.0, 0.0);
if (getPossibleGridOffsetForSdrObject(aGridOffset, pTextObj.get(), GetSdrPageView()))
{
const Point aOffset(basegfx::fround(aGridOffset.getX()),
basegfx::fround(aGridOffset.getY()));
const Point aOffset(basegfx::fround<tools::Long>(aGridOffset.getX()),
basegfx::fround<tools::Long>(aGridOffset.getY()));
aEditArea1 += aOffset;
aMinArea1 += aOffset;
@ -1432,8 +1432,8 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
basegfx::B2DVector aGridOffset(0.0, 0.0);
if (getPossibleGridOffsetForSdrObject(aGridOffset, pTextObj.get(), pPV))
{
const Point aOffset(basegfx::fround(aGridOffset.getX()),
basegfx::fround(aGridOffset.getY()));
const Point aOffset(basegfx::fround<tools::Long>(aGridOffset.getX()),
basegfx::fround<tools::Long>(aGridOffset.getY()));
aTextEditArea += aOffset;
aMinTextEditArea += aOffset;

View File

@ -571,11 +571,11 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj1, bool bScale)
const Size aOrigSizePixel(aBitmapEx.GetSizePixel());
const Point aClipTopLeft(
basegfx::fround(floor(std::max(0.0, aPixel.getMinX()))),
basegfx::fround(floor(std::max(0.0, aPixel.getMinY()))));
basegfx::fround<tools::Long>(floor(std::max(0.0, aPixel.getMinX()))),
basegfx::fround<tools::Long>(floor(std::max(0.0, aPixel.getMinY()))));
const Size aClipSize(
basegfx::fround(ceil(std::min(static_cast<double>(aOrigSizePixel.Width()), aPixel.getWidth()))),
basegfx::fround(ceil(std::min(static_cast<double>(aOrigSizePixel.Height()), aPixel.getHeight()))));
basegfx::fround<tools::Long>(ceil(std::min(static_cast<double>(aOrigSizePixel.Width()), aPixel.getWidth()))),
basegfx::fround<tools::Long>(ceil(std::min(static_cast<double>(aOrigSizePixel.Height()), aPixel.getHeight()))));
const BitmapEx aClippedBitmap(
aBitmapEx,
aClipTopLeft,

View File

@ -1658,8 +1658,8 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
GradTransformer::GradToVec(aGradTransGradient, aGradTransVector, pObj);
// build handles
const Point aTmpPos1(basegfx::fround(aGradTransVector.maPositionA.getX()), basegfx::fround(aGradTransVector.maPositionA.getY()));
const Point aTmpPos2(basegfx::fround(aGradTransVector.maPositionB.getX()), basegfx::fround(aGradTransVector.maPositionB.getY()));
const Point aTmpPos1(basegfx::fround<tools::Long>(aGradTransVector.maPositionA.getX()), basegfx::fround<tools::Long>(aGradTransVector.maPositionA.getY()));
const Point aTmpPos2(basegfx::fround<tools::Long>(aGradTransVector.maPositionB.getX()), basegfx::fround<tools::Long>(aGradTransVector.maPositionB.getY()));
std::unique_ptr<SdrHdlColor> pColHdl1(new SdrHdlColor(aTmpPos1, aGradTransVector.aCol1, SDR_HANDLE_COLOR_SIZE_NORMAL, true));
std::unique_ptr<SdrHdlColor> pColHdl2(new SdrHdlColor(aTmpPos2, aGradTransVector.aCol2, SDR_HANDLE_COLOR_SIZE_NORMAL, true));
std::unique_ptr<SdrHdlGradient> pGradHdl(new SdrHdlGradient(aTmpPos1, aTmpPos2, false));
@ -1699,8 +1699,8 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode)
GradTransformer::GradToVec(aGradTransGradient, aGradTransVector, pObj);
// build handles
const Point aTmpPos1(basegfx::fround(aGradTransVector.maPositionA.getX()), basegfx::fround(aGradTransVector.maPositionA.getY()));
const Point aTmpPos2(basegfx::fround(aGradTransVector.maPositionB.getX()), basegfx::fround(aGradTransVector.maPositionB.getY()));
const Point aTmpPos1(basegfx::fround<tools::Long>(aGradTransVector.maPositionA.getX()), basegfx::fround<tools::Long>(aGradTransVector.maPositionA.getY()));
const Point aTmpPos2(basegfx::fround<tools::Long>(aGradTransVector.maPositionB.getX()), basegfx::fround<tools::Long>(aGradTransVector.maPositionB.getY()));
std::unique_ptr<SdrHdlColor> pColHdl1(new SdrHdlColor(aTmpPos1, aGradTransVector.aCol1, aHdlSize, false));
std::unique_ptr<SdrHdlColor> pColHdl2(new SdrHdlColor(aTmpPos2, aGradTransVector.aCol2, aHdlSize, false));
std::unique_ptr<SdrHdlGradient> pGradHdl(new SdrHdlGradient(aTmpPos1, aTmpPos2, true));
@ -2384,8 +2384,8 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT
if(getPossibleGridOffsetForSdrObject(aGridOffset, pObj, pPV))
{
aRect += Point(
basegfx::fround(aGridOffset.getX()),
basegfx::fround(aGridOffset.getY()));
basegfx::fround<tools::Long>(aGridOffset.getX()),
basegfx::fround<tools::Long>(aGridOffset.getY()));
}
double nTol2(nTol);

View File

@ -2071,15 +2071,15 @@ basegfx::B2DPolygon SdrEdgeObj::ImplAddConnectorOverlay(const SdrDragMethod& rDr
if (bTail1)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aMyCon1.m_aObjOfs.X(), aMyCon1.m_aObjOfs.Y()));
aMyCon1.m_aObjOfs.setX( basegfx::fround(aTemp.getX()) );
aMyCon1.m_aObjOfs.setY( basegfx::fround(aTemp.getY()) );
aMyCon1.m_aObjOfs.setX( basegfx::fround<tools::Long>(aTemp.getX()) );
aMyCon1.m_aObjOfs.setY( basegfx::fround<tools::Long>(aTemp.getY()) );
}
if (bTail2)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aMyCon2.m_aObjOfs.X(), aMyCon2.m_aObjOfs.Y()));
aMyCon2.m_aObjOfs.setX( basegfx::fround(aTemp.getX()) );
aMyCon2.m_aObjOfs.setY( basegfx::fround(aTemp.getY()) );
aMyCon2.m_aObjOfs.setX( basegfx::fround<tools::Long>(aTemp.getX()) );
aMyCon2.m_aObjOfs.setY( basegfx::fround<tools::Long>(aTemp.getY()) );
}
SdrEdgeInfoRec aInfo(m_aEdgeInfo);
@ -2104,15 +2104,15 @@ basegfx::B2DPolygon SdrEdgeObj::ImplAddConnectorOverlay(const SdrDragMethod& rDr
if (bTail1)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aPt1.X(), aPt1.Y()));
aPt1.setX( basegfx::fround(aTemp.getX()) );
aPt1.setY( basegfx::fround(aTemp.getY()) );
aPt1.setX( basegfx::fround<tools::Long>(aTemp.getX()) );
aPt1.setY( basegfx::fround<tools::Long>(aTemp.getY()) );
}
if (bTail2)
{
const basegfx::B2DPoint aTemp(rDragMethod.getCurrentTransformation() * basegfx::B2DPoint(aPt2.X(), aPt2.Y()));
aPt2.setX( basegfx::fround(aTemp.getX()) );
aPt2.setY( basegfx::fround(aTemp.getY()) );
aPt2.setX( basegfx::fround<tools::Long>(aTemp.getX()) );
aPt2.setY( basegfx::fround<tools::Long>(aTemp.getY()) );
}
aResult.append(basegfx::B2DPoint(aPt1.X(), aPt1.Y()));

View File

@ -1232,21 +1232,21 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) const
basegfx::B2DPoint aPos;
aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -339,7 +339,7 @@ static tools::Long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPo
const basegfx::B2DRange aPolygonRange(rPolyPolygon.getB2DRange());
const double fOldWidth(std::max(aPolygonRange.getWidth(), 1.0));
const double fScale(static_cast<double>(nNewWidth) / fOldWidth);
tools::Long nHeight(basegfx::fround(aPolygonRange.getHeight() * fScale));
tools::Long nHeight(basegfx::fround<tools::Long>(aPolygonRange.getHeight() * fScale));
if(bCenter)
{
@ -1407,8 +1407,8 @@ void SdrMeasureObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
}
// derive new model data
const Point aNewPt1(basegfx::fround(aPosA.getX()), basegfx::fround(aPosA.getY()));
const Point aNewPt2(basegfx::fround(aPosB.getX()), basegfx::fround(aPosB.getY()));
const Point aNewPt1(basegfx::fround<tools::Long>(aPosA.getX()), basegfx::fround<tools::Long>(aPosA.getY()));
const Point aNewPt2(basegfx::fround<tools::Long>(aPosB.getX()), basegfx::fround<tools::Long>(aPosB.getY()));
if(aNewPt1 == aPt1 && aNewPt2 == aPt2)
return;

View File

@ -521,12 +521,12 @@ void ImpSdrPdfImport::InsertObj(SdrObject* pObj1, bool bScale)
const Size aOrigSizePixel(aBitmapEx.GetSizePixel());
const Point aClipTopLeft(
basegfx::fround(floor(std::max(0.0, aPixel.getMinX()))),
basegfx::fround(floor(std::max(0.0, aPixel.getMinY()))));
basegfx::fround<tools::Long>(floor(std::max(0.0, aPixel.getMinX()))),
basegfx::fround<tools::Long>(floor(std::max(0.0, aPixel.getMinY()))));
const Size aClipSize(
basegfx::fround(ceil(std::min(
basegfx::fround<tools::Long>(ceil(std::min(
static_cast<double>(aOrigSizePixel.Width()), aPixel.getWidth()))),
basegfx::fround(
basegfx::fround<tools::Long>(
ceil(std::min(static_cast<double>(aOrigSizePixel.Height()),
aPixel.getHeight()))));
const BitmapEx aClippedBitmap(aBitmapEx, aClipTopLeft, aClipSize);

View File

@ -926,8 +926,8 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
// that avoids to do it later by Metafile::Move what would be expensive
aOutMap.SetOrigin(
Point(
basegfx::fround(-aBound.getMinX() - aHalfPixelInMtf.getWidth()),
basegfx::fround(-aBound.getMinY() - aHalfPixelInMtf.getHeight()) ) );
basegfx::fround<tools::Long>(-aBound.getMinX() - aHalfPixelInMtf.getWidth()),
basegfx::fround<tools::Long>(-aBound.getMinY() - aHalfPixelInMtf.getHeight()) ) );
aOut->SetRelativeMapMode( aOutMap );
sdr::contact::DisplayInfo aDisplayInfo;
@ -965,8 +965,8 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
// export is always a risky thing, so it will have to show if this will
// not influence something else.
const Size aBoundSize(
basegfx::fround(aBound.getWidth() + 1),
basegfx::fround(aBound.getHeight() + 1));
basegfx::fround<tools::Long>(aBound.getWidth() + 1),
basegfx::fround<tools::Long>(aBound.getHeight() + 1));
aMtf.SetPrefMapMode( aMap );
aMtf.SetPrefSize( aBoundSize );

View File

@ -2015,8 +2015,8 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn
basegfx::B2DHomMatrix aNewHomogenMatrix;
pSdrObject->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
aVclPoint.AdjustX(basegfx::fround(aNewHomogenMatrix.get(0, 2)) );
aVclPoint.AdjustY(basegfx::fround(aNewHomogenMatrix.get(1, 2)) );
aVclPoint.AdjustX(basegfx::fround<tools::Long>(aNewHomogenMatrix.get(0, 2)) );
aVclPoint.AdjustY(basegfx::fround<tools::Long>(aNewHomogenMatrix.get(1, 2)) );
// #88491# position relative to anchor
if( pSdrObject->getSdrModelFromSdrObject().IsWriter() )
@ -2542,8 +2542,8 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn
basegfx::B2DHomMatrix aNewHomogenMatrix;
GetSdrObject()->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
aVclPoint.AdjustX( -(basegfx::fround(aNewHomogenMatrix.get(0, 2))) );
aVclPoint.AdjustY( -(basegfx::fround(aNewHomogenMatrix.get(1, 2))) );
aVclPoint.AdjustX( -(basegfx::fround<tools::Long>(aNewHomogenMatrix.get(0, 2))) );
aVclPoint.AdjustY( -(basegfx::fround<tools::Long>(aNewHomogenMatrix.get(1, 2))) );
// tdf#117145 metric of SdrModel is app-specific, metric of UNO API is 100thmm
// Need to adapt aVclPoint from app-specific to 100thmm

View File

@ -866,8 +866,8 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou
// rRef is relative to the Crop-Action, si in X/Y-Ranges of [0.0 .. 1.0],
// to get the correct absolute position, transform using the old Rect
const Point aRef(
aOldRect.Left() + basegfx::fround(aOldRect.GetWidth() * rRef.getX()),
aOldRect.Top() + basegfx::fround(aOldRect.GetHeight() * rRef.getY()));
aOldRect.Left() + basegfx::fround<tools::Long>(aOldRect.GetWidth() * rRef.getX()),
aOldRect.Top() + basegfx::fround<tools::Long>(aOldRect.GetHeight() * rRef.getY()));
// apply transformation, use old ResizeRect for now
tools::Rectangle aNewRect( aOldRect );
@ -956,8 +956,8 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou
// Create the new TopLeft of the unrotated, cropped object by creating
// as if re-creating the unrotated geometry
aNewTopLeft = Point(
basegfx::fround(aRotNewCenter.getX() - (0.5 * aNewRect.getOpenWidth())),
basegfx::fround(aRotNewCenter.getY() - (0.5 * aNewRect.getOpenHeight())));
basegfx::fround<tools::Long>(aRotNewCenter.getX() - (0.5 * aNewRect.getOpenWidth())),
basegfx::fround<tools::Long>(aRotNewCenter.getY() - (0.5 * aNewRect.getOpenHeight())));
}
// check if we have movement and execute if yes
@ -1018,10 +1018,10 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const
// create new modified, but untransformed OutRect
setOutRectangle(tools::Rectangle(
basegfx::fround(aCenter.getX() - (0.5 * aAbsScale.getX())),
basegfx::fround(aCenter.getY() - (0.5 * aAbsScale.getY())),
basegfx::fround(aCenter.getX() + (0.5 * aAbsScale.getX())),
basegfx::fround(aCenter.getY() + (0.5 * aAbsScale.getY()))));
basegfx::fround<tools::Long>(aCenter.getX() - (0.5 * aAbsScale.getX())),
basegfx::fround<tools::Long>(aCenter.getY() - (0.5 * aAbsScale.getY())),
basegfx::fround<tools::Long>(aCenter.getX() + (0.5 * aAbsScale.getX())),
basegfx::fround<tools::Long>(aCenter.getY() + (0.5 * aAbsScale.getY()))));
// restore FrameAreas so that actions below not adapted to new
// full transformations take the correct actions
@ -1242,21 +1242,21 @@ void SwVirtFlyDrawObj::addCropHandles(SdrHdlList& rTarget) const
basegfx::B2DPoint aPos;
aPos = aTargetTransform * basegfx::B2DPoint(0.0, 0.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(0.5, 0.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(1.0, 0.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(0.0, 0.5);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(1.0, 0.5);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(0.0, 1.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(0.5, 1.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
aPos = aTargetTransform * basegfx::B2DPoint(1.0, 1.0);
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround<tools::Long>(aPos.getX()), basegfx::fround<tools::Long>(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
}
// Macro

View File

@ -181,10 +181,10 @@ SwRect TransformableSwFrame::getUntransformedFrameArea() const
const basegfx::B2DVector aAbsScale(basegfx::absolute(aScale));
return SwRect(
basegfx::fround(aCenter.getX() - (0.5 * aAbsScale.getX())),
basegfx::fround(aCenter.getY() - (0.5 * aAbsScale.getY())),
basegfx::fround(aAbsScale.getX()),
basegfx::fround(aAbsScale.getY()));
basegfx::fround<tools::Long>(aCenter.getX() - (0.5 * aAbsScale.getX())),
basegfx::fround<tools::Long>(aCenter.getY() - (0.5 * aAbsScale.getY())),
basegfx::fround<tools::Long>(aAbsScale.getX()),
basegfx::fround<tools::Long>(aAbsScale.getY()));
}
}
@ -206,10 +206,10 @@ SwRect TransformableSwFrame::getUntransformedFramePrintArea() const
const SwRect aUntransformedFrameArea(getUntransformedFrameArea());
return SwRect(
basegfx::fround(aCenter.getX() - (0.5 * aAbsScale.getX())) - aUntransformedFrameArea.Left(),
basegfx::fround(aCenter.getY() - (0.5 * aAbsScale.getY())) - aUntransformedFrameArea.Top(),
basegfx::fround(aAbsScale.getX()),
basegfx::fround(aAbsScale.getY()));
basegfx::fround<tools::Long>(aCenter.getX() - (0.5 * aAbsScale.getX())) - aUntransformedFrameArea.Left(),
basegfx::fround<tools::Long>(aCenter.getY() - (0.5 * aAbsScale.getY())) - aUntransformedFrameArea.Top(),
basegfx::fround<tools::Long>(aAbsScale.getX()),
basegfx::fround<tools::Long>(aAbsScale.getY()));
}
}
@ -240,8 +240,8 @@ void TransformableSwFrame::adaptFrameAreasToTransformations()
basegfx::B2DRange aRangeFrameArea(0.0, 0.0, 1.0, 1.0);
aRangeFrameArea.transform(getLocalFrameAreaTransformation());
const SwRect aNewFrm(
basegfx::fround(aRangeFrameArea.getMinX()), basegfx::fround(aRangeFrameArea.getMinY()),
basegfx::fround(aRangeFrameArea.getWidth()), basegfx::fround(aRangeFrameArea.getHeight()));
basegfx::fround<tools::Long>(aRangeFrameArea.getMinX()), basegfx::fround<tools::Long>(aRangeFrameArea.getMinY()),
basegfx::fround<tools::Long>(aRangeFrameArea.getWidth()), basegfx::fround<tools::Long>(aRangeFrameArea.getHeight()));
if(aNewFrm != mrSwFrameAreaDefinition.getFrameArea())
{
@ -256,10 +256,10 @@ void TransformableSwFrame::adaptFrameAreasToTransformations()
basegfx::B2DRange aRangeFramePrintArea(0.0, 0.0, 1.0, 1.0);
aRangeFramePrintArea.transform(getLocalFramePrintAreaTransformation());
const SwRect aNewPrt(
basegfx::fround(aRangeFramePrintArea.getMinX()) - mrSwFrameAreaDefinition.getFrameArea().Left(),
basegfx::fround(aRangeFramePrintArea.getMinY()) - mrSwFrameAreaDefinition.getFrameArea().Top(),
basegfx::fround(aRangeFramePrintArea.getWidth()),
basegfx::fround(aRangeFramePrintArea.getHeight()));
basegfx::fround<tools::Long>(aRangeFramePrintArea.getMinX()) - mrSwFrameAreaDefinition.getFrameArea().Left(),
basegfx::fround<tools::Long>(aRangeFramePrintArea.getMinY()) - mrSwFrameAreaDefinition.getFrameArea().Top(),
basegfx::fround<tools::Long>(aRangeFramePrintArea.getWidth()),
basegfx::fround<tools::Long>(aRangeFramePrintArea.getHeight()));
if(aNewPrt != mrSwFrameAreaDefinition.getFramePrintArea())
{

View File

@ -237,9 +237,10 @@ void AutoFormatPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nC
Size aStrSize;
sal_uInt8 nFormatIndex = GetFormatIndex(nCol, nRow);
const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, nRow));
const tools::Rectangle cellRect(
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY()));
const tools::Rectangle cellRect(basegfx::fround<tools::Long>(aCellRange.getMinX()),
basegfx::fround<tools::Long>(aCellRange.getMinY()),
basegfx::fround<tools::Long>(aCellRange.getMaxX()),
basegfx::fround<tools::Long>(aCellRange.getMaxY()));
Point aPos = cellRect.TopLeft();
tools::Long nRightX = 0;
@ -327,9 +328,11 @@ void AutoFormatPreview::DrawBackground(vcl::RenderContext& rRenderContext)
rRenderContext.SetLineColor();
rRenderContext.SetFillColor(aBrushItem.GetColor());
const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, nRow));
rRenderContext.DrawRect(tools::Rectangle(
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())));
rRenderContext.DrawRect(
tools::Rectangle(basegfx::fround<tools::Long>(aCellRange.getMinX()),
basegfx::fround<tools::Long>(aCellRange.getMinY()),
basegfx::fround<tools::Long>(aCellRange.getMaxX()),
basegfx::fround<tools::Long>(aCellRange.getMaxY())));
rRenderContext.Pop();
}
}

View File

@ -739,7 +739,7 @@ BitmapEx BitmapEx::TransformBitmapEx(
return BitmapEx();
// force destination to 24 bit, we want to smooth output
const Size aDestinationSize(basegfx::fround(fWidth), basegfx::fround(fHeight));
const Size aDestinationSize(basegfx::fround<tools::Long>(fWidth), basegfx::fround<tools::Long>(fHeight));
bool bSmooth = implTransformNeedsSmooth(rTransformation);
const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bSmooth));

View File

@ -376,8 +376,8 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
::basegfx::B2DRectangle const & rDestRect,
::basegfx::B2DHomMatrix const & rLocalTransform )
{
const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ),
::basegfx::fround( rDestRect.getHeight() ) );
const Size aDestBmpSize( ::basegfx::fround<tools::Long>( rDestRect.getWidth() ),
::basegfx::fround<tools::Long>( rDestRect.getHeight() ) );
if( aDestBmpSize.IsEmpty() )
return BitmapEx();
@ -460,8 +460,8 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
::basegfx::B2DPoint aPoint(x,y);
aPoint *= aTransform;
const int nSrcX( ::basegfx::fround( aPoint.getX() ) );
const int nSrcY( ::basegfx::fround( aPoint.getY() ) );
const tools::Long nSrcX( ::basegfx::fround<tools::Long>( aPoint.getX() ) );
const tools::Long nSrcY( ::basegfx::fround<tools::Long>( aPoint.getY() ) );
if( nSrcX < 0 || nSrcX >= aBmpSize.Width() ||
nSrcY < 0 || nSrcY >= aBmpSize.Height() )
{
@ -484,8 +484,8 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
::basegfx::B2DPoint aPoint(x,y);
aPoint *= aTransform;
const int nSrcX( ::basegfx::fround( aPoint.getX() ) );
const int nSrcY( ::basegfx::fround( aPoint.getY() ) );
const tools::Long nSrcX( ::basegfx::fround<tools::Long>( aPoint.getX() ) );
const tools::Long nSrcY( ::basegfx::fround<tools::Long>( aPoint.getY() ) );
if( nSrcX < 0 || nSrcX >= aBmpSize.Width() ||
nSrcY < 0 || nSrcY >= aBmpSize.Height() )
{
@ -519,8 +519,8 @@ BitmapEx DrawBitmapInRect( const BitmapEx& rBitmap,
if( rBitmapRect.isEmpty() || rDestRect.isEmpty() )
return BitmapEx();
const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ),
::basegfx::fround( rDestRect.getHeight() ) );
const Size aDestBmpSize( ::basegfx::fround<tools::Long>( rDestRect.getWidth() ),
::basegfx::fround<tools::Long>( rDestRect.getHeight() ) );
Bitmap aSrcBitmap( rBitmap.GetBitmap() );
Bitmap aSrcAlpha;

View File

@ -221,11 +221,11 @@ namespace
rTarget.AddAction(
new MetaBmpExScaleAction(
Point(
basegfx::fround(aLogicBitmapRange.getMinX()),
basegfx::fround(aLogicBitmapRange.getMinY())),
basegfx::fround<tools::Long>(aLogicBitmapRange.getMinX()),
basegfx::fround<tools::Long>(aLogicBitmapRange.getMinY())),
Size(
basegfx::fround(aLogicBitmapRange.getWidth()),
basegfx::fround(aLogicBitmapRange.getHeight())),
basegfx::fround<tools::Long>(aLogicBitmapRange.getWidth()),
basegfx::fround<tools::Long>(aLogicBitmapRange.getHeight())),
BitmapEx(rBitmapEx.GetBitmap(), aAlpha)));
return true;

View File

@ -546,13 +546,13 @@ Bitmap ImpGraphic::getBitmap(const GraphicConversionParameters& rParameters) con
if(fWH <= 1.0)
{
aDrawSize.setWidth(basegfx::fround(GRAPHIC_MTFTOBMP_MAXEXT * fWH));
aDrawSize.setWidth(basegfx::fround<tools::Long>(GRAPHIC_MTFTOBMP_MAXEXT * fWH));
aDrawSize.setHeight(GRAPHIC_MTFTOBMP_MAXEXT);
}
else
{
aDrawSize.setWidth(GRAPHIC_MTFTOBMP_MAXEXT);
aDrawSize.setHeight(basegfx::fround(GRAPHIC_MTFTOBMP_MAXEXT / fWH));
aDrawSize.setHeight(basegfx::fround<tools::Long>(GRAPHIC_MTFTOBMP_MAXEXT / fWH));
}
}
@ -774,7 +774,7 @@ Size ImpGraphic::getPrefSize() const
aSize = Size(basegfx::fround(rRange.getWidth() / 20.0f), basegfx::fround(rRange.getHeight() / 20.0f));
else
#endif
aSize = Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight()));
aSize = Size(basegfx::fround<tools::Long>(rRange.getWidth()), basegfx::fround<tools::Long>(rRange.getHeight()));
}
else
{

View File

@ -1245,8 +1245,8 @@ tools::Rectangle vcl::Region::GetBoundRect() const
{
// #i122149# corrected rounding, no need for ceil() and floor() here
return tools::Rectangle(
basegfx::fround(aRange.getMinX()), basegfx::fround(aRange.getMinY()),
basegfx::fround(aRange.getMaxX()), basegfx::fround(aRange.getMaxY()));
basegfx::fround<tools::Long>(aRange.getMinX()), basegfx::fround<tools::Long>(aRange.getMinY()),
basegfx::fround<tools::Long>(aRange.getMaxX()), basegfx::fround<tools::Long>(aRange.getMaxY()));
}
}

View File

@ -701,8 +701,8 @@ void RegionBand::Scale(double fScaleX, double fScaleY)
// process the vertical move
if(0.0 != fScaleY)
{
pBand->mnYTop = basegfx::fround(pBand->mnYTop * fScaleY);
pBand->mnYBottom = basegfx::fround(pBand->mnYBottom * fScaleY);
pBand->mnYTop = basegfx::fround<tools::Long>(pBand->mnYTop * fScaleY);
pBand->mnYBottom = basegfx::fround<tools::Long>(pBand->mnYBottom * fScaleY);
}
// process the horizontal move

View File

@ -743,10 +743,10 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
const double fFactorX(static_cast<double>(aBitmapEx.GetSizePixel().Width()) / aSrcSizePixel.Width());
const double fFactorY(static_cast<double>(aBitmapEx.GetSizePixel().Height()) / aSrcSizePixel.Height());
aCropLeftTop.setWidth( basegfx::fround(aCropLeftTop.Width() * fFactorX) );
aCropLeftTop.setHeight( basegfx::fround(aCropLeftTop.Height() * fFactorY) );
aCropRightBottom.setWidth( basegfx::fround(aCropRightBottom.Width() * fFactorX) );
aCropRightBottom.setHeight( basegfx::fround(aCropRightBottom.Height() * fFactorY) );
aCropLeftTop.setWidth( basegfx::fround<tools::Long>(aCropLeftTop.Width() * fFactorX) );
aCropLeftTop.setHeight( basegfx::fround<tools::Long>(aCropLeftTop.Height() * fFactorY) );
aCropRightBottom.setWidth( basegfx::fround<tools::Long>(aCropRightBottom.Width() * fFactorX) );
aCropRightBottom.setHeight( basegfx::fround<tools::Long>(aCropRightBottom.Height() * fFactorY) );
aSrcSizePixel = aBitmapEx.GetSizePixel();
}

View File

@ -542,10 +542,10 @@ void OutputDevice::DrawTransformedBitmapEx(
// with no rotation, shear or mirroring it can be mapped to DrawBitmapEx
// do *not* execute the mirroring here, it's done in the fallback
// #i124580# the correct DestSize needs to be calculated based on MaxXY values
Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
Point aDestPt(basegfx::fround<tools::Long>(aTranslate.getX()), basegfx::fround<tools::Long>(aTranslate.getY()));
const Size aDestSize(
basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
basegfx::fround<tools::Long>(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround<tools::Long>(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
const Point aOrigin = GetMapMode().GetOrigin();
if (!bMetafile && comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MapUnit::MapPixel)
{
@ -572,10 +572,10 @@ void OutputDevice::DrawTransformedBitmapEx(
// with no rotation or shear it can be mapped to DrawBitmapEx
// do *not* execute the mirroring here, it's done in the fallback
// #i124580# the correct DestSize needs to be calculated based on MaxXY values
const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
const Point aDestPt(basegfx::fround<tools::Long>(aTranslate.getX()), basegfx::fround<tools::Long>(aTranslate.getY()));
const Size aDestSize(
basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
basegfx::fround<tools::Long>(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround<tools::Long>(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
DrawBitmapEx(aDestPt, aDestSize, bitmapEx);
return;
@ -669,10 +669,10 @@ void OutputDevice::DrawTransformedBitmapEx(
// extract point and size; do not remove size, the bitmap may have been prepared reduced by purpose
// #i124580# the correct DestSize needs to be calculated based on MaxXY values
const Point aDestPt(basegfx::fround(aVisibleRange.getMinX()), basegfx::fround(aVisibleRange.getMinY()));
const Point aDestPt(basegfx::fround<tools::Long>(aVisibleRange.getMinX()), basegfx::fround<tools::Long>(aVisibleRange.getMinY()));
const Size aDestSize(
basegfx::fround(aVisibleRange.getMaxX()) - aDestPt.X(),
basegfx::fround(aVisibleRange.getMaxY()) - aDestPt.Y());
basegfx::fround<tools::Long>(aVisibleRange.getMaxX()) - aDestPt.X(),
basegfx::fround<tools::Long>(aVisibleRange.getMaxY()) - aDestPt.Y());
DrawBitmapEx(aDestPt, aDestSize, aTransformed);
}

View File

@ -782,7 +782,7 @@ tools::Long OutputDevice::GetTextArray( const OUString& rStr, KernArray* pKernAr
if (mbMap)
nWidth = ImplDevicePixelToLogicWidth( nWidth );
return basegfx::fround(nWidth);
return basegfx::fround<tools::Long>(nWidth);
}
void OutputDevice::GetCaretPositions( const OUString& rStr, KernArray& rCaretXArray,

View File

@ -324,7 +324,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
const double fRatio(static_cast<double>(maPreviewSize.getWidth()) / static_cast<double>(maPreviewSize.getHeight()));
const double fNewWidth(sqrt(static_cast<double>(nPlannedSquarePixels) * fRatio));
const double fNewHeight(sqrt(static_cast<double>(nPlannedSquarePixels) / fRatio));
const Size aScaledSize(basegfx::fround(fNewWidth), basegfx::fround(fNewHeight));
const Size aScaledSize(basegfx::fround<tools::Long>(fNewWidth), basegfx::fround<tools::Long>(fNewHeight));
// check if this eventual maximum is already reached
// due to having hit the MaxSquarePixels. Due to using
@ -403,7 +403,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
fScale *= fCorrection;
}
const Size aScaledSize2(basegfx::fround(fWidth), basegfx::fround(fHeight));
const Size aScaledSize2(basegfx::fround<tools::Long>(fWidth), basegfx::fround<tools::Long>(fHeight));
pPrerenderVDev->SetOutputSizePixel(aScaledSize2, false);
aLogicSize = pPrerenderVDev->PixelToLogic( aScaledSize2, MapMode( MapUnit::Map100thMM ) );
}

View File

@ -2649,8 +2649,8 @@ bool WinSalGraphicsImpl::drawTransformedBitmap(
if(nSrcWidth && nSrcHeight)
{
const tools::Long nDestWidth(basegfx::fround(basegfx::B2DVector(rX - rNull).getLength()));
const tools::Long nDestHeight(basegfx::fround(basegfx::B2DVector(rY - rNull).getLength()));
const tools::Long nDestWidth(basegfx::fround<tools::Long>(basegfx::B2DVector(rX - rNull).getLength()));
const tools::Long nDestHeight(basegfx::fround<tools::Long>(basegfx::B2DVector(rY - rNull).getLength()));
if(nDestWidth && nDestHeight)
{