tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / test / source / util / xindent.cxx
blob714b9e91eb8e638e9559f22c6569f43fa0f6010c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <test/util/xindent.hxx>
12 #include <com/sun/star/beans/XPropertySet.hpp>
13 #include <com/sun/star/util/XIndent.hpp>
15 #include <com/sun/star/uno/Any.hxx>
16 #include <com/sun/star/uno/Reference.hxx>
18 #include <cppunit/TestAssert.h>
20 using namespace com::sun::star;
21 using namespace com::sun::star::uno;
23 namespace apitest
25 void XIndent::testIncrementIndent()
27 uno::Reference<util::XIndent> xIndent(init(), UNO_QUERY_THROW);
28 uno::Reference<beans::XPropertySet> xPropertySet(xIndent, UNO_QUERY_THROW);
29 uno::Any aAny = xPropertySet->getPropertyValue(u"ParaIndent"_ustr);
30 sal_Int32 nOldValue = aAny.get<sal_Int32>();
32 xIndent->incrementIndent();
34 uno::Any aAny2 = xPropertySet->getPropertyValue(u"ParaIndent"_ustr);
35 sal_Int32 nNewValue = aAny2.get<sal_Int32>();
36 CPPUNIT_ASSERT_MESSAGE("Successfully able to Increment Indent", nOldValue < nNewValue);
38 void XIndent::testDecrementIndent()
40 uno::Reference<util::XIndent> xIndent(init(), UNO_QUERY_THROW);
41 uno::Reference<beans::XPropertySet> xPropertySet(xIndent, UNO_QUERY_THROW);
42 xIndent->incrementIndent();
43 uno::Any aAny = xPropertySet->getPropertyValue(u"ParaIndent"_ustr);
44 sal_Int32 nOldValue = aAny.get<sal_Int32>();
46 xIndent->decrementIndent();
48 uno::Any aAny2 = xPropertySet->getPropertyValue(u"ParaIndent"_ustr);
49 sal_Int32 nNewValue = aAny2.get<sal_Int32>();
50 CPPUNIT_ASSERT_MESSAGE("Successfully able to Decrement Indent", nOldValue > nNewValue);
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */