diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-28 09:27:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-29 12:38:51 +0200 |
commit | 894b4911ffb96ff667fdeb3aec7922316ab7230a (patch) | |
tree | 3942ed8088c058b70bb79984b186c5156284abf4 /vcl/source/control/calendar.cxx | |
parent | 5b0ae3b59cd2cccfb72d991657366eb2a69bff49 (diff) |
pass DX array around using o3tl::span instead of pointer
so we get bounds checking in debug mode
Note that I cannot just pass around the std::vectors
involved because there is a place in editeng which
calls with a subset of a vector.
Change-Id: I5088a139593c27bf9cbe5d843ab4b0048ac6d508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124330
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control/calendar.cxx')
-rw-r--r-- | vcl/source/control/calendar.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx index 4beea72b5e83..2d5910a920f0 100644 --- a/vcl/source/control/calendar.cxx +++ b/vcl/source/control/calendar.cxx @@ -704,7 +704,10 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext) rRenderContext.SetLineColor(rStyleSettings.GetWindowTextColor()); Point aStartPos(nDayX, nDeltaY); rRenderContext.DrawLine(aStartPos, Point(nDayX + (7 * mnDayWidth), nDeltaY)); - rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, &(mnDayOfWeekAry[1])); + std::vector<tools::Long> aTmp; + for (int k=0; k<6; ++k) + aTmp.push_back(mnDayOfWeekAry[k+1]); + rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, {aTmp.data(), aTmp.size()}); // display days sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth(); |