Index: src/text/ptbl/xp/pd_DocumentRDF.h =================================================================== --- src/text/ptbl/xp/pd_DocumentRDF.h (revision 30791) +++ src/text/ptbl/xp/pd_DocumentRDF.h (working copy) @@ -1052,10 +1052,15 @@ // subclasses to be made for the runtime environment. static void setSemanticItemFactory( PD_SemanticItemFactory* f ); static void setRDFDialogs( PD_RDFDialogs* d ); + + static PD_SemanticItemFactory *getSemanticItemFactory(); + static PD_RDFDialogs *getRDFDialogs(); protected: PD_Document* m_doc; private: + static PD_SemanticItemFactory *s_SemanticItemFactory; + static PD_RDFDialogs *s_RDFDialogs; PT_AttrPropIndex m_indexAP; PD_Document* getDocument(void) const; Index: src/text/ptbl/xp/pd_DocumentRDF.cpp =================================================================== --- src/text/ptbl/xp/pd_DocumentRDF.cpp (revision 30791) +++ src/text/ptbl/xp/pd_DocumentRDF.cpp (working copy) @@ -76,7 +76,12 @@ return 0; } }; -static PD_SemanticItemFactory* s_SemanticItemFactory = new PD_SemanticItemFactoryNull; +PD_SemanticItemFactory *PD_DocumentRDF::s_SemanticItemFactory; +PD_SemanticItemFactory *PD_DocumentRDF::getSemanticItemFactory() +{ + if (!s_SemanticItemFactory) s_SemanticItemFactory = new PD_SemanticItemFactoryNull; + return s_SemanticItemFactory; +} void PD_DocumentRDF::setSemanticItemFactory( PD_SemanticItemFactory* f ) { @@ -95,7 +100,12 @@ return std::make_pair(0,0); } }; -static PD_RDFDialogs* s_RDFDialogs = new PD_RDFDialogsNull; +PD_RDFDialogs *PD_DocumentRDF::s_RDFDialogs; +PD_RDFDialogs *PD_DocumentRDF::getRDFDialogs() +{ + if (!s_RDFDialogs) s_RDFDialogs = new PD_RDFDialogsNull; + return s_RDFDialogs; +} void PD_DocumentRDF::setRDFDialogs( PD_RDFDialogs* d ) { @@ -104,12 +114,12 @@ std::pair< PT_DocPosition, PT_DocPosition > runInsertReferenceDialog( FV_View* pView ) { - return s_RDFDialogs->runInsertReferenceDialog( pView ); + return PD_DocumentRDF::getRDFDialogs()->runInsertReferenceDialog( pView ); } void runSemanticStylesheetsDialog( FV_View* pView ) { - s_RDFDialogs->runSemanticStylesheetsDialog( pView ); + PD_DocumentRDF::getRDFDialogs()->runSemanticStylesheetsDialog( pView ); } @@ -1745,16 +1755,16 @@ { if (semanticClass == "Contact") { - return PD_RDFSemanticItemHandle( s_SemanticItemFactory->createContact( rdf, it ) ); + return PD_RDFSemanticItemHandle( PD_DocumentRDF::getSemanticItemFactory()->createContact( rdf, it ) ); } if (semanticClass == "Event") { - return PD_RDFSemanticItemHandle( s_SemanticItemFactory->createEvent( rdf, it )); + return PD_RDFSemanticItemHandle( PD_DocumentRDF::getSemanticItemFactory()->createEvent( rdf, it )); } #ifdef WITH_CHAMPLAIN if (semanticClass == "Location") { - return PD_RDFSemanticItemHandle( s_SemanticItemFactory->createLocation( rdf, it )); + return PD_RDFSemanticItemHandle( PD_DocumentRDF::getSemanticItemFactory()->createLocation( rdf, it )); } #endif return PD_RDFSemanticItemHandle(); @@ -5076,7 +5086,7 @@ continue; uniqfilter.insert(n); - PD_RDFContact* newItem = s_SemanticItemFactory->createContact( rdf, it ); + PD_RDFContact* newItem = PD_DocumentRDF::getSemanticItemFactory()->createContact( rdf, it ); PD_RDFContactHandle h( newItem ); ret.push_back( h ); } @@ -5131,7 +5141,7 @@ continue; uniqfilter.insert(n); - PD_RDFEvent* newItem = s_SemanticItemFactory->createEvent( rdf, it ); + PD_RDFEvent* newItem = PD_DocumentRDF::getSemanticItemFactory()->createEvent( rdf, it ); PD_RDFEventHandle h( newItem ); ret.push_back( h ); } @@ -5160,7 +5170,7 @@ UT_DEBUGMSG(("addLocations() n:%s\n", n.c_str() )); #ifdef WITH_CHAMPLAIN - PD_RDFLocation* newItem = s_SemanticItemFactory->createLocation( rdf, it, isGeo84 ); + PD_RDFLocation* newItem = PD_DocumentRDF::getSemanticItemFactory()->createLocation( rdf, it, isGeo84 ); PD_RDFLocationHandle h( newItem ); ret.push_back( h ); #else