You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2013/12/16 17:48:12 UTC
svn commit: r1551260 [2/4] - in /openoffice/branches/rejuvenate01: ./
main/instsetoo_native/util/ main/padmin/source/ main/solenv/bin/
main/solenv/bin/modules/installer/ main/solenv/bin/modules/installer/patch/
main/solenv/bin/modules/installer/windows...
Modified: openoffice/branches/rejuvenate01/main/solenv/bin/patch_tool.pl
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/solenv/bin/patch_tool.pl?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/solenv/bin/patch_tool.pl (original)
+++ openoffice/branches/rejuvenate01/main/solenv/bin/patch_tool.pl Mon Dec 16 16:48:11 2013
@@ -38,6 +38,8 @@ use installer::patch::Msi;
use installer::patch::ReleasesList;
use installer::patch::Version;
+#use Carp::Always;
+
use strict;
@@ -64,6 +66,10 @@ use strict;
The version that is to be patched.
--target-version <major>.<minor>.<micro>
The version after the patch has been applied.
+ --language <language-code>
+ Language of the installation sets.
+ --package-format
+ Only the package format 'msi' is supported at the moment.
=head1 DESCRIPTION
@@ -80,7 +86,6 @@ use strict;
=cut
-# my $ImageFamily = "MNPapps";
# The ImageFamily name has to have 1-8 alphanumeric characters.
my $ImageFamily = "AOO";
my $SourceImageName = "Source";
@@ -90,21 +95,26 @@ my $TargetImageName = "Target";
sub ProcessCommandline ()
{
- my $arguments = {
+ my $context = {
'product-name' => undef,
'output-path' => undef,
'data-path' => undef,
'lst-file' => undef,
'source-version' => undef,
- 'target-version' => undef};
+ 'target-version' => undef,
+ 'language' => undef,
+ 'package-format' => undef
+ };
if ( ! GetOptions(
- "product-name=s", \$arguments->{'product-name'},
- "output-path=s", \$arguments->{'output-path'},
- "data-path=s" => \$arguments->{'data-path'},
- "lst-file=s" => \$arguments->{'lst-file'},
- "source-version:s" => \$arguments->{'source-version'},
- "target-version:s" => \$arguments->{'target-version'}
+ "product-name=s", \$context->{'product-name'},
+ "output-path=s", \$context->{'output-path'},
+ "data-path=s" => \$context->{'data-path'},
+ "lst-file=s" => \$context->{'lst-file'},
+ "source-version:s" => \$context->{'source-version'},
+ "target-version:s" => \$context->{'target-version'},
+ "language=s" => \$context->{'language'},
+ "package-format=s" => \$context->{'package-format'}
))
{
pod2usage(2);
@@ -112,14 +122,9 @@ sub ProcessCommandline ()
# Only the command should be left in @ARGV.
pod2usage(2) unless scalar @ARGV == 1;
- $arguments->{'command'} = shift @ARGV;
-
- # At the moment we only support patches on windows. When this
- # is extended in the future we need the package format as an
- # argument.
- $arguments->{'package-format'} = "msi";
+ $context->{'command'} = shift @ARGV;
- return $arguments;
+ return $context;
}
@@ -181,46 +186,28 @@ sub ProvideInstallationSets ($$)
-sub GetLanguages ()
+sub IsLanguageValid ($$$)
{
- # The set of languages is taken from the WITH_LANG environment variable.
- # If that is missing or is empty then the default 'en-US' is used instead.
- my @languages = ("en-US");
- my $with_lang = $ENV{'WITH_LANG'};
- if (defined $with_lang && $with_lang ne "")
- {
- @languages = split(/\s+/, $with_lang);
- }
- return @languages;
-}
-
-
+ my ($context, $release_data, $language) = @_;
+ my $normalized_language = installer::languages::get_normalized_language($language);
-sub FindValidLanguages ($$$)
-{
- my ($context, $release_data, $languages) = @_;
-
- my @valid_languages = ();
- foreach my $language (@$languages)
+ if ( ! ProvideInstallationSets($context, $language))
{
- if ( ! ProvideInstallationSets($context, $language))
- {
- installer::logger::PrintError(" '%s' has no target installation set\n", $language);
- }
- elsif ( ! defined $release_data->{$language})
- {
- installer::logger::PrintError(" '%s' is not a released language for version %s\n",
- $language,
- $context->{'source-version'});
- }
- else
- {
- push @valid_languages, $language;
- }
+ installer::logger::PrintError(" '%s' has no target installation set\n", $language);
+ return 0;
+ }
+ elsif ( ! defined $release_data->{$normalized_language})
+ {
+ installer::logger::PrintError(" '%s' is not a released language for version %s\n",
+ $language,
+ $context->{'source-version'});
+ return 0;
+ }
+ else
+ {
+ return 1;
}
-
- return @valid_languages;
}
@@ -327,6 +314,19 @@ sub DetermineVersions ($$)
}
$context->{'source-version'} = $last_release;
}
+
+ if (defined $context->{'source-version'})
+ {
+ $context->{'source-version-dash'} = installer::patch::Version::ArrayToDirectoryName(
+ installer::patch::Version::StringToNumberArray(
+ $context->{'source-version'}));
+ }
+ if (defined $context->{'target-version'})
+ {
+ $context->{'target-version-dash'} = installer::patch::Version::ArrayToDirectoryName(
+ installer::patch::Version::StringToNumberArray(
+ $context->{'target-version'}));
+ }
}
@@ -352,7 +352,7 @@ sub CheckUpgradeCode($$)
}
else
{
- $installer::logger::Info->printf("OK: UpgradeCode values are identical\n");
+ $installer::logger::Info->printf("OK: UpgradeCode values are different\n");
return 1;
}
}
@@ -382,7 +382,7 @@ sub CheckProductCode($$)
}
else
{
- $installer::logger::Info->printf("OK: ProductCode properties differ\n");
+ $installer::logger::Info->printf("OK: ProductCodes are identical\n");
return 1;
}
}
@@ -501,25 +501,60 @@ sub CheckNewFiles($$)
# Create data structures for fast lookup.
my %source_file_map = map {$_->GetValue("File") => $_} @{$source_file_table->GetAllRows()};
- my @target_files = map {$_->GetValue("File")} @{$target_file_table->GetAllRows()};
+ my %target_files_map = map {$_->GetValue("File") => $_} @{$target_file_table->GetAllRows()};
# Search for added files (files in target that where not in source).
- my $added_file_count = 0;
- foreach my $uniquename (@target_files)
+ my @added_files = ();
+ foreach my $uniquename (keys %target_files_map)
{
if ( ! defined $source_file_map{$uniquename})
{
- ++$added_file_count;
+ push @added_files, $target_files_map{$uniquename};
}
}
- if ($added_file_count > 0)
+ if (scalar @added_files > 0)
{
- $installer::logger::Info->printf("Warning: %d files have been added\n", $added_file_count);
+ $installer::logger::Info->printf("Warning: %d files have been added\n", scalar @added_files);
- $installer::logger::Info->printf("Check for new files being part of new components is not yet implemented\n");
-
- return 1;
+ # Prepare component tables and hashes.
+ my $source_component_table = $source_msi->GetTable("Component");
+ my $target_component_table = $target_msi->GetTable("Component");
+ die unless defined $source_component_table && defined $target_component_table;
+ my %source_component_map = map {$_->GetValue('Component') => $_} @{$source_component_table->GetAllRows()};
+ my %target_component_map = map {$_->GetValue('Component') => $_} @{$target_component_table->GetAllRows()};
+
+ my @new_files_with_existing_components = ();
+ foreach my $target_file_row (@added_files)
+ {
+ $installer::logger::Info->printf(" %s (%s)\n",
+ $target_file_row->GetValue("FileName"),
+ $target_file_row->GetValue("File"));
+
+ # Get target component for target file.
+ my $target_component = $target_file_row->GetValue('Component_');
+
+ # Check that the component is not part of the source components.
+ if (defined $source_component_map{$target_component})
+ {
+ push @new_files_with_existing_components, $target_file_row;
+ }
+ }
+
+ if (scalar @new_files_with_existing_components > 0)
+ {
+ $installer::logger::Info->printf(
+ "Error: %d new files have existing components (which must also be new)\n",
+ scalar @new_files_with_existing_components);
+ return 0;
+ }
+ else
+ {
+ $installer::logger::Info->printf(
+ "OK: all %d new files also have new components\n",
+ scalar @added_files);
+ return 1;
+ }
}
else
{
@@ -531,13 +566,96 @@ sub CheckNewFiles($$)
-=head2 CheckComponentSets($source_msi, $target_msi)
+=head2 CheckFeatureSets($source_msi, $target_msi)
+
+ Features must not be removed but can be added.
+ Parent features of new features also have to be new.
+
+=cut
+sub CheckFeatureSets($$)
+{
+ my ($source_msi, $target_msi) = @_;
+
+ # Get the 'Feature' tables.
+ my $source_feature_table = $source_msi->GetTable("Feature");
+ my $target_feature_table = $target_msi->GetTable("Feature");
+
+ # Create data structures for fast lookup.
+ my %source_feature_map = map {$_->GetValue("Feature") => $_} @{$source_feature_table->GetAllRows()};
+ my %target_feature_map = map {$_->GetValue("Feature") => $_} @{$target_feature_table->GetAllRows()};
+
+ # Check that no feature has been removed.
+ my @removed_features = ();
+ foreach my $feature_name (keys %source_feature_map)
+ {
+ if ( ! defined $target_feature_map{$feature_name})
+ {
+ push @removed_features, $feature_name;
+ }
+ }
+ if (scalar @removed_features > 0)
+ {
+ # There are removed features.
+ $installer::logger::Info->printf(
+ "Error: %d features have been removed:\n",
+ scalar @removed_features);
+ $installer::logger::Info->printf(" %s\n", join(", ", @removed_features));
+ return 0;
+ }
+
+ # Check that added features belong to new parent features.
+ my @added_features = ();
+ foreach my $feature_name (keys %target_feature_map)
+ {
+ if ( ! defined $source_feature_map{$feature_name})
+ {
+ push @added_features, $feature_name;
+ }
+ }
+
+ if (scalar @added_features > 0)
+ {
+ $installer::logger::Info->printf("Warning: %d features have been addded\n", scalar @added_features);
+
+ my @new_features_with_existing_parents = ();
+ foreach my $new_feature (@added_features)
+ {
+ my $target_feature = $target_feature_map{$new_feature};
+ if (defined $source_feature_map{$target_feature->{'Feature_Parent'}})
+ {
+ push @new_features_with_existing_parents, $target_feature;
+ }
+ }
+
+ if (scalar @new_features_with_existing_parents > 0)
+ {
+ $installer::logger::Info->printf(
+ "Error: %d new features have existing parents (which also must be new)\n",
+ scalar @new_features_with_existing_parents);
+ return 0;
+ }
+ else
+ {
+ $installer::logger::Info->printf(
+ "OK: parents of all new features are also new\n");
+ return 1;
+ }
+ }
+
+ $installer::logger::Info->printf("OK: feature sets in source and target are compatible\n");
+ return 1;
+}
+
+
+
+
+=head2 CheckRemovedComponents($source_msi, $target_msi)
Components must not be removed but can be added.
Features of added components have also to be new.
=cut
-sub CheckComponentSets($$)
+sub CheckRemovedComponents ($$)
{
my ($source_msi, $target_msi) = @_;
@@ -558,7 +676,12 @@ sub CheckComponentSets($$)
push @removed_components, $componentname;
}
}
- if (scalar @removed_components > 0)
+ if (scalar @removed_components == 0)
+ {
+ $installer::logger::Info->printf("OK: no removed components\n");
+ return 1;
+ }
+ else
{
# There are removed components.
@@ -587,48 +710,115 @@ sub CheckComponentSets($$)
return 0;
}
}
+}
+
+
+
+
+sub GetTableAndMap ($$$)
+{
+ my ($msi, $table_name, $index_column) = @_;
+
+ my $table = $msi->GetTable($table_name);
+ my %map = map {$_->GetValue($index_column) => $_} @{$table->GetAllRows()};
+
+ return ($table, \%map);
+}
+
+
+=head2 CheckAddedComponents($source_msi, $target_msi)
+
+ Components can be added.
+ Features of added components have also to be new.
+
+=cut
+sub CheckAddedComponents ($$)
+{
+ my ($source_msi, $target_msi) = @_;
+
+ # Get the 'Component' tables and maps.
+ my ($source_component_table, $source_component_map)
+ = GetTableAndMap($source_msi, "Component", "Component");
+ my ($target_component_table, $target_component_map)
+ = GetTableAndMap($target_msi, "Component", "Component");
# Check that added components belong to new features.
my @added_components = ();
- foreach my $componentname (keys %target_component_map)
+ foreach my $componentname (keys %$target_component_map)
{
- if ( ! defined $source_component_map{$componentname})
+ if ( ! defined $source_component_map->{$componentname})
{
push @added_components, $componentname;
}
}
- if (scalar @added_components > 0)
+ if (scalar @added_components == 0)
{
- # Check if any of them is not a registry component.
- my $is_file_component_removed = 0;
- foreach my $componentname (@removed_components)
- {
- if ($componentname !~ /^registry/)
- {
- $is_file_component_removed = 1;
- }
- }
-
- if ($is_file_component_removed)
- {
- $installer::logger::Info->printf(
- "Warning: %d components have been addded\n",
- scalar @added_components);
- $installer::logger::Info->printf(
- "Test for new components belonging to new features has not yet been implemented\n");
- return 0;
- }
- else
- {
- $installer::logger::Info->printf(
- "Warning: %d components have been addded, all of them registry components\n",
- scalar @added_components);
- }
+ $installer::logger::Info->printf("OK: no new components\n");
+ return 1;
}
+ else
+ {
+ $installer::logger::Info->printf(
+ "Warning: %d components have been addded\n",
+ scalar @added_components);
+
+ # Check that the referencing features are also new.
+ my $target_feature_component_table = $target_msi->GetTable("FeatureComponents");
+
+ my $error = 0;
+ foreach my $component_name (@added_components)
+ {
+ my @feature_names = ();
+ foreach my $feature_component_row (@{$target_feature_component_table->GetAllRows()})
+ {
+ if ($feature_component_row->GetValue("Component_") eq $component_name)
+ {
+ my $feature_name = $feature_component_row->GetValue("Feature_");
+ push @feature_names, $feature_name;
+ }
+ }
+ if (scalar @feature_names == 0)
+ {
+ $installer::logger::Info->printf("Error: no feature found for component '%s'\n", $component_name);
+ $error = 1;
+ }
+ else
+ {
+ # Check that the referenced features are new and have new parents (if they have parents).
+ my ($source_feature_table, $source_feature_map)
+ = GetTableAndMap($source_msi, "Feature", "Feature");
+ my ($target_feature_table, $target_feature_map)
+ = GetTableAndMap($target_msi, "Feature", "Feature");
+ foreach my $feature_name (@feature_names)
+ {
+ $installer::logger::Info->printf(" component '%s' -> feature '%s'\n",
+ $component_name,
+ $feature_name);
+ my $source_feature_row = $source_feature_map->{$feature_name};
+ if (defined $source_feature_row)
+ {
+ $installer::logger::Info->printf("Warning(Error?): feature of new component is not new\n");
+ $error = 1;
+ }
+ else
+ {
+ # Feature is new. Check that the parent feature is also new.
+ my $target_feature_row = $target_feature_map->{$feature_name};
+ my $parent_feature_name = $target_feature_row->GetValue("Feature_Parent");
+ if ($parent_feature_name ne "" && defined $source_feature_map->{$parent_feature_name})
+ {
+ $installer::logger::Info->printf("Warning(Error?): parent feature of new component is not new\n");
+ $error = 1;
+ }
+ }
+ }
+ }
+ }
- $installer::logger::Info->printf("OK: component sets in source and target are compatible\n");
- return 1;
+# return !$error;
+ return 1;
+ }
}
@@ -962,6 +1152,131 @@ sub CheckComponentKeyPath ($$)
+sub GetMissingReferences ($$$$$)
+{
+ my ($table, $key, $map, $what, $report_key) = @_;
+
+ my @missing_references = ();
+
+ foreach my $row (@{$table->GetAllRows()})
+ {
+ my $value = $row->GetValue($key);
+ if ($value ne "" && ! defined $map->{$value})
+ {
+ push @missing_references, [$what, $row->GetValue($report_key), $value];
+ }
+ }
+
+ return @missing_references;
+}
+
+
+
+
+=head CheckAllReferences ($msi)
+
+ Check references from files and registry entries to components,
+ from components to features, and between features.
+
+=cut
+
+sub CheckAllReferences ($)
+{
+ my ($msi) = @_;
+
+ # Set up tables and maps for easy iteration and fast lookups.
+
+ my $feature_table = $msi->GetTable("Feature");
+ my $component_table = $msi->GetTable("Component");
+ my $feature_component_table = $msi->GetTable("FeatureComponents");
+ my $file_table = $msi->GetTable("File");
+ my $registry_table = $msi->GetTable("Registry");
+ my $directory_table = $msi->GetTable("Directory");
+
+ my %feature_map = map {$_->GetValue("Feature") => $_} @{$feature_table->GetAllRows()};
+ my %component_map = map {$_->GetValue("Component") => $_} @{$component_table->GetAllRows()};
+ my %directory_map = map {$_->GetValue("Directory") => $_} @{$directory_table->GetAllRows()};
+
+ my @missing_references = ();
+
+ # Check references from files and registry entries to components.
+ push @missing_references, GetMissingReferences(
+ $file_table,
+ "Component_",
+ \%component_map,
+ "file->component",
+ "File");
+ push @missing_references, GetMissingReferences(
+ $registry_table,
+ "Component_",
+ \%component_map,
+ "registry->component",
+ "Registry");
+
+ # Check references between features and components.
+ push @missing_references, GetMissingReferences(
+ $feature_component_table,
+ "Feature_",
+ \%feature_map,
+ "component->feature",
+ "Component_");
+ push @missing_references, GetMissingReferences(
+ $feature_component_table,
+ "Component_",
+ \%component_map,
+ "feature->component",
+ "Feature_");
+
+ # Check references between features.
+ push @missing_references, GetMissingReferences(
+ $feature_table,
+ 'Feature_Parent',
+ \%feature_map,
+ "feature->feature",
+ 'Feature');
+
+ # Check references between directories.
+ push @missing_references, GetMissingReferences(
+ $directory_table,
+ 'Directory_Parent',
+ \%directory_map,
+ "directory->directory",
+ 'Directory');
+
+ # Check references from components to directories.
+ push @missing_references, GetMissingReferences(
+ $component_table,
+ 'Directory_',
+ \%directory_map,
+ "component->directory",
+ 'Component');
+
+ # Check references from components to files (via the .
+
+ # Report the result.
+ if (scalar @missing_references > 0)
+ {
+ $installer::logger::Info->printf("Error: there are %d missing references\n", scalar @missing_references);
+ foreach my $reference (@missing_references)
+ {
+ $installer::logger::Info->printf(" %s : %s -> %s\n",
+ $reference->[0],
+ $reference->[1],
+ $reference->[2]);
+ }
+ return 0;
+ }
+ else
+ {
+ $installer::logger::Info->printf("OK: all references are OK\n");
+ return 1;
+
+ }
+}
+
+
+
+
sub Check ($$$$)
{
my ($source_msi, $target_msi, $variables, $product_name) = @_;
@@ -971,22 +1286,37 @@ sub Check ($$$$)
my $result = 1;
- $result &&= CheckUpgradeCode($source_msi, $target_msi);
- $result &&= CheckProductCode($source_msi, $target_msi);
- $result &&= CheckBuildIdCode($source_msi, $target_msi);
- $result &&= CheckProductName($source_msi, $target_msi);
- $result &&= CheckRemovedFiles($source_msi, $target_msi);
- $result &&= CheckNewFiles($source_msi, $target_msi);
- $result &&= CheckComponentSets($source_msi, $target_msi);
- $result &&= CheckComponentValues($source_msi, $target_msi, $variables);
- $result &&= CheckFileSequence($source_msi, $target_msi);
- $result &&= CheckFileSequenceUnique($source_msi, $target_msi);
- $result &&= CheckFileSequenceHoles($source_msi, $target_msi);
- $result &&= CheckRegistryItems($source_msi, $target_msi, $product_name);
- $result &&= CheckComponentKeyPath($source_msi, $target_msi);
+ # Using &= below to avoid lazy evaluation. Even if there are errors, all checks shall be run.
+ $result &= CheckUpgradeCode($source_msi, $target_msi);
+ $result &= CheckProductCode($source_msi, $target_msi);
+ $result &= CheckBuildIdCode($source_msi, $target_msi);
+ $result &= CheckProductName($source_msi, $target_msi);
+ $result &= CheckRemovedFiles($source_msi, $target_msi);
+ $result &= CheckNewFiles($source_msi, $target_msi);
+ $result &= CheckFeatureSets($source_msi, $target_msi);
+ $result &= CheckRemovedComponents($source_msi, $target_msi);
+ $result &= CheckAddedComponents($source_msi, $target_msi);
+ $result &= CheckComponentValues($source_msi, $target_msi, $variables);
+ $result &= CheckFileSequence($source_msi, $target_msi);
+ $result &= CheckFileSequenceUnique($source_msi, $target_msi);
+ $result &= CheckFileSequenceHoles($source_msi, $target_msi);
+ $result &= CheckRegistryItems($source_msi, $target_msi, $product_name);
+ $result &= CheckComponentKeyPath($source_msi, $target_msi);
+ $result &= CheckAllReferences($target_msi);
$installer::logger::Info->decrease_indentation();
+ if ($result)
+ {
+ $installer::logger::Info->printf("OK: Source and target releases are compatible.\n");
+ }
+ else
+ {
+ $installer::logger::Info->printf("Error: Source and target releases are not compatible.\n");
+ $installer::logger::Info->printf(" => Can not create patch.\n");
+ $installer::logger::Info->printf(" Did you create the target installation set with 'release=t' ?\n");
+ }
+
return $result;
}
@@ -1232,8 +1562,8 @@ sub CreatePcp ($$$$$$%)
}
my $pcp = installer::patch::Msi->new(
$pcp_filename,
- undef,
- undef,
+ $target_msi->{'version'},
+ $target_msi->{'is_current_version'},
$language,
$context->{'product-name'});
@@ -1281,7 +1611,6 @@ sub ShowLog ($$$$)
"/o", "'".installer::patch::Tools::ToWindowsPath($destination_path)."'");
printf("running command $command\n");
my $response = qx($command);
- printf("response is '%s'\n", $response);
my @candidates = glob($destination_path . "/Details*");
foreach my $candidate (@candidates)
{
@@ -1306,8 +1635,8 @@ sub ShowLog ($$$$)
close $in;
close $out;
- my $URL = $new_name;
- $URL =~ s/\/c\//c|\//;
+ my $URL = File::Spec->rel2abs($new_name);
+ $URL =~ s/\/cygdrive\/(.)\//$1|\//;
$URL =~ s/^(.):/$1|/;
$URL = "file:///". $URL;
$installer::logger::Info->printf("open %s in your browser to see the log messages\n", $URL);
@@ -1344,13 +1673,17 @@ sub CreateMsp ($)
|| die ("can not create temporary path ".$temporary_msimsp_path);
}
$installer::logger::Info->printf("running msimsp.exe, that will take a while\n");
+ my $create_performance_log = 0;
my $command = join(" ",
"msimsp.exe",
"-s", "'".installer::patch::Tools::ToWindowsPath($pcp->{'filename'})."'",
"-p", "'".installer::patch::Tools::ToWindowsPath($pcp->{'msp_filename'})."'",
"-l", "'".installer::patch::Tools::ToWindowsPath($log_filename)."'",
"-f", "'".installer::patch::Tools::ToWindowsPath($temporary_msimsp_path)."'");
-# "-lp", MsiTools::ToEscapedWindowsPath($performance_log_filename),
+ if ($create_performance_log)
+ {
+ $command .= " -lp " . MsiTools::ToEscapedWindowsPath($performance_log_filename);
+ }
$installer::logger::Info->printf("running command %s\n", $command);
my $response = qx($command);
$installer::logger::Info->printf("response of msimsp is %s\n", $response);
@@ -1361,7 +1694,60 @@ sub CreateMsp ($)
# Show the log file that was created by the msimsp.exe command.
ShowLog($log_path, $log_filename, $log_basename, "msp creation");
- ShowLog($log_path, $performance_log_filename, $performance_log_basename, "msp creation perf");
+ if ($create_performance_log)
+ {
+ ShowLog($log_path, $performance_log_filename, $performance_log_basename, "msp creation perf");
+ }
+}
+
+
+sub ProvideMsis ($$$)
+{
+ my ($context, $variables, $language) = @_;
+
+ # 2a. Provide .msi and .cab files and unpack .cab for the source release.
+ $installer::logger::Info->printf("locating source package (%s)\n", $context->{'source-version'});
+ $installer::logger::Info->increase_indentation();
+ if ( ! installer::patch::InstallationSet::ProvideUnpackedCab(
+ $context->{'source-version'},
+ 0,
+ $language,
+ "msi",
+ $context->{'product-name'}))
+ {
+ die "could not provide unpacked .cab file";
+ }
+ my $source_msi = installer::patch::Msi->FindAndCreate(
+ $context->{'source-version'},
+ 0,
+ $language,
+ $context->{'product-name'});
+ die unless defined $source_msi;
+ die unless $source_msi->IsValid();
+ $installer::logger::Info->decrease_indentation();
+
+ # 2b. Provide .msi and .cab files and unpacked .cab for the target release.
+ $installer::logger::Info->printf("locating target package (%s)\n", $context->{'target-version'});
+ $installer::logger::Info->increase_indentation();
+ if ( ! installer::patch::InstallationSet::ProvideUnpackedCab(
+ $context->{'target-version'},
+ 1,
+ $language,
+ "msi",
+ $context->{'product-name'}))
+ {
+ die;
+ }
+ my $target_msi = installer::patch::Msi->FindAndCreate(
+ $context->{'target-version'},
+ 0,
+ $language,
+ $context->{'product-name'});
+ die unless defined $target_msi;
+ die unless $target_msi->IsValid();
+ $installer::logger::Info->decrease_indentation();
+
+ return ($source_msi, $target_msi);
}
@@ -1400,57 +1786,23 @@ sub CreatePatch ($$)
->{$context->{'package-format'}};
# 1. Determine the set of languages for which we can create patches.
- my @requested_languages = GetLanguages();
- my @valid_languages = FindValidLanguages($context, $release_data, \@requested_languages);
- $installer::logger::Info->printf("of the requested languages '%s' are valid: '%s'\n",
- join("', '", @requested_languages),
- join("', '", @valid_languages));
- foreach my $language (@valid_languages)
+ my $language = $context->{'language'};
+ my %no_ms_lang_locale_map = map {$_=>1} @installer::globals::noMSLocaleLangs;
+ if (defined $no_ms_lang_locale_map{$language})
{
- $installer::logger::Info->printf("processing language '%s'\n", $language);
- $installer::logger::Info->increase_indentation();
+ $language = "en-US_".$language;
+ }
- # 2a. Provide .msi and .cab files and unpacke .cab for the source release.
- $installer::logger::Info->printf("locating source package (%s)\n", $context->{'source-version'});
+ if ( ! IsLanguageValid($context, $release_data, $language))
+ {
+ $installer::logger::Info->printf("can not create patch for language '%s'\n", $language);
+ }
+ else
+ {
+ $installer::logger::Info->printf("processing language '%s'\n", $language);
$installer::logger::Info->increase_indentation();
- if ( ! installer::patch::InstallationSet::ProvideUnpackedCab(
- $context->{'source-version'},
- 0,
- $language,
- "msi",
- $context->{'product-name'}))
- {
- die "could not provide unpacked .cab file";
- }
- my $source_msi = installer::patch::Msi->FindAndCreate(
- $context->{'source-version'},
- 0,
- $language,
- $context->{'product-name'});
- die unless $source_msi->IsValid();
- $installer::logger::Info->decrease_indentation();
-
- # 2b. Provide .msi and .cab files and unpacke .cab for the target release.
- $installer::logger::Info->printf("locating target package (%s)\n", $context->{'target-version'});
- $installer::logger::Info->increase_indentation();
- if ( ! installer::patch::InstallationSet::ProvideUnpackedCab(
- $context->{'target-version'},
- 1,
- $language,
- "msi",
- $context->{'product-name'}))
- {
- die;
- }
- my $target_msi = installer::patch::Msi->FindAndCreate(
- $context->{'target-version'},
- 0,
- $language,
- $context->{'product-name'});
- die unless defined $target_msi;
- die unless $target_msi->IsValid();
- $installer::logger::Info->decrease_indentation();
+ my ($source_msi, $target_msi) = ProvideMsis($context, $variables, $language);
# Trigger reading of tables.
foreach my $table_name (("File", "Component", "Registry"))
@@ -1463,15 +1815,8 @@ sub CreatePatch ($$)
# 3. Check if the source and target msis fullfil all necessary requirements.
if ( ! Check($source_msi, $target_msi, $variables, $context->{'product-name'}))
{
- $installer::logger::Info->printf("Error: Source and target releases are not compatible.\n");
- $installer::logger::Info->printf(" => Can not create patch.\n");
- $installer::logger::Info->printf(" Did you create the target installation set with 'release=t' ?\n");
exit(1);
}
- else
- {
- $installer::logger::Info->printf("OK: Source and target releases are compatible.\n");
- }
# Provide the base path for creating .pcp and .mcp file.
my $msp_path = File::Spec->catfile(
@@ -1479,12 +1824,12 @@ sub CreatePatch ($$)
$context->{'product-name'},
"msp",
sprintf("%s_%s",
- installer::patch::Version::ArrayToDirectoryName(
- installer::patch::Version::StringToNumberArray(
- $source_msi->{'version'})),
- installer::patch::Version::ArrayToDirectoryName(
- installer::patch::Version::StringToNumberArray(
- $target_msi->{'version'}))),
+ installer::patch::Version::ArrayToDirectoryName(
+ installer::patch::Version::StringToNumberArray(
+ $source_msi->{'version'})),
+ installer::patch::Version::ArrayToDirectoryName(
+ installer::patch::Version::StringToNumberArray(
+ $target_msi->{'version'}))),
$language
);
File::Path::make_path($msp_path) unless -d $msp_path;
@@ -1508,6 +1853,58 @@ sub CreatePatch ($$)
+
+sub CheckPatchCompatability ($$)
+{
+ my ($context, $variables) = @_;
+
+ $installer::logger::Info->printf("patch will update product %s from %s to %s\n",
+ $context->{'product-name'},
+ $context->{'source-version'},
+ $context->{'target-version'});
+
+ my $release_data = installer::patch::ReleasesList::Instance()
+ ->{$context->{'source-version'}}
+ ->{$context->{'package-format'}};
+
+ # 1. Determine the set of languages for which we can create patches.
+ my $language = $context->{'language'};
+ my %no_ms_lang_locale_map = map {$_=>1} @installer::globals::noMSLocaleLangs;
+ if (defined $no_ms_lang_locale_map{$language})
+ {
+ $language = "en-US_".$language;
+ }
+
+ if ( ! IsLanguageValid($context, $release_data, $language))
+ {
+ $installer::logger::Info->printf("can not create patch for language '%s'\n", $language);
+ }
+ else
+ {
+ $installer::logger::Info->printf("processing language '%s'\n", $language);
+ $installer::logger::Info->increase_indentation();
+
+ my ($source_msi, $target_msi) = ProvideMsis($context, $variables, $language);
+
+ # Trigger reading of tables.
+ foreach my $table_name (("File", "Component", "Registry"))
+ {
+ $source_msi->GetTable($table_name);
+ $target_msi->GetTable($table_name);
+ $installer::logger::Info->printf("read %s table (source and target\n", $table_name);
+ }
+
+ # 3. Check if the source and target msis fullfil all necessary requirements.
+ if ( ! Check($source_msi, $target_msi, $variables, $context->{'product-name'}))
+ {
+ exit(1);
+ }
+ }
+}
+
+
+
+
=cut ApplyPatch ($context, $variables)
This is for testing only.
@@ -1522,7 +1919,6 @@ sub ApplyPatch ($$)
$context->{'product-name'},
$context->{'source-version'},
$context->{'target-version'});
- my @languages = GetLanguages();
my $source_version_dirname = installer::patch::Version::ArrayToDirectoryName(
installer::patch::Version::StringToNumberArray(
@@ -1531,41 +1927,45 @@ sub ApplyPatch ($$)
installer::patch::Version::StringToNumberArray(
$context->{'target-version'}));
- foreach my $language (@languages)
+ my $language = $context->{'language'};
+ my %no_ms_lang_locale_map = map {$_=>1} @installer::globals::noMSLocaleLangs;
+ if (defined $no_ms_lang_locale_map{$language})
{
- my $msp_filename = File::Spec->catfile(
- $context->{'output-path'},
- $context->{'product-name'},
- "msp",
- $source_version_dirname . "_" . $target_version_dirname,
- $language,
- "openoffice.msp");
- if ( ! -f $msp_filename)
- {
- $installer::logger::Info->printf("%s does not point to a valid file\n", $msp_filename);
- next;
- }
-
- my $log_path = File::Spec->catfile(dirname($msp_filename), "log");
- my $log_basename = "apply-msp";
- my $log_filename = File::Spec->catfile($log_path, $log_basename.".log");
+ $language = "en-US_".$language;
+ }
+
+ my $msp_filename = File::Spec->catfile(
+ $context->{'output-path'},
+ $context->{'product-name'},
+ "msp",
+ $source_version_dirname . "_" . $target_version_dirname,
+ $language,
+ "openoffice.msp");
+ if ( ! -f $msp_filename)
+ {
+ $installer::logger::Info->printf("%s does not point to a valid file\n", $msp_filename);
+ next;
+ }
- my $command = join(" ",
- "msiexec.exe",
- "/update", "'".installer::patch::Tools::ToWindowsPath($msp_filename)."'",
- "/L*xv!", "'".installer::patch::Tools::ToWindowsPath($log_filename)."'",
- "REINSTALL=ALL",
+ my $log_path = File::Spec->catfile(dirname($msp_filename), "log");
+ my $log_basename = "apply-msp";
+ my $log_filename = File::Spec->catfile($log_path, $log_basename.".log");
+
+ my $command = join(" ",
+ "msiexec.exe",
+ "/update", "'".installer::patch::Tools::ToWindowsPath($msp_filename)."'",
+ "/L*xv!", "'".installer::patch::Tools::ToWindowsPath($log_filename)."'",
+ "REINSTALL=ALL",
# "REINSTALLMODE=vomus",
- "REINSTALLMODE=omus",
- "MSIENFORCEUPGRADECOMPONENTRULES=1");
+ "REINSTALLMODE=omus",
+ "MSIENFORCEUPGRADECOMPONENTRULES=1");
- printf("executing command %s\n", $command);
- my $response = qx($command);
- Encode::from_to($response, "UTF16LE", "UTF8");
- printf("response was '%s'\n", $response);
+ printf("executing command %s\n", $command);
+ my $response = qx($command);
+ Encode::from_to($response, "UTF16LE", "UTF8");
+ printf("response was '%s'\n", $response);
- ShowLog($log_path, $log_filename, $log_basename, "msp application");
- }
+ ShowLog($log_path, $log_filename, $log_basename, "msp application");
}
@@ -1802,12 +2202,17 @@ sub UpdateReleasesXML($$)
sub main ()
{
- installer::logger::SetupSimpleLogging(undef);
my $context = ProcessCommandline();
+ installer::logger::starttime();
+ $installer::logger::Global->add_timestamp("starting logging");
+# installer::logger::SetupSimpleLogging(undef);
+
die "ERROR: list file is not defined, please use --lst-file option"
unless defined $context->{'lst-file'};
die "ERROR: product name is not defined, please use --product-name option"
unless defined $context->{'product-name'};
+ die sprintf("ERROR: package format %s is not supported", $context->{'package-format'})
+ unless defined $context->{'package-format'} ne "msi";
my ($variables, undef, undef) = installer::ziplist::read_openoffice_lst_file(
$context->{'lst-file'},
@@ -1815,6 +2220,22 @@ sub main ()
undef);
DetermineVersions($context, $variables);
+ if ($context->{'command'} =~ /create|check/)
+ {
+ $installer::logger::Lang->set_filename(
+ File::Spec->catfile(
+ $context->{'output-path'},
+ $context->{'product-name'},
+ "msp",
+ $context->{'source-version-dash'} . "_" . $context->{'target-version-dash'},
+ $context->{'language'},
+ "log",
+ "patch-creation.log"));
+ $installer::logger::Lang->copy_lines_from($installer::logger::Global);
+ $installer::logger::Lang->set_forward(undef);
+ $installer::logger::Info->set_forward($installer::logger::Lang);
+ }
+
if ($context->{'command'} eq "create")
{
CreatePatch($context, $variables);
@@ -1827,6 +2248,10 @@ sub main ()
{
UpdateReleasesXML($context, $variables);
}
+ elsif ($context->{'command'} eq "check")
+ {
+ CheckPatchCompatability($context, $variables);
+ }
}
Modified: openoffice/branches/rejuvenate01/main/solenv/bin/release_prepare.pl
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/solenv/bin/release_prepare.pl?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/solenv/bin/release_prepare.pl (original)
+++ openoffice/branches/rejuvenate01/main/solenv/bin/release_prepare.pl Mon Dec 16 16:48:11 2013
@@ -32,7 +32,7 @@ use Getopt::Long;
use Pod::Usage;
use Digest;
-use Carp::Always;
+#use Carp::Always;
use strict;
Modified: openoffice/branches/rejuvenate01/main/svx/source/accessibility/AccessibleShape.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/accessibility/AccessibleShape.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/accessibility/AccessibleShape.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/accessibility/AccessibleShape.cxx Mon Dec 16 16:48:11 2013
@@ -435,19 +435,18 @@ uno::Reference<XAccessibleRelationSet> S
throw (::com::sun::star::uno::RuntimeException)
{
::osl::MutexGuard aGuard (maMutex);
- ::utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper;
- uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
- aSequence[0] = mpParent->GetAccessibleCaption(mxShape);
+ ::utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper;
//this mxshape is the captioned shape, only for sw
- if(aSequence[0].get())
- {
- pRelationSet->AddRelation(
- AccessibleRelation( AccessibleRelationType::DESCRIBED_BY, aSequence ) );
- }
-
if (pRelationSet != NULL)
{
+ uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
+ aSequence[0] = mpParent->GetAccessibleCaption(mxShape);
+ if(aSequence[0].get())
+ {
+ pRelationSet->AddRelation(
+ AccessibleRelation( AccessibleRelationType::DESCRIBED_BY, aSequence ) );
+ }
return uno::Reference<XAccessibleRelationSet> (
new ::utl::AccessibleRelationSetHelper (*pRelationSet));
}
@@ -455,8 +454,6 @@ uno::Reference<XAccessibleRelationSet> S
{
return uno::Reference<XAccessibleRelationSet>(NULL);
}
-
- return uno::Reference<XAccessibleRelationSet>();
}
/** Return a copy of the state set.
Modified: openoffice/branches/rejuvenate01/main/svx/source/table/accessibletableshape.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/table/accessibletableshape.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/table/accessibletableshape.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/table/accessibletableshape.cxx Mon Dec 16 16:48:11 2013
@@ -327,6 +327,7 @@ void SAL_CALL AccessibleTableShapeImpl::
AccessibleTableShape::AccessibleTableShape( const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo)
: AccessibleTableShape_Base(rShapeInfo, rShapeTreeInfo)
+, mnPreviousSelectionCount(0)
, mxImpl( new AccessibleTableShapeImpl( maShapeTreeInfo ) )
{
}
@@ -342,8 +343,7 @@ AccessibleTableShape::~AccessibleTableSh
void AccessibleTableShape::Init()
{
try
- {
- mnPreviousSelectionCount = 0;
+ {
Reference< XPropertySet > xSet( mxShape, UNO_QUERY_THROW );
Reference< XTable > xTable( xSet->getPropertyValue(C2U("Model")), UNO_QUERY_THROW );
Modified: openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atsfonts.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atsfonts.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atsfonts.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atsfonts.cxx Mon Dec 16 16:48:11 2013
@@ -36,6 +36,8 @@
#include "basegfx/polygon/b2dpolygon.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
+typedef GlyphID ATSGlyphID;
+
// =======================================================================
// mac specific physically available font face
@@ -239,10 +241,10 @@ void AtsTextStyle::SetTextColor( const R
// -----------------------------------------------------------------------
-bool AtsTextStyle::GetGlyphBoundRect( sal_GlyphId nGlyphId, Rectangle& rRect ) const
+bool AtsTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const
{
ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback
- GlyphID aGlyphId = nGlyphId;
+ ATSGlyphID aGlyphId = aGlyphId;
ATSGlyphScreenMetrics aGlyphMetrics;
const bool bNonAntialiasedText = false;
OSStatus eStatus = ATSUGlyphGetScreenMetrics( rATSUStyle,
@@ -302,14 +304,14 @@ static OSStatus GgoMoveToProc( const Flo
return eStatus;
}
-bool AtsTextStyle::GetGlyphOutline( sal_GlyphId nGlyphId, basegfx::B2DPolyPolygon& rResult ) const
+bool AtsTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rResult ) const
{
GgoData aGgoData;
aGgoData.mpPolyPoly = &rResult;
rResult.clear();
OSStatus eGgoStatus = noErr;
- OSStatus eStatus = ATSUGlyphGetCubicPaths( maATSUStyle, nGlyphId,
+ OSStatus eStatus = ATSUGlyphGetCubicPaths( maATSUStyle, aGlyphId,
GgoMoveToProc, GgoLineToProc, GgoCurveToProc, GgoClosePathProc,
&aGgoData, &eGgoStatus );
if( (eStatus != noErr) ) // TODO: why is (eGgoStatus!=noErr) when curves are involved?
Modified: openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atslayout.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atslayout.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atslayout.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/atslayout.cxx Mon Dec 16 16:48:11 2013
@@ -44,7 +44,7 @@ public:
virtual void AdjustLayout( ImplLayoutArgs& );
virtual void DrawText( SalGraphics& ) const;
- virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
+ virtual int GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int&,
sal_Int32* pGlyphAdvances, int* pCharIndexes ) const;
virtual long GetTextWidth() const;
@@ -469,7 +469,7 @@ void ATSLayout::DrawText( SalGraphics& r
*
* @return : number of glyph details that were provided
**/
-int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& nStart,
+int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int& nStart,
sal_Int32* pGlyphAdvances, int* pCharIndexes ) const
{
if( nStart < 0 ) // first glyph requested?
@@ -528,7 +528,7 @@ int ATSLayout::GetNextGlyphs( int nLen,
while( nCount < nLen )
{
++nCount;
- sal_GlyphId nGlyphId = mpGlyphIds[nStart];
+ sal_GlyphId aGlyphId = mpGlyphIds[nStart];
// check if glyph fallback is needed for this glyph
// TODO: use ATSUDirectGetLayoutDataArrayPtrFromTextLayout(kATSUDirectDataStyleIndex) API instead?
@@ -546,11 +546,11 @@ int ATSLayout::GetNextGlyphs( int nLen,
// register fallback font
const int nLevel = mpFallbackInfo->AddFallback( nFallbackFontID );
// update sal_GlyphId with fallback level
- nGlyphId |= (nLevel << GF_FONTSHIFT);
+ aGlyphId |= (nLevel << GF_FONTSHIFT);
}
// update resulting glyphid array
- *(pGlyphIDs++) = nGlyphId;
+ *(pOutGlyphIds++) = aGlyphId;
// update returned glyph advance array
if( pGlyphAdvances )
@@ -1198,13 +1198,13 @@ void ATSLayout::Simplify( bool /*bIsBase
// get the ImplFontData for a glyph fallback font
// for a glyphid that was returned by ATSLayout::GetNextGlyphs()
-const ImplFontData* ATSLayout::GetFallbackFontData( sal_GlyphId nGlyphId ) const
+const ImplFontData* ATSLayout::GetFallbackFontData( sal_GlyphId aGlyphId ) const
{
// check if any fallback fonts were needed
if( !mpFallbackInfo )
return NULL;
// check if the current glyph needs a fallback font
- int nFallbackLevel = (nGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
+ int nFallbackLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
if( !nFallbackLevel )
return NULL;
return mpFallbackInfo->GetFallbackFontData( nFallbackLevel );
Modified: openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctfonts.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctfonts.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctfonts.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctfonts.cxx Mon Dec 16 16:48:11 2013
@@ -174,10 +174,10 @@ void CTTextStyle::GetFontMetric( float f
// -----------------------------------------------------------------------
-bool CTTextStyle::GetGlyphBoundRect( sal_GlyphId nGlyphId, Rectangle& rRect ) const
+bool CTTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const
{
const DynCoreTextSyms& rCT = DynCoreTextSyms::get();
- CGGlyph nCGGlyph = nGlyphId & GF_IDXMASK; // NOTE: CoreText handles glyph fallback itself
+ CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK; // NOTE: CoreText handles glyph fallback itself
CTFontRef aCTFontRef = (CTFontRef)CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName );
const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // TODO: horz/vert
@@ -232,13 +232,13 @@ static void MyCGPathApplierFunc( void* p
}
}
-bool CTTextStyle::GetGlyphOutline( sal_GlyphId nGlyphId, basegfx::B2DPolyPolygon& rResult ) const
+bool CTTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rResult ) const
{
rResult.clear();
const DynCoreTextSyms& rCT = DynCoreTextSyms::get();
// TODO: GF_FONTMASK if using non-native glyph fallback
- CGGlyph nCGGlyph = nGlyphId & GF_IDXMASK;
+ CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK;
CTFontRef pCTFont = (CTFontRef)CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName );
CGPathRef xPath = rCT.FontCreatePathForGlyph( pCTFont, nCGGlyph, NULL );
Modified: openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctlayout.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctlayout.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctlayout.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/ctlayout.cxx Mon Dec 16 16:48:11 2013
@@ -37,7 +37,7 @@ public:
virtual void AdjustLayout( ImplLayoutArgs& );
virtual void DrawText( SalGraphics& ) const;
- virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
+ virtual int GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int&,
sal_Int32* pGlyphAdvances, int* pCharIndexes ) const;
virtual long GetTextWidth() const;
@@ -244,7 +244,7 @@ void CTLayout::DrawText( SalGraphics& rG
// -----------------------------------------------------------------------
-int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& nStart,
+int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int& nStart,
sal_Int32* pGlyphAdvances, int* pCharIndexes ) const
{
if( !mpCTLine )
@@ -320,7 +320,7 @@ int CTLayout::GetNextGlyphs( int nLen, s
for(; (--nLen >= 0) && (nSubIndex < nGlyphsInRun); ++nSubIndex, ++nStart )
{
// convert glyph details for VCL
- *(pGlyphIDs++) = pCGGlyphIdx[ nSubIndex ];
+ *(pOutGlyphIds++) = pCGGlyphIdx[ nSubIndex ];
if( pGlyphAdvances )
*(pGlyphAdvances++) = pCGGlyphAdvs[ nSubIndex ].width;
if( pCharIndexes )
@@ -471,14 +471,14 @@ void CTLayout::Simplify( bool /*bIsBase*
// get the ImplFontData for a glyph fallback font
// for a glyphid that was returned by CTLayout::GetNextGlyphs()
-const ImplFontData* CTLayout::GetFallbackFontData( sal_GlyphId /*nGlyphId*/ ) const
+const ImplFontData* CTLayout::GetFallbackFontData( sal_GlyphId /*aGlyphId*/ ) const
{
#if 0
// check if any fallback fonts were needed
if( !mpFallbackInfo )
return NULL;
// check if the current glyph needs a fallback font
- int nFallbackLevel = (nGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
+ int nFallbackLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
if( !nFallbackLevel )
return NULL;
pFallbackFont = mpFallbackInfo->GetFallbackFontData( nFallbackLevel );
Modified: openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/salgdi.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/salgdi.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/salgdi.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/aqua/source/gdi/salgdi.cxx Mon Dec 16 16:48:11 2013
@@ -1776,17 +1776,17 @@ long AquaSalGraphics::GetGraphicsWidth()
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect )
+bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
{
- const bool bRC = mpMacTextStyle->GetGlyphBoundRect( (sal_GlyphId)nGlyphId, rRect );
+ const bool bRC = mpMacTextStyle->GetGlyphBoundRect( aGlyphId, rRect );
return bRC;
}
// -----------------------------------------------------------------------
-sal_Bool AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
+bool AquaSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
{
- const bool bRC = mpMacTextStyle->GetGlyphOutline( (sal_GlyphId)nGlyphId, rPolyPoly );
+ const bool bRC = mpMacTextStyle->GetGlyphOutline( aGlyphId, rPolyPoly );
return bRC;
}
@@ -2042,7 +2042,7 @@ static bool GetRawFontData( const ImplFo
}
sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
- const ImplFontData* pFontData, sal_GlyphId* pGlyphIDs, sal_uInt8* pEncoding,
+ const ImplFontData* pFontData, sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
// TODO: move more of the functionality here into the generic subsetter code
@@ -2072,7 +2072,7 @@ sal_Bool AquaSalGraphics::CreateFontSubs
// make the subsetter provide the requested subset
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" );
bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL,
- pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths );
+ pGlyphIds, pEncoding, nGlyphCount, pGlyphWidths );
fclose( pOutFile );
return bRC;
}
@@ -2118,21 +2118,21 @@ sal_Bool AquaSalGraphics::CreateFontSubs
for( int i = 0; i < nGlyphCount; ++i )
{
aTempEncs[i] = pEncoding[i];
- sal_GlyphId nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
- if( pGlyphIDs[i] & GF_ISCHAR )
+ sal_GlyphId aGlyphId( pGlyphIds[i] & GF_IDXMASK);
+ if( pGlyphIds[i] & GF_ISCHAR )
{
- bool bVertical = (pGlyphIDs[i] & GF_ROTMASK) != 0;
- nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical );
- if( nGlyphIdx == 0 && pFontData->IsSymbolFont() )
+ bool bVertical = (pGlyphIds[i] & GF_ROTMASK) != 0;
+ aGlyphId = ::MapChar( pSftFont, static_cast<sal_uInt16>(aGlyphId), bVertical );
+ if( aGlyphId == 0 && pFontData->IsSymbolFont() )
{
// #i12824# emulate symbol aliasing U+FXXX <-> U+0XXX
- nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
- nGlyphIdx = (nGlyphIdx & 0xF000) ? (nGlyphIdx & 0x00FF) : (nGlyphIdx | 0xF000 );
- nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical );
+ aGlyphId = pGlyphIds[i] & GF_IDXMASK;
+ aGlyphId = (aGlyphId & 0xF000) ? (aGlyphId & 0x00FF) : (aGlyphId | 0xF000 );
+ aGlyphId = ::MapChar( pSftFont, static_cast<sal_uInt16>(aGlyphId), bVertical );
}
}
- aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx );
- if( !nGlyphIdx )
+ aShortIDs[i] = static_cast<sal_uInt16>( aGlyphId );
+ if( !aGlyphId )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
}
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/aqua/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/aqua/salgdi.h?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/aqua/salgdi.h (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/aqua/salgdi.h Mon Dec 16 16:48:11 2013
@@ -44,7 +44,6 @@ class ImplMacTextStyle;
struct CGRect;
-typedef sal_uInt32 sal_GlyphId;
typedef std::vector<unsigned char> ByteVector;
#ifndef CGFLOAT_TYPE
@@ -357,7 +356,7 @@ public:
// as "undefined character"
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
- sal_GlyphId* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pEncoding,
sal_Int32* pWidths,
int nGlyphs,
@@ -393,8 +392,8 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& );
+ virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& );
+ virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/fontsubset.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/fontsubset.hxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/fontsubset.hxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/fontsubset.hxx Mon Dec 16 16:48:11 2013
@@ -28,6 +28,7 @@
#include <tools/string.hxx>
#include <cstdio>
+#include "salglyphid.hxx"
#include "vcl/dllapi.h"
#include "sallayout.hxx"
@@ -59,7 +60,7 @@ public:
bool CreateFontSubset( int nOutFontTypeMask,
FILE* pOutFile, const char* pOutFontName,
- const sal_GlyphId* pReqGlyphIds, const sal_uInt8* pEncodedIds,
+ const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncodedIds,
int nReqGlyphCount, sal_Int32* pOutGlyphWidths = NULL );
public: // TODO: make subsetter results private and provide accessor methods instead
@@ -82,7 +83,7 @@ private:
int mnReqFontTypeMask; // allowed subset-target font types
FILE* mpOutFile;
const char* mpReqFontName;
- const sal_GlyphId* mpReqGlyphIds;
+ const sal_GlyphId* mpReqGlyphIds;
const sal_uInt8* mpReqEncodedIds;
int mnReqGlyphCount;
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/glyphcache.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/glyphcache.hxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/glyphcache.hxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/glyphcache.hxx Mon Dec 16 16:48:11 2013
@@ -80,7 +80,7 @@ private:
friend class ServerFont;
// used by ServerFont class only
void AddedGlyph( ServerFont&, GlyphData& );
- void RemovingGlyph( ServerFont&, GlyphData&, int nGlyphIndex );
+ void RemovingGlyph( ServerFont&, GlyphData&, sal_GlyphId );
void UsingGlyph( ServerFont&, GlyphData& );
void GrowNotify();
@@ -188,16 +188,16 @@ public:
virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
Point TransformPoint( const Point& ) const;
- GlyphData& GetGlyphData( int nGlyphIndex );
- const GlyphMetric& GetGlyphMetric( int nGlyphIndex )
- { return GetGlyphData( nGlyphIndex ).GetMetric(); }
+ GlyphData& GetGlyphData( sal_GlyphId );
+ const GlyphMetric& GetGlyphMetric( sal_GlyphId aGlyphId )
+ { return GetGlyphData( aGlyphId ).GetMetric(); }
- virtual int GetGlyphIndex( sal_UCS4 ) const = 0;
- virtual bool GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const = 0;
+ virtual sal_GlyphId GetGlyphIndex( sal_UCS4 ) const = 0;
+ virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& ) const = 0;
virtual bool GetAntialiasAdvice( void ) const = 0;
- bool IsGlyphInvisible( int nGlyphIndex );
- virtual bool GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const = 0;
- virtual bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const = 0;
+ bool IsGlyphInvisible( sal_GlyphId );
+ virtual bool GetGlyphBitmap1( sal_GlyphId, RawBitmap& ) const = 0;
+ virtual bool GetGlyphBitmap8( sal_GlyphId, RawBitmap& ) const = 0;
void SetExtended( int nInfo, void* ppVoid );
int GetExtInfo() { return mnExtInfo; }
@@ -214,7 +214,7 @@ protected:
long Release() const;
sal_uLong GetByteCount() const { return mnBytesUsed; }
- virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const = 0;
+ virtual void InitGlyphData( sal_GlyphId, GlyphData& ) const = 0;
virtual void GarbageCollect( long );
void ReleaseFromGarbageCollect();
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/graphite_layout.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/graphite_layout.hxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/graphite_layout.hxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/graphite_layout.hxx Mon Dec 16 16:48:11 2013
@@ -48,12 +48,6 @@
#include <vcl/dllapi.h>
// Module
-// For backwards compatibility with 2.4.x
-#if (SUPD == 680)
-typedef sal_Int32 sal_GlyphId;
-#endif
-
-
// Module type definitions and forward declarations.
//
class TextSourceAdaptor;
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/os2/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/os2/salgdi.h?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/os2/salgdi.h (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/os2/salgdi.h Mon Dec 16 16:48:11 2013
@@ -288,7 +288,7 @@ public:
// as "undefined character"
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
- sal_GlyphId* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pEncoding,
sal_Int32* pWidths,
int nGlyphs,
@@ -324,8 +324,8 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& );
+ virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/salgdi.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/salgdi.hxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/salgdi.hxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/salgdi.hxx Mon Dec 16 16:48:11 2013
@@ -29,6 +29,7 @@
#include "vcl/sv.h"
#include "vcl/dllapi.h"
#include "vcl/salgtype.hxx"
+#include "salglyphid.hxx"
#include "vos/thread.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salnativewidgets.hxx"
@@ -263,7 +264,7 @@ public:
// as "undefined character"
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData* pFont,
- sal_GlyphId* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pEncoding,
sal_Int32* pWidths,
int nGlyphs,
@@ -305,8 +306,8 @@ public:
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc ) = 0;
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
- virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
+ virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) = 0;
+ virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) = 0;
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0;
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/sallayout.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/sallayout.hxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/sallayout.hxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/sallayout.hxx Mon Dec 16 16:48:11 2013
@@ -38,6 +38,7 @@ typedef unsigned short LanguageType;
// for typedef sal_UCS4
#include <vcl/vclenum.hxx>
+#include "salglyphid.hxx"
class SalGraphics;
class ImplFontData;
@@ -146,28 +147,6 @@ VCL_PLUGIN_PUBLIC const char* GetAutofal
// - SalLayout -
// -------------
-typedef sal_uInt32 sal_GlyphId;
-
-// Glyph Flags
-#define GF_NONE 0x00000000
-#define GF_FLAGMASK 0xFF800000
-#define GF_IDXMASK ~GF_FLAGMASK
-#define GF_ISCHAR 0x00800000
-#define GF_ROTL 0x01000000
-// caution !!!
-#define GF_VERT 0x02000000
-// GF_VERT is only for windows implementation
-// (win/source/gdi/salgdi3.cxx, win/source/gdi/winlayout.cxx)
-// don't use this elsewhere !!!
-#define GF_ROTR 0x03000000
-#define GF_ROTMASK 0x03000000
-#define GF_UNHINTED 0x04000000
-#define GF_GSUB 0x08000000
-#define GF_FONTMASK 0xF0000000
-#define GF_FONTSHIFT 28
-
-#define GF_DROPPED 0xFFFFFFFF
-
// all positions/widths are in font units
// one exception: drawposition is in pixel units
@@ -306,17 +285,17 @@ struct GlyphItem
int mnCharPos; // index in string
int mnOrigWidth; // original glyph width
int mnNewWidth; // width after adjustments
- sal_GlyphId mnGlyphIndex;
+ sal_GlyphId maGlyphId;
Point maLinearPos; // absolute position of non rotated string
public:
GlyphItem() {}
- GlyphItem( int nCharPos, sal_GlyphId nGlyphIndex, const Point& rLinearPos,
+ GlyphItem( int nCharPos, sal_GlyphId aGlyphId, const Point& rLinearPos,
long nFlags, int nOrigWidth )
: mnFlags(nFlags), mnCharPos(nCharPos),
mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth),
- mnGlyphIndex(nGlyphIndex), maLinearPos(rLinearPos)
+ maGlyphId(aGlyphId), maLinearPos(rLinearPos)
{}
enum{ FALLBACK_MASK=0xFF, IS_IN_CLUSTER=0x100, IS_RTL_GLYPH=0x200, IS_DIACRITIC=0x400 };
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/unx/pspgraphics.h
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/unx/pspgraphics.h?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/unx/pspgraphics.h (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/unx/pspgraphics.h Mon Dec 16 16:48:11 2013
@@ -104,7 +104,7 @@ public:
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
- sal_GlyphId* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pEncoding,
sal_Int32* pWidths,
int nGlyphs,
@@ -121,8 +121,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& );
+ virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/unx/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/unx/salgdi.h?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/unx/salgdi.h (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/unx/salgdi.h Mon Dec 16 16:48:11 2013
@@ -251,7 +251,7 @@ public:
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
- sal_GlyphId* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pEncoding,
sal_Int32* pWidths,
int nGlyphs,
@@ -268,8 +268,8 @@ public:
bool bVertical,
Int32Vector& rWidths,
Ucs2UIntMap& rUnicodeEnc );
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
+ virtual bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
virtual bool supportsOperation( OutDevSupportType ) const;
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/vcl/fontmanager.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/vcl/fontmanager.hxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/vcl/fontmanager.hxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/vcl/fontmanager.hxx Mon Dec 16 16:48:11 2013
@@ -32,6 +32,7 @@
#include "vcl/dllapi.h"
#include "vcl/helper.hxx"
+#include "salglyphid.hxx"
#include "com/sun/star/lang/Locale.hpp"
@@ -643,7 +644,7 @@ public:
bool createFontSubset( FontSubsetInfo&,
fontID nFont,
const rtl::OUString& rOutFile,
- sal_uInt32* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pNewEncoding,
sal_Int32* pWidths,
int nGlyphs,
Modified: openoffice/branches/rejuvenate01/main/vcl/inc/win/salgdi.h
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/inc/win/salgdi.h?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/inc/win/salgdi.h (original)
+++ openoffice/branches/rejuvenate01/main/vcl/inc/win/salgdi.h Mon Dec 16 16:48:11 2013
@@ -318,7 +318,7 @@ public:
// as "undefined character"
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
- sal_GlyphId* pGlyphIDs,
+ sal_GlyphId* pGlyphIds,
sal_uInt8* pEncoding,
sal_Int32* pWidths,
int nGlyphs,
@@ -354,8 +354,8 @@ public:
Ucs2UIntMap& rUnicodeEnc );
virtual int GetMinKashidaWidth();
- virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
+ virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& );
+ virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& );
virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
virtual void DrawServerFontLayout( const ServerFontLayout& );
Modified: openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/os2layout.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/os2layout.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/os2layout.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/os2layout.cxx Mon Dec 16 16:48:11 2013
@@ -507,7 +507,7 @@ bool Os2SalLayout::LayoutText( ImplLayou
// -----------------------------------------------------------------------
-int Os2SalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int& nStart,
+int Os2SalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIds, Point& rPos, int& nStart,
sal_Int32* pGlyphAdvances, int* pCharIndexes ) const
{
// return zero if no more glyph found
@@ -527,29 +527,29 @@ int Os2SalLayout::GetNextGlyphs( int nLe
int nCount = 0;
while( nCount < nLen )
{
- // update return values {nGlyphIndex,nCharPos,nGlyphAdvance}
- long nGlyphIndex = mpOutGlyphs[ nStart ];
+ // update return values {aGlyphId,nCharPos,nGlyphAdvance}
+ sal_GlyphId aGlyphId = mpOutGlyphs[ nStart ];
if( mbDisableGlyphs )
{
if( mnLayoutFlags & SAL_LAYOUT_VERTICAL )
{
- sal_Unicode cChar = (sal_Unicode)(nGlyphIndex & GF_IDXMASK);
+ sal_Unicode cChar = (sal_Unicode)(aGlyphId & GF_IDXMASK);
#ifdef GNG_VERT_HACK
if( mrOs2FontData.HasGSUBstitutions( mhPS )
&& mrOs2FontData.IsGSUBstituted( cChar ) )
- nGlyphIndex |= GF_ROTL | GF_GSUB;
+ aGlyphId |= GF_ROTL | GF_GSUB;
else
#endif // GNG_VERT_HACK
{
- nGlyphIndex |= GetVerticalFlags( cChar );
- if( !(nGlyphIndex & GF_ROTMASK) )
- nGlyphIndex |= GF_VERT;
+ aGlyphId |= GetVerticalFlags( cChar );
+ if( !(aGlyphId & GF_ROTMASK) )
+ aGlyphId |= GF_VERT;
}
}
- nGlyphIndex |= GF_ISCHAR;
+ aGlyphId |= GF_ISCHAR;
}
++nCount;
- *(pGlyphs++) = nGlyphIndex;
+ *(pGlyphIds++) = aGlyphId;
if( pGlyphAdvances )
*(pGlyphAdvances++) = mpGlyphAdvances[ nStart ];
if( pCharIndexes )
Modified: openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/salgdi3.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/salgdi3.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/salgdi3.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/os2/source/gdi/salgdi3.cxx Mon Dec 16 16:48:11 2013
@@ -1198,7 +1198,7 @@ void Os2SalGraphics::GetDevFontSubstList
// -----------------------------------------------------------------------
-sal_Bool Os2SalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect )
+bool Os2SalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
{
// use unity matrix
MAT2 aMat;
@@ -1206,13 +1206,13 @@ sal_Bool Os2SalGraphics::GetGlyphBoundRe
aMat.eM12 = aMat.eM21 = FixedFromDouble( 0.0 );
UINT nGGOFlags = GGO_METRICS;
- if( !(nIndex & GF_ISCHAR) )
+ if( !(aGlyphId & GF_ISCHAR) )
nGGOFlags |= GGO_GLYPH_INDEX;
- nIndex &= GF_IDXMASK;
+ aGlyphId &= GF_IDXMASK;
GLYPHMETRICS aGM;
DWORD nSize = FT2_ERROR;
- nSize = Ft2GetGlyphOutline( mhPS, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat );
+ nSize = Ft2GetGlyphOutline( mhPS, aGlyphId, nGGOFlags, &aGM, 0, NULL, &aMat );
if( nSize == FT2_ERROR )
return false;
@@ -1227,7 +1227,7 @@ sal_Bool Os2SalGraphics::GetGlyphBoundRe
// -----------------------------------------------------------------------
-sal_Bool Os2SalGraphics::GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly )
+bool Os2SalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, ::basegfx::B2DPolyPolygon& rB2DPolyPoly )
{
#if OSL_DEBUG_LEVEL>0
debug_printf("Os2SalGraphics::GetGlyphOutline\n");
@@ -1242,13 +1242,13 @@ sal_Bool Os2SalGraphics::GetGlyphOutline
aMat.eM12 = aMat.eM21 = FixedFromDouble( 0.0 );
UINT nGGOFlags = GGO_NATIVE;
- if( !(nIndex & GF_ISCHAR) )
+ if( !(aGlyphId & GF_ISCHAR) )
nGGOFlags |= GGO_GLYPH_INDEX;
- nIndex &= GF_IDXMASK;
+ aGlyphId &= GF_IDXMASK;
GLYPHMETRICS aGlyphMetrics;
DWORD nSize1 = FT2_ERROR;
- nSize1 = Ft2GetGlyphOutline( mhPS, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
+ nSize1 = Ft2GetGlyphOutline( mhPS, aGlyphId, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat );
if( !nSize1 ) // blank glyphs are ok
bRet = TRUE;
@@ -1257,7 +1257,7 @@ sal_Bool Os2SalGraphics::GetGlyphOutline
PM_BYTE* pData = new PM_BYTE[ nSize1 ];
ULONG nTotalCount = 0;
DWORD nSize2;
- nSize2 = Ft2GetGlyphOutline( mhPS, nIndex, nGGOFlags,
+ nSize2 = Ft2GetGlyphOutline( mhPS, aGlyphId, nGGOFlags,
&aGlyphMetrics, nSize1, pData, &aMat );
if( nSize1 == nSize2 )
@@ -1497,7 +1497,7 @@ int ScopedTrueTypeFont::open(void * pBuf
}
sal_Bool Os2SalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
- const ImplFontData* pFont, long* pGlyphIDs, sal_uInt8* pEncoding,
+ const ImplFontData* pFont, sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo )
{
// TODO: use more of the central font-subsetting code, move stuff there if needed
@@ -1536,25 +1536,25 @@ sal_Bool Os2SalGraphics::CreateFontSubse
const RawFontData aRawCffData( mhPS, nCffTag );
if( aRawCffData.get() )
{
- long nRealGlyphIds[ 256 ];
+ sal_GlyphId aRealGlyphIds[ 256 ];
for( int i = 0; i < nGlyphCount; ++i )
{
// TODO: remap notdef glyph if needed
// TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly?
- sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
- if( pGlyphIDs[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated
- nGlyphIdx = pImplFontCharMap->GetGlyphIndex( nGlyphIdx );
- if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
+ sal_uInt32 aGlyphIdx = pGlyphIds[i] & GF_IDXMASK;
+ if( pGlyphIds[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated
+ aGlyphId = pImplFontCharMap->GetGlyphIndex( aGlyphId );
+ if( (pGlyphIds[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution
{/*####*/}
- nRealGlyphIds[i] = nGlyphIdx;
+ aRealGlyphIds[i] = aGlyphId;
}
// provide a font subset from the CFF-table
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" );
rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() );
bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL,
- nRealGlyphIds, pEncoding, nGlyphCount, pGlyphWidths );
+ aRealGlyphIds, pEncoding, nGlyphCount, pGlyphWidths );
fclose( pOutFile );
return bRC;
}
@@ -1594,21 +1594,21 @@ sal_Bool Os2SalGraphics::CreateFontSubse
for( i = 0; i < nGlyphCount; ++i )
{
aTempEncs[i] = pEncoding[i];
- sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK;
- if( pGlyphIDs[i] & GF_ISCHAR )
+ sal_GlyphId aGlyphId = pGlyphIds[i] & GF_IDXMASK;
+ if( pGlyphIds[i] & GF_ISCHAR )
{
- sal_Unicode cChar = static_cast<sal_Unicode>(nGlyphIdx); // TODO: sal_UCS4
- const bool bVertical = ((pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0);
- nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical );
- if( (nGlyphIdx == 0) && pFont->IsSymbolFont() )
+ sal_Unicode cChar = static_cast<sal_Unicode>(aGlyphId); // TODO: sal_UCS4
+ const bool bVertical = ((pGlyphIds[i] & (GF_ROTMASK|GF_GSUB)) != 0);
+ aGlyphId = ::MapChar( aSftTTF.get(), cChar, bVertical );
+ if( (aGlyphId == 0) && pFont->IsSymbolFont() )
{
// #i12824# emulate symbol aliasing U+FXXX <-> U+0XXX
cChar = (cChar & 0xF000) ? (cChar & 0x00FF) : (cChar | 0xF000);
- nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical );
+ aGlyphId = ::MapChar( aSftTTF.get(), cChar, bVertical );
}
}
- aShortIDs[i] = static_cast<USHORT>( nGlyphIdx );
- if( !nGlyphIdx )
+ aShortIDs[i] = static_cast<USHORT>( aGlyphId );
+ if( !aGlyphId )
if( nNotDef < 0 )
nNotDef = i; // first NotDef glyph found
}
Modified: openoffice/branches/rejuvenate01/main/vcl/source/fontsubset/cff.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/vcl/source/fontsubset/cff.cxx?rev=1551260&r1=1551259&r2=1551260&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/vcl/source/fontsubset/cff.cxx (original)
+++ openoffice/branches/rejuvenate01/main/vcl/source/fontsubset/cff.cxx Mon Dec 16 16:48:11 2013
@@ -28,7 +28,7 @@
#include <cstring>
#include <assert.h>
-#include <fontsubset.hxx>
+#include "fontsubset.hxx"
#include <vcl/strhelper.hxx>
@@ -358,7 +358,7 @@ class SubsetterContext
public:
virtual ~SubsetterContext( void);
virtual bool emitAsType1( class Type1Emitter&,
- const sal_GlyphId* pGlyphIDs, const U8* pEncoding,
+ const sal_GlyphId* pGlyphIds, const U8* pEncoding,
GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& ) = 0;
};
@@ -383,7 +383,7 @@ public:
void initialCffRead( void);
bool emitAsType1( class Type1Emitter&,
- const sal_GlyphId* pGlyphIDs, const U8* pEncoding,
+ const sal_GlyphId* pGlyphIds, const U8* pEncoding,
GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& );
// used by charstring converter
@@ -2081,7 +2081,7 @@ void Type1Emitter::emitValVector( const
// --------------------------------------------------------------------
bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
- const sal_GlyphId* pReqGlyphIDs, const U8* pReqEncoding,
+ const sal_GlyphId* pReqGlyphIds, const U8* pReqEncoding,
GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rFSInfo)
{
// prepare some fontdirectory details
@@ -2163,7 +2163,7 @@ bool CffSubsetterContext::emitAsType1( T
"/Encoding 256 array\n"
"0 1 255 {1 index exch /.notdef put} for\n");
for( int i = 1; (i < nGlyphCount) && (i < 256); ++i) {
- const char* pGlyphName = getGlyphName( pReqGlyphIDs[i]);
+ const char* pGlyphName = getGlyphName( pReqGlyphIds[i]);
pOut += sprintf( pOut, "dup %d /%s put\n", pReqEncoding[i], pGlyphName);
}
pOut += sprintf( pOut, "readonly def\n");
@@ -2314,20 +2314,20 @@ bool CffSubsetterContext::emitAsType1( T
"2 index /CharStrings %d dict dup begin\n", nGlyphCount);
rEmitter.emitAllCrypted();
for( int i = 0; i < nGlyphCount; ++i) {
- const int nGlyphId = pReqGlyphIDs[i];
- assert( (nGlyphId >= 0) && (nGlyphId < mnCharStrCount));
+ const int nCffGlyphId = pReqGlyphIds[i];
+ assert( (nCffGlyphId >= 0) && (nCffGlyphId < mnCharStrCount));
// get privdict context matching to the glyph
- const int nFDSelect = getFDSelect( nGlyphId);
+ const int nFDSelect = getFDSelect( nCffGlyphId);
if( nFDSelect < 0)
continue;
mpCffLocal = &maCffLocal[ nFDSelect];
// convert the Type2op charstring to its Type1op counterpart
- const int nT2Len = seekIndexData( mnCharStrBase, nGlyphId);
+ const int nT2Len = seekIndexData( mnCharStrBase, nCffGlyphId);
assert( nT2Len > 0);
U8 aType1Ops[ MAX_T1OPS_SIZE]; // TODO: dynamic allocation
const int nT1Len = convert2Type1Ops( mpCffLocal, mpReadPtr, nT2Len, aType1Ops);
// get the glyph name
- const char* pGlyphName = getGlyphName( nGlyphId);
+ const char* pGlyphName = getGlyphName( nCffGlyphId);
// emit the encrypted Type1op charstring
pOut += sprintf( pOut, "/%s %d RD ", pGlyphName, nT1Len);
memcpy( pOut, aType1Ops, nT1Len);