summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-11-02 23:29:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-11-05 07:23:44 -0600
commit62308b65adf5980875753da4069156af79fbbfd4 (patch)
treef7a69fb0c8fbc061cafa1f9ea7cc79e80d2e7b8b /sfx2
parent2158e8bf85e139fd3cf59d00059ed2e2026f6a4a (diff)
don't warn for empty VBA structure, fdo#61059
Change-Id: I0d0f7fa216fcea7ca893120ad183dc3758ca51d4 (cherry picked from commit 2e803712c4c2b844dab1fefdfbda12058a5f1ab7) Reviewed-on: https://gerrit.libreoffice.org/6573 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docmacromode.cxx29
1 files changed, 14 insertions, 15 deletions
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 83d557203d62..39d2b6d26260 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -332,25 +332,24 @@ namespace sfx2
else
{
OUString aStdLibName( "Standard" );
+ OUString aVBAProject( "VBAProject" );
Sequence< OUString > aElements = xContainer->getElementNames();
if ( aElements.getLength() )
{
- if ( aElements.getLength() > 1 || !aElements[0].equals( aStdLibName ) )
- bHasMacroLib = sal_True;
- else
+ sal_Int32 nElements = aElements.getLength();
+ for( sal_Int32 i = 0; i < nElements; ++i )
{
- // usually a "Standard" library is always present (design)
- // for this reason we must check if it's empty
- //
- // Note: Since #i73229#, this is not true anymore. There's no default
- // "Standard" lib anymore. Wouldn't it be time to get completely
- // rid of the "Standard" thingie - this shouldn't be necessary
- // anymore, should it?
- Reference < XNameAccess > xLib;
- Any aAny = xContainer->getByName( aStdLibName );
- aAny >>= xLib;
- if ( xLib.is() )
- bHasMacroLib = xLib->hasElements();
+ OUString aElement = aElements[i];
+ if( aElement == aStdLibName || aElement == aVBAProject )
+ {
+ Reference < XNameAccess > xLib;
+ Any aAny = xContainer->getByName( aStdLibName );
+ aAny >>= xLib;
+ if ( xLib.is() && xLib->hasElements() )
+ return sal_True;
+ }
+ else
+ return sal_True;
}
}
}