[Libreoffice-commits] core.git: 5 commits - connectivity/source include/connectivity libreofficekit/qa registry/source slideshow/source store/source sw/inc sw/source
Noel Grandin
noel at peralex.com
Fri Jul 18 05:41:25 PDT 2014
connectivity/source/parse/sqlnode.cxx | 6 +++---
include/connectivity/sqlparse.hxx | 6 +++---
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 2 +-
registry/source/registry.cxx | 3 +++
slideshow/source/inc/tools.hxx | 2 +-
store/source/object.hxx | 2 +-
sw/inc/ndarr.hxx | 2 +-
sw/source/core/docnode/ndnum.cxx | 2 +-
8 files changed, 14 insertions(+), 11 deletions(-)
New commits:
commit aaedf14175c841fa74340f9f0af19d722756628d
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 14:02:53 2014 +0200
cid#705673 Resource leak
Change-Id: Ib4cf76e941541b7f09b6a0dfbdab2a2604a0311d
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index d7d77b2..803372f 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -118,6 +118,7 @@ static RegError REGISTRY_CALLTYPE createRegistry(rtl_uString* registryName,
ORegistry* pReg = new ORegistry();
if ((ret = pReg->initRegistry(registryName, REG_CREATE)))
{
+ delete pReg;
*phRegistry = NULL;
return ret;
}
commit dac4af0e0f7f167850a5b30ae914947634213d22
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 14:01:12 2014 +0200
cid#705674 and cid#705675 Resource leak
Change-Id: Id97e5de8433cc5dc9cb72c0d447ce6af50eb4918
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index d3ba33d..d7d77b2 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -514,6 +514,7 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registr
ORegistry* pReg = new ORegistry();
if ((ret = pReg->initRegistry(registryName, REG_CREATE)))
{
+ delete pReg;
*phRegistry = NULL;
return ret;
}
@@ -563,6 +564,7 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryN
ORegistry* pReg = new ORegistry();
if ((_ret = pReg->initRegistry(registryName, accessMode)))
{
+ delete pReg;
*phRegistry = NULL;
return _ret;
}
commit 0532c5a897615320c5b1727d1867d9fbc574c22c
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 13:51:30 2014 +0200
cid#1226493 Uninitialized scalar variable
Change-Id: I80cd8adccad492c7e4b71e6204c0059bfc003b83
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 74661f1..3c8dc97 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -35,7 +35,7 @@ void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
const char *sName = gtk_tool_button_get_stock_id( GTK_TOOL_BUTTON(pButton) );
float fZoom = 0;
- float fCurrentZoom;
+ float fCurrentZoom = 0;
if ( pDocView )
{
commit 21e3f143ab54028ffb2f609bb9cf7ef69ed638be
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 13:49:17 2014 +0200
cid#1226495 Uninitialized scalar field
Change-Id: I5f05fc312032c50639f147f27353aa560a69f65a
diff --git a/store/source/object.hxx b/store/source/object.hxx
index 2b93a6f..31f827f 100644
--- a/store/source/object.hxx
+++ b/store/source/object.hxx
@@ -65,7 +65,7 @@ class OStoreObject : public store::IStoreHandle
public:
/** Construction.
*/
- OStoreObject() {}
+ OStoreObject() : m_nRefCount(0) {}
/** IStoreHandle.
*/
commit a517898052a739433759e23aada84c7d11b727a7
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 11:45:07 2014 +0200
remove unnecessary "const &" qualifier from T* parameters
e.g. convert code like
foo(X * const & p)
to
foo(X * p)
since the "const &" part of it adds nothing useful.
Change-Id: Icf5f2041517259e7b6e055b75ed1e0e77c547da5
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 0f64267..19f8257 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -822,7 +822,7 @@ void OSQLParser::killThousandSeparator(OSQLParseNode* pLiteral)
}
}
-OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*const& pLiteral)
+OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType, OSQLParseNode* pLiteral)
{
if ( !pLiteral )
return NULL;
@@ -940,7 +940,7 @@ OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*const& pLit
return pReturn;
}
-sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* const pLiteral,OSQLParseNode*const & pCompare,OSQLParseNode* pLiteral2)
+sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend, OSQLParseNode* pLiteral, OSQLParseNode* pCompare, OSQLParseNode* pLiteral2)
{
OSL_ENSURE(inPredicateCheck(),"Only in predicate check allowed!");
sal_Int16 nErg = 0;
@@ -969,7 +969,7 @@ sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode*
return nErg;
}
-sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode* const& pAppend, OSQLParseNode*& pLiteral, const OSQLParseNode* pEscape)
+sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode* pAppend, OSQLParseNode*& pLiteral, const OSQLParseNode* pEscape)
{
sal_Int16 nErg = 0;
sal_Int32 nType = 0;
diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx
index f6a7b0f..5afe259 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -172,7 +172,7 @@ namespace connectivity
OSQLParseNode* buildDate(sal_Int32 _nType,OSQLParseNode*& pLiteral);
bool extractDate(OSQLParseNode* pLiteral,double& _rfValue);
void killThousandSeparator(OSQLParseNode* pLiteral);
- OSQLParseNode* convertNode(sal_Int32 nType,OSQLParseNode*const& pLiteral);
+ OSQLParseNode* convertNode(sal_Int32 nType, OSQLParseNode* pLiteral);
// makes a string out of a number, pLiteral will be deleted
OSQLParseNode* buildNode_STR_NUM(OSQLParseNode*& pLiteral);
OSQLParseNode* buildNode_Date(const double& fValue, sal_Int32 nType);
@@ -240,9 +240,9 @@ namespace connectivity
sal_Int16 buildComparsionRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral);
// pCompre will be deleted if it is not used
- sal_Int16 buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* const pLiteral,OSQLParseNode*const & pCompare,OSQLParseNode* pLiteral2 = NULL);
+ sal_Int16 buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* const pLiteral,OSQLParseNode* pCompare,OSQLParseNode* pLiteral2 = NULL);
- sal_Int16 buildLikeRule(OSQLParseNode* const& pAppend,OSQLParseNode*& pLiteral,const OSQLParseNode* pEscape);
+ sal_Int16 buildLikeRule(OSQLParseNode* pAppend, OSQLParseNode*& pLiteral, const OSQLParseNode* pEscape);
sal_Int16 buildStringNodes(OSQLParseNode*& pLiteral);
#else
#endif
diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx
index 98e92a6..4e8037e 100644
--- a/slideshow/source/inc/tools.hxx
+++ b/slideshow/source/inc/tools.hxx
@@ -70,7 +70,7 @@ namespace slideshow
typedef ::boost::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr;
template <typename T>
- inline ::std::size_t hash_value( T * const& p )
+ inline ::std::size_t hash_value( T const * p )
{
::std::size_t d = static_cast< ::std::size_t >(
reinterpret_cast< ::std::ptrdiff_t >(p) );
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index a004af3..7d65a95 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -80,7 +80,7 @@ struct CompareSwOutlineNodes
class SwOutlineNodes : public o3tl::sorted_vector<SwNode*, CompareSwOutlineNodes>
{
public:
- bool Seek_Entry(SwNode* const &rP, sal_uInt16* pnPos) const;
+ bool Seek_Entry(SwNode* rP, sal_uInt16* pnPos) const;
};
class SW_DLLPUBLIC SwNodes
diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index 905b91f..efe0567 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -29,7 +29,7 @@ bool CompareSwOutlineNodes::operator()( SwNode* const& lhs, SwNode* const& rhs)
return lhs->GetIndex() < rhs->GetIndex();
}
-bool SwOutlineNodes::Seek_Entry(SwNode* const &rP, sal_uInt16* pnPos) const
+bool SwOutlineNodes::Seek_Entry(SwNode* rP, sal_uInt16* pnPos) const
{
const_iterator it = lower_bound(rP);
*pnPos = it - begin();
More information about the Libreoffice-commits
mailing list