diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-01-21 09:45:29 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-01-21 09:45:29 +1100 |
commit | 2bd8a54e0624143ee5128d1e224b1635b2c5d1f4 (patch) | |
tree | 6acd5402304cd8f9efc400d11ca32dab95d5410d /cocoa/PlatCocoa.mm | |
parent | 56d581a730cd2c5dd0959c6b3bd532c9f5ad42e2 (diff) | |
download | scintilla-mirror-2bd8a54e0624143ee5128d1e224b1635b2c5d1f4.tar.gz |
Added ELEMENTS macro and use it to clarify determining size of arrays.
Diffstat (limited to 'cocoa/PlatCocoa.mm')
-rw-r--r-- | cocoa/PlatCocoa.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 3c952e039..304798cbb 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -26,6 +26,7 @@ #include <vector> #include <map> +#include "StringCopy.h" #include "XPM.h" #import <Foundation/NSGeometry.h> @@ -1053,7 +1054,7 @@ XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) { if (!font_.GetID()) return 1; - const int sizeStringLength = (sizeof( sizeString ) / sizeof( sizeString[0] ) - 1); + const int sizeStringLength = ELEMENTS( sizeString ); int width = WidthText( font_, sizeString, sizeStringLength ); return (int) ((width / (float) sizeStringLength) + 0.5); |