diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-07-27 16:56:46 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-08-02 11:41:50 -0400 |
commit | 343bc8260d428f2fc3b61c82af25eda4adfc04e4 (patch) | |
tree | 4141f501cc22bc74f4c749d16a958c006ac5c8d2 /desktop | |
parent | 666427b7a51eb16829d96563b53bcef2de541da1 (diff) |
Use implicit OString constructor and cleanup casts.
Change-Id: I686c32d3666bceb23dd86a4220428fa319ffdf45
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 6 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 20 |
2 files changed, 13 insertions, 13 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 8a7934b9f0e2..8ccb6b01335f 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -2649,13 +2649,13 @@ void DesktopLOKTest::testComplexSelection() static const OString aText("hello world"); // Certainly not complex. - CPPUNIT_ASSERT_EQUAL((int)LOK_SELTYPE_NONE, pDocument->pClass->getSelectionType(pDocument)); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(LOK_SELTYPE_NONE), pDocument->pClass->getSelectionType(pDocument)); // Paste text. CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", aText.getStr(), aText.getLength())); // No selection. - CPPUNIT_ASSERT_EQUAL((int)LOK_SELTYPE_NONE, pDocument->pClass->getSelectionType(pDocument)); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(LOK_SELTYPE_NONE), pDocument->pClass->getSelectionType(pDocument)); // Paste an image. OUString aFileURL; @@ -2689,7 +2689,7 @@ void DesktopLOKTest::testComplexSelection() free(pText); // We expect this to be complex. - CPPUNIT_ASSERT_EQUAL((int)LOK_SELTYPE_COMPLEX, pDocument->pClass->getSelectionType(pDocument)); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(LOK_SELTYPE_COMPLEX), pDocument->pClass->getSelectionType(pDocument)); } namespace { diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 03c0d86267d1..7193b1ec4571 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -986,6 +986,15 @@ LibLODocument_Impl::~LibLODocument_Impl() } } +static OUString getGenerator() +{ + OUString sGenerator( + Translate::ExpandVariables("%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION (%1)")); + OUString os("$_OS"); + ::rtl::Bootstrap::expandMacros(os); + return sGenerator.replaceFirst("%1", os); +} + extern "C" { CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, LibreOfficeKitCallback pCallback, void* pData) @@ -3427,15 +3436,6 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n pDoc->setTextSelection(nType, nX, nY); } -static OUString getGenerator() -{ - OUString sGenerator( - Translate::ExpandVariables("%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION (%1)")); - OUString os("$_OS"); - ::rtl::Bootstrap::expandMacros(os); - return sGenerator.replaceFirst("%1", os); -} - static bool getFromTransferrable( const css::uno::Reference<css::datatransfer::XTransferable> &xTransferable, const OString &aInMimeType, OString &aRet); @@ -3633,7 +3633,7 @@ static int doc_getSelectionType(LibreOfficeKitDocument* pThis) return LOK_SELTYPE_COMPLEX; OString aRet; - bool bSuccess = getFromTransferrable(xTransferable, OString("text/plain;charset=utf-8"), aRet); + bool bSuccess = getFromTransferrable(xTransferable, "text/plain;charset=utf-8", aRet); if (!bSuccess) return LOK_SELTYPE_NONE; |