[Libreoffice-commits] core.git: 9 commits - filter/source forms/source i18nutil/source include/xmloff libreofficekit/source sc/source vcl/inc xmloff/source
Caolán McNamara
caolanm at redhat.com
Sat Dec 19 10:10:41 PST 2015
filter/source/svg/svgreader.cxx | 2 -
forms/source/xforms/submission/submission_get.cxx | 3 +-
i18nutil/source/utility/paper.cxx | 4 +--
include/xmloff/xmlictxt.hxx | 8 +++---
libreofficekit/source/gtk/lokdocview.cxx | 26 ++++++++++------------
sc/source/ui/app/inputwin.cxx | 6 +++--
vcl/inc/opengl/texture.hxx | 1
xmloff/source/core/xmlictxt.cxx | 18 +++++----------
xmloff/source/transform/TransformerContext.cxx | 9 ++-----
xmloff/source/transform/TransformerContext.hxx | 8 +++---
10 files changed, 39 insertions(+), 46 deletions(-)
New commits:
commit 98d108811a078aa3b49013d20612f35047741047
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:17:58 2015 +0000
coverity#1343621 Constant expression result
and
coverity#1343622 Logically dead code
Change-Id: I30e5dd8a12941a7eb37520a385a63ac2b46731cc
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index 814c745..f824953 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -175,7 +175,7 @@ struct AnnotatingVisitor
void operator()( const uno::Reference<xml::dom::XElement>& xElem)
{
const sal_Int32 nTagId(getTokenId(xElem->getTagName()));
- if (nTagId != XML_TEXT || nTagId != XML_TSPAN)
+ if (nTagId != XML_TEXT && nTagId != XML_TSPAN)
return;
maCurrState = maParentStates.back();
commit e2ed122ff34a0fe36e2925dd30fe217606069984
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:15:22 2015 +0000
coverity#1343619 Unchecked return value
Change-Id: Icc27e275d376b3ff66d0e44eb23e62f57f9cc470
diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx
index a120e95..be8424c 100644
--- a/forms/source/xforms/submission/submission_get.cxx
+++ b/forms/source/xforms/submission/submission_get.cxx
@@ -88,7 +88,8 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference<
OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
ucbhelper::Content aContent(aQueryURL, aEnvironment, m_xContext);
css::uno::Reference< XOutputStream > aPipe( css::io::Pipe::create(m_xContext), UNO_QUERY_THROW );
- aContent.openStream(aPipe);
+ if (!aContent.openStream(aPipe))
+ return UNKNOWN_ERROR;
// get reply
try {
m_aResultStream = aContent.openStream();
commit c4decc56d2c4b7f4287ea382c7244cd0da1b5c24
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:13:08 2015 +0000
coverity#1343620 Unchecked return value
Change-Id: I5ac69ef416a1317644b451442a51531806d9cf0d
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index 6223b6b..93f81ce 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -233,9 +233,9 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
char aBuffer[ 1024 ];
aBuffer[0] = 0;
char *pBuffer = fgets( aBuffer, sizeof(aBuffer), pPipe );
- pclose( pPipe );
+ bool bOk = pclose(pPipe) == 0;
- if (pBuffer && *pBuffer != 0)
+ if (bOk && pBuffer && *pBuffer != 0)
{
OString aPaper(pBuffer);
aPaper = aPaper.trim();
commit 746da6b7fb3829e1ca23a4b8dfec6c502bac681c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:11:03 2015 +0000
coverity#1343633 Resource leak
Change-Id: I2384091557c2a3b061e2c60118309f35b65b45d6
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 5f30908..55c7f78 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -334,6 +334,9 @@ static void
doSearch(LOKDocView* pDocView, const char* pText, bool bBackwards, bool highlightAll)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
+ if (!priv->m_pDocument)
+ return;
+
boost::property_tree::ptree aTree;
GtkWidget* drawingWidget = GTK_WIDGET(pDocView);
GdkWindow* drawingWindow = gtk_widget_get_window(drawingWidget);
@@ -341,9 +344,6 @@ doSearch(LOKDocView* pDocView, const char* pText, bool bBackwards, bool highligh
cairo_rectangle_int_t cairoVisRect;
int x, y;
- if (!priv->m_pDocument)
- return;
-
cairo_region_get_rectangle(cairoVisRegion, 0, &cairoVisRect);
x = pixelToTwip (cairoVisRect.x, priv->m_fZoom);
y = pixelToTwip (cairoVisRect.y, priv->m_fZoom);
@@ -2543,13 +2543,13 @@ SAL_DLLPUBLIC_EXPORT void
lok_doc_view_set_part (LOKDocView* pDocView, int nPart)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
+ if (!priv->m_pDocument)
+ return;
+
GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
LOEvent* pLOEvent = new LOEvent(LOK_SET_PART);
GError* error = nullptr;
- if (!priv->m_pDocument)
- return;
-
pLOEvent->m_nPart = nPart;
g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
@@ -2566,7 +2566,6 @@ SAL_DLLPUBLIC_EXPORT gchar*
lok_doc_view_get_part_name (LOKDocView* pDocView, int nPart)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
-
if (!priv->m_pDocument)
return nullptr;
@@ -2682,7 +2681,6 @@ lok_doc_view_post_command (LOKDocView* pDocView,
gboolean bNotifyWhenFinished)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
-
if (!priv->m_pDocument)
return;
commit 5b05a3fa2d6873c1046a959c545db133b1974e2c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:09:10 2015 +0000
coverity#1343632 Resource leak
Change-Id: I79bf35a4c1a2f0463abc202f6c2b104ffdd5139c
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index d23aa2c..5f30908 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2579,13 +2579,13 @@ lok_doc_view_set_partmode(LOKDocView* pDocView,
int nPartMode)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
+ if (!priv->m_pDocument)
+ return;
+
GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
LOEvent* pLOEvent = new LOEvent(LOK_SET_PARTMODE);
GError* error = nullptr;
- if (!priv->m_pDocument)
- return;
-
pLOEvent->m_nPartMode = nPartMode;
g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
commit 169298fa73d2c5429d1960db6049a4ed15653b4f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:08:01 2015 +0000
coverity#1343631 Resource leak
Change-Id: Ic5d7c88ae4080c2e103fb691c2e326a9e239aa12
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 6b89955..d23aa2c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2649,13 +2649,13 @@ lok_doc_view_set_edit(LOKDocView* pDocView,
gboolean bEdit)
{
LOKDocViewPrivate& priv = getPrivate(pDocView);
+ if (!priv->m_pDocument)
+ return;
+
GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
LOEvent* pLOEvent = new LOEvent(LOK_SET_EDIT);
GError* error = nullptr;
- if (!priv->m_pDocument)
- return;
-
pLOEvent->m_bEdit = bEdit;
g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
commit 8f85595371de1848c9eb85492f04eb0e2bfc9cf5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 15:05:00 2015 +0000
coverity#1343637 Double free
and
coverity#1343638 Double free
coverity#1343639 Double free
coverity#1343640 Double free
coverity#1343641 Double free
Change-Id: I8ce42f03d40fe514f73b3a7eabdb4f323b2239e6
diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
index 16bb92f..9d180bd 100644
--- a/include/xmloff/xmlictxt.hxx
+++ b/include/xmloff/xmlictxt.hxx
@@ -28,6 +28,7 @@
#include <tools/ref.hxx>
#include <rtl/ustring.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <xmloff/nmspmap.hxx>
class SvXMLNamespaceMap;
class SvXMLImport;
@@ -42,11 +43,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public SvRefBase,
sal_uInt16 mnPrefix;
OUString maLocalName;
- SvXMLNamespaceMap *mpRewindMap;
+ std::unique_ptr<SvXMLNamespaceMap> mxRewindMap;
- SAL_DLLPRIVATE SvXMLNamespaceMap *TakeRewindMap()
- { auto p = mpRewindMap; mpRewindMap = nullptr; return p; }
- SAL_DLLPRIVATE void PutRewindMap( SvXMLNamespaceMap *p ) { mpRewindMap = p; }
+ SAL_DLLPRIVATE SvXMLNamespaceMap *TakeRewindMap() { return mxRewindMap.release(); }
+ SAL_DLLPRIVATE void PutRewindMap( SvXMLNamespaceMap *p ) { mxRewindMap.reset(p); }
protected:
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx
index ff7e439..9629143 100644
--- a/xmloff/source/core/xmlictxt.cxx
+++ b/xmloff/source/core/xmlictxt.cxx
@@ -23,31 +23,27 @@
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XLocator.hpp>
-#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlimp.hxx>
#include <xmloff/xmlictxt.hxx>
using namespace ::com::sun::star;
SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
- const OUString& rLName ) :
- mrImport( rImp ),
- mnPrefix( nPrfx ),
- maLocalName( rLName ),
- mpRewindMap( nullptr )
+ const OUString& rLName )
+ : mrImport(rImp)
+ , mnPrefix(nPrfx)
+ , maLocalName(rLName)
{
}
-SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp ) :
- mrImport( rImp ),
- mnPrefix ( 0 ),
- mpRewindMap( nullptr )
+SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp )
+ : mrImport(rImp)
+ , mnPrefix(0)
{
}
SvXMLImportContext::~SvXMLImportContext()
{
- delete mpRewindMap;
}
SvXMLImportContext *SvXMLImportContext::CreateChildContext( sal_uInt16 nPrefix,
diff --git a/xmloff/source/transform/TransformerContext.cxx b/xmloff/source/transform/TransformerContext.cxx
index 72adbe6..71b2b44 100644
--- a/xmloff/source/transform/TransformerContext.cxx
+++ b/xmloff/source/transform/TransformerContext.cxx
@@ -22,7 +22,6 @@
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <osl/diagnose.h>
-#include <xmloff/nmspmap.hxx>
#include "TransformerBase.hxx"
@@ -47,16 +46,14 @@ bool XMLTransformerContext::HasNamespace( sal_uInt16 nPrefix ) const
}
XMLTransformerContext::XMLTransformerContext( XMLTransformerBase& rImp,
- const OUString& rQName ) :
- m_rTransformer( rImp ),
- m_aQName( rQName ),
- m_pRewindMap( nullptr )
+ const OUString& rQName )
+ : m_rTransformer(rImp)
+ , m_aQName(rQName)
{
}
XMLTransformerContext::~XMLTransformerContext()
{
- delete m_pRewindMap;
}
rtl::Reference<XMLTransformerContext> XMLTransformerContext::CreateChildContext( sal_uInt16 nPrefix,
diff --git a/xmloff/source/transform/TransformerContext.hxx b/xmloff/source/transform/TransformerContext.hxx
index e514433..5d27b3c 100644
--- a/xmloff/source/transform/TransformerContext.hxx
+++ b/xmloff/source/transform/TransformerContext.hxx
@@ -24,6 +24,7 @@
#include <salhelper/simplereferenceobject.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
+#include <xmloff/nmspmap.hxx>
#include <xmloff/xmltoken.hxx>
class SvXMLNamespaceMap;
@@ -37,11 +38,10 @@ class XMLTransformerContext : public ::salhelper::SimpleReferenceObject
OUString m_aQName;
- SvXMLNamespaceMap *m_pRewindMap;
+ std::unique_ptr<SvXMLNamespaceMap> m_xRewindMap;
- SvXMLNamespaceMap *TakeRewindMap()
- { auto p = m_pRewindMap; m_pRewindMap = nullptr; return p; }
- void PutRewindMap( SvXMLNamespaceMap *p ) { m_pRewindMap = p; }
+ SvXMLNamespaceMap *TakeRewindMap() { return m_xRewindMap.release(); }
+ void PutRewindMap( SvXMLNamespaceMap *p ) { m_xRewindMap.reset(p); }
protected:
commit 7b6ffbcc958410035adfd4ed1d4b97991dfb883c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 14:53:51 2015 +0000
coverity#1343628 Dereference after null check
Change-Id: Ibaac758db8774b5721425354cba1b9f07e8cd0ff
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e35e1d4..026389e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1635,8 +1635,10 @@ IMPL_LINK_NOARG_TYPED(ScTextWnd, ModifyHdl, LinkParamNone*, void)
void ScTextWnd::StopEditEngine( bool bAll )
{
- if (pEditEngine)
- pEditEngine->SetNotifyHdl(Link<EENotify&, void>());
+ if (!pEditEngine)
+ return;
+
+ pEditEngine->SetNotifyHdl(Link<EENotify&, void>());
if (pEditView)
{
commit a66332bedf40bf718eb4ca755fc0acd2599dbcbc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 19 14:46:39 2015 +0000
coverity#1343636 Uninitialized scalar field
Change-Id: Ibef02c68869d548507fb36aeba7e4dc9a6110cab
diff --git a/vcl/inc/opengl/texture.hxx b/vcl/inc/opengl/texture.hxx
index e57aa9e..e11f71e 100644
--- a/vcl/inc/opengl/texture.hxx
+++ b/vcl/inc/opengl/texture.hxx
@@ -38,7 +38,6 @@ public:
int mnHeight;
GLenum mnFilter;
GLuint mnOptStencil;
- bool mbHasOptStencil;
std::unique_ptr<std::vector<int>> mpSlotReferences;
int mnFreeSlots;
More information about the Libreoffice-commits
mailing list