Kaydet (Commit) 2e803712 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

don't warn for empty VBA structure, fdo#61059

Change-Id: I0d0f7fa216fcea7ca893120ad183dc3758ca51d4
üst 35210e22
...@@ -331,25 +331,24 @@ namespace sfx2 ...@@ -331,25 +331,24 @@ namespace sfx2
else else
{ {
OUString aStdLibName( "Standard" ); OUString aStdLibName( "Standard" );
OUString aVBAProject( "VBAProject" );
Sequence< OUString > aElements = xContainer->getElementNames(); Sequence< OUString > aElements = xContainer->getElementNames();
if ( aElements.getLength() ) if ( aElements.getLength() )
{ {
if ( aElements.getLength() > 1 || !aElements[0].equals( aStdLibName ) ) sal_Int32 nElements = aElements.getLength();
bHasMacroLib = sal_True; for( sal_Int32 i = 0; i < nElements; ++i )
else
{ {
// usually a "Standard" library is always present (design) OUString aElement = aElements[i];
// for this reason we must check if it's empty if( aElement == aStdLibName || aElement == aVBAProject )
// {
// Note: Since #i73229#, this is not true anymore. There's no default Reference < XNameAccess > xLib;
// "Standard" lib anymore. Wouldn't it be time to get completely Any aAny = xContainer->getByName( aStdLibName );
// rid of the "Standard" thingie - this shouldn't be necessary aAny >>= xLib;
// anymore, should it? if ( xLib.is() && xLib->hasElements() )
Reference < XNameAccess > xLib; return sal_True;
Any aAny = xContainer->getByName( aStdLibName ); }
aAny >>= xLib; else
if ( xLib.is() ) return sal_True;
bHasMacroLib = xLib->hasElements();
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment