1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
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 */
9
10 #include <swmodeltestbase.hxx>
11
12 #include <docsh.hxx>
13 #include <view.hxx>
14 #include <wrtsh.hxx>
15
16 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/edit/data/";
17
18 namespace
19 {
20 /// Covers sw/source/core/edit/ fixes.
21 class Test : public SwModelTestBase
22 {
23 };
24 }
25
CPPUNIT_TEST_FIXTURE(Test,testRedlineHidden)26 CPPUNIT_TEST_FIXTURE(Test, testRedlineHidden)
27 {
28 // Given a document with ShowRedlineChanges=false:
29 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "redline-hidden.fodt");
30
31 // When formatting a paragraph by setting the para adjust to center, then make sure setting the
32 // new item set on the paragraph doesn't crash:
33 SwView* pView = pDoc->GetDocShell()->GetView();
34 SfxItemSet aSet(pView->GetPool(), svl::Items<RES_PARATR_ADJUST, RES_PARATR_ADJUST>{});
35 SvxAdjustItem aItem(SvxAdjust::Center, RES_PARATR_ADJUST);
36 aSet.Put(aItem);
37 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
38 pWrtShell->SetAttrSet(aSet, SetAttrMode::DEFAULT, nullptr, true);
39 }
40
41 CPPUNIT_PLUGIN_IMPLEMENT();
42
43 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
44