uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastChildContextFromFactory
(OOXMLFastContextHandler * pHandler, OOXMLFactory_ns::Pointer_t pFactory, Token_t Element)
{
uno::Reference < xml::sax::XFastContextHandler > aResult;
Id nDefine = pHandler->getDefine();
if (pFactory.get() != NULL)
{
CreateElementMapPointer pMap = pFactory->getCreateElementMap(nDefine);
TokenToIdMapPointer pTokenMap = pFactory->getTokenToIdMap(nDefine);
if (pMap.get() != NULL)
{
Id nId = (*pTokenMap)[Element];
#ifdef DEBUG_CREATE
string sDefine(pFactory->getDefineName(nDefine));
string sElement(fastTokenToId(Element));
string sQName((*QNameToString::Instance())(nId));
debug_logger->startElement("createFastChildContextFromFactory");
debug_logger->attribute("define", sDefine);
debug_logger->attribute("element", sElement);
debug_logger->attribute("qname", sQName);
static char buffer[16];
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIuUINT32, nId);
debug_logger->attribute("idnum", buffer);
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIuUINT32, nDefine);
debug_logger->attribute("definenum", buffer);
#endif
CreateElement aCreateElement = (*pMap)[Element];
switch (aCreateElement.m_nResource)
{
case RT_
:
aResult.set(OOXMLFastHelper<OOXMLFastContextHandler
>::createAndSetParentAndDefine(pHandler, Element, nId, aCreateElement.m_nId));
break;
case RT_Any:
aResult.set(createFastChildContextFromStart(pHandler, Element));
break;
default:
break;
}
#ifdef DEBUG_CREATE
debug_logger->endElement("createFastChildContextFromFactory");
#endif
}
}
return aResult;
}
OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId)
{
OOXMLFactory_ns::Pointer_t pResult;
switch (nId & 0xffff0000)
{
case
:
pResult =
::getInstance();
break;
default:
break;
}
return pResult;
}
uno::Reference< xml::sax::XFastContextHandler > OOXMLFactory::createFastChildContextFromStart
(OOXMLFastContextHandler * pHandler, Token_t Element)
{
#ifdef DEBUG_CREATE
debug_logger->startElement("createFastChildContextFromStart");
#endif
uno::Reference < xml::sax::XFastContextHandler > aResult;
OOXMLFactory_ns::Pointer_t pFactory;
if (! aResult.is())
{
pFactory = getFactoryForNamespace(
);
aResult.set(createFastChildContextFromFactory(pHandler, pFactory, Element));
}
#ifdef DEBUG_CREATE
debug_logger->endElement("createFastChildContextFromStart");
#endif
return aResult;
}
namespace tokenmap {
struct token { const char * name; Token_t nToken; };
class Perfect_Hash
{
private:
static inline unsigned int hash (const char *str, unsigned int len);
public:
static struct token *in_word_set (const char *str, unsigned int len);
};
}
string fastTokenToId(sal_uInt32 nToken)
{
string sResult;
switch (nToken & 0xffff0000)
{
case NS_
:
sResult += "
:";
break;
}
switch (nToken & 0xffff)
{
case
:
sResult += "
";
break;
}
return sResult;
}
case
: //
,
Sprm::Kind SprmKind(sal_uInt32 nSprmCode)
{
Sprm::Kind nResult = Sprm::UNKNOWN;
switch (nSprmCode)
{
paragraph
nResult = Sprm::PARAGRAPH;
break;
character
nResult = Sprm::CHARACTER;
break;
table
nResult = Sprm::TABLE;
break;
default:
break;
}
return nResult;
}
uno::Reference < xml::sax::XFastParser > OOXMLStreamImpl::getFastParser()
{
if (! mxFastParser.is())
{
uno::Reference < lang::XMultiComponentFactory > xFactory =
uno::Reference < lang::XMultiComponentFactory >
(mxContext->getServiceManager());
mxFastParser.set(xFactory->createInstanceWithContext
( ::rtl::OUString::createFromAscii
( "com.sun.star.xml.sax.FastParser" ),
mxContext ), uno::UNO_QUERY_THROW);
mxFastParser->registerNamespace(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("
")),
);
}
return mxFastParser;
}
#include "OOXMLFactory.hxx"
#include "OOXMLFastHelper.hxx"
#include "OOXMLStreamImpl.hxx"
#include "doctok/sprmids.hxx"
#include "doctok/resourceids.hxx"
namespace writerfilter {
namespace ooxml {
/// @cond GENERATED
/// @endcond
}}