vcl: rename opaque ENTER4 function in map.cxx
The function ENTER4 in vcl/source/outdev/map.cxx has a name that gives no indication of its purpose, making the code difficult to read. This function calculates the map resolutions for a source and destination MapMode using a standardized 72 DPI, which is necessary for logical unit conversions. Rename it to lcl_calcConversionMapRes to clearly reflect its purpose and improve maintainability. Change-Id: I2cc265c07c4108a3a3a37356a148ae9ea37a3b9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196467 Tested-by: Jenkins Reviewed-by: Dan Williams <dcbw@libreoffice.org>
This commit is contained in:
committed by
Michael Weghorn
parent
05f7513a5f
commit
9007c815c5
@@ -1349,7 +1349,7 @@ auto getCorrectedUnit(MapUnit eMapSrc, MapUnit eMapDst)
|
||||
return std::make_pair(eSrc, eDst);
|
||||
}
|
||||
|
||||
std::pair<ImplMapRes, ImplMapRes> ENTER4(const MapMode& rMMSource, const MapMode& rMMDest)
|
||||
std::pair<ImplMapRes, ImplMapRes> lcl_calcConversionMapRes(const MapMode& rMMSource, const MapMode& rMMDest)
|
||||
{
|
||||
std::pair<ImplMapRes, ImplMapRes> result;
|
||||
lcl_calcMapResolution(rMMSource, 72, 72, result.first);
|
||||
@@ -1476,7 +1476,7 @@ Point OutputDevice::LogicToLogic( const Point& rPtSource,
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto [aMapResSource, aMapResDest] = ENTER4( rMapModeSource, rMapModeDest );
|
||||
const auto [aMapResSource, aMapResDest] = lcl_calcConversionMapRes( rMapModeSource, rMapModeDest );
|
||||
|
||||
return Point( lcl_scaleLogicValue( rPtSource.X() + aMapResSource.mnMapOfsX,
|
||||
aMapResSource.mfMapScX, aMapResDest.mfMapScX ) -
|
||||
@@ -1505,7 +1505,7 @@ Size OutputDevice::LogicToLogic( const Size& rSzSource,
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto [aMapResSource, aMapResDest] = ENTER4( rMapModeSource, rMapModeDest );
|
||||
const auto [aMapResSource, aMapResDest] = lcl_calcConversionMapRes( rMapModeSource, rMapModeDest );
|
||||
|
||||
return Size( lcl_scaleLogicValue( rSzSource.Width(),
|
||||
aMapResSource.mfMapScX, aMapResDest.mfMapScX ),
|
||||
@@ -1554,7 +1554,7 @@ basegfx::B2DHomMatrix OutputDevice::LogicToLogic(const MapMode& rMapModeSource,
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto [aMapResSource, aMapResDest] = ENTER4(rMapModeSource, rMapModeDest);
|
||||
const auto [aMapResSource, aMapResDest] = lcl_calcConversionMapRes(rMapModeSource, rMapModeDest);
|
||||
|
||||
const double fScaleFactorX(aMapResSource.mfMapScX / aMapResDest.mfMapScX);
|
||||
const double fScaleFactorY(aMapResSource.mfMapScY / aMapResDest.mfMapScY);
|
||||
@@ -1598,7 +1598,7 @@ tools::Rectangle OutputDevice::LogicToLogic( const tools::Rectangle& rRectSource
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto [aMapResSource, aMapResDest] = ENTER4( rMapModeSource, rMapModeDest );
|
||||
const auto [aMapResSource, aMapResDest] = lcl_calcConversionMapRes( rMapModeSource, rMapModeDest );
|
||||
|
||||
auto left = lcl_scaleLogicValue( rRectSource.Left() + aMapResSource.mnMapOfsX,
|
||||
aMapResSource.mfMapScX, aMapResDest.mfMapScX ) -
|
||||
|
||||
Reference in New Issue
Block a user