summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-11 16:26:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-01-11 20:35:39 +0100
commitf523c854a50358fe3434d8e65bd47f76ccc77b90 (patch)
tree92f1739bee19ab7a14a7f6f41830585bff677e7b
parent18bc9ea75daf4eb3520a4d0ef6649d92261012a6 (diff)
make VCL_FLOAT_DEVICE_PIXEL compile
Change-Id: I0673b77a24085a8f06471d67c4cfdec43047c226 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128290 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/outdev/map.cxx3
-rw-r--r--vcl/source/outdev/text.cxx17
2 files changed, 10 insertions, 10 deletions
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 112fd5322557..73badc74bcfc 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -1824,9 +1824,8 @@ DeviceCoordinate OutputDevice::LogicWidthToDeviceCoordinate( tools::Long nWidth
return static_cast<DeviceCoordinate>(nWidth);
#if VCL_FLOAT_DEVICE_PIXEL
- return (double)nWidth * maMapRes.mfScaleX * mnDPIX;
+ return ImplLogicToPixel(static_cast<double>(nWidth), mnDPIX, maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX);
#else
-
return ImplLogicToPixel(nWidth, mnDPIX, maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX);
#endif
}
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index a28dc49e5ebd..9a9e3d9f5399 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -986,12 +986,13 @@ tools::Long OutputDevice::GetTextArray( const OUString& rStr, std::vector<sal_In
}
#if VCL_FLOAT_DEVICE_PIXEL
- std::unique_ptr<DeviceCoordinate[]> pDXPixelArray;
+ std::unique_ptr<std::vector<DeviceCoordinate>> xDXPixelArray;
if(pDXAry)
{
- pDXPixelArray.reset(new DeviceCoordinate[nLen]);
+ xDXPixelArray.reset(new std::vector<DeviceCoordinate>(nLen));
}
- DeviceCoordinate nWidth = pSalLayout->FillDXArray( pDXPixelArray.get() );
+ std::vector<DeviceCoordinate>* pDXPixelArray = xDXPixelArray.get();
+ DeviceCoordinate nWidth = pSalLayout->FillDXArray(pDXPixelArray);
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
// convert virtual char widths to virtual absolute positions
@@ -999,7 +1000,7 @@ tools::Long OutputDevice::GetTextArray( const OUString& rStr, std::vector<sal_In
{
for( int i = 1; i < nLen; ++i )
{
- pDXPixelArray[ i ] += pDXPixelArray[ i-1 ];
+ (*pDXPixelArray)[i] += (*pDXPixelArray)[i - 1];
}
}
if( mbMap )
@@ -1008,7 +1009,7 @@ tools::Long OutputDevice::GetTextArray( const OUString& rStr, std::vector<sal_In
{
for( int i = 0; i < nLen; ++i )
{
- pDXPixelArray[i] = ImplDevicePixelToLogicWidth( pDXPixelArray[i] );
+ (*pDXPixelArray)[i] = ImplDevicePixelToLogicWidth((*pDXPixelArray)[i]);
}
}
nWidth = ImplDevicePixelToLogicWidth( nWidth );
@@ -1019,7 +1020,7 @@ tools::Long OutputDevice::GetTextArray( const OUString& rStr, std::vector<sal_In
{
for( int i = 0; i < nLen; ++i )
{
- pDXPixelArray[i] /= nWidthFactor;
+ (*pDXPixelArray)[i] /= nWidthFactor;
}
}
nWidth /= nWidthFactor;
@@ -1029,7 +1030,7 @@ tools::Long OutputDevice::GetTextArray( const OUString& rStr, std::vector<sal_In
pDXAry->resize(nLen);
for( int i = 0; i < nLen; ++i )
{
- (*pDXAry)[i] = basegfx::fround(pDXPixelArray[i]);
+ (*pDXAry)[i] = basegfx::fround((*pDXPixelArray)[i]);
}
}
return basegfx::fround(nWidth);
@@ -1361,7 +1362,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr,
pDXPixelArray = xDXPixelArray.get();
for( int i = 0; i < nLen; ++i )
{
- pDXPixelArray[i] = (*pDXArray)[i];
+ pDXPixelArray[i] = pDXArray[i];
}
#else /* !VCL_FLOAT_DEVICE_PIXEL */
pDXPixelArray = const_cast<DeviceCoordinate*>(pDXArray.data());