[Libreoffice-commits] core.git: 36 commits - chart2/source codemaker/source connectivity/source desktop/source extensions/source filter/source forms/source helpcompiler/inc helpcompiler/source include/svx include/toolkit l10ntools/source qadevOOo/tests registry/tools sc/source svx/source toolkit/source ucb/source unodevtools/source unoidl/source vbahelper/source
Caolán McNamara
caolanm at redhat.com
Fri Nov 6 04:16:36 PST 2015
chart2/source/view/axes/VCoordinateSystem.cxx | 2
chart2/source/view/inc/PlotterBase.hxx | 2
chart2/source/view/inc/VCoordinateSystem.hxx | 2
chart2/source/view/main/PlotterBase.cxx | 2
codemaker/source/cppumaker/cppumaker.cxx | 6
codemaker/source/javamaker/javamaker.cxx | 4
connectivity/source/drivers/calc/CConnection.cxx | 2
connectivity/source/drivers/file/FConnection.cxx | 3
connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx | 2
connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx | 2
connectivity/source/inc/calc/CConnection.hxx | 3
connectivity/source/inc/file/FConnection.hxx | 3
desktop/source/app/app.cxx | 26
extensions/source/plugin/unx/npwrap.cxx | 306 +++++------
filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 2
filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx | 2
filter/source/xsltdialog/xmlfilterjar.cxx | 2
filter/source/xsltdialog/xmlfilterjar.hxx | 2
forms/source/component/clickableimage.cxx | 2
forms/source/component/clickableimage.hxx | 2
helpcompiler/inc/HelpCompiler.hxx | 2
helpcompiler/source/HelpCompiler.cxx | 2
helpcompiler/source/HelpIndexer_main.cxx | 105 ++-
include/svx/unoshape.hxx | 4
include/toolkit/controls/controlmodelcontainerbase.hxx | 2
include/toolkit/controls/dialogcontrol.hxx | 2
l10ntools/source/helpex.cxx | 126 ++--
l10ntools/source/localize.cxx | 34 -
l10ntools/source/pocheck.cxx | 38 -
l10ntools/source/uimerge.cxx | 35 -
qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java | 2
qadevOOo/tests/java/ifc/container/_XNameContainer.java | 5
qadevOOo/tests/java/ifc/document/_XEventsSupplier.java | 2
qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java | 4
qadevOOo/tests/java/mod/_sw/SwXTextDocument.java | 20
registry/tools/regcompare.cxx | 174 +++---
registry/tools/regmerge.cxx | 111 ++-
registry/tools/regview.cxx | 90 +--
sc/source/ui/vba/vbaapplication.cxx | 2
sc/source/ui/vba/vbaapplication.hxx | 2
svx/source/gengal/gengal.cxx | 5
svx/source/unodraw/unoshap2.cxx | 4
svx/source/unodraw/unoshap4.cxx | 3
toolkit/source/controls/controlmodelcontainerbase.cxx | 2
toolkit/source/controls/dialogcontrol.cxx | 2
ucb/source/ucp/file/bc.cxx | 5
ucb/source/ucp/file/bc.hxx | 2
unodevtools/source/skeletonmaker/skeletonmaker.cxx | 3
unoidl/source/unoidl-check.cxx | 3
unoidl/source/unoidl-read.cxx | 3
unoidl/source/unoidl-write.cxx | 6
vbahelper/source/vbahelper/vbadocumentsbase.cxx | 2
52 files changed, 628 insertions(+), 551 deletions(-)
New commits:
commit cc68b830edb0ce15b6c1695d87e76d8968632744
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 11:12:44 2015 +0000
afl-event-testing: afl-1.93b has a new persistent pattern
some testing shows that I can reliably hit at least 1000 pseudo-restarts
without failures, so bump from 100 to 1000
Change-Id: Ib72c74068793ea1090a7b99a566372dc943641e6
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 4dbe67a..aa1a776 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1274,31 +1274,21 @@ struct ExecuteGlobals
static ExecuteGlobals* pExecGlobals = NULL;
-#define PERSIST_MAX 100
-unsigned int persist_cnt;
//This just calls Execute() for all normal uses of LibreOffice, but for
-//ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up
-//to PERSIST_MAX times)
+//ui-testing if built with afl-clang-fast++ then on exit it will pseudo-restart
+//(up to 100 times)
void Desktop::DoExecute()
{
-try_again:
+#if !defined(__AFL_HAVE_MANUAL_CONTROL)
+ Execute();
+#else
+ while (__AFL_LOOP(1000))
{
Execute();
- /* To signal successful completion of a run, we need to deliver
- SIGSTOP to our own process, then loop to the very beginning
- once we're resumed by the supervisor process. We do this only
- if AFL_PERSISTENT is set to retain normal behavior when the
- program is executed directly; and take note of PERSIST_MAX. */
- if (getenv("AFL_PERSISTENT") && persist_cnt++ < PERSIST_MAX)
- {
- OpenDefault();
-#if defined UNX
- raise(SIGSTOP);
-#endif
- goto try_again;
- }
+ OpenDefault();
}
+#endif
}
int Desktop::Main()
commit a9c3e2d27f8e4a9cac6866d4d03f289aff49bf4d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:44:04 2015 +0000
coverity#1326268 Dereference after null check
Change-Id: I3b744c5141a3217822cf4617a30d4f6368e76dd9
diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java
index c74f93d..49fe710 100644
--- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java
+++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertyStates.java
@@ -75,8 +75,8 @@ public class _XMultiPropertyStates extends MultiMethodTest {
boolean result = false;
try {
Object[] defaults = oObj.getPropertyDefaults(names);
- result = (defaults != null) && defaults.length == names.length;
log.println("Number of default values: " + defaults.length);
+ result = defaults.length == names.length;
} catch (com.sun.star.beans.UnknownPropertyException e) {
log.println("some properties seem to be unknown: " + e.toString());
} catch (com.sun.star.lang.WrappedTargetException e) {
commit 98565e0c3c140cacccfc5cd28192bb8a5f76c0d9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:41:36 2015 +0000
coverity#1326298 Dereference after null check
Change-Id: Ia260697264fbb087ca827b409dea800ca2514c6e
diff --git a/qadevOOo/tests/java/ifc/container/_XNameContainer.java b/qadevOOo/tests/java/ifc/container/_XNameContainer.java
index 2e9f259..5a16c32 100644
--- a/qadevOOo/tests/java/ifc/container/_XNameContainer.java
+++ b/qadevOOo/tests/java/ifc/container/_XNameContainer.java
@@ -97,10 +97,7 @@ public class _XNameContainer extends MultiMethodTest {
log.println("get ObjRelation(\"INSTANCE" + Index +"\")");
Object oInstance = tEnv.getObjRelation("INSTANCE"+ Index);
- if (oInstance == null) {
- log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
- }
-
+ log.println("ObjRelation(\"INSTANCE" + Index +"\") Object n.a.");
log.println("testing insertByName(\""+Name+"\")...");
try {
commit abafff8cd37d12c9d6897da5e331b0170bbc9b9f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:38:45 2015 +0000
coverity#1326563 Dereference before null check
Change-Id: I198f6a0ee1070b5aec475d55de437d7c9f5b281c
diff --git a/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java b/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java
index 8aa25ca..ee41f37 100644
--- a/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java
+++ b/qadevOOo/tests/java/ifc/document/_XEventsSupplier.java
@@ -44,7 +44,7 @@ public class _XEventsSupplier extends MultiMethodTest {
XNameReplace xNR = oObj.getEvents();
xNR.getElementNames();
- tRes.tested("getEvents()",xNR != null);
+ tRes.tested("getEvents()", true);
}
} // finish class _XEventSupplier
commit 4e6f348ed92a1b3719bf80059d6ceed5ab638601
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:38:13 2015 +0000
coverity#1326562 Dereference before null check
Change-Id: I3f24c355e57fddf36e5af141bf10d43e72257f4f
diff --git a/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java b/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java
index 9a10e56..1cc5b32 100644
--- a/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java
+++ b/qadevOOo/tests/java/ifc/document/_XLinkTargetSupplier.java
@@ -42,9 +42,7 @@ public class _XLinkTargetSupplier extends MultiMethodTest {
public void _getLinks() {
XNameAccess links = oObj.getLinks();
links.getElementNames();
- tRes.tested("getLinks()", links != null);
+ tRes.tested("getLinks()", true);
}
}
-
-
commit 199fd5ce980e1a14db5a07fb8c565de2aea72ccd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:37:09 2015 +0000
coverity#1326560 Dereference before null check
Change-Id: Id4892ad9cfe53f00d8b20babd34ae46807ce833b
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
index ef93bdd..75ffd62 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java
@@ -181,23 +181,15 @@ public class SwXTextDocument extends TestCase {
log.println("creating a second textdocument");
xSecondTextDoc = WriterTools.createTextDoc(Param.getMSF());
- if (xTextDoc != null) {
- log.println("Creating instance...");
+ XText oText2 = xTextDoc.getText();
+ XTextCursor oTextCursor = oText2.createTextCursor();
- XText oText2 = xTextDoc.getText();
- XTextCursor oTextCursor = oText2.createTextCursor();
-
- for (int i = 0; i < 11; i++) {
- oText2.insertString(oTextCursor, "xTextDoc ", false);
- }
-
- tEnv = new TestEnvironment(xTextDoc);
- } else {
- log.println("Failed to create instance.");
-
- return tEnv;
+ for (int i = 0; i < 11; i++) {
+ oText2.insertString(oTextCursor, "xTextDoc ", false);
}
+ tEnv = new TestEnvironment(xTextDoc);
+
XModel model1 = UnoRuntime.queryInterface(XModel.class, xTextDoc);
XModel model2 = UnoRuntime.queryInterface(XModel.class, xSecondTextDoc);
commit 8366909cd1ff58aa00f82565eb83c8af47672339
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:18:19 2015 +0000
coverity#1338269 Uncaught exception
Change-Id: I32bfeb0ded37da05eecc97b92d9f724d59123fce
diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx
index bdd3ad8..84be029 100644
--- a/l10ntools/source/pocheck.cxx
+++ b/l10ntools/source/pocheck.cxx
@@ -453,25 +453,33 @@ static void checkMathSymbolNames(const OString& aLanguage)
int main()
{
- OString aLanguages(getenv("ALL_LANGS"));
- if( aLanguages.isEmpty() )
+ try
{
- std::cerr << "Usage: bin/run pocheck\n";
- return 1;
+ OString aLanguages(getenv("ALL_LANGS"));
+ if( aLanguages.isEmpty() )
+ {
+ std::cerr << "Usage: bin/run pocheck\n";
+ return 1;
+ }
+ for(sal_Int32 i = 1;;++i) // skip en-US
+ {
+ OString aLanguage = aLanguages.getToken(i,' ');
+ if( aLanguage.isEmpty() )
+ break;
+ if( aLanguage == "qtz" )
+ continue;
+ checkStyleNames(aLanguage);
+ checkFunctionNames(aLanguage);
+ checkVerticalBar(aLanguage);
+ checkMathSymbolNames(aLanguage);
+ }
+ return 0;
}
- for(sal_Int32 i = 1;;++i) // skip en-US
+ catch (std::exception& e)
{
- OString aLanguage = aLanguages.getToken(i,' ');
- if( aLanguage.isEmpty() )
- break;
- if( aLanguage == "qtz" )
- continue;
- checkStyleNames(aLanguage);
- checkFunctionNames(aLanguage);
- checkVerticalBar(aLanguage);
- checkMathSymbolNames(aLanguage);
+ std::cerr << "pocheck: exception " << e.what() << std::endl;
+ return 1;
}
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit a814812bdabf3e0e8b1e6de82bd73b26b4c5ec9e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:17:01 2015 +0000
coverity#1338268 Uncaught exception
Change-Id: Id954d556c2b65772025b8aaabdbfa9ed4ae7a9b7
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 5c107a6..e12ffc0 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -453,19 +453,29 @@ void handleProjects(char * sSourceRoot, char const * sDestRoot)
}
}
-SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
- if (argc != 3) {
- cerr
- << ("localize (c)2001 by Sun Microsystems\n\n"
- "As part of the L10N framework, localize extracts en-US\n"
- "strings for translation out of the toplevel modules defined\n"
- "in projects array in l10ntools/source/localize.cxx.\n\n"
- "Syntax: localize <source-root> <outfile>\n");
- exit(EXIT_FAILURE);
- }
- try {
+SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
+{
+ try
+ {
+ if (argc != 3)
+ {
+ cerr
+ << ("localize (c)2001 by Sun Microsystems\n\n"
+ "As part of the L10N framework, localize extracts en-US\n"
+ "strings for translation out of the toplevel modules defined\n"
+ "in projects array in l10ntools/source/localize.cxx.\n\n"
+ "Syntax: localize <source-root> <outfile>\n");
+ exit(EXIT_FAILURE);
+ }
handleProjects(argv[1],argv[2]);
- } catch (bool) { //TODO
+ }
+ catch (std::exception& e)
+ {
+ cerr << "exception: " << e.what() << std::endl;
+ return EXIT_FAILURE;
+ }
+ catch (bool) //TODO
+ {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
commit fb1a18d6c1cb315defc1f7cd20167015274f296e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:15:10 2015 +0000
coverity#1338261 Uncaught exception
Change-Id: I3e818ed5ccf395f0fbaf82f8e62870b847fc41c9
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index e68abb5..e805ade 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -47,85 +47,93 @@ void WriteUsage()
" (de, en-US, ...) or all\n");
}
-SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
-
- bool bMultiMerge = false;
- for (int nIndex = 1; nIndex != argc; ++nIndex)
+SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
+{
+ bool hasNoError = true;
+ try
{
- if (std::strcmp(argv[nIndex], "-mi") == 0)
+ bool bMultiMerge = false;
+ for (int nIndex = 1; nIndex != argc; ++nIndex)
{
- argv[nIndex][1] = 'i';
- argv[nIndex][2] = '\0';
- bMultiMerge = true;
- break;
+ if (std::strcmp(argv[nIndex], "-mi") == 0)
+ {
+ argv[nIndex][1] = 'i';
+ argv[nIndex][2] = '\0';
+ bMultiMerge = true;
+ break;
+ }
}
- }
- common::HandledArgs aArgs;
- if ( !common::handleArguments( argc, argv, aArgs) )
- {
- WriteUsage();
- return 1;
- }
- bool hasNoError = true;
+ common::HandledArgs aArgs;
+ if ( !common::handleArguments( argc, argv, aArgs) )
+ {
+ WriteUsage();
+ return 1;
+ }
- if ( aArgs.m_bMergeMode )
- {
- if( bMultiMerge )
+ if ( aArgs.m_bMergeMode )
{
- std::ifstream aInput( aArgs.m_sInputFile.getStr() );
- if( !aInput.is_open() )
+ if( bMultiMerge )
{
- std::cerr << "Helpex error: cannot open input file\n";
- return 1;
- }
- MergeDataFile* pMergeDataFile = 0;
- if( aArgs.m_sLanguage != "qtz")
- {
- pMergeDataFile = new MergeDataFile(aArgs.m_sMergeSrc, OString(), false, false );
+ std::ifstream aInput( aArgs.m_sInputFile.getStr() );
+ if( !aInput.is_open() )
+ {
+ std::cerr << "Helpex error: cannot open input file\n";
+ return 1;
+ }
+ MergeDataFile* pMergeDataFile = 0;
+ if( aArgs.m_sLanguage != "qtz")
+ {
+ pMergeDataFile = new MergeDataFile(aArgs.m_sMergeSrc, OString(), false, false );
+ }
+ std::string sTemp;
+ aInput >> sTemp;
+ while( !aInput.eof() )
+ {
+ // coverity[tainted_data] - this is a build time tool
+ const OString sXhpFile( sTemp.data(), (sal_Int32)sTemp.length() );
+ HelpParser aParser( sXhpFile );
+ const OString sOutput(
+ aArgs.m_sOutputFile +
+ sXhpFile.copy( sXhpFile.lastIndexOf('/') ));
+ if( !aParser.Merge( aArgs.m_sMergeSrc, sOutput,
+ aArgs.m_sLanguage, pMergeDataFile ))
+ {
+ hasNoError = false;
+ }
+ aInput >> sTemp;
+ }
+ aInput.close();
+ delete pMergeDataFile;
}
- std::string sTemp;
- aInput >> sTemp;
- while( !aInput.eof() )
+ else
{
- // coverity[tainted_data] - this is a build time tool
- const OString sXhpFile( sTemp.data(), (sal_Int32)sTemp.length() );
- HelpParser aParser( sXhpFile );
- const OString sOutput(
- aArgs.m_sOutputFile +
- sXhpFile.copy( sXhpFile.lastIndexOf('/') ));
- if( !aParser.Merge( aArgs.m_sMergeSrc, sOutput,
- aArgs.m_sLanguage, pMergeDataFile ))
+ HelpParser aParser( aArgs.m_sInputFile );
+ MergeDataFile* pMergeDataFile = 0;
+ if( aArgs.m_sLanguage != "qtz")
{
- hasNoError = false;
+ pMergeDataFile = new MergeDataFile(aArgs.m_sMergeSrc, aArgs.m_sInputFile, false, false );
}
- aInput >> sTemp;
+ hasNoError =
+ aParser.Merge(
+ aArgs.m_sMergeSrc, aArgs.m_sOutputFile,
+ aArgs.m_sLanguage, pMergeDataFile );
+ delete pMergeDataFile;
}
- aInput.close();
- delete pMergeDataFile;
}
else
{
HelpParser aParser( aArgs.m_sInputFile );
- MergeDataFile* pMergeDataFile = 0;
- if( aArgs.m_sLanguage != "qtz")
- {
- pMergeDataFile = new MergeDataFile(aArgs.m_sMergeSrc, aArgs.m_sInputFile, false, false );
- }
hasNoError =
- aParser.Merge(
- aArgs.m_sMergeSrc, aArgs.m_sOutputFile,
- aArgs.m_sLanguage, pMergeDataFile );
- delete pMergeDataFile;
+ HelpParser::CreatePO(
+ aArgs.m_sOutputFile, aArgs.m_sInputFile,
+ new XMLFile( OString('0') ), "help" );
}
}
- else
+ catch (std::exception& e)
{
- HelpParser aParser( aArgs.m_sInputFile );
- hasNoError =
- HelpParser::CreatePO(
- aArgs.m_sOutputFile, aArgs.m_sInputFile,
- new XMLFile( OString('0') ), "help" );
+ std::cerr << "Helpex exception: " << e.what() << std::endl;
+ hasNoError = true;
}
if( hasNoError )
commit a8d95baea41f8bc91024429fa08e09a35a5c1e08
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:12:48 2015 +0000
coverity#1338256 Uncaught exception
Change-Id: Iadfb2e59fd40aa178123dbfc20be093cc8f128d2
diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx
index 8a0450d3..c2e42dd 100644
--- a/l10ntools/source/uimerge.cxx
+++ b/l10ntools/source/uimerge.cxx
@@ -182,26 +182,33 @@ bool Merge(
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
int nRetValue = 0;
-
- common::HandledArgs aArgs;
- if ( !common::handleArguments(argc, argv, aArgs) )
+ try
{
- common::writeUsage("uiex","*.ui");
- return 1;
- }
- sInputFileName = aArgs.m_sInputFile;
- sOutputFile = aArgs.m_sOutputFile;
+ common::HandledArgs aArgs;
+ if ( !common::handleArguments(argc, argv, aArgs) )
+ {
+ common::writeUsage("uiex","*.ui");
+ return 1;
+ }
- if (!aArgs.m_bMergeMode)
- {
- nRetValue = extractTranslations();
+ sInputFileName = aArgs.m_sInputFile;
+ sOutputFile = aArgs.m_sOutputFile;
+
+ if (!aArgs.m_bMergeMode)
+ {
+ nRetValue = extractTranslations();
+ }
+ else
+ {
+ Merge(aArgs.m_sMergeSrc, sInputFileName, sOutputFile, aArgs.m_sLanguage);
+ }
}
- else
+ catch (std::exception& e)
{
- Merge(aArgs.m_sMergeSrc, sInputFileName, sOutputFile, aArgs.m_sLanguage);
+ fprintf(stderr, "exception: %s\n", e.what());
+ return 1;
}
-
return nRetValue;
}
commit 09414353ba069cc86ac9a0cc578d6345a68944c5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:05:40 2015 +0000
coverity#1338266 Uncaught exception
Change-Id: I27a2a4dd0f5fd88d92eafa35bf8ae2e4aa0d5d17
diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx
index bd079e5..12da5ad 100644
--- a/extensions/source/plugin/unx/npwrap.cxx
+++ b/extensions/source/plugin/unx/npwrap.cxx
@@ -319,169 +319,177 @@ extern "C" {
int main( int argc, char **argv)
{
- struct sigaction aSigAction;
- aSigAction.sa_handler = signal_handler;
- sigemptyset( &aSigAction.sa_mask );
- aSigAction.sa_flags = SA_NOCLDSTOP;
- sigaction( SIGSEGV, &aSigAction, NULL );
- sigaction( SIGBUS, &aSigAction, NULL );
- sigaction( SIGABRT, &aSigAction, NULL );
- sigaction( SIGTERM, &aSigAction, NULL );
- sigaction( SIGILL, &aSigAction, NULL );
-
- int nArg = (argc < 3) ? 1 : 2;
- char* pBaseName = argv[nArg] + strlen(argv[nArg]);
- while( pBaseName > argv[nArg] && pBaseName[-1] != '/' )
- pBaseName--;
- LoadAdditionalLibs( pBaseName );
-
- if( argc == 2 ) {
- CheckPlugin(argv[1]);
- exit(0);
- }
- nAppArguments = argc;
- pAppArguments = argv;
-
- XSetErrorHandler( plugin_x_error_handler );
-
- if( pipe( wakeup_fd ) ) {
- SAL_WARN("extensions.plugin", "could not pipe()");
- return 1;
- }
- // initialize 'wakeup' pipe.
- int flags;
-
- // set close-on-exec descriptor flag.
- if ((flags = fcntl (wakeup_fd[0], F_GETFD)) != -1) {
- flags |= FD_CLOEXEC;
- (void)fcntl(wakeup_fd[0], F_SETFD, flags);
- }
- if ((flags = fcntl (wakeup_fd[1], F_GETFD)) != -1) {
- flags |= FD_CLOEXEC;
- (void)fcntl(wakeup_fd[1], F_SETFD, flags);
- }
-
- // set non-blocking I/O flag.
- if ((flags = fcntl (wakeup_fd[0], F_GETFL)) != -1) {
- flags |= O_NONBLOCK;
- (void)fcntl(wakeup_fd[0], F_SETFL, flags);
- }
- if ((flags = fcntl (wakeup_fd[1], F_GETFL)) != -1) {
- flags |= O_NONBLOCK;
- (void)fcntl(wakeup_fd[1], F_SETFL, flags);
- }
-
- pPluginLib = LoadModule( argv[2] );
- if( ! pPluginLib ) {
- exit(255);
- }
- int nSocket = atol( argv[1] );
-
-#if ENABLE_GTK
- g_thread_init(NULL);
- gtk_init(&argc, &argv);
-#endif
+ try
+ {
+ struct sigaction aSigAction;
+ aSigAction.sa_handler = signal_handler;
+ sigemptyset( &aSigAction.sa_mask );
+ aSigAction.sa_flags = SA_NOCLDSTOP;
+ sigaction( SIGSEGV, &aSigAction, NULL );
+ sigaction( SIGBUS, &aSigAction, NULL );
+ sigaction( SIGABRT, &aSigAction, NULL );
+ sigaction( SIGTERM, &aSigAction, NULL );
+ sigaction( SIGILL, &aSigAction, NULL );
+
+ int nArg = (argc < 3) ? 1 : 2;
+ char* pBaseName = argv[nArg] + strlen(argv[nArg]);
+ while( pBaseName > argv[nArg] && pBaseName[-1] != '/' )
+ pBaseName--;
+ LoadAdditionalLibs( pBaseName );
+
+ if( argc == 2 ) {
+ CheckPlugin(argv[1]);
+ exit(0);
+ }
+ nAppArguments = argc;
+ pAppArguments = argv;
- pConnector = new PluginConnector( nSocket );
- pConnector->SetConnectionLostHdl( Link<Mediator*,void>( NULL, GlobalConnectionLostHdl ) );
+ XSetErrorHandler( plugin_x_error_handler );
- XtSetLanguageProc( NULL, NULL, NULL );
+ if( pipe( wakeup_fd ) ) {
+ SAL_WARN("extensions.plugin", "could not pipe()");
+ return 1;
+ }
+ // initialize 'wakeup' pipe.
+ int flags;
- XtToolkitInitialize();
- app_context = XtCreateApplicationContext();
- pXtAppDisplay = XtOpenDisplay( app_context, NULL, "SOPlugin", "SOPlugin", NULL, 0, &argc, argv );
+ // set close-on-exec descriptor flag.
+ if ((flags = fcntl (wakeup_fd[0], F_GETFD)) != -1) {
+ flags |= FD_CLOEXEC;
+ (void)fcntl(wakeup_fd[0], F_SETFD, flags);
+ }
+ if ((flags = fcntl (wakeup_fd[1], F_GETFD)) != -1) {
+ flags |= FD_CLOEXEC;
+ (void)fcntl(wakeup_fd[1], F_SETFD, flags);
+ }
+ // set non-blocking I/O flag.
+ if ((flags = fcntl (wakeup_fd[0], F_GETFL)) != -1) {
+ flags |= O_NONBLOCK;
+ (void)fcntl(wakeup_fd[0], F_SETFL, flags);
+ }
+ if ((flags = fcntl (wakeup_fd[1], F_GETFL)) != -1) {
+ flags |= O_NONBLOCK;
+ (void)fcntl(wakeup_fd[1], F_SETFL, flags);
+ }
-#if ENABLE_GTK
- // integrate Xt events into GTK event loop
- GPollFD aXtPollDesc, aWakeupPollDesc;
+ pPluginLib = LoadModule( argv[2] );
+ if( ! pPluginLib ) {
+ exit(255);
+ }
+ int nSocket = atol( argv[1] );
- GSource* pXTSource = g_source_new( &aXtEventFuncs, sizeof(GSource) );
- if( !pXTSource ) {
- SAL_WARN("extensions.plugin", "could not get Xt GSource");
- return 1;
- }
+ #if ENABLE_GTK
+ g_thread_init(NULL);
+ gtk_init(&argc, &argv);
+ #endif
- g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS );
- g_source_set_can_recurse( pXTSource, sal_True );
- g_source_attach( pXTSource, NULL );
- aXtPollDesc.fd = ConnectionNumber( pXtAppDisplay );
- aXtPollDesc.events = G_IO_IN;
- aXtPollDesc.revents = 0;
- g_source_add_poll( pXTSource, &aXtPollDesc );
-
- gint xt_polling_timer_id = g_timeout_add( 25, pollXtTimerCallback, NULL);
- // Initialize wakeup events listener
- GSource *pWakeupSource = g_source_new( &aWakeupEventFuncs, sizeof(GSource) );
- if ( pWakeupSource == NULL ) {
- SAL_WARN("extensions.plugin", "could not get wakeup source");
- return 1;
- }
- g_source_set_priority( pWakeupSource, GDK_PRIORITY_EVENTS);
- g_source_attach( pWakeupSource, NULL );
- aWakeupPollDesc.fd = wakeup_fd[0];
- aWakeupPollDesc.events = G_IO_IN;
- aWakeupPollDesc.revents = 0;
- g_source_add_poll( pWakeupSource, &aWakeupPollDesc );
-
- pAppDisplay = gdk_x11_display_get_xdisplay( gdk_display_get_default() );
-#else
- pAppDisplay = pXtAppDisplay;
- XtAppAddInput( app_context,
- wakeup_fd[0],
- (XtPointer)XtInputReadMask,
- ThreadEventHandler, NULL );
-#endif
+ pConnector = new PluginConnector( nSocket );
+ pConnector->SetConnectionLostHdl( Link<Mediator*,void>( NULL, GlobalConnectionLostHdl ) );
- // send that we are ready to go
- MediatorMessage* pMessage =
- pConnector->Transact( "init req", 8,
- NULL );
- delete pMessage;
-
-#if OSL_DEBUG_LEVEL > 3
- int nPID = getpid();
- int nChild = fork();
- if( nChild == 0 ) {
- char pidbuf[16];
- char* pArgs[] = { "xterm", "-sl", "2000", "-sb", "-e", "gdb", "pluginapp.bin", pidbuf, NULL };
- sprintf( pidbuf, "%d", nPID );
- execvp( pArgs[0], pArgs );
- _exit(255);
- } else
- sleep( 10 );
-#endif
+ XtSetLanguageProc( NULL, NULL, NULL );
- /*
- * Loop for events.
- */
- // for some reason XtAppSetExitFlag won't quit the application
- // in ThreadEventHandler most of times; Xt will hang in select
- // (hat is in XtAppNextEvent). Have our own mainloop instead
- // of XtAppMainLoop
- do {
-#if ENABLE_GTK
- g_main_context_iteration( NULL, sal_True );
-#else
- XtAppProcessEvent( app_context, XtIMAll );
-#endif
- } while( ! XtAppGetExitFlag( app_context ) && ! bPluginAppQuit );
+ XtToolkitInitialize();
+ app_context = XtCreateApplicationContext();
+ pXtAppDisplay = XtOpenDisplay( app_context, NULL, "SOPlugin", "SOPlugin", NULL, 0, &argc, argv );
- SAL_INFO("extensions.plugin", "left plugin app main loop");
-#if ENABLE_GTK
- g_source_remove(xt_polling_timer_id);
-#endif
+ #if ENABLE_GTK
+ // integrate Xt events into GTK event loop
+ GPollFD aXtPollDesc, aWakeupPollDesc;
- pNP_Shutdown();
- SAL_INFO("extensions.plugin", "NP_Shutdown done");
- osl_unloadModule( pPluginLib );
- SAL_INFO("extensions.plugin", "plugin close");
+ GSource* pXTSource = g_source_new( &aXtEventFuncs, sizeof(GSource) );
+ if( !pXTSource ) {
+ SAL_WARN("extensions.plugin", "could not get Xt GSource");
+ return 1;
+ }
- close( wakeup_fd[0] );
- close( wakeup_fd[1] );
+ g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS );
+ g_source_set_can_recurse( pXTSource, sal_True );
+ g_source_attach( pXTSource, NULL );
+ aXtPollDesc.fd = ConnectionNumber( pXtAppDisplay );
+ aXtPollDesc.events = G_IO_IN;
+ aXtPollDesc.revents = 0;
+ g_source_add_poll( pXTSource, &aXtPollDesc );
+
+ gint xt_polling_timer_id = g_timeout_add( 25, pollXtTimerCallback, NULL);
+ // Initialize wakeup events listener
+ GSource *pWakeupSource = g_source_new( &aWakeupEventFuncs, sizeof(GSource) );
+ if ( pWakeupSource == NULL ) {
+ SAL_WARN("extensions.plugin", "could not get wakeup source");
+ return 1;
+ }
+ g_source_set_priority( pWakeupSource, GDK_PRIORITY_EVENTS);
+ g_source_attach( pWakeupSource, NULL );
+ aWakeupPollDesc.fd = wakeup_fd[0];
+ aWakeupPollDesc.events = G_IO_IN;
+ aWakeupPollDesc.revents = 0;
+ g_source_add_poll( pWakeupSource, &aWakeupPollDesc );
+
+ pAppDisplay = gdk_x11_display_get_xdisplay( gdk_display_get_default() );
+ #else
+ pAppDisplay = pXtAppDisplay;
+ XtAppAddInput( app_context,
+ wakeup_fd[0],
+ (XtPointer)XtInputReadMask,
+ ThreadEventHandler, NULL );
+ #endif
+
+ // send that we are ready to go
+ MediatorMessage* pMessage =
+ pConnector->Transact( "init req", 8,
+ NULL );
+ delete pMessage;
+
+ #if OSL_DEBUG_LEVEL > 3
+ int nPID = getpid();
+ int nChild = fork();
+ if( nChild == 0 ) {
+ char pidbuf[16];
+ char* pArgs[] = { "xterm", "-sl", "2000", "-sb", "-e", "gdb", "pluginapp.bin", pidbuf, NULL };
+ sprintf( pidbuf, "%d", nPID );
+ execvp( pArgs[0], pArgs );
+ _exit(255);
+ } else
+ sleep( 10 );
+ #endif
+
+ /*
+ * Loop for events.
+ */
+ // for some reason XtAppSetExitFlag won't quit the application
+ // in ThreadEventHandler most of times; Xt will hang in select
+ // (hat is in XtAppNextEvent). Have our own mainloop instead
+ // of XtAppMainLoop
+ do {
+ #if ENABLE_GTK
+ g_main_context_iteration( NULL, sal_True );
+ #else
+ XtAppProcessEvent( app_context, XtIMAll );
+ #endif
+ } while( ! XtAppGetExitFlag( app_context ) && ! bPluginAppQuit );
+
+ SAL_INFO("extensions.plugin", "left plugin app main loop");
+
+ #if ENABLE_GTK
+ g_source_remove(xt_polling_timer_id);
+ #endif
+
+ pNP_Shutdown();
+ SAL_INFO("extensions.plugin", "NP_Shutdown done");
+ osl_unloadModule( pPluginLib );
+ SAL_INFO("extensions.plugin", "plugin close");
+
+ close( wakeup_fd[0] );
+ close( wakeup_fd[1] );
- return 0;
+ return 0;
+ }
+ catch (std::exception& e)
+ {
+ SAL_WARN("extensions.plugin", "exception: " << e.what());
+ return 255;
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f3c77010ce650570ce0819fd262a164c47b7f6a7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 10:00:03 2015 +0000
coverity#1338271 Uncaught exception
Change-Id: Ib2b7617f9862b904bd3d5939800244c541eba8a5
diff --git a/helpcompiler/source/HelpIndexer_main.cxx b/helpcompiler/source/HelpIndexer_main.cxx
index 97b1d7a..85ff29a 100644
--- a/helpcompiler/source/HelpIndexer_main.cxx
+++ b/helpcompiler/source/HelpIndexer_main.cxx
@@ -16,70 +16,79 @@
#include "LuceneHelper.hxx"
-int main(int argc, char **argv) {
- const std::string pLang("-lang");
- const std::string pModule("-mod");
- const std::string pDir("-dir");
+int main(int argc, char **argv)
+{
+ try
+ {
+ const std::string pLang("-lang");
+ const std::string pModule("-mod");
+ const std::string pDir("-dir");
- std::string lang;
- std::string module;
- std::string dir;
+ std::string lang;
+ std::string module;
+ std::string dir;
- bool error = false;
- for (int i = 1; i < argc; ++i) {
- if (pLang.compare(argv[i]) == 0) {
- if (i + 1 < argc) {
- lang = argv[++i];
+ bool error = false;
+ for (int i = 1; i < argc; ++i) {
+ if (pLang.compare(argv[i]) == 0) {
+ if (i + 1 < argc) {
+ lang = argv[++i];
+ } else {
+ error = true;
+ }
+ } else if (pModule.compare(argv[i]) == 0) {
+ if (i + 1 < argc) {
+ module = argv[++i];
+ } else {
+ error = true;
+ }
+ } else if (pDir.compare(argv[i]) == 0) {
+ if (i + 1 < argc) {
+ dir = argv[++i];
+ } else {
+ error = true;
+ }
} else {
error = true;
}
- } else if (pModule.compare(argv[i]) == 0) {
- if (i + 1 < argc) {
- module = argv[++i];
- } else {
- error = true;
- }
- } else if (pDir.compare(argv[i]) == 0) {
- if (i + 1 < argc) {
- dir = argv[++i];
- } else {
- error = true;
- }
- } else {
- error = true;
}
- }
- if (error) {
- std::cerr << "Error parsing command-line arguments" << std::endl;
- }
+ if (error) {
+ std::cerr << "Error parsing command-line arguments" << std::endl;
+ }
- if (error || lang.empty() || module.empty() || dir.empty()) {
- std::cerr << "Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -dir Dir" << std::endl;
- return 1;
- }
+ if (error || lang.empty() || module.empty() || dir.empty()) {
+ std::cerr << "Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -dir Dir" << std::endl;
+ return 1;
+ }
- OUString sDir;
+ OUString sDir;
- osl::File::getFileURLFromSystemPath(
- OUString(dir.c_str(), dir.size(), osl_getThreadTextEncoding()),
- sDir);
+ osl::File::getFileURLFromSystemPath(
+ OUString(dir.c_str(), dir.size(), osl_getThreadTextEncoding()),
+ sDir);
- OUString cwd;
- osl_getProcessWorkingDir(&cwd.pData);
+ OUString cwd;
+ osl_getProcessWorkingDir(&cwd.pData);
- osl::File::getAbsoluteFileURL(cwd, sDir, sDir);
+ osl::File::getAbsoluteFileURL(cwd, sDir, sDir);
- HelpIndexer indexer(
- OUString(lang.c_str(), lang.size(), osl_getThreadTextEncoding()),
- OUString(module.c_str(), module.size(), osl_getThreadTextEncoding()),
- sDir, sDir);
+ HelpIndexer indexer(
+ OUString(lang.c_str(), lang.size(), osl_getThreadTextEncoding()),
+ OUString(module.c_str(), module.size(), osl_getThreadTextEncoding()),
+ sDir, sDir);
- if (!indexer.indexDocuments()) {
- std::cerr << OUStringToOString(indexer.getErrorMessage(), osl_getThreadTextEncoding()).getStr() << std::endl;
+ if (!indexer.indexDocuments()) {
+ std::cerr << OUStringToOString(indexer.getErrorMessage(), osl_getThreadTextEncoding()).getStr() << std::endl;
+ return 2;
+ }
+ return 0;
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "failure: " << e.what() << std::endl;
return 2;
}
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0b3a807eadb8cb1e25556ddc25c9b722527314bb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:57:21 2015 +0000
coverity#1338272 Uncaught exception
Change-Id: I5b2b7044c77de899ce8dc1e44f3673835bd3ce4c
diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx
index 5b2ae7d..dcf3a8d 100644
--- a/registry/tools/regview.cxx
+++ b/registry/tools/regview.cxx
@@ -34,71 +34,79 @@ int main( int argc, char * argv[] )
int __cdecl main( int argc, char * argv[] )
#endif
{
- RegHandle hReg;
- RegKeyHandle hRootKey, hKey;
-
- if (argc < 2 || argc > 3)
+ try
{
- fprintf(stderr, "using: regview registryfile [keyName]\n");
- exit(1);
- }
+ RegHandle hReg;
+ RegKeyHandle hRootKey, hKey;
- OUString regName( convertToFileUrl(argv[1], strlen(argv[1])) );
- if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY) != RegError::NO_ERROR)
- {
- fprintf(stderr, "open registry \"%s\" failed\n", argv[1]);
- exit(1);
- }
+ if (argc < 2 || argc > 3)
+ {
+ fprintf(stderr, "using: regview registryfile [keyName]\n");
+ exit(1);
+ }
- if (reg_openRootKey(hReg, &hRootKey) == RegError::NO_ERROR)
- {
- if (argc == 3)
+ OUString regName( convertToFileUrl(argv[1], strlen(argv[1])) );
+ if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY) != RegError::NO_ERROR)
{
- OUString keyName( OUString::createFromAscii(argv[2]) );
- if (reg_openKey(hRootKey, keyName.pData, &hKey) == RegError::NO_ERROR)
+ fprintf(stderr, "open registry \"%s\" failed\n", argv[1]);
+ exit(1);
+ }
+
+ if (reg_openRootKey(hReg, &hRootKey) == RegError::NO_ERROR)
+ {
+ if (argc == 3)
{
- if (reg_dumpRegistry(hKey) != RegError::NO_ERROR)
+ OUString keyName( OUString::createFromAscii(argv[2]) );
+ if (reg_openKey(hRootKey, keyName.pData, &hKey) == RegError::NO_ERROR)
{
- fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
- }
+ if (reg_dumpRegistry(hKey) != RegError::NO_ERROR)
+ {
+ fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
+ }
- if (reg_closeKey(hKey) != RegError::NO_ERROR)
+ if (reg_closeKey(hKey) != RegError::NO_ERROR)
+ {
+ fprintf(stderr, "closing key \"%s\" of registry \"%s\" failed\n",
+ argv[2], argv[1]);
+ }
+ }
+ else
{
- fprintf(stderr, "closing key \"%s\" of registry \"%s\" failed\n",
+ fprintf(stderr, "key \"%s\" not exists in registry \"%s\"\n",
argv[2], argv[1]);
}
}
else
{
- fprintf(stderr, "key \"%s\" not exists in registry \"%s\"\n",
- argv[2], argv[1]);
+ if (reg_dumpRegistry(hRootKey) != RegError::NO_ERROR)
+ {
+ fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
+ }
+ }
+
+ if (reg_closeKey(hRootKey) != RegError::NO_ERROR)
+ {
+ fprintf(stderr, "closing root key of registry \"%s\" failed\n", argv[1]);
}
}
else
{
- if (reg_dumpRegistry(hRootKey) != RegError::NO_ERROR)
- {
- fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
- }
+ fprintf(stderr, "open root key of registry \"%s\" failed\n", argv[1]);
}
- if (reg_closeKey(hRootKey) != RegError::NO_ERROR)
+ if (reg_closeRegistry(hReg) != RegError::NO_ERROR)
{
- fprintf(stderr, "closing root key of registry \"%s\" failed\n", argv[1]);
+ fprintf(stderr, "closing registry \"%s\" failed\n", argv[1]);
+ exit(1);
}
- }
- else
- {
- fprintf(stderr, "open root key of registry \"%s\" failed\n", argv[1]);
- }
- if (reg_closeRegistry(hReg) != RegError::NO_ERROR)
+ return 0;
+ }
+ catch (std::exception& e)
{
- fprintf(stderr, "closing registry \"%s\" failed\n", argv[1]);
- exit(1);
+ fprintf(stderr, "failure: \"%s\"\n", e.what());
+ return 1;
}
-
- return 0;
}
commit eb02a55385c2f2e8cfeabeacb566c9fe630135f3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:55:29 2015 +0000
coverity#1338270 Uncaught exception
Change-Id: I5c6fae963c4aabe15d82a51f5801e62656188051
diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index 90a22e4..ee745a5 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -1954,113 +1954,121 @@ int main( int argc, char * argv[] )
int _cdecl main( int argc, char * argv[] )
#endif
{
- std::vector< std::string > args;
-
- Options_Impl options(argv[0]);
- for (int i = 1; i < argc; i++)
+ try
{
- if (!Options::checkArgument(args, argv[i], strlen(argv[i])))
+ std::vector< std::string > args;
+
+ Options_Impl options(argv[0]);
+ for (int i = 1; i < argc; i++)
+ {
+ if (!Options::checkArgument(args, argv[i], strlen(argv[i])))
+ {
+ // failure.
+ options.printUsage();
+ return 1;
+ }
+ }
+ if (!options.initOptions(args))
{
- // failure.
- options.printUsage();
return 1;
}
- }
- if (!options.initOptions(args))
- {
- return 1;
- }
-
- OUString regName1( convertToFileUrl(options.getRegName1().c_str(), options.getRegName1().size()) );
- OUString regName2( convertToFileUrl(options.getRegName2().c_str(), options.getRegName2().size()) );
-
- Registry reg1, reg2;
- if ( reg1.open(regName1, RegAccessMode::READONLY) != RegError::NO_ERROR )
- {
- fprintf(stdout, "%s: open registry \"%s\" failed\n",
- options.getProgramName().c_str(), options.getRegName1().c_str());
- return 2;
- }
- if ( reg2.open(regName2, RegAccessMode::READONLY) != RegError::NO_ERROR )
- {
- fprintf(stdout, "%s: open registry \"%s\" failed\n",
- options.getProgramName().c_str(), options.getRegName2().c_str());
- return 3;
- }
- RegistryKey key1, key2;
- if ( reg1.openRootKey(key1) != RegError::NO_ERROR )
- {
- fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
- options.getProgramName().c_str(), options.getRegName1().c_str());
- return 4;
- }
- if ( reg2.openRootKey(key2) != RegError::NO_ERROR )
- {
- fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
- options.getProgramName().c_str(), options.getRegName2().c_str());
- return 5;
- }
+ OUString regName1( convertToFileUrl(options.getRegName1().c_str(), options.getRegName1().size()) );
+ OUString regName2( convertToFileUrl(options.getRegName2().c_str(), options.getRegName2().size()) );
- if ( options.isStartKeyValid() )
- {
- if ( options.matchedWithExcludeKey( options.getStartKey() ) )
+ Registry reg1, reg2;
+ if ( reg1.open(regName1, RegAccessMode::READONLY) != RegError::NO_ERROR )
+ {
+ fprintf(stdout, "%s: open registry \"%s\" failed\n",
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return 2;
+ }
+ if ( reg2.open(regName2, RegAccessMode::READONLY) != RegError::NO_ERROR )
{
- fprintf(stdout, "%s: start key is equal to one of the exclude keys\n",
- options.getProgramName().c_str());
- return 6;
+ fprintf(stdout, "%s: open registry \"%s\" failed\n",
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return 3;
}
- RegistryKey sk1, sk2;
- if ( key1.openKey(options.getStartKey(), sk1) != RegError::NO_ERROR )
+
+ RegistryKey key1, key2;
+ if ( reg1.openRootKey(key1) != RegError::NO_ERROR )
{
- fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
+ fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName1().c_str());
- return 7;
+ return 4;
}
- if ( key2.openKey(options.getStartKey(), sk2) != RegError::NO_ERROR )
+ if ( reg2.openRootKey(key2) != RegError::NO_ERROR )
{
- fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
+ fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName2().c_str());
- return 8;
+ return 5;
}
- key1 = sk1;
- key2 = sk2;
- }
+ if ( options.isStartKeyValid() )
+ {
+ if ( options.matchedWithExcludeKey( options.getStartKey() ) )
+ {
+ fprintf(stdout, "%s: start key is equal to one of the exclude keys\n",
+ options.getProgramName().c_str());
+ return 6;
+ }
+ RegistryKey sk1, sk2;
+ if ( key1.openKey(options.getStartKey(), sk1) != RegError::NO_ERROR )
+ {
+ fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return 7;
+ }
+ if ( key2.openKey(options.getStartKey(), sk2) != RegError::NO_ERROR )
+ {
+ fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return 8;
+ }
- sal_uInt32 nError = compareKeys(options, key1, key2);
- if ( nError )
- {
- if ( options.unoTypeCheck() )
+ key1 = sk1;
+ key2 = sk2;
+ }
+
+ sal_uInt32 nError = compareKeys(options, key1, key2);
+ if ( nError )
{
- fprintf(stdout, "%s: registries are incompatible: %lu differences!\n",
- options.getProgramName().c_str(),
- sal::static_int_cast< unsigned long >(nError));
+ if ( options.unoTypeCheck() )
+ {
+ fprintf(stdout, "%s: registries are incompatible: %lu differences!\n",
+ options.getProgramName().c_str(),
+ sal::static_int_cast< unsigned long >(nError));
+ }
+ else
+ {
+ fprintf(stdout, "%s: registries contain %lu differences!\n",
+ options.getProgramName().c_str(),
+ sal::static_int_cast< unsigned long >(nError));
+ }
}
- else
+
+ key1.releaseKey();
+ key2.releaseKey();
+ if ( reg1.close() != RegError::NO_ERROR )
+ {
+ fprintf(stdout, "%s: closing registry \"%s\" failed\n",
+ options.getProgramName().c_str(), options.getRegName1().c_str());
+ return 9;
+ }
+ if ( reg2.close() != RegError::NO_ERROR )
{
- fprintf(stdout, "%s: registries contain %lu differences!\n",
- options.getProgramName().c_str(),
- sal::static_int_cast< unsigned long >(nError));
+ fprintf(stdout, "%s: closing registry \"%s\" failed\n",
+ options.getProgramName().c_str(), options.getRegName2().c_str());
+ return 10;
}
- }
- key1.releaseKey();
- key2.releaseKey();
- if ( reg1.close() != RegError::NO_ERROR )
- {
- fprintf(stdout, "%s: closing registry \"%s\" failed\n",
- options.getProgramName().c_str(), options.getRegName1().c_str());
- return 9;
+ return ((nError > 0) ? 11 : 0);
}
- if ( reg2.close() != RegError::NO_ERROR )
+ catch (std::exception& e)
{
- fprintf(stdout, "%s: closing registry \"%s\" failed\n",
- options.getProgramName().c_str(), options.getRegName2().c_str());
- return 10;
+ fprintf(stdout, ("WARNING: \"%s\"\n"), e.what());
+ return 11;
}
-
- return ((nError > 0) ? 11 : 0);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 061474017b550398b6c525bb18f0318d6cbe4850
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:53:14 2015 +0000
coverity#1338267 Uncaught exception
Change-Id: Id886abbafe7501e17eaae5b2ebf0bd065745c1ad
diff --git a/codemaker/source/javamaker/javamaker.cxx b/codemaker/source/javamaker/javamaker.cxx
index 2e97763..b711806 100644
--- a/codemaker/source/javamaker/javamaker.cxx
+++ b/codemaker/source/javamaker/javamaker.cxx
@@ -89,7 +89,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
} catch (IllegalArgument & e) {
std::cerr << "Illegal option " << e.m_message << '\n';
return EXIT_FAILURE;
+ } catch (std::exception & e) {
+ std::cerr << "Failure " << e.what() << '\n';
+ return EXIT_FAILURE;
}
+
return EXIT_SUCCESS;
}
commit d097d86940371fc114292462d3dca95ebf299701
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:52:07 2015 +0000
coverity#1338265 Uncaught exception
Change-Id: I5fd48ccaa9dc5c0477cb1d7da307c8403d92e3f7
diff --git a/chart2/source/view/inc/PlotterBase.hxx b/chart2/source/view/inc/PlotterBase.hxx
index af9ac88..5b7b935 100644
--- a/chart2/source/view/inc/PlotterBase.hxx
+++ b/chart2/source/view/inc/PlotterBase.hxx
@@ -56,7 +56,7 @@ public:
, const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >& xFactory
, const OUString& rCID
- ) throw (::com::sun::star::uno::RuntimeException );
+ ) throw (css::uno::RuntimeException, std::exception);
virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx
index 8d1334e..d3fd0e7 100644
--- a/chart2/source/view/main/PlotterBase.cxx
+++ b/chart2/source/view/main/PlotterBase.cxx
@@ -44,7 +44,7 @@ void PlotterBase::initPlotter( const uno::Reference< drawing::XShapes >& xLogic
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xShapeFactory
, const OUString& rCID )
- throw (uno::RuntimeException)
+ throw (uno::RuntimeException, std::exception)
{
OSL_PRECOND(xLogicTarget.is()&&xFinalTarget.is()&&xShapeFactory.is(),"no proper initialization parameters");
//is only allowed to be called once
commit 7165e1333e377b6975e4319963c1837939326438
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:51:11 2015 +0000
coverity#1338264 Uncaught exception
Change-Id: Ie9e6ad45f6d25d8a6e643d647898a5b595202590
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index bed27ee..ca3d76d 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -21,7 +21,7 @@
#include <rtl/byteseq.hxx>
#include <osl/diagnose.h>
-IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException )
+IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException, std::exception)
{
OUString iniUrl;
if (osl_File_E_None != osl_getFileURLFromSystemPath(rIniName.pData, &iniUrl.pData))
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
index dc3e274..61c76c1 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
@@ -59,7 +59,7 @@ class IniParser
IniSectionMap mAllSection;
public:
IniSectionMap& getAllSection() { return mAllSection; }
- explicit IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException);
+ explicit IniParser(OUString const & rIniName) throw(css::io::IOException, std::exception);
};
#endif
commit cd4e97ede3002663ae6be238392f665765e39466
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:49:55 2015 +0000
coverity#1338263 Uncaught exception
Change-Id: Ide3aec7a352786ed441be1f506a5cf488843ea29
diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx
index c6cdf4c..e52d3f8 100644
--- a/unoidl/source/unoidl-check.cxx
+++ b/unoidl/source/unoidl-check.cxx
@@ -1196,6 +1196,9 @@ SAL_IMPLEMENT_MAIN() {
<< "Bad input <" << e1.getUri() << ">: " << e1.getDetail()
<< std::endl;
std::exit(EXIT_FAILURE);
+ } catch (std::exception & e1) {
+ std::cerr << "Failure: " << e1.what() << std::endl;
+ std::exit(EXIT_FAILURE);
}
}
commit 7ef80d16d9370745ca88b241738738fca0140370
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:49:09 2015 +0000
coverity#1338262 Uncaught exception
Change-Id: I95f00b63f21b29bc3c22a4891ebc5668fed723fc
diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx
index 99a2024..67c870c 100644
--- a/unoidl/source/unoidl-read.cxx
+++ b/unoidl/source/unoidl-read.cxx
@@ -1152,6 +1152,9 @@ SAL_IMPLEMENT_MAIN() {
<< "Bad input <" << e1.getUri() << ">: " << e1.getDetail()
<< std::endl;
std::exit(EXIT_FAILURE);
+ } catch (std::exception & e1) {
+ std::cerr << "Failure: " << e1.what() << std::endl;
+ std::exit(EXIT_FAILURE);
}
}
commit 9aa7c8375c7f1038e8c729415636040113e1f0a1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:47:53 2015 +0000
coverity#1338260 Uncaught exception
Change-Id: Ib969223cb5c8acdad0e97ff9b944703d3ee43825
diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
index 06153d1..b403c7f 100644
--- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx
+++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
@@ -317,6 +317,9 @@ SAL_IMPLEMENT_MAIN()
<< "ERROR: Bad format of <" << e.getUri() << ">, \""
<< e.getDetail() << "\"\n";
return EXIT_FAILURE;
+ } catch (std::exception & e) {
+ std::cerr << "ERROR: " << e.what() << "\n";
+ return EXIT_FAILURE;
}
return 0;
commit df35df21ce4868f551dac1f01a91db80db75137f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:46:39 2015 +0000
coverity#1338259 Uncaught exception
Change-Id: I36e2194c304adae5b5c3377519eccc5ef78fd9ea
diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index 3ea09d3..f400c6a 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -1104,7 +1104,13 @@ SAL_IMPLEMENT_MAIN() {
<< "Bad input <" << e1.getUri() << ">: " << e1.getDetail()
<< std::endl;
std::exit(EXIT_FAILURE);
+ } catch (std::exception & e1) {
+ std::cerr
+ << "Failure: " << e1.what()
+ << std::endl;
+ std::exit(EXIT_FAILURE);
}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 95965034e3ce5e559f0338a65753aaa5dd02937e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:45:37 2015 +0000
coverity#1338258 Uncaught exception
Change-Id: I61032db81c012f2120bdd971111155d660eef5b4
diff --git a/helpcompiler/inc/HelpCompiler.hxx b/helpcompiler/inc/HelpCompiler.hxx
index 6982b11..b2ea751 100644
--- a/helpcompiler/inc/HelpCompiler.hxx
+++ b/helpcompiler/inc/HelpCompiler.hxx
@@ -231,7 +231,7 @@ public:
const std::string &in_module,
const std::string &in_lang,
bool in_bExtensionMode);
- bool compile() throw (HelpProcessingException, BasicCodeTagger::TaggerException);
+ bool compile() throw (HelpProcessingException, BasicCodeTagger::TaggerException, std::exception);
private:
xmlDocPtr getSourceDocument(const fs::path &filePath);
static void tagBasicCodeExamples(xmlDocPtr doc);
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx
index 2f67295..c4a3eaa 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -437,7 +437,7 @@ void myparser::traverse( xmlNodePtr parentNode )
}
bool HelpCompiler::compile()
- throw (HelpProcessingException, BasicCodeTagger::TaggerException)
+ throw (HelpProcessingException, BasicCodeTagger::TaggerException, std::exception)
{
// we now have the jaroutputstream, which will contain the document.
// now determine the document as a dom tree in variable docResolved
commit f36c2939be2305dc9dabd73385397ddf003204ee
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:43:36 2015 +0000
coverity#1338254 Uncaught exception
Change-Id: Ie7cf971b3d0c67f33a1b82ff12a8e25506bf0cd0
diff --git a/codemaker/source/cppumaker/cppumaker.cxx b/codemaker/source/cppumaker/cppumaker.cxx
index ef21d17..c5ac5d8 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -98,10 +98,14 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
<< "ERROR: Bad format of <" << e.getUri() << ">, \""
<< e.getDetail() << "\"\n";
return EXIT_FAILURE;
- } catch (IllegalArgument & e) {
+ } catch (IllegalArgument& e) {
std::cerr << "Illegal option " << e.m_message << '\n';
return EXIT_FAILURE;
+ } catch (std::exception& e) {
+ std::cerr << "Failure " << e.what() << '\n';
+ return EXIT_FAILURE;
}
+
return EXIT_SUCCESS;
}
commit e460c11f42ec3405130463328944713094171ffc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:42:22 2015 +0000
coverity#1338253 Uncaught exception
Change-Id: Ia4235060dc2e8943a91e9115111bac9fe9a3fc66
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index 3388f6d..dd895c0 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -97,7 +97,7 @@ void VCoordinateSystem::initPlottingTargets( const Reference< drawing::XShapes
, const Reference< drawing::XShapes >& xFinalTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
, Reference< drawing::XShapes >& xLogicTargetForSeriesBehindAxis )
- throw (uno::RuntimeException)
+ throw (uno::RuntimeException, std::exception)
{
OSL_PRECOND(xLogicTarget.is()&&xFinalTarget.is()&&xShapeFactory.is(),"no proper initialization parameters");
//is only allowed to be called once
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index 8fdefd8..10890b9 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -59,7 +59,7 @@ public:
::com::sun::star::lang::XMultiServiceFactory >& xFactory
, ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTargetForSeriesBehindAxis )
- throw (::com::sun::star::uno::RuntimeException);
+ throw (css::uno::RuntimeException, std::exception);
void setParticle( const OUString& rCooSysParticle );
commit 77a03426517ae5e39ad32a4e62c90b630dde1b27
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:41:26 2015 +0000
coverity#1338252 Uncaught exception
Change-Id: Ia058e42700c7724efd74fd6c5560ccca919fb2e8
diff --git a/registry/tools/regmerge.cxx b/registry/tools/regmerge.cxx
index 3a929c9..b7e4a50 100644
--- a/registry/tools/regmerge.cxx
+++ b/registry/tools/regmerge.cxx
@@ -86,84 +86,93 @@ int main( int argc, char * argv[] )
int __cdecl main( int argc, char * argv[] )
#endif
{
- Options_Impl options(argv[0]);
-
- std::vector< std::string > args;
- for (int i = 1; i < argc; i++)
+ try
{
- if (!Options::checkArgument(args, argv[i], strlen(argv[i])))
+ Options_Impl options(argv[0]);
+
+ std::vector< std::string > args;
+ for (int i = 1; i < argc; i++)
+ {
+ if (!Options::checkArgument(args, argv[i], strlen(argv[i])))
+ {
+ options.printUsage();
+ return 1;
+ }
+ }
+ if (!options.initOptions(args))
+ {
+ return 1;
+ }
+ if (args.size() < 3)
{
options.printUsage();
return 1;
}
- }
- if (!options.initOptions(args))
- {
- return 1;
- }
- if (args.size() < 3)
- {
- options.printUsage();
- return 1;
- }
- Registry reg;
- OUString regName( convertToFileUrl(args[0].c_str(), args[0].size()) );
- if (reg.open(regName, RegAccessMode::READWRITE) != RegError::NO_ERROR)
- {
- if (reg.create(regName) != RegError::NO_ERROR)
+ Registry reg;
+ OUString regName( convertToFileUrl(args[0].c_str(), args[0].size()) );
+ if (reg.open(regName, RegAccessMode::READWRITE) != RegError::NO_ERROR)
{
- if (options.isVerbose())
- fprintf(stderr, "open registry \"%s\" failed\n", args[0].c_str());
- return -1;
+ if (reg.create(regName) != RegError::NO_ERROR)
+ {
+ if (options.isVerbose())
+ fprintf(stderr, "open registry \"%s\" failed\n", args[0].c_str());
+ return -1;
+ }
}
- }
- RegistryKey rootKey;
- if (reg.openRootKey(rootKey) != RegError::NO_ERROR)
- {
- if (options.isVerbose())
- fprintf(stderr, "open root key of registry \"%s\" failed\n", args[0].c_str());
- return -4;
- }
+ RegistryKey rootKey;
+ if (reg.openRootKey(rootKey) != RegError::NO_ERROR)
+ {
+ if (options.isVerbose())
+ fprintf(stderr, "open root key of registry \"%s\" failed\n", args[0].c_str());
+ return -4;
+ }
- OUString mergeKeyName( OUString::createFromAscii(args[1].c_str()) );
- for (size_t i = 2; i < args.size(); i++)
- {
- OUString targetRegName( convertToFileUrl(args[i].c_str(), args[i].size()) );
- RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, false, options.isVerbose());
- if (_ret != RegError::NO_ERROR)
+ OUString mergeKeyName( OUString::createFromAscii(args[1].c_str()) );
+ for (size_t i = 2; i < args.size(); i++)
{
- if (_ret == RegError::MERGE_CONFLICT)
+ OUString targetRegName( convertToFileUrl(args[i].c_str(), args[i].size()) );
+ RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, false, options.isVerbose());
+ if (_ret != RegError::NO_ERROR)
{
- if (options.isVerbose())
- fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
- args[i].c_str(), args[1].c_str(), args[0].c_str());
+ if (_ret == RegError::MERGE_CONFLICT)
+ {
+ if (options.isVerbose())
+ fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
+ args[i].c_str(), args[1].c_str(), args[0].c_str());
+ }
+ else
+ {
+ if (options.isVerbose())
+ fprintf(stderr, "ERROR: merging registry \"%s\" under key \"%s\" in registry \"%s\" failed.\n",
+ args[i].c_str(), args[1].c_str(), args[0].c_str());
+ return -2;
+ }
}
else
{
if (options.isVerbose())
- fprintf(stderr, "ERROR: merging registry \"%s\" under key \"%s\" in registry \"%s\" failed.\n",
+ fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
args[i].c_str(), args[1].c_str(), args[0].c_str());
- return -2;
}
}
- else
+
+ rootKey.releaseKey();
+ if (reg.close() != RegError::NO_ERROR)
{
if (options.isVerbose())
- fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
- args[i].c_str(), args[1].c_str(), args[0].c_str());
+ fprintf(stderr, "closing registry \"%s\" failed\n", args[0].c_str());
+ return -5;
}
}
-
- rootKey.releaseKey();
- if (reg.close() != RegError::NO_ERROR)
+ catch (const std::exception &e)
{
- if (options.isVerbose())
- fprintf(stderr, "closing registry \"%s\" failed\n", args[0].c_str());
+ SAL_WARN("registry", "Fatal exception: " << e.what());
return -5;
}
+
return 0;
}
commit e995c817dd8a2a9e476dde4dfb3b041d0c50c408
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:38:04 2015 +0000
coverity#1338251 Uncaught exception
Change-Id: I92f1a05b7fb6718a0b74f7a792df250147a26137
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index 887b3bc..3690a9f 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -321,6 +321,11 @@ int GalApp::Main()
SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
return EXIT_FAILURE;
}
+ catch (const std::exception &e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.what());
+ return 1;
+ }
return EXIT_SUCCESS;
}
commit 4422c2271c05b9e1f25a0a03ec639a70a5281060
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:36:56 2015 +0000
coverity#1338250 Uncaught exception
Change-Id: I0c78b48213b4a638eca86eb9481974f49bc35319
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 7ed8a2c..41e4e38 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -659,7 +659,7 @@ protected:
// override these for special property handling in subcasses. Return true if property is handled
virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override;
- virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException) override;
+ virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override;
public:
SvxGraphicObject( SdrObject* pObj, OUString const & referer ) throw();
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 46a7e80..b9cb41a 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1572,9 +1572,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
return true;
}
-
-
-bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception)
{
switch( pProperty->nWID )
{
commit 9ca5df186e890971f36bf85e9a8870503c922d37
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:35:48 2015 +0000
coverity#1338249 Uncaught exception
Change-Id: Ife52263b250e11720575cec800834f7608f25d6c
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
index 82dbb2a..f83f549 100644
--- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx
@@ -123,7 +123,7 @@ class DocumentsAccessImpl : public DocumentsAccessImpl_BASE
NameIndexHash namesToIndices;
VbaDocumentsBase::DOCUMENT_TYPE meDocType;
public:
- DocumentsAccessImpl( const uno::Reference< uno::XComponentContext >& xContext, VbaDocumentsBase::DOCUMENT_TYPE eDocType ) throw (uno::RuntimeException) :m_xContext( xContext ), meDocType( eDocType )
+ DocumentsAccessImpl( const uno::Reference< uno::XComponentContext >& xContext, VbaDocumentsBase::DOCUMENT_TYPE eDocType ) throw (uno::RuntimeException, std::exception) :m_xContext( xContext ), meDocType( eDocType )
{
uno::Reference< container::XEnumeration > xEnum = new DocumentsEnumImpl( m_xContext );
sal_Int32 nIndex=0;
commit 8a6d8f11f8411f156f8a281d44241760dbca2f5f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:34:27 2015 +0000
coverity#1338248 Uncaught exception
Change-Id: I708e77b2745de8eb5b85cd05d0694cda18a84866
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index 245aefc..40270cb 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -63,7 +63,7 @@ OCalcConnection::~OCalcConnection()
}
void OCalcConnection::construct(const OUString& url,const Sequence< PropertyValue >& info)
- throw(SQLException, RuntimeException, DeploymentException)
+ throw(SQLException, RuntimeException, DeploymentException, std::exception)
{
// open file
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 92a1a3a..370588a 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -96,7 +96,8 @@ bool OConnection::matchesExtension( const OUString& _rExt ) const
void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& info)
throw( css::sdbc::SQLException,
css::uno::RuntimeException,
- css::uno::DeploymentException)
+ css::uno::DeploymentException,
+ std::exception)
{
osl_atomic_increment( &m_refCount );
diff --git a/connectivity/source/inc/calc/CConnection.hxx b/connectivity/source/inc/calc/CConnection.hxx
index 1ee2e21..854a9f7 100644
--- a/connectivity/source/inc/calc/CConnection.hxx
+++ b/connectivity/source/inc/calc/CConnection.hxx
@@ -53,7 +53,8 @@ namespace connectivity
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo )
throw( css::sdbc::SQLException,
css::uno::RuntimeException,
- css::uno::DeploymentException) override;
+ css::uno::DeploymentException,
+ std::exception) override;
// XServiceInfo
DECLARE_SERVICE_INFO();
diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx
index a64eddb..034dbb4c 100644
--- a/connectivity/source/inc/file/FConnection.hxx
+++ b/connectivity/source/inc/file/FConnection.hxx
@@ -81,7 +81,8 @@ namespace connectivity
virtual void construct(const OUString& _rUrl, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo )
throw( css::sdbc::SQLException,
css::uno::RuntimeException,
- css::uno::DeploymentException);
+ css::uno::DeploymentException,
+ std::exception);
// OComponentHelper
virtual void SAL_CALL disposing() override;
commit 4cf1ebd1b2ebad53a57d788bc4766a12aa51ad8e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:32:40 2015 +0000
coverity#1338247 Uncaught exception
Change-Id: Ibd7b50578fea64b1091f4840b5ec685e058fafa6
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 09d8345..ef3f6ea 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -860,7 +860,7 @@ static uno::Reference< util::XPathSettings > lcl_getPathSettingsService( const u
return xPathSettings;
}
-OUString ScVbaApplication::getOfficePath( const OUString& _sPathType ) throw (uno::RuntimeException)
+OUString ScVbaApplication::getOfficePath( const OUString& _sPathType ) throw (uno::RuntimeException, std::exception)
{
OUString sRetPath;
uno::Reference< util::XPathSettings > xProps = lcl_getPathSettingsService( mxContext );
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index 6f14276..c898e5a 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -37,7 +37,7 @@ private:
// note: member variables moved to struct "ScVbaAppSettings", see cxx file, to be shared by all application instances
ScVbaAppSettings& mrAppSettings;
- OUString getOfficePath( const OUString& sPath ) throw ( css::uno::RuntimeException );
+ OUString getOfficePath( const OUString& sPath ) throw ( css::uno::RuntimeException, std::exception );
protected:
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException) override;
commit e1d1154d099aa450777d6b6b205c664faab596af
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:31:41 2015 +0000
coverity#1338246 Uncaught exception
Change-Id: I149f41989575b19eb113cdeca217839b4a0a7d18
diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx
index 420ce91..813accb 100644
--- a/filter/source/xsltdialog/xmlfilterjar.cxx
+++ b/filter/source/xsltdialog/xmlfilterjar.cxx
@@ -113,7 +113,7 @@ static void _addFile( Reference< XInterface >& xRootFolder, Reference< XSingleSe
}
}
-void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference< XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( Exception )
+void XMLFilterJarHelper::addFile( Reference< XInterface > xRootFolder, Reference< XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( Exception, std::exception )
{
if( !rSourceFile.isEmpty() &&
!rSourceFile.startsWith("http:") &&
diff --git a/filter/source/xsltdialog/xmlfilterjar.hxx b/filter/source/xsltdialog/xmlfilterjar.hxx
index 9372940..0da990e 100644
--- a/filter/source/xsltdialog/xmlfilterjar.hxx
+++ b/filter/source/xsltdialog/xmlfilterjar.hxx
@@ -38,7 +38,7 @@ public:
void openPackage( const OUString& rPackageURL, XMLFilterVector& rFilters );
private:
- void addFile( css::uno::Reference< css::uno::XInterface > xRootFolder, css::uno::Reference< css::lang::XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( css::uno::Exception );
+ void addFile( css::uno::Reference< css::uno::XInterface > xRootFolder, css::uno::Reference< css::lang::XSingleServiceFactory > xFactory, const OUString& rSourceFile ) throw( css::uno::Exception, std::exception );
bool copyFile( css::uno::Reference< css::container::XHierarchicalNameAccess > xIfc, OUString& rURL, const OUString& rTargetURL );
bool copyFiles( css::uno::Reference< css::container::XHierarchicalNameAccess > xIfc, filter_info_impl* pFilter );
commit 5e8e025d60d8c694dc305c045830c42803ef2af3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:30:50 2015 +0000
coverity#1338245 Uncaught exception
Change-Id: I9f3df5bed8b6dd6239a4747d86889faaa52bc4d2
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 211b780..1a32c98 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -65,7 +65,7 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::task;
bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >& aDescriptor )
- throw (RuntimeException)
+ throw (RuntimeException, std::exception)
{
OUString udConvertClass=msUserData[0];
OUString udImport =msUserData[2];
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx
index 422e9d5..8d5b402 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.hxx
@@ -65,7 +65,7 @@ protected:
throw (css::uno::RuntimeException);
bool SAL_CALL importImpl( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor )
- throw (css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, std::exception);
commit a114895f1fd232d25e6bc8cf149878bf7106b3bb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:29:48 2015 +0000
coverity#1338240 Uncaught exception
Change-Id: I3b1b1c9745cae1dd7a765769ea761973d0a60134
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 843b7c9..7ed8a2c 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -874,7 +874,7 @@ public:
protected:
// override these for special property handling in subcasses. Return true if property is handled
- virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException) override;
+ virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override;
virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override;
private:
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 4f3bc05..71e46ff 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -806,8 +806,7 @@ SvxMediaShape::~SvxMediaShape() throw()
}
-
-bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException)
+bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception)
{
if( ((pProperty->nWID >= OWN_ATTR_MEDIA_URL) && (pProperty->nWID <= OWN_ATTR_MEDIA_ZOOM))
|| (pProperty->nWID == OWN_ATTR_MEDIA_STREAM)
commit abf49c259b88cb6537ab4b818df3cac5c62d23c2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:29:30 2015 +0000
coverity#1338244 Uncaught exception
Change-Id: If46689d2b9cf8f6cb76d61296332444d4c3fb5fd
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index 5e05c52..2e8707c 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -835,7 +835,7 @@ namespace frm
void OClickableImageBaseModel::_propertyChanged( const PropertyChangeEvent& rEvt )
- throw( RuntimeException )
+ throw( RuntimeException, std::exception )
{
// If a URL was set, it needs to be passed onto the ImageProducer.
::osl::MutexGuard aGuard(m_aMutex);
diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx
index a22cd6bc..27fb4eb 100644
--- a/forms/source/component/clickableimage.hxx
+++ b/forms/source/component/clickableimage.hxx
@@ -120,7 +120,7 @@ namespace frm
using ::cppu::OPropertySetHelper::getFastPropertyValue;
// OPropertyChangeListener
- virtual void _propertyChanged(const css::beans::PropertyChangeEvent&) throw(css::uno::RuntimeException) override;
+ virtual void _propertyChanged(const css::beans::PropertyChangeEvent&) throw(css::uno::RuntimeException, std::exception) override;
// XPropertyState
virtual css::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const override;
commit 3f8a28f41398774642a36153966f766e5c99d05e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:26:51 2015 +0000
coverity#1338239 Uncaught exception
Change-Id: I99ea322db83a6deb67483435de1549380bfec7fb
diff --git a/include/toolkit/controls/controlmodelcontainerbase.hxx b/include/toolkit/controls/controlmodelcontainerbase.hxx
index 2e1c3ae..8791826 100644
--- a/include/toolkit/controls/controlmodelcontainerbase.hxx
+++ b/include/toolkit/controls/controlmodelcontainerbase.hxx
@@ -261,7 +261,7 @@ public:
// to implement this, certainly Dialog does, lets see about others
virtual void SAL_CALL modified( const css::lang::EventObject& ) throw (css::uno::RuntimeException, std::exception) override {}
protected:
- virtual void ImplModelPropertiesChanged( const css::uno::Sequence< css::beans::PropertyChangeEvent >& rEvents ) throw(css::uno::RuntimeException) override;
+ virtual void ImplModelPropertiesChanged( const css::uno::Sequence< css::beans::PropertyChangeEvent >& rEvents ) throw(css::uno::RuntimeException, std::exception) override;
virtual void removingControl( const css::uno::Reference< css::awt::XControl >& _rxControl ) override;
virtual void addingControl( const css::uno::Reference< css::awt::XControl >& _rxControl ) override;
};
diff --git a/include/toolkit/controls/dialogcontrol.hxx b/include/toolkit/controls/dialogcontrol.hxx
index 17c77e7..62325ac 100644
--- a/include/toolkit/controls/dialogcontrol.hxx
+++ b/include/toolkit/controls/dialogcontrol.hxx
@@ -164,7 +164,7 @@ public:
protected:
virtual void PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc ) override;
- virtual void ImplModelPropertiesChanged( const css::uno::Sequence< css::beans::PropertyChangeEvent >& rEvents ) throw(css::uno::RuntimeException) override;
+ virtual void ImplModelPropertiesChanged( const css::uno::Sequence< css::beans::PropertyChangeEvent >& rEvents ) throw(css::uno::RuntimeException, std::exception) override;
protected:
};
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 8e62ecb..859fde50 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1668,7 +1668,7 @@ void ControlContainerBase::elementReplaced( const ContainerEvent& Event ) throw(
}
// XPropertiesChangeListener
-void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
+void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException, std::exception)
{
if( !isDesignMode() && !mbCreatingCompatiblePeer )
{
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 005984c..acdffa2 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -650,7 +650,7 @@ throw (RuntimeException, std::exception)
ImplUpdateResourceResolver();
}
-void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException)
+void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents ) throw(RuntimeException, std::exception)
{
sal_Int32 nLen = rEvents.getLength();
for( sal_Int32 i = 0; i < nLen; i++ )
commit aa9f75adc228f19161500e0ed019388e335f16a6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 6 09:25:11 2015 +0000
coverity#1338238 Uncaught exception
Change-Id: If822954d8355df879da8315e1c006571d3a26139
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 92c8e63..82e3f29 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -775,14 +775,11 @@ BaseContent::getPropertySetInfo(
return m_pMyShell->info_p( m_aUncPath );
}
-
-
-
Reference< sdbc::XRow > SAL_CALL
BaseContent::getPropertyValues(
sal_Int32 nMyCommandIdentifier,
const Sequence< beans::Property >& PropertySet )
- throw( RuntimeException )
+ throw( RuntimeException, std::exception )
{
sal_Int32 nProps = PropertySet.getLength();
if ( !nProps )
diff --git a/ucb/source/ucp/file/bc.hxx b/ucb/source/ucp/file/bc.hxx
index dc89399..8d39045 100644
--- a/ucb/source/ucp/file/bc.hxx
+++ b/ucb/source/ucp/file/bc.hxx
@@ -302,7 +302,7 @@ namespace fileaccess {
getPropertyValues(
sal_Int32 nMyCommandIdentifier,
const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& PropertySet )
- throw( com::sun::star::uno::RuntimeException );
+ throw( css::uno::RuntimeException, std::exception );
com::sun::star::uno::Sequence< com::sun::star::uno::Any > SAL_CALL
setPropertyValues(
More information about the Libreoffice-commits
mailing list