[Libreoffice-commits] .: sc/source
Eike Rathke
erack at kemper.freedesktop.org
Tue May 8 01:49:50 PDT 2012
sc/source/ui/docshell/docsh5.cxx | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
New commits:
commit 01f79a346f27012791fa2373a3b93003963a6b3e
Author: Eike Rathke <erack at redhat.com>
Date: Tue May 8 10:49:28 2012 +0200
resolved rhbz#819118 catch exception from VBA lib container
If in an imported Excel document with VBA a sheet to be copied does not have
a document object in the VBAProject container (whyever that may be the case)
the getByName() rightly throws a NoSuchElement exception. Catch that.
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index c297ee0..e33a68c 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -949,15 +949,21 @@ sal_Bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, s
nTabToUse = aDocument.GetMaxTableNumber() - 1;
rtl::OUString sCodeName;
rtl::OUString sSource;
- Reference< XNameContainer > xLib;
- if( xLibContainer.is() )
+ try
{
- com::sun::star::uno::Any aLibAny = xLibContainer->getByName( aLibName );
- aLibAny >>= xLib;
+ Reference< XNameContainer > xLib;
+ if( xLibContainer.is() )
+ {
+ com::sun::star::uno::Any aLibAny = xLibContainer->getByName( aLibName );
+ aLibAny >>= xLib;
+ }
+ if( xLib.is() )
+ {
+ xLib->getByName( sSrcCodeName ) >>= sSource;
+ }
}
- if( xLib.is() )
+ catch ( const com::sun::star::uno::Exception& )
{
- xLib->getByName( sSrcCodeName ) >>= sSource;
}
VBA_InsertModule( aDocument, nTabToUse, sCodeName, sSource );
}
More information about the Libreoffice-commits
mailing list