[Libreoffice-commits] core.git: connectivity/source filter/source writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 08:07:55 UTC 2018


 connectivity/source/drivers/writer/Wservices.cxx |    8 +++++---
 filter/source/msfilter/rtfutil.cxx               |    3 ++-
 writerfilter/source/dmapper/SdtHelper.cxx        |    3 +--
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 3ad881feafebd90888ece906382c0e69390b79c2
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Nov 20 21:48:50 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Nov 21 09:07:31 2018 +0100

    connectivity Writer driver: make ProviderRequest members private
    
    And two more trivial readability cleanups.
    
    Change-Id: Ie79d9afbdc79260821c27c3f62be3e4635f40395
    Reviewed-on: https://gerrit.libreoffice.org/63677
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/connectivity/source/drivers/writer/Wservices.cxx b/connectivity/source/drivers/writer/Wservices.cxx
index 1566b4eacc45..10e0e3ef32e7 100644
--- a/connectivity/source/drivers/writer/Wservices.cxx
+++ b/connectivity/source/drivers/writer/Wservices.cxx
@@ -30,10 +30,12 @@ using createFactoryFunc = uno::Reference<lang::XSingleServiceFactory> (*)(
 
 struct ProviderRequest
 {
+private:
     uno::Reference<lang::XSingleServiceFactory> xRet;
     uno::Reference<lang::XMultiServiceFactory> const xServiceManager;
     OUString const sImplementationName;
 
+public:
     ProviderRequest(void* pServiceManager, sal_Char const* pImplementationName)
         : xServiceManager(static_cast<lang::XMultiServiceFactory*>(pServiceManager))
         , sImplementationName(OUString::createFromAscii(pImplementationName))
@@ -56,7 +58,7 @@ struct ProviderRequest
         return xRet.is();
     }
 
-    void* getProvider() const { return xRet.get(); }
+    uno::XInterface* getProvider() const { return xRet.get(); }
 };
 
 extern "C" SAL_DLLPUBLIC_EXPORT void*
@@ -73,8 +75,8 @@ connectivity_writer_component_getFactory(const sal_Char* pImplementationName, vo
                              connectivity::writer::ODriver_CreateInstance,
                              ::cppu::createSingleFactory);
 
-        if (aReq.xRet.is())
-            aReq.xRet->acquire();
+        if (aReq.getProvider())
+            aReq.getProvider()->acquire();
 
         pRet = aReq.getProvider();
     }
diff --git a/filter/source/msfilter/rtfutil.cxx b/filter/source/msfilter/rtfutil.cxx
index 0d2f590c10fa..7e16cc87960d 100644
--- a/filter/source/msfilter/rtfutil.cxx
+++ b/filter/source/msfilter/rtfutil.cxx
@@ -239,7 +239,8 @@ OString WriteHex(const sal_uInt8* pData, sal_uInt32 nSize, SvStream* pStream, sa
 bool ExtractOLE2FromObjdata(const OString& rObjdata, SvStream& rOle2)
 {
     SvMemoryStream aStream;
-    int b = 0, count = 2;
+    int b = 0;
+    int count = 2;
 
     // Feed the destination text to a stream.
     for (int i = 0; i < rObjdata.getLength(); ++i)
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index cccebf1d260c..f7797844b29d 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -150,8 +150,7 @@ void SdtHelper::createDateControl(OUString const& rContentText, const beans::Pro
         SAL_WARN("writerfilter", "unhandled w:dateFormat value");
         if (m_sDate.isEmpty())
             return;
-        else
-            nDateFormat = 0;
+        nDateFormat = 0;
     }
     xPropertySet->setPropertyValue("DateFormat", uno::makeAny(nDateFormat));
 


More information about the Libreoffice-commits mailing list