summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-09-01 14:59:07 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-09-01 14:59:07 +0200
commit03ee94167cc16990ee8809f3ebe30af27ba94570 (patch)
tree10e14e8147dd50a3904978ac08b377ee63e8f68f /sfx2/source
parent7c006c81f4d7eb4c1dd371585ca09bfc3549a0d7 (diff)
dba33i: #i111146# migrated all SFX-based applications to use named views
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/docfac.cxx15
-rw-r--r--sfx2/source/view/viewfac.cxx14
2 files changed, 15 insertions, 14 deletions
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 8f8a4a969740..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() &&
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index 5ef64a2a8b0d..f9469e8a9f88 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -30,7 +30,6 @@
// INCLUDE ---------------------------------------------------------------
#include <sfx2/app.hxx>
-#include "sfxresid.hxx"
#include <rtl/ustrbuf.hxx>
#include "viewfac.hxx"
@@ -72,23 +71,10 @@ String SfxViewFactory::GetAPIViewName() const
// CTOR / DTOR -----------------------------------------------------------
SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
- USHORT nOrdinal, const ResId& aDescrResId ):
- fnCreate(fnC),
- fnInit(fnI),
- nOrd(nOrdinal),
- aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()),
- m_sViewName()
-{
- aDescription.SetRT(aDescrResId.GetRT());
- DBG_CTOR(SfxViewFactory, 0);
-}
-
-SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
USHORT nOrdinal, const sal_Char* asciiViewName ):
fnCreate(fnC),
fnInit(fnI),
nOrd(nOrdinal),
- aDescription( SfxResId( 0 ) ),
m_sViewName( String::CreateFromAscii( asciiViewName ) )
{
DBG_CTOR(SfxViewFactory, 0);