diff options
-rw-r--r-- | include/vcl/outdev.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/ImplLayoutArgs.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/sallayout.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 30 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 10 | ||||
-rw-r--r-- | vcl/source/text/ImplLayoutArgs.cxx | 2 |
6 files changed, 25 insertions, 25 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index cfa423759202..f898f4f13902 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1232,7 +1232,7 @@ public: const SalLayoutGlyphs* pGlyphs = nullptr) const; SAL_DLLPRIVATE vcl::text::ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen, - DeviceCoordinate nPixelWidth, + double nPixelWidth, SalLayoutFlags flags = SalLayoutFlags::NONE, vcl::text::TextLayoutCache const* = nullptr) const; SAL_DLLPRIVATE std::unique_ptr<SalLayout> diff --git a/vcl/inc/ImplLayoutArgs.hxx b/vcl/inc/ImplLayoutArgs.hxx index d7100d71fd8b..1802ce19decd 100644 --- a/vcl/inc/ImplLayoutArgs.hxx +++ b/vcl/inc/ImplLayoutArgs.hxx @@ -37,7 +37,7 @@ public: // positioning related inputs const double* mpDXArray; // in floating point pixel units const sal_Bool* mpKashidaArray; - DeviceCoordinate mnLayoutWidth; // in pixel units + double mnLayoutWidth; // in pixel units Degree10 mnOrientation; // in 0-3600 system // data for bidi and glyph+script fallback @@ -47,7 +47,7 @@ public: ImplLayoutArgs(OUString const& rStr, int nMinCharPos, int nEndCharPos, SalLayoutFlags nFlags, LanguageTag aLanguageTag, vcl::text::TextLayoutCache const* pLayoutCache); - void SetLayoutWidth(DeviceCoordinate nWidth); + void SetLayoutWidth(double nWidth); void SetDXArray(const double* pDXArray); void SetKashidaArray(const sal_Bool* pKashidaArray); void SetOrientation(Degree10 nOrientation); diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 51f62d9b0057..274de68a0400 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -141,7 +141,7 @@ private: GenericSalLayout& operator=( const GenericSalLayout& ) = delete; void ApplyDXArray(const double*, const sal_Bool*); - void Justify(DeviceCoordinate nNewWidth); + void Justify(double nNewWidth); void ApplyAsianKerning(std::u16string_view rStr); void GetCharWidths(std::vector<double>& rCharWidths, diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index da70859f4c53..ba2f1e050dca 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -276,9 +276,9 @@ double GenericSalLayout::GetTextWidth() const return nWidth; } -void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) +void GenericSalLayout::Justify(double nNewWidth) { - DeviceCoordinate nOldWidth = GetTextWidth(); + double nOldWidth = GetTextWidth(); if( !nOldWidth || nNewWidth==nOldWidth ) return; @@ -292,7 +292,7 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) std::vector<GlyphItem>::iterator pGlyphIter; // count stretchable glyphs int nStretchable = 0; - int nMaxGlyphWidth = 0; + double nMaxGlyphWidth = 0; for(pGlyphIter = m_GlyphItems.begin(); pGlyphIter != pGlyphIterRight; ++pGlyphIter) { if( !pGlyphIter->IsInCluster() ) @@ -311,7 +311,7 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) pGlyphIterRight->setLinearPosX( nNewWidth ); // justify glyph widths and positions - int nDiffWidth = nNewWidth - nOldWidth; + double nDiffWidth = nNewWidth - nOldWidth; if( nDiffWidth >= 0) // expanded case { // expand width by distributing space between glyphs evenly @@ -326,7 +326,7 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) continue; // distribute extra space equally to stretchable glyphs - int nDeltaWidth = nDiffWidth / nStretchable--; + double nDeltaWidth = nDiffWidth / nStretchable--; nDiffWidth -= nDeltaWidth; pGlyphIter->addNewWidth(nDeltaWidth); nDeltaSum += nDeltaWidth; @@ -335,13 +335,13 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) else // condensed case { // squeeze width by moving glyphs proportionally - double fSqueeze = static_cast<double>(nNewWidth) / nOldWidth; + double fSqueeze = nNewWidth / nOldWidth; if(m_GlyphItems.size() > 1) { for( pGlyphIter = m_GlyphItems.begin(); ++pGlyphIter != pGlyphIterRight;) { - int nX = pGlyphIter->linearPos().getX(); - nX = static_cast<int>(nX * fSqueeze); + double nX = pGlyphIter->linearPos().getX(); + nX = nX * fSqueeze; pGlyphIter->setLinearPosX( nX ); } } @@ -423,7 +423,7 @@ void GenericSalLayout::ApplyAsianKerning(std::u16string_view rStr) continue; // apply punctuation compression to logical glyph widths - DeviceCoordinate nDelta = (nKernCurrent < nKernNext) ? nKernCurrent : nKernNext; + double nDelta = (nKernCurrent < nKernNext) ? nKernCurrent : nKernNext; if (nDelta < 0) { nDelta = (nDelta * pGlyphIter->origWidth() + 2) / 4; @@ -640,7 +640,7 @@ void MultiSalLayout::AdjustLayout( vcl::text::ImplLayoutArgs& rArgs ) { // for stretched text in a MultiSalLayout the target width needs to be // distributed by individually adjusting its virtual character widths - DeviceCoordinate nTargetWidth = aMultiArgs.mnLayoutWidth; + double nTargetWidth = aMultiArgs.mnLayoutWidth; aMultiArgs.mnLayoutWidth = 0; // we need to get the original unmodified layouts ready @@ -652,7 +652,7 @@ void MultiSalLayout::AdjustLayout( vcl::text::ImplLayoutArgs& rArgs ) // #i17359# multilayout is not simplified yet, so calculating the // unjustified width needs handholding; also count the number of // stretchable virtual char widths - DeviceCoordinate nOrigWidth = 0; + double nOrigWidth = 0; int nStretchable = 0; for( int i = 0; i < nCharCount; ++i ) { @@ -665,14 +665,14 @@ void MultiSalLayout::AdjustLayout( vcl::text::ImplLayoutArgs& rArgs ) // now we are able to distribute the extra width over the virtual char widths if( nOrigWidth && (nTargetWidth != nOrigWidth) ) { - DeviceCoordinate nDiffWidth = nTargetWidth - nOrigWidth; - DeviceCoordinate nWidthSum = 0; + double nDiffWidth = nTargetWidth - nOrigWidth; + double nWidthSum = 0; for( int i = 0; i < nCharCount; ++i ) { - DeviceCoordinate nJustWidth = aJustificationArray[i]; + double nJustWidth = aJustificationArray[i]; if( (nJustWidth > 0) && (nStretchable > 0) ) { - DeviceCoordinate nDeltaWidth = nDiffWidth / nStretchable; + double nDeltaWidth = nDiffWidth / nStretchable; nJustWidth += nDeltaWidth; nDiffWidth -= nDeltaWidth; --nStretchable; diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 81f4aa095840..6e35beccfec0 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1115,7 +1115,7 @@ void OutputDevice::DrawStretchText( const Point& rStartPt, sal_Int32 nWidth, vcl::text::ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, const sal_Int32 nMinIndex, const sal_Int32 nLen, - DeviceCoordinate nPixelWidth, + double nPixelWidth, SalLayoutFlags nLayoutFlags, vcl::text::TextLayoutCache const*const pLayoutCache) const { @@ -1328,17 +1328,17 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, pGlyphs = nullptr; } - DeviceCoordinate nPixelWidth = static_cast<DeviceCoordinate>(nLogicalWidth); + double nPixelWidth = nLogicalWidth; if( nLogicalWidth && mbMap ) { // convert from logical units to physical units - nPixelWidth = LogicWidthToDeviceCoordinate( nLogicalWidth ); + nPixelWidth = ImplLogicWidthToDeviceSubPixel(nLogicalWidth); } vcl::text::ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen, nPixelWidth, flags, pLayoutCache); - DeviceCoordinate nEndGlyphCoord(0); + double nEndGlyphCoord(0); std::unique_ptr<double[]> xDXPixelArray; if( !pDXArray.empty() ) { @@ -1405,7 +1405,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, // adjust to right alignment if necessary if( aLayoutArgs.mnFlags & SalLayoutFlags::RightAlign ) { - DeviceCoordinate nRTLOffset; + double nRTLOffset; if (!pDXArray.empty()) nRTLOffset = nEndGlyphCoord; else if( nPixelWidth ) diff --git a/vcl/source/text/ImplLayoutArgs.cxx b/vcl/source/text/ImplLayoutArgs.cxx index 80aec6b5f42c..826d288bba6f 100644 --- a/vcl/source/text/ImplLayoutArgs.cxx +++ b/vcl/source/text/ImplLayoutArgs.cxx @@ -88,7 +88,7 @@ ImplLayoutArgs::ImplLayoutArgs(const OUString& rStr, int nMinCharPos, int nEndCh maRuns.ResetPos(); } -void ImplLayoutArgs::SetLayoutWidth(DeviceCoordinate nWidth) { mnLayoutWidth = nWidth; } +void ImplLayoutArgs::SetLayoutWidth(double nWidth) { mnLayoutWidth = nWidth; } void ImplLayoutArgs::SetDXArray(double const* pDXArray) { mpDXArray = pDXArray; } |