include/unotools/fltrcfg.hxx              |    2 --
 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx |    4 ++--
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx |    4 ++--
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |    2 ++
 sw/source/core/txtnode/fntcache.cxx       |    2 +-
 sw/source/ui/vba/vbasystem.cxx            |   18 +++++++++---------
 sw/source/uibase/docvw/PostItMgr.cxx      |    2 +-
 sw/source/uibase/uno/unotxdoc.cxx         |    2 +-
 unotools/source/config/fltrcfg.cxx        |   28 ++++++++++++++++------------
 9 files changed, 34 insertions(+), 30 deletions(-)

New commits:
commit cb97267f5676b7790806dc15d17f2a6523232ccc
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Fri Oct 14 16:46:02 2016 +0200

    clang-cl loplugin: sw
    
    Change-Id: I1e0894f116e8288eb8b648ed3ac679be237806a3
    Reviewed-on: https://gerrit.libreoffice.org/29845
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index cb0c804..85266bf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -53,6 +53,8 @@
 
 #include <string>
 
+#if !defined(_WIN32)
+
 class Test : public SwModelTestBase
 {
 public:
@@ -94,8 +96,6 @@ protected:
     }
 };
 
-#if !defined(_WIN32)
-
 DECLARE_OOXMLEXPORT_TEST(testPageGraphicBackground, 
"page-graphic-background.odt")
 {
     // No idea how the graphic background should be exported (seems there is no
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 4646876..4d73a7f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -52,6 +52,8 @@
 
 #include <string>
 
+#if !defined(_WIN32)
+
 class Test : public SwModelTestBase
 {
 public:
@@ -73,8 +75,6 @@ protected:
     }
 };
 
-#if !defined(_WIN32)
-
 DECLARE_OOXMLEXPORT_TEST(testFdo68418, "fdo68418.docx")
 {
     // The problem was that in 'MSWordExportBase::SectionProperties' function 
in 'wrt8sty.cxx'
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 7ec75f3..23d3aa3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -79,6 +79,7 @@ public:
     }
 };
 
+#if !defined _WIN32
 class FailTest : public Test
 {
 public:
@@ -112,6 +113,7 @@ public:
         finish();
     }
 };
+#endif
 
 DECLARE_OOXMLIMPORT_TEST(testImageHyperlink, "image-hyperlink.docx")
 {
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 87c2764..92aa6ad 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -507,7 +507,7 @@ void SwFntObj::GuessLeading( const SwViewShell&
 #if defined(_WIN32)
     OutputDevice *pWin = rSh.GetWin() ?
                          rSh.GetWin() :
-                         GetpApp()->GetDefaultDevice();
+                         Application::GetDefaultDevice();
     if ( pWin )
     {
         MapMode aTmpMap( MapUnit::MapTwip );
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index e0cecc0..ffa0cb2 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -96,12 +96,12 @@ uno::Any PrivateProfileStringListener::getValueEvent()
     {
         // get key/value from windows register
 #ifdef _WIN32
-        HKEY hBaseKey = NULL;
+        HKEY hBaseKey = nullptr;
         OString sSubKey;
         lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey );
-        if( hBaseKey != NULL )
+        if( hBaseKey != nullptr )
         {
-            HKEY hKey = NULL;
+            HKEY hKey = nullptr;
             LONG lResult;
             LPCTSTR lpSubKey = TEXT( sSubKey.getStr());
             TCHAR szBuffer[1024];
@@ -110,7 +110,7 @@ uno::Any PrivateProfileStringListener::getValueEvent()
             if( ERROR_SUCCESS == lResult )
             {
                 LPCTSTR lpValueName = TEXT(maKey.getStr());
-                lResult = RegQueryValueEx( hKey, lpValueName, NULL, NULL, 
(LPBYTE)szBuffer, &cbData );
+                lResult = RegQueryValueEx( hKey, lpValueName, nullptr, 
nullptr, reinterpret_cast<LPBYTE>(szBuffer), &cbData );
                 RegCloseKey( hKey );
                 sValue = OUString::createFromAscii(szBuffer);
             }
@@ -141,21 +141,21 @@ void PrivateProfileStringListener::setValueEvent( const 
css::uno::Any& value )
     {
         //set value into windows register
 #ifdef _WIN32
-        HKEY hBaseKey = NULL;
+        HKEY hBaseKey = nullptr;
         OString sSubKey;
         lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey );
-        if( hBaseKey != NULL )
+        if( hBaseKey != nullptr )
         {
-            HKEY hKey = NULL;
+            HKEY hKey = nullptr;
             LONG lResult;
             LPCTSTR lpSubKey = TEXT( sSubKey.getStr());
-            lResult = RegCreateKeyEx( hBaseKey, lpSubKey, 0, NULL, 
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL );
+            lResult = RegCreateKeyEx( hBaseKey, lpSubKey, 0, nullptr, 
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, nullptr );
             if( ERROR_SUCCESS == lResult )
             {
                 OString aUTF8Value = OUStringToOString( aValue, 
RTL_TEXTENCODING_UTF8 );
                 DWORD cbData = sizeof(TCHAR) * (_tcslen(aUTF8Value.getStr()) + 
1);
                 LPCTSTR lpValueName = TEXT(maKey.getStr());
-                lResult = RegSetValueEx( hKey, lpValueName, 0 /* Reserved */, 
REG_SZ, (LPBYTE)aUTF8Value.getStr(), cbData );
+                lResult = RegSetValueEx( hKey, lpValueName, 0 /* Reserved */, 
REG_SZ, reinterpret_cast<BYTE const *>(aUTF8Value.getStr()), cbData );
                 RegCloseKey( hKey );
             }
         }
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index e09dc6a..757c1f5 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -965,7 +965,7 @@ void SwPostItMgr::MakeVisible(const SwSidebarWin* pPostIt )
 {
     long aPage = -1;
     // we don't know the page yet, lets find it ourselves
-    for (unsigned long n=0;n<mPages.size();n++)
+    for (std::vector<SwPostItPageItem*>::size_type n=0;n<mPages.size();n++)
     {
         if (mPages[n]->mList->size()>0)
         {
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 9a968d4b..8513b0a 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3489,7 +3489,7 @@ void SAL_CALL SwXTextDocument::paintTile( const 
::css::uno::Any& Parent, ::sal_I
     #if defined(_WIN32)
     sal_Int64 nWindowHandle;
     Parent >>= nWindowHandle;
-    aData.hWnd = (HWND) nWindowHandle;
+    aData.hWnd = reinterpret_cast<HWND>(nWindowHandle);
     ScopedVclPtrInstance<VirtualDevice> xDevice(&aData, Size(1, 1), 
DeviceFormat::DEFAULT);
     paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, 
nTileWidth, nTileHeight);
     #else
commit f8bf15e8ed3bf1116bc77921eb22228705903297
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Fri Oct 14 16:45:19 2016 +0200

    clang-cl loplugin: unotools
    
    Change-Id: I1bbdae6b27a04321b232851f5f45ac2248b55835
    Reviewed-on: https://gerrit.libreoffice.org/29843
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    Tested-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/include/unotools/fltrcfg.hxx b/include/unotools/fltrcfg.hxx
index 35f7917..ab0eb13 100644
--- a/include/unotools/fltrcfg.hxx
+++ b/include/unotools/fltrcfg.hxx
@@ -29,8 +29,6 @@ class UNOTOOLS_DLLPUBLIC SvtFilterOptions : public 
utl::ConfigItem
 private:
     std::unique_ptr<SvtFilterOptions_Impl> pImpl;
 
-    const css::uno::Sequence<OUString>& GetPropertyNames();
-
     virtual void            ImplCommit() override;
 
 public:
diff --git a/unotools/source/config/fltrcfg.cxx 
b/unotools/source/config/fltrcfg.cxx
index 0cb2b29..c26e4d5 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -292,19 +292,9 @@ bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const
     return bRet;
 }
 
-SvtFilterOptions::SvtFilterOptions() :
-    ConfigItem( "Office.Common/Filter/Microsoft" ),
-    pImpl(new SvtFilterOptions_Impl)
-{
-    EnableNotification(GetPropertyNames());
-    Load();
-}
+namespace {
 
-SvtFilterOptions::~SvtFilterOptions()
-{
-}
-
-const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
+const Sequence<OUString>& GetPropertyNames()
 {
     static Sequence<OUString> aNames;
     if(!aNames.getLength())
@@ -335,6 +325,20 @@ const Sequence<OUString>& 
SvtFilterOptions::GetPropertyNames()
     return aNames;
 }
 
+}
+
+SvtFilterOptions::SvtFilterOptions() :
+    ConfigItem( "Office.Common/Filter/Microsoft" ),
+    pImpl(new SvtFilterOptions_Impl)
+{
+    EnableNotification(GetPropertyNames());
+    Load();
+}
+
+SvtFilterOptions::~SvtFilterOptions()
+{
+}
+
 static sal_uLong lcl_GetFlag(sal_Int32 nProp)
 {
     sal_uLong nFlag = 0;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to