summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-24 15:01:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-07-24 22:08:41 +0200
commit2882c0fd4740e35f03e0a800b8f6b33fb06cf8f2 (patch)
tree6dab045d3634445309803594330bc6cdca17751e /vcl
parent1fbbc34a4d25c479ebec1f1419b50bbd3c312127 (diff)
GetCharWidths always returns true
Change-Id: I4a58b203a7c18484c3405f918e77297ac764725d Reviewed-on: https://gerrit.libreoffice.org/57925 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/sallayout.hxx2
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx4
-rw-r--r--vcl/source/gdi/sallayout.cxx8
3 files changed, 5 insertions, 9 deletions
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 8daed9a01d09..b6fc7ed75a5c 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -344,7 +344,7 @@ private:
void Justify(DeviceCoordinate nNewWidth);
void ApplyAsianKerning(const OUString& rStr);
- bool GetCharWidths(DeviceCoordinate* pCharWidths) const;
+ void GetCharWidths(DeviceCoordinate* pCharWidths) const;
void SetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 647788129d32..3d5d235fb601 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -572,7 +572,7 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs)
return true;
}
-bool GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
+void GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
{
const int nCharCount = mnEndCharPos - mnMinCharPos;
@@ -586,8 +586,6 @@ bool GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const
continue;
pCharWidths[nIndex] += aGlyphItem.mnNewWidth;
}
-
- return true;
}
// A note on how Kashida justification is implemented (because it took me 5
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index a738a1d5168b..d921354879fc 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -693,9 +693,8 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, tools::Rectangle& rRect
DeviceCoordinate GenericSalLayout::FillDXArray( DeviceCoordinate* pCharWidths ) const
{
- if( pCharWidths )
- if( !GetCharWidths( pCharWidths ) )
- return 0;
+ if (pCharWidths)
+ GetCharWidths(pCharWidths);
return GetTextWidth();
}
@@ -877,8 +876,7 @@ sal_Int32 GenericSalLayout::GetTextBreak( DeviceCoordinate nMaxWidth, DeviceCoor
{
int nCharCapacity = mnEndCharPos - mnMinCharPos;
std::unique_ptr<DeviceCoordinate[]> const pCharWidths(new DeviceCoordinate[nCharCapacity]);
- if (!GetCharWidths(pCharWidths.get()))
- return -1;
+ GetCharWidths(pCharWidths.get());
DeviceCoordinate nWidth = 0;
for( int i = mnMinCharPos; i < mnEndCharPos; ++i )