diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 5c611500572f..7969991f11d2 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -175,7 +175,8 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) if(rArgs.mpDXArray) { int nFullPixelWidth = nPixelWidth; - nPixelWidth = rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1]; + nPixelWidth = mnTrailingSpaceCount == mnCharCount + ? 0 : rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1]; mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth; } else