CWS-TOOLING: integrate CWS sb129
This commit is contained in:
commit
0b5a8e1e0c
@ -16,3 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\avmedia
|
||||
..\inc\avmedia\mediatoolbox.hxx %_DEST%\inc%_EXT%\avmedia\mediatoolbox.hxx
|
||||
|
||||
..\%__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
|
||||
|
@ -497,44 +497,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
|
||||
*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 -
|
||||
// ------------------------
|
||||
|
34
avmedia/source/gstreamer/avmediagst.component
Normal file
34
avmedia/source/gstreamer/avmediagst.component
Normal 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>
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
|
||||
*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 -
|
||||
// ------------------------
|
||||
|
@ -69,3 +69,11 @@ DEF1EXPORTFILE=exports.dxp
|
||||
.ENDIF
|
||||
|
||||
.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
|
||||
|
@ -64,13 +64,4 @@ public class MediaUno
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
34
avmedia/source/java/avmedia.jar.component
Normal file
34
avmedia/source/java/avmedia.jar.component
Normal 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>
|
@ -59,3 +59,11 @@ CUSTOMMANIFESTFILE = manifest
|
||||
# --- Targets ------------------------------------------------------
|
||||
|
||||
.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
|
||||
|
34
avmedia/source/quicktime/avmediaQuickTime.component
Normal file
34
avmedia/source/quicktime/avmediaQuickTime.component
Normal 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>
|
@ -83,3 +83,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map
|
||||
dummy:
|
||||
@echo " Nothing to build for GUIBASE=$(GUIBASE)"
|
||||
.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
|
||||
|
@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
|
||||
*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 -
|
||||
// ------------------------
|
||||
|
34
avmedia/source/win/avmediawin.component
Normal file
34
avmedia/source/win/avmediawin.component
Normal 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>
|
@ -1,4 +1,3 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
||||
|
@ -80,3 +80,11 @@ SHL1STDLIBS += dxguid.lib
|
||||
.ENDIF
|
||||
|
||||
.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
|
||||
|
@ -48,33 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
|
||||
*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 -
|
||||
// ------------------------
|
||||
|
@ -1,4 +1,3 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
||||
|
@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
|
||||
*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 -
|
||||
// ------------------------
|
||||
|
34
avmedia/util/avmedia.component
Normal file
34
avmedia/util/avmedia.component
Normal 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>
|
@ -77,3 +77,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
|
||||
@echo LibMain>>$@
|
||||
@echo CT>>$@
|
||||
.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
|
||||
|
@ -57,3 +57,4 @@ mkdir: %_DEST%\inc%_EXT%\basic
|
||||
|
||||
..\inc\basic\basicmanagerrepository.hxx %_DEST%\inc%_EXT%\basic\basicmanagerrepository.hxx
|
||||
..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx
|
||||
..\%__SRC%\misc\sb.component %_DEST%\xml%_EXT%\sb.component
|
||||
|
@ -143,4 +143,10 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
|
||||
$(SRS)$/basic.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
|
||||
|
@ -1,4 +1,5 @@
|
||||
/*************************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--**********************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -23,42 +24,16 @@
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
**********************************************************************-->
|
||||
|
||||
#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
|
||||
#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
|
||||
|
||||
#include "sal/config.h"
|
||||
|
||||
#include "rtl/string.h"
|
||||
#include "sal/types.h"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
struct Span {
|
||||
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
|
||||
<component loader="com.sun.star.loader.SharedLibrary"
|
||||
xmlns="http://openoffice.org/2010/uno-components">
|
||||
<implementation name="com.sun.star.comp.sfx2.DialogLibraryContainer">
|
||||
<service name="com.sun.star.script.DialogLibraryContainer"/>
|
||||
<service name="com.sun.star.script.DocumentDialogLibraryContainer"/>
|
||||
</implementation>
|
||||
<implementation name="com.sun.star.comp.sfx2.ScriptLibraryContainer">
|
||||
<service name="com.sun.star.script.DocumentScriptLibraryContainer"/>
|
||||
<service name="com.sun.star.script.ScriptLibraryContainer"/>
|
||||
</implementation>
|
||||
</component>
|
@ -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\source nmake - all cg_source cg_inc NULL
|
||||
cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL
|
||||
|
@ -1,3 +1,4 @@
|
||||
..\%__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.so %_DEST%\lib%_EXT%\configmgr.uno.so
|
||||
..\%__SRC%\misc\configmgr.component %_DEST%\xml%_EXT%\configmgr.component
|
||||
|
@ -51,16 +51,13 @@ propertynode.cxx
|
||||
setnode.cxx
|
||||
Internal representations of data nodes.
|
||||
|
||||
pad.cxx
|
||||
parsemanager.cxx
|
||||
parser.hxx
|
||||
span.hxx
|
||||
valueparser.cxx
|
||||
xcdparser.cxx
|
||||
xcsparser.cxx
|
||||
xcuparser.cxx
|
||||
xmldata.cxx
|
||||
xmlreader.cxx
|
||||
XML file reading.
|
||||
|
||||
modifications.cxx
|
||||
|
@ -769,7 +769,7 @@ void Components::parseModificationLayer() {
|
||||
"configmgr user registrymodifications.xcu does not (yet) exist");
|
||||
// Migrate old user layer data (can be removed once migration is no
|
||||
// longer relevant, probably OOo 4; also see hack for xsi namespace in
|
||||
// XmlReader constructor):
|
||||
// xmlreader::XmlReader::registerNamespaceIri):
|
||||
parseFiles(
|
||||
Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
|
||||
&parseXcuFile,
|
||||
|
45
configmgr/source/configmgr.component
Normal file
45
configmgr/source/configmgr.component
Normal 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>
|
@ -52,7 +52,6 @@ SLOFILES = \
|
||||
$(SLO)/modifications.obj \
|
||||
$(SLO)/node.obj \
|
||||
$(SLO)/nodemap.obj \
|
||||
$(SLO)/pad.obj \
|
||||
$(SLO)/parsemanager.obj \
|
||||
$(SLO)/partial.obj \
|
||||
$(SLO)/propertynode.obj \
|
||||
@ -66,8 +65,7 @@ SLOFILES = \
|
||||
$(SLO)/xcdparser.obj \
|
||||
$(SLO)/xcsparser.obj \
|
||||
$(SLO)/xcuparser.obj \
|
||||
$(SLO)/xmldata.obj \
|
||||
$(SLO)/xmlreader.obj
|
||||
$(SLO)/xmldata.obj
|
||||
|
||||
SHL1IMPLIB = i$(SHL1TARGET)
|
||||
SHL1OBJS = $(SLOFILES)
|
||||
@ -76,9 +74,18 @@ SHL1STDLIBS = \
|
||||
$(CPPUHELPERLIB) \
|
||||
$(CPPULIB) \
|
||||
$(SALHELPERLIB) \
|
||||
$(SALLIB)
|
||||
$(SALLIB) \
|
||||
$(XMLREADERLIB)
|
||||
SHL1TARGET = configmgr.uno
|
||||
SHL1USE_EXPORTS = name
|
||||
DEF1NAME = $(SHL1TARGET)
|
||||
|
||||
.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
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -32,10 +32,11 @@
|
||||
#include "com/sun/star/uno/RuntimeException.hpp"
|
||||
#include "osl/diagnose.h"
|
||||
#include "sal/types.h"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "parsemanager.hxx"
|
||||
#include "parser.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -52,28 +53,42 @@ ParseManager::ParseManager(
|
||||
reader_(url), parser_(parser)
|
||||
{
|
||||
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() {
|
||||
for (;;) {
|
||||
switch (itemData_.is()
|
||||
? XmlReader::RESULT_BEGIN
|
||||
? xmlreader::XmlReader::RESULT_BEGIN
|
||||
: reader_.nextItem(
|
||||
parser_->getTextMode(), &itemData_, &itemNamespace_))
|
||||
parser_->getTextMode(), &itemData_, &itemNamespaceId_))
|
||||
{
|
||||
case XmlReader::RESULT_BEGIN:
|
||||
if (!parser_->startElement(reader_, itemNamespace_, itemData_))
|
||||
case xmlreader::XmlReader::RESULT_BEGIN:
|
||||
if (!parser_->startElement(reader_, itemNamespaceId_, itemData_))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case XmlReader::RESULT_END:
|
||||
case xmlreader::XmlReader::RESULT_END:
|
||||
parser_->endElement(reader_);
|
||||
break;
|
||||
case XmlReader::RESULT_TEXT:
|
||||
case xmlreader::XmlReader::RESULT_TEXT:
|
||||
parser_->characters(itemData_);
|
||||
break;
|
||||
case XmlReader::RESULT_DONE:
|
||||
case xmlreader::XmlReader::RESULT_DONE:
|
||||
return true;
|
||||
}
|
||||
itemData_.clear();
|
||||
|
@ -35,9 +35,8 @@
|
||||
#include "rtl/ref.hxx"
|
||||
#include "sal/types.h"
|
||||
#include "salhelper/simplereferenceobject.hxx"
|
||||
|
||||
#include "span.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
namespace rtl { class OUString; }
|
||||
|
||||
@ -55,13 +54,15 @@ public:
|
||||
|
||||
bool parse();
|
||||
|
||||
enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 };
|
||||
|
||||
private:
|
||||
virtual ~ParseManager();
|
||||
|
||||
XmlReader reader_;
|
||||
xmlreader::XmlReader reader_;
|
||||
rtl::Reference< Parser > parser_;
|
||||
Span itemData_;
|
||||
XmlReader::Namespace itemNamespace_;
|
||||
xmlreader::Span itemData_;
|
||||
int itemNamespaceId_;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -33,23 +33,23 @@
|
||||
#include <memory>
|
||||
|
||||
#include "salhelper/simplereferenceobject.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "xmlreader.hxx"
|
||||
namespace xmlreader { struct Span; }
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
struct Span;
|
||||
|
||||
class Parser: public salhelper::SimpleReferenceObject {
|
||||
public:
|
||||
virtual XmlReader::Text getTextMode() = 0;
|
||||
virtual xmlreader::XmlReader::Text getTextMode() = 0;
|
||||
|
||||
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:
|
||||
Parser() {}
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "precompiled_configmgr.hxx"
|
||||
#include "sal/config.h"
|
||||
|
||||
#include "com/sun/star/registry/XRegistryKey.hpp"
|
||||
#include "com/sun/star/uno/Exception.hpp"
|
||||
#include "com/sun/star/uno/Reference.hxx"
|
||||
#include "com/sun/star/uno/XComponentContext.hpp"
|
||||
@ -36,9 +35,6 @@
|
||||
#include "cppuhelper/implementationentry.hxx"
|
||||
#include "osl/diagnose.h"
|
||||
#include "uno/lbnames.h"
|
||||
#include "rtl/textenc.h"
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "sal/types.h"
|
||||
|
||||
#include "configurationprovider.hxx"
|
||||
@ -89,47 +85,3 @@ component_getImplementationEnvironment(
|
||||
{
|
||||
*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;
|
||||
}
|
||||
|
@ -40,16 +40,17 @@
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "sal/types.h"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "localizedvaluenode.hxx"
|
||||
#include "node.hxx"
|
||||
#include "nodemap.hxx"
|
||||
#include "parsemanager.hxx"
|
||||
#include "propertynode.hxx"
|
||||
#include "span.hxx"
|
||||
#include "type.hxx"
|
||||
#include "valueparser.hxx"
|
||||
#include "xmldata.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -74,7 +75,7 @@ bool parseHexDigit(char c, int * value) {
|
||||
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);
|
||||
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) ||
|
||||
text.equals(RTL_CONSTASCII_STRINGPARAM("1")))
|
||||
@ -91,7 +92,7 @@ bool parseValue(Span const & text, sal_Bool * value) {
|
||||
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);
|
||||
// For backwards compatibility, support hexadecimal values:
|
||||
sal_Int32 n =
|
||||
@ -110,7 +111,7 @@ bool parseValue(Span const & text, sal_Int16 * value) {
|
||||
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);
|
||||
// For backwards compatibility, support hexadecimal values:
|
||||
*value =
|
||||
@ -125,7 +126,7 @@ bool parseValue(Span const & text, sal_Int32 * value) {
|
||||
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);
|
||||
// For backwards compatibility, support hexadecimal values:
|
||||
*value =
|
||||
@ -140,20 +141,22 @@ bool parseValue(Span const & text, sal_Int64 * value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool parseValue(Span const & text, double * value) {
|
||||
bool parseValue(xmlreader::Span const & text, double * value) {
|
||||
OSL_ASSERT(text.is() && value != 0);
|
||||
*value = rtl::OString(text.begin, text.length).toDouble();
|
||||
//TODO: check valid lexical representation
|
||||
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);
|
||||
*value = xmldata::convertFromUtf8(text);
|
||||
*value = text.convertFromUtf8();
|
||||
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);
|
||||
if ((text.length & 1) != 0) {
|
||||
return false;
|
||||
@ -173,7 +176,9 @@ bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
|
||||
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;
|
||||
if (!parseValue(text, &val)) {
|
||||
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(
|
||||
rtl::OString const & separator, Span const & text)
|
||||
rtl::OString const & separator, xmlreader::Span const & text)
|
||||
{
|
||||
comphelper::SequenceAsVector< T > seq;
|
||||
Span sep;
|
||||
xmlreader::Span sep;
|
||||
if (separator.getLength() == 0) {
|
||||
sep = Span(RTL_CONSTASCII_STRINGPARAM(" "));
|
||||
sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" "));
|
||||
} else {
|
||||
sep = Span(separator.getStr(), separator.getLength());
|
||||
sep = xmlreader::Span(separator.getStr(), separator.getLength());
|
||||
}
|
||||
if (text.length != 0) {
|
||||
for (Span t(text);;) {
|
||||
for (xmlreader::Span t(text);;) {
|
||||
sal_Int32 i = rtl_str_indexOfStr_WithLength(
|
||||
t.begin, t.length, sep.begin, sep.length);
|
||||
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(
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
@ -215,7 +222,7 @@ template< typename T > css::uno::Any parseListValue(
|
||||
}
|
||||
|
||||
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) {
|
||||
case TYPE_ANY:
|
||||
@ -266,7 +273,7 @@ ValueParser::ValueParser(int layer): layer_(layer) {}
|
||||
|
||||
ValueParser::~ValueParser() {}
|
||||
|
||||
XmlReader::Text ValueParser::getTextMode() const {
|
||||
xmlreader::XmlReader::Text ValueParser::getTextMode() const {
|
||||
if (node_.is()) {
|
||||
switch (state_) {
|
||||
case STATE_TEXT:
|
||||
@ -278,23 +285,24 @@ XmlReader::Text ValueParser::getTextMode() const {
|
||||
return
|
||||
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
|
||||
separator_.getLength() != 0)
|
||||
? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED;
|
||||
? xmlreader::XmlReader::TEXT_RAW
|
||||
: xmlreader::XmlReader::TEXT_NORMALIZED;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return XmlReader::TEXT_NONE;
|
||||
return xmlreader::XmlReader::TEXT_NONE;
|
||||
}
|
||||
|
||||
bool ValueParser::startElement(
|
||||
XmlReader & reader, XmlReader::Namespace ns, Span const & name)
|
||||
xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
|
||||
{
|
||||
if (!node_.is()) {
|
||||
return false;
|
||||
}
|
||||
switch (state_) {
|
||||
case STATE_TEXT:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
|
||||
isListType(type_) && separator_.getLength() == 0)
|
||||
{
|
||||
@ -306,18 +314,18 @@ bool ValueParser::startElement(
|
||||
}
|
||||
// fall through
|
||||
case STATE_IT:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) &&
|
||||
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
|
||||
{
|
||||
sal_Int32 scalar = -1;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar")))
|
||||
{
|
||||
if (!parseValue(reader.getAttributeValue(true), &scalar)) {
|
||||
@ -352,7 +360,7 @@ bool ValueParser::startElement(
|
||||
}
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
@ -439,7 +447,7 @@ bool ValueParser::endElement() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ValueParser::characters(Span const & text) {
|
||||
void ValueParser::characters(xmlreader::Span const & text) {
|
||||
if (node_.is()) {
|
||||
OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT);
|
||||
pad_.add(text.begin, text.length);
|
||||
|
@ -36,19 +36,19 @@
|
||||
#include "rtl/ref.hxx"
|
||||
#include "rtl/string.hxx"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/pad.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "pad.hxx"
|
||||
#include "type.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace com { namespace sun { namespace star { namespace uno {
|
||||
class Any;
|
||||
} } } }
|
||||
namespace xmlreader { struct Span; }
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
class Node;
|
||||
struct Span;
|
||||
|
||||
class ValueParser: private boost::noncopyable {
|
||||
public:
|
||||
@ -56,14 +56,14 @@ public:
|
||||
|
||||
~ValueParser();
|
||||
|
||||
XmlReader::Text getTextMode() const;
|
||||
xmlreader::XmlReader::Text getTextMode() const;
|
||||
|
||||
bool startElement(
|
||||
XmlReader & reader, XmlReader::Namespace ns, Span const & name);
|
||||
xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
|
||||
|
||||
bool endElement();
|
||||
|
||||
void characters(Span const & text);
|
||||
void characters(xmlreader::Span const & text);
|
||||
|
||||
void start(
|
||||
rtl::Reference< Node > const & property,
|
||||
@ -83,7 +83,7 @@ private:
|
||||
rtl::Reference< Node > node_;
|
||||
rtl::OUString localizedName_;
|
||||
State state_;
|
||||
Pad pad_;
|
||||
xmlreader::Pad pad_;
|
||||
std::vector< com::sun::star::uno::Any > items_;
|
||||
};
|
||||
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "sal/types.h"
|
||||
#include "xmlreader/span.hxx"
|
||||
|
||||
#include "data.hxx"
|
||||
#include "groupnode.hxx"
|
||||
@ -54,7 +55,6 @@
|
||||
#include "node.hxx"
|
||||
#include "nodemap.hxx"
|
||||
#include "propertynode.hxx"
|
||||
#include "span.hxx"
|
||||
#include "type.hxx"
|
||||
#include "writemodfile.hxx"
|
||||
|
||||
@ -341,22 +341,23 @@ void writeNode(
|
||||
rtl::Reference< Node > const & parent, rtl::OUString const & name,
|
||||
rtl::Reference< Node > const & node)
|
||||
{
|
||||
static Span const typeNames[] = {
|
||||
Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
|
||||
Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
|
||||
static xmlreader::Span const typeNames[] = {
|
||||
xmlreader::Span(), xmlreader::Span(), xmlreader::Span(),
|
||||
// TYPE_ERROR, TYPE_NIL, TYPE_ANY
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
|
||||
xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
|
||||
switch (node->kind()) {
|
||||
case Node::KIND_PROPERTY:
|
||||
{
|
||||
|
@ -37,13 +37,14 @@
|
||||
#include "rtl/string.h"
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "span.hxx"
|
||||
#include "parsemanager.hxx"
|
||||
#include "xcdparser.hxx"
|
||||
#include "xcsparser.hxx"
|
||||
#include "xcuparser.hxx"
|
||||
#include "xmldata.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -59,22 +60,22 @@ XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data & data):
|
||||
|
||||
XcdParser::~XcdParser() {}
|
||||
|
||||
XmlReader::Text XcdParser::getTextMode() {
|
||||
xmlreader::XmlReader::Text XcdParser::getTextMode() {
|
||||
return nestedParser_.is()
|
||||
? nestedParser_->getTextMode() : XmlReader::TEXT_NONE;
|
||||
? nestedParser_->getTextMode() : xmlreader::XmlReader::TEXT_NONE;
|
||||
}
|
||||
|
||||
bool XcdParser::startElement(
|
||||
XmlReader & reader, XmlReader::Namespace ns, Span const & name)
|
||||
xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
|
||||
{
|
||||
if (nestedParser_.is()) {
|
||||
OSL_ASSERT(nesting_ != LONG_MAX);
|
||||
++nesting_;
|
||||
return nestedParser_->startElement(reader, ns, name);
|
||||
return nestedParser_->startElement(reader, nsId, name);
|
||||
}
|
||||
switch (state_) {
|
||||
case STATE_START:
|
||||
if (ns == XmlReader::NAMESPACE_OOR &&
|
||||
if (nsId == ParseManager::NAMESPACE_OOR &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("data")))
|
||||
{
|
||||
state_ = STATE_DEPENDENCIES;
|
||||
@ -82,18 +83,19 @@ bool XcdParser::startElement(
|
||||
}
|
||||
break;
|
||||
case STATE_DEPENDENCIES:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
|
||||
{
|
||||
if (dependency_.getLength() == 0) {
|
||||
Span attrFile;
|
||||
xmlreader::Span attrFile;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR
|
||||
if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
//TODO: _OOR
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file")))
|
||||
{
|
||||
attrFile = reader.getAttributeValue(false);
|
||||
@ -107,7 +109,7 @@ bool XcdParser::startElement(
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
dependency_ = xmldata::convertFromUtf8(attrFile);
|
||||
dependency_ = attrFile.convertFromUtf8();
|
||||
if (dependency_.getLength() == 0) {
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
@ -127,19 +129,19 @@ bool XcdParser::startElement(
|
||||
state_ = STATE_COMPONENTS;
|
||||
// fall through
|
||||
case STATE_COMPONENTS:
|
||||
if (ns == XmlReader::NAMESPACE_OOR &&
|
||||
if (nsId == ParseManager::NAMESPACE_OOR &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema")))
|
||||
{
|
||||
nestedParser_ = new XcsParser(layer_, data_);
|
||||
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")))
|
||||
{
|
||||
nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0);
|
||||
nesting_ = 1;
|
||||
return nestedParser_->startElement(reader, ns, name);
|
||||
return nestedParser_->startElement(reader, nsId, name);
|
||||
}
|
||||
break;
|
||||
default: // STATE_DEPENDENCY
|
||||
@ -148,12 +150,12 @@ bool XcdParser::startElement(
|
||||
}
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
|
||||
void XcdParser::endElement(XmlReader const & reader) {
|
||||
void XcdParser::endElement(xmlreader::XmlReader const & reader) {
|
||||
if (nestedParser_.is()) {
|
||||
nestedParser_->endElement(reader);
|
||||
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()) {
|
||||
nestedParser_->characters(text);
|
||||
}
|
||||
|
@ -34,14 +34,15 @@
|
||||
|
||||
#include "rtl/ref.hxx"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "parser.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace xmlreader { struct Span; }
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
struct Data;
|
||||
struct Span;
|
||||
|
||||
class XcdParser: public Parser {
|
||||
public:
|
||||
@ -52,14 +53,14 @@ public:
|
||||
private:
|
||||
virtual ~XcdParser();
|
||||
|
||||
virtual XmlReader::Text getTextMode();
|
||||
virtual xmlreader::XmlReader::Text getTextMode();
|
||||
|
||||
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 {
|
||||
STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };
|
||||
|
@ -41,18 +41,19 @@
|
||||
#include "rtl/string.hxx"
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "data.hxx"
|
||||
#include "localizedpropertynode.hxx"
|
||||
#include "groupnode.hxx"
|
||||
#include "node.hxx"
|
||||
#include "nodemap.hxx"
|
||||
#include "parsemanager.hxx"
|
||||
#include "propertynode.hxx"
|
||||
#include "setnode.hxx"
|
||||
#include "span.hxx"
|
||||
#include "xcsparser.hxx"
|
||||
#include "xmldata.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -125,18 +126,18 @@ XcsParser::XcsParser(int layer, Data & data):
|
||||
|
||||
XcsParser::~XcsParser() {}
|
||||
|
||||
XmlReader::Text XcsParser::getTextMode() {
|
||||
xmlreader::XmlReader::Text XcsParser::getTextMode() {
|
||||
return valueParser_.getTextMode();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
if (state_ == STATE_START) {
|
||||
if (ns == XmlReader::NAMESPACE_OOR &&
|
||||
if (nsId == ParseManager::NAMESPACE_OOR &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) {
|
||||
handleComponentSchema(reader);
|
||||
state_ = STATE_COMPONENT_SCHEMA;
|
||||
@ -148,7 +149,7 @@ bool XcsParser::startElement(
|
||||
// prop constraints; accepting all four at illegal places (and with
|
||||
// illegal content):
|
||||
if (ignoring_ > 0 ||
|
||||
(ns == XmlReader::NAMESPACE_NONE &&
|
||||
(nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
(name.equals(RTL_CONSTASCII_STRINGPARAM("info")) ||
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("import")) ||
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) ||
|
||||
@ -160,7 +161,7 @@ bool XcsParser::startElement(
|
||||
}
|
||||
switch (state_) {
|
||||
case STATE_COMPONENT_SCHEMA:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("templates")))
|
||||
{
|
||||
state_ = STATE_TEMPLATES;
|
||||
@ -168,7 +169,7 @@ bool XcsParser::startElement(
|
||||
}
|
||||
// fall through
|
||||
case STATE_TEMPLATES_DONE:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
|
||||
{
|
||||
state_ = STATE_COMPONENT;
|
||||
@ -183,13 +184,13 @@ bool XcsParser::startElement(
|
||||
break;
|
||||
case STATE_TEMPLATES:
|
||||
if (elements_.empty()) {
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
|
||||
{
|
||||
handleGroup(reader, true);
|
||||
return true;
|
||||
}
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
|
||||
{
|
||||
handleSet(reader, true);
|
||||
@ -203,7 +204,7 @@ bool XcsParser::startElement(
|
||||
switch (elements_.top().node->kind()) {
|
||||
case Node::KIND_PROPERTY:
|
||||
case Node::KIND_LOCALIZED_PROPERTY:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
|
||||
{
|
||||
handlePropValue(reader, elements_.top().node);
|
||||
@ -211,25 +212,25 @@ bool XcsParser::startElement(
|
||||
}
|
||||
break;
|
||||
case Node::KIND_GROUP:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
|
||||
{
|
||||
handleProp(reader);
|
||||
return true;
|
||||
}
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref")))
|
||||
{
|
||||
handleNodeRef(reader);
|
||||
return true;
|
||||
}
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
|
||||
{
|
||||
handleGroup(reader, false);
|
||||
return true;
|
||||
}
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
|
||||
{
|
||||
handleSet(reader, false);
|
||||
@ -237,7 +238,7 @@ bool XcsParser::startElement(
|
||||
}
|
||||
break;
|
||||
case Node::KIND_SET:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
|
||||
{
|
||||
handleSetItem(
|
||||
@ -260,12 +261,12 @@ bool XcsParser::startElement(
|
||||
}
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
|
||||
void XcsParser::endElement(XmlReader const & reader) {
|
||||
void XcsParser::endElement(xmlreader::XmlReader const & reader) {
|
||||
if (valueParser_.endElement()) {
|
||||
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);
|
||||
}
|
||||
|
||||
void XcsParser::handleComponentSchema(XmlReader & reader) {
|
||||
void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
|
||||
//TODO: oor:version, xml:lang attributes
|
||||
rtl::OStringBuffer buf;
|
||||
buf.append('.');
|
||||
bool hasPackage = false;
|
||||
bool hasName = false;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
|
||||
{
|
||||
if (hasPackage) {
|
||||
@ -371,9 +372,9 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
hasPackage = true;
|
||||
Span s(reader.getAttributeValue(false));
|
||||
xmlreader::Span s(reader.getAttributeValue(false));
|
||||
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")))
|
||||
{
|
||||
if (hasName) {
|
||||
@ -385,7 +386,7 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
hasName = true;
|
||||
Span s(reader.getAttributeValue(false));
|
||||
xmlreader::Span s(reader.getAttributeValue(false));
|
||||
buf.append(s.begin, s.length);
|
||||
}
|
||||
}
|
||||
@ -405,38 +406,36 @@ void XcsParser::handleComponentSchema(XmlReader & reader) {
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
componentName_ = xmldata::convertFromUtf8(
|
||||
Span(buf.getStr(), buf.getLength()));
|
||||
componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
|
||||
convertFromUtf8();
|
||||
}
|
||||
|
||||
void XcsParser::handleNodeRef(XmlReader & reader) {
|
||||
void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) {
|
||||
bool hasName = false;
|
||||
rtl::OUString name;
|
||||
rtl::OUString component(componentName_);
|
||||
bool hasNodeType = false;
|
||||
rtl::OUString nodeType;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
|
||||
{
|
||||
component = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
component = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
|
||||
{
|
||||
hasNodeType = true;
|
||||
nodeType = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
nodeType = reader.getAttributeValue(false).convertFromUtf8();
|
||||
}
|
||||
}
|
||||
if (!hasName) {
|
||||
@ -465,33 +464,33 @@ void XcsParser::handleNodeRef(XmlReader & reader) {
|
||||
elements_.push(Element(node, name));
|
||||
}
|
||||
|
||||
void XcsParser::handleProp(XmlReader & reader) {
|
||||
void XcsParser::handleProp(xmlreader::XmlReader & reader) {
|
||||
bool hasName = false;
|
||||
rtl::OUString name;
|
||||
valueParser_.type_ = TYPE_ERROR;
|
||||
bool localized = false;
|
||||
bool nillable = true;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
|
||||
{
|
||||
valueParser_.type_ = xmldata::parseType(
|
||||
reader, reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized")))
|
||||
{
|
||||
localized = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable")))
|
||||
{
|
||||
nillable = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
@ -525,16 +524,16 @@ void XcsParser::handleProp(XmlReader & reader) {
|
||||
}
|
||||
|
||||
void XcsParser::handlePropValue(
|
||||
XmlReader & reader, rtl::Reference< Node > const & property)
|
||||
xmlreader::XmlReader & reader, rtl::Reference< Node > const & property)
|
||||
{
|
||||
Span attrSeparator;
|
||||
xmlreader::Span attrSeparator;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
|
||||
{
|
||||
attrSeparator = reader.getAttributeValue(false);
|
||||
@ -553,22 +552,22 @@ void XcsParser::handlePropValue(
|
||||
valueParser_.start(property);
|
||||
}
|
||||
|
||||
void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
|
||||
void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) {
|
||||
bool hasName = false;
|
||||
rtl::OUString name;
|
||||
bool extensible = false;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible")))
|
||||
{
|
||||
extensible = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
@ -592,34 +591,32 @@ void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
|
||||
name));
|
||||
}
|
||||
|
||||
void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
|
||||
void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) {
|
||||
bool hasName = false;
|
||||
rtl::OUString name;
|
||||
rtl::OUString component(componentName_);
|
||||
bool hasNodeType = false;
|
||||
rtl::OUString nodeType;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
|
||||
{
|
||||
component = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
component = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
|
||||
{
|
||||
hasNodeType = true;
|
||||
nodeType = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
nodeType = reader.getAttributeValue(false).convertFromUtf8();
|
||||
}
|
||||
}
|
||||
if (!hasName) {
|
||||
@ -642,27 +639,25 @@ void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
|
||||
name));
|
||||
}
|
||||
|
||||
void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) {
|
||||
void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) {
|
||||
rtl::OUString component(componentName_);
|
||||
bool hasNodeType = false;
|
||||
rtl::OUString nodeType;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
|
||||
{
|
||||
component = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
component = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
|
||||
{
|
||||
hasNodeType = true;
|
||||
nodeType = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
nodeType = reader.getAttributeValue(false).convertFromUtf8();
|
||||
}
|
||||
}
|
||||
set->getAdditionalTemplateNames().push_back(
|
||||
|
@ -34,17 +34,18 @@
|
||||
|
||||
#include "rtl/ref.hxx"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "node.hxx"
|
||||
#include "parser.hxx"
|
||||
#include "valueparser.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace xmlreader { struct Span; }
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
class SetNode;
|
||||
struct Data;
|
||||
struct Span;
|
||||
|
||||
class XcsParser: public Parser {
|
||||
public:
|
||||
@ -53,29 +54,29 @@ public:
|
||||
private:
|
||||
virtual ~XcsParser();
|
||||
|
||||
virtual XmlReader::Text getTextMode();
|
||||
virtual xmlreader::XmlReader::Text getTextMode();
|
||||
|
||||
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(
|
||||
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 {
|
||||
STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES,
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "rtl/string.hxx"
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "data.hxx"
|
||||
#include "localizedpropertynode.hxx"
|
||||
@ -49,14 +51,13 @@
|
||||
#include "modifications.hxx"
|
||||
#include "node.hxx"
|
||||
#include "nodemap.hxx"
|
||||
#include "parsemanager.hxx"
|
||||
#include "partial.hxx"
|
||||
#include "path.hxx"
|
||||
#include "propertynode.hxx"
|
||||
#include "setnode.hxx"
|
||||
#include "span.hxx"
|
||||
#include "xcuparser.hxx"
|
||||
#include "xmldata.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -79,22 +80,22 @@ XcuParser::XcuParser(
|
||||
|
||||
XcuParser::~XcuParser() {}
|
||||
|
||||
XmlReader::Text XcuParser::getTextMode() {
|
||||
xmlreader::XmlReader::Text XcuParser::getTextMode() {
|
||||
return valueParser_.getTextMode();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
if (state_.empty()) {
|
||||
if (ns == XmlReader::NAMESPACE_OOR &&
|
||||
if (nsId == ParseManager::NAMESPACE_OOR &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
|
||||
{
|
||||
handleComponentData(reader);
|
||||
} else if (ns == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (nsId == ParseManager::NAMESPACE_OOR &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("items")))
|
||||
{
|
||||
state_.push(State(rtl::Reference< Node >(), false));
|
||||
@ -102,7 +103,7 @@ bool XcuParser::startElement(
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
RTL_CONSTASCII_USTRINGPARAM("bad root element <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
@ -110,7 +111,7 @@ bool XcuParser::startElement(
|
||||
} else if (state_.top().ignore) {
|
||||
state_.push(State(false));
|
||||
} else if (!state_.top().node.is()) {
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
|
||||
{
|
||||
handleItem(reader);
|
||||
@ -118,7 +119,7 @@ bool XcuParser::startElement(
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
@ -126,7 +127,7 @@ bool XcuParser::startElement(
|
||||
} else {
|
||||
switch (state_.top().node->kind()) {
|
||||
case Node::KIND_PROPERTY:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
|
||||
{
|
||||
handlePropValue(
|
||||
@ -137,14 +138,14 @@ bool XcuParser::startElement(
|
||||
(rtl::OUString(
|
||||
RTL_CONSTASCII_USTRINGPARAM(
|
||||
"bad property node member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
break;
|
||||
case Node::KIND_LOCALIZED_PROPERTY:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
|
||||
{
|
||||
handleLocpropValue(
|
||||
@ -156,7 +157,7 @@ bool XcuParser::startElement(
|
||||
(rtl::OUString(
|
||||
RTL_CONSTASCII_USTRINGPARAM(
|
||||
"bad localized property node member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
@ -165,18 +166,18 @@ bool XcuParser::startElement(
|
||||
case Node::KIND_LOCALIZED_VALUE:
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
case Node::KIND_GROUP:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
|
||||
{
|
||||
handleGroupProp(
|
||||
reader,
|
||||
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")))
|
||||
{
|
||||
handleGroupNode(reader, state_.top().node);
|
||||
@ -185,19 +186,19 @@ bool XcuParser::startElement(
|
||||
(rtl::OUString(
|
||||
RTL_CONSTASCII_USTRINGPARAM(
|
||||
"bad group node member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
break;
|
||||
case Node::KIND_SET:
|
||||
if (ns == XmlReader::NAMESPACE_NONE &&
|
||||
if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
|
||||
name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
|
||||
{
|
||||
handleSetNode(
|
||||
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")))
|
||||
{
|
||||
OSL_TRACE(
|
||||
@ -209,7 +210,7 @@ bool XcuParser::startElement(
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) +
|
||||
xmldata::convertFromUtf8(name) +
|
||||
name.convertFromUtf8() +
|
||||
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
@ -220,7 +221,7 @@ bool XcuParser::startElement(
|
||||
return true;
|
||||
}
|
||||
|
||||
void XcuParser::endElement(XmlReader const &) {
|
||||
void XcuParser::endElement(xmlreader::XmlReader const &) {
|
||||
if (valueParser_.endElement()) {
|
||||
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);
|
||||
}
|
||||
|
||||
XcuParser::Operation XcuParser::parseOperation(Span const & text) {
|
||||
XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) {
|
||||
OSL_ASSERT(text.is());
|
||||
if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) {
|
||||
return OPERATION_MODIFY;
|
||||
@ -265,11 +266,11 @@ XcuParser::Operation XcuParser::parseOperation(Span const & text) {
|
||||
}
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) +
|
||||
xmldata::convertFromUtf8(text)),
|
||||
text.convertFromUtf8()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
|
||||
void XcuParser::handleComponentData(XmlReader & reader) {
|
||||
void XcuParser::handleComponentData(xmlreader::XmlReader & reader) {
|
||||
rtl::OStringBuffer buf;
|
||||
buf.append('.');
|
||||
bool hasPackage = false;
|
||||
@ -277,12 +278,12 @@ void XcuParser::handleComponentData(XmlReader & reader) {
|
||||
Operation op = OPERATION_MODIFY;
|
||||
bool finalized = false;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
|
||||
{
|
||||
if (hasPackage) {
|
||||
@ -295,9 +296,9 @@ void XcuParser::handleComponentData(XmlReader & reader) {
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
hasPackage = true;
|
||||
Span s(reader.getAttributeValue(false));
|
||||
xmlreader::Span s(reader.getAttributeValue(false));
|
||||
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")))
|
||||
{
|
||||
if (hasName) {
|
||||
@ -309,13 +310,13 @@ void XcuParser::handleComponentData(XmlReader & reader) {
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
hasName = true;
|
||||
Span s(reader.getAttributeValue(false));
|
||||
xmlreader::Span s(reader.getAttributeValue(false));
|
||||
buf.append(s.begin, s.length);
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
|
||||
{
|
||||
op = parseOperation(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
|
||||
{
|
||||
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
@ -337,8 +338,8 @@ void XcuParser::handleComponentData(XmlReader & reader) {
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
componentName_ = xmldata::convertFromUtf8(
|
||||
Span(buf.getStr(), buf.getLength()));
|
||||
componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
|
||||
convertFromUtf8();
|
||||
if (trackPath_) {
|
||||
OSL_ASSERT(path_.empty());
|
||||
path_.push_back(componentName_);
|
||||
@ -380,15 +381,15 @@ void XcuParser::handleComponentData(XmlReader & reader) {
|
||||
state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
|
||||
}
|
||||
|
||||
void XcuParser::handleItem(XmlReader & reader) {
|
||||
Span attrPath;
|
||||
void XcuParser::handleItem(xmlreader::XmlReader & reader) {
|
||||
xmlreader::Span attrPath;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path")))
|
||||
{
|
||||
attrPath = reader.getAttributeValue(false);
|
||||
@ -401,7 +402,7 @@ void XcuParser::handleItem(XmlReader & reader) {
|
||||
reader.getUrl()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
rtl::OUString path(xmldata::convertFromUtf8(attrPath));
|
||||
rtl::OUString path(attrPath.convertFromUtf8());
|
||||
int finalizedLayer;
|
||||
rtl::Reference< Node > node(
|
||||
data_.resolvePathRepresentation(
|
||||
@ -446,21 +447,23 @@ void XcuParser::handleItem(XmlReader & reader) {
|
||||
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;
|
||||
rtl::OString separator;
|
||||
rtl::OUString external;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_XSI &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_XSI &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
|
||||
{
|
||||
nil = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
|
||||
{
|
||||
Type type = xmldata::parseType(
|
||||
@ -473,10 +476,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
valueParser_.type_ = type;
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
|
||||
{
|
||||
Span s(reader.getAttributeValue(false));
|
||||
xmlreader::Span s(reader.getAttributeValue(false));
|
||||
if (s.length == 0) {
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
@ -486,10 +489,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
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")))
|
||||
{
|
||||
external = xmldata::convertFromUtf8(reader.getAttributeValue(true));
|
||||
external = reader.getAttributeValue(true).convertFromUtf8();
|
||||
if (external.getLength() == 0) {
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
@ -529,27 +532,27 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
|
||||
}
|
||||
|
||||
void XcuParser::handleLocpropValue(
|
||||
XmlReader & reader, LocalizedPropertyNode * locprop)
|
||||
xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop)
|
||||
{
|
||||
rtl::OUString name;
|
||||
bool nil = false;
|
||||
rtl::OString separator;
|
||||
Operation op = OPERATION_FUSE;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_XML &&
|
||||
if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang")))
|
||||
{
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_XSI &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_XSI &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
|
||||
{
|
||||
nil = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
|
||||
{
|
||||
Type type = xmldata::parseType(
|
||||
@ -562,10 +565,10 @@ void XcuParser::handleLocpropValue(
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
valueParser_.type_ = type;
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
|
||||
{
|
||||
Span s(reader.getAttributeValue(false));
|
||||
xmlreader::Span s(reader.getAttributeValue(false));
|
||||
if (s.length == 0) {
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(
|
||||
@ -575,7 +578,7 @@ void XcuParser::handleLocpropValue(
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
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")))
|
||||
{
|
||||
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;
|
||||
rtl::OUString name;
|
||||
Type type = TYPE_ERROR;
|
||||
Operation op = OPERATION_MODIFY;
|
||||
bool finalized = false;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
|
||||
{
|
||||
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")))
|
||||
{
|
||||
op = parseOperation(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
|
||||
{
|
||||
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
@ -726,8 +731,8 @@ void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
|
||||
}
|
||||
|
||||
void XcuParser::handleUnknownGroupProp(
|
||||
XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
|
||||
Type type, Operation operation, bool finalized)
|
||||
xmlreader::XmlReader const & reader, GroupNode * group,
|
||||
rtl::OUString const & name, Type type, Operation operation, bool finalized)
|
||||
{
|
||||
switch (operation) {
|
||||
case OPERATION_REPLACE:
|
||||
@ -767,7 +772,7 @@ void XcuParser::handleUnknownGroupProp(
|
||||
}
|
||||
|
||||
void XcuParser::handlePlainGroupProp(
|
||||
XmlReader const & reader, GroupNode * group,
|
||||
xmlreader::XmlReader const & reader, GroupNode * group,
|
||||
NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
|
||||
Type type, Operation operation, bool finalized)
|
||||
{
|
||||
@ -821,7 +826,7 @@ void XcuParser::handlePlainGroupProp(
|
||||
}
|
||||
|
||||
void XcuParser::handleLocalizedGroupProp(
|
||||
XmlReader const & reader, LocalizedPropertyNode * property,
|
||||
xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
|
||||
rtl::OUString const & name, Type type, Operation operation, bool finalized)
|
||||
{
|
||||
if (property->getLayer() > valueParser_.getLayer()) {
|
||||
@ -879,28 +884,28 @@ void XcuParser::handleLocalizedGroupProp(
|
||||
}
|
||||
|
||||
void XcuParser::handleGroupNode(
|
||||
XmlReader & reader, rtl::Reference< Node > const & group)
|
||||
xmlreader::XmlReader & reader, rtl::Reference< Node > const & group)
|
||||
{
|
||||
bool hasName = false;
|
||||
rtl::OUString name;
|
||||
Operation op = OPERATION_MODIFY;
|
||||
bool finalized = false;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
|
||||
{
|
||||
op = parseOperation(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
|
||||
{
|
||||
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
@ -950,7 +955,7 @@ void XcuParser::handleGroupNode(
|
||||
state_.top().locked || finalizedLayer < valueParser_.getLayer()));
|
||||
}
|
||||
|
||||
void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
|
||||
void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) {
|
||||
bool hasName = false;
|
||||
rtl::OUString name;
|
||||
rtl::OUString component(componentName_);
|
||||
@ -960,36 +965,34 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
|
||||
bool finalized = false;
|
||||
bool mandatory = false;
|
||||
for (;;) {
|
||||
XmlReader::Namespace attrNs;
|
||||
Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNs, &attrLn)) {
|
||||
int attrNsId;
|
||||
xmlreader::Span attrLn;
|
||||
if (!reader.nextAttribute(&attrNsId, &attrLn)) {
|
||||
break;
|
||||
}
|
||||
if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
|
||||
{
|
||||
hasName = true;
|
||||
name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
name = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
|
||||
{
|
||||
component = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
component = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
|
||||
{
|
||||
hasNodeType = true;
|
||||
nodeType = xmldata::convertFromUtf8(
|
||||
reader.getAttributeValue(false));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
nodeType = reader.getAttributeValue(false).convertFromUtf8();
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
|
||||
{
|
||||
op = parseOperation(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
|
||||
{
|
||||
finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
} else if (attrNs == XmlReader::NAMESPACE_OOR &&
|
||||
} else if (attrNsId == ParseManager::NAMESPACE_OOR &&
|
||||
attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory")))
|
||||
{
|
||||
mandatory = xmldata::parseBoolean(reader.getAttributeValue(true));
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "rtl/ref.hxx"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "additions.hxx"
|
||||
#include "node.hxx"
|
||||
@ -43,7 +44,8 @@
|
||||
#include "type.hxx"
|
||||
#include "valueparser.hxx"
|
||||
#include "xmldata.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace xmlreader { struct Span; }
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -54,7 +56,6 @@ class Partial;
|
||||
class PropertyNode;
|
||||
class SetNode;
|
||||
struct Data;
|
||||
struct Span;
|
||||
|
||||
class XcuParser: public Parser {
|
||||
public:
|
||||
@ -65,49 +66,50 @@ public:
|
||||
private:
|
||||
virtual ~XcuParser();
|
||||
|
||||
virtual XmlReader::Text getTextMode();
|
||||
virtual xmlreader::XmlReader::Text getTextMode();
|
||||
|
||||
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 {
|
||||
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(
|
||||
XmlReader & reader, LocalizedPropertyNode * locprop);
|
||||
xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop);
|
||||
|
||||
void handleGroupProp(XmlReader & reader, GroupNode * group);
|
||||
void handleGroupProp(xmlreader::XmlReader & reader, GroupNode * group);
|
||||
|
||||
void handleUnknownGroupProp(
|
||||
XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
|
||||
Type type, Operation operation, bool finalized);
|
||||
xmlreader::XmlReader const & reader, GroupNode * group,
|
||||
rtl::OUString const & name, Type type, Operation operation,
|
||||
bool finalized);
|
||||
|
||||
void handlePlainGroupProp(
|
||||
XmlReader const & reader, GroupNode * group,
|
||||
xmlreader::XmlReader const & reader, GroupNode * group,
|
||||
NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
|
||||
Type type, Operation operation, bool finalized);
|
||||
|
||||
void handleLocalizedGroupProp(
|
||||
XmlReader const & reader, LocalizedPropertyNode * property,
|
||||
xmlreader::XmlReader const & reader, LocalizedPropertyNode * property,
|
||||
rtl::OUString const & name, Type type, Operation operation,
|
||||
bool finalized);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -40,12 +40,12 @@
|
||||
#include "rtl/ref.hxx"
|
||||
#include "rtl/strbuf.hxx"
|
||||
#include "rtl/string.h"
|
||||
#include "rtl/textcvt.h"
|
||||
#include "rtl/textenc.h"
|
||||
#include "rtl/ustrbuf.hxx"
|
||||
#include "rtl/ustring.h"
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "sal/types.h"
|
||||
#include "xmlreader/span.hxx"
|
||||
#include "xmlreader/xmlreader.hxx"
|
||||
|
||||
#include "data.hxx"
|
||||
#include "groupnode.hxx"
|
||||
@ -57,9 +57,7 @@
|
||||
#include "parser.hxx"
|
||||
#include "propertynode.hxx"
|
||||
#include "setnode.hxx"
|
||||
#include "span.hxx"
|
||||
#include "type.hxx"
|
||||
#include "xmlreader.hxx"
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
@ -71,90 +69,88 @@ namespace css = com::sun::star;
|
||||
|
||||
}
|
||||
|
||||
rtl::OUString convertFromUtf8(Span const & text) {
|
||||
OSL_ASSERT(text.is());
|
||||
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) {
|
||||
Type parseType(
|
||||
xmlreader::XmlReader const & reader, xmlreader::Span const & text)
|
||||
{
|
||||
OSL_ASSERT(text.is());
|
||||
sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':');
|
||||
if (i >= 0) {
|
||||
switch (reader.getNamespace(Span(text.begin, i))) {
|
||||
case XmlReader::NAMESPACE_OOR:
|
||||
if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("any")))
|
||||
switch (reader.getNamespaceId(xmlreader::Span(text.begin, i))) {
|
||||
case ParseManager::NAMESPACE_OOR:
|
||||
if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("any")))
|
||||
{
|
||||
return TYPE_ANY;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("boolean-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("boolean-list")))
|
||||
{
|
||||
return TYPE_BOOLEAN_LIST;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("short-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("short-list")))
|
||||
{
|
||||
return TYPE_SHORT_LIST;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("int-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("int-list")))
|
||||
{
|
||||
return TYPE_INT_LIST;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("long-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("long-list")))
|
||||
{
|
||||
return TYPE_LONG_LIST;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("double-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("double-list")))
|
||||
{
|
||||
return TYPE_DOUBLE_LIST;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("string-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("string-list")))
|
||||
{
|
||||
return TYPE_STRING_LIST;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
|
||||
{
|
||||
return TYPE_HEXBINARY_LIST;
|
||||
}
|
||||
break;
|
||||
case XmlReader::NAMESPACE_XS:
|
||||
if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("boolean")))
|
||||
case ParseManager::NAMESPACE_XS:
|
||||
if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("boolean")))
|
||||
{
|
||||
return TYPE_BOOLEAN;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("short")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("short")))
|
||||
{
|
||||
return TYPE_SHORT;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("int")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("int")))
|
||||
{
|
||||
return TYPE_INT;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("long")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("long")))
|
||||
{
|
||||
return TYPE_LONG;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("double")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("double")))
|
||||
{
|
||||
return TYPE_DOUBLE;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("string")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("string")))
|
||||
{
|
||||
return TYPE_STRING;
|
||||
} else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
|
||||
RTL_CONSTASCII_STRINGPARAM("hexBinary")))
|
||||
} else if (xmlreader::Span(
|
||||
text.begin + i + 1, text.length - (i + 1)).
|
||||
equals(RTL_CONSTASCII_STRINGPARAM("hexBinary")))
|
||||
{
|
||||
return TYPE_HEXBINARY;
|
||||
}
|
||||
@ -165,11 +161,11 @@ Type parseType(XmlReader const & reader, Span const & text) {
|
||||
}
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) +
|
||||
convertFromUtf8(text)),
|
||||
text.convertFromUtf8()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
|
||||
bool parseBoolean(Span const & text) {
|
||||
bool parseBoolean(xmlreader::Span const & text) {
|
||||
OSL_ASSERT(text.is());
|
||||
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
|
||||
return true;
|
||||
@ -179,7 +175,7 @@ bool parseBoolean(Span const & text) {
|
||||
}
|
||||
throw css::uno::RuntimeException(
|
||||
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) +
|
||||
convertFromUtf8(text)),
|
||||
text.convertFromUtf8()),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
|
||||
|
@ -33,19 +33,19 @@
|
||||
#include "type.hxx"
|
||||
|
||||
namespace rtl { class OUString; }
|
||||
namespace xmlreader {
|
||||
class XmlReader;
|
||||
struct Span;
|
||||
}
|
||||
|
||||
namespace configmgr {
|
||||
|
||||
class XmlReader;
|
||||
struct Span;
|
||||
|
||||
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(Span const & text);
|
||||
bool parseBoolean(xmlreader::Span const & text);
|
||||
|
||||
rtl::OUString parseTemplateReference(
|
||||
rtl::OUString const & component, bool hasNodeType,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
@ -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
|
||||
..\%COMMON_OUTDIR%\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
|
||||
|
@ -899,11 +899,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const
|
||||
*_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)
|
||||
{
|
||||
|
@ -49,35 +49,6 @@ extern "C"
|
||||
*_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*/)
|
||||
{
|
||||
|
34
connectivity/source/cpool/dbpool2.component
Normal file
34
connectivity/source/cpool/dbpool2.component
Normal 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>
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -78,4 +78,10 @@ DEF1EXPORTFILE= exports.dxp
|
||||
|
||||
.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
|
||||
|
37
connectivity/source/dbtools/dbtools.component
Normal file
37
connectivity/source/dbtools/dbtools.component
Normal 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>
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -95,3 +95,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk
|
||||
@echo _TI >$@
|
||||
@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
|
||||
|
@ -29,13 +29,11 @@
|
||||
#include "precompiled_connectivity.hxx"
|
||||
#include "adabas/BDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::adabas;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -1,4 +1,5 @@
|
||||
/*************************************************************************
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--**********************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -23,37 +24,12 @@
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
**********************************************************************-->
|
||||
|
||||
#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
|
||||
#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
|
||||
|
||||
#include "sal/config.h"
|
||||
|
||||
#include "rtl/strbuf.hxx"
|
||||
#include "sal/types.h"
|
||||
|
||||
#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
|
||||
<component loader="com.sun.star.loader.SharedLibrary"
|
||||
xmlns="http://openoffice.org/2010/uno-components">
|
||||
<implementation name="com.sun.star.comp.sdbcx.adabas.ODriver">
|
||||
<service name="com.sun.star.sdbc.Driver"/>
|
||||
<service name="com.sun.star.sdbcx.Driver"/>
|
||||
</implementation>
|
||||
</component>
|
@ -1,5 +1,4 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
__mh_dylib_header
|
||||
___builtin_delete
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -104,3 +104,11 @@ DEF1EXPORTFILE= exports.dxp
|
||||
|
||||
|
||||
.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
|
||||
|
@ -29,13 +29,11 @@
|
||||
#include "precompiled_connectivity.hxx"
|
||||
#include "ado/ADriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::ado;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -121,31 +94,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
35
connectivity/source/drivers/ado/ado.component
Normal file
35
connectivity/source/drivers/ado/ado.component
Normal 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>
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -112,3 +112,11 @@ dummy:
|
||||
# --- Targets ----------------------------------
|
||||
.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
|
||||
|
@ -29,13 +29,11 @@
|
||||
#include "precompiled_connectivity.hxx"
|
||||
#include "calc/CDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::calc;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
35
connectivity/source/drivers/calc/calc.component
Normal file
35
connectivity/source/drivers/calc/calc.component
Normal 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>
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -94,3 +94,11 @@ DEF1EXPORTFILE= exports.dxp
|
||||
.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
|
||||
|
@ -29,13 +29,11 @@
|
||||
#include "precompiled_connectivity.hxx"
|
||||
#include "dbase/DDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::dbase;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
35
connectivity/source/drivers/dbase/dbase.component
Normal file
35
connectivity/source/drivers/dbase/dbase.component
Normal 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>
|
@ -1,5 +1,4 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
__mh_dylib_header
|
||||
___builtin_delete
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -127,3 +127,11 @@ DEF1EXPORTFILE= exports.dxp
|
||||
.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
|
||||
|
@ -29,13 +29,11 @@
|
||||
#include "precompiled_connectivity.hxx"
|
||||
#include "LDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::evoab;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
@ -35,7 +35,6 @@ using namespace connectivity::evoab;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +96,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
34
connectivity/source/drivers/evoab2/evoab.component
Normal file
34
connectivity/source/drivers/evoab2/evoab.component
Normal 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>
|
@ -110,3 +110,11 @@ DEF1NAME= $(SHL1TARGET)
|
||||
# --- Targets ----------------------------------
|
||||
|
||||
.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
|
||||
|
@ -29,13 +29,11 @@
|
||||
#include "precompiled_connectivity.hxx"
|
||||
#include "flat/EDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::flat;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
35
connectivity/source/drivers/flat/flat.component
Normal file
35
connectivity/source/drivers/flat/flat.component
Normal 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>
|
@ -1,5 +1,4 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
__mh_dylib_header
|
||||
___builtin_delete
|
||||
|
@ -105,3 +105,11 @@ DEF1EXPORTFILE= exports.dxp
|
||||
.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
|
||||
|
@ -30,13 +30,11 @@
|
||||
|
||||
#include "hsqldb/HDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::hsqldb;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -123,31 +96,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -1,5 +1,4 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
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
|
||||
|
35
connectivity/source/drivers/hsqldb/hsqldb.component
Normal file
35
connectivity/source/drivers/hsqldb/hsqldb.component
Normal 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>
|
@ -1,7 +1,6 @@
|
||||
UDK_3_0_0 {
|
||||
global:
|
||||
component_getImplementationEnvironment;
|
||||
component_writeInfo;
|
||||
component_getFactory;
|
||||
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;
|
||||
|
@ -115,3 +115,11 @@ DEF1EXPORTFILE= exports.dxp
|
||||
.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
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
34
connectivity/source/drivers/jdbc/jdbc.component
Normal file
34
connectivity/source/drivers/jdbc/jdbc.component
Normal 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>
|
@ -1,5 +1,4 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
__mh_dylib_header
|
||||
___builtin_delete
|
||||
|
@ -34,7 +34,6 @@ using namespace connectivity;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -47,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -121,31 +95,6 @@ component_getImplementationEnvironment(
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -110,3 +110,11 @@ DEF1EXPORTFILE= exports.dxp
|
||||
.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
|
||||
|
@ -30,13 +30,11 @@
|
||||
|
||||
#include "KDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::kab;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
34
connectivity/source/drivers/kab/kab1.component
Normal file
34
connectivity/source/drivers/kab/kab1.component
Normal 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>
|
@ -138,3 +138,11 @@ dummy:
|
||||
|
||||
.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
|
||||
|
@ -30,13 +30,11 @@
|
||||
|
||||
#include "MacabDriver.hxx"
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace connectivity::macab;
|
||||
using ::rtl::OUString;
|
||||
using ::com::sun::star::uno::Reference;
|
||||
using ::com::sun::star::uno::Sequence;
|
||||
using ::com::sun::star::registry::XRegistryKey;
|
||||
using ::com::sun::star::lang::XSingleServiceFactory;
|
||||
using ::com::sun::star::lang::XMultiServiceFactory;
|
||||
|
||||
@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
|
||||
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
|
||||
{
|
||||
@ -122,31 +95,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron
|
||||
*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(
|
||||
const sal_Char* pImplementationName,
|
||||
|
@ -1,3 +1,2 @@
|
||||
component_getImplementationEnvironment
|
||||
component_writeInfo
|
||||
component_getFactory
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user