[Libreoffice-commits] core.git: connectivity/source starmath/source svx/source sw/source vcl/source writerfilter/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 7 06:15:50 UTC 2021


 connectivity/source/drivers/writer/WDriver.cxx      |    2 +-
 starmath/source/rtfexport.cxx                       |    2 +-
 svx/source/dialog/signaturelinehelper.cxx           |    4 ++--
 sw/source/core/doc/textboxhelper.cxx                |    9 ++++-----
 sw/source/filter/html/htmlreqifreader.cxx           |    2 +-
 vcl/source/filter/ipdf/pdfdocument.cxx              |    2 +-
 vcl/source/filter/ipdf/pdfread.cxx                  |    8 ++++----
 vcl/source/gdi/pdfobjectcopier.cxx                  |    4 ++--
 vcl/source/pdf/PDFiumTools.cxx                      |    4 ++--
 writerfilter/source/dmapper/domainmapperfactory.cxx |    4 ++--
 writerfilter/source/filter/WriterFilter.cxx         |    2 +-
 11 files changed, 21 insertions(+), 22 deletions(-)

New commits:
commit 084f60a07cf5ba41d4dd8f9bb2726c78eb8a7874
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Sep 6 20:08:31 2021 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Sep 7 08:15:18 2021 +0200

    Avoid repeating the return type from the declaration
    
    Change-Id: I0dce02d10b8c74e80f5672e2dd580b6837ba3291
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121732
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/connectivity/source/drivers/writer/WDriver.cxx b/connectivity/source/drivers/writer/WDriver.cxx
index 7c8cde2da3b7..fa3a3dcf685a 100644
--- a/connectivity/source/drivers/writer/WDriver.cxx
+++ b/connectivity/source/drivers/writer/WDriver.cxx
@@ -82,7 +82,7 @@ ODriver::getPropertyInfo(const OUString& url, const uno::Sequence<beans::Propert
         const OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
         ::dbtools::throwGenericSQLException(sMessage, *this);
     }
-    return uno::Sequence<sdbc::DriverPropertyInfo>();
+    return {};
 }
 
 } // namespace
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index 9ce0bb3e1dbe..ee5c486eae61 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -182,7 +182,7 @@ OString mathSymbolToString(const SmNode* node, rtl_TextEncoding nEncoding)
     assert(node->GetType() == SmNodeType::Math || node->GetType() == SmNodeType::MathIdent);
     auto txtnode = static_cast<const SmTextNode*>(node);
     if (txtnode->GetText().isEmpty())
-        return OString();
+        return {};
     assert(txtnode->GetText().getLength() == 1);
     sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode(txtnode->GetText()[0]);
     OUString aValue(chr);
diff --git a/svx/source/dialog/signaturelinehelper.cxx b/svx/source/dialog/signaturelinehelper.cxx
index 4728fc36f1fa..e40cb6885b59 100644
--- a/svx/source/dialog/signaturelinehelper.cxx
+++ b/svx/source/dialog/signaturelinehelper.cxx
@@ -60,12 +60,12 @@ uno::Reference<security::XCertificate> getSignatureCertificate(SfxObjectShell* p
 {
     if (!pShell)
     {
-        return uno::Reference<security::XCertificate>();
+        return {};
     }
 
     if (!pParent)
     {
-        return uno::Reference<security::XCertificate>();
+        return {};
     }
 
     uno::Reference<security::XDocumentDigitalSignatures> xSigner;
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 3475c72a0930..3858da359a3c 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -378,12 +378,11 @@ SwTextBoxHelper::getUnoTextFrame(uno::Reference<drawing::XShape> const& xShape)
             auto pSdrObj = pFrameFormat->FindSdrObject();
             if (pSdrObj)
             {
-                return uno::Reference<css::text::XTextFrame>(pSdrObj->getUnoShape(),
-                                                             uno::UNO_QUERY);
+                return { pSdrObj->getUnoShape(), uno::UNO_QUERY };
             }
         }
     }
-    return uno::Reference<css::text::XTextFrame>();
+    return {};
 }
 
 template <typename T> static void lcl_queryInterface(const SwFrameFormat* pShape, uno::Any& rAny)
@@ -623,11 +622,11 @@ void SwTextBoxHelper::getProperty(SwFrameFormat const* pShape, sal_uInt16 nWID,
 css::uno::Any SwTextBoxHelper::getProperty(SwFrameFormat const* pShape, const OUString& rPropName)
 {
     if (!pShape)
-        return uno::Any();
+        return {};
 
     SwFrameFormat* pFormat = getOtherTextBoxFormat(pShape, RES_DRAWFRMFMT);
     if (!pFormat)
-        return uno::Any();
+        return {};
 
     uno::Reference<beans::XPropertySet> const xPropertySet(
         SwXTextFrame::CreateXTextFrame(*pFormat->GetDoc(), pFormat), uno::UNO_QUERY);
diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx
index 30c027edb351..fd18353cf217 100644
--- a/sw/source/filter/html/htmlreqifreader.cxx
+++ b/sw/source/filter/html/htmlreqifreader.cxx
@@ -273,7 +273,7 @@ OString InsertOLE1Header(SvStream& rOle2, SvStream& rOle1, sal_uInt32& nWidth, s
     rOle2.Seek(0);
     tools::SvRef<SotStorage> xStorage(new SotStorage(rOle2));
     if (xStorage->GetError() != ERRCODE_NONE)
-        return OString();
+        return {};
 
     if (xStorage->IsStream("\1Ole10Native"))
     {
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index e8bca353133d..b8224b159329 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -1432,7 +1432,7 @@ OString PDFDocument::ReadKeyword(SvStream& rStream)
     char ch;
     rStream.ReadChar(ch);
     if (rStream.eof())
-        return OString();
+        return {};
     while (rtl::isAsciiAlpha(static_cast<unsigned char>(ch)))
     {
         aBuf.append(ch);
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 9b44a6476878..a69d10c7cafc 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -99,7 +99,7 @@ BinaryDataContainer createBinaryDataContainer(SvStream& rStream)
     // Save the original PDF stream for later use.
     SvMemoryStream aMemoryStream;
     if (!getCompatibleStream(rStream, aMemoryStream))
-        return BinaryDataContainer();
+        return {};
 
     const sal_uInt32 nStreamLength = aMemoryStream.TellEnd();
 
@@ -108,9 +108,9 @@ BinaryDataContainer createBinaryDataContainer(SvStream& rStream)
     aMemoryStream.Seek(STREAM_SEEK_TO_BEGIN);
     aMemoryStream.ReadBytes(aPdfData->data(), aPdfData->size());
     if (aMemoryStream.GetError())
-        return BinaryDataContainer();
+        return {};
 
-    return BinaryDataContainer(std::move(aPdfData));
+    return { std::move(aPdfData) };
 }
 
 } // end anonymous namespace
@@ -245,7 +245,7 @@ basegfx::B2DPoint convertFromPDFInternalToHMM(basegfx::B2DSize const& rInputPoin
 {
     double x = convertPointToMm100(rInputPoint.getX());
     double y = convertPointToMm100(rPageSize.getY() - rInputPoint.getY());
-    return basegfx::B2DPoint(x, y);
+    return { x, y };
 }
 
 std::vector<PDFGraphicAnnotation>
diff --git a/vcl/source/gdi/pdfobjectcopier.cxx b/vcl/source/gdi/pdfobjectcopier.cxx
index 1372d419ce99..e8eec6f3c564 100644
--- a/vcl/source/gdi/pdfobjectcopier.cxx
+++ b/vcl/source/gdi/pdfobjectcopier.cxx
@@ -188,7 +188,7 @@ OString PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
             filter::PDFObjectElement* pReferenced = pReference->LookupObject();
             if (!pReferenced)
             {
-                return OString();
+                return {};
             }
 
             aItems = pReferenced->GetDictionaryItems();
@@ -206,7 +206,7 @@ OString PDFObjectCopier::copyExternalResources(filter::PDFObjectElement& rPage,
             aItems = pObject->GetDictionaryItems();
     }
     if (aItems.empty())
-        return OString();
+        return {};
 
     SvMemoryStream& rDocBuffer = rPage.GetDocument().GetEditBuffer();
 
diff --git a/vcl/source/pdf/PDFiumTools.cxx b/vcl/source/pdf/PDFiumTools.cxx
index f6428f02b167..4fe465426201 100644
--- a/vcl/source/pdf/PDFiumTools.cxx
+++ b/vcl/source/pdf/PDFiumTools.cxx
@@ -15,11 +15,11 @@ namespace vcl::pdf
 OUString convertPdfDateToISO8601(OUString const& rInput)
 {
     if (rInput.getLength() < 6)
-        return OUString();
+        return {};
 
     OUString prefix = rInput.copy(0, 2);
     if (prefix != "D:")
-        return OUString();
+        return {};
 
     OUString sYear = rInput.copy(2, 4);
 
diff --git a/writerfilter/source/dmapper/domainmapperfactory.cxx b/writerfilter/source/dmapper/domainmapperfactory.cxx
index 1e52cfc36fcc..d2c0b4adb557 100644
--- a/writerfilter/source/dmapper/domainmapperfactory.cxx
+++ b/writerfilter/source/dmapper/domainmapperfactory.cxx
@@ -30,8 +30,8 @@ DomainMapperFactory::createMapper(css::uno::Reference<css::uno::XComponentContex
     TagLogger::getInstance().startDocument();
 #endif
 
-    return Stream::Pointer_t(new DomainMapper(xContext, xInputStream, xModel, bRepairStorage,
-                                              eDocumentType, rMediaDesc));
+    return { new DomainMapper(xContext, xInputStream, xModel, bRepairStorage, eDocumentType,
+                              rMediaDesc) };
 }
 
 } // namespace writerfilter::dmapper
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 0d9326c41fe0..f546446e1da4 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -82,7 +82,7 @@ static OUString lcl_GetExceptionMessageRec(xml::sax::SAXException const& e)
     {
         return ue.Message;
     }
-    return OUString();
+    return {};
 }
 
 namespace


More information about the Libreoffice-commits mailing list