Kaydet (Commit) 68ef83db authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

fix buildbreakers in oox, revert token changes for now

üst b7882741
......@@ -36,7 +36,6 @@ $(eval $(call gb_Library_set_include,oox,\
-I$(OUTDIR)/inc \
-I$(OUTDIR)/inc/offuh \
-I$(realpath $(SRCDIR)/oox/inc) \
$(if $(filter YES,$(SYSTEM_OPENSSL)),$(filter -I%,$(OPENSSL_CFLAGS))) \
))
$(eval $(call gb_Library_add_defs,oox,\
......@@ -62,11 +61,7 @@ $(eval $(call gb_Library_add_linked_libs,oox,\
$(gb_STDLIBS) \
))
$(call gb_Library_use_external,oox,openssl)
$(eval $(call gb_Library_add_ldflags,oox,\
$(if $(filter YES,$(SYSTEM_OPENSSL)),$(OPENSSL_LIBS)) \
))
$(eval $(call gb_Library_use_external,oox,openssl))
$(eval $(call gb_Library_set_componentfile,oox,oox/util/oox))
......
oox oox : cppu cppuhelper comphelper filter sal offapi sax basegfx svx xmlscript tools vcl unotools BOOST:boost OPENSSL:openssl LIBXSLT:libxslt NULL
oox oox\prj nmake - all oox_prj NULL
oox oox usr1 - all oox_mkout NULL
oox oox\prj nmake - all oox_prj NULL
..\source\token\tokens.txt %_DEST%\inc\oox\token\tokens.txt
\ No newline at end of file
......@@ -37,7 +37,7 @@ NamespaceMap::NamespaceMap()
static const struct NamespaceUrl { sal_Int32 mnId; const sal_Char* mpcUrl; } spNamespaceUrls[] =
{
// include auto-generated C array with namespace URLs as C strings
#include <token/namespacenames.inc>
#include "namespacenames.inc"
{ -1, "" }
};
......
#*************************************************************************
#
# 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.
#
#*************************************************************************
$ARGV0 = shift @ARGV;
$ARGV1 = shift @ARGV;
$ARGV2 = shift @ARGV;
$ARGV3 = shift @ARGV;
# parse input file
open( INFILE, $ARGV0 ) or die "cannot open input file: $!";
my %namespaces;
while( <INFILE> )
{
# trim newline
chomp( $_ );
# trim leading/trailing whitespace
$_ =~ s/^\s*//g;
$_ =~ s/\s*$//g;
# trim comments
$_ =~ s/^#.*//;
# skip empty lines
if( $_ )
{
# check for valid characters
$_ =~ /^([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
$namespaces{$1} = $2;
}
}
close( INFILE );
# generate output files
open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
# number of bits to shift the namespace identifier
$shift = 16;
print ( IDFILE "const size_t NMSP_SHIFT = $shift;\n" );
$i = 1;
foreach( keys( %namespaces ) )
{
print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" );
$id = $i << $shift;
print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" );
print( TXTFILE "$id $_ $namespaces{$_}\n" );
++$i;
}
close( IDFILE );
close( nameFILE );
close( TXTFILE );
......@@ -25,33 +25,43 @@
#
#*************************************************************************
# operation mode (1 = identifiers, 2 = names)
$op = shift @ARGV;
die "Error: invalid operation" unless( $op >= 1 && $op <= 2);
$ARGV0 = shift @ARGV;
$ARGV1 = shift @ARGV;
$ARGV2 = shift @ARGV;
$i = 0;
while( <> ) {
# parse input file
open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!";
my %props;
while( <INFILE> )
{
# trim newline
chomp( $_ );
# trim leading/trailing whitespace
$_ =~ s/^\s*//g;
$_ =~ s/\s*$//g;
# skip empty lines
if( $_ ) {
# check for valid characters
$_ =~ /^[A-Z][a-zA-Z0-9]+$/ or die "Error: invalid entry: '$_'";
# generate output
if( $op == 1 ) {
print( "const sal_Int32 PROP_$_ = $i;\n" );
} elsif( $op == 2 ) {
print( "/* $i */ \"$_\",\n" );
}
++$i;
}
# check for valid characters
$_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "Error: invalid character in property '$_'";
$id = "PROP_$_";
$props{$_} = $id;
}
close( INFILE );
# generate output files
open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
if( $op == 1 ) {
print( "const sal_Int32 PROP_COUNT = $i;\nconst sal_Int32 PROP_INVALID = -1;\n" );
} elsif( $op == 2 ) {
print( " \"\"\n" );
$i = 0;
foreach( sort( keys( %props ) ) )
{
print( IDFILE "const sal_Int32 $props{$_} = $i;\n" );
print( NAMEFILE "/* $i */ \"$_\",\n" );
++$i;
}
print( IDFILE "const sal_Int32 PROP_COUNT = $i;\n" );
print( IDFILE "const sal_Int32 PROP_INVALID = -1;\n" );
close( IDFILE );
close( NAMEFILE );
......@@ -37,7 +37,8 @@ PropertyNameVector::PropertyNameVector()
static const sal_Char* sppcPropertyNames[] =
{
// include auto-generated C array with property names as C strings
#include <token/propertynames.inc>
#include "propertynames.inc"
""
};
size_t nArraySize = (sizeof( sppcPropertyNames ) / sizeof( *sppcPropertyNames )) - 1;
......
......@@ -43,10 +43,8 @@ using ::rtl::OUString;
// ============================================================================
namespace {
// include auto-generated Perfect_Hash class
#include <token/tokenhash.inc>
// include auto-generated Perfect_Hash
#include "tokenhash.inc"
} // namespace
// ============================================================================
......@@ -57,7 +55,7 @@ TokenMap::TokenMap() :
static const sal_Char* sppcTokenNames[] =
{
// include auto-generated C array with token names as C strings
#include <token/tokennames.inc>
#include "tokennames.inc"
""
};
......@@ -70,14 +68,14 @@ TokenMap::TokenMap() :
}
#if OSL_DEBUG_LEVEL > 0
// check that the Perfect_Hash is in sync with the token name list
// check that the perfect_hash is in sync with the token name list
bool bOk = true;
for( sal_Int32 nToken = 0; bOk && (nToken < XML_TOKEN_COUNT); ++nToken )
{
// check that the getIdentifier <-> getToken roundtrip works
OString aUtf8Name = OUStringToOString( maTokenNames[ nToken ].maUniName, RTL_TEXTENCODING_UTF8 );
const XMLTokenInfo* pTokenInfo = Perfect_Hash::getTokenInfo( aUtf8Name.getStr(), aUtf8Name.getLength() );
bOk = pTokenInfo && (pTokenInfo->mnToken == nToken);
struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() );
bOk = pToken && (pToken->nToken == nToken);
OSL_ENSURE( bOk, ::rtl::OStringBuffer( "TokenMap::TokenMap - token list broken, #" ).
append( nToken ).append( ", '" ).append( aUtf8Name ).append( '\'' ).getStr() );
}
......@@ -98,8 +96,8 @@ OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const
sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
{
OString aUtf8Name = OUStringToOString( rUnicodeName, RTL_TEXTENCODING_UTF8 );
const XMLTokenInfo* pTokenInfo = Perfect_Hash::getTokenInfo( aUtf8Name.getStr(), aUtf8Name.getLength() );
return pTokenInfo ? pTokenInfo->mnToken : XML_TOKEN_INVALID;
struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() );
return pToken ? pToken->nToken : XML_TOKEN_INVALID;
}
Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const
......@@ -111,9 +109,9 @@ Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const
sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) const
{
const XMLTokenInfo* pTokenInfo = Perfect_Hash::getTokenInfo(
struct xmltoken* pToken = Perfect_Hash::in_word_set(
reinterpret_cast< const char* >( rUtf8Name.getConstArray() ), rUtf8Name.getLength() );
return pTokenInfo ? pTokenInfo->mnToken : XML_TOKEN_INVALID;
return pToken ? pToken->nToken : XML_TOKEN_INVALID;
}
// ============================================================================
......
......@@ -25,55 +25,56 @@
#
#*************************************************************************
# operation mode (1 = identifiers, 2 = names, 3 = gperf)
$op = shift @ARGV;
die "Error: invalid operation" unless( $op >= 1 && $op <= 3);
$ARGV0 = shift @ARGV;
$ARGV1 = shift @ARGV;
$ARGV2 = shift @ARGV;
$ARGV3 = shift @ARGV;
if( $op == 3 ) {
print( "%language=C++\n" );
print( "%define slot-name mpcName\n" );
print( "%define initializer-suffix ,0\n" );
print( "%define lookup-function-name getTokenInfo\n" );
print( "%compare-strncmp\n" );
print( "%readonly-tables\n" );
print( "%enum\n" );
print( "%null-strings\n" );
print( "%struct-type\n" );
print( "struct XMLTokenInfo {\n" );
print( " const sal_Char* mpcName;\n" );
print( " sal_Int32 mnToken;\n" );
print( "};\n" );
print( "%%\n" );
}
$i = 0;
while( <> )
open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!";
my %tokens;
while ( <INFILE> )
{
# trim newline
chomp( $_ );
# trim leading/trailing whitespace
$_ =~ s/^\s*//g;
$_ =~ s/\s*$//g;
# skip empty lines
if( $_ ) {
# check for valid characters
$_ =~ /^[a-zA-Z0-9-_]+$/ or die "Error: invalid entry: '$_'";
# generate output
$id = "XML_$_";
$id =~ s/-/_/g;
if( $op == 1 ) {
print( "const sal_Int32 $id = $i;\n" );
} elsif( $op == 2 ) {
print( "\"$_\",\n" );
} elsif( $op == 3 ) {
print( "$_,$id\n" );
}
++$i;
}
# check for valid characters
$_ =~ /^[a-zA-Z0-9-_]+$/ or die "Error: invalid character in token '$_'";
$id = "XML_$_";
$id =~ s/-/_/g;
$tokens{$_} = $id;
}
close ( INFILE );
# generate output files
open ( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
open ( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
open ( GPERFFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
if( $op == 1 ) {
print( "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
} elsif( $op == 3 ) {
print( "%%\n" );
print( GPERFFILE "%language=C++\n" );
print( GPERFFILE "%global-table\n" );
print( GPERFFILE "%null-strings\n" );
print( GPERFFILE "%struct-type\n" );
print( GPERFFILE "struct xmltoken {\n" );
print( GPERFFILE " const sal_Char *name;\n" );
print( GPERFFILE " sal_Int32 nToken;\n" );
print( GPERFFILE "};\n" );
print( GPERFFILE "%%\n" );
$i = 0;
foreach( sort( keys( %tokens ) ) )
{
print( IDFILE "const sal_Int32 $tokens{$_} = $i;\n" );
print( NAMEFILE "\"$_\",\n" );
print( GPERFFILE "$_,$tokens{$_}\n" );
++$i;
}
print( IDFILE "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
print( GPERFFILE "%%\n" );
close( IDFILE );
close( NAMEFILE );
close( GPERFFILE );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment