CWS-TOOLING: integrate CWS sb129

This commit is contained in:
Vladimir Glazunov 2010-09-29 10:24:13 +02:00
commit 0b5a8e1e0c
386 changed files with 5239 additions and 5579 deletions

View File

@ -16,3 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\avmedia
..\inc\avmedia\mediatoolbox.hxx %_DEST%\inc%_EXT%\avmedia\mediatoolbox.hxx ..\inc\avmedia\mediatoolbox.hxx %_DEST%\inc%_EXT%\avmedia\mediatoolbox.hxx
..\%__SRC%\class\avmedia.jar %_DEST%\bin%_EXT%\avmedia.jar ..\%__SRC%\class\avmedia.jar %_DEST%\bin%_EXT%\avmedia.jar
..\%__SRC%\misc\avmedia.component %_DEST%\xml%_EXT%\avmedia.component
..\%__SRC%\misc\avmedia.jar.component %_DEST%\xml%_EXT%\avmedia.jar.component
..\%__SRC%\misc\avmediaQuickTime.component %_DEST%\xml%_EXT%\avmediaQuickTime.component
..\%__SRC%\misc\avmediagst.component %_DEST%\xml%_EXT%\avmediagst.component
..\%__SRC%\misc\avmediawin.component %_DEST%\xml%_EXT%\avmediawin.component

View File

@ -497,44 +497,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
// -----------------------
// - component_writeInfo -
// -----------------------
extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
{
sal_Bool bRet = sal_False;
if( pRegistryKey )
{
try
{
rtl::OUString sKeyName = DECLARE_ASCII( "/" );
sKeyName += avmedia::SoundHandler::impl_getStaticImplementationName();
sKeyName += DECLARE_ASCII( "/UNO/SERVICES" );
css::uno::Reference< css::registry::XRegistryKey > xNewKey(
static_cast< css::registry::XRegistryKey* >( pRegistryKey )->createKey(sKeyName));
if ( xNewKey.is() == sal_True )
{
css::uno::Sequence< ::rtl::OUString > seqServiceNames = avmedia::SoundHandler::impl_getStaticSupportedServiceNames();
const ::rtl::OUString* pArray = seqServiceNames.getArray();
sal_Int32 nLength = seqServiceNames.getLength();
for ( sal_Int32 nCounter = 0; nCounter < nLength; ++nCounter )
xNewKey->createKey( pArray[nCounter] );
}
bRet = sal_True;
}
catch( css::registry::InvalidRegistryException& )
{
OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
}
}
return bRet;
}
// ------------------------ // ------------------------
// - component_getFactory - // - component_getFactory -
// ------------------------ // ------------------------

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.avmedia.Manager_GStreamer">
<service name="com.sun.star.media.Manager_GStreamer"/>
</implementation>
</component>

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
// -----------------------
// - component_writeInfo -
// -----------------------
extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
{
sal_Bool bRet = sal_False;
if( pRegistryKey )
{
try
{
uno::Reference< registry::XRegistryKey > xNewKey1(
static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
::rtl::OUString::createFromAscii(
"/" AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/"
AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ) );
bRet = sal_True;
}
catch( registry::InvalidRegistryException& )
{
OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
}
}
return bRet;
}
// ------------------------ // ------------------------
// - component_getFactory - // - component_getFactory -
// ------------------------ // ------------------------

View File

@ -69,3 +69,11 @@ DEF1EXPORTFILE=exports.dxp
.ENDIF .ENDIF
.INCLUDE : target.mk .INCLUDE : target.mk
ALLTAR : $(MISC)/avmediagst.component
$(MISC)/avmediagst.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
avmediagst.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt avmediagst.component

View File

@ -64,13 +64,4 @@ public class MediaUno
return null; return null;
} }
// -------------------------------------------------------------------------
public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey regKey )
{
return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo(
s_implName, s_serviceName, regKey );
}
} }

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.Java2"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.media.Manager_Java">
<service name="com.sun.star.media.Manager_Java"/>
</implementation>
</component>

View File

@ -59,3 +59,11 @@ CUSTOMMANIFESTFILE = manifest
# --- Targets ------------------------------------------------------ # --- Targets ------------------------------------------------------
.INCLUDE: target.mk .INCLUDE: target.mk
ALLTAR : $(MISC)/avmedia.jar.component
$(MISC)/avmedia.jar.component .ERRREMOVE : \
$(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_JAVA)avmedia.jar' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.avmedia.Manager_QuickTime">
<service name="com.sun.star.media.Manager_QuickTime"/>
</implementation>
</component>

View File

@ -83,3 +83,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
dummy: dummy:
@echo " Nothing to build for GUIBASE=$(GUIBASE)" @echo " Nothing to build for GUIBASE=$(GUIBASE)"
.ENDIF .ENDIF
ALLTAR : $(MISC)/avmediaQuickTime.component
$(MISC)/avmediaQuickTime.component .ERRREMOVE : \
$(SOLARENV)/bin/createcomponent.xslt avmediaQuickTime.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt avmediaQuickTime.component

View File

@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
// -----------------------
// - component_writeInfo -
// -----------------------
extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
{
sal_Bool bRet = sal_False;
if( pRegistryKey )
{
try
{
uno::Reference< registry::XRegistryKey > xNewKey1(
static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
::rtl::OUString::createFromAscii(
"/" AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/"
AVMEDIA_QUICKTIME_MANAGER_SERVICENAME ) ) );
bRet = sal_True;
}
catch( registry::InvalidRegistryException& )
{
OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
}
}
return bRet;
}
// ------------------------ // ------------------------
// - component_getFactory - // - component_getFactory -
// ------------------------ // ------------------------

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.avmedia.Manager_DirectX">
<service name="com.sun.star.media.Manager_DirectX"/>
</implementation>
</component>

View File

@ -1,4 +1,3 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -80,3 +80,11 @@ SHL1STDLIBS += dxguid.lib
.ENDIF .ENDIF
.INCLUDE : target.mk .INCLUDE : target.mk
ALLTAR : $(MISC)/avmediawin.component
$(MISC)/avmediawin.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
avmediawin.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt avmediawin.component

View File

@ -48,33 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
// -----------------------
// - component_writeInfo -
// -----------------------
extern "C" sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey )
{
sal_Bool bRet = sal_False;
if( pRegistryKey )
{
try
{
uno::Reference< registry::XRegistryKey > xNewKey1(
static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
::rtl::OUString::createFromAscii( "/com.sun.star.comp.avmedia.Manager_DirectX/UNO/SERVICES/com.sun.star.media.Manager_DirectX" ) ) );
bRet = sal_True;
}
catch( registry::InvalidRegistryException& )
{
OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
}
}
return bRet;
}
// ------------------------ // ------------------------
// - component_getFactory - // - component_getFactory -
// ------------------------ // ------------------------

View File

@ -1,4 +1,3 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
// -----------------------
// - component_writeInfo -
// -----------------------
extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
{
sal_Bool bRet = sal_False;
if( pRegistryKey )
{
try
{
uno::Reference< registry::XRegistryKey > xNewKey1(
static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
::rtl::OUString::createFromAscii(
"/" AVMEDIA_XINE_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/"
AVMEDIA_XINE_MANAGER_SERVICENAME ) ) );
bRet = sal_True;
}
catch( registry::InvalidRegistryException& )
{
OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
}
}
return bRet;
}
// ------------------------ // ------------------------
// - component_getFactory - // - component_getFactory -
// ------------------------ // ------------------------

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.framework.SoundHandler">
<service name="com.sun.star.frame.ContentHandler"/>
</implementation>
</component>

View File

@ -77,3 +77,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo LibMain>>$@ @echo LibMain>>$@
@echo CT>>$@ @echo CT>>$@
.ENDIF .ENDIF
ALLTAR : $(MISC)/avmedia.component
$(MISC)/avmedia.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
avmedia.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt avmedia.component

View File

@ -57,3 +57,4 @@ mkdir: %_DEST%\inc%_EXT%\basic
..\inc\basic\basicmanagerrepository.hxx %_DEST%\inc%_EXT%\basic\basicmanagerrepository.hxx ..\inc\basic\basicmanagerrepository.hxx %_DEST%\inc%_EXT%\basic\basicmanagerrepository.hxx
..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx ..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx
..\%__SRC%\misc\sb.component %_DEST%\xml%_EXT%\sb.component

View File

@ -143,4 +143,10 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
$(SRS)$/basic.srs: $(SRS)$/basic.srs:
$(TYPE) $(SRS)$/classes.srs + $(SRS)$/runtime.srs + $(SRS)$/sbx.srs > $@ $(TYPE) $(SRS)$/classes.srs + $(SRS)$/runtime.srs + $(SRS)$/sbx.srs > $@
ALLTAR : $(MISC)/sb.component
$(MISC)/sb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
sb.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt sb.component

View File

@ -1,4 +1,5 @@
/************************************************************************* <?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
* *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -23,42 +24,16 @@
* <http://www.openoffice.org/license.html> * <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
* *
************************************************************************/ **********************************************************************-->
#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX <component loader="com.sun.star.loader.SharedLibrary"
#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sfx2.DialogLibraryContainer">
#include "sal/config.h" <service name="com.sun.star.script.DialogLibraryContainer"/>
<service name="com.sun.star.script.DocumentDialogLibraryContainer"/>
#include "rtl/string.h" </implementation>
#include "sal/types.h" <implementation name="com.sun.star.comp.sfx2.ScriptLibraryContainer">
<service name="com.sun.star.script.DocumentScriptLibraryContainer"/>
namespace configmgr { <service name="com.sun.star.script.ScriptLibraryContainer"/>
</implementation>
struct Span { </component>
char const * begin;
sal_Int32 length;
inline Span(): begin(0), length(0) {}
// init length to avoid compiler warnings
inline Span(char const * theBegin, sal_Int32 theLength):
begin(theBegin), length(theLength) {}
inline void clear() throw() { begin = 0; }
inline bool is() const { return begin != 0; }
inline bool equals(Span const & text) const {
return rtl_str_compare_WithLength(
begin, length, text.begin, text.length) == 0;
}
inline bool equals(char const * textBegin, sal_Int32 textLength) const {
return equals(Span(textBegin, textLength));
}
};
}
#endif

View File

@ -1,4 +1,4 @@
cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport NULL cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport xmlreader NULL
cg configmgr\inc nmake - all cg_inc NULL cg configmgr\inc nmake - all cg_inc NULL
cg configmgr\source nmake - all cg_source cg_inc NULL cg configmgr\source nmake - all cg_source cg_inc NULL
cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL

View File

@ -1,3 +1,4 @@
..\%__SRC%\bin\configmgr.uno.dll %_DEST%\bin%_EXT%\configmgr.uno.dll ..\%__SRC%\bin\configmgr.uno.dll %_DEST%\bin%_EXT%\configmgr.uno.dll
..\%__SRC%\lib\configmgr.uno.dylib %_DEST%\lib%_EXT%\configmgr.uno.dylib ..\%__SRC%\lib\configmgr.uno.dylib %_DEST%\lib%_EXT%\configmgr.uno.dylib
..\%__SRC%\lib\configmgr.uno.so %_DEST%\lib%_EXT%\configmgr.uno.so ..\%__SRC%\lib\configmgr.uno.so %_DEST%\lib%_EXT%\configmgr.uno.so
..\%__SRC%\misc\configmgr.component %_DEST%\xml%_EXT%\configmgr.component

View File

@ -51,16 +51,13 @@ propertynode.cxx
setnode.cxx setnode.cxx
Internal representations of data nodes. Internal representations of data nodes.
pad.cxx
parsemanager.cxx parsemanager.cxx
parser.hxx parser.hxx
span.hxx
valueparser.cxx valueparser.cxx
xcdparser.cxx xcdparser.cxx
xcsparser.cxx xcsparser.cxx
xcuparser.cxx xcuparser.cxx
xmldata.cxx xmldata.cxx
xmlreader.cxx
XML file reading. XML file reading.
modifications.cxx modifications.cxx

View File

@ -769,7 +769,7 @@ void Components::parseModificationLayer() {
"configmgr user registrymodifications.xcu does not (yet) exist"); "configmgr user registrymodifications.xcu does not (yet) exist");
// Migrate old user layer data (can be removed once migration is no // Migrate old user layer data (can be removed once migration is no
// longer relevant, probably OOo 4; also see hack for xsi namespace in // longer relevant, probably OOo 4; also see hack for xsi namespace in
// XmlReader constructor): // xmlreader::XmlReader::registerNamespaceIri):
parseFiles( parseFiles(
Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")), Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
&parseXcuFile, &parseXcuFile,

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.configuration.ConfigurationProvider">
<service name="com.sun.star.configuration.ConfigurationProvider"/>
</implementation>
<implementation name="com.sun.star.comp.configuration.ConfigurationRegistry">
<service name="com.sun.star.configuration.ConfigurationRegistry"/>
</implementation>
<implementation name="com.sun.star.comp.configuration.DefaultProvider">
<service name="com.sun.star.configuration.DefaultProvider"/>
<singleton name="com.sun.star.configuration.theDefaultProvider"/>
</implementation>
<implementation name="com.sun.star.comp.configuration.Update">
<service name="com.sun.star.configuration.Update_Service"/>
<singleton name="com.sun.star.configuration.Update"/>
</implementation>
</component>

View File

@ -52,7 +52,6 @@ SLOFILES = \
$(SLO)/modifications.obj \ $(SLO)/modifications.obj \
$(SLO)/node.obj \ $(SLO)/node.obj \
$(SLO)/nodemap.obj \ $(SLO)/nodemap.obj \
$(SLO)/pad.obj \
$(SLO)/parsemanager.obj \ $(SLO)/parsemanager.obj \
$(SLO)/partial.obj \ $(SLO)/partial.obj \
$(SLO)/propertynode.obj \ $(SLO)/propertynode.obj \
@ -66,8 +65,7 @@ SLOFILES = \
$(SLO)/xcdparser.obj \ $(SLO)/xcdparser.obj \
$(SLO)/xcsparser.obj \ $(SLO)/xcsparser.obj \
$(SLO)/xcuparser.obj \ $(SLO)/xcuparser.obj \
$(SLO)/xmldata.obj \ $(SLO)/xmldata.obj
$(SLO)/xmlreader.obj
SHL1IMPLIB = i$(SHL1TARGET) SHL1IMPLIB = i$(SHL1TARGET)
SHL1OBJS = $(SLOFILES) SHL1OBJS = $(SLOFILES)
@ -76,9 +74,18 @@ SHL1STDLIBS = \
$(CPPUHELPERLIB) \ $(CPPUHELPERLIB) \
$(CPPULIB) \ $(CPPULIB) \
$(SALHELPERLIB) \ $(SALHELPERLIB) \
$(SALLIB) $(SALLIB) \
$(XMLREADERLIB)
SHL1TARGET = configmgr.uno SHL1TARGET = configmgr.uno
SHL1USE_EXPORTS = name SHL1USE_EXPORTS = name
DEF1NAME = $(SHL1TARGET) DEF1NAME = $(SHL1TARGET)
.INCLUDE: target.mk .INCLUDE: target.mk
ALLTAR : $(MISC)/configmgr.component
$(MISC)/configmgr.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
configmgr.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt configmgr.component

View File

@ -1,86 +0,0 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include "precompiled_configmgr.hxx"
#include "sal/config.h"
#include "osl/diagnose.h"
#include "rtl/string.h"
#include "sal/types.h"
#include "pad.hxx"
#include "span.hxx"
namespace configmgr {
void Pad::add(char const * begin, sal_Int32 length) {
OSL_ASSERT(
begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
if (length != 0) {
flushSpan();
if (buffer_.getLength() == 0) {
span_ = Span(begin, length);
} else {
buffer_.append(begin, length);
}
}
}
void Pad::addEphemeral(char const * begin, sal_Int32 length) {
OSL_ASSERT(
begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
if (length != 0) {
flushSpan();
buffer_.append(begin, length);
}
}
void Pad::clear() {
OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
span_.clear();
buffer_.setLength(0);
}
Span Pad::get() const {
OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
if (span_.is()) {
return span_;
} else if (buffer_.getLength() == 0) {
return Span(RTL_CONSTASCII_STRINGPARAM(""));
} else {
return Span(buffer_.getStr(), buffer_.getLength());
}
}
void Pad::flushSpan() {
if (span_.is()) {
buffer_.append(span_.begin, span_.length);
span_.clear();
}
}
}

View File

@ -32,10 +32,11 @@
#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/RuntimeException.hpp"
#include "osl/diagnose.h" #include "osl/diagnose.h"
#include "sal/types.h" #include "sal/types.h"
#include "xmlreader/span.hxx"
#include "xmlreader/xmlreader.hxx"
#include "parsemanager.hxx" #include "parsemanager.hxx"
#include "parser.hxx" #include "parser.hxx"
#include "xmlreader.hxx"
namespace configmgr { namespace configmgr {
@ -52,28 +53,42 @@ ParseManager::ParseManager(
reader_(url), parser_(parser) reader_(url), parser_(parser)
{ {
OSL_ASSERT(parser.is()); OSL_ASSERT(parser.is());
int id;
id = reader_.registerNamespaceIri(
xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry")));
OSL_ASSERT(id == NAMESPACE_OOR);
id = reader_.registerNamespaceIri(
xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema")));
OSL_ASSERT(id == NAMESPACE_XS);
id = reader_.registerNamespaceIri(
xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM(
"http://www.w3.org/2001/XMLSchema-instance")));
OSL_ASSERT(id == NAMESPACE_XSI);
} }
bool ParseManager::parse() { bool ParseManager::parse() {
for (;;) { for (;;) {
switch (itemData_.is() switch (itemData_.is()
? XmlReader::RESULT_BEGIN ? xmlreader::XmlReader::RESULT_BEGIN
: reader_.nextItem( : reader_.nextItem(
parser_->getTextMode(), &itemData_, &itemNamespace_)) parser_->getTextMode(), &itemData_, &itemNamespaceId_))
{ {
case XmlReader::RESULT_BEGIN: case xmlreader::XmlReader::RESULT_BEGIN:
if (!parser_->startElement(reader_, itemNamespace_, itemData_)) if (!parser_->startElement(reader_, itemNamespaceId_, itemData_))
{ {
return false; return false;
} }
break; break;
case XmlReader::RESULT_END: case xmlreader::XmlReader::RESULT_END:
parser_->endElement(reader_); parser_->endElement(reader_);
break; break;
case XmlReader::RESULT_TEXT: case xmlreader::XmlReader::RESULT_TEXT:
parser_->characters(itemData_); parser_->characters(itemData_);
break; break;
case XmlReader::RESULT_DONE: case xmlreader::XmlReader::RESULT_DONE:
return true; return true;
} }
itemData_.clear(); itemData_.clear();

View File

@ -35,9 +35,8 @@
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "salhelper/simplereferenceobject.hxx" #include "salhelper/simplereferenceobject.hxx"
#include "xmlreader/span.hxx"
#include "span.hxx" #include "xmlreader/xmlreader.hxx"
#include "xmlreader.hxx"
namespace rtl { class OUString; } namespace rtl { class OUString; }
@ -55,13 +54,15 @@ public:
bool parse(); bool parse();
enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 };
private: private:
virtual ~ParseManager(); virtual ~ParseManager();
XmlReader reader_; xmlreader::XmlReader reader_;
rtl::Reference< Parser > parser_; rtl::Reference< Parser > parser_;
Span itemData_; xmlreader::Span itemData_;
XmlReader::Namespace itemNamespace_; int itemNamespaceId_;
}; };
} }

View File

@ -33,23 +33,23 @@
#include <memory> #include <memory>
#include "salhelper/simplereferenceobject.hxx" #include "salhelper/simplereferenceobject.hxx"
#include "xmlreader/xmlreader.hxx"
#include "xmlreader.hxx" namespace xmlreader { struct Span; }
namespace configmgr { namespace configmgr {
struct Span;
class Parser: public salhelper::SimpleReferenceObject { class Parser: public salhelper::SimpleReferenceObject {
public: public:
virtual XmlReader::Text getTextMode() = 0; virtual xmlreader::XmlReader::Text getTextMode() = 0;
virtual bool startElement( virtual bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name) = 0; xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
= 0;
virtual void endElement(XmlReader const & reader) = 0; virtual void endElement(xmlreader::XmlReader const & reader) = 0;
virtual void characters(Span const & text) = 0; virtual void characters(xmlreader::Span const & text) = 0;
protected: protected:
Parser() {} Parser() {}

View File

@ -28,7 +28,6 @@
#include "precompiled_configmgr.hxx" #include "precompiled_configmgr.hxx"
#include "sal/config.h" #include "sal/config.h"
#include "com/sun/star/registry/XRegistryKey.hpp"
#include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XComponentContext.hpp"
@ -36,9 +35,6 @@
#include "cppuhelper/implementationentry.hxx" #include "cppuhelper/implementationentry.hxx"
#include "osl/diagnose.h" #include "osl/diagnose.h"
#include "uno/lbnames.h" #include "uno/lbnames.h"
#include "rtl/textenc.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "configurationprovider.hxx" #include "configurationprovider.hxx"
@ -89,47 +85,3 @@ component_getImplementationEnvironment(
{ {
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey)
{
if (!component_writeInfoHelper(pServiceManager, pRegistryKey, services)) {
return false;
}
try {
css::uno::Reference< css::registry::XRegistryKey >(
(css::uno::Reference< css::registry::XRegistryKey >(
static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
createKey(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"/com.sun.star.comp.configuration.DefaultProvider/UNO/"
"SINGLETONS/"
"com.sun.star.configuration.theDefaultProvider")))),
css::uno::UNO_SET_THROW)->
setStringValue(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.DefaultProvider")));
css::uno::Reference< css::registry::XRegistryKey >(
(css::uno::Reference< css::registry::XRegistryKey >(
static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
createKey(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"/com.sun.star.comp.configuration.Update/UNO/"
"SINGLETONS/com.sun.star.configuration.Update")))),
css::uno::UNO_SET_THROW)->
setStringValue(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.Update_Service")));
} catch (css::uno::Exception & e) {
(void) e;
OSL_TRACE(
"configmgr component_writeInfo exception: %s",
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
return false;
}
return true;
}

View File

@ -40,16 +40,17 @@
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "xmlreader/span.hxx"
#include "xmlreader/xmlreader.hxx"
#include "localizedvaluenode.hxx" #include "localizedvaluenode.hxx"
#include "node.hxx" #include "node.hxx"
#include "nodemap.hxx" #include "nodemap.hxx"
#include "parsemanager.hxx"
#include "propertynode.hxx" #include "propertynode.hxx"
#include "span.hxx"
#include "type.hxx" #include "type.hxx"
#include "valueparser.hxx" #include "valueparser.hxx"
#include "xmldata.hxx" #include "xmldata.hxx"
#include "xmlreader.hxx"
namespace configmgr { namespace configmgr {
@ -74,7 +75,7 @@ bool parseHexDigit(char c, int * value) {
return false; return false;
} }
bool parseValue(Span const & text, sal_Bool * value) { bool parseValue(xmlreader::Span const & text, sal_Bool * value) {
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) || if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) ||
text.equals(RTL_CONSTASCII_STRINGPARAM("1"))) text.equals(RTL_CONSTASCII_STRINGPARAM("1")))
@ -91,7 +92,7 @@ bool parseValue(Span const & text, sal_Bool * value) {
return false; return false;
} }
bool parseValue(Span const & text, sal_Int16 * value) { bool parseValue(xmlreader::Span const & text, sal_Int16 * value) {
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
// For backwards compatibility, support hexadecimal values: // For backwards compatibility, support hexadecimal values:
sal_Int32 n = sal_Int32 n =
@ -110,7 +111,7 @@ bool parseValue(Span const & text, sal_Int16 * value) {
return false; return false;
} }
bool parseValue(Span const & text, sal_Int32 * value) { bool parseValue(xmlreader::Span const & text, sal_Int32 * value) {
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
// For backwards compatibility, support hexadecimal values: // For backwards compatibility, support hexadecimal values:
*value = *value =
@ -125,7 +126,7 @@ bool parseValue(Span const & text, sal_Int32 * value) {
return true; return true;
} }
bool parseValue(Span const & text, sal_Int64 * value) { bool parseValue(xmlreader::Span const & text, sal_Int64 * value) {
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
// For backwards compatibility, support hexadecimal values: // For backwards compatibility, support hexadecimal values:
*value = *value =
@ -140,20 +141,22 @@ bool parseValue(Span const & text, sal_Int64 * value) {
return true; return true;
} }
bool parseValue(Span const & text, double * value) { bool parseValue(xmlreader::Span const & text, double * value) {
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
*value = rtl::OString(text.begin, text.length).toDouble(); *value = rtl::OString(text.begin, text.length).toDouble();
//TODO: check valid lexical representation //TODO: check valid lexical representation
return true; return true;
} }
bool parseValue(Span const & text, rtl::OUString * value) { bool parseValue(xmlreader::Span const & text, rtl::OUString * value) {
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
*value = xmldata::convertFromUtf8(text); *value = text.convertFromUtf8();
return true; return true;
} }
bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) { bool parseValue(
xmlreader::Span const & text, css::uno::Sequence< sal_Int8 > * value)
{
OSL_ASSERT(text.is() && value != 0); OSL_ASSERT(text.is() && value != 0);
if ((text.length & 1) != 0) { if ((text.length & 1) != 0) {
return false; return false;
@ -173,7 +176,9 @@ bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
return true; return true;
} }
template< typename T > css::uno::Any parseSingleValue(Span const & text) { template< typename T > css::uno::Any parseSingleValue(
xmlreader::Span const & text)
{
T val; T val;
if (!parseValue(text, &val)) { if (!parseValue(text, &val)) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
@ -184,21 +189,23 @@ template< typename T > css::uno::Any parseSingleValue(Span const & text) {
} }
template< typename T > css::uno::Any parseListValue( template< typename T > css::uno::Any parseListValue(
rtl::OString const & separator, Span const & text) rtl::OString const & separator, xmlreader::Span const & text)
{ {
comphelper::SequenceAsVector< T > seq; comphelper::SequenceAsVector< T > seq;
Span sep; xmlreader::Span sep;
if (separator.getLength() == 0) { if (separator.getLength() == 0) {
sep = Span(RTL_CONSTASCII_STRINGPARAM(" ")); sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" "));
} else { } else {
sep = Span(separator.getStr(), separator.getLength()); sep = xmlreader::Span(separator.getStr(), separator.getLength());
} }
if (text.length != 0) { if (text.length != 0) {
for (Span t(text);;) { for (xmlreader::Span t(text);;) {
sal_Int32 i = rtl_str_indexOfStr_WithLength( sal_Int32 i = rtl_str_indexOfStr_WithLength(
t.begin, t.length, sep.begin, sep.length); t.begin, t.length, sep.begin, sep.length);
T val; T val;
if (!parseValue(Span(t.begin, i == -1 ? t.length : i), &val)) { if (!parseValue(
xmlreader::Span(t.begin, i == -1 ? t.length : i), &val))
{
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
@ -215,7 +222,7 @@ template< typename T > css::uno::Any parseListValue(
} }
css::uno::Any parseValue( css::uno::Any parseValue(
rtl::OString const & separator, Span const & text, Type type) rtl::OString const & separator, xmlreader::Span const & text, Type type)
{ {
switch (type) { switch (type) {
case TYPE_ANY: case TYPE_ANY:
@ -266,7 +273,7 @@ ValueParser::ValueParser(int layer): layer_(layer) {}
ValueParser::~ValueParser() {} ValueParser::~ValueParser() {}
XmlReader::Text ValueParser::getTextMode() const { xmlreader::XmlReader::Text ValueParser::getTextMode() const {
if (node_.is()) { if (node_.is()) {
switch (state_) { switch (state_) {
case STATE_TEXT: case STATE_TEXT:
@ -278,23 +285,24 @@ XmlReader::Text ValueParser::getTextMode() const {
return return
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST || (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
separator_.getLength() != 0) separator_.getLength() != 0)
? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED; ? xmlreader::XmlReader::TEXT_RAW
: xmlreader::XmlReader::TEXT_NORMALIZED;
default: default:
break; break;
} }
} }
return XmlReader::TEXT_NONE; return xmlreader::XmlReader::TEXT_NONE;
} }
bool ValueParser::startElement( bool ValueParser::startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name) xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{ {
if (!node_.is()) { if (!node_.is()) {
return false; return false;
} }
switch (state_) { switch (state_) {
case STATE_TEXT: case STATE_TEXT:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("it")) && name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
isListType(type_) && separator_.getLength() == 0) isListType(type_) && separator_.getLength() == 0)
{ {
@ -306,18 +314,18 @@ bool ValueParser::startElement(
} }
// fall through // fall through
case STATE_IT: case STATE_IT:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) && name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) &&
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST)) (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
{ {
sal_Int32 scalar = -1; sal_Int32 scalar = -1;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar")))
{ {
if (!parseValue(reader.getAttributeValue(true), &scalar)) { if (!parseValue(reader.getAttributeValue(true), &scalar)) {
@ -352,7 +360,7 @@ bool ValueParser::startElement(
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
@ -439,7 +447,7 @@ bool ValueParser::endElement() {
return true; return true;
} }
void ValueParser::characters(Span const & text) { void ValueParser::characters(xmlreader::Span const & text) {
if (node_.is()) { if (node_.is()) {
OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT); OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT);
pad_.add(text.begin, text.length); pad_.add(text.begin, text.length);

View File

@ -36,19 +36,19 @@
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "rtl/string.hxx" #include "rtl/string.hxx"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/pad.hxx"
#include "xmlreader/xmlreader.hxx"
#include "pad.hxx"
#include "type.hxx" #include "type.hxx"
#include "xmlreader.hxx"
namespace com { namespace sun { namespace star { namespace uno { namespace com { namespace sun { namespace star { namespace uno {
class Any; class Any;
} } } } } } } }
namespace xmlreader { struct Span; }
namespace configmgr { namespace configmgr {
class Node; class Node;
struct Span;
class ValueParser: private boost::noncopyable { class ValueParser: private boost::noncopyable {
public: public:
@ -56,14 +56,14 @@ public:
~ValueParser(); ~ValueParser();
XmlReader::Text getTextMode() const; xmlreader::XmlReader::Text getTextMode() const;
bool startElement( bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name); xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
bool endElement(); bool endElement();
void characters(Span const & text); void characters(xmlreader::Span const & text);
void start( void start(
rtl::Reference< Node > const & property, rtl::Reference< Node > const & property,
@ -83,7 +83,7 @@ private:
rtl::Reference< Node > node_; rtl::Reference< Node > node_;
rtl::OUString localizedName_; rtl::OUString localizedName_;
State state_; State state_;
Pad pad_; xmlreader::Pad pad_;
std::vector< com::sun::star::uno::Any > items_; std::vector< com::sun::star::uno::Any > items_;
}; };

View File

@ -45,6 +45,7 @@
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "xmlreader/span.hxx"
#include "data.hxx" #include "data.hxx"
#include "groupnode.hxx" #include "groupnode.hxx"
@ -54,7 +55,6 @@
#include "node.hxx" #include "node.hxx"
#include "nodemap.hxx" #include "nodemap.hxx"
#include "propertynode.hxx" #include "propertynode.hxx"
#include "span.hxx"
#include "type.hxx" #include "type.hxx"
#include "writemodfile.hxx" #include "writemodfile.hxx"
@ -341,22 +341,23 @@ void writeNode(
rtl::Reference< Node > const & parent, rtl::OUString const & name, rtl::Reference< Node > const & parent, rtl::OUString const & name,
rtl::Reference< Node > const & node) rtl::Reference< Node > const & node)
{ {
static Span const typeNames[] = { static xmlreader::Span const typeNames[] = {
Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY xmlreader::Span(), xmlreader::Span(), xmlreader::Span(),
Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")), // TYPE_ERROR, TYPE_NIL, TYPE_ANY
Span(RTL_CONSTASCII_STRINGPARAM("xs:short")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
Span(RTL_CONSTASCII_STRINGPARAM("xs:int")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
Span(RTL_CONSTASCII_STRINGPARAM("xs:long")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
Span(RTL_CONSTASCII_STRINGPARAM("xs:double")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
Span(RTL_CONSTASCII_STRINGPARAM("xs:string")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")), xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) }; xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
switch (node->kind()) { switch (node->kind()) {
case Node::KIND_PROPERTY: case Node::KIND_PROPERTY:
{ {

View File

@ -37,13 +37,14 @@
#include "rtl/string.h" #include "rtl/string.h"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/span.hxx"
#include "xmlreader/xmlreader.hxx"
#include "span.hxx" #include "parsemanager.hxx"
#include "xcdparser.hxx" #include "xcdparser.hxx"
#include "xcsparser.hxx" #include "xcsparser.hxx"
#include "xcuparser.hxx" #include "xcuparser.hxx"
#include "xmldata.hxx" #include "xmldata.hxx"
#include "xmlreader.hxx"
namespace configmgr { namespace configmgr {
@ -59,22 +60,22 @@ XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data & data):
XcdParser::~XcdParser() {} XcdParser::~XcdParser() {}
XmlReader::Text XcdParser::getTextMode() { xmlreader::XmlReader::Text XcdParser::getTextMode() {
return nestedParser_.is() return nestedParser_.is()
? nestedParser_->getTextMode() : XmlReader::TEXT_NONE; ? nestedParser_->getTextMode() : xmlreader::XmlReader::TEXT_NONE;
} }
bool XcdParser::startElement( bool XcdParser::startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name) xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{ {
if (nestedParser_.is()) { if (nestedParser_.is()) {
OSL_ASSERT(nesting_ != LONG_MAX); OSL_ASSERT(nesting_ != LONG_MAX);
++nesting_; ++nesting_;
return nestedParser_->startElement(reader, ns, name); return nestedParser_->startElement(reader, nsId, name);
} }
switch (state_) { switch (state_) {
case STATE_START: case STATE_START:
if (ns == XmlReader::NAMESPACE_OOR && if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("data"))) name.equals(RTL_CONSTASCII_STRINGPARAM("data")))
{ {
state_ = STATE_DEPENDENCIES; state_ = STATE_DEPENDENCIES;
@ -82,18 +83,19 @@ bool XcdParser::startElement(
} }
break; break;
case STATE_DEPENDENCIES: case STATE_DEPENDENCIES:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("dependency"))) name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
{ {
if (dependency_.getLength() == 0) { if (dependency_.getLength() == 0) {
Span attrFile; xmlreader::Span attrFile;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE &&
//TODO: _OOR
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file")))
{ {
attrFile = reader.getAttributeValue(false); attrFile = reader.getAttributeValue(false);
@ -107,7 +109,7 @@ bool XcdParser::startElement(
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
dependency_ = xmldata::convertFromUtf8(attrFile); dependency_ = attrFile.convertFromUtf8();
if (dependency_.getLength() == 0) { if (dependency_.getLength() == 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
@ -127,19 +129,19 @@ bool XcdParser::startElement(
state_ = STATE_COMPONENTS; state_ = STATE_COMPONENTS;
// fall through // fall through
case STATE_COMPONENTS: case STATE_COMPONENTS:
if (ns == XmlReader::NAMESPACE_OOR && if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema")))
{ {
nestedParser_ = new XcsParser(layer_, data_); nestedParser_ = new XcsParser(layer_, data_);
nesting_ = 1; nesting_ = 1;
return nestedParser_->startElement(reader, ns, name); return nestedParser_->startElement(reader, nsId, name);
} }
if (ns == XmlReader::NAMESPACE_OOR && if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
{ {
nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0); nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0);
nesting_ = 1; nesting_ = 1;
return nestedParser_->startElement(reader, ns, name); return nestedParser_->startElement(reader, nsId, name);
} }
break; break;
default: // STATE_DEPENDENCY default: // STATE_DEPENDENCY
@ -148,12 +150,12 @@ bool XcdParser::startElement(
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
void XcdParser::endElement(XmlReader const & reader) { void XcdParser::endElement(xmlreader::XmlReader const & reader) {
if (nestedParser_.is()) { if (nestedParser_.is()) {
nestedParser_->endElement(reader); nestedParser_->endElement(reader);
if (--nesting_ == 0) { if (--nesting_ == 0) {
@ -174,7 +176,7 @@ void XcdParser::endElement(XmlReader const & reader) {
} }
} }
void XcdParser::characters(Span const & text) { void XcdParser::characters(xmlreader::Span const & text) {
if (nestedParser_.is()) { if (nestedParser_.is()) {
nestedParser_->characters(text); nestedParser_->characters(text);
} }

View File

@ -34,14 +34,15 @@
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/xmlreader.hxx"
#include "parser.hxx" #include "parser.hxx"
#include "xmlreader.hxx"
namespace xmlreader { struct Span; }
namespace configmgr { namespace configmgr {
struct Data; struct Data;
struct Span;
class XcdParser: public Parser { class XcdParser: public Parser {
public: public:
@ -52,14 +53,14 @@ public:
private: private:
virtual ~XcdParser(); virtual ~XcdParser();
virtual XmlReader::Text getTextMode(); virtual xmlreader::XmlReader::Text getTextMode();
virtual bool startElement( virtual bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name); xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
virtual void endElement(XmlReader const & reader); virtual void endElement(xmlreader::XmlReader const & reader);
virtual void characters(Span const & text); virtual void characters(xmlreader::Span const & text);
enum State { enum State {
STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS }; STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };

View File

@ -41,18 +41,19 @@
#include "rtl/string.hxx" #include "rtl/string.hxx"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/span.hxx"
#include "xmlreader/xmlreader.hxx"
#include "data.hxx" #include "data.hxx"
#include "localizedpropertynode.hxx" #include "localizedpropertynode.hxx"
#include "groupnode.hxx" #include "groupnode.hxx"
#include "node.hxx" #include "node.hxx"
#include "nodemap.hxx" #include "nodemap.hxx"
#include "parsemanager.hxx"
#include "propertynode.hxx" #include "propertynode.hxx"
#include "setnode.hxx" #include "setnode.hxx"
#include "span.hxx"
#include "xcsparser.hxx" #include "xcsparser.hxx"
#include "xmldata.hxx" #include "xmldata.hxx"
#include "xmlreader.hxx"
namespace configmgr { namespace configmgr {
@ -125,18 +126,18 @@ XcsParser::XcsParser(int layer, Data & data):
XcsParser::~XcsParser() {} XcsParser::~XcsParser() {}
XmlReader::Text XcsParser::getTextMode() { xmlreader::XmlReader::Text XcsParser::getTextMode() {
return valueParser_.getTextMode(); return valueParser_.getTextMode();
} }
bool XcsParser::startElement( bool XcsParser::startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name) xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{ {
if (valueParser_.startElement(reader, ns, name)) { if (valueParser_.startElement(reader, nsId, name)) {
return true; return true;
} }
if (state_ == STATE_START) { if (state_ == STATE_START) {
if (ns == XmlReader::NAMESPACE_OOR && if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) { name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) {
handleComponentSchema(reader); handleComponentSchema(reader);
state_ = STATE_COMPONENT_SCHEMA; state_ = STATE_COMPONENT_SCHEMA;
@ -148,7 +149,7 @@ bool XcsParser::startElement(
// prop constraints; accepting all four at illegal places (and with // prop constraints; accepting all four at illegal places (and with
// illegal content): // illegal content):
if (ignoring_ > 0 || if (ignoring_ > 0 ||
(ns == XmlReader::NAMESPACE_NONE && (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
(name.equals(RTL_CONSTASCII_STRINGPARAM("info")) || (name.equals(RTL_CONSTASCII_STRINGPARAM("info")) ||
name.equals(RTL_CONSTASCII_STRINGPARAM("import")) || name.equals(RTL_CONSTASCII_STRINGPARAM("import")) ||
name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) || name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) ||
@ -160,7 +161,7 @@ bool XcsParser::startElement(
} }
switch (state_) { switch (state_) {
case STATE_COMPONENT_SCHEMA: case STATE_COMPONENT_SCHEMA:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("templates"))) name.equals(RTL_CONSTASCII_STRINGPARAM("templates")))
{ {
state_ = STATE_TEMPLATES; state_ = STATE_TEMPLATES;
@ -168,7 +169,7 @@ bool XcsParser::startElement(
} }
// fall through // fall through
case STATE_TEMPLATES_DONE: case STATE_TEMPLATES_DONE:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component"))) name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{ {
state_ = STATE_COMPONENT; state_ = STATE_COMPONENT;
@ -183,13 +184,13 @@ bool XcsParser::startElement(
break; break;
case STATE_TEMPLATES: case STATE_TEMPLATES:
if (elements_.empty()) { if (elements_.empty()) {
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("group"))) name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
{ {
handleGroup(reader, true); handleGroup(reader, true);
return true; return true;
} }
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("set"))) name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
{ {
handleSet(reader, true); handleSet(reader, true);
@ -203,7 +204,7 @@ bool XcsParser::startElement(
switch (elements_.top().node->kind()) { switch (elements_.top().node->kind()) {
case Node::KIND_PROPERTY: case Node::KIND_PROPERTY:
case Node::KIND_LOCALIZED_PROPERTY: case Node::KIND_LOCALIZED_PROPERTY:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
{ {
handlePropValue(reader, elements_.top().node); handlePropValue(reader, elements_.top().node);
@ -211,25 +212,25 @@ bool XcsParser::startElement(
} }
break; break;
case Node::KIND_GROUP: case Node::KIND_GROUP:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
{ {
handleProp(reader); handleProp(reader);
return true; return true;
} }
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref"))) name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref")))
{ {
handleNodeRef(reader); handleNodeRef(reader);
return true; return true;
} }
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("group"))) name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
{ {
handleGroup(reader, false); handleGroup(reader, false);
return true; return true;
} }
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("set"))) name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
{ {
handleSet(reader, false); handleSet(reader, false);
@ -237,7 +238,7 @@ bool XcsParser::startElement(
} }
break; break;
case Node::KIND_SET: case Node::KIND_SET:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("item"))) name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
{ {
handleSetItem( handleSetItem(
@ -260,12 +261,12 @@ bool XcsParser::startElement(
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
void XcsParser::endElement(XmlReader const & reader) { void XcsParser::endElement(xmlreader::XmlReader const & reader) {
if (valueParser_.endElement()) { if (valueParser_.endElement()) {
return; return;
} }
@ -342,23 +343,23 @@ void XcsParser::endElement(XmlReader const & reader) {
} }
} }
void XcsParser::characters(Span const & text) { void XcsParser::characters(xmlreader::Span const & text) {
valueParser_.characters(text); valueParser_.characters(text);
} }
void XcsParser::handleComponentSchema(XmlReader & reader) { void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
//TODO: oor:version, xml:lang attributes //TODO: oor:version, xml:lang attributes
rtl::OStringBuffer buf; rtl::OStringBuffer buf;
buf.append('.'); buf.append('.');
bool hasPackage = false; bool hasPackage = false;
bool hasName = false; bool hasName = false;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
{ {
if (hasPackage) { if (hasPackage) {
@ -371,9 +372,9 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
hasPackage = true; hasPackage = true;
Span s(reader.getAttributeValue(false)); xmlreader::Span s(reader.getAttributeValue(false));
buf.insert(0, s.begin, s.length); buf.insert(0, s.begin, s.length);
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
if (hasName) { if (hasName) {
@ -385,7 +386,7 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
hasName = true; hasName = true;
Span s(reader.getAttributeValue(false)); xmlreader::Span s(reader.getAttributeValue(false));
buf.append(s.begin, s.length); buf.append(s.begin, s.length);
} }
} }
@ -405,38 +406,36 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
componentName_ = xmldata::convertFromUtf8( componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
Span(buf.getStr(), buf.getLength())); convertFromUtf8();
} }
void XcsParser::handleNodeRef(XmlReader & reader) { void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) {
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
rtl::OUString component(componentName_); rtl::OUString component(componentName_);
bool hasNodeType = false; bool hasNodeType = false;
rtl::OUString nodeType; rtl::OUString nodeType;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{ {
component = xmldata::convertFromUtf8( component = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false)); } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{ {
hasNodeType = true; hasNodeType = true;
nodeType = xmldata::convertFromUtf8( nodeType = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false));
} }
} }
if (!hasName) { if (!hasName) {
@ -465,33 +464,33 @@ void XcsParser::handleNodeRef(XmlReader & reader) {
elements_.push(Element(node, name)); elements_.push(Element(node, name));
} }
void XcsParser::handleProp(XmlReader & reader) { void XcsParser::handleProp(xmlreader::XmlReader & reader) {
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
valueParser_.type_ = TYPE_ERROR; valueParser_.type_ = TYPE_ERROR;
bool localized = false; bool localized = false;
bool nillable = true; bool nillable = true;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{ {
valueParser_.type_ = xmldata::parseType( valueParser_.type_ = xmldata::parseType(
reader, reader.getAttributeValue(true)); reader, reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized")))
{ {
localized = xmldata::parseBoolean(reader.getAttributeValue(true)); localized = xmldata::parseBoolean(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable")))
{ {
nillable = xmldata::parseBoolean(reader.getAttributeValue(true)); nillable = xmldata::parseBoolean(reader.getAttributeValue(true));
@ -525,16 +524,16 @@ void XcsParser::handleProp(XmlReader & reader) {
} }
void XcsParser::handlePropValue( void XcsParser::handlePropValue(
XmlReader & reader, rtl::Reference< Node > const & property) xmlreader::XmlReader & reader, rtl::Reference< Node > const & property)
{ {
Span attrSeparator; xmlreader::Span attrSeparator;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
{ {
attrSeparator = reader.getAttributeValue(false); attrSeparator = reader.getAttributeValue(false);
@ -553,22 +552,22 @@ void XcsParser::handlePropValue(
valueParser_.start(property); valueParser_.start(property);
} }
void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) { void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) {
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
bool extensible = false; bool extensible = false;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible")))
{ {
extensible = xmldata::parseBoolean(reader.getAttributeValue(true)); extensible = xmldata::parseBoolean(reader.getAttributeValue(true));
@ -592,34 +591,32 @@ void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
name)); name));
} }
void XcsParser::handleSet(XmlReader & reader, bool isTemplate) { void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) {
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
rtl::OUString component(componentName_); rtl::OUString component(componentName_);
bool hasNodeType = false; bool hasNodeType = false;
rtl::OUString nodeType; rtl::OUString nodeType;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{ {
component = xmldata::convertFromUtf8( component = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false)); } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{ {
hasNodeType = true; hasNodeType = true;
nodeType = xmldata::convertFromUtf8( nodeType = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false));
} }
} }
if (!hasName) { if (!hasName) {
@ -642,27 +639,25 @@ void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
name)); name));
} }
void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) { void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) {
rtl::OUString component(componentName_); rtl::OUString component(componentName_);
bool hasNodeType = false; bool hasNodeType = false;
rtl::OUString nodeType; rtl::OUString nodeType;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{ {
component = xmldata::convertFromUtf8( component = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false)); } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{ {
hasNodeType = true; hasNodeType = true;
nodeType = xmldata::convertFromUtf8( nodeType = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false));
} }
} }
set->getAdditionalTemplateNames().push_back( set->getAdditionalTemplateNames().push_back(

View File

@ -34,17 +34,18 @@
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/xmlreader.hxx"
#include "node.hxx" #include "node.hxx"
#include "parser.hxx" #include "parser.hxx"
#include "valueparser.hxx" #include "valueparser.hxx"
#include "xmlreader.hxx"
namespace xmlreader { struct Span; }
namespace configmgr { namespace configmgr {
class SetNode; class SetNode;
struct Data; struct Data;
struct Span;
class XcsParser: public Parser { class XcsParser: public Parser {
public: public:
@ -53,29 +54,29 @@ public:
private: private:
virtual ~XcsParser(); virtual ~XcsParser();
virtual XmlReader::Text getTextMode(); virtual xmlreader::XmlReader::Text getTextMode();
virtual bool startElement( virtual bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name); xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
virtual void endElement(XmlReader const & reader); virtual void endElement(xmlreader::XmlReader const & reader);
virtual void characters(Span const & text); virtual void characters(xmlreader::Span const & text);
void handleComponentSchema(XmlReader & reader); void handleComponentSchema(xmlreader::XmlReader & reader);
void handleNodeRef(XmlReader & reader); void handleNodeRef(xmlreader::XmlReader & reader);
void handleProp(XmlReader & reader); void handleProp(xmlreader::XmlReader & reader);
void handlePropValue( void handlePropValue(
XmlReader & reader, rtl::Reference< Node > const & property); xmlreader::XmlReader & reader, rtl::Reference< Node > const & property);
void handleGroup(XmlReader & reader, bool isTemplate); void handleGroup(xmlreader::XmlReader & reader, bool isTemplate);
void handleSet(XmlReader & reader, bool isTemplate); void handleSet(xmlreader::XmlReader & reader, bool isTemplate);
void handleSetItem(XmlReader & reader, SetNode * set); void handleSetItem(xmlreader::XmlReader & reader, SetNode * set);
enum State { enum State {
STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES, STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES,

View File

@ -41,6 +41,8 @@
#include "rtl/string.hxx" #include "rtl/string.hxx"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/span.hxx"
#include "xmlreader/xmlreader.hxx"
#include "data.hxx" #include "data.hxx"
#include "localizedpropertynode.hxx" #include "localizedpropertynode.hxx"
@ -49,14 +51,13 @@
#include "modifications.hxx" #include "modifications.hxx"
#include "node.hxx" #include "node.hxx"
#include "nodemap.hxx" #include "nodemap.hxx"
#include "parsemanager.hxx"
#include "partial.hxx" #include "partial.hxx"
#include "path.hxx" #include "path.hxx"
#include "propertynode.hxx" #include "propertynode.hxx"
#include "setnode.hxx" #include "setnode.hxx"
#include "span.hxx"
#include "xcuparser.hxx" #include "xcuparser.hxx"
#include "xmldata.hxx" #include "xmldata.hxx"
#include "xmlreader.hxx"
namespace configmgr { namespace configmgr {
@ -79,22 +80,22 @@ XcuParser::XcuParser(
XcuParser::~XcuParser() {} XcuParser::~XcuParser() {}
XmlReader::Text XcuParser::getTextMode() { xmlreader::XmlReader::Text XcuParser::getTextMode() {
return valueParser_.getTextMode(); return valueParser_.getTextMode();
} }
bool XcuParser::startElement( bool XcuParser::startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name) xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
{ {
if (valueParser_.startElement(reader, ns, name)) { if (valueParser_.startElement(reader, nsId, name)) {
return true; return true;
} }
if (state_.empty()) { if (state_.empty()) {
if (ns == XmlReader::NAMESPACE_OOR && if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
{ {
handleComponentData(reader); handleComponentData(reader);
} else if (ns == XmlReader::NAMESPACE_OOR && } else if (nsId == ParseManager::NAMESPACE_OOR &&
name.equals(RTL_CONSTASCII_STRINGPARAM("items"))) name.equals(RTL_CONSTASCII_STRINGPARAM("items")))
{ {
state_.push(State(rtl::Reference< Node >(), false)); state_.push(State(rtl::Reference< Node >(), false));
@ -102,7 +103,7 @@ bool XcuParser::startElement(
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bad root element <")) + RTL_CONSTASCII_USTRINGPARAM("bad root element <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
@ -110,7 +111,7 @@ bool XcuParser::startElement(
} else if (state_.top().ignore) { } else if (state_.top().ignore) {
state_.push(State(false)); state_.push(State(false));
} else if (!state_.top().node.is()) { } else if (!state_.top().node.is()) {
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("item"))) name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
{ {
handleItem(reader); handleItem(reader);
@ -118,7 +119,7 @@ bool XcuParser::startElement(
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) + RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
@ -126,7 +127,7 @@ bool XcuParser::startElement(
} else { } else {
switch (state_.top().node->kind()) { switch (state_.top().node->kind()) {
case Node::KIND_PROPERTY: case Node::KIND_PROPERTY:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
{ {
handlePropValue( handlePropValue(
@ -137,14 +138,14 @@ bool XcuParser::startElement(
(rtl::OUString( (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( RTL_CONSTASCII_USTRINGPARAM(
"bad property node member <")) + "bad property node member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
break; break;
case Node::KIND_LOCALIZED_PROPERTY: case Node::KIND_LOCALIZED_PROPERTY:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
{ {
handleLocpropValue( handleLocpropValue(
@ -156,7 +157,7 @@ bool XcuParser::startElement(
(rtl::OUString( (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( RTL_CONSTASCII_USTRINGPARAM(
"bad localized property node member <")) + "bad localized property node member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
@ -165,18 +166,18 @@ bool XcuParser::startElement(
case Node::KIND_LOCALIZED_VALUE: case Node::KIND_LOCALIZED_VALUE:
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
case Node::KIND_GROUP: case Node::KIND_GROUP:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
{ {
handleGroupProp( handleGroupProp(
reader, reader,
dynamic_cast< GroupNode * >(state_.top().node.get())); dynamic_cast< GroupNode * >(state_.top().node.get()));
} else if (ns == XmlReader::NAMESPACE_NONE && } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("node"))) name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
{ {
handleGroupNode(reader, state_.top().node); handleGroupNode(reader, state_.top().node);
@ -185,19 +186,19 @@ bool XcuParser::startElement(
(rtl::OUString( (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( RTL_CONSTASCII_USTRINGPARAM(
"bad group node member <")) + "bad group node member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
break; break;
case Node::KIND_SET: case Node::KIND_SET:
if (ns == XmlReader::NAMESPACE_NONE && if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("node"))) name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
{ {
handleSetNode( handleSetNode(
reader, dynamic_cast< SetNode * >(state_.top().node.get())); reader, dynamic_cast< SetNode * >(state_.top().node.get()));
} else if (ns == XmlReader::NAMESPACE_NONE && } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
{ {
OSL_TRACE( OSL_TRACE(
@ -209,7 +210,7 @@ bool XcuParser::startElement(
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) + RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) +
xmldata::convertFromUtf8(name) + name.convertFromUtf8() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
@ -220,7 +221,7 @@ bool XcuParser::startElement(
return true; return true;
} }
void XcuParser::endElement(XmlReader const &) { void XcuParser::endElement(xmlreader::XmlReader const &) {
if (valueParser_.endElement()) { if (valueParser_.endElement()) {
return; return;
} }
@ -245,11 +246,11 @@ void XcuParser::endElement(XmlReader const &) {
} }
} }
void XcuParser::characters(Span const & text) { void XcuParser::characters(xmlreader::Span const & text) {
valueParser_.characters(text); valueParser_.characters(text);
} }
XcuParser::Operation XcuParser::parseOperation(Span const & text) { XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) {
OSL_ASSERT(text.is()); OSL_ASSERT(text.is());
if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) { if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) {
return OPERATION_MODIFY; return OPERATION_MODIFY;
@ -265,11 +266,11 @@ XcuParser::Operation XcuParser::parseOperation(Span const & text) {
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) +
xmldata::convertFromUtf8(text)), text.convertFromUtf8()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
void XcuParser::handleComponentData(XmlReader & reader) { void XcuParser::handleComponentData(xmlreader::XmlReader & reader) {
rtl::OStringBuffer buf; rtl::OStringBuffer buf;
buf.append('.'); buf.append('.');
bool hasPackage = false; bool hasPackage = false;
@ -277,12 +278,12 @@ void XcuParser::handleComponentData(XmlReader & reader) {
Operation op = OPERATION_MODIFY; Operation op = OPERATION_MODIFY;
bool finalized = false; bool finalized = false;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
{ {
if (hasPackage) { if (hasPackage) {
@ -295,9 +296,9 @@ void XcuParser::handleComponentData(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
hasPackage = true; hasPackage = true;
Span s(reader.getAttributeValue(false)); xmlreader::Span s(reader.getAttributeValue(false));
buf.insert(0, s.begin, s.length); buf.insert(0, s.begin, s.length);
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
if (hasName) { if (hasName) {
@ -309,13 +310,13 @@ void XcuParser::handleComponentData(XmlReader & reader) {
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
hasName = true; hasName = true;
Span s(reader.getAttributeValue(false)); xmlreader::Span s(reader.getAttributeValue(false));
buf.append(s.begin, s.length); buf.append(s.begin, s.length);
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{ {
op = parseOperation(reader.getAttributeValue(true)); op = parseOperation(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{ {
finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
@ -337,8 +338,8 @@ void XcuParser::handleComponentData(XmlReader & reader) {
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
componentName_ = xmldata::convertFromUtf8( componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
Span(buf.getStr(), buf.getLength())); convertFromUtf8();
if (trackPath_) { if (trackPath_) {
OSL_ASSERT(path_.empty()); OSL_ASSERT(path_.empty());
path_.push_back(componentName_); path_.push_back(componentName_);
@ -380,15 +381,15 @@ void XcuParser::handleComponentData(XmlReader & reader) {
state_.push(State(node, finalizedLayer < valueParser_.getLayer())); state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
} }
void XcuParser::handleItem(XmlReader & reader) { void XcuParser::handleItem(xmlreader::XmlReader & reader) {
Span attrPath; xmlreader::Span attrPath;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path")))
{ {
attrPath = reader.getAttributeValue(false); attrPath = reader.getAttributeValue(false);
@ -401,7 +402,7 @@ void XcuParser::handleItem(XmlReader & reader) {
reader.getUrl()), reader.getUrl()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
rtl::OUString path(xmldata::convertFromUtf8(attrPath)); rtl::OUString path(attrPath.convertFromUtf8());
int finalizedLayer; int finalizedLayer;
rtl::Reference< Node > node( rtl::Reference< Node > node(
data_.resolvePathRepresentation( data_.resolvePathRepresentation(
@ -446,21 +447,23 @@ void XcuParser::handleItem(XmlReader & reader) {
state_.push(State(node, finalizedLayer < valueParser_.getLayer())); state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
} }
void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { void XcuParser::handlePropValue(
xmlreader::XmlReader & reader, PropertyNode * prop)
{
bool nil = false; bool nil = false;
rtl::OString separator; rtl::OString separator;
rtl::OUString external; rtl::OUString external;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_XSI && if (attrNsId == ParseManager::NAMESPACE_XSI &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
{ {
nil = xmldata::parseBoolean(reader.getAttributeValue(true)); nil = xmldata::parseBoolean(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{ {
Type type = xmldata::parseType( Type type = xmldata::parseType(
@ -473,10 +476,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
valueParser_.type_ = type; valueParser_.type_ = type;
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
{ {
Span s(reader.getAttributeValue(false)); xmlreader::Span s(reader.getAttributeValue(false));
if (s.length == 0) { if (s.length == 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
@ -486,10 +489,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
separator = rtl::OString(s.begin, s.length); separator = rtl::OString(s.begin, s.length);
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external")))
{ {
external = xmldata::convertFromUtf8(reader.getAttributeValue(true)); external = reader.getAttributeValue(true).convertFromUtf8();
if (external.getLength() == 0) { if (external.getLength() == 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
@ -529,27 +532,27 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
} }
void XcuParser::handleLocpropValue( void XcuParser::handleLocpropValue(
XmlReader & reader, LocalizedPropertyNode * locprop) xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop)
{ {
rtl::OUString name; rtl::OUString name;
bool nil = false; bool nil = false;
rtl::OString separator; rtl::OString separator;
Operation op = OPERATION_FUSE; Operation op = OPERATION_FUSE;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_XML && if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang")))
{ {
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_XSI && } else if (attrNsId == ParseManager::NAMESPACE_XSI &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
{ {
nil = xmldata::parseBoolean(reader.getAttributeValue(true)); nil = xmldata::parseBoolean(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{ {
Type type = xmldata::parseType( Type type = xmldata::parseType(
@ -562,10 +565,10 @@ void XcuParser::handleLocpropValue(
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
valueParser_.type_ = type; valueParser_.type_ = type;
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
{ {
Span s(reader.getAttributeValue(false)); xmlreader::Span s(reader.getAttributeValue(false));
if (s.length == 0) { if (s.length == 0) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString( (rtl::OUString(
@ -575,7 +578,7 @@ void XcuParser::handleLocpropValue(
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
separator = rtl::OString(s.begin, s.length); separator = rtl::OString(s.begin, s.length);
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{ {
op = parseOperation(reader.getAttributeValue(true)); op = parseOperation(reader.getAttributeValue(true));
@ -651,32 +654,34 @@ void XcuParser::handleLocpropValue(
} }
} }
void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) { void XcuParser::handleGroupProp(
xmlreader::XmlReader & reader, GroupNode * group)
{
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
Type type = TYPE_ERROR; Type type = TYPE_ERROR;
Operation op = OPERATION_MODIFY; Operation op = OPERATION_MODIFY;
bool finalized = false; bool finalized = false;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
{ {
type = xmldata::parseType(reader, reader.getAttributeValue(true)); type = xmldata::parseType(reader, reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{ {
op = parseOperation(reader.getAttributeValue(true)); op = parseOperation(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{ {
finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
@ -726,8 +731,8 @@ void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
} }
void XcuParser::handleUnknownGroupProp( void XcuParser::handleUnknownGroupProp(
XmlReader const & reader, GroupNode * group, rtl::OUString const & name, xmlreader::XmlReader const & reader, GroupNode * group,
Type type, Operation operation, bool finalized) rtl::OUString const & name, Type type, Operation operation, bool finalized)
{ {
switch (operation) { switch (operation) {
case OPERATION_REPLACE: case OPERATION_REPLACE:
@ -767,7 +772,7 @@ void XcuParser::handleUnknownGroupProp(
} }
void XcuParser::handlePlainGroupProp( void XcuParser::handlePlainGroupProp(
XmlReader const & reader, GroupNode * group, xmlreader::XmlReader const & reader, GroupNode * group,
NodeMap::iterator const & propertyIndex, rtl::OUString const & name, NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
Type type, Operation operation, bool finalized) Type type, Operation operation, bool finalized)
{ {
@ -821,7 +826,7 @@ void XcuParser::handlePlainGroupProp(
} }
void XcuParser::handleLocalizedGroupProp( void XcuParser::handleLocalizedGroupProp(
XmlReader const & reader, LocalizedPropertyNode * property, xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
rtl::OUString const & name, Type type, Operation operation, bool finalized) rtl::OUString const & name, Type type, Operation operation, bool finalized)
{ {
if (property->getLayer() > valueParser_.getLayer()) { if (property->getLayer() > valueParser_.getLayer()) {
@ -879,28 +884,28 @@ void XcuParser::handleLocalizedGroupProp(
} }
void XcuParser::handleGroupNode( void XcuParser::handleGroupNode(
XmlReader & reader, rtl::Reference< Node > const & group) xmlreader::XmlReader & reader, rtl::Reference< Node > const & group)
{ {
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
Operation op = OPERATION_MODIFY; Operation op = OPERATION_MODIFY;
bool finalized = false; bool finalized = false;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{ {
op = parseOperation(reader.getAttributeValue(true)); op = parseOperation(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{ {
finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
@ -950,7 +955,7 @@ void XcuParser::handleGroupNode(
state_.top().locked || finalizedLayer < valueParser_.getLayer())); state_.top().locked || finalizedLayer < valueParser_.getLayer()));
} }
void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) {
bool hasName = false; bool hasName = false;
rtl::OUString name; rtl::OUString name;
rtl::OUString component(componentName_); rtl::OUString component(componentName_);
@ -960,36 +965,34 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
bool finalized = false; bool finalized = false;
bool mandatory = false; bool mandatory = false;
for (;;) { for (;;) {
XmlReader::Namespace attrNs; int attrNsId;
Span attrLn; xmlreader::Span attrLn;
if (!reader.nextAttribute(&attrNs, &attrLn)) { if (!reader.nextAttribute(&attrNsId, &attrLn)) {
break; break;
} }
if (attrNs == XmlReader::NAMESPACE_OOR && if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
{ {
hasName = true; hasName = true;
name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); name = reader.getAttributeValue(false).convertFromUtf8();
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
{ {
component = xmldata::convertFromUtf8( component = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false)); } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
{ {
hasNodeType = true; hasNodeType = true;
nodeType = xmldata::convertFromUtf8( nodeType = reader.getAttributeValue(false).convertFromUtf8();
reader.getAttributeValue(false)); } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
{ {
op = parseOperation(reader.getAttributeValue(true)); op = parseOperation(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
{ {
finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
} else if (attrNs == XmlReader::NAMESPACE_OOR && } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory"))) attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory")))
{ {
mandatory = xmldata::parseBoolean(reader.getAttributeValue(true)); mandatory = xmldata::parseBoolean(reader.getAttributeValue(true));

View File

@ -34,6 +34,7 @@
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "xmlreader/xmlreader.hxx"
#include "additions.hxx" #include "additions.hxx"
#include "node.hxx" #include "node.hxx"
@ -43,7 +44,8 @@
#include "type.hxx" #include "type.hxx"
#include "valueparser.hxx" #include "valueparser.hxx"
#include "xmldata.hxx" #include "xmldata.hxx"
#include "xmlreader.hxx"
namespace xmlreader { struct Span; }
namespace configmgr { namespace configmgr {
@ -54,7 +56,6 @@ class Partial;
class PropertyNode; class PropertyNode;
class SetNode; class SetNode;
struct Data; struct Data;
struct Span;
class XcuParser: public Parser { class XcuParser: public Parser {
public: public:
@ -65,49 +66,50 @@ public:
private: private:
virtual ~XcuParser(); virtual ~XcuParser();
virtual XmlReader::Text getTextMode(); virtual xmlreader::XmlReader::Text getTextMode();
virtual bool startElement( virtual bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name); xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
virtual void endElement(XmlReader const & reader); virtual void endElement(xmlreader::XmlReader const & reader);
virtual void characters(Span const & span); virtual void characters(xmlreader::Span const & span);
enum Operation { enum Operation {
OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE }; OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE };
static Operation parseOperation(Span const & text); static Operation parseOperation(xmlreader::Span const & text);
void handleComponentData(XmlReader & reader); void handleComponentData(xmlreader::XmlReader & reader);
void handleItem(XmlReader & reader); void handleItem(xmlreader::XmlReader & reader);
void handlePropValue(XmlReader & reader, PropertyNode * prop); void handlePropValue(xmlreader::XmlReader & reader, PropertyNode * prop);
void handleLocpropValue( void handleLocpropValue(
XmlReader & reader, LocalizedPropertyNode * locprop); xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop);
void handleGroupProp(XmlReader & reader, GroupNode * group); void handleGroupProp(xmlreader::XmlReader & reader, GroupNode * group);
void handleUnknownGroupProp( void handleUnknownGroupProp(
XmlReader const & reader, GroupNode * group, rtl::OUString const & name, xmlreader::XmlReader const & reader, GroupNode * group,
Type type, Operation operation, bool finalized); rtl::OUString const & name, Type type, Operation operation,
bool finalized);
void handlePlainGroupProp( void handlePlainGroupProp(
XmlReader const & reader, GroupNode * group, xmlreader::XmlReader const & reader, GroupNode * group,
NodeMap::iterator const & propertyIndex, rtl::OUString const & name, NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
Type type, Operation operation, bool finalized); Type type, Operation operation, bool finalized);
void handleLocalizedGroupProp( void handleLocalizedGroupProp(
XmlReader const & reader, LocalizedPropertyNode * property, xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
rtl::OUString const & name, Type type, Operation operation, rtl::OUString const & name, Type type, Operation operation,
bool finalized); bool finalized);
void handleGroupNode( void handleGroupNode(
XmlReader & reader, rtl::Reference< Node > const & group); xmlreader::XmlReader & reader, rtl::Reference< Node > const & group);
void handleSetNode(XmlReader & reader, SetNode * set); void handleSetNode(xmlreader::XmlReader & reader, SetNode * set);
void recordModification(bool addition); void recordModification(bool addition);

View File

@ -40,12 +40,12 @@
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "rtl/strbuf.hxx" #include "rtl/strbuf.hxx"
#include "rtl/string.h" #include "rtl/string.h"
#include "rtl/textcvt.h"
#include "rtl/textenc.h"
#include "rtl/ustrbuf.hxx" #include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "xmlreader/span.hxx"
#include "xmlreader/xmlreader.hxx"
#include "data.hxx" #include "data.hxx"
#include "groupnode.hxx" #include "groupnode.hxx"
@ -57,9 +57,7 @@
#include "parser.hxx" #include "parser.hxx"
#include "propertynode.hxx" #include "propertynode.hxx"
#include "setnode.hxx" #include "setnode.hxx"
#include "span.hxx"
#include "type.hxx" #include "type.hxx"
#include "xmlreader.hxx"
namespace configmgr { namespace configmgr {
@ -71,90 +69,88 @@ namespace css = com::sun::star;
} }
rtl::OUString convertFromUtf8(Span const & text) { Type parseType(
OSL_ASSERT(text.is()); xmlreader::XmlReader const & reader, xmlreader::Span const & text)
rtl_uString * s = 0; {
if (!rtl_convertStringToUString(
&s, text.begin, text.length, RTL_TEXTENCODING_UTF8,
(RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
{
throw css::uno::RuntimeException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("cannot convert from UTF-8")),
css::uno::Reference< css::uno::XInterface >());
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
}
Type parseType(XmlReader const & reader, Span const & text) {
OSL_ASSERT(text.is()); OSL_ASSERT(text.is());
sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':'); sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':');
if (i >= 0) { if (i >= 0) {
switch (reader.getNamespace(Span(text.begin, i))) { switch (reader.getNamespaceId(xmlreader::Span(text.begin, i))) {
case XmlReader::NAMESPACE_OOR: case ParseManager::NAMESPACE_OOR:
if (Span(text.begin + i + 1, text.length - (i + 1)).equals( if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)).
RTL_CONSTASCII_STRINGPARAM("any"))) equals(RTL_CONSTASCII_STRINGPARAM("any")))
{ {
return TYPE_ANY; return TYPE_ANY;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("boolean-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("boolean-list")))
{ {
return TYPE_BOOLEAN_LIST; return TYPE_BOOLEAN_LIST;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("short-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("short-list")))
{ {
return TYPE_SHORT_LIST; return TYPE_SHORT_LIST;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("int-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("int-list")))
{ {
return TYPE_INT_LIST; return TYPE_INT_LIST;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("long-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("long-list")))
{ {
return TYPE_LONG_LIST; return TYPE_LONG_LIST;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("double-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("double-list")))
{ {
return TYPE_DOUBLE_LIST; return TYPE_DOUBLE_LIST;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("string-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("string-list")))
{ {
return TYPE_STRING_LIST; return TYPE_STRING_LIST;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("hexBinary-list"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
{ {
return TYPE_HEXBINARY_LIST; return TYPE_HEXBINARY_LIST;
} }
break; break;
case XmlReader::NAMESPACE_XS: case ParseManager::NAMESPACE_XS:
if (Span(text.begin + i + 1, text.length - (i + 1)).equals( if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)).
RTL_CONSTASCII_STRINGPARAM("boolean"))) equals(RTL_CONSTASCII_STRINGPARAM("boolean")))
{ {
return TYPE_BOOLEAN; return TYPE_BOOLEAN;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("short"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("short")))
{ {
return TYPE_SHORT; return TYPE_SHORT;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("int"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("int")))
{ {
return TYPE_INT; return TYPE_INT;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("long"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("long")))
{ {
return TYPE_LONG; return TYPE_LONG;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("double"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("double")))
{ {
return TYPE_DOUBLE; return TYPE_DOUBLE;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("string"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("string")))
{ {
return TYPE_STRING; return TYPE_STRING;
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( } else if (xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM("hexBinary"))) text.begin + i + 1, text.length - (i + 1)).
equals(RTL_CONSTASCII_STRINGPARAM("hexBinary")))
{ {
return TYPE_HEXBINARY; return TYPE_HEXBINARY;
} }
@ -165,11 +161,11 @@ Type parseType(XmlReader const & reader, Span const & text) {
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) +
convertFromUtf8(text)), text.convertFromUtf8()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }
bool parseBoolean(Span const & text) { bool parseBoolean(xmlreader::Span const & text) {
OSL_ASSERT(text.is()); OSL_ASSERT(text.is());
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) { if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
return true; return true;
@ -179,7 +175,7 @@ bool parseBoolean(Span const & text) {
} }
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) +
convertFromUtf8(text)), text.convertFromUtf8()),
css::uno::Reference< css::uno::XInterface >()); css::uno::Reference< css::uno::XInterface >());
} }

View File

@ -33,19 +33,19 @@
#include "type.hxx" #include "type.hxx"
namespace rtl { class OUString; } namespace rtl { class OUString; }
namespace xmlreader {
class XmlReader;
struct Span;
}
namespace configmgr { namespace configmgr {
class XmlReader;
struct Span;
namespace xmldata { namespace xmldata {
rtl::OUString convertFromUtf8(Span const & text); Type parseType(
xmlreader::XmlReader const & reader, xmlreader::Span const & text);
Type parseType(XmlReader const & reader, Span const & text); bool parseBoolean(xmlreader::Span const & text);
bool parseBoolean(Span const & text);
rtl::OUString parseTemplateReference( rtl::OUString parseTemplateReference(
rtl::OUString const & component, bool hasNodeType, rtl::OUString const & component, bool hasNodeType,

File diff suppressed because it is too large Load Diff

View File

@ -1,186 +0,0 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
#define INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
#include "sal/config.h"
#include <stack>
#include <vector>
#include "boost/noncopyable.hpp"
#include "com/sun/star/container/NoSuchElementException.hpp"
#include "com/sun/star/uno/RuntimeException.hpp"
#include "osl/file.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "pad.hxx"
#include "span.hxx"
namespace configmgr {
class XmlReader: private boost::noncopyable {
public:
explicit XmlReader(rtl::OUString const & fileUrl)
SAL_THROW((
com::sun::star::container::NoSuchElementException,
com::sun::star::uno::RuntimeException));
~XmlReader();
enum Namespace {
NAMESPACE_NONE, NAMESPACE_XML, NAMESPACE_OOR, NAMESPACE_XS,
NAMESPACE_XSI, NAMESPACE_OTHER };
enum Text { TEXT_NONE, TEXT_RAW, TEXT_NORMALIZED };
enum Result { RESULT_BEGIN, RESULT_END, RESULT_TEXT, RESULT_DONE };
// RESULT_BEGIN: data = localName, ns = ns
// RESULT_END: data, ns unused
// RESULT_TEXT: data = text, ns unused
Result nextItem(Text reportText, Span * data, Namespace * ns);
bool nextAttribute(Namespace * ns, Span * localName);
// the span returned by getAttributeValue is only valid until the next call
// to nextItem or getAttributeValue
Span getAttributeValue(bool fullyNormalize);
Namespace getNamespace(Span const & prefix) const;
rtl::OUString getUrl() const;
private:
inline char read() { return pos_ == end_ ? '\0' : *pos_++; }
inline char peek() { return pos_ == end_ ? '\0' : *pos_; }
void normalizeLineEnds(Span const & text);
void skipSpace();
bool skipComment();
void skipProcessingInstruction();
void skipDocumentTypeDeclaration();
Span scanCdataSection();
bool scanName(char const ** nameColon);
Namespace scanNamespaceIri(char const * begin, char const * end);
char const * handleReference(char const * position, char const * end);
Span handleAttributeValue(
char const * begin, char const * end, bool fullyNormalize);
Result handleStartTag(Namespace * ns, Span * localName);
Result handleEndTag();
void handleElementEnd();
Result handleSkippedText(Span * data, Namespace * ns);
Result handleRawText(Span * text);
Result handleNormalizedText(Span * text);
struct NamespaceData {
Span prefix;
Namespace ns;
NamespaceData() {}
NamespaceData(Span const & thePrefix, Namespace theNs):
prefix(thePrefix), ns(theNs) {}
};
typedef std::vector< NamespaceData > NamespaceList;
struct ElementData {
Span name;
NamespaceList::size_type inheritedNamespaces;
Namespace defaultNamespace;
ElementData(
Span const & theName,
NamespaceList::size_type theInheritedNamespaces,
Namespace theDefaultNamespace):
name(theName), inheritedNamespaces(theInheritedNamespaces),
defaultNamespace(theDefaultNamespace)
{}
};
typedef std::stack< ElementData > ElementStack;
struct AttributeData {
char const * nameBegin;
char const * nameEnd;
char const * nameColon;
char const * valueBegin;
char const * valueEnd;
AttributeData(
char const * theNameBegin, char const * theNameEnd,
char const * theNameColon, char const * theValueBegin,
char const * theValueEnd):
nameBegin(theNameBegin), nameEnd(theNameEnd),
nameColon(theNameColon), valueBegin(theValueBegin),
valueEnd(theValueEnd)
{}
};
typedef std::vector< AttributeData > Attributes;
enum State {
STATE_CONTENT, STATE_START_TAG, STATE_END_TAG, STATE_EMPTY_ELEMENT_TAG,
STATE_DONE };
rtl::OUString fileUrl_;
oslFileHandle fileHandle_;
sal_uInt64 fileSize_;
void * fileAddress_;
NamespaceList namespaces_;
ElementStack elements_;
char const * pos_;
char const * end_;
State state_;
Attributes attributes_;
Attributes::iterator currentAttribute_;
bool firstAttribute_;
Pad pad_;
};
}
#endif

View File

@ -31,3 +31,20 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\DataAccess
..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu ..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip ..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip ..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
..\%__SRC%\misc\adabas.component %_DEST%\xml%_EXT%\adabas.component
..\%__SRC%\misc\ado.component %_DEST%\xml%_EXT%\ado.component
..\%__SRC%\misc\calc.component %_DEST%\xml%_EXT%\calc.component
..\%__SRC%\misc\dbase.component %_DEST%\xml%_EXT%\dbase.component
..\%__SRC%\misc\dbpool2.component %_DEST%\xml%_EXT%\dbpool2.component
..\%__SRC%\misc\dbtools.component %_DEST%\xml%_EXT%\dbtools.component
..\%__SRC%\misc\evoab.component %_DEST%\xml%_EXT%\evoab.component
..\%__SRC%\misc\flat.component %_DEST%\xml%_EXT%\flat.component
..\%__SRC%\misc\hsqldb.component %_DEST%\xml%_EXT%\hsqldb.component
..\%__SRC%\misc\jdbc.component %_DEST%\xml%_EXT%\jdbc.component
..\%__SRC%\misc\kab1.component %_DEST%\xml%_EXT%\kab1.component
..\%__SRC%\misc\macab1.component %_DEST%\xml%_EXT%\macab1.component
..\%__SRC%\misc\mozab.component %_DEST%\xml%_EXT%\mozab.component
..\%__SRC%\misc\mozbootstrap.component %_DEST%\xml%_EXT%\mozbootstrap.component
..\%__SRC%\misc\mysql.component %_DEST%\xml%_EXT%\mysql.component
..\%__SRC%\misc\odbc.component %_DEST%\xml%_EXT%\odbc.component
..\%__SRC%\misc\sdbc2.component %_DEST%\xml%_EXT%\sdbc2.component

View File

@ -899,11 +899,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const
*_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* serviceManager, com::sun::star::registry::XRegistryKey* registryKey)
{
return cppu::component_writeInfoHelper(serviceManager, registryKey, entries);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey) SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey)
{ {

View File

@ -49,35 +49,6 @@ extern "C"
*_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey)
{
::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/");
sMainKeyName += OPoolCollection::getImplementationName_Static();
sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES");
try
{
Reference< XRegistryKey > xMainKey = _pRegistryKey->createKey(sMainKeyName);
if (!xMainKey.is())
return sal_False;
Sequence< ::rtl::OUString > sServices = OPoolCollection::getSupportedServiceNames_Static();
const ::rtl::OUString* pServices = sServices.getConstArray();
for (sal_Int32 i=0; i<sServices.getLength(); ++i, ++pServices)
xMainKey->createKey(*pServices);
}
catch(InvalidRegistryException&)
{
return sal_False;
}
catch(InvalidValueException&)
{
return sal_False;
}
return sal_True;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/) void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
{ {

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.sdbc.OConnectionPool">
<service name="com.sun.star.sdbc.ConnectionPool"/>
</implementation>
</component>

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -78,4 +78,10 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : target.mk .INCLUDE : target.mk
ALLTAR : $(MISC)/dbpool2.component
$(MISC)/dbpool2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
dbpool2.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt dbpool2.component

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="org.openoffice.comp.helper.DatabaseMetaDataResultSet">
<service name="com.sun.star.sdbc.ResultSet"/>
</implementation>
<implementation name="org.openoffice.comp.helper.ParameterSubstitution">
<service name="com.sun.star.sdb.ParameterSubstitution"/>
</implementation>
</component>

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -95,3 +95,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
@echo _TI >$@ @echo _TI >$@
@echo _real >>$@ @echo _real >>$@
ALLTAR : $(MISC)/dbtools.component
$(MISC)/dbtools.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
dbtools.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt dbtools.component

View File

@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx" #include "precompiled_connectivity.hxx"
#include "adabas/BDriver.hxx" #include "adabas/BDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::adabas; using namespace connectivity::adabas;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
ODriver::getImplementationName_Static(),
ODriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -1,4 +1,5 @@
/************************************************************************* <?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
* *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -23,37 +24,12 @@
* <http://www.openoffice.org/license.html> * <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
* *
************************************************************************/ **********************************************************************-->
#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX <component loader="com.sun.star.loader.SharedLibrary"
#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbcx.adabas.ODriver">
#include "sal/config.h" <service name="com.sun.star.sdbc.Driver"/>
<service name="com.sun.star.sdbcx.Driver"/>
#include "rtl/strbuf.hxx" </implementation>
#include "sal/types.h" </component>
#include "span.hxx"
namespace configmgr {
class Pad {
public:
void add(char const * begin, sal_Int32 length);
void addEphemeral(char const * begin, sal_Int32 length);
void clear();
Span get() const;
private:
void flushSpan();
Span span_;
rtl::OStringBuffer buffer_;
};
}
#endif

View File

@ -1,5 +1,4 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory
__mh_dylib_header __mh_dylib_header
___builtin_delete ___builtin_delete

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -104,3 +104,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/adabas.component
$(MISC)/adabas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
adabas.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt adabas.component

View File

@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx" #include "precompiled_connectivity.hxx"
#include "ado/ADriver.hxx" #include "ado/ADriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::ado; using namespace connectivity::ado;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "ADO::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -121,31 +94,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine"; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine";
} }
//---------------------------------------------------------------------------------------
extern "C" sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
ODriver::getImplementationName_Static(),
ODriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "ADO::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" void* SAL_CALL component_getFactory( extern "C" void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.ado.ODriver">
<service name="com.sun.star.sdbc.Driver"/>
<service name="com.sun.star.sdbcx.Driver"/>
</implementation>
</component>

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -112,3 +112,11 @@ dummy:
# --- Targets ---------------------------------- # --- Targets ----------------------------------
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/ado.component
$(MISC)/ado.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
ado.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt ado.component

View File

@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx" #include "precompiled_connectivity.hxx"
#include "calc/CDriver.hxx" #include "calc/CDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::calc; using namespace connectivity::calc;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
ODriver::getImplementationName_Static(),
ODriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.calc.ODriver">
<service name="com.sun.star.sdbc.Driver"/>
<service name="com.sun.star.sdbcx.Driver"/>
</implementation>
</component>

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -94,3 +94,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/calc.component
$(MISC)/calc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
calc.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt calc.component

View File

@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx" #include "precompiled_connectivity.hxx"
#include "dbase/DDriver.hxx" #include "dbase/DDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::dbase; using namespace connectivity::dbase;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
ODriver::getImplementationName_Static(),
ODriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.dbase.ODriver">
<service name="com.sun.star.sdbc.Driver"/>
<service name="com.sun.star.sdbcx.Driver"/>
</implementation>
</component>

View File

@ -1,5 +1,4 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory
__mh_dylib_header __mh_dylib_header
___builtin_delete ___builtin_delete

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -127,3 +127,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/dbase.component
$(MISC)/dbase.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
dbase.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt dbase.component

View File

@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx" #include "precompiled_connectivity.hxx"
#include "LDriver.hxx" #include "LDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::evoab; using namespace connectivity::evoab;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
OEvoabDriver::getImplementationName_Static(),
OEvoabDriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -35,7 +35,6 @@ using namespace connectivity::evoab;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "EVOAB::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +96,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
OEvoabDriver::getImplementationName_Static(),
OEvoabDriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.evoab.OEvoabDriver">
<service name="com.sun.star.sdbc.Driver"/>
</implementation>
</component>

View File

@ -110,3 +110,11 @@ DEF1NAME= $(SHL1TARGET)
# --- Targets ---------------------------------- # --- Targets ----------------------------------
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/evoab.component
$(MISC)/evoab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
evoab.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt evoab.component

View File

@ -29,13 +29,11 @@
#include "precompiled_connectivity.hxx" #include "precompiled_connectivity.hxx"
#include "flat/EDriver.hxx" #include "flat/EDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::flat; using namespace connectivity::flat;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
ODriver::getImplementationName_Static(),
ODriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.flat.ODriver">
<service name="com.sun.star.sdbc.Driver"/>
<service name="com.sun.star.sdbcx.Driver"/>
</implementation>
</component>

View File

@ -1,5 +1,4 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory
__mh_dylib_header __mh_dylib_header
___builtin_delete ___builtin_delete

View File

@ -105,3 +105,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/flat.component
$(MISC)/flat.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
flat.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt flat.component

View File

@ -30,13 +30,11 @@
#include "hsqldb/HDriver.hxx" #include "hsqldb/HDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::hsqldb; using namespace connectivity::hsqldb;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pT rtl_ModuleCount* _pT
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -123,31 +96,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
ODriverDelegator::getImplementationName_Static(),
ODriverDelegator::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -1,5 +1,4 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.sdbcx.comp.hsqldb.Driver">
<service name="com.sun.star.sdbc.Driver"/>
<service name="com.sun.star.sdbcx.Driver"/>
</implementation>
</component>

View File

@ -1,7 +1,6 @@
UDK_3_0_0 { UDK_3_0_0 {
global: global:
component_getImplementationEnvironment; component_getImplementationEnvironment;
component_writeInfo;
component_getFactory; component_getFactory;
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream; Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream;
Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII; Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII;

View File

@ -115,3 +115,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/hsqldb.component
$(MISC)/hsqldb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
hsqldb.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt hsqldb.component

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.JDBCDriver">
<service name="com.sun.star.sdbc.Driver"/>
</implementation>
</component>

View File

@ -1,5 +1,4 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory
__mh_dylib_header __mh_dylib_header
___builtin_delete ___builtin_delete

View File

@ -34,7 +34,6 @@ using namespace connectivity;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -47,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pModCount rtl_ModuleCount* _pModCount
); );
//***************************************************************************************
//
// Die vorgeschriebene C-Api muss erfuellt werden!
// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "SBA::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -121,31 +95,6 @@ component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void* /*pServiceManager*/,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
java_sql_Driver::getImplementationName_Static(),
java_sql_Driver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "SBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -110,3 +110,11 @@ DEF1EXPORTFILE= exports.dxp
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/jdbc.component
$(MISC)/jdbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
jdbc.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt jdbc.component

View File

@ -30,13 +30,11 @@
#include "KDriver.hxx" #include "KDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::kab; using namespace connectivity::kab;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pTemp rtl_ModuleCount* _pTemp
); );
//***************************************************************************************
//
// The following C Api must be provided!
// It consists in three functions that must be exported by the module
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "KAB::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void*,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
KabDriver::getImplementationName_Static(),
KabDriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "KAB::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.SharedLibrary"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.kab.Driver">
<service name="com.sun.star.sdbc.Driver"/>
</implementation>
</component>

View File

@ -138,3 +138,11 @@ dummy:
.INCLUDE : $(PRJ)$/target.pmk .INCLUDE : $(PRJ)$/target.pmk
ALLTAR : $(MISC)/kab1.component
$(MISC)/kab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
kab1.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt kab1.component

View File

@ -30,13 +30,11 @@
#include "MacabDriver.hxx" #include "MacabDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h>
using namespace connectivity::macab; using namespace connectivity::macab;
using ::rtl::OUString; using ::rtl::OUString;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
using ::com::sun::star::registry::XRegistryKey;
using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XSingleServiceFactory;
using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory;
@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
rtl_ModuleCount* _pTemp rtl_ModuleCount* _pTemp
); );
//***************************************************************************************
//
// The following C Api must be provided!
// It consists in three functions that must be exported by the module
//
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
const OUString& aServiceImplName,
const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
aMainKeyName = OUString::createFromAscii("/");
aMainKeyName += aServiceImplName;
aMainKeyName += OUString::createFromAscii("/UNO/SERVICES");
Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) );
OSL_ENSURE(xNewKey.is(), "MACAB::component_writeInfo : could not create a registry key !");
for (sal_Int32 i=0; i<Services.getLength(); ++i)
xNewKey->createKey(Services[i]);
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
struct ProviderRequest struct ProviderRequest
{ {
@ -122,31 +95,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
} }
//---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void*,
void* pRegistryKey
)
{
if (pRegistryKey)
try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
MacabDriver::getImplementationName_Static(),
MacabDriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
catch (::com::sun::star::registry::InvalidRegistryException& )
{
OSL_ENSURE(sal_False, "MACAB::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
}
return sal_False;
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName, const sal_Char* pImplementationName,

View File

@ -1,3 +1,2 @@
component_getImplementationEnvironment component_getImplementationEnvironment
component_writeInfo
component_getFactory component_getFactory

Some files were not shown because too many files have changed in this diff Show More