[Libreoffice-commits] core.git: 7 commits - dbaccess/source extensions/source include/formula include/osl lotuswordpro/source sal/osl svx/source
Michael Stahl
mstahl at redhat.com
Thu Mar 12 09:36:00 PDT 2015
dbaccess/source/ui/dlg/adodatalinks.cxx | 3 ---
extensions/source/update/check/updatecheckconfig.cxx | 4 ++--
include/formula/grammar.hxx | 2 +-
include/osl/profile.hxx | 6 +++---
lotuswordpro/source/filter/lwpbulletstylemgr.cxx | 2 +-
sal/osl/w32/dllentry.c | 6 ++++++
svx/source/engine3d/camera3d.cxx | 7 +++----
7 files changed, 16 insertions(+), 14 deletions(-)
New commits:
commit 61a1e5934a60586d9385d957c119a1ea5913c0cc
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 17:17:22 2015 +0100
dbaccess: PVS-Studio V522 Dereferencing of null pointer 'piTmpConnection'
Change-Id: I30b2a0f2b3bc82b534a3463aa7f842edf194bdf7
diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx
index e9dd1d8..2cf32be 100644
--- a/dbaccess/source/ui/dlg/adodatalinks.cxx
+++ b/dbaccess/source/ui/dlg/adodatalinks.cxx
@@ -81,15 +81,12 @@ BSTR PromptNew(long hWnd)
);
if( FAILED( hr ) )
{
- piTmpConnection->Release( );
- dlPrompt->Release( );
return connstr;
}
dlPrompt->put_hWnd(hWnd);
if( FAILED( hr ) )
{
- piTmpConnection->Release( );
dlPrompt->Release( );
return connstr;
}
commit 6c6d9793730b836e761adba1d02694c133047b09
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 17:01:15 2015 +0100
extensions: PVS-Studio V716 Suspicious type conversion: BOOL -> HRESULT
Change-Id: I3ab73401b29be79ae5457c9f8905ad35e6f0c5fa
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index 6ef8392..a1c5c97 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -190,7 +190,7 @@ OUString UpdateCheckConfig::getDesktopDirectory()
#ifdef WNT
WCHAR szPath[MAX_PATH];
- if( ! FAILED( SHGetSpecialFolderPathW( NULL, szPath, CSIDL_DESKTOPDIRECTORY, true ) ) )
+ if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_DESKTOPDIRECTORY, true))
{
aRet = OUString( reinterpret_cast< sal_Unicode * >(szPath) );
osl::FileBase::getFileURLFromSystemPath( aRet, aRet );
@@ -219,7 +219,7 @@ OUString UpdateCheckConfig::getAllUsersDirectory()
#ifdef WNT
WCHAR szPath[MAX_PATH];
- if( ! FAILED( SHGetSpecialFolderPathW( NULL, szPath, CSIDL_COMMON_DOCUMENTS, true ) ) )
+ if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_COMMON_DOCUMENTS, true))
{
aRet = OUString( reinterpret_cast< sal_Unicode * >(szPath) );
osl::FileBase::getFileURLFromSystemPath( aRet, aRet );
commit 91c059023f36217761cbdd281ba286d8e63258c9
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 15:53:31 2015 +0100
lotuswordpro: PVS-Studio V674 comparing long to double
Not sure if the GetMRest is supposed to be multiplied with something,
but ~nobody knows or uses that format anyway so just suppress the warning.
Change-Id: I883d090901cf0be0978579ade24beaed6f6ae5c1
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
index c71cf15..feb3e49 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
@@ -174,7 +174,7 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid
pListStyle->SetListBullet(nC, pSilverBullet->GetBulletChar(), pSilverBullet->GetBulletFontName(),
pSilverBullet->GetPrefix(), pSilverBullet->GetSuffix());
- if (pIndent->GetMRest() > 0.001)
+ if (pIndent->GetMRest() > 0) /* note: used to be 0.001, no idea why */
{
pListStyle->SetListPosition(nC, 0.0,
LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(pIndent->GetMRest())), 0.0, eAlign);
commit f1b5381ed70a21a6f460bcd6a8bedad10b9a5a02
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 15:40:05 2015 +0100
formula: PVS-Studio V610 Undefined behavior shift negative signed int
Change-Id: If6c054abfab6ba421a6924a65dac76782e6eaa0b
diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx
index 8fe2823..4f6a2bc 100644
--- a/include/formula/grammar.hxx
+++ b/include/formula/grammar.hxx
@@ -53,7 +53,7 @@ public:
// Room for 256 reference conventions.
static const int kEnglishBit = (1 << (kConventionShift + 8));
// Mask off all non-language bits.
- static const int kFlagMask = ~((~int(0)) << kConventionShift);
+ static const int kFlagMask = ~((~unsigned(0)) << kConventionShift);
/** Values encoding the formula language plus address reference convention
plus English parsing/formatting
commit 2298c1a66380a0c91ea222d01259686641ab4c6c
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 15:35:29 2015 +0100
sal: PVS-Studio V611 memory was allocated using 'new T[]' operator
... but was released using the 'delete' operator
Change-Id: I67a4b9b8c60f7fddaeef4344ba472d331b3ca154
diff --git a/include/osl/profile.hxx b/include/osl/profile.hxx
index f14a09a..661efe2 100644
--- a/include/osl/profile.hxx
+++ b/include/osl/profile.hxx
@@ -131,7 +131,7 @@ namespace osl {
pStrings[ nItems ] = NULL;
bool bRet =
osl_writeProfileIdent(profile, rSection.getStr(), rEntry.getStr(), nFirstId, pStrings, nValue );
- delete pStrings;
+ delete[] pStrings;
return bRet;
}
@@ -162,7 +162,7 @@ namespace osl {
size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aEntries.push_back( rtl::OString( pBuf+n ) );
- delete pBuf;
+ delete[] pBuf;
}
return aEntries;
@@ -184,7 +184,7 @@ namespace osl {
size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aSections.push_back( rtl::OString( pBuf+n ) );
- delete pBuf;
+ delete[] pBuf;
}
return aSections;
commit 61e723e4699e9d545479fb4e6ea04ee28290dfda
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 15:30:10 2015 +0100
svx: PVS-Studio V603 The object was created but it is not being used
Seems the values in the default ctor don't matter much, it'll all be
overwritten by assignment later.
Change-Id: Ie59546176c8bf9eecafd94d417fd8e5da2262a1a
diff --git a/svx/source/engine3d/camera3d.cxx b/svx/source/engine3d/camera3d.cxx
index d131d87..ef2e4d7 100644
--- a/svx/source/engine3d/camera3d.cxx
+++ b/svx/source/engine3d/camera3d.cxx
@@ -36,14 +36,13 @@ Camera3D::Camera3D(const basegfx::B3DPoint& rPos, const basegfx::B3DPoint& rLook
}
Camera3D::Camera3D()
- : fResetFocalLength(0.0)
+ : aResetPos(0.0, 0.0, 1.0)
+ , fResetFocalLength(0.0)
, fResetBankAngle(0.0)
- , fFocalLength(0.0)
+ , fFocalLength(35.0)
, fBankAngle(0.0)
, bAutoAdjustProjection(false)
{
- basegfx::B3DPoint aVector3D(0.0 ,0.0 ,1.0);
- Camera3D(aVector3D, basegfx::B3DPoint());
}
// Set default values for reset
commit 279b6e4b75e74c743ca018435c1d7644c71b9e0c
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Mar 12 14:44:36 2015 +0100
sal: add comment re: V718 'CreateThread' should not be called from 'DllMain'
Change-Id: I6e444e6c3dd4f5e158fe9b649b97ccb5ca32c3a7
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c
index e472c1f..1a113b3 100644
--- a/sal/osl/w32/dllentry.c
+++ b/sal/osl/w32/dllentry.c
@@ -306,6 +306,12 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
// No error check, it works or it does not
// Thread should only be started for headless mode, see desktop/win32/source/officeloader.cxx
CreateThread( NULL, 0, ParentMonitorThreadProc, (LPVOID)dwParentProcessId, 0, &dwThreadId );
+ // Note: calling CreateThread in DllMain is discouraged
+ // but this is only done in the headless mode and in
+ // that case no other threads should be running at startup
+ // when sal3.dll is loaded; also there is no
+ // synchronization with the spawned thread, so there
+ // does not appear to be a real risk of deadlock here
}
}
More information about the Libreoffice-commits
mailing list