summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/filter/svm/SvmConverter.cxx6
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx4
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx3
-rw-r--r--vcl/source/gdi/metaact.cxx6
-rw-r--r--vcl/source/outdev/text.cxx32
5 files changed, 19 insertions, 32 deletions
diff --git a/vcl/source/filter/svm/SvmConverter.cxx b/vcl/source/filter/svm/SvmConverter.cxx
index 2b5a65b189ce..a192d66df890 100644
--- a/vcl/source/filter/svm/SvmConverter.cxx
+++ b/vcl/source/filter/svm/SvmConverter.cxx
@@ -770,7 +770,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
for (sal_Int32 j = 0; j < nAryLen; ++j)
{
rIStm.ReadInt32( nTmp );
- aDXAry.set(j, nTmp);
+ aDXAry[j] = nTmp;
}
// #106172# Add last DX array elem, if missing
@@ -794,9 +794,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
// difference to last elem and store
// in very last.
if( nStrLen > 1 )
- aDXAry.set(nStrLen-1, aDXAry[ nStrLen-2 ] + aTmpAry[ nStrLen-1 ] - aTmpAry[ nStrLen-2 ]);
+ aDXAry[nStrLen-1] = aDXAry[ nStrLen-2 ] + aTmpAry[ nStrLen-1 ] - aTmpAry[ nStrLen-2 ];
else
- aDXAry.set(nStrLen-1, aTmpAry[ nStrLen-1 ]); // len=1: 0th position taken to be 0
+ aDXAry[nStrLen-1] = aTmpAry[ nStrLen-1 ]; // len=1: 0th position taken to be 0
}
}
#ifdef DBG_UTIL
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index c9c08d590174..fb248fd9f3e0 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -891,13 +891,13 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const OUString& rText, K
{
if (!pDXArray.empty())
{
- aOwnArray.assign(pDXArray);
+ aOwnArray.assign(pDXArray.begin(), pDXArray.end());
pDX = aOwnArray;
}
const double fFactor = static_cast<double>(nWidth) / nNormWidth;
for( i = 0; i < ( nLen - 1 ); i++ )
- aOwnArray.set(i, basegfx::fround(aOwnArray[i] * fFactor));
+ aOwnArray[i] *= fFactor;
}
}
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index bd4f8b5d8fc6..06fb75d61ca0 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1204,8 +1204,9 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
}
else
{
+ const double fAdjust = static_cast<double>(pA->GetWidth()) / nNormSize;
for ( sal_Int32 i = 0; i < ( nLen - 1 ); i++ )
- aDXAry.set(i, aDXAry[i] * static_cast<sal_Int32>(pA->GetWidth()) / nNormSize);
+ aDXAry[i] *= fAdjust;
if ( ( nLen <= 1 ) || ( static_cast<sal_Int32>(pA->GetWidth()) == nNormSize ) )
aDXAry.clear();
aSrcLineInfo = LineInfo();
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 944a1e114128..b5f1eac47761 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -677,7 +677,7 @@ MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt,
mnIndex ( nIndex ),
mnLen ( nLen )
{
- maDXAry.assign(pDXAry);
+ maDXAry.assign(pDXAry.begin(), pDXAry.end());
}
MetaTextArrayAction::MetaTextArrayAction(const Point& rStartPt, OUString aStr, KernArraySpan pDXAry,
@@ -693,7 +693,7 @@ MetaTextArrayAction::MetaTextArrayAction(const Point& rStartPt, OUString aStr, K
, mnLayoutContextIndex(nLayoutContextIndex)
, mnLayoutContextLen(nLayoutContextLen)
{
- maDXAry.assign(pDXAry);
+ maDXAry.assign(pDXAry.begin(), pDXAry.end());
}
MetaTextArrayAction::~MetaTextArrayAction()
@@ -733,7 +733,7 @@ void MetaTextArrayAction::Scale( double fScaleX, double fScaleY )
if ( !maDXAry.empty() && mnLen )
{
for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
- maDXAry.set(i, basegfx::fround(maDXAry[i] * fabs(fScaleX)));
+ maDXAry[i] *= fabs(fScaleX);
}
}
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 4113121b6820..ff83e0807a59 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -814,7 +814,7 @@ OutputDevice::GetPartialTextArray(const OUString& rStr, KernArray* pKernArray, s
nPartLen = rStr.getLength() - nPartIndex;
}
- std::vector<sal_Int32>* pDXAry = pKernArray ? &pKernArray->get_subunit_array() : nullptr;
+ KernArray* pDXAry = pKernArray;
// do layout
std::unique_ptr<SalLayout> pSalLayout;
@@ -885,16 +885,10 @@ OutputDevice::GetPartialTextArray(const OUString& rStr, KernArray* pKernArray, s
if (pDXPixelArray)
{
assert(pKernArray && "pDXPixelArray depends on pKernArray existing");
- int nSubPixelFactor = pKernArray->get_factor();
if (mbMap)
{
for (int i = 0; i < nPartLen; ++i)
- (*pDXPixelArray)[i] = ImplDevicePixelToLogicWidthDouble((*pDXPixelArray)[i] * nSubPixelFactor);
- }
- else if (nSubPixelFactor)
- {
- for (int i = 0; i < nPartLen; ++i)
- (*pDXPixelArray)[i] *= nSubPixelFactor;
+ (*pDXPixelArray)[i] = ImplDevicePixelToLogicWidthDouble((*pDXPixelArray)[i]);
}
}
@@ -902,7 +896,7 @@ OutputDevice::GetPartialTextArray(const OUString& rStr, KernArray* pKernArray, s
{
pDXAry->resize(nPartLen);
for (int i = 0; i < nPartLen; ++i)
- (*pDXAry)[i] = basegfx::fround((*pDXPixelArray)[i]);
+ (*pDXAry)[i] = (*pDXPixelArray)[i];
}
vcl::TextArrayMetrics stReturnValue;
@@ -919,7 +913,7 @@ OutputDevice::GetPartialTextArray(const OUString& rStr, KernArray* pKernArray, s
return stReturnValue;
}
-void OutputDevice::GetCaretPositions( const OUString& rStr, KernArray& rCaretXArray,
+void OutputDevice::GetCaretPositions( const OUString& rStr, KernArray& rCaretPos,
sal_Int32 nIndex, sal_Int32 nLen,
const SalLayoutGlyphs* pGlyphs ) const
{
@@ -930,7 +924,6 @@ void OutputDevice::GetCaretPositions( const OUString& rStr, KernArray& rCaretXAr
nLen = rStr.getLength() - nIndex;
sal_Int32 nCaretPos = nLen * 2;
- std::vector<sal_Int32>& rCaretPos = rCaretXArray.get_subunit_array();
rCaretPos.resize(nCaretPos);
// do layout
@@ -950,7 +943,7 @@ void OutputDevice::GetCaretPositions( const OUString& rStr, KernArray& rCaretXAr
for (i = 0; i < nCaretPos; ++i)
if (aCaretPixelPos[i] >= 0)
break;
- tools::Long nXPos = (i < nCaretPos) ? aCaretPixelPos[i] : -1;
+ double nXPos = (i < nCaretPos) ? aCaretPixelPos[i] : -1;
for (i = 0; i < nCaretPos; ++i)
{
if (aCaretPixelPos[i] >= 0)
@@ -967,21 +960,15 @@ void OutputDevice::GetCaretPositions( const OUString& rStr, KernArray& rCaretXAr
aCaretPixelPos[i] = nWidth - aCaretPixelPos[i] - 1;
}
- int nSubPixelFactor = rCaretXArray.get_factor();
// convert from font units to logical units
if( mbMap )
{
for (i = 0; i < nCaretPos; ++i)
- aCaretPixelPos[i] = ImplDevicePixelToLogicWidth(aCaretPixelPos[i] * nSubPixelFactor);
- }
- else if (nSubPixelFactor)
- {
- for (i = 0; i < nCaretPos; ++i)
- aCaretPixelPos[i] *= nSubPixelFactor;
+ aCaretPixelPos[i] = ImplDevicePixelToLogicWidthDouble(aCaretPixelPos[i]);
}
for (i = 0; i < nCaretPos; ++i)
- rCaretPos[i] = basegfx::fround(aCaretPixelPos[i]);
+ rCaretPos[i] = aCaretPixelPos[i];
}
void OutputDevice::DrawStretchText( const Point& rStartPt, sal_Int32 nWidth,
@@ -1266,12 +1253,11 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(
{
// convert from logical units to font units without rounding,
// keeping accuracy for lower levels
- int nSubPixels = pDXArray.get_factor();
for (int i = 0; i < nJustLen; ++i)
{
stJustification.SetTotalAdvance(
nJustMinCluster + i,
- ImplLogicWidthToDeviceSubPixel(pDXArray.get_subunit(i)) / nSubPixels);
+ ImplLogicWidthToDeviceSubPixel(pDXArray[i]));
}
nEndGlyphCoord = stJustification.GetTotalAdvance(nJustMinCluster + nJustLen - 1);
@@ -1280,7 +1266,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(
{
for (int i = 0; i < nJustLen; ++i)
{
- stJustification.SetTotalAdvance(nJustMinCluster + i, pDXArray.get(i));
+ stJustification.SetTotalAdvance(nJustMinCluster + i, pDXArray[i]);
}
nEndGlyphCoord