/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include #include #include #include #include #include using namespace ::com::sun::star; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::uno; class DBTestBase : public UnoApiTest { public: DBTestBase() : UnoApiTest("dbaccess/qa/unit/data") {}; utl::TempFile createTempCopy(OUString const & pathname); uno::Reference< XOfficeDatabaseDocument > getDocumentForFileName(const OUString &sFileName); uno::Reference getDocumentForUrl(OUString const & url); uno::Reference< XConnection > getConnectionForDocument( uno::Reference< XOfficeDatabaseDocument > const & xDocument); }; utl::TempFile DBTestBase::createTempCopy(OUString const & pathname) { OUString url; createFileURL(pathname, url); utl::TempFile tmp; tmp.EnableKillingFile(); auto const e = osl::File::copy(url, tmp.GetURL()); CPPUNIT_ASSERT_EQUAL_MESSAGE( (OUStringToOString("<" + url + "> -> <" + tmp.GetURL() + ">", RTL_TEXTENCODING_UTF8) .getStr()), osl::FileBase::E_None, e); return tmp; } uno::Reference< XOfficeDatabaseDocument > DBTestBase::getDocumentForFileName(const OUString &sFileName) { OUString sFilePath; createFileURL(sFileName, sFilePath); return getDocumentForUrl(sFilePath); } uno::Reference DBTestBase::getDocumentForUrl(OUString const & url) { uno::Reference< lang::XComponent > xComponent (loadFromDesktop(url)); CPPUNIT_ASSERT(xComponent.is()); uno::Reference< XOfficeDatabaseDocument > xDocument(xComponent, UNO_QUERY); CPPUNIT_ASSERT(xDocument.is()); return xDocument; } uno::Reference< XConnection > DBTestBase::getConnectionForDocument( uno::Reference< XOfficeDatabaseDocument > const & xDocument) { uno::Reference< XDataSource > xDataSource = xDocument->getDataSource(); CPPUNIT_ASSERT(xDataSource.is()); uno::Reference< XConnection > xConnection = xDataSource->getConnection("",""); CPPUNIT_ASSERT(xConnection.is()); return xConnection; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ption value='distro/collabora/co-24.04.10'>distro/collabora/co-24.04.10 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/idlc
AgeCommit message (Expand)Author
2017-09-18Use even more WIN32_LEAN_AND_MEANMike Kaganski
2017-09-11clang-tidy modernize-use-emplace in hwpfilter..lotuswordproNoel Grandin
2017-09-04loplugin:unnecessaryparen include c++ castsNoel Grandin
2017-08-11convert std::map::insert to std::map::emplace IINoel Grandin
2017-08-06loplugin:constparams in sw part6Noel Grandin
2017-07-18no copy neededJochen Nitschke
2017-07-18loplugin:constparams codemaker,idl,idlcNoel Grandin
2017-07-17extend loplugin useuniqueptr to OUString pointersNoel Grandin
2017-07-16Fix lifecycle issueStephan Bergmann
2017-07-14extend loplugin useuniqueptr to POD typesNoel Grandin
2017-07-05loplugin:unnecessaryparenStephan Bergmann
2017-06-25loplugin:oncevar in helpcompiler..jvmfwkNoel Grandin
2017-06-23loplugin:unusedfields in forms..idlcNoel Grandin
2017-06-09More tests to suppress (all .PHONY test targets should be covered now)Stephan Bergmann
2017-05-29remove some unnecessary OString constructor callsNoel Grandin
2017-05-28remove unnecessary use of OString::getStrNoel Grandin
2017-05-09remove unnecessary empty OUString fields and varsNoel Grandin
2017-04-06loplugin:redundantcast check for c-style casts to voidNoel Grandin
2017-04-06loplugin:redundantcast find cstyle double castsNoel Grandin
2017-03-25Fix typosAndrea Gelmini
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann
2017-03-22Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)Stephan Bergmann
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
2017-02-21Idlc::m_pErrorHandler is unusedStephan Bergmann
2017-02-21loplugin:subtlezeroinit: idlcStephan Bergmann
2017-02-16convert ExprComb to scoped enumNoel Grandin
2017-02-16convert ErrorCode to scoped enumNoel Grandin
2017-02-16convert WarningCode to scoped enumNoel Grandin
2017-02-16remove unused PS_OpCompleted from ParseState enumNoel Grandin
2017-01-26Remove dynamic exception specificationsStephan Bergmann
2017-01-25Remove junkStephan Bergmann
2017-01-25loplugin: unnecessary destructor forms..idlcNoel Grandin
2017-01-19New loplugin:dynexcspec: Add @throws documentation, idlcStephan Bergmann
2017-01-17no special support for MACOSX PPC in master for a while nowCaolán McNamara
2017-01-09New loplugin:externvar: idlcStephan Bergmann
2016-12-20bootstrap building with --disable-dynloading on standard linuxCaolán McNamara
2016-11-29Rewrite some (trivial) assignments inside if/while conditions: idlcStephan Bergmann
2016-11-08loplugin:expandablemethods in hwpfilter..linguisticNoel Grandin
2016-11-08loplugin:unnecessaryvirtual in hwpfilter..rscNoel Grandin
2016-11-02loplugin:oncevar in helpcompiler..reportdesignNoel Grandin
2016-10-19loplugin:expandablemethodds in hwpfilter..linguisticNoel Grandin
2016-10-16clang-cl loplugin: idlcStephan Bergmann
2016-10-13tdf#96099 Reduce no of typedefs used for trivial containersAsela Dasanayaka
2016-10-06Simplify AstExpression::compareStephan Bergmann
2016-09-24we shouldn't need explicit lt_rtl_OUString, etc things anymoreCaolán McNamara
2016-09-19loplugin:unusedenumvaluesNoel Grandin
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
2016-08-12loplugin:unusedenumconstants in forms..sotNoel Grandin
2016-08-08loplugin:unnecessaryvirtualNoel Grandin