Kaydet (Commit) 2882c0fd authored tarafından Caolán McNamara's avatar Caolán McNamara

GetCharWidths always returns true

Change-Id: I4a58b203a7c18484c3405f918e77297ac764725d
Reviewed-on: https://gerrit.libreoffice.org/57925
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1fbbc34a
...@@ -344,7 +344,7 @@ private: ...@@ -344,7 +344,7 @@ private:
void Justify(DeviceCoordinate nNewWidth); void Justify(DeviceCoordinate nNewWidth);
void ApplyAsianKerning(const OUString& rStr); void ApplyAsianKerning(const OUString& rStr);
bool GetCharWidths(DeviceCoordinate* pCharWidths) const; void GetCharWidths(DeviceCoordinate* pCharWidths) const;
void SetNeedFallback(ImplLayoutArgs&, sal_Int32, bool); void SetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
......
...@@ -572,7 +572,7 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs) ...@@ -572,7 +572,7 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs)
return true; return true;
} }
bool GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const void GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
{ {
const int nCharCount = mnEndCharPos - mnMinCharPos; const int nCharCount = mnEndCharPos - mnMinCharPos;
...@@ -586,8 +586,6 @@ bool GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const ...@@ -586,8 +586,6 @@ bool GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
continue; continue;
pCharWidths[nIndex] += aGlyphItem.mnNewWidth; pCharWidths[nIndex] += aGlyphItem.mnNewWidth;
} }
return true;
} }
// A note on how Kashida justification is implemented (because it took me 5 // A note on how Kashida justification is implemented (because it took me 5
......
...@@ -693,9 +693,8 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, tools::Rectangle& rRect ...@@ -693,9 +693,8 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, tools::Rectangle& rRect
DeviceCoordinate GenericSalLayout::FillDXArray( DeviceCoordinate* pCharWidths ) const DeviceCoordinate GenericSalLayout::FillDXArray( DeviceCoordinate* pCharWidths ) const
{ {
if( pCharWidths ) if (pCharWidths)
if( !GetCharWidths( pCharWidths ) ) GetCharWidths(pCharWidths);
return 0;
return GetTextWidth(); return GetTextWidth();
} }
...@@ -877,8 +876,7 @@ sal_Int32 GenericSalLayout::GetTextBreak( DeviceCoordinate nMaxWidth, DeviceCoor ...@@ -877,8 +876,7 @@ sal_Int32 GenericSalLayout::GetTextBreak( DeviceCoordinate nMaxWidth, DeviceCoor
{ {
int nCharCapacity = mnEndCharPos - mnMinCharPos; int nCharCapacity = mnEndCharPos - mnMinCharPos;
std::unique_ptr<DeviceCoordinate[]> const pCharWidths(new DeviceCoordinate[nCharCapacity]); std::unique_ptr<DeviceCoordinate[]> const pCharWidths(new DeviceCoordinate[nCharCapacity]);
if (!GetCharWidths(pCharWidths.get())) GetCharWidths(pCharWidths.get());
return -1;
DeviceCoordinate nWidth = 0; DeviceCoordinate nWidth = 0;
for( int i = mnMinCharPos; i < mnEndCharPos; ++i ) for( int i = mnMinCharPos; i < mnEndCharPos; ++i )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment