summaryrefslogtreecommitdiff
path: root/sfx2
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
parent7c006c81f4d7eb4c1dd371585ca09bfc3549a0d7 (diff)
dba33i: #i111146# migrated all SFX-based applications to use named views
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx11
-rw-r--r--sfx2/inc/viewfac.hxx5
-rw-r--r--sfx2/source/doc/docfac.cxx15
-rw-r--r--sfx2/source/view/viewfac.cxx14
4 files changed, 15 insertions, 30 deletions
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 34362500b690..ee8dfb1ca57c 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -123,17 +123,6 @@ public: \
static SfxViewFactory&Factory() { return *pFactory; } \
static void InitFactory()
-#define SFX_IMPL_VIEWFACTORY(Class, rResId) \
- SfxViewFactory* Class::pFactory; \
- SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
- { return new Class(pFrame, pOldView); } \
- void Class::RegisterFactory( USHORT nPrio ) \
- { \
- pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,rResId);\
- InitFactory(); \
- } \
- void Class::InitFactory()
-
#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
SfxViewFactory* Class::pFactory; \
SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
index 0e6498b1f8a5..b0f0abdba3b3 100644
--- a/sfx2/inc/viewfac.hxx
+++ b/sfx2/inc/viewfac.hxx
@@ -46,16 +46,12 @@ class SFX2_DLLPUBLIC SfxViewFactory
{
public:
SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
- USHORT nOrdinal, const ResId& aDescrResId );
- SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
USHORT nOrdinal, const sal_Char* asciiViewName );
~SfxViewFactory();
SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
void InitFactory();
- String GetDescription() const
- { return String( aDescription ); }
USHORT GetOrdinal() const { return nOrd; }
/// returns a legacy view name. This is "view" with an appended ordinal/ID.
@@ -72,7 +68,6 @@ private:
SfxViewCtor fnCreate;
SfxViewInit fnInit;
USHORT nOrd;
- ResId aDescription;
const String m_sViewName;
};
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);