[Libreoffice-commits] core.git: 30 commits - desktop/source filter/source jurt/com oox/source opencl/source pyuno/source qadevOOo/tests reportdesign/source sal/cppunittester scripting/java sc/source sfx2/source svx/source sw/source ucb/source
Caolán McNamara
caolanm at redhat.com
Fri Aug 19 12:01:55 UTC 2016
desktop/source/app/cmdlineargs.cxx | 2
desktop/source/lib/init.cxx | 3
filter/source/xsltfilter/LibXSLTTransformer.cxx | 214 ++++------
jurt/com/sun/star/lib/connections/socket/socketAcceptor.java | 8
jurt/com/sun/star/lib/connections/socket/socketConnector.java | 6
oox/source/ole/vbaexport.cxx | 20
opencl/source/openclwrapper.cxx | 13
pyuno/source/module/pyuno_adapter.cxx | 2
pyuno/source/module/pyuno_impl.hxx | 2
qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java | 19
qadevOOo/tests/java/mod/_dbaccess/ORowSet.java | 1
qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java | 2
reportdesign/source/filter/xml/xmlImage.cxx | 28 -
reportdesign/source/filter/xml/xmlReport.cxx | 3
sal/cppunittester/cppunittester.cxx | 5
sc/source/core/data/table1.cxx | 2
sc/source/filter/excel/xlformula.cxx | 22 -
sc/source/filter/oox/formulabase.cxx | 22 -
scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java | 6
scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java | 15
scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java | 10
scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java | 10
sfx2/source/view/lokhelper.cxx | 8
svx/source/sidebar/nbdtmg.cxx | 14
sw/source/core/access/accpara.cxx | 6
sw/source/core/undo/rolbck.cxx | 7
sw/source/filter/ww8/rtfsdrexport.cxx | 2
sw/source/ui/table/tautofmt.cxx | 3
ucb/source/ucp/cmis/cmis_content.cxx | 8
ucb/source/ucp/webdav-neon/webdavcontent.cxx | 4
ucb/source/ucp/webdav-neon/webdavcontent.hxx | 4
31 files changed, 261 insertions(+), 210 deletions(-)
New commits:
commit 608bceee0505482d7bb443aeec95c132e21e01f4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 12:16:00 2016 +0100
coverity#1371338 Dereference null return value
Change-Id: Id03176fc5d7870e257f2a7c48bea56d8e80035a6
diff --git a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
index 60d5562..0a7f7f8 100644
--- a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
+++ b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java
@@ -248,18 +248,19 @@ public class _XDocumentTemplates extends MultiMethodTest {
XRow row = UnoRuntime.queryInterface(XRow.class, statRes);
XContentAccess contAcc = UnoRuntime.queryInterface(XContentAccess.class, statRes);
XContent subContent = null;
- try {
- statRes.first();
- while(!statRes.isAfterLast()) {
- if ( subName.equals(row.getString(1)) ) {
- subContent = contAcc.queryContent();
+ if (statRes != null) {
+ try {
+ statRes.first();
+ while(!statRes.isAfterLast()) {
+ if ( subName.equals(row.getString(1)) ) {
+ subContent = contAcc.queryContent();
+ }
+ statRes.next();
}
- statRes.next();
+ } catch(com.sun.star.sdbc.SQLException e) {
+ log.println("Exception occurred:" + e);
}
- } catch(com.sun.star.sdbc.SQLException e) {
- log.println("Exception occurred:" + e);
}
-
return subContent;
}
}
commit 84e059da41431a561db2f9d23cfff340091b9778
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 12:14:18 2016 +0100
coverity#1371339 Dereference null return value
Change-Id: I5ef9f7a22046bf1ca9b8a25c9fb0f2fc431c1993
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 66fdd9f..a8cafba 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -685,7 +685,8 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
SfxItemIter aIter( m_OldSet ), aOrigIter( rSet );
const SfxPoolItem* pItem = aIter.FirstItem(),
* pOrigItem = aOrigIter.FirstItem();
- do {
+ while (pItem && pOrigItem)
+ {
if( !rSetArr.count( pOrigItem->Which() ))
{
m_ResetArray.push_back( pOrigItem->Which() );
@@ -741,11 +742,9 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
}
}
- if( aIter.IsAtEnd() )
- break;
pItem = aIter.NextItem();
pOrigItem = aOrigIter.NextItem();
- } while( true );
+ }
}
void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
commit 6830d8c2083fa66cc113f587cbfc4aa5a4f8a535
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 12:07:14 2016 +0100
coverity#1371372 Resource leak on an exceptional path
and
coverity#1371366 Resource leak on an exceptional path
coverity#1371376 Resource leak on an exceptional path
Change-Id: Ic0fd05f02b1d78a47d4ee924dee8f10811586d0d
diff --git a/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java b/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java
index b3f3c50..73ba069 100644
--- a/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java
+++ b/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java
@@ -31,7 +31,7 @@ public class ClassLoaderFactory {
private ClassLoaderFactory() {}
- public static ClassLoader getURLClassLoader(ScriptMetaData scriptData) {
+ public static URLClassLoader getURLClassLoader(ScriptMetaData scriptData) {
ClassLoader parent = scriptData.getClass().getClassLoader();
URL[] classPath = scriptData.getClassPath();
LogUtils.DEBUG("Classpath has length " + classPath.length);
@@ -43,8 +43,8 @@ public class ClassLoaderFactory {
return getURLClassLoader(parent, classPath);
}
- private static ClassLoader getURLClassLoader(ClassLoader parent,
+ private static URLClassLoader getURLClassLoader(ClassLoader parent,
URL[] classpath) {
return new URLClassLoader(classpath, parent);
}
-}
\ No newline at end of file
+}
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index c832e6e..b444cce 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -35,6 +35,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
+import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
@@ -180,15 +181,14 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener {
*/
public void edit(final XScriptContext context, ScriptMetaData entry) {
if (entry != null) {
+ URLClassLoader cl = null;
try {
- ClassLoader cl = null;
-
try {
cl = ClassLoaderFactory.getURLClassLoader(entry);
} catch (Exception ignore) { // TODO re-examine error handling
}
- final ClassLoader theCl = cl;
+ final URLClassLoader theCl = cl;
final URL url = entry.getSourceURL();
SwingInvocation.invoke(
new Runnable() {
@@ -210,6 +210,12 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener {
});
} catch (IOException ioe) {
showErrorMessage("Error loading file: " + ioe.getMessage());
+ if (cl != null) {
+ try {
+ cl.close();
+ } catch (IOException e) {
+ }
+ }
}
}
}
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
index 2aabba7..76ee4ef 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java
@@ -49,7 +49,9 @@ import com.sun.star.uno.Any;
import com.sun.star.uno.Type;
import com.sun.star.uno.XComponentContext;
+import java.io.IOException;
import java.net.URL;
+import java.net.URLClassLoader;
import java.util.StringTokenizer;
@@ -182,13 +184,19 @@ class ScriptImpl implements XScript {
aOutParamIndex[0] = new short[0];
aOutParam[0] = new Object[0];
- ClassLoader cl = null;
+ URLClassLoader cl = null;
URL sourceUrl = null;
try {
cl = ClassLoaderFactory.getURLClassLoader(metaData);
sourceUrl = metaData.getSourceURL();
} catch (java.net.MalformedURLException mfu) {
+ if (cl != null) {
+ try {
+ cl.close();
+ } catch (IOException e) {
+ }
+ }
// Framework error
throw new ScriptFrameworkErrorException(
mfu.getMessage(), null,
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
index 9465a64..359ac4a 100644
--- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
+++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java
@@ -44,7 +44,9 @@ import com.sun.star.script.provider.XScript;
import com.sun.star.uno.XComponentContext;
+import java.io.IOException;
import java.net.URL;
+import java.net.URLClassLoader;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ImporterTopLevel;
@@ -181,12 +183,18 @@ class ScriptImpl implements XScript {
aOutParamIndex[0] = new short[0];
aOutParam[0] = new Object[0];
- ClassLoader cl = null;
+ URLClassLoader cl = null;
try {
cl = ClassLoaderFactory.getURLClassLoader(metaData);
metaData.getSourceURL();
} catch (java.net.MalformedURLException mfu) {
+ if (cl != null) {
+ try {
+ cl.close();
+ } catch (IOException e) {
+ }
+ }
throw new ScriptFrameworkErrorException(
mfu.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
commit 21b0cbfdc531379cfdd8359941ac6c6a4b8b66fd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:47:23 2016 +0100
coverity#1371367 Resource leak on an exceptional path
Change-Id: I4da5f6d427e8132d62860b46cb4def88b8afb25d
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index c432007..c832e6e 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -344,6 +344,9 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener {
if (fos != null) {
try {
fos.flush();
+ } catch (IOException ignore) {
+ }
+ try {
fos.close();
} catch (IOException ignore) {
}
commit ccc355bc4e4368df51fbec33d6d0bcf035bffcca
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:45:40 2016 +0100
coverity#1371375 Resource leak
Change-Id: I53b5ddc26e77168c29ba1bcfd199b1accbc54d3a
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6199979..dfad9b2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1505,7 +1505,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
std::stringstream aStream;
boost::property_tree::write_json(aStream, aTree);
- pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, strdup(aStream.str().c_str()));
+ OString aPayload = aStream.str().c_str();
+ pDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_UNO_COMMAND_RESULT, aPayload.getStr());
return;
}
}
commit 16e6f1fb6b4f763fcb4af0c309f72b7819db72ed
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:35:07 2016 +0100
coverity#1371374 Resource leak
Change-Id: I6b96ab51c2013577b9d0299a86e545b4a899939a
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index ca4eb48..a882511 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -1066,10 +1066,10 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
getCorrectExportOrder(xNameContainer, aLibraryMap);
// start here with the VBA export
- SotStorage* pVBAStream = pRootStorage->OpenSotStorage("VBA", STREAM_READWRITE);
- SotStorageStream* pDirStream = pVBAStream->OpenSotStream("dir", STREAM_READWRITE);
+ tools::SvRef<SotStorage> xVBAStream = pRootStorage->OpenSotStorage("VBA", STREAM_READWRITE);
+ SotStorageStream* pDirStream = xVBAStream->OpenSotStream("dir", STREAM_READWRITE);
- SotStorageStream* pVBAProjectStream = pVBAStream->OpenSotStream("_VBA_PROJECT", STREAM_READWRITE);
+ SotStorageStream* pVBAProjectStream = xVBAStream->OpenSotStream("_VBA_PROJECT", STREAM_READWRITE);
SotStorageStream* pPROJECTStream = pRootStorage->OpenSotStream("PROJECT", STREAM_READWRITE);
SotStorageStream* pPROJECTwmStream = pRootStorage->OpenSotStream("PROJECTwm", STREAM_READWRITE);
@@ -1107,11 +1107,11 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
OUString aSheet2Path = "/home/moggi/Documents/testfiles/vba/VBA/Sheet2";
OUString aSheet3Path = "/home/moggi/Documents/testfiles/vba/VBA/Sheet3";
OUString aWorkbookPath = "/home/moggi/Documents/testfiles/vba/VBA/ThisWorkbook";
- SotStorageStream* pModule1Stream = pVBAStream->OpenSotStream("Module1", STREAM_READWRITE);
- SotStorageStream* pSheet1Stream = pVBAStream->OpenSotStream("Sheet1", STREAM_READWRITE);
- SotStorageStream* pSheet2Stream = pVBAStream->OpenSotStream("Sheet2", STREAM_READWRITE);
- SotStorageStream* pSheet3Stream = pVBAStream->OpenSotStream("Sheet3", STREAM_READWRITE);
- SotStorageStream* pWorkbookStream = pVBAStream->OpenSotStream("ThisWorkbook", STREAM_READWRITE);
+ SotStorageStream* pModule1Stream = xVBAStream->OpenSotStream("Module1", STREAM_READWRITE);
+ SotStorageStream* pSheet1Stream = xVBAStream->OpenSotStream("Sheet1", STREAM_READWRITE);
+ SotStorageStream* pSheet2Stream = xVBAStream->OpenSotStream("Sheet2", STREAM_READWRITE);
+ SotStorageStream* pSheet3Stream = xVBAStream->OpenSotStream("Sheet3", STREAM_READWRITE);
+ SotStorageStream* pWorkbookStream = xVBAStream->OpenSotStream("ThisWorkbook", STREAM_READWRITE);
addFileStreamToSotStream(aModule1Path, pModule1Stream);
addFileStreamToSotStream(aSheet1Path, pSheet1Stream);
addFileStreamToSotStream(aSheet2Path, pSheet2Stream);
@@ -1129,7 +1129,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
for (sal_Int32 i = 0; i < n; ++i)
{
const OUString& rModuleName = aElementNames[aLibraryMap[i]];
- SotStorageStream* pModuleStream = pVBAStream->OpenSotStream(rModuleName, STREAM_READWRITE);
+ SotStorageStream* pModuleStream = xVBAStream->OpenSotStream(rModuleName, STREAM_READWRITE);
css::uno::Any aCode = xNameContainer->getByName(rModuleName);
css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(rModuleName);
OUString aSourceCode;
@@ -1143,7 +1143,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
pVBAProjectStream->Commit();
pDirStream->Commit();
- pVBAStream->Commit();
+ xVBAStream->Commit();
pPROJECTStream->Commit();
pPROJECTwmStream->Commit();
pRootStorage->Commit();
commit ce757cdd9e68193ad08bffc0911f72e7cd3dc283
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:26:58 2016 +0100
coverity#1371380 Resource leak on an exceptional path
Change-Id: I278f8d50dfaaa45e582a34e43ddba3b143203796
diff --git a/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java b/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
index 9fd8001..4000a1d 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
@@ -144,7 +144,7 @@ public final class socketAcceptor implements XAcceptor {
}
serv = server;
}
- Socket socket;
+ Socket socket = null;
try {
socket = serv.accept();
if (DEBUG) {
@@ -165,6 +165,12 @@ public final class socketAcceptor implements XAcceptor {
return new SocketConnection(acceptingDescription, socket);
}
catch(IOException e) {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch(IOException ioException) {
+ }
+ }
throw new ConnectionSetupException(e);
}
}
diff --git a/jurt/com/sun/star/lib/connections/socket/socketConnector.java b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
index e88f104..3d29e47 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketConnector.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
@@ -154,9 +154,11 @@ public final class socketConnector implements XConnector {
con = new SocketConnection(connectionDescription, socket);
} catch (IOException e) {
- try {
- socket.close();
- } catch(IOException ioException) {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch(IOException ioException) {
+ }
}
throw new NoConnectException(e);
}
commit 29a479c3ceada7343974730c8c9eeaea0a5c9d1f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:22:27 2016 +0100
coverity#1371379 Resource leak on an exceptional path
Change-Id: I0e26dfe610aa7e2cb5eb292aca239ba5e1ad34d9
diff --git a/jurt/com/sun/star/lib/connections/socket/socketConnector.java b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
index 4ce67ce..e88f104 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketConnector.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
@@ -154,6 +154,10 @@ public final class socketConnector implements XConnector {
con = new SocketConnection(connectionDescription, socket);
} catch (IOException e) {
+ try {
+ socket.close();
+ } catch(IOException ioException) {
+ }
throw new NoConnectException(e);
}
connected = true;
commit 2e333bcf78c6ee5d8aa9fe5edda910e34500bccd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:16:35 2016 +0100
coverity#1371454 DE: Dropped or ignored exception
Change-Id: I324fe2b2cb2b5874b183fa9685d969708c345b39
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java
index 1e86ccbd..40c032a 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java
@@ -453,6 +453,7 @@ public class ORowSet extends TestCase {
}
catch(Exception ex)
{
+ System.out.println("caught exception: " + ex);
}
}
}
commit 6d1b332b411a615ad5677835b92d3dc43d4abd5a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:13:36 2016 +0100
Resolves: coverity#1371451 Useless call
seems to be broken since...
commit 74bd852583566fdfc7e2e35f8f9bd0ad1c821ecb
Author: Stephan Wunderlich <sw at openoffice.org>
Date: Fri Jan 31 13:48:01 2003 +0000
CHG: using AnyConverter instead of simple cast
Change-Id: I005618f32ac50d3601e9ad0b790f37c08ba073ce
diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java
index 8565e35..d13e113 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java
@@ -121,7 +121,7 @@ public class ScAutoFormatsObj extends TestCase{
log.println( "adding INSTANCEn as mod relation to environment" );
int THRCNT = 1;
if ((String)Param.get("THRCNT") != null) {
- Integer.parseInt((String)Param.get("THRCNT"));
+ THRCNT = Integer.parseInt((String)Param.get("THRCNT"));
}
for (int n = 1; n < (THRCNT+1) ;n++ ) {
log.println( "adding INSTANCE" + n
commit a75d49241df2e0dd2f1bcd3ce7fae3197eb5afe8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:06:40 2016 +0100
coverity#1371437 Uncaught exception
Change-Id: I2daa658f51a81ce9292f236075dc37c16af4279d
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index cf60272..f43d278 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -78,7 +78,7 @@ sal_Int64 Adapter::getSomething( const Sequence< sal_Int8 > &id) throw (RuntimeE
}
void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
- throw ( InvocationTargetException )
+ throw ( InvocationTargetException, RuntimeException )
{
if( !Py_IsInitialized() )
throw InvocationTargetException();
diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx
index 31b43ce..653d6fd 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -262,7 +262,7 @@ OUString pyString2ustring( PyObject *str );
void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
- throw ( css::reflection::InvocationTargetException );
+ throw (css::reflection::InvocationTargetException, css::uno::RuntimeException);
PyRef PyUNO_callable_new (
const css::uno::Reference<css::script::XInvocation2> &xInv,
commit a205a1ffade2520314553f1fc7cb529f6fc6e59e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:04:59 2016 +0100
coverity#1371438 Uncaught exception
Change-Id: I83818be02fd7479bf6990dde076aad582a7f8f44
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index c919f47..bd97cb3 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -144,7 +144,7 @@ Content::Content(
const uno::Reference< ucb::XContentIdentifier >& Identifier,
rtl::Reference< DAVSessionFactory > const & rSessionFactory,
bool isCollection )
- throw ( ucb::ContentCreationException )
+ throw (ucb::ContentCreationException, css::uno::RuntimeException)
: ContentImplHelper( rxContext, pProvider, Identifier ),
m_eResourceType( UNKNOWN ),
m_eResourceTypeForLocks( UNKNOWN ),
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
index 1183896..825fe09 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
@@ -233,7 +233,7 @@ public:
const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier,
rtl::Reference< DAVSessionFactory > const & rSessionFactory,
bool isCollection )
- throw ( css::ucb::ContentCreationException );
+ throw (css::ucb::ContentCreationException, css::uno::RuntimeException);
virtual ~Content();
// XInterface
commit 62e760e36c2f64dface18b0383ee61fdf7868aa8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:03:52 2016 +0100
coverity#1371439 Uncaught exception
Change-Id: I642be9296babf077588eaf4c9da0aa11dc184fa0
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 8f1fcce..c919f47 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -109,7 +109,7 @@ Content::Content(
ContentProvider* pProvider,
const uno::Reference< ucb::XContentIdentifier >& Identifier,
rtl::Reference< DAVSessionFactory > const & rSessionFactory )
- throw ( ucb::ContentCreationException )
+ throw (ucb::ContentCreationException, css::uno::RuntimeException)
: ContentImplHelper( rxContext, pProvider, Identifier ),
m_eResourceType( UNKNOWN ),
m_eResourceTypeForLocks( UNKNOWN ),
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
index bda8566..1183896 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
@@ -227,7 +227,7 @@ public:
ContentProvider* pProvider,
const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier,
rtl::Reference< DAVSessionFactory > const & rSessionFactory )
- throw ( css::ucb::ContentCreationException );
+ throw (css::ucb::ContentCreationException, css::uno::RuntimeException);
Content( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
ContentProvider* pProvider,
const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier,
commit dd8e0a4280feacd3cc81326e53de36b188f798ec
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:02:22 2016 +0100
coverity#1371449 Uninitialized scalar field
Change-Id: I9e43b01f40cc325b83d23903fcec9010f848fb28
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 2563d1b..d08d5c0 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -86,7 +86,10 @@ class TimingListener
: public CppUnit::TestListener
{
public:
- TimingListener() = default;
+ TimingListener()
+ : m_nStartTime(0)
+ {
+ }
TimingListener(const TimingListener&) = delete;
TimingListener& operator=(const TimingListener&) = delete;
commit 55b4ca8b5e7283aafc7a539b629dc4c3dad8fb51
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 11:00:24 2016 +0100
try and silence coverity#1371452 Wrapper object use after free
Change-Id: I52ac98481a1a98c40ad8d6a31d8868b233337ec9
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 4f9230b..743a841 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -327,6 +327,7 @@ namespace XSLT
m_transformer->error(msg);
}
closeOutput();
+ m_tcontext->_private = nullptr;
oh.reset();
xsltFreeStylesheet(styleSheet);
xsltFreeTransformContext(m_tcontext);
commit e00691e04d3e79145a93e89a7681b2847adea9c5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:59:14 2016 +0100
lets not have yet another indent style
Change-Id: Iaf9d143c5f63b066d2a5d1d061354cc8b1cf1550
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 4d35c16..4f9230b 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -232,23 +232,23 @@ namespace XSLT
if (buffer == nullptr || len < 0)
return -1;
if (len > 0)
+ {
+ css::uno::Reference<XOutputStream> xos = m_transformer->getOutputStream();
+ sal_Int32 writeLen = len;
+ sal_Int32 bufLen = ::std::min(writeLen, OUTPUT_BUFFER_SIZE);
+ const sal_uInt8* memPtr =
+ reinterpret_cast<const sal_uInt8*> (buffer);
+ while (writeLen > 0)
{
- css::uno::Reference<XOutputStream> xos = m_transformer->getOutputStream();
- sal_Int32 writeLen = len;
- sal_Int32 bufLen = ::std::min(writeLen, OUTPUT_BUFFER_SIZE);
- const sal_uInt8* memPtr =
- reinterpret_cast<const sal_uInt8*> (buffer);
- while (writeLen > 0)
- {
- sal_Int32 n = ::std::min(writeLen, bufLen);
- m_writeBuf.realloc(n);
- memcpy(m_writeBuf.getArray(), memPtr,
- static_cast<size_t> (n));
- xos.get()->writeBytes(m_writeBuf);
- memPtr += n;
- writeLen -= n;
- }
+ sal_Int32 n = ::std::min(writeLen, bufLen);
+ m_writeBuf.realloc(n);
+ memcpy(m_writeBuf.getArray(), memPtr,
+ static_cast<size_t> (n));
+ xos.get()->writeBytes(m_writeBuf);
+ memPtr += n;
+ writeLen -= n;
}
+ }
return len;
}
@@ -257,10 +257,10 @@ namespace XSLT
{
css::uno::Reference<XOutputStream> xos = m_transformer->getOutputStream();
if (xos.is())
- {
- xos.get()->flush();
- xos.get()->closeOutput();
- }
+ {
+ xos.get()->flush();
+ xos.get()->closeOutput();
+ }
m_transformer->done();
return 0;
}
@@ -296,36 +296,36 @@ namespace XSLT
#endif
std::unique_ptr<OleHandler> oh(new OleHandler(m_transformer->getComponentContext()));
if (styleSheet)
- {
- m_tcontext = xsltNewTransformContext(styleSheet, doc);
- m_tcontext->_private = static_cast<void *> (oh.get());
- xsltQuoteUserParams(m_tcontext, ¶ms[0]);
- result = xsltApplyStylesheetUser(styleSheet, doc, nullptr, nullptr, nullptr,
- m_tcontext);
- }
+ {
+ m_tcontext = xsltNewTransformContext(styleSheet, doc);
+ m_tcontext->_private = static_cast<void *> (oh.get());
+ xsltQuoteUserParams(m_tcontext, ¶ms[0]);
+ result = xsltApplyStylesheetUser(styleSheet, doc, nullptr, nullptr, nullptr,
+ m_tcontext);
+ }
if (result)
- {
- xmlCharEncodingHandlerPtr encoder = xmlGetCharEncodingHandler(
- XML_CHAR_ENCODING_UTF8);
- xmlOutputBufferPtr outBuf = xmlAllocOutputBuffer(encoder);
- outBuf->context = static_cast<void *> (this);
- outBuf->writecallback = &ParserOutputBufferCallback::on_write;
- outBuf->closecallback = &ParserOutputBufferCallback::on_close;
- xsltSaveResultTo(outBuf, result, styleSheet);
- xmlOutputBufferClose(outBuf);
- }
+ {
+ xmlCharEncodingHandlerPtr encoder = xmlGetCharEncodingHandler(
+ XML_CHAR_ENCODING_UTF8);
+ xmlOutputBufferPtr outBuf = xmlAllocOutputBuffer(encoder);
+ outBuf->context = static_cast<void *> (this);
+ outBuf->writecallback = &ParserOutputBufferCallback::on_write;
+ outBuf->closecallback = &ParserOutputBufferCallback::on_close;
+ xsltSaveResultTo(outBuf, result, styleSheet);
+ xmlOutputBufferClose(outBuf);
+ }
else
- {
- xmlErrorPtr lastErr = xmlGetLastError();
- OUString msg;
- if (lastErr)
- msg = OUString::createFromAscii(lastErr->message);
- else
- msg = "Unknown XSLT transformation error";
-
- m_transformer->error(msg);
- }
+ {
+ xmlErrorPtr lastErr = xmlGetLastError();
+ OUString msg;
+ if (lastErr)
+ msg = OUString::createFromAscii(lastErr->message);
+ else
+ msg = "Unknown XSLT transformation error";
+
+ m_transformer->error(msg);
+ }
closeOutput();
oh.reset();
xsltFreeStylesheet(styleSheet);
@@ -420,10 +420,10 @@ namespace XSLT
ListenerList::iterator it;
ListenerList* l = &m_listeners;
for (it = l->begin(); it != l->end(); ++it)
- {
- css::uno::Reference<XStreamListener> xl = *it;
- xl.get()->started();
- }
+ {
+ css::uno::Reference<XStreamListener> xl = *it;
+ xl.get()->started();
+ }
OSL_ENSURE(!m_Reader.is(), "Somebody forgot to call terminate *and* holds a reference to this LibXSLTTransformer instance");
m_Reader = new Reader(this);
m_Reader->launch();
@@ -436,13 +436,13 @@ namespace XSLT
Any arg;
arg <<= Exception(msg, *this);
for (ListenerList::iterator it = l->begin(); it != l->end(); ++it)
+ {
+ css::uno::Reference<XStreamListener> xl = *it;
+ if (xl.is())
{
- css::uno::Reference<XStreamListener> xl = *it;
- if (xl.is())
- {
- xl.get()->error(arg);
- }
+ xl.get()->error(arg);
}
+ }
}
void
@@ -450,13 +450,13 @@ namespace XSLT
{
ListenerList* l = &m_listeners;
for (ListenerList::iterator it = l->begin(); it != l->end(); ++it)
+ {
+ css::uno::Reference<XStreamListener> xl = *it;
+ if (xl.is())
{
- css::uno::Reference<XStreamListener> xl = *it;
- if (xl.is())
- {
- xl.get()->closed();
- }
+ xl.get()->closed();
}
+ }
}
void
@@ -484,56 +484,54 @@ namespace XSLT
xmlSubstituteEntitiesDefault(0);
m_parameters.clear();
for (int i = 0; i < params.getLength(); i++)
+ {
+ NamedValue nv;
+ params[i] >>= nv;
+ OString nameUTF8 = OUStringToOString(nv.Name,
+ RTL_TEXTENCODING_UTF8);
+ OUString value;
+ OString valueUTF8;
+ if (nv.Value >>= value)
{
- NamedValue nv;
- params[i] >>= nv;
- OString nameUTF8 = OUStringToOString(nv.Name,
+ valueUTF8 = OUStringToOString(value,
RTL_TEXTENCODING_UTF8);
- OUString value;
- OString valueUTF8;
- if (nv.Value >>= value)
- {
- valueUTF8 = OUStringToOString(value,
- RTL_TEXTENCODING_UTF8);
- }
- else
- {
- // ignore non-string parameters
- continue;
- }
- if (nameUTF8.equals("StylesheetURL"))
- {
- m_styleSheetURL = valueUTF8;
- }
- else if (nameUTF8.equals("SourceURL"))
- {
- m_parameters.insert(pair<const char*, OString> (
- PARAM_SOURCE_URL, valueUTF8));
- }
- else if (nameUTF8.equals("SourceBaseURL"))
- {
- m_parameters.insert(pair<const char*, OString> (
- PARAM_SOURCE_BASE_URL, valueUTF8));
- }
- else if (nameUTF8.equals("TargetURL"))
- {
- m_parameters.insert(pair<const char*, OString> (
- PARAM_TARGET_URL, valueUTF8));
- }
- else if (nameUTF8.equals("TargetBaseURL"))
- {
- m_parameters.insert(pair<const char*, OString> (
- PARAM_TARGET_BASE_URL, valueUTF8));
- }
- else if (nameUTF8.equals("DoctypePublic"))
- {
- m_parameters.insert(pair<const char*, OString> (
- PARAM_DOCTYPE_PUBLIC, valueUTF8));
- }
}
+ else
+ {
+ // ignore non-string parameters
+ continue;
+ }
+ if (nameUTF8.equals("StylesheetURL"))
+ {
+ m_styleSheetURL = valueUTF8;
+ }
+ else if (nameUTF8.equals("SourceURL"))
+ {
+ m_parameters.insert(pair<const char*, OString> (
+ PARAM_SOURCE_URL, valueUTF8));
+ }
+ else if (nameUTF8.equals("SourceBaseURL"))
+ {
+ m_parameters.insert(pair<const char*, OString> (
+ PARAM_SOURCE_BASE_URL, valueUTF8));
+ }
+ else if (nameUTF8.equals("TargetURL"))
+ {
+ m_parameters.insert(pair<const char*, OString> (
+ PARAM_TARGET_URL, valueUTF8));
+ }
+ else if (nameUTF8.equals("TargetBaseURL"))
+ {
+ m_parameters.insert(pair<const char*, OString> (
+ PARAM_TARGET_BASE_URL, valueUTF8));
+ }
+ else if (nameUTF8.equals("DoctypePublic"))
+ {
+ m_parameters.insert(pair<const char*, OString> (
+ PARAM_DOCTYPE_PUBLIC, valueUTF8));
+ }
+ }
}
-
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6b8585858a9ee065061f51070ea114e8c33a8ed2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:45:48 2016 +0100
coverity#1371353 Illegal address computation
Change-Id: Ieeaf2ae7ba21a235141dcf303ca4485711c871db
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 1dc696e1..2d9651f 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -646,21 +646,21 @@ XclFunctionProvider::XclFunctionProvider( const XclRoot& rRoot )
from earlier tables. */
XclBiff eBiff = rRoot.GetBiff();
if( eBiff >= EXC_BIFF2 )
- (this->*pFillFunc)( saFuncTable_2, std::end( saFuncTable_2 ) );
+ (this->*pFillFunc)(std::begin(saFuncTable_2), std::end(saFuncTable_2));
if( eBiff >= EXC_BIFF3 )
- (this->*pFillFunc)( saFuncTable_3, std::end( saFuncTable_3 ) );
+ (this->*pFillFunc)(std::begin(saFuncTable_3), std::end(saFuncTable_3));
if( eBiff >= EXC_BIFF4 )
- (this->*pFillFunc)( saFuncTable_4, std::end( saFuncTable_4 ) );
+ (this->*pFillFunc)(std::begin(saFuncTable_4), std::end(saFuncTable_4));
if( eBiff >= EXC_BIFF5 )
- (this->*pFillFunc)( saFuncTable_5, std::end( saFuncTable_5 ) );
+ (this->*pFillFunc)(std::begin(saFuncTable_5), std::end(saFuncTable_5));
if( eBiff >= EXC_BIFF8 )
- (this->*pFillFunc)( saFuncTable_8, std::end( saFuncTable_8 ) );
- (this->*pFillFunc)( saFuncTable_Oox, std::end( saFuncTable_Oox ) );
- (this->*pFillFunc)( saFuncTable_2010, std::end( saFuncTable_2010 ) );
- (this->*pFillFunc)( saFuncTable_2013, std::end( saFuncTable_2013 ) );
- (this->*pFillFunc)( saFuncTable_2016, std::end( saFuncTable_2016 ) );
- (this->*pFillFunc)( saFuncTable_Odf, std::end( saFuncTable_Odf ) );
- (this->*pFillFunc)( saFuncTable_OOoLO, std::end( saFuncTable_OOoLO ) );
+ (this->*pFillFunc)(std::begin(saFuncTable_8), std::end(saFuncTable_8));
+ (this->*pFillFunc)(std::begin(saFuncTable_Oox), std::end(saFuncTable_Oox));
+ (this->*pFillFunc)(std::begin(saFuncTable_2010), std::end(saFuncTable_2010));
+ (this->*pFillFunc)(std::begin(saFuncTable_2013), std::end(saFuncTable_2013));
+ (this->*pFillFunc)(std::begin(saFuncTable_2016), std::end(saFuncTable_2016));
+ (this->*pFillFunc)(std::begin(saFuncTable_Odf), std::end(saFuncTable_Odf));
+ (this->*pFillFunc)(std::begin(saFuncTable_OOoLO), std::end(saFuncTable_OOoLO));
}
const XclFunctionInfo* XclFunctionProvider::GetFuncInfoFromXclFunc( sal_uInt16 nXclFunc ) const
commit 05266d3fe8633cb88f7bc8cab74ea922b0da6ad6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:43:28 2016 +0100
coverity#1371352 Illegal address computation
probable fix I guess
Change-Id: I9b5582cfff6c489113c523f34bd1b6acb9d835fd
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 72b7493..dcee0b3 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -1039,17 +1039,17 @@ FunctionProviderImpl::FunctionProviderImpl( bool bImportFilter )
/* Add functions supported in the current BIFF version only. Function
tables from later BIFF versions may overwrite single functions from
earlier tables. */
- initFuncs( saFuncTableBiff2, std::end( saFuncTableBiff2 ), bImportFilter );
- initFuncs( saFuncTableBiff3, std::end( saFuncTableBiff3 ), bImportFilter );
- initFuncs( saFuncTableBiff4, std::end( saFuncTableBiff4 ), bImportFilter );
- initFuncs( saFuncTableBiff5, std::end( saFuncTableBiff5 ), bImportFilter );
- initFuncs( saFuncTableBiff8, std::end( saFuncTableBiff8 ), bImportFilter );
- initFuncs( saFuncTableOox, std::end( saFuncTableOox ), bImportFilter );
- initFuncs( saFuncTable2010, std::end( saFuncTable2010 ), bImportFilter );
- initFuncs( saFuncTable2013, std::end( saFuncTable2013 ), bImportFilter );
- initFuncs( saFuncTable2016, std::end( saFuncTable2016 ), bImportFilter );
- initFuncs( saFuncTableOdf, std::end( saFuncTableOdf ), bImportFilter );
- initFuncs( saFuncTableOOoLO, std::end( saFuncTableOOoLO ), bImportFilter );
+ initFuncs(std::begin(saFuncTableBiff2), std::end(saFuncTableBiff2), bImportFilter);
+ initFuncs(std::begin(saFuncTableBiff3), std::end(saFuncTableBiff3), bImportFilter);
+ initFuncs(std::begin(saFuncTableBiff4), std::end(saFuncTableBiff4), bImportFilter);
+ initFuncs(std::begin(saFuncTableBiff5), std::end(saFuncTableBiff5), bImportFilter);
+ initFuncs(std::begin(saFuncTableBiff8), std::end(saFuncTableBiff8), bImportFilter);
+ initFuncs(std::begin(saFuncTableOox ), std::end(saFuncTableOox ), bImportFilter);
+ initFuncs(std::begin(saFuncTable2010 ), std::end(saFuncTable2010 ), bImportFilter);
+ initFuncs(std::begin(saFuncTable2013 ), std::end(saFuncTable2013 ), bImportFilter);
+ initFuncs(std::begin(saFuncTable2016 ), std::end(saFuncTable2016 ), bImportFilter);
+ initFuncs(std::begin(saFuncTableOdf ), std::end(saFuncTableOdf ), bImportFilter);
+ initFuncs(std::begin(saFuncTableOOoLO), std::end(saFuncTableOOoLO), bImportFilter);
}
void FunctionProviderImpl::initFunc(const FunctionData& rFuncData)
commit fef09fe0ddd53530ab32dd9ec91fdd07c5567343
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:32:47 2016 +0100
coverity#1371337 Dereference null return value
Change-Id: I209f28c1c78ffaec4f8f01b263e2e6320caa6a83
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 4113160..7a23e1b 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -25,10 +25,14 @@ using namespace com::sun::star;
int SfxLokHelper::createView()
{
SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
+ if (!pViewFrame)
+ return -1;
SfxRequest aRequest(pViewFrame, SID_NEWWINDOW);
pViewFrame->ExecView_Impl(aRequest);
-
- return SfxViewShell::Current()->GetViewShellId();
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (!pViewShell)
+ return -1;
+ return pViewShell->GetViewShellId();
}
void SfxLokHelper::destroyView(int nId)
commit 87e520e7b26c3eaf07ed10dcd0cb0f7f5cebd14d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:26:46 2016 +0100
Related: coverity#1371331 rework code a little
Change-Id: I4ea8f7b4fdd891f552d23e86eb376bd33ac33411
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 11b957d..1949094 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -253,13 +253,15 @@ BulletsTypeMgr::BulletsTypeMgr()
BulletsTypeMgr::BulletsTypeMgr(const BulletsTypeMgr& aTypeMgr):
NBOTypeMgrBase(aTypeMgr)
{
- for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
+ for (sal_uInt16 i=0; i < DEFAULT_BULLET_TYPES; ++i)
{
- pActualBullets[i]->bIsCustomized = aTypeMgr.pActualBullets[i]->bIsCustomized;
- pActualBullets[i]->cBulletChar = aTypeMgr.pActualBullets[i]->cBulletChar;
- pActualBullets[i]->aFont = aTypeMgr.pActualBullets[i]->aFont;
- pActualBullets[i]->sDescription = aTypeMgr. pActualBullets[i]->sDescription;
- pActualBullets[i]->eType = aTypeMgr. pActualBullets[i]->eType;
+ const BulletsSettings_Impl* pSrcBullet = aTypeMgr.pActualBullets[i];
+ BulletsSettings_Impl* pTargetBullet = pActualBullets[i];
+ pTargetBullet->bIsCustomized = pSrcBullet->bIsCustomized;
+ pTargetBullet->cBulletChar = pSrcBullet->cBulletChar;
+ pTargetBullet->aFont = pSrcBullet->aFont;
+ pTargetBullet->sDescription = pSrcBullet->sDescription;
+ pTargetBullet->eType = pSrcBullet->eType;
}
}
commit b794ed87f46dba5af9567c235358efd66ecee5af
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:23:54 2016 +0100
Related: coverity#1371328 rename variable slightly
Change-Id: I5cd6e9f4f5b3d9d7086229e4753d443d0f82bed7
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 56853fd..52edb6c 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -361,7 +361,7 @@ namespace cmis
libcmis::SessionFactory::setCertificateValidationHandler( certHandler );
// Get the auth credentials
- AuthProvider authProvider( xEnv, m_xIdentifier->getContentIdentifier( ), m_aURL.getBindingUrl( ) );
+ AuthProvider aAuthProvider(xEnv, m_xIdentifier->getContentIdentifier(), m_aURL.getBindingUrl());
AuthProvider::setXEnv( xEnv );
string rUsername = OUSTR_TO_STDSTR( m_aURL.getUsername( ) );
@@ -371,13 +371,13 @@ namespace cmis
while ( !bIsDone )
{
- if ( authProvider.authenticationQuery( rUsername, rPassword ) )
+ if (aAuthProvider.authenticationQuery(rUsername, rPassword))
{
// Initiate a CMIS session and register it as we found nothing
libcmis::OAuth2DataPtr oauth2Data;
if ( m_aURL.getBindingUrl( ) == GDRIVE_BASE_URL )
{
- libcmis::SessionFactory::setOAuth2AuthCodeProvider( authProvider.gdriveAuthCodeFallback );
+ libcmis::SessionFactory::setOAuth2AuthCodeProvider(aAuthProvider.gdriveAuthCodeFallback);
oauth2Data.reset( new libcmis::OAuth2Data(
GDRIVE_AUTH_URL, GDRIVE_TOKEN_URL,
GDRIVE_SCOPE, GDRIVE_REDIRECT_URI,
@@ -390,7 +390,7 @@ namespace cmis
ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) );
if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL )
{
- libcmis::SessionFactory::setOAuth2AuthCodeProvider( authProvider.onedriveAuthCodeFallback );
+ libcmis::SessionFactory::setOAuth2AuthCodeProvider(aAuthProvider.onedriveAuthCodeFallback);
oauth2Data.reset( new libcmis::OAuth2Data(
ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL,
ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI,
commit 33f92fedf61c23843d87675af73d89cec363133c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:21:41 2016 +0100
Related: coverity#1371327 why use 'this'
Change-Id: I49d92fdc86ac5b3eb61f75849d574cb260c77e2c
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 55f1920..4d35c16 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -217,7 +217,7 @@ namespace XSLT
if (buffer == nullptr || len < 0)
return (-1);
sal_Int32 n;
- css::uno::Reference<XInputStream> xis = this->m_transformer->getInputStream();
+ css::uno::Reference<XInputStream> xis = m_transformer->getInputStream();
n = xis.get()->readBytes(m_readBuf, len);
if (n > 0)
{
@@ -235,8 +235,7 @@ namespace XSLT
{
css::uno::Reference<XOutputStream> xos = m_transformer->getOutputStream();
sal_Int32 writeLen = len;
- sal_Int32 bufLen = ::std::min(writeLen,
- this->OUTPUT_BUFFER_SIZE);
+ sal_Int32 bufLen = ::std::min(writeLen, OUTPUT_BUFFER_SIZE);
const sal_uInt8* memPtr =
reinterpret_cast<const sal_uInt8*> (buffer);
while (writeLen > 0)
commit e1d50431a0107a1c0b0313a85b1856088353f777
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:10:53 2016 +0100
coverity#1371130 'Constant' variable guards dead code
Change-Id: I94ac63f009cb398ef88e4889084bb9a99eb8bf6c
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 32f0e5f..43330a6 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -479,12 +479,12 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo )
clGetPlatformInfo(gpuInfo->mpPlatformID, CL_PLATFORM_NAME, 64,
pName, nullptr);
- bool bIsNotWinOrIsWin8OrGreater = true;
-
+#if defined (_WIN32)
// the Win32 SDK 8.1 deprecates GetVersionEx()
-#ifdef _WIN32_WINNT_WINBLUE
- bIsNotWinOrIsWin8OrGreater = IsWindows8OrGreater();
-#elif defined (_WIN32)
+# ifdef _WIN32_WINNT_WINBLUE
+ const bool bIsNotWinOrIsWin8OrGreater = IsWindows8OrGreater();
+# else
+ bool bIsNotWinOrIsWin8OrGreater = true;
OSVERSIONINFO aVersionInfo;
memset( &aVersionInfo, 0, sizeof(aVersionInfo) );
aVersionInfo.dwOSVersionInfoSize = sizeof( aVersionInfo );
@@ -495,6 +495,9 @@ bool initOpenCLRunEnv( GPUEnv *gpuInfo )
(aVersionInfo.dwMajorVersion == 6 && aVersionInfo.dwMinorVersion < 2))
bIsNotWinOrIsWin8OrGreater = false;
}
+# endif
+#else
+ const bool bIsNotWinOrIsWin8OrGreater = true;
#endif
// Heuristic: Certain old low-end OpenCL implementations don't
commit af743edb6452beca15b47c288b97d50e8d2b8892
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:04:11 2016 +0100
coverity#1371122 Unchecked return value
Change-Id: I0f09f8a601d3159194d4fae0e22cc690d1633701
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index f884dc3..feac296 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -199,7 +199,7 @@ bool SetOptimalHeightsToRows(
if (nLast)
{
ScFlatUInt16RowSegments::RangeData aRangeData;
- rCxt.getHeightArray().getRangeData(nInner, aRangeData);
+ (void)rCxt.getHeightArray().getRangeData(nInner, aRangeData);
if (aRangeData.mnValue + nExtraHeight == nLast)
{
nRngEnd = std::min<SCSIZE>(i + nMoreRows, aRangeData.mnRow2);
commit 9031a01deaa2bc29dfc30ce7ae76e3852ace5808
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 10:01:08 2016 +0100
coverity#1371120 Unchecked return value
Change-Id: I0d515f405ddea289a9610e960c050b28bb842a2f
diff --git a/reportdesign/source/filter/xml/xmlImage.cxx b/reportdesign/source/filter/xml/xmlImage.cxx
index 7133cd9..0ab2c3a 100644
--- a/reportdesign/source/filter/xml/xmlImage.cxx
+++ b/reportdesign/source/filter/xml/xmlImage.cxx
@@ -65,31 +65,31 @@ OXMLImage::OXMLImage( ORptFilter& rImport,
switch( rTokenMap.Get( nPrefix, sLocalName ) )
{
case XML_TOK_IMAGE_DATA:
- {
+ {
SvtPathOptions aPathOptions;
sValue = aPathOptions.SubstituteVariable(sValue);
_xComponent->setImageURL(rImport.GetAbsoluteReference( sValue ));
- }
-
break;
+ }
case XML_TOK_PRESERVE_IRI:
_xComponent->setPreserveIRI(s_sTRUE == sValue);
break;
case XML_TOK_SCALE:
+ {
+ sal_uInt16 nRet = awt::ImageScaleMode::NONE;
+ if ( s_sTRUE == sValue )
+ {
+ nRet = awt::ImageScaleMode::ANISOTROPIC;
+ }
+ else
{
- sal_uInt16 nRet = awt::ImageScaleMode::NONE;
- if ( s_sTRUE == sValue )
- {
- nRet = awt::ImageScaleMode::ANISOTROPIC;
- }
- else
- {
- const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetImageScaleOptions();
- SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
- }
- _xComponent->setScaleMode( nRet );
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetImageScaleOptions();
+ bool bConvertOk = SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
+ SAL_WARN_IF(!bConvertOk, "reportdesign", "convertEnum failed");
}
+ _xComponent->setScaleMode( nRet );
break;
+ }
case XML_TOK_DATA_FORMULA:
_xComponent->setDataField(ORptFilter::convertFormula(sValue));
break;
commit 9ce9e22f664b5db0e6c21ee50ba6467bc369dd0b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 09:59:04 2016 +0100
coverity#1371119 Unchecked return value
Change-Id: I6a39ee4aafe646c542f03c8548e1822837dfde5c
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index f9a2758..1211caf 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -460,7 +460,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
// --display and its argument are handled "out of line"
// in Unix-only desktop/unx/source/splashx.c and vcl/unx/*,
// and just ignored here
- supplier.next(&aArg);
+ (void)supplier.next(&aArg);
}
else if ( oArg == "convert-to" )
{
commit d785e039959d9274628488f7ef5b89af8445351e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 09:57:57 2016 +0100
coverity#1371118 Unchecked return value
Change-Id: I59316bdbd6bf4eec2b382c5894f51f1208c84fb6
diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx
index 895ae83..2170f84 100644
--- a/reportdesign/source/filter/xml/xmlReport.cxx
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -70,7 +70,8 @@ OXMLReport::OXMLReport( ORptFilter& rImport,
{
sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND);
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
- SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
+ bool bConvertOk = SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
+ SAL_WARN_IF(!bConvertOk, "reportdesign", "convertEnum failed");
m_xComponent->setCommandType(nRet);
}
break;
commit 3a1e60b47b311ceaacf4676d62bf9b989ea6d26f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 09:54:37 2016 +0100
coverity#1371117 Unchecked return value
Change-Id: I5243defe3cdcfecd5fac80a42863cda564f0aaab
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 6a5ac30..4954ed8 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -396,9 +396,9 @@ void SwAccessibleParagraph::InvalidateContent_( bool bVisibleDataFired )
aEvent.EventId = AccessibleEventId::TEXT_CHANGED;
// determine exact changes between sOldText and rText
- comphelper::OCommonAccessibleText::implInitTextChangedEvent(
- sOldText, rText,
- aEvent.OldValue, aEvent.NewValue );
+ (void)comphelper::OCommonAccessibleText::implInitTextChangedEvent(sOldText, rText,
+ aEvent.OldValue,
+ aEvent.NewValue);
FireAccessibleEvent( aEvent );
uno::Reference< XAccessible > xparent = getAccessibleParent();
commit c0b4aa8b7d0851208c5b6df00e1feab501aaf784
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 09:50:47 2016 +0100
coverity#1371116 Unchecked return value
Change-Id: I7d07b3e1b1eaaeb60adab2b957f6831794ee2eb4
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 3855935..0786f77 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -469,7 +469,7 @@ void RtfSdrExport::impl_writeGraphic()
// Export it to a stream.
SvMemoryStream aStream;
- GraphicConverter::Export(aStream, aGraphic, ConvertDataFormat::PNG);
+ (void)GraphicConverter::Export(aStream, aGraphic, ConvertDataFormat::PNG);
aStream.Seek(STREAM_SEEK_TO_END);
sal_uInt32 nSize = aStream.Tell();
const sal_uInt8* pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData());
commit ced06472f7b10bc301c66ebf1dd98d5dff8a7e6c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 19 09:48:40 2016 +0100
coverity#1371115 Unchecked return value
Change-Id: I71749199bdfc7f00acc955038e519e790bd9c373
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index fc3d22d..0c289cf 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -332,7 +332,8 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, AddHdl, Button*, void)
// Format with the name does not already exist, so take up.
std::unique_ptr<SwTableAutoFormat> pNewData(
new SwTableAutoFormat(aFormatName));
- pShell->GetTableAutoFormat( *pNewData );
+ bool bGetOk = pShell->GetTableAutoFormat( *pNewData );
+ SAL_WARN_IF(!bGetOk, "sw.ui", "GetTableAutoFormat failed for: " << aFormatName);
// Insert sorted!!
for( n = 1; n < pTableTable->size(); ++n )
More information about the Libreoffice-commits
mailing list