[libreoffice] import srpm
David Tardon
dtardon at fedoraproject.org
Sat Oct 9 07:39:54 UTC 2010
commit 80763257ac3a36212b3a96532a9ee62fca09d634
Author: David Tardon <dtardon at redhat.com>
Date: Sat Oct 9 09:39:30 2010 +0200
import srpm
.gitignore | 30 +
description.xml | 20 +
evolocal.odb | Bin 0 -> 3759 bytes
libreoffice-buildfix.patch | 113 +
libreoffice-multiliblauncher.sh | 16 +
libreoffice.spec | 3202 ++++++++++++++++++++
manifest.xml | 6 +
...-1.9.123.ooo53397.prelinkoptimize.desktop.patch | 111 +
...g-2.0.1.rhXXXXXX.extensions.defaulttoevo2.patch | 82 +
...ffice.org-2.0.2.rh188467.printingdefaults.patch | 15 +
...rg-2.2.0.gccXXXXX.solenv.javaregistration.patch | 53 +
...fice.org-2.2.1.ooo7065.sw.titlepagedialog.patch | 1136 +++++++
openoffice.org-2.3.0.ooo76649.httpencoding.patch | 13 +
openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch | 47 +
...ffice.org-3.0.0.ooo88341.sc.verticalboxes.patch | 102 +
...e.org-3.1.0.ooo101274.opening-a-directory.patch | 174 ++
...fice.org-3.1.0.ooo102061.sc.cellanchoring.patch | 1751 +++++++++++
...3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch | 23 +
...ce.org-3.1.0.oooXXXXX.solenv.allowmissing.patch | 64 +
...rg-3.1.1.ooo105784.vcl.sniffscriptforsubs.patch | 189 ++
...ice.org-3.2.0.ooo106502.svx.fixspelltimer.patch | 13 +
...fice.org-3.2.0.ooo108846.sfx2.qstartfixes.patch | 87 +
...e.org-3.2.0.ooo110142.svx.safercolornames.patch | 31 +
...3.2.0.ooo111741.extras.malformed-xml-file.patch | 24 +
openoffice.org-3.2.0.ooo95369.sw.sortedobjs.patch | 17 +
....rh632236.writerfilter.cleanup-cell-props.patch | 37 +
....0.ooo100686.wizards.types.not.mediatypes.patch | 49 +
openoffice.org-3.3.0.ooo106591.sal.tradcopy.patch | 83 +
...office.org-3.3.0.ooo107490.cppu.lifecycle.patch | 852 ++++++
...oo108246.svx.hide-sql-group-when-inactive.patch | 97 +
...office.org-3.3.0.ooo108637.sfx2.uisavedir.patch | 41 +
openoffice.org-3.3.0.ooo111758.sd.xerror.patch | 21 +
...g-3.3.0.ooo112059.sw.avoid-null-ptr-deref.patch | 16 +
....ooo112384.sw.export.doc.styledoesntexist.patch | 11 +
....org-3.3.0.ooo113273.desktop.resolvelinks.patch | 55 +
...ffice.org-3.3.0.ooo114012.sd.bada11ychain.patch | 66 +
...g-3.3.0.ooo114703.vcl.betterlocalize.font.patch | 30 +
...ice.org-3.3.0.rh637738.libgcrypt.addmutex.patch | 167 +
...rg-3.3.0.rh638185.editeng.cjkctlhtmlsizes.patch | 64 +
redhat-agreement.xsl | 12 +
sources | 30 +
unowinreg.dll | Bin 0 -> 6144 bytes
workspace.cmcfixes77.patch | 1378 +++++++++
workspace.cmcfixes78.patch | 11 +
workspace.cmcfixes79.patch | 379 +++
workspace.dtardon03.patch | 286 ++
workspace.gtk3.patch | 2761 +++++++++++++++++
workspace.impress195.patch | 287 ++
workspace.srb1.patch | 31 +
workspace.vcl113.patch | 490 +++
workspace.vcl114.patch | 57 +
workspace.vcl115.patch | 13 +
52 files changed, 14643 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..94338c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,30 @@
+/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz
+/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
+/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+/acor_lt.zip
+/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip
+/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz
+/libreoffice-artwork-3.2.99.1.tar.bz2
+/libreoffice-base-3.2.99.1.tar.bz2
+/libreoffice-bootstrap-3.2.99.1.tar.bz2
+/libreoffice-calc-3.2.99.1.tar.bz2
+/libreoffice-components-3.2.99.1.tar.bz2
+/libreoffice-extensions-3.2.99.1.tar.bz2
+/libreoffice-extras-3.2.99.1.tar.bz2
+/libreoffice-filters-3.2.99.1.tar.bz2
+/libreoffice-help-3.2.99.1.tar.bz2
+/libreoffice-impress-3.2.99.1.tar.bz2
+/libreoffice-l10n-3.2.99.1.tar.bz2
+/libreoffice-libs-core-3.2.99.1.tar.bz2
+/libreoffice-libs-extern-3.2.99.1.tar.bz2
+/libreoffice-libs-extern-sys-3.2.99.1.tar.bz2
+/libreoffice-libs-gui-3.2.99.1.tar.bz2
+/libreoffice-postprocess-3.2.99.1.tar.bz2
+/libreoffice-sdk-3.2.99.1.tar.bz2
+/libreoffice-testing-3.2.99.1.tar.bz2
+/libreoffice-ure-3.2.99.1.tar.bz2
+/libreoffice-writer-3.2.99.1.tar.bz2
+/redhat-langpacks.tar.gz
+/redhat-registry.tar.gz
diff --git a/description.xml b/description.xml
new file mode 100644
index 0000000..6db9ac6
--- /dev/null
+++ b/description.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dep="http://openoffice.org/extensions/description/2006">
+ <identifier
+ value="@id@"/>
+
+ <dependencies>
+ <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/>
+ </dependencies>
+
+ <version value="@version@"/>
+
+ <publisher>
+ <name xlink:href="http://openoffice.org" lang="en">OpenOffice.org</name>
+ </publisher>
+
+ <display-name>
+ <name lang="en-US">@display-name@</name>
+ </display-name>
+
+</description>
diff --git a/evolocal.odb b/evolocal.odb
new file mode 100644
index 0000000..82f486a
Binary files /dev/null and b/evolocal.odb differ
diff --git a/libreoffice-buildfix.patch b/libreoffice-buildfix.patch
new file mode 100644
index 0000000..d59bff9
--- /dev/null
+++ b/libreoffice-buildfix.patch
@@ -0,0 +1,113 @@
+--- a/sysui/util/checksize.pl 2010-09-24 16:35:55.000000000 +0100
++++ b/sysui/util/checksize.pl 2010-09-24 16:35:55.000000000 +0100
+@@ -79,7 +79,7 @@
+ my $file = shift;
+ print "$path$file\n" if ((-e "$path$file") && $is_debug);
+ # don't check dpc,flag,rpmflag,sdf [obj for UNX] files, or etc subdirectory
+- return if ( ($file =~ /.+\.(dpc|\w*?flag)/) || ($file =~ /.+\.obj/ && $ENV{GUI} eq 'UNX') || ($path =~ /.+etc/) || ($path =~ /.+logs/) || ($path =~ /.+sdf/) );
++ return if ( ($file =~ /.+\.(dpc|\w*?flag)/) || ($file =~ /.+\.obj/ && $ENV{GUI} eq 'UNX') || ($path =~ /.+etc/) || ($path =~ /.+logs/) || ($file =~ /.+sdf/) );
+ if ( -z "$path$file" ) {
+ print "Error: $path$file 0 Bytes!\n";
+ $err++;
+--- a/solenv/inc/postset.mk 2010-09-29 12:55:57.000000000 +0100
++++ b/solenv/inc/postset.mk 2010-09-29 12:58:29.000000000 +0100
+@@ -33,15 +33,13 @@
+ # Complete list of all supported ISO codes
+ completelangiso=af \
+ ar \
+-as-IN \
++as \
+ be-BY \
+ bo \
+ bg \
+ br \
+ brx \
+ bn \
+-bn-BD \
+-bn-IN \
+ bs \
+ by \
+ ca \
+@@ -66,9 +64,8 @@
+ gd \
+ gl \
+ gu \
+-gu-IN \
+ he \
+-hi-IN \
++hi \
+ hr \
+ hu \
+ is \
+@@ -92,8 +89,8 @@
+ mn \
+ mni \
+ ms \
+-ml-IN \
+-mr-IN \
++ml \
++mr \
+ my \
+ ne \
+ nb \
+@@ -103,7 +100,7 @@
+ ns \
+ om \
+ oc \
+-or-IN \
++or \
+ pap \
+ pa-IN \
+ pl \
+@@ -127,16 +124,16 @@
+ sv \
+ sw \
+ sw-TZ \
+-te-IN \
+-ti-ER \
+-ta-IN \
++te \
++ti \
++ta \
+ th \
+ tn \
+ tr \
+ ts \
+ tg \
+ ug \
+-ur-IN \
++ur \
+ uk \
+ uz \
+ ve \
+--- a/configure.in Thu Sep 30 12:57:20 2010 +0200
++++ a/configure.in Wed Oct 06 09:59:39 2010 +0200
+@@ -5077,6 +5077,7 @@
+ SYSTEM_REDLAND=NO
+ fi
+ AC_SUBST(SYSTEM_REDLAND)
++AC_SUBST(REDLAND_CFLAGS)
+ AC_SUBST(REDLAND_LIBS)
+
+ dnl ===================================================================
+--- a/set_soenv.in Thu Sep 30 12:57:20 2010 +0200
++++ a/set_soenv.in Wed Oct 06 09:59:39 2010 +0200
+@@ -1917,6 +1917,7 @@
+ ToFile( "USE_XINERAMA", "@USE_XINERAMA@", "e" );
+ ToFile( "XINERAMA_LINK", "@XINERAMA_LINK@", "e" );
+ ToFile( "SYSTEM_REDLAND", "@SYSTEM_REDLAND@", "e" );
++ToFile( "REDLAND_CFLAGS", "@REDLAND_CFLAGS@", "e" );
+ ToFile( "REDLAND_LIBS", "@REDLAND_LIBS@", "e" );
+ ToFile( "SYSTEM_HUNSPELL", "@SYSTEM_HUNSPELL@", "e" );
+ ToFile( "HUNSPELL_CFLAGS", "@HUNSPELL_CFLAGS@", "e" );
+--- a/unoxml/source/rdf/librdf_repository.cxx Thu Sep 30 12:57:20 2010 +0200
++++ a/unoxml/source/rdf/librdf_repository.cxx Wed Oct 06 09:59:39 2010 +0200
+@@ -39,7 +39,7 @@
+ #include <boost/shared_array.hpp>
+ #include <boost/bind.hpp>
+
+-#include <librdf.h>
++#include <redland.h>
+
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+ #include <com/sun/star/lang/XInitialization.hpp>
diff --git a/libreoffice-multiliblauncher.sh b/libreoffice-multiliblauncher.sh
new file mode 100644
index 0000000..7c416af
--- /dev/null
+++ b/libreoffice-multiliblauncher.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+OOO_ARCH=$(uname -m)
+case $OOO_ARCH in
+ x86_64 | s390x | sparc64)
+ OOO_LIB_DIR="/usr/lib64"
+ SECONDARY_LIB_DIR="/usr/lib"
+ ;;
+ * )
+ OOO_LIB_DIR="/usr/lib"
+ SECONDARY_LIB_DIR="/usr/lib64"
+ ;;
+esac
+if [ ! -x $OOO_LIB_DIR/BRAND/program/LAUNCHER ]; then
+ OOO_LIB_DIR="$SECONDARY_LIB_DIR"
+fi
+exec $OOO_LIB_DIR/BRAND/program/LAUNCHER "$@"
diff --git a/libreoffice.spec b/libreoffice.spec
new file mode 100644
index 0000000..d4df772
--- /dev/null
+++ b/libreoffice.spec
@@ -0,0 +1,3202 @@
+# rhbz#465664 jar-repacking breaks help by reordering META-INF/MANIFEST.MF
+%define __jar_repack %{nil}
+# don't worry about whitespace for now
+%define _default_patch_flags -s -l
+# undef to get english only and no-langpacks for a faster smoketest build
+%define langpacks 1
+# whether to use stlport or gcc's stl, we're basically locked to stlport for
+# i386 to support third party uno components and add-ons designed to work with
+# vanilla OOo.
+%ifarch %{ix86}
+%define stlport_abi_lockin 1
+%else
+%define stlport_abi_lockin 0
+%endif
+
+%if %{stlport_abi_lockin}
+%define stlflags --with-stlport
+%else
+%define stlflags --without-stlport
+%endif
+
+%if %{langpacks}
+%define langpack_langs af ar bg bn ca cs cy da de dz el en-US es et eu fi fr ga gl gu pa-IN he hi hu hr it ja ko lt ms nb nl nn nr pl pt pt-BR ru sh sk sl sr ss st sv ta th tr ve xh zh-CN zh-TW zu ns tn ts as mr ml or te ur kn uk mai ro
+%else
+%define langpack_langs en-US
+%endif
+
+Summary: Free Software Productivity Suite
+Name: libreoffice
+Version: 3.2.99.1
+Release: 2%{?dist}
+License: LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and (CDDL or GPLv2) and Public Domain
+Group: Applications/Productivity
+URL: http://www.documentfoundation.org/develop
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source0: http://download.documentfoundation.org/libreoffice/src/libreoffice-artwork-3.2.99.1.tar.bz2
+Source1: http://download.documentfoundation.org/libreoffice/src/libreoffice-base-3.2.99.1.tar.bz2
+Source2: http://download.documentfoundation.org/libreoffice/src/libreoffice-bootstrap-3.2.99.1.tar.bz2
+Source3: http://download.documentfoundation.org/libreoffice/src/libreoffice-calc-3.2.99.1.tar.bz2
+Source4: http://download.documentfoundation.org/libreoffice/src/libreoffice-components-3.2.99.1.tar.bz2
+Source5: http://download.documentfoundation.org/libreoffice/src/libreoffice-extensions-3.2.99.1.tar.bz2
+Source6: http://download.documentfoundation.org/libreoffice/src/libreoffice-extras-3.2.99.1.tar.bz2
+Source7: http://download.documentfoundation.org/libreoffice/src/libreoffice-filters-3.2.99.1.tar.bz2
+Source8: http://download.documentfoundation.org/libreoffice/src/libreoffice-help-3.2.99.1.tar.bz2
+Source9: http://download.documentfoundation.org/libreoffice/src/libreoffice-impress-3.2.99.1.tar.bz2
+Source10: http://download.documentfoundation.org/libreoffice/src/libreoffice-libs-core-3.2.99.1.tar.bz2
+Source11: http://download.documentfoundation.org/libreoffice/src/libreoffice-libs-extern-3.2.99.1.tar.bz2
+Source12: http://download.documentfoundation.org/libreoffice/src/libreoffice-libs-extern-sys-3.2.99.1.tar.bz2
+Source13: http://download.documentfoundation.org/libreoffice/src/libreoffice-libs-gui-3.2.99.1.tar.bz2
+Source14: http://download.documentfoundation.org/libreoffice/src/libreoffice-postprocess-3.2.99.1.tar.bz2
+Source15: http://download.documentfoundation.org/libreoffice/src/libreoffice-sdk-3.2.99.1.tar.bz2
+Source16: http://download.documentfoundation.org/libreoffice/src/libreoffice-testing-3.2.99.1.tar.bz2
+Source17: http://download.documentfoundation.org/libreoffice/src/libreoffice-ure-3.2.99.1.tar.bz2
+Source18: http://download.documentfoundation.org/libreoffice/src/libreoffice-writer-3.2.99.1.tar.bz2
+Source19: http://cgit.freedesktop.org/ooo-build/ooo-build/plain/src/evolocal.odb
+Source20: http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll
+Source21: redhat-registry.tar.gz
+Source22: redhat-langpacks.tar.gz
+Source23: redhat-agreement.xsl
+Source24: http://www.openoffice.org/nonav/issues/showattachment.cgi/66959/acor_lt.zip
+Source25: libreoffice-multiliblauncher.sh
+Source26: http://hg.services.openoffice.org/binaries/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz
+Source27: http://hg.services.openoffice.org/binaries/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+Source28: http://hg.services.openoffice.org/binaries/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
+Source29: http://hg.services.openoffice.org/binaries/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+Source30: http://hg.services.openoffice.org/binaries/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+Source31: http://hg.services.openoffice.org/binaries/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip
+Source32: http://hg.services.openoffice.org/binaries/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz
+Source33: description.xml
+Source34: manifest.xml
+Source35: http://download.documentfoundation.org/libreoffice/src/libreoffice-l10n-3.2.99.1.tar.bz2
+BuildRequires: zip, findutils, autoconf, flex, bison, icu, gperf, gcc-c++
+BuildRequires: binutils, java-devel >= 1.6.0, boost-devel, zlib-devel
+BuildRequires: python-devel, expat-devel, libxml2-devel, libxslt-devel, bc
+BuildRequires: neon-devel, libcurl-devel, libidn-devel, pam-devel, cups-devel
+BuildRequires: libXext-devel, libXt-devel, libICE-devel, libjpeg-devel, make
+BuildRequires: gecko-devel, libwpd-devel, hunspell-devel, unixODBC-devel
+BuildRequires: db4-devel, sane-backends-devel, libicu-devel, perl-Archive-Zip
+BuildRequires: freetype-devel, gtk2-devel, desktop-file-utils, hyphen-devel
+BuildRequires: evolution-data-server-devel, libtextcat-devel, nss-devel
+BuildRequires: gstreamer-devel, gstreamer-plugins-base-devel, openssl-devel
+BuildRequires: mdds-devel, lpsolve-devel, hsqldb, bsh, lucene, lucene-contrib
+BuildRequires: mesa-libGLU-devel, redland-devel, ant, ant-apache-regexp
+BuildRequires: jakarta-commons-codec, jakarta-commons-httpclient, cppunit-devel
+BuildRequires: jakarta-commons-lang, poppler-devel, fontpackages-devel, junit4
+BuildRequires: pentaho-reporting-flow-engine, libXinerama-devel, mythes-devel
+BuildRequires: silgraphite-devel, libwpg-devel, libwps-devel, vigra-devel
+
+Patch1: openoffice.org-2.0.1.rhXXXXXX.extensions.defaulttoevo2.patch
+Patch2: openoffice.org-1.9.123.ooo53397.prelinkoptimize.desktop.patch
+Patch3: openoffice.org-2.0.2.rh188467.printingdefaults.patch
+Patch4: openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
+Patch5: openoffice.org-2.3.0.ooo76649.httpencoding.patch
+Patch6: openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch
+Patch7: openoffice.org-3.0.0.ooo88341.sc.verticalboxes.patch
+Patch8: workspace.dtardon03.patch
+Patch9: openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch
+Patch10: openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch
+Patch11: openoffice.org-3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch
+Patch12: openoffice.org-3.1.0.ooo101274.opening-a-directory.patch
+Patch13: openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch
+Patch14: workspace.impress195.patch
+Patch15: openoffice.org-3.1.1.ooo105784.vcl.sniffscriptforsubs.patch
+Patch16: workspace.srb1.patch
+Patch17: openoffice.org-3.2.0.ooo106502.svx.fixspelltimer.patch
+Patch18: openoffice.org-3.3.0.ooo108246.svx.hide-sql-group-when-inactive.patch
+Patch19: openoffice.org-3.3.0.ooo108637.sfx2.uisavedir.patch
+Patch20: openoffice.org-3.2.0.ooo108846.sfx2.qstartfixes.patch
+Patch21: openoffice.org-3.2.0.ooo95369.sw.sortedobjs.patch
+Patch22: openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch
+Patch23: openoffice.org-3.3.0.ooo111758.sd.xerror.patch
+Patch24: openoffice.org-3.2.0.ooo111741.extras.malformed-xml-file.patch
+Patch25: openoffice.org-3.3.0.ooo112059.sw.avoid-null-ptr-deref.patch
+Patch26: openoffice.org-3.3.0.ooo107490.cppu.lifecycle.patch
+Patch27: openoffice.org-3.3.0.ooo100686.wizards.types.not.mediatypes.patch
+Patch28: workspace.vcl113.patch
+Patch29: openoffice.org-3.3.0.ooo112384.sw.export.doc.styledoesntexist.patch
+Patch30: workspace.gtk3.patch
+Patch31: workspace.cmcfixes77.patch
+Patch32: workspace.vcl114.patch
+Patch33: openoffice.org-3.3.0.ooo113273.desktop.resolvelinks.patch
+Patch34: openoffice.org-3.3.0.ooo106591.sal.tradcopy.patch
+Patch35: workspace.vcl115.patch
+Patch36: workspace.cmcfixes78.patch
+Patch37: openoffice.org-3.3.0.ooo114012.sd.bada11ychain.patch
+Patch38: workspace.cmcfixes79.patch
+Patch39: openoffice.org-3.3.0.ooo114703.vcl.betterlocalize.font.patch
+Patch40: openoffice.org-3.3.0.rh637738.libgcrypt.addmutex.patch
+Patch41: openoffice.org-3.3.0.rh638185.editeng.cjkctlhtmlsizes.patch
+Patch42: openoffice.org-3.2.0.rh632236.writerfilter.cleanup-cell-props.patch
+Patch43: libreoffice-buildfix.patch
+
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%define instdir %{_libdir}
+%define baseinstdir %{instdir}/libreoffice
+%define ureinstdir %{baseinstdir}/ure
+%define basisinstdir %{baseinstdir}/basis3.3
+%define sdkinstdir %{baseinstdir}/basis3.3/sdk
+%define fontname opensymbol
+%define OFFICEUPD 330
+%define SOPOST l*
+
+%description
+LibreOffice is an Open Source, community-developed, office productivity suite.
+It includes the key desktop applications, such as a word processor,
+spreadsheet, presentation manager, formula editor and drawing program, with a
+user interface and feature set similar to other office suites. Sophisticated
+and flexible, LibreOffice also works transparently with a variety of file
+formats, including Microsoft Office File Formats.
+
+%package core
+Summary: Core modules for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-%{fontname}-fonts = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Requires: liberation-sans-fonts >= 1.0, liberation-serif-fonts >= 1.0, liberation-mono-fonts >= 1.0
+Requires: dejavu-sans-fonts, dejavu-serif-fonts, dejavu-sans-mono-fonts
+Requires: hunspell-en, hyphen-en, hyphen >= 2.4, autocorr-en
+Requires: lucene
+Requires(pre): gtk2 >= 2.9.4
+Requires(post): gtk2 >= 2.9.4
+Requires(preun): gtk2 >= 2.9.4
+Requires(postun): gtk2 >= 2.9.4
+Obsoletes: openoffice.org-core < 1:3.3.1
+Obsoletes: openoffice.org-brand < 1:3.3.1, broffice.org-brand < 1:3.3.1
+
+%description core
+The shared core libraries and support files for LibreOffice.
+
+%package pyuno
+Summary: Python support for LibreOffice
+Group: Development/Libraries
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Requires: python
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-pyuno < 1:3.3.1
+
+%description pyuno
+Python bindings for the LibreOffice UNO component model. Allows scripts both
+external to LibreOffice and within the internal LibreOffice scripting framework
+to be written in python.
+
+%package base
+Summary: Database front-end for LibreOffice
+Group: Applications/Productivity
+Requires: hsqldb, postgresql-jdbc
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-calc = %{version}-%{release}
+Obsoletes: openoffice.org-base-core < 1:3.3.1
+Obsoletes: openoffice.org-base < 1:3.3.1, broffice.org-base < 1:3.3.1
+
+%description base
+GUI database front-end for LibreOffice. Allows creation and management of
+databases through a GUI.
+
+%package report-builder
+Summary: Create database reports from LibreOffice
+Group: Applications/Productivity
+Requires: pentaho-reporting-flow-engine
+Requires: %{name}-base = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-report-builder < 1:3.3.1
+
+%description report-builder
+Creates database reports from LibreOffice databases. The report builder can
+define group and page headers as well as group, page footers and calculation
+fields to accomplish complex database reports.
+
+%package bsh
+Summary: BeanShell support for LibreOffice
+Group: Development/Libraries
+Requires: bsh
+Requires: %{name}-core = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-bsh < 1:3.3.1
+
+%description bsh
+Support BeanShell scripts in LibreOffice.
+
+%package rhino
+Summary: JavaScript support for LibreOffice
+Group: Development/Libraries
+Requires: %{name}-core = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-rhino < 1:3.3.1
+
+%description rhino
+Support JavaScript scripts in LibreOffice.
+
+%package wiki-publisher
+Summary: Create Wiki articles on MediaWiki servers with LibreOffice
+Group: Applications/Productivity
+Requires: jakarta-commons-codec, jakarta-commons-httpclient
+Requires: jakarta-commons-lang, jakarta-commons-logging
+Requires: %{name}-writer = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-wiki-publisher < 1:3.3.1
+
+%description wiki-publisher
+The Wiki Publisher enables you to create Wiki articles on MediaWiki servers
+without having to know the syntax of the MediaWiki markup language. Publish
+your new and existing documents transparently with writer to a wiki page.
+
+%package ogltrans
+Summary: 3D OpenGL slide transitions for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-impress = %{version}-%{release}
+Requires(pre): %{name}-core
+Obsoletes: openoffice.org-ogltrans < 1:3.3.1
+
+%description ogltrans
+OpenGL Transitions enable 3D slide transitions to be used in LibreOffice.
+Requires good quality 3D support for your graphics card for best experience.
+
+%package presentation-minimizer
+Summary: Shrink LibreOffice presentations
+Group: Applications/Productivity
+Requires: %{name}-impress = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-presentation-minimizer < 1:3.3.1
+
+%description presentation-minimizer
+The Presentation Minimizer is used to reduce the file size of the current
+presentation. Images will be compressed, and data that is no longer needed will
+be removed.
+
+%package presenter-screen
+Summary: Presenter Screen for LibreOffice Presentations
+Group: Applications/Productivity
+Requires: %{name}-impress = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-presenter-screen < 1:3.3.1
+
+%description presenter-screen
+The Presenter Screen is used to provides information on a second screen, that
+typically is not visible to the audience when delivering a presentation. e.g.
+slide notes.
+
+%package pdfimport
+Summary: PDF Importer for LibreOffice Draw
+Group: Applications/Productivity
+Requires: %{name}-draw = %{version}-%{release}
+Requires(pre): %{name}-core
+Requires(post): %{name}-core
+Requires(preun): %{name}-core
+Requires(postun): %{name}-core
+Obsoletes: openoffice.org-pdfimport < 1:3.3.1
+
+%description pdfimport
+The PDF Importer imports PDF into drawing documents to preserve layout
+and enable basic editing of PDF documents.
+
+%package %{fontname}-fonts
+Summary: LibreOffice dingbats font
+Group: User Interface/X
+Requires: fontpackages-filesystem
+Obsoletes: openoffice.org-fonts < 1:3.3.1
+BuildArch: noarch
+
+%description %{fontname}-fonts
+A dingbats font, OpenSymbol, suitable for use by LibreOffice for bullets and
+mathematical symbols.
+
+%package writer
+Summary: LibreOffice Word Processor Application
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Obsoletes: openoffice.org-writer-core < 1:3.3.1
+Obsoletes: openoffice.org-writer < 1:3.3.1, broffice.org-writer < 1:3.3.1
+
+%description writer
+The LibreOffice Word Processor application.
+
+%package emailmerge
+Summary: Email mail-merge component for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-writer = %{version}-%{release}
+Requires: %{name}-pyuno = %{version}-%{release}
+Obsoletes: openoffice.org-emailmerge < 1:3.3.1
+
+%description emailmerge
+Enables the LibreOffice writer module to mail-merge to email.
+
+%package calc
+Summary: LibreOffice Spreadsheet Application
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Obsoletes: openoffice.org-calc-core < 1:3.3.1
+Obsoletes: openoffice.org-calc < 1:3.3.1, broffice.org-calc < 1:3.3.1
+
+%description calc
+The LibreOffice Spreadsheet application.
+
+%package draw
+Summary: LibreOffice Drawing Application
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-pdfimport = %{version}-%{release}
+Requires: %{name}-graphicfilter = %{version}-%{release}
+Obsoletes: openoffice.org-draw-core < 1:3.3.1
+Obsoletes: openoffice.org-draw < 1:3.3.1, broffice.org-draw < 1:3.3.1
+
+%description draw
+The LibreOffice Drawing Application.
+
+%package impress
+Summary: LibreOffice Presentation Application
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-presenter-screen = %{version}-%{release}
+Obsoletes: openoffice.org-impress-core < 1:3.3.1
+Obsoletes: openoffice.org-impress < 1:3.3.1, broffice.org-impress < 1:3.3.1
+
+%description impress
+The LibreOffice Presentation Application.
+
+%package math
+Summary: LibreOffice Equation Editor Application
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-ure = %{version}-%{release}
+Obsoletes: openoffice.org-math-core < 1:3.3.1
+Obsoletes: openoffice.org-math < 1:3.3.1, broffice.org-math < 1:3.3.1
+
+%description math
+The LibreOffice Equation Editor Application.
+
+%package graphicfilter
+Summary: LibreOffice Extra Graphic filters
+Group: Applications/Productivity
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-core = %{version}-%{release}
+Obsoletes: openoffice.org-graphicfilter < 1:3.3.1
+
+%description graphicfilter
+The graphicfilter module for LibreOffice provides graphic filters, e.g. svg and
+flash filters.
+
+%package xsltfilter
+Summary: Optional xsltfilter module for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Obsoletes: openoffice.org-xsltfilter < 1:3.3.1
+
+%description xsltfilter
+The xsltfilter module for LibreOffice, provides additional docbook and
+xhtml export transforms. Install this to enable docbook export.
+
+%package javafilter
+Summary: Optional javafilter module for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Obsoletes: openoffice.org-javafilter < 1:3.3.1
+
+%description javafilter
+The javafilter module for LibreOffice, provides additional AportisDoc,
+Pocket Excel and Pocket Word import filters.
+
+%post javafilter
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun javafilter
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%package testtools
+Summary: Testtools for LibreOffice
+Group: Development/Libraries
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-core = %{version}-%{release}
+Requires: %{name}-writer = %{version}-%{release}
+Requires: %{name}-calc = %{version}-%{release}
+Requires: %{name}-draw = %{version}-%{release}
+Requires: %{name}-impress = %{version}-%{release}
+Requires: %{name}-base = %{version}-%{release}
+Requires: %{name}-math = %{version}-%{release}
+Requires: %{name}-bsh = %{version}-%{release}
+Requires: %{name}-rhino = %{version}-%{release}
+Obsoletes: openoffice.org-testtools < 1:3.3.1
+
+%description testtools
+QA tools for LibreOffice, enables automated testing.
+
+%package ure
+Summary: UNO Runtime Environment
+Group: Development/Libraries
+Requires: unzip, jre >= 1.5.0
+Obsoletes: openoffice.org-ure < 1:3.3.1
+
+%description ure
+UNO is the component model of LibreOffice. UNO offers interoperability between
+programming languages, other components models and hardware architectures,
+either in process or over process boundaries, in the Intranet as well as in the
+Internet. UNO components may be implemented in and accessed from any
+programming language for which a UNO implementation (AKA language binding) and
+an appropriate bridge or adapter exists
+
+%package sdk
+Summary: Software Development Kit for LibreOffice
+Group: Development/Libraries
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-core = %{version}-%{release}
+Requires: unzip, java-devel
+Obsoletes: openoffice.org-sdk < 1:3.3.1, openoffice.org-devel < 1:3.3.1
+
+%description sdk
+The LibreOffice SDK is an add-on for the LibreOffice office suite. It provides
+the necessary tools for programming using the LibreOffice APIs and for creating
+extensions (UNO components) for LibreOffice. To set the build environment for
+building against the sdk use %{sdkinstdir}/setsdkenv_unix.sh.
+
+%package sdk-doc
+Summary: Software Development Kit documentation for LibreOffice
+Group: Documentation
+Requires: %{name}-sdk = %{version}-%{release}
+Obsoletes: openoffice.org-sdk-doc < 1:3.3.1
+
+%description sdk-doc
+This provides documentation for programming using the LibreOffice APIs
+and examples of creating extensions (UNO components) for LibreOffice.
+
+%package headless
+Summary: LibreOffice Headless plug-in
+Group: Development/Libraries
+Requires: %{name}-ure = %{version}-%{release}
+Requires: %{name}-core = %{version}-%{release}
+Obsoletes: openoffice.org-headless < 1:3.3.1
+
+%description headless
+A plug-in for LibreOffice that enables it to function without an X server.
+It implements the -headless command line option and allows LibreOffice to be
+used as a backend server for e.g. document conversion.
+
+%package langpack-af
+Summary: Afrikaans language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=af), hunspell-af, hyphen-af, autocorr-af
+Obsoletes: openoffice.org-langpack-af_ZA < 1:3.3.1
+
+%description langpack-af
+Provides additional Afrikaans translations and resources for LibreOffice.
+
+%package langpack-ar
+Summary: Arabic language pack for LibreOffice
+Group: Applications/Productivity
+Requires: font(:lang=ar), hunspell-ar
+Requires: %{name}-core = %{version}-%{release}
+Obsoletes: openoffice.org-langpack-ar < 1:3.3.1
+
+%description langpack-ar
+Provides additional Arabic translations and resources for LibreOffice.
+
+%package langpack-bg
+Summary: Bulgarian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=bg), hunspell-bg, hyphen-bg, mythes-bg, autocorr-bg
+Obsoletes: openoffice.org-langpack-bg_BG < 1:3.3.1
+
+%description langpack-bg
+Provides additional Bulgarian translations and resources for LibreOffice.
+
+%package langpack-bn
+Summary: Bengali language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=bn), hunspell-bn, hyphen-bn
+Obsoletes: openoffice.org-langpack-bn < 1:3.3.1
+
+%description langpack-bn
+Provides additional Bengali translations and resources for LibreOffice.
+
+%package langpack-ca
+Summary: Catalan language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ca), hunspell-ca, hyphen-ca, mythes-ca
+Obsoletes: openoffice.org-langpack-ca_ES < 1:3.3.1
+
+%description langpack-ca
+Provides additional Catalan translations and resources for LibreOffice.
+
+%package langpack-cs
+Summary: Czech language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=cs), hunspell-cs, hyphen-cs, mythes-cs, autocorr-cs
+Obsoletes: openoffice.org-langpack-cs_CZ < 1:3.3.1
+
+%description langpack-cs
+Provides additional Czech translations and resources for LibreOffice.
+
+%package langpack-cy
+Summary: Welsh language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=cy), hunspell-cy, hyphen-cy
+Obsoletes: openoffice.org-langpack-cy_GB < 1:3.3.1
+
+%description langpack-cy
+Provides additional Welsh translations and resources for LibreOffice.
+
+%package langpack-da
+Summary: Danish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=da), hunspell-da, hyphen-da, mythes-da, autocorr-da
+Obsoletes: openoffice.org-langpack-da_DK < 1:3.3.1
+
+%description langpack-da
+Provides additional Danish translations and resources for LibreOffice.
+
+%package langpack-de
+Summary: German language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=de), hunspell-de, hyphen-de, mythes-de, autocorr-de
+Obsoletes: openoffice.org-langpack-de < 1:3.3.1
+
+%description langpack-de
+Provides additional German translations and resources for LibreOffice.
+
+%package langpack-el
+Summary: Greek language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=el), hunspell-el, hyphen-el, mythes-el
+Obsoletes: openoffice.org-langpack-el_GR < 1:3.3.1
+
+%description langpack-el
+Provides additional Greek translations and resources for LibreOffice.
+
+%package langpack-en
+Summary: English language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: mythes-en
+Obsoletes: openoffice.org-langpack-en < 1:3.3.1
+
+%description langpack-en
+English thesaurus for LibreOffice.
+
+%package langpack-es
+Summary: Spanish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=es), hunspell-es, hyphen-es, mythes-es, autocorr-es
+Obsoletes: openoffice.org-langpack-es < 1:3.3.1
+
+%description langpack-es
+Provides additional Spanish translations and resources for LibreOffice.
+
+%package langpack-et
+Summary: Estonian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=et), hunspell-et, hyphen-et
+Obsoletes: openoffice.org-langpack-et_EE < 1:3.3.1
+
+%description langpack-et
+Provides additional Estonian translations and resources for LibreOffice.
+
+%package langpack-eu
+Summary: Basque language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=eu), hunspell-eu, hyphen-eu, autocorr-eu
+Obsoletes: openoffice.org-langpack-eu_ES < 1:3.3.1
+
+%description langpack-eu
+Provides additional Basque translations and resources for LibreOffice.
+
+%package langpack-fi
+Summary: Finnish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=fi), openoffice.org-voikko, autocorr-fi
+Obsoletes: openoffice.org-langpack-fi_FI < 1:3.3.1
+
+%description langpack-fi
+Provides additional Finnish translations and resources for LibreOffice.
+
+%package langpack-fr
+Summary: French language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=fr), hunspell-fr, hyphen-fr, mythes-fr, autocorr-fr
+Obsoletes: openoffice.org-langpack-fr < 1:3.3.1
+
+%description langpack-fr
+Provides additional French translations and resources for LibreOffice.
+
+%package langpack-ga
+Summary: Irish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ga), hunspell-ga, hyphen-ga, mythes-ga, autocorr-ga
+Obsoletes: openoffice.org-langpack-ga_IE < 1:3.3.1
+
+%description langpack-ga
+Provides additional Irish translations and resources for LibreOffice.
+
+%package langpack-gl
+Summary: Galician language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=gl), hunspell-gl, hyphen-gl
+Obsoletes: openoffice.org-langpack-gl_ES < 1:3.3.1
+
+%description langpack-gl
+Provides additional Galician translations and resources for LibreOffice.
+
+%package langpack-gu
+Summary: Gujarati language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=gu), hunspell-gu, hyphen-gu
+Obsoletes: openoffice.org-langpack-gu_IN < 1:3.3.1
+
+%description langpack-gu
+Provides additional Gujarati translations and resources for OpenOffice.or.
+
+%package langpack-pa
+Summary: Punjabi language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=pa), hunspell-pa, hyphen-pa
+Obsoletes: openoffice.org-langpack-pa < 1:3.3.1
+
+%description langpack-pa
+Provides additional Punjabi translations and resources for LibreOffice.
+
+%package langpack-he
+Summary: Hebrew language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=he), hunspell-he
+Obsoletes: openoffice.org-langpack-he_IL < 1:3.3.1
+
+%description langpack-he
+Provides additional Hebrew translations and resources for LibreOffice.
+
+%package langpack-hi
+Summary: Hindi language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=hi), hunspell-hi, hyphen-hi
+Obsoletes: openoffice.org-langpack-hi_IN < 1:3.3.1
+
+%description langpack-hi
+Provides additional Hindi translations and resources for LibreOffice.
+
+%package langpack-hu
+Summary: Hungarian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=hu), hunspell-hu, hyphen-hu, mythes-hu, autocorr-hu
+Obsoletes: openoffice.org-langpack-hu_HU < 1:3.3.1
+
+%description langpack-hu
+Provides additional Hungarian translations and resources for LibreOffice.
+
+%package langpack-hr
+Summary: Croatian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=hr), hunspell-hr, hyphen-hr
+Obsoletes: openoffice.org-langpack-hr_HR < 1:3.3.1
+
+%description langpack-hr
+Provides additional Croatian translations and resources for LibreOffice.
+
+%package langpack-it
+Summary: Italian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=it), hunspell-it, hyphen-it, mythes-it, autocorr-it
+Obsoletes: openoffice.org-langpack-it < 1:3.3.1
+
+%description langpack-it
+Provides additional Italian translations and resources for LibreOffice.
+
+%package langpack-ja
+Summary: Japanese language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ja), autocorr-ja
+Obsoletes: openoffice.org-langpack-ja_JP < 1:3.3.1
+
+%description langpack-ja
+Provides additional Japanese translations and resources for LibreOffice.
+
+%package langpack-ko
+Summary: Korean language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ko), hunspell-ko, autocorr-ko
+Obsoletes: openoffice.org-langpack-ko_KR < 1:3.3.1
+
+%description langpack-ko
+Provides additional Korean translations and resources for LibreOffice.
+
+%package langpack-lt
+Summary: Lithuanian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=lt), hunspell-lt, hyphen-lt, autocorr-lt
+Obsoletes: openoffice.org-langpack-lt_LT < 1:3.3.1
+
+%description langpack-lt
+Provides additional Lithuanian translations and resources for LibreOffice.
+
+%package langpack-ms
+Summary: Malay language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ms), hunspell-ms
+Obsoletes: openoffice.org-langpack-ms_MY < 1:3.3.1
+
+%description langpack-ms
+Provides additional Malay translations and resources for LibreOffice.
+
+%package langpack-nb
+Summary: Bokmal language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=nb), hunspell-nb, hyphen-nb, mythes-nb
+Obsoletes: openoffice.org-langpack-nb_NO < 1:3.3.1
+
+%description langpack-nb
+Provides additional Bokmal translations and resources for LibreOffice.
+
+%package langpack-nl
+Summary: Dutch language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=nl), hunspell-nl, hyphen-nl, mythes-nl, autocorr-nl
+Obsoletes: openoffice.org-langpack-nl < 1:3.3.1
+
+%description langpack-nl
+Provides additional Dutch translations and resources for LibreOffice.
+
+%package langpack-nn
+Summary: Nynorsk language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=nn), hunspell-nn, hyphen-nn, mythes-nn
+Obsoletes: openoffice.org-langpack-nn_NO < 1:3.3.1
+
+%description langpack-nn
+Provides additional Nynorsk translations and resources for LibreOffice.
+
+%package langpack-nr
+Summary: Southern Ndebele language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=nr), hunspell-nr
+Obsoletes: openoffice.org-langpack-nr_ZA < 1:3.3.1
+
+%description langpack-nr
+Provides additional Southern Ndebele translations and resources for
+LibreOffice.
+
+%package langpack-pl
+Summary: Polish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=pl), hunspell-pl, hyphen-pl, mythes-pl, autocorr-pl
+Obsoletes: openoffice.org-langpack-pl_PL < 1:3.3.1
+
+%description langpack-pl
+Provides additional Polish translations and resources for LibreOffice.
+
+%package langpack-pt-PT
+Summary: Portuguese language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=pt), hunspell-pt, hyphen-pt, mythes-pt, autocorr-pt
+Obsoletes: openoffice.org-langpack-pt_PT < 1:3.3.1
+
+%description langpack-pt-PT
+Provides additional Portuguese translations and resources for LibreOffice.
+
+%package langpack-pt-BR
+Summary: Brazilian Portuguese language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=pt), hunspell-pt, hyphen-pt, mythes-pt, autocorr-pt
+Obsoletes: openoffice.org-langpack-pt_BR < 1:3.3.1
+
+%description langpack-pt-BR
+Provides additional Brazilian Portuguese translations and resources for
+LibreOffice.
+
+%package langpack-ru
+Summary: Russian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ru), hunspell-ru, hyphen-ru, mythes-ru, autocorr-ru
+Obsoletes: openoffice.org-langpack-ru < 1:3.3.1
+
+%description langpack-ru
+Provides additional Russian translations and resources for LibreOffice.
+
+%package langpack-sk
+Summary: Slovak language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=sk), hunspell-sk, hyphen-sk, mythes-sk, autocorr-sk
+Obsoletes: openoffice.org-langpack-sk_SK < 1:3.3.1
+
+%description langpack-sk
+Provides additional Slovak translations and resources for LibreOffice.
+
+%package langpack-sl
+Summary: Slovenian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=sl), hunspell-sl, hyphen-sl, mythes-sl, autocorr-sl
+Obsoletes: openoffice.org-langpack-sl_SI < 1:3.3.1
+
+%description langpack-sl
+Provides additional Slovenian translations and resources for LibreOffice.
+
+%package langpack-sr
+Summary: Serbian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=sr), hunspell-sr, hyphen-sr, autocorr-sr
+Obsoletes: openoffice.org-langpack-sr < 1:3.3.1
+
+%description langpack-sr
+Provides additional Serbian translations and resources for LibreOffice.
+
+%package langpack-ss
+Summary: Swati language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ss), hunspell-ss
+Obsoletes: openoffice.org-langpack-ss_ZA < 1:3.3.1
+
+%description langpack-ss
+Provides additional Swati translations and resources for LibreOffice.
+
+%package langpack-st
+Summary: Southern Sotho language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=st), hunspell-st
+Obsoletes: openoffice.org-langpack-st_ZA < 1:3.3.1
+
+%description langpack-st
+Provides additional Southern Sotho translations and resources for
+LibreOffice.
+
+%package langpack-sv
+Summary: Swedish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=sv), hunspell-sv, hyphen-sv, mythes-sv, autocorr-sv
+Obsoletes: openoffice.org-langpack-sv < 1:3.3.1
+
+%description langpack-sv
+Provides additional Swedish translations and resources for LibreOffice.
+
+%package langpack-ta
+Summary: Tamil language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ta), hunspell-ta, hyphen-ta
+Obsoletes: openoffice.org-langpack-ta_IN < 1:3.3.1
+
+%description langpack-ta
+Provides additional Tamil translations and resources for LibreOffice.
+
+%package langpack-th
+Summary: Thai language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=th), hunspell-th
+Obsoletes: openoffice.org-langpack-th_TH < 1:3.3.1
+
+%description langpack-th
+Provides additional Thai translations and resources for LibreOffice.
+
+%package langpack-nso
+Summary: Northern Sotho language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=nso), hunspell-nso
+Obsoletes: openoffice.org-langpack-nso_ZA < 1:3.3.1
+
+%description langpack-nso
+Provides additional Northern Sotho translations and resources for
+LibreOffice.
+
+%package langpack-tn
+Summary: Tswana language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=tn), hunspell-tn
+Obsoletes: openoffice.org-langpack-tn_ZA < 1:3.3.1
+
+%description langpack-tn
+Provides additional Tswana translations and resources for LibreOffice.
+
+%package langpack-ts
+Summary: Tsonga language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ts), hunspell-ts
+Obsoletes: openoffice.org-langpack-ts_ZA < 1:3.3.1
+
+%description langpack-ts
+Provides additional Tsonga translations and resources for LibreOffice.
+
+%package langpack-tr
+Summary: Turkish language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=tr), autocorr-tr
+Obsoletes: openoffice.org-langpack-tr_TR < 1:3.3.1
+
+%description langpack-tr
+Provides additional Turkish translations and resources for LibreOffice.
+
+%package langpack-ve
+Summary: Venda language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ve), hunspell-ve
+Obsoletes: openoffice.org-langpack-ve_ZA < 1:3.3.1
+
+%description langpack-ve
+Provides additional Venda translations and resources for LibreOffice.
+
+%package langpack-xh
+Summary: Xhosa language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=xh), hunspell-xh
+Obsoletes: openoffice.org-langpack-xh_ZA < 1:3.3.1
+
+%description langpack-xh
+Provides additional Xhosa translations and resources for LibreOffice.
+
+%package langpack-zh-Hans
+Summary: Simplified Chinese language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=zh-cn), autocorr-zh
+Obsoletes: openoffice.org-langpack-zh_CN < 1:3.3.1
+
+%description langpack-zh-Hans
+Provides additional Simplified Chinese translations and resources for
+LibreOffice.
+
+%package langpack-zh-Hant
+Summary: Traditional Chinese language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=zh-tw), autocorr-zh
+Obsoletes: openoffice.org-langpack-zh_TW < 1:3.3.1
+
+%description langpack-zh-Hant
+Provides additional Traditional Chinese translations and resources for
+LibreOffice.
+
+%package langpack-zu
+Summary: Zulu language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=zu), hunspell-zu, hyphen-zu
+Obsoletes: openoffice.org-langpack-zu_ZA < 1:3.3.1
+
+%description langpack-zu
+Provides additional Zulu translations and resources for LibreOffice.
+
+%package langpack-as
+Summary: Assamese language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=as), hunspell-as, hyphen-as
+Obsoletes: openoffice.org-langpack-as_IN < 1:3.3.1
+
+%description langpack-as
+Provides additional Assamese translations and resources for LibreOffice.
+
+%package langpack-mr
+Summary: Marathi language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=mr), hunspell-mr, hyphen-mr
+Obsoletes: openoffice.org-langpack-mr_IN < 1:3.3.1
+
+%description langpack-mr
+Provides additional Marathi translations and resources for LibreOffice.
+
+%package langpack-ml
+Summary: Malayalam language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ml), hunspell-ml, hyphen-ml
+Obsoletes: openoffice.org-langpack-ml_IN < 1:3.3.1
+
+%description langpack-ml
+Provides additional Malayalam translations and resources for LibreOffice.
+
+%package langpack-or
+Summary: Oriya language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=or), hunspell-or, hyphen-or
+Obsoletes: openoffice.org-langpack-or_IN < 1:3.3.1
+
+%description langpack-or
+Provides additional Oriya translations and resources for LibreOffice.
+
+%package langpack-te
+Summary: Telugu language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=te), hunspell-te, hyphen-te
+Obsoletes: openoffice.org-langpack-te_IN < 1:3.3.1
+
+%description langpack-te
+Provides additional Telugu translations and resources for LibreOffice.
+
+%package langpack-ur
+Summary: Urdu language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ur), hunspell-ur
+Obsoletes: openoffice.org-langpack-ur < 1:3.3.1
+
+%description langpack-ur
+Provides additional Urdu translations and resources for LibreOffice.
+
+%package langpack-kn
+Summary: Kannada language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=kn), hunspell-kn, hyphen-kn
+Obsoletes: openoffice.org-langpack-kn_IN < 1:3.3.1
+
+%description langpack-kn
+Provides additional Kannada translations and resources for LibreOffice.
+
+%package langpack-dz
+Summary: Dzongkha language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=dz)
+Obsoletes: openoffice.org-langpack-dz < 1:3.3.1
+
+%description langpack-dz
+Provides additional Dzongkha translations and resources for LibreOffice.
+
+%package langpack-uk
+Summary: Ukrainian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=uk), hunspell-uk, hyphen-uk, mythes-uk
+Obsoletes: openoffice.org-langpack-uk < 1:3.3.1
+
+%description langpack-uk
+Provides additional Ukrainian translations and resources for LibreOffice.
+
+%package langpack-mai
+Summary: Maithili language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=mai)
+Obsoletes: openoffice.org-langpack-mai_IN < 1:3.3.1
+
+%description langpack-mai
+Provides additional Maithili translations and resources for LibreOffice.
+
+%package langpack-ro
+Summary: Romanian language pack for LibreOffice
+Group: Applications/Productivity
+Requires: %{name}-core = %{version}-%{release}
+Requires: font(:lang=ro), hunspell-ro, hyphen-ro, mythes-ro
+Obsoletes: openoffice.org-langpack-ro < 1:3.3.1
+
+%description langpack-ro
+Provides additional Romanian translations and resources for LibreOffice.
+
+%package -n autocorr-en
+Summary: English auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-en
+Rules for auto-correcting common English typing errors.
+
+%package -n autocorr-af
+Summary: Afrikaans auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-af
+Rules for auto-correcting common Afrikaans typing errors.
+
+%package -n autocorr-bg
+Summary: Bulgarian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-bg
+Rules for auto-correcting common Bulgarian typing errors.
+
+%package -n autocorr-cs
+Summary: Czech auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-cs
+Rules for auto-correcting common Czech typing errors.
+
+%package -n autocorr-da
+Summary: Danish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-da
+Rules for auto-correcting common Danish typing error.
+
+%package -n autocorr-de
+Summary: German auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-de
+Rules for auto-correcting common German typing errors.
+
+%package -n autocorr-es
+Summary: Spanish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-es
+Rules for auto-correcting common Spanish typing errors.
+
+%package -n autocorr-eu
+Summary: Basque auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-eu
+Rules for auto-correcting common Basque typing errors.
+
+%package -n autocorr-fa
+Summary: Farsi auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-fa
+Rules for auto-correcting common Farsi typing errors.
+
+%package -n autocorr-fi
+Summary: Finnish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-fi
+Rules for auto-correcting common Finnish typing errors.
+
+%package -n autocorr-fr
+Summary: French auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-fr
+Rules for auto-correcting common French typing errors.
+
+%package -n autocorr-ga
+Summary: Irish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-ga
+Rules for auto-correcting common Irish typing errors.
+
+%package -n autocorr-hu
+Summary: Hungarian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-hu
+Rules for auto-correcting common Hungarian typing errors.
+
+%package -n autocorr-it
+Summary: Italian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-it
+Rules for auto-correcting common Italian typing errors.
+
+%package -n autocorr-ja
+Summary: Japanese auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-ja
+Rules for auto-correcting common Japanese typing errors.
+
+%package -n autocorr-ko
+Summary: Korean auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-ko
+Rules for auto-correcting common Korean typing errors.
+
+%package -n autocorr-lb
+Summary: Luxembourgish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-lb
+Rules for auto-correcting common Luxembourgish typing errors.
+
+%package -n autocorr-lt
+Summary: Lithuanian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-lt
+Rules for auto-correcting common Lithuanian typing errors.
+
+%package -n autocorr-mn
+Summary: Mongolian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-mn
+Rules for auto-correcting common Mongolian typing errors.
+
+%package -n autocorr-nl
+Summary: Dutch auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-nl
+Rules for auto-correcting common Dutch typing errors.
+
+%package -n autocorr-pl
+Summary: Polish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-pl
+Rules for auto-correcting common Polish typing errors.
+
+%package -n autocorr-pt
+Summary: Portuguese auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-pt
+Rules for auto-correcting common Portuguese typing errors.
+
+%package -n autocorr-ru
+Summary: Russian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-ru
+Rules for auto-correcting common Russian typing errors.
+
+%package -n autocorr-sk
+Summary: Slovak auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-sk
+Rules for auto-correcting common Slovak typing errors.
+
+%package -n autocorr-sl
+Summary: Slovenian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-sl
+Rules for auto-correcting common Slovenian typing errors.
+
+%package -n autocorr-sr
+Summary: Serbian auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-sr
+Rules for auto-correcting common Serbian typing errors.
+
+%package -n autocorr-sv
+Summary: Swedish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-sv
+Rules for auto-correcting common Swedish typing errors.
+
+%package -n autocorr-tr
+Summary: Turkish auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-tr
+Rules for auto-correcting common Turkish typing errors.
+
+%package -n autocorr-vi
+Summary: Vietnamese auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-vi
+Rules for auto-correcting common Vietnamese typing errors.
+
+%package -n autocorr-zh
+Summary: Chinese auto-correction rules
+Group: Applications/Text
+BuildArch: noarch
+
+%description -n autocorr-zh
+Rules for auto-correcting common Chinese typing errors.
+
+%prep
+%setup -q -c -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -a 10 -a 11 -a 12 -a 13 -a 14 -a 15 -a 16 -a 17 -a 18 -a 35
+for a in */*; do mv `pwd`/$a .; done
+#remove "debugging" translations
+rm -rf l10n/source/kid
+#Customize Palette to remove Sun colours and add Red Hat colours
+(head -n -1 extras/source/palettes/standard.soc && \
+ echo -e ' <draw:color draw:name="Red Hat 1" draw:color="#cc0000"/>
+ <draw:color draw:name="Red Hat 2" draw:color="#0093d9"/>
+ <draw:color draw:name="Red Hat 3" draw:color="#ff8d00"/>
+ <draw:color draw:name="Red Hat 4" draw:color="#abb400"/>
+ <draw:color draw:name="Red Hat 5" draw:color="#4e376b"/>' && \
+ tail -n 1 extras/source/palettes/standard.soc) > redhat.soc
+mv -f redhat.soc extras/source/palettes/standard.soc
+cp -p %{SOURCE19} extras/source/database/evolocal.odb
+cp -p %{SOURCE20} external/unowinreg/unowinreg.dll
+%patch1 -p1 -b .rhXXXXXX.extensions.defaulttoevo2.patch
+%patch2 -p1 -b .ooo53397.prelinkoptimize.desktop.patch
+%patch3 -p1
+%patch4 -p1 -b .ooo7065.sw.titlepagedialog.patch
+%patch5 -p0 -b .ooo76649.httpencoding.patch
+%patch6 -p1 -b .ooo86080.unopkg.bodge.patch
+%patch7 -p1 -b .ooo88341.sc.verticalboxes.patch
+%patch8 -p0 -b .workspace.dtardon03.patch
+%patch9 -p0 -b .gccXXXXX.solenv.javaregistration.patch
+%patch10 -p1 -b .oooXXXXX.solenv.allowmissing.patch
+%patch11 -p1 -b .ooo61927.sw.ww6.unicodefontencoding.patch
+%patch12 -p0 -b .ooo101274.opening-a-directory.patch
+%patch13 -p0 -b .ooo102061.sc.cellanchoring.patch
+%patch14 -p0 -b .workspace.impress195.patch
+%patch15 -p0 -b .ooo105784.vcl.sniffscriptforsubs.patch
+%patch16 -p1 -b .workspace.srb1.patch
+%patch17 -p1 -b .ooo106502.svx.fixspelltimer.patch
+%patch18 -p1 -b .ooo108246.svx.hide-sql-group-when-inactive.patch
+%patch19 -p1 -b .ooo108637.sfx2.uisavedir.patch
+%patch20 -p1 -b .ooo108846.sfx2.qstartfixes.patch
+%patch21 -p1 -b .ooo95369.sw.sortedobjs.patch
+%patch22 -p0 -b .ooo110142.svx.safercolornames.patch
+%patch23 -p0 -b .ooo111758.sd.xerror.patch
+%patch24 -p1 -b .ooo111741.extras.malformed-xml-file.patch
+%patch25 -p1 -b .ooo112059.sw.avoid-null-ptr-deref.patch
+%patch26 -p0 -b .ooo107490.cppu.lifecycle.patch
+%patch27 -p0 -b .ooo100686.wizards.types.not.mediatypes.patch
+%patch28 -p0 -b .workspace.vcl113.patch
+%patch29 -p0 -b .ooo112384.sw.export.doc.styledoesntexist.patch
+%patch30 -p0 -b .workspace.gtk3.patch
+%patch31 -p1 -b .workspace.cmcfixes77.patch
+%patch32 -p0 -b .workspace.vcl114.patch
+%patch33 -p0 -b .ooo113273.desktop.resolvelinks.patch
+%patch34 -p0 -b .ooo106591.sal.tradcopy.patch
+%patch35 -p1 -b .workspace.vcl115.patch
+%patch36 -p1 -b .workspace.cmcfixes78.patch
+%patch37 -p0 -b .ooo114012.sd.bada11ychain.patch
+%patch38 -p1 -b .workspace.cmcfixes79.patch
+%patch39 -p1 -b .ooo114703.vcl.betterlocalize.font.patch
+%patch40 -p0 -b .rh637738.libgcrypt.addmutex.patch
+%patch41 -p1 -b .rh638185.editeng.cjkctlhtmlsizes.patch
+%patch42 -p1 -b .rh632236.writerfilter.cleanup-cell-props.patch
+%patch43 -p1 -b .libreoffice-buildfix.patch
+
+%build
+echo build start time is `date`, diskspace: `df -h . | tail -n 1`
+#don't build localized helps which are poorly translated
+POORHELPS=`find l10n/source -name localize.sdf -exec grep 'helpcontent2.*main.*Working With %PRODUCTNAME' {} \; | cut -f 10 | grep -v en-US | xargs`
+#convert _smp_mflags to dmake equivalent
+SMP_MFLAGS=%{?_smp_mflags}
+SMP_MFLAGS=$[${SMP_MFLAGS/-j/}]
+if [ $SMP_MFLAGS -lt 2 ]; then SMP_MFLAGS=2; fi
+NDMAKES=`dc -e "$SMP_MFLAGS v p"`
+NBUILDS=`dc -e "$SMP_MFLAGS $NDMAKES / p"`
+
+autoconf
+%configure \
+ --with-vendor="Red Hat, Inc." --with-num-cpus=$NBUILDS --with-max-jobs=$NDMAKES \
+ --with-build-version="Ver: %{version}-%{release}" --with-unix-wrapper=%{name} \
+ --enable-symbols --disable-ldap --disable-epm --disable-mathmldtd \
+ --disable-Xaw --disable-gnome-vfs --enable-gio --enable-symbols \
+ --enable-lockdown --enable-evolution2 --enable-cairo --enable-dbus \
+ --enable-opengl --enable-vba --enable-minimizer --enable-presenter-console \
+ --enable-pdfimport --enable-wiki-publisher --enable-report-builder \
+ --with-system-jfreereport --with-vba-package-format="builtin" \
+ --with-system-libs --with-system-headers --with-system-mozilla \
+ --with-system-mythes --with-system-dicts --with-system-apache-commons \
+ --with-system-libtextcat --with-system-libtextcat-data --without-system-saxon \
+ --with-external-dict-dir=/usr/share/myspell --without-myspell-dicts \
+ --without-fonts --without-agg --without-ppds --without-afms %{stlflags} \
+ --with-lang="%{langpack_langs}" --with-poor-help-localizations="$POORHELPS" \
+ --with-external-tar=`pwd`/ext_sources --with-java-target-version=1.5
+
+mkdir -p ext_sources
+cp %{SOURCE20} ext_sources/185d60944ea767075d27247c3162b3bc-unowinreg.dll
+cp %{SOURCE26} ext_sources
+cp %{SOURCE27} ext_sources
+cp %{SOURCE28} ext_sources
+cp %{SOURCE29} ext_sources
+cp %{SOURCE30} ext_sources
+cp %{SOURCE31} ext_sources
+cp %{SOURCE32} ext_sources
+
+#use the RPM_OPT_FLAGS but remove the OOo overridden ones
+for i in $RPM_OPT_FLAGS; do
+ case "$i" in
+ -O?|-pipe|-Wall|-g|-fexceptions) continue;;
+ esac
+ ARCH_FLAGS="$ARCH_FLAGS $i"
+done
+export ARCH_FLAGS
+
+. ./*[Ee]nv.[Ss]et.sh
+./bootstrap
+cd instsetoo_native
+if ! VERBOSE=false build --dlv_switch -link -P$NBUILDS --all -- -P$NDMAKES -s; then
+ build --dlv_switch -link --all
+fi
+
+#generate the icons and mime type stuff
+export DESTDIR=../../../output
+export KDEMAINDIR=/usr
+export GNOMEDIR=/usr
+export GNOME_MIME_THEME=hicolor
+cd ../sysui
+cd unxlng*/misc/libreoffice
+./create_tree.sh
+
+echo build end time is `date`, diskspace: `df -h . | tail -n 1`
+
+%install
+rm -rf $RPM_BUILD_ROOT
+source ./Linux*Env.Set.sh
+#figure out the icon version
+export `grep "^PRODUCTVERSIONSHORT =" sysui/desktop/productversion.mk | sed -e "s/ //g"`
+export `grep "PRODUCTVERSION[ ]*=[ ]*" sysui/desktop/productversion.mk | sed -e "s/ //g"`
+#install
+cd instsetoo_native/util
+#direct install
+mkdir -p $RPM_BUILD_ROOT/%{instdir}
+export PKGFORMAT=installed
+#don't duplicate english helpcontent about the place
+unset DEFAULT_TO_ENGLISH_FOR_PACKING
+if dmake openoffice_en-US; then
+ ok=true
+ break
+else
+ echo - ---dump log start---
+ cat ../unx*.pro/OpenOffice/installed/logging/en-US/log_*_en-US.log
+ echo - ---dump log end---
+ ok=false
+fi
+if [ $ok == "false" ]; then
+ exit 1
+fi
+mkdir -p $RPM_BUILD_ROOT/%{baseinstdir}
+mv ../unxlng*.pro/OpenOffice/installed/install/en-US/* $RPM_BUILD_ROOT/%{baseinstdir}
+chmod -R +w $RPM_BUILD_ROOT/%{baseinstdir}
+%if %{langpacks}
+dmake ooolanguagepack
+rm -rf ../unxlng*.pro/OpenOffice_languagepack/installed/install/log
+for langpack in ../unxlng*.pro/OpenOffice_languagepack/installed/install/*; do
+cp -rp $langpack/* $RPM_BUILD_ROOT/%{baseinstdir}
+rm -rf $langpack
+done
+%endif
+for file in swriter scalc simpress sdraw ; do
+ cp -f ../../desktop/$OUTPATH.pro/bin/$file $RPM_BUILD_ROOT/%{baseinstdir}/program/$file.bin
+done
+rm -rf $RPM_BUILD_ROOT/%{baseinstdir}/share/prereg
+#give a consistent javasettingsunopkginstall.xml
+$RPM_BUILD_ROOT/%{baseinstdir}/program/unopkg list --bundled || :
+export WITH_LANG="en-US"
+dmake sdkoo
+mv ../unxlng*.pro/OpenOffice_SDK/installed/install/en-US/*/sdk $RPM_BUILD_ROOT/%{sdkinstdir}
+cd ../../
+
+# revoke ScriptProviders and make into extensions
+pushd $RPM_BUILD_ROOT/%{basisinstdir}/program
+
+# BeanShell
+../ure-link/bin/regcomp -revoke -r services.rdb -br services.rdb -c "vnd.sun.star.expand:\$OOO_BASE_DIR/program/classes/ScriptProviderForBeanShell.jar"
+mkdir $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt/META-INF
+mv classes/ScriptProviderForBeanShell.jar $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt
+cp %{SOURCE33} $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt
+cp %{SOURCE34} $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt/META-INF
+sed -i -e 's/@display-name@/Script provider for BeanShell/' \
+ -e 's/@version@/%{version}/' \
+ -e 's/@id@/com.sun.star.script.provider.ScriptProviderForBeanShell/' \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt/description.xml
+sed -i -e 's/@type@/java/' -e 's/@path@/ScriptProviderForBeanShell.jar/' \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt/META-INF/manifest.xml
+
+# JavaScript
+../ure-link/bin/regcomp -revoke -r services.rdb -br services.rdb -c "vnd.sun.star.expand:\$OOO_BASE_DIR/program/classes/ScriptProviderForJavaScript.jar"
+mkdir $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt/META-INF
+mv classes/ScriptProviderForJavaScript.jar $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt
+cp %{SOURCE33} $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt
+cp %{SOURCE34} $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt/META-INF
+sed -i -e 's/@display-name@/Script provider for JavaScript/' \
+ -e 's/@version@/%{version}/' \
+ -e 's/@id@/com.sun.star.script.provider.ScriptProviderForJavaScript/' \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt/description.xml
+sed -i -e 's/@type@/java/' -e 's/@path@/ScriptProviderForJavaScript.jar/' \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt/META-INF/manifest.xml
+
+# Python
+../ure-link/bin/regcomp -revoke -r services.rdb -br services.rdb -c vnd.openoffice.pymodule:pythonscript
+mkdir $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt/META-INF
+mv pythonscript.py $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt
+cp %{SOURCE33} $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt
+cp %{SOURCE34} $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt/META-INF
+sed -i -e 's/@display-name@/Script provider for Python/' \
+ -e 's/@version@/%{version}/' \
+ -e 's/@id@/com.sun.star.script.provider.ScriptProviderForPython/' \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt/description.xml
+sed -i -e 's/@type@/python/' -e 's/@path@/pythonscript.py/' \
+ $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt/META-INF/manifest.xml
+
+popd
+
+#configure sdk
+pushd $RPM_BUILD_ROOT/%{sdkinstdir}
+ for file in setsdkenv_unix.csh setsdkenv_unix.sh ; do
+ sed -e "s, at OO_SDK_NAME@,sdk," \
+ -e "s, at OO_SDK_HOME@,%{sdkinstdir}," \
+ -e "s, at OFFICE_HOME@,%{baseinstdir}," \
+ -e "s, at OFFICE_BASE_HOME@,%{basisinstdir}," \
+ -e "s, at OO_SDK_URE_HOME@,%{ureinstdir}," \
+ -e "s, at OO_SDK_MAKE_HOME@,/usr/bin," \
+ -e "s, at OO_SDK_ZIP_HOME@,/usr/bin," \
+ -e "s, at OO_SDK_CPP_HOME@,/usr/bin," \
+ -e "s, at OO_SDK_CC_55_OR_HIGHER@,," \
+ -e "s, at OO_SDK_JAVA_HOME@,$JAVA_HOME," \
+ -e "s, at OO_SDK_OUTPUT_DIR@,\$HOME," \
+ -e "s, at SDK_AUTO_DEPLOYMENT@,NO," \
+ $file.in > $file
+ chmod 755 $file
+ done
+#fix permissions
+ find examples -type f -exec chmod -x {} \;
+popd
+
+#add our custom configuration options
+#enable gtk file dialog as the default
+rm -rf $RPM_BUILD_ROOT/%{basisinstdir}/share/registry/modules/org/openoffice/Office/Common/Common-UseOOoFileDialogs.xcu
+#default autorecovery settings
+#system libtextcat fingerprint location
+#rhbz#484055 system autocorr location
+#rhbz#451512 set better math print options
+tar xzf %{SOURCE21} -C $RPM_BUILD_ROOT/%{basisinstdir}/share
+
+#add the debugging libsalalloc_malloc.so.3 library
+cp -f solver/%{OFFICEUPD}/unxlng*.pro/lib/libsalalloc_malloc.so.3 $RPM_BUILD_ROOT/%{ureinstdir}/lib
+chmod -x $RPM_BUILD_ROOT/%{basisinstdir}/program/testtoolrc
+chmod -x $RPM_BUILD_ROOT/%{basisinstdir}/program/hid.lst
+
+#remove spurious exec bits
+chmod -x $RPM_BUILD_ROOT/%{basisinstdir}/program/gengalrc
+
+#We don't need to carry around all the letter templates for all the languages
+#in each langpack! In addition, all the bitmaps are the same!
+pushd $RPM_BUILD_ROOT/%{basisinstdir}/share/template
+mkdir -p wizard
+for I in %{langpack_langs}; do
+ if [ -d $I/wizard/bitmap ]; then
+ cp -afl $I/wizard/bitmap wizard/
+ rm -rf $I/wizard/bitmap
+ ln -sf ../../wizard/bitmap $I/wizard/bitmap
+ fi
+
+ if [ -d $I/wizard/letter/$I ]; then
+ mv -f $I/wizard/letter/$I ${I}_wizard_letter_${I}
+ rm -rf $I/wizard/letter/*
+ mv -f ${I}_wizard_letter_${I} $I/wizard/letter/$I
+ else
+ rm -rf $I/wizard/letter/*
+ fi
+done
+popd
+
+#Set some aliases to canonical autocorrect language files for locales with matching languages
+pushd $RPM_BUILD_ROOT/%{basisinstdir}/share/autocorr
+
+# ooo#108049
+cp -p %{SOURCE24} acor_lt-LT.dat
+
+#en-ZA exists and has a good autocorrect file with two or three extras that make sense for South Africa
+en_GB_aliases="en-AG en-AU en-BS en-BW en-BZ en-CA en-DK en-GH en-HK en-IE en-IN en-JM en-NG en-NZ en-SG en-TT"
+for lang in $en_GB_aliases; do
+ ln -sf acor_en-GB.dat acor_$lang.dat
+done
+en_US_aliases="en-PH"
+for lang in $en_US_aliases; do
+ ln -sf acor_en-US.dat acor_$lang.dat
+done
+en_ZA_aliases="en-NA en-ZW"
+for lang in $en_ZA_aliases; do
+ ln -sf acor_en-ZA.dat acor_$lang.dat
+done
+%if %{langpacks}
+af_ZA_aliases="af-NA"
+for lang in $af_ZA_aliases; do
+ ln -sf acor_af-ZA.dat acor_$lang.dat
+done
+de_DE_aliases="de-AT de-BE de-CH de-LI de-LU"
+for lang in $de_DE_aliases; do
+ ln -sf acor_de-DE.dat acor_$lang.dat
+done
+es_ES_aliases="es-AR es-BO es-CL es-CO es-CR es-CU es-DO es-EC es-GT es-HN es-MX es-NI es-PA es-PE es-PR es-PY es-SV es-US es-UY es-VE"
+for lang in $es_ES_aliases; do
+ ln -sf acor_es-ES.dat acor_$lang.dat
+done
+fr_FR_aliases="fr-BE fr-CA fr-CH fr-LU fr-MC"
+for lang in $fr_FR_aliases; do
+ ln -sf acor_fr-FR.dat acor_$lang.dat
+done
+it_IT_aliases="it-CH"
+for lang in $it_IT_aliases; do
+ ln -sf acor_it-IT.dat acor_$lang.dat
+done
+nl_NL_aliases="nl-AW nl-BE"
+for lang in $nl_NL_aliases; do
+ ln -s acor_nl-NL.dat acor_$lang.dat
+done
+sv_SE_aliases="sv-FI"
+for lang in $sv_SE_aliases; do
+ ln -s acor_sv-SE.dat acor_$lang.dat
+done
+%else
+rm -f acor_[a-df-z]*.dat acor_e[su]*.dat
+%endif
+popd
+#rhbz#484055 make these shared across multiple applications
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}
+mv -f $RPM_BUILD_ROOT/%{basisinstdir}/share/autocorr $RPM_BUILD_ROOT/%{_datadir}/autocorr
+chmod 755 $RPM_BUILD_ROOT/%{_datadir}/autocorr
+
+%if %{langpacks}
+
+#auto generate the langpack file lists, format is...
+#langpack id, has help or not, autocorrection glob, script classification
+langpackdetails=\
+(\
+af help western ar help ctl \
+bg help western bn help western \
+ca help western cs help western \
+cy nohelp western da help western \
+de help western el help western \
+es help western et help western \
+eu help western fi help western \
+fr help western ga nohelp western \
+gl help western gu nohelp ctl \
+pa-IN help ctl he nohelp ctl \
+hi help ctl hu help western \
+hr nohelp western it help western \
+ja help cjk ko help cjk \
+lt help western ms nohelp western \
+nb help western nl help western \
+nn help western pl help western \
+pt help western pt-BR help western \
+ru help western sk help western \
+sl help western sr help western \
+sv help western ta help ctl \
+th help ctlseqcheck tr help western \
+zh-CN help cjk zh-TW help cjk \
+zu help western tn help western \
+ts help western as nohelp western \
+mr nohelp western ml nohelp western \
+or nohelp ctl te nohelp western \
+ur nohelp western kn nohelp western \
+xh help western ve help western \
+st help western ss help western \
+nr help western ns help western \
+dz help ctl uk help western \
+sh help western mai help western \
+ro nohelp western
+)
+
+tar xzf %{SOURCE22}
+
+i=0
+while [ $i -lt ${#langpackdetails[@]} ]; do
+ lang=${langpackdetails[$i]}
+ sed -e "s/LANG/$lang/g" langpacks/libreoffice.langpack-common.template > $lang.filelist
+ i=$[i+1]
+ help=${langpackdetails[$i]}
+ if [ "$help" = "help" ]; then
+ sed -e "s/LANG/$lang/g" langpacks/libreoffice.langpack-help.template >> $lang.filelist
+ fi
+ i=$[i+1]
+ type=${langpackdetails[$i]}
+ if [ "$type" = "cjk" ]; then
+ sed -e "s/LANG/$lang/g" langpacks/libreoffice.langpack-cjk.template >> $lang.filelist
+ fi
+ #rh217269 upstream made a decision to sequence check all ctl languages
+ #I think this is wrong, and only Thai should be sequence checked
+ if [ "$type" = "ctlseqcheck" ]; then
+ sed -e "s/LANG/$lang/g" langpacks/libreoffice.langpack-ctl.template >> $lang.filelist
+ fi
+ if [ "$type" = "ctl" ]; then
+ rm -f $RPM_BUILD_ROOT/%{basisinstdir}/share/registry/ctl_$lang.xcd
+ fi
+ i=$[i+1]
+done
+
+#rhbz#452379 clump serbian translations together
+cat sh.filelist >> sr.filelist
+
+%endif
+
+#remove it in case we didn't build with gcj
+rm -f $RPM_BUILD_ROOT/%{basisinstdir}/program/classes/sandbox.jar
+
+#remove pagein stuff
+rm -f $RPM_BUILD_ROOT/%{basisinstdir}/program/pagein*
+
+#remove dummy .dat files
+rm -f $RPM_BUILD_ROOT/%{basisinstdir}/program/root?.dat
+
+#set standard permissions for rpmlint
+find $RPM_BUILD_ROOT/%{baseinstdir} -exec chmod +w {} \;
+find $RPM_BUILD_ROOT/%{baseinstdir} -type d -exec chmod 0755 {} \;
+
+# move python bits into site-packages
+mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}
+pushd $RPM_BUILD_ROOT/%{python_sitearch}
+echo "import sys, os" > uno.py
+echo "sys.path.append('%{basisinstdir}/program')" >> uno.py
+echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{baseinstdir}/program/fundamentalrc')" >> uno.py
+cat $RPM_BUILD_ROOT/%{basisinstdir}/program/uno.py >> uno.py
+rm -f $RPM_BUILD_ROOT/%{basisinstdir}/program/uno.py*
+mv -f $RPM_BUILD_ROOT/%{basisinstdir}/program/unohelper.py* .
+popd
+
+# rhbz#477435 package opensymbol separately
+pushd $RPM_BUILD_ROOT/%{basisinstdir}/share/fonts/truetype
+install -d -m 0755 %{buildroot}%{_fontdir}
+install -p -m 0644 *.ttf %{buildroot}%{_fontdir}
+popd
+rm -rf $RPM_BUILD_ROOT/%{basisinstdir}/share/fonts
+
+#ensure that no sneaky un-prelinkable, un-fpic or non executable shared libs
+#have snuck through
+pic=0
+executable=0
+for foo in `find $RPM_BUILD_ROOT/%{instdir} -name "*" -exec file {} \;| grep ": ELF" | cut -d: -f 1` ; do
+ chmod +wx $foo
+ ls -asl $foo
+ result=`readelf -d $foo | grep TEXTREL` || true
+ if [ "$result" != "" ]; then
+ echo "TEXTREL Warning: $foo is b0rked (-fpic missing)"
+ pic=1
+ fi
+ result=`readelf -l $foo | grep GNU_STACK | grep RWE` || true
+ if [ "$result" != "" ]; then
+ echo "GNU_STACK Warning: $foo is b0rked (-noexecstack missing)"
+ executable=1
+ fi
+done
+if [ $pic == 1 ]; then false; fi
+if [ $executable == 1 ]; then false; fi
+
+#make up some /usr/bin scripts
+mkdir -p $RPM_BUILD_ROOT/%{_bindir}
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/ooffice
+echo exec libreoffice \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/ooffice
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/ooffice
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/ooviewdoc
+echo exec libreoffice -view \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/ooviewdoc
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/ooviewdoc
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oowriter
+echo exec libreoffice -writer \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oowriter
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oowriter
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oocalc
+echo exec libreoffice -calc \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oocalc
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oocalc
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/ooimpress
+echo exec libreoffice -impress \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/ooimpress
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/ooimpress
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oodraw
+echo exec libreoffice -draw \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oodraw
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oodraw
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oomath
+echo exec libreoffice -math \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oomath
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oomath
+
+echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oobase
+echo exec libreoffice -base \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oobase
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oobase
+
+cp -f %{SOURCE25} $RPM_BUILD_ROOT/%{_bindir}/unopkg
+sed -i -e "s/LAUNCHER/unopkg/g" $RPM_BUILD_ROOT/%{_bindir}/unopkg
+sed -i -e "s/BRAND/libreoffice/g" $RPM_BUILD_ROOT/%{_bindir}/unopkg
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/unopkg
+
+cp -f %{SOURCE25} $RPM_BUILD_ROOT/%{_bindir}/libreoffice
+sed -i -e "s/LAUNCHER/soffice/g" $RPM_BUILD_ROOT/%{_bindir}/libreoffice
+sed -i -e "s/BRAND/libreoffice/g" $RPM_BUILD_ROOT/%{_bindir}/libreoffice
+chmod a+x $RPM_BUILD_ROOT/%{_bindir}/libreoffice
+
+pushd $RPM_BUILD_ROOT/%{_bindir}
+# rhbz#499474 provide a /usr/bin/soffice for .recently-used.xbel
+ln -s %{baseinstdir}/program/soffice soffice
+# rhbz#499474 provide a /usr/bin/openoffice.org for backwards compat
+ln -s %{baseinstdir}/program/libreoffice openoffice.org
+popd
+
+pushd $RPM_BUILD_ROOT/%{baseinstdir}/share/xdg/
+chmod u+w *.desktop
+rm -rf printeradmin.desktop
+for file in *.desktop; do
+ # rhbz#156677 remove the version from Name=
+ sed -i -e "s/$PRODUCTVERSION //g" $file
+ # rhbz#156067 don't version the icons
+ sed -i -e "s/$PRODUCTVERSIONSHORT//g" $file
+ # add X-GIO-NoFuse so we get url:// instead of file://~.gvfs/
+ echo X-GIO-NoFuse=true >> $file
+done
+echo "StartupNotify=true" >> base.desktop
+echo "StartupNotify=true" >> calc.desktop
+echo "StartupNotify=true" >> impress.desktop
+echo "StartupNotify=true" >> writer.desktop
+echo "StartupNotify=true" >> math.desktop
+echo "StartupNotify=true" >> draw.desktop
+echo "TryExec=oobase" >> base.desktop
+echo "TryExec=oocalc" >> calc.desktop
+echo "TryExec=ooimpress" >> impress.desktop
+echo "TryExec=oowriter" >> writer.desktop
+echo "TryExec=oomath" >> math.desktop
+echo "TryExec=oodraw" >> draw.desktop
+# rhbz#156677# / rhbz#186515#
+echo "NoDisplay=true" >> math.desktop
+echo "NoDisplay=true" >> startcenter.desktop
+# rhbz#491159 temporarily remove NoDisplay=true from qstart.desktop
+sed -i -e "/NoDisplay=true/d" qstart.desktop
+# relocate the .desktop and icon files
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
+cp -p base.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-base.desktop
+cp -p calc.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-calc.desktop
+cp -p impress.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-impress.desktop
+cp -p writer.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-writer.desktop
+cp -p math.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-math.desktop
+cp -p draw.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-draw.desktop
+cp -p javafilter.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-javafilter.desktop
+cp -p startcenter.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-startcenter.desktop
+for desktop in *.desktop; do
+ desktop-file-validate $desktop
+done
+popd
+
+pushd sysui/output/usr/share/
+#get rid of the gnome icons and other unneeded files
+rm -rf icons/gnome applications application-registry
+# rhbz#156067 don't version the icons
+find . -name "*.desktop" -exec sed -i -e s/$PRODUCTVERSIONSHORT//g {} \;
+find . -name "*libreoffice$PRODUCTVERSIONSHORT*" -print \
+ | while read path; do
+ mv $path `echo $path | sed s/libreoffice$PRODUCTVERSIONSHORT/libreoffice/`
+ done
+find . -type l -print \
+ | while read path; do
+ target=`readlink $path`
+ new_target=`echo $target | sed -e s/$PRODUCTVERSIONSHORT//g`
+ if [ "$target" != "$new_target" ]; then
+ ln -sf $new_target $path
+ fi
+ done
+
+sed -i -e s/libreoffice$PRODUCTVERSIONSHORT/libreoffice/g \
+ ./mime-info/libreoffice.keys
+#relocate the rest of them
+cp -r icons $RPM_BUILD_ROOT/%{_datadir}
+cp -r mime-info $RPM_BUILD_ROOT/%{_datadir}
+#add our mime-types, e.g. for .oxt extensions
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mime/packages
+cp -p mime/packages/libreoffice.xml $RPM_BUILD_ROOT/%{_datadir}/mime/packages
+popd
+
+rm -rf $RPM_BUILD_ROOT/%{baseinstdir}/readmes
+rm -rf $RPM_BUILD_ROOT/%{baseinstdir}/licenses
+
+mkdir -p $RPM_BUILD_ROOT/%{basisinstdir}/share/psprint/driver
+cp -r psprint_config/configuration/ppds/SGENPRT.PS $RPM_BUILD_ROOT/%{basisinstdir}/share/psprint/driver/SGENPRT.PS
+
+# rhbz#452385 to auto have postgres in classpath if subsequently installed
+# rhbz#465664 to get lucene working for functional help
+sed -i -e "s#URE_MORE_JAVA_CLASSPATH_URLS.*#& file:///usr/share/java/lucene.jar file:///usr/share/java/lucene-contrib/lucene-analyzers.jar file:///usr/share/java/postgresql-jdbc.jar#" $RPM_BUILD_ROOT/%{basisinstdir}/program/fundamentalbasisrc
+
+%check
+source ./Linux*Env.Set.sh
+cd test
+build && deliver -link
+cd ../smoketestoo_native
+#JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY="1" works around flawed accessibility check
+#SAL_USE_VCLPLUGIN="svp" uses the headless plugin for these tests
+JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY="1" SAL_USE_VCLPLUGIN="svp" timeout -k 2m 2h build.pl
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{langpacks}
+%files langpack-af -f af.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ar -f ar.filelist
+%defattr(-,root,root,-)
+
+%files langpack-bg -f bg.filelist
+%defattr(-,root,root,-)
+
+%files langpack-bn -f bn.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ca -f ca.filelist
+%defattr(-,root,root,-)
+
+%files langpack-cs -f cs.filelist
+%defattr(-,root,root,-)
+
+%files langpack-cy -f cy.filelist
+%defattr(-,root,root,-)
+
+%files langpack-da -f da.filelist
+%defattr(-,root,root,-)
+
+%files langpack-de -f de.filelist
+%defattr(-,root,root,-)
+
+%files langpack-el -f el.filelist
+%defattr(-,root,root,-)
+
+%files langpack-en
+%defattr(-,root,root,-)
+
+%files langpack-es -f es.filelist
+%defattr(-,root,root,-)
+
+%files langpack-et -f et.filelist
+%defattr(-,root,root,-)
+
+%files langpack-eu -f eu.filelist
+%defattr(-,root,root,-)
+
+%files langpack-fi -f fi.filelist
+%defattr(-,root,root,-)
+
+%files langpack-fr -f fr.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ga -f ga.filelist
+%defattr(-,root,root,-)
+
+%files langpack-gl -f gl.filelist
+%defattr(-,root,root,-)
+
+%files langpack-gu -f gu.filelist
+%defattr(-,root,root,-)
+
+%files langpack-pa -f pa-IN.filelist
+%defattr(-,root,root,-)
+
+%files langpack-he -f he.filelist
+%defattr(-,root,root,-)
+
+%files langpack-hi -f hi.filelist
+%defattr(-,root,root,-)
+
+%files langpack-hu -f hu.filelist
+%defattr(-,root,root,-)
+
+%files langpack-hr -f hr.filelist
+%defattr(-,root,root,-)
+
+%files langpack-it -f it.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ja -f ja.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ko -f ko.filelist
+%defattr(-,root,root,-)
+%{baseinstdir}/share/registry/korea.xcd
+
+%files langpack-lt -f lt.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ms -f ms.filelist
+%defattr(-,root,root,-)
+
+%files langpack-nb -f nb.filelist
+%defattr(-,root,root,-)
+
+%files langpack-nl -f nl.filelist
+%defattr(-,root,root,-)
+
+%files langpack-nn -f nn.filelist
+%defattr(-,root,root,-)
+
+%files langpack-pl -f pl.filelist
+%defattr(-,root,root,-)
+
+%files langpack-pt-PT -f pt.filelist
+%defattr(-,root,root,-)
+
+%files langpack-pt-BR -f pt-BR.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ru -f ru.filelist
+%defattr(-,root,root,-)
+
+%files langpack-sk -f sk.filelist
+%defattr(-,root,root,-)
+
+%files langpack-sl -f sl.filelist
+%defattr(-,root,root,-)
+
+%files langpack-sr -f sr.filelist
+%defattr(-,root,root,-)
+
+%files langpack-sv -f sv.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ta -f ta.filelist
+%defattr(-,root,root,-)
+
+%files langpack-th -f th.filelist
+%defattr(-,root,root,-)
+
+%files langpack-tr -f tr.filelist
+%defattr(-,root,root,-)
+
+%files langpack-zh-Hans -f zh-CN.filelist
+%defattr(-,root,root,-)
+
+%files langpack-zh-Hant -f zh-TW.filelist
+%defattr(-,root,root,-)
+
+%files langpack-zu -f zu.filelist
+%defattr(-,root,root,-)
+
+%files langpack-tn -f tn.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ts -f ts.filelist
+%defattr(-,root,root,-)
+
+%files langpack-nso -f ns.filelist
+%defattr(-,root,root,-)
+
+%files langpack-nr -f nr.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ss -f ss.filelist
+%defattr(-,root,root,-)
+
+%files langpack-st -f st.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ve -f ve.filelist
+%defattr(-,root,root,-)
+
+%files langpack-xh -f xh.filelist
+%defattr(-,root,root,-)
+
+%files langpack-as -f as.filelist
+%defattr(-,root,root,-)
+
+%files langpack-mr -f mr.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ml -f ml.filelist
+%defattr(-,root,root,-)
+
+%files langpack-or -f or.filelist
+%defattr(-,root,root,-)
+
+%files langpack-te -f te.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ur -f ur.filelist
+%defattr(-,root,root,-)
+
+%files langpack-kn -f kn.filelist
+%defattr(-,root,root,-)
+
+%files langpack-dz -f dz.filelist
+%defattr(-,root,root,-)
+
+%files langpack-uk -f uk.filelist
+%defattr(-,root,root,-)
+
+%files langpack-mai -f mai.filelist
+%defattr(-,root,root,-)
+
+%files langpack-ro -f ro.filelist
+%defattr(-,root,root,-)
+%endif
+
+%files core
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/help
+%docdir %{basisinstdir}/help/en
+%dir %{basisinstdir}/help/en
+%{basisinstdir}/help/en/default.css
+%{basisinstdir}/help/en/err.html
+%{basisinstdir}/help/en/highcontrast1.css
+%{basisinstdir}/help/en/highcontrast2.css
+%{basisinstdir}/help/en/highcontrastblack.css
+%{basisinstdir}/help/en/highcontrastwhite.css
+%{basisinstdir}/help/en/sbasic.*
+%{basisinstdir}/help/en/schart.*
+%{basisinstdir}/help/en/shared.*
+%{basisinstdir}/help/idxcaption.xsl
+%{basisinstdir}/help/idxcontent.xsl
+%{basisinstdir}/help/main_transform.xsl
+%{basisinstdir}/presets
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/addin
+%{basisinstdir}/program/basprov%{SOPOST}.uno.so
+%{basisinstdir}/program/canvasfactory.uno.so
+%{basisinstdir}/program/cde-open-url
+%dir %{basisinstdir}/program/classes
+%{basisinstdir}/program/classes/agenda.jar
+%{basisinstdir}/program/classes/commonwizards.jar
+%{basisinstdir}/program/classes/fax.jar
+%{basisinstdir}/program/classes/form.jar
+%{basisinstdir}/program/classes/query.jar
+%{basisinstdir}/program/classes/letter.jar
+%{basisinstdir}/program/classes/LuceneHelpWrapper.jar
+%{basisinstdir}/program/classes/officebean.jar
+%{basisinstdir}/program/classes/report.jar
+%{basisinstdir}/program/classes/saxon9.jar
+%{basisinstdir}/program/classes/ScriptFramework.jar
+%{basisinstdir}/program/classes/ScriptProviderForJava.jar
+%{basisinstdir}/program/classes/table.jar
+%{basisinstdir}/program/classes/unoil.jar
+%{basisinstdir}/program/classes/web.jar
+%{basisinstdir}/program/classes/XMergeBridge.jar
+%{basisinstdir}/program/classes/xmerge.jar
+%{basisinstdir}/program/classes/XSLTFilter.jar
+%{basisinstdir}/program/classes/XSLTValidate.jar
+%{basisinstdir}/program/cmdmail.uno.so
+%{basisinstdir}/program/deployment%{SOPOST}.uno.so
+%{basisinstdir}/program/deploymentgui%{SOPOST}.uno.so
+%{basisinstdir}/program/dlgprov%{SOPOST}.uno.so
+%{basisinstdir}/program/fastsax.uno.so
+%{basisinstdir}/program/fpicker.uno.so
+%{basisinstdir}/program/fps_gnome.uno.so
+%{basisinstdir}/program/fps_office.uno.so
+%{basisinstdir}/program/fundamentalbasisrc
+%{basisinstdir}/program/gengal*
+%{basisinstdir}/program/gnome-open-url
+%{basisinstdir}/program/gnome-open-url.bin
+%{basisinstdir}/program/hatchwindowfactory.uno.so
+%{basisinstdir}/program/i18nsearch.uno.so
+%{basisinstdir}/program/kde-open-url
+%{basisinstdir}/program/legacy_binfilters.rdb
+%{basisinstdir}/program/libacc%{SOPOST}.so
+%{basisinstdir}/program/libadabas%{SOPOST}.so
+%{basisinstdir}/program/libavmedia*.so
+%{basisinstdir}/program/libbasctl%{SOPOST}.so
+%{basisinstdir}/program/libbf_sb%{SOPOST}.so
+%{basisinstdir}/program/libbf_frm%{SOPOST}.so
+%{basisinstdir}/program/libbf_go%{SOPOST}.so
+%{basisinstdir}/program/libbf_migratefilter%{SOPOST}.so
+%{basisinstdir}/program/libbf_ofa%{SOPOST}.so
+%{basisinstdir}/program/libbf_sch%{SOPOST}.so
+%{basisinstdir}/program/libbf_sd%{SOPOST}.so
+%{basisinstdir}/program/libbf_so%{SOPOST}.so
+%{basisinstdir}/program/libbf_svt%{SOPOST}.so
+%{basisinstdir}/program/libbf_svx%{SOPOST}.so
+%{basisinstdir}/program/libbf_wrapper%{SOPOST}.so
+%{basisinstdir}/program/libbf_xo%{SOPOST}.so
+%{basisinstdir}/program/libbib%{SOPOST}.so
+%{basisinstdir}/program/libbindet%{SOPOST}.so
+%{basisinstdir}/program/libcached1.so
+%{basisinstdir}/program/libcanvastools%{SOPOST}.so
+%{basisinstdir}/program/libchart*%{SOPOST}.so
+%{basisinstdir}/program/libcollator_data.so
+%{basisinstdir}/program/libcppcanvas%{SOPOST}.so
+%{basisinstdir}/program/libctl%{SOPOST}.so
+%{basisinstdir}/program/libcui%{SOPOST}.so
+%{basisinstdir}/program/libdba%{SOPOST}.so
+%{basisinstdir}/program/libdbacfg%{SOPOST}.so
+%{basisinstdir}/program/libdbase%{SOPOST}.so
+%{basisinstdir}/program/libdbaxml%{SOPOST}.so
+%{basisinstdir}/program/libdbmm%{SOPOST}.so
+%{basisinstdir}/program/libdbpool2.so
+%{basisinstdir}/program/libdbtools%{SOPOST}.so
+%{basisinstdir}/program/libdbu%{SOPOST}.so
+%{basisinstdir}/program/libdeploymentmisc%{SOPOST}.so
+%{basisinstdir}/program/libdesktop_detector%{SOPOST}.so
+%{basisinstdir}/program/libdict_ja.so
+%{basisinstdir}/program/libdict_zh.so
+%{basisinstdir}/program/libdrawinglayer%{SOPOST}.so
+%{basisinstdir}/program/libediteng%{SOPOST}.so
+%{basisinstdir}/program/libeggtray%{SOPOST}.so
+%{basisinstdir}/program/libembobj.so
+%{basisinstdir}/program/libemboleobj.so
+%{basisinstdir}/program/libevoab*.so
+%{basisinstdir}/program/libevtatt.so
+%{basisinstdir}/program/libegi%{SOPOST}.so
+%{basisinstdir}/program/libeme%{SOPOST}.so
+%{basisinstdir}/program/libepb%{SOPOST}.so
+%{basisinstdir}/program/libepg%{SOPOST}.so
+%{basisinstdir}/program/libepp%{SOPOST}.so
+%{basisinstdir}/program/libeps%{SOPOST}.so
+%{basisinstdir}/program/libept%{SOPOST}.so
+%{basisinstdir}/program/libera%{SOPOST}.so
+%{basisinstdir}/program/libeti%{SOPOST}.so
+%{basisinstdir}/program/libexp%{SOPOST}.so
+%{basisinstdir}/program/libicd%{SOPOST}.so
+%{basisinstdir}/program/libicg%{SOPOST}.so
+%{basisinstdir}/program/libidx%{SOPOST}.so
+%{basisinstdir}/program/libime%{SOPOST}.so
+%{basisinstdir}/program/libindex_data.so
+%{basisinstdir}/program/libipb%{SOPOST}.so
+%{basisinstdir}/program/libipd%{SOPOST}.so
+%{basisinstdir}/program/libips%{SOPOST}.so
+%{basisinstdir}/program/libipt%{SOPOST}.so
+%{basisinstdir}/program/libipx%{SOPOST}.so
+%{basisinstdir}/program/libira%{SOPOST}.so
+%{basisinstdir}/program/libitg%{SOPOST}.so
+%{basisinstdir}/program/libiti%{SOPOST}.so
+%{basisinstdir}/program/libofficebean.so
+%{basisinstdir}/program/liboooimprovecore%{SOPOST}.so
+%{basisinstdir}/program/libfile%{SOPOST}.so
+%{basisinstdir}/program/libfilterconfig1.so
+%{basisinstdir}/program/libflat%{SOPOST}.so
+%{basisinstdir}/program/libfrm%{SOPOST}.so
+%{basisinstdir}/program/libguesslang%{SOPOST}.so
+%{basisinstdir}/program/libhelplinker%{SOPOST}.so
+%{basisinstdir}/program/libhyphen%{SOPOST}.so
+%{basisinstdir}/program/libi18nregexpgcc3.so
+%{basisinstdir}/program/libjdbc%{SOPOST}.so
+%{basisinstdir}/program/liblegacy_binfilters%{SOPOST}.so
+%{basisinstdir}/program/liblng%{SOPOST}.so
+%{basisinstdir}/program/liblog%{SOPOST}.so
+%{basisinstdir}/program/liblocaledata_en.so
+%{basisinstdir}/program/liblocaledata_es.so
+%{basisinstdir}/program/liblocaledata_euro.so
+%{basisinstdir}/program/liblocaledata_others.so
+%{basisinstdir}/program/libmcnttype.so
+%{basisinstdir}/program/libmozbootstrap.so
+%{basisinstdir}/program/libmsfilter%{SOPOST}.so
+%{basisinstdir}/program/libmsforms%{SOPOST}.uno.so
+%{basisinstdir}/program/libmtfrenderer.uno.so
+%{basisinstdir}/program/libmysql%{SOPOST}.so
+%{basisinstdir}/program/libodbc%{SOPOST}.so
+%{basisinstdir}/program/libodbcbase%{SOPOST}.so
+%{basisinstdir}/program/liboffacc%{SOPOST}.so
+%{basisinstdir}/program/liboox%{SOPOST}.so
+%{basisinstdir}/program/libpcr%{SOPOST}.so
+%{basisinstdir}/program/libpdffilter%{SOPOST}.so
+%{basisinstdir}/program/libpl%{SOPOST}.so
+%{basisinstdir}/program/libpreload%{SOPOST}.so
+%{basisinstdir}/program/libprotocolhandler%{SOPOST}.so
+%{basisinstdir}/program/libqstart_gtk%{SOPOST}.so
+%{basisinstdir}/program/librecentfile.so
+%{basisinstdir}/program/libres%{SOPOST}.so
+%{basisinstdir}/program/libsax%{SOPOST}.so
+%{basisinstdir}/program/libscn%{SOPOST}.so
+%{basisinstdir}/program/libscriptframe.so
+%{basisinstdir}/program/libsd%{SOPOST}.so
+%{basisinstdir}/program/libsdfilt%{SOPOST}.so
+%{basisinstdir}/program/libsdbc2.so
+%{basisinstdir}/program/libsdbt%{SOPOST}so
+%{basisinstdir}/program/libsdd%{SOPOST}.so
+%{basisinstdir}/program/libsdui%{SOPOST}.so
+%{basisinstdir}/program/libspa%{SOPOST}.so
+%{basisinstdir}/program/libspell%{SOPOST}.so
+%{basisinstdir}/program/libsrtrs1.so
+%{basisinstdir}/program/libsts%{SOPOST}.so
+%{basisinstdir}/program/libsvx%{SOPOST}.so
+%{basisinstdir}/program/libsvxcore%{SOPOST}.so
+%{basisinstdir}/program/libsw%{SOPOST}.so
+%{basisinstdir}/program/libtextconv_dict.so
+%{basisinstdir}/program/libtextconversiondlgs%{SOPOST}.so
+%{basisinstdir}/program/libtvhlp1.so
+%{basisinstdir}/program/libucbhelper4gcc3.so
+%{basisinstdir}/program/libucpchelp1.so
+%{basisinstdir}/program/libucpdav1.so
+%{basisinstdir}/program/libucpftp1.so
+%{basisinstdir}/program/libucphier1.so
+%{basisinstdir}/program/libucppkg1.so
+%{basisinstdir}/program/libunordf%{SOPOST}.so
+%{basisinstdir}/program/libunopkgapp.so
+%{basisinstdir}/program/libunoxml%{SOPOST}.so
+%{basisinstdir}/program/libupdchk%{SOPOST}.so
+%{basisinstdir}/program/libuui%{SOPOST}.so
+%{basisinstdir}/program/libvbahelper%{SOPOST}.so
+%{basisinstdir}/program/libvclplug_gen%{SOPOST}.so
+%{basisinstdir}/program/libvclplug_gtk%{SOPOST}.so
+%{basisinstdir}/program/libwpgimport%{SOPOST}.so
+%{basisinstdir}/program/libxmlfa%{SOPOST}.so
+%{basisinstdir}/program/libxmlfd%{SOPOST}.so
+%{basisinstdir}/program/libxmx%{SOPOST}.so
+%{basisinstdir}/program/libxof%{SOPOST}.so
+%{basisinstdir}/program/libxsec_fw.so
+%{basisinstdir}/program/libxsec_xmlsec.so
+%{basisinstdir}/program/libxsltdlg%{SOPOST}.so
+%{basisinstdir}/program/libxsltfilter%{SOPOST}.so
+%{basisinstdir}/program/libxstor.so
+%{basisinstdir}/program/migrationoo2.uno.so
+%{basisinstdir}/program/nsplugin
+%{basisinstdir}/program/open-url
+%{basisinstdir}/program/offapi.rdb
+%{basisinstdir}/program/passwordcontainer.uno.so
+%{basisinstdir}/program/plugin
+%{basisinstdir}/program/pluginapp.bin
+%{basisinstdir}/program/productregistration.uno.so
+%dir %{basisinstdir}/program/resource
+%{basisinstdir}/program/resource/avmediaen-US.res
+%{basisinstdir}/program/resource/accen-US.res
+%{basisinstdir}/program/resource/basctlen-US.res
+%{basisinstdir}/program/resource/bf_frmen-US.res
+%{basisinstdir}/program/resource/bf_ofaen-US.res
+%{basisinstdir}/program/resource/bf_schen-US.res
+%{basisinstdir}/program/resource/bf_sden-US.res
+%{basisinstdir}/program/resource/bf_svten-US.res
+%{basisinstdir}/program/resource/bf_svxen-US.res
+%{basisinstdir}/program/resource/biben-US.res
+%{basisinstdir}/program/resource/calen-US.res
+%{basisinstdir}/program/resource/chartcontrolleren-US.res
+%{basisinstdir}/program/resource/cuien-US.res
+%{basisinstdir}/program/resource/dbaen-US.res
+%{basisinstdir}/program/resource/dbmmen-US.res
+%{basisinstdir}/program/resource/dbuen-US.res
+%{basisinstdir}/program/resource/dbwen-US.res
+%{basisinstdir}/program/resource/deploymenten-US.res
+%{basisinstdir}/program/resource/deploymentguien-US.res
+%{basisinstdir}/program/resource/dkten-US.res
+%{basisinstdir}/program/resource/editengen-US.res
+%{basisinstdir}/program/resource/egien-US.res
+%{basisinstdir}/program/resource/emeen-US.res
+%{basisinstdir}/program/resource/epben-US.res
+%{basisinstdir}/program/resource/epgen-US.res
+%{basisinstdir}/program/resource/eppen-US.res
+%{basisinstdir}/program/resource/epsen-US.res
+%{basisinstdir}/program/resource/epten-US.res
+%{basisinstdir}/program/resource/euren-US.res
+%{basisinstdir}/program/resource/fps_officeen-US.res
+%{basisinstdir}/program/resource/frmen-US.res
+%{basisinstdir}/program/resource/fween-US.res
+%{basisinstdir}/program/resource/galen-US.res
+%{basisinstdir}/program/resource/impen-US.res
+%{basisinstdir}/program/resource/ofaen-US.res
+%{basisinstdir}/program/resource/pcren-US.res
+%{basisinstdir}/program/resource/pdffilteren-US.res
+%{basisinstdir}/program/resource/preloaden-US.res
+%{basisinstdir}/program/resource/productregistrationen-US.res
+%{basisinstdir}/program/resource/sanen-US.res
+%{basisinstdir}/program/resource/sben-US.res
+%{basisinstdir}/program/resource/sden-US.res
+%{basisinstdir}/program/resource/sfxen-US.res
+%{basisinstdir}/program/resource/spaen-US.res
+%{basisinstdir}/program/resource/sdbten-US.res
+%{basisinstdir}/program/resource/svsen-US.res
+%{basisinstdir}/program/resource/svten-US.res
+%{basisinstdir}/program/resource/svxen-US.res
+%{basisinstdir}/program/resource/swen-US.res
+%{basisinstdir}/program/resource/textconversiondlgsen-US.res
+%{basisinstdir}/program/resource/tken-US.res
+%{basisinstdir}/program/resource/tplen-US.res
+%{basisinstdir}/program/resource/uuien-US.res
+%{basisinstdir}/program/resource/updchken-US.res
+%{basisinstdir}/program/resource/upden-US.res
+%{basisinstdir}/program/resource/vclen-US.res
+%{basisinstdir}/program/resource/wzien-US.res
+%{basisinstdir}/program/resource/xmlsecen-US.res
+%{basisinstdir}/program/resource/xsltdlgen-US.res
+%{basisinstdir}/program/sax.uno.so
+%{basisinstdir}/program/senddoc
+%{basisinstdir}/program/services.rdb
+%{basisinstdir}/program/simplecanvas.uno.so
+%{basisinstdir}/program/slideshow.uno.so
+%{basisinstdir}/program/libsofficeapp.so
+%{basisinstdir}/program/spadmin.bin
+%{basisinstdir}/program/stringresource%{SOPOST}.uno.so
+%{basisinstdir}/program/syssh.uno.so
+%{basisinstdir}/program/ucpexpand1.uno.so
+%{basisinstdir}/program/ucpext.uno.so
+%{basisinstdir}/program/ucptdoc1.uno.so
+%{basisinstdir}/program/unorc
+%{basisinstdir}/program/updatefeed.uno.so
+%{basisinstdir}/ure-link
+%{basisinstdir}/program/uri-encode
+%{basisinstdir}/program/vbaevents%{SOPOST}.uno.so
+%{basisinstdir}/program/vclcanvas.uno.so
+%{basisinstdir}/program/versionrc
+%{basisinstdir}/program/cairocanvas.uno.so
+%dir %{basisinstdir}/share
+%dir %{basisinstdir}/share/Scripts
+%{basisinstdir}/share/Scripts/java
+%{basisinstdir}/share/autotext
+%{basisinstdir}/share/basic
+%dir %{basisinstdir}/share/config
+%{basisinstdir}/share/config/images.zip
+%{basisinstdir}/share/config/images_classic.zip
+%{basisinstdir}/share/config/images_crystal.zip
+%{basisinstdir}/share/config/images_hicontrast.zip
+%{basisinstdir}/share/config/images_oxygen.zip
+%{basisinstdir}/share/config/images_tango.zip
+%{basisinstdir}/share/config/javasettingsunopkginstall.xml
+%{basisinstdir}/share/config/psetup.xpm
+%{basisinstdir}/share/config/psetupl.xpm
+%dir %{basisinstdir}/share/config/soffice.cfg
+%{basisinstdir}/share/config/soffice.cfg/modules
+%{basisinstdir}/share/config/symbol
+%{basisinstdir}/share/config/webcast
+%{basisinstdir}/share/config/wizard
+%dir %{basisinstdir}/share/dtd
+%{basisinstdir}/share/dtd/officedocument
+%{basisinstdir}/share/gallery
+%dir %{basisinstdir}/share/psprint
+%config %{basisinstdir}/share/psprint/psprint.conf
+%{basisinstdir}/share/psprint/driver
+%dir %{basisinstdir}/share/registry
+%{basisinstdir}/share/registry/binfilter.xcd
+%{basisinstdir}/share/registry/gnome.xcd
+%{basisinstdir}/share/registry/lingucomponent.xcd
+%{basisinstdir}/share/registry/main.xcd
+%{basisinstdir}/share/registry/oo-ad-ldap.xcd.sample
+%{basisinstdir}/share/registry/oo-ldap.xcd.sample
+%{basisinstdir}/share/registry/Langpack-en-US.xcd
+%dir %{basisinstdir}/share/registry/modules
+%dir %{basisinstdir}/share/registry/modules/org
+%dir %{basisinstdir}/share/registry/modules/org/openoffice
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office/Paths
+%{basisinstdir}/share/registry/modules/org/openoffice/Office/Paths/SystemAutoCorrect.xcu
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office/Recovery
+%{basisinstdir}/share/registry/modules/org/openoffice/Office/Recovery/AutoSaveRecovery.xcu
+%dir %{basisinstdir}/share/registry/res
+%{basisinstdir}/share/registry/res/fcfg_langpack_en-US.xcd
+%dir %{basisinstdir}/share/samples
+%{basisinstdir}/share/samples/en-US
+%dir %{basisinstdir}/share/template
+%{basisinstdir}/share/template/en-US
+%{basisinstdir}/share/template/wizard
+%dir %{basisinstdir}/share/wordbook
+%{basisinstdir}/share/wordbook/en-US
+%dir %{basisinstdir}/share/xslt
+%{basisinstdir}/share/xslt/common
+%dir %{basisinstdir}/share/xslt/export
+%{basisinstdir}/share/xslt/export/common
+%{basisinstdir}/share/xslt/export/spreadsheetml
+%{basisinstdir}/share/xslt/export/wordml
+%dir %{basisinstdir}/share/xslt/import
+%{basisinstdir}/share/xslt/import/common
+%{basisinstdir}/share/xslt/import/spreadsheetml
+%{basisinstdir}/share/xslt/import/wordml
+%{basisinstdir}/program/liblnth%{SOPOST}.so
+%{_bindir}/unopkg
+#icons and mime
+%{_datadir}/icons/*/*/*/gnome*
+%{_datadir}/icons/*/*/*/libreoffice*
+%{_datadir}/mime-info/libreoffice.*
+%{basisinstdir}/program/libxmlsecurity.so
+%{_datadir}/mime/packages/libreoffice.xml
+%{basisinstdir}/program/configmgr.uno.so
+%{basisinstdir}/program/desktopbe1.uno.so
+%{basisinstdir}/program/fsstorage.uno.so
+%{basisinstdir}/program/gconfbe1.uno.so
+%{basisinstdir}/program/i18npool.uno.so
+%{basisinstdir}/program/libbasegfx%{SOPOST}.so
+%{basisinstdir}/program/libcomphelp4gcc3.so
+%{basisinstdir}/program/libfileacc.so
+%{basisinstdir}/program/libfwe%{SOPOST}.so
+%{basisinstdir}/program/libfwi%{SOPOST}.so
+%{basisinstdir}/program/libfwk%{SOPOST}.so
+%{basisinstdir}/program/libfwl%{SOPOST}.so
+%{basisinstdir}/program/libfwm%{SOPOST}.so
+%{basisinstdir}/program/libi18nisolang*.so
+%{basisinstdir}/program/libi18npaper*.so
+%{basisinstdir}/program/libi18nutilgcc3.so
+%{basisinstdir}/program/libpackage2.so
+%{basisinstdir}/program/libsb%{SOPOST}.so
+%{basisinstdir}/program/libsfx%{SOPOST}.so
+%{basisinstdir}/program/libsot%{SOPOST}.so
+%{basisinstdir}/program/libspl%{SOPOST}.so
+%{basisinstdir}/program/libsvl%{SOPOST}.so
+%{basisinstdir}/program/libsvt%{SOPOST}.so
+%{basisinstdir}/program/libtk%{SOPOST}.so
+%{basisinstdir}/program/libtl%{SOPOST}.so
+%{basisinstdir}/program/libucb1.so
+%{basisinstdir}/program/libucpfile1.so
+%{basisinstdir}/program/libutl%{SOPOST}.so
+%{basisinstdir}/program/libvcl%{SOPOST}.so
+%{basisinstdir}/program/libvos3gcc3.so
+%{basisinstdir}/program/libxcr%{SOPOST}.so
+%{basisinstdir}/program/libxo%{SOPOST}.so
+%{basisinstdir}/program/localebe1.uno.so
+%{basisinstdir}/program/ucpgio1.uno.so
+%{basisinstdir}/program/oovbaapi.rdb
+#share unopkg
+%dir %{baseinstdir}
+%{baseinstdir}/basis-link
+%dir %{baseinstdir}/share
+%dir %{baseinstdir}/share/extensions
+%{baseinstdir}/share/extensions/package.txt
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/unopkg
+%{baseinstdir}/program/unopkg.bin
+%{baseinstdir}/program/bootstraprc
+%{baseinstdir}/program/fundamentalrc
+%{baseinstdir}/program/setuprc
+%{baseinstdir}/program/versionrc
+%doc %{baseinstdir}/LICENSE
+%doc %{baseinstdir}/LICENSE.html
+%doc %{baseinstdir}/LICENSE.odt
+%doc %{baseinstdir}/README
+%doc %{baseinstdir}/README.html
+%doc %{baseinstdir}/THIRDPARTYLICENSEREADME.html
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/about.*
+%{baseinstdir}/program/intro.*
+%dir %{baseinstdir}/program/resource
+%{baseinstdir}/program/resource/oooen-US.res
+%{baseinstdir}/program/soffice
+%{baseinstdir}/program/soffice.bin
+%{baseinstdir}/program/sofficerc
+%{baseinstdir}/program/spadmin
+%{baseinstdir}/program/unoinfo
+%{baseinstdir}/program/libnpsoplugin.so
+%dir %{baseinstdir}/share
+%dir %{baseinstdir}/share/config
+%{baseinstdir}/share/config/images_brand.zip
+%docdir %{baseinstdir}/share/readme
+%dir %{baseinstdir}/share/readme
+%{baseinstdir}/share/readme/LICENSE_en-US
+%{baseinstdir}/share/readme/LICENSE_en-US.html
+%{baseinstdir}/share/readme/README_en-US
+%{baseinstdir}/share/readme/README_en-US.html
+%dir %{baseinstdir}/share/registry
+%{baseinstdir}/share/registry/brand.xcd
+%{baseinstdir}/share/xdg/
+%{baseinstdir}/program/redirectrc
+%{_datadir}/applications/libreoffice-startcenter.desktop
+#launchers
+%{_bindir}/libreoffice
+%{_bindir}/openoffice.org
+%{_bindir}/soffice
+%{_bindir}/ooffice
+%{_bindir}/ooviewdoc
+
+%post core
+update-mime-database %{_datadir}/mime &> /dev/null || :
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ for theme in hicolor locolor; do
+ if test -d "%{_datadir}/icons/$theme"; then
+ if test -f "%{_datadir}/icons/$theme/index.theme"; then
+ touch --no-create %{_datadir}/icons/$theme
+ gtk-update-icon-cache -q %{_datadir}/icons/$theme
+ fi
+ fi
+ done
+fi
+
+%postun core
+update-mime-database %{_datadir}/mime &> /dev/null || :
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ for theme in hicolor locolor; do
+ if test -d "%{_datadir}/icons/$theme"; then
+ if test -f "%{_datadir}/icons/$theme/index.theme"; then
+ touch --no-create %{_datadir}/icons/$theme
+ gtk-update-icon-cache -q %{_datadir}/icons/$theme
+ fi
+ fi
+ done
+fi
+
+%files base
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%{basisinstdir}/help/en/sdatabase.*
+%dir %{basisinstdir}/program
+%dir %{basisinstdir}/program/classes
+%{basisinstdir}/program/classes/sdbc_hsqldb.jar
+%{basisinstdir}/program/libabp%{SOPOST}.so
+%{basisinstdir}/program/libadabasui%{SOPOST}.so
+%{basisinstdir}/program/libdbp%{SOPOST}.so
+%{basisinstdir}/program/libhsqldb.so
+%{basisinstdir}/program/librpt*%{SOPOST}.so
+%dir %{basisinstdir}/program/resource
+%{basisinstdir}/program/resource/abpen-US.res
+%{basisinstdir}/program/resource/adabasuien-US.res
+%{basisinstdir}/program/resource/cnren-US.res
+%{basisinstdir}/program/resource/dbpen-US.res
+%{basisinstdir}/program/resource/rpten-US.res
+%{basisinstdir}/program/resource/rptuien-US.res
+%{basisinstdir}/program/resource/sdbclen-US.res
+%{basisinstdir}/program/resource/sdberren-US.res
+%{basisinstdir}/share/registry/base.xcd
+%dir %{baseinstdir}
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/sbase
+%{_datadir}/applications/libreoffice-base.desktop
+%{_bindir}/oobase
+
+%post base
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun base
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%files report-builder
+%defattr(-,root,root,-)
+%docdir %{baseinstdir}/share/extensions/report-builder/help
+%{baseinstdir}/share/extensions/report-builder
+
+%files bsh
+%defattr(-,root,root,-)
+%{basisinstdir}/share/Scripts/beanshell
+%{baseinstdir}/share/extensions/ScriptProviderForBeanShell.oxt
+
+%files rhino
+%defattr(-,root,root,-)
+%{basisinstdir}/program/classes/js.jar
+%{basisinstdir}/share/Scripts/javascript
+%{baseinstdir}/share/extensions/ScriptProviderForJavaScript.oxt
+
+%files wiki-publisher
+%defattr(-,root,root,-)
+%docdir %{baseinstdir}/share/extensions/wiki-publisher/license
+%{baseinstdir}/share/extensions/wiki-publisher
+
+%files ogltrans
+%defattr(-,root,root,-)
+%dir %{baseinstdir}
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/OGLTrans.uno.so
+%dir %{basisinstdir}/share/config
+%dir %{basisinstdir}/share/config/soffice.cfg
+%dir %{basisinstdir}/share/config/soffice.cfg/simpress
+%{basisinstdir}/share/config/soffice.cfg/simpress/transitions-ogl.xml
+%{basisinstdir}/share/registry/ogltrans.xcd
+
+%files presentation-minimizer
+%defattr(-,root,root,-)
+%docdir %{baseinstdir}/share/extensions/presentation-minimizer/help
+%{baseinstdir}/share/extensions/presentation-minimizer
+
+%files presenter-screen
+%defattr(-,root,root,-)
+%docdir %{baseinstdir}/share/extensions/presenter-screen/help
+%{baseinstdir}/share/extensions/presenter-screen
+
+%files pdfimport
+%defattr(-,root,root,-)
+%docdir %{baseinstdir}/share/extensions/pdfimport/help
+%{baseinstdir}/share/extensions/pdfimport
+
+%_font_pkg -n %{fontname} opens___.ttf
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_fontdir}
+
+%files calc
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%{basisinstdir}/help/en/scalc.*
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libanalysis%{SOPOST}.so
+%{basisinstdir}/program/libbf_sc%{SOPOST}.so
+%{basisinstdir}/program/libcalc%{SOPOST}.so
+%{basisinstdir}/program/libdate%{SOPOST}.so
+%{basisinstdir}/program/libfor%{SOPOST}.so
+%{basisinstdir}/program/libforui%{SOPOST}.so
+%{basisinstdir}/program/libsc%{SOPOST}.so
+%{basisinstdir}/program/libscd%{SOPOST}.so
+%{basisinstdir}/program/libscfilt%{SOPOST}.so
+%{basisinstdir}/program/libscui%{SOPOST}.so
+%{basisinstdir}/program/libsolver%{SOPOST}.so
+%dir %{basisinstdir}/program/resource
+%{basisinstdir}/program/resource/analysisen-US.res
+%{basisinstdir}/program/resource/bf_scen-US.res
+%{basisinstdir}/program/resource/dateen-US.res
+%{basisinstdir}/program/resource/foren-US.res
+%{basisinstdir}/program/resource/foruien-US.res
+%{basisinstdir}/program/resource/scen-US.res
+%{basisinstdir}/program/resource/solveren-US.res
+%{basisinstdir}/program/libvbaobj%{SOPOST}.uno.so
+%{basisinstdir}/share/registry/calc.xcd
+%dir %{baseinstdir}
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/scalc
+%{baseinstdir}/program/scalc.bin
+%{_datadir}/applications/libreoffice-calc.desktop
+%{_bindir}/oocalc
+
+%post calc
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun calc
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%files draw
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%{basisinstdir}/help/en/sdraw.*
+%{basisinstdir}/share/registry/draw.xcd
+%dir %{baseinstdir}
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/sdraw
+%{baseinstdir}/program/sdraw.bin
+%{_datadir}/applications/libreoffice-draw.desktop
+%{_bindir}/oodraw
+
+%post draw
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun draw
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%files emailmerge
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/mailmerge.py*
+
+%files writer
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%{basisinstdir}/help/en/swriter.*
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libbf_sw%{SOPOST}.so
+%{basisinstdir}/program/libhwp.so
+%{basisinstdir}/program/libmsword%{SOPOST}.so
+%{basisinstdir}/program/libmsworks%{SOPOST}.so
+%{basisinstdir}/program/libswd%{SOPOST}.so
+%{basisinstdir}/program/libswui%{SOPOST}.so
+%{basisinstdir}/program/libt602filter%{SOPOST}.so
+%{basisinstdir}/program/libwpft%{SOPOST}.so
+%{basisinstdir}/program/libwriterfilter%{SOPOST}.so
+%{basisinstdir}/program/libvbaswobj%{SOPOST}.uno.so
+%dir %{basisinstdir}/program/resource
+%{basisinstdir}/program/resource/bf_swen-US.res
+%{basisinstdir}/program/resource/t602filteren-US.res
+%dir %{basisinstdir}/share/registry/modules
+%dir %{basisinstdir}/share/registry/modules/org
+%dir %{basisinstdir}/share/registry/modules/org/openoffice
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office/Writer
+%{basisinstdir}/share/registry/modules/org/openoffice/Office/Writer/TableNumberRecognition.xcu
+%{basisinstdir}/share/registry/writer.xcd
+%dir %{baseinstdir}
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/swriter
+%{baseinstdir}/program/swriter.bin
+%{_datadir}/applications/libreoffice-writer.desktop
+%{_bindir}/oowriter
+
+%post writer
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun writer
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%files impress
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%{basisinstdir}/help/en/simpress.*
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libanimcore.so
+%{basisinstdir}/program/libplaceware*.so
+%dir %{basisinstdir}/share/config
+%dir %{basisinstdir}/share/config/soffice.cfg
+%dir %{basisinstdir}/share/config/soffice.cfg/simpress
+%{basisinstdir}/share/config/soffice.cfg/simpress/effects.xml
+%{basisinstdir}/share/config/soffice.cfg/simpress/transitions.xml
+%{basisinstdir}/share/registry/impress.xcd
+%dir %{baseinstdir}
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/simpress
+%{baseinstdir}/program/simpress.bin
+%{_datadir}/applications/libreoffice-impress.desktop
+%{_bindir}/ooimpress
+
+%post impress
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun impress
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%files math
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%{basisinstdir}/help/en/smath.*
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libbf_sm%{SOPOST}.so
+%{basisinstdir}/program/libsm%{SOPOST}.so
+%{basisinstdir}/program/libsmd%{SOPOST}.so
+%dir %{basisinstdir}/program/resource
+%{basisinstdir}/program/resource/bf_smen-US.res
+%{basisinstdir}/program/resource/smen-US.res
+%dir %{basisinstdir}/share/registry/modules
+%dir %{basisinstdir}/share/registry/modules/org
+%dir %{basisinstdir}/share/registry/modules/org/openoffice
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office
+%dir %{basisinstdir}/share/registry/modules/org/openoffice/Office/Math
+%{basisinstdir}/share/registry/modules/org/openoffice/Office/Math/MathPrintOptions.xcu
+%{basisinstdir}/share/registry/math.xcd
+%dir %{baseinstdir}
+%dir %{baseinstdir}/program
+%{baseinstdir}/program/smath
+%{_datadir}/applications/libreoffice-math.desktop
+%{_bindir}/oomath
+
+%post math
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%postun math
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+%files graphicfilter
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libflash%{SOPOST}.so
+%{basisinstdir}/program/libsvgfilter%{SOPOST}.so
+%{basisinstdir}/share/registry/graphicfilter.xcd
+
+%files xsltfilter
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/share/xslt
+%{basisinstdir}/share/xslt/docbook
+%dir %{basisinstdir}/share/xslt/export
+%{basisinstdir}/share/xslt/export/uof
+%{basisinstdir}/share/xslt/export/xhtml
+%dir %{basisinstdir}/share/xslt/import
+%{basisinstdir}/share/xslt/import/uof
+%{basisinstdir}/share/registry/xsltfilter.xcd
+
+%files javafilter
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/program
+%dir %{basisinstdir}/program/classes
+%{basisinstdir}/program/classes/aportisdoc.jar
+%{basisinstdir}/program/classes/pexcel.jar
+%{basisinstdir}/program/classes/pocketword.jar
+%{_datadir}/applications/libreoffice-javafilter.desktop
+%{basisinstdir}/share/registry/palm.xcd
+%{basisinstdir}/share/registry/pocketexcel.xcd
+%{basisinstdir}/share/registry/pocketword.xcd
+
+%files testtools
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/hid.lst
+%{basisinstdir}/program/libcommuni%{SOPOST}.so
+%{ureinstdir}/lib/libsalalloc_malloc.so.3
+%{basisinstdir}/program/libsimplecm%{SOPOST}.so
+%{basisinstdir}/program/testtoolrc
+%{basisinstdir}/program/testtool.bin
+%dir %{basisinstdir}/program/resource
+%{basisinstdir}/program/resource/stten-US.res
+
+%files ure
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{baseinstdir}
+%{ureinstdir}
+%exclude %{ureinstdir}/lib/libsalalloc_malloc.so.3
+
+%files sdk
+%defattr(-,root,root,-)
+%{sdkinstdir}/
+%exclude %{sdkinstdir}/docs/
+%exclude %{sdkinstdir}/examples/
+
+%files sdk-doc
+%defattr(-,root,root,-)
+%docdir %{sdkinstdir}/docs
+%{sdkinstdir}/docs/
+%{sdkinstdir}/examples/
+
+%files headless
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libbasebmp%{SOPOST}.so
+%{basisinstdir}/program/libvclplug_svp%{SOPOST}.so
+
+%files pyuno
+%defattr(-,root,root,-)
+%dir %{basisinstdir}
+%dir %{basisinstdir}/program
+%{basisinstdir}/program/libpyuno.so
+%{basisinstdir}/program/officehelper.py*
+%{basisinstdir}/program/pythonloader.py*
+%{basisinstdir}/program/pythonloader.uno.so
+%{basisinstdir}/program/pythonloader.unorc
+%{basisinstdir}/program/pyuno.so
+%dir %{basisinstdir}/share/Scripts
+%{basisinstdir}/share/Scripts/python
+%{python_sitearch}/uno.py*
+%{python_sitearch}/unohelper.py*
+%{baseinstdir}/share/extensions/ScriptProviderForPython.oxt
+%{basisinstdir}/share/registry/pyuno.xcd
+
+%files -n autocorr-en
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_en-*
+
+%if %{langpacks}
+
+%files -n autocorr-af
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_af-*
+
+%files -n autocorr-bg
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_bg-*
+
+%files -n autocorr-cs
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_cs-*
+
+%files -n autocorr-da
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_da-*
+
+%files -n autocorr-de
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_de-*
+
+%files -n autocorr-es
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_es-*
+
+%files -n autocorr-eu
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_eu.dat
+
+%files -n autocorr-fa
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_fa-*
+
+%files -n autocorr-fi
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_fi-*
+
+%files -n autocorr-fr
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_fr-*
+
+%files -n autocorr-ga
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_ga-*
+
+%files -n autocorr-hu
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_hu-*
+
+%files -n autocorr-it
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_it-*
+
+%files -n autocorr-ja
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_ja-*
+
+%files -n autocorr-ko
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_ko-*
+
+%files -n autocorr-lb
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_lb-*
+
+%files -n autocorr-lt
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_lt-*
+
+%files -n autocorr-nl
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_nl-*
+
+%files -n autocorr-mn
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_mn-*
+
+%files -n autocorr-pl
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_pl-*
+
+%files -n autocorr-pt
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_pt-*
+
+%files -n autocorr-ru
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_ru-*
+
+%files -n autocorr-sk
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_sk-*
+
+%files -n autocorr-sl
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_sl-*
+
+%files -n autocorr-sr
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_sr-*
+%{_datadir}/autocorr/acor_sh-*
+
+%files -n autocorr-sv
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_sv-*
+
+%files -n autocorr-tr
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_tr-*
+
+%files -n autocorr-vi
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_vi-*
+
+%files -n autocorr-zh
+%defattr(-,root,root,-)
+%doc solver/%{OFFICEUPD}/unxlng*/bin/ure/LICENSE
+%dir %{_datadir}/autocorr
+%{_datadir}/autocorr/acor_zh-*
+
+%endif
+
+%changelog
+* Wed Oct 06 2010 Caolán McNamara <caolanm at redhat.com> 3.2.99.1-2
+- Related: rhbz#639945 pull in review changes
+ + redland build-fix
+ + replace awk script
+ + validate .destop files
+
+* Wed Sep 29 2010 Caolán McNamara <caolanm at redhat.com> 3.2.99.1-1
+- initial import of the leviathan
diff --git a/manifest.xml b/manifest.xml
new file mode 100644
index 0000000..280b1a5
--- /dev/null
+++ b/manifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=@type@"
+ manifest:full-path="@path@"/>
+</manifest:manifest>
diff --git a/openoffice.org-1.9.123.ooo53397.prelinkoptimize.desktop.patch b/openoffice.org-1.9.123.ooo53397.prelinkoptimize.desktop.patch
new file mode 100644
index 0000000..b10bc6f
--- /dev/null
+++ b/openoffice.org-1.9.123.ooo53397.prelinkoptimize.desktop.patch
@@ -0,0 +1,111 @@
+diff -r a92d0bd6747b desktop/prj/build.lst
+--- a/desktop/prj/build.lst Mon Dec 28 16:11:17 2009 +0100
++++ b/desktop/prj/build.lst Wed Dec 30 09:34:10 2009 +0100
+@@ -1,4 +1,4 @@
+-dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh NULL
++dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh sc sd sw NULL
+ dt desktop usr1 - all dt_mkout NULL
+ dt desktop\inc nmake - all dt_inc NULL
+ dt desktop\prj get - all dt_prj NULL
+diff -r a92d0bd6747b desktop/scripts/soffice.sh
+--- a/desktop/scripts/soffice.sh Mon Dec 28 16:11:17 2009 +0100
++++ b/desktop/scripts/soffice.sh Wed Dec 30 09:34:10 2009 +0100
+@@ -73,30 +73,26 @@
+ esac
+ done
+
+-# pagein
+-sd_pagein_args=@pagein-common
+ for sd_arg in "$@"; do
+ case ${sd_arg} in
+ -calc)
+- sd_pagein_args="${sd_pagein_args} @pagein-calc"
++ sd_binary="scalc.bin"
+ break;
+ ;;
+ -draw)
+- sd_pagein_args="${sd_pagein_args} @pagein-draw"
++ sd_binary="sdraw.bin"
+ break;
+ ;;
+ -impress)
+- sd_pagein_args="${sd_pagein_args} @pagein-impress"
++ sd_binary="simpress.bin"
+ break;
+ ;;
+ -writer)
+- sd_pagein_args="${sd_pagein_args} @pagein-writer"
++ sd_binary="swriter.bin"
+ break;
+ ;;
+ esac
+ done
+-"$sd_prog/../basis-link/program/pagein" -L"$sd_prog/../basis-link/program" \
+- ${sd_pagein_args}
+
+ # extend the ld_library_path for java: javaldx checks the sofficerc for us
+ if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
+diff -r a92d0bd6747b desktop/util/makefile.mk
+--- a/desktop/util/makefile.mk Mon Dec 28 16:11:17 2009 +0100
++++ b/desktop/util/makefile.mk Wed Dec 30 09:34:10 2009 +0100
+@@ -192,6 +192,60 @@
+ APP5DEPN= $(APP1TARGETN) $(APP5RES) ooverinfo.rc
+ APP5DEF= $(MISCX)$/$(TARGET).def
+
++.IF "$(OS)" == "LINUX"
++PRELINKLIBS=$(APP5STDLIBS)
++PRELINKLIBS+= \
++ $(SVXLIB) \
++ $(SVXCORELIB) \
++ $(XMLOFFLIB) \
++ -lfwl$(DLLPOSTFIX) \
++ -lpackage2 \
++ -lucpfile1 \
++ -lucb1 \
++ $(STORELIB) \
++ $(REGLIB) \
++ -lvclplug_gtk$(DLLPOSTFIX) \
++ -lvclplug_gen$(DLLPOSTFIX) \
++ $(LNGLIB) \
++ $(ICUINLIB)
++
++APP6TARGET=swriter
++APP6NOSAL=TRUE
++APP6RPATH=BRAND
++APP6OBJS=$(APP5OBJS)
++APP6STDLIBS=$(PRELINKLIBS) \
++ $(ISWLIB)
++APP6DEPN=$(APP5DEPN)
++APP6DEF=$(MISCX)$/$(TARGET).def
++
++APP7TARGET=scalc
++APP7NOSAL=TRUE
++APP7RPATH=BRAND
++APP7OBJS=$(APP5OBJS)
++APP7STDLIBS=$(PRELINKLIBS) \
++ $(ISCLIB)
++APP7DEPN=$(APP5DEPN)
++APP7DEF=$(MISCX)$/$(TARGET).def
++
++APP8TARGET=sdraw
++APP8NOSAL=TRUE
++APP8RPATH=BRAND
++APP8OBJS=$(APP5OBJS)
++APP8STDLIBS=$(PRELINKLIBS) \
++ $(ISDLIB)
++APP8DEPN=$(APP5DEPN)
++APP8DEF=$(MISCX)$/$(TARGET).def
++
++APP9TARGET=simpress
++APP9NOSAL=TRUE
++APP9RPATH=BRAND
++APP9OBJS=$(APP5OBJS)
++APP9STDLIBS=$(PRELINKLIBS) \
++ $(ISDLIB)
++APP9DEPN=$(APP5DEPN)
++APP9DEF=$(MISCX)$/$(TARGET).def
++.ENDIF
++
+ .IF "$(GUI)" == "WNT"
+ APP5RES= $(RES)$/oodesktop.res
+ APP5ICON=$(SOLARRESDIR)$/icons/ooo3_main_app.ico
diff --git a/openoffice.org-2.0.1.rhXXXXXX.extensions.defaulttoevo2.patch b/openoffice.org-2.0.1.rhXXXXXX.extensions.defaulttoevo2.patch
new file mode 100644
index 0000000..313c839
--- /dev/null
+++ b/openoffice.org-2.0.1.rhXXXXXX.extensions.defaulttoevo2.patch
@@ -0,0 +1,82 @@
+--- openoffice.org/officecfg/registry/data/org/openoffice/Office/Writer.xcu.orig 2005-04-18 20:39:35.000000000 +0530
++++ openoffice.org/officecfg/registry/data/org/openoffice/Office/Writer.xcu 2005-05-10 17:30:14.000000000 +0530
+@@ -40,6 +40,32 @@
+ <prop oor:name="IsHideEmptyParagraphs" >
+ <value>true</value>
+ </prop>
++ <node oor:name="DataSource">
++ <prop oor:name="DataSourceName" oor:type="xs:string">
++ <value>EvolutionLocal</value>
++ </prop>
++ <prop oor:name="DataTableName" oor:type="xs:string">
++ <value>Personal</value>
++ </prop>
++ </node>
++ <node oor:name="AddressDataAssignments">
++ <node oor:name="_0" oor:op="replace">
++ <prop oor:name="DBColumnAssignments" oor:type="oor:string-list">
++ <value oor:separator=",">title,full_name,family_name,org,addr_line1,addr_line2,city,state,zip,country,home_phone,business_phone,email_1,</value>
++ </prop>
++ <node oor:name="DataSource">
++ <prop oor:name="DataCommandType" oor:type="xs:short">
++ <value>0</value>
++ </prop>
++ <prop oor:name="DataSourceName" oor:type="xs:string">
++ <value>EvolutionLocal</value>
++ </prop>
++ <prop oor:name="DataTableName" oor:type="xs:string">
++ <value>Personal</value>
++ </prop>
++ </node>
++ </node>
++ </node>
+ <prop oor:name="EMailSupported">
+ <value>true</value>
+ </prop>
+--- openoffice.org/extras/source/database/makefile.mk.bakj 2005-03-16 18:49:33.251075928 +0530
++++ openoffice.org/extras/source/database/makefile.mk 2005-03-16 18:50:38.651285353 +0530
+@@ -72,8 +72,8 @@
+
+ ZIP1TARGET = $(DATABASE_USER_TARGET)
+
+-ZIP1LIST = biblio.odb
+-
++ZIP1LIST = biblio.odb \
++ evolocal.odb
+ ZIP2TARGET = $(DATABASE_USER_BIBLIO_TARGET)
+
+ ZIP2LIST = biblio.dbf biblio.dbt
+--- openoffice.org/officecfg/registry/data/org/openoffice/Office/DataAccess.xcu.bakj 2005-03-16 18:51:43.777536725 +0530
++++ openoffice.org/officecfg/registry/data/org/openoffice/Office/DataAccess.xcu 2005-03-16 18:52:51.471404727 +0530
+@@ -161,6 +161,14 @@
+ <value>Bibliography</value>
+ </prop>
+ </node>
++ <node oor:name="EvolutionLocal" oor:op="replace">
++ <prop oor:name="Location" oor:type="xs:string">
++ <value>$(userurl)/database/evolocal.odb</value>
++ </prop>
++ <prop oor:name="Name" oor:type="xs:string">
++ <value>EvolutionLocal</value>
++ </prop>
++ </node>
+ </node>
+ <node oor:name="Bibliography">
+ <node oor:name="CurrentDataSource">
+--- openoffice.org.orig/extensions/source/abpilot/abspilot.cxx 19 Dec 2005 17:26:24 -0000 1.13
++++ openoffice.org/extensions/source/abpilot/abspilot.cxx 16 Feb 2006 12:45:38 -0000
+@@ -124,12 +124,8 @@
+ // some initial settings
+ #ifdef MACOSX
+ m_aSettings.eType = AST_MACAB;
+-#elif WITH_MOZILLA
+-#ifdef UNX
+- m_aSettings.eType = AST_MORK;
+-#else
+- m_aSettings.eType = AST_OE;
+-#endif
++#elif UNX
++ m_aSettings.eType = AST_EVOLUTION;
+ #else
+ m_aSettings.eType = AST_OTHER;
+ #endif
diff --git a/openoffice.org-2.0.2.rh188467.printingdefaults.patch b/openoffice.org-2.0.2.rh188467.printingdefaults.patch
new file mode 100644
index 0000000..45c40aa
--- /dev/null
+++ b/openoffice.org-2.0.2.rh188467.printingdefaults.patch
@@ -0,0 +1,15 @@
+Index: configuration/ppds/SGENPRT.PS
+===================================================================
+RCS file: /cvs/external/psprint_config/configuration/ppds/SGENPRT.PS,v
+retrieving revision 1.3
+diff -u -p -u -r1.3 SGENPRT.PS
+--- openoffice.org.orig/psprint_config/configuration/ppds/SGENPRT.PS 26 Nov 2004 16:10:35 -0000 1.3
++++ openoffice.org/psprint_config/configuration/ppds/SGENPRT.PS 30 Aug 2005 11:17:51 -0000
+@@ -58,6 +58,7 @@
+ *ColorDevice: True
+ *DefaultColorSpace: RGB
+ *LanguageLevel: "2"
++*TTRasterizer: Type42
+
+ *% --- For None Color or old PostScript(R) printers use following lines ---
+ *% *ColorDevice: False
diff --git a/openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch b/openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch
new file mode 100644
index 0000000..0deea14
--- /dev/null
+++ b/openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch
@@ -0,0 +1,53 @@
+--- solenv/bin/modules/installer/globals.pm 2010-05-25 21:01:11.000000000 +0100
++++ solenv/bin/modules/installer/globals.pm 2010-05-27 08:01:11.000000000 +0100
+@@ -404,8 +404,8 @@
+ %usedtreeconditions = ();
+ %moduledestination = ();
+
+- $unomaxservices = 1800; # regcomp -c argument length
+- $javamaxservices = 15;
++ $unomaxservices = 1; # regcomp -c argument length
++ $javamaxservices = 1;
+
+ $one_cab_file = 0;
+ $fix_number_of_cab_files = 1;
+--- solenv/bin/modules/installer/servicesfile.pm 2010-05-25 21:01:11.000000000 +0100
++++ solenv/bin/modules/installer/servicesfile.pm 2010-06-10 09:07:46.000000000 +0100
+@@ -222,17 +231,31 @@
+ if ( $i % $installer::globals::javamaxservices == 0 || $i > $#{$javacomponents} ) # limiting to $installer::globals::maxservices files
+ {
+ my @regcompoutput = ();
++ my @throwregcompoutput = ();
+
+ my $systemcall = "$installer::globals::wrapcmd $$regcompfileref -register -br ".fix_cygwin_path($regcomprdb)." -r ".fix_cygwin_path($servicesfile)." -c " . $installer::globals::quote . $filestring . $installer::globals::quote . " -l com.sun.star.loader.Java2 -wop=" . $installer::globals::quote . $javaservicesurlprefix . $installer::globals::quote ." -env:URE_INTERNAL_JAVA_DIR=" . $installer::globals::quote . make_file_url($$ure_internal_java_dir_ref) . $installer::globals::quote . " 2\>\&1 |";
+
+- open (REG, "$systemcall");
+- while (<REG>) {push(@regcompoutput, $_); }
+- close (REG);
++ my $returnvalue = 1;
++ my $infoline = "Systemcall: $systemcall\n";
+
+- my $returnvalue = $?; # $? contains the return value of the systemcall
++ for ( my $j = 0; $j <= 10; $j++) {
++ open (REG, "$systemcall");
++ while (<REG>) {push(@throwregcompoutput, $_); }
++ close (REG);
++
++ $returnvalue = $?; # $? contains the return value of the systemcall
+
+- my $infoline = "Systemcall: $systemcall\n";
+- push( @installer::globals::logfileinfo, $infoline);
++ push( @installer::globals::logfileinfo, $infoline);
++
++ if ($returnvalue == 0) {
++ last;
++ }
++
++ $infoline = "RATS: attempt $j: $systemcall\n";
++ push( @installer::globals::logfileinfo, $infoline);
++ }
++
++ $regcompoutput = $throwregcompoutput;
+
+ for ( my $k = 0; $k <= $#regcompoutput; $k++ ) { push( @installer::globals::logfileinfo, "$regcompoutput[$k]"); }
+
diff --git a/openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch b/openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
new file mode 100644
index 0000000..24fd96d
--- /dev/null
+++ b/openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
@@ -0,0 +1,1136 @@
+Index: inc/cmdid.h
+===================================================================
+RCS file: /cvs/sw/sw/inc/cmdid.h,v
+retrieving revision 1.72
+diff -u -r1.72 cmdid.h
+--- openoffice.org.orig/sw/inc/cmdid.h 27 Jun 2007 13:12:47 -0000 1.72
++++ openoffice.org/sw/inc/cmdid.h 10 Jul 2007 12:54:59 -0000
+@@ -539,6 +539,8 @@
+
+ #define FN_SET_PAGE_STYLE (FN_FORMAT + 93) /* Anwenden Seitenv. */
+
++#define FN_FORMAT_TITLEPAGE_DLG (FN_FORMAT + 98) /* Title Page */
++
+
+ #define FN_TABLE_REP (FN_FORMAT + 99) /* TableRepresentation */
+ #define FN_CONVERT_TEXT_TABLE (FN_FORMAT + 100) /* Konvertierung Text <-> Tabelle */
+Index: inc/globals.hrc
+===================================================================
+RCS file: /cvs/sw/sw/inc/globals.hrc,v
+retrieving revision 1.16
+diff -u -r1.16 globals.hrc
+--- openoffice.org.orig/sw/inc/globals.hrc 2 May 2006 15:13:43 -0000 1.16
++++ openoffice.org/sw/inc/globals.hrc 10 Jul 2007 12:55:08 -0000
+@@ -282,7 +282,9 @@
+ #define TP_SECTION_INDENTS (RC_GLOBALS_BEGIN + 102)
+ #define TP_OPTCOMPATIBILITY_PAGE (RC_GLOBALS_BEGIN + 103)
+ #define TP_MAILCONFIG (RC_GLOBALS_BEGIN + 104)
+-//maximum: RC_GLOBALS_BEGIN + 119
++#define TP_TITLEPAGE (RC_GLOBALS_BEGIN + 105)
++//maximum: RC_GLOBALS_BEGIN + 120
++
+
+ #if STR_DOC_STAT > RC_GLOBALS_END
+ #error Resource-Id Ueberlauf in #file, #line
+@@ -294,4 +296,5 @@
+ #define SID_WRT_SHELL (RC_GLOBALS_BEGIN + 117)
+
+ #define DLG_LINE_NUMBERING (RC_GLOBALS_BEGIN + 118)
++#define DLG_TITLEPAGE (RC_GLOBALS_BEGIN + 119)
+ #endif // _GLOBALS_HRC
+Index: inc/helpid.h
+===================================================================
+RCS file: /cvs/sw/sw/inc/helpid.h,v
+retrieving revision 1.30
+diff -u -r1.30 helpid.h
+--- openoffice.org.orig/sw/inc/helpid.h 2 Jan 2007 16:45:16 -0000 1.30
++++ openoffice.org/sw/inc/helpid.h 10 Jul 2007 12:55:09 -0000
+@@ -986,3 +986,4 @@
+ #define HID_MM_HEADER_12 (HID_BASE + 2279)
+ #define HID_MM_HEADER_13 (HID_BASE + 2280)
+
++#define HID_TITLEPAGE (HID_BASE + 2281)
+Index: inc/rcid.hrc
+===================================================================
+RCS file: /cvs/sw/sw/inc/rcid.hrc,v
+retrieving revision 1.12
+diff -u -r1.12 rcid.hrc
+--- openoffice.org.orig/sw/inc/rcid.hrc 22 May 2007 16:20:20 -0000 1.12
++++ openoffice.org/sw/inc/rcid.hrc 10 Jul 2007 12:55:14 -0000
+@@ -135,7 +135,7 @@
+
+ // globale Ressourcen
+ #define RC_GLOBALS_BEGIN RC_GLOBALS
+-#define RC_GLOBALS_END (RC_GLOBALS_BEGIN + 119)
++#define RC_GLOBALS_END (RC_GLOBALS_BEGIN + 120)
+
+ // Format-Vorlagen
+ #define RC_FMTUI_BEGIN RC_FMTUI
+Index: inc/swabstdlg.hxx
+===================================================================
+RCS file: /cvs/sw/sw/inc/swabstdlg.hxx,v
+retrieving revision 1.13
+diff -u -r1.13 swabstdlg.hxx
+--- openoffice.org.orig/sw/inc/swabstdlg.hxx 26 Apr 2007 08:48:16 -0000 1.13
++++ openoffice.org/sw/inc/swabstdlg.hxx 10 Jul 2007 12:55:16 -0000
+@@ -477,6 +477,7 @@
+ SwField* pField, BOOL bNextButton = FALSE ) = 0; //add for SwFldInputDlg
+ virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg( int nResId,
+ Window * pParent, SwWrtShell &rSh, BOOL bEd = FALSE) = 0; //add for SwInsFootNoteDlg
++ virtual VclAbstractDialog* CreateTitlePageDlg ( Window * pParent ) = 0;
+ virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
+ SwView& rView, BOOL bCol = FALSE ) = 0; //add for SwInsRowColDlg, SwLineNumberingDlg
+ virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId,
+Index: sdi/_basesh.sdi
+===================================================================
+RCS file: /cvs/sw/sw/sdi/_basesh.sdi,v
+retrieving revision 1.16
+diff -u -r1.16 _basesh.sdi
+--- openoffice.org.orig/sw/sdi/_basesh.sdi 2 May 2006 15:13:56 -0000 1.16
++++ openoffice.org/sw/sdi/_basesh.sdi 10 Jul 2007 12:55:36 -0000
+@@ -250,6 +250,12 @@
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
++ FN_FORMAT_TITLEPAGE_DLG // status(final|play)
++ [
++ ExecMethod = ExecDlg ;
++ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
++ ]
++
+ FN_FORMAT_PAGE_COLUMN_DLG // status(final|play)
+ [
+ ExecMethod = ExecDlg ;
+Index: sdi/swriter.sdi
+===================================================================
+RCS file: /cvs/sw/sw/sdi/swriter.sdi,v
+retrieving revision 1.66
+diff -u -r1.66 swriter.sdi
+--- openoffice.org.orig/sw/sdi/swriter.sdi 27 Jun 2007 13:16:04 -0000 1.66
++++ openoffice.org/sw/sdi/swriter.sdi 10 Jul 2007 12:57:02 -0000
+@@ -6330,6 +6330,31 @@
+ ]
+
+ //--------------------------------------------------------------------------
++SfxVoidItem TitlePageDialog FN_FORMAT_TITLEPAGE_DLG
++()
++[
++ /* flags: */
++ AutoUpdate = FALSE,
++ Cachable = Cachable,
++ FastCall = FALSE,
++ HasCoreId = FALSE,
++ HasDialog = TRUE,
++ ReadOnlyDoc = FALSE,
++ Toggle = FALSE,
++ Container = FALSE,
++ RecordAbsolute = FALSE,
++ RecordPerItem;
++ Asynchron;
++
++ /* config: */
++ AccelConfig = TRUE,
++ MenuConfig = TRUE,
++ StatusBarConfig = FALSE,
++ ToolBoxConfig = TRUE,
++ GroupId = GID_FORMAT;
++]
++
++//--------------------------------------------------------------------------
+ SfxVoidItem PageDown FN_PAGEDOWN
+ ()
+ [
+Index: source/ui/dialog/swdlgfact.cxx
+===================================================================
+RCS file: /cvs/sw/sw/source/ui/dialog/swdlgfact.cxx,v
+retrieving revision 1.13
+diff -u -r1.13 swdlgfact.cxx
+--- openoffice.org.orig/sw/source/ui/dialog/swdlgfact.cxx 26 Apr 2007 09:06:20 -0000 1.13
++++ openoffice.org/sw/source/ui/dialog/swdlgfact.cxx 10 Jul 2007 13:05:50 -0000
+@@ -97,6 +97,7 @@
+ #include <instable.hxx> //add for SwInsTableDlg
+ #include <javaedit.hxx> //add for SwJavaEditDialog
+ #include <linenum.hxx> //add for SwLineNumberingDlg
++#include <titlepage.hxx> //add for SwTitlePageDlg
+ #include <mailmrge.hxx> //add for SwMailMergeDlg, SwMailMergeCreateFromDlg, SwMailMergeFieldConnectionsDlg
+ #include <mergetbl.hxx> //add for SwMergeTblDlg
+ #include <multmrk.hxx> //add for SwMultiTOXMarkDlg
+@@ -1357,6 +1358,14 @@
+ return 0;
+ }
+
++VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( Window *pParent )
++{
++ Dialog* pDlg = new SwTitlePageDlg( pParent );
++ if ( pDlg )
++ return new VclAbstractDialog_Impl( pDlg );
++ return 0;
++}
++
+ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nResId,
+ SwView& rView, BOOL /*bCol*/ ) //add for SwInsRowColDlg, SwLineNumberingDlg
+ {
+Index: source/ui/dialog/swdlgfact.hxx
+===================================================================
+RCS file: /cvs/sw/sw/source/ui/dialog/swdlgfact.hxx,v
+retrieving revision 1.9
+diff -u -r1.9 swdlgfact.hxx
+--- openoffice.org.orig/sw/source/ui/dialog/swdlgfact.hxx 26 Apr 2007 09:06:34 -0000 1.9
++++ openoffice.org/sw/source/ui/dialog/swdlgfact.hxx 10 Jul 2007 13:05:50 -0000
+@@ -532,6 +532,7 @@
+ SwField* pField, BOOL bNextButton = FALSE ); //add for SwFldInputDlg
+ virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg( int nResId,
+ Window * pParent, SwWrtShell &rSh, BOOL bEd = FALSE); //add for SwInsFootNoteDlg
++ virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent );
+ virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
+ SwView& rView, BOOL bCol = FALSE ); //add for SwInsRowColDlg, SwLineNumberingDlg
+ virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId,
+Index: source/ui/inc/swmn_tmpl.hrc
+===================================================================
+RCS file: /cvs/sw/sw/source/ui/inc/swmn_tmpl.hrc,v
+retrieving revision 1.13
+diff -u -r1.13 swmn_tmpl.hrc
+--- openoffice.org.orig/sw/source/ui/inc/swmn_tmpl.hrc 27 Jun 2007 13:25:09 -0000 1.13
++++ openoffice.org/sw/source/ui/inc/swmn_tmpl.hrc 10 Jul 2007 13:08:19 -0000
+@@ -67,8 +67,13 @@
+ Identifier = FN_FORMAT_PAGE_DLG ; \
+ HelpID = FN_FORMAT_PAGE_DLG ; \
+ Text [ en-US ] = "Pa~ge..." ; \
+- };
+-
++ };\
++ MenuItem\
++ {\
++ Identifier = FN_FORMAT_TITLEPAGE_DLG ; \
++ HelpID = FN_FORMAT_TITLEPAGE_DLG ; \
++ Text [ en-US ] = "~Title Page..." ; \
++ };
+
+ #define MN_TEXT_ATTR\
+ MenuItem\
+Index: source/ui/misc/makefile.mk
+===================================================================
+RCS file: /cvs/sw/sw/source/ui/misc/makefile.mk,v
+retrieving revision 1.12
+diff -u -r1.12 makefile.mk
+--- openoffice.org.orig/sw/source/ui/misc/makefile.mk 9 Sep 2005 10:35:47 -0000 1.12
++++ openoffice.org/sw/source/ui/misc/makefile.mk 10 Jul 2007 13:09:42 -0000
+@@ -56,7 +56,8 @@
+ pgfnote.src \
+ pggrid.src \
+ redlndlg.src \
+- srtdlg.src
++ srtdlg.src \
++ titlepage.src
+
+ EXCEPTIONSFILES = \
+ $(SLO)$/glossary.obj \
+@@ -76,6 +77,7 @@
+ $(SLO)$/insfnote.obj \
+ $(SLO)$/insrule.obj \
+ $(SLO)$/linenum.obj \
++ $(SLO)$/titlepage.obj \
+ $(SLO)$/num.obj \
+ $(SLO)$/numberingtypelistbox.obj \
+ $(SLO)$/outline.obj \
+Index: source/ui/shells/basesh.cxx
+===================================================================
+RCS file: /cvs/sw/sw/source/ui/shells/basesh.cxx,v
+retrieving revision 1.81
+diff -u -r1.81 basesh.cxx
+--- openoffice.org.orig/sw/source/ui/shells/basesh.cxx 10 May 2007 16:22:02 -0000 1.81
++++ openoffice.org/sw/source/ui/shells/basesh.cxx 10 Jul 2007 13:10:07 -0000
+@@ -2546,6 +2546,14 @@
+
+ switch ( nSlot )
+ {
++ case FN_FORMAT_TITLEPAGE_DLG:
++ {
++ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
++ VclAbstractDialog* pDlg = pFact->CreateTitlePageDlg( pMDI );
++ pDlg->Execute();
++ delete pDlg;
++ }
++ break;
+ case FN_FORMAT_PAGE_COLUMN_DLG:
+ case FN_FORMAT_PAGE_DLG:
+ {
+Index: uiconfig/swriter/menubar/menubar.xml
+===================================================================
+RCS file: /cvs/sw/sw/uiconfig/swriter/menubar/menubar.xml,v
+retrieving revision 1.28
+diff -u -r1.28 menubar.xml
+--- openoffice.org.orig/sw/uiconfig/swriter/menubar/menubar.xml 29 May 2007 14:49:53 -0000 1.28
++++ openoffice.org/sw/uiconfig/swriter/menubar/menubar.xml 10 Jul 2007 13:13:00 -0000
+@@ -217,6 +217,7 @@
+ <menu:menuitem menu:id=".uno:ParagraphDialog"/>
+ <menu:menuitem menu:id=".uno:BulletsAndNumberingDialog"/>
+ <menu:menuitem menu:id=".uno:PageDialog"/>
++ <menu:menuitem menu:id=".uno:TitlePageDialog"/>
+ <menu:menuseparator/>
+ <menu:menu menu:id=".uno:TransliterateMenu">
+ <menu:menupopup>
+Index: util/makefile.mk
+===================================================================
+RCS file: /cvs/sw/sw/util/makefile.mk,v
+retrieving revision 1.61
+diff -u -r1.61 makefile.mk
+--- openoffice.org.orig/sw/util/makefile.mk 22 May 2007 16:41:25 -0000 1.61
++++ openoffice.org/sw/util/makefile.mk 10 Jul 2007 13:13:05 -0000
+@@ -263,6 +263,7 @@
+ $(SLO)$/instable.obj \
+ $(SLO)$/insrule.obj \
+ $(SLO)$/javaedit.obj \
++ $(SLO)$/titlepage.obj \
+ $(SLO)$/linenum.obj \
+ $(SLO)$/mailmrge.obj \
+ $(SLO)$/multmrk.obj \
+diff -ru openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+--- openoffice.org.orig/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 2007-07-10 14:35:38.000000000 +0100
++++ openoffice.org/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 2007-07-09 12:03:44.000000000 +0100
+@@ -802,6 +802,11 @@
+ <value xml:lang="en-US">~Page...</value>
+ </prop>
+ </node>
++ <node oor:name=".uno:TitlePageDialog" oor:op="replace">
++ <prop oor:name="Label" oor:type="xs:string">
++ <value xml:lang="en-US">Title Page...</value>
++ </prop>
++ </node>
+ <node oor:name=".uno:FormatColumns" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Co~lumns...</value>
+--- /dev/null 2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org.orig/sw/source/ui/inc/titlepage.hxx 2008-11-13 12:48:59.000000000 +0000
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++#ifndef _SWTITLEPAGE_HXX
++#define _SWTITLEPAGE_HXX
++
++#ifndef _BASEDLGS_HXX //autogen
++#include <sfx2/basedlgs.hxx>
++#endif
++
++#ifndef _SFXTABDLG_HXX //autogen
++#include <sfx2/tabdlg.hxx>
++#endif
++
++#ifndef _SV_FIXED_HXX //autogen
++#include <vcl/fixed.hxx>
++#endif
++
++#ifndef _SV_FIELD_HXX //autogen
++#include <vcl/field.hxx>
++#endif
++#ifndef _NUMBERINGTYPELISTBOX_HXX
++#include <numberingtypelistbox.hxx>
++#endif
++
++#ifndef _LSTBOX_HXX //autogen
++#include <vcl/lstbox.hxx>
++#endif
++
++class Window;
++class SfxItemSet;
++class SwView;
++class SwWrtShell;
++class SwPageDesc;
++
++/*--------------------------------------------------------------------
++ Beschreibung: SingleTabDialog
++ --------------------------------------------------------------------*/
++
++class SwTitlePageDlg : public SfxModalDialog
++{
++private:
++ FixedLine aMakeInsertFL;
++ RadioButton aUseExistingPagesRB;
++ RadioButton aInsertNewPagesRB;
++ FixedText aPageCountFT;
++ NumericField aPageCountNF;
++ FixedText aPagePagesFT;
++
++ FixedText aPageStartFT;
++ RadioButton aDocumentStartRB;
++ RadioButton aPageStartRB;
++ NumericField aPageStartNF;
++
++ FixedLine aNumberingFL;
++ CheckBox aRestartNumberingCB;
++ FixedText aRestartNumberingFT;
++ NumericField aRestartNumberingNF;
++ CheckBox aSetPageNumberCB;
++ FixedText aSetPageNumberFT;
++ NumericField aSetPageNumberNF;
++
++ FixedLine aPagePropertiesFL;
++ ListBox aPagePropertiesLB;
++ PushButton aPagePropertiesPB;
++
++ FixedLine aBottomFL;
++ OKButton aOkPB;
++ CancelButton aCancelPB;
++ HelpButton aHelpPB;
++
++ SwWrtShell *mpSh;
++
++ const SwFmtPageDesc *mpPageFmtDesc;
++
++ SwPageDesc *mpTitleDesc;
++ const SwPageDesc *mpIndexDesc;
++ const SwPageDesc *mpNormalDesc;
++
++ void FillList();
++
++ USHORT GetInsertPosition() const;
++
++ DECL_LINK( OKHdl, Button * );
++ DECL_LINK( EditHdl, Button * );
++ DECL_LINK( RestartNumberingHdl, CheckBox* );
++ DECL_LINK( SetPageNumberHdl, CheckBox* );
++ DECL_LINK( UpHdl, NumericField * );
++ DECL_LINK( DownHdl, NumericField * );
++ DECL_LINK( StartPageHdl, RadioButton * );
++public:
++ SwTitlePageDlg( Window *pParent );
++ ~SwTitlePageDlg();
++};
++
++#endif
++
++/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+--- /dev/null 2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org/sw/source/ui/misc/titlepage.src 2008-11-13 12:03:28.000000000 +0000
+@@ -0,0 +1,260 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++/* StarView ressource file */
++
++#ifndef _SFX_HRC
++#include <sfx2/sfx.hrc>
++#endif
++#ifndef _SVX_DIALOGS_HRC
++#include <svx/dialogs.hrc>
++#endif
++#include "globals.hrc"
++#include "misc.hrc"
++#include "titlepage.hrc"
++#include "helpid.h"
++/**************************************************************************/
++/* */
++/**************************************************************************/
++ModalDialog DLG_TITLEPAGE
++{
++ HelpID = HID_TITLEPAGE ;
++ OutputSize = TRUE ;
++ SVLook = TRUE ;
++ Size = MAP_APPFONT ( 216 , 201 ) ;
++ Text [ en-US ] = "Title Pages" ;
++ Moveable = TRUE ;
++
++ FixedLine FL_MAKEINSERT
++ {
++ Pos = MAP_APPFONT ( 6 , 5 ) ;
++ Size = MAP_APPFONT ( 204 , 8 ) ;
++ Text [ en-US ] = "Make Title Pages" ;
++ Text [ x-comment ] = " ";
++ };
++ RadioButton RB_USE_EXISTING_PAGES
++ {
++ Pos = MAP_APPFONT ( 12 , 18 ) ;
++ Size = MAP_APPFONT ( 150 , 10 ) ;
++ Text [ en-US ] = "Convert existing pages to title pages" ;
++ TabStop = TRUE ;
++ Check = TRUE ;
++ Text [ x-comment ] = " ";
++ };
++ RadioButton RB_INSERT_NEW_PAGES
++ {
++ Pos = MAP_APPFONT ( 12 , 34 ) ;
++ Size = MAP_APPFONT ( 150 , 10 ) ;
++ Text [ en-US ] = "Insert new title pages" ;
++ Text [ x-comment ] = " ";
++ };
++ FixedText FT_PAGE_COUNT
++ {
++ Pos = MAP_APPFONT ( 12 , 50 ) ;
++ Size = MAP_APPFONT ( 80 , 8 ) ;
++ Text [ en-US ] = "Number of title pages" ;
++ Text [ x-comment ] = " ";
++ };
++ NumericField NF_PAGE_COUNT
++ {
++ Pos = MAP_APPFONT ( 80 , 50 ) ;
++ Size = MAP_APPFONT ( 30 , 12 ) ;
++ Border = TRUE ;
++ TabStop = TRUE ;
++ Left = TRUE ;
++ Repeat = TRUE ;
++ Spin = TRUE ;
++ Minimum = 1 ;
++ Maximum = 65535;
++ First = 1 ;
++ Last = 65535;
++ SpinSize = 1 ;
++ };
++ FixedText FT_PAGE_PAGES
++ {
++ Pos = MAP_APPFONT ( 116 , 50 ) ;
++ Size = MAP_APPFONT ( 80 , 10 ) ;
++ Text [ en-US ] = "pages" ;
++ Text [ x-comment ] = " ";
++ };
++ FixedText FT_PAGE_START
++ {
++ Pos = MAP_APPFONT ( 12 , 66 ) ;
++ Size = MAP_APPFONT ( 58 , 8 ) ;
++ Text [ en-US ] = "Place title pages at" ;
++ Text [ x-comment ] = " ";
++ };
++ RadioButton RB_DOCUMENT_START
++ {
++ Pos = MAP_APPFONT ( 70 , 66 ) ;
++ Size = MAP_APPFONT ( 80 , 10 ) ;
++ Text [ en-US ] = "Document Start" ;
++ TabStop = TRUE ;
++ Check = TRUE ;
++ Text [ x-comment ] = " ";
++ };
++ RadioButton RB_PAGE_START
++ {
++ Pos = MAP_APPFONT ( 70 , 78 ) ;
++ Size = MAP_APPFONT ( 30 , 10 ) ;
++ Text [ en-US ] = "Page" ;
++ Text [ x-comment ] = " ";
++ };
++ NumericField NF_PAGE_START
++ {
++ Pos = MAP_APPFONT ( 95 , 78 ) ;
++ Size = MAP_APPFONT ( 30 , 12 ) ;
++ Border = TRUE ;
++ TabStop = TRUE ;
++ Left = TRUE ;
++ Repeat = TRUE ;
++ Spin = TRUE ;
++ Minimum = 1 ;
++ Maximum = 65535;
++ First = 1 ;
++ Last = 65535;
++ SpinSize = 1 ;
++ };
++ FixedLine FL_NUMBERING
++ {
++ Pos = MAP_APPFONT ( 6 , 98 ) ;
++ Size = MAP_APPFONT ( 204 , 8 ) ;
++ Text [ en-US ] = "Page Numbering" ;
++ Text [ x-comment ] = " ";
++ };
++ CheckBox CB_RESTART_NUMBERING
++ {
++ Pos = MAP_APPFONT ( 12, 111 ) ;
++ Size = MAP_APPFONT ( 150 , 10 ) ;
++ TabStop = TRUE ;
++ Text [ en-US ] = "Reset Page Numbering after title pages" ;
++ Text [ x-comment ] = " ";
++ };
++ FixedText FT_RESTART_NUMBERING
++ {
++ Pos = MAP_APPFONT ( 140 , 111 ) ;
++ Size = MAP_APPFONT ( 50 , 10 ) ;
++ Text [ en-US ] = "Page Number" ;
++ Text [ x-comment ] = " ";
++ };
++ NumericField NF_RESTART_NUMBERING
++ {
++ Pos = MAP_APPFONT ( 180 , 111 ) ;
++ Size = MAP_APPFONT ( 30 , 12 ) ;
++ Border = TRUE ;
++ TabStop = TRUE ;
++ Left = TRUE ;
++ Repeat = TRUE ;
++ Spin = TRUE ;
++ Minimum = 1 ;
++ Maximum = 65535;
++ First = 1 ;
++ Last = 65535;
++ SpinSize = 1 ;
++ };
++ CheckBox CB_SET_PAGE_NUMBER
++ {
++ Pos = MAP_APPFONT ( 12 , 125 ) ;
++ Size = MAP_APPFONT ( 150 , 10 ) ;
++ TabStop = TRUE ;
++ Text [ en-US ] = "Set Page Number for first title page" ;
++ Text [ x-comment ] = " ";
++ };
++ FixedText FT_SET_PAGE_NUMBER
++ {
++ Pos = MAP_APPFONT ( 140 , 125 ) ;
++ Size = MAP_APPFONT ( 50 , 10 ) ;
++ Text [ en-US ] = "Page Number" ;
++ Text [ x-comment ] = " ";
++ };
++ NumericField NF_SET_PAGE_NUMBER
++ {
++ Pos = MAP_APPFONT ( 180 , 125 ) ;
++ Size = MAP_APPFONT ( 30 , 12 ) ;
++ Border = TRUE ;
++ TabStop = TRUE ;
++ Left = TRUE ;
++ Repeat = TRUE ;
++ Spin = TRUE ;
++ Minimum = 1 ;
++ Maximum = 65535;
++ First = 1 ;
++ Last = 65535;
++ SpinSize = 1 ;
++ };
++ FixedLine FL_PAGE_PROPERTIES
++ {
++ Pos = MAP_APPFONT ( 6 , 141 ) ;
++ Size = MAP_APPFONT ( 204 , 8 ) ;
++ Text [ en-US ] = "Edit Page Properties" ;
++ Text [ x-comment ] = " ";
++ };
++ ListBox LB_PAGE_PROPERTIES
++ {
++ Border = TRUE ;
++ Pos = MAP_APPFONT ( 12 , 154 ) ;
++ Size = MAP_APPFONT ( 150 , 80 ) ;
++ TabStop = TRUE ;
++ DropDown = TRUE ;
++ CurPos = 0 ;
++ };
++ PushButton PB_PAGE_PROPERTIES
++ {
++ Pos = MAP_APPFONT ( 170 , 154 ) ;
++ Size = MAP_APPFONT ( 30 , 12 ) ;
++ Text [ en-US ] = "Edit..." ;
++ };
++ FixedLine FL_BOTTOM
++ {
++ Pos = MAP_APPFONT ( 6 , 170 ) ;
++ Size = MAP_APPFONT ( 204 , 8 ) ;
++ };
++ OKButton PB_OK
++ {
++ Pos = MAP_APPFONT ( 54 , 181 ) ;
++ Size = MAP_APPFONT ( 50 , 14 ) ;
++ DefButton = TRUE ;
++ };
++ CancelButton PB_CANCEL
++ {
++ Pos = MAP_APPFONT ( 107 , 181 ) ;
++ Size = MAP_APPFONT ( 50 , 14 ) ;
++ DefButton = TRUE ;
++ };
++ HelpButton PB_HELP
++ {
++ Pos = MAP_APPFONT ( 160 , 181 ) ;
++ Size = MAP_APPFONT ( 50 , 14 ) ;
++ };
++};
+--- /dev/null 2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org/sw/source/ui/misc/titlepage.cxx 2008-11-13 12:58:11.000000000 +0000
+@@ -0,0 +1,375 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_sw.hxx"
++
++#ifdef SW_DLLIMPLEMENTATION
++#undef SW_DLLIMPLEMENTATION
++#endif
++
++#include <sfx2/viewfrm.hxx>
++#include <vcl/msgbox.hxx>
++#include <view.hxx>
++#include <swmodule.hxx>
++#include <wrtsh.hxx>
++#include <poolfmt.hxx>
++#include <docsh.hxx>
++#include <charfmt.hxx>
++#include <docstyle.hxx>
++
++#include "fldbas.hxx"
++#include "lineinfo.hxx"
++#include "globals.hrc"
++#include "titlepage.hrc"
++#include "titlepage.hxx"
++#include "uitool.hxx"
++#include "fmtpdsc.hxx"
++#include "pagedesc.hxx"
++
++#include <IDocumentStylePoolAccess.hxx>
++
++namespace
++{
++ bool lcl_GetPageDesc(SwWrtShell *pSh, USHORT &rPageNo, const SwFmtPageDesc **ppPageFmtDesc)
++ {
++ bool bRet = false;
++ SfxItemSet aSet( pSh->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC );
++ if (pSh->GetCurAttr( aSet ))
++ {
++ const SfxPoolItem* pItem(0);
++ if (SFX_ITEM_SET == aSet.GetItemState( RES_PAGEDESC, TRUE, &pItem ) && pItem)
++ {
++ rPageNo = ((const SwFmtPageDesc *)pItem)->GetNumOffset();
++ if (ppPageFmtDesc)
++ (*ppPageFmtDesc) = (const SwFmtPageDesc *)(pItem->Clone());
++ bRet = true;
++ }
++ }
++ return bRet;
++ }
++
++ bool lcl_SkipNPages(SwWrtShell *pSh, USHORT nNoPages)
++ {
++ bool bAllOk = true;
++ for (USHORT nI = 0; nI < nNoPages && bAllOk; ++nI)
++ bAllOk = pSh->SttNxtPg();
++ return bAllOk;
++ }
++
++ void lcl_ChangePage(SwWrtShell *pSh, USHORT nNewNumber,
++ const SwPageDesc *pNewDesc)
++ {
++ const USHORT nCurIdx = pSh->GetCurPageDesc();
++ const SwPageDesc &rCurrentDesc = pSh->GetPageDesc( nCurIdx );
++
++ const SwFmtPageDesc *pPageFmtDesc(0);
++ USHORT nDontCare;
++ lcl_GetPageDesc(pSh, nDontCare, &pPageFmtDesc);
++
++ //If we want a new number then set it, otherwise reuse the existing one
++ USHORT nPgNo = nNewNumber ?
++ nNewNumber : ( pPageFmtDesc ? pPageFmtDesc->GetNumOffset() : 0 );
++
++ //If we want a new descriptior then set it, otherwise reuse the existing one
++ if (!pNewDesc)
++ {
++ SwFmtPageDesc aPageFmtDesc(pPageFmtDesc ? *pPageFmtDesc : &rCurrentDesc);
++ if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
++ pSh->SetAttr(aPageFmtDesc);
++ }
++ else
++ {
++ SwFmtPageDesc aPageFmtDesc(pNewDesc);
++ if (nPgNo) aPageFmtDesc.SetNumOffset(nPgNo);
++ pSh->SetAttr(aPageFmtDesc);
++ }
++
++ delete pPageFmtDesc;
++ }
++
++ void lcl_PushCursor(SwWrtShell *pSh)
++ {
++ pSh->LockView( TRUE );
++ pSh->StartAllAction();
++ pSh->SwCrsrShell::Push();
++ }
++
++ void lcl_PopCursor(SwWrtShell *pSh)
++ {
++ pSh->SwCrsrShell::Pop( FALSE );
++ pSh->EndAllAction();
++ pSh->LockView( FALSE );
++ }
++
++ USHORT lcl_GetCurrentPage(SwWrtShell *pSh)
++ {
++ String sDummy;
++ USHORT nPhyNum=1, nVirtNum=1;
++ pSh->GetPageNumber(0, true, nPhyNum, nVirtNum, sDummy);
++ return nPhyNum;
++ }
++}
++
++/*
++ * Only include the Index page in the list if the page count implies one
++ * to reduce confusing things
++ */
++void SwTitlePageDlg::FillList()
++{
++ USHORT nTitlePages = aPageCountNF.GetValue();
++ aPagePropertiesLB.Clear();
++ if (mpTitleDesc)
++ aPagePropertiesLB.InsertEntry(mpTitleDesc->GetName());
++ if (nTitlePages > 1 && mpIndexDesc)
++ aPagePropertiesLB.InsertEntry(mpIndexDesc->GetName());
++ if (mpNormalDesc)
++ aPagePropertiesLB.InsertEntry(mpNormalDesc->GetName());
++ aPagePropertiesLB.SelectEntryPos(0);
++}
++
++/*--------------------------------------------------------------------
++ Beschreibung:
++ --------------------------------------------------------------------*/
++
++USHORT SwTitlePageDlg::GetInsertPosition() const
++{
++ USHORT nPage = 1;
++ if (aPageStartNF.IsEnabled())
++ nPage = aPageStartNF.GetValue();
++ return nPage;
++}
++
++SwTitlePageDlg::SwTitlePageDlg( Window *pParent ) :
++ SfxModalDialog( pParent, SW_RES(DLG_TITLEPAGE) ),
++#pragma warning (disable : 4355)
++ aMakeInsertFL ( this, SW_RES( FL_MAKEINSERT )),
++ aUseExistingPagesRB ( this, SW_RES( RB_USE_EXISTING_PAGES )),
++ aInsertNewPagesRB ( this, SW_RES( RB_INSERT_NEW_PAGES )),
++ aPageCountFT ( this, SW_RES( FT_PAGE_COUNT )),
++ aPageCountNF ( this, SW_RES( NF_PAGE_COUNT )),
++ aPagePagesFT ( this, SW_RES( FT_PAGE_PAGES )),
++ aPageStartFT ( this, SW_RES( FT_PAGE_START )),
++ aDocumentStartRB ( this, SW_RES( RB_DOCUMENT_START )),
++ aPageStartRB ( this, SW_RES( RB_PAGE_START )),
++ aPageStartNF ( this, SW_RES( NF_PAGE_START )),
++ aNumberingFL ( this, SW_RES( FL_NUMBERING )),
++ aRestartNumberingCB ( this, SW_RES( CB_RESTART_NUMBERING )),
++ aRestartNumberingFT ( this, SW_RES( FT_RESTART_NUMBERING )),
++ aRestartNumberingNF ( this, SW_RES( NF_RESTART_NUMBERING )),
++ aSetPageNumberCB ( this, SW_RES( CB_SET_PAGE_NUMBER )),
++ aSetPageNumberFT ( this, SW_RES( FT_SET_PAGE_NUMBER )),
++ aSetPageNumberNF ( this, SW_RES( NF_SET_PAGE_NUMBER )),
++ aPagePropertiesFL ( this, SW_RES( FL_PAGE_PROPERTIES )),
++ aPagePropertiesLB ( this, SW_RES( LB_PAGE_PROPERTIES )),
++ aPagePropertiesPB ( this, SW_RES( PB_PAGE_PROPERTIES )),
++ aBottomFL ( this, SW_RES( FL_BOTTOM )),
++ aOkPB ( this, SW_RES( PB_OK )),
++ aCancelPB ( this, SW_RES( PB_CANCEL )),
++ aHelpPB ( this, SW_RES( PB_HELP )),
++ mpPageFmtDesc (0)
++#pragma warning (default : 4355)
++{
++ FreeResource();
++
++ aOkPB.SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
++ aRestartNumberingCB.SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
++ aSetPageNumberCB.SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
++
++ USHORT nSetPage = 1;
++ USHORT nResetPage = 1;
++ USHORT nTitlePages = 1;
++ mpSh = ::GetActiveView()->GetWrtShellPtr();
++ lcl_PushCursor(mpSh);
++
++ SwView& rView = mpSh->GetView();
++ rView.InvalidateRulerPos();
++
++ bool bMaybeResetNumbering = false;
++
++ mpTitleDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_FIRST);
++ mpIndexDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_REGISTER);
++ mpNormalDesc = mpSh->GetPageDescFromPool(RES_POOLPAGE_STANDARD);
++
++ mpSh->SttDoc();
++ if (lcl_GetPageDesc( mpSh, nSetPage, &mpPageFmtDesc ))
++ {
++ if (mpPageFmtDesc->GetPageDesc() == mpTitleDesc)
++ {
++ while (mpSh->SttNxtPg())
++ {
++ const USHORT nCurIdx = mpSh->GetCurPageDesc();
++ const SwPageDesc &rPageDesc = mpSh->GetPageDesc( nCurIdx );
++
++ if (mpIndexDesc != &rPageDesc)
++ {
++ mpNormalDesc = &rPageDesc;
++ bMaybeResetNumbering = lcl_GetPageDesc(mpSh, nResetPage, NULL);
++ break;
++ }
++ ++nTitlePages;
++ }
++ }
++ }
++ lcl_PopCursor(mpSh);
++
++ aUseExistingPagesRB.Check();
++ aPageCountNF.SetValue(nTitlePages);
++ aPageCountNF.SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
++ aPageCountNF.SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
++
++ aDocumentStartRB.Check();
++ aPageStartNF.Enable(false);
++ aPageStartNF.SetValue(lcl_GetCurrentPage(mpSh));
++ Link aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl);
++ aDocumentStartRB.SetClickHdl(aStartPageHdl);
++ aPageStartRB.SetClickHdl(aStartPageHdl);
++
++ if (bMaybeResetNumbering && nResetPage > 0)
++ {
++ aRestartNumberingCB.Check();
++ aRestartNumberingNF.SetValue(nResetPage);
++ }
++ aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
++
++ aSetPageNumberNF.SetValue(nSetPage);
++ if (nSetPage > 1)
++ aSetPageNumberCB.Check();
++ aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
++
++ FillList();
++ aPagePropertiesPB.SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
++}
++
++IMPL_LINK(SwTitlePageDlg, UpHdl, NumericField *, EMPTYARG)
++{
++ if (aPageCountNF.GetValue() == 2)
++ FillList();
++ return 0;
++}
++
++IMPL_LINK(SwTitlePageDlg, DownHdl, NumericField *, EMPTYARG)
++{
++ if (aPageCountNF.GetValue() == 1)
++ FillList();
++ return 0;
++}
++
++IMPL_LINK(SwTitlePageDlg, RestartNumberingHdl, CheckBox*, EMPTYARG)
++{
++ aRestartNumberingNF.Enable(aRestartNumberingCB.IsChecked());
++ return 0;
++}
++
++IMPL_LINK(SwTitlePageDlg, SetPageNumberHdl, CheckBox*, EMPTYARG)
++{
++ aSetPageNumberNF.Enable(aSetPageNumberCB.IsChecked());
++ return 0;
++}
++
++IMPL_LINK(SwTitlePageDlg, StartPageHdl, RadioButton*, EMPTYARG)
++{
++ aPageStartNF.Enable(aPageStartRB.IsChecked());
++ return 0;
++}
++
++__EXPORT SwTitlePageDlg::~SwTitlePageDlg()
++{
++ delete mpPageFmtDesc;
++}
++
++IMPL_LINK( SwTitlePageDlg, EditHdl, Button *, /*pBtn*/ )
++{
++ SwView& rView = mpSh->GetView();
++ rView.GetDocShell()->FormatPage(aPagePropertiesLB.GetSelectEntry(), false, mpSh);
++ rView.InvalidateRulerPos();
++
++ return 0;
++}
++
++IMPL_LINK( SwTitlePageDlg, OKHdl, Button *, /*pBtn*/ )
++{
++ lcl_PushCursor(mpSh);
++
++ mpSh->StartUndo();
++
++ SwFmtPageDesc aTitleDesc(mpTitleDesc);
++
++ if (aSetPageNumberCB.IsChecked())
++ aTitleDesc.SetNumOffset(aSetPageNumberNF.GetValue());
++ else if (mpPageFmtDesc)
++ aTitleDesc.SetNumOffset(mpPageFmtDesc->GetNumOffset());
++
++ USHORT nNoPages = aPageCountNF.GetValue();
++ if (!aUseExistingPagesRB.IsChecked())
++ {
++ mpSh->GotoPage(GetInsertPosition(), false);
++ for (USHORT nI=0; nI < nNoPages; ++nI)
++ mpSh->InsertPageBreak();
++ }
++
++ mpSh->GotoPage(GetInsertPosition(), false);
++ for (USHORT nI=1; nI < nNoPages; ++nI)
++ {
++ if (mpSh->SttNxtPg())
++ lcl_ChangePage(mpSh, 0, mpIndexDesc);
++ }
++
++ mpSh->GotoPage(GetInsertPosition(), false);
++ mpSh->SetAttr(aTitleDesc);
++
++ if (nNoPages > 1 && mpSh->GotoPage(GetInsertPosition() + nNoPages, false))
++ {
++ SwFmtPageDesc aPageFmtDesc(mpNormalDesc);
++ mpSh->SetAttr(aPageFmtDesc);
++ }
++
++ if (aRestartNumberingCB.IsChecked() || nNoPages > 1)
++ {
++ USHORT nPgNo = aRestartNumberingCB.IsChecked() ? aRestartNumberingNF.GetValue() : 0;
++ const SwPageDesc *pNewDesc = nNoPages > 1 ? mpNormalDesc : 0;
++ mpSh->GotoPage(GetInsertPosition() + nNoPages, false);
++ lcl_ChangePage(mpSh, nPgNo, pNewDesc);
++ }
++
++ mpSh->EndUndo();
++ lcl_PopCursor(mpSh);
++ if (!aUseExistingPagesRB.IsChecked())
++ mpSh->GotoPage(GetInsertPosition(), false);
++ EndDialog( RET_OK );
++ return 0;
++}
++
++/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+--- /dev/null 2008-10-28 16:28:18.200260089 +0000
++++ openoffice.org/sw/source/ui/misc/titlepage.hrc 2008-11-13 10:21:32.000000000 +0000
+@@ -0,0 +1,58 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ *
++ * $Revision$
++ *
++ * last change: $Author$ $Date$
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++#define FL_MAKEINSERT 1
++#define RB_USE_EXISTING_PAGES 2
++#define RB_INSERT_NEW_PAGES 3
++#define FT_PAGE_COUNT 4
++#define NF_PAGE_COUNT 5
++#define FT_PAGE_PAGES 6
++#define FT_PAGE_START 7
++#define RB_DOCUMENT_START 8
++#define RB_PAGE_START 9
++#define NF_PAGE_START 10
++#define FL_NUMBERING 11
++#define CB_RESTART_NUMBERING 12
++#define FT_RESTART_NUMBERING 13
++#define NF_RESTART_NUMBERING 14
++#define CB_SET_PAGE_NUMBER 15
++#define FT_SET_PAGE_NUMBER 16
++#define NF_SET_PAGE_NUMBER 17
++#define FL_PAGE_PROPERTIES 18
++#define LB_PAGE_PROPERTIES 19
++#define PB_PAGE_PROPERTIES 20
++#define FL_BOTTOM 21
++#define PB_OK 22
++#define PB_CANCEL 23
++#define PB_HELP 24
diff --git a/openoffice.org-2.3.0.ooo76649.httpencoding.patch b/openoffice.org-2.3.0.ooo76649.httpencoding.patch
new file mode 100644
index 0000000..3125263
--- /dev/null
+++ b/openoffice.org-2.3.0.ooo76649.httpencoding.patch
@@ -0,0 +1,13 @@
+diff -ru svtools.orig/source/svhtml/parhtml.cxx svtools/source/svhtml/parhtml.cxx
+--- svtools.orig/source/svhtml/parhtml.cxx 2010-07-14 11:11:17.000000000 +0100
++++ svtools/source/svhtml/parhtml.cxx 2010-07-14 11:16:29.000000000 +0100
+@@ -323,6 +323,9 @@
+ bReadComment = FALSE;
+ bIsInHeader = TRUE;
+ pOptions = new HTMLOptions;
++
++ //#i76649, default to UTF-8 for HTML unless we know differently
++ SetSrcEncoding(RTL_TEXTENCODING_UTF8);
+ }
+
+ HTMLParser::~HTMLParser()
diff --git a/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch b/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch
new file mode 100644
index 0000000..a12639c
--- /dev/null
+++ b/openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch
@@ -0,0 +1,47 @@
+--- openoffice.org.orig/desktop/scripts/unopkg.sh 2008-01-14 15:55:26.000000000 +0000
++++ openoffice.org/desktop/scripts/unopkg.sh 2008-02-14 10:52:10.000000000 +0000
+@@ -43,6 +43,33 @@
+ sd_prog=`pwd`
+ cd "$sd_cwd"
+
++isshared=0
++for arg in $@
++do
++if [ "$arg" = "--shared" ]; then
++ isshared=1
++fi
++done
++if [ $isshared -eq 1 ]; then
++ echo $@ | grep -q env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY
++ if [ $? -ne 0 ]; then
++ set -- $@ '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
++ fi
++ echo $@ | grep -q env:UNO_JAVA_JFW_INSTALL_DATA
++ if [ $? -ne 0 -a -w $sd_prog/../share/config/javasettingsunopkginstall.xml ]; then
++ set -- $@ '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
++ fi
++ echo $@ | grep -q env:UserInstallation
++ if [ $? -ne 0 ]; then
++ INSTDIR=`/bin/mktemp -d --tmpdir unoinstall.XXXXXX`
++ if [ $? -ne 0 ]; then
++ echo "Could not create tmp dir" >&2
++ exit 1
++ fi
++ set -- $@ '-env:UserInstallation=file://'$INSTDIR
++ fi
++fi
++
+ #collect all bootstrap variables specified on the command line
+ #so that they can be passed as arguments to javaldx later on
+ for arg in $@
+@@ -71,6 +98,8 @@
+ # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
+
+ # execute binary
+-exec "$sd_prog/unopkg.bin" "$@" \
++"$sd_prog/unopkg.bin" "$@" \
+ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
+-
++if [ -n "$INSTDIR" ]; then
++ rm -rf $INSTDIR
++fi
diff --git a/openoffice.org-3.0.0.ooo88341.sc.verticalboxes.patch b/openoffice.org-3.0.0.ooo88341.sc.verticalboxes.patch
new file mode 100644
index 0000000..72369d8
--- /dev/null
+++ b/openoffice.org-3.0.0.ooo88341.sc.verticalboxes.patch
@@ -0,0 +1,102 @@
+Index: source/ui/inc/output.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/inc/output.hxx,v
+retrieving revision 1.19
+diff -u -r1.19 output.hxx
+--- openoffice.org.orig/sc/source/ui/inc/output.hxx 26 Jun 2007 11:50:45 -0000 1.19
++++ openoffice.org/sc/source/ui/inc/output.hxx 16 Apr 2008 12:05:59 -0000
+@@ -242,6 +242,7 @@
+ void DrawExtraShadow(BOOL bLeft, BOOL bTop, BOOL bRight, BOOL bBottom);
+ void DrawFrame();
+
++ bool UseNormalClip(SCROW nCellY, const SfxItemSet* pCondSet);
+ // with logic MapMode set!
+ void DrawEdit(BOOL bPixelToLogic);
+
+Index: source/ui/view/output2.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/output2.cxx,v
+retrieving revision 1.54.216.1
+diff -u -r1.54.216.1 output2.cxx
+--- openoffice.org.orig/sc/source/ui/view/output2.cxx 18 Jan 2008 12:02:36 -0000 1.54.216.1
++++ openoffice.org/sc/source/ui/view/output2.cxx 16 Apr 2008 12:19:34 -0000
+@@ -1907,6 +1907,21 @@
+ }
+ }
+
++bool ScOutputData::UseNormalClip(SCROW nCellY, const SfxItemSet* pCondSet)
++{
++ bool bNormalClip = false;
++ // Don't clip for text height when printing rows with optimal height,
++ // except when font size is from conditional formatting.
++ //! Allow clipping when vertically merged?
++ if ( eType != OUTTYPE_PRINTER ||
++ ( pDoc->GetRowFlags( nCellY, nTab ) & CR_MANUALSIZE ) ||
++ ( pCondSet && SFX_ITEM_SET ==
++ pCondSet->GetItemState(ATTR_FONT_HEIGHT, TRUE) ) )
++ bNormalClip = TRUE;
++ return bNormalClip;
++}
++
++
+ void ScOutputData::DrawEdit(BOOL bPixelToLogic)
+ {
+ vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() );
+@@ -2524,13 +2539,8 @@
+ (ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE);
+ BOOL bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
+
+- // Don't clip for text height when printing rows with optimal height,
+- // except when font size is from conditional formatting.
+- //! Allow clipping when vertically merged?
+- if ( eType != OUTTYPE_PRINTER ||
+- ( pDoc->GetRowFlags( nCellY, nTab ) & CR_MANUALSIZE ) ||
+- ( pCondSet && SFX_ITEM_SET ==
+- pCondSet->GetItemState(ATTR_FONT_HEIGHT, TRUE) ) )
++
++ if (UseNormalClip(nCellY, pCondSet))
+ bClip = TRUE;
+ else
+ bSimClip = TRUE;
+@@ -2580,6 +2590,18 @@
+ #endif
+
+ Rectangle aLogicClip;
++ if (
++ ((nAttrRotate == 9000) || (nAttrRotate == 27000)) &&
++ (!(eOrient==SVX_ORIENTATION_STANDARD && !bAsianVertical)) &&
++ (!(bClip || bSimClip))
++ )
++ {
++ if (UseNormalClip(nCellY, pCondSet))
++ bClip = TRUE;
++ else
++ bSimClip = TRUE;
++ }
++
+ if (bClip || bSimClip)
+ {
+ // Clip marks are already handled in GetOutputArea
+@@ -2635,10 +2657,20 @@
+ }
+ else
+ {
++ long nDiff = 0;
+ if (eHorJust==SVX_HOR_JUSTIFY_RIGHT)
+- aLogicStart.X() += nAvailWidth - nEngineWidth;
++ nDiff = nAvailWidth - nEngineWidth;
+ else if (eHorJust==SVX_HOR_JUSTIFY_CENTER)
+- aLogicStart.X() += (nAvailWidth - nEngineWidth) / 2;
++ nDiff = (nAvailWidth - nEngineWidth) / 2;
++
++ if (nEngineWidth > nAvailWidth)
++ {
++ if (nAttrRotate == 9000)
++ nDiff = 0;
++ else if (nAttrRotate == 27000)
++ nDiff = nAvailWidth - nEngineWidth;
++ }
++ aLogicStart.X() += nDiff;
+ }
+ }
+
diff --git a/openoffice.org-3.1.0.ooo101274.opening-a-directory.patch b/openoffice.org-3.1.0.ooo101274.opening-a-directory.patch
new file mode 100644
index 0000000..8475362
--- /dev/null
+++ b/openoffice.org-3.1.0.ooo101274.opening-a-directory.patch
@@ -0,0 +1,174 @@
+Index: ucbhelper/source/client/content.cxx
+===================================================================
+--- ucbhelper/source/client/content.cxx (revision 270567)
++++ ucbhelper/source/client/content.cxx (working copy)
+@@ -39,6 +39,7 @@
+ #include <cppuhelper/weak.hxx>
+
+ #include <cppuhelper/implbase1.hxx>
++#include <com/sun/star/beans/PropertyValue.hpp>
+ #include <com/sun/star/ucb/ContentCreationError.hpp>
+ #include <com/sun/star/ucb/XCommandEnvironment.hpp>
+ #include <com/sun/star/ucb/XCommandInfo.hpp>
+@@ -48,6 +49,8 @@
+ #include <com/sun/star/ucb/ContentAction.hpp>
+ #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
+ #include <com/sun/star/ucb/InsertCommandArgument.hpp>
++#include <com/sun/star/ucb/IOErrorCode.hpp>
++#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
+ #include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp>
+ #include <com/sun/star/ucb/NameClash.hpp>
+ #include <com/sun/star/ucb/OpenMode.hpp>
+@@ -65,6 +68,8 @@
+ #include <com/sun/star/sdbc/XRow.hpp>
+ #include <com/sun/star/lang/IllegalArgumentException.hpp>
+ #include <com/sun/star/beans/UnknownPropertyException.hpp>
++#include <com/sun/star/task/XInteractionRequest.hpp>
++
+ #include <ucbhelper/macros.hxx>
+ #include <ucbhelper/content.hxx>
+ #include <ucbhelper/contentbroker.hxx>
+@@ -72,6 +77,10 @@
+ #include <ucbhelper/activedatastreamer.hxx>
+ #include <ucbhelper/interactionrequest.hxx>
+ #include <ucbhelper/cancelcommandexecution.hxx>
++#include <ucbhelper/fileidentifierconverter.hxx>
++#include <ucbhelper/simpleinteractionrequest.hxx>
++
++#include <memory>
+
+ using namespace com::sun::star::container;
+ using namespace com::sun::star::beans;
+@@ -375,6 +384,54 @@
+ return Reference< XContent >();
+ }
+
++namespace
++{
++
++void
++lcl_displayMessage(
++ const Reference<XCommandEnvironment>& rEnvironment,
++ const rtl::OUString& rUri)
++{
++ // Create exception
++ const Reference<XContentProviderManager> xCPM(
++ getContentBroker(true)->getContentProviderManagerInterface());
++ const PropertyValue aUriProperty(
++ rtl::OUString::createFromAscii("Uri"),
++ -1,
++ makeAny(getSystemPathFromFileURL(xCPM, rUri)),
++ PropertyState_DIRECT_VALUE)
++ ;
++ Sequence<Any> lArguments(1);
++ lArguments[0] <<= aUriProperty;
++ const InteractiveAugmentedIOException xError(
++ rtl::OUString(),
++ 0,
++ InteractionClassification_ERROR,
++ IOErrorCode_NO_FILE,
++ lArguments)
++ ;
++
++ // Create interaction request
++ std::auto_ptr<ucbhelper::SimpleInteractionRequest> aRequest(
++ new ucbhelper::SimpleInteractionRequest(makeAny(xError), CONTINUATION_APPROVE));
++ {
++ Reference<XInteractionContinuation> xContinuation(
++ new ::ucbhelper::InteractionApprove(aRequest.get()));
++ Sequence<Reference<XInteractionContinuation> > lContinuations(1);
++ lContinuations[0].set(xContinuation);
++ aRequest->setContinuations(lContinuations);
++ }
++
++ Reference<XInteractionHandler> xInteraction(rEnvironment->getInteractionHandler());
++ if (xInteraction.is())
++ {
++ Reference<XInteractionRequest> xRequest(aRequest.release());
++ xInteraction->handle(xRequest);
++ }
++}
++
++}
++
+ //=========================================================================
+ //=========================================================================
+ //
+@@ -1186,7 +1243,10 @@
+ throw( CommandAbortedException, RuntimeException, Exception )
+ {
+ if ( !isDocument() )
++ {
++ lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
+ return Reference< XInputStream >();
++ }
+
+ Reference< XActiveDataSink > xSink = new ActiveDataSink;
+
+@@ -1211,7 +1271,10 @@
+ throw( CommandAbortedException, RuntimeException, Exception )
+ {
+ if ( !isDocument() )
++ {
++ lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
+ return Reference< XInputStream >();
++ }
+
+ Reference< XActiveDataSink > xSink = new ActiveDataSink;
+
+@@ -1236,7 +1299,10 @@
+ throw( CommandAbortedException, RuntimeException, Exception )
+ {
+ if ( !isDocument() )
++ {
++ lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
+ return Reference< XStream >();
++ }
+
+ Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer;
+
+@@ -1261,7 +1327,10 @@
+ throw( CommandAbortedException, RuntimeException, Exception )
+ {
+ if ( !isDocument() )
++ {
++ lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
+ return Reference< XStream >();
++ }
+
+ Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer;
+
+@@ -1286,7 +1355,10 @@
+ throw( CommandAbortedException, RuntimeException, Exception )
+ {
+ if ( !isDocument() )
++ {
++ lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
+ return sal_False;
++ }
+
+ OpenCommandArgument2 aArg;
+ aArg.Mode = OpenMode::DOCUMENT;
+@@ -1309,7 +1381,10 @@
+ throw( CommandAbortedException, RuntimeException, Exception )
+ {
+ if ( !isDocument() )
++ {
++ lcl_displayMessage(m_xImpl->getEnvironment(), getURL());
+ return sal_False;
++ }
+
+ OpenCommandArgument2 aArg;
+ aArg.Mode = OpenMode::DOCUMENT;
+Index: comphelper/source/misc/mediadescriptor.cxx
+===================================================================
+--- comphelper/source/misc/stillreadwriteinteraction.cxx 2010-07-06 15:32:02.000000000 +0100
++++ comphelper/source/misc/stillreadwriteinteraction.cxx 2010-07-06 15:32:31.000000000 +0100
+@@ -103,6 +103,7 @@
+ bAbort = (
+ (exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED )
+ || (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION )
++ || (exIO.Code == css::ucb::IOErrorCode_NO_FILE )
+ || (exIO.Code == css::ucb::IOErrorCode_NOT_EXISTING )
+ #ifdef MACOSX
+ // this is a workaround for MAC, on this platform if the file is locked
diff --git a/openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch b/openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch
new file mode 100644
index 0000000..1f781a4
--- /dev/null
+++ b/openoffice.org-3.1.0.ooo102061.sc.cellanchoring.patch
@@ -0,0 +1,1751 @@
+diff -ru sc.orig/inc/document.hxx sc/inc/document.hxx
+--- sc.orig/inc/document.hxx 2009-06-04 12:39:48.000000000 +0100
++++ sc/inc/document.hxx 2009-06-04 12:40:23.000000000 +0100
+@@ -1319,8 +1319,8 @@
+ void RestorePrintRanges( const ScPrintRangeSaver& rSaver );
+
+ SC_DLLPUBLIC Rectangle GetMMRect( SCCOL nStartCol, SCROW nStartRow,
+- SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
+- SC_DLLPUBLIC ScRange GetRange( SCTAB nTab, const Rectangle& rMMRect );
++ SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const;
++ SC_DLLPUBLIC ScRange GetRange( SCTAB nTab, const Rectangle& rMMRect ) const;
+
+ void UpdStlShtPtrsFrmNms();
+ void StylesToNames();
+diff -ru sc.orig/inc/drwlayer.hxx sc/inc/drwlayer.hxx
+--- sc.orig/inc/drwlayer.hxx 2009-06-04 12:39:49.000000000 +0100
++++ sc/inc/drwlayer.hxx 2009-06-04 12:40:23.000000000 +0100
+@@ -107,12 +107,10 @@
+ BOOL bHyphenatorSet;
+
+ private:
+- void MoveAreaTwips( SCTAB nTab, const Rectangle& rArea, const Point& rMove,
+- const Point& rTopLeft );
+ void MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
+ SCsCOL nDx,SCsROW nDy, bool bUpdateNoteCaptionPos );
+
+- void RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos );
++ void RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos );
+
+ public:
+ ScDrawLayer( ScDocument* pDocument, const String& rName );
+@@ -194,8 +192,11 @@
+ void EnsureGraphicNames();
+
+ // Verankerung setzen und ermitteln
+- static void SetAnchor( SdrObject*, ScAnchorType );
+- static ScAnchorType GetAnchor( const SdrObject* );
++ static void SetPageAnchored( SdrObject& );
++ static void SetCellAnchored( SdrObject&, const ScDrawObjData &rAnchor );
++ static void SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
++ static void UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab );
++ static ScAnchorType GetAnchorType( const SdrObject& );
+
+ // Positionen fuer Detektivlinien
+ static ScDrawObjData* GetObjData( SdrObject* pObj, BOOL bCreate=FALSE );
+diff -ru sc.orig/inc/userdat.hxx sc/inc/userdat.hxx
+--- sc.orig/inc/userdat.hxx 2009-06-04 12:39:49.000000000 +0100
++++ sc/inc/userdat.hxx 2009-06-04 12:40:23.000000000 +0100
+@@ -63,12 +63,15 @@
+ public:
+ ScAddress maStart;
+ ScAddress maEnd;
++ Point maStartOffset;
++ Point maEndOffset;
+ bool mbNote;
++ Rectangle maLastRect;
+
+ explicit ScDrawObjData();
+
+ private:
+- virtual ScDrawObjData* Clone( SdrObject* pObj ) const;
++ virtual ScDrawObjData* Clone( SdrObject* pObj ) const;
+ };
+
+ //-------------------------------------------------------------------------
+diff -ru sc.orig/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
+--- sc.orig/source/core/data/documen3.cxx 2009-06-04 12:39:09.000000000 +0100
++++ sc/source/core/data/documen3.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -1605,7 +1605,7 @@
+ return bAdded;
+ }
+
+-ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect )
++ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) const
+ {
+ ScTable* pTable = pTab[nTab];
+ if (!pTable)
+@@ -1879,7 +1879,7 @@
+ }
+
+ Rectangle ScDocument::GetMMRect( SCCOL nStartCol, SCROW nStartRow,
+- SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
++ SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const
+ {
+ if (!ValidTab(nTab) || !pTab[nTab])
+ {
+diff -ru sc.orig/source/core/data/drwlayer.cxx sc/source/core/data/drwlayer.cxx
+--- sc.orig/source/core/data/drwlayer.cxx 2009-06-04 12:39:09.000000000 +0100
++++ sc/source/core/data/drwlayer.cxx 2009-06-05 12:28:12.000000000 +0100
+@@ -68,6 +68,9 @@
+ #include <vcl/svapp.hxx>
+ #include <unotools/ucbstreamhelper.hxx>
+
++#include <basegfx/polygon/b2dpolygon.hxx>
++#include <basegfx/polygon/b2dpolygontools.hxx>
++
+ #include "drwlayer.hxx"
+ #include "drawpage.hxx"
+ #include "global.hxx"
+@@ -526,7 +529,41 @@
+ }
+ }
+
+-void ScDrawLayer::RecalcPos( SdrObject* pObj, const ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos )
++namespace
++{
++ //Can't have a zero width dimension
++ Rectangle lcl_makeSafeRectangle(const Rectangle &rNew)
++ {
++ Rectangle aRect = rNew;
++ if (aRect.Bottom() == aRect.Top())
++ aRect.Bottom() = aRect.Top()+1;
++ if (aRect.Right() == aRect.Left())
++ aRect.Right() = aRect.Left()+1;
++ return aRect;
++ }
++
++ Point lcl_calcAvailableDiff(ScDocument &rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const Point &aWantedDiff)
++ {
++ Point aAvailableDiff(aWantedDiff);
++ long nHeight = rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS;
++ long nWidth = rDoc.GetColWidth( nCol, nTab ) * HMM_PER_TWIPS;
++ if (aAvailableDiff.Y() > nHeight)
++ aAvailableDiff.Y() = nHeight;
++ if (aAvailableDiff.X() > nWidth)
++ aAvailableDiff.X() = nWidth;
++ return aAvailableDiff;
++ }
++
++ Rectangle lcl_UpdateCalcPoly(basegfx::B2DPolygon &rCalcPoly, int nWhichPoint, const Point &rPos)
++ {
++ rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y()));
++ basegfx::B2DRange aRange(basegfx::tools::getRange(rCalcPoly));
++ return Rectangle(aRange.getMinX(), aRange.getMinY(),
++ aRange.getMaxX(), aRange.getMaxY());
++ }
++}
++
++void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegativePage, bool bUpdateNoteCaptionPos )
+ {
+ DBG_ASSERT( pDoc, "ScDrawLayer::RecalcPos - missing document" );
+ if( !pDoc )
+@@ -565,6 +602,8 @@
+
+ if( bCircle )
+ {
++ rData.maLastRect = pObj->GetLogicRect();
++
+ Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
+ TwipsToMM( aPos.X() );
+ TwipsToMM( aPos.Y() );
+@@ -585,11 +624,18 @@
+ {
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+- pObj->SetLogicRect(aRect);
++ rData.maLastRect = lcl_makeSafeRectangle(aRect);
++ pObj->SetLogicRect(rData.maLastRect);
+ }
+ }
+ else if( bArrow )
+ {
++ rData.maLastRect = pObj->GetLogicRect();
++ basegfx::B2DPolygon aCalcPoly;
++ Point aOrigStartPos(pObj->GetPoint(0));
++ Point aOrigEndPos(pObj->GetPoint(1));
++ aCalcPoly.append(basegfx::B2DPoint(aOrigStartPos.X(), aOrigStartPos.Y()));
++ aCalcPoly.append(basegfx::B2DPoint(aOrigEndPos.X(), aOrigEndPos.Y()));
+ //! nicht mehrere Undos fuer ein Objekt erzeugen (hinteres kann dann weggelassen werden)
+
+ SCCOL nLastCol;
+@@ -610,6 +656,8 @@
+ {
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
++
++ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 0, aStartPos);
+ pObj->SetPoint( aStartPos, 0 );
+ }
+
+@@ -624,6 +672,8 @@
+ {
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
++
++ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 1, aEndPos);
+ pObj->SetPoint( aEndPos, 1 );
+ }
+ }
+@@ -644,6 +694,8 @@
+ {
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
++
++ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 1, aEndPos);
+ pObj->SetPoint( aEndPos, 1 );
+ }
+
+@@ -660,45 +712,68 @@
+ {
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
++
++ rData.maLastRect = lcl_UpdateCalcPoly(aCalcPoly, 0, aStartPos);
+ pObj->SetPoint( aStartPos, 0 );
+ }
+ }
+ }
+ }
+- else // Referenz-Rahmen
++ else
+ {
++ bool bCanResize = bValid2 && !pObj->IsResizeProtect();
++
++ //First time positioning, must be able to at least move it
++ if (rData.maLastRect.IsEmpty())
++ rData.maLastRect = pObj->GetLogicRect();
++
+ DBG_ASSERT( bValid1, "ScDrawLayer::RecalcPos - invalid start position" );
+ Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
+ TwipsToMM( aPos.X() );
+ TwipsToMM( aPos.Y() );
++ aPos += lcl_calcAvailableDiff(*pDoc, nCol1, nRow1, nTab1, rData.maStartOffset);
+
+- if( bValid2 )
++ if( bCanResize )
+ {
+- Point aEnd( pDoc->GetColOffset( nCol2 + 1, nTab2 ), pDoc->GetRowOffset( nRow2 + 1, nTab2 ) );
++ Point aEnd( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
+ TwipsToMM( aEnd.X() );
+ TwipsToMM( aEnd.Y() );
++ aEnd += lcl_calcAvailableDiff(*pDoc, nCol2, nRow2, nTab2, rData.maEndOffset);
+
+ Rectangle aNew( aPos, aEnd );
+ if ( bNegativePage )
+ MirrorRectRTL( aNew );
+ if ( pObj->GetLogicRect() != aNew )
+ {
++ Rectangle aOld(pObj->GetLogicRect());
++
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
+- pObj->SetLogicRect(aNew);
++ rData.maLastRect = lcl_makeSafeRectangle(aNew);
++ pObj->SetLogicRect(rData.maLastRect);
+ }
+ }
+ else
+ {
+ if ( bNegativePage )
+- aPos.X() = -aPos.X();
++ aPos.X() = -aPos.X() - rData.maLastRect.GetWidth();
+ if ( pObj->GetRelativePos() != aPos )
+ {
+ if (bRecording)
+ AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
++ rData.maLastRect.SetPos( aPos );
+ pObj->SetRelativePos( aPos );
+ }
+ }
++
++ /*
++ * If we were not allowed resize the object, then the end cell anchor
++ * is possibly incorrect now, and if the object has no end-cell (e.g.
++ * missing in original .xml) we are also forced to generate one
++ */
++ bool bEndAnchorIsBad = !bValid2 || pObj->IsResizeProtect();
++ if (bEndAnchorIsBad)
++ ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, *pDoc, nTab1);
+ }
+ }
+
+@@ -873,151 +948,6 @@
+ return pRet;
+ }
+
+-// MoveAreaTwips: all measures are kept in twips
+-void ScDrawLayer::MoveAreaTwips( SCTAB nTab, const Rectangle& rArea,
+- const Point& rMove, const Point& rTopLeft )
+-{
+- if (!rMove.X() && !rMove.Y())
+- return; // nix
+-
+- SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
+- DBG_ASSERT(pPage,"Page nicht gefunden");
+- if (!pPage)
+- return;
+-
+- BOOL bNegativePage = pDoc && pDoc->IsNegativePage( nTab );
+-
+- // fuer Shrinking!
+- Rectangle aNew( rArea );
+- BOOL bShrink = FALSE;
+- if ( rMove.X() < 0 || rMove.Y() < 0 ) // verkleinern
+- {
+- if ( rTopLeft != rArea.TopLeft() ) // sind gleich beim Verschieben von Zellen
+- {
+- bShrink = TRUE;
+- aNew.Left() = rTopLeft.X();
+- aNew.Top() = rTopLeft.Y();
+- }
+- }
+- SdrObjListIter aIter( *pPage, IM_FLAT );
+- SdrObject* pObject = aIter.Next();
+- while (pObject)
+- {
+- if( GetAnchor( pObject ) == SCA_CELL )
+- {
+- if ( GetObjData( pObject ) ) // Detektiv-Pfeil ?
+- {
+- // hier nichts
+- }
+- else if ( pObject->ISA( SdrEdgeObj ) ) // Verbinder?
+- {
+- // hier auch nichts
+- //! nicht verbundene Enden wie bei Linien (s.u.) behandeln?
+- }
+- else if ( pObject->IsPolyObj() && pObject->GetPointCount()==2 )
+- {
+- for (USHORT i=0; i<2; i++)
+- {
+- BOOL bMoved = FALSE;
+- Point aPoint = pObject->GetPoint(i);
+- lcl_ReverseTwipsToMM( aPoint );
+- if (rArea.IsInside(aPoint))
+- {
+- aPoint += rMove; bMoved = TRUE;
+- }
+- else if (bShrink && aNew.IsInside(aPoint))
+- {
+- // Punkt ist in betroffener Zelle - Test auf geloeschten Bereich
+- if ( rMove.X() && aPoint.X() >= rArea.Left() + rMove.X() )
+- {
+- aPoint.X() = rArea.Left() + rMove.X() - SHRINK_DIST_TWIPS;
+- if ( aPoint.X() < 0 ) aPoint.X() = 0;
+- bMoved = TRUE;
+- }
+- if ( rMove.Y() && aPoint.Y() >= rArea.Top() + rMove.Y() )
+- {
+- aPoint.Y() = rArea.Top() + rMove.Y() - SHRINK_DIST_TWIPS;
+- if ( aPoint.Y() < 0 ) aPoint.Y() = 0;
+- bMoved = TRUE;
+- }
+- }
+- if( bMoved )
+- {
+- AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
+- lcl_TwipsToMM( aPoint );
+- pObject->SetPoint( aPoint, i );
+- }
+- }
+- }
+- else
+- {
+- Rectangle aObjRect = pObject->GetLogicRect();
+- // aOldMMPos: not converted, millimeters
+- Point aOldMMPos = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft();
+- lcl_ReverseTwipsToMM( aObjRect );
+- Point aTopLeft = bNegativePage ? aObjRect.TopRight() : aObjRect.TopLeft(); // logical left
+- Size aMoveSize;
+- BOOL bDoMove = FALSE;
+- if (rArea.IsInside(aTopLeft))
+- {
+- aMoveSize = Size(rMove.X(),rMove.Y());
+- bDoMove = TRUE;
+- }
+- else if (bShrink && aNew.IsInside(aTopLeft))
+- {
+- // Position ist in betroffener Zelle - Test auf geloeschten Bereich
+- if ( rMove.X() && aTopLeft.X() >= rArea.Left() + rMove.X() )
+- {
+- aMoveSize.Width() = rArea.Left() + rMove.X() - SHRINK_DIST - aTopLeft.X();
+- bDoMove = TRUE;
+- }
+- if ( rMove.Y() && aTopLeft.Y() >= rArea.Top() + rMove.Y() )
+- {
+- aMoveSize.Height() = rArea.Top() + rMove.Y() - SHRINK_DIST - aTopLeft.Y();
+- bDoMove = TRUE;
+- }
+- }
+- if ( bDoMove )
+- {
+- if ( bNegativePage )
+- {
+- if ( aTopLeft.X() + aMoveSize.Width() > 0 )
+- aMoveSize.Width() = -aTopLeft.X();
+- }
+- else
+- {
+- if ( aTopLeft.X() + aMoveSize.Width() < 0 )
+- aMoveSize.Width() = -aTopLeft.X();
+- }
+- if ( aTopLeft.Y() + aMoveSize.Height() < 0 )
+- aMoveSize.Height() = -aTopLeft.Y();
+-
+- // get corresponding move size in millimeters:
+- Point aNewPos( aTopLeft.X() + aMoveSize.Width(), aTopLeft.Y() + aMoveSize.Height() );
+- lcl_TwipsToMM( aNewPos );
+- aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters
+-
+- AddCalcUndo( new SdrUndoMoveObj( *pObject, aMoveSize ) );
+- pObject->Move( aMoveSize );
+- }
+- else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) &&
+- !pObject->IsResizeProtect() )
+- {
+- // geschuetzte Groessen werden nicht veraendert
+- // (Positionen schon, weil sie ja an der Zelle "verankert" sind)
+- AddCalcUndo( new SdrUndoGeoObj( *pObject ) );
+- long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1;
+- long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1;
+- long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction
+- pObject->Resize( aOldMMPos, Fraction( nOldSizeX+nLogMoveX, nOldSizeX ),
+- Fraction( nOldSizeY+rMove.Y(), nOldSizeY ) );
+- }
+- }
+- }
+- pObject = aIter.Next();
+- }
+-}
+-
+ void ScDrawLayer::MoveArea( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2,
+ SCsCOL nDx,SCsROW nDy, BOOL bInsDel, bool bUpdateNoteCaptionPos )
+ {
+@@ -1059,11 +989,6 @@
+ aTopLeft.Y() += aMove.Y();
+ }
+
+- // drawing objects are now directly included in cut&paste
+- // -> only update references when inserting/deleting (or changing widths or heights)
+- if ( bInsDel )
+- MoveAreaTwips( nTab, aRect, aMove, aTopLeft );
+-
+ //
+ // Detektiv-Pfeile: Zellpositionen anpassen
+ //
+@@ -1101,8 +1026,6 @@
+ aTopLeft.X() = -aTopLeft.X();
+ nDifTwips = -nDifTwips;
+ }
+-
+- MoveAreaTwips( nTab, aRect, Point( nDifTwips,0 ), aTopLeft );
+ }
+
+ void ScDrawLayer::HeightChanged( SCTAB nTab, SCROW nRow, long nDifTwips )
+@@ -1133,8 +1056,6 @@
+ MirrorRectRTL( aRect );
+ aTopLeft.X() = -aTopLeft.X();
+ }
+-
+- MoveAreaTwips( nTab, aRect, Point( 0,nDifTwips ), aTopLeft );
+ }
+
+ BOOL ScDrawLayer::HasObjectsInRows( SCTAB nTab, SCROW nStartRow, SCROW nEndRow )
+@@ -1846,35 +1767,105 @@
+ }
+ }
+
+-void ScDrawLayer::SetAnchor( SdrObject* pObj, ScAnchorType eType )
++namespace
++{
++ SdrObjUserData* GetFirstUserDataOfType(const SdrObject *pObj, UINT16 nId)
++ {
++ USHORT nCount = pObj ? pObj->GetUserDataCount() : 0;
++ for( USHORT i = 0; i < nCount; i++ )
++ {
++ SdrObjUserData* pData = pObj->GetUserData( i );
++ if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId )
++ return pData;
++ }
++ return NULL;
++ }
++
++ void DeleteFirstUserDataOfType(SdrObject *pObj, UINT16 nId)
++ {
++ USHORT nCount = pObj ? pObj->GetUserDataCount() : 0;
++ for( USHORT i = nCount; i > 0; i-- )
++ {
++ SdrObjUserData* pData = pObj->GetUserData( i-1 );
++ if( pData && pData->GetInventor() == SC_DRAWLAYER && pData->GetId() == nId )
++ pObj->DeleteUserData(i-1);
++ }
++ }
++}
++
++void ScDrawLayer::SetCellAnchored( SdrObject &rObj, const ScDrawObjData &rAnchor )
++{
++ ScDrawObjData* pAnchor = GetObjData( &rObj, true );
++ pAnchor->maStart = rAnchor.maStart;
++ pAnchor->maEnd = rAnchor.maEnd;
++ pAnchor->maStartOffset = rAnchor.maStartOffset;
++ pAnchor->maEndOffset = rAnchor.maEndOffset;
++}
++
++void ScDrawLayer::SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab )
++{
++ Rectangle aObjRect(rObj.GetLogicRect());
++ ScRange aRange = rDoc.GetRange( nTab, aObjRect );
++
++ Rectangle aCellRect;
++
++ ScDrawObjData aAnchor;
++ aAnchor.maStart = aRange.aStart;
++ aCellRect = rDoc.GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(),
++ aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
++ aAnchor.maStartOffset.Y() = aObjRect.Top()-aCellRect.Top();
++ if (!rDoc.IsNegativePage(nTab))
++ aAnchor.maStartOffset.X() = aObjRect.Left()-aCellRect.Left();
++ else
++ aAnchor.maStartOffset.X() = aCellRect.Right()-aObjRect.Right();
++
++ aAnchor.maEnd = aRange.aEnd;
++ aCellRect = rDoc.GetMMRect( aRange.aEnd.Col(), aRange.aEnd.Row(),
++ aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab() );
++ aAnchor.maEndOffset.Y() = aObjRect.Bottom()-aCellRect.Top();
++ if (!rDoc.IsNegativePage(nTab))
++ aAnchor.maEndOffset.X() = aObjRect.Right()-aCellRect.Left();
++ else
++ aAnchor.maEndOffset.X() = aCellRect.Right()-aObjRect.Left();
++
++ SetCellAnchored( rObj, aAnchor );
++}
++
++void ScDrawLayer::UpdateCellAnchorFromPositionEnd( SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab )
+ {
+- ScAnchorType eOldAnchorType = GetAnchor( pObj );
++ Rectangle aObjRect(rObj.GetLogicRect());
++ ScRange aRange = rDoc.GetRange( nTab, aObjRect );
+
+- // Ein an der Seite verankertes Objekt zeichnet sich durch eine Anker-Pos
+- // von (0,1) aus. Das ist ein shabby Trick, der aber funktioniert!
+- Point aAnchor( 0, eType == SCA_PAGE ? 1 : 0 );
+- pObj->SetAnchorPos( aAnchor );
++ ScDrawObjData* pAnchor = GetObjData( &rObj, true );
++ pAnchor->maEnd = aRange.aEnd;
++
++ Rectangle aCellRect;
++ aCellRect = rDoc.GetMMRect( aRange.aEnd.Col(), aRange.aEnd.Row(),
++ aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aEnd.Tab() );
++ pAnchor->maEndOffset.Y() = aObjRect.Bottom()-aCellRect.Top();
++ if (!rDoc.IsNegativePage(nTab))
++ pAnchor->maEndOffset.X() = aObjRect.Right()-aCellRect.Left();
++ else
++ pAnchor->maEndOffset.X() = aCellRect.Right()-aObjRect.Left();
++}
+
+- if ( eOldAnchorType != eType )
+- pObj->notifyShapePropertyChange( ::svx::eSpreadsheetAnchor );
++void ScDrawLayer::SetPageAnchored( SdrObject &rObj )
++{
++ DeleteFirstUserDataOfType(&rObj, SC_UD_OBJDATA);
+ }
+
+-ScAnchorType ScDrawLayer::GetAnchor( const SdrObject* pObj )
++ScAnchorType ScDrawLayer::GetAnchorType( const SdrObject &rObj )
+ {
+- Point aAnchor( pObj->GetAnchorPos() );
+- return ( aAnchor.Y() != 0 ) ? SCA_PAGE : SCA_CELL;
++ //If this object has a cell anchor associated with it
++ //then its cell-anchored, otherwise its page-anchored
++ return ScDrawLayer::GetObjData(const_cast<SdrObject*>(&rObj)) ? SCA_CELL : SCA_PAGE;
+ }
+
+ ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, BOOL bCreate ) // static
+ {
+- USHORT nCount = pObj ? pObj->GetUserDataCount() : 0;
+- for( USHORT i = 0; i < nCount; i++ )
+- {
+- SdrObjUserData* pData = pObj->GetUserData( i );
+- if( pData && pData->GetInventor() == SC_DRAWLAYER
+- && pData->GetId() == SC_UD_OBJDATA )
+- return (ScDrawObjData*) pData;
+- }
++ if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_OBJDATA))
++ return (ScDrawObjData*) pData;
++
+ if( pObj && bCreate )
+ {
+ ScDrawObjData* pData = new ScDrawObjData;
+@@ -1911,15 +1902,7 @@
+
+ ScIMapInfo* ScDrawLayer::GetIMapInfo( SdrObject* pObj ) // static
+ {
+- USHORT nCount = pObj->GetUserDataCount();
+- for( USHORT i = 0; i < nCount; i++ )
+- {
+- SdrObjUserData* pData = pObj->GetUserData( i );
+- if( pData && pData->GetInventor() == SC_DRAWLAYER
+- && pData->GetId() == SC_UD_IMAPDATA )
+- return (ScIMapInfo*) pData;
+- }
+- return NULL;
++ return (ScIMapInfo*)GetFirstUserDataOfType(pObj, SC_UD_IMAPDATA);
+ }
+
+ // static:
+@@ -1972,7 +1955,7 @@
+ else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt
+ {
+ // TODO/LEAN: working with visual area needs running state
+- aGraphSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize();
++ aGraphSize = ((const SdrOle2Obj*)pObj)->GetOrigObjSize();
+ bObjSupported = TRUE;
+ }
+
+@@ -1990,14 +1973,9 @@
+
+ ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, BOOL bCreate ) // static
+ {
+- USHORT nCount = pObj->GetUserDataCount();
+- for( USHORT i = 0; i < nCount; i++ )
+- {
+- SdrObjUserData* pData = pObj->GetUserData( i );
+- if( pData && pData->GetInventor() == SC_DRAWLAYER
+- && pData->GetId() == SC_UD_MACRODATA )
+- return (ScMacroInfo*) pData;
+- }
++ if (SdrObjUserData *pData = GetFirstUserDataOfType(pObj, SC_UD_MACRODATA))
++ return (ScMacroInfo*) pData;
++
+ if ( bCreate )
+ {
+ ScMacroInfo* pData = new ScMacroInfo;
+diff -ru sc.orig/source/core/data/postit.cxx sc/source/core/data/postit.cxx
+--- sc.orig/source/core/data/postit.cxx 2009-06-04 12:39:10.000000000 +0100
++++ sc/source/core/data/postit.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -102,7 +102,6 @@
+
+ void ScCaptionUtil::SetBasicCaptionSettings( SdrCaptionObj& rCaption, bool bShown )
+ {
+- ScDrawLayer::SetAnchor( &rCaption, SCA_PAGE );
+ SetCaptionLayer( rCaption, bShown );
+ rCaption.SetFixedTail();
+ rCaption.SetSpecialTextBoxShadow();
+diff -ru sc.orig/source/core/tool/detfunc.cxx sc/source/core/tool/detfunc.cxx
+--- sc.orig/source/core/tool/detfunc.cxx 2009-06-04 12:39:11.000000000 +0100
++++ sc/source/core/tool/detfunc.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -492,7 +492,6 @@
+
+ pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
+
+- ScDrawLayer::SetAnchor( pBox, SCA_CELL );
+ pBox->SetLayer( SC_LAYER_INTERN );
+ pPage->InsertObject( pBox );
+ pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
+@@ -534,7 +533,6 @@
+ pArrow->NbcSetLogicRect(Rectangle(aStartPos,aEndPos)); //! noetig ???
+ pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
+
+- ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
+ pArrow->SetLayer( SC_LAYER_INTERN );
+ pPage->InsertObject( pArrow );
+ pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
+@@ -565,7 +563,6 @@
+
+ pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
+
+- ScDrawLayer::SetAnchor( pBox, SCA_CELL );
+ pBox->SetLayer( SC_LAYER_INTERN );
+ pPage->InsertObject( pBox );
+ pModel->AddCalcUndo( new SdrUndoInsertObj( *pBox ) );
+@@ -600,7 +597,6 @@
+
+ pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
+
+- ScDrawLayer::SetAnchor( pArrow, SCA_CELL );
+ pArrow->SetLayer( SC_LAYER_INTERN );
+ pPage->InsertObject( pArrow );
+ pModel->AddCalcUndo( new SdrUndoInsertObj( *pArrow ) );
+@@ -668,7 +664,6 @@
+
+ pCircle->SetMergedItemSetAndBroadcast(rAttrSet);
+
+- ScDrawLayer::SetAnchor( pCircle, SCA_CELL );
+ pCircle->SetLayer( SC_LAYER_INTERN );
+ pPage->InsertObject( pCircle );
+ pModel->AddCalcUndo( new SdrUndoInsertObj( *pCircle ) );
+diff -ru sc.orig/source/filter/xml/XMLExportIterator.hxx sc/source/filter/xml/XMLExportIterator.hxx
+--- sc.orig/source/filter/xml/XMLExportIterator.hxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/XMLExportIterator.hxx 2009-06-04 12:40:23.000000000 +0100
+@@ -72,6 +72,8 @@
+ {
+ ScAddress aAddress;
+ ScAddress aEndAddress;
++ sal_Int32 nEndX;
++ sal_Int32 nEndY;
+ com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xShape;
+
+ sal_Bool operator<(const ScMyShape& aShape) const;
+diff -ru sc.orig/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
+--- sc.orig/source/filter/xml/xmlexprt.cxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/xmlexprt.cxx 2009-06-04 12:51:46.000000000 +0100
+@@ -599,39 +599,21 @@
+ else
+ {
+ ++nShapesCount;
+- SvxShape* pShapeImp(SvxShape::getImplementation(xShape));
+- if (pShapeImp)
++ if (SvxShape* pShapeImp = SvxShape::getImplementation(xShape))
+ {
+- SdrObject *pSdrObj(pShapeImp->GetSdrObject());
+- if (pSdrObj)
++ if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
+ {
+- if (ScDrawLayer::GetAnchor(pSdrObj) == SCA_CELL)
++ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData( pSdrObj ))
+ {
+- if (pDoc)
+- {
+-
+- awt::Point aPoint(xShape->getPosition());
+- awt::Size aSize(xShape->getSize());
+- rtl::OUString sType(xShape->getShapeType());
+- Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
+- if ( sType.equals(sCaptionShape) )
+- {
+- awt::Point aRelativeCaptionPoint;
+- xShapeProp->getPropertyValue( sCaptionPoint ) >>= aRelativeCaptionPoint;
+- Point aCoreRelativeCaptionPoint(aRelativeCaptionPoint.X, aRelativeCaptionPoint.Y);
+- Point aCoreAbsoluteCaptionPoint(aPoint.X, aPoint.Y);
+- aCoreAbsoluteCaptionPoint += aCoreRelativeCaptionPoint;
+- aRectangle.Union(Rectangle(aCoreAbsoluteCaptionPoint, aCoreAbsoluteCaptionPoint));
+- }
+- ScRange aRange(pDoc->GetRange(static_cast<SCTAB>(nTable), aRectangle));
+- ScMyShape aMyShape;
+- aMyShape.aAddress = aRange.aStart;
+- aMyShape.aEndAddress = aRange.aEnd;
+- aMyShape.xShape = xShape;
+- pSharedData->AddNewShape(aMyShape);
+- pSharedData->SetLastColumn(nTable, aRange.aStart.Col());
+- pSharedData->SetLastRow(nTable, aRange.aStart.Row());
+- }
++ ScMyShape aMyShape;
++ aMyShape.aAddress = pAnchor->maStart;
++ aMyShape.aEndAddress = pAnchor->maEnd;
++ aMyShape.nEndX = pAnchor->maEndOffset.X();
++ aMyShape.nEndY = pAnchor->maEndOffset.Y();
++ aMyShape.xShape = xShape;
++ pSharedData->AddNewShape(aMyShape);
++ pSharedData->SetLastColumn(nTable, pAnchor->maStart.Col());
++ pSharedData->SetLastRow(nTable, pAnchor->maStart.Row());
+ }
+ else
+ pSharedData->AddTableShape(nTable, xShape);
+@@ -2585,29 +2567,15 @@
+ aPoint.X = 2 * aItr->xShape->getPosition().X + aItr->xShape->getSize().Width - aPoint.X;
+ if ( !aItr->xShape->getShapeType().equals(sCaptionShape) )
+ {
+- awt::Point aEndPoint;
+ Rectangle aEndRec(pDoc->GetMMRect(aItr->aEndAddress.Col(), aItr->aEndAddress.Row(),
+ aItr->aEndAddress.Col(), aItr->aEndAddress.Row(), aItr->aEndAddress.Tab()));
+ rtl::OUString sEndAddress;
+ ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc, FormulaGrammar::CONV_OOO);
+ AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, sEndAddress);
+- if (bNegativePage)
+- aEndPoint.X = -aEndRec.Right();
+- else
+- aEndPoint.X = aEndRec.Left();
+- aEndPoint.Y = aEndRec.Top();
+- awt::Point aStartPoint(aItr->xShape->getPosition());
+- awt::Size aSize(aItr->xShape->getSize());
+- sal_Int32 nEndX;
+- if (bNegativePage)
+- nEndX = -aStartPoint.X - aEndPoint.X;
+- else
+- nEndX = aStartPoint.X + aSize.Width - aEndPoint.X;
+- sal_Int32 nEndY(aStartPoint.Y + aSize.Height - aEndPoint.Y);
+ rtl::OUStringBuffer sBuffer;
+- GetMM100UnitConverter().convertMeasure(sBuffer, nEndX);
++ GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndX);
+ AddAttribute(XML_NAMESPACE_TABLE, XML_END_X, sBuffer.makeStringAndClear());
+- GetMM100UnitConverter().convertMeasure(sBuffer, nEndY);
++ GetMM100UnitConverter().convertMeasure(sBuffer, aItr->nEndY);
+ AddAttribute(XML_NAMESPACE_TABLE, XML_END_Y, sBuffer.makeStringAndClear());
+ }
+ ExportShape(aItr->xShape, &aPoint);
+diff -ru sc.orig/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
+--- sc.orig/source/filter/xml/xmlimprt.cxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/xmlimprt.cxx 2009-06-04 15:23:47.000000000 +0100
+@@ -2813,7 +2813,7 @@
+ }
+
+ aTables.UpdateRowHeights();
+- aTables.ResizeShapes();
++ aTables.FixupOLEs();
+ }
+ if (GetModel().is())
+ {
+diff -ru sc.orig/source/filter/xml/xmlsubti.cxx sc/source/filter/xml/xmlsubti.cxx
+--- sc.orig/source/filter/xml/xmlsubti.cxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/xmlsubti.cxx 2009-06-04 15:17:25.000000000 +0100
+@@ -153,7 +153,7 @@
+
+ ScMyTables::ScMyTables(ScXMLImport& rTempImport)
+ : rImport(rTempImport),
+- aResizeShapes(rTempImport),
++ aFixupOLEs(rTempImport),
+ nCurrentColStylePos(0),
+ nCurrentDrawPage( -1 ),
+ nCurrentXShapes( -1 ),
+@@ -757,12 +757,10 @@
+ return !((nCurrentSheet != nCurrentXShapes) || !xShapes.is());
+ }
+
+-void ScMyTables::AddShape(uno::Reference <drawing::XShape>& rShape,
+- rtl::OUString* pRangeList,
+- table::CellAddress& rStartAddress, table::CellAddress& rEndAddress,
+- sal_Int32 nEndX, sal_Int32 nEndY)
++void ScMyTables::AddOLE(uno::Reference <drawing::XShape>& rShape,
++ const rtl::OUString &rRangeList)
+ {
+- aResizeShapes.AddShape(rShape, pRangeList, rStartAddress, rEndAddress, nEndX, nEndY);
++ aFixupOLEs.AddOLE(rShape, rRangeList);
+ }
+
+ void ScMyTables::AddMatrixRange(
+diff -ru sc.orig/source/filter/xml/xmlsubti.hxx sc/source/filter/xml/xmlsubti.hxx
+--- sc.orig/source/filter/xml/xmlsubti.hxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/xmlsubti.hxx 2009-06-04 15:23:00.000000000 +0100
+@@ -114,7 +114,7 @@
+
+ ScXMLImport& rImport;
+
+- ScMyShapeResizer aResizeShapes;
++ ScMyOLEFixer aFixupOLEs;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > xCurrentSheet;
+ ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > xCurrentCellRange;
+@@ -151,7 +151,9 @@
+ void AddColumn(sal_Bool bIsCovered);
+ void NewTable(sal_Int32 nTempSpannedCols);
+ void UpdateRowHeights();
+- void ResizeShapes() { aResizeShapes.ResizeShapes(); }
++ void FixupOLEs() { aFixupOLEs.FixupOLEs(); }
++ sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const
++ { return ScMyOLEFixer::IsOLE(rShape); }
+ void DeleteTable();
+ com::sun::star::table::CellAddress GetRealCellPos();
+ void AddColCount(sal_Int32 nTempColCount);
+@@ -170,11 +172,8 @@
+ GetCurrentXShapes();
+ sal_Bool HasDrawPage();
+ sal_Bool HasXShapes();
+- void AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
+- rtl::OUString* pRangeList,
+- com::sun::star::table::CellAddress& rStartAddress,
+- com::sun::star::table::CellAddress& rEndAddress,
+- sal_Int32 nEndX, sal_Int32 nEndY);
++ void AddOLE(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
++ const rtl::OUString &rRangeList);
+
+ void AddMatrixRange( sal_Int32 nStartColumn,
+ sal_Int32 nStartRow,
+diff -ru sc.orig/source/filter/xml/XMLTableShapeImportHelper.cxx sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+--- sc.orig/source/filter/xml/XMLTableShapeImportHelper.cxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/XMLTableShapeImportHelper.cxx 2009-06-04 15:17:38.000000000 +0100
+@@ -36,6 +36,7 @@
+ #include "drwlayer.hxx"
+ #include "xmlannoi.hxx"
+ #include "rangeutl.hxx"
++#include "userdat.hxx"
+ #include "docuno.hxx"
+ #include "sheetdata.hxx"
+ #include <xmloff/nmspmap.hxx>
+@@ -90,6 +91,11 @@
+ {
+ if (!pAnnotationContext)
+ {
++ ScDrawObjData aAnchor;
++ aAnchor.maStart = ScAddress(aStartCell.Column, aStartCell.Row, aStartCell.Sheet);
++ awt::Point aStartPoint(rShape->getPosition());
++ aAnchor.maStartOffset = Point(aStartPoint.X, aStartPoint.Y);
++
+ sal_Int32 nEndX(-1);
+ sal_Int32 nEndY(-1);
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+@@ -111,11 +117,18 @@
+ {
+ sal_Int32 nOffset(0);
+ ScRangeStringConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset);
++ aAnchor.maEnd = ScAddress(aEndCell.Column, aEndCell.Row, aEndCell.Sheet);
+ }
+ else if (IsXMLToken(aLocalName, XML_END_X))
++ {
+ static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndX, rValue);
++ aAnchor.maEndOffset.X() = nEndX;
++ }
+ else if (IsXMLToken(aLocalName, XML_END_Y))
++ {
+ static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndY, rValue);
++ aAnchor.maEndOffset.Y() = nEndY;
++ }
+ else if (IsXMLToken(aLocalName, XML_TABLE_BACKGROUND))
+ if (IsXMLToken(rValue, XML_TRUE))
+ nLayerID = SC_LAYER_BACK;
+@@ -128,39 +141,28 @@
+ }
+ SetLayer(rShape, nLayerID, rShape->getShapeType());
+
+- if (!bOnTable)
++ if (SvxShape* pShapeImp = SvxShape::getImplementation(rShape))
+ {
+- rTables.AddShape(rShape,
+- pRangeList, aStartCell, aEndCell, nEndX, nEndY);
+- SvxShape* pShapeImp = SvxShape::getImplementation(rShape);
+- if (pShapeImp)
+- {
+- SdrObject *pSdrObj = pShapeImp->GetSdrObject();
+- if (pSdrObj)
+- ScDrawLayer::SetAnchor(pSdrObj, SCA_CELL);
+- }
++ if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
++ {
++ if (!bOnTable)
++ ScDrawLayer::SetCellAnchored(*pSdrObj, aAnchor);
++ else
++ ScDrawLayer::SetPageAnchored(*pSdrObj);
++ }
+ }
+- else
+- {
+- if ( pRangeList )
+- {
+- // #i78086# If there are notification ranges, the ChartListener must be created
+- // also when anchored to the sheet
+- // -> call AddShape with invalid cell position (checked in ScMyShapeResizer::ResizeShapes)
+-
+- table::CellAddress aInvalidPos( -1, -1, -1 );
+- rTables.AddShape(rShape,
+- pRangeList, aInvalidPos, aInvalidPos, 0, 0);
+- }
+
+- SvxShape* pShapeImp = SvxShape::getImplementation(rShape);
+- if (pShapeImp)
+- {
+- SdrObject *pSdrObj = pShapeImp->GetSdrObject();
+- if (pSdrObj)
+- ScDrawLayer::SetAnchor(pSdrObj, SCA_PAGE);
+- }
+- }
++ if ( bOnTable && pRangeList )
++ {
++ // #i78086# If there are notification ranges, the ChartListener must be created
++ // also when anchored to the sheet
++ // -> call AddOLE with invalid cell position (checked in ScMyShapeResizer::ResizeShapes)
++
++ if (rTables.IsOLE(rShape))
++ rTables.AddOLE(rShape, *pRangeList);
++ }
++
++ delete pRangeList;
+ }
+ else // shape is annotation
+ {
+diff -ru sc.orig/source/filter/xml/XMLTableShapeResizer.cxx sc/source/filter/xml/XMLTableShapeResizer.cxx
+--- sc.orig/source/filter/xml/XMLTableShapeResizer.cxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/XMLTableShapeResizer.cxx 2009-06-04 15:27:39.000000000 +0100
+@@ -51,38 +51,38 @@
+ using ::std::vector;
+ using ::rtl::OUString;
+
+-ScMyShapeResizer::ScMyShapeResizer(ScXMLImport& rTempImport)
++ScMyOLEFixer::ScMyOLEFixer(ScXMLImport& rTempImport)
+ : rImport(rTempImport),
+ aShapes(),
+ pCollection(NULL)
+ {
+ }
+
+-ScMyShapeResizer::~ScMyShapeResizer()
++ScMyOLEFixer::~ScMyOLEFixer()
+ {
+ }
+
+-sal_Bool ScMyShapeResizer::IsOLE(uno::Reference< drawing::XShape >& rShape) const
++sal_Bool ScMyOLEFixer::IsOLE(uno::Reference< drawing::XShape >& rShape)
+ {
+ return rShape->getShapeType().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")));
+ }
+
+-void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
++void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
+ const rtl::OUString& rName,
+- const rtl::OUString* pRangeList)
++ const rtl::OUString& rRangeList)
+ {
+- if (!pDoc || !pRangeList)
+- // These are minimum required.
++ // This is the minimum required.
++ if (!pDoc)
+ return;
+
+- if (!pRangeList->getLength())
++ if (!rRangeList.getLength())
+ {
+ pDoc->AddOLEObjectToCollection(rName);
+ return;
+ }
+
+ OUString aRangeStr;
+- ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, *pRangeList, pDoc);
++ ScRangeStringConverter::GetStringFromXMLRangeString(aRangeStr, rRangeList, pDoc);
+ if (!aRangeStr.getLength())
+ {
+ pDoc->AddOLEObjectToCollection(rName);
+@@ -112,271 +112,45 @@
+ }
+ }
+
+-void ScMyShapeResizer::AddShape(uno::Reference <drawing::XShape>& rShape,
+- rtl::OUString* pRangeList,
+- table::CellAddress& rStartAddress, table::CellAddress& rEndAddress,
+- sal_Int32 nEndX, sal_Int32 nEndY)
++void ScMyOLEFixer::AddOLE(uno::Reference <drawing::XShape>& rShape,
++ const rtl::OUString &rRangeList)
+ {
+- ScMyToResizeShape aShape;
++ ScMyToFixupOLE aShape;
+ aShape.xShape.set(rShape);
+- aShape.pRangeList = pRangeList;
+- aShape.aEndCell = rEndAddress;
+- aShape.aStartCell = rStartAddress;
+- aShape.nEndY = nEndY;
+- aShape.nEndX = nEndX;
++ aShape.sRangeList = rRangeList;
+ aShapes.push_back(aShape);
+ }
+
+-void ScMyShapeResizer::GetNewShapeSizePos(ScDocument* pDoc, const Rectangle& rStartRect,
+- const table::CellAddress& rEndCell,
+- awt::Point& rPoint, awt::Size& rSize,
+- sal_Int32& rEndX, sal_Int32& rEndY) const
+-{
+- awt::Point aRefPoint;
+- BOOL bNegativePage(pDoc->IsNegativePage(rEndCell.Sheet));
+- if (bNegativePage)
+- aRefPoint.X = rStartRect.Right();
+- else
+- aRefPoint.X = rStartRect.Left();
+- aRefPoint.Y = rStartRect.Top();
+- Rectangle aRect(pDoc->GetMMRect(
+- static_cast<SCCOL>(rEndCell.Column), static_cast<SCROW>(rEndCell.Row),
+- static_cast<SCCOL>(rEndCell.Column), static_cast<SCROW>(rEndCell.Row), rEndCell.Sheet ));
+- if (bNegativePage)
+- rEndX = -rEndX + aRect.Right();
+- else
+- rEndX += aRect.Left();
+- rEndY += aRect.Top();
+- rPoint.X += aRefPoint.X;
+- if (bNegativePage)
+- {
+- if (rPoint.X < rStartRect.Left())
+- rPoint.X = rStartRect.Left() + 2; // increment by 2 100th_mm because the cellwidth is internal in twips
+- }
+- else
+- {
+- if (rPoint.X > rStartRect.Right())
+- rPoint.X = rStartRect.Right() - 2; // decrement by 2 100th_mm because the cellwidth is internal in twips
+- }
+- rPoint.Y += aRefPoint.Y;
+- if (rPoint.Y > rStartRect.Bottom())
+- rPoint.Y = rStartRect.Bottom() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
+- if (bNegativePage)
+- {
+- rSize.Width = -(rEndX - rPoint.X);
+- }
+- else
+- rSize.Width = rEndX - rPoint.X;
+- rSize.Height = rEndY - rPoint.Y;
+-}
+-
+-void ScMyShapeResizer::ResizeShapes()
++void ScMyOLEFixer::FixupOLEs()
+ {
+ if (!aShapes.empty() && rImport.GetModel().is())
+ {
+- rtl::OUString sRowHeight(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CELLHGT));
+ rtl::OUString sPersistName (RTL_CONSTASCII_USTRINGPARAM("PersistName"));
+- rtl::OUString sCaptionPoint( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ));
+- rtl::OUString sConnectorShape( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ConnectorShape") );
+- rtl::OUString sCaptionShape( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape") );
+- rtl::OUString sStartShape(RTL_CONSTASCII_USTRINGPARAM("StartShape"));
+- rtl::OUString sEndShape(RTL_CONSTASCII_USTRINGPARAM("EndShape"));
+- rtl::OUString sStartPosition(RTL_CONSTASCII_USTRINGPARAM("StartPosition"));
+- rtl::OUString sEndPosition(RTL_CONSTASCII_USTRINGPARAM("EndPosition"));
+- uno::Reference<table::XCellRange> xTableRow;
+- uno::Reference<sheet::XSpreadsheet> xSheet;
+- uno::Reference<table::XTableRows> xTableRows;
+- sal_Int32 nOldRow(-1);
+- sal_Int32 nOldSheet(-1);
+- ScMyToResizeShapes::iterator aItr(aShapes.begin());
+- ScMyToResizeShapes::iterator aEndItr(aShapes.end());
+- uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( rImport.GetModel(), uno::UNO_QUERY );
+- if ( xSpreadDoc.is() )
++ ScMyToFixupOLEs::iterator aItr(aShapes.begin());
++ ScMyToFixupOLEs::iterator aEndItr(aShapes.end());
++ ScDocument* pDoc(rImport.GetDocument());
++
++ rImport.LockSolarMutex();
++
++ while (aItr != aEndItr)
+ {
+- uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
+- ScDocument* pDoc(rImport.GetDocument());
+- if ( pDoc && xIndex.is() )
++ // #i78086# also call CreateChartListener for invalid position (anchored to sheet)
++ if (!IsOLE(aItr->xShape))
++ DBG_ERROR("Only OLEs should be in here now");
++
++ if (IsOLE(aItr->xShape))
+ {
+- rImport.LockSolarMutex();
+- while (aItr != aEndItr)
+- {
+- // #i78086# invalid cell position is used to call CreateChartListener only
+- if ( aItr->aEndCell.Sheet >= 0 )
+- {
+- if ((nOldSheet != aItr->aEndCell.Sheet) || !xSheet.is())
+- {
+- nOldSheet = aItr->aEndCell.Sheet;
+- xSheet.set(xIndex->getByIndex(nOldSheet), uno::UNO_QUERY);
+- if (xSheet.is())
+- {
+- uno::Reference<table::XColumnRowRange> xColumnRowRange (xSheet, uno::UNO_QUERY);
+- if (xColumnRowRange.is())
+- xTableRows = xColumnRowRange->getRows();
+- }
+- }
+- if (xTableRows.is())
+- {
+- if (nOldRow != aItr->aEndCell.Row || !xTableRow.is())
+- {
+- nOldRow = aItr->aEndCell.Row;
+- xTableRows->getByIndex(nOldRow) >>= xTableRow;
+- }
+- if (xTableRow.is())
+- {
+- uno::Reference <beans::XPropertySet> xRowProperties(xTableRow, uno::UNO_QUERY);
+- if (xRowProperties.is())
+- {
+- sal_Int32 nHeight;
+- if (xRowProperties->getPropertyValue(sRowHeight) >>= nHeight)
+- {
+- Rectangle aRec = pDoc->GetMMRect(static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row),
+- static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row), aItr->aStartCell.Sheet);
+- awt::Point aPoint(aItr->xShape->getPosition());
+- awt::Size aSize(aItr->xShape->getSize());
+- if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
+- aPoint.X += aSize.Width;
+- if (aItr->nEndY >= 0 && aItr->nEndX >= 0)
+- {
+- if (aItr->xShape->getShapeType().equals(sConnectorShape))
+- {
+- //#103122#; handle connected Connectorshapes
+- uno::Reference<beans::XPropertySet> xShapeProps (aItr->xShape, uno::UNO_QUERY);
+- if(xShapeProps.is())
+- {
+- uno::Reference<drawing::XShape> xStartShape(xShapeProps->getPropertyValue( sStartShape ), uno::UNO_QUERY);
+- uno::Reference<drawing::XShape> xEndShape(xShapeProps->getPropertyValue( sEndShape ), uno::UNO_QUERY);
+- if (!xStartShape.is() && !xEndShape.is())
+- {
+- awt::Size aOldSize(aSize);
+- GetNewShapeSizePos(pDoc, aRec, aItr->aEndCell, aPoint, aSize, aItr->nEndX, aItr->nEndY);
+- aItr->xShape->setPosition(aPoint);
+- if( (aSize.Width != aOldSize.Width) ||
+- (aSize.Height != aOldSize.Height) )
+- aItr->xShape->setSize(aSize);
+- }
+- else if (xStartShape.is() && xEndShape.is())
+- {
+- // do nothing, because they are connected
+- }
+- else
+- {
+- // only one point is connected, the other should be moved
+-
+- rtl::OUString sProperty;
+- if (xStartShape.is())
+- {
+- awt::Point aEndPoint;
+- xShapeProps->getPropertyValue(sEndPosition) >>= aEndPoint;
+- aPoint.X = aRec.Left() + aEndPoint.X;
+- aPoint.Y = aRec.Top() + aEndPoint.Y;
+- sProperty = sEndPosition;
+- }
+- else
+- {
+- awt::Point aStartPoint;
+- xShapeProps->getPropertyValue(sStartPosition) >>= aStartPoint;
+- aPoint.X = aRec.Left() + aStartPoint.X;
+- aPoint.Y = aRec.Top() + aStartPoint.Y;
+- sProperty = sStartPosition;
+- }
+- xShapeProps->setPropertyValue(sProperty, uno::makeAny(aPoint));
+- }
+- }
+- }
+- else
+- {
+- awt::Size aOldSize(aSize);
+- GetNewShapeSizePos(pDoc, aRec, aItr->aEndCell, aPoint, aSize, aItr->nEndX, aItr->nEndY);
+- if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
+- aPoint.X -= aSize.Width;
+- aItr->xShape->setPosition(aPoint);
+- if( (aSize.Width != aOldSize.Width) ||
+- (aSize.Height != aOldSize.Height) )
+- aItr->xShape->setSize(aSize);
+- }
+- }
+- else
+- {
+- if (aItr->xShape->getShapeType().equals(sCaptionShape))
+- {
+- Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
+-
+- awt::Point aCaptionPoint;
+- uno::Reference< beans::XPropertySet > xShapeProps(aItr->xShape, uno::UNO_QUERY);
+- if (xShapeProps.is())
+- {
+- try
+- {
+- xShapeProps->getPropertyValue( sCaptionPoint ) >>= aCaptionPoint;
+- }
+- catch ( uno::Exception& )
+- {
+- DBG_ERROR("This Captionshape has no CaptionPoint property.");
+- }
+- }
+- Point aCorePoint(aPoint.X, aPoint.Y);
+- Point aCoreCaptionPoint(aCaptionPoint.X, aCaptionPoint.Y);
+- aCoreCaptionPoint += aCorePoint;
+- aRectangle.Union(Rectangle(aCoreCaptionPoint, aCoreCaptionPoint));
+-
+- Point aBeforeRightBottomPoint(aRectangle.BottomRight());
+-
+- aRectangle += aRec.TopLeft();
+- if (aRectangle.Left() > aRec.Right())
+- aRectangle -= (Point(aRectangle.Left() - aRec.Right() + 2, 0));
+- if (aRectangle.Top() > aRec.Bottom())
+- aRectangle -= (Point(0, aRectangle.Top() - aRec.Bottom() + 2));
+-
+- Point aDifferencePoint(aRectangle.BottomRight() - aBeforeRightBottomPoint);
+- aPoint.X += aDifferencePoint.X();
+- aPoint.Y += aDifferencePoint.Y();
+-
+- aItr->xShape->setPosition(aPoint);
+- }
+- else
+- {
+- // #96159# it is possible, that shapes have a negative position
+- // this is now handled here
+- DBG_ERROR("no or negative end address of this shape");
+- awt::Point aRefPoint;
+- aRefPoint.X = aRec.Left();
+- aRefPoint.Y = aRec.Top();
+- aPoint.X += aRefPoint.X;
+- if (aPoint.X > aRec.Right())
+- aPoint.X = aRec.Right() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
+- aPoint.Y += aRefPoint.Y;
+- if (aPoint.Y > aRec.Bottom())
+- aPoint.Y = aRec.Bottom() - 2; // decrement by 2 100th_mm because the cellheight is internal in twips
+- aItr->xShape->setPosition(aPoint);
+- }
+- }
+- }
+- }
+- }
+- }
+- else
+- {
+- DBG_ERROR("something wents wrong");
+- }
+- }
+- // #i78086# call CreateChartListener also for invalid position (anchored to sheet)
+- if (IsOLE(aItr->xShape))
+- {
+- uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
+- uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
+- rtl::OUString sName;
+- if (xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
+- (xShapeProps->getPropertyValue(sPersistName) >>= sName))
+- CreateChartListener(pDoc, sName, aItr->pRangeList);
+- }
+- if (aItr->pRangeList)
+- delete aItr->pRangeList;
+- aItr = aShapes.erase(aItr);
+- }
+- rImport.UnlockSolarMutex();
+-// if (pCollection)
+-// pDoc->SetChartListenerCollection(pCollection);
++ uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
++ uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
++ rtl::OUString sName;
++
++ if (pDoc && xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
++ (xShapeProps->getPropertyValue(sPersistName) >>= sName))
++ CreateChartListener(pDoc, sName, aItr->sRangeList);
+ }
++ aItr = aShapes.erase(aItr);
+ }
++
++ rImport.UnlockSolarMutex();
+ }
+ }
+diff -ru sc.orig/source/filter/xml/XMLTableShapeResizer.hxx sc/source/filter/xml/XMLTableShapeResizer.hxx
+--- sc.orig/source/filter/xml/XMLTableShapeResizer.hxx 2009-06-04 12:39:13.000000000 +0100
++++ sc/source/filter/xml/XMLTableShapeResizer.hxx 2009-06-04 15:22:38.000000000 +0100
+@@ -41,44 +41,31 @@
+ class ScDocument;
+ class Rectangle;
+
+-struct ScMyToResizeShape
++struct ScMyToFixupOLE
+ {
+ com::sun::star::uno::Reference <com::sun::star::drawing::XShape> xShape;
+- rtl::OUString* pRangeList;
+- com::sun::star::table::CellAddress aEndCell;
+- com::sun::star::table::CellAddress aStartCell;
+- sal_Int32 nEndX;
+- sal_Int32 nEndY;
+-
+- ScMyToResizeShape() : pRangeList(NULL) {}
++ rtl::OUString sRangeList;
+ };
+
+-typedef std::list<ScMyToResizeShape> ScMyToResizeShapes;
++typedef std::list<ScMyToFixupOLE> ScMyToFixupOLEs;
+
+-class ScMyShapeResizer
++class ScMyOLEFixer
+ {
+ ScXMLImport& rImport;
+- ScMyToResizeShapes aShapes;
++ ScMyToFixupOLEs aShapes;
+ ScChartListenerCollection* pCollection;
+
+- sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const;
+ void CreateChartListener(ScDocument* pDoc,
+ const rtl::OUString& rName,
+- const rtl::OUString* pRangeList);
+- void GetNewShapeSizePos(ScDocument* pDoc, const Rectangle& rStartRect,
+- const com::sun::star::table::CellAddress& rEndCell,
+- com::sun::star::awt::Point& rPoint, com::sun::star::awt::Size& rSize,
+- sal_Int32& rEndX, sal_Int32& rEndY) const;
++ const rtl::OUString& rRangeList);
+ public:
+- ScMyShapeResizer(ScXMLImport& rImport);
+- ~ScMyShapeResizer();
++ ScMyOLEFixer(ScXMLImport& rImport);
++ ~ScMyOLEFixer();
+
+- void AddShape(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
+- rtl::OUString* pRangeList,
+- com::sun::star::table::CellAddress& rStartAddress,
+- com::sun::star::table::CellAddress& rEndAddress,
+- sal_Int32 nEndX, sal_Int32 nEndY);
+- void ResizeShapes();
++ static sal_Bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape);
++ void AddOLE(com::sun::star::uno::Reference <com::sun::star::drawing::XShape>& rShape,
++ const rtl::OUString &rRangeList);
++ void FixupOLEs();
+ };
+
+ #endif
+diff -ru sc.orig/source/ui/Accessibility/AccessibleDocument.cxx sc/source/ui/Accessibility/AccessibleDocument.cxx
+--- sc.orig/source/ui/Accessibility/AccessibleDocument.cxx 2009-06-04 12:39:41.000000000 +0100
++++ sc/source/ui/Accessibility/AccessibleDocument.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -44,6 +44,7 @@
+ #include "drawview.hxx"
+ #include "gridwin.hxx"
+ #include "AccessibleEditObject.hxx"
++#include "userdat.hxx"
+ #include "scresid.hxx"
+ #ifndef SC_SC_HRC
+ #include "sc.hrc"
+@@ -1017,35 +1018,10 @@
+ uno::Reference<beans::XPropertySet> xShapeProp(xShape, uno::UNO_QUERY);
+ if (pShapeImp && xShapeProp.is())
+ {
+- SdrObject *pSdrObj = pShapeImp->GetSdrObject();
+- if (pSdrObj)
++ if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
+ {
+- if (ScDrawLayer::GetAnchor(pSdrObj) == SCA_CELL)
+- {
+- ScDocument* pDoc = mpViewShell->GetViewData()->GetDocument();
+- if (pDoc)
+- {
+- rtl::OUString sCaptionShape(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape"));
+- awt::Point aPoint(xShape->getPosition());
+- awt::Size aSize(xShape->getSize());
+- rtl::OUString sType(xShape->getShapeType());
+- Rectangle aRectangle(aPoint.X, aPoint.Y, aPoint.X + aSize.Width, aPoint.Y + aSize.Height);
+- if ( sType.equals(sCaptionShape) )
+- {
+- awt::Point aRelativeCaptionPoint;
+- rtl::OUString sCaptionPoint( RTL_CONSTASCII_USTRINGPARAM( "CaptionPoint" ));
+- xShapeProp->getPropertyValue( sCaptionPoint ) >>= aRelativeCaptionPoint;
+- Point aCoreRelativeCaptionPoint(aRelativeCaptionPoint.X, aRelativeCaptionPoint.Y);
+- Point aCoreAbsoluteCaptionPoint(aPoint.X, aPoint.Y);
+- aCoreAbsoluteCaptionPoint += aCoreRelativeCaptionPoint;
+- aRectangle.Union(Rectangle(aCoreAbsoluteCaptionPoint, aCoreAbsoluteCaptionPoint));
+- }
+- ScRange aRange = pDoc->GetRange(mpAccessibleDocument->getVisibleTable(), aRectangle);
+- pAddress = new ScAddress(aRange.aStart);
+- }
+- }
+-// else
+-// do nothing, because it is always a NULL Pointer
++ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pSdrObj))
++ return new ScAddress(pAnchor->maStart);
+ }
+ }
+ }
+diff -ru sc.orig/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx
+--- sc.orig/source/ui/drawfunc/drawsh2.cxx 2009-06-04 12:39:40.000000000 +0100
++++ sc/source/ui/drawfunc/drawsh2.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -115,7 +115,7 @@
+
+ if ( !bDisableAnchor )
+ {
+- switch( pView->GetAnchor() )
++ switch( pView->GetAnchorType() )
+ {
+ case SCA_PAGE:
+ rSet.Put( SfxBoolItem( SID_ANCHOR_PAGE, TRUE ) );
+diff -ru sc.orig/source/ui/drawfunc/drawsh5.cxx sc/source/ui/drawfunc/drawsh5.cxx
+--- sc.orig/source/ui/drawfunc/drawsh5.cxx 2009-06-04 12:39:40.000000000 +0100
++++ sc/source/ui/drawfunc/drawsh5.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -397,26 +397,26 @@
+ break;
+
+ case SID_ANCHOR_PAGE:
+- pView->SetAnchor( SCA_PAGE );
++ pView->SetPageAnchored();
+ rBindings.Invalidate( SID_ANCHOR_PAGE );
+ rBindings.Invalidate( SID_ANCHOR_CELL );
+ break;
+
+ case SID_ANCHOR_CELL:
+- pView->SetAnchor( SCA_CELL );
++ pView->SetCellAnchored();
+ rBindings.Invalidate( SID_ANCHOR_PAGE );
+ rBindings.Invalidate( SID_ANCHOR_CELL );
+ break;
+
+ case SID_ANCHOR_TOGGLE:
+ {
+- switch( pView->GetAnchor() )
++ switch( pView->GetAnchorType() )
+ {
+ case SCA_CELL:
+- pView->SetAnchor( SCA_PAGE );
++ pView->SetPageAnchored();
+ break;
+ default:
+- pView->SetAnchor( SCA_CELL );
++ pView->SetCellAnchored();
+ break;
+ }
+ }
+diff -ru sc.orig/source/ui/inc/drawview.hxx sc/source/ui/inc/drawview.hxx
+--- sc.orig/source/ui/inc/drawview.hxx 2009-06-04 12:39:46.000000000 +0100
++++ sc/source/ui/inc/drawview.hxx 2009-06-04 12:40:23.000000000 +0100
+@@ -100,8 +100,9 @@
+
+ void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
+
+- void SetAnchor( ScAnchorType );
+- ScAnchorType GetAnchor() const;
++ void SetPageAnchored();
++ void SetCellAnchored();
++ ScAnchorType GetAnchorType() const;
+
+ void VCAddWin( Window* pWin );
+ void VCRemoveWin( Window* pWin );
+diff -ru sc.orig/source/ui/unoobj/shapeuno.cxx sc/source/ui/unoobj/shapeuno.cxx
+--- sc.orig/source/ui/unoobj/shapeuno.cxx 2009-06-04 12:39:29.000000000 +0100
++++ sc/source/ui/unoobj/shapeuno.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -365,20 +365,9 @@
+ table::CellRangeAddress aAddress = xRangeAdd->getRangeAddress();
+ if (nTab == aAddress.Sheet)
+ {
+- if (aAddress.StartRow != aAddress.EndRow) //should be a Spreadsheet
+- {
+- DBG_ASSERT(aAddress.StartRow == 0 && aAddress.EndRow == MAXROW &&
+- aAddress.StartColumn == 0 && aAddress.EndColumn == MAXCOL, "here should be a XSpreadsheet");
+- ScDrawLayer::SetAnchor(pObj, SCA_PAGE);
+- }
+- else
+- {
+- DBG_ASSERT(aAddress.StartRow == aAddress.EndRow &&
+- aAddress.StartColumn == aAddress.EndColumn, "here should be a XCell");
+- ScDrawLayer::SetAnchor(pObj, SCA_CELL);
+- }
+ Rectangle aRect(pDoc->GetMMRect( static_cast<SCCOL>(aAddress.StartColumn), static_cast<SCROW>(aAddress.StartRow),
+ static_cast<SCCOL>(aAddress.EndColumn), static_cast<SCROW>(aAddress.EndRow), aAddress.Sheet ));
++ awt::Point aRelPoint;
+ uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
+ if (xShape.is())
+ {
+@@ -397,7 +386,8 @@
+ awt::Size aUnoSize;
+ awt::Point aCaptionPoint;
+ ScRange aRange;
+- awt::Point aUnoPoint(lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint ));
++ aRelPoint = lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint );
++ awt::Point aUnoPoint(aRelPoint);
+
+ aUnoPoint.X += aPoint.X();
+ aUnoPoint.Y += aPoint.Y();
+@@ -426,6 +416,24 @@
+ xShape->setPosition(aUnoPoint);
+ pDocSh->SetModified();
+ }
++
++ if (aAddress.StartRow != aAddress.EndRow) //should be a Spreadsheet
++ {
++ DBG_ASSERT(aAddress.StartRow == 0 && aAddress.EndRow == MAXROW &&
++ aAddress.StartColumn == 0 && aAddress.EndColumn == MAXCOL, "here should be a XSpreadsheet");
++ ScDrawLayer::SetPageAnchored(*pObj);
++ }
++ else
++ {
++ DBG_ASSERT(aAddress.StartRow == aAddress.EndRow &&
++ aAddress.StartColumn == aAddress.EndColumn, "here should be a XCell");
++ ScDrawObjData aAnchor;
++ aAnchor.maStart = ScAddress(aAddress.StartColumn, aAddress.StartRow, aAddress.Sheet);
++ aAnchor.maStartOffset = Point(aRelPoint.X, aRelPoint.Y);
++ ScDrawLayer::SetCellAnchored(*pObj, aAnchor);
++ //Currently we've only got a start anchor, not an end-anchor, so generate that now
++ ScDrawLayer::UpdateCellAnchorFromPositionEnd(*pObj, *pDoc, aAddress.Sheet);
++ }
+ }
+ }
+ }
+@@ -485,7 +493,7 @@
+ uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
+ if (xShape.is())
+ {
+- if (ScDrawLayer::GetAnchor(pObj) == SCA_PAGE)
++ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_PAGE)
+ {
+ awt::Point aPoint(xShape->getPosition());
+ awt::Size aSize(xShape->getSize());
+@@ -512,7 +520,7 @@
+ xShape->setPosition(aPoint);
+ pDocSh->SetModified();
+ }
+- else if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
++ else if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+ {
+ awt::Size aUnoSize;
+ awt::Point aCaptionPoint;
+@@ -583,7 +591,7 @@
+ uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
+ if (xShape.is())
+ {
+- if (ScDrawLayer::GetAnchor(pObj) == SCA_PAGE)
++ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_PAGE)
+ {
+ awt::Point aPoint = xShape->getPosition();
+ awt::Point aCaptionPoint;
+@@ -596,7 +604,7 @@
+ xShape->setPosition(aPoint);
+ pDocSh->SetModified();
+ }
+- else if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
++ else if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+ {
+ awt::Size aUnoSize;
+ awt::Point aCaptionPoint;
+@@ -663,23 +671,10 @@
+ {
+ ScDocShell* pDocSh = (ScDocShell*)pObjSh;
+ uno::Reference< uno::XInterface > xAnchor;
+- if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
+- {
+- uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
+- if (xShape.is())
+- {
+- awt::Size aUnoSize;
+- awt::Point aCaptionPoint;
+- ScRange aRange;
+- awt::Point aUnoPoint(lcl_GetRelativePos( xShape, pDoc, nTab, aRange, aUnoSize, aCaptionPoint ));
+-
+- xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, aRange.aStart )));
+- }
+- }
++ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
++ xAnchor.set(static_cast<cppu::OWeakObject*>(new ScCellObj( pDocSh, pAnchor->maStart)));
+ else
+- {
+ xAnchor.set(static_cast<cppu::OWeakObject*>(new ScTableSheetObj( pDocSh, nTab )));
+- }
+ aAny <<= xAnchor;
+ }
+ }
+@@ -722,7 +717,7 @@
+ uno::Reference<drawing::XShape> xShape( mxShapeAgg, uno::UNO_QUERY );
+ if (xShape.is())
+ {
+- if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
++ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+ {
+ awt::Size aUnoSize;
+ awt::Point aCaptionPoint;
+@@ -782,7 +777,7 @@
+ if (xShape.is())
+ {
+ uno::Reference< uno::XInterface > xAnchor;
+- if (ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
++ if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+ {
+ awt::Size aUnoSize;
+ awt::Point aCaptionPoint;
+diff -ru sc.orig/source/ui/view/drawvie3.cxx sc/source/ui/view/drawvie3.cxx
+--- sc.orig/source/ui/view/drawvie3.cxx 2009-06-04 12:39:42.000000000 +0100
++++ sc/source/ui/view/drawvie3.cxx 2009-06-05 08:47:05.000000000 +0100
+@@ -77,7 +77,7 @@
+
+ // Verankerung setzen
+
+-void ScDrawView::SetAnchor( ScAnchorType eType )
++void ScDrawView::SetPageAnchored()
+ {
+ SdrObject* pObj = NULL;
+ if( AreObjectsMarked() )
+@@ -87,7 +87,7 @@
+ for( ULONG i=0; i<nCount; i++ )
+ {
+ pObj = pMark->GetMark(i)->GetMarkedSdrObj();
+- ScDrawLayer::SetAnchor( pObj, eType );
++ ScDrawLayer::SetPageAnchored( *pObj );
+ }
+
+ if ( pViewData )
+@@ -95,7 +95,28 @@
+ }
+ }
+
+-ScAnchorType ScDrawView::GetAnchor() const
++void ScDrawView::SetCellAnchored()
++{
++ if (!pDoc)
++ return;
++
++ SdrObject* pObj = NULL;
++ if( AreObjectsMarked() )
++ {
++ const SdrMarkList* pMark = &GetMarkedObjectList();
++ ULONG nCount = pMark->GetMarkCount();
++ for( ULONG i=0; i<nCount; i++ )
++ {
++ pObj = pMark->GetMark(i)->GetMarkedSdrObj();
++ ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab);
++ }
++
++ if ( pViewData )
++ pViewData->GetDocShell()->SetDrawModified();
++ }
++}
++
++ScAnchorType ScDrawView::GetAnchorType() const
+ {
+ BOOL bPage = FALSE;
+ BOOL bCell = FALSE;
+@@ -108,7 +129,7 @@
+ for( ULONG i=0; i<nCount; i++ )
+ {
+ pObj = pMark->GetMark(i)->GetMarkedSdrObj();
+- if( ScDrawLayer::GetAnchor( pObj ) == SCA_CELL )
++ if( ScDrawLayer::GetAnchorType( *pObj ) == SCA_CELL )
+ bCell =TRUE;
+ else
+ bPage = TRUE;
+@@ -138,6 +159,20 @@
+ if ( nTab == ((ScTabSizeChangedHint&)rHint).GetTab() )
+ UpdateWorkArea();
+ }
++ else if ( rHint.ISA( SdrHint ) )
++ {
++ if (const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint ))
++ {
++ //Update the anchors of any non note object that is cell anchored which has
++ //been moved since the last anchors for its position was calculated
++ if (pSdrHint->GetKind() == HINT_OBJCHG || pSdrHint->GetKind() == HINT_OBJINSERTED)
++ if (SdrObject* pObj = const_cast<SdrObject*>(pSdrHint->GetObject()))
++ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pObj))
++ if (!pAnchor->mbNote && pAnchor->maLastRect != pObj->GetLogicRect())
++ ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *pDoc, nTab);
++ }
++ FmFormView::Notify( rBC,rHint );
++ }
+ else
+ FmFormView::Notify( rBC,rHint );
+ }
+diff -ru sc.orig/source/ui/view/drawview.cxx sc/source/ui/view/drawview.cxx
+--- sc.orig/source/ui/view/drawview.cxx 2009-06-04 12:39:41.000000000 +0100
++++ sc/source/ui/view/drawview.cxx 2009-06-04 12:40:23.000000000 +0100
+@@ -155,46 +155,15 @@
+
+ void ScDrawView::AddCustomHdl()
+ {
+- BOOL bNegativePage = pDoc->IsNegativePage( nTab );
+-
+ const SdrMarkList &rMrkList = GetMarkedObjectList();
+ UINT32 nCount = rMrkList.GetMarkCount();
+ for(UINT32 nPos=0; nPos<nCount; nPos++ )
+ {
+- const SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
+- if(ScDrawLayer::GetAnchor(pObj) == SCA_CELL)
++ SdrObject* pObj = rMrkList.GetMark(nPos)->GetMarkedSdrObj();
++ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjDataTab(pObj, nTab))
+ {
+- const INT32 nDelta = 1;
+-
+- Rectangle aBoundRect = pObj->GetCurrentBoundRect();
+- Point aPos;
+- if (bNegativePage)
+- {
+- aPos = aBoundRect.TopRight();
+- aPos.X() = -aPos.X(); // so the loop below is the same
+- }
+- else
+- aPos = aBoundRect.TopLeft();
+- long nPosX = (long) (aPos.X() / HMM_PER_TWIPS) + nDelta;
+- long nPosY = (long) (aPos.Y() / HMM_PER_TWIPS) + nDelta;
+-
+- SCCOL nCol;
+- INT32 nWidth = 0;
+-
+- for(nCol=0; nCol<=MAXCOL && nWidth<=nPosX; nCol++)
+- nWidth += pDoc->GetColWidth(nCol,nTab);
+-
+- if(nCol > 0)
+- --nCol;
+-
+- SCROW nRow = nPosY <= 0 ? 0 : pDoc->GetRowForHeight( nTab,
+- (ULONG) nPosY);
+- if(nRow > 0)
+- --nRow;
+-
+- ScTabView* pView = pViewData->GetView();
+- ScAddress aScAddress(nCol, nRow, nTab);
+- pView->CreateAnchorHandles(aHdl, aScAddress);
++ if (ScTabView* pView = pViewData->GetView())
++ pView->CreateAnchorHandles(aHdl, pAnchor->maStart);
+ }
+ }
+ }
diff --git a/openoffice.org-3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch b/openoffice.org-3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch
new file mode 100644
index 0000000..5979187
--- /dev/null
+++ b/openoffice.org-3.1.0.ooo61927.sw.ww6.unicodefontencoding.patch
@@ -0,0 +1,23 @@
+Index: source/filter/ww8/wrtw8sty.cxx
+===================================================================
+RCS file: /cvs/sw/sw/source/filter/ww8/wrtw8sty.cxx,v
+retrieving revision 1.49.44.2
+diff -u -r1.49.44.2 wrtw8sty.cxx
+--- openoffice.org.orig/sw/source/filter/ww8/wrtw8sty.cxx 12 Dec 2008 11:11:33 -0000 1.49.44.2
++++ openoffice.org/sw/source/filter/ww8/wrtw8sty.cxx 9 Apr 2009 12:02:50 -0000
+@@ -621,7 +621,14 @@
+
+ ShortToSVBT16( 400, &maWW8_FFN[2] ); // weiss ich nicht besser
+ // 400 == FW_NORMAL (windows.h)
+- maWW8_FFN[4] = sw::ms::rtl_TextEncodingToWinCharset(eChrSet);
++ //
++ //#i61927# For unicode fonts like Arial Unicode, Word 97+ sets the chs
++ //to SHIFTJIS presumably to capture that it's a multi-byte encoding font
++ //but Word95 doesn't do this, and sets it to 0 (ANSI), so we should do the
++ //same
++ maWW8_FFN[4] = bWrtWW8 ?
++ sw::ms::rtl_TextEncodingToWinCharset(eChrSet) :
++ rtl_getBestWindowsCharsetFromTextEncoding(eChrSet);
+
+ if (mbAlt)
+ maWW8_FFN[5] = static_cast< BYTE >(msFamilyNm.Len() + 1);
diff --git a/openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch b/openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch
new file mode 100644
index 0000000..1676e40
--- /dev/null
+++ b/openoffice.org-3.1.0.oooXXXXX.solenv.allowmissing.patch
@@ -0,0 +1,64 @@
+Index: bin/modules/installer/scriptitems.pm
+===================================================================
+RCS file: /cvs/tools/solenv/bin/modules/installer/scriptitems.pm,v
+retrieving revision 1.17
+diff -u -p -r1.17 scriptitems.pm
+--- openoffice.org.orig/solenv/bin/modules/installer/scriptitems.pm 24 Feb 2005 16:21:15 -0000 1.17
++++ openoffice.org/solenv/bin/modules/installer/scriptitems.pm 18 Mar 2005 22:39:42 -0000
+@@ -1077,7 +1077,7 @@
+ }
+ else
+ {
+- $infoline = "ERROR: Source for $$searchfilenameref not found!\n"; # Important message in log file
++ $infoline = "WARNING: Source for $$searchfilenameref not found!\n"; # Important message in log file
+ }
+
+ push( @installer::globals::logfileinfo, $infoline);
+@@ -1155,7 +1155,7 @@
+ }
+ else
+ {
+- $infoline = "ERROR: Source for $$searchfilenameref not found!\n"; # Important message in log file
++ $infoline = "WARNING: Source for $$searchfilenameref not found!\n"; # Important message in log file
+ }
+
+ push( @installer::globals::logfileinfo, $infoline);
+@@ -1371,11 +1371,10 @@
+
+ if ( ! $installer::globals::languagepack )
+ {
+- $infoline = "ERROR: Removing file $filename from file list.\n";
++ $infoline = "WARNING: Removing file $filename from file list.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+- push(@missingfiles, "ERROR: File not found: $filename\n");
+- $error_occured = 1;
++ push(@missingfiles, "WARNING: File not found: $filename\n");
+
+ next; # removing this file from list, if sourcepath is empty
+ }
+@@ -1383,11 +1382,10 @@
+ {
+ if (( $onefile->{'ismultilingual'} ) || ( $styles =~ /\bFORCELANGUAGEPACK\b/ ))
+ {
+- $infoline = "ERROR: Removing file $filename from file list.\n";
++ $infoline = "WARNING: Removing file $filename from file list.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+- push(@missingfiles, "ERROR: File not found: $filename\n");
+- $error_occured = 1;
++ push(@missingfiles, "WARNING: File not found: $filename\n");
+
+ next; # removing this file from list, if sourcepath is empty
+ }
+--- openoffice.org.orig/solenv/bin/modules/installer/simplepackage.pm 2010-07-12 10:27:26.000000000 +0100
++++ openoffice.org/solenv/bin/modules/installer/simplepackage.pm 2010-07-12 10:27:54.000000000 +0100
+@@ -53,7 +53,7 @@
+ ( $installer::globals::packageformat eq "archive" ))
+ {
+ $installer::globals::is_simple_packager_project = 1;
+- $installer::globals::patch_user_dir = 1;
++ $installer::globals::patch_user_dir = 0;
+ }
+ elsif( $installer::globals::packageformat eq "dmg" )
+ {
diff --git a/openoffice.org-3.1.1.ooo105784.vcl.sniffscriptforsubs.patch b/openoffice.org-3.1.1.ooo105784.vcl.sniffscriptforsubs.patch
new file mode 100644
index 0000000..4555983
--- /dev/null
+++ b/openoffice.org-3.1.1.ooo105784.vcl.sniffscriptforsubs.patch
@@ -0,0 +1,189 @@
+diff -ru vcl.orig/unx/source/fontmanager/fontconfig.cxx vcl/unx/source/fontmanager/fontconfig.cxx
+--- vcl.orig/unx/source/fontmanager/fontconfig.cxx 2009-10-08 13:25:00.000000000 +0100
++++ vcl/unx/source/fontmanager/fontconfig.cxx 2009-10-08 13:51:51.000000000 +0100
+@@ -80,6 +80,9 @@
+
+ #include "sal/alloca.h"
+
++#include <i18nutil/unicode.hxx> //unicode::getUnicodeScriptType
++#include <com/sun/star/i18n/ScriptType.hdl> //ScriptType
++
+ #include <utility>
+ #include <algorithm>
+
+@@ -907,6 +910,138 @@
+ }
+ }
+
++static const char* pick_sample_language(const sal_uInt32 cCode)
++{
++ using namespace ::com::sun::star::i18n;
++
++ static ScriptTypeList aScripts[] =
++ {
++ { UnicodeScript_kBasicLatin, UnicodeScript_kBasicLatin, UnicodeScript_kBasicLatin },
++ { UnicodeScript_kLatin1Supplement, UnicodeScript_kLatin1Supplement, UnicodeScript_kLatin1Supplement },
++ { UnicodeScript_kLatinExtendedA, UnicodeScript_kLatinExtendedA, UnicodeScript_kLatinExtendedA },
++ { UnicodeScript_kLatinExtendedB, UnicodeScript_kLatinExtendedB, UnicodeScript_kLatinExtendedB },
++ { UnicodeScript_kGreek, UnicodeScript_kGreek, UnicodeScript_kGreek },
++ { UnicodeScript_kCyrillic, UnicodeScript_kCyrillic, UnicodeScript_kCyrillic },
++ { UnicodeScript_kArmenian, UnicodeScript_kArmenian, UnicodeScript_kArmenian },
++ { UnicodeScript_kHebrew, UnicodeScript_kHebrew, UnicodeScript_kHebrew },
++ { UnicodeScript_kArabic, UnicodeScript_kArabic, UnicodeScript_kArabic },
++ { UnicodeScript_kSyriac, UnicodeScript_kSyriac, UnicodeScript_kSyriac },
++ { UnicodeScript_kThaana, UnicodeScript_kThaana, UnicodeScript_kThaana },
++ { UnicodeScript_kDevanagari, UnicodeScript_kDevanagari, UnicodeScript_kDevanagari },
++ { UnicodeScript_kBengali, UnicodeScript_kBengali, UnicodeScript_kBengali },
++ { UnicodeScript_kGurmukhi, UnicodeScript_kGurmukhi, UnicodeScript_kGurmukhi },
++ { UnicodeScript_kGujarati, UnicodeScript_kGujarati, UnicodeScript_kGujarati },
++ { UnicodeScript_kOriya, UnicodeScript_kOriya, UnicodeScript_kOriya },
++ { UnicodeScript_kTamil, UnicodeScript_kTamil, UnicodeScript_kTamil },
++ { UnicodeScript_kTelugu, UnicodeScript_kTelugu, UnicodeScript_kTelugu },
++ { UnicodeScript_kKannada, UnicodeScript_kKannada, UnicodeScript_kKannada },
++ { UnicodeScript_kMalayalam, UnicodeScript_kMalayalam, UnicodeScript_kMalayalam },
++ { UnicodeScript_kSinhala, UnicodeScript_kSinhala, UnicodeScript_kSinhala },
++ { UnicodeScript_kThai, UnicodeScript_kThai, UnicodeScript_kThai },
++ { UnicodeScript_kLao, UnicodeScript_kLao, UnicodeScript_kLao },
++ { UnicodeScript_kTibetan, UnicodeScript_kTibetan, UnicodeScript_kTibetan },
++ { UnicodeScript_kMyanmar, UnicodeScript_kMyanmar, UnicodeScript_kMyanmar },
++ { UnicodeScript_kGeorgian, UnicodeScript_kGeorgian, UnicodeScript_kGeorgian },
++ { UnicodeScript_kHangulJamo, UnicodeScript_kHangulJamo, UnicodeScript_kHangulJamo },
++ { UnicodeScript_kEthiopic, UnicodeScript_kEthiopic, UnicodeScript_kEthiopic },
++ { UnicodeScript_kCherokee, UnicodeScript_kCherokee, UnicodeScript_kCherokee },
++ { UnicodeScript_kUnifiedCanadianAboriginalSyllabics,
++ UnicodeScript_kUnifiedCanadianAboriginalSyllabics,
++ UnicodeScript_kUnifiedCanadianAboriginalSyllabics },
++ { UnicodeScript_kKhmer, UnicodeScript_kKhmer, UnicodeScript_kKhmer },
++ { UnicodeScript_kMongolian, UnicodeScript_kMongolian, UnicodeScript_kMongolian },
++ { UnicodeScript_kLatinExtendedAdditional, UnicodeScript_kLatinExtendedAdditional,
++ UnicodeScript_kLatinExtendedAdditional },
++ { UnicodeScript_kGreekExtended, UnicodeScript_kGreekExtended, UnicodeScript_kGreekExtended },
++ { UnicodeScript_kHiragana, UnicodeScript_kHiragana, UnicodeScript_kHiragana },
++ { UnicodeScript_kKatakana, UnicodeScript_kKatakana, UnicodeScript_kKatakana },
++ { UnicodeScript_kHangulCompatibilityJamo, UnicodeScript_kHangulCompatibilityJamo,
++ UnicodeScript_kHangulCompatibilityJamo },
++ { UnicodeScript_kHangulSyllable, UnicodeScript_kHangulSyllable,
++ UnicodeScript_kHangulSyllable },
++ { UnicodeScript_kArabicPresentationB, UnicodeScript_kArabicPresentationB,
++ UnicodeScript_kArabicPresentationB },
++ { UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, UnicodeScript_kScriptCount }
++ };
++
++ switch (unicode::getUnicodeScriptType(cCode, aScripts, UnicodeScript_kScriptCount))
++ {
++ case UnicodeScript_kBasicLatin:
++ case UnicodeScript_kLatin1Supplement:
++ case UnicodeScript_kLatinExtendedA:
++ case UnicodeScript_kLatinExtendedB:
++ case UnicodeScript_kLatinExtendedAdditional:
++ return "en";
++ case UnicodeScript_kGreek:
++ case UnicodeScript_kGreekExtended:
++ return "el";
++ case UnicodeScript_kCyrillic:
++ return "ru";
++ case UnicodeScript_kArmenian:
++ return "hy";
++ case UnicodeScript_kHebrew:
++ return "he";
++ case UnicodeScript_kArabic:
++ case UnicodeScript_kArabicPresentationB:
++ return "ar";
++ case UnicodeScript_kSyriac:
++ return "syr";
++ case UnicodeScript_kThaana:
++ return "dv";
++ case UnicodeScript_kDevanagari:
++ return "hi";
++ case UnicodeScript_kBengali:
++ return "bn";
++ case UnicodeScript_kGurmukhi:
++ return "pa";
++ case UnicodeScript_kGujarati:
++ return "gu";
++ case UnicodeScript_kOriya:
++ return "or";
++ case UnicodeScript_kTamil:
++ return "ta";
++ case UnicodeScript_kTelugu:
++ return "te";
++ case UnicodeScript_kKannada:
++ return "ka";
++ case UnicodeScript_kMalayalam:
++ return "ml";
++ case UnicodeScript_kSinhala:
++ return "si";
++ case UnicodeScript_kThai:
++ return "th";
++ case UnicodeScript_kLao:
++ return "lo";
++ case UnicodeScript_kTibetan:
++ return "bo";
++ case UnicodeScript_kMyanmar:
++ return "my";
++ case UnicodeScript_kGeorgian:
++ return "ka";
++ case UnicodeScript_kHangulJamo:
++ case UnicodeScript_kHangulCompatibilityJamo:
++ case UnicodeScript_kHangulSyllable:
++ return "ko";
++ case UnicodeScript_kEthiopic:
++ return "am";
++ case UnicodeScript_kCherokee:
++ return "chr";
++ case UnicodeScript_kUnifiedCanadianAboriginalSyllabics:
++ return "ui";
++ case UnicodeScript_kKhmer:
++ return "km";
++ case UnicodeScript_kMongolian:
++ return "mn";
++ case UnicodeScript_kHiragana:
++ case UnicodeScript_kKatakana:
++ return "ja";
++ default:
++ break;
++ }
++
++ return NULL;
++}
++
+ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName,
+ rtl::OUString& rMissingCodes, const rtl::OString &rLangAttrib,
+ italic::type &rItalic, weight::type &rWeight,
+@@ -928,8 +1063,6 @@
+ rWrapper.FcPatternAddString( pPattern, FC_FAMILY, pTargetNameUtf8 );
+
+ const FcChar8* pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr();
+- if( rLangAttrib.getLength() )
+- rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 );
+
+ // Add required Unicode characters, if any
+ if ( rMissingCodes.getLength() )
+@@ -940,11 +1073,16 @@
+ // also handle unicode surrogates
+ const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex );
+ rWrapper.FcCharSetAddChar( unicodes, nCode );
++ if (!pLangAttribUtf8)
++ pLangAttribUtf8 = (const FcChar8*)pick_sample_language(nCode);
+ }
+ rWrapper.FcPatternAddCharSet( pPattern, FC_CHARSET, unicodes);
+ rWrapper.FcCharSetDestroy( unicodes );
+ }
+
++ if( pLangAttribUtf8 )
++ rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 );
++
+ addtopattern(rWrapper, pPattern, rItalic, rWeight, rWidth, rPitch);
+
+ // query fontconfig for a substitute
+diff -ru vcl.orig/util/makefile.mk vcl/util/makefile.mk
+--- vcl.orig/util/makefile.mk 2009-10-08 13:25:00.000000000 +0100
++++ vcl/util/makefile.mk 2009-10-08 13:25:09.000000000 +0100
+@@ -298,6 +298,7 @@
+ # libs for generic plugin
+ SHL2STDLIBS=\
+ $(VCLLIB)\
++ $(I18NUTILLIB) \
+ $(I18NPAPERLIB) \
+ $(I18NISOLANGLIB) \
+ $(TOOLSLIB) \
diff --git a/openoffice.org-3.2.0.ooo106502.svx.fixspelltimer.patch b/openoffice.org-3.2.0.ooo106502.svx.fixspelltimer.patch
new file mode 100644
index 0000000..ed7fe4d
--- /dev/null
+++ b/openoffice.org-3.2.0.ooo106502.svx.fixspelltimer.patch
@@ -0,0 +1,13 @@
+diff -r 3ee4cb3a17dd svx/source/editeng/editeng.cxx
+--- a/editeng/source/editeng/editeng.cxx Fri Oct 30 09:44:02 2009 +0000
++++ b/editeng/source/editeng/editeng.cxx Fri Oct 30 17:46:26 2009 +0000
+@@ -1783,7 +1783,8 @@
+ ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n );
+ pNode->CreateWrongList();
+ }
+- pImpEditEngine->StartOnlineSpellTimer();
++ if (pImpEditEngine->IsFormatted())
++ pImpEditEngine->StartOnlineSpellTimer();
+ }
+ else
+ {
diff --git a/openoffice.org-3.2.0.ooo108846.sfx2.qstartfixes.patch b/openoffice.org-3.2.0.ooo108846.sfx2.qstartfixes.patch
new file mode 100644
index 0000000..c455b03
--- /dev/null
+++ b/openoffice.org-3.2.0.ooo108846.sfx2.qstartfixes.patch
@@ -0,0 +1,87 @@
+diff -r 3c24aa9a7810 desktop/source/app/cmdlineargs.cxx
+--- a/desktop/source/app/cmdlineargs.cxx Sat Jan 23 16:31:03 2010 +0000
++++ b/desktop/source/app/cmdlineargs.cxx Tue Feb 02 13:59:39 2010 +0000
+@@ -396,7 +396,7 @@
+ }
+ else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
+ {
+-#if defined(WNT) || defined(OS2) || defined(QUARTZ)
++#if defined(ENABLE_QUICKSTART_APPLET)
+ SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
+ #endif
+ SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
+diff -r 3c24aa9a7810 desktop/source/app/makefile.mk
+--- a/desktop/source/app/makefile.mk Sat Jan 23 16:31:03 2010 +0000
++++ b/desktop/source/app/makefile.mk Tue Feb 02 13:59:39 2010 +0000
+@@ -53,6 +53,10 @@
+ # DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
+ # .ENDIF
+
++.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2" || "$(GUIBASE)"=="aqua" || "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
++CFLAGS+=-DENABLE_QUICKSTART_APPLET
++.ENDIF
++
+ SHL1TARGET = sofficeapp
+ SHL1OBJS = \
+ $(SLO)$/app.obj \
+diff -r 3c24aa9a7810 sfx2/source/appl/shutdownicon.cxx
+--- a/sfx2/source/appl/shutdownicon.cxx Sat Jan 23 16:31:03 2010 +0000
++++ b/sfx2/source/appl/shutdownicon.cxx Tue Feb 02 13:59:39 2010 +0000
+@@ -555,8 +555,8 @@
+ return;
+
+ // always remove ourselves as listener
++ pInst->m_bListenForTermination = true;
+ xDesktop->removeTerminateListener( pInst );
+- pInst->m_bListenForTermination = true;
+
+ // terminate desktop only if no tasks exist
+ Reference< XFramesSupplier > xSupplier( xDesktop, UNO_QUERY );
+diff -r 3c24aa9a7810 sfx2/source/appl/shutdowniconunx.cxx
+--- a/sfx2/source/appl/shutdowniconunx.cxx Sat Jan 23 16:31:03 2010 +0000
++++ b/sfx2/source/appl/shutdowniconunx.cxx Tue Feb 02 13:59:39 2010 +0000
+@@ -39,6 +39,7 @@
+ static EggTrayIcon *pTrayIcon;
+ static GtkWidget *pExitMenuItem = NULL;
+ static GtkWidget *pOpenMenuItem = NULL;
++static GtkWidget *pDisableMenuItem = NULL;
+
+ static void open_url_cb( GtkWidget *, gpointer data )
+ {
+@@ -67,8 +68,10 @@
+ static void exit_quickstarter_cb( GtkWidget * )
+ {
+ egg_tray_icon_cancel_message (pTrayIcon, 1 );
+- ShutdownIcon::getInstance()->terminateDesktop();
+ plugin_shutdown_sys_tray();
++ //terminate may cause this .so to be unloaded. So we must be hands off
++ //all calls into this .so after this call
++ ShutdownIcon::terminateDesktop();
+ }
+
+ static void menu_deactivate_cb( GtkWidget *pMenu )
+@@ -265,7 +268,7 @@
+ pMenuItem = gtk_separator_menu_item_new();
+ gtk_menu_shell_append( pMenuShell, pMenuItem );
+
+- (void) add_image_menu_item
++ pDisableMenuItem = add_image_menu_item
+ ( pMenuShell, GTK_STOCK_CLOSE,
+ pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ),
+ G_CALLBACK( systray_disable_cb ) );
+@@ -289,6 +292,7 @@
+ bool bModal = ShutdownIcon::bModalMode;
+ gtk_widget_set_sensitive( pExitMenuItem, !bModal);
+ gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
++ gtk_widget_set_sensitive( pDisableMenuItem, !bModal);
+ }
+
+ extern "C" {
+@@ -404,6 +409,7 @@
+ pTrayIcon = NULL;
+ pExitMenuItem = NULL;
+ pOpenMenuItem = NULL;
++ pDisableMenuItem = NULL;
+ }
+
+ #endif // ENABLE_QUICKSTART_APPLET
diff --git a/openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch b/openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch
new file mode 100644
index 0000000..c316687
--- /dev/null
+++ b/openoffice.org-3.2.0.ooo110142.svx.safercolornames.patch
@@ -0,0 +1,31 @@
+diff -ru svx.orig/source/unodraw/unoprov.cxx svx/source/unodraw/unoprov.cxx
+--- svx.orig/source/unodraw/unoprov.cxx 2010-03-15 14:31:21.000000000 +0000
++++ svx/source/unodraw/unoprov.cxx 2010-03-15 15:17:05.000000000 +0000
+@@ -1368,12 +1370,24 @@
+
+ bool SvxUnoConvertResourceString( USHORT* pSourceResIds, USHORT* pDestResIds, int nCount, String& rString ) throw()
+ {
+- int i = 0;
++ //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't
++ //replace "Red Hat 1" with the translation of Red :-)
++ rtl::OUString sStr(rString);
++ const sal_Unicode *pStr = sStr.getStr();
++ sal_Int32 nLength = sStr.getLength();
++ while( nLength > 0 )
++ {
++ const sal_Unicode nChar = pStr[nLength-1];
++ if (nChar != '%' && (nChar < '0' || nChar > '9'))
++ break;
++ nLength--;
++ }
++ sStr = rtl::OUString(pStr, nLength).trim();
+
+- for( i = 0; i < nCount; i++ )
++ for(int i = 0; i < nCount; ++i )
+ {
+ String aStrDefName = SVX_RESSTR( pSourceResIds[i] );
+- if( rString.Search( aStrDefName ) == 0 )
++ if( sStr.equals( aStrDefName ) )
+ {
+ String aReplace = SVX_RESSTR( pDestResIds[i] );
+ rString.Replace( 0, aStrDefName.Len(), aReplace );
diff --git a/openoffice.org-3.2.0.ooo111741.extras.malformed-xml-file.patch b/openoffice.org-3.2.0.ooo111741.extras.malformed-xml-file.patch
new file mode 100644
index 0000000..827fa5c
--- /dev/null
+++ b/openoffice.org-3.2.0.ooo111741.extras.malformed-xml-file.patch
@@ -0,0 +1,24 @@
+# HG changeset patch
+# Parent 34e231cc7773ab82fa170edf12e1e6082e5fa50b
+#i111741# fix malformed XML
+
+diff -r 34e231cc7773 extras/source/palettes/lang/pt-BR/classic_pt-BR.sog
+--- a/extras/source/palettes/lang/pt-BR/classic_pt-BR.sog Fri May 21 08:28:32 2010 +0200
++++ b/extras/source/palettes/lang/pt-BR/classic_pt-BR.sog Fri May 21 09:31:48 2010 +0200
+@@ -17,15 +17,4 @@
+ <draw:gradient draw:name="Radial 3" draw:style="radial" draw:cx="100%" draw:cy="0%" draw:start-color="#000000" draw:end-color="#ffffff" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/>
+ <draw:gradient draw:name="Radial 4" draw:style="radial" draw:cx="0%" draw:cy="100%" draw:start-color="#000000" draw:end-color="#ffffff" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/>
+ <draw:gradient draw:name="Radial 5" draw:style="radial" draw:cx="100%" draw:cy="100%" draw:start-color="#000000" draw:end-color="#ffffff" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/>
+- <draw:gradient draw:name="Azul vertical" draw:style="linear" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Azul diagonal" draw:style="linear" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Azul horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Azul horizontal 2" draw:style="axial" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:ang
le="900" draw:border="0%"/><draw:gradient draw:name="Azul Vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 3" draw:style="linear" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 6" draw:style="axial" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw
:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradie
+-t draw:name="Azul radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, azul" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, azul 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, azul 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul" draw:style="square" draw:cx="10%" draw:cy="10%"
draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Turquesa vertical" draw:style="linear" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" dr
aw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradien
+- draw:name="Turquesa diagonal" draw:style="linear" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Turquesa horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Turquesa horizontal 2" draw:style="axial" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Turquesa vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%"
draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 3" draw:style="linear" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 6" draw:style="axial" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" dra
w:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="
+-00%" draw:border="0%"/><draw:gradient draw:name="Do meio, turquesa" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, turquesa 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, turquesa 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turquesa 1" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient dr
aw:name="De um canto, turquesa 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turquesa 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turquesa 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta vertical" draw:style="linear" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal" draw:style="linear" draw:start-color="#94006b
" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intens
+-ty="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Violeta horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Violeta horizontal 2" draw:style="axial" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Violeta vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 3" draw:style="linear" draw:start-color="#94006b" draw:end-color="#000000"
draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 6" draw:style="axial" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Violeta radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, violeta" draw:style="square" d
raw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="
+-94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, violeta 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, violeta 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw
:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja vertical" draw:style="linear" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal" draw:style="linear" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 2" draw:
style="linear" draw:start-color="#000000" draw:end-color="#ff9966" dra
+-:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Laranja horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Laranja horizontal 2" draw:style="axial" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Laranja vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 3" draw:style="linear" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 4" draw:style="linear" draw:star
t-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 6" draw:style="axial" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Laranja radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal " draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%
"/><draw:gradient draw:name="Laranja diagonal 2" draw:style="rectangu
+-ar" draw:cx="50%" draw:cy="50%" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:sta
rt-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde vertical" draw:style="linear" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde diagonal" draw:style="linear" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradie
nt draw:name="Verde horizontal" draw:style="axial" draw:start-color="#
+-00000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Verde horizontal 2" draw:style="axial" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Verde vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 3" draw:style="linear" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 5" draw:
style="axial" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 6" draw:style="axial" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Verde radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, verde" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, verde 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-i
ntensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:n
+-me="Do meio, verde 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde 4" draw:style="square" dra
w:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho vertical" draw:style="linear" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal" draw:style="linear" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Vermelho horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/>
<draw:gradient draw:name="Vermelho horizontal 2" draw:style="axial" dr
+-w:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Vermelho vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 3" draw:style="linear" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:n
ame="Vermelho diagonal 6" draw:style="axial" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Vermelho radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, vermelho" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, vermelho 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, vermelho 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color
="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:e
+-d-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw
:border="0%"/></office:gradient-table>
++ <draw:gradient draw:name="Azul vertical" draw:style="linear" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Azul diagonal" draw:style="linear" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Azul horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Azul horizontal 2" draw:style="axial" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:ang
le="900" draw:border="0%"/><draw:gradient draw:name="Azul Vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 3" draw:style="linear" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul diagonal 6" draw:style="axial" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw
:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Azul radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, azul" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, azul 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#0000ff" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, azul 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:na
me="De um canto, azul" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, azul 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#0000ff" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Turquesa vertical" draw:style="linear" draw:start-c
olor="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal" draw:style="linear" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Turquesa horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Turquesa horizontal 2" draw:style="axial" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Turque
sa vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 3" draw:style="linear" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Turquesa diagonal 6" draw:style="axial" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350"
draw:border="0%"/><draw:gradient draw:name="Turquesa radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, turquesa" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, turquesa 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#33a3a3" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, turquesa 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turque
sa 1" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turquesa 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turquesa 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, turquesa 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#33a3a3" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta vertical" draw:style="linear" draw:start-color="
#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal" draw:style="linear" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Violeta horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Violeta horizontal 2" draw:style="axial" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Violeta vertical
2" draw:style="linear" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 3" draw:style="linear" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Violeta diagonal 6" draw:style="axial" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/
><draw:gradient draw:name="Violeta radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, violeta" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, violeta 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#94006b" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, violeta 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta" draw:style="square"
draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, violeta 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#94006b" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja vertical" draw:style="linear" draw:start-color="#ff9966" draw:end-color="#00
0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal" draw:style="linear" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Laranja horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Laranja horizontal 2" draw:style="axial" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Laranja vertical 2" draw:style="linear" dra
w:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 3" draw:style="linear" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 6" draw:style="axial" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:nam
e="Laranja radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal " draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#ff9966" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Laranja diagonal 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja" draw:style="square" draw:cx="10%" draw:c
y="10%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, laranja 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff9966" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde vertical" draw:style="linear" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intens
ity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde diagonal" draw:style="linear" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Verde horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Verde horizontal 2" draw:style="axial" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Verde vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-c
olor="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 3" draw:style="linear" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Verde diagonal 6" draw:style="axial" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Verde radial" draw:style="radial" draw:cx=
"50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, verde" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, verde 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#00ae00" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, verde 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#00ae00
" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, verde 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#00ae00" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho vertical" draw:style="linear" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:bord
er="0%"/><draw:gradient draw:name="Vermelho diagonal" draw:style="linear" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="450" draw:border="0%"/><draw:gradient draw:name="Vermelho horizontal" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Vermelho horizontal 2" draw:style="axial" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="900" draw:border="0%"/><draw:gradient draw:name="Vermelho vertical 2" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" dra
w:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 3" draw:style="linear" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 4" draw:style="linear" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 5" draw:style="axial" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Vermelho diagonal 6" draw:style="axial" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="1350" draw:border="0%"/><draw:gradient draw:name="Vermelho radial" draw:style="radial" draw:cx="50%" draw:cy="50%" draw:start-
color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:border="0%"/><draw:gradient draw:name="Do meio, vermelho" draw:style="square" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, vermelho 2" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#ff0000" draw:end-color="#000000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="Do meio, vermelho 3" draw:style="rectangular" draw:cx="50%" draw:cy="50%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho" draw:style="square" draw:cx="10%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intens
ity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho 2" draw:style="square" draw:cx="90%" draw:cy="10%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho 3" draw:style="square" draw:cx="10%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/><draw:gradient draw:name="De um canto, vermelho 4" draw:style="square" draw:cx="90%" draw:cy="90%" draw:start-color="#000000" draw:end-color="#ff0000" draw:start-intensity="100%" draw:end-intensity="100%" draw:angle="0" draw:border="0%"/></office:gradient-table>
diff --git a/openoffice.org-3.2.0.ooo95369.sw.sortedobjs.patch b/openoffice.org-3.2.0.ooo95369.sw.sortedobjs.patch
new file mode 100644
index 0000000..847fd89
--- /dev/null
+++ b/openoffice.org-3.2.0.ooo95369.sw.sortedobjs.patch
@@ -0,0 +1,17 @@
+diff -r 2da10c20ba01 sw/source/core/layout/trvlfrm.cxx
+--- a/sw/source/core/layout/trvlfrm.cxx Mon Feb 08 10:49:42 2010 +0000
++++ b/sw/source/core/layout/trvlfrm.cxx Tue Feb 16 10:35:18 2010 +0000
+@@ -2064,9 +2064,11 @@
+ if ( pStartFrm->IsInFly() )
+ {
+ const SwAnchoredObject* pObj = pStartFrm->FindFlyFrm();
+- aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
++ ASSERT( pObj, "No Start Object." );
++ if (pObj) aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
+ const SwAnchoredObject* pObj2 = pEndFrm->FindFlyFrm();
+- aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj2)) );
++ ASSERT( pObj2, "No Start Object." );
++ if (pObj2) aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj2)) );
+ }
+
+ //Fall 4: Tabellenselection
diff --git a/openoffice.org-3.2.0.rh632236.writerfilter.cleanup-cell-props.patch b/openoffice.org-3.2.0.rh632236.writerfilter.cleanup-cell-props.patch
new file mode 100644
index 0000000..0c237dd
--- /dev/null
+++ b/openoffice.org-3.2.0.rh632236.writerfilter.cleanup-cell-props.patch
@@ -0,0 +1,37 @@
+# HG changeset patch
+# Parent 95fe59fa4df8614a0bf6b0f5b7c7114e98a28f8d
+rhbz#632236: [abrt] [docx] _Construct<long, long> crash
+
+diff -r 95fe59fa4df8 writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx Wed Sep 29 09:32:54 2010 +0200
++++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx Wed Sep 29 09:59:15 2010 +0200
+@@ -492,13 +492,6 @@
+ if( aRepeatIter == m_aTableProperties->end() )
+ m_aTableProperties->Insert( PROP_HEADER_ROW_COUNT, false, uno::makeAny( (sal_Int32)0 ));
+
+- // Remove the PROP_HEADER_ROW_COUNT from the table default to avoid
+- // propagating it to the cells
+- PropertyMap::iterator aDefaultRepeatIt =
+- rInfo.pTableDefaults->find( PropertyDefinition( PROP_HEADER_ROW_COUNT, false ) );
+- if ( aDefaultRepeatIt != rInfo.pTableDefaults->end( ) )
+- rInfo.pTableDefaults->erase( aDefaultRepeatIt );
+-
+ rInfo.aTableProperties = m_aTableProperties->GetPropertyValues();
+
+ #ifdef DEBUG_DOMAINMAPPER
+@@ -588,7 +581,14 @@
+ PropertyMapPtr pStyleProps = rInfo.pTableStyle->GetProperties( nCellStyleMask + nRowStyleMask );
+ pAllCellProps->insert( pStyleProps );
+ }
+-
++
++ // Remove properties from style/row that aren't allowed in cells
++ const PropertyMap::iterator aDefaultRepeatIt =
++ pAllCellProps->find(
++ PropertyDefinition( PROP_HEADER_ROW_COUNT, false ) );
++ if ( aDefaultRepeatIt != pAllCellProps->end( ) )
++ pAllCellProps->erase( aDefaultRepeatIt );
++
+ // Then add the cell properties
+ pAllCellProps->insert( *aCellIterator );
+ aCellIterator->get( )->swap( *pAllCellProps.get( ) );
diff --git a/openoffice.org-3.3.0.ooo100686.wizards.types.not.mediatypes.patch b/openoffice.org-3.3.0.ooo100686.wizards.types.not.mediatypes.patch
new file mode 100644
index 0000000..63c4839
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo100686.wizards.types.not.mediatypes.patch
@@ -0,0 +1,49 @@
+--- wizards/source/euro/AutoPilotRun.xba 2010-06-08 11:34:12.000000000 +0100
++++ wizards/source/euro/AutoPilotRun.xba 2010-06-08 12:54:34.000000000 +0100
+@@ -11,7 +11,7 @@
+ Public SubstFile as String
+ Public SubstDir as String
+ Public NoArgs()
+-Public FilterList(9) as String
++Public TypeList(14) as String
+ Public GoOn as Boolean
+ Public DoUnprotect as Integer
+ Public Password as String
+@@ -55,20 +55,25 @@
+ Else
+ SourceDir = Source
+ TargetStemDir = TargetDir
+- FilterList(0) = "application/x-starcalc"
+- FilterList(1) = "application/vnd.stardivision.calc"
+- FilterList(2) = "application/vnd.sun.xml.calc"
+- FilterList(3) = "application/vnd.oasis.opendocument.spreadsheet"
++ TypeList(0) = "calc8"
++ TypeList(1) = "calc_StarOffice_XML_Calc"
++ TypeList(2) = "calc_StarCalc_30"
++ TypeList(3) = "calc_StarCalc_40"
++ TypeList(4) = "calc_StarCalc_50"
+ If DialogModel.chkTextDocuments.State = 1 Then
+- ReDim Preserve FilterList(8) as String
+-
+- FilterList(4) = "application/x-starwriter"
+- FilterList(5) = "application/vnd.stardivision.writer"
+- FilterList(6) = "application/vnd.stardivision.writer/web"
+- FilterList(7) = "application/vnd.sun.xml.writer"
+- FilterList(8) = "application/vnd.oasis.opendocument.text"
++ ReDim Preserve TypeList(13) as String
++
++ TypeList(5) = "writer8"
++ TypeList(6) = "writerglobal8"
++ TypeList(7) = "writer_StarOffice_XML_Writer"
++ TypeList(8) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument"
++ TypeList(9) = "writer_StarWriter_30"
++ TypeList(10) = "writer_StarWriter_40"
++ TypeList(11) = "writer_globaldocument_StarWriter_40GlobalDocument"
++ TypeList(12) = "writer_StarWriter_50"
++ TypeList(13) = "writer_globaldocument_StarWriter_50GlobalDocument"
+ End If
+- FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, FilterList())
++ FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
+ TotDocCount = Ubound(FilesList(),1) + 1
+ End If
+ InitializeProgressPage(DialogModel)
diff --git a/openoffice.org-3.3.0.ooo106591.sal.tradcopy.patch b/openoffice.org-3.3.0.ooo106591.sal.tradcopy.patch
new file mode 100644
index 0000000..6e85962
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo106591.sal.tradcopy.patch
@@ -0,0 +1,83 @@
+diff -ru sal.orig/osl/unx/file_misc.cxx sal/osl/unx/file_misc.cxx
+--- sal.orig/osl/unx/file_misc.cxx 2010-08-09 09:13:30.000000000 +0100
++++ sal/osl/unx/file_misc.cxx 2010-08-09 09:21:21.000000000 +0100
+@@ -1022,66 +1022,29 @@
+ return nRet;
+ }
+
+- /* HACK: because memory mapping fails on various
+- platforms if the size of the source file is 0 byte */
+- if (0 == nSourceSize)
+- {
+- close(SourceFileFD);
+- close(DestFileFD);
+- return 0;
+- }
+-
+- // read and lseek are used to check the possibility to access the data
+- // not a nice solution, but it allows to avoid a crash in case it is an opened samba file
+- // generally, reading of one byte should not affect the performance
+- char nCh;
+- if ( 1 != read( SourceFileFD, &nCh, 1 )
+- || -1 == lseek( SourceFileFD, 0, SEEK_SET ) )
+- {
+- nRet = errno;
+- close( SourceFileFD );
+- close( DestFileFD );
+- return nRet;
+- }
+-
+ size_t nWritten = 0;
+ size_t nRemains = nSourceSize;
+
+- /* mmap file -- open dest file -- write -- fsync it at the end */
+- void* pSourceFile = mmap( 0, nSourceSize, PROT_READ, MAP_SHARED, SourceFileFD, 0 );
+- if ( pSourceFile != MAP_FAILED )
+- {
+- nWritten = write( DestFileFD, pSourceFile, nSourceSize );
+- nRemains -= nWritten;
+- munmap( (char*)pSourceFile, nSourceSize );
+- }
+-
+ if ( nRemains )
+ {
+ /* mmap has problems, try the direct streaming */
+- char pBuffer[32000];
++ char pBuffer[0x7FFF];
+ size_t nRead = 0;
+
+- nRemains = nSourceSize;
+-
+- if ( -1 != lseek( SourceFileFD, 0, SEEK_SET )
+- && -1 != lseek( DestFileFD, 0, SEEK_SET ) )
++ do
+ {
+- do
+- {
+- nRead = 0;
+- nWritten = 0;
+-
+- size_t nToRead = std::min( (size_t)32000, nRemains );
+- nRead = read( SourceFileFD, pBuffer, nToRead );
+- if ( (size_t)-1 != nRead )
+- nWritten = write( DestFileFD, pBuffer, nRead );
+-
+- if ( (size_t)-1 != nWritten )
+- nRemains -= nWritten;
+- }
+- while( nRemains && (size_t)-1 != nRead && nRead == nWritten );
++ nRead = 0;
++ nWritten = 0;
++
++ size_t nToRead = std::min( sizeof(pBuffer), nRemains );
++ nRead = read( SourceFileFD, pBuffer, nToRead );
++ if ( (size_t)-1 != nRead )
++ nWritten = write( DestFileFD, pBuffer, nRead );
++
++ if ( (size_t)-1 != nWritten )
++ nRemains -= nWritten;
+ }
++ while( nRemains && (size_t)-1 != nRead && nRead == nWritten );
+ }
+
+ if ( nRemains )
diff --git a/openoffice.org-3.3.0.ooo107490.cppu.lifecycle.patch b/openoffice.org-3.3.0.ooo107490.cppu.lifecycle.patch
new file mode 100644
index 0000000..960dc32
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo107490.cppu.lifecycle.patch
@@ -0,0 +1,852 @@
+--- cppu/source/threadpool/jobqueue.cxx 2008-04-11 11:33:02.000000000 +0100
++++ cppu/source/threadpool/jobqueue.cxx 2009-12-02 16:14:26.000000000 +0000
+@@ -45,6 +45,7 @@
+ m_cndWait( osl_createCondition() )
+ {
+ osl_resetCondition( m_cndWait );
++ m_DisposedCallerAdmin = DisposedCallerAdmin::getInstance();
+ }
+
+ JobQueue::~JobQueue()
+@@ -71,7 +72,7 @@
+ {
+ // synchronize with the dispose calls
+ MutexGuard guard( m_mutex );
+- if( DisposedCallerAdmin::getInstance()->isDisposed( nDisposeId ) )
++ if( m_DisposedCallerAdmin->isDisposed( nDisposeId ) )
+ {
+ return 0;
+ }
+--- cppu/source/threadpool/jobqueue.hxx 2008-04-11 11:33:18.000000000 +0100
++++ cppu/source/threadpool/jobqueue.hxx 2009-12-02 16:15:49.000000000 +0000
+@@ -37,6 +37,8 @@
+ #include <osl/conditn.h>
+ #include <osl/mutex.hxx>
+
++#include <boost/shared_ptr.hpp>
++
+ namespace cppu_threadpool
+ {
+ extern "C" typedef void (SAL_CALL RequestFun)(void *);
+@@ -51,6 +53,9 @@
+
+ typedef ::std::list < sal_Int64 > CallStackList;
+
++ class DisposedCallerAdmin;
++ typedef boost::shared_ptr<DisposedCallerAdmin> DisposedCallerAdminHolder;
++
+ class JobQueue
+ {
+ public:
+@@ -76,6 +81,7 @@
+ sal_Int32 m_nToDo;
+ sal_Bool m_bSuspended;
+ oslCondition m_cndWait;
++ DisposedCallerAdminHolder m_DisposedCallerAdmin;
+ };
+ }
+
+--- cppu/source/threadpool/thread.cxx 2008-04-11 11:34:00.000000000 +0100
++++ cppu/source/threadpool/thread.cxx 2009-12-03 16:15:02.000000000 +0000
+@@ -31,6 +31,8 @@
+ #include <osl/diagnose.h>
+ #include <uno/threadpool.h>
+
++#include <rtl/instance.hxx>
++
+ #include "thread.hxx"
+ #include "jobqueue.hxx"
+ #include "threadpool.hxx"
+@@ -98,20 +100,17 @@
+ } while( pCurrent );
+ }
+
+- ThreadAdmin* ThreadAdmin::getInstance()
++ struct theThreadAdmin : public rtl::StaticWithInit< ThreadAdminHolder, theThreadAdmin >
+ {
+- static ThreadAdmin *pThreadAdmin = 0;
+- if( ! pThreadAdmin )
+- {
+- MutexGuard guard( Mutex::getGlobalMutex() );
+- if( ! pThreadAdmin )
+- {
+- static ThreadAdmin admin;
+- pThreadAdmin = &admin;
+- }
++ ThreadAdminHolder operator () () {
++ ThreadAdminHolder aRet(new ThreadAdmin());
++ return aRet;
+ }
+- return pThreadAdmin;
++ };
+
++ ThreadAdminHolder& ThreadAdmin::getInstance()
++ {
++ return theThreadAdmin::get();
+ }
+
+ // ----------------------------------------------------------------------------------
+@@ -119,12 +118,13 @@
+ const ByteSequence &aThreadId,
+ sal_Bool bAsynchron )
+ : m_thread( 0 )
++ , m_aThreadAdmin( ThreadAdmin::getInstance() )
+ , m_pQueue( pQueue )
+ , m_aThreadId( aThreadId )
+ , m_bAsynchron( bAsynchron )
+ , m_bDeleteSelf( sal_True )
+ {
+- ThreadAdmin::getInstance()->add( this );
++ m_aThreadAdmin->add( this );
+ }
+
+
+@@ -166,7 +166,7 @@
+
+ void ORequestThread::onTerminated()
+ {
+- ThreadAdmin::getInstance()->remove( this );
++ m_aThreadAdmin->remove( this );
+ if( m_bDeleteSelf )
+ {
+ delete this;
+@@ -175,6 +175,8 @@
+
+ void ORequestThread::run()
+ {
++ ThreadPoolHolder theThreadPool = cppu_threadpool::ThreadPool::getInstance();
++
+ while ( m_pQueue )
+ {
+ if( ! m_bAsynchron )
+@@ -197,7 +199,7 @@
+
+ if( m_pQueue->isEmpty() )
+ {
+- ThreadPool::getInstance()->revokeQueue( m_aThreadId , m_bAsynchron );
++ theThreadPool->revokeQueue( m_aThreadId , m_bAsynchron );
+ // Note : revokeQueue might have failed because m_pQueue.isEmpty()
+ // may be false (race).
+ }
+@@ -211,7 +213,7 @@
+ uno_releaseIdFromCurrentThread();
+ }
+
+- cppu_threadpool::ThreadPool::getInstance()->waitInPool( this );
++ theThreadPool->waitInPool( this );
+ }
+ }
+ }
+--- cppu/source/threadpool/thread.hxx 2008-04-11 11:34:18.000000000 +0100
++++ cppu/source/threadpool/thread.hxx 2009-12-02 15:58:34.000000000 +0000
+@@ -37,6 +37,8 @@
+ namespace cppu_threadpool {
+
+ class JobQueue;
++ class ThreadAdmin;
++ typedef boost::shared_ptr<ThreadAdmin> ThreadAdminHolder;
+
+ //-----------------------------------------
+ // private thread class for the threadpool
+@@ -61,6 +63,7 @@
+
+ private:
+ oslThread m_thread;
++ ThreadAdminHolder m_aThreadAdmin;
+ JobQueue *m_pQueue;
+ ::rtl::ByteSequence m_aThreadId;
+ sal_Bool m_bAsynchron;
+@@ -71,7 +74,7 @@
+ {
+ public:
+ ~ThreadAdmin ();
+- static ThreadAdmin *getInstance();
++ static ThreadAdminHolder &getInstance();
+ void add( ORequestThread * );
+ void remove( ORequestThread * );
+ void join();
+--- cppu/source/threadpool/threadpool.cxx 2008-04-11 11:34:54.000000000 +0100
++++ cppu/source/threadpool/threadpool.cxx 2009-12-03 16:14:56.000000000 +0000
+@@ -33,6 +33,7 @@
+ #include <osl/diagnose.h>
+ #include <osl/mutex.hxx>
+ #include <osl/thread.h>
++#include <rtl/instance.hxx>
+
+ #include <uno/threadpool.h>
+
+@@ -44,19 +45,17 @@
+
+ namespace cppu_threadpool
+ {
+- DisposedCallerAdmin *DisposedCallerAdmin::getInstance()
++ struct theDisposedCallerAdmin :
++ public rtl::StaticWithInit< DisposedCallerAdminHolder, theDisposedCallerAdmin >
+ {
+- static DisposedCallerAdmin *pDisposedCallerAdmin = 0;
+- if( ! pDisposedCallerAdmin )
+- {
+- MutexGuard guard( Mutex::getGlobalMutex() );
+- if( ! pDisposedCallerAdmin )
+- {
+- static DisposedCallerAdmin admin;
+- pDisposedCallerAdmin = &admin;
+- }
++ DisposedCallerAdminHolder operator () () {
++ return DisposedCallerAdminHolder(new DisposedCallerAdmin());
+ }
+- return pDisposedCallerAdmin;
++ };
++
++ DisposedCallerAdminHolder DisposedCallerAdmin::getInstance()
++ {
++ return theDisposedCallerAdmin::get();
+ }
+
+ DisposedCallerAdmin::~DisposedCallerAdmin()
+@@ -107,6 +106,21 @@
+
+
+ //-------------------------------------------------------------------------------
++
++ struct theThreadPool :
++ public rtl::StaticWithInit< ThreadPoolHolder, theThreadPool >
++ {
++ ThreadPoolHolder operator () () {
++ ThreadPoolHolder aRet(new ThreadPool());
++ return aRet;
++ }
++ };
++
++ ThreadPool::ThreadPool()
++ {
++ m_DisposedCallerAdmin = DisposedCallerAdmin::getInstance();
++ }
++
+ ThreadPool::~ThreadPool()
+ {
+ #if OSL_DEBUG_LEVEL > 1
+@@ -116,19 +130,9 @@
+ }
+ #endif
+ }
+- ThreadPool *ThreadPool::getInstance()
++ ThreadPoolHolder ThreadPool::getInstance()
+ {
+- static ThreadPool *pThreadPool = 0;
+- if( ! pThreadPool )
+- {
+- MutexGuard guard( Mutex::getGlobalMutex() );
+- if( ! pThreadPool )
+- {
+- static ThreadPool pool;
+- pThreadPool = &pool;
+- }
+- }
+- return pThreadPool;
++ return theThreadPool::get();
+ }
+
+
+@@ -136,7 +140,7 @@
+ {
+ if( nDisposeId )
+ {
+- DisposedCallerAdmin::getInstance()->dispose( nDisposeId );
++ m_DisposedCallerAdmin->dispose( nDisposeId );
+
+ MutexGuard guard( m_mutex );
+ for( ThreadIdHashMap::iterator ii = m_mapQueue.begin() ;
+@@ -171,7 +175,7 @@
+
+ void ThreadPool::stopDisposing( sal_Int64 nDisposeId )
+ {
+- DisposedCallerAdmin::getInstance()->stopDisposing( nDisposeId );
++ m_DisposedCallerAdmin->stopDisposing( nDisposeId );
+ }
+
+ /******************
+@@ -400,7 +404,7 @@
+
+
+
+-typedef ::std::hash_set< uno_ThreadPool, uno_ThreadPool_Hash, uno_ThreadPool_Equal > ThreadpoolHashSet;
++typedef ::std::hash_map< uno_ThreadPool, ThreadPoolHolder, uno_ThreadPool_Hash, uno_ThreadPool_Equal > ThreadpoolHashSet;
+
+ static ThreadpoolHashSet *g_pThreadpoolHashSet;
+
+@@ -420,7 +424,7 @@
+
+ // Just ensure that the handle is unique in the process (via heap)
+ uno_ThreadPool h = new struct _uno_ThreadPool;
+- g_pThreadpoolHashSet->insert( h );
++ g_pThreadpoolHashSet->insert( ThreadpoolHashSet::value_type(h, ThreadPool::getInstance()) );
+ return h;
+ }
+
+--- cppu/source/threadpool/threadpool.hxx 2008-04-11 11:35:13.000000000 +0100
++++ cppu/source/threadpool/threadpool.hxx 2009-12-02 16:12:13.000000000 +0000
+@@ -33,6 +33,8 @@
+
+ #include <rtl/byteseq.hxx>
+
++#include <boost/shared_ptr.hpp>
++
+ #include "jobqueue.hxx"
+
+
+@@ -78,13 +80,16 @@
+ };
+
+ typedef ::std::list < struct ::cppu_threadpool::WaitingThread * > WaitingThreadList;
++
++ class DisposedCallerAdmin;
++ typedef boost::shared_ptr<DisposedCallerAdmin> DisposedCallerAdminHolder;
+
+ class DisposedCallerAdmin
+ {
+ public:
+ ~DisposedCallerAdmin();
+
+- static DisposedCallerAdmin *getInstance();
++ static DisposedCallerAdminHolder getInstance();
+
+ void dispose( sal_Int64 nDisposeId );
+ void stopDisposing( sal_Int64 nDisposeId );
+@@ -95,11 +100,15 @@
+ DisposedCallerList m_lst;
+ };
+
++ class ThreadPool;
++ typedef boost::shared_ptr<ThreadPool> ThreadPoolHolder;
++
+ class ThreadPool
+ {
+ public:
++ ThreadPool();
+ ~ThreadPool();
+- static ThreadPool *getInstance();
++ static ThreadPoolHolder getInstance();
+
+ void dispose( sal_Int64 nDisposeId );
+ void stopDisposing( sal_Int64 nDisposeId );
+@@ -127,6 +136,8 @@
+
+ ::osl::Mutex m_mutexWaitingThreadList;
+ WaitingThreadList m_lstThreads;
++
++ DisposedCallerAdminHolder m_DisposedCallerAdmin;
+ };
+
+ } // end namespace cppu_threadpool
+--- cppu/source/uno/lbenv.cxx 2009-02-12 10:18:09.000000000 +0000
++++ cppu/source/uno/lbenv.cxx 2009-12-03 16:14:26.000000000 +0000
+@@ -142,6 +142,7 @@
+ ::osl::Mutex mutex;
+ OUString2EnvironmentMap aName2EnvMap;
+
++ EnvironmentsData() : isDisposing(false) {}
+ ~EnvironmentsData();
+
+ inline void getEnvironment(
+@@ -150,6 +151,8 @@
+ inline void getRegisteredEnvironments(
+ uno_Environment *** pppEnvs, sal_Int32 * pnLen,
+ uno_memAlloc memAlloc, const OUString & rEnvDcp );
++
++ bool isDisposing;
+ };
+
+ namespace
+@@ -598,9 +601,14 @@
+ *ppHardEnv = 0;
+ }
+
++ EnvironmentsData & rData = theEnvironmentsData::get();
++
++ if (rData.isDisposing)
++ return;
++
+ uno_DefaultEnvironment * that = (uno_DefaultEnvironment *)pEnv;
+ {
+- ::osl::MutexGuard guard( theEnvironmentsData::get().mutex );
++ ::osl::MutexGuard guard( rData.mutex );
+ if (1 == ::osl_incrementInterlockedCount( &that->nRef )) // is dead
+ {
+ that->nRef = 0;
+@@ -917,6 +925,7 @@
+ EnvironmentsData::~EnvironmentsData()
+ {
+ ::osl::MutexGuard guard( mutex );
++ isDisposing = true;
+
+ for ( OUString2EnvironmentMap::const_iterator iPos( aName2EnvMap.begin() );
+ iPos != aName2EnvMap.end(); ++iPos )
+--- cppu/util/target.pmk 2008-04-11 12:07:15.000000000 +0100
++++ cppu/util/target.pmk 2009-12-02 15:50:08.000000000 +0000
+@@ -55,12 +55,3 @@
+ .ENDIF
+
+ .ENDIF
+-
+-# other stuff
+-
+-.IF "$(cppu_no_leak)" == ""
+-.IF "$(bndchk)" == ""
+-CFLAGS += -DCPPU_LEAK_STATIC_DATA
+-.ENDIF
+-.ENDIF
+-
+--- sax/source/tools/fastserializer.cxx 2010-06-22 12:54:56.000000000 +0100
++++ sax/source/tools/fastserializer.cxx 2010-06-22 13:14:30.000000000 +0100
+@@ -27,6 +27,7 @@
+
+ #include "fastserializer.hxx"
+ #include <rtl/ustrbuf.hxx>
++#include <rtl/byteseq.hxx>
+
+ #include <com/sun/star/xml/Attribute.hpp>
+ #include <com/sun/star/xml/FastAttribute.hpp>
+@@ -41,6 +42,7 @@
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Sequence;
++using ::com::sun::star::uno::toUnoSequence;
+ using ::com::sun::star::xml::FastAttribute;
+ using ::com::sun::star::xml::Attribute;
+ using ::com::sun::star::xml::sax::SAXException;
+@@ -52,15 +54,15 @@
+ using ::com::sun::star::io::IOException;
+ using ::com::sun::star::io::BufferSizeExceededException;
+
+-static Sequence< sal_Int8 > aClosingBracket((sal_Int8 *)">", 1);
+-static Sequence< sal_Int8 > aSlashAndClosingBracket((sal_Int8 *)"/>", 2);
+-static Sequence< sal_Int8 > aColon((sal_Int8 *)":", 1);
+-static Sequence< sal_Int8 > aOpeningBracket((sal_Int8 *)"<", 1);
+-static Sequence< sal_Int8 > aOpeningBracketAndSlash((sal_Int8 *)"</", 2);
+-static Sequence< sal_Int8 > aQuote((sal_Int8 *)"\"", 1);
+-static Sequence< sal_Int8 > aEqualSignAndQuote((sal_Int8 *)"=\"", 2);
+-static Sequence< sal_Int8 > aSpace((sal_Int8 *)" ", 1);
+-static Sequence< sal_Int8 > aXmlHeader((sal_Int8*) "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", 56);
++static rtl::ByteSequence aClosingBracket((const sal_Int8 *)">", 1);
++static rtl::ByteSequence aSlashAndClosingBracket((const sal_Int8 *)"/>", 2);
++static rtl::ByteSequence aColon((const sal_Int8 *)":", 1);
++static rtl::ByteSequence aOpeningBracket((const sal_Int8 *)"<", 1);
++static rtl::ByteSequence aOpeningBracketAndSlash((const sal_Int8 *)"</", 2);
++static rtl::ByteSequence aQuote((const sal_Int8 *)"\"", 1);
++static rtl::ByteSequence aEqualSignAndQuote((const sal_Int8 *)"=\"", 2);
++static rtl::ByteSequence aSpace((const sal_Int8 *)" ", 1);
++static rtl::ByteSequence aXmlHeader((const sal_Int8*) "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", 56);
+
+ #define HAS_NAMESPACE(x) ((x & 0xffff0000) != 0)
+ #define NAMESPACE(x) (x >> 16)
+@@ -74,7 +76,7 @@
+ {
+ if (!mxOutputStream.is())
+ return;
+- writeBytes(aXmlHeader);
++ writeBytes(toUnoSequence(aXmlHeader));
+ }
+
+ OUString FastSaxSerializer::escapeXml( const OUString& s )
+@@ -116,7 +118,7 @@
+ {
+ if( HAS_NAMESPACE( nElement ) ) {
+ writeBytes(mxFastTokenHandler->getUTF8Identifier(NAMESPACE(nElement)));
+- writeBytes(aColon);
++ writeBytes(toUnoSequence(aColon));
+ writeBytes(mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement)));
+ } else
+ writeBytes(mxFastTokenHandler->getUTF8Identifier(nElement));
+@@ -128,12 +130,12 @@
+ if (!mxOutputStream.is())
+ return;
+
+- writeBytes(aOpeningBracket);
++ writeBytes(toUnoSequence(aOpeningBracket));
+
+ writeId(Element);
+ writeFastAttributeList(Attribs);
+
+- writeBytes(aClosingBracket);
++ writeBytes(toUnoSequence(aClosingBracket));
+ }
+
+ void SAL_CALL FastSaxSerializer::startUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs )
+@@ -142,19 +144,19 @@
+ if (!mxOutputStream.is())
+ return;
+
+- writeBytes(aOpeningBracket);
++ writeBytes(toUnoSequence(aOpeningBracket));
+
+ if (Namespace.getLength())
+ {
+ write(Namespace);
+- writeBytes(aColon);
++ writeBytes(toUnoSequence(aColon));
+ }
+
+ write(Name);
+
+ writeFastAttributeList(Attribs);
+
+- writeBytes(aClosingBracket);
++ writeBytes(toUnoSequence(aClosingBracket));
+ }
+
+ void SAL_CALL FastSaxSerializer::endFastElement( ::sal_Int32 Element )
+@@ -163,11 +165,11 @@
+ if (!mxOutputStream.is())
+ return;
+
+- writeBytes(aOpeningBracketAndSlash);
++ writeBytes(toUnoSequence(aOpeningBracketAndSlash));
+
+ writeId(Element);
+
+- writeBytes(aClosingBracket);
++ writeBytes(toUnoSequence(aClosingBracket));
+ }
+
+ void SAL_CALL FastSaxSerializer::endUnknownElement( const OUString& Namespace, const OUString& Name )
+@@ -176,17 +178,17 @@
+ if (!mxOutputStream.is())
+ return;
+
+- writeBytes(aOpeningBracketAndSlash);
++ writeBytes(toUnoSequence(aOpeningBracketAndSlash));
+
+ if (Namespace.getLength())
+ {
+ write(Namespace);
+- writeBytes(aColon);
++ writeBytes(toUnoSequence(aColon));
+ }
+
+ write(Name);
+
+- writeBytes(aClosingBracket);
++ writeBytes(toUnoSequence(aClosingBracket));
+ }
+
+ void SAL_CALL FastSaxSerializer::singleFastElement( ::sal_Int32 Element, const Reference< XFastAttributeList >& Attribs )
+@@ -195,12 +197,12 @@
+ if (!mxOutputStream.is())
+ return;
+
+- writeBytes(aOpeningBracket);
++ writeBytes(toUnoSequence(aOpeningBracket));
+
+ writeId(Element);
+ writeFastAttributeList(Attribs);
+
+- writeBytes(aSlashAndClosingBracket);
++ writeBytes(toUnoSequence(aSlashAndClosingBracket));
+ }
+
+ void SAL_CALL FastSaxSerializer::singleUnknownElement( const OUString& Namespace, const OUString& Name, const Reference< XFastAttributeList >& Attribs )
+@@ -209,19 +211,19 @@
+ if (!mxOutputStream.is())
+ return;
+
+- writeBytes(aOpeningBracket);
++ writeBytes(toUnoSequence(aOpeningBracket));
+
+ if (Namespace.getLength())
+ {
+ write(Namespace);
+- writeBytes(aColon);
++ writeBytes(toUnoSequence(aColon));
+ }
+
+ write(Name);
+
+ writeFastAttributeList(Attribs);
+
+- writeBytes(aSlashAndClosingBracket);
++ writeBytes(toUnoSequence(aSlashAndClosingBracket));
+ }
+
+ void SAL_CALL FastSaxSerializer::characters( const OUString& aChars )
+@@ -251,12 +253,12 @@
+ sal_Int32 nAttrLength = aAttrSeq.getLength();
+ for (sal_Int32 i = 0; i < nAttrLength; i++)
+ {
+- writeBytes(aSpace);
++ writeBytes(toUnoSequence(aSpace));
+
+ write(pAttr[i].Name);
+- writeBytes(aEqualSignAndQuote);
++ writeBytes(toUnoSequence(aEqualSignAndQuote));
+ write(escapeXml(pAttr[i].Value));
+- writeBytes(aQuote);
++ writeBytes(toUnoSequence(aQuote));
+ }
+
+ Sequence< FastAttribute > aFastAttrSeq = Attribs->getFastAttributes();
+@@ -264,16 +266,16 @@
+ sal_Int32 nFastAttrLength = aFastAttrSeq.getLength();
+ for (sal_Int32 j = 0; j < nFastAttrLength; j++)
+ {
+- writeBytes(aSpace);
++ writeBytes(toUnoSequence(aSpace));
+
+ sal_Int32 nToken = pFastAttr[j].Token;
+ writeId(nToken);
+
+- writeBytes(aEqualSignAndQuote);
++ writeBytes(toUnoSequence(aEqualSignAndQuote));
+
+ write(escapeXml(Attribs->getValue(pFastAttr[j].Token)));
+
+- writeBytes(aQuote);
++ writeBytes(toUnoSequence(aQuote));
+ }
+ }
+
+--- package/inc/ZipPackageFolder.hxx 2010-06-22 11:49:17.000000000 +0100
++++ package/inc/ZipPackageFolder.hxx 2010-06-22 12:50:26.000000000 +0100
+@@ -53,8 +53,6 @@
+ ::com::sun::star::container::XEnumerationAccess
+ >
+ {
+- static com::sun::star::uno::Sequence < sal_Int8 > aImplementationId;
+-
+ protected:
+ ContentHash maContents;
+ const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+@@ -82,10 +80,7 @@
+ throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ static void copyZipEntry( ZipEntry &rDest, const ZipEntry &rSource);
+- static ::com::sun::star::uno::Sequence < sal_Int8 > static_getImplementationId()
+- {
+- return aImplementationId;
+- }
++ static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId();
+
+ void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
+ void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; }
+--- package/source/xstor/owriteablestream.cxx 2010-06-22 11:49:15.000000000 +0100
++++ package/source/xstor/owriteablestream.cxx 2010-06-22 12:13:20.000000000 +0100
+@@ -53,6 +53,7 @@
+
+ #include <rtl/digest.h>
+ #include <rtl/logfile.hxx>
++#include <rtl/instance.hxx>
+
+ // since the copying uses 32000 blocks usually, it makes sense to have a smaller size
+ #define MAX_STORCACHE_SIZE 30000
+@@ -2169,25 +2170,14 @@
+ return m_pData->m_pTypeCollection->getTypes() ;
+ }
+
++namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
++
+ //-----------------------------------------------
+ uno::Sequence< sal_Int8 > SAL_CALL OWriteStream::getImplementationId()
+ throw( uno::RuntimeException )
+ {
+- static ::cppu::OImplementationId* pID = NULL ;
+-
+- if ( pID == NULL )
+- {
+- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ) ;
+-
+- if ( pID == NULL )
+- {
+- static ::cppu::OImplementationId aID( sal_False ) ;
+- pID = &aID ;
+- }
+- }
+-
+- return pID->getImplementationId() ;
+-
++ ::cppu::OImplementationId &rId = lcl_ImplId::get();
++ return rId.getImplementationId();
+ }
+
+ //-----------------------------------------------
+--- package/source/xstor/xstorage.cxx 2010-06-22 11:49:15.000000000 +0100
++++ package/source/xstor/xstorage.cxx 2010-06-22 12:11:45.000000000 +0100
+@@ -48,6 +48,7 @@
+ #include <cppuhelper/typeprovider.hxx>
+ #include <cppuhelper/exc_hlp.hxx>
+ #include <rtl/logfile.hxx>
++#include <rtl/instance.hxx>
+
+ #include <comphelper/processfactory.hxx>
+ #include <comphelper/componentcontext.hxx>
+@@ -2367,25 +2368,14 @@
+ return m_pData->m_pTypeCollection->getTypes() ;
+ }
+
++namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
++
+ //-----------------------------------------------
+ uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId()
+ throw( uno::RuntimeException )
+ {
+- static ::cppu::OImplementationId* pID = NULL ;
+-
+- if ( pID == NULL )
+- {
+- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ) ;
+-
+- if ( pID == NULL )
+- {
+- static ::cppu::OImplementationId aID( sal_False ) ;
+- pID = &aID ;
+- }
+- }
+-
+- return pID->getImplementationId() ;
+-
++ ::cppu::OImplementationId &rID = lcl_ImplId::get();
++ return rID.getImplementationId();
+ }
+
+ //____________________________________________________________________________________________________
+--- package/source/zippackage/ZipPackage.cxx 2010-06-22 11:49:16.000000000 +0100
++++ package/source/zippackage/ZipPackage.cxx 2010-06-22 12:12:00.000000000 +0100
+@@ -68,6 +68,7 @@
+ #include <rtl/uri.hxx>
+ #include <rtl/random.h>
+ #include <rtl/logfile.hxx>
++#include <rtl/instance.hxx>
+ #include <osl/time.h>
+ #include <osl/file.hxx>
+ #include "com/sun/star/io/XAsyncOutputMonitor.hpp"
+@@ -1585,21 +1586,14 @@
+ static_getSupportedServiceNames());
+ }
+
++namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
++
+ // XUnoTunnel
+ Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId( void )
+ throw (RuntimeException)
+ {
+- static ::cppu::OImplementationId * pId = 0;
+- if (! pId)
+- {
+- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+- if (! pId)
+- {
+- static ::cppu::OImplementationId aId;
+- pId = &aId;
+- }
+- }
+- return pId->getImplementationId();
++ ::cppu::OImplementationId &rId = lcl_ImplId::get();
++ return rId.getImplementationId();
+ }
+
+ sal_Int64 SAL_CALL ZipPackage::getSomething( const Sequence< sal_Int8 >& aIdentifier )
+--- package/source/zippackage/ZipPackageFolder.cxx 2010-06-22 11:49:16.000000000 +0100
++++ package/source/zippackage/ZipPackageFolder.cxx 2010-06-22 12:50:00.000000000 +0100
+@@ -43,6 +43,7 @@
+ #include <com/sun/star/io/XSeekable.hpp>
+ #include <EncryptedDataHeader.hxx>
+ #include <rtl/random.h>
++#include <rtl/instance.hxx>
+ #include <memory>
+
+ using namespace com::sun::star::packages::zip::ZipConstants;
+@@ -59,7 +60,7 @@
+ using namespace ::com::sun::star;
+ using vos::ORef;
+
+-Sequence < sal_Int8 > ZipPackageFolder::aImplementationId = Sequence < sal_Int8 > ();
++namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
+
+ ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory,
+ sal_Int32 nFormat,
+@@ -80,10 +81,9 @@
+ aEntry.nCompressedSize = 0;
+ aEntry.nSize = 0;
+ aEntry.nOffset = -1;
+- if ( !aImplementationId.getLength() )
+- {
+- aImplementationId = getImplementationId();
+- }
++ Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get();
++ if ( !rCachedImplId.getLength() )
++ rCachedImplId = getImplementationId();
+ }
+
+
+@@ -187,6 +187,11 @@
+ rDest.nExtraLen = rSource.nExtraLen;
+ }
+
++const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageFolder::static_getImplementationId()
++{
++ return lcl_CachedImplId::get();
++}
++
+ // XNameContainer
+ void SAL_CALL ZipPackageFolder::insertByName( const OUString& aName, const Any& aElement )
+ throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
+--- package/source/zippackage/ZipPackageStream.cxx 2010-06-22 11:49:16.000000000 +0100
++++ package/source/zippackage/ZipPackageStream.cxx 2010-06-22 12:53:32.000000000 +0100
+@@ -45,6 +45,8 @@
+ #include <comphelper/seekableinput.hxx>
+ #include <comphelper/storagehelper.hxx>
+
++#include <rtl/instance.hxx>
++
+ #include <PackageConstants.hxx>
+
+ using namespace com::sun::star::packages::zip::ZipConstants;
+@@ -55,8 +57,12 @@
+ using namespace cppu;
+ using namespace rtl;
+
+-Sequence < sal_Int8 > ZipPackageStream::aImplementationId = Sequence < sal_Int8 > ();
++namespace { struct lcl_CachedImplId : public rtl::Static< Sequence < sal_Int8 >, lcl_CachedImplId > {}; }
+
++const ::com::sun::star::uno::Sequence < sal_Int8 >& ZipPackageStream::static_getImplementationId()
++{
++ return lcl_CachedImplId::get();
++}
+
+ ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,
+ const Reference< XMultiServiceFactory >& xFactory,
+@@ -91,10 +97,9 @@
+ aEntry.nPathLen = -1;
+ aEntry.nExtraLen = -1;
+
+- if ( !aImplementationId.getLength() )
+- {
+- aImplementationId = getImplementationId();
+- }
++ Sequence < sal_Int8 > &rCachedImplId = lcl_CachedImplId::get();
++ if ( !rCachedImplId.getLength() )
++ rCachedImplId = getImplementationId();
+ }
+
+ ZipPackageStream::~ZipPackageStream( void )
+--- package/source/zippackage/ZipPackageStream.hxx 2010-06-22 11:49:16.000000000 +0100
++++ package/source/zippackage/ZipPackageStream.hxx 2010-06-22 12:51:18.000000000 +0100
+@@ -55,7 +55,6 @@
+ ::com::sun::star::packages::XDataSinkEncrSupport
+ >
+ {
+- static com::sun::star::uno::Sequence < sal_Int8 > aImplementationId;
+ protected:
+ com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
+ const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory;
+@@ -146,10 +145,7 @@
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawData()
+ throw(::com::sun::star::uno::RuntimeException);
+
+- static ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId()
+- {
+- return aImplementationId;
+- }
++ static const ::com::sun::star::uno::Sequence < sal_Int8 >& static_getImplementationId();
+
+ // XActiveDataSink
+ virtual void SAL_CALL setInputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aStream )
diff --git a/openoffice.org-3.3.0.ooo108246.svx.hide-sql-group-when-inactive.patch b/openoffice.org-3.3.0.ooo108246.svx.hide-sql-group-when-inactive.patch
new file mode 100644
index 0000000..4862e4b
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo108246.svx.hide-sql-group-when-inactive.patch
@@ -0,0 +1,97 @@
+diff -r aa65062d8d37 svx/source/cui/optcolor.cxx
+--- a/cui/source/options/optcolor.cxx Mon Jan 11 19:41:39 2010 +0100
++++ b/cui/source/options/optcolor.cxx Sat Jan 16 10:03:24 2010 +0100
+@@ -261,6 +261,9 @@
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
++ // calculate position behind last chapter
++ sal_Int32 impl_getPosBehindLastChapter() const;
++
+ public:
+ ColorConfigWindow_Impl(Window* pParent, const ResId& rResId);
+ ~ColorConfigWindow_Impl();
+@@ -398,7 +401,7 @@
+
+ /* -----------------------------25.03.2002 17:05------------------------------
+
+- ---------------------------------------------------------------------------*/
++---------------------------------------------------------------------------*/
+ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rResId) :
+ Window(pParent, rResId),
+ aGeneralBackWN(this),
+@@ -709,14 +712,14 @@
+ aChapters[GROUP_CALC ]->SetGroupHeight( aChapters[GROUP_DRAW]->GetPosPixel().Y() - aChapters[GROUP_CALC]->GetPosPixel().Y() );
+ aChapters[GROUP_DRAW ]->SetGroupHeight( aChapters[GROUP_BASIC]->GetPosPixel().Y() - aChapters[GROUP_DRAW]->GetPosPixel().Y() );
+ aChapters[GROUP_BASIC ]->SetGroupHeight( aChapters[GROUP_SQL]->GetPosPixel().Y() - aChapters[GROUP_BASIC]->GetPosPixel().Y() );
++ aChapters[GROUP_SQL]->SetGroupHeight(impl_getPosBehindLastChapter()
++ - aChapters[GROUP_SQL]->GetPosPixel().Y());
+
+ ExtendedColorConfig aExtConfig;
+ sal_Int32 nExtCount = aExtConfig.GetComponentCount();
+ if ( nExtCount )
+ {
+- // calculate position behind last chapter
+- sal_Int32 nLastY = aSQLCommentWN.GetPosPixel().Y() + aSQLCommentWN.GetSizePixel().Height();
+- nLastY = nLastY + LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
++ const sal_Int32 nLastY(impl_getPosBehindLastChapter());
+ // to calculate the number of lines
+ sal_Int32 nHeight = LogicToPixel( Size( 0, _LINE_HEIGHT ), MAP_APPFONT ).Height();
+ sal_Int32 nLineNum = nLastY / nHeight;
+@@ -898,6 +901,15 @@
+ aChapterWins.clear();
+ ::std::vector< Window*>().swap(aChapterWins);
+ }
++
++sal_Int32
++ColorConfigWindow_Impl::impl_getPosBehindLastChapter() const
++{
++ sal_Int32 nLastY = aSQLCommentWN.GetPosPixel().Y() + aSQLCommentWN.GetSizePixel().Height();
++ nLastY = nLastY + LogicToPixel( Size( 0, 3 ), MAP_APPFONT ).Height();
++ return nLastY;
++}
++
+ /* -----------------------------2002/06/20 12:48------------------------------
+
+ ---------------------------------------------------------------------------*/
+@@ -1175,9 +1187,9 @@
+ /* -----------------------------26.03.2002 12:55------------------------------
+
+ ---------------------------------------------------------------------------*/
+-sal_Bool lcl_MoveAndShow(Window* pWindow, long nOffset, long nMaxVisible, bool _bShow)
++sal_Bool lcl_MoveAndShow(Window* pWindow, long nOffset, long nMaxVisible, sal_Bool _bShow)
+ {
+- BOOL bHide = TRUE;
++ sal_Bool bHide = TRUE;
+ if(pWindow)
+ {
+ Point aPos = pWindow->GetPosPixel();
+@@ -1206,12 +1218,14 @@
+ continue;
+ Point aPos;
+ //controls outside of the view need to be hidden to speed up accessibility tools
+- bool bShowCtrl = ( lcl_isGroupVisible(
++ sal_Bool bShowCtrl = ( lcl_isGroupVisible(
+ lcl_getGroup(i), aScrollWindow.GetModuleOptions() ) != sal_False );
+- lcl_MoveAndShow(aScrollWindow.aCheckBoxes[i], nOffset, nWindowHeight, bShowCtrl);
+- lcl_MoveAndShow(aScrollWindow.aFixedTexts[i], nOffset, nWindowHeight, bShowCtrl);
+- lcl_MoveAndShow(aScrollWindow.aWindows[i] , nOffset, nWindowHeight, bShowCtrl);
+- BOOL bShow = lcl_MoveAndShow(aScrollWindow.aColorBoxes[i], nOffset, nWindowHeight, bShowCtrl);
++ // if any of the items on the current line is visible, the
++ // whole line should be visible
++ sal_Bool bShow(lcl_MoveAndShow(aScrollWindow.aCheckBoxes[i], nOffset, nWindowHeight, bShowCtrl));
++ bShow = lcl_MoveAndShow(aScrollWindow.aFixedTexts[i], nOffset, nWindowHeight, bShowCtrl) || bShow;
++ bShow = lcl_MoveAndShow(aScrollWindow.aWindows[i] , nOffset, nWindowHeight, bShowCtrl) || bShow;
++ bShow = lcl_MoveAndShow(aScrollWindow.aColorBoxes[i], nOffset, nWindowHeight, bShowCtrl) || bShow;
+ if(bShow)
+ {
+ if(nFirstVisible == -1)
+@@ -1223,7 +1237,7 @@
+ //show the one prior to the first visible and the first after the last visble control
+ //to enable KEY_TAB travelling
+
+- if(nFirstVisible)
++ if(nFirstVisible > 0)
+ {
+ //skip gaps where no controls exist for the related ColorConfigEntry
+ do
diff --git a/openoffice.org-3.3.0.ooo108637.sfx2.uisavedir.patch b/openoffice.org-3.3.0.ooo108637.sfx2.uisavedir.patch
new file mode 100644
index 0000000..6ea6c1d
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo108637.sfx2.uisavedir.patch
@@ -0,0 +1,41 @@
+diff -r 3c24aa9a7810 sfx2/source/doc/guisaveas.cxx
+--- a/sfx2/source/doc/guisaveas.cxx Sat Jan 23 16:31:03 2010 +0000
++++ b/sfx2/source/doc/guisaveas.cxx Sun Jan 24 17:16:37 2010 +0000
+@@ -231,7 +231,7 @@
+ sal_Bool bSetStandardName,
+ ::rtl::OUString& aSuggestedName,
+ sal_Bool bPreselectPassword,
+- const ::rtl::OUString& aSuggestedDir,
++ ::rtl::OUString& aSuggestedDir,
+ sal_Int16 nDialog,
+ const ::rtl::OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList
+@@ -731,7 +731,7 @@
+ sal_Bool bSetStandardName,
+ ::rtl::OUString& aSuggestedName,
+ sal_Bool bPreselectPassword,
+- const ::rtl::OUString& aSuggestedDir,
++ ::rtl::OUString& aSuggestedDir,
+ sal_Int16 nDialog,
+ const ::rtl::OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList)
+@@ -927,6 +927,7 @@
+ INetURLObject aURL( pFileDlg->GetPath() );
+ // the path should be provided outside since it might be used for further calls to the dialog
+ aSuggestedName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
++ aSuggestedDir = pFileDlg->GetDisplayDirectory();
+
+ // old filter options should be cleared in case different filter is used
+
+@@ -1412,10 +1413,8 @@
+ sal_Bool bExit = sal_False;
+ while ( !bExit )
+ {
++ // in case the dialog is opened a second time the folder should be the same as previously navigated to by the user, not what was handed over by initial parameters
+ bUseFilterOptions = aModelData.OutputFileDialog( nStoreMode, aFilterProps, bSetStandardName, aSuggestedName, bPreselectPassword, aSuggestedDir, nDialog, sStandardDir, aBlackList );
+-
+- // in case the dialog is opend a second time the folder should be the same as before, not what was handed over by parameters
+- aSuggestedDir = ::rtl::OUString();
+ if ( nStoreMode == SAVEAS_REQUESTED )
+ {
+ // in case of saving check filter for possible alien warning
diff --git a/openoffice.org-3.3.0.ooo111758.sd.xerror.patch b/openoffice.org-3.3.0.ooo111758.sd.xerror.patch
new file mode 100644
index 0000000..4d7973d
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo111758.sd.xerror.patch
@@ -0,0 +1,21 @@
+diff -ru sd.orig/source/ui/slideshow/slideshow.cxx sd/source/ui/slideshow/slideshow.cxx
+--- sd.orig/source/ui/slideshow/slideshow.cxx 2010-05-21 15:44:15.000000000 +0100
++++ sd/source/ui/slideshow/slideshow.cxx 2010-05-21 15:45:57.000000000 +0100
+@@ -699,6 +699,8 @@
+ ViewShellBase* pFullScreenViewShellBase = mpFullScreenViewShellBase;
+ mpFullScreenViewShellBase = 0;
+
++ xController->dispose();
++
+ if( pFullScreenViewShellBase )
+ {
+ PresentationViewShell* pShell = dynamic_cast<PresentationViewShell*>(pFullScreenViewShellBase->GetMainViewShell().get());
+@@ -713,8 +715,6 @@
+ }
+ }
+
+- xController->dispose();
+-
+ if( pFullScreenViewShellBase )
+ {
+ PresentationViewShell* pShell = NULL;
diff --git a/openoffice.org-3.3.0.ooo112059.sw.avoid-null-ptr-deref.patch b/openoffice.org-3.3.0.ooo112059.sw.avoid-null-ptr-deref.patch
new file mode 100644
index 0000000..6bc8ef5
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo112059.sw.avoid-null-ptr-deref.patch
@@ -0,0 +1,16 @@
+# HG changeset patch
+# Parent 25cb853961c8c5bcbe8833e2cd2323707a3d204b
+#i112059# avoid possible null pointer dereference
+
+diff -r 25cb853961c8 sw/source/filter/ww8/ww8graf.cxx
+--- a/sw/source/filter/ww8/ww8graf.cxx Tue Jun 01 06:52:22 2010 +0200
++++ b/sw/source/filter/ww8/ww8graf.cxx Thu Jun 03 08:30:49 2010 +0200
+@@ -2833,7 +2833,7 @@
+ MapWrapIntoFlyFmt(pRecord, pRetFrmFmt);
+
+ // Set frame name with object name
+- if( aObjName.Len() )
++ if( pRetFrmFmt /*#i52825# */ && aObjName.Len() )
+ pRetFrmFmt->SetName( aObjName );
+ return AddAutoAnchor(pRetFrmFmt);
+ }
diff --git a/openoffice.org-3.3.0.ooo112384.sw.export.doc.styledoesntexist.patch b/openoffice.org-3.3.0.ooo112384.sw.export.doc.styledoesntexist.patch
new file mode 100644
index 0000000..08a9b2a
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo112384.sw.export.doc.styledoesntexist.patch
@@ -0,0 +1,11 @@
+--- sw/source/filter/ww8/ww8atr.cxx 2010-06-14 14:19:56.000000000 +0100
++++ sw/source/filter/ww8/ww8atr.cxx 2010-06-14 14:20:18.000000000 +0100
+@@ -2298,7 +2298,7 @@
+ if( sStyle.Len() )
+ {
+ SwTxtFmtColl* pColl = GetExport().pDoc->FindTxtFmtCollByName(sStyle);
+- if (!pColl->IsAssignedToListLevelOfOutlineStyle() || pColl->GetAssignedOutlineStyleLevel() < nTOXLvl)
++ if (!pColl || !pColl->IsAssignedToListLevelOfOutlineStyle() || pColl->GetAssignedOutlineStyleLevel() < nTOXLvl)
+ {
+ if( sTOption.Len() )
+ sTOption += ',';
diff --git a/openoffice.org-3.3.0.ooo113273.desktop.resolvelinks.patch b/openoffice.org-3.3.0.ooo113273.desktop.resolvelinks.patch
new file mode 100644
index 0000000..ca76130
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo113273.desktop.resolvelinks.patch
@@ -0,0 +1,55 @@
+diff -ru desktop.orig/source/deployment/misc/dp_misc.cxx desktop/source/deployment/misc/dp_misc.cxx
+--- desktop.orig/source/deployment/misc/dp_misc.cxx 2010-07-20 08:31:24.000000000 +0100
++++ desktop/source/deployment/misc/dp_misc.cxx 2010-07-20 09:12:23.000000000 +0100
+@@ -143,6 +143,23 @@
+ return pipe.is();
+ }
+
++//get modification time
++static bool getModifyTimeTargetFile(const OUString &rFileURL, TimeValue &rTime)
++{
++ ::osl::DirectoryItem item;
++ if (::osl::DirectoryItem::get(rFileURL, item) != ::osl::File::E_None)
++ return false;
++
++ ::osl::FileStatus stat(FileStatusMask_ModifyTime|FileStatusMask_Type|FileStatusMask_LinkTargetURL);
++ if (item.getFileStatus(stat) != ::osl::File::E_None)
++ return false;
++
++ if( stat.getFileType() == ::osl::FileStatus::Link )
++ return getModifyTimeTargetFile(stat.getLinkTargetURL(), rTime);
++
++ rTime = stat.getModifyTime();
++ return true;
++}
+
+ //Returns true if the Folder was more recently modified then
+ //the lastsynchronized file. That is the repository needs to
+@@ -181,15 +198,12 @@
+
+ //compare the modification time of the extension folder and the last
+ //modified file
+- ::osl::FileStatus statFolder(FileStatusMask_ModifyTime);
+- ::osl::FileStatus statFile(FileStatusMask_ModifyTime);
+- if (itemExtFolder.getFileStatus(statFolder) == ::osl::File::E_None)
++ TimeValue timeFolder;
++ if (getModifyTimeTargetFile(folderURL, timeFolder))
+ {
+- if (itemFile.getFileStatus(statFile) == ::osl::File::E_None)
++ TimeValue timeFile;
++ if (getModifyTimeTargetFile(fileURL, timeFile))
+ {
+- TimeValue timeFolder = statFolder.getModifyTime();
+- TimeValue timeFile = statFile.getModifyTime();
+-
+ if (timeFile.Seconds < timeFolder.Seconds)
+ bNeedsSync = true;
+ }
+@@ -204,6 +218,7 @@
+ OSL_ASSERT(0);
+ bNeedsSync = true;
+ }
++
+ return bNeedsSync;
+ }
+
diff --git a/openoffice.org-3.3.0.ooo114012.sd.bada11ychain.patch b/openoffice.org-3.3.0.ooo114012.sd.bada11ychain.patch
new file mode 100644
index 0000000..39a148d
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo114012.sd.bada11ychain.patch
@@ -0,0 +1,66 @@
+--- sd/source/ui/accessibility/AccessibleSlideSorterView.cxx 2010-08-27 13:38:58.000000000 +0100
++++ sd/source/ui/accessibility/AccessibleSlideSorterView.cxx 2010-08-27 13:34:27.000000000 +0100
+@@ -109,7 +109,6 @@
+ const Reference<XAccessible>& rxParent,
+ ::Window* pContentWindow)
+ : AccessibleSlideSorterViewBase(MutexOwner::maMutex),
+- mpImpl(new Implementation(*this,rSlideSorter,pContentWindow)),
+ mrSlideSorter(rSlideSorter),
+ mxParent(rxParent),
+ mnClientId(0),
+@@ -121,6 +120,16 @@
+
+
+
++
++void AccessibleSlideSorterView::Init()
++{
++ mpImpl.reset(new Implementation(*this,mrSlideSorter,mpContentWindow));
++}
++
++
++
++
++
+ AccessibleSlideSorterView::~AccessibleSlideSorterView (void)
+ {
+ Destroyed ();
+--- sd/source/ui/inc/AccessibleSlideSorterView.hxx 2010-08-27 13:01:53.000000000 +0100
++++ sd/source/ui/inc/AccessibleSlideSorterView.hxx 2010-08-27 13:30:28.000000000 +0100
+@@ -76,6 +76,8 @@
+ ::sd::slidesorter::SlideSorter& rSlideSorter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> & rxParent,
+ ::Window* pParentWindow);
++
++ void Init();
+
+ virtual ~AccessibleSlideSorterView (void);
+
+--- sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx 2010-08-27 13:01:53.000000000 +0100
++++ sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx 2010-08-27 13:41:43.000000000 +0100
+@@ -273,16 +273,22 @@
+ SlideSorterViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow)
+ {
+ OSL_ASSERT(mpSlideSorter.get()!=NULL);
+-
+ // When the view is not set then the initialization is not yet complete
+ // and we can not yet provide an accessibility object.
+- if (mpView == NULL)
++ if (mpView == NULL || mpSlideSorter.get() == NULL)
+ return NULL;
+
+- return new ::accessibility::AccessibleSlideSorterView (
++ ::accessibility::AccessibleSlideSorterView *pAccessibleView =
++ new ::accessibility::AccessibleSlideSorterView(
+ *mpSlideSorter.get(),
+ pWindow->GetAccessibleParentWindow()->GetAccessible(),
+ pWindow);
++
++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> xRet(pAccessibleView);
++
++ pAccessibleView->Init();
++
++ return xRet;
+ }
+
+
diff --git a/openoffice.org-3.3.0.ooo114703.vcl.betterlocalize.font.patch b/openoffice.org-3.3.0.ooo114703.vcl.betterlocalize.font.patch
new file mode 100644
index 0000000..e6d7a4b
--- /dev/null
+++ b/openoffice.org-3.3.0.ooo114703.vcl.betterlocalize.font.patch
@@ -0,0 +1,30 @@
+diff -r 1ddfe565e084 vcl/unx/source/fontmanager/fontconfig.cxx
+--- a/vcl/unx/source/fontmanager/fontconfig.cxx Thu Sep 23 09:39:43 2010 +0100
++++ b/vcl/unx/source/fontmanager/fontconfig.cxx Thu Sep 23 14:13:17 2010 +0100
+@@ -512,19 +512,24 @@
+ for (std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter)
+ {
+ const char *pLang = (const char*)aIter->first;
+- //perfect
+ if( rtl_str_compare(pLang,sFullMatch.getStr() ) == 0)
+ {
++ //perfect match
+ candidate = aIter->second;
+ break;
+ }
+ else if( (rtl_str_compare(pLang,sLangMatch.getStr()) == 0) && (!alreadyclosematch))
+ {
++ //fairly close
+ candidate = aIter->second;
+ alreadyclosematch = true;
+ }
++ else if( (rtl_str_compare(pLang,"en") == 0) && (!alreadyclosematch) )
++ {
++ //english name
++ candidate = aIter->second;
++ }
+ }
+-
+ return candidate;
+ }
+ }
diff --git a/openoffice.org-3.3.0.rh637738.libgcrypt.addmutex.patch b/openoffice.org-3.3.0.rh637738.libgcrypt.addmutex.patch
new file mode 100644
index 0000000..7fc97cb
--- /dev/null
+++ b/openoffice.org-3.3.0.rh637738.libgcrypt.addmutex.patch
@@ -0,0 +1,167 @@
+diff -ru ucb.orig/source/ucp/webdav/NeonHeadRequest.cxx ucb/source/ucp/webdav/NeonHeadRequest.cxx
+--- ucb.orig/source/ucp/webdav/NeonHeadRequest.cxx 2010-09-27 11:08:46.000000000 +0100
++++ ucb/source/ucp/webdav/NeonHeadRequest.cxx 2010-09-27 13:21:17.000000000 +0100
+@@ -156,6 +156,8 @@
+ // Constructor
+ // -------------------------------------------------------------------
+
++extern osl::Mutex aGlobalNeonMutex;
++
+ NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
+ const rtl::OUString & inPath,
+ const std::vector< ::rtl::OUString > &
+@@ -179,7 +181,10 @@
+ ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx );
+ #endif
+
+- nError = ne_request_dispatch( req );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ nError = ne_request_dispatch( req );
++ }
+
+ #if NEON_VERSION >= 0x0250
+ process_headers(req, ioResource, inHeaderNames);
+diff -ru ucb.orig/source/ucp/webdav/NeonSession.cxx ucb/source/ucp/webdav/NeonSession.cxx
+--- ucb.orig/source/ucp/webdav/NeonSession.cxx 2010-09-27 11:08:46.000000000 +0100
++++ ucb/source/ucp/webdav/NeonSession.cxx 2010-09-27 13:26:01.000000000 +0100
+@@ -618,7 +618,12 @@
+ // -------------------------------------------------------------------
+ // static members!
+ bool NeonSession::m_bGlobalsInited = false;
+-osl::Mutex NeonSession::m_aGlobalMutex;
++//See https://bugzilla.redhat.com/show_bug.cgi?id=544619#c4
++//neon is threadsafe, but uses gnutls which is only thread-safe
++//if initialized to be thread-safe. cups, unfortunately, generally
++//initializes it first, and as non-thread-safe, leaving the entire
++//stack unsafe
++osl::Mutex aGlobalNeonMutex;
+ NeonLockStore NeonSession::m_aNeonLockStore;
+
+ // -------------------------------------------------------------------
+@@ -647,7 +652,10 @@
+ {
+ if ( m_pHttpSession )
+ {
+- ne_session_destroy( m_pHttpSession );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ ne_session_destroy( m_pHttpSession );
++ }
+ m_pHttpSession = 0;
+ }
+ delete static_cast< RequestDataMap * >( m_pRequestData );
+@@ -673,11 +681,7 @@
+ if ( m_pHttpSession == 0 )
+ {
+ // Ensure that Neon sockets are initialized
+-
+- // --> tkr #151111# crashed if copy and pasted pictures from the internet
+- // ne_sock_init() was executed by two threads at the same time.
+- osl::Guard< osl::Mutex > theGlobalGuard( m_aGlobalMutex );
+- // <--
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
+ if ( !m_bGlobalsInited )
+ {
+ if ( ne_sock_init() != 0 )
+@@ -726,7 +730,10 @@
+ m_nProxyPort = rProxyCfg.nPort;
+
+ // new session needed, destroy old first
+- ne_session_destroy( m_pHttpSession );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ ne_session_destroy( m_pHttpSession );
++ }
+ m_pHttpSession = 0;
+ bCreateNewSession = true;
+ }
+@@ -739,14 +746,15 @@
+ // currently (0.22.0) neon does not allow to pass the user info
+ // to the session
+
+- m_pHttpSession = ne_session_create(
+- rtl::OUStringToOString( m_aScheme,
+- RTL_TEXTENCODING_UTF8 ).getStr(),
+- /* theUri.GetUserInfo(),
+- @@@ for FTP via HTTP proxy, but not supported by Neon */
+- rtl::OUStringToOString( m_aHostName,
+- RTL_TEXTENCODING_UTF8 ).getStr(),
+- m_nPort );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ m_pHttpSession = ne_session_create(
++ rtl::OUStringToOString( m_aScheme, RTL_TEXTENCODING_UTF8 ).getStr(),
++ /* theUri.GetUserInfo(),
++ @@@ for FTP via HTTP proxy, but not supported by Neon */
++ rtl::OUStringToOString( m_aHostName, RTL_TEXTENCODING_UTF8 ).getStr(),
++ m_nPort );
++ }
+
+ if ( m_pHttpSession == 0 )
+ throw DAVException( DAVException::DAV_SESSION_CREATE,
+@@ -1638,12 +1646,11 @@
+ void NeonSession::abort()
+ throw ( DAVException )
+ {
+- // 11.11.09 (tkr): The following code lines causing crashes if
+- // closing a ongoing connection. It turned out that this existing
+- // solution doesn't work in multi-threading environments.
+- // So I disabled them in 3.2. . Issue #73893# should fix it in OOo 3.3.
+- //if ( m_pHttpSession )
+- // ne_close_connection( m_pHttpSession );
++ if ( m_pHttpSession )
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ ne_close_connection( m_pHttpSession );
++ }
+ }
+
+ // -------------------------------------------------------------------
+@@ -1934,7 +1941,10 @@
+ ne_decompress * dc
+ = ne_decompress_reader( req, ne_accept_2xx, reader, userdata );
+
+- ret = ne_request_dispatch( req );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ ret = ne_request_dispatch( req );
++ }
+
+ #if NEON_VERSION >= 0x0250
+ if ( getheaders )
+@@ -1974,7 +1984,10 @@
+
+ ne_set_request_body_buffer( req, buffer, size );
+
+- ret = ne_request_dispatch( req );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ ret = ne_request_dispatch( req );
++ }
+
+ if ( ret == NE_OK && ne_get_status( req )->klass != 2 )
+ ret = NE_ERROR;
+@@ -2019,7 +2032,10 @@
+
+ ne_set_request_body_buffer( req, buffer, strlen( buffer ) );
+
+- ret = ne_request_dispatch( req );
++ {
++ osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
++ ret = ne_request_dispatch( req );
++ }
+
+ //if ( ctx.error )
+ // ret = NE_ERROR;
+diff -ru ucb.orig/source/ucp/webdav/NeonSession.hxx ucb/source/ucp/webdav/NeonSession.hxx
+--- ucb.orig/source/ucp/webdav/NeonSession.hxx 2010-09-27 11:08:46.000000000 +0100
++++ ucb/source/ucp/webdav/NeonSession.hxx 2010-09-27 13:06:43.000000000 +0100
+@@ -66,7 +66,6 @@
+ DAVRequestEnvironment m_aEnv;
+
+ static bool m_bGlobalsInited;
+- static osl::Mutex m_aGlobalMutex;
+ static NeonLockStore m_aNeonLockStore;
+
+ protected:
diff --git a/openoffice.org-3.3.0.rh638185.editeng.cjkctlhtmlsizes.patch b/openoffice.org-3.3.0.rh638185.editeng.cjkctlhtmlsizes.patch
new file mode 100644
index 0000000..209c7cd
--- /dev/null
+++ b/openoffice.org-3.3.0.rh638185.editeng.cjkctlhtmlsizes.patch
@@ -0,0 +1,64 @@
+diff -r 5f77587494c6 editeng/source/editeng/eehtml.cxx
+--- a/editeng/source/editeng/eehtml.cxx Mon Sep 27 20:33:10 2010 +0100
++++ b/editeng/source/editeng/eehtml.cxx Tue Sep 28 16:23:00 2010 +0100
+@@ -633,15 +633,30 @@
+ SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() );
+
+ aItems.ClearItem( EE_PARA_ULSPACE );
++
+ aItems.ClearItem( EE_CHAR_FONTHEIGHT );
+ aItems.ClearItem( EE_CHAR_FONTINFO );
+ aItems.ClearItem( EE_CHAR_WEIGHT );
+
++ aItems.ClearItem( EE_CHAR_FONTHEIGHT_CJK );
++ aItems.ClearItem( EE_CHAR_FONTINFO_CJK );
++ aItems.ClearItem( EE_CHAR_WEIGHT_CJK );
++
++ aItems.ClearItem( EE_CHAR_FONTHEIGHT_CTL );
++ aItems.ClearItem( EE_CHAR_FONTINFO_CTL );
++ aItems.ClearItem( EE_CHAR_WEIGHT_CTL );
++
+ // Fett in den ersten 3 Headings
+ if ( ( nHLevel >= 1 ) && ( nHLevel <= 3 ) )
+ {
+ SvxWeightItem aWeightItem( WEIGHT_BOLD, EE_CHAR_WEIGHT );
+ aItems.Put( aWeightItem );
++
++ SvxWeightItem aWeightItemCJK( WEIGHT_BOLD, EE_CHAR_WEIGHT_CJK );
++ aItems.Put( aWeightItem );
++
++ SvxWeightItem aWeightItemCTL( WEIGHT_BOLD, EE_CHAR_WEIGHT_CTL );
++ aItems.Put( aWeightItem );
+ }
+
+ // Fonthoehe und Abstaende, wenn LogicToLogic moeglich:
+@@ -660,9 +675,16 @@
+ nPoints = 11;
+
+ nPoints = OutputDevice::LogicToLogic( nPoints, MAP_POINT, eUnit );
++
+ SvxFontHeightItem aHeightItem( nPoints, 100, EE_CHAR_FONTHEIGHT );
+ aItems.Put( aHeightItem );
+
++ SvxFontHeightItem aHeightItemCJK( nPoints, 100, EE_CHAR_FONTHEIGHT_CJK );
++ aItems.Put( aHeightItemCJK );
++
++ SvxFontHeightItem aHeightItemCTL( nPoints, 100, EE_CHAR_FONTHEIGHT_CTL );
++ aItems.Put( aHeightItemCTL );
++
+ // Absatzabstaende, wenn Heading:
+ if ( !nHLevel || ((nHLevel >= 1) && (nHLevel <= 6)) )
+ {
+@@ -679,6 +701,12 @@
+ Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, LANGUAGE_SYSTEM, 0 );
+ SvxFontItem aFontItem( aFont.GetFamily(), aFont.GetName(), XubString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO );
+ aItems.Put( aFontItem );
++
++ SvxFontItem aFontItemCJK( aFont.GetFamily(), aFont.GetName(), XubString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
++ aItems.Put( aFontItemCJK );
++
++ SvxFontItem aFontItemCTL( aFont.GetFamily(), aFont.GetName(), XubString(), aFont.GetPitch(), aFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
++ aItems.Put( aFontItemCTL );
+ }
+
+ pImpEditEngine->SetParaAttribs( nNode, aItems );
diff --git a/redhat-agreement.xsl b/redhat-agreement.xsl
new file mode 100644
index 0000000..76e96a4
--- /dev/null
+++ b/redhat-agreement.xsl
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ex="http://openoffice.org/extensions/description/2006" version="1.0">
+
+<xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="ex:registration"/>
+
+</xsl:stylesheet>
diff --git a/sources b/sources
index e69de29..148d246 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,30 @@
+18f577b374d60b3c760a3a3350407632 18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz
+1f24ab1d39f4a51faf22244c94a6203f 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
+35c94d2df8893241173de1d16b6034c0 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+798b2ffdc8bcfe7bca2cf92b62caf685 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+a7983f859eafb2677d7ff386a023bc40 a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+8c994b7e7873b30d70dccc3918cdfbc0 acor_lt.zip
+ada24d37d8d638b3d8a9985e80bc2978 ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip
+fdb27bfe2dbe2e7b57ae194d9bf36bab fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz
+5340511b6bc2043f642be4ee1e8bf3a7 libreoffice-artwork-3.2.99.1.tar.bz2
+6ef55d438e487e243f96e5c7ce3fe6ec libreoffice-base-3.2.99.1.tar.bz2
+57b68ba83440a900533b40063191cfa5 libreoffice-bootstrap-3.2.99.1.tar.bz2
+daa04e0294bee6c285f004896aa609c8 libreoffice-calc-3.2.99.1.tar.bz2
+8a9393624078d473ac4480cb6b549c20 libreoffice-components-3.2.99.1.tar.bz2
+271da86a068de92d57e4f9c65d512cc5 libreoffice-extensions-3.2.99.1.tar.bz2
+436f19879bd561eef407ce74a3e9f18e libreoffice-extras-3.2.99.1.tar.bz2
+42332f99506dff9780ebcd5d65b60034 libreoffice-filters-3.2.99.1.tar.bz2
+fe17733e7afa553d25b57fb9c7dcfa2c libreoffice-help-3.2.99.1.tar.bz2
+d6dc499bc930629304b1aa3abdfada76 libreoffice-impress-3.2.99.1.tar.bz2
+921f6e161f33b66fbc7c550bfeb74e6f libreoffice-l10n-3.2.99.1.tar.bz2
+9c5bdbb9aac46518aeb033e3a63184e2 libreoffice-libs-core-3.2.99.1.tar.bz2
+5299b08196e521e1fcd4f7665ab0aea9 libreoffice-libs-extern-3.2.99.1.tar.bz2
+d9d45344146d591c51f944fcdc62ee6c libreoffice-libs-extern-sys-3.2.99.1.tar.bz2
+f8638cdfbd58b2a367cf3fe70b4b0c44 libreoffice-libs-gui-3.2.99.1.tar.bz2
+9df015c8299af8bf8b88d5b6288fd6fa libreoffice-postprocess-3.2.99.1.tar.bz2
+acbc48dba8bff10b1b5cf46f57597549 libreoffice-sdk-3.2.99.1.tar.bz2
+2cf115243dcfa686868e49927437d61f libreoffice-testing-3.2.99.1.tar.bz2
+310bf13fb37477cb0b533e92596c4c23 libreoffice-ure-3.2.99.1.tar.bz2
+1fb344dd20334f42d7632e2f76ffb54c libreoffice-writer-3.2.99.1.tar.bz2
+7d38610a11453ee5d12aefe7abda7e91 redhat-langpacks.tar.gz
+f7d976ca8f993913c7b20d88f9961082 redhat-registry.tar.gz
diff --git a/unowinreg.dll b/unowinreg.dll
new file mode 100644
index 0000000..d78bb55
Binary files /dev/null and b/unowinreg.dll differ
diff --git a/workspace.cmcfixes77.patch b/workspace.cmcfixes77.patch
new file mode 100644
index 0000000..abac5d9
--- /dev/null
+++ b/workspace.cmcfixes77.patch
@@ -0,0 +1,1378 @@
+diff -r 85e7cfbbb08a configure.in
+--- a/configure.in Tue Jun 29 15:31:44 2010 +0200
++++ b/configure.in Tue Jul 20 09:57:11 2010 +0100
+@@ -546,6 +546,12 @@
+ AC_ARG_WITH(system-lpsolve,
+ [ --with-system-lpsolve Use lpsolve already on system
+ ],,)
++AC_ARG_WITH(system-libtextcat,
++[ --with-system-libtextcat Use libtextcat already on system
++],,)
++AC_ARG_WITH(system-libtextcat-data,
++[ --with-system-libtextcat-data Use libtextcat data already on system
++],,)
+ AC_ARG_WITH(system-cppunit,
+ [ --with-system-cppunit Use cppunit already on system
+ ],,)
+@@ -5142,6 +5148,38 @@
+ fi
+ AC_SUBST(SYSTEM_LPSOLVE)
+
++dnl ===================================================================
++dnl Checking for libtextcat
++dnl ===================================================================
++AC_MSG_CHECKING([which libtextcat to use])
++if test -n "$with_system_libtextcat" && test "$with_system_libtextcat" != "no"; then
++ AC_MSG_RESULT([external])
++ SYSTEM_LIBTEXTCAT=YES
++ AC_CHECK_HEADER(libtextcat/textcat.h, [],
++ [ AC_MSG_ERROR(libtextcat headers not found.)], [])
++ AC_CHECK_LIB(textcat, special_textcat_Init, ,
++ [ AC_MSG_ERROR(libtextcat library not found or not suitable. libtextcat typically needs to be patched)], [])
++else
++ AC_MSG_RESULT([internal])
++ SYSTEM_LIBTEXTCAT=NO
++ BUILD_TYPE="$BUILD_TYPE LIBTEXTCAT"
++fi
++AC_SUBST(SYSTEM_LIBTEXTCAT)
++
++AC_MSG_CHECKING([which libtextcat data directory to use])
++if test -n "$with_system_libtextcat_data" && test "$with_system_libtextcat_data" != "no"; then
++ if test "$with_system_libtextcat_data" = "yes"; then
++ SYSTEM_LIBTEXTCAT_DATA=file:///usr/share/libtextcat
++ else
++ SYSTEM_LIBTEXTCAT_DATA=file://$with_system_libtextcat_data
++ fi
++ AC_MSG_RESULT([$SYSTEM_LIBTEXTCAT_DATA])
++else
++ AC_MSG_RESULT([internal])
++ BUILD_TYPE="$BUILD_TYPE LIBTEXTCATDATA"
++fi
++AC_SUBST(SYSTEM_LIBTEXTCAT_DATA)
++
+ dnl ***************************************
+ dnl testing libc version for Linux...
+ dnl ***************************************
+@@ -6504,6 +6542,7 @@
+ AC_MSG_CHECKING([whether to include AFMs])
+ if test "$with_afms" != "no"; then
+ AC_MSG_RESULT([yes])
++ BUILD_TYPE="$BUILD_TYPE AFMS"
+ else
+ AC_MSG_RESULT([no])
+ WITHOUT_AFMS=YES
+diff -r 85e7cfbbb08a libtextcat/makefile.mk
+--- a/libtextcat/makefile.mk Tue Jun 29 15:31:44 2010 +0200
++++ b/libtextcat/makefile.mk Tue Jul 20 09:57:11 2010 +0100
+@@ -30,6 +30,12 @@
+ PRJNAME=libtextcat
+ TARGET=libtextcat
+
++.IF "$(SYSTEM_LIBTEXTCAT)" == "YES"
++all:
++ @echo "An already available installation of libtextcat should exist on your system."
++ @echo "Therefore the version provided here does not need to be built in addition."
++.ENDIF
++
+ # --- Settings -----------------------------------------------------
+
+ .INCLUDE : settings.mk
+diff -r 85e7cfbbb08a lingucomponent/prj/build.lst
+--- a/lingucomponent/prj/build.lst Tue Jun 29 15:31:44 2010 +0200
++++ b/lingucomponent/prj/build.lst Tue Jul 20 09:57:11 2010 +0100
+@@ -1,4 +1,4 @@
+-lc lingucomponent : linguistic libtextcat svl HYPHEN:hyphen HUNSPELL:hunspell MYTHES:mythes NULL
++lc lingucomponent : linguistic LIBTEXTCAT:libtextcat LIBTEXTCATDATA:libtextcat svl HYPHEN:hyphen HUNSPELL:hunspell MYTHES:mythes NULL
+ lc lingucomponent usr1 - all lc_mkout NULL
+ lc lingucomponent\inc nmake - all lc_inc NULL
+ lc lingucomponent\source\lingutil nmake - all lc_util lc_inc NULL
+diff -r 85e7cfbbb08a officecfg/registry/data/org/openoffice/Office/Paths.xcu
+--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu Tue Jun 29 15:31:44 2010 +0200
++++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu Tue Jul 20 09:57:11 2010 +0100
+@@ -169,7 +169,8 @@
+
+ <node oor:name="Fingerprint" oor:op="fuse" oor:mandatory="true">
+ <node oor:name="InternalPaths">
+- <node oor:name="$(insturl)/share/fingerprint" oor:op="fuse" />
++ <node install:module="internallibtextcatdata" oor:name="$(insturl)/share/fingerprint" oor:op="fuse"/>
++ <node install:module="externallibtextcatdata" oor:name="${SYSTEM_LIBTEXTCAT_DATA}" oor:op="fuse"/>
+ </node>
+ </node>
+
+diff -r 85e7cfbbb08a officecfg/registry/data/org/openoffice/Office/makefile.mk
+--- a/officecfg/registry/data/org/openoffice/Office/makefile.mk Tue Jun 29 15:31:44 2010 +0200
++++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk Tue Jul 20 09:57:11 2010 +0100
+@@ -87,6 +87,8 @@
+ Paths-macosx.xcu \
+ Paths-unxwnt.xcu \
+ Paths-unixdesktop.xcu \
++ Paths-internallibtextcatdata.xcu \
++ Paths-externallibtextcatdata.xcu \
+ Writer-cjk.xcu \
+ Impress-ogltrans.xcu \
+ Embedding-calc.xcu \
+diff -r 85e7cfbbb08a postprocess/packregistry/makefile.mk
+--- a/postprocess/packregistry/makefile.mk Tue Jun 29 15:31:44 2010 +0200
++++ b/postprocess/packregistry/makefile.mk Tue Jul 20 09:57:11 2010 +0100
+@@ -343,6 +343,11 @@
+ MY_FILES_main += $(MY_MOD)/DataAccess/mozab2.xcu
+ .END
+ .END
++.IF "$(SYSTEM_LIBTEXTCAT_DATA)" != ""
++MY_FILES_main += $(MY_MOD)/org/openoffice/Office/Paths-externallibtextcatdata.xcu
++.ELSE
++MY_FILES_main += $(MY_MOD)/org/openoffice/Office/Paths-internallibtextcatdata.xcu
++.END
+
+ MY_DEPS_math = main
+ MY_FILES_math = \
+diff -r 85e7cfbbb08a psprint_config/prj/build.lst
+--- a/psprint_config/prj/build.lst Tue Jun 29 15:31:44 2010 +0200
++++ b/psprint_config/prj/build.lst Tue Jul 20 09:57:11 2010 +0100
+@@ -1,4 +1,4 @@
+-pc psprint_config : soltools afms NULL
++pc psprint_config : soltools AFMS:afms NULL
+ pc psprint_config usr1 - all pc_mkout NULL
+ pc psprint_config\configuration nmake - u pc_conf NULL
+ pc psprint_config\configuration\ppds nmake - u pc_ppds NULL
+diff -r 85e7cfbbb08a scp2/source/ooo/file_library_ooo.scp
+--- a/scp2/source/ooo/file_library_ooo.scp Tue Jun 29 15:31:44 2010 +0200
++++ b/scp2/source/ooo/file_library_ooo.scp Tue Jul 20 09:57:11 2010 +0100
+@@ -1669,6 +1669,7 @@
+ #endif
+ End
+
++#ifndef SYSTEM_LIBTEXTCAT
+ File gid_File_Lib_Libtextcat
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+@@ -1679,6 +1680,7 @@
+ Name = "libtextcat.dll";
+ #endif
+ End
++#endif
+
+ STD_UNO_LIB_FILE( gid_File_Lib_Guesslang, guesslang )
+
+diff -r 85e7cfbbb08a scp2/source/ooo/file_ooo.scp
+--- a/scp2/source/ooo/file_ooo.scp Tue Jun 29 15:31:44 2010 +0200
++++ b/scp2/source/ooo/file_ooo.scp Tue Jul 20 09:57:11 2010 +0100
+@@ -523,6 +523,7 @@
+ #endif
+ #endif
+
++#ifndef SYSTEM_LIBTEXTCAT_DATA
+ // fingerprint files (lm)
+
+ File gid_File_Conf_Fpdb
+@@ -1036,7 +1037,7 @@
+ Dir = gid_Dir_Share_Fingerprint;
+ Styles = (PACKED);
+ End
+-
++#endif
+
+
+ // mod files
+diff -r 85e7cfbbb08a scp2/source/ooo/makefile.mk
+--- a/scp2/source/ooo/makefile.mk Tue Jun 29 15:31:44 2010 +0200
++++ b/scp2/source/ooo/makefile.mk Tue Jul 20 09:57:11 2010 +0100
+@@ -233,6 +233,14 @@
+ SCPDEFS+=-DSYSTEM_PYTHON
+ .ENDIF
+
++.IF "$(SYSTEM_LIBTEXTCAT)" == "YES"
++SCPDEFS+=-DSYSTEM_LIBTEXTCAT
++.ENDIF
++
++.IF "$(SYSTEM_LIBTEXTCAT_DATA)" != ""
++SCPDEFS+=-DSYSTEM_LIBTEXTCAT_DATA
++.ENDIF
++
+ .IF "$(ENABLE_SVCTAGS)" == "YES"
+ SCPDEFS+=-DENABLE_SVCTAGS
+ .ENDIF
+diff -r 85e7cfbbb08a set_soenv.in
+--- a/set_soenv.in Tue Jun 29 15:31:44 2010 +0200
++++ b/set_soenv.in Tue Jul 20 09:57:11 2010 +0100
+@@ -1926,6 +1926,8 @@
+ ToFile( "SYSTEM_MYTHES", "@SYSTEM_MYTHES@", "e" );
+ ToFile( "MYTHES_CFLAGS", "@MYTHES_CFLAGS@", "e" );
+ ToFile( "MYTHES_LIBS", "@MYTHES_LIBS@", "e" );
++ToFile( "SYSTEM_LIBTEXTCAT", "@SYSTEM_LIBTEXTCAT@","e" );
++ToFile( "SYSTEM_LIBTEXTCAT_DATA","@SYSTEM_LIBTEXTCAT_DATA@","e" );
+ ToFile( "PAM", "@PAM@", "e" );
+ ToFile( "NEW_SHADOW_API", "@NEW_SHADOW_API@", "e" );
+ ToFile( "PAM_LINK", "@PAM_LINK@", "e" );
+diff -r 85e7cfbbb08a solenv/bin/modules/installer/ziplist.pm
+--- a/solenv/bin/modules/installer/ziplist.pm Tue Jun 29 15:31:44 2010 +0200
++++ b/solenv/bin/modules/installer/ziplist.pm Tue Jul 20 09:57:11 2010 +0100
+@@ -806,6 +806,7 @@
+ $variableshashref->{'PRODUCTMINOR'} = $localminor;
+
+ $variableshashref->{'PRODUCTBUILDID'} = $installer::globals::buildid;
++ $variableshashref->{'SYSTEM_LIBTEXTCAT_DATA'} = $ENV{'SYSTEM_LIBTEXTCAT_DATA'} , if( defined $ENV{'SYSTEM_LIBTEXTCAT_DATA'} && $ENV{'SYSTEM_LIBTEXTCAT_DATA'} ne "" );
+ }
+
+ 1;
+diff -r 85e7cfbbb08a solenv/config/sooo330.ini
+--- a/solenv/config/sooo330.ini Tue Jun 29 15:31:44 2010 +0200
++++ b/solenv/config/sooo330.ini Tue Jul 20 09:57:11 2010 +0100
+@@ -9,7 +9,7 @@
+ BMP_WRITES_FLAG TRUE
+ BUILD_SPECIAL TRUE
+ BUILD_STAX YES
+- BUILD_TYPE SO OOo EXT BINFILTER MORE_FONTS BSH CURL DICTIONARIES HSQLDB HUNSPELL HYPHEN MYTHES JPEG LIBXML2 LIBXMLSEC LPSOLVE MOZ NEON TWAIN PYTHON ZLIB SANE UNIXODBC X11_EXTENSIONS LIBWPD EPM ODK MSFONTEXTRACT MATHMLDTD BOOST MDDS EXPAT CRASHREP BERKELEYDB LIBXSLT SUN AGG GTK ICU SYSTRAY_GTK JAVAINSTALLER2 VIGRA OPENSSL JFREEREPORT APACHE_COMMONS TOMCAT REPORTBUILDER SDEXT SWEXT XPDF LUCENE REDLAND SAXON WRITER2LATEX NSS L10N GRAPHITE MYSQLCPPCONN MYSQLC CPPUNIT
++ BUILD_TYPE SO OOo EXT BINFILTER MORE_FONTS BSH CURL DICTIONARIES HSQLDB HUNSPELL HYPHEN MYTHES JPEG LIBXML2 LIBXMLSEC LPSOLVE MOZ NEON TWAIN PYTHON ZLIB SANE UNIXODBC X11_EXTENSIONS LIBWPD EPM ODK MSFONTEXTRACT MATHMLDTD BOOST MDDS EXPAT CRASHREP BERKELEYDB LIBXSLT SUN AGG GTK ICU SYSTRAY_GTK JAVAINSTALLER2 VIGRA OPENSSL JFREEREPORT APACHE_COMMONS TOMCAT REPORTBUILDER SDEXT SWEXT XPDF LUCENE REDLAND SAXON WRITER2LATEX NSS L10N GRAPHITE MYSQLCPPCONN MYSQLC CPPUNIT LIBTEXTCAT LIBTEXTCATDATA AFMS
+ common_build TRUE
+ COMMON_OUTDIR common
+ CONFIG_PROJECT config_office
+--- a/configure.in 2010-07-07 12:32:33.000000000 +0100
++++ b/configure.in 2010-07-07 12:33:27.000000000 +0100
+@@ -3853,7 +3856,11 @@
+ [
+ AC_CHECK_FILE(/usr/share/java/lucene-core.jar,
+ [ LUCENE_CORE_JAR=/usr/share/java/lucene-core.jar ],
+- [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
++ [ AC_CHECK_FILE(/usr/share/java/lucene.jar,
++ [ LUCENE_CORE_JAR=/usr/share/java/lucene.jar ],
++ [ AC_MSG_ERROR(lucene-core.jar replacement not found)]
++ )
++ ]
+ )
+ ]
+ )
+@@ -3876,22 +3883,6 @@
+ AC_CHECK_FILE($LUCENE_CORE_JAR, [],
+ [ AC_MSG_ERROR(lucene-analyzers.jar not found.)], [])
+ fi
+- AC_MSG_CHECKING([whether lucene is version 2.x])
+- export LUCENE_CORE_JAR
+- if $PERL -e 'use Archive::Zip;
+- my $file = "$ENV{'LUCENE_CORE_JAR'}";
+- my $zip = Archive::Zip->new( $file );
+- my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
+- if ( $mf =~ m/Specification-Version: 2.*/ ) {
+- exit 0;
+- } else {
+- exit 1;
+- }'; then
+- AC_MSG_RESULT([yes])
+- else
+- AC_MSG_ERROR([no, you need lucene 2])
+- fi
+-
+ else
+ AC_MSG_RESULT([internal])
+ SYSTEM_LUCENE=NO
+--- a/svtools/source/config/menuoptions.cxx 2010-07-30 12:52:42.000000000 +0100
++++ b/svtools/source/config/menuoptions.cxx 2010-07-30 12:52:53.000000000 +0100
+@@ -245,8 +245,15 @@
+ // Follow assignment use order of values in relation to our list of key names!
+ DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nI miss some values of configuration keys!\n" );
+
+- sal_Bool bMenuIcons = true;
+- sal_Bool bSystemMenuIcons = true;
++ sal_Bool bMenuIcons = sal_True;
++ sal_Bool bSystemMenuIcons = sal_True;
++ if (m_nMenuIcons == 2)
++ bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
++ else
++ {
++ bSystemMenuIcons = sal_False;
++ bMenuIcons = m_nMenuIcons ? sal_True : sal_False;
++ }
+
+ // Copy values from list in right order to ouer internal member.
+ sal_Int32 nPropertyCount = seqValues.getLength() ;
+diff -r a1a3b75faa8a basebmp/test/basictest.cxx
+--- a/basebmp/test/basictest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/basictest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,10 +27,12 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
+ #include "cppunit/plugin/TestPlugIn.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/point/b2ipoint.hxx>
+diff -r a1a3b75faa8a basebmp/test/bmpmasktest.cxx
+--- a/basebmp/test/bmpmasktest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/bmpmasktest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/range/b2irange.hxx>
+diff -r a1a3b75faa8a basebmp/test/bmptest.cxx
+--- a/basebmp/test/bmptest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/bmptest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/range/b2irange.hxx>
+diff -r a1a3b75faa8a basebmp/test/cliptest.cxx
+--- a/basebmp/test/cliptest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/cliptest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/point/b2ipoint.hxx>
+diff -r a1a3b75faa8a basebmp/test/filltest.cxx
+--- a/basebmp/test/filltest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/filltest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/range/b2drange.hxx>
+diff -r a1a3b75faa8a basebmp/test/linetest.cxx
+--- a/basebmp/test/linetest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/linetest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/point/b2ipoint.hxx>
+diff -r a1a3b75faa8a basebmp/test/makefile.mk
+--- a/basebmp/test/makefile.mk Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/makefile.mk Fri Jul 30 13:40:34 2010 +0100
+@@ -60,6 +60,13 @@
+ .ENDIF
+ .ENDIF
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+ # --- Common ----------------------------------------------------------
+diff -r a1a3b75faa8a basebmp/test/masktest.cxx
+--- a/basebmp/test/masktest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/masktest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/range/b2irange.hxx>
+diff -r a1a3b75faa8a basebmp/test/polytest.cxx
+--- a/basebmp/test/polytest.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basebmp/test/polytest.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,9 +27,11 @@
+
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/vector/b2isize.hxx>
+ #include <basegfx/range/b2irange.hxx>
+diff -r a1a3b75faa8a basegfx/test/basegfx1d.cxx
+--- a/basegfx/test/basegfx1d.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/basegfx1d.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,10 +30,12 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
+ #include "cppunit/plugin/TestPlugIn.h"
++#include "postextstl.h"
+
+ namespace basegfx1d
+ {
+diff -r a1a3b75faa8a basegfx/test/basegfx2d.cxx
+--- a/basegfx/test/basegfx2d.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/basegfx2d.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,9 +30,11 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/matrix/b2dhommatrix.hxx>
+ #include <basegfx/polygon/b2dpolygon.hxx>
+diff -r a1a3b75faa8a basegfx/test/basegfx3d.cxx
+--- a/basegfx/test/basegfx3d.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/basegfx3d.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,9 +30,11 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ namespace basegfx3d
+ {
+diff -r a1a3b75faa8a basegfx/test/basegfxtools.cxx
+--- a/basegfx/test/basegfxtools.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/basegfxtools.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,9 +30,11 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/tools/keystoplerp.hxx>
+ #include <basegfx/numeric/ftools.hxx>
+diff -r a1a3b75faa8a basegfx/test/boxclipper.cxx
+--- a/basegfx/test/boxclipper.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/boxclipper.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,9 +30,11 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/matrix/b2dhommatrix.hxx>
+ #include <basegfx/curve/b2dcubicbezier.hxx>
+diff -r a1a3b75faa8a basegfx/test/clipstate.cxx
+--- a/basegfx/test/clipstate.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/clipstate.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,9 +30,11 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/tools/b2dclipstate.hxx>
+ #include <basegfx/range/b2dpolyrange.hxx>
+diff -r a1a3b75faa8a basegfx/test/genericclipper.cxx
+--- a/basegfx/test/genericclipper.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/genericclipper.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -30,9 +30,11 @@
+ #include "precompiled_basegfx.hxx"
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <basegfx/matrix/b2dhommatrix.hxx>
+ #include <basegfx/curve/b2dcubicbezier.hxx>
+diff -r a1a3b75faa8a basegfx/test/makefile.mk
+--- a/basegfx/test/makefile.mk Fri Jul 30 12:58:40 2010 +0100
++++ b/basegfx/test/makefile.mk Fri Jul 30 13:40:34 2010 +0100
+@@ -36,6 +36,13 @@
+
+ .INCLUDE : settings.mk
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+ # --- Common ----------------------------------------------------------
+diff -r a1a3b75faa8a configure.in
+--- a/configure.in Fri Jul 30 12:58:40 2010 +0100
++++ b/configure.in Fri Jul 30 13:40:34 2010 +0100
+@@ -3613,12 +3613,6 @@
+ # a system-cppunit before the first version using a proper cppunit
+ # (and that being 1.12.1) anyway
+ PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.1 )
+- AC_MSG_CHECKING([STL compatibility])
+- if test "$WITH_STLPORT" != "no"; then
+- AC_MSG_ERROR([to use system cppunit you need to use --without-stlport])
+- else
+- AC_MSG_RESULT([OK])
+- fi
+ else
+ AC_MSG_RESULT([internal])
+ SYSTEM_CPPUNIT=NO
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_connection.cxx
+--- a/mysqlc/source/mysqlc_connection.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_connection.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -35,13 +35,13 @@
+ #include "mysqlc_preparedstatement.hxx"
+ #include "mysqlc_general.hxx"
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/driver.h>
+ #include <cppconn/connection.h>
+ #include <cppconn/statement.h>
+ #include <cppconn/metadata.h>
+ #include <cppconn/exception.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ #include <com/sun/star/sdbc/ColumnValue.hpp>
+ #include <com/sun/star/sdbc/XRow.hpp>
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_connection.hxx
+--- a/mysqlc/source/mysqlc_connection.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_connection.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -46,9 +46,9 @@
+ #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
+ #include <com/sun/star/util/XStringSubstitution.hpp>
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/driver.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+ #include <cppuhelper/compbase3.hxx>
+ #include <cppuhelper/weakref.hxx>
+ #include <rtl/string.hxx>
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_databasemetadata.cxx
+--- a/mysqlc/source/mysqlc_databasemetadata.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_databasemetadata.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -54,13 +54,13 @@
+ using ::rtl::OUString;
+ using mysqlc_sdbc_driver::getStringFromAny;
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/connection.h>
+ #include <cppconn/resultset.h>
+ #include <cppconn/metadata.h>
+ #include <cppconn/statement.h>
+ #include <cppconn/prepared_statement.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ static ext_std::string wild("%");
+
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_databasemetadata.hxx
+--- a/mysqlc/source/mysqlc_databasemetadata.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_databasemetadata.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -39,9 +39,9 @@
+ #include <cppuhelper/implbase1.hxx>
+ #endif
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/metadata.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ namespace connectivity
+ {
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_driver.cxx
+--- a/mysqlc/source/mysqlc_driver.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_driver.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -38,13 +38,12 @@
+ using ::rtl::OUString;
+ #include <stdio.h>
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/exception.h>
+-
+ #ifdef SYSTEM_MYSQL_CPPCONN
+ #include <mysql_driver.h>
+ #endif
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+
+ /* {{{ MysqlCDriver::MysqlCDriver() -I- */
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_driver.hxx
+--- a/mysqlc/source/mysqlc_driver.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_driver.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -36,9 +36,9 @@
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+
+ #include <cppuhelper/compbase2.hxx>
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/driver.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+ #include <osl/module.h>
+
+ namespace connectivity
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_general.hxx
+--- a/mysqlc/source/mysqlc_general.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_general.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -33,9 +33,9 @@
+ #include <com/sun/star/uno/XInterface.hpp>
+ #include <com/sun/star/sdbc/SQLException.hpp>
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/exception.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ namespace mysqlc_sdbc_driver
+ {
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_preparedstatement.hxx
+--- a/mysqlc/source/mysqlc_preparedstatement.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_preparedstatement.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -48,9 +48,9 @@
+ #include <com/sun/star/io/XInputStream.hpp>
+ #endif
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/prepared_statement.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ namespace connectivity
+ {
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_resultsetmetadata.hxx
+--- a/mysqlc/source/mysqlc_resultsetmetadata.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_resultsetmetadata.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -35,9 +35,9 @@
+ #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
+
+ #include <cppuhelper/implbase1.hxx>
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/resultset_metadata.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ namespace connectivity
+ {
+diff -r a1a3b75faa8a mysqlc/source/mysqlc_statement.hxx
+--- a/mysqlc/source/mysqlc_statement.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/mysqlc/source/mysqlc_statement.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -13,9 +13,9 @@
+ #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
+ #include <com/sun/star/util/XCancellable.hpp>
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <cppconn/statement.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+ #include <cppuhelper/compbase5.hxx>
+ #include <list>
+
+diff -r a1a3b75faa8a o3tl/qa/makefile.mk
+--- a/o3tl/qa/makefile.mk Fri Jul 30 12:58:40 2010 +0100
++++ b/o3tl/qa/makefile.mk Fri Jul 30 13:40:34 2010 +0100
+@@ -36,6 +36,13 @@
+
+ .INCLUDE : settings.mk
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+ .IF "$(L10N_framework)"==""
+diff -r a1a3b75faa8a o3tl/qa/test-cow_wrapper.cxx
+--- a/o3tl/qa/test-cow_wrapper.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/o3tl/qa/test-cow_wrapper.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -1,9 +1,11 @@
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
+ #include "cppunit/plugin/TestPlugIn.h"
++#include "postextstl.h"
+
+ #include "cow_wrapper_clients.hxx"
+
+diff -r a1a3b75faa8a o3tl/qa/test-heap_ptr.cxx
+--- a/o3tl/qa/test-heap_ptr.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/o3tl/qa/test-heap_ptr.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -25,9 +25,11 @@
+ *
+ ************************************************************************/
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <o3tl/heap_ptr.hxx>
+
+diff -r a1a3b75faa8a o3tl/qa/test-range.cxx
+--- a/o3tl/qa/test-range.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/o3tl/qa/test-range.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -25,9 +25,11 @@
+ *
+ ************************************************************************/
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <o3tl/range.hxx>
+ #include <vector>
+diff -r a1a3b75faa8a o3tl/qa/test-vector_pool.cxx
+--- a/o3tl/qa/test-vector_pool.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/o3tl/qa/test-vector_pool.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -1,8 +1,10 @@
+ // autogenerated file with codegen.pl
+
++#include "preextstl.h"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
++#include "postextstl.h"
+
+ #include <o3tl/vector_pool.hxx>
+
+diff -r a1a3b75faa8a sal/cppunittester/cppunittester.cxx
+--- a/sal/cppunittester/cppunittester.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/sal/cppunittester/cppunittester.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -31,6 +31,7 @@
+ #include <cstdlib>
+ #include <iostream>
+
++#include "preextstl.h"
+ #include "cppunit/CompilerOutputter.h"
+ #include "cppunit/TestResult.h"
+ #include "cppunit/TestResultCollector.h"
+@@ -38,6 +39,7 @@
+ #include "cppunit/extensions/TestFactoryRegistry.h"
+ #include "cppunit/plugin/PlugInManager.h"
+ #include "cppunit/portability/Stream.h"
++#include "postextstl.h"
+ #include "osl/thread.h"
+ #include "rtl/process.h"
+ #include "rtl/string.hxx"
+diff -r a1a3b75faa8a sal/cppunittester/makefile.mk
+--- a/sal/cppunittester/makefile.mk Fri Jul 30 12:58:40 2010 +0100
++++ b/sal/cppunittester/makefile.mk Fri Jul 30 13:40:34 2010 +0100
+@@ -33,6 +33,13 @@
+
+ .INCLUDE: settings.mk
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+ OBJFILES = $(APP1OBJS)
+diff -r a1a3b75faa8a sax/qa/cppunit/makefile.mk
+--- a/sax/qa/cppunit/makefile.mk Fri Jul 30 12:58:40 2010 +0100
++++ b/sax/qa/cppunit/makefile.mk Fri Jul 30 13:40:34 2010 +0100
+@@ -35,6 +35,13 @@
+
+ .INCLUDE : settings.mk
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+ DLLPRE = # no leading "lib" on .so files
+
+diff -r a1a3b75faa8a sax/qa/cppunit/test_converter.cxx
+--- a/sax/qa/cppunit/test_converter.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/sax/qa/cppunit/test_converter.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -25,10 +25,12 @@
+ *
+ ************************************************************************/
+
++#include "preextstl.h"
+ #include <cppunit/TestAssert.h>
+ #include <cppunit/TestFixture.h>
+ #include <cppunit/extensions/HelperMacros.h>
+ #include <cppunit/plugin/TestPlugIn.h>
++#include "postextstl.h"
+
+ #include <rtl/ustrbuf.hxx>
+
+diff -r a1a3b75faa8a sfx2/qa/cppunit/makefile.mk
+--- a/sfx2/qa/cppunit/makefile.mk Fri Jul 30 12:58:40 2010 +0100
++++ b/sfx2/qa/cppunit/makefile.mk Fri Jul 30 13:40:34 2010 +0100
+@@ -35,6 +35,13 @@
+
+ .INCLUDE : settings.mk
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+ DLLPRE = # no leading "lib" on .so files
+
+diff -r a1a3b75faa8a sfx2/qa/cppunit/test_metadatable.cxx
+--- a/sfx2/qa/cppunit/test_metadatable.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/sfx2/qa/cppunit/test_metadatable.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -27,10 +27,12 @@
+
+ #include "precompiled_sfx2.hxx"
+
++#include "preextstl.h"
+ #include <cppunit/TestAssert.h>
+ #include <cppunit/TestFixture.h>
+ #include <cppunit/extensions/HelperMacros.h>
+ #include <cppunit/plugin/TestPlugIn.h>
++#include "postextstl.h"
+
+ #include <rtl/ustrbuf.hxx>
+
+diff -r a1a3b75faa8a stlport/prj/d.lst
+--- a/stlport/prj/d.lst Fri Jul 30 12:58:40 2010 +0100
++++ b/stlport/prj/d.lst Fri Jul 30 13:40:34 2010 +0100
+@@ -17,6 +17,7 @@
+ ..\%__SRC%\inc\stlport\using\h\* %_DEST%\inc%_EXT%\stl\using\h\*
+ ..\%__SRC%\inc\stlport\wrap_std\* %_DEST%\inc%_EXT%\stl\wrap_std\*
+ ..\%__SRC%\inc\stlport\wrap_std\h\* %_DEST%\inc%_EXT%\stl\wrap_std\h\*
++..\systemstlguards\*.h %_DEST%\inc%_EXT%\stl\*.h
+ ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
+ ..\%__SRC%\lib\lib*.a %_DEST%\lib%_EXT%\lib*.a
+ ..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib
+diff -r a1a3b75faa8a tools/inc/tools/postextstl.h
+--- a/tools/inc/tools/postextstl.h Fri Jul 30 12:58:40 2010 +0100
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,36 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * Copyright 2000, 2010 Oracle and/or its affiliates.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org. If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-
+-#ifdef std_was_redefined_as_stlport
+-// put things back the way they were
+-# define std std_was_redefined_as_stlport
+-# undef _STLP_OUTERMOST_HEADER_ID
+-// force config to be re-read
+-# undef _STLP_NOTHROW_INHERENTLY
+-# undef _STLP_CONFIG_H
+-# include <stddef.h>
+-#endif
+diff -r a1a3b75faa8a tools/inc/tools/preextstl.h
+--- a/tools/inc/tools/preextstl.h Fri Jul 30 12:58:40 2010 +0100
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,71 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * Copyright 2000, 2010 Oracle and/or its affiliates.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org. If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-//1. Force inclusion of a std:: using header to ensure the stlport define
+-//of std as "stlport"
+-#include <algorithm>
+-#if defined(ADAPT_EXT_STL)
+-//2. Force inclusion of stlport headers to get their stlport:: definitions
+-# include <ostream>
+-# include <istream>
+-# include <fstream>
+-# include <iostream>
+-# include <vector>
+-# include <list>
+-# include <map>
+-//3. Now force inclusion of native headers to get their std:: definitions
+-# if defined(std)
+-# define std_was_redefined_as_stlport std
+-# undef std
+-# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf
+-# if defined(_GNUC__)
+-# pragma GCC visibility push(default)
+-# endif
+-# include _STLP_NATIVE_HEADER(exception_defines.h)
+-# include _STLP_NATIVE_HEADER(limits)
+-# include _STLP_NATIVE_HEADER(memory)
+-# include _STLP_NATIVE_HEADER(exception)
+-# include _STLP_NATIVE_HEADER(iosfwd)
+-# include _STLP_NATIVE_HEADER(algorithm)
+-# include _STLP_NATIVE_HEADER(string)
+-# include _STLP_NATIVE_HEADER(streambuf)
+-# include _STLP_NATIVE_HEADER(ios)
+-# include _STLP_NATIVE_HEADER(locale)
+-# include _STLP_NATIVE_HEADER(stdexcept)
+-# include _STLP_NATIVE_HEADER(ostream)
+-# include _STLP_NATIVE_HEADER(istream)
+-# include _STLP_NATIVE_HEADER(iostream)
+-# include _STLP_NATIVE_HEADER(vector)
+-# include _STLP_NATIVE_HEADER(list)
+-# include _STLP_NATIVE_HEADER(map)
+-# if defined(_GNUC__)
+-# pragma GCC visibility pop
+-# endif
+-# endif
+-#endif
+-//ext_std resolves to the std that external c++ libs, e.g. Graphite were built
+-//against regardless of whether that is stlport or system stl
+-namespace ext_std = std;
+diff -r a1a3b75faa8a tools/prj/d.lst
+--- a/tools/prj/d.lst Fri Jul 30 12:58:40 2010 +0100
++++ b/tools/prj/d.lst Fri Jul 30 13:40:34 2010 +0100
+@@ -34,9 +34,6 @@
+ ..\inc\tools\postx.h %_DEST%\inc%_EXT%\tools\postx.h
+ ..\inc\tools\prex.h %_DEST%\inc%_EXT%\tools\prex.h
+
+-..\inc\tools\postextstl.h %_DEST%\inc%_EXT%\tools\postextstl.h
+-..\inc\tools\preextstl.h %_DEST%\inc%_EXT%\tools\preextstl.h
+-
+ ..\inc\tools\svlibrary.hxx %_DEST%\inc%_EXT%\tools\svlibrary.hxx
+ ..\inc\tools\solarmutex.hxx %_DEST%\inc%_EXT%\tools\solarmutex.hxx
+ ..\inc\tools\wintypes.hxx %_DEST%\inc%_EXT%\tools\wintypes.hxx
+diff -r a1a3b75faa8a vcl/inc/vcl/graphite_adaptors.hxx
+--- a/vcl/inc/vcl/graphite_adaptors.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/inc/vcl/graphite_adaptors.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -55,11 +55,11 @@
+ #include "vcl/dllapi.h"
+
+ // Libraries
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <graphite/GrClient.h>
+ #include <graphite/Font.h>
+ #include <graphite/ITextSource.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ // Module type definitions and forward declarations.
+ //
+diff -r a1a3b75faa8a vcl/inc/vcl/graphite_features.hxx
+--- a/vcl/inc/vcl/graphite_features.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/inc/vcl/graphite_features.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -29,11 +29,11 @@
+ // Parse a string of features specified as ; separated pairs.
+ // e.g.
+ // 1001=1&2002=2&fav1=0
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <graphite/GrClient.h>
+ #include <graphite/Font.h>
+ #include <graphite/GrFeature.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ namespace grutils
+ {
+diff -r a1a3b75faa8a vcl/inc/vcl/graphite_layout.hxx
+--- a/vcl/inc/vcl/graphite_layout.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/inc/vcl/graphite_layout.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -40,13 +40,13 @@
+ #include <vector>
+ #include <utility>
+ // Libraries
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <graphite/GrClient.h>
+ #include <graphite/Font.h>
+ #include <graphite/GrConstants.h>
+ #include <graphite/GrAppData.h>
+ #include <graphite/SegmentAux.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+ // Platform
+ #include <vcl/sallayout.hxx>
+ #include <vcl/dllapi.h>
+diff -r a1a3b75faa8a vcl/source/glyphs/graphite_cache.cxx
+--- a/vcl/source/glyphs/graphite_cache.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/source/glyphs/graphite_cache.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -36,10 +36,10 @@
+ #include <tools/debug.hxx>
+ #include <vcl/sallayout.hxx>
+
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <graphite/GrClient.h>
+ #include <graphite/Segment.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ #include <rtl/ustring.hxx>
+ #include <vcl/graphite_layout.hxx>
+diff -r a1a3b75faa8a vcl/source/glyphs/graphite_layout.cxx
+--- a/vcl/source/glyphs/graphite_layout.cxx Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/source/glyphs/graphite_layout.cxx Fri Jul 30 13:40:34 2010 +0100
+@@ -63,13 +63,13 @@
+ #include <unicode/uscript.h>
+
+ // Graphite Libraries (must be after vcl headers on windows)
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <graphite/GrClient.h>
+ #include <graphite/Font.h>
+ #include <graphite/ITextSource.h>
+ #include <graphite/Segment.h>
+ #include <graphite/SegmentPainter.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ #include <vcl/graphite_layout.hxx>
+ #include <vcl/graphite_features.hxx>
+diff -r a1a3b75faa8a vcl/source/glyphs/graphite_textsrc.hxx
+--- a/vcl/source/glyphs/graphite_textsrc.hxx Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/source/glyphs/graphite_textsrc.hxx Fri Jul 30 13:40:34 2010 +0100
+@@ -59,11 +59,11 @@
+ #include "vcl/dllapi.h"
+
+ // Libraries
+-#include <tools/preextstl.h>
++#include <preextstl.h>
+ #include <graphite/GrClient.h>
+ #include <graphite/Font.h>
+ #include <graphite/ITextSource.h>
+-#include <tools/postextstl.h>
++#include <postextstl.h>
+
+ // Module type definitions and forward declarations.
+ //
+diff -r a1a3b75faa8a vcl/util/makefile2.pmk
+--- a/vcl/util/makefile2.pmk Fri Jul 30 12:58:40 2010 +0100
++++ b/vcl/util/makefile2.pmk Fri Jul 30 13:40:34 2010 +0100
+@@ -36,6 +36,6 @@
+ #building with stlport, but graphite was not built with stlport
+ .IF "$(USE_SYSTEM_STL)"!="YES"
+ .IF "$(SYSTEM_GRAPHITE)"=="YES"
+-CDEFS += -DADAPT_EXT_STL
++CFLAGSCXX+=-DADAPT_EXT_STL
+ .ENDIF
+ .ENDIF
+--- a/test/source/cpp/officeconnection.cxx 2010-07-31 15:23:28.000000000 +0100
++++ b/test/source/cpp/officeconnection.cxx 2010-07-31 15:24:37.000000000 +0100
+@@ -33,7 +33,9 @@
+ #include "com/sun/star/lang/XMultiServiceFactory.hpp"
+ #include "com/sun/star/uno/Reference.hxx"
+ #include "cppuhelper/bootstrap.hxx"
++#include <preextstl.h>
+ #include "cppunit/TestAssert.h"
++#include <postextstl.h>
+ #include "osl/process.h"
+ #include "osl/time.h"
+ #include "sal/types.h"
+--- a/test/source/cpp/makefile.mk 2010-07-31 15:27:19.000000000 +0100
++++ b/test/source/cpp/makefile.mk 2010-07-31 15:23:28.000000000 +0100
+@@ -35,6 +35,13 @@
+ CDEFS += -DOOO_DLLIMPLEMENTATION_TEST
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ SLOFILES = \
+ $(SLO)/getargument.obj \
+ $(SLO)/officeconnection.obj \
+--- a/smoketestoo_native/makefile.mk 2010-07-31 19:54:31.000000000 +0100
++++ b/smoketestoo_native/makefile.mk 2010-07-31 20:03:00.000000000 +0100
+@@ -33,6 +33,13 @@
+
+ CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
++#building with stlport, but cppunit was not built with stlport
++.IF "$(USE_SYSTEM_STL)"!="YES"
++.IF "$(SYSTEM_CPPUNIT)"=="YES"
++CFLAGSCXX+=-DADAPT_EXT_STL
++.ENDIF
++.ENDIF
++
+ SLOFILES = $(SHL1OBJS)
+
+ SHL1TARGET = smoketest
+--- a/smoketestoo_native/smoketest.cxx 2010-07-31 19:54:32.000000000 +0100
++++ b/smoketestoo_native/smoketest.cxx 2010-07-31 19:58:06.000000000 +0100
+@@ -44,11 +44,13 @@
+ #include "com/sun/star/uno/RuntimeException.hpp"
+ #include "com/sun/star/uno/Sequence.hxx"
+ #include "com/sun/star/util/URL.hpp"
++#include <preextstl.h>
+ #include "cppuhelper/implbase1.hxx"
+ #include "cppunit/TestAssert.h"
+ #include "cppunit/TestFixture.h"
+ #include "cppunit/extensions/HelperMacros.h"
+ #include "cppunit/plugin/TestPlugIn.h"
++#include <postextstl.h>
+ #include "osl/conditn.hxx"
+ #include "osl/diagnose.h"
+ #include "rtl/ustring.h"
+diff -r a4c016dc07ba forms/source/component/Button.cxx
+--- a/forms/source/component/Button.cxx Tue Aug 03 12:19:44 2010 +0100
++++ b/forms/source/component/Button.cxx Wed Aug 04 18:51:57 2010 +0100
+@@ -439,7 +439,7 @@
+ void OButtonControl::actionPerformed(const ActionEvent& /*rEvent*/) throw ( ::com::sun::star::uno::RuntimeException)
+ {
+ // Asynchron fuer starutil::URL-Button
+- sal_uInt32 n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) );
++ ULONG n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) );
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_nClickEvent = n;
+diff -r a4c016dc07ba forms/source/component/Button.hxx
+--- a/forms/source/component/Button.hxx Tue Aug 03 12:19:44 2010 +0100
++++ b/forms/source/component/Button.hxx Wed Aug 04 18:51:57 2010 +0100
+@@ -127,7 +127,7 @@
+ ,public OFormNavigationHelper
+ {
+ private:
+- sal_uInt32 m_nClickEvent;
++ ULONG m_nClickEvent;
+ sal_Int16 m_nTargetUrlFeatureId;
+ /// caches the value of the "Enabled" property of our model
+ sal_Bool m_bEnabledByPropertyValue;
+diff -r b96c661a8f96 canvas/source/cairo/cairo_textlayout.cxx
+--- a/canvas/source/cairo/cairo_textlayout.cxx Fri Aug 06 11:55:33 2010 +0200
++++ b/canvas/source/cairo/cairo_textlayout.cxx Fri Aug 06 13:30:27 2010 +0200
+@@ -521,8 +521,8 @@
+ nWidth = aFont.GetHeight();
+ } else {
+ // any scaling needs to be relative to the platform-dependent definition
+- // of width of the font
+- nWidth = aFont.GetHeight() * aFont.GetWidth() / aMetric.GetWidth();
++ // of height of the font
++ nWidth = aFont.GetWidth() * aFont.GetHeight() / aMetric.GetHeight();
+ }
+
+ cairo_matrix_init_identity(&m);
+diff -r a1a3b75faa8a stlport/systemstlguards/postextstl.h
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/stlport/systemstlguards/postextstl.h Fri Jul 30 13:40:34 2010 +0100
+@@ -0,0 +1,36 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * Copyright 2000, 2010 Oracle and/or its affiliates.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org. If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifdef std_was_redefined_as_stlport
++// put things back the way they were
++# define std std_was_redefined_as_stlport
++# undef _STLP_OUTERMOST_HEADER_ID
++// force config to be re-read
++# undef _STLP_NOTHROW_INHERENTLY
++# undef _STLP_CONFIG_H
++# include <stddef.h>
++#endif
+diff -r a1a3b75faa8a stlport/systemstlguards/preextstl.h
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/stlport/systemstlguards/preextstl.h Fri Jul 30 13:40:34 2010 +0100
+@@ -0,0 +1,77 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * Copyright 2000, 2010 Oracle and/or its affiliates.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org. If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++//1. Force inclusion of a std:: using header to ensure the stlport define
++//of std as "stlport"
++#include <algorithm>
++#if defined(ADAPT_EXT_STL)
++//2. Force inclusion of stlport headers to get their stlport:: definitions
++# include <ostream>
++# include <istream>
++# include <fstream>
++# include <iostream>
++# include <sstream>
++# include <vector>
++# include <deque>
++# include <set>
++# include <list>
++# include <map>
++//3. Now force inclusion of native headers to get their std:: definitions
++# if defined(std)
++# define std_was_redefined_as_stlport std
++# undef std
++# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf
++# if defined(_GNUC__)
++# pragma GCC visibility push(default)
++# endif
++# include _STLP_NATIVE_HEADER(exception_defines.h)
++# include _STLP_NATIVE_HEADER(limits)
++# include _STLP_NATIVE_HEADER(memory)
++# include _STLP_NATIVE_HEADER(exception)
++# include _STLP_NATIVE_HEADER(iosfwd)
++# include _STLP_NATIVE_HEADER(algorithm)
++# include _STLP_NATIVE_HEADER(string)
++# include _STLP_NATIVE_HEADER(streambuf)
++# include _STLP_NATIVE_HEADER(ios)
++# include _STLP_NATIVE_HEADER(locale)
++# include _STLP_NATIVE_HEADER(stdexcept)
++# include _STLP_NATIVE_HEADER(ostream)
++# include _STLP_NATIVE_HEADER(istream)
++# include _STLP_NATIVE_HEADER(iostream)
++# include _STLP_NATIVE_HEADER(sstream)
++# include _STLP_NATIVE_HEADER(vector)
++# include _STLP_NATIVE_HEADER(deque)
++# include _STLP_NATIVE_HEADER(set)
++# include _STLP_NATIVE_HEADER(list)
++# include _STLP_NATIVE_HEADER(map)
++# if defined(_GNUC__)
++# pragma GCC visibility pop
++# endif
++# endif
++#endif
++//ext_std resolves to the std that external c++ libs, e.g. Graphite were built
++//against regardless of whether that is stlport or system stl
++namespace ext_std = std;
diff --git a/workspace.cmcfixes78.patch b/workspace.cmcfixes78.patch
new file mode 100644
index 0000000..bd3822b
--- /dev/null
+++ b/workspace.cmcfixes78.patch
@@ -0,0 +1,11 @@
+diff -r 87f4911ea629 canvas/source/cairo/cairo_canvashelper.cxx
+--- a/canvas/source/cairo/cairo_canvashelper.cxx Mon Aug 02 18:43:47 2010 +0200
++++ b/canvas/source/cairo/cairo_canvashelper.cxx Mon Aug 16 14:06:14 2010 +0100
+@@ -1395,6 +1395,7 @@
+ ::rtl::math::approxEqual( aMatrix.x0, 0 ) &&
+ ::rtl::math::approxEqual( aMatrix.y0, 0 ) )
+ cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE );
++ cairo_pattern_set_extend( cairo_get_source(mpCairo.get()), CAIRO_EXTEND_PAD );
+ cairo_rectangle( mpCairo.get(), 0, 0, aBitmapSize.Width, aBitmapSize.Height );
+ cairo_clip( mpCairo.get() );
+
diff --git a/workspace.cmcfixes79.patch b/workspace.cmcfixes79.patch
new file mode 100644
index 0000000..e534ef2
--- /dev/null
+++ b/workspace.cmcfixes79.patch
@@ -0,0 +1,379 @@
+diff -r 5893d50a0b8c desktop/source/app/app.cxx
+--- a/desktop/source/app/app.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/desktop/source/app/app.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -2129,23 +2129,8 @@
+ hMouseSettings.SetFollow( aAppearanceCfg.IsMenuMouseFollow() ? (nFollow|MOUSE_FOLLOW_MENU) : (nFollow&~MOUSE_FOLLOW_MENU));
+ rSettings.SetMouseSettings(hMouseSettings);
+
+- BOOL bUseImagesInMenus = hStyleSettings.GetUseImagesInMenus();
+-
+ SvtMenuOptions aMenuOpt;
+- nGet = aMenuOpt.GetMenuIconsState();
+- switch ( nGet )
+- {
+- case 0:
+- bUseImagesInMenus = FALSE;
+- break;
+- case 1:
+- bUseImagesInMenus = TRUE;
+- break;
+- case 2:
+- default:
+- break;
+- }
+- hStyleSettings.SetUseImagesInMenus(bUseImagesInMenus);
++ hStyleSettings.SetUseImagesInMenus(aMenuOpt.GetMenuIconsState());
+
+ sal_uInt16 nTabStyle = hStyleSettings.GetTabControlStyle();
+ nTabStyle &= ~STYLE_TABCONTROL_SINGLELINE;
+diff -r 5893d50a0b8c framework/source/classes/menumanager.cxx
+--- a/framework/source/classes/menumanager.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/framework/source/classes/menumanager.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -169,11 +169,13 @@
+ {
+ USHORT nItemId = FillItemCommand(aItemCommand,pMenu, i );
+ bool bShowMenuImages( m_bShowMenuImages );
+- MenuItemBits nBits = pMenu->GetItemBits( nItemId );
+- // overwrite the default?
+- if ( nBits )
++
++ // overwrite the show icons on menu option?
++ if (!bShowMenuImages)
++ {
++ MenuItemBits nBits = pMenu->GetItemBits( nItemId );
+ bShowMenuImages = ( ( nBits & MIB_ICON ) == MIB_ICON );
+-
++ }
+
+ PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nItemId );
+ if ( pPopupMenu )
+@@ -1137,10 +1139,12 @@
+ if ( _pMenu->GetItemType( nPos ) != MENUITEM_SEPARATOR )
+ {
+ bool bTmpShowMenuImages( bShowMenuImages );
+- MenuItemBits nBits = _pMenu->GetItemBits( nId );
+- // overwrite the default?
+- if ( nBits )
++ // overwrite the show icons on menu option?
++ if (!bTmpShowMenuImages)
++ {
++ MenuItemBits nBits = _pMenu->GetItemBits( nId );
+ bTmpShowMenuImages = ( ( nBits & MIB_ICON ) == MIB_ICON );
++ }
+
+ if ( bTmpShowMenuImages )
+ {
+diff -r 5893d50a0b8c framework/source/uielement/menubarmanager.cxx
+--- a/framework/source/uielement/menubarmanager.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/framework/source/uielement/menubarmanager.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -1331,10 +1331,12 @@
+ Reference< XStatusListener > xStatusListener;
+ PopupMenu* pPopup = pMenu->GetPopupMenu( nItemId );
+ bool bItemShowMenuImages = m_bShowMenuImages;
+- MenuItemBits nBits = pMenu->GetItemBits( nItemId );
+ // overwrite the show icons on menu option?
+- if ( nBits )
++ if (!bItemShowMenuImages)
++ {
++ MenuItemBits nBits = pMenu->GetItemBits( nItemId );
+ bItemShowMenuImages = ( ( nBits & MIB_ICON ) == MIB_ICON );
++ }
+ if ( pPopup )
+ {
+ // Retrieve module identifier from Help Command entry
+diff -r 5893d50a0b8c officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu Wed Sep 08 15:25:35 2010 +0100
++++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu Mon Sep 13 15:13:31 2010 +0100
+@@ -41,6 +41,14 @@
+ <value xml:lang="en-US">~Trace Dependents</value>
+ </prop>
+ </node>
++ <node oor:name=".uno:SinglePane" oor:op="replace">
++ <prop oor:name="Label" oor:type="xs:string">
++ <value xml:lang="en-US">~Normal Pane</value>
++ </prop>
++ <prop oor:name="ContextLabel" oor:type="xs:string">
++ <value xml:lang="en-US">~Normal</value>
++ </prop>
++ </node>
+ <node oor:name=".uno:SplitWindow" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Split Window</value>
+diff -r 5893d50a0b8c sd/uiconfig/simpress/menubar/menubar.xml
+--- a/sd/uiconfig/simpress/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sd/uiconfig/simpress/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -79,14 +79,14 @@
+ <menu:menuitem menu:id=".uno:NormalMultiPaneGUI" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:OutlineMode" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:DiaMode" menu:style="radio"/>
+- <menu:menuitem menu:id=".uno:Presentation"/>
++ <menu:menuitem menu:id=".uno:Presentation" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:NotesMode" menu:style="radio"/>
+ <menu:menuitem menu:id=".uno:HandoutMode" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menu menu:id=".uno:MasterPageMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:SlideMasterPage"/>
+- <menu:menuitem menu:id=".uno:NotesMasterPage"/>
++ <menu:menuitem menu:id=".uno:SlideMasterPage" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:NotesMasterPage" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:MasterLayouts"/>
+ </menu:menupopup>
+diff -r 5893d50a0b8c svtools/source/config/menuoptions.cxx
+--- a/svtools/source/config/menuoptions.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/svtools/source/config/menuoptions.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -190,9 +190,9 @@
+ Commit();
+ }
+
+- void SetMenuIconsState ( sal_Int16 bState )
++ void SetMenuIconsState ( sal_Int16 nState )
+ {
+- m_nMenuIcons = bState;
++ m_nMenuIcons = nState;
+ SetModified();
+ for ( USHORT n=0; n<aList.Count(); n++ )
+ aList.GetObject(n)->Call( this );
+@@ -318,7 +318,7 @@
+ sal_Bool bMenuIcons = sal_True;
+ sal_Bool bSystemMenuIcons = sal_True;
+ if (m_nMenuIcons == 2)
+- bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
++ bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetPreferredUseImagesInMenus());
+ else
+ {
+ bSystemMenuIcons = sal_False;
+@@ -342,12 +342,12 @@
+ else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES )
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" );
+- bMenuSettingsChanged = seqValues[nProperty] >>= bMenuIcons;
++ bMenuSettingsChanged |= seqValues[nProperty] >>= bMenuIcons;
+ }
+ else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES )
+ {
+ DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
+- bMenuSettingsChanged = seqValues[nProperty] >>= bSystemMenuIcons;
++ bMenuSettingsChanged |= seqValues[nProperty] >>= bSystemMenuIcons;
+ }
+
+ #if OSL_DEBUG_LEVEL > 1
+diff -r 5893d50a0b8c sw/uiconfig/sglobal/menubar/menubar.xml
+--- a/sw/uiconfig/sglobal/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sw/uiconfig/sglobal/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -103,8 +103,8 @@
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:PrintLayout"/>
+- <menu:menuitem menu:id=".uno:BrowseView"/>
++ <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+diff -r 5893d50a0b8c sw/uiconfig/sweb/menubar/menubar.xml
+--- a/sw/uiconfig/sweb/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sw/uiconfig/sweb/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -75,9 +75,9 @@
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:PrintLayout"/>
+- <menu:menuitem menu:id=".uno:BrowseView"/>
+- <menu:menuitem menu:id=".uno:SourceView"/>
++ <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:SourceView" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+diff -r 5893d50a0b8c sw/uiconfig/swform/menubar/menubar.xml
+--- a/sw/uiconfig/swform/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sw/uiconfig/swform/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -103,8 +103,8 @@
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:PrintLayout"/>
+- <menu:menuitem menu:id=".uno:BrowseView"/>
++ <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+diff -r 5893d50a0b8c sw/uiconfig/swreport/menubar/menubar.xml
+--- a/sw/uiconfig/swreport/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sw/uiconfig/swreport/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -103,8 +103,8 @@
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:PrintLayout"/>
+- <menu:menuitem menu:id=".uno:BrowseView"/>
++ <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+diff -r 5893d50a0b8c sw/uiconfig/swriter/menubar/menubar.xml
+--- a/sw/uiconfig/swriter/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sw/uiconfig/swriter/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -106,8 +106,8 @@
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:PrintLayout"/>
+- <menu:menuitem menu:id=".uno:BrowseView"/>
++ <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+diff -r 5893d50a0b8c sw/uiconfig/swxform/menubar/menubar.xml
+--- a/sw/uiconfig/swxform/menubar/menubar.xml Wed Sep 08 15:25:35 2010 +0100
++++ b/sw/uiconfig/swxform/menubar/menubar.xml Mon Sep 13 15:13:31 2010 +0100
+@@ -104,8 +104,8 @@
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu">
+ <menu:menupopup>
+- <menu:menuitem menu:id=".uno:PrintLayout"/>
+- <menu:menuitem menu:id=".uno:BrowseView"/>
++ <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/>
++ <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+diff -r 5893d50a0b8c vcl/aqua/source/window/salframe.cxx
+--- a/vcl/aqua/source/window/salframe.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/vcl/aqua/source/window/salframe.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -1266,7 +1266,7 @@
+ aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidth]) );
+
+ // images in menus false for MacOSX
+- aStyleSettings.SetUseImagesInMenus( false );
++ aStyleSettings.SetPreferredUseImagesInMenus( false );
+
+ rSettings.SetStyleSettings( aStyleSettings );
+
+diff -r 5893d50a0b8c vcl/inc/vcl/settings.hxx
+--- a/vcl/inc/vcl/settings.hxx Wed Sep 08 15:25:35 2010 +0100
++++ b/vcl/inc/vcl/settings.hxx Mon Sep 13 15:13:31 2010 +0100
+@@ -431,6 +431,7 @@
+ USHORT mnUseSystemUIFonts;
+ USHORT mnAutoMnemonic;
+ USHORT mnUseImagesInMenus;
++ BOOL mbPreferredUseImagesInMenus;
+ ULONG mnUseFlatBorders;
+ long mnMinThumbSize;
+ ULONG mnSymbolsStyle;
+@@ -525,6 +526,10 @@
+ #define STYLE_SYMBOLS_CLASSIC ((ULONG)7)
+ #define STYLE_SYMBOLS_THEMES_MAX ((ULONG)8)
+
++#define STYLE_MENUIMAGES_OFF ((USHORT)0)
++#define STYLE_MENUIMAGES_ON ((USHORT)1)
++#define STYLE_MENUIMAGES_AUTO ((USHORT)2)
++
+ #define STYLE_CURSOR_NOBLINKTIME ((ULONG)0xFFFFFFFF)
+
+ class VCL_DLLPUBLIC StyleSettings
+@@ -746,10 +751,16 @@
+ { CopyData(); mpData->mnUseFlatMenues = bUseFlatMenues; }
+ BOOL GetUseFlatMenues() const
+ { return (BOOL) mpData->mnUseFlatMenues; }
++
+ void SetUseImagesInMenus( BOOL bUseImagesInMenus )
+ { CopyData(); mpData->mnUseImagesInMenus = bUseImagesInMenus; }
+- BOOL GetUseImagesInMenus() const
+- { return (BOOL) mpData->mnUseImagesInMenus; }
++ BOOL GetUseImagesInMenus() const;
++
++ void SetPreferredUseImagesInMenus( BOOL bPreferredUseImagesInMenus )
++ { CopyData(); mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; }
++ BOOL GetPreferredUseImagesInMenus() const
++ { return mpData->mbPreferredUseImagesInMenus; }
++
+ void SetSkipDisabledInMenus( BOOL bSkipDisabledInMenus )
+ { CopyData(); mpData->mnSkipDisabledInMenus = bSkipDisabledInMenus; }
+ BOOL GetSkipDisabledInMenus() const
+diff -r 5893d50a0b8c vcl/source/app/settings.cxx
+--- a/vcl/source/app/settings.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/vcl/source/app/settings.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -435,6 +435,7 @@
+ mnAutoMnemonic = 1;
+ mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
+ mnSymbolsStyle = STYLE_SYMBOLS_AUTO;
++ mnUseImagesInMenus = STYLE_MENUIMAGES_AUTO;
+ mnPreferredSymbolsStyle = STYLE_SYMBOLS_AUTO;
+ mpFontOptions = NULL;
+
+@@ -539,6 +540,7 @@
+ mnUseFlatMenues = rData.mnUseFlatMenues;
+ mnAutoMnemonic = rData.mnAutoMnemonic;
+ mnUseImagesInMenus = rData.mnUseImagesInMenus;
++ mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
+ mnSkipDisabledInMenus = rData.mnSkipDisabledInMenus;
+ mnToolbarIconSize = rData.mnToolbarIconSize;
+ mnSymbolsStyle = rData.mnSymbolsStyle;
+@@ -632,7 +634,7 @@
+ mnUseSystemUIFonts = 1;
+ mnUseFlatBorders = 0;
+ mnUseFlatMenues = 0;
+- mnUseImagesInMenus = (USHORT)TRUE;
++ mbPreferredUseImagesInMenus = TRUE;
+ mnSkipDisabledInMenus = (USHORT)FALSE;
+
+ Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR );
+@@ -866,6 +868,19 @@
+
+ // -----------------------------------------------------------------------
+
++BOOL StyleSettings::GetUseImagesInMenus() const
++{
++ // icon mode selected in Tools -> Options... -> OpenOffice.org -> View
++ USHORT nStyle = mpData->mnUseImagesInMenus;
++
++ if ( nStyle == STYLE_MENUIMAGES_AUTO )
++ return GetPreferredUseImagesInMenus();
++
++ return (BOOL)nStyle;
++}
++
++// -----------------------------------------------------------------------
++
+ void StyleSettings::SetStandardStyles()
+ {
+ CopyData();
+@@ -1104,6 +1119,7 @@
+ (mpData->maFieldFont == rSet.mpData->maFieldFont) &&
+ (mpData->maIconFont == rSet.mpData->maIconFont) &&
+ (mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
++ (mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
+ (mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
+ (mpData->maFontColor == rSet.mpData->maFontColor ))
+ return TRUE;
+diff -r 5893d50a0b8c vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx Wed Sep 08 15:25:35 2010 +0100
++++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx Mon Sep 13 15:13:31 2010 +0100
+@@ -3552,7 +3552,7 @@
+ gboolean showmenuicons = true;
+ pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gImageMenuItem );
+ g_object_get( pSettings, "gtk-menu-images", &showmenuicons, (char *)NULL );
+- aStyleSet.SetUseImagesInMenus( showmenuicons );
++ aStyleSet.SetPreferredUseImagesInMenus( showmenuicons );
+
+ // set scrollbar settings
+ gint slider_width = 14;
+--- a/idlc/source/preproc/tokens.c 2010-09-08 13:23:54.000000000 +0100
++++ b/idlc/source/preproc/tokens.c 2010-09-08 13:24:20.000000000 +0100
+@@ -477,7 +477,7 @@
+ if (write(1, wbuf, OBS) != OBS)
+ error(ERROR, "short write!");
+ if (wbp > &wbuf[OBS])
+- memcpy(wbuf, wbuf + OBS, wbp - &wbuf[OBS]);
++ memmove(wbuf, wbuf + OBS, wbp - &wbuf[OBS]);
+ wbp -= OBS;
+ }
+ }
diff --git a/workspace.dtardon03.patch b/workspace.dtardon03.patch
new file mode 100644
index 0000000..e5e50e3
--- /dev/null
+++ b/workspace.dtardon03.patch
@@ -0,0 +1,286 @@
+Index: filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+===================================================================
+--- filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (revision 276736)
++++ filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (working copy)
+@@ -102,8 +102,8 @@
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- As CSS writing-mode is not implemented by all browsers, a heuristic is done -->
+- <xsl:variable name="writingMode" select="key('writingModeStyles', 'test')"/>
+- <xsl:if test="contains($writingMode, 'rl')">
++ <xsl:variable name="writingModeTest" select="key('writingModeStyles', 'test')"/>
++ <xsl:if test="contains($writingModeTest, 'rl')">
+ <xsl:attribute name="dir">rtl</xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+@@ -579,13 +579,13 @@
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$tabIndent='NaN'">
+- <xsl:variable name="tabPosition">
++ <xsl:variable name="tabPositionTmp">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$tabStops/style:tab-stop[last()]/@style:position"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Heuristic: for every tab that is more than specified give a further 1 cm -->
+- <xsl:value-of select="$parentMarginLeft + $tabPosition + count($tabStops/style:tab-stop) - $tabCount"/>
++ <xsl:value-of select="$parentMarginLeft + $tabPositionTmp + count($tabStops/style:tab-stop) - $tabCount"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tabIndent"/>
+diff -ru filter.orig/source/xslt/export/uof/odf2uof_text.xsl filter/source/xslt/export/uof/odf2uof_text.xsl
+--- filter.orig/source/xslt/export/uof/odf2uof_text.xsl 2009-04-24 09:31:14.000000000 +0100
++++ filter/source/xslt/export/uof/odf2uof_text.xsl 2009-04-24 09:32:29.000000000 +0100
+@@ -4029,13 +4029,7 @@
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+- <xsl:variable name="stt">
+- <xsl:value-of select="./text:a"/>
+- </xsl:variable>
+- <xsl:variable name="end">
+- <xsl:value-of select="."/>
+- </xsl:variable>
+- <xsl:value-of select="substring-after($end,$stt)"/>
++ <xsl:value-of select="$bijiao"/>
+ </xsl:element>
+ </xsl:if>
+ </字:句>
+Index: filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+===================================================================
+--- filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (revision 270524)
++++ filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (working copy)
+@@ -1767,6 +1767,11 @@
+ <xsl:param name="minLabelWidth"/>
+ <xsl:param name="listIndent" />
+
++ <!-- The text:list-header shall not be labeled. According to ODF specification (sect. 4.3.2):
++ "The <text:list-header> element represents a list header and is a special kind of list item. It
++ contains one or more paragraphs that are displayed before a list. The paragraphs are formatted
++ like list items but they do not have a preceding number or bullet." -->
++ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
+
+ <xsl:variable name="listIndentNew">
+ <xsl:choose>
+@@ -1785,13 +1790,15 @@
+ <xsl:variable name="itemNumberNew">
+ <xsl:if test="$listStyle/text:list-style/text:list-level-style-number">
+ <xsl:choose>
+- <xsl:when test="$isEmptyList">
++ <xsl:when test="$isListHeader">0</xsl:when>
+ <!-- An empty list item (no text:h/text:p as child), will not count as item and does not increment the count. -->
+ <xsl:variable name="tempItemNumber">
+ <xsl:choose>
+ <!-- siblings will be incremented by one -->
+ <xsl:when test="$itemNumber">
+- <xsl:value-of select="$itemNumber + 1"/>
++ <xsl:if test="not($isListHeader)">
++ <xsl:value-of select="$itemNumber + 1"/>
++ </xsl:if>
+ </xsl:when>
+ <!-- if a higher list level had content the numbering starts with 1 -->
+ <xsl:when test="$isListNumberingReset and $listLevel > 1">
+@@ -1866,6 +1873,7 @@
+ <xsl:when test="$display">
+ <xsl:value-of select="$display"/>
+ </xsl:when>
++ <xsl:when test="$isListHeader">0</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+@@ -1876,9 +1884,10 @@
+ </xsl:variable>
+ <xsl:element name="li">
+ <xsl:choose>
+- <xsl:when test="$isEmptyList">
++ <xsl:when test="$isEmptyList or $isListHeader">
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
++ <xsl:with-param name="isNextLevelNumberingReset" select="$isListHeader or $isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemLabel" select="$itemLabelNew"/>
+ <xsl:with-param name="listLevel" select="$listLevel + 1"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+@@ -1889,7 +1898,7 @@
+ <xsl:apply-templates mode="list-item-children" select="*[1]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
++ <xsl:with-param name="isNextLevelNumberingReset" select="$isListHeader or $isNextLevelNumberingReset"/>
+ <!-- The new created label is given to the children -->
+ <xsl:with-param name="itemLabel" select="$itemLabelNew"/>
+ <xsl:with-param name="listLabelElement">
+@@ -2088,7 +2097,7 @@
+
+
+ <!-- The Numbering start value (or offset from regular counteing) is used at the first item of offset,
+- but have to be reused on following item/headers with no text:start-value -->
++ but have to be reused on following items with no text:start-value -->
+ <xsl:template name="getItemNumber">
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listLevelStyle"/>
+@@ -2122,6 +2131,8 @@
+ <!-- E.g.: If a list level 2 number is searched, a level 3 with content found with only a level 1 parent with content,
+ the level 3 gets a 'pseudoLevel' -->
+ <xsl:param name="pseudoLevel" select="0" />
++ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
++ <xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
+
+ <!-- set the next of preceding list items. Starting from the current to the next previous text:list-item -->
+ <xsl:variable name="precedingListItemOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle[$precedingListItemsOfSameLevelAndStyleCount - $IteratorSameLevelAndStyle + 1]"/>
+@@ -2155,7 +2166,7 @@
+ <xsl:when test="$currentListLevel < $listLevel">
+ <xsl:choose>
+ <!-- if it has content the counting is ended -->
+- <xsl:when test="*[name() = 'text:h' or name() = 'text:p']">
++ <xsl:when test="not($isEmptyList or $isListHeader)">
+ <!-- 2DO: Perhaps the children still have to be processed -->
+ <xsl:value-of select="$itemNumber + $pseudoLevel"/>
+ </xsl:when>
+@@ -2210,7 +2221,7 @@
+ <xsl:with-param name="pseudoLevel">
+ <xsl:choose>
+ <!-- empty list item does not count -->
+- <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p'])">
++ <xsl:when test="$isEmptyList or $isListHeader">
+ <xsl:value-of select="$pseudoLevel"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+@@ -2243,11 +2254,14 @@
+ <xsl:param name="precedingListItemsOfSameStyleCount"/>
+ <xsl:param name="pseudoLevel" />
+
++ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
++ <xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
++
+ <xsl:choose>
+ <xsl:when test="@text:start-value">
+ <xsl:choose>
+- <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p'])">
+- <!-- empty list item does not count -->
++ <xsl:when test="$isEmptyList or $isListHeader">
++ <!-- empty list item does not count. neither does list header -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+@@ -2269,8 +2283,8 @@
+ </xsl:when>
+ <xsl:when test="$listLevelStyle/@text:start-value">
+ <xsl:choose>
+- <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p'])">
+- <!-- empty list item does not count -->
++ <xsl:when test="$isEmptyList or $isListHeader">
++ <!-- empty list item does not count. neither does list header -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+@@ -2292,8 +2306,8 @@
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+- <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p'])">
+- <!-- empty list item does not count -->
++ <xsl:when test="$isEmptyList or $isListHeader">
++ <!-- empty list item does not count. neither does list header -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+Index: filter/source/docbook/sofftodocbookheadings.xsl
+===================================================================
+--- filter/source/docbook/sofftodocbookheadings.xsl (revision 270724)
++++ filter/source/docbook/sofftodocbookheadings.xsl (working copy)
+@@ -73,11 +73,6 @@
+ match="text:h"
+ use="generate-id(preceding::text:h[@text:level < current()/@text:level][1])"/>
+
+- <!-- All those headings have not the lowest outline level (mapped to section1), but come before the first heading mapped to section1 -->
+- <xsl:key name="preludingHeadings"
+- match="text:h"
+- use="generate-id(following::text:h[@text:level = $section1_OutlineLevel][1])"/>
+-
+ <!-- The key function "getHeadingsByOutline" returns all headings of a certain outline level -->
+ <xsl:key name="getHeadingsByOutline"
+ match="text:h"
+@@ -175,7 +170,7 @@
+ <xsl:text disable-output-escaping="yes"><sect1></xsl:text>
+ <title></title>
+ <!-- create sections for all the first section1 preluding headings -->
+- <xsl:for-each select="key('preludingHeadings', generate-id())">
++ <xsl:for-each select="key('getHeadingsByOutline', $section1_OutlineLevel)[1]/preceding::text:h">
+ <xsl:call-template name="make-section">
+ <xsl:with-param name="previousSectionLevel" select="$section1_OutlineLevel"/>
+ <xsl:with-param name="currentSectionLevel">
+@@ -1186,4 +1181,4 @@
+ <xsl:with-param name="whitespaces" select="8"/>
+ </xsl:call-template>
+ </xsl:template>
+-</xsl:stylesheet>
+\ No newline at end of file
++</xsl:stylesheet>
+Index: filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+===================================================================
+--- filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (revision 276736)
++++ filter/source/xslt/odf2xhtml/export/xhtml/body.xsl (working copy)
+@@ -59,6 +59,13 @@
+ <xsl:key name="writingModeStyles" match="/*/office:styles/style:style/style:paragraph-properties/@style:writing-mode | /*/office:automatic-styles/style:style/style:paragraph-properties/@style:writing-mode" use="'test'"/>
+ <xsl:template name="create-body">
+ <xsl:param name="globalData"/>
++ <xsl:call-template name="create-body.collect-page-properties">
++ <xsl:with-param name="globalData" select="$globalData"/>
++ </xsl:call-template>
++ </xsl:template>
++
++ <xsl:template name="create-body.collect-page-properties">
++ <xsl:param name="globalData"/>
+
+ <!-- approximation to find the correct master page style (with page dimensions) -->
+ <xsl:variable name="masterPageNames">
+@@ -75,10 +82,10 @@
+
+ <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
+ <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
+- <xsl:variable name="pageProperties">
++ <xsl:variable name="pagePropertiesRTF">
+ <xsl:choose>
+ <xsl:when test="not($pageLayoutName) or $pageLayoutName = ''">
+- <xsl:copy-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
++ <xsl:value-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Find the according style:page-layout and store the properties in a variable -->
+@@ -86,6 +93,35 @@
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
++ <xsl:choose>
++ <xsl:when test="function-available('common:node-set')">
++ <xsl:call-template name="create-body.create">
++ <xsl:with-param name="globalData" select="common:node-set($globalData)"/>
++ <xsl:with-param name="pageProperties" select="common:node-set($pagePropertiesRTF)"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:when test="function-available('xalan:nodeset')">
++ <xsl:call-template name="create-body.create">
++ <xsl:with-param name="globalData" select="xalan:nodeset($globalData)"/>
++ <xsl:with-param name="pageProperties" select="xalan:nodeset($pagePropertiesRTF)"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:when test="function-available('xt:node-set')">
++ <xsl:call-template name="create-body.create">
++ <xsl:with-param name="globalData" select="xt:node-set($globalData)"/>
++ <xsl:with-param name="pageProperties" select="xt:node-set($pagePropertiesRTF)"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:template>
++
++ <xsl:template name="create-body.create">
++ <xsl:param name="globalData"/>
++ <xsl:param name="pageProperties"/>
++
+ <xsl:element name="body">
+ <!-- direction of text flow -->
+ <xsl:variable name="writingMode" select="$pageProperties/style:page-layout-properties/@style:writing-mode"/>
diff --git a/workspace.gtk3.patch b/workspace.gtk3.patch
new file mode 100644
index 0000000..78ba4f1
--- /dev/null
+++ b/workspace.gtk3.patch
@@ -0,0 +1,2761 @@
+diff -ru svtools.orig/inc/svtools/svtools.hrc svtools/inc/svtools/svtools.hrc
+--- svtools/inc/svtools/svtools.hrc 2009-01-14 15:52:54.000000000 +0000
++++ svtools/inc/svtools/svtools.hrc 2009-01-14 15:53:18.000000000 +0000
+@@ -73,6 +73,7 @@
+ #define RID_FILEOPEN_INVALIDFOLDER (RID_SVTOOLS_START + 34)
+ #define RID_FILEOPEN_NOTEXISTENTFILE (RID_SVTOOLS_START + 35)
+ #define STR_SVT_NOREMOVABLEDEVICE (RID_SVTOOLS_START + 36)
++#define STR_SVT_ALLFORMATS (RID_SVTOOLS_START + 37)
+
+ // doc template dialog
+ #define DLG_DOCTEMPLATE (RID_SVTOOLS_START+50)
+diff -ru fpicker.orig/source/office/iodlg.src fpicker/source/office/iodlg.src
+--- fpicker/source/office/iodlg.src 2009-01-14 11:56:02.000000000 +0000
++++ fpicker/source/office/iodlg.src 2009-01-14 15:59:44.000000000 +0000
+@@ -317,5 +312,10 @@
+ Text [ en-US ] = "No removable storage device detected.\nMake sure it is plugged in properly and try again." ;
+ };
+
++String STR_SVT_ALLFORMATS
++{
++ Text [ en-US ] = "All Formats" ;
++};
++
+ //******************************************************************** EOF
+
+diff -ru fpicker.orig/source/unx/gnome/resourceprovider.cxx fpicker/source/unx/gnome/resourceprovider.cxx
+--- fpicker/source/unx/gnome/resourceprovider.cxx 2009-01-14 11:56:02.000000000 +0000
++++ fpicker/source/unx/gnome/resourceprovider.cxx 2009-01-14 15:42:26.000000000 +0000
+@@ -85,7 +85,8 @@
+ { CHECKBOX_SELECTION, STR_SVT_FILEPICKER_SELECTION },
+ { FOLDERPICKER_TITLE, STR_SVT_FOLDERPICKER_DEFAULT_TITLE },
+ { FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION },
+- { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE }
++ { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE },
++ { FILE_PICKER_ALLFORMATS, STR_SVT_ALLFORMATS }
+ };
+
+ _Entry OtherCtrlIdToResIdTable[] = {
+diff -ru fpicker.orig/source/unx/gnome/resourceprovider.hxx fpicker/source/unx/gnome/resourceprovider.hxx
+--- fpicker/source/unx/gnome/resourceprovider.hxx 2009-01-14 11:56:02.000000000 +0000
++++ fpicker/source/unx/gnome/resourceprovider.hxx 2009-01-14 15:40:34.000000000 +0000
+@@ -48,6 +48,7 @@
+ #define FILE_PICKER_TITLE_SAVE 503
+ #define FILE_PICKER_FILE_TYPE 504
+ #define FILE_PICKER_OVERWRITE 505
++#define FILE_PICKER_ALLFORMATS 506
+
+ //------------------------------------------------------------------------
+ // deklarations
+diff -ru fpicker.orig/source/unx/gnome/SalGtkFilePicker.cxx fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+--- fpicker/source/unx/gnome/SalGtkFilePicker.cxx 2009-01-14 11:56:02.000000000 +0000
++++ fpicker/source/unx/gnome/SalGtkFilePicker.cxx 2009-01-14 15:42:05.000000000 +0000
+@@ -52,6 +52,7 @@
+
+ #include <iostream>
+ #include <algorithm>
++#include <set>
+ #include "resourceprovider.hxx"
+ #ifndef _SV_RC_H
+ #include <tools/rc.hxx>
+@@ -181,6 +182,7 @@
+ mbPreviewState( sal_False ),
+ mHID_Preview( 0 ),
+ m_pPreview( NULL ),
++ m_pPseudoFilter( NULL ),
+ m_PreviewImageWidth( 256 ),
+ m_PreviewImageHeight( 256 )
+ {
+@@ -692,7 +694,7 @@
+ m_pFilterList = new FilterList;
+
+ // set the first filter to the current filter
+- if( ( !m_aCurrentFilter ) || ( !m_aCurrentFilter.getLength() ) )
++ if ( !m_aCurrentFilter.getLength() )
+ m_aCurrentFilter = _rInitialCurrentFilter;
+ }
+ }
+@@ -715,7 +717,6 @@
+
+ // append the filter
+ m_pFilterList->insert( m_pFilterList->end(), FilterEntry( aTitle, aFilter ) );
+- // implAddFilter( aTitle, aFilter );
+ }
+
+ //-----------------------------------------------------------------------------------------
+@@ -782,7 +783,10 @@
+ }
+ else if( GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog)))
+ {
+- updateCurrentFilterFromName(gtk_file_filter_get_name( filter ));
++ if (m_pPseudoFilter != filter)
++ updateCurrentFilterFromName(gtk_file_filter_get_name( filter ));
++ else
++ updateCurrentFilterFromName(OUStringToOString( m_aInitialFilter, RTL_TEXTENCODING_UTF8 ).getStr());
+ }
+ }
+
+@@ -950,9 +954,15 @@
+ }
+ }
+
+- const gchar* filtername =
+- gtk_file_filter_get_name( gtk_file_chooser_get_filter( GTK_FILE_CHOOSER( m_pDialog ) ) );
+- sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
++ GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog));
++ if (m_pPseudoFilter != filter)
++ {
++ const gchar* filtername =
++ gtk_file_filter_get_name( filter );
++ sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
++ }
++ else
++ sFilterName = m_aInitialFilter;
+ }
+
+ OSL_TRACE( "2: current filter is %s\n",
+@@ -1917,7 +1927,7 @@
+ }
+ }
+
+-int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
++GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
+ {
+ GdkThreadLock aLock;
+
+@@ -1968,7 +1978,6 @@
+
+ gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( m_pDialog ), filter );
+
+- int nAdded = 0;
+ if (!bAllGlob)
+ {
+ GtkTreeIter iter;
+@@ -1979,30 +1988,67 @@
+ 2, aFilterName.getStr(),
+ 3, OUStringToOString(rType, RTL_TEXTENCODING_UTF8).getStr(),
+ -1);
+- nAdded = 1;
+ }
+- return nAdded;
++ return filter;
+ }
+
+-int SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Sequence< StringPair >& _rFilters )
++void SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Sequence< StringPair >& _rFilters )
+ {
+ // Gtk+ has no filter group concept I think so ...
+ // implAddFilter( _rFilter, String() );
+- int nAdded = 0;
+ const StringPair* pSubFilters = _rFilters.getConstArray();
+ const StringPair* pSubFiltersEnd = pSubFilters + _rFilters.getLength();
+ for( ; pSubFilters != pSubFiltersEnd; ++pSubFilters )
+- nAdded += implAddFilter( pSubFilters->First, pSubFilters->Second );
+- return nAdded;
++ implAddFilter( pSubFilters->First, pSubFilters->Second );
+ }
+
+ void SalGtkFilePicker::SetFilters()
+ {
+- OSL_TRACE( "start setting filters\n");
+-
+ GdkThreadLock aLock;
+
+- int nAdded = 0;
++ if (!m_aInitialFilter.getLength())
++ m_aInitialFilter = m_aCurrentFilter;
++
++ rtl::OUString sPseudoFilter;
++ if( GTK_FILE_CHOOSER_ACTION_SAVE == gtk_file_chooser_get_action( GTK_FILE_CHOOSER( m_pDialog ) ) )
++ {
++ std::set<OUString> aAllFormats;
++ if( m_pFilterList && !m_pFilterList->empty() )
++ {
++ for ( FilterList::iterator aListIter = m_pFilterList->begin();
++ aListIter != m_pFilterList->end();
++ ++aListIter
++ )
++ {
++ if( aListIter->hasSubFilters() )
++ { // it's a filter group
++ UnoFilterList aSubFilters;
++ aListIter->getSubFilters( aSubFilters );
++ const StringPair* pSubFilters = aSubFilters.getConstArray();
++ const StringPair* pSubFiltersEnd = pSubFilters + aSubFilters.getLength();
++ for( ; pSubFilters != pSubFiltersEnd; ++pSubFilters )
++ aAllFormats.insert(pSubFilters->Second);
++ }
++ else
++ aAllFormats.insert(aListIter->getFilter());
++ }
++ }
++ if (aAllFormats.size() > 1)
++ {
++ rtl::OUString sAllFilter;
++ std::set<OUString>::const_iterator aEnd = aAllFormats.end();
++ for (std::set<OUString>::const_iterator aIter = aAllFormats.begin(); aIter != aEnd; ++aIter)
++ {
++ if (sAllFilter.getLength())
++ sAllFilter += OUString(sal_Unicode(';'));
++ sAllFilter += *aIter;
++ }
++ CResourceProvider aResProvider;
++ sPseudoFilter = aResProvider.getResString(FILE_PICKER_ALLFORMATS);
++ m_pPseudoFilter = implAddFilter( sPseudoFilter, sAllFilter );
++ }
++ }
++
+ if( m_pFilterList && !m_pFilterList->empty() )
+ {
+ for ( FilterList::iterator aListIter = m_pFilterList->begin();
+@@ -2016,30 +2062,27 @@
+ UnoFilterList aSubFilters;
+ aListIter->getSubFilters( aSubFilters );
+
+- nAdded += implAddFilterGroup( aListIter->getTitle(), aSubFilters );
++ implAddFilterGroup( aListIter->getTitle(), aSubFilters );
+ }
+ else
+ {
+ // it's a single filter
+
+- nAdded += implAddFilter( aListIter->getTitle(), aListIter->getFilter() );
++ implAddFilter( aListIter->getTitle(), aListIter->getFilter() );
+ }
+ }
+ }
+
+- if (nAdded)
++ if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(m_pFilterStore), NULL)) //If m_pFilterStore is not empty
+ gtk_widget_show( m_pFilterExpander );
+ else
+ gtk_widget_hide( m_pFilterExpander );
+
+ // set the default filter
+- if( m_aCurrentFilter && (m_aCurrentFilter.getLength() > 0) )
+- {
+- OSL_TRACE( "Setting current filter to %s\n",
+- OUStringToOString( m_aCurrentFilter, RTL_TEXTENCODING_UTF8 ).getStr() );
+-
++ if (sPseudoFilter.getLength())
++ SetCurFilter( sPseudoFilter );
++ else if(m_aCurrentFilter.getLength())
+ SetCurFilter( m_aCurrentFilter );
+- }
+
+ OSL_TRACE( "end setting filters\n");
+ }
+diff -ru fpicker.orig/source/unx/gnome/SalGtkFilePicker.hxx fpicker/source/unx/gnome/SalGtkFilePicker.hxx
+--- fpicker/source/unx/gnome/SalGtkFilePicker.hxx 2009-01-14 11:56:02.000000000 +0000
++++ fpicker/source/unx/gnome/SalGtkFilePicker.hxx 2009-01-14 15:34:41.000000000 +0000
+@@ -317,11 +317,13 @@
+ gulong mnHID_SelectionChange;
+
+ ::rtl::OUString m_aCurrentFilter;
++ ::rtl::OUString m_aInitialFilter;
+
+ bool bVersionWidthUnset;
+ sal_Bool mbPreviewState;
+ gulong mHID_Preview;
+ GtkWidget* m_pPreview;
++ GtkFileFilter* m_pPseudoFilter;
+ sal_Int32 m_PreviewImageWidth;
+ sal_Int32 m_PreviewImageHeight;
+
+@@ -332,8 +334,8 @@
+ void UpdateFilterfromUI();
+
+ void implChangeType( GtkTreeSelection *selection );
+- int implAddFilter( const OUString& rFilter, const OUString& rType);
+- int implAddFilterGroup( const OUString& rFilter,
++ GtkFileFilter * implAddFilter( const OUString& rFilter, const OUString& rType );
++ void implAddFilterGroup( const OUString& rFilter,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair>& _rFilters );
+ void updateCurrentFilterFromName(const gchar* filtername);
+ void unselect_type();
+--- vcl.orig/unx/gtk/window/gtkframe.cxx 2010-05-29 11:29:16.000000000 +0100
++++ vcl/unx/gtk/window/gtkframe.cxx 2010-05-29 12:02:19.000000000 +0100
+@@ -79,6 +79,14 @@
+ #define GDK_META_MASK (1 << 28)
+ #endif
+
++#if GTK_CHECK_VERSION(2,90,0)
++#define IS_WIDGET_REALIZED gtk_widget_get_realized
++#define IS_WIDGET_MAPPED gtk_widget_get_mapped
++#else
++#define IS_WIDGET_REALIZED GTK_WIDGET_REALIZED
++#define IS_WIDGET_MAPPED GTK_WIDGET_MAPPED
++#endif
++
+ using namespace com::sun::star;
+
+ int GtkSalFrame::m_nFloats = 0;
+@@ -428,12 +436,12 @@
+ getDisplay()->deregisterFrame( this );
+
+ if( m_pRegion )
+- gdk_region_destroy( m_pRegion );
++ gdk_region_destroy( m_pRegion );
+
+ if( m_hBackgroundPixmap )
+ {
+ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ None );
+ XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap );
+ }
+@@ -592,7 +600,7 @@
+ SalDisplay* pDisp = GetX11SalData()->GetDisplay();
+ m_aSystemData.nSize = sizeof( SystemChildData );
+ m_aSystemData.pDisplay = pDisp->GetDisplay();
+- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window);
++ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow));
+ m_aSystemData.pSalFrame = this;
+ m_aSystemData.pWidget = m_pWindow;
+ m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual();
+@@ -644,7 +652,7 @@
+ * some paint issues
+ */
+ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ m_hBackgroundPixmap );
+ }
+
+@@ -678,7 +686,7 @@
+ else if( ! bBeforeRealize )
+ {
+ Display* pDisplay = GetX11SalData()->GetDisplay()->GetDisplay();
+- XLIB_Window aWindow = GDK_WINDOW_XWINDOW( GTK_WIDGET(pWindow)->window );
++ XLIB_Window aWindow = GDK_WINDOW_XWINDOW( widget_get_window(GTK_WIDGET(pWindow)) );
+ XWMHints* pHints = XGetWMHints( pDisplay, aWindow );
+ if( ! pHints )
+ {
+@@ -863,7 +871,7 @@
+ nUserTime= getDisplay()->GetLastUserEventTime( true );
+ // nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window);
+ }
+- lcl_set_user_time(GTK_WIDGET(m_pWindow)->window, nUserTime);
++ lcl_set_user_time(widget_get_window(GTK_WIDGET(m_pWindow)), nUserTime);
+ }
+
+ if( bDecoHandling )
+@@ -917,7 +925,8 @@
+ {
+ m_pWindow = gtk_plug_new( pSysData->aWindow );
+ m_bWindowIsGtkPlug = true;
+- GTK_WIDGET_SET_FLAGS( m_pWindow, GTK_CAN_FOCUS | GTK_SENSITIVE | GTK_CAN_DEFAULT );
++ widget_set_can_default( m_pWindow, true );
++ widget_set_can_focus( m_pWindow, true );
+ gtk_widget_set_sensitive( m_pWindow, true );
+ }
+ else
+@@ -942,7 +951,7 @@
+ if( ! m_bWindowIsGtkPlug )
+ {
+ XReparentWindow( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ (XLIB_Window)pSysData->aWindow,
+ 0, 0 );
+ }
+@@ -976,14 +985,14 @@
+ if( nStyle != m_nExtStyle && ! isChild() )
+ {
+ m_nExtStyle = nStyle;
+- if( GTK_WIDGET_REALIZED( m_pWindow ) )
++ if( IS_WIDGET_REALIZED( m_pWindow ) )
+ {
+ XClassHint* pClass = XAllocClassHint();
+ rtl::OString aResHint = X11SalData::getFrameResName( m_nExtStyle );
+ pClass->res_name = const_cast<char*>(aResHint.getStr());
+ pClass->res_class = const_cast<char*>(X11SalData::getFrameClassName());
+ XSetClassHint( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ pClass );
+ XFree( pClass );
+ }
+@@ -1007,7 +1016,7 @@
+ if( ! m_aGraphics[i].pGraphics )
+ {
+ m_aGraphics[i].pGraphics = new GtkSalGraphics( m_pWindow );
+- m_aGraphics[i].pGraphics->Init( this, GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
++ m_aGraphics[i].pGraphics->Init( this, GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_nScreen );
+ }
+ return m_aGraphics[i].pGraphics;
+ }
+@@ -1308,7 +1317,7 @@
+ setMinMaxSize();
+
+ // #i45160# switch to desktop where a dialog with parent will appear
+- if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && GTK_WIDGET_MAPPED(m_pParent->m_pWindow) )
++ if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && IS_WIDGET_MAPPED(m_pParent->m_pWindow) )
+ getDisplay()->getWMAdaptor()->switchToWorkArea( m_pParent->m_nWorkArea );
+
+ if( isFloatGrabWindow() &&
+@@ -1363,7 +1372,7 @@
+ nUserTime= getDisplay()->GetLastUserEventTime( true );
+ //nUserTime = gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window);
+ }
+- lcl_set_user_time( GTK_WIDGET(m_pWindow)->window, nUserTime );
++ lcl_set_user_time( widget_get_window(GTK_WIDGET(m_pWindow)), nUserTime );
+
+ if( bHack && ! bNoActivate && (m_nStyle & SAL_FRAME_STYLE_TOOLWINDOW) )
+ m_bSetFocusOnMap = true;
+@@ -1472,7 +1481,7 @@
+ {
+ m_aMaxSize = Size( nWidth, nHeight );
+ // Show does a setMinMaxSize
+- if( GTK_WIDGET_MAPPED( m_pWindow ) )
++ if( IS_WIDGET_MAPPED( m_pWindow ) )
+ setMinMaxSize();
+ }
+ }
+@@ -1485,7 +1494,7 @@
+ {
+ gtk_widget_set_size_request( m_pWindow, nWidth, nHeight );
+ // Show does a setMinMaxSize
+- if( GTK_WIDGET_MAPPED( m_pWindow ) )
++ if( IS_WIDGET_MAPPED( m_pWindow ) )
+ setMinMaxSize();
+ }
+ }
+@@ -1737,7 +1746,7 @@
+ gtk_widget_realize( m_pWindow );
+ // update system data
+ GtkSalDisplay* pDisp = getDisplay();
+- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window);
++ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow));
+ m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual();
+ m_aSystemData.nScreen = nScreen;
+ m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth();
+@@ -1748,7 +1757,7 @@
+ for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ )
+ {
+ if( m_aGraphics[i].bInUse )
+- m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
++ m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_nScreen );
+ }
+ updateScreenNumber();
+ }
+@@ -1777,7 +1786,7 @@
+
+ Rectangle aOldScreenRect( pDisp->GetXineramaScreens()[maGeometry.nScreenNumber] );
+ Rectangle aNewScreenRect( pDisp->GetXineramaScreens()[nNewScreen] );
+- bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
++ bool bVisible = IS_WIDGET_MAPPED(m_pWindow);
+ if( bVisible )
+ Show( FALSE );
+ maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left());
+@@ -1809,7 +1818,7 @@
+ {
+ m_aRestorePosSize = Rectangle( Point( maGeometry.nX, maGeometry.nY ),
+ Size( maGeometry.nWidth, maGeometry.nHeight ) );
+- bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
++ bool bVisible = IS_WIDGET_MAPPED(m_pWindow);
+ if( bVisible )
+ Show( FALSE );
+ m_nStyle |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN;
+@@ -1838,7 +1847,7 @@
+ }
+ else
+ {
+- bool bVisible = GTK_WIDGET_MAPPED(m_pWindow);
++ bool bVisible = IS_WIDGET_MAPPED(m_pWindow);
+ if( ! getDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() )
+ gtk_window_unfullscreen( GTK_WINDOW(m_pWindow) );
+ if( bVisible )
+@@ -2052,7 +2061,7 @@
+ }
+ #ifdef ENABLE_DBUS
+ m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation",
+- GDK_WINDOW_XID(m_pWindow->window));
++ GDK_WINDOW_XID(widget_get_window(m_pWindow)));
+ #endif
+ }
+ else
+@@ -2078,7 +2087,7 @@
+ {
+ if( isChild( false, true ) )
+ gtk_widget_grab_focus( m_pWindow );
+- else if( GTK_WIDGET_MAPPED( m_pWindow ) )
++ else if( IS_WIDGET_MAPPED( m_pWindow ) )
+ {
+ if( ! (nFlags & SAL_FRAME_TOTOP_GRABFOCUS_ONLY) )
+ gtk_window_present( GTK_WINDOW(m_pWindow) );
+@@ -2087,7 +2096,7 @@
+ // gdk_window_focus( m_pWindow->window, gdk_x11_get_server_time(GTK_WIDGET (m_pWindow)->window) );
+ /* #i99360# ugly workaround an X11 library bug */
+ guint32 nUserTime= getDisplay()->GetLastUserEventTime( true );
+- gdk_window_focus( m_pWindow->window, nUserTime );
++ gdk_window_focus( widget_get_window(m_pWindow), nUserTime );
+ }
+ /* need to do an XSetInputFocus here because
+ * gdk_window_focus will ask a EWMH compliant WM to put the focus
+@@ -2099,7 +2108,7 @@
+ // sad but true: this can cause an XError, we need to catch that
+ // to do this we need to synchronize with the XServer
+ getDisplay()->GetXLib()->PushXErrorLevel( true );
+- XSetInputFocus( getDisplay()->GetDisplay(), GDK_WINDOW_XWINDOW( m_pWindow->window ), RevertToParent, CurrentTime );
++ XSetInputFocus( getDisplay()->GetDisplay(), GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow) ), RevertToParent, CurrentTime );
+ XSync( getDisplay()->GetDisplay(), False );
+ getDisplay()->GetXLib()->PopXErrorLevel();
+ }
+@@ -2118,7 +2127,7 @@
+ {
+ m_ePointerStyle = ePointerStyle;
+ GdkCursor *pCursor = getDisplay()->getCursor( ePointerStyle );
+- gdk_window_set_cursor( m_pWindow->window, pCursor );
++ gdk_window_set_cursor( widget_get_window(m_pWindow), pCursor );
+ m_pCurrentCursor = pCursor;
+
+ // #i80791# use grabPointer the same way as CaptureMouse, respective float grab
+@@ -2153,7 +2162,7 @@
+ {
+ const int nMask = ( GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK );
+
+- gdk_pointer_grab( m_pWindow->window, bOwnerEvents,
++ gdk_pointer_grab( widget_get_window(m_pWindow), bOwnerEvents,
+ (GdkEventMask) nMask, NULL, m_pCurrentCursor,
+ GDK_CURRENT_TIME );
+ }
+@@ -2166,7 +2175,7 @@
+ // this is of course a bad hack, especially as we cannot
+ // set the right cursor this way
+ XGrabPointer( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW( m_pWindow->window),
++ GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow)),
+ bOwnerEvents,
+ PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync,
+@@ -2214,7 +2223,7 @@
+ // #i38648# ask for the next motion hint
+ gint x, y;
+ GdkModifierType mask;
+- gdk_window_get_pointer( pFrame->m_pWindow->window, &x, &y, &mask );
++ gdk_window_get_pointer( widget_get_window(pFrame->m_pWindow) , &x, &y, &mask );
+ }
+
+ void GtkSalFrame::Flush()
+@@ -2300,7 +2309,7 @@
+ return NULL;
+
+ X11SalBitmap *pBmp = new X11SalBitmap;
+- GdkWindow *pWin = m_pWindow->window;
++ GdkWindow *pWin = widget_get_window(m_pWindow);
+ if( pBmp->SnapShot( GDK_DISPLAY_XDISPLAY( getGdkDisplay() ),
+ GDK_WINDOW_XID( pWin ) ) )
+ return pBmp;
+@@ -2362,7 +2371,7 @@
+
+ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nScreen )
+ {
+- bool bWasVisible = GTK_WIDGET_MAPPED(m_pWindow);
++ bool bWasVisible = IS_WIDGET_MAPPED(m_pWindow);
+ if( bWasVisible )
+ Show( FALSE );
+
+@@ -2407,7 +2416,7 @@
+ m_pIMHandler = NULL;
+ }
+ if( m_pRegion )
+- gdk_region_destroy( m_pRegion );
++ gdk_region_destroy( m_pRegion );
+ if( m_pFixedContainer )
+ gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) );
+ if( m_pWindow )
+@@ -2435,7 +2444,7 @@
+ {
+ if( m_aGraphics[i].bInUse )
+ {
+- m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(m_pWindow->window), m_nScreen );
++ m_aGraphics[i].pGraphics->SetDrawable( GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)), m_nScreen );
+ m_aGraphics[i].pGraphics->SetWindow( m_pWindow );
+ }
+ }
+@@ -2465,14 +2474,14 @@
+ void GtkSalFrame::ResetClipRegion()
+ {
+ if( m_pWindow )
+- gdk_window_shape_combine_region( m_pWindow->window, NULL, 0, 0 );
++ gdk_window_shape_combine_region( widget_get_window(m_pWindow), NULL, 0, 0 );
+ }
+
+ void GtkSalFrame::BeginSetClipRegion( ULONG )
+ {
+ if( m_pRegion )
+- gdk_region_destroy( m_pRegion );
+- m_pRegion = gdk_region_new();
++ gdk_region_destroy( m_pRegion );
++ m_pRegion = gdk_region_new();
+ }
+
+ void GtkSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
+@@ -2485,14 +2494,14 @@
+ aRect.width = nWidth;
+ aRect.height = nHeight;
+
+- gdk_region_union_with_rect( m_pRegion, &aRect );
++ gdk_region_union_with_rect( m_pRegion, &aRect );
+ }
+ }
+
+ void GtkSalFrame::EndSetClipRegion()
+ {
+ if( m_pWindow && m_pRegion )
+- gdk_window_shape_combine_region( m_pWindow->window, m_pRegion, 0, 0 );
++ gdk_window_shape_combine_region( widget_get_window(m_pWindow), m_pRegion, 0, 0 );
+ }
+
+ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
+@@ -2506,7 +2515,7 @@
+ if( pEvent->xproperty.atom == nDesktopAtom &&
+ pEvent->xproperty.state == PropertyNewValue )
+ {
+- m_nWorkArea = pAdaptor->getWindowWorkArea( GDK_WINDOW_XWINDOW( m_pWindow->window) );
++ m_nWorkArea = pAdaptor->getWindowWorkArea( GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow)) );
+ }
+ }
+ else if( pEvent->type == ConfigureNotify )
+@@ -2533,7 +2542,7 @@
+ int x = 0, y = 0;
+ XLIB_Window aChild;
+ XTranslateCoordinates( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW( m_pWindow->window),
++ GDK_WINDOW_XWINDOW( widget_get_window(m_pWindow) ),
+ getDisplay()->GetRootWindow( getDisplay()->GetDefaultScreenNumber() ),
+ 0, 0,
+ &x, &y,
+@@ -2548,7 +2557,7 @@
+ }
+ else if( pEvent->type == ClientMessage &&
+ pEvent->xclient.message_type == getDisplay()->getWMAdaptor()->getAtom( vcl_sal::WMAdaptor::XEMBED ) &&
+- pEvent->xclient.window == GDK_WINDOW_XWINDOW(m_pWindow->window) &&
++ pEvent->xclient.window == GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)) &&
+ m_bWindowIsGtkPlug
+ )
+ {
+@@ -2560,7 +2569,7 @@
+ {
+ GdkEventFocus aEvent;
+ aEvent.type = GDK_FOCUS_CHANGE;
+- aEvent.window = m_pWindow->window;
++ aEvent.window = widget_get_window(m_pWindow);
+ aEvent.send_event = TRUE;
+ aEvent.in = (pEvent->xclient.data.l[1] == 1);
+ signalFocus( m_pWindow, &aEvent, this );
+@@ -2575,7 +2584,7 @@
+ if( m_hBackgroundPixmap )
+ {
+ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ None );
+ XFreePixmap( getDisplay()->GetDisplay(), m_hBackgroundPixmap );
+ m_hBackgroundPixmap = None;
+@@ -2588,7 +2597,7 @@
+ {
+ m_hBackgroundPixmap =
+ XCreatePixmap( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ aSize.Width(),
+ aSize.Height(),
+ getDisplay()->GetVisual(m_nScreen).GetDepth() );
+@@ -2604,7 +2613,7 @@
+ aTwoRect,
+ getDisplay()->GetCopyGC(m_nScreen) );
+ XSetWindowBackgroundPixmap( getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(m_pWindow->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(m_pWindow)),
+ m_hBackgroundPixmap );
+ }
+ }
+@@ -2777,7 +2786,7 @@
+ // ask for the next hint
+ gint x, y;
+ GdkModifierType mask;
+- gdk_window_get_pointer( GTK_WIDGET(pThis->m_pWindow)->window, &x, &y, &mask );
++ gdk_window_get_pointer( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &x, &y, &mask );
+ }
+ }
+
+@@ -2872,7 +2881,7 @@
+ if( bSetFocus )
+ {
+ XSetInputFocus( pThis->getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW( GTK_WIDGET(pThis->m_pWindow)->window),
++ GDK_WINDOW_XWINDOW( widget_get_window(GTK_WIDGET(pThis->m_pWindow))),
+ RevertToParent, CurrentTime );
+ }
+
+@@ -2920,7 +2929,7 @@
+ */
+ XLIB_Window aChild;
+ XTranslateCoordinates( pThis->getDisplay()->GetDisplay(),
+- GDK_WINDOW_XWINDOW(GTK_WIDGET(pThis->m_pWindow)->window),
++ GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pThis->m_pWindow))),
+ pThis->getDisplay()->GetRootWindow( pThis->getDisplay()->GetDefaultScreenNumber() ),
+ 0, 0,
+ &x, &y,
+@@ -2954,7 +2963,7 @@
+ if( ! (pThis->m_nStyle & SAL_FRAME_STYLE_PLUG) )
+ {
+ GdkRectangle aRect;
+- gdk_window_get_frame_extents( GTK_WIDGET(pThis->m_pWindow)->window, &aRect );
++ gdk_window_get_frame_extents( widget_get_window(GTK_WIDGET(pThis->m_pWindow)), &aRect );
+ pThis->maGeometry.nTopDecoration = y - aRect.y;
+ pThis->maGeometry.nBottomDecoration = aRect.y + aRect.height - y - pEvent->height;
+ pThis->maGeometry.nLeftDecoration = x - aRect.x;
+@@ -3165,7 +3174,7 @@
+ * some time on the Xserver as well as prevent
+ * some paint issues
+ */
+- GdkWindow* pWin = GTK_WIDGET(pThis->getWindow())->window;
++ GdkWindow* pWin = widget_get_window(GTK_WIDGET(pThis->getWindow()));
+ if( pWin )
+ {
+ XLIB_Window aWin = GDK_WINDOW_XWINDOW(pWin);
+@@ -3269,7 +3278,7 @@
+ G_CALLBACK (signalIMPreeditEnd), this );
+
+ m_pFrame->getDisplay()->GetXLib()->PushXErrorLevel( true );
+- gtk_im_context_set_client_window( m_pIMContext, GTK_WIDGET(m_pFrame->m_pWindow)->window );
++ gtk_im_context_set_client_window( m_pIMContext, widget_get_window(GTK_WIDGET(m_pFrame->m_pWindow)) );
+ gtk_im_context_focus_in( m_pIMContext );
+ m_pFrame->getDisplay()->GetXLib()->PopXErrorLevel();
+ m_bFocused = true;
+--- fpicker.orig/source/unx/gnome/SalGtkFilePicker.cxx 2010-05-29 21:22:49.000000000 +0100
++++ fpicker/source/unx/gnome/SalGtkFilePicker.cxx 2010-05-29 21:26:05.000000000 +0100
+@@ -602,7 +602,11 @@
+ g_return_if_fail( GTK_IS_DIALOG( pDialog ) );
+
+ GList *pChildren =
++#if GTK_CHECK_VERSION(2,90,0)
++ gtk_container_get_children( GTK_CONTAINER( gtk_dialog_get_action_area(pDialog) ) );
++#else
+ gtk_container_get_children( GTK_CONTAINER( pDialog->action_area ) );
++#endif
+
+ for( GList *p = pChildren; p; p = p->next )
+ gtk_widget_destroy( GTK_WIDGET( p->data ) );
+@@ -1600,7 +1604,7 @@
+
+ gtk_image_set_from_pixbuf( GTK_IMAGE( preview ), pixbuf );
+ if( pixbuf )
+- gdk_pixbuf_unref( pixbuf );
++ g_object_unref( pixbuf );
+
+ }
+
+--- libegg.orig/source/eggtrayicon.c 2010-05-29 21:27:29.000000000 +0100
++++ libegg/source/eggtrayicon.c 2010-05-30 12:53:27.000000000 +0100
+@@ -230,6 +230,7 @@
+ {
+ EggTrayIcon *icon = user_data;
+ XEvent *xev = (XEvent *)xevent;
++ (void)event;
+
+ if (xev->xany.type == ClientMessage &&
+ xev->xclient.message_type == icon->manager_atom &&
+@@ -280,6 +281,36 @@
+ #endif
+ }
+
++static gboolean
++gtk_widget_is_has_window(GtkWidget *widget)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_get_has_window(widget);
++#else
++ return GTK_WIDGET_NO_WINDOW(widget);
++#endif
++}
++
++static gboolean
++gtk_widget_is_app_paintable(GtkWidget *widget)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_get_app_paintable(widget);
++#else
++ return GTK_WIDGET_APP_PAINTABLE(widget);
++#endif
++}
++
++static GdkWindow *
++gtk_widget_window(GtkWidget *widget)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_get_window(widget);
++#else
++ return widget->window;
++#endif
++}
++
+ #ifdef GDK_WINDOWING_X11
+
+ static void
+@@ -297,7 +328,7 @@
+ ev.window = window;
+ ev.message_type = icon->system_tray_opcode_atom;
+ ev.format = 32;
+- ev.data.l[0] = gdk_x11_get_server_time (GTK_WIDGET (icon)->window);
++ ev.data.l[0] = gdk_x11_get_server_time (gtk_widget_window(GTK_WIDGET(icon)));
+ ev.data.l[1] = message;
+ ev.data.l[2] = data1;
+ ev.data.l[3] = data2;
+@@ -322,6 +353,16 @@
+ 0, 0);
+ }
+
++static gboolean
++gtk_widget_is_realized(GtkWidget *widget)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_get_realized(widget);
++#else
++ return GTK_WIDGET_REALIZED(widget);
++#endif
++}
++
+ static void
+ egg_tray_icon_update_manager_window (EggTrayIcon *icon,
+ gboolean dock_if_realized)
+@@ -354,7 +395,7 @@
+
+ gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
+
+- if (dock_if_realized && GTK_WIDGET_REALIZED (icon))
++ if (dock_if_realized && gtk_widget_is_realized (GTK_WIDGET (icon)))
+ egg_tray_icon_send_dock_request (icon);
+
+ egg_tray_icon_get_orientation_property (icon);
+@@ -383,7 +424,8 @@
+ static gboolean
+ transparent_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
+ {
+- gdk_window_clear_area (widget->window, event->area.x, event->area.y,
++ (void)user_data;
++ gdk_window_clear_area (gtk_widget_window(widget), event->area.x, event->area.y,
+ event->area.width, event->area.height);
+ return FALSE;
+ }
+@@ -392,18 +434,21 @@
+ make_transparent_again (GtkWidget *widget, GtkStyle *previous_style,
+ gpointer user_data)
+ {
+- gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
++ (void)previous_style;
++ (void)user_data;
++ gdk_window_set_back_pixmap (gtk_widget_window(widget), NULL, TRUE);
+ }
+
+ static void
+ make_transparent (GtkWidget *widget, gpointer user_data)
+ {
+- if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget))
++ if (gtk_widget_is_has_window (widget) || gtk_widget_is_app_paintable (widget))
+ return;
+
++ (void)user_data;
+ gtk_widget_set_app_paintable (widget, TRUE);
+ gtk_widget_set_double_buffered (widget, FALSE);
+- gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
++ gdk_window_set_back_pixmap (gtk_widget_window(widget), NULL, TRUE);
+ g_signal_connect (widget, "expose_event",
+ G_CALLBACK (transparent_expose_event), NULL);
+ g_signal_connect_after (widget, "style_set",
+--- libegg.orig/source/eggtrayicon-impl.h 2010-05-29 21:27:29.000000000 +0100
++++ libegg/source/eggtrayicon-impl.h 2010-05-30 12:46:49.000000000 +0100
+@@ -21,7 +21,7 @@
+ #ifndef __EGG_TRAY_ICON_IMPL_H__
+ #define __EGG_TRAY_ICON_IMPL_H__
+
+-#include <gtk/gtkplug.h>
++#include <gtk/gtk.h>
+ #ifdef GDK_WINDOWING_X11
+ #include <gdk/gdkx.h>
+ #endif
+--- sfx2.orig/source/appl/shutdowniconunx.cxx 2010-05-29 21:22:29.000000000 +0100
++++ sfx2/source/appl/shutdowniconunx.cxx 2010-05-30 12:59:35.000000000 +0100
+@@ -302,18 +302,34 @@
+ gpointer )
+ {
+ GtkRequisition req;
+- GtkWidget *ebox = GTK_BIN( pTrayIcon )->child;
++ GtkWidget *ebox = gtk_bin_get_child(GTK_BIN( pTrayIcon ));
+
+ gtk_widget_size_request( GTK_WIDGET( menu ), &req );
++#if GTK_CHECK_VERSION(2,90,0)
++ gdk_window_get_origin( gtk_widget_get_window(ebox), x, y );
++
++ GtkAllocation allocation;
++ gtk_widget_get_allocation(ebox, &allocation);
++
++ (*x) += allocation.x;
++ (*y) += allocation.y;
++#else
+ gdk_window_get_origin( ebox->window, x, y );
+
+ (*x) += ebox->allocation.x;
+ (*y) += ebox->allocation.y;
++#endif
+
+ if (*y >= gdk_screen_get_height (gtk_widget_get_screen (ebox)) / 2)
+ (*y) -= req.height;
+ else
++ {
++#if GTK_CHECK_VERSION(2,90,0)
++ (*y) += allocation.height;
++#else
+ (*y) += ebox->allocation.height;
++#endif
++ }
+
+ *push_in = TRUE;
+ }
+@@ -372,8 +388,12 @@
+ pTrayIcon = egg_tray_icon_new( aLabel );
+
+ GtkWidget *pParent = gtk_event_box_new();
++#if GTK_CHECK_VERSION(2,90,0)
++ gtk_widget_set_tooltip_text (pParent, aLabel );
++#else
+ GtkTooltips *pTooltips = gtk_tooltips_new();
+ gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pParent, aLabel, NULL );
++#endif
+
+ GtkWidget *pIconImage = gtk_image_new();
+ gtk_container_add( GTK_CONTAINER( pParent ), pIconImage );
+--- vcl.orig/unx/gtk/app/gtkdata.cxx 2010-06-14 19:51:39.500810695 +0100
++++ vcl/unx/gtk/app/gtkdata.cxx 2010-06-15 10:07:16.669799057 +0100
+@@ -217,11 +217,12 @@
+ {
+ gint nMonitors = gdk_screen_get_n_monitors(pScreen);
+ m_aXineramaScreens = std::vector<Rectangle>();
++ m_aXineramaScreenIndexMap = std::vector<int>(nMonitors);
+ for (gint i = 0; i < nMonitors; ++i)
+ {
+ GdkRectangle dest;
+ gdk_screen_get_monitor_geometry(pScreen, i, &dest);
+- addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
++ addXineramaScreenUnique( i, dest.x, dest.y, dest.width, dest.height );
+ }
+ m_bXinerama = m_aXineramaScreens.size() > 1;
+ if( ! m_aFrames.empty() )
+@@ -235,6 +236,35 @@
+ }
+ }
+
++extern "C"
++{
++ typedef gint(* screen_get_primary_monitor)(GdkScreen *screen);
++}
++
++int GtkSalDisplay::GetDefaultMonitorNumber() const
++{
++ fprintf(stderr, "GtkSalDisplay::GetDefaultMonitorNumber\n");
++
++ GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
++#if GTK_CHECK_VERSION(2,20,0)
++ return m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
++#else
++ static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
++ (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
++ if (sym_gdk_screen_get_primary_monitor)
++ return sym_gdk_screen_get_primary_monitor( pScreen );
++ //gdk_screen_get_primary_monitor unavailable, take the first laptop monitor as the default
++ gint nMonitors = gdk_screen_get_n_monitors(pScreen);
++ for (gint i = 0; i < nMonitors; ++i)
++ {
++ fprintf(stderr, "name is %s\n", gdk_screen_get_monitor_plug_name(pScreen, i));
++ if (g_ascii_strncasecmp (gdk_screen_get_monitor_plug_name(pScreen, i), "LVDS", 4) == 0)
++ return m_aXineramaScreenIndexMap[i];
++ }
++ return 0;
++#endif
++}
++
+ void GtkSalDisplay::initScreen( int nScreen ) const
+ {
+ if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) )
+--- vcl.orig/unx/inc/saldisp.hxx 2010-06-14 19:51:39.548798785 +0100
++++ vcl/unx/inc/saldisp.hxx 2010-06-15 10:06:53.031798755 +0100
+@@ -389,6 +389,7 @@
+
+ bool m_bXinerama;
+ std::vector< Rectangle > m_aXineramaScreens;
++ std::vector< int > m_aXineramaScreenIndexMap;
+ std::list<SalFrame*> m_aFrames;
+ std::list<SalObject*> m_aSalObjects;
+
+@@ -404,7 +405,7 @@
+ int processRandREvent( XEvent* );
+
+ void doDestruct();
+- void addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight );
++ void addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight );
+ public:
+ static SalDisplay *GetSalDisplay( Display* display );
+ static BOOL BestVisual( Display *pDisp,
+@@ -474,6 +475,7 @@
+ XLIB_Window GetDrawable( int nScreen ) const { return getDataForScreen( nScreen ).m_aRefWindow; }
+ Display *GetDisplay() const { return pDisp_; }
+ int GetDefaultScreenNumber() const { return m_nDefaultScreen; }
++ virtual int GetDefaultMonitorNumber() const;
+ const Size& GetScreenSize( int nScreen ) const { return getDataForScreen( nScreen ).m_aSize; }
+ srv_vendor_t GetServerVendor() const { return meServerVendor; }
+ void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); }
+--- vcl.orig/unx/source/app/saldisp.cxx 2010-06-14 19:51:39.516798973 +0100
++++ vcl/unx/source/app/saldisp.cxx 2010-06-15 10:12:39.627798619 +0100
+@@ -2592,7 +2592,7 @@
+ sal::static_int_cast< unsigned int >(GetVisual(m_nDefaultScreen).GetVisualId()) );
+ }
+
+-void SalDisplay::addXineramaScreenUnique( long i_nX, long i_nY, long i_nWidth, long i_nHeight )
++void SalDisplay::addXineramaScreenUnique( int i, long i_nX, long i_nY, long i_nWidth, long i_nHeight )
+ {
+ // see if any frame buffers are at the same coordinates
+ // this can happen with weird configuration e.g. on
+@@ -2607,10 +2607,12 @@
+ m_aXineramaScreens[n].GetHeight() < i_nHeight )
+ {
+ m_aXineramaScreens[n].SetSize( Size( i_nWidth, i_nHeight ) );
++ m_aXineramaScreenIndexMap[i] = n;
+ }
+ return;
+ }
+ }
++ m_aXineramaScreenIndexMap[i] = m_aXineramaScreens.size();
+ m_aXineramaScreens.push_back( Rectangle( Point( i_nX, i_nY ), Size( i_nWidth, i_nHeight ) ) );
+ }
+
+@@ -2637,8 +2639,9 @@
+ {
+ m_bXinerama = true;
+ m_aXineramaScreens = std::vector<Rectangle>();
++ m_aXineramaScreenIndexMap = std::vector<int>(nFramebuffers);
+ for( int i = 0; i < nFramebuffers; i++ )
+- addXineramaScreenUnique( pFramebuffers[i].x,
++ addXineramaScreenUnique( i, pFramebuffers[i].x,
+ pFramebuffers[i].y,
+ pFramebuffers[i].width,
+ pFramebuffers[i].height );
+@@ -2654,9 +2657,10 @@
+ if( nFramebuffers > 1 )
+ {
+ m_aXineramaScreens = std::vector<Rectangle>();
++ m_aXineramaScreenIndexMap = std::vector<int>(nFramebuffers);
+ for( int i = 0; i < nFramebuffers; i++ )
+ {
+- addXineramaScreenUnique( pScreens[i].x_org,
++ addXineramaScreenUnique( i, pScreens[i].x_org,
+ pScreens[i].y_org,
+ pScreens[i].width,
+ pScreens[i].height );
+@@ -2677,6 +2681,11 @@
+ #endif // USE_XINERAMA
+ }
+
++int SalDisplay::GetDefaultMonitorNumber() const
++{
++ return 0;
++}
++
+ void SalDisplay::registerFrame( SalFrame* pFrame )
+ {
+ m_aFrames.push_front( pFrame );
+--- vcl.orig/unx/source/app/salsys.cxx 2010-06-14 19:51:39.515799413 +0100
++++ vcl/unx/source/app/salsys.cxx 2010-06-14 20:28:14.281799292 +0100
+@@ -74,7 +74,7 @@
+ unsigned int X11SalSystem::GetDefaultDisplayNumber()
+ {
+ SalDisplay* pSalDisp = GetX11SalData()->GetDisplay();
+- return pSalDisp->GetDefaultScreenNumber();
++ return pSalDisp->IsXinerama() ? pSalDisp->GetDefaultMonitorNumber() : pSalDisp->GetDefaultScreenNumber();
+ }
+
+ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
+--- vcl.orig/unx/inc/plugins/gtk/gtkgdi.hxx 2010-06-21 12:34:41.000000000 +0100
++++ vcl/unx/inc/plugins/gtk/gtkgdi.hxx 2010-06-21 13:16:40.000000000 +0100
+@@ -49,7 +49,7 @@
+ virtual ~GtkSalGraphics();
+
+ inline GtkWidget* GetGtkWidget() const { return m_pWindow; }
+- inline GdkWindow* GetGdkWindow() const { return m_pWindow->window; }
++ inline GdkWindow* GetGdkWindow() const { return widget_get_window(m_pWindow); }
+ inline GtkSalFrame* GetGtkFrame() const { return static_cast<GtkSalFrame*>(m_pFrame); }
+ void SetWindow( GtkWidget* window ) { m_pWindow = window; }
+
+@@ -127,7 +127,7 @@
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue& aValue,
+ const OUString& rCaption );
+- BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
++ BOOL NWPaintGTKComboBoxEntry( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ const Rectangle& rControlRectangle,
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue& aValue,
+@@ -137,11 +137,13 @@
+ const clipList& rClipList,
+ ControlState nState, const ImplControlValue& aValue,
+ const OUString& rCaption );
+- BOOL NWPaintGTKListBox( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+- const Rectangle& rControlRectangle,
+- const clipList& rClipList,
+- ControlState nState, const ImplControlValue& aValue,
+- const OUString& rCaption );
++ BOOL NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
++ ControlType nType, ControlPart nPart,
++ const Rectangle& rControlRectangle,
++ const clipList& rClipList,
++ ControlState nState,
++ const ImplControlValue& aValue,
++ const OUString& rCaption );
+
+ BOOL NWPaintGTKToolbar( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
+ const Rectangle& rControlRectangle,
+--- vcl.orig/unx/gtk/gdi/salnativewidgets-gtk.cxx 2010-06-21 12:34:41.000000000 +0100
++++ vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 2010-06-21 13:19:37.000000000 +0100
+@@ -68,39 +68,45 @@
+ class NWPixmapCache;
+ struct NWFWidgetData
+ {
+- GtkWidget * gCacheWindow;
+- GtkWidget * gDumbContainer;
++ GtkWidget * gCacheWindow;
++ GtkWidget * gDumbContainer;
+
+- GtkWidget * gBtnWidget;
+- GtkWidget * gRadioWidget;
+- GtkWidget * gRadioWidgetSibling;
+- GtkWidget * gCheckWidget;
+- GtkWidget * gScrollHorizWidget;
+- GtkWidget * gScrollVertWidget;
+- GtkWidget * gArrowWidget;
+- GtkWidget * gDropdownWidget;
+- GtkWidget * gEditBoxWidget;
+- GtkWidget * gSpinButtonWidget;
+- GtkWidget * gNotebookWidget;
+- GtkWidget * gOptionMenuWidget;
+- GtkWidget * gComboWidget;
+- GtkWidget * gScrolledWindowWidget;
+- GtkWidget * gToolbarWidget;
+- GtkWidget * gToolbarButtonWidget;
+- GtkWidget * gToolbarToggleWidget;
+- GtkWidget * gHandleBoxWidget;
+- GtkWidget * gMenubarWidget;
+- GtkWidget * gMenuItemMenubarWidget;
+- GtkWidget * gMenuWidget;
+- GtkWidget * gMenuItemMenuWidget;
+- GtkWidget * gMenuItemCheckMenuWidget;
+- GtkWidget * gMenuItemRadioMenuWidget;
+- GtkWidget * gImageMenuItem;
+- GtkWidget * gTooltipPopup;
+- GtkWidget * gProgressBar;
+- GtkWidget * gTreeView;
+- GtkWidget * gHScale;
+- GtkWidget * gVScale;
++ GtkWidget * gBtnWidget;
++ GtkWidget * gRadioWidget;
++ GtkWidget * gRadioWidgetSibling;
++ GtkWidget * gCheckWidget;
++ GtkWidget * gScrollHorizWidget;
++ GtkWidget * gScrollVertWidget;
++ GtkWidget * gArrowWidget;
++ GtkWidget * gDropdownWidget;
++ GtkWidget * gEditBoxWidget;
++ GtkWidget * gSpinButtonWidget;
++ GtkWidget * gNotebookWidget;
++ GtkWidget * gComboBoxEntryWidget;
++ GtkWidget * gComboBoxEntry_EntryWidget;
++ GtkWidget * gComboBoxEntry_ButtonWidget;
++ GtkWidget * gComboBoxEntry_ArrowWidget;
++ GtkWidget * gComboBoxWidget;
++ GtkWidget * gComboBox_ButtonWidget;
++ GtkWidget * gComboBox_SeparatorWidget;
++ GtkWidget * gComboBox_ArrowWidget;
++ GtkWidget * gScrolledWindowWidget;
++ GtkWidget * gToolbarWidget;
++ GtkWidget * gToolbarButtonWidget;
++ GtkWidget * gToolbarToggleWidget;
++ GtkWidget * gHandleBoxWidget;
++ GtkWidget * gMenubarWidget;
++ GtkWidget * gMenuItemMenubarWidget;
++ GtkWidget * gMenuWidget;
++ GtkWidget * gMenuItemMenuWidget;
++ GtkWidget * gMenuItemCheckMenuWidget;
++ GtkWidget * gMenuItemRadioMenuWidget;
++ GtkWidget * gImageMenuItem;
++ GtkWidget * gTooltipPopup;
++ GtkWidget * gProgressBar;
++ GtkWidget * gTreeView;
++ GtkWidget * gHScale;
++ GtkWidget * gVScale;
+
+ NWPixmapCacheList* gNWPixmapCacheList;
+ NWPixmapCache* gCacheTabItems;
+@@ -120,8 +126,14 @@
+ gEditBoxWidget( NULL ),
+ gSpinButtonWidget( NULL ),
+ gNotebookWidget( NULL ),
+- gOptionMenuWidget( NULL ),
+- gComboWidget( NULL ),
++ gComboBoxEntryWidget( NULL ),
++ gComboBoxEntry_EntryWidget( NULL ),
++ gComboBoxEntry_ButtonWidget( NULL ),
++ gComboBoxEntry_ArrowWidget( NULL ),
++ gComboBoxWidget( NULL ),
++ gComboBox_ButtonWidget( NULL ),
++ gComboBox_SeparatorWidget( NULL ),
++ gComboBox_ArrowWidget( NULL ),
+ gScrolledWindowWidget( NULL ),
+ gToolbarWidget( NULL ),
+ gToolbarButtonWidget( NULL ),
+@@ -148,29 +160,29 @@
+ // Keep a hash table of Widgets->default flags so that we can
+ // easily and quickly reset each to a default state before using
+ // them
+-static std::hash_map<long, guint> gWidgetDefaultFlags;
++static std::hash_map<long, guint> gWidgetDefaultFlags;
+ static std::vector<NWFWidgetData> gWidgetData;
+
+-static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
++static const GtkBorder aDefDefBorder = { 1, 1, 1, 1 };
+
+ // Some GTK defaults
+-#define MIN_ARROW_SIZE 11
+-#define BTN_CHILD_SPACING 1
+-#define MIN_SPIN_ARROW_WIDTH 6
+-
+-
+-static void NWEnsureGTKRadio ( int nScreen );
+-static void NWEnsureGTKButton ( int nScreen );
+-static void NWEnsureGTKCheck ( int nScreen );
+-static void NWEnsureGTKScrollbars ( int nScreen );
+-static void NWEnsureGTKArrow ( int nScreen );
+-static void NWEnsureGTKEditBox ( int nScreen );
+-static void NWEnsureGTKSpinButton ( int nScreen );
+-static void NWEnsureGTKNotebook ( int nScreen );
+-static void NWEnsureGTKOptionMenu ( int nScreen );
+-static void NWEnsureGTKCombo ( int nScreen );
+-static void NWEnsureGTKScrolledWindow ( int nScreen );
+-static void NWEnsureGTKToolbar ( int nScreen );
++#define MIN_ARROW_SIZE 11
++#define BTN_CHILD_SPACING 1
++#define MIN_SPIN_ARROW_WIDTH 6
++
++
++static void NWEnsureGTKRadio ( int nScreen );
++static void NWEnsureGTKButton ( int nScreen );
++static void NWEnsureGTKCheck ( int nScreen );
++static void NWEnsureGTKScrollbars ( int nScreen );
++static void NWEnsureGTKArrow ( int nScreen );
++static void NWEnsureGTKEditBox ( int nScreen );
++static void NWEnsureGTKSpinButton ( int nScreen );
++static void NWEnsureGTKNotebook ( int nScreen );
++static void NWEnsureGTKComboBoxEntry ( int nScreen );
++static void NWEnsureGTKComboBox ( int nScreen );
++static void NWEnsureGTKScrolledWindow ( int nScreen );
++static void NWEnsureGTKToolbar ( int nScreen );
+ static void NWEnsureGTKMenubar ( int nScreen );
+ static void NWEnsureGTKMenu ( int nScreen );
+ static void NWEnsureGTKTooltip ( int nScreen );
+@@ -210,14 +222,10 @@
+ ControlState nState, const ImplControlValue& aValue,
+ const OUString& rCaption );
+ //---
+-static Rectangle NWGetComboBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
++static Rectangle NWGetComboBoxEntryButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
+ const ImplControlValue& aValue, const OUString& rCaption );
+
+-//---
+-static Rectangle NWGetListBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
+- const ImplControlValue& aValue, const OUString& rCaption );
+-
+-static Rectangle NWGetListBoxIndicatorRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
++static Rectangle NWGetComboBoxButtonRect( int nScreen, ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
+ const ImplControlValue& aValue, const OUString& rCaption );
+
+ static Rectangle NWGetToolbarRect( int nScreen,
+@@ -229,7 +237,7 @@
+ const OUString& rCaption );
+ //---
+
+-static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
++static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect );
+ //---
+
+ /*********************************************************
+@@ -298,7 +306,6 @@
+ g_object_ref( m_pixmap );
+ }
+
+-
+ NWPixmapCache::NWPixmapCache( int nScreen )
+ {
+ m_idx = 0;
+@@ -308,25 +315,25 @@
+ if( gWidgetData[m_screen].gNWPixmapCacheList )
+ gWidgetData[m_screen].gNWPixmapCacheList->AddCache(this);
+ }
++
+ NWPixmapCache::~NWPixmapCache()
+ {
+ if( gWidgetData[m_screen].gNWPixmapCacheList )
+ gWidgetData[m_screen].gNWPixmapCacheList->RemoveCache(this);
+ delete[] pData;
+ }
++
+ void NWPixmapCache::ThemeChanged()
+ {
+ // throw away cached pixmaps
+- int i;
+- for(i=0; i<m_size; i++)
++ for(int i=0; i<m_size; i++)
+ pData[i].SetPixmap( NULL );
+ }
+
+-BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
++BOOL NWPixmapCache::Find( ControlType aType, ControlState aState, const Rectangle& r_pixmapRect, GdkPixmap** pPixmap )
+ {
+ aState &= ~CTRL_CACHING_ALLOWED; // mask clipping flag
+- int i;
+- for(i=0; i<m_size; i++)
++ for(int i=0; i<m_size; i++)
+ {
+ if( pData[i].m_nType == aType &&
+ pData[i].m_nState == aState &&
+@@ -354,11 +361,11 @@
+ pData[m_idx].SetPixmap( pPixmap );
+ }
+
+-
+ void NWPixmapCacheList::AddCache( NWPixmapCache* pCache )
+ {
+ mCaches.push_back( pCache );
+ }
++
+ void NWPixmapCacheList::RemoveCache( NWPixmapCache* pCache )
+ {
+ ::std::vector< NWPixmapCache* >::iterator p;
+@@ -366,6 +373,7 @@
+ if( p != mCaches.end() )
+ mCaches.erase( p );
+ }
++
+ void NWPixmapCacheList::ThemeChanged( )
+ {
+ ::std::vector< NWPixmapCache* >::iterator p = mCaches.begin();
+@@ -382,10 +390,10 @@
+ *********************************************************/
+ inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc )
+ {
+- aDst.left = pSrc->left;
+- aDst.top = pSrc->top;
+- aDst.right = pSrc->right;
+- aDst.bottom = pSrc->bottom;
++ aDst.left = pSrc->left;
++ aDst.top = pSrc->top;
++ aDst.right = pSrc->right;
++ aDst.bottom = pSrc->bottom;
+ }
+
+
+@@ -536,40 +544,40 @@
+ BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+ {
+ if (
+- ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
+- ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
+- ((nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL)) ||
++ ((nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
++ ((nType==CTRL_RADIOBUTTON) && (nPart==PART_ENTIRE_CONTROL)) ||
++ ((nType==CTRL_CHECKBOX) && (nPart==PART_ENTIRE_CONTROL)) ||
+ ((nType==CTRL_SCROLLBAR) &&
+ ( (nPart==PART_DRAW_BACKGROUND_HORZ)
+ || (nPart==PART_DRAW_BACKGROUND_VERT)
+ || (nPart==PART_ENTIRE_CONTROL)
+- || (nPart==HAS_THREE_BUTTONS) ) ) ||
++ || (nPart==HAS_THREE_BUTTONS) ) ) ||
+ ((nType==CTRL_EDITBOX) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
++ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ ((nType==CTRL_MULTILINE_EDITBOX) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
++ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ ((nType==CTRL_SPINBOX) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+ || (nPart==PART_ALL_BUTTONS)
+- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
++ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ ((nType==CTRL_SPINBUTTONS) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+- || (nPart==PART_ALL_BUTTONS) ) ) ||
++ || (nPart==PART_ALL_BUTTONS) ) ) ||
+ ((nType==CTRL_COMBOBOX) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
++ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ (((nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) ||
+ (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER)) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+- || (nPart==PART_TABS_DRAW_RTL) ) ) ||
++ || (nPart==PART_TABS_DRAW_RTL) ) ) ||
+ ((nType==CTRL_LISTBOX) &&
+ ( (nPart==PART_ENTIRE_CONTROL)
+ || (nPart==PART_WINDOW)
+- || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
++ || (nPart==HAS_BACKGROUND_TEXTURE) ) ) ||
+ ((nType == CTRL_TOOLBAR) &&
+- ( (nPart==PART_ENTIRE_CONTROL)
++ ( (nPart==PART_ENTIRE_CONTROL)
+ || (nPart==PART_DRAW_BACKGROUND_HORZ)
+ || (nPart==PART_DRAW_BACKGROUND_VERT)
+ || (nPart==PART_THUMB_HORZ)
+@@ -638,7 +646,7 @@
+ gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward,
+ "has-secondary-forward-stepper", &has_forward2,
+ "has-backward-stepper", &has_backward,
+- "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
++ "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
+ Rectangle aForward;
+ Rectangle aBackward;
+
+@@ -738,7 +746,7 @@
+ return drawNativeMixedStateCheck( nType, nPart, rControlRegion, nState, aValue, rCaption );
+ }
+
+- BOOL returnVal = FALSE;
++ BOOL returnVal = FALSE;
+ // get a GC with current clipping region set
+ SelectFont();
+
+@@ -828,12 +836,9 @@
+ {
+ returnVal = NWPaintGTKSpinBox( nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
+ }
+- else if ( (nType == CTRL_COMBOBOX) &&
+- ( (nPart==PART_ENTIRE_CONTROL)
+- ||(nPart==PART_BUTTON_DOWN)
+- ) )
++ else if ( (nType == CTRL_COMBOBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_BUTTON_DOWN)) )
+ {
+- returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
++ returnVal = NWPaintGTKComboBoxEntry( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
+ }
+ else if ( (nType==CTRL_TAB_ITEM) || (nType==CTRL_TAB_PANE) || (nType==CTRL_TAB_BODY) || (nType==CTRL_FIXEDBORDER) )
+ {
+@@ -844,7 +849,7 @@
+ }
+ else if ( (nType==CTRL_LISTBOX) && ((nPart==PART_ENTIRE_CONTROL) || (nPart==PART_WINDOW)) )
+ {
+- returnVal = NWPaintGTKListBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
++ returnVal = NWPaintGTKComboBox( gdkDrawable, nType, nPart, aCtrlRect, aClip, nState, aValue, rCaption );
+ }
+ else if ( (nType== CTRL_TOOLBAR) )
+ {
+@@ -1001,7 +1006,7 @@
+ }
+ if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
+ {
+- rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
++ rNativeBoundingRegion = NWGetComboBoxEntryButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
+ aValue, rCaption );
+ rNativeContentRegion = rNativeBoundingRegion;
+
+@@ -1018,7 +1023,7 @@
+ }
+ if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
+ {
+- rNativeBoundingRegion = NWGetListBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
++ rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
+ aValue, rCaption );
+ rNativeContentRegion = rNativeBoundingRegion;
+
+@@ -1148,16 +1153,16 @@
+ ControlState nState, const ImplControlValue&,
+ const OUString& )
+ {
+- GtkStateType stateType;
+- GtkShadowType shadowType;
+- gboolean interiorFocus;
+- gint focusWidth;
+- gint focusPad;
+- BOOL bDrawFocus = TRUE;
+- gint x, y, w, h;
+- GtkBorder aDefBorder;
+- GtkBorder* pBorder;
+- GdkRectangle clipRect;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
++ gboolean interiorFocus;
++ gint focusWidth;
++ gint focusPad;
++ BOOL bDrawFocus = TRUE;
++ gint x, y, w, h;
++ GtkBorder aDefBorder;
++ GtkBorder* pBorder;
++ GdkRectangle clipRect;
+
+ NWEnsureGTKButton( m_nScreen );
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+@@ -1168,10 +1173,10 @@
+ h = rControlRectangle.GetHeight();
+
+ // Grab some button style attributes
+- gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth,
+- "focus-padding", &focusPad,
+- "interior_focus", &interiorFocus,
+- "default_border", &pBorder,
++ gtk_widget_style_get( gWidgetData[m_nScreen].gBtnWidget, "focus-line-width", &focusWidth,
++ "focus-padding", &focusPad,
++ "interior_focus", &interiorFocus,
++ "default_border", &pBorder,
+ (char *)NULL );
+
+ // Make sure the border values exist, otherwise use some defaults
+@@ -1261,21 +1266,21 @@
+ ControlType, ControlPart, Rectangle aAreaRect, ControlState nState,
+ const ImplControlValue&, const OUString& )
+ {
+- gboolean interiorFocus;
+- gint focusWidth;
+- gint focusPad;
+- GtkBorder aDefBorder;
+- GtkBorder * pBorder;
+- BOOL bDrawFocus = TRUE;
+- Rectangle aRect;
+- gint x, y, w, h;
++ gboolean interiorFocus;
++ gint focusWidth;
++ gint focusPad;
++ GtkBorder aDefBorder;
++ GtkBorder * pBorder;
++ BOOL bDrawFocus = TRUE;
++ Rectangle aRect;
++ gint x, y, w, h;
+
+ NWEnsureGTKButton( nScreen );
+ gtk_widget_style_get( gWidgetData[nScreen].gBtnWidget,
+- "focus-line-width", &focusWidth,
+- "focus-padding", &focusPad,
+- "interior_focus", &interiorFocus,
+- "default_border", &pBorder,
++ "focus-line-width", &focusWidth,
++ "focus-padding", &focusPad,
++ "interior_focus", &interiorFocus,
++ "default_border", &pBorder,
+ (char *)NULL );
+
+ // Make sure the border values exist, otherwise use some defaults
+@@ -1318,11 +1323,11 @@
+ const ImplControlValue& aValue,
+ const OUString& )
+ {
+- GtkStateType stateType;
+- GtkShadowType shadowType;
+- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
++ GtkStateType stateType;
++ GtkShadowType shadowType;
++ BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON);
+ gint x, y;
+- GdkRectangle clipRect;
++ GdkRectangle clipRect;
+
+ NWEnsureGTKButton( m_nScreen );
+ NWEnsureGTKRadio( m_nScreen );
+@@ -1376,11 +1381,11 @@
+ const ImplControlValue& aValue,
+ const OUString& )
+ {
+- GtkStateType stateType;
+- GtkShadowType shadowType;
+- BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
+- GdkRectangle clipRect;
+- gint x,y;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
++ BOOL isChecked = (aValue.getTristateVal()==BUTTONVALUE_ON) ? TRUE : FALSE;
++ GdkRectangle clipRect;
++ gint x,y;
+
+ NWEnsureGTKButton( m_nScreen );
+ NWEnsureGTKCheck( m_nScreen );
+@@ -1497,7 +1502,7 @@
+ gtk_widget_style_get( gWidgetData[m_nScreen].gScrollHorizWidget, "has-forward-stepper", &has_forward,
+ "has-secondary-forward-stepper", &has_forward2,
+ "has-backward-stepper", &has_backward,
+- "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
++ "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
+ gint magic = trough_border ? 1 : 0;
+ gint nFirst = 0;
+
+@@ -1677,7 +1682,7 @@
+ if ( has_backward )
+ {
+ NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
+- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
++ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ gtk_paint_box( style, gdkDrawable, stateType, shadowType,
+ gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
+ x+hShim+button11BoundRect.Left(), y+vShim+button11BoundRect.Top(),
+@@ -1692,7 +1697,7 @@
+ if ( has_forward2 )
+ {
+ NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
+- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
++ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ gtk_paint_box( style, gdkDrawable, stateType, shadowType,
+ gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
+ x+hShim+button12BoundRect.Left(), y+vShim+button12BoundRect.Top(),
+@@ -1708,7 +1713,7 @@
+ if ( has_backward2 )
+ {
+ NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
+- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
++ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
+ GTK_WIDGET(scrollbarWidget), "stepper",
+ x+hShim+button21BoundRect.Left(), y+vShim+button21BoundRect.Top(),
+@@ -1723,7 +1728,7 @@
+ if ( has_forward )
+ {
+ NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
+- if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
++ if ( stateType == GTK_STATE_INSENSITIVE ) stateType = GTK_STATE_NORMAL;
+ gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
+ GTK_WIDGET(scrollbarWidget), "stepper",
+ x+hShim+button22BoundRect.Left(), y+vShim+button22BoundRect.Top(),
+@@ -1748,7 +1753,7 @@
+
+ //---
+
+-static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
++static Rectangle NWGetScrollButtonRect( int nScreen, ControlPart nPart, Rectangle aAreaRect )
+ {
+ gint slider_width;
+ gint stepper_size;
+@@ -1762,7 +1767,7 @@
+ "slider-width", &slider_width,
+ "stepper-size", &stepper_size,
+ "trough-border", &trough_border,
+- "stepper-spacing", &stepper_spacing, (char *)NULL );
++ "stepper-spacing", &stepper_spacing, (char *)NULL );
+
+ gboolean has_forward;
+ gboolean has_forward2;
+@@ -1773,7 +1778,7 @@
+ "has-forward-stepper", &has_forward,
+ "has-secondary-forward-stepper", &has_forward2,
+ "has-backward-stepper", &has_backward,
+- "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
++ "has-secondary-backward-stepper", &has_backward2, (char *)NULL );
+ gint buttonWidth;
+ gint buttonHeight;
+ Rectangle buttonRect;
+@@ -1839,7 +1844,7 @@
+ const ImplControlValue& aValue,
+ const OUString& rCaption )
+ {
+- Rectangle pixmapRect;
++ Rectangle pixmapRect;
+ GdkRectangle clipRect;
+
+ // Find the overall bounding rect of the buttons's drawing area,
+@@ -1872,16 +1877,16 @@
+ const ImplControlValue&,
+ const OUString& )
+ {
+- Rectangle pixmapRect = aAreaRect;
+- gboolean interiorFocus;
+- gint focusWidth;
++ Rectangle pixmapRect = aAreaRect;
++ gboolean interiorFocus;
++ gint focusWidth;
+
+ NWEnsureGTKEditBox( nScreen );
+
+ // Grab some entry style attributes
+ gtk_widget_style_get( gWidgetData[nScreen].gEditBoxWidget,
+- "focus-line-width", &focusWidth,
+- "interior-focus", &interiorFocus, (char *)NULL );
++ "focus-line-width", &focusWidth,
++ "interior-focus", &interiorFocus, (char *)NULL );
+
+ if ( !interiorFocus )
+ {
+@@ -1898,24 +1903,24 @@
+ * All coordinates should be local to the Pixmap, NOT
+ * screen/window coordinates.
+ */
+-static void NWPaintOneEditBox( int nScreen,
++static void NWPaintOneEditBox( int nScreen,
+ GdkDrawable * gdkDrawable,
+- GdkRectangle * gdkRect,
+- ControlType nType,
++ GdkRectangle * gdkRect,
++ ControlType nType,
+ ControlPart,
+- Rectangle aEditBoxRect,
+- ControlState nState,
++ Rectangle aEditBoxRect,
++ ControlState nState,
+ const ImplControlValue&,
+ const OUString& )
+ {
+- GtkStateType stateType;
+- GtkShadowType shadowType;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
+ GtkWidget *widget;
+
+ NWEnsureGTKButton( nScreen );
+ NWEnsureGTKEditBox( nScreen );
+ NWEnsureGTKSpinButton( nScreen );
+- NWEnsureGTKCombo( nScreen );
++ NWEnsureGTKComboBoxEntry( nScreen );
+ NWEnsureGTKScrolledWindow( nScreen );
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+
+@@ -1928,14 +1933,13 @@
+ case CTRL_SPINBOX:
+ widget = gWidgetData[nScreen].gSpinButtonWidget;
+ break;
+-
+ case CTRL_MULTILINE_EDITBOX:
+ widget = gWidgetData[nScreen].gScrolledWindowWidget;
+ break;
++ case CTRL_LISTBOX:
+ case CTRL_COMBOBOX:
+- widget = GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry;
++ widget = gWidgetData[nScreen].gComboBoxEntry_EntryWidget;
+ break;
+-
+ default:
+ widget = gWidgetData[nScreen].gEditBoxWidget;
+ break;
+@@ -2067,14 +2071,14 @@
+
+ static Rectangle NWGetSpinButtonRect( int nScreen,
+ ControlType,
+- ControlPart nPart,
+- Rectangle aAreaRect,
++ ControlPart nPart,
++ Rectangle aAreaRect,
+ ControlState,
+ const ImplControlValue&,
+ const OUString& )
+ {
+- gint buttonSize;
+- Rectangle buttonRect;
++ gint buttonSize;
++ Rectangle buttonRect;
+
+ NWEnsureGTKSpinButton( nScreen );
+
+@@ -2151,7 +2155,9 @@
+
+ //-------------------------------------
+
+-BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
++#define ARROW_EXTENT 0.7
++
++BOOL GtkSalGraphics::NWPaintGTKComboBoxEntry( GdkDrawable* gdkDrawable,
+ ControlType nType, ControlPart nPart,
+ const Rectangle& rControlRectangle,
+ const clipList& rClipList,
+@@ -2159,17 +2165,16 @@
+ const ImplControlValue& aValue,
+ const OUString& rCaption )
+ {
+- Rectangle pixmapRect;
+- Rectangle buttonRect;
+- GtkStateType stateType;
+- GtkShadowType shadowType;
+- Rectangle arrowRect;
+- gint x,y;
+- GdkRectangle clipRect;
++ Rectangle pixmapRect;
++ Rectangle buttonRect;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
++ Rectangle arrowRect;
++ gint x,y;
++ GdkRectangle clipRect;
+
+ NWEnsureGTKButton( m_nScreen );
+- NWEnsureGTKArrow( m_nScreen );
+- NWEnsureGTKCombo( m_nScreen );
++ NWEnsureGTKComboBoxEntry( m_nScreen );
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+
+ // Find the overall bounding rect of the buttons's drawing area,
+@@ -2179,17 +2184,15 @@
+ y = rControlRectangle.Top();
+
+ NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
+- NWSetWidgetState( gWidgetData[m_nScreen].gComboWidget, nState, stateType );
+- NWSetWidgetState( gWidgetData[m_nScreen].gArrowWidget, nState, stateType );
++ NWSetWidgetState( gWidgetData[m_nScreen].gComboBoxEntryWidget, nState, stateType );
+
+- buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption );
++ buttonRect = NWGetComboBoxEntryButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption );
+ if( nPart == PART_BUTTON_DOWN )
+ buttonRect.Left() += 1;
+
+- Rectangle aEditBoxRect( pixmapRect );
++ Rectangle aEditBoxRect( pixmapRect );
+ aEditBoxRect.SetSize( Size( pixmapRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) );
+
+- #define ARROW_EXTENT 0.7
+ arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT),
+ (gint)(MIN_ARROW_SIZE * ARROW_EXTENT) ) );
+ arrowRect.SetPos( Point( buttonRect.Left() + (gint)((buttonRect.GetWidth() - arrowRect.GetWidth()) / 2),
+@@ -2212,14 +2215,14 @@
+ x+(buttonRect.Left() - pixmapRect.Left()),
+ y+(buttonRect.Top() - pixmapRect.Top()),
+ buttonRect.GetWidth(), buttonRect.GetHeight() );
+- gtk_paint_box( GTK_COMBO(gWidgetData[m_nScreen].gComboWidget)->button->style, gdkDrawable, stateType, shadowType,
+- &clipRect, GTK_COMBO(gWidgetData[m_nScreen].gComboWidget)->button, "button",
++ gtk_paint_box( gWidgetData[m_nScreen].gComboBoxEntry_ButtonWidget->style, gdkDrawable, stateType, shadowType,
++ &clipRect, gWidgetData[m_nScreen].gComboBoxEntry_ButtonWidget, "button",
+ x+(buttonRect.Left() - pixmapRect.Left()),
+ y+(buttonRect.Top() - pixmapRect.Top()),
+ buttonRect.GetWidth(), buttonRect.GetHeight() );
+
+- gtk_paint_arrow( gWidgetData[m_nScreen].gArrowWidget->style, gdkDrawable, stateType, shadowType,
+- &clipRect, gWidgetData[m_nScreen].gArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
++ gtk_paint_arrow( gWidgetData[m_nScreen].gComboBoxEntry_ArrowWidget->style, gdkDrawable, stateType, shadowType,
++ &clipRect, gWidgetData[m_nScreen].gComboBoxEntry_ArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
+ x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()),
+ arrowRect.GetWidth(), arrowRect.GetHeight() );
+ }
+@@ -2227,32 +2230,147 @@
+ return( TRUE );
+ }
+
++BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
++ ControlType nType, ControlPart nPart,
++ const Rectangle& rControlRectangle,
++ const clipList& rClipList,
++ ControlState nState,
++ const ImplControlValue& aValue,
++ const OUString& rCaption )
++{
++ Rectangle pixmapRect;
++ Rectangle buttonRect;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
++ Rectangle arrowRect;
++ gint x,y;
++ GdkRectangle clipRect;
++
++ NWEnsureGTKButton( m_nScreen );
++ NWEnsureGTKComboBox( m_nScreen );
++ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
++
++ // Find the overall bounding rect of the buttons's drawing area,
++ // plus its actual draw rect excluding adornment
++ pixmapRect = rControlRectangle;
++ if ( nPart == PART_WINDOW )
++ {
++ // Make the widget a _bit_ bigger
++ pixmapRect.SetPos( Point( pixmapRect.Left() - 1,
++ pixmapRect.Top() - 1 ) );
++ pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 2,
++ pixmapRect.GetHeight() + 2 ) );
++ }
++ x = pixmapRect.Left();
++ y = pixmapRect.Top();
++
++ NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
++ NWSetWidgetState( gWidgetData[m_nScreen].gComboBoxWidget, nState, stateType );
++
++ buttonRect = NWGetComboBoxButtonRect( m_nScreen, nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rCaption );
++ if( nPart == PART_BUTTON_DOWN )
++ buttonRect.Left() += 1;
++
++ arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT),
++ (gint)(MIN_ARROW_SIZE * ARROW_EXTENT) ) );
++ arrowRect.SetPos( Point( buttonRect.Left() + (gint)((buttonRect.GetWidth() - arrowRect.GetWidth()) / 2),
++ buttonRect.Top() + (gint)((buttonRect.GetHeight() - arrowRect.GetHeight()) / 2) ) );
++
++ for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
++ {
++ clipRect.x = it->Left();
++ clipRect.y = it->Top();
++ clipRect.width = it->GetWidth();
++ clipRect.height = it->GetHeight();
++
++ if ( nPart != PART_WINDOW )
++ {
++ // Buttons must paint opaque since some themes have alpha-channel enabled buttons
++ gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
++ &clipRect, m_pWindow, "base",
++ x+(pixmapRect.Left() - pixmapRect.Left()),
++ y+(pixmapRect.Top() - pixmapRect.Top()),
++ pixmapRect.GetWidth(), pixmapRect.GetHeight() );
++
++ gtk_paint_box( gWidgetData[m_nScreen].gComboBox_ButtonWidget->style, gdkDrawable, stateType, shadowType,
++ &clipRect, gWidgetData[m_nScreen].gComboBox_ButtonWidget, "button",
++ x+(pixmapRect.Left() - pixmapRect.Left()),
++ y+(pixmapRect.Top() - pixmapRect.Top()),
++ pixmapRect.GetWidth(), pixmapRect.GetHeight() );
++
++ gtk_paint_arrow( gWidgetData[m_nScreen].gComboBox_ArrowWidget->style, gdkDrawable, stateType, shadowType,
++ &clipRect, gWidgetData[m_nScreen].gComboBox_ArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
++ x+(arrowRect.Left() - pixmapRect.Left()), y+(arrowRect.Top() - pixmapRect.Top()),
++ arrowRect.GetWidth(), arrowRect.GetHeight() );
++
++ if (gWidgetData[m_nScreen].gComboBox_SeparatorWidget)
++ {
++ gint nSeparatorWidth;
++ gboolean bWideSeparators;
++ gtk_widget_style_get(gWidgetData[m_nScreen].gComboBox_SeparatorWidget,
++ "wide-separators", &bWideSeparators,
++ "separator-width", &nSeparatorWidth,
++ NULL);
++
++ if (bWideSeparators)
++ {
++ gtk_paint_box(gWidgetData[m_nScreen].gComboBox_SeparatorWidget->style,
++ gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT,
++ &clipRect, gWidgetData[m_nScreen].gComboBox_SeparatorWidget,
++ "vseparator", x+(arrowRect.Left() - pixmapRect.Left()-nSeparatorWidth),
++ y+(arrowRect.Top() - pixmapRect.Top()), nSeparatorWidth, arrowRect.GetHeight());
++ }
++ else
++ {
++ gtk_paint_vline(gWidgetData[m_nScreen].gComboBox_SeparatorWidget->style,
++ gdkDrawable, GTK_STATE_NORMAL, &clipRect,
++ gWidgetData[m_nScreen].gComboBox_SeparatorWidget, "vseparator",
++ y+(arrowRect.Top() - pixmapRect.Top()), y+(arrowRect.Top() - pixmapRect.Top()) + arrowRect.GetHeight(),
++ x+(arrowRect.Left() - pixmapRect.Left())-
++ gWidgetData[m_nScreen].gComboBox_SeparatorWidget->style->xthickness);
++ }
++ }
++ }
++ else
++ {
++ NWEnsureGTKScrolledWindow(m_nScreen);
++
++ gtk_paint_shadow( gWidgetData[m_nScreen].gScrolledWindowWidget->style, gdkDrawable,
++ GTK_STATE_NORMAL, GTK_SHADOW_IN, &clipRect,
++ gWidgetData[m_nScreen].gScrolledWindowWidget, "scrolled_window",
++ x, y, pixmapRect.GetWidth(), pixmapRect.GetHeight() );
++ }
++ }
++
++ return( TRUE );
++}
++
+ //----
+
+-static Rectangle NWGetComboBoxButtonRect( int nScreen,
++static Rectangle NWGetComboBoxEntryButtonRect( int nScreen,
+ ControlType,
+ ControlPart nPart,
+- Rectangle aAreaRect,
++ Rectangle aAreaRect,
+ ControlState,
+ const ImplControlValue&,
+ const OUString& )
+ {
+- Rectangle aButtonRect;
+- gint nArrowWidth;
++ Rectangle aButtonRect;
++ gint nArrowWidth;
+ gint nButtonWidth;
+- gint nFocusWidth;
+- gint nFocusPad;
++ gint nFocusWidth;
++ gint nFocusPad;
+
+- NWEnsureGTKArrow( nScreen );
++ NWEnsureGTKComboBoxEntry ( nScreen );
+
+ // Grab some button style attributes
+- gtk_widget_style_get( gWidgetData[nScreen].gDropdownWidget,
+- "focus-line-width", &nFocusWidth,
+- "focus-padding", &nFocusPad, (char *)NULL );
++ gtk_widget_style_get( gWidgetData[nScreen].gComboBoxEntry_ButtonWidget,
++ "focus-line-width", &nFocusWidth,
++ "focus-padding", &nFocusPad, (char *)NULL );
+
+- nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gArrowWidget)->xpad * 2);
++ nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gComboBoxEntry_ArrowWidget)->xpad * 2);
+ nButtonWidth = nArrowWidth +
+- ((BTN_CHILD_SPACING + gWidgetData[nScreen].gDropdownWidget->style->xthickness) * 2)
++ ((BTN_CHILD_SPACING + gWidgetData[nScreen].gComboBoxEntry_ButtonWidget->style->xthickness) * 2)
+ + (2 * (nFocusWidth+nFocusPad));
+ if( nPart == PART_BUTTON_DOWN )
+ {
+@@ -2262,13 +2380,73 @@
+ }
+ else if( nPart == PART_SUB_EDIT )
+ {
+- NWEnsureGTKCombo( nScreen );
+-
+- gint adjust_x = GTK_CONTAINER(gWidgetData[nScreen].gComboWidget)->border_width +
++ gint adjust_x = GTK_CONTAINER(gWidgetData[nScreen].gComboBoxEntryWidget)->border_width +
++ nFocusWidth +
++ nFocusPad;
++ gint adjust_y = adjust_x + gWidgetData[nScreen].gComboBoxEntryWidget->style->ythickness;
++ adjust_x += gWidgetData[nScreen].gComboBoxEntryWidget->style->xthickness;
++ aButtonRect.SetSize( Size( aAreaRect.GetWidth() - nButtonWidth - 2 * adjust_x,
++ aAreaRect.GetHeight() - 2 * adjust_y ) );
++ Point aEditPos = aAreaRect.TopLeft();
++ aEditPos.X() += adjust_x;
++ aEditPos.Y() += adjust_y;
++ aButtonRect.SetPos( aEditPos );
++ }
++
++ return( aButtonRect );
++}
++
++static Rectangle NWGetComboBoxButtonRect( int nScreen,
++ ControlType,
++ ControlPart nPart,
++ Rectangle aAreaRect,
++ ControlState,
++ const ImplControlValue&,
++ const OUString& )
++{
++ Rectangle aButtonRect;
++ gint nArrowWidth;
++ gint nButtonWidth;
++ gint nFocusWidth;
++ gint nFocusPad;
++
++ NWEnsureGTKComboBox ( nScreen );
++ // Grab some button style attributes
++ gtk_widget_style_get( gWidgetData[nScreen].gComboBox_ButtonWidget,
++ "focus-line-width", &nFocusWidth,
++ "focus-padding", &nFocusPad, (char *)NULL );
++ nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gWidgetData[nScreen].gComboBox_ArrowWidget)->xpad * 2);
++
++ gint nSeparatorWidth = 0;
++ if (gWidgetData[nScreen].gComboBox_SeparatorWidget)
++ {
++ gboolean bWideSeparators;
++ gtk_widget_style_get(gWidgetData[nScreen].gComboBox_SeparatorWidget,
++ "wide-separators", &bWideSeparators,
++ "separator-width", &nSeparatorWidth,
++ NULL);
++
++ if (!bWideSeparators)
++ nSeparatorWidth = gWidgetData[nScreen].gComboBox_SeparatorWidget->style->xthickness;
++ }
++
++ nButtonWidth = nArrowWidth + nSeparatorWidth +
++ + gWidgetData[nScreen].gComboBox_ButtonWidget->style->xthickness
++ + (nFocusWidth+nFocusPad);
++
++ if( nPart == PART_BUTTON_DOWN )
++ {
++ aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) );
++ aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth,
++ aAreaRect.Top() ) );
++ }
++ else if( nPart == PART_SUB_EDIT )
++ {
++ gint adjust_x = GTK_CONTAINER(gWidgetData[nScreen].gComboBoxWidget)->border_width +
+ nFocusWidth +
+ nFocusPad;
+- gint adjust_y = adjust_x + gWidgetData[nScreen].gComboWidget->style->ythickness;
+- adjust_x += gWidgetData[nScreen].gComboWidget->style->xthickness;
++ gint adjust_y = adjust_x + gWidgetData[nScreen].gComboBoxWidget->style->ythickness;
++ adjust_x += gWidgetData[nScreen].gComboBoxWidget->style->xthickness;
+ aButtonRect.SetSize( Size( aAreaRect.GetWidth() - nButtonWidth - 2 * adjust_x,
+ aAreaRect.GetHeight() - 2 * adjust_y ) );
+ Point aEditPos = aAreaRect.TopLeft();
+@@ -2280,6 +2458,7 @@
+ return( aButtonRect );
+ }
+
++
+ //-------------------------------------
+
+
+@@ -2366,7 +2545,7 @@
+ }
+
+
+-// gtk_widget_set_state( gWidgetData[m_nScreen].gNotebookWidget, stateType );
++// gtk_widget_set_state( gWidgetData[m_nScreen].gNotebookWidget, stateType );
+
+ pixmap = gdk_pixmap_new( NULL, pixmapRect.GetWidth(), pixmapRect.GetHeight(),
+ GetX11SalData()->GetDisplay()->GetVisual( m_nScreen ).GetDepth() );
+@@ -2424,100 +2603,13 @@
+ return bSuccess;
+ }
+
+-//-------------------------------------
+-
+-BOOL GtkSalGraphics::NWPaintGTKListBox( GdkDrawable* gdkDrawable,
+- ControlType nType, ControlPart nPart,
+- const Rectangle& rControlRectangle,
+- const clipList& rClipList,
+- ControlState nState,
+- const ImplControlValue& aValue,
+- const OUString& rCaption )
++static void set_widget_orientation(GtkWidget *widget, GtkOrientation orientation)
+ {
+- Rectangle pixmapRect;
+- Rectangle widgetRect;
+- Rectangle aIndicatorRect;
+- GtkStateType stateType;
+- GtkShadowType shadowType;
+- gint bInteriorFocus;
+- gint nFocusLineWidth;
+- gint nFocusPadding;
+- gint x,y;
+- GdkRectangle clipRect;
+-
+- NWEnsureGTKButton( m_nScreen );
+- NWEnsureGTKOptionMenu( m_nScreen );
+- NWEnsureGTKScrolledWindow( m_nScreen );
+- NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+-
+- // Find the overall bounding rect of the buttons's drawing area,
+- // plus its actual draw rect excluding adornment
+- pixmapRect = rControlRectangle;
+- if ( nPart == PART_WINDOW )
+- {
+- // Make the widget a _bit_ bigger
+- pixmapRect.SetPos( Point( pixmapRect.Left() - 1,
+- pixmapRect.Top() - 1 ) );
+- pixmapRect.SetSize( Size( pixmapRect.GetWidth() + 2,
+- pixmapRect.GetHeight() + 2 ) );
+- }
+-
+- widgetRect = pixmapRect;
+- x = pixmapRect.Left();
+- y = pixmapRect.Top();
+-
+- // set up references to correct drawable and cliprect
+- NWSetWidgetState( gWidgetData[m_nScreen].gBtnWidget, nState, stateType );
+- NWSetWidgetState( gWidgetData[m_nScreen].gOptionMenuWidget, nState, stateType );
+- NWSetWidgetState( gWidgetData[m_nScreen].gScrolledWindowWidget, nState, stateType );
+-
+- if ( nPart != PART_WINDOW )
+- {
+- gtk_widget_style_get( gWidgetData[m_nScreen].gOptionMenuWidget,
+- "interior_focus", &bInteriorFocus,
+- "focus_line_width", &nFocusLineWidth,
+- "focus_padding", &nFocusPadding,
+- (char *)NULL);
+- }
+-
+- for( clipList::const_iterator it = rClipList.begin(); it != rClipList.end(); ++it )
+- {
+- clipRect.x = it->Left();
+- clipRect.y = it->Top();
+- clipRect.width = it->GetWidth();
+- clipRect.height = it->GetHeight();
+-
+- if ( nPart != PART_WINDOW )
+- {
+- // Listboxes must paint opaque since some themes have alpha-channel enabled bodies
+- gtk_paint_flat_box( gWidgetData[m_nScreen].gBtnWidget->style, gdkDrawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+- &clipRect, m_pWindow, "base", x, y,
+- pixmapRect.GetWidth(), pixmapRect.GetHeight() );
+- gtk_paint_box( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect,
+- gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenu",
+- x+(widgetRect.Left() - pixmapRect.Left()),
+- y+(widgetRect.Top() - pixmapRect.Top()),
+- widgetRect.GetWidth(), widgetRect.GetHeight() );
+- aIndicatorRect = NWGetListBoxIndicatorRect( m_nScreen, nType, nPart, widgetRect, nState,
+- aValue, rCaption );
+- gtk_paint_tab( gWidgetData[m_nScreen].gOptionMenuWidget->style, gdkDrawable, stateType, shadowType, &clipRect,
+- gWidgetData[m_nScreen].gOptionMenuWidget, "optionmenutab",
+- x+(aIndicatorRect.Left() - pixmapRect.Left()),
+- y+(aIndicatorRect.Top() - pixmapRect.Top()),
+- aIndicatorRect.GetWidth(), aIndicatorRect.GetHeight() );
+- }
+- else
+- {
+- shadowType = GTK_SHADOW_IN;
+-
+- gtk_paint_shadow( gWidgetData[m_nScreen].gScrolledWindowWidget->style, gdkDrawable, GTK_STATE_NORMAL, shadowType,
+- &clipRect, gWidgetData[m_nScreen].gScrolledWindowWidget, "scrolled_window",
+- x+(widgetRect.Left() - pixmapRect.Left()), y+(widgetRect.Top() - pixmapRect.Top()),
+- widgetRect.GetWidth(), widgetRect.GetHeight() );
+- }
+- }
+-
+- return( TRUE );
++#if GTK_CHECK_VERSION(2,90,0)
++ gtk_orientable_set_orientation( GTK_ORIENTABLE(widget), orientation );
++#else
++ gtk_toolbar_set_orientation( GTK_TOOLBAR(widget), orientation );
++#endif
+ }
+
+ BOOL GtkSalGraphics::NWPaintGTKToolbar(
+@@ -2528,14 +2620,14 @@
+ ControlState nState, const ImplControlValue& aValue,
+ const OUString& )
+ {
+- GtkStateType stateType;
+- GtkShadowType shadowType;
+- gint x, y, w, h;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
++ gint x, y, w, h;
+ gint g_x=0, g_y=0, g_w=10, g_h=10;
+ bool bPaintButton = true;
+ GtkWidget* pButtonWidget = gWidgetData[m_nScreen].gToolbarButtonWidget;
+ const gchar* pButtonDetail = "button";
+- GdkRectangle clipRect;
++ GdkRectangle clipRect;
+
+ NWEnsureGTKToolbar( m_nScreen );
+ if( nPart == PART_BUTTON ) // toolbar buttons cannot focus in gtk
+@@ -2557,9 +2649,9 @@
+ GTK_WIDGET_SET_FLAGS( gWidgetData[m_nScreen].gToolbarWidget, GTK_SENSITIVE );
+
+ if( nPart == PART_DRAW_BACKGROUND_HORZ )
+- gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nScreen].gToolbarWidget), GTK_ORIENTATION_HORIZONTAL );
++ set_widget_orientation( gWidgetData[m_nScreen].gToolbarWidget, GTK_ORIENTATION_HORIZONTAL );
+ else
+- gtk_toolbar_set_orientation( GTK_TOOLBAR(gWidgetData[m_nScreen].gToolbarWidget), GTK_ORIENTATION_VERTICAL );
++ set_widget_orientation( gWidgetData[m_nScreen].gToolbarWidget, GTK_ORIENTATION_VERTICAL );
+ }
+ // handle grip
+ else if( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
+@@ -2675,11 +2767,11 @@
+ ControlState nState, const ImplControlValue&,
+ const OUString& )
+ {
+- GtkStateType stateType;
+- GtkShadowType shadowType;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
+ GtkShadowType selected_shadow_type = GTK_SHADOW_OUT;
+- gint x, y, w, h;
+- GdkRectangle clipRect;
++ gint x, y, w, h;
++ GdkRectangle clipRect;
+
+ NWEnsureGTKMenubar( m_nScreen );
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+@@ -2765,11 +2857,11 @@
+ if( nPart == PART_MENU_ITEM && ! (nState & CTRL_STATE_ENABLED) )
+ return FALSE;
+
+- GtkStateType stateType;
+- GtkShadowType shadowType;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
+ GtkShadowType selected_shadow_type = GTK_SHADOW_OUT;
+- gint x, y, w, h;
+- GdkRectangle clipRect;
++ gint x, y, w, h;
++ GdkRectangle clipRect;
+
+ NWEnsureGTKMenu( m_nScreen );
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+@@ -2892,8 +2984,8 @@
+ {
+ NWEnsureGTKTooltip( m_nScreen );
+
+- gint x, y, w, h;
+- GdkRectangle clipRect;
++ gint x, y, w, h;
++ GdkRectangle clipRect;
+
+ x = rControlRectangle.Left();
+ y = rControlRectangle.Top();
+@@ -2935,12 +3027,12 @@
+ aRect.Right() += 2;
+ aRect.Top() -= 2;
+ aRect.Bottom() += 2;
+- gint w, h;
++ gint w, h;
+ w = aRect.GetWidth();
+ h = aRect.GetHeight();
+
+- GtkStateType stateType;
+- GtkShadowType shadowType;
++ GtkStateType stateType;
++ GtkShadowType shadowType;
+ NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );
+
+ ButtonValue aButtonValue = rValue.getTristateVal();
+@@ -2984,7 +3076,7 @@
+ {
+ NWEnsureGTKProgressBar( m_nScreen );
+
+- gint w, h;
++ gint w, h;
+ w = rControlRectangle.GetWidth();
+ h = rControlRectangle.GetHeight();
+
+@@ -3164,116 +3256,6 @@
+ return bRet;
+ }
+
+-//----
+-
+-static Rectangle NWGetListBoxButtonRect( int nScreen,
+- ControlType,
+- ControlPart nPart,
+- Rectangle aAreaRect,
+- ControlState,
+- const ImplControlValue&,
+- const OUString& )
+-{
+- Rectangle aPartRect;
+- GtkRequisition *pIndicatorSize = NULL;
+- GtkBorder *pIndicatorSpacing = NULL;
+- gint width = 13; // GTK+ default
+- gint right = 5; // GTK+ default
+- gint nButtonAreaWidth = 0;
+- gint xthickness = 0;
+-
+- NWEnsureGTKOptionMenu( nScreen );
+-
+- gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget,
+- "indicator_size", &pIndicatorSize,
+- "indicator_spacing",&pIndicatorSpacing, (char *)NULL);
+-
+- if ( pIndicatorSize )
+- width = pIndicatorSize->width;
+-
+- if ( pIndicatorSpacing )
+- right = pIndicatorSpacing->right;
+-
+- Size aPartSize( 0, aAreaRect.GetHeight() );
+- Point aPartPos ( 0, aAreaRect.Top() );
+-
+- xthickness = gWidgetData[nScreen].gOptionMenuWidget->style->xthickness;
+- nButtonAreaWidth = width + right + (xthickness * 2);
+- switch( nPart )
+- {
+- case PART_BUTTON_DOWN:
+- aPartSize.Width() = nButtonAreaWidth;
+- aPartPos.X() = aAreaRect.Left() + aAreaRect.GetWidth() - aPartSize.Width();
+- break;
+-
+- case PART_SUB_EDIT:
+- aPartSize.Width() = aAreaRect.GetWidth() - nButtonAreaWidth - xthickness;
+- aPartPos.X() = aAreaRect.Left() + xthickness;
+- break;
+-
+- default:
+- aPartSize.Width() = aAreaRect.GetWidth();
+- aPartPos.X() = aAreaRect.Left();
+- break;
+- }
+- aPartRect = Rectangle( aPartPos, aPartSize );
+-
+- if ( pIndicatorSize )
+- gtk_requisition_free( pIndicatorSize );
+- if ( pIndicatorSpacing )
+- gtk_border_free( pIndicatorSpacing );
+-
+- return( aPartRect );
+-}
+-
+-//----
+-
+-static Rectangle NWGetListBoxIndicatorRect( int nScreen,
+- ControlType,
+- ControlPart,
+- Rectangle aAreaRect,
+- ControlState,
+- const ImplControlValue&,
+- const OUString& )
+-{
+- Rectangle aIndicatorRect;
+- GtkRequisition *pIndicatorSize = NULL;
+- GtkBorder *pIndicatorSpacing = NULL;
+- gint width = 13; // GTK+ default
+- gint height = 13; // GTK+ default
+- gint right = 5; // GTK+ default
+-
+- NWEnsureGTKOptionMenu( nScreen );
+-
+- gtk_widget_style_get( gWidgetData[nScreen].gOptionMenuWidget,
+- "indicator_size", &pIndicatorSize,
+- "indicator_spacing",&pIndicatorSpacing, (char *)NULL);
+-
+- if ( pIndicatorSize )
+- {
+- width = pIndicatorSize->width;
+- height = pIndicatorSize->height;
+- }
+-
+- if ( pIndicatorSpacing )
+- right = pIndicatorSpacing->right;
+-
+- aIndicatorRect.SetSize( Size( width, height ) );
+- aIndicatorRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - width - right - gWidgetData[nScreen].gOptionMenuWidget->style->xthickness,
+- aAreaRect.Top() + ((aAreaRect.GetHeight() - height) / 2) ) );
+-
+- // If height is odd, move the indicator down 1 pixel
+- if ( aIndicatorRect.GetHeight() % 2 )
+- aIndicatorRect.Move( 0, 1 );
+-
+- if ( pIndicatorSize )
+- gtk_requisition_free( pIndicatorSize );
+- if ( pIndicatorSpacing )
+- gtk_border_free( pIndicatorSpacing );
+-
+- return( aIndicatorRect );
+-}
+-
+ static Rectangle NWGetToolbarRect( int nScreen,
+ ControlType,
+ ControlPart nPart,
+@@ -3495,10 +3477,10 @@
+ aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
+
+ // UI font
+- OString aFamily = pango_font_description_get_family( pStyle->font_desc );
+- int nPangoHeight = pango_font_description_get_size( pStyle->font_desc );
+- PangoStyle eStyle = pango_font_description_get_style( pStyle->font_desc );
+- PangoWeight eWeight = pango_font_description_get_weight( pStyle->font_desc );
++ OString aFamily = pango_font_description_get_family( pStyle->font_desc );
++ int nPangoHeight = pango_font_description_get_size( pStyle->font_desc );
++ PangoStyle eStyle = pango_font_description_get_style( pStyle->font_desc );
++ PangoWeight eWeight = pango_font_description_get_weight( pStyle->font_desc );
+ PangoStretch eStretch = pango_font_description_get_stretch( pStyle->font_desc );
+
+ psp::FastPrintFontInfo aInfo;
+@@ -3507,9 +3489,9 @@
+ // set italic
+ switch( eStyle )
+ {
+- case PANGO_STYLE_NORMAL: aInfo.m_eItalic = psp::italic::Upright;break;
+- case PANGO_STYLE_ITALIC: aInfo.m_eItalic = psp::italic::Italic;break;
+- case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = psp::italic::Oblique;break;
++ case PANGO_STYLE_NORMAL: aInfo.m_eItalic = psp::italic::Upright;break;
++ case PANGO_STYLE_ITALIC: aInfo.m_eItalic = psp::italic::Italic;break;
++ case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = psp::italic::Oblique;break;
+ }
+ // set weight
+ if( eWeight <= PANGO_WEIGHT_ULTRALIGHT )
+@@ -3525,15 +3507,15 @@
+ // set width
+ switch( eStretch )
+ {
+- case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = psp::width::UltraCondensed;break;
+- case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = psp::width::ExtraCondensed;break;
+- case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = psp::width::Condensed;break;
+- case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = psp::width::SemiCondensed;break;
+- case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = psp::width::Normal;break;
+- case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = psp::width::SemiExpanded;break;
+- case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = psp::width::Expanded;break;
+- case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = psp::width::ExtraExpanded;break;
+- case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = psp::width::UltraExpanded;break;
++ case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = psp::width::UltraCondensed;break;
++ case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = psp::width::ExtraCondensed;break;
++ case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = psp::width::Condensed;break;
++ case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = psp::width::SemiCondensed;break;
++ case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = psp::width::Normal;break;
++ case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = psp::width::SemiExpanded;break;
++ case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = psp::width::Expanded;break;
++ case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = psp::width::ExtraExpanded;break;
++ case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = psp::width::UltraExpanded;break;
+ }
+
+ #if OSL_DEBUG_LEVEL > 1
+@@ -3629,7 +3611,7 @@
+ g_free( pIconThemeName );
+
+ // FIXME: need some way of fetching toolbar icon size.
+-// aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_SMALL );
++// aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_SMALL );
+
+ const cairo_font_options_t* pNewOptions = NULL;
+ if( GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ) )
+@@ -3700,8 +3682,8 @@
+ GdkPixmap* GtkSalGraphics::NWGetPixmapFromScreen( Rectangle srcRect )
+ {
+ // Create a new pixmap to hold the composite of the window background and the control
+- GdkPixmap * pPixmap = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
+- GdkGC * pPixmapGC = gdk_gc_new( pPixmap );
++ GdkPixmap * pPixmap = gdk_pixmap_new( GDK_DRAWABLE(GetGdkWindow()), srcRect.GetWidth(), srcRect.GetHeight(), -1 );
++ GdkGC * pPixmapGC = gdk_gc_new( pPixmap );
+
+ if( !pPixmap || !pPixmapGC )
+ {
+@@ -3902,7 +3884,7 @@
+ NWAddWidgetToCacheWindow( gWidgetData[nScreen].gDropdownWidget, nScreen );
+ gWidgetData[nScreen].gArrowWidget = gtk_arrow_new( GTK_ARROW_DOWN, GTK_SHADOW_OUT );
+ gtk_container_add( GTK_CONTAINER(gWidgetData[nScreen].gDropdownWidget), gWidgetData[nScreen].gArrowWidget );
+- gtk_widget_set_rc_style( gWidgetData[nScreen].gArrowWidget );
++ gtk_widget_set_style( gWidgetData[nScreen].gArrowWidget, NULL );
+ gtk_widget_realize( gWidgetData[nScreen].gArrowWidget );
+ }
+ }
+@@ -3948,32 +3930,132 @@
+
+ //-------------------------------------
+
+-static void NWEnsureGTKOptionMenu( int nScreen )
++G_BEGIN_DECLS
++static void get_combo_box_entry_inner_widgets(GtkWidget *widget, gpointer client_data);
++static void get_combo_box_entry_arrow(GtkWidget *widget, gpointer client_data);
++static void get_combo_box_inner_widgets(GtkWidget *widget, gpointer client_data);
++G_END_DECLS
++
++static void get_combo_box_entry_inner_widgets(GtkWidget *widget, gpointer client_data)
++{
++ int nScreen = GPOINTER_TO_INT(client_data);
++ if (GTK_IS_TOGGLE_BUTTON(widget))
++ gWidgetData[nScreen].gComboBoxEntry_ButtonWidget = widget;
++ else if (GTK_IS_ENTRY(widget))
++ {
++ // #i59129# Setting non-editable means it doesn't blink, so
++ // there are no timeouts running around to nobble us
++ gtk_editable_set_editable(GTK_EDITABLE(widget), false);
++ gWidgetData[nScreen].gComboBoxEntry_EntryWidget = widget;
++ }
++ else
++ return;
++ gtk_widget_realize(widget);
++}
++
++static void get_combo_box_entry_arrow(GtkWidget *widget, gpointer client_data)
+ {
+- if ( !gWidgetData[nScreen].gOptionMenuWidget )
++ if (GTK_IS_ARROW(widget))
+ {
+- gWidgetData[nScreen].gOptionMenuWidget = gtk_option_menu_new();
+- NWAddWidgetToCacheWindow( gWidgetData[nScreen].gOptionMenuWidget, nScreen );
++ int nScreen = GPOINTER_TO_INT(client_data);
++ gWidgetData[nScreen].gComboBoxEntry_ArrowWidget = widget;
++ gtk_widget_realize(widget);
+ }
+ }
+
+-//-------------------------------------
++static void NWEnsureGTKComboBoxEntry( int nScreen )
++{
++ if ( !gWidgetData[nScreen].gComboBoxEntryWidget )
++ {
++ gWidgetData[nScreen].gComboBoxEntryWidget = gtk_combo_box_entry_new();
++
++ NWAddWidgetToCacheWindow( gWidgetData[nScreen].gComboBoxEntryWidget, nScreen );
++
++ gtk_container_forall(GTK_CONTAINER(gWidgetData[nScreen].gComboBoxEntryWidget),
++ get_combo_box_entry_inner_widgets, GINT_TO_POINTER(nScreen) );
+
+-static void NWEnsureGTKCombo( int nScreen )
++ //If for some reason or other we couldn't find the expected children,
++ //alias them to some we know will definitely exist
++ if (!gWidgetData[nScreen].gComboBoxEntry_EntryWidget)
++ {
++ NWEnsureGTKEditBox( nScreen );
++ gWidgetData[nScreen].gComboBoxEntry_EntryWidget = gWidgetData[nScreen].gEditBoxWidget;
++ }
++ if (gWidgetData[nScreen].gComboBoxEntry_ButtonWidget)
++ {
++ //Dig around for the arrow
++ GtkWidget *child = GTK_BIN(gWidgetData[nScreen].gComboBoxEntry_ButtonWidget)->child;
++ if (GTK_IS_HBOX(child))
++ {
++ gtk_container_forall(GTK_CONTAINER(child), get_combo_box_entry_arrow,
++ GINT_TO_POINTER(nScreen) );
++ }
++ else
++ get_combo_box_entry_arrow(child, GINT_TO_POINTER(nScreen));
++ }
++ else
++ {
++ NWEnsureGTKArrow( nScreen );
++ gWidgetData[nScreen].gComboBoxEntry_ButtonWidget = gWidgetData[nScreen].gDropdownWidget;
++ }
++ if (!gWidgetData[nScreen].gComboBoxEntry_ArrowWidget)
++ {
++ NWEnsureGTKArrow( nScreen );
++ gWidgetData[nScreen].gComboBoxEntry_ArrowWidget = gWidgetData[nScreen].gArrowWidget;
++ }
++ }
++}
++
++static void get_combo_box_inner_widgets(GtkWidget *widget, gpointer client_data)
++{
++ int nScreen = GPOINTER_TO_INT(client_data);
++ if (GTK_IS_TOGGLE_BUTTON(widget))
++ gWidgetData[nScreen].gComboBox_ButtonWidget = widget;
++ else if (GTK_IS_SEPARATOR(widget))
++ gWidgetData[nScreen].gComboBox_SeparatorWidget = widget;
++ else if (GTK_IS_ARROW(widget))
++ gWidgetData[nScreen].gComboBox_ArrowWidget = widget;
++ else
++ return;
++ gtk_widget_realize(widget);
++}
++
++static void NWEnsureGTKComboBox( int nScreen )
+ {
+- if ( !gWidgetData[nScreen].gComboWidget )
++ if ( !gWidgetData[nScreen].gComboBoxWidget )
+ {
+- gWidgetData[nScreen].gComboWidget = gtk_combo_new();
++ gWidgetData[nScreen].gComboBoxWidget = gtk_combo_box_new();
+
+- // #i59129# Setting non-editable means it doesn't blink, so
+- // there are no timeouts running around to nobble us
+- gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry), false);
++ NWAddWidgetToCacheWindow( gWidgetData[nScreen].gComboBoxWidget, nScreen );
++
++ gtk_container_forall(GTK_CONTAINER(gWidgetData[nScreen].gComboBoxWidget),
++ get_combo_box_inner_widgets, GINT_TO_POINTER(nScreen) );
+
+- NWAddWidgetToCacheWindow( gWidgetData[nScreen].gComboWidget, nScreen );
+- // Must realize the ComboBox's children, since GTK
+- // does not do this for us in GtkCombo::gtk_widget_realize()
+- gtk_widget_realize( GTK_COMBO(gWidgetData[nScreen].gComboWidget)->button );
+- gtk_widget_realize( GTK_COMBO(gWidgetData[nScreen].gComboWidget)->entry );
++ //If for some reason or other we couldn't find the expected children,
++ //alias them to some we know will definitely exist
++ if (gWidgetData[nScreen].gComboBox_ButtonWidget)
++ {
++ //Dig around for the arrow
++ GtkWidget *child = GTK_BIN(gWidgetData[nScreen].gComboBox_ButtonWidget)->child;
++ if (GTK_IS_HBOX(child))
++ {
++ gtk_container_forall(GTK_CONTAINER(child), get_combo_box_inner_widgets,
++ GINT_TO_POINTER(nScreen) );
++ }
++ else
++ get_combo_box_inner_widgets(child, GINT_TO_POINTER(nScreen));
++ }
++ else
++ {
++ NWEnsureGTKArrow( nScreen );
++ gWidgetData[nScreen].gComboBox_ButtonWidget = gWidgetData[nScreen].gDropdownWidget;
++ }
++
++ if (!gWidgetData[nScreen].gComboBox_ArrowWidget)
++ {
++ NWEnsureGTKArrow( nScreen );
++ gWidgetData[nScreen].gComboBox_ArrowWidget = gWidgetData[nScreen].gArrowWidget;
++ }
+ }
+ }
+
+@@ -4130,3 +4212,5 @@
+ NWAddWidgetToCacheWindow( gWidgetData[nScreen].gVScale, nScreen );
+ }
+ }
++
++/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+--- vcl.orig/unx/gtk/window/gtkobject.cxx 2010-05-26 17:30:44.000000000 +0100
++++ vcl/unx/gtk/window/gtkobject.cxx 2010-07-01 10:45:41.000000000 +0100
+@@ -32,6 +32,7 @@
+ #include <plugins/gtk/gtkframe.hxx>
+ #include <plugins/gtk/gtkdata.hxx>
+ #include <plugins/gtk/gtkinst.hxx>
++#include <plugins/gtk/gtkgdi.hxx>
+
+ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, BOOL bShow )
+ : m_pSocket( NULL ),
+@@ -58,7 +59,7 @@
+ SalDisplay* pDisp = GetX11SalData()->GetDisplay();
+ m_aSystemData.nSize = sizeof( SystemChildData );
+ m_aSystemData.pDisplay = pDisp->GetDisplay();
+- m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pSocket->window);
++ m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pSocket));
+ m_aSystemData.pSalFrame = NULL;
+ m_aSystemData.pWidget = m_pSocket;
+ m_aSystemData.pVisual = pDisp->GetVisual(pParent->getScreenNumber()).GetVisual();
+@@ -66,7 +67,7 @@
+ m_aSystemData.nDepth = pDisp->GetVisual(pParent->getScreenNumber()).GetDepth();
+ m_aSystemData.aColormap = pDisp->GetColormap(pParent->getScreenNumber()).GetXColormap();
+ m_aSystemData.pAppContext = NULL;
+- m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(GTK_WIDGET(pParent->getWindow())->window);
++ m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pParent->getWindow())));
+ m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow());
+
+ g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this );
+--- fpicker.orig/source/unx/gnome/SalGtkPicker.cxx 2010-05-26 17:30:44.000000000 +0100
++++ fpicker/source/unx/gnome/SalGtkPicker.cxx 2010-07-01 12:51:05.000000000 +0100
+@@ -155,7 +157,11 @@
+ if (pParent)
+ {
+ gtk_widget_realize(mpDialog);
++#if GTK_CHECK_VERSION(2,90,0)
++ gdk_window_set_transient_for(gtk_widget_get_window(mpDialog), pParent);
++#else
+ gdk_window_set_transient_for(mpDialog->window, pParent);
++#endif
+ }
+ }
+
+--- extensions.orig/source/plugin/unx/npnapi.cxx 2010-07-01 13:42:35.000000000 +0100
++++ extensions/source/plugin/unx/npnapi.cxx 2010-07-01 13:44:46.000000000 +0100
+@@ -701,8 +701,11 @@
+ pInst->window.window = (void *)gtk_socket_get_id( GTK_SOCKET(pInst->pGtkWidget ) );
+
+ XSync( pAppDisplay, False );
+-
++#if GTK_CHECK_VERSION(2,90,0)
++ XMapWindow( pAppDisplay, GDK_WINDOW_XWINDOW(gtk_widget_get_window(pInst->pGtkWindow)) );
++#else
+ XMapWindow( pAppDisplay, GDK_WINDOW_XWINDOW(pInst->pGtkWindow->window) );
++#endif
+
+ XSync( pAppDisplay, False );
+ }
+--- vcl.orig/unx/inc/plugins/gtk/gtkdata.hxx 2010-07-07 10:20:34.000000000 +0100
++++ vcl/unx/inc/plugins/gtk/gtkdata.hxx 2010-07-07 11:15:19.000000000 +0100
+@@ -40,6 +40,39 @@
+
+ #include <list>
+
++inline GdkWindow * widget_get_window(GtkWidget *widget)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_get_window(widget);
++#else
++ return widget->window;
++#endif
++}
++
++inline void widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_set_can_focus(widget, can_focus);
++#else
++ if (can_focus)
++ GTK_WIDGET_SET_FLAGS( widget, GTK_CAN_FOCUS );
++ else
++ GTK_WIDGET_UNSET_FLAGS( widget, GTK_CAN_FOCUS );
++#endif
++}
++
++inline void widget_set_can_default(GtkWidget *widget, gboolean can_default)
++{
++#if GTK_CHECK_VERSION(2,90,0)
++ return gtk_widget_set_can_default(widget, can_default);
++#else
++ if (can_default)
++ GTK_WIDGET_SET_FLAGS( widget, GTK_CAN_DEFAULT );
++ else
++ GTK_WIDGET_UNSET_FLAGS( widget, GTK_CAN_DEFAULT );
++#endif
++}
++
+ class GtkData : public X11SalData
+ {
+ public:
+@@ -73,6 +106,8 @@
+ virtual long Dispatch( XEvent *pEvent );
+ virtual void initScreen( int nScreen ) const;
+
++ virtual int GetDefaultMonitorNumber() const;
++
+ static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event,
+ GdkEvent* event,
+ gpointer data );
diff --git a/workspace.impress195.patch b/workspace.impress195.patch
new file mode 100644
index 0000000..d08eaaf
--- /dev/null
+++ b/workspace.impress195.patch
@@ -0,0 +1,287 @@
+diff -ru sd.orig/source/ui/framework/factories/BasicViewFactory.cxx sd/source/ui/framework/factories/BasicViewFactory.cxx
+--- sd.orig/source/ui/framework/factories/BasicViewFactory.cxx 2009-05-25 09:21:53.000000000 +0100
++++ sd/source/ui/framework/factories/BasicViewFactory.cxx 2009-05-25 10:03:48.000000000 +0100
+@@ -141,8 +141,9 @@
+ mpViewShellContainer(new ViewShellContainer()),
+ mpBase(NULL),
+ mpFrameView(NULL),
++ mpWindow(new WorkWindow(NULL,WB_STDWORK)),
+ mpViewCache(new ViewCache()),
+- mxLocalPane(new Pane(Reference<XResourceId>(), new WorkWindow(NULL,WB_STDWORK)))
++ mxLocalPane(new Pane(Reference<XResourceId>(), mpWindow.get()))
+ {
+ (void)rxContext;
+ }
+diff -ru sd.orig/source/ui/framework/factories/BasicViewFactory.hxx sd/source/ui/framework/factories/BasicViewFactory.hxx
+--- sd.orig/source/ui/framework/factories/BasicViewFactory.hxx 2009-05-25 09:21:53.000000000 +0100
++++ sd/source/ui/framework/factories/BasicViewFactory.hxx 2009-05-25 11:20:23.000000000 +0100
+@@ -123,6 +123,7 @@
+ FrameView* mpFrameView;
+
+ class ViewCache;
++ ::boost::shared_ptr<Window> mpWindow;
+ ::boost::shared_ptr<ViewCache> mpViewCache;
+
+ css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
+Index: cppcanvas/source/mtfrenderer/implrenderer.cxx
+===================================================================
+--- cppcanvas/source/mtfrenderer/implrenderer.cxx (revision 276100)
++++ cppcanvas/source/mtfrenderer/implrenderer.cxx (working copy)
+@@ -43,6 +43,7 @@
+ #include <com/sun/star/rendering/TexturingMode.hpp>
+ #include <com/sun/star/uno/Sequence.hxx>
+ #include <com/sun/star/geometry/RealPoint2D.hpp>
++#include <com/sun/star/rendering/PanoseProportion.hpp>
+ #include <com/sun/star/rendering/ViewState.hpp>
+ #include <com/sun/star/rendering/RenderState.hpp>
+ #include <com/sun/star/rendering/XCanvasFont.hpp>
+@@ -850,6 +851,12 @@
+ rParms.mrParms.maFontLetterForm.isValid() ?
+ rParms.mrParms.maFontLetterForm.getValue() :
+ (rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
++ aFontRequest.FontDescription.FontDescription.Proportion =
++ rParms.mrParms.maFontProportion.isValid() ?
++ rParms.mrParms.maFontProportion.getValue() :
++ (rFont.GetPitch() == PITCH_FIXED)
++ ? rendering::PanoseProportion::MONO_SPACED
++ : rendering::PanoseProportion::ANYTHING;
+
+ LanguageType aLang = rFont.GetLanguage();
+ aFontRequest.Locale = MsLangId::convertLanguageToLocale(aLang, false);
+@@ -2967,7 +2974,8 @@
+ if( rParams.maFontName.isValid() ||
+ rParams.maFontWeight.isValid() ||
+ rParams.maFontLetterForm.isValid() ||
+- rParams.maFontUnderline.isValid() )
++ rParams.maFontUnderline.isValid() ||
++ rParams.maFontProportion.isValid() )
+ {
+ ::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
+
+Index: cppcanvas/inc/cppcanvas/renderer.hxx
+===================================================================
+--- cppcanvas/inc/cppcanvas/renderer.hxx (revision 276100)
++++ cppcanvas/inc/cppcanvas/renderer.hxx (working copy)
+@@ -139,6 +139,9 @@
+ /// Optionally forces the given font letter form (italics etc.) for all text actions
+ ::comphelper::OptionalValue< sal_Int8 > maFontLetterForm;
+
++ /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
++ ::comphelper::OptionalValue< sal_Int8 > maFontProportion;
++
+ /// Optionally forces underlining for all text actions
+ ::comphelper::OptionalValue< bool > maFontUnderline;
+ };
+Index: canvas/source/directx/dx_textlayout_drawhelper.cxx
+===================================================================
+--- canvas/source/directx/dx_textlayout_drawhelper.cxx (revision 276100)
++++ canvas/source/directx/dx_textlayout_drawhelper.cxx (working copy)
+@@ -135,6 +135,9 @@
+ aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
+ aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
++ aFont.SetPitch(
++ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
++ ? PITCH_FIXED : PITCH_VARIABLE);
+
+ aFont.SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
+
+@@ -267,6 +270,9 @@
+ aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
+ aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
+ aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
++ aFont.SetPitch(
++ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
++ ? PITCH_FIXED : PITCH_VARIABLE);
+
+ // adjust to stretched font
+ if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
+Index: canvas/source/vcl/canvasfont.cxx
+===================================================================
+--- canvas/source/vcl/canvasfont.cxx (revision 276100)
++++ canvas/source/vcl/canvasfont.cxx (working copy)
+@@ -38,6 +38,8 @@
+ #include <i18npool/mslangid.hxx>
+ #include <vcl/metric.hxx>
+
++#include <com/sun/star/rendering/PanoseProportion.hpp>
++
+ #include "canvasfont.hxx"
+ #include "textlayout.hxx"
+
+@@ -66,6 +68,9 @@
+ // TODO(F2): improve panose->vclenum conversion
+ maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
+ maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
++ maFont->SetPitch(
++ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
++ ? PITCH_FIXED : PITCH_VARIABLE);
+
+ maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
+
+Index: canvas/source/cairo/cairo_canvasfont.cxx
+===================================================================
+--- canvas/source/cairo/cairo_canvasfont.cxx (revision 276100)
++++ canvas/source/cairo/cairo_canvasfont.cxx (working copy)
+@@ -33,6 +33,8 @@
+
+ #include <canvas/debug.hxx>
+
++#include <com/sun/star/rendering/PanoseProportion.hpp>
++
+ #include <rtl/math.hxx>
+ #include <basegfx/numeric/ftools.hxx>
+
+@@ -86,6 +88,9 @@
+ // TODO(F2): improve panose->vclenum conversion
+ maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
+ maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
++ maFont->SetPitch(
++ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
++ ? PITCH_FIXED : PITCH_VARIABLE);
+
+ maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
+
+Index: drawinglayer/source/processor2d/canvasprocessor.cxx
+===================================================================
+--- drawinglayer/source/processor2d/canvasprocessor.cxx (revision 276100)
++++ drawinglayer/source/processor2d/canvasprocessor.cxx (working copy)
+@@ -57,6 +57,7 @@
+ #include <basegfx/tuple/b2i64tuple.hxx>
+ #include <basegfx/range/b2irange.hxx>
+ #include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
++#include <com/sun/star/rendering/PanoseProportion.hpp>
+ #include <com/sun/star/rendering/CompositeOperation.hpp>
+ #include <com/sun/star/rendering/StrokeAttributes.hpp>
+ #include <com/sun/star/rendering/PathJoinType.hpp>
+@@ -1517,6 +1518,10 @@
+ aFontRequest.FontDescription.IsVertical = rFontAttr.getVertical() ? util::TriState_YES : util::TriState_NO;
+ // TODO(F2): improve vclenum->panose conversion
+ aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttr.getWeight());
++ aFontRequest.FontDescription.FontDescription.Proportion =
++ rFontAttr.getMonospaced()
++ ? rendering::PanoseProportion::MONO_SPACED
++ : rendering::PanoseProportion::ANYTHING;
+ aFontRequest.FontDescription.FontDescription.Letterform = rFontAttr.getItalic() ? 9 : 0;
+
+ // init CellSize to 1.0, else a default font height will be used
+Index: drawinglayer/source/primitive2d/textlayoutdevice.cxx
+===================================================================
+--- drawinglayer/source/primitive2d/textlayoutdevice.cxx (revision 276100)
++++ drawinglayer/source/primitive2d/textlayoutdevice.cxx (working copy)
+@@ -406,6 +406,7 @@
+ aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
+ aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
+ aRetval.SetOutline(rFontAttribute.getOutline());
++ aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
+ aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
+
+ #ifdef WIN32
+@@ -445,6 +446,7 @@
+ RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
+ rFont.IsVertical(),
+ ITALIC_NONE != rFont.GetItalic(),
++ PITCH_FIXED == rFont.GetPitch(),
+ rFont.IsOutline(),
+ bRTL,
+ bBiDiStrong);
+--- drawinglayer/source/attribute/fontattribute.cxx 2010-07-06 16:05:42.000000000 +0100
++++ drawinglayer/source/attribute/fontattribute.cxx 2010-07-06 16:06:02.000000000 +0100
+@@ -55,6 +55,7 @@
+ unsigned mbOutline : 1; // Outline Flag
+ unsigned mbRTL : 1; // RTL Flag
+ unsigned mbBiDiStrong : 1; // BiDi Flag
++ unsigned mbMonospaced : 1;
+
+ ImpFontAttribute(
+ const String& rFamilyName,
+@@ -63,6 +64,7 @@
+ bool bSymbol,
+ bool bVertical,
+ bool bItalic,
++ bool bMonospaced,
+ bool bOutline,
+ bool bRTL,
+ bool bBiDiStrong)
+@@ -75,7 +77,8 @@
+ mbItalic(bItalic),
+ mbOutline(bOutline),
+ mbRTL(bRTL),
+- mbBiDiStrong(bBiDiStrong)
++ mbBiDiStrong(bBiDiStrong),
++ mbMonospaced(bMonospaced)
+ {
+ }
+
+@@ -89,6 +92,7 @@
+ bool getOutline() const { return mbOutline; }
+ bool getRTL() const { return mbRTL; }
+ bool getBiDiStrong() const { return mbBiDiStrong; }
++ bool getMonospaced() const { return mbMonospaced; }
+
+ bool operator==(const ImpFontAttribute& rCompare) const
+ {
+@@ -100,7 +104,8 @@
+ && getItalic() == rCompare.getItalic()
+ && getOutline() == rCompare.getOutline()
+ && getRTL() == rCompare.getRTL()
+- && getBiDiStrong() == rCompare.getBiDiStrong());
++ && getBiDiStrong() == rCompare.getBiDiStrong()
++ && getMonospaced() == rCompare.getMonospaced());
+ }
+
+ static ImpFontAttribute* get_global_default()
+@@ -112,7 +117,7 @@
+ pDefault = new ImpFontAttribute(
+ String(), String(),
+ 0,
+- false, false, false, false, false, false);
++ false, false, false, false, false, false, false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+@@ -129,11 +134,12 @@
+ bool bSymbol,
+ bool bVertical,
+ bool bItalic,
++ bool bMonospaced,
+ bool bOutline,
+ bool bRTL,
+ bool bBiDiStrong)
+ : mpFontAttribute(new ImpFontAttribute(
+- rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong))
++ rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bMonospaced, bOutline, bRTL, bBiDiStrong))
+ {
+ }
+
+@@ -246,6 +252,12 @@
+ return mpFontAttribute->getBiDiStrong();
+ }
+
++ bool FontAttribute::getMonospaced() const
++ {
++ return mpFontAttribute->getMonospaced();
++ }
++
++
+ } // end of namespace attribute
+ } // end of namespace drawinglayer
+
+--- drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx 2010-07-07 11:39:31.000000000 +0100
++++ drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx 2010-07-07 11:44:38.000000000 +0100
+@@ -65,6 +65,7 @@
+ bool bSymbol = false,
+ bool bVertical = false,
+ bool bItalic = false,
++ bool bMonospaced = false,
+ bool bOutline = false,
+ bool bRTL = false,
+ bool bBiDiStrong = false);
+@@ -89,6 +90,7 @@
+ bool getOutline() const;
+ bool getRTL() const;
+ bool getBiDiStrong() const;
++ bool getMonospaced() const;
+ };
+ } // end of namespace attribute
+ } // end of namespace drawinglayer
diff --git a/workspace.srb1.patch b/workspace.srb1.patch
new file mode 100644
index 0000000..d344fdb
--- /dev/null
+++ b/workspace.srb1.patch
@@ -0,0 +1,31 @@
+diff -r bec9b2b2628f -r 47329487e9cf reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
+--- a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java Mon Nov 09 14:52:58 2009 +0100
++++ b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java Wed Nov 11 10:36:44 2009 +0100
+@@ -35,6 +35,7 @@
+
+ import org.pentaho.reporting.libraries.resourceloader.ResourceData;
+ import org.pentaho.reporting.libraries.resourceloader.ResourceKey;
++import org.pentaho.reporting.libraries.resourceloader.ResourceException;
+ import org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException;
+ import org.pentaho.reporting.libraries.resourceloader.ResourceLoader;
+ import org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException;
+@@ -169,4 +170,19 @@
+ {
+ return resourceManager;
+ }
++
++ public boolean isSupportedDeserializer(String string)
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public String serialize(ResourceKey rk, ResourceKey rk1) throws ResourceException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public ResourceKey deserialize(ResourceKey rk, String string) throws ResourceKeyCreationException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
+ }
diff --git a/workspace.vcl113.patch b/workspace.vcl113.patch
new file mode 100644
index 0000000..e3cbb23
--- /dev/null
+++ b/workspace.vcl113.patch
@@ -0,0 +1,490 @@
+diff -ru vcl.orig/inc/vcl/salgdi.hxx vcl/inc/vcl/salgdi.hxx
+--- vcl.orig/inc/vcl/salgdi.hxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/inc/vcl/salgdi.hxx 2010-06-09 11:54:03.000000000 +0100
+@@ -233,7 +233,7 @@
+ // release the fonts
+ void ReleaseFonts() { SetFont( NULL, 0 ); }
+ // get the current font's metrics
+- virtual void GetFontMetric( ImplFontMetricData* ) = 0;
++ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
+
+ // get kernign pairs of the current font
+ // return only PairCount if (pKernPairs == NULL)
+diff -ru vcl.orig/source/gdi/outdev3.cxx vcl/source/gdi/outdev3.cxx
+--- vcl.orig/source/gdi/outdev3.cxx 2010-06-08 16:16:37.000000000 +0100
++++ vcl/source/gdi/outdev3.cxx 2010-06-09 12:41:11.000000000 +0100
+@@ -6588,6 +6588,10 @@
+ rtl::OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear();
+
+ ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
++
++ ImplFontMetricData aOrigMetric(aFontSelData);
++ mpGraphics->GetFontMetric(&aOrigMetric);
++
+ // when device specific font substitution may have been performed for
+ // the originally selected font then make sure that a fallback to that
+ // font is performed first
+@@ -6632,7 +6636,22 @@
+ }
+ #endif
+
++ ImplFontMetricData aSubstituteMetric(aFontSelData);
+ pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
++ mpGraphics->GetFontMetric(&aSubstituteMetric, nFallbackLevel);
++
++ long nOriginalHeight = aOrigMetric.mnAscent + aOrigMetric.mnDescent;
++ long nSubstituteHeight = aSubstituteMetric.mnAscent + aSubstituteMetric.mnDescent;
++ //Too tall, shrink it a bit. Need a better calculation to include extra
++ //factors and any extra wriggle room we might have available ?
++ if (nSubstituteHeight > nOriginalHeight)
++ {
++ float fScale = nOriginalHeight/(float)nSubstituteHeight;
++ long nOrigHeight = aFontSelData.mnHeight;
++ aFontSelData.mnHeight *= fScale;
++ pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
++ aFontSelData.mnHeight = nOrigHeight;
++ }
+
+ // create and add glyph fallback layout to multilayout
+ rLayoutArgs.ResetPos();
+diff -ru vcl.orig/unx/headless/svpgdi.hxx vcl/unx/headless/svpgdi.hxx
+--- vcl.orig/unx/headless/svpgdi.hxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/headless/svpgdi.hxx 2010-06-09 11:56:34.000000000 +0100
+@@ -86,7 +86,7 @@
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+- virtual void GetFontMetric( ImplFontMetricData* );
++ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual void GetDevFontList( ImplDevFontList* );
+diff -ru vcl.orig/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.cxx
+--- vcl.orig/unx/headless/svppspgraphics.cxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/headless/svppspgraphics.cxx 2010-06-09 12:01:06.000000000 +0100
+@@ -792,7 +792,7 @@
+ }
+ }
+
+-void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric )
++void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
+ {
+ const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
+ psp::PrintFontInfo aInfo;
+diff -ru vcl.orig/unx/headless/svppspgraphics.hxx vcl/unx/headless/svppspgraphics.hxx
+--- vcl.orig/unx/headless/svppspgraphics.hxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/headless/svppspgraphics.hxx 2010-06-09 11:57:47.000000000 +0100
+@@ -105,7 +105,7 @@
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+- virtual void GetFontMetric( ImplFontMetricData* );
++ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+ virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual void GetDevFontList( ImplDevFontList* );
+diff -ru vcl.orig/unx/headless/svptext.cxx vcl/unx/headless/svptext.cxx
+--- vcl.orig/unx/headless/svptext.cxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/headless/svptext.cxx 2010-06-09 11:57:29.000000000 +0100
+@@ -240,12 +240,15 @@
+
+ // ---------------------------------------------------------------------------
+
+-void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
++void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
+ {
+- if( m_pServerFont[0] != NULL )
++ if( nFallbackLevel >= MAX_FALLBACK )
++ return;
++
++ if( m_pServerFont[nFallbackLevel] != NULL )
+ {
+ long rDummyFactor;
+- m_pServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor );
++ m_pServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
+ }
+ }
+
+diff -ru vcl.orig/unx/inc/pspgraphics.h vcl/unx/inc/pspgraphics.h
+--- vcl.orig/unx/inc/pspgraphics.h 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/inc/pspgraphics.h 2010-06-09 11:55:52.000000000 +0100
+@@ -102,7 +102,7 @@
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+- virtual void GetFontMetric( ImplFontMetricData* );
++ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
+ virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual void GetDevFontList( ImplDevFontList* );
+diff -ru vcl.orig/unx/inc/salgdi.h vcl/unx/inc/salgdi.h
+--- vcl.orig/unx/inc/salgdi.h 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/inc/salgdi.h 2010-06-09 11:55:46.000000000 +0100
+@@ -249,7 +249,7 @@
+
+ virtual void SetTextColor( SalColor nSalColor );
+ virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
+- virtual void GetFontMetric( ImplFontMetricData* );
++ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
+ virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
+ virtual ImplFontCharMap* GetImplFontCharMap() const;
+ virtual void GetDevFontList( ImplDevFontList* );
+diff -ru vcl.orig/unx/source/gdi/pspgraphics.cxx vcl/unx/source/gdi/pspgraphics.cxx
+--- vcl.orig/unx/source/gdi/pspgraphics.cxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/source/gdi/pspgraphics.cxx 2010-06-09 12:02:18.000000000 +0100
+@@ -885,7 +885,7 @@
+ }
+ }
+
+-void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric )
++void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
+ {
+ const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
+ psp::PrintFontInfo aInfo;
+diff -ru vcl.orig/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salgdi3.cxx
+--- vcl.orig/unx/source/gdi/salgdi3.cxx 2010-06-08 16:16:51.000000000 +0100
++++ vcl/unx/source/gdi/salgdi3.cxx 2010-06-09 11:52:55.000000000 +0100
+@@ -1747,16 +1747,19 @@
+ // ----------------------------------------------------------------------------
+
+ void
+-X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric )
++X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel )
+ {
+- if( mpServerFont[0] != NULL )
++ if( nFallbackLevel >= MAX_FALLBACK )
++ return;
++
++ if( mpServerFont[nFallbackLevel] != NULL )
+ {
+ long rDummyFactor;
+- mpServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor );
++ mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
+ }
+- else if( mXFont[0] != NULL )
++ else if( mXFont[nFallbackLevel] != NULL )
+ {
+- mXFont[0]->ToImplFontMetricData( pMetric );
++ mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric );
+ if ( bFontVertical_ )
+ pMetric->mnOrientation = 0;
+ }
+diff -ru vcl.orig/source/glyphs/gcach_ftyp.cxx vcl/source/glyphs/gcach_ftyp.cxx
+--- vcl.orig/source/glyphs/gcach_ftyp.cxx 2010-06-21 09:44:48.000000000 +0100
++++ vcl/source/glyphs/gcach_ftyp.cxx 2010-06-21 10:45:25.000000000 +0100
+@@ -892,6 +909,9 @@
+ }
+ }
+ #endif
++
++ if( mnPrioEmbedded <= 0 )
++ mnLoadFlags |= FT_LOAD_NO_BITMAP;
+ }
+
+ // -----------------------------------------------------------------------
+diff -ru extensions.orig/source/scanner/scanner.cxx extensions/source/scanner/scanner.cxx
+--- extensions.orig/source/scanner/scanner.cxx 2010-07-12 20:17:35.000000000 +0100
++++ extensions/source/scanner/scanner.cxx 2010-07-13 10:17:25.000000000 +0100
+@@ -43,13 +43,14 @@
+ ScannerManager::ScannerManager() :
+ mpData( NULL )
+ {
++ AcquireData();
+ }
+
+ // -----------------------------------------------------------------------------
+
+ ScannerManager::~ScannerManager()
+ {
+- DestroyData();
++ ReleaseData();
+ }
+
+ // -----------------------------------------------------------------------------
+diff -ru extensions.orig/source/scanner/scanner.hxx extensions/source/scanner/scanner.hxx
+--- extensions.orig/source/scanner/scanner.hxx 2010-07-12 20:17:35.000000000 +0100
++++ extensions/source/scanner/scanner.hxx 2010-07-13 09:27:57.000000000 +0100
+@@ -73,7 +73,8 @@
+ vos::OMutex maProtector;
+ void* mpData;
+
+- void DestroyData();
++ void AcquireData();
++ void ReleaseData();
+
+ public:
+
+@@ -105,7 +106,7 @@
+ void Unlock() { maProtector.release(); }
+
+ void* GetData() const { return mpData; }
+- void SetData( void* pData ) { DestroyData(); mpData = pData; }
++ void SetData( void* pData ) { ReleaseData(); mpData = pData; }
+ };
+
+ // -----------------------------------------------------------------------------
+diff -ru extensions.orig/source/scanner/scanunx.cxx extensions/source/scanner/scanunx.cxx
+--- extensions.orig/source/scanner/scanunx.cxx 2010-07-12 20:17:35.000000000 +0100
++++ extensions/source/scanner/scanunx.cxx 2010-07-13 10:16:41.000000000 +0100
+@@ -31,6 +31,7 @@
+ #include <sanedlg.hxx>
+ #include <vos/thread.hxx>
+ #include <tools/list.hxx>
++#include <boost/shared_ptr.hpp>
+
+ #if OSL_DEBUG_LEVEL > 1
+ #include <stdio.h>
+@@ -113,12 +114,41 @@
+ vos::OMutex m_aProtector;
+ ScanError m_nError;
+ bool m_bBusy;
++
++ SaneHolder() : m_nError(ScanError_ScanErrorNone), m_bBusy(false) {}
+ };
+
+-DECLARE_LIST( SaneHolderList, SaneHolder* )
++namespace
++{
++ typedef std::vector< boost::shared_ptr<SaneHolder> > sanevec;
++ class allSanes
++ {
++ private:
++ int mnRefCount;
++ public:
++ sanevec m_aSanes;
++ allSanes() : mnRefCount(0) {}
++ void acquire();
++ void release();
++ };
++
++ void allSanes::acquire()
++ {
++ ++mnRefCount;
++ }
++
++ void allSanes::release()
++ {
++ // was unused, now because of i99835: "Scanning interface not SANE API
++ // compliant" destroy all SaneHolder to get Sane Dtor called
++ --mnRefCount;
++ if (!mnRefCount)
++ m_aSanes.clear();
++ }
+
+-static SaneHolderList allSanes;
+-static vos::OMutex aSaneProtector;
++ struct theSaneProtector : public rtl::Static<vos::OMutex, theSaneProtector> {};
++ struct theSanes : public rtl::Static<allSanes, theSanes> {};
++}
+
+ // -----------------
+ // - ScannerThread -
+@@ -126,7 +156,7 @@
+
+ class ScannerThread : public vos::OThread
+ {
+- SaneHolder* m_pHolder;
++ boost::shared_ptr<SaneHolder> m_pHolder;
+ REF( com::sun::star::lang::XEventListener ) m_xListener;
+ ScannerManager* m_pManager; // just for the disposing call
+
+@@ -134,7 +164,7 @@
+ virtual void run();
+ virtual void onTerminated() { delete this; }
+ public:
+- ScannerThread( SaneHolder* pHolder,
++ ScannerThread( boost::shared_ptr<SaneHolder> pHolder,
+ const REF( com::sun::star::lang::XEventListener )& listener,
+ ScannerManager* pManager );
+ virtual ~ScannerThread();
+@@ -143,7 +173,7 @@
+ // -----------------------------------------------------------------------------
+
+ ScannerThread::ScannerThread(
+- SaneHolder* pHolder,
++ boost::shared_ptr<SaneHolder> pHolder,
+ const REF( com::sun::star::lang::XEventListener )& listener,
+ ScannerManager* pManager )
+ : m_pHolder( pHolder ), m_xListener( listener ), m_pManager( pManager )
+@@ -192,16 +222,16 @@
+ // - ScannerManager -
+ // ------------------
+
+-void ScannerManager::DestroyData()
++void ScannerManager::AcquireData()
+ {
+- // was unused, now because of i99835: "Scanning interface not SANE API compliant"
+- // delete all SaneHolder to get Sane Dtor called
+- int i;
+- for ( i = allSanes.Count(); i > 0; i-- )
+- {
+- SaneHolder *pSaneHolder = allSanes.GetObject(i-1);
+- if ( pSaneHolder ) delete pSaneHolder;
+- }
++ vos::OGuard aGuard( theSaneProtector::get() );
++ theSanes::get().acquire();
++}
++
++void ScannerManager::ReleaseData()
++{
++ vos::OGuard aGuard( theSaneProtector::get() );
++ theSanes::get().release();
+ }
+
+ // -----------------------------------------------------------------------------
+@@ -224,17 +254,14 @@
+
+ SEQ( ScannerContext ) ScannerManager::getAvailableScanners() throw()
+ {
+- vos::OGuard aGuard( aSaneProtector );
++ vos::OGuard aGuard( theSaneProtector::get() );
++ sanevec &rSanes = theSanes::get().m_aSanes;
+
+- if( ! allSanes.Count() )
++ if( rSanes.empty() )
+ {
+- SaneHolder* pSaneHolder = new SaneHolder;
+- pSaneHolder->m_nError = ScanError_ScanErrorNone;
+- pSaneHolder->m_bBusy = false;
++ boost::shared_ptr<SaneHolder> pSaneHolder(new SaneHolder);
+ if( Sane::IsSane() )
+- allSanes.Insert( pSaneHolder );
+- else
+- delete pSaneHolder;
++ rSanes.push_back( pSaneHolder );
+ }
+
+ if( Sane::IsSane() )
+@@ -252,20 +279,21 @@
+
+ BOOL ScannerManager::configureScanner( ScannerContext& scanner_context ) throw( ScannerException )
+ {
+- vos::OGuard aGuard( aSaneProtector );
++ vos::OGuard aGuard( theSaneProtector::get() );
++ sanevec &rSanes = theSanes::get().m_aSanes;
+
+ #if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "ScannerManager::configureScanner\n" );
+ #endif
+
+- if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= allSanes.Count() )
++ if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() )
+ throw ScannerException(
+ ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ REF( XScannerManager )( this ),
+ ScanError_InvalidContext
+ );
+
+- SaneHolder* pHolder = allSanes.GetObject( scanner_context.InternalData );
++ boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
+ if( pHolder->m_bBusy )
+ throw ScannerException(
+ ::rtl::OUString::createFromAscii( "Scanner is busy" ),
+@@ -286,19 +314,20 @@
+ void ScannerManager::startScan( const ScannerContext& scanner_context,
+ const REF( com::sun::star::lang::XEventListener )& listener ) throw( ScannerException )
+ {
+- vos::OGuard aGuard( aSaneProtector );
++ vos::OGuard aGuard( theSaneProtector::get() );
++ sanevec &rSanes = theSanes::get().m_aSanes;
+
+ #if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "ScannerManager::startScan\n" );
+ #endif
+
+- if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= allSanes.Count() )
++ if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() )
+ throw ScannerException(
+ ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ REF( XScannerManager )( this ),
+ ScanError_InvalidContext
+ );
+- SaneHolder* pHolder = allSanes.GetObject( scanner_context.InternalData );
++ boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
+ if( pHolder->m_bBusy )
+ throw ScannerException(
+ ::rtl::OUString::createFromAscii( "Scanner is busy" ),
+@@ -315,16 +344,17 @@
+
+ ScanError ScannerManager::getError( const ScannerContext& scanner_context ) throw( ScannerException )
+ {
+- vos::OGuard aGuard( aSaneProtector );
++ vos::OGuard aGuard( theSaneProtector::get() );
++ sanevec &rSanes = theSanes::get().m_aSanes;
+
+- if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= allSanes.Count() )
++ if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() )
+ throw ScannerException(
+ ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ REF( XScannerManager )( this ),
+ ScanError_InvalidContext
+ );
+
+- SaneHolder* pHolder = allSanes.GetObject( scanner_context.InternalData );
++ boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
+
+ return pHolder->m_nError;
+ }
+@@ -333,15 +363,16 @@
+
+ REF( AWT::XBitmap ) ScannerManager::getBitmap( const ScannerContext& scanner_context ) throw( ScannerException )
+ {
+- vos::OGuard aGuard( aSaneProtector );
++ vos::OGuard aGuard( theSaneProtector::get() );
++ sanevec &rSanes = theSanes::get().m_aSanes;
+
+- if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= allSanes.Count() )
++ if( scanner_context.InternalData < 0 || (ULONG)scanner_context.InternalData >= rSanes.size() )
+ throw ScannerException(
+ ::rtl::OUString::createFromAscii( "Scanner does not exist" ),
+ REF( XScannerManager )( this ),
+ ScanError_InvalidContext
+ );
+- SaneHolder* pHolder = allSanes.GetObject( scanner_context.InternalData );
++ boost::shared_ptr<SaneHolder> pHolder = rSanes[scanner_context.InternalData];
+
+ vos::OGuard aProtGuard( pHolder->m_aProtector );
+
+diff -ru extensions.orig/source/scanner/scanwin.cxx extensions/source/scanner/scanwin.cxx
+--- extensions.orig/source/scanner/scanwin.cxx 2010-07-12 20:17:35.000000000 +0100
++++ extensions/source/scanner/scanwin.cxx 2010-07-13 09:28:40.000000000 +0100
+@@ -887,7 +887,11 @@
+ // - ScannerManager -
+ // ------------------
+
+-void ScannerManager::DestroyData()
++void ScannerManager::AcquireData()
++{
++}
++
++void ScannerManager::ReleaseData()
+ {
+ if( mpData )
+ {
+@@ -979,7 +983,7 @@
+ }
+
+ GlobalUnlock( hDIB );
+- DestroyData();
++ ReleaseData();
+ }
+
+ return aRet;
+@@ -1009,7 +1013,7 @@
+ if( rContext.InternalData != 0 || rContext.ScannerName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TWAIN" ) ) )
+ throw ScannerException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Scanner does not exist" ) ), xThis, ScanError_InvalidContext );
+
+- DestroyData();
++ ReleaseData();
+
+ return aTwain.SelectSource( *this );
+ }
+@@ -1025,7 +1029,7 @@
+ if( rContext.InternalData != 0 || rContext.ScannerName != ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TWAIN" ) ) )
+ throw ScannerException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Scanner does not exist" ) ), xThis, ScanError_InvalidContext );
+
+- DestroyData();
++ ReleaseData();
+ aTwain.PerformTransfer( *this, rxListener );
+ }
+
diff --git a/workspace.vcl114.patch b/workspace.vcl114.patch
new file mode 100644
index 0000000..02780e5
--- /dev/null
+++ b/workspace.vcl114.patch
@@ -0,0 +1,57 @@
+diff -ru vcl.orig/unx/gtk/app/gtkdata.cxx vcl/unx/gtk/app/gtkdata.cxx
+--- vcl.orig/unx/gtk/app/gtkdata.cxx 2010-07-19 15:32:25.000000000 +0100
++++ vcl/unx/gtk/app/gtkdata.cxx 2010-07-19 15:43:33.000000000 +0100
+@@ -519,6 +519,7 @@
+ GSource *m_pUserEvent;
+ oslMutex m_aDispatchMutex;
+ oslCondition m_aDispatchCondition;
++ XIOErrorHandler m_aOrigGTKXIOErrorHandler;
+
+ public:
+ static gboolean timeoutFn(gpointer data);
+@@ -552,6 +553,7 @@
+ m_pUserEvent = NULL;
+ m_aDispatchCondition = osl_createCondition();
+ m_aDispatchMutex = osl_createMutex();
++ m_aOrigGTKXIOErrorHandler = NULL;
+ }
+
+ GtkXLib::~GtkXLib()
+@@ -565,6 +567,9 @@
+ osl_setCondition( m_aDispatchCondition );
+ osl_destroyCondition( m_aDispatchCondition );
+ osl_destroyMutex( m_aDispatchMutex );
++
++ PopXErrorLevel();
++ XSetIOErrorHandler (m_aOrigGTKXIOErrorHandler);
+ }
+
+ void GtkXLib::Init()
+@@ -626,6 +631,10 @@
+ // init gtk/gdk
+ gtk_init_check( &nParams, &pCmdLineAry );
+
++ //gtk_init_check sets XError/XIOError handlers, we want our own one
++ m_aOrigGTKXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl );
++ PushXErrorLevel( !!getenv( "SAL_IGNOREXERRORS" ) );
++
+ for (i = 0; i < nParams; i++ )
+ g_free( pCmdLineAry[i] );
+ delete [] pCmdLineAry;
+diff -ru vcl/unx/gtk/a11y.orig/atkutil.cxx vcl/unx/gtk/a11y/atkutil.cxx
+--- vcl.orig/unx/gtk/a11y.orig/atkutil.cxx 2010-07-28 09:07:53.000000000 +0100
++++ vcl/unx/gtk/a11y/atkutil.cxx 2010-07-28 09:10:39.000000000 +0100
+@@ -77,11 +77,10 @@
+ uno::Reference< accessibility::XAccessible > xAccessible = xNextFocusObject;
+ if( xAccessible.get() == reinterpret_cast < accessibility::XAccessible * > (data) )
+ {
++ AtkObject *atk_obj = xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL;
+ // Gail does not notify focus changes to NULL, so do we ..
+- if( xAccessible.is() )
++ if( atk_obj )
+ {
+- AtkObject *atk_obj = atk_object_wrapper_ref( xAccessible );
+-
+ #ifdef ENABLE_TRACING
+ fprintf(stderr, "notifying focus event for %p\n", atk_obj);
+ #endif
diff --git a/workspace.vcl115.patch b/workspace.vcl115.patch
new file mode 100644
index 0000000..3325aa8
--- /dev/null
+++ b/workspace.vcl115.patch
@@ -0,0 +1,13 @@
+diff -r e08d3a985a67 vcl/unx/gtk/window/gtkframe.cxx
+--- a/vcl/unx/gtk/window/gtkframe.cxx Fri Aug 06 13:25:47 2010 +0100
++++ b/vcl/unx/gtk/window/gtkframe.cxx Fri Aug 13 08:58:07 2010 +0100
+@@ -1355,7 +1355,8 @@
+ // awesome.
+ bool bHack =
+ getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ||
+- getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz")
++ getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("compiz") ||
++ getDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Mutter")
+ ;
+ if( nUserTime == 0 && bHack )
+ {
More information about the scm-commits
mailing list