From 56187df6ebd9d1fb16bf954fce8df0999e9e3048 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Thu, 21 Oct 2010 11:05:38 +0000 Subject: [PATCH] Use a global solver per application. This make it possible to wire different BALMLayout's. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39040 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/libs/alm/ALMLayout.h | 2 +- src/libs/alm/ALMLayout.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/headers/libs/alm/ALMLayout.h b/headers/libs/alm/ALMLayout.h index 8cb1aec4a9..f7f1b0e257 100644 --- a/headers/libs/alm/ALMLayout.h +++ b/headers/libs/alm/ALMLayout.h @@ -134,7 +134,7 @@ private: void _ParseGroupItem(GroupItem& item, XTab* left, YTab* top, XTab* right, YTab* bottom); - LinearSpec fSolver; + LinearSpec& fSolver; XTab* fLeft; XTab* fRight; diff --git a/src/libs/alm/ALMLayout.cpp b/src/libs/alm/ALMLayout.cpp index 4f94ee0c07..09819fb363 100644 --- a/src/libs/alm/ALMLayout.cpp +++ b/src/libs/alm/ALMLayout.cpp @@ -22,12 +22,17 @@ const BSize kMinSize(0, 0); const BSize kMaxSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED); +static LinearSpec gLinearSolver; + + /** * Constructor. * Creates new layout engine. */ BALMLayout::BALMLayout(float spacing) : + fSolver(gLinearSolver), + fInset(0.0f), fSpacing(spacing), fCurrentArea(NULL)