1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include <test/bootstrapfixture.hxx>
11 #include <unotest/macros_test.hxx>
13 #include <com/sun/star/beans/XPropertySet.hpp>
14 #include <com/sun/star/frame/Bibliography.hpp>
16 using namespace ::com::sun::star
;
20 /// Covers extensions/source/bibliography/ fixes.
21 class Test
: public test::BootstrapFixture
, public unotest::MacrosTest
26 CPPUNIT_TEST_FIXTURE(Test
, testBibliographyLoader
)
28 // Given a bibliography provider:
29 uno::Reference
<container::XNameAccess
> xBibAccess
30 = frame::Bibliography::create(mxComponentContext
);
31 uno::Reference
<beans::XPropertySet
> xPropSet(xBibAccess
, uno::UNO_QUERY
);
32 uno::Sequence
<beans::PropertyValue
> aSeq
;
34 // When getting the column names:
35 xPropSet
->getPropertyValue("BibliographyDataFieldNames") >>= aSeq
;
37 // Then make sure we have columns and all have non-empty names:
38 CPPUNIT_ASSERT(aSeq
.hasElements());
40 // Without the accompanying fix in place, this test would have failed, as the last column
41 // (LOCAL_URL) had an empty field name:
42 for (const auto& rPair
: std::as_const(aSeq
))
44 CPPUNIT_ASSERT(!rPair
.Name
.isEmpty());
48 CPPUNIT_PLUGIN_IMPLEMENT();
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */