summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-09-04 13:40:48 +0300
committerTor Lillqvist <tml@collabora.com>2020-09-04 14:24:25 +0200
commitbcb415d56de44246eea8c9de45e7f9f91b9d6570 (patch)
treeba01d486bb83cc2198f34b7f4f1877b10cd12bae /libreofficekit
parent052cf89f2fc3f32150d0f6dbcbc859a127fa595b (diff)
Avoid loplugin:external and loplugin:simplifypointertobool warnings
Note that this file isn't actually compiled at the moment unless you edit the Module_libreofficekit.mk. And then the unit test will fail. But that is another problem. Change-Id: I431ce889ca4059e98662cddcaee3aa570102c515 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102042 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index ee935cf82cdb..56d789b61e5e 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -67,7 +67,7 @@ void insertString(Document& rDocument, const std::string& s)
}
-OUString getFileURLFromSystemPath(OUString const & path)
+static OUString getFileURLFromSystemPath(OUString const & path)
{
OUString url;
osl::FileBase::RC e = osl::FileBase::getFileURLFromSystemPath(path, url);
@@ -130,7 +130,7 @@ void TiledRenderingTest::runAllTests()
std::unique_ptr< Office > pOffice( lok_cpp_init(
m_sLOPath.c_str() ) );
- CPPUNIT_ASSERT( pOffice.get() );
+ CPPUNIT_ASSERT( pOffice );
testDocumentLoadFail( pOffice.get() );
testDocumentTypes( pOffice.get() );
@@ -148,7 +148,7 @@ void TiledRenderingTest::testDocumentLoadFail( Office* pOffice )
{
const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/IDONOTEXIST.odt";
std::unique_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) );
- CPPUNIT_ASSERT( !pDocument.get() );
+ CPPUNIT_ASSERT( !pDocument );
// TODO: we probably want to have some way of returning what
// the cause of failure was. getError() will return
// something along the lines of:
@@ -158,10 +158,10 @@ void TiledRenderingTest::testDocumentLoadFail( Office* pOffice )
// Our dumped .png files end up in
// workdir/CppunitTest/libreofficekit_tiledrendering.test.core
-int getDocumentType( Office* pOffice, const string& rPath )
+static int getDocumentType( Office* pOffice, const string& rPath )
{
std::unique_ptr< Document> pDocument( pOffice->documentLoad( rPath.c_str() ) );
- CPPUNIT_ASSERT( pDocument.get() );
+ CPPUNIT_ASSERT( pDocument );
return pDocument->getDocumentType();
}
@@ -180,7 +180,7 @@ void TiledRenderingTest::testDocumentTypes( Office* pOffice )
{
std::unique_ptr<Document> pDocument(loadDocument(pOffice, "blank_text.odt"));
- CPPUNIT_ASSERT(pDocument.get());
+ CPPUNIT_ASSERT(pDocument);
CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_TEXT, static_cast<LibreOfficeKitDocumentType>(pDocument->getDocumentType()));
// This crashed.
pDocument->postUnoCommand(".uno:Bold");
@@ -223,7 +223,7 @@ void TiledRenderingTest::testPaintPartTile(Office* pOffice)
{
std::unique_ptr<Document> pDocument(loadDocument(pOffice, "blank_text.odt"));
- CPPUNIT_ASSERT(pDocument.get());
+ CPPUNIT_ASSERT(pDocument);
CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_TEXT, static_cast<LibreOfficeKitDocumentType>(pDocument->getDocumentType()));
// Create two views.
@@ -401,7 +401,7 @@ void TiledRenderingTest::testMultiKeyInput(Office *pOffice)
{
std::unique_ptr<Document> pDocument(loadDocument(pOffice, "blank_text.odt"));
- CPPUNIT_ASSERT(pDocument.get());
+ CPPUNIT_ASSERT(pDocument);
CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_TEXT, static_cast<LibreOfficeKitDocumentType>(pDocument->getDocumentType()));
// Create two views.