+2007-07-15 Andreia Gaita <avidigal@novell.com>
+
+ * PrintPreviewControl.cs: Remove extraneous Invalidate calls. Separate
+ full preview invalidation from layout invalidation, and only invalidate
+ the layout when setting zoom or other properties. Invalidation should
+ always be done even when resetting properties with the same values as
+ what is there. Fixes #81744 and #79830.
+
2007-07-15 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* ListView.cs: Implement initial support for Groups. Split some of the
public bool AutoZoom {
get { return autozoom; }
set {
- if (autozoom != value) {
- InvalidatePreview ();
- Invalidate ();
- }
autozoom = value;
+ InvalidateLayout ();
}
}
[DefaultValue(1)]
public int Columns {
get { return columns; }
set {
- if (columns != value) {
- columns = value;
- if (AutoZoom)
- InvalidatePreview ();
- Invalidate ();
- }
+ columns = value;
+ InvalidateLayout ();
}
}
[DefaultValue(null)]
public int Rows {
get { return rows; }
set {
- if (rows != value) {
- rows = value;
- if (AutoZoom)
- InvalidatePreview ();
- Invalidate ();
- }
+ rows = value;
+ InvalidateLayout ();
}
}
[DefaultValue(0)]
value = 1;
}
- if (startPage != value)
- Invalidate ();
+ int start = StartPage;
startPage = value;
- OnStartPageChanged (EventArgs.Empty);
+ if (start != startPage) {
+ InvalidateLayout ();
+ OnStartPageChanged (EventArgs.Empty);
+ }
}
}
public double Zoom {
get { return zoom; }
set {
- if (zoom < 0.0)
+ if (value <= 0)
throw new ArgumentException ("zoom");
- if (zoom != value) {
- InvalidatePreview ();
- Invalidate ();
- }
+ autozoom = false;
zoom = value;
+ InvalidateLayout ();
}
}
#endregion // Public Instance Properties
}
page_infos = null;
}
- if (image_cache != null) {
- for (int i = 0; i < image_cache.Length; i++) {
- if (image_cache[i] !=null)
- image_cache[i].Dispose();
- }
- image_cache = null;
- }
+ InvalidateLayout();
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnResize(EventArgs e)
{
+ InvalidateLayout ();
base.OnResize (e);
- if (AutoZoom) {
- if (page_infos != null && page_infos.Length > 0) {
- Size new_size = ThemeEngine.Current.PrintPreviewControlGetPageSize (this);
- if (new_size.Width != image_size.Width && new_size.Height != image_size.Height)
- image_cache = null;
- }
- }
-
- UpdateScrollBars ();
- Invalidate ();
}
protected virtual void OnStartPageChanged(EventArgs e)
ResumeLayout (false);
}
+
+ private void InvalidateLayout() {
+ if (image_cache != null) {
+ for (int i = 0; i < image_cache.Length; i++) {
+ if (image_cache[i] !=null)
+ image_cache[i].Dispose();
+ }
+ image_cache = null;
+ }
+ Invalidate ();
+ }
}
}