[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 4 commits - bridges/test i18npool/source javaunohelper/source sdext/source stoc/source svtools/source sw/qa testtools/source toolkit/source writerfilter/source

Miklos Vajna vmiklos at suse.cz
Mon May 6 08:49:16 PDT 2013


 bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx |    4 
 bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx |    2 
 i18npool/source/transliteration/transliteration_Numeric.cxx           |    6 -
 javaunohelper/source/bootstrap.cxx                                    |    4 
 javaunohelper/source/javaunohelper.cxx                                |   10 -
 javaunohelper/source/juhx-export-functions.hxx                        |   47 ++++++++
 javaunohelper/source/juhx-export-types.hxx                            |   55 ++++++++++
 javaunohelper/source/preload.cxx                                      |   28 ++---
 sdext/source/presenter/PresenterController.cxx                        |    2 
 stoc/source/registry_tdprovider/functiondescription.cxx               |    4 
 stoc/source/registry_tdprovider/methoddescription.cxx                 |    2 
 svtools/source/edit/editsyntaxhighlighter.cxx                         |    4 
 sw/qa/extras/inc/swmodeltestbase.hxx                                  |   34 +++++-
 sw/qa/extras/rtfimport/data/fdo63023.rtf                              |   10 +
 sw/qa/extras/rtfimport/rtfimport.cxx                                  |    9 +
 testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx                |    6 -
 toolkit/source/awt/stylesettings.cxx                                  |    2 
 toolkit/source/awt/vclxwindow1.cxx                                    |   14 +-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx                        |   11 +-
 19 files changed, 201 insertions(+), 53 deletions(-)

New commits:
commit 6bf2ac6b88d4fd4f1cfe420d7a9c78dc0ab2b90b
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Apr 18 17:07:22 2013 +0200

    fdo#63023 incorrect RTF background color in header
    
    (cherry picked from commits 3d4fef85d05269e613316a7af6245f05d207d76e and
    08dc5de900b2e5cca9d9443fc5d4ea7756842af9)
    
    Change-Id: I33f5c8a856206860ac9cdb23dd6b5222cb785bf7
    Reviewed-on: https://gerrit.libreoffice.org/3461
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index ae0af3d..a4e8213 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -29,6 +29,8 @@
 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
 #include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/table/XCell.hpp>
 
 #include <test/bootstrapfixture.hxx>
 #include <unotest/macros_test.hxx>
@@ -189,19 +191,39 @@ protected:
     }
 
     // Get paragraph (counted from 1), optionally check it contains the given text.
-    uno::Reference< text::XTextRange > getParagraph( int number, OUString content = OUString() ) const
+    uno::Reference<text::XTextContent> getParagraphOrTable(int number, uno::Reference<text::XText> xText = uno::Reference<text::XText>()) const
     {
-        uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
-        uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+        uno::Reference<container::XEnumerationAccess> paraEnumAccess;
+        if (xText.is())
+            paraEnumAccess.set(xText, uno::UNO_QUERY);
+        else
+        {
+            uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+            paraEnumAccess.set(textDocument->getText(), uno::UNO_QUERY);
+        }
         uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
         for( int i = 1;
              i < number;
              ++i )
             paraEnum->nextElement();
-        uno::Reference< text::XTextRange > paragraph( paraEnum->nextElement(), uno::UNO_QUERY );
+        uno::Reference< text::XTextContent> const xElem(paraEnum->nextElement(),
+                uno::UNO_QUERY_THROW);
+        return xElem;
+    }
+
+    uno::Reference< text::XTextRange > getParagraph( int number, OUString content = OUString() ) const
+    {
+        uno::Reference<text::XTextRange> const xParagraph(
+                getParagraphOrTable(number), uno::UNO_QUERY_THROW);
         if( !content.isEmpty())
-            CPPUNIT_ASSERT_EQUAL( content, paragraph->getString());
-        return paragraph;
+            CPPUNIT_ASSERT_EQUAL( content, xParagraph->getString());
+        return xParagraph;
+    }
+
+    uno::Reference<text::XTextRange> getParagraphOfText(int number, uno::Reference<text::XText> xText) const
+    {
+        uno::Reference<text::XTextRange> const xParagraph(getParagraphOrTable(number, xText), uno::UNO_QUERY_THROW);
+        return xParagraph;
     }
 
     /// Get run (counted from 1) of a paragraph, optionally check it contains the given text.
diff --git a/sw/qa/extras/rtfimport/data/fdo63023.rtf b/sw/qa/extras/rtfimport/data/fdo63023.rtf
new file mode 100644
index 0000000..c246dc6
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo63023.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red92\green133\blue38;\red153\green153\blue255;\red220\green35\blue0;\red255\green255\blue153;\red128\green128\blue128;}
+{\header
+{\cf4\chcbpat6
+Yellow 2 Background with Violet Text}
+\pard\par
+}
+body text
+\pard\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 246358e..c02dac5 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -146,6 +146,7 @@ public:
     void testFdo37716();
     void testFdo51916();
     void testFdo61193();
+    void testFdo63023();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -262,6 +263,7 @@ void Test::run()
         {"fdo37716.rtf", &Test::testFdo37716},
         {"fdo51916.rtf", &Test::testFdo51916},
         {"hello.rtf", &Test::testFdo61193},
+        {"fdo63023.rtf", &Test::testFdo63023},
     };
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
     {
@@ -1205,6 +1207,13 @@ void Test::testFdo51916()
     // Complex nested table caused a crash.
 }
 
+void Test::testFdo63023()
+{
+    uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "HeaderText");
+    // Back color was black (0) in the header, due to missing color table in the substream.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF99), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xHeaderText), 1), "CharBackColor"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 954c08f..0a2348d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -572,9 +572,14 @@ void RTFDocumentImpl::seek(sal_uInt32 nPos)
 
 sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 nIndex)
 {
-    if (nIndex < m_aColorTable.size())
-        return m_aColorTable[nIndex];
-    return 0;
+    if (!m_pSuperstream)
+    {
+        if (nIndex < m_aColorTable.size())
+            return m_aColorTable[nIndex];
+        return 0;
+    }
+    else
+        return m_pSuperstream->getColorTable(nIndex);
 }
 
 rtl_TextEncoding RTFDocumentImpl::getEncoding(sal_uInt32 nFontIndex)
commit e238fdf9c495c0f1d5917cbc26c95ade42732835
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 18 13:16:41 2013 +0200

    Let juhx.dll export undecorated symbols on Windows
    
    ...otherwise preload.cxx in juh.dll will not be able to find them
    via osl_getFunctionSymbol.  What apparently happens is that JNICALL expanding
    to __stdcall decorates symbol names with _... at NN.  This likely was hidden in
    pre-gbuild times thanks to the use of def files.  (On a side note, the JVM
    appears to contain special code to find syms for native methods in both
    decorated and undecorated form; that explains why it picks up the decorated
    symbols from juh.dll just fine.)
    
    There is no need for the functions in juhx.dll (called from the juh.dll wrapper)
    to adhere to JNICALL (in fact, things would likely be easier to maintain if the
    juhx.dll functions also used different names than their juh.dll wrappers).
    However, what complicates this patch is that for DISABLE_DYNLOADING, the juh
    wrapper and its preload.cxx is elided, and the code that would normally go into
    the juhx library goes into the juh library (and thus needs to stick to JNICALL,
    and also needs to use the right function names).
    
    (cherry picked from commit 96488510c006785bba22c1039885c03e95ac4832)
    Conflicts:
    	javaunohelper/source/bootstrap.cxx
    	javaunohelper/source/javaunohelper.cxx
    	javaunohelper/source/preload.cxx
    
    Change-Id: I66611648f1f79f57f0c1b23fb7a801da2d7b86c5
    Reviewed-on: https://gerrit.libreoffice.org/3455
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx
index 558a853..6248d09 100644
--- a/javaunohelper/source/bootstrap.cxx
+++ b/javaunohelper/source/bootstrap.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
 
 #include "osl/diagnose.h"
 
@@ -36,6 +37,7 @@
 #include "jvmaccess/virtualmachine.hxx"
 #include "jvmaccess/unovirtualmachine.hxx"
 
+#include "juhx-export-functions.hxx"
 #include "vm.hxx"
 
 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
@@ -66,7 +68,7 @@ inline ::rtl::OUString jstring_to_oustring( jstring jstr, JNIEnv * jni_env )
 }
 
 //==================================================================================================
-extern "C" SAL_JNI_EXPORT jobject JNICALL Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
+jobject Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap(
     JNIEnv * jni_env, SAL_UNUSED_PARAMETER jclass, jstring juno_rc, jobjectArray jpairs,
     jobject loader )
 {
diff --git a/javaunohelper/source/javaunohelper.cxx b/javaunohelper/source/javaunohelper.cxx
index 45c9392..5536ced 100644
--- a/javaunohelper/source/javaunohelper.cxx
+++ b/javaunohelper/source/javaunohelper.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
 
 #include <osl/diagnose.h>
 #include <osl/module.h>
@@ -37,6 +38,7 @@
 #include "jvmaccess/virtualmachine.hxx"
 #include "jvmaccess/unovirtualmachine.hxx"
 
+#include "juhx-export-functions.hxx"
 #include "vm.hxx"
 
 #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
@@ -52,8 +54,7 @@ using ::rtl::OUString;
  * Method:    component_writeInfo
  * Signature: (Ljava/lang/String;Lcom/sun/star/lang/XMultiServiceFactory;Lcom/sun/star/registry/XRegistryKey;)Z
  */
-extern "C" SAL_JNI_EXPORT jboolean JNICALL
-Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
+jboolean Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
     JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jLibName, jobject jSMgr,
     jobject jRegKey, jobject loader )
 {
@@ -139,8 +140,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
  * Method:    component_getFactory
  * Signature: (Ljava/lang/String;Ljava/lang/String;Lcom/sun/star/lang/XMultiServiceFactory;Lcom/sun/star/registry/XRegistryKey;)Ljava/lang/Object;
  */
-extern "C" SAL_JNI_EXPORT jobject JNICALL
-Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
+jobject Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
     JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jLibName, jstring jImplName,
     jobject jSMgr, jobject jRegKey, jobject loader )
 {
@@ -246,7 +246,7 @@ Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
  * Method:    createRegistryServiceFactory
  * Signature: (Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/Object;
  */
-extern "C" SAL_JNI_EXPORT jobject JNICALL
+jobject
 Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactory(
     JNIEnv * pJEnv, SAL_UNUSED_PARAMETER jclass, jstring jWriteRegFile,
     jstring jReadRegFile, jboolean jbReadOnly, jobject loader )
diff --git a/javaunohelper/source/juhx-export-functions.hxx b/javaunohelper/source/juhx-export-functions.hxx
new file mode 100644
index 0000000..0ecd75c
--- /dev/null
+++ b/javaunohelper/source/juhx-export-functions.hxx
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_JAVAUNOHELPER_SOURCE_JUHX_EXPORT_FUNCTIONS_HXX
+#define INCLUDED_JAVAUNOHELPER_SOURCE_JUHX_EXPORT_FUNCTIONS_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#include "juhx-export-types.hxx"
+
+extern "C" {
+
+SAL_JNI_EXPORT javaunohelper::detail::Func_bootstrap
+Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap;
+
+SAL_JNI_EXPORT javaunohelper::detail::Func_createRegistryServiceFactory
+Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactory;
+
+SAL_JNI_EXPORT javaunohelper::detail::Func_getFactory
+Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory;
+
+SAL_JNI_EXPORT javaunohelper::detail::Func_writeInfo
+Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo;
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/javaunohelper/source/juhx-export-types.hxx b/javaunohelper/source/juhx-export-types.hxx
new file mode 100644
index 0000000..ff9bf62
--- /dev/null
+++ b/javaunohelper/source/juhx-export-types.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_JAVAUNOHELPER_SOURCE_JUHX_EXPORT_TYPES_HXX
+#define INCLUDED_JAVAUNOHELPER_SOURCE_JUHX_EXPORT_TYPES_HXX
+
+#include "sal/config.h"
+
+#include "jni.h"
+
+#if defined DISABLE_DYNLOADING
+#define JAVAUNOHELPER_DETAIL_CALLCONV JNICALL
+#else
+#define JAVAUNOHELPER_DETAIL_CALLCONV
+#endif
+
+extern "C" {
+
+namespace javaunohelper { namespace detail {
+
+typedef jobject JAVAUNOHELPER_DETAIL_CALLCONV Func_bootstrap(
+    JNIEnv *_env, jclass, jstring, jobjectArray, jobject);
+
+typedef jobject JAVAUNOHELPER_DETAIL_CALLCONV Func_createRegistryServiceFactory(
+    JNIEnv *, jclass, jstring, jstring, jboolean, jobject );
+
+typedef jobject JAVAUNOHELPER_DETAIL_CALLCONV Func_getFactory(
+    JNIEnv *, jclass, jstring, jstring, jobject, jobject, jobject);
+
+typedef jboolean JAVAUNOHELPER_DETAIL_CALLCONV Func_writeInfo(
+    JNIEnv *, jclass, jstring, jobject, jobject, jobject);
+
+} }
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/javaunohelper/source/preload.cxx b/javaunohelper/source/preload.cxx
index c188d82..afe2ec0 100644
--- a/javaunohelper/source/preload.cxx
+++ b/javaunohelper/source/preload.cxx
@@ -17,12 +17,15 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
 
 #include "jni.h"
 
 #include "rtl/ustring.hxx"
 #include "osl/module.h"
 
+#include "juhx-export-types.hxx"
+
 // In retrospect, the reason to create a juh wrapper around the juhx library was
 // probably because java.lang.System.loadLibrary uses RTLD_LOCAL, so uniqueness
 // of GCC RTTI symbols needed for exception handling would not be guaranteed.
@@ -37,19 +40,12 @@ using ::rtl::OUString;
 
 extern "C"
 {
-typedef jboolean (JNICALL * fptr_writeInfo)(
-    JNIEnv *, jclass, jstring, jobject, jobject, jobject );
-typedef jobject (JNICALL * fptr_getFactory)(
-    JNIEnv *, jclass, jstring, jstring, jobject, jobject, jobject );
-typedef jobject (JNICALL * fptr_createRegistryServiceFactory)(
-    JNIEnv *, jclass, jstring, jstring, jboolean, jobject );
-typedef jobject (JNICALL * fptr_bootstrap)(
-    JNIEnv *_env, jclass, jstring, jobjectArray, jobject );
 
-static fptr_writeInfo s_writeInfo;
-static fptr_getFactory s_getFactory;
-static fptr_createRegistryServiceFactory s_createRegistryServiceFactory;
-static fptr_bootstrap s_bootstrap;
+static javaunohelper::detail::Func_writeInfo * s_writeInfo;
+static javaunohelper::detail::Func_getFactory * s_getFactory;
+static javaunohelper::detail::Func_createRegistryServiceFactory *
+    s_createRegistryServiceFactory;
+static javaunohelper::detail::Func_bootstrap * s_bootstrap;
 static bool s_inited = false;
 
 extern "C" { static void SAL_CALL thisModule() {} }
@@ -73,21 +69,21 @@ static bool inited_juhx( JNIEnv * jni_env )
     {
         OUString symbol =
               OUSTR("Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo");
-        s_writeInfo = (fptr_writeInfo)osl_getFunctionSymbol(
+        s_writeInfo = (javaunohelper::detail::Func_writeInfo *)osl_getFunctionSymbol(
             hModule, symbol.pData );
         symbol =
             OUSTR("Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory");
-        s_getFactory = (fptr_getFactory)osl_getFunctionSymbol(
+        s_getFactory = (javaunohelper::detail::Func_getFactory *)osl_getFunctionSymbol(
             hModule, symbol.pData );
         symbol =
             OUSTR("Java_com_sun_star_comp_helper_RegistryServiceFactory_createRegistryServiceFactory");
         s_createRegistryServiceFactory =
-            (fptr_createRegistryServiceFactory)osl_getFunctionSymbol(
+            (javaunohelper::detail::Func_createRegistryServiceFactory *)osl_getFunctionSymbol(
                 hModule, symbol.pData );
         symbol =
             OUSTR("Java_com_sun_star_comp_helper_Bootstrap_cppuhelper_1bootstrap");
         s_bootstrap =
-            (fptr_bootstrap)osl_getFunctionSymbol( hModule, symbol.pData );
+            (javaunohelper::detail::Func_bootstrap *)osl_getFunctionSymbol( hModule, symbol.pData );
 
         if (0 == s_writeInfo ||
             0 == s_getFactory ||
commit 2557c2796c0c4c533e31a28ca59fe3296e582f0a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Apr 16 13:52:02 2013 +0200

    rhbz#867808 Do not throw RuntimeException by pointer
    
    (cherry picked from commit e46564a0a6a74da90785a1b910d33e2b5bfdcfd9, plus
    63b4633cf7b0da9eba63e752cec72cb10ed9d93e "Related: rhbz#867808 if one person
    threw by pointer..." and 336353a87e6003e685aab87ea74a158546e1f297 "Related
    rhbz#867808: More apparently bogus 'throw new ...' in C++ code")
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    
    Conflicts:
    	bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx
    	bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx
    	sdext/source/presenter/PresenterController.cxx
    	stoc/source/registry_tdprovider/functiondescription.cxx
    	stoc/source/registry_tdprovider/methoddescription.cxx
    	toolkit/source/awt/vclxwindow1.cxx
    
    Change-Id: I22b7d3d642e7ee0488d6b726a331d328065bbee7
    Reviewed-on: https://gerrit.libreoffice.org/3418
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx b/bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx
index df0991c..b7a5ff3 100644
--- a/bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx
+++ b/bridges/test/java_uno/nativethreadpool/testnativethreadpoolclient.cxx
@@ -74,7 +74,7 @@ sal_Int32 Client::run(css::uno::Sequence< rtl::OUString > const &)
     css::uno::Reference< css::lang::XMultiComponentFactory > factory(
         context->getServiceManager());
     if (!factory.is()) {
-        throw new css::uno::RuntimeException(
+        throw css::uno::RuntimeException(
             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no component context service manager" )),
             static_cast< cppu::OWeakObject * >(this));
     }
@@ -94,7 +94,7 @@ sal_Int32 Client::run(css::uno::Sequence< rtl::OUString > const &)
     }
     relay->start(this);
     if (!data.setData(reinterpret_cast< void * >(12345))) {
-        throw new css::uno::RuntimeException(
+        throw css::uno::RuntimeException(
             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "osl::ThreadData::setData failed" )),
             static_cast< cppu::OWeakObject * >(this));
     }
diff --git a/bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx b/bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx
index 607a054..3952ce9 100644
--- a/bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx
+++ b/bridges/test/java_uno/nativethreadpool/testnativethreadpoolserver.cxx
@@ -63,7 +63,7 @@ sal_Int32 Server::get() throw (css::uno::RuntimeException) {
     css::uno::Reference< css::lang::XMultiComponentFactory > factory(
         context->getServiceManager());
     if (!factory.is()) {
-        throw new css::uno::RuntimeException(
+        throw css::uno::RuntimeException(
             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no component context service manager" )),
             static_cast< cppu::OWeakObject * >(this));
     }
diff --git a/i18npool/source/transliteration/transliteration_Numeric.cxx b/i18npool/source/transliteration/transliteration_Numeric.cxx
index eec4236..de24368 100644
--- a/i18npool/source/transliteration/transliteration_Numeric.cxx
+++ b/i18npool/source/transliteration/transliteration_Numeric.cxx
@@ -38,21 +38,21 @@ OUString SAL_CALL
 transliteration_Numeric::folding( const OUString& /*inStr*/, sal_Int32 /*startPos*/, sal_Int32 /*nCount*/, Sequence< sal_Int32 >& /*offset*/ )
         throw(RuntimeException)
 {
-        throw (new RuntimeException());
+        throw RuntimeException();
 }
 
 sal_Bool SAL_CALL
 transliteration_Numeric::equals( const OUString& /*str1*/, sal_Int32 /*pos1*/, sal_Int32 /*nCount1*/, sal_Int32& /*nMatch1*/, const OUString& /*str2*/, sal_Int32 /*pos2*/, sal_Int32 /*nCount2*/, sal_Int32& /*nMatch2*/ )
         throw(RuntimeException)
 {
-        throw (new RuntimeException());
+        throw RuntimeException();
 }
 
 Sequence< OUString > SAL_CALL
 transliteration_Numeric::transliterateRange( const OUString& /*str1*/, const OUString& /*str2*/ )
         throw(RuntimeException)
 {
-        throw (new RuntimeException());
+        throw RuntimeException();
 }
 
 
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 14820da..44b5bea 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -119,7 +119,7 @@ PresenterController::PresenterController (
     OSL_ASSERT(mxController.is());
 
     if ( ! mxSlideShowController.is())
-        throw new lang::IllegalArgumentException(
+        throw lang::IllegalArgumentException(
             A2S("missing slide show controller"),
             static_cast<XWeak*>(this),
             2);
diff --git a/stoc/source/registry_tdprovider/functiondescription.cxx b/stoc/source/registry_tdprovider/functiondescription.cxx
index 8840451..3cb9635 100644
--- a/stoc/source/registry_tdprovider/functiondescription.cxx
+++ b/stoc/source/registry_tdprovider/functiondescription.cxx
@@ -71,7 +71,7 @@ FunctionDescription::getExceptions() const {
         try {
             any = m_manager->getByHierarchicalName(name);
         } catch (const css::container::NoSuchElementException & e) {
-            throw new css::uno::RuntimeException(
+            throw css::uno::RuntimeException(
                 (rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM(
                         "com.sun.star.container.NoSuchElementException: "))
@@ -81,7 +81,7 @@ FunctionDescription::getExceptions() const {
         if (!(any >>= exceptions[i])
             || exceptions[i]->getTypeClass() != css::uno::TypeClass_EXCEPTION)
         {
-            throw new css::uno::RuntimeException(
+            throw css::uno::RuntimeException(
                 (rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM("not an exception type: "))
                  + name),
diff --git a/stoc/source/registry_tdprovider/methoddescription.cxx b/stoc/source/registry_tdprovider/methoddescription.cxx
index fd2d6c3..f018d1f 100644
--- a/stoc/source/registry_tdprovider/methoddescription.cxx
+++ b/stoc/source/registry_tdprovider/methoddescription.cxx
@@ -90,7 +90,7 @@ css::uno::Reference< css::reflection::XTypeDescription > Parameter::getType()
             m_manager->getByHierarchicalName(m_typeName),
             css::uno::UNO_QUERY_THROW);
     } catch (const css::container::NoSuchElementException & e) {
-        throw new css::uno::RuntimeException(
+        throw css::uno::RuntimeException(
             (rtl::OUString(
                 RTL_CONSTASCII_USTRINGPARAM(
                     "com.sun.star.container.NoSuchElementException: "))
diff --git a/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx b/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx
index c2e7bda..7d08eab 100644
--- a/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx
+++ b/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx
@@ -799,7 +799,7 @@ static bool raiseException(XBridgeTest* xLBT )
        bRet = performQueryForUnknownType( xLBT ) && bRet;
         if (! bRet)
         {
-            throw new unoidl::com::sun::star::uno::RuntimeException(
+            throw unoidl::com::sun::star::uno::RuntimeException(
                 new String("error: test failed!"), 0);
         }
     }
@@ -819,7 +819,7 @@ static bool raiseException(XBridgeTest* xLBT )
         {
             if (args->Length < 1)
             {
-                throw new RuntimeException(
+                throw RuntimeException(
                     "missing argument for bridgetest!", this );
             }
             Object* test_obj =
@@ -846,7 +846,7 @@ static bool raiseException(XBridgeTest* xLBT )
             s->Append(exc->GetType()->Name);
             s->Append(S"\n Message: ");
             s->Append(exc->Message);
-            throw new unoidl::com::sun::star::uno::RuntimeException(
+            throw unoidl::com::sun::star::uno::RuntimeException(
                 s->ToString(), 0);
         }
     }
diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx
index 97d5e29..fc0fbaa 100644
--- a/toolkit/source/awt/stylesettings.cxx
+++ b/toolkit/source/awt/stylesettings.cxx
@@ -116,7 +116,7 @@ namespace toolkit
     {
         Window* pWindow = i_rOwningWindow.GetWindow();
         if ( !pWindow )
-            throw new RuntimeException();
+            throw RuntimeException();
         pWindow->AddEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) );
     }
 
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index f38a95c..77af1b2 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -46,10 +46,9 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle )
     Window *pWindow = GetWindow();
     if ( pWindow->GetType() != WINDOW_WORKWINDOW )
     {
-        ::com::sun::star::uno::Exception *pException =
-            new ::com::sun::star::uno::RuntimeException;
-        pException->Message = ::rtl::OUString("not a work window");
-        throw pException;
+        com::sun::star::uno::Exception aException;
+        aException.Message = ::rtl::OUString("not a work window");
+        throw aException;
     }
 
     // use sal_Int64 here to accomodate all int types
@@ -77,10 +76,9 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle )
     }
     if( bThrow )
     {
-        ::com::sun::star::uno::Exception *pException =
-            new ::com::sun::star::uno::RuntimeException;
-        pException->Message = ::rtl::OUString("incorrect window handle type");
-        throw pException;
+        com::sun::star::uno::Exception aException;
+        aException.Message = ::rtl::OUString("incorrect window handle type");
+        throw aException;
     }
     // create system parent data
     SystemParentData aSysParentData;
commit 8443407096ac4e6848c38874aaebcef01c585f4f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 16 13:40:04 2013 +0100

    Resolves: fdo#47209 and rhbz#927223 syntax highlighter crash
    
    when trying to parse empty lines looking for the matching
    bracket
    
    Change-Id: I3961a3d0e804d136de286e21934c6ba5ab0496cf
    (cherry picked from commit 02917cb57e2c2e9fcab2db8f72960023f3e4edaf)
    Reviewed-on: https://gerrit.libreoffice.org/3414
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 6485311..3b5f3e5 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -89,6 +89,10 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey)
                 continue;
 
             String aLine( GetTextEngine()->GetText( aPara ) );
+
+            if (aLine.Len() == 0)
+                continue;
+
             for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i)
             {
                 if (aLine.GetChar(i)==aChar)


More information about the Libreoffice-commits mailing list