summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfac.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/docfac.cxx')
-rw-r--r--sfx2/source/doc/docfac.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index bfd67210ec44..4311559f94af 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory
SfxViewFactory &rFactory
)
{
+#if OSL_DEBUG_LEVEL > 0
+ {
+ const String sViewName( rFactory.GetAPIViewName() );
+ for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i )
+ {
+ if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) )
+ continue;
+ ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" );
+ sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US );
+ sMessage += "'!";
+ OSL_ENSURE( false, sMessage.GetBuffer() );
+ break;
+ }
+ }
+#endif
sal_uInt16 nPos;
for ( nPos = 0;
nPos < pImpl->aViewFactoryArr.Count() &&
@@ -467,7 +482,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie
)
{
SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) );
- if ( rViewFac.GetViewName() == i_rViewName )
+ if ( ( rViewFac.GetAPIViewName() == i_rViewName )
+ || ( rViewFac.GetLegacyViewName() == i_rViewName )
+ )
return &rViewFac;
}
return NULL;