defer finding dialog parent until we need it
[LibreOffice.git] / extensions / qa / bibliography / bibliography.cxx
blob6c716269ad9ba4caeda0379e75d13d9ce45c06d7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/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;
18 namespace
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 = frame::Bibliography::create(m_xContext);
30 uno::Reference<beans::XPropertySet> xPropSet(xBibAccess, uno::UNO_QUERY);
31 uno::Sequence<beans::PropertyValue> aSeq;
33 // When getting the column names:
34 xPropSet->getPropertyValue(u"BibliographyDataFieldNames"_ustr) >>= aSeq;
36 // Then make sure we have columns and all have non-empty names:
37 CPPUNIT_ASSERT(aSeq.hasElements());
39 // Without the accompanying fix in place, this test would have failed, as the last column
40 // (LOCAL_URL) had an empty field name:
41 for (const auto& rPair : aSeq)
43 CPPUNIT_ASSERT(!rPair.Name.isEmpty());
47 CPPUNIT_PLUGIN_IMPLEMENT();
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */