You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2012/08/20 13:46:47 UTC
svn commit: r1374979 [25/29] - in /incubator/ooo/branches/writer001: ./
ext_libraries/apr-util/ ext_libraries/apr-util/prj/ ext_libraries/apr/
ext_libraries/coinmp/ ext_libraries/hunspell/ ext_libraries/serf/
ext_libraries/serf/prj/ ext_sources/ extras...
Modified: incubator/ooo/branches/writer001/main/sfx2/source/doc/sfxbasemodel.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/doc/sfxbasemodel.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/doc/sfxbasemodel.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/doc/sfxbasemodel.cxx Mon Aug 20 11:46:19 2012
@@ -2788,41 +2788,53 @@ void SfxBaseModel::impl_store( const
const SfxFilter* pFilter = pMedium->GetFilter();
if ( pFilter && aFilterName.equals( pFilter->GetFilterName() ) )
{
- aArgHash.erase( aFilterString );
- aArgHash.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
-
- try
+ // 119366 - If the former file saving with password, do not trying in StoreSelf anyway...
+ bool bFormerPassword = false;
{
- storeSelf( aArgHash.getAsConstPropertyValueList() );
- bSaved = sal_True;
+ uno::Sequence< beans::NamedValue > aOldEncryptionData;
+ if (GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData ))
+ {
+ bFormerPassword = true;
+ }
}
- catch( const lang::IllegalArgumentException& )
+ if ( !bFormerPassword )
{
- // some additional arguments do not allow to use saving, SaveAs should be done
- // but only for normal documents, the shared documents would be overwritten in this case
- // that would mean an information loss
- // TODO/LATER: need a new interaction for this case
- if ( m_pData->m_pObjectShell->IsDocShared() )
- {
- m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) );
- m_pData->m_pObjectShell->StoreLog();
+ aArgHash.erase( aFilterString );
+ aArgHash.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
- uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) ), uno::Sequence< beans::NamedValue >() );
- if ( !aNewEncryptionData.getLength() )
+ try
+ {
+ storeSelf( aArgHash.getAsConstPropertyValueList() );
+ bSaved = sal_True;
+ }
+ catch( const lang::IllegalArgumentException& )
+ {
+ // some additional arguments do not allow to use saving, SaveAs should be done
+ // but only for normal documents, the shared documents would be overwritten in this case
+ // that would mean an information loss
+ // TODO/LATER: need a new interaction for this case
+ if ( m_pData->m_pObjectShell->IsDocShared() )
{
- ::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ), ::rtl::OUString() );
- aNewEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aNewPassword );
- }
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) );
+ m_pData->m_pObjectShell->StoreLog();
- uno::Sequence< beans::NamedValue > aOldEncryptionData;
- GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData );
+ uno::Sequence< beans::NamedValue > aNewEncryptionData = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) ), uno::Sequence< beans::NamedValue >() );
+ if ( !aNewEncryptionData.getLength() )
+ {
+ ::rtl::OUString aNewPassword = aArgHash.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ), ::rtl::OUString() );
+ aNewEncryptionData = ::comphelper::OStorageHelper::CreatePackageEncryptionData( aNewPassword );
+ }
- if ( !aOldEncryptionData.getLength() && !aNewEncryptionData.getLength() )
- throw;
- else
- {
- // if the password is changed a special error should be used in case of shared document
- throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
+ uno::Sequence< beans::NamedValue > aOldEncryptionData;
+ GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData );
+
+ if ( !aOldEncryptionData.getLength() && !aNewEncryptionData.getLength() )
+ throw;
+ else
+ {
+ // if the password is changed a special error should be used in case of shared document
+ throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
+ }
}
}
}
Modified: incubator/ooo/branches/writer001/main/shell/source/unix/misc/senddoc.sh
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/shell/source/unix/misc/senddoc.sh?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/shell/source/unix/misc/senddoc.sh (original)
+++ incubator/ooo/branches/writer001/main/shell/source/unix/misc/senddoc.sh Mon Aug 20 11:46:19 2012
@@ -110,65 +110,74 @@ case `basename "$MAILER" | sed 's/-.*$//
done
if [ "$TO" != "" ]; then
- COMMAND=${COMMAND:-}${COMMAND:+,}to=${TO}
+ COMMAND=${COMMAND:-}${COMMAND:+,}to=\'${TO}\'
fi
if [ "$CC" != "" ]; then
- COMMAND=${COMMAND:-}${COMMAND:+,}cc=${CC}
+ COMMAND=${COMMAND:-}${COMMAND:+,}cc=\'${CC}\'
fi
if [ "$BCC" != "" ]; then
- COMMAND=${COMMAND:-}${COMMAND:+,}bcc=${BCC}
+ COMMAND=${COMMAND:-}${COMMAND:+,}bcc=\'${BCC}\'
fi
if [ "$SUBJECT" != "" ]; then
- COMMAND=${COMMAND:-}${COMMAND:+,}subject=${SUBJECT}
+ COMMAND=${COMMAND:-}${COMMAND:+,}subject=\'${SUBJECT}\'
fi
if [ "$BODY" != "" ]; then
- COMMAND=${COMMAND:-}${COMMAND:+,}body=${BODY}
+ COMMAND=${COMMAND:-}${COMMAND:+,}body=\'${BODY}\'
fi
if [ "$ATTACH" != "" ]; then
- COMMAND=${COMMAND:-}${COMMAND:+,}attachment=${ATTACH}
+ COMMAND=${COMMAND:-}${COMMAND:+,}attachment=\'${ATTACH}\'
fi
run_mozilla "$MAILER" "$COMMAND"
;;
- kmail)
-
- while [ "$1" != "" ]; do
- case $1 in
- --to)
- TO="${TO:-}${TO:+,}$2"
- shift
- ;;
- --cc)
- CC="${CC:-}${CC:+,}$2"
- shift
- ;;
- --bcc)
- BCC="${BCC:-}${BCC:+,}$2"
- shift
- ;;
- --subject)
- SUBJECT="$2"
- shift
- ;;
- --body)
- BODY="$2"
- shift
- ;;
- --attach)
- ATTACH="$2"
- shift
- ;;
- *)
- ;;
- esac
- shift;
- done
-
- ${MAILER} --composer ${CC:+--cc} ${CC:+"${CC}"} ${BCC:+--bcc} ${BCC:+"${BCC}"} \
- ${SUBJECT:+--subject} ${SUBJECT:+"${SUBJECT}"} ${BODY:+--body} ${BODY:+"${BODY}"} \
- ${ATTACH:+--attach} ${ATTACH:+"${ATTACH}"} ${TO:+"${TO}"}
- ;;
+ kmail)
+
+ while [ "$1" != "" ]; do
+ case $1 in
+ --to)
+ TO="${TO:-}${TO:+,}$2"
+ shift
+ ;;
+ --cc)
+ CC="${CC:-}${CC:+,}$2"
+ shift
+ ;;
+ --bcc)
+ BCC="${BCC:-}${BCC:+,}$2"
+ shift
+ ;;
+ --subject)
+ SUBJECT="$2"
+ shift
+ ;;
+ --body)
+ BODY="$2"
+ shift
+ ;;
+ --from)
+ FROM="$2"
+ shift
+ ;;
+ --attach)
+ ATTACH="${ATTACH:-}${ATTACH:+ }--attach "`echo "file://$2" | ${URI_ENCODE}`
+ shift
+ ;;
+ *)
+ ;;
+ esac
+ shift;
+ done
+
+ ${MAILER} --composer \
+ ${CC:+--cc} ${CC:+"${CC}"} \
+ ${BCC:+--bcc} ${BCC:+"${BCC}"} \
+ ${SUBJECT:+--subject} ${SUBJECT:+"${SUBJECT}"} \
+ ${BODY:+--body} ${BODY:+"${BODY}"} \
+ ${FROM:+--header} ${FROM:+"From: ${FROM}"} \
+ ${ATTACH:+${ATTACH}} \
+ ${TO:+"${TO}"}
+ ;;
mutt)
Modified: incubator/ooo/branches/writer001/main/slideshow/source/engine/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/slideshow/source/engine/makefile.mk?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/slideshow/source/engine/makefile.mk (original)
+++ incubator/ooo/branches/writer001/main/slideshow/source/engine/makefile.mk Mon Aug 20 11:46:19 2012
@@ -33,10 +33,6 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
-ENABLE_PRESENTER_EXTRA_UI is not used anymore
-.ENDIF
-
# --- Common ----------------------------------------------------------
ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE
Modified: incubator/ooo/branches/writer001/main/solenv/bin/build.pl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/build.pl?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/build.pl (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/build.pl Mon Aug 20 11:46:19 2012
@@ -1558,7 +1558,7 @@ sub get_options {
if (!$html) {
print_error("\"--html_path\" switch is used only with \"--html\"") if ($html_path);
print_error("\"--dontgraboutput\" switch is used only with \"--html\"") if ($dont_grab_output);
- };
+ }
if ((scalar keys %exclude_branches) && !$build_all_parents) {
print_error("\"--exclude_branch_from\" is not applicable for one module builds!!");
};
@@ -2017,10 +2017,7 @@ sub run_job {
if (!-d $log_dir) {
system("$perl $mkout");
};
- $error_code = system ("$job_to_do > $log_file 2>&1");
- if (!$grab_output && -f $log_file) {
- system("cat $log_file");
- };
+ $error_code = system ("$job_to_do 2>&1 | tee $log_file");
} else {
$error_code = system ("$job_to_do");
};
Modified: incubator/ooo/branches/writer001/main/solenv/bin/download_external_dependencies.pl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/download_external_dependencies.pl?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/download_external_dependencies.pl (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/download_external_dependencies.pl Mon Aug 20 11:46:19 2012
@@ -1,5 +1,26 @@
#!/usr/bin/perl
+#**************************************************************
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#**************************************************************
+
=head1 NAME
download_external_libraries.pl - Load missing tarballs specified in main/external_libs.lst.
@@ -159,11 +180,7 @@ sub ProcessLastBlock ()
my $name = GetValue('name');
my $checksum = GetChecksum();
- if ( ! defined $checksum)
- {
- die "no checksum given for $name";
- }
- elsif ( ! IsPresent($name, $checksum))
+ if ( ! IsPresent($name, $checksum))
{
AddDownloadRequest($name, $checksum);
}
@@ -263,7 +280,7 @@ sub SubstituteVariables ($)
{
my ($head,$name,$tail) = ($1,$2,$3);
my $value = GetValue($name);
- die "can evaluate variable $name" if ! defined $value;
+ die "can not evaluate variable $name" if ! defined $value;
$text = $head.$value.$tail;
die "(probably) detected an infinite recursion in variable definitions" if --$infinite_recursion_guard<=0;
@@ -387,7 +404,12 @@ sub IsPresent ($$)
# File exists. Check if its checksum is correct.
my $checksum;
- if ($given_checksum->{'type'} eq "MD5")
+ if ( ! defined $given_checksum)
+ {
+ print "no checksum given, can not verify\n";
+ return 1;
+ }
+ elsif ($given_checksum->{'type'} eq "MD5")
{
my $md5 = Digest::MD5->new();
open my $in, $filename;
@@ -410,7 +432,7 @@ sub IsPresent ($$)
{
# Checksum does not match. Delete the file.
print "$name exists, but checksum does not match => deleting\n";
- #unlink($filename);
+ unlink($filename);
return 0;
}
else
@@ -455,7 +477,12 @@ sub Download ()
foreach my $url (@$urls)
{
- last if DownloadFile($checksum->{'value'}."-".$name, $url, $checksum);
+ last if DownloadFile(
+ defined $checksum
+ ? $checksum->{'value'}."-".$name
+ : $name,
+ $url,
+ $checksum);
}
}
}
@@ -480,7 +507,8 @@ sub DownloadFile ($$$)
my $temporary_filename = $filename . ".part";
print "downloading to $temporary_filename\n";
- open my $out, ">$temporary_filename";
+ my $out;
+ open $out, ">$temporary_filename";
binmode($out);
# Prepare checksum
@@ -516,7 +544,7 @@ sub DownloadFile ($$$)
{
$last_was_redirect = 0;
# Throw away the data we got so far.
- $checksum->reset();
+ $digest->reset();
close $out;
open $out, ">$temporary_filename";
binmode($out);
Modified: incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/scriptitems.pm
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/scriptitems.pm?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/scriptitems.pm (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/scriptitems.pm Mon Aug 20 11:46:19 2012
@@ -538,11 +538,7 @@ sub add_bundled_extension_blobs
{
push @bundle_files, $bundlehttpsrc . $name;
}
- # file:// extensions are taken from the solver bin/ directory.
- for my $name (ExtensionsLst::GetExtensionList("file", @installer::globals::languageproducts))
- {
- push @bundle_files, $bundlefilesrc . $name;
- }
+ # file:// extensions are added as pre-registered in add_bundled_prereg_extension().
}
installer::logger::print_message(
@@ -606,11 +602,11 @@ sub add_bundled_prereg_extensions
}
else
{
- # Add the default rextensions for the current language set.
-
- # file:// URLs are currently handled by add_bundled_extension_blobs(@), therefore
- # we may not their handling here anmore.
- # @bundle_files = ExtensionsLst::GetExtensionList("file", @installer::globals::languageproducts);
+ # Add extensions from file:// URLs.
+ for my $name (ExtensionsLst::GetExtensionList("file", @installer::globals::languageproducts))
+ {
+ push @bundle_files, $name;
+ }
}
installer::logger::print_message(
@@ -985,7 +981,8 @@ sub replace_setup_variables
if ( $hashref->{'USERDIRPRODUCTVERSION'} ) { $userdirproductversion = $hashref->{'USERDIRPRODUCTVERSION'}; }
my $productkey = $productname . " " . $productversion;
- my $scsrevision = SvnRevision::DetectRevisionId(File::Spec->catfile($ENV{'SRC_ROOT'}, File::Spec->updir()));
+ my $scsrevision;
+ $scsrevision = "" unless ( $scsrevision = SvnRevision::DetectRevisionId(File::Spec->catfile($ENV{'SRC_ROOT'}, File::Spec->updir())) );
# string $buildid, which is used to replace the setup variable <buildid>
@@ -1014,7 +1011,7 @@ sub replace_setup_variables
my $value = $oneitem->{'Value'};
$value =~ s/\<buildid\>/$buildidstring/;
- $value =~ s/\<scsrevision\>/$scsrevision/ if defined $scsrevision;
+ $value =~ s/\<scsrevision\>/$scsrevision/;
$value =~ s/\<sequence_languages\>/$languagesstring/;
$value =~ s/\<productkey\>/$productkey/;
$value =~ s/\<productcode\>/$installer::globals::productcode/;
Modified: incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/component.pm
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/component.pm?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/component.pm (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/component.pm Mon Aug 20 11:46:19 2012
@@ -223,7 +223,7 @@ sub get_file_component_attributes
if ( $localstyles =~ /\bFONT\b/ )
{
- $attributes = 16; # font files will not be deinstalled
+ $attributes = 8; # font files will be deinstalled if the ref count is 0
}
if ( $localstyles =~ /\bASSEMBLY\b/ )
Modified: incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/property.pm
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/property.pm?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/property.pm (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/modules/installer/windows/property.pm Mon Aug 20 11:46:19 2012
@@ -479,7 +479,11 @@ sub update_property_table
my $arpcomments = get_arpcomments_for_property_table($allvariables, $languagestringref);
my $installlevel = get_installlevel_for_property_table();
my $ischeckforproductupdates = get_ischeckforproductupdates_for_property_table();
- my $manufacturer = get_manufacturer_for_property_table();
+# my $manufacturer = get_manufacturer_for_property_table();
+# tweak publisher name in the registry to OOOVENDOR=Apache Software Foundation. The global change of the
+# manufacturer from "OpenOffice.org" to "Apache Software Foundation" requires more analysis and testing
+# because more registry entries/keys are potentially affected. For example test product updates etc.
+ my $manufacturer = $allvariables->{'OOOVENDOR'};
my $productlanguage = get_productlanguage_for_property_table($language);
my $productname = get_productname_for_property_table($allvariables);
my $productversion = get_productversion_for_property_table();
Modified: incubator/ooo/branches/writer001/main/solenv/bin/pchdelta.py
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/bin/pchdelta.py?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/bin/pchdelta.py (original)
+++ incubator/ooo/branches/writer001/main/solenv/bin/pchdelta.py Mon Aug 20 11:46:19 2012
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# *************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
@@ -25,7 +25,7 @@
# Hacky little delta debug tool to figure out the proper includes for a pch file
#
# Usage:
-#
+#
# pchdelta.py <pch_target> <dir1> [<dir2> <dir3> ...]
#
# <pch_target> File to perform delta debugging on. The section to test
@@ -82,7 +82,7 @@ def writePch(pchname, header, footer, ac
outputfile.write(MARKER)
outputfile.write(footer)
outputfile.close()
-
+
# ------------------------------------------------------------------------------
# Recursive tester routine. Test the segment given and if an error is
@@ -165,6 +165,3 @@ if not testSequenceBuild(dirlist):
print "Starting evaluation of " + str(len(lines)) + " lines"
acceptedlines = binaryTest(dirlist, lines, pchname, header, footer, [], "", 0)
writePch(pchname, header, footer, acceptedlines, [])
-
-
-
Modified: incubator/ooo/branches/writer001/main/solenv/inc/installationtest.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/inc/installationtest.mk?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/inc/installationtest.mk (original)
+++ incubator/ooo/branches/writer001/main/solenv/inc/installationtest.mk Mon Aug 20 11:46:19 2012
@@ -95,10 +95,10 @@ my_javaenv = \
.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
OOO_EXTRACT_TO:=$(shell cygpath -m `mktemp -dt ooosmoke.XXXXXX`)
$(MISC)/$(TARGET)/installation.flag : $(shell \
- ls $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip)
+ ls $(installationtest_instset)/Apache_OpenOffice_*_install-arc_$(defaultlangiso).zip)
$(COMMAND_ECHO)$(MKDIRHIER) $(@:d)
- $(COMMAND_ECHO)unzip -q $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip -d "$(OOO_EXTRACT_TO)"
- $(COMMAND_ECHO)mv "$(OOO_EXTRACT_TO)"/OOo_*_install-arc_$(defaultlangiso) "$(OOO_EXTRACT_TO)"/opt
+ $(COMMAND_ECHO)unzip -q $(installationtest_instset)/Apache_OpenOffice_*_install-arc_$(defaultlangiso).zip -d "$(OOO_EXTRACT_TO)"
+ $(COMMAND_ECHO)mv "$(OOO_EXTRACT_TO)"/Apache_OpenOffice_*_install-arc_$(defaultlangiso) "$(OOO_EXTRACT_TO)"/opt
$(COMMAND_ECHO)echo "$(OOO_EXTRACT_TO)" > $@
.END
Modified: incubator/ooo/branches/writer001/main/solenv/inc/libs.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/solenv/inc/libs.mk?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/solenv/inc/libs.mk (original)
+++ incubator/ooo/branches/writer001/main/solenv/inc/libs.mk Mon Aug 20 11:46:19 2012
@@ -214,7 +214,7 @@ ZLIB3RDLIB=-lz
ZLIB3RDLIB=-lzlib
.ENDIF
.IF "$(SYSTEM_JPEG)"=="YES"
-.IF "$(SOLAR_JAVA)" != "" && "$(JDK)" != "gcj" && "$(OS)" != "MACOSX"
+.IF "$(SOLAR_JAVA)" != "" && "$(JDK)" != "gcj" && "$(OS)" != "MACOSX" && "$(OS)" != "OS2"
#i34482# Blackdown/Sun jdk is in the libsearch patch and has a libjpeg :-(
.IF "$(OS)" == "FREEBSD"
JPEG3RDLIB=/usr/local/lib/libjpeg.so
@@ -344,7 +344,7 @@ ULINGULIB=-lulingu
.IF "$(SYSTEM_HUNSPELL)" == "YES"
HUNSPELLLIB=$(HUNSPELL_LIBS)
.ELSE
-HUNSPELLLIB=-lhunspell-1.2
+HUNSPELLLIB=-lhunspell-1.3
.ENDIF
.IF "$(SYSTEM_MYTHES)" == "YES"
MYTHESLIB=$(MYTHES_LIBS)
@@ -355,7 +355,9 @@ MYTHESLIB=-lmythes-1.2
.ENDIF
PYUNOLIB=-lpyuno
COINMPLIBS=-lCoinMP -lCoinUtils -lClp -lCbc -lOsi -lOsiClp -lCgl -lCbcSolver
-SERFLIBS=-lapr-1 -laprutil-1 -lserf-1
+INTERNAL_APR_LIBS=-lapr-1
+INTERNAL_APR_UTIL_LIBS=-laprutil-1
+INTERNAL_SERF_LIBS=-lserf-1
SOFFICELIB=-lsofficeapp
UNOPKGAPPLIB=-lunopkgapp
TESTLIB=-ltest
@@ -526,7 +528,9 @@ HUNSPELLLIB=$(LIBPRE) libhunspell.lib
MYTHESLIB=libmythes.lib
PYUNOLIB=ipyuno.lib
COINMPLIBS=CoinMP.lib
-SERFLIBS=libapr-1.lib iapr-util.lib iserf.lib
+INTERNAL_APR_LIBS=libapr-1.lib
+INTERNAL_APR_UTIL_LIBS=iapr-util.lib
+INTERNAL_SERF_LIBS=iserf.lib
SOFFICELIB=isofficeapp.lib
UNOPKGAPPLIB=iunopkgapp.lib
TESTLIB=itest.lib
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stg.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stg.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stg.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stg.cxx Mon Aug 20 11:46:19 2012
@@ -103,7 +103,8 @@ const SvStream* OLEStorageBase::GetSvStr
OLEStorageBase::OLEStorageBase( StgIo* p, StgDirEntry* pe, StreamMode& nMode )
: nStreamMode( nMode ), pIo( p ), pEntry( pe )
{
- p->IncRef();
+ if ( p )
+ p->IncRef();
if( pe )
pe->nRefCnt++;
}
@@ -120,21 +121,28 @@ OLEStorageBase::~OLEStorageBase()
else
pEntry->Close();
}
+
+ pEntry = NULL;
}
- if( !pIo->DecRef() )
+ if( pIo && !pIo->DecRef() )
+ {
delete pIo;
+ pIo = NULL;
+ }
}
// Validate the instance for I/O
sal_Bool OLEStorageBase::Validate_Impl( sal_Bool bWrite ) const
{
- if( pEntry
+ if( pIo
+ && pIo->pTOC
+ && pEntry
&& !pEntry->bInvalid
&& ( !bWrite || !pEntry->bDirect || ( nStreamMode & STREAM_WRITE ) ) )
- return sal_True;
+ return sal_True;
return sal_False;
}
@@ -173,7 +181,7 @@ StorageStream::StorageStream( StgIo* p,
: OLEStorageBase( p, q, m_nMode ), nPos( 0L )
{
// The dir entry may be 0; this means that the stream is invalid.
- if( q )
+ if( q && p )
{
if( q->nRefCnt == 1 )
{
@@ -274,14 +282,21 @@ sal_Bool StorageStream::Commit()
sal_Bool StorageStream::Revert()
{
- pEntry->Revert();
- pIo->MoveError( *this );
- return Good();
+ sal_Bool bResult = sal_False;
+
+ if ( Validate() )
+ {
+ pEntry->Revert();
+ pIo->MoveError( *this );
+ bResult = Good();
+ }
+
+ return bResult;
}
sal_Bool StorageStream::CopyTo( BaseStorageStream* pDest )
{
- if( !Validate() || !pDest->Validate( sal_True ) || Equals( *pDest ) )
+ if( !Validate() || !pDest || !pDest->Validate( sal_True ) || Equals( *pDest ) )
return sal_False;
pEntry->Copy( *pDest );
pDest->Commit();
@@ -341,14 +356,20 @@ sal_Bool Storage::IsStorageFile( const S
sal_Bool Storage::IsStorageFile( SvStream* pStream )
{
- StgHeader aHdr;
- sal_uLong nPos = pStream->Tell();
- sal_Bool bRet = ( aHdr.Load( *pStream ) && aHdr.Check() );
-
- // It's not a stream error if it is too small for a OLE storage header
- if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK )
- pStream->ResetError();
- pStream->Seek( nPos );
+ sal_Bool bRet = sal_False;
+
+ if ( pStream )
+ {
+ StgHeader aHdr;
+ sal_uLong nPos = pStream->Tell();
+ bRet = ( aHdr.Load( *pStream ) && aHdr.Check() );
+
+ // It's not a stream error if it is too small for a OLE storage header
+ if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK )
+ pStream->ResetError();
+ pStream->Seek( nPos );
+ }
+
return bRet;
}
@@ -463,7 +484,9 @@ void Storage::Init( sal_Bool bCreate )
pEntry = NULL;
sal_Bool bHdrLoaded = sal_False;
bIsRoot = sal_True;
- if( pIo->Good() )
+
+ OSL_ENSURE( pIo, "The pointer may not be empty at this point!" );
+ if( pIo->Good() && pIo->GetStrm() )
{
sal_uLong nSize = pIo->GetStrm()->Seek( STREAM_SEEK_TO_END );
pIo->GetStrm()->Seek( 0L );
@@ -484,7 +507,7 @@ void Storage::Init( sal_Bool bCreate )
// the file is empty
if( !bHdrLoaded )
pIo->Init();
- if( pIo->Good() )
+ if( pIo->Good() && pIo->pTOC )
{
pEntry = pIo->pTOC->GetRoot();
pEntry->nRefCnt++;
@@ -539,7 +562,7 @@ const String& Storage::GetName() const
void Storage::FillInfoList( SvStorageInfoList* pList ) const
{
- if( Validate() )
+ if( Validate() && pList )
{
StgIterator aIter( *pEntry );
StgDirEntry* p = aIter.First();
@@ -739,21 +762,24 @@ sal_Bool Storage::CopyTo( const String&
BaseStorage* p1 = OpenStorage( rElem, INTERNAL_MODE );
BaseStorage* p2 = pDest->OpenOLEStorage( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect );
- sal_uLong nTmpErr = p2->GetError();
- if( !nTmpErr )
- {
- p2->SetClassId( p1->GetClassId() );
- p1->CopyTo( p2 );
- SetError( p1->GetError() );
-
- nTmpErr = p2->GetError();
- if( !nTmpErr )
- p2->Commit();
- else
- pDest->SetError( nTmpErr );
- }
- else
- pDest->SetError( nTmpErr );
+ if ( p2 )
+ {
+ sal_uLong nTmpErr = p2->GetError();
+ if( !nTmpErr )
+ {
+ p2->SetClassId( p1->GetClassId() );
+ p1->CopyTo( p2 );
+ SetError( p1->GetError() );
+
+ nTmpErr = p2->GetError();
+ if( !nTmpErr )
+ p2->Commit();
+ else
+ pDest->SetError( nTmpErr );
+ }
+ else
+ pDest->SetError( nTmpErr );
+ }
delete p1;
delete p2;
@@ -765,20 +791,23 @@ sal_Bool Storage::CopyTo( const String&
BaseStorageStream* p1 = OpenStream( rElem, INTERNAL_MODE );
BaseStorageStream* p2 = pDest->OpenStream( rNew, STREAM_WRITE | STREAM_SHARE_DENYALL, pEntry->bDirect );
- sal_uLong nTmpErr = p2->GetError();
- if( !nTmpErr )
- {
- p1->CopyTo( p2 );
- SetError( p1->GetError() );
-
- nTmpErr = p2->GetError();
- if( !nTmpErr )
- p2->Commit();
- else
- pDest->SetError( nTmpErr );
- }
- else
- pDest->SetError( nTmpErr );
+ if ( p2 )
+ {
+ sal_uLong nTmpErr = p2->GetError();
+ if( !nTmpErr )
+ {
+ p1->CopyTo( p2 );
+ SetError( p1->GetError() );
+
+ nTmpErr = p2->GetError();
+ if( !nTmpErr )
+ p2->Commit();
+ else
+ pDest->SetError( nTmpErr );
+ }
+ else
+ pDest->SetError( nTmpErr );
+ }
delete p1;
delete p2;
@@ -1036,17 +1065,23 @@ sal_Bool Storage::ValidateFAT()
void Storage::SetDirty()
{
- pEntry->SetDirty();
+ if ( pEntry )
+ pEntry->SetDirty();
}
void Storage::SetClassId( const ClsId& rId )
{
- pEntry->aEntry.SetClassId( rId );
+ if ( pEntry )
+ pEntry->aEntry.SetClassId( rId );
}
const ClsId& Storage::GetClassId() const
{
- return pEntry->aEntry.GetClassId();
+ if ( pEntry )
+ return pEntry->aEntry.GetClassId();
+
+ static ClsId aDummyId = {0,0,0,0,0,0,0,0,0,0,0};
+ return aDummyId;
}
const SvStream* Storage::GetSvStream() const
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgavl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgavl.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgavl.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgavl.cxx Mon Aug 20 11:46:19 2012
@@ -24,7 +24,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sot.hxx"
-
+#include <osl/diagnose.h>
#include "stgavl.hxx"
StgAvlNode::StgAvlNode()
@@ -41,13 +41,16 @@ StgAvlNode::~StgAvlNode()
StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
{
- StgAvlNode* p = this;
- while( p )
+ if ( pFind )
{
- short nRes = p->Compare( pFind );
- if( !nRes )
- return p;
- else p = ( nRes < 0 ) ? p->pLeft : p->pRight;
+ StgAvlNode* p = this;
+ while( p )
+ {
+ short nRes = p->Compare( pFind );
+ if( !nRes )
+ return p;
+ else p = ( nRes < 0 ) ? p->pLeft : p->pRight;
+ }
}
return NULL;
}
@@ -61,23 +64,28 @@ short StgAvlNode::Locate
{
short nRes = 0;
StgAvlNode* pCur = this;
+
+ OSL_ENSURE( pPivot && pParent && pPrev, "The pointers may not be NULL!" );
*pParent = *pPrev = NULL;
*pPivot = this;
// search tree for insertion point
-
- while( pCur != NULL )
+ if ( pFind )
{
- // check for pPivot
- if( pCur->nBalance != 0 )
- *pPivot = pCur, *pParent = *pPrev;
- // save pPrev location and see what direction to go
- *pPrev = pCur;
- nRes = pCur->Compare( pFind );
- if( nRes == 0 )
- break;
- else pCur = ( nRes < 0 ) ? pCur->pLeft : pCur->pRight;
+ while( pCur != NULL )
+ {
+ // check for pPivot
+ if( pCur->nBalance != 0 )
+ *pPivot = pCur, *pParent = *pPrev;
+ // save pPrev location and see what direction to go
+ *pPrev = pCur;
+ nRes = pCur->Compare( pFind );
+ if( nRes == 0 )
+ break;
+ else pCur = ( nRes < 0 ) ? pCur->pLeft : pCur->pRight;
+ }
}
+
return( nRes );
}
@@ -89,8 +97,10 @@ short StgAvlNode::Adjust( StgAvlNode** p
StgAvlNode* pCur = this;
short nDelta;
// no traversing
- if( pCur == pNew )
+ OSL_ENSURE( pHeavy && pNew, "The pointers is not allowed to be NULL!" );
+ if( pCur == pNew || !pNew )
return nBalance;
+
short nRes = Compare( pNew );
if( nRes > 0 )
{
@@ -127,6 +137,7 @@ short StgAvlNode::Adjust( StgAvlNode** p
StgAvlNode* StgAvlNode::RotLL()
{
+ OSL_ENSURE( pLeft, "The pointer is not allowed to be NULL!" );
StgAvlNode *pHeavy = pLeft;
pLeft = pHeavy->pRight;
pHeavy->pRight = this;
@@ -138,7 +149,7 @@ StgAvlNode* StgAvlNode::RotLL()
StgAvlNode* StgAvlNode::RotLR()
{
-
+ OSL_ENSURE( pLeft && pLeft->pRight, "The pointer is not allowed to be NULL!" );
StgAvlNode* pHeavy = pLeft;
StgAvlNode* pNewRoot = pHeavy->pRight;
@@ -170,6 +181,7 @@ StgAvlNode* StgAvlNode::RotLR()
StgAvlNode* StgAvlNode::RotRR()
{
+ OSL_ENSURE( pRight, "The pointer is not allowed to be NULL!" );
StgAvlNode* pHeavy = pRight;
pRight = pHeavy->pLeft;
pHeavy->pLeft = this;
@@ -181,6 +193,7 @@ StgAvlNode* StgAvlNode::RotRR()
StgAvlNode* StgAvlNode::RotRL()
{
+ OSL_ENSURE( pRight && pRight->pLeft, "The pointer is not allowed to be NULL!" );
StgAvlNode* pHeavy = pRight;
StgAvlNode* pNewRoot = pHeavy->pLeft;
pHeavy->pLeft = pNewRoot->pRight;
@@ -210,7 +223,7 @@ StgAvlNode* StgAvlNode::RotRL()
StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, sal_Bool bPtrs )
{
- if( *p )
+ if( p && *p && pDel )
{
StgAvlNode* pCur = *p;
short nRes = bPtrs ? short( pCur == pDel ) : short(pCur->Compare( pDel ));
@@ -264,14 +277,11 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode*
void StgAvlNode::StgEnum( short& n )
{
- if( this )
- {
- if( pLeft )
- pLeft->StgEnum( n );
- nId = n++;
- if( pRight )
- pRight->StgEnum( n );
- }
+ if( pLeft )
+ pLeft->StgEnum( n );
+ nId = n++;
+ if( pRight )
+ pRight->StgEnum( n );
}
// Add node to AVL tree.
@@ -280,6 +290,9 @@ void StgAvlNode::StgEnum( short& n )
sal_Bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
{
StgAvlNode* pPivot, *pHeavy, *pNewRoot, *pParent, *pPrev;
+ if ( !pRoot )
+ return sal_False;
+
// special case - empty tree
if( *pRoot == NULL )
{
@@ -290,6 +303,8 @@ sal_Bool StgAvlNode::Insert( StgAvlNode*
short nRes = (*pRoot)->Locate( pIns, &pPivot, &pParent, &pPrev );
if( !nRes )
return sal_False;
+ OSL_ENSURE( pPivot && pPrev, "The pointers may not be NULL!" );
+
// add new node
if( nRes < 0 )
pPrev->pLeft = pIns;
@@ -327,6 +342,9 @@ sal_Bool StgAvlNode::Insert( StgAvlNode*
sal_Bool StgAvlNode::Remove( StgAvlNode** pRoot, StgAvlNode* pDel, sal_Bool bDel )
{
+ if ( !pRoot )
+ return sal_False;
+
// special case - empty tree
if( *pRoot == NULL )
return sal_False;
@@ -357,6 +375,9 @@ sal_Bool StgAvlNode::Remove( StgAvlNode*
sal_Bool StgAvlNode::Move
( StgAvlNode** pRoot1, StgAvlNode** pRoot2, StgAvlNode* pMove )
{
+ if ( !pRoot1 )
+ return sal_False;
+
// special case - empty tree
if( *pRoot1 == NULL )
return sal_False;
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.cxx Mon Aug 20 11:46:19 2012
@@ -67,6 +67,7 @@ typedef std::hash_map
StgPage::StgPage( StgCache* p, short n )
{
+ OSL_ENSURE( n >= 512, "Unexpected page size is provided!" );
pCache = p;
nData = n;
bDirty = sal_False;
@@ -130,11 +131,15 @@ StgCache::~StgCache()
void StgCache::SetPhysPageSize( short n )
{
- nPageSize = n;
- sal_uLong nPos = pStrm->Tell();
- sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
- nPages = lcl_GetPageCount( nFileSize, nPageSize );
- pStrm->Seek( nPos );
+ OSL_ENSURE( n >= 512, "Unexpecte page size is provided!" );
+ if ( n >= 512 )
+ {
+ nPageSize = n;
+ sal_uLong nPos = pStrm->Tell();
+ sal_uLong nFileSize = pStrm->Seek( STREAM_SEEK_TO_END );
+ nPages = lcl_GetPageCount( nFileSize, nPageSize );
+ pStrm->Seek( nPos );
+ }
}
// Create a new cache element
@@ -188,19 +193,24 @@ StgPage* StgCache::Create( sal_Int32 nPg
void StgCache::Erase( StgPage* pElem )
{
- //remove from LRU
- pElem->pNext1->pLast1 = pElem->pLast1;
- pElem->pLast1->pNext1 = pElem->pNext1;
- if( pCur == pElem )
- pCur = ( pElem->pNext1 == pElem ) ? NULL : pElem->pNext1;
- if( pLRUCache )
- ((UsrStgPagePtr_Impl*)pLRUCache)->erase( pElem->nPage );
- // remove from Sorted
- pElem->pNext2->pLast2 = pElem->pLast2;
- pElem->pLast2->pNext2 = pElem->pNext2;
- if( pElem1 == pElem )
- pElem1 = ( pElem->pNext2 == pElem ) ? NULL : pElem->pNext2;
- delete pElem;
+ OSL_ENSURE( pElem, "The pointer should not be NULL!" );
+ if ( pElem )
+ {
+ OSL_ENSURE( pElem->pNext1 && pElem->pLast1, "The pointers may not be NULL!" );
+ //remove from LRU
+ pElem->pNext1->pLast1 = pElem->pLast1;
+ pElem->pLast1->pNext1 = pElem->pNext1;
+ if( pCur == pElem )
+ pCur = ( pElem->pNext1 == pElem ) ? NULL : pElem->pNext1;
+ if( pLRUCache )
+ ((UsrStgPagePtr_Impl*)pLRUCache)->erase( pElem->nPage );
+ // remove from Sorted
+ pElem->pNext2->pLast2 = pElem->pLast2;
+ pElem->pLast2->pNext2 = pElem->pNext2;
+ if( pElem1 == pElem )
+ pElem1 = ( pElem->pNext2 == pElem ) ? NULL : pElem->pNext2;
+ delete pElem;
+ }
}
// remove all cache elements without flushing them
@@ -232,9 +242,11 @@ StgPage* StgCache::Find( sal_Int32 nPage
{
// page found
StgPage* pFound = (*aIt).second;
+ OSL_ENSURE( pFound, "The pointer may not be NULL!" );
if( pFound != pCur )
{
+ OSL_ENSURE( pFound->pNext1 && pFound->pLast1, "The pointers may not be NULL!" );
// remove from LRU
pFound->pNext1->pLast1 = pFound->pLast1;
pFound->pLast1->pNext1 = pFound->pNext1;
@@ -281,7 +293,10 @@ StgPage* StgCache::Copy( sal_Int32 nNew,
// old page: we must have this data!
StgPage* q = Get( nOld, sal_True );
if( q )
+ {
+ OSL_ENSURE( p->nData == q->nData, "Unexpected page size!" );
memcpy( p->pData, q->pData, p->nData );
+ }
}
p->SetDirty();
return p;
@@ -456,11 +471,15 @@ sal_Bool StgCache::Read( sal_Int32 nPage
sal_Bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg )
{
- if( Good() )
+ if( Good() )
{
sal_uLong nPos = Page2Pos( nPage );
- sal_uLong nBytes = nPg * nPageSize;
+ sal_uLong nBytes = 0;
+ if ( SAL_MAX_INT32 / nPg > nPageSize )
+ nBytes = nPg * nPageSize;
+
// fixed address and size for the header
+ // nPageSize must be >= 512, otherwise the header can not be written here, we check it on import
if( nPage == -1 )
nPos = 0L, nBytes = 512;
if( pStrm->Tell() != nPos )
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.hxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgcache.hxx Mon Aug 20 11:46:19 2012
@@ -71,7 +71,7 @@ public:
SvStream* GetStrm() { return pStrm; }
void SetStrm( SvStream*, sal_Bool );
void SetStrm( UCBStorageStream* );
- sal_Bool IsWritable() { return pStrm->IsWritable(); }
+ sal_Bool IsWritable() { return ( pStrm && pStrm->IsWritable() ); }
sal_Bool Good() { return sal_Bool( nError == SVSTREAM_OK ); }
sal_Bool Bad() { return sal_Bool( nError != SVSTREAM_OK ); }
sal_uLong GetError() { return nError; }
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.cxx Mon Aug 20 11:46:19 2012
@@ -50,9 +50,9 @@
// Problem der Implementation: Keine Hierarchischen commits. Daher nur
// insgesamt transaktionsorientert oder direkt.
-StgDirEntry::StgDirEntry( const void* pFrom, sal_Bool * pbOk ) : StgAvlNode()
+StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk ) : StgAvlNode()
{
- *pbOk = aEntry.Load( pFrom );
+ *pbOk = aEntry.Load( pBuffer, nBufferLen );
InitMembers();
}
@@ -99,8 +99,13 @@ StgDirEntry::~StgDirEntry()
short StgDirEntry::Compare( const StgAvlNode* p ) const
{
- const StgDirEntry* pEntry = (const StgDirEntry*) p;
- return aEntry.Compare( pEntry->aEntry );
+ short nResult = -1;
+ if ( p )
+ {
+ const StgDirEntry* pEntry = (const StgDirEntry*) p;
+ nResult = aEntry.Compare( pEntry->aEntry );
+ }
+ return nResult;
}
// Enumerate the entry numbers.
@@ -260,9 +265,9 @@ void StgDirEntry::OpenStream( StgIo& rIo
sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold();
delete pStgStrm;
if( !bForceBig && aEntry.GetSize() < nThreshold )
- pStgStrm = new StgSmallStrm( rIo, this );
+ pStgStrm = new StgSmallStrm( rIo, *this );
else
- pStgStrm = new StgDataStrm( rIo, this );
+ pStgStrm = new StgDataStrm( rIo, *this );
if( bInvalid && aEntry.GetSize() )
{
// This entry has invalid data, so delete that data
@@ -320,6 +325,10 @@ sal_Bool StgDirEntry::SetSize( sal_Int32
}
else
{
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( !pStgStrm )
+ return sal_False;
+
sal_Bool bRes = sal_False;
StgIo& rIo = pStgStrm->GetIo();
sal_Int32 nThreshold = rIo.aHdr.GetThreshold();
@@ -399,6 +408,10 @@ sal_Int32 StgDirEntry::Seek( sal_Int32 n
}
else
{
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( !pStgStrm )
+ return nPos;
+
sal_Int32 nSize = aEntry.GetSize();
if( nNew < 0 )
@@ -418,6 +431,7 @@ sal_Int32 StgDirEntry::Seek( sal_Int32 n
pStgStrm->Pos2Page( nNew );
nNew = pStgStrm->GetPos();
}
+
return nPos = nNew;
}
@@ -432,7 +446,14 @@ sal_Int32 StgDirEntry::Read( void* p, sa
else if( pCurStrm )
nLen = pCurStrm->Read( p, nLen );
else
+ {
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( !pStgStrm )
+ return 0;
+
nLen = pStgStrm->Read( p, nLen );
+ }
+
nPos += nLen;
return nLen;
}
@@ -450,6 +471,11 @@ sal_Int32 StgDirEntry::Write( const void
// Is this stream opened in transacted mode? Do we have to make a copy?
if( !bDirect && !pTmpStrm && !Strm2Tmp() )
return 0;
+
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( !pStgStrm )
+ return 0;
+
if( pTmpStrm )
{
nLen = pTmpStrm->Write( p, nLen );
@@ -631,6 +657,10 @@ sal_Bool StgDirEntry::Strm2Tmp()
{
if( n )
{
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( !pStgStrm )
+ return sal_False;
+
sal_uInt8 aTempBytes[ 4096 ];
void* p = static_cast<void*>( aTempBytes );
pStgStrm->Pos2Page( 0L );
@@ -652,9 +682,13 @@ sal_Bool StgDirEntry::Strm2Tmp()
else
n = 1;
}
+
if( n )
{
- pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( pStgStrm )
+ pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
+
delete pTmpStrm;
pTmpStrm = NULL;
return sal_False;
@@ -672,6 +706,9 @@ sal_Bool StgDirEntry::Tmp2Strm()
pTmpStrm = pCurStrm, pCurStrm = NULL;
if( pTmpStrm )
{
+ OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
+ if ( !pStgStrm )
+ return sal_False;
sal_uLong n = pTmpStrm->GetSize();
StgStrm* pNewStrm;
StgIo& rIo = pStgStrm->GetIo();
@@ -809,7 +846,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n
if( p )
{
sal_Bool bOk(sal_False);
- StgDirEntry* pCur = new StgDirEntry( p, &bOk );
+ StgDirEntry* pCur = new StgDirEntry( p, STGENTRY_SIZE, &bOk );
if( !bOk )
{
@@ -864,6 +901,9 @@ void StgDirStrm::SetupEntry( sal_Int32 n
sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes )
{
// Always allocate full pages
+ if ( nBytes < 0 )
+ nBytes = 0;
+
nBytes = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize;
return StgStrm::SetSize( nBytes );
}
@@ -872,7 +912,7 @@ sal_Bool StgDirStrm::SetSize( sal_Int32
sal_Bool StgDirStrm::Store()
{
- if( !pRoot->IsDirty() )
+ if( !pRoot || !pRoot->IsDirty() )
return sal_True;
if( !pRoot->StoreStreams( rIo ) )
return sal_False;
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.hxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgdir.hxx Mon Aug 20 11:46:19 2012
@@ -66,7 +66,7 @@ public:
sal_Bool bDirect; // sal_True: direct mode
sal_Bool bZombie; // sal_True: Removed From StgIo
sal_Bool bInvalid; // sal_True: invalid entry
- StgDirEntry( const void*, sal_Bool * pbOk );
+ StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk );
StgDirEntry( const StgEntry& );
~StgDirEntry();
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.cxx Mon Aug 20 11:46:19 2012
@@ -74,32 +74,61 @@ SvStream& operator <<( SvStream& r, cons
///////////////////////////// class StgHeader ////////////////////////////
StgHeader::StgHeader()
-{
- memset( this, 0, sizeof( StgHeader ) );
+: nVersion( 0 )
+, nByteOrder( 0 )
+, nPageSize( 0 )
+, nDataPageSize( 0 )
+, bDirty( 0 )
+, nFATSize( 0 )
+, nTOCstrm( 0 )
+, nReserved( 0 )
+, nThreshold( 0 )
+, nDataFAT( 0 )
+, nDataFATSize( 0 )
+, nMasterChain( 0 )
+, nMaster( 0 )
+{
+ memset( cSignature, 0, sizeof( cSignature ) );
+ memset( &aClsId, 0, sizeof( ClsId ) );
+ memset( cReserved, 0, sizeof( cReserved ) );
+ memset( nMasterFAT, 0, sizeof( nMasterFAT ) );
}
void StgHeader::Init()
{
- memset( this, 0, sizeof( StgHeader ) );
memcpy( cSignature, cStgSignature, 8 );
+ memset( &aClsId, 0, sizeof( ClsId ) );
nVersion = 0x0003003B;
nByteOrder = 0xFFFE;
nPageSize = 9; // 512 bytes
nDataPageSize = 6; // 64 bytes
+ bDirty = 0;
+ memset( cReserved, 0, sizeof( cReserved ) );
+ nFATSize = 0;
+ nTOCstrm = 0;
+ nReserved = 0;
nThreshold = 4096;
+ nDataFAT = 0;
nDataFATSize = 0;
nMasterChain = STG_EOF;
+
SetTOCStart( STG_EOF );
SetDataFATStart( STG_EOF );
- for( short i = 0; i < 109; i++ )
+ for( short i = 0; i < cFATPagesInHeader; i++ )
SetFATPage( i, STG_FREE );
}
sal_Bool StgHeader::Load( StgIo& rIo )
{
- SvStream& r = *rIo.GetStrm();
- Load( r );
- return rIo.Good();
+ sal_Bool bResult = sal_False;
+ if ( rIo.GetStrm() )
+ {
+ SvStream& r = *rIo.GetStrm();
+ bResult = Load( r );
+ bResult = ( bResult && rIo.Good() );
+ }
+
+ return bResult;
}
sal_Bool StgHeader::Load( SvStream& r )
@@ -120,9 +149,10 @@ sal_Bool StgHeader::Load( SvStream& r )
>> nDataFATSize // 40 # of data FATpages
>> nMasterChain // 44 chain to the next master block
>> nMaster; // 48 # of additional master blocks
- for( short i = 0; i < 109; i++ )
+ for( short i = 0; i < cFATPagesInHeader; i++ )
r >> nMasterFAT[ i ];
- return r.GetErrorCode() == ERRCODE_NONE;
+
+ return ( r.GetErrorCode() == ERRCODE_NONE && Check() );
}
sal_Bool StgHeader::Store( StgIo& rIo )
@@ -145,7 +175,7 @@ sal_Bool StgHeader::Store( StgIo& rIo )
<< nDataFATSize // 40 # of data FAT pages
<< nMasterChain // 44 chain to the next master block
<< nMaster; // 48 # of additional master blocks
- for( short i = 0; i < 109; i++ )
+ for( short i = 0; i < cFATPagesInHeader; i++ )
r << nMasterFAT[ i ];
bDirty = !rIo.Good();
return sal_Bool( !bDirty );
@@ -161,13 +191,20 @@ sal_Bool StgHeader::Check()
{
return sal_Bool( memcmp( cSignature, cStgSignature, 8 ) == 0
&& (short) ( nVersion >> 16 ) == 3 )
+ && nPageSize == 9
&& lcl_wontoverflow(nPageSize)
- && lcl_wontoverflow(nDataPageSize);
+ && lcl_wontoverflow(nDataPageSize)
+ && nFATSize > 0
+ && nTOCstrm >= 0
+ && nThreshold > 0
+ && ( nDataFAT == STG_EOF || ( nDataFAT >= 0 && nDataFATSize > 0 ) )
+ && ( nMasterChain == STG_EOF || ( nMasterChain >=0 && nMaster > 0 ) )
+ && nMaster >= 0;
}
sal_Int32 StgHeader::GetFATPage( short n ) const
{
- if( n >= 0 && n < 109 )
+ if( n >= 0 && n < cFATPagesInHeader )
return nMasterFAT[ n ];
else
return STG_EOF;
@@ -175,7 +212,7 @@ sal_Int32 StgHeader::GetFATPage( short n
void StgHeader::SetFATPage( short n, sal_Int32 nb )
{
- if( n >= 0 && n < 109 )
+ if( n >= 0 && n < cFATPagesInHeader )
{
if( nMasterFAT[ n ] != nb )
bDirty = sal_True, nMasterFAT[ n ] = nb;
@@ -251,7 +288,21 @@ static void FromUnicode( String& rName )
*/
sal_Bool StgEntry::Init()
{
- memset( this, 0, sizeof (StgEntry) - sizeof( String ) );
+ memset( nName, 0, sizeof( nName ) );
+ nNameLen = 0;
+ cType = 0;
+ cFlags = 0;
+ nLeft = 0;
+ nRight = 0;
+ nChild = 0;
+ memset( &aClsId, 0, sizeof( aClsId ) );
+ nFlags = 0;
+ nMtime[0] = 0; nMtime[1] = 0;
+ nAtime[0] = 0; nAtime[1] = 0;
+ nPage1 = 0;
+ nSize = 0;
+ nUnknown = 0;
+
SetLeaf( STG_LEFT, STG_FREE );
SetLeaf( STG_RIGHT, STG_FREE );
SetLeaf( STG_CHILD, STG_FREE );
@@ -358,9 +409,12 @@ short StgEntry::Compare( const StgEntry&
// These load/store operations are a bit more complicated,
// since they have to copy their contents into a packed structure.
-sal_Bool StgEntry::Load( const void* pFrom )
+sal_Bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize )
{
- SvMemoryStream r( (sal_Char*) pFrom, 128, STREAM_READ );
+ if ( nBufSize < 128 )
+ return sal_False;
+
+ SvMemoryStream r( (sal_Char*) pFrom, nBufSize, STREAM_READ );
for( short i = 0; i < 32; i++ )
r >> nName[ i ]; // 00 name as WCHAR
r >> nNameLen // 40 size of name in bytes including 00H
@@ -382,7 +436,9 @@ sal_Bool StgEntry::Load( const void* pFr
sal_uInt16 n = nNameLen;
if( n )
n = ( n >> 1 ) - 1;
- if( n > 31 || (nSize < 0 && cType != STG_STORAGE) )
+ if ( n > 31 ||
+ (nSize < 0 && cType != STG_STORAGE) ||
+ ( nPage1 < 0 && nPage1 != STG_EOF ) )
{
// the size makes no sence for the substorage
// TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.hxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgelem.hxx Mon Aug 20 11:46:19 2012
@@ -42,47 +42,50 @@ SvStream& operator<<( SvStream&, const C
class StgHeader
{
- sal_uInt8 cSignature[ 8 ]; // 00 signature (see below)
- ClsId aClsId; // 08 Class ID
- sal_Int32 nVersion; // 18 version number
- sal_uInt16 nByteOrder; // 1C Unicode byte order indicator
- sal_Int16 nPageSize; // 1E 1 << nPageSize = block size
- sal_Int16 nDataPageSize; // 20 1 << this size == data block size
- sal_uInt8 bDirty; // 22 internal dirty flag
- sal_uInt8 cReserved[ 9 ]; // 23
- sal_Int32 nFATSize; // 2C total number of FAT pages
- sal_Int32 nTOCstrm; // 30 starting page for the TOC stream
- sal_Int32 nReserved; // 34
- sal_Int32 nThreshold; // 38 minimum file size for big data
- sal_Int32 nDataFAT; // 3C page # of 1st data FAT block
- sal_Int32 nDataFATSize; // 40 # of data fat blocks
- sal_Int32 nMasterChain; // 44 chain to the next master block
- sal_Int32 nMaster; // 48 # of additional master blocks
- sal_Int32 nMasterFAT[ 109 ]; // 4C first 109 master FAT pages
+ static const sal_uInt8 cFATPagesInHeader = 109;
+
+ sal_uInt8 cSignature[ 8 ]; // 00 signature (see below)
+ ClsId aClsId; // 08 Class ID
+ sal_Int32 nVersion; // 18 version number
+ sal_uInt16 nByteOrder; // 1C Unicode byte order indicator
+ sal_Int16 nPageSize; // 1E 1 << nPageSize = block size
+ sal_Int16 nDataPageSize; // 20 1 << this size == data block size
+ sal_uInt8 bDirty; // 22 internal dirty flag
+ sal_uInt8 cReserved[ 9 ]; // 23
+ sal_Int32 nFATSize; // 2C total number of FAT pages
+ sal_Int32 nTOCstrm; // 30 starting page for the TOC stream
+ sal_Int32 nReserved; // 34
+ sal_Int32 nThreshold; // 38 minimum file size for big data
+ sal_Int32 nDataFAT; // 3C page # of 1st data FAT block
+ sal_Int32 nDataFATSize; // 40 # of data fat blocks
+ sal_Int32 nMasterChain; // 44 chain to the next master block
+ sal_Int32 nMaster; // 48 # of additional master blocks
+ sal_Int32 nMasterFAT[ cFATPagesInHeader ]; // 4C first [cFATPagesInHeader] master FAT pages
public:
StgHeader();
+
void Init(); // initialize the header
sal_Bool Load( StgIo& );
sal_Bool Load( SvStream& );
sal_Bool Store( StgIo& );
sal_Bool Check(); // check the signature and version
- short GetByteOrder() const { return nByteOrder; }
- sal_Int32 GetTOCStart() const { return nTOCstrm; }
+ short GetByteOrder() const { return nByteOrder; }
+ sal_Int32 GetTOCStart() const { return nTOCstrm; }
void SetTOCStart( sal_Int32 n );
- sal_Int32 GetDataFATStart() const { return nDataFAT; }
+ sal_Int32 GetDataFATStart() const { return nDataFAT; }
void SetDataFATStart( sal_Int32 n );
- sal_Int32 GetDataFATSize() const { return nDataFATSize; }
+ sal_Int32 GetDataFATSize() const { return nDataFATSize; }
void SetDataFATSize( sal_Int32 n );
- sal_Int32 GetThreshold() const { return nThreshold; }
- short GetPageSize() const { return nPageSize; }
- short GetDataPageSize() const { return nDataPageSize; }
- sal_Int32 GetFATSize() const { return nFATSize; }
+ sal_Int32 GetThreshold() const { return nThreshold; }
+ short GetPageSize() const { return nPageSize; }
+ short GetDataPageSize() const { return nDataPageSize; }
+ sal_Int32 GetFATSize() const { return nFATSize; }
void SetFATSize( sal_Int32 n );
- sal_Int32 GetFATChain() const { return nMasterChain; }
+ sal_Int32 GetFATChain() const { return nMasterChain; }
void SetFATChain( sal_Int32 n );
- sal_Int32 GetMasters() const { return nMaster; }
+ sal_Int32 GetMasters() const { return nMaster; }
void SetMasters( sal_Int32 n );
- short GetFAT1Size() const { return 109; }
+ short GetFAT1Size() const { return cFATPagesInHeader; }
const ClsId& GetClassId() const { return aClsId; }
void SetClassId( const ClsId& );
sal_Int32 GetFATPage( short ) const;
@@ -136,7 +139,7 @@ public:
void GetName( String& rName ) const;
// fill in the name
short Compare( const StgEntry& ) const; // compare two entries
- sal_Bool Load( const void* );
+ sal_Bool Load( const void* pBuffer, sal_uInt32 nBufSize );
void Store( void* );
StgEntryType GetType() const { return (StgEntryType) cType; }
sal_Int32 GetStartPage() const { return nPage1; }
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgio.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgio.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgio.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgio.cxx Mon Aug 20 11:46:19 2012
@@ -66,6 +66,8 @@ sal_Bool StgIo::Load()
else
return sal_False;
}
+ else
+ return sal_False;
}
return Good();
}
@@ -99,7 +101,7 @@ void StgIo::SetupStreams()
if( pRoot )
{
pDataFAT = new StgDataStrm( *this, aHdr.GetDataFATStart(), -1 );
- pDataStrm = new StgDataStrm( *this, pRoot );
+ pDataStrm = new StgDataStrm( *this, *pRoot );
pDataFAT->SetIncrement( 1 << aHdr.GetPageSize() );
pDataStrm->SetIncrement( GetDataPageSize() );
pDataStrm->SetEntry( *pRoot );
@@ -121,7 +123,7 @@ short StgIo::GetDataPageSize()
sal_Bool StgIo::CommitAll()
{
// Store the data (all streams and the TOC)
- if( pTOC->Store() )
+ if( pTOC && pTOC->Store() && pDataFAT )
{
if( Commit( NULL ) )
{
@@ -158,7 +160,11 @@ public:
sal_Int32 GetPageSize() { return nPageSize; }
sal_Int32 Count() { return nPages; }
- sal_Int32 operator[]( sal_Int32 nOffset ) { return pFat[ nOffset ]; }
+ sal_Int32 operator[]( sal_Int32 nOffset )
+ {
+ OSL_ENSURE( nOffset >= 0 && nOffset < nPages, "Unexpected offset!" );
+ return nOffset >= 0 && nOffset < nPages ? pFat[ nOffset ] : -2;
+ }
sal_uLong Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect );
sal_Bool HasUnrefChains();
@@ -206,6 +212,8 @@ sal_uLong EasyFat::Mark( sal_Int32 nPage
sal_Int32 nCurPage = nPage;
while( nCount != 0 )
{
+ if( nCurPage < 0 || nCurPage >= nPages )
+ return FAT_OUTOFBOUNDS;
pFree[ nCurPage ] = sal_False;
nCurPage = pFat[ nCurPage ];
//Stream zu lang
@@ -219,9 +227,6 @@ sal_uLong EasyFat::Mark( sal_Int32 nPage
nCount = 1;
if( nCount != -1 )
nCount--;
- // Naechster Block nicht in der FAT
- if( nCount && ( nCurPage < 0 || nCurPage >= nPages ) )
- return FAT_OUTOFBOUNDS;
}
return FAT_OK;
}
@@ -265,6 +270,9 @@ sal_uLong Validator::ValidateMasterFATs(
{
sal_Int32 nCount = rIo.aHdr.GetFATSize();
sal_uLong nErr;
+ if ( !rIo.pFAT )
+ return FAT_INMEMORYERROR;
+
for( sal_Int32 i = 0; i < nCount; i++ )
{
if( ( nErr = aFat.Mark(rIo.pFAT->GetPage( short(i), sal_False ), aFat.GetPageSize(), -3 )) != FAT_OK )
@@ -273,11 +281,15 @@ sal_uLong Validator::ValidateMasterFATs(
if( rIo.aHdr.GetMasters() )
if( ( nErr = aFat.Mark(rIo.aHdr.GetFATChain( ), aFat.GetPageSize(), -4 )) != FAT_OK )
return nErr;
+
return FAT_OK;
}
sal_uLong Validator::MarkAll( StgDirEntry *pEntry )
{
+ if ( !pEntry )
+ return FAT_INMEMORYERROR;
+
StgIterator aIter( *pEntry );
sal_uLong nErr = FAT_OK;
for( StgDirEntry* p = aIter.First(); p ; p = aIter.Next() )
@@ -304,6 +316,9 @@ sal_uLong Validator::MarkAll( StgDirEntr
sal_uLong Validator::ValidateDirectoryEntries()
{
+ if ( !rIo.pTOC )
+ return FAT_INMEMORYERROR;
+
// Normale DirEntries
sal_uLong nErr = MarkAll( rIo.pTOC->GetRoot() );
if( nErr != FAT_OK )
@@ -353,7 +368,11 @@ sal_uLong StgIo::ValidateFATs()
Validator *pV = new Validator( *this );
sal_Bool bRet1 = !pV->IsError(), bRet2 = sal_True ;
delete pV;
+
SvFileStream *pFileStrm = ( SvFileStream *) GetStrm();
+ if ( !pFileStrm )
+ return FAT_INMEMORYERROR;
+
StgIo aIo;
if( aIo.Open( pFileStrm->GetFileName(),
STREAM_READ | STREAM_SHARE_DENYNONE) &&
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgole.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgole.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgole.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgole.cxx Mon Aug 20 11:46:19 2012
@@ -122,37 +122,22 @@ sal_Bool StgCompObjStream::Load()
*this >> aClsId;
sal_Int32 nLen1 = 0;
*this >> nLen1;
- // higher bits are ignored
- nLen1 &= 0xFFFF;
- sal_Char* p = new sal_Char[ (sal_uInt16) nLen1 ];
- if( Read( p, nLen1 ) == (sal_uLong) nLen1 )
- {
- aUserName = nLen1 ? String( p, gsl_getSystemTextEncoding() ) : String();
-/* // Now we can read the CB format
- sal_Int32 nLen2 = 0;
- *this >> nLen2;
- if( nLen2 > 0 )
- {
- // get a string name
- if( nLen2 > nLen1 )
- delete p, p = new char[ nLen2 ];
- if( Read( p, nLen2 ) == (sal_uLong) nLen2 && nLen2 )
- nCbFormat = Exchange::RegisterFormatName( String( p ) );
- else
- SetError( SVSTREAM_GENERALERROR );
- }
- else if( nLen2 == -1L )
- // Windows clipboard format
- *this >> nCbFormat;
- else
- // unknown identifier
- SetError( SVSTREAM_GENERALERROR );
-*/
- nCbFormat = ReadClipboardFormat( *this );
- }
- else
- SetError( SVSTREAM_GENERALERROR );
- delete [] p;
+ if ( nLen1 > 0 )
+ {
+ // higher bits are ignored
+ sal_uLong nStrLen = ::std::min( nLen1, (sal_Int32)0xFFFE );
+
+ sal_Char* p = new sal_Char[ nStrLen+1 ];
+ p[nStrLen] = 0;
+ if( Read( p, nStrLen ) == nStrLen )
+ {
+ aUserName = nStrLen ? String( p, gsl_getSystemTextEncoding() ) : String();
+ nCbFormat = ReadClipboardFormat( *this );
+ }
+ else
+ SetError( SVSTREAM_GENERALERROR );
+ delete [] p;
+ }
}
return sal_Bool( GetError() == SVSTREAM_OK );
}
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.cxx Mon Aug 20 11:46:19 2012
@@ -78,7 +78,7 @@ sal_Int32 StgFAT::GetNextPage( sal_Int32
{
if( nPg >= 0 )
{
- StgPage* pPg = GetPhysPage( nPg << 2 );
+ StgPage* pPg = GetPhysPage( nPg << 2 );
nPg = pPg ? pPg->GetPage( nOffset >> 2 ) : STG_EOF;
}
return nPg;
@@ -266,19 +266,22 @@ sal_Int32 StgFAT::AllocPages( sal_Int32
sal_Bool StgFAT::InitNew( sal_Int32 nPage1 )
{
sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries;
- while( n-- )
+ if ( n > 0 )
{
- StgPage* pPg = NULL;
- // Position within the underlying stream
- // use the Pos2Page() method of the stream
- rStrm.Pos2Page( nPage1 << 2 );
- // Initialize the page
- pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE );
- if ( !pPg )
- return sal_False;
- for( short i = 0; i < nEntries; i++ )
- pPg->SetPage( i, STG_FREE );
- nPage1++;
+ while( n-- )
+ {
+ StgPage* pPg = NULL;
+ // Position within the underlying stream
+ // use the Pos2Page() method of the stream
+ rStrm.Pos2Page( nPage1 << 2 );
+ // Initialize the page
+ pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE );
+ if ( !pPg )
+ return sal_False;
+ for( short i = 0; i < nEntries; i++ )
+ pPg->SetPage( i, STG_FREE );
+ nPage1++;
+ }
}
return sal_True;
}
@@ -337,6 +340,9 @@ void StgStrm::SetEntry( StgDirEntry& r )
sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
{
+ if ( !pFat )
+ return sal_False;
+
sal_Int32 nRel, nBgn;
// Values < 0 seek to the end
if( nBytePos < 0 || nBytePos >= nSize )
@@ -401,6 +407,9 @@ StgPage* StgStrm::GetPhysPage( sal_Int32
sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes )
{
+ if ( !pFat )
+ return sal_False;
+
sal_Int32 nTo = nStart;
sal_Int32 nPgs = ( nBytes + nPageSize - 1 ) / nPageSize;
while( nPgs-- )
@@ -427,6 +436,9 @@ sal_Bool StgStrm::Copy( sal_Int32 nFrom,
sal_Bool StgStrm::SetSize( sal_Int32 nBytes )
{
+ if ( nBytes < 0 || !pFat )
+ return sal_False;
+
// round up to page size
sal_Int32 nOld = ( ( nSize + nPageSize - 1 ) / nPageSize ) * nPageSize;
sal_Int32 nNew = ( ( nBytes + nPageSize - 1 ) / nPageSize ) * nPageSize;
@@ -498,6 +510,7 @@ sal_Bool StgFATStrm::Pos2Page( sal_Int32
StgPage* StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce )
{
+ OSL_ENSURE( nBytePos >= 0, "The value may not be negative!" );
return rIo.Get( nBytePos / ( nPageSize >> 2 ), bForce );
}
@@ -505,6 +518,7 @@ StgPage* StgFATStrm::GetPhysPage( sal_In
sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterAlloc )
{
+ OSL_ENSURE( nOff >= 0, "The offset may not be negative!" );
if( pnMasterAlloc ) *pnMasterAlloc = 0;
if( nOff < rIo.aHdr.GetFAT1Size() )
return rIo.aHdr.GetFATPage( nOff );
@@ -579,6 +593,7 @@ sal_Int32 StgFATStrm::GetPage( short nOf
sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
{
+ OSL_ENSURE( nOff >= 0, "The offset may not be negative!" );
sal_Bool bRes = sal_True;
if( nOff < rIo.aHdr.GetFAT1Size() )
rIo.aHdr.SetFATPage( nOff, nNewPage );
@@ -628,6 +643,9 @@ sal_Bool StgFATStrm::SetPage( short nOff
sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
{
+ if ( nBytes < 0 )
+ return sal_False;
+
// Set the number of entries to a multiple of the page size
short nOld = (short) ( ( nSize + ( nPageSize - 1 ) ) / nPageSize );
short nNew = (short) (
@@ -654,6 +672,7 @@ sal_Bool StgFATStrm::SetSize( sal_Int32
// find a free page using the FAT allocator
sal_Int32 n = 1;
+ OSL_ENSURE( pFat, "The pointer is always initializer here!" );
sal_Int32 nNewPage = pFat->FindBlock( n );
if( nNewPage == STG_EOF )
{
@@ -726,21 +745,25 @@ StgDataStrm::StgDataStrm( StgIo& r, sal_
Init( nBgn, nLen );
}
-StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r )
+StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry& p ) : StgStrm( r )
{
- pEntry = p;
- Init( p->aEntry.GetLeaf( STG_DATA ),
- p->aEntry.GetSize() );
+ pEntry = &p;
+ Init( p.aEntry.GetLeaf( STG_DATA ),
+ p.aEntry.GetSize() );
}
void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
{
- pFat = new StgFAT( *rIo.pFAT, sal_True );
+ if ( rIo.pFAT )
+ pFat = new StgFAT( *rIo.pFAT, sal_True );
+
+ OSL_ENSURE( pFat, "The pointer should not be empty!" );
+
nStart = nPage = nBgn;
nSize = nLen;
nIncr = 1;
nOffset = 0;
- if( nLen < 0 )
+ if( nLen < 0 && pFat )
{
// determine the actual size of the stream by scanning
// the FAT chain and counting the # of pages allocated
@@ -761,6 +784,9 @@ void StgDataStrm::Init( sal_Int32 nBgn,
sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes )
{
+ if ( !pFat )
+ return sal_False;
+
nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr;
sal_Int32 nOldSz = nSize;
if( ( nOldSz != nBytes ) )
@@ -866,12 +892,15 @@ sal_Int32 StgDataStrm::Read( void* pBuf,
sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n )
{
+ if ( n < 0 )
+ return 0;
+
sal_Int32 nDone = 0;
if( ( nPos + n ) > nSize )
{
sal_Int32 nOld = nPos;
if( !SetSize( nPos + n ) )
- return sal_False;
+ return 0;
Pos2Page( nOld );
}
while( n )
@@ -936,17 +965,20 @@ StgSmallStrm::StgSmallStrm( StgIo& r, sa
Init( nBgn, nLen );
}
-StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry* p ) : StgStrm( r )
+StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry& p ) : StgStrm( r )
{
- pEntry = p;
- Init( p->aEntry.GetLeaf( STG_DATA ),
- p->aEntry.GetSize() );
+ pEntry = &p;
+ Init( p.aEntry.GetLeaf( STG_DATA ),
+ p.aEntry.GetSize() );
}
void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
{
- pFat = new StgFAT( *rIo.pDataFAT, sal_False );
+ if ( rIo.pDataFAT )
+ pFat = new StgFAT( *rIo.pDataFAT, sal_False );
pData = rIo.pDataStrm;
+ OSL_ENSURE( pFat && pData, "The pointers should not be empty!" );
+
nPageSize = rIo.GetDataPageSize();
nStart =
nPage = nBgn;
@@ -971,7 +1003,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf
nBytes = (short) n;
if( nBytes )
{
- if( !pData->Pos2Page( nPage * nPageSize + nOffset ) )
+ if( !pData || !pData->Pos2Page( nPage * nPageSize + nOffset ) )
break;
// all reading thru the stream
short nRes = (short) pData->Read( (sal_uInt8*)pBuf + nDone, nBytes );
@@ -1011,9 +1043,10 @@ sal_Int32 StgSmallStrm::Write( const voi
{
// all writing goes thru the stream
sal_Int32 nDataPos = nPage * nPageSize + nOffset;
- if( pData->GetSize() < ( nDataPos + nBytes ) )
- if( !pData->SetSize( nDataPos + nBytes ) )
- break;
+ if ( !pData
+ || ( pData->GetSize() < ( nDataPos + nBytes )
+ && !pData->SetSize( nDataPos + nBytes ) ) )
+ break;
if( !pData->Pos2Page( nDataPos ) )
break;
short nRes = (short) pData->Write( (sal_uInt8*)pBuf + nDone, nBytes );
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.hxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/stgstrms.hxx Mon Aug 20 11:46:19 2012
@@ -120,7 +120,7 @@ class StgDataStrm : public StgStrm // a
void Init( sal_Int32 nBgn, sal_Int32 nLen );
public:
StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 );
- StgDataStrm( StgIo&, StgDirEntry* );
+ StgDataStrm( StgIo&, StgDirEntry& );
void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty );
void SetIncrement( short n ) { nIncr = n ; }
virtual sal_Bool SetSize( sal_Int32 );
@@ -139,7 +139,7 @@ class StgSmallStrm : public StgStrm //
void Init( sal_Int32 nBgn, sal_Int32 nLen );
public:
StgSmallStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen );
- StgSmallStrm( StgIo&, StgDirEntry* );
+ StgSmallStrm( StgIo&, StgDirEntry& );
virtual sal_Int32 Read( void*, sal_Int32 );
virtual sal_Int32 Write( const void*, sal_Int32 );
virtual sal_Bool IsSmallStrm() { return sal_True; }
Modified: incubator/ooo/branches/writer001/main/sot/source/sdstor/storinfo.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sot/source/sdstor/storinfo.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sot/source/sdstor/storinfo.cxx (original)
+++ incubator/ooo/branches/writer001/main/sot/source/sdstor/storinfo.cxx Mon Aug 20 11:46:19 2012
@@ -56,10 +56,11 @@ sal_uLong ReadClipboardFormat( SvStream
if( nLen > 0 )
{
// get a string name
- sal_Char * p = new sal_Char[ nLen ];
- if( rStm.Read( p, nLen ) == (sal_uLong) nLen )
+ sal_Char * p = new( ::std::nothrow ) sal_Char[ nLen ];
+ if( p && rStm.Read( p, nLen ) == (sal_uLong) nLen )
{
- nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, short(nLen-1) ) );
+ // take so much from the buffer, as the string supports
+ nFormat = SotExchange::RegisterFormatName( String::CreateFromAscii( p, xub_StrLen( ( nLen - 1 ) & STRING_MAXLEN ) ) );
}
else
rStm.SetError( SVSTREAM_GENERALERROR );
Modified: incubator/ooo/branches/writer001/main/starmath/inc/edit.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/starmath/inc/edit.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/starmath/inc/edit.hxx (original)
+++ incubator/ooo/branches/writer001/main/starmath/inc/edit.hxx Mon Aug 20 11:46:19 2012
@@ -93,6 +93,7 @@ class SmEditWindow : public Window, publ
void SetScrollBarRanges();
void InitScrollBars();
void InvalidateSlots();
+ void UpdateStatus( bool bSetDocModified = false );
public:
SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin );
Modified: incubator/ooo/branches/writer001/main/starmath/source/document.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/starmath/source/document.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/starmath/source/document.cxx (original)
+++ incubator/ooo/branches/writer001/main/starmath/source/document.cxx Mon Aug 20 11:46:19 2012
@@ -1181,6 +1181,10 @@ void SmDocShell::Execute(SfxRequest& rRe
DBG_UNHANDLED_EXCEPTION();
}
}
+
+ SmModule *pModule = SM_MOD();
+ if ( pModule && pModule->GetConfig()->IsAutoRedraw() )
+ UpdateText();
Repaint();
SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
while( pFrm )
Modified: incubator/ooo/branches/writer001/main/starmath/source/edit.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/starmath/source/edit.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/starmath/source/edit.cxx (original)
+++ incubator/ooo/branches/writer001/main/starmath/source/edit.cxx Mon Aug 20 11:46:19 2012
@@ -245,9 +245,7 @@ void SmEditWindow::DataChanged( const Da
IMPL_LINK( SmEditWindow, ModifyTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
{
- SmModule *pp = SM_MOD();
- if (pp->GetConfig()->IsAutoRedraw())
- Flush();
+ UpdateStatus();
aModifyTimer.Stop();
return 0;
}
@@ -877,13 +875,23 @@ sal_Bool SmEditWindow::IsSelected() cons
return pEditView ? pEditView->HasSelection() : sal_False;
}
+
+void SmEditWindow::UpdateStatus( bool bSetDocModified )
+{
+ SmModule *pMod = SM_MOD();
+ if (pMod && pMod->GetConfig()->IsAutoRedraw())
+ Flush();
+ if ( bSetDocModified )
+ GetDoc()->SetModified( sal_True );
+}
+
void SmEditWindow::Cut()
{
DBG_ASSERT( pEditView, "EditView missing" );
if (pEditView)
{
pEditView->Cut();
- GetDoc()->SetModified( sal_True );
+ UpdateStatus( sal_True );
}
}
@@ -900,7 +908,7 @@ void SmEditWindow::Paste()
if (pEditView)
{
pEditView->Paste();
- GetDoc()->SetModified( sal_True );
+ UpdateStatus( sal_True );
}
}
@@ -910,7 +918,7 @@ void SmEditWindow::Delete()
if (pEditView)
{
pEditView->DeleteSelected();
- GetDoc()->SetModified( sal_True );
+ UpdateStatus( sal_True );
}
}
Modified: incubator/ooo/branches/writer001/main/starmath/source/node.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/starmath/source/node.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/starmath/source/node.cxx (original)
+++ incubator/ooo/branches/writer001/main/starmath/source/node.cxx Mon Aug 20 11:46:19 2012
@@ -2812,23 +2812,51 @@ void SmAttributNode::CreateTextFromNode(
nLast = aStr.GetChar(0);
switch (nLast)
{
- case 0xAF:
+ case 0xAF: // MACRON
APPEND(rText,"overline ");
break;
- case 0x2d9:
+ case 0x2d9: // DOT ABOVE
APPEND(rText,"dot ");
break;
- case 0x2dc:
+ case 0x2dc: // SMALL TILDE
APPEND(rText,"widetilde ");
break;
- case 0xA8:
+ case 0xA8: // DIAERESIS
APPEND(rText,"ddot ");
break;
case 0xE082:
break;
case 0xE09B:
+ case 0x20DB: // COMBINING THREE DOTS ABOVE
APPEND(rText,"dddot ");
break;
+ case 0x301: // COMBINING ACUTE ACCENT
+ APPEND(rText,"acute ");
+ break;
+ case 0x300: // COMBINING GRAVE ACCENT
+ APPEND(rText,"grave ");
+ break;
+ case 0x30C: // COMBINING CARON
+ APPEND(rText,"check ");
+ break;
+ case 0x306: // COMBINING BREVE
+ APPEND(rText,"breve ");
+ break;
+ case 0x30A: // COMBINING RING ABOVE
+ APPEND(rText,"circle ");
+ break;
+ case 0x20D7: // COMBINING RIGHT ARROW ABOVE
+ APPEND(rText,"vec ");
+ break;
+ case 0x303: // COMBINING TILDE
+ APPEND(rText,"tilde ");
+ break;
+ case 0x302: // COMBINING CIRCUMFLEX ACCENT
+ APPEND(rText,"hat ");
+ break;
+ case 0x304: // COMBINING MACRON
+ APPEND(rText,"bar ");
+ break;
default:
rText.Append(nLast);
break;
Modified: incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgnode.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgnode.hxx (original)
+++ incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgnode.hxx Mon Aug 20 11:46:19 2012
@@ -50,6 +50,7 @@ namespace svgio
namespace svgreader
{
typedef ::std::vector< SvgNode* > SvgNodeVector;
+ typedef ::std::vector< const SvgStyleAttributes* > SvgStyleAttributeVector;
enum XmlSpace
{
@@ -79,6 +80,13 @@ namespace svgio
/// XmlSpace value
XmlSpace maXmlSpace;
+ /// CSS styles
+ SvgStyleAttributeVector maCssStyleVector;
+
+ protected:
+ /// helper to evtl. link to css style
+ const SvgStyleAttributes* checkForCssStyle(const rtl::OUString& rClassStr, const SvgStyleAttributes& rOriginal) const;
+
public:
SvgNode(
SVGToken aType,
Modified: incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx (original)
+++ incubator/ooo/branches/writer001/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx Mon Aug 20 11:46:19 2012
@@ -139,12 +139,18 @@ namespace svgio
TextAnchor_end
};
+ enum FillRule
+ {
+ FillRule_notset,
+ FillRule_nonzero,
+ FillRule_evenodd
+ };
+
class SvgStyleAttributes
{
private:
SvgNode& mrOwner;
const SvgStyleAttributes* mpCssStyleParent;
-
SvgPaint maFill;
SvgPaint maStroke;
SvgPaint maStopColor;
@@ -187,18 +193,19 @@ namespace svgio
rtl::OUString maMarkerEndXLink;
const SvgMarkerNode* mpMarkerEndXLink;
+ /// fill rule
+ FillRule maFillRule;
+
+ // ClipRule setting (only valid wne mbIsClipPathContent == true, default is FillRule_nonzero)
+ FillRule maClipRule;
+
/// bitfield
- bool maFillRule : 1; // true: NonZero, false: EvenOdd
- bool maFillRuleSet : 1;
// defines if this attributes are part of a ClipPath. If yes,
// rough geometry will be created on decomposition by patching
// vaules for fill, stroke, strokeWidth and others
bool mbIsClipPathContent : 1;
- // ClipRule setting (only valid wne mbIsClipPathContent == true)
- bool mbClipRule : 1; // true == nonzero(default), false == evenodd
-
/// internal helpers
void add_fillGradient(
const basegfx::B2DPolyPolygon& rPath,
@@ -256,8 +263,9 @@ namespace svgio
const drawinglayer::primitive2d::Primitive2DSequence& rSource,
const basegfx::B2DHomMatrix* pTransform) const;
- /// helper to evtl. link to css style
- void checkForCssStyle(const rtl::OUString& rClassStr) const;
+ /// helper to set mpCssStyleParent temporarily for CSS style hierarchies
+ void setCssStyleParent(const SvgStyleAttributes* pNew) { mpCssStyleParent = pNew; }
+ const SvgStyleAttributes* getCssStyleParent() const { return mpCssStyleParent; }
/// scan helpers
void readStyle(const rtl::OUString& rCandidate);
@@ -307,8 +315,8 @@ namespace svgio
void setFillOpacity(const SvgNumber& rFillOpacity = SvgNumber()) { maFillOpacity = rFillOpacity; }
/// fill rule content
- bool getFillRule() const;
- void setFillRule(const bool* pFillRule = 0);
+ const FillRule getFillRule() const;
+ void setFillRule(const FillRule aFillRule = FillRule_notset) { maFillRule = aFillRule; }
/// fill StrokeDasharray content
const SvgNumberVector& getStrokeDasharray() const;
Modified: incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgcirclenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgcirclenode.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgcirclenode.cxx (original)
+++ incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgcirclenode.cxx Mon Aug 20 11:46:19 2012
@@ -52,9 +52,8 @@ namespace svgio
const SvgStyleAttributes* SvgCircleNode::getSvgStyleAttributes() const
{
static rtl::OUString aClassStr(rtl::OUString::createFromAscii("circle"));
- maSvgStyleAttributes.checkForCssStyle(aClassStr);
- return &maSvgStyleAttributes;
+ return checkForCssStyle(aClassStr, maSvgStyleAttributes);
}
void SvgCircleNode::parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent)
Modified: incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgellipsenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgellipsenode.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgellipsenode.cxx (original)
+++ incubator/ooo/branches/writer001/main/svgio/source/svgreader/svgellipsenode.cxx Mon Aug 20 11:46:19 2012
@@ -53,9 +53,8 @@ namespace svgio
const SvgStyleAttributes* SvgEllipseNode::getSvgStyleAttributes() const
{
static rtl::OUString aClassStr(rtl::OUString::createFromAscii("ellipse"));
- maSvgStyleAttributes.checkForCssStyle(aClassStr);
- return &maSvgStyleAttributes;
+ return checkForCssStyle(aClassStr, maSvgStyleAttributes);
}
void SvgEllipseNode::parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent)