int count = 0;\r
firstTabOffset = 0;\r
\r
- GDIPlus.GdipGetStringFormatTabStopCount(nativeStrFmt, out count);\r
- if (count==0) return null;\r
+ GDIPlus.GdipGetStringFormatTabStopCount(nativeStrFmt, out count); \r
\r
float[] tabStops = new float[count]; \r
- GDIPlus.GdipGetStringFormatTabStops(nativeStrFmt, count, out firstTabOffset, out tabStops);\r
+ \r
+ if (count!=0) \r
+ GDIPlus.GdipGetStringFormatTabStops(nativeStrFmt, count, out firstTabOffset, tabStops);\r
+ \r
return tabStops; \r
}\r
\r
[DllImport ("gdiplus.dll")]
internal static extern Status GdipGetStringFormatTabStopCount(IntPtr format, out int count);
[DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetStringFormatTabStops(IntPtr format, int count, out float firstTabOffset, out float[] tabStops);
+ internal static extern Status GdipGetStringFormatTabStops(IntPtr format, int count, out float firstTabOffset, [In, Out] float[] tabStops);
//ImageCodecInfo functions
[DllImport("gdiplus.dll")]
public void TestSpecialConstructors()
{
StringFormat smf = StringFormat.GenericDefault;
- smf = StringFormat.GenericTypographic;
-
+ smf = StringFormat.GenericTypographic;
}
[Test]
AssertEquals (StringFormatFlags.DisplayFormatControl, smf.FormatFlags);
}
+ [Test]
+ public void TabsStops()
+ {
+ StringFormat smf = new StringFormat ();
+
+ float firstTabOffset;
+ float[] tabsSrc = {100, 200, 300, 400};
+ float[] tabStops;
+
+ smf.SetTabStops(200, tabsSrc);
+ tabStops = smf.GetTabStops(out firstTabOffset);
+
+ AssertEquals (200, firstTabOffset);
+ AssertEquals (tabsSrc.Length, tabStops.Length);
+ AssertEquals (tabsSrc[0], tabStops[0]);
+ AssertEquals (tabsSrc[1], tabStops[1]);
+ AssertEquals (tabsSrc[2], tabStops[2]);
+ AssertEquals (tabsSrc[3], tabStops[3]);
+ }
+
}
}