[Uml-devel] KDE/kdesdk/umbrello/umbrello
Ralf Habacker
ralf.habacker at gmail.com
Wed Jan 18 19:21:04 UTC 2012
SVN commit 1274539 by habacker:
After loading of xmi objects clip the widget size against the allowed limits to make sure the widget size is in bound.
BUG: 291894
M +1 -0 umlview.cpp
M +12 -0 widgets/umlwidget.cpp
M +2 -0 widgets/umlwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1274538:1274539
@@ -3468,6 +3468,7 @@
widget = loadWidgetFromXMI(widgetElement);
if (widget) {
m_WidgetList.append(widget);
+ widget->clipSize();
// In the interest of best-effort loading, in case of a
// (widget == NULL) we still go on.
// The individual widget's loadFromXMI method should
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1274538:1274539
@@ -1238,6 +1238,18 @@
adjustAssocs(getX(), getY()); // adjust assoc lines
}
+/**
+ * clip the size of this widget against the
+ * minimal and maximal limits.
+ */
+void UMLWidget::clipSize()
+{
+ int width = getWidth();
+ int height = getHeight();
+ constrain(width, height);
+ setSize(width, height);
+}
+
void UMLWidget::setDefaultFontMetrics(UMLWidget::FontType fontType)
{
setupFontType(m_Font, fontType);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.h #1274538:1274539
@@ -235,6 +235,8 @@
void updateComponentSize();
+ void clipSize();
+
void forceUpdateFontMetrics(QPainter *painter);
virtual bool loadFromXMI(QDomElement &qElement);
More information about the umbrello-devel
mailing list