[Libreoffice-commits] core.git: 14 commits - basegfx/source connectivity/source dbaccess/source desktop/unx idlc/source sc/source sfx2/source soltools/mkdepend sw/source vcl/unx

Caolán McNamara caolanm at redhat.com
Tue Oct 28 03:32:01 PDT 2014


 basegfx/source/polygon/b2dpolygontools.cxx              |    9 ++-
 connectivity/source/drivers/dbase/DTable.cxx            |    9 ++-
 dbaccess/source/core/dataaccess/definitioncontainer.cxx |   43 ++++++++++++----
 desktop/unx/source/start.c                              |    2 
 idlc/source/idlcproduce.cxx                             |    6 +-
 sc/source/ui/vba/vbaformatconditions.cxx                |   25 ++++++++-
 sc/source/ui/vba/vbastyles.cxx                          |   25 ++++++++-
 sfx2/source/doc/docfile.cxx                             |    6 +-
 soltools/mkdepend/main.c                                |    4 -
 sw/source/core/unocore/unostyle.cxx                     |    1 
 sw/source/filter/ww8/ww8par.cxx                         |    3 +
 sw/source/filter/ww8/ww8par2.cxx                        |    9 ++-
 vcl/unx/generic/app/sm.cxx                              |    8 +-
 13 files changed, 124 insertions(+), 26 deletions(-)

New commits:
commit cb67f0c5f9424fc085c4169211bda7e36cfbd904
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 28 09:41:44 2014 +0000

    coverity#1242656 Untrusted loop bound
    
    Change-Id: Iaf60d887860476e17d3db306a2089bfffd0564c9

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b5cc9a8..542afa9 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4265,8 +4265,15 @@ void WW8RStyle::ImportOldFormatStyles()
     }
 
     std::vector<pxoffset> aPAPXOffsets(stcp);
+    size_t nMaxByteCount = rSt.remainingSize();
     sal_uInt16 cbPapx(0);
-    rSt.ReadUInt16( cbPapx );
+    rSt.ReadUInt16(cbPapx);
+    if (cbPapx > nMaxByteCount)
+    {
+        SAL_WARN("sw.ww8", "WW8RStyle::ImportOldFormatStyles: truncating out of range "
+            << cbPapx << " to " << nMaxByteCount);
+        cbPapx = nMaxByteCount;
+    }
     nByteCount = 2;
     stcp=0;
     while (nByteCount < cbPapx)
commit 8c8c2dd14a5f8f2771b8b750937156a98f4a74b6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 28 09:15:20 2014 +0000

    assert on missing SolarMutex in SwXStyle dtor
    
     #18 0x00002ba554c3b9d2 in ImplDbgTestSolarMutex () at vcl/source/app/dbggui.cxx:793
            __PRETTY_FUNCTION__ = "void ImplDbgTestSolarMutex()"
     #19 0x00002ba553a8897e in DbgFunc (nAction=3, pParam=0x0) at tools/source/debug/debug.cxx:299
            pDebugData = 0x2ba553d51be0 <aDebugData>
     #20 0x00002ba5525bf509 in SfxBroadcaster::RemoveListener (this=0x3512a60, rListener=...) at svl/source/notify/SfxBroadcaster.cxx:127
            aIter =
            __PRETTY_FUNCTION__ = "void SfxBroadcaster::RemoveListener(SfxListener&)"
            positionOfRemovedElement = 63395440
     #21 0x00002ba5525cfea1 in SfxListener::EndListening (this=0x3d16de0, rBroadcaster=..., bAllDups=false) at svl/source/notify/lstner.cxx:91
            it =
     #22 0x00002ba5666f9bd1 in SwXStyle::~SwXStyle (this=0x3d16d80, __in_chrg=<optimized out>) at sw/source/core/unocore/unostyle.cxx:1306
    No locals.
     #23 0x00002ba5666f9cb0 in SwXStyle::~SwXStyle (this=0x3d16d80, __in_chrg=<optimized out>) at sw/source/core/unocore/unostyle.cxx:1308
    No locals.
     #24 0x00002ba550985142 in cppu::OWeakObject::release (this=0x3d16d80) at cppuhelper/source/weak.cxx:204
    No locals.
    
    Change-Id: Ieb33e5a8c739b575dd3b546deb3cc2cef53e8ec8

diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index d1b7f14..1038f26 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1302,6 +1302,7 @@ SwXStyle::SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
 
 SwXStyle::~SwXStyle()
 {
+    SolarMutexGuard aGuard;
     if(pBasePool)
         EndListening(*pBasePool);
     delete pPropImpl;
commit 17354cb84a2622cb4504f854af55adf6c62813fb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 28 09:09:45 2014 +0000

    improve Sttb dumping for truncated case
    
    Change-Id: I52c7c6d75a843673d1cacbf9adc77ac574fa95f7

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 12ffe46..fcba4e0 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -503,7 +503,10 @@ void Sttb::Print( FILE* fp )
         for (sal_uInt16 index = 0; index < cData; ++index)
         {
             if (index >= dataItems.size())
+            {
                 fprintf(fp, "   Sttb truncated at entry %d(0x%x)\n", static_cast< int >( index ), static_cast< unsigned int >( index ));
+                break;
+            }
             fprintf(fp,"   string dataItem[ %d(0x%x) ] has name %s\n", static_cast< int >( index ), static_cast< unsigned int >( index ), OUStringToOString( dataItems[ index ].data, RTL_TEXTENCODING_UTF8 ).getStr() );
         }
     }
commit 316ac78e78b7ff75aa914d9b34c086cef9ef843c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 21:01:05 2014 +0000

    coverity#982185 silence Unchecked return value from library
    
    and
    
    coverity#982184 Unchecked return value from library
    
    Change-Id: I4b4ba39abc4c008b68cfc1498ee56ac9c4934c98

diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 6cbcf12..9c63e0e 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -194,7 +194,7 @@ int main(int argc, char    **argv)
         nargc = 1;
         if ((afd = open(argv[1]+1, O_RDONLY)) < 0)
             fatalerr("cannot open \"%s\"\n", argv[1]+1);
-        fstat(afd, &ast);
+        (void)fstat(afd, &ast);
         args = (char *)malloc(ast.st_size + 1);
         if ((ast.st_size = read(afd, args, (size_t) ast.st_size)) < 0)
             fatalerr("failed to read %s\n", argv[1]+1);
@@ -488,7 +488,7 @@ struct filepointer *getfile(char *file)
         *content->f_p = '\0';
         return(content);
     }
-    fstat(fd, &st);
+    (void)fstat(fd, &st);
 
     size_backup = st.st_size;
     malloc_size = size_backup;
commit fafcf07ec98db304a07e21ddc984bf94a68344c6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 21:00:19 2014 +0000

    coverity#982167 Unchecked return value
    
    Change-Id: I14c306132a8f12c6f7ecebe5b012984d04bf0d91

diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx
index cfc093c..060ab9d 100644
--- a/idlc/source/idlcproduce.cxx
+++ b/idlc/source/idlcproduce.cxx
@@ -180,7 +180,11 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile)
     if ( !idlc()->getRoot()->dump(rootKey) )
     {
         rootKey.releaseKey();
-        regFile.close();
+        if (regFile.close() != REG_NO_ERROR)
+        {
+            fprintf(stderr, "%s: could not close registry file '%s'\n",
+                    pOptions->getProgramName().getStr(), regFileName.getStr());
+        }
         regFile.destroy(OStringToOUString(regFileName, RTL_TEXTENCODING_UTF8));
         removeIfExists(regFileName);
         cleanPath();
commit e7d9a137ca1cdf4f403d94166e52de31f1119a2c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:58:31 2014 +0000

    coverity#982159 silence Unchecked return value from library
    
    Change-Id: I92ff023ea2a8503d7c4799921c644aa011685ae2

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 13be4a4..5fb0dc3 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -370,7 +370,7 @@ connect_pipe( rtl_uString *pPipePath )
     if ( ( fd = socket( AF_UNIX, SOCK_STREAM, 0 ) ) < 0 )
         return fd;
 
-    fcntl( fd, F_SETFD, FD_CLOEXEC );
+    (void)fcntl( fd, F_SETFD, FD_CLOEXEC );
 
     addr.sun_family = AF_UNIX;
     strncpy( addr.sun_path, rtl_string_getStr( pPipeStr ), sizeof( addr.sun_path ) - 1 );
commit 3130f06bb5a07a6fc31911a59666e0ce3aedf162
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:57:50 2014 +0000

    coverity#735350 silence Unchecked return value from library
    
    Change-Id: I8b84466f8bb277c30df4340849b17506eddd4f21

diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 4c0536f..13962d6 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -699,23 +699,23 @@ void ICEWatchProc(
                 if ((flags = fcntl(pThis->m_nWakeupFiles[0], F_GETFD)) != -1)
                 {
                     flags |= FD_CLOEXEC;
-                    fcntl(pThis->m_nWakeupFiles[0], F_SETFD, flags);
+                    (void)fcntl(pThis->m_nWakeupFiles[0], F_SETFD, flags);
                 }
                 if ((flags = fcntl(pThis->m_nWakeupFiles[0], F_GETFL)) != -1)
                 {
                     flags |= O_NONBLOCK;
-                    fcntl(pThis->m_nWakeupFiles[0], F_SETFL, flags);
+                    (void)fcntl(pThis->m_nWakeupFiles[0], F_SETFL, flags);
                 }
                 // set close-on-exec and nonblock descriptor flag.
                 if ((flags = fcntl(pThis->m_nWakeupFiles[1], F_GETFD)) != -1)
                 {
                     flags |= FD_CLOEXEC;
-                    fcntl(pThis->m_nWakeupFiles[1], F_SETFD, flags);
+                    (void)fcntl(pThis->m_nWakeupFiles[1], F_SETFD, flags);
                 }
                 if ((flags = fcntl(pThis->m_nWakeupFiles[1], F_GETFL)) != -1)
                 {
                     flags |= O_NONBLOCK;
-                    fcntl(pThis->m_nWakeupFiles[1], F_SETFL, flags);
+                    (void)fcntl(pThis->m_nWakeupFiles[1], F_SETFL, flags);
                 }
                 pThis->m_ICEThread = osl_createThread(
                     ICEConnectionWorker, pThis);
commit 119f0da5037ebea7f3f6dabfb354d1cf1c41bb82
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:56:40 2014 +0000

    coverity#704019 Unchecked return value
    
    Change-Id: I605861dd741b1899924c0079b931da418be5d647

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 580ecad..082aa20 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1885,7 +1885,7 @@ void SfxMedium::Transfer_Impl()
             ::ucbhelper::Content aTransferContent;
 
             ::ucbhelper::Content aDestContent;
-            ::ucbhelper::Content::create( aDestURL, xComEnv, comphelper::getProcessComponentContext(), aDestContent );
+            (void)::ucbhelper::Content::create( aDestURL, xComEnv, comphelper::getProcessComponentContext(), aDestContent );
             // For checkin, we need the object URL, not the parent folder:
             if ( !IsInCheckIn( ) )
             {
@@ -1948,7 +1948,7 @@ void SfxMedium::Transfer_Impl()
 
                 CloseStreams_Impl();
 
-                ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent );
+                (void)::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aSourceContent );
 
                 // check for external parameters that may customize the handling of NameClash situations
                 SFX_ITEMSET_ARG( GetItemSet(), pRename, SfxBoolItem, SID_RENAME, false );
commit 4779f2a76920c3f842bcd34cc2580fefe6fd1402
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:55:58 2014 +0000

    coverity#704020 Unchecked return value
    
    Change-Id: I0f8b49bb43d88549ba90db63ce7041e6d5e0fe64

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index d190925..580ecad 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -436,7 +436,7 @@ Reference < XContent > SfxMedium::GetContent() const
             else if ( !pImp->m_aLogicName.isEmpty() )
                 aURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
             if (!aURL.isEmpty() )
-                ::ucbhelper::Content::create( aURL, xEnv, comphelper::getProcessComponentContext(), pImp->aContent );
+                (void)::ucbhelper::Content::create( aURL, xEnv, comphelper::getProcessComponentContext(), pImp->aContent );
         }
     }
 
commit 17a0efcea50be5c9adf33639cfd47d9a90b2f742
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:54:25 2014 +0000

    coverity#1242792 Unused value
    
    Change-Id: Iec4c69e7fea727cc507506b9570f1f6d0c20a70f

diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx
index eb6f210..d5bbcf7 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -3416,7 +3416,9 @@ namespace basegfx
             {
                 // prepare loop
                 bool bControlA(false);
+#if defined SAL_LOG_WARN
                 bool bControlB(false);
+#endif
 
                 // get next point and flag
                 aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
@@ -3437,7 +3439,9 @@ namespace basegfx
                 if(b < nCount && com::sun::star::drawing::PolygonFlags_CONTROL == ePolygonFlag)
                 {
                     aControlB = aNewCoordinatePair;
+#if defined SAL_LOG_WARN
                     bControlB = true;
+#endif
 
                     // get next point and flag
                     aNewCoordinatePair = B2DPoint(pPointSequence->X, pPointSequence->Y);
@@ -3462,7 +3466,10 @@ namespace basegfx
                     && aControlA.equal(aControlB)
                     && aControlA.equal(aRetval.getB2DPoint(aRetval.count() - 1)))
                 {
-                    bControlA = bControlB = false;
+                    bControlA = false;
+#if defined SAL_LOG_WARN
+                    bControlB = false;
+#endif
                 }
 
                 if(bControlA)
commit d54775f2c2146e1687140554bd903cc38be00054
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:47:45 2014 +0000

    coverity#1233509 Uncaught exception
    
    Change-Id: I09087bb872446d426e3556a64745d3faad254f9b

diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx
index 44de5c9..99953ee 100644
--- a/sc/source/ui/vba/vbastyles.cxx
+++ b/sc/source/ui/vba/vbastyles.cxx
@@ -18,6 +18,7 @@
  */
 #include "vbastyles.hxx"
 #include "vbastyle.hxx"
+#include <cppuhelper/exc_hlp.hxx>
 #include <ooo/vba/excel/XRange.hpp>
 
 using namespace ::ooo::vba;
@@ -80,9 +81,31 @@ public:
         }
         virtual uno::Any SAL_CALL nextElement(  ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) SAL_OVERRIDE
         {
+            try
+            {
                 if ( nIndex < m_xIndexAccess->getCount() )
                         return lcl_createAPIStyleToVBAObject( m_xIndexAccess->getByIndex( nIndex++ ), m_xParent, m_xContext, m_xModel );
-                throw container::NoSuchElementException();
+            }
+            catch (const container::NoSuchElementException&)
+            {
+                throw;
+            }
+            catch (const lang::WrappedTargetException&)
+            {
+                throw;
+            }
+            catch (const uno::RuntimeException&)
+            {
+                throw;
+            }
+            catch (const uno::Exception& e)
+            {
+                css::uno::Any a(cppu::getCaughtException());
+                throw css::lang::WrappedTargetException(
+                    "wrapped Exception " + e.Message,
+                    css::uno::Reference<css::uno::XInterface>(), a);
+            }
+            throw container::NoSuchElementException();
         }
 };
 
commit 9a3b6aec3eca28f92d8cdb0e2a9bbcadfa7d6bc0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:45:20 2014 +0000

    coverity#1233510 Uncaught exception
    
    Change-Id: I20584d87d9cea6dcc4bb27fbeca5261453166ba5

diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index 21e8158..78df566 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -20,6 +20,7 @@
 #include <ooo/vba/excel/XRange.hpp>
 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
 #include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
+#include <cppuhelper/exc_hlp.hxx>
 #include <vector>
 #include "vbaformatconditions.hxx"
 #include "vbaformatcondition.hxx"
@@ -103,9 +104,31 @@ public:
 
         virtual uno::Any SAL_CALL nextElement(  ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) SAL_OVERRIDE
         {
+            try
+            {
                 if ( nIndex < m_xIndexAccess->getCount() )
                         return xSheetConditionToFormatCondition( uno::Reference< XHelperInterface >( m_xParentRange, uno::UNO_QUERY_THROW ), m_xContext, m_xStyles, m_xParentCollection, m_xProps, m_xIndexAccess->getByIndex( nIndex++ ) );
-                throw container::NoSuchElementException();
+            }
+            catch (const container::NoSuchElementException&)
+            {
+                throw;
+            }
+            catch (const lang::WrappedTargetException&)
+            {
+                throw;
+            }
+            catch (const uno::RuntimeException&)
+            {
+                throw;
+            }
+            catch (const uno::Exception& e)
+            {
+                css::uno::Any a(cppu::getCaughtException());
+                throw css::lang::WrappedTargetException(
+                    "wrapped Exception " + e.Message,
+                    css::uno::Reference<css::uno::XInterface>(), a);
+            }
+            throw container::NoSuchElementException();
         }
 };
 
commit 90da361cbc3287719d9019146537e3560c481ecb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:29:53 2014 +0000

    coverity#706465 Uncaught exception
    
    Change-Id: Ic328c8a68fac462c402b70f85093cd8b14d2882d

diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index 9f84573..64c798c 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -29,6 +29,7 @@
 #include <comphelper/sequence.hxx>
 #include <comphelper/enumhelper.hxx>
 #include <comphelper/extract.hxx>
+#include <cppuhelper/exc_hlp.hxx>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/ucb/CommandInfo.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -212,19 +213,41 @@ void SAL_CALL ODefinitionContainer::replaceByName( const OUString& _rName, const
 {
     ResettableMutexGuard aGuard(m_aMutex);
 
-    // let derived classes approve the new object
-    Reference< XContent > xNewElement(aElement,UNO_QUERY);
-    approveNewObject( _rName, xNewElement );    // will throw if necessary
+    try
+    {
+        // let derived classes approve the new object
+        Reference< XContent > xNewElement(aElement,UNO_QUERY);
+        approveNewObject( _rName, xNewElement );    // will throw if necessary
 
-    // the old element (for the notifications)
-    Reference< XContent > xOldElement = implGetByName( _rName, impl_haveAnyListeners_nothrow() );
+        // the old element (for the notifications)
+        Reference< XContent > xOldElement = implGetByName( _rName, impl_haveAnyListeners_nothrow() );
 
-    notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ApproveListeners );
-    implReplace( _rName, xNewElement );
-    notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ContainerListemers );
+        notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ApproveListeners );
+        implReplace( _rName, xNewElement );
+        notifyByName( aGuard, _rName, xNewElement, xOldElement, E_REPLACED, ContainerListemers );
 
-    // and dispose it
-    disposeComponent(xOldElement);
+        // and dispose it
+        disposeComponent(xOldElement);
+    }
+    catch (const RuntimeException&)
+    {
+        throw;
+    }
+    catch (const NoSuchElementException&)
+    {
+        throw;
+    }
+    catch (const WrappedTargetException&)
+    {
+        throw;
+    }
+    catch (const Exception& e)
+    {
+        css::uno::Any a(cppu::getCaughtException());
+        throw css::lang::WrappedTargetException(
+          "wrapped Exception " + e.Message,
+          css::uno::Reference<css::uno::XInterface>(), a);
+    }
 }
 
 namespace
commit d8a8b5ac59990e043b1f9d8344b6a644d05367fc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 27 20:22:11 2014 +0000

    coverity#706303 Uncaught exception
    
    Change-Id: If3963e0ae2c6477eb074e89f411c22a82d339634

diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 4c1bf02..728e01a 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2166,7 +2166,14 @@ void SAL_CALL ODbaseTable::alterColumnByName( const OUString& colName, const Ref
     Reference<XDataDescriptorFactory> xOldColumn;
     m_pColumns->getByName(colName) >>= xOldColumn;
 
-    alterColumn(m_pColumns->findColumn(colName)-1,descriptor,xOldColumn);
+    try
+    {
+        alterColumn(m_pColumns->findColumn(colName)-1,descriptor,xOldColumn);
+    }
+    catch (const css::lang::IndexOutOfBoundsException&)
+    {
+        throw NoSuchElementException(colName, *this);
+    }
 }
 
 void SAL_CALL ODbaseTable::alterColumnByIndex( sal_Int32 index, const Reference< XPropertySet >& descriptor ) throw(SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, RuntimeException, std::exception)


More information about the Libreoffice-commits mailing list