12#include <com/sun/star/form/runtime/XFormController.hpp>
13#include <com/sun/star/view/XFormLayerAccess.hpp>
15#include <com/sun/star/uno/Reference.hxx>
17#include <cppunit/TestAssert.h>
25 uno::Reference<view::XFormLayerAccess> xFLA(
init(), uno::UNO_QUERY_THROW);
27 const bool bCurrentMode = xFLA->isFormDesignMode();
31 xFLA->setFormDesignMode(
false);
32 uno::Reference<form::runtime::XFormController> xFC = xFLA->getFormController(
m_xForm);
33 CPPUNIT_ASSERT(xFC.is());
35 xFLA->setFormDesignMode(bCurrentMode);
42 uno::Reference<view::XFormLayerAccess> xFLA(
init(), uno::UNO_QUERY_THROW);
44 const bool bCurrentMode = xFLA->isFormDesignMode();
45 xFLA->setFormDesignMode(!bCurrentMode);
47 const bool bNewMode = xFLA->isFormDesignMode();
48 CPPUNIT_ASSERT_EQUAL(!bCurrentMode, bNewMode);
50 xFLA->setFormDesignMode(bCurrentMode);
51 CPPUNIT_ASSERT_EQUAL(bCurrentMode,
static_cast<bool>(xFLA->isFormDesignMode()));