[ooo-build-commit] 2 commits - configure.in distro-configs/CrossWin32.conf.in patches/dev300
Fridrich Strba
fridrich at kemper.freedesktop.org
Mon Jun 29 02:43:30 PDT 2009
configure.in | 6
distro-configs/CrossWin32.conf.in | 22
patches/dev300/apply | 54
patches/dev300/crosswin32-accessibility-nojava.diff | 17
patches/dev300/crosswin32-basegfx-no-cppunit.diff | 8
patches/dev300/crosswin32-config_office-cross.diff | 216
patches/dev300/crosswin32-config_office-mingw.diff | 72
patches/dev300/crosswin32-connectivity-mingw.diff | 51
patches/dev300/crosswin32-cppuhelper-mingw.diff | 64
patches/dev300/crosswin32-cppunit-mingw.diff | 36
patches/dev300/crosswin32-dbaccess-mingw.diff | 50
patches/dev300/crosswin32-desktop-mingw.diff | 130
patches/dev300/crosswin32-dtrans-mingw.diff | 333 +
patches/dev300/crosswin32-embeddedobj-mingw.diff | 259 +
patches/dev300/crosswin32-external-mingwheaders.diff | 71
patches/dev300/crosswin32-fpicker-mingw.diff | 261 +
patches/dev300/crosswin32-funit-char-line.diff | 23
patches/dev300/crosswin32-goodies-mingw.diff | 11
patches/dev300/crosswin32-helpcontent2-mingw.diff | 18
patches/dev300/crosswin32-i18npool-cross.diff | 103
patches/dev300/crosswin32-i18npool-mingw.diff | 16
patches/dev300/crosswin32-icc-cross.diff | 16
patches/dev300/crosswin32-instsetoo_native-mingw.diff | 11
patches/dev300/crosswin32-lingucomponent-mingw.diff | 11
patches/dev300/crosswin32-o3tl-no-cppunit.diff | 8
patches/dev300/crosswin32-postprocess-mingw.diff | 26
patches/dev300/crosswin32-pyuno-mingw.diff | 10
patches/dev300/crosswin32-sal-cross.diff | 16
patches/dev300/crosswin32-sal-mingw-c.diff | 108
patches/dev300/crosswin32-sal-mingw.diff | 120
patches/dev300/crosswin32-sccomp-mingw.diff | 26
patches/dev300/crosswin32-scp2-mingw.diff | 274 +
patches/dev300/crosswin32-setup_native-mingw.diff | 18
patches/dev300/crosswin32-shell-mingw.diff | 355 +
patches/dev300/crosswin32-solenv-cross.diff | 208
patches/dev300/crosswin32-solenv-mingw-installer.diff | 58
patches/dev300/crosswin32-solenv-mingw.diff | 324 +
patches/dev300/crosswin32-solenv.diff | 11
patches/dev300/crosswin32-soltools-cross.diff | 13
patches/dev300/crosswin32-store-core.diff | 4118 ++++++++++++++++++
patches/dev300/crosswin32-store-registry.diff | 174
patches/dev300/crosswin32-svtools-minimal.diff | 84
patches/dev300/crosswin32-svx-mingw.diff | 24
patches/dev300/crosswin32-sysui-mingw.diff | 10
patches/dev300/crosswin32-tools-mingw.diff | 28
patches/dev300/crosswin32-unotools-mingw.diff | 10
patches/dev300/crosswin32-vcl-mingw.diff | 424 +
47 files changed, 8303 insertions(+), 3 deletions(-)
New commits:
commit 0b50e80553461ed82b001476f0108bd82e2ed3ec
Author: Fridrich Strba <fridrich.strba at bluewin.ch>
Date: Mon Jun 29 11:30:17 2009 +0200
Adding some missing added files :) and a small fix in apply
* distro-configs/CrossWin32.conf.in:
* patches/dev300/apply:
* patches/dev300/crosswin32-accessibility-nojava.diff:
* patches/dev300/crosswin32-basegfx-no-cppunit.diff:
* patches/dev300/crosswin32-config_office-cross.diff:
* patches/dev300/crosswin32-config_office-mingw.diff:
* patches/dev300/crosswin32-connectivity-mingw.diff:
* patches/dev300/crosswin32-cppuhelper-mingw.diff:
* patches/dev300/crosswin32-cppunit-mingw.diff:
* patches/dev300/crosswin32-dbaccess-mingw.diff:
* patches/dev300/crosswin32-desktop-mingw.diff:
* patches/dev300/crosswin32-dtrans-mingw.diff:
* patches/dev300/crosswin32-embeddedobj-mingw.diff:
* patches/dev300/crosswin32-external-mingwheaders.diff:
* patches/dev300/crosswin32-fpicker-mingw.diff:
* patches/dev300/crosswin32-funit-char-line.diff:
* patches/dev300/crosswin32-goodies-mingw.diff:
* patches/dev300/crosswin32-helpcontent2-mingw.diff:
* patches/dev300/crosswin32-i18npool-cross.diff:
* patches/dev300/crosswin32-i18npool-mingw.diff:
* patches/dev300/crosswin32-icc-cross.diff:
* patches/dev300/crosswin32-instsetoo_native-mingw.diff:
* patches/dev300/crosswin32-lingucomponent-mingw.diff:
* patches/dev300/crosswin32-o3tl-no-cppunit.diff:
* patches/dev300/crosswin32-postprocess-mingw.diff:
* patches/dev300/crosswin32-pyuno-mingw.diff:
* patches/dev300/crosswin32-sal-cross.diff:
* patches/dev300/crosswin32-sal-mingw-c.diff:
* patches/dev300/crosswin32-sal-mingw.diff:
* patches/dev300/crosswin32-sccomp-mingw.diff:
* patches/dev300/crosswin32-scp2-mingw.diff:
* patches/dev300/crosswin32-setup_native-mingw.diff:
* patches/dev300/crosswin32-shell-mingw.diff:
* patches/dev300/crosswin32-solenv-cross.diff:
* patches/dev300/crosswin32-solenv-mingw-installer.diff:
* patches/dev300/crosswin32-solenv-mingw.diff:
* patches/dev300/crosswin32-solenv.diff:
* patches/dev300/crosswin32-soltools-cross.diff:
* patches/dev300/crosswin32-store-core.diff:
* patches/dev300/crosswin32-store-registry.diff:
* patches/dev300/crosswin32-svtools-minimal.diff:
* patches/dev300/crosswin32-svx-mingw.diff:
* patches/dev300/crosswin32-sysui-mingw.diff:
* patches/dev300/crosswin32-tools-mingw.diff:
* patches/dev300/crosswin32-unotools-mingw.diff:
* patches/dev300/crosswin32-vcl-mingw.diff:
diff --git a/distro-configs/CrossWin32.conf.in b/distro-configs/CrossWin32.conf.in
new file mode 100644
index 0000000..fe065e3
--- /dev/null
+++ b/distro-configs/CrossWin32.conf.in
@@ -0,0 +1,22 @@
+--host="i686-pc-mingw32"
+--with-vendor=\"Google Summer of Code 2009.\"
+--disable-activex-component
+--without-agfa-monotype-fonts
+--disable-xrender-link
+--disable-cups
+--disable-pam
+--disable-crypt-link
+--disable-randr
+--disable-gtk
+--with-ant-home=/usr/share/ant
+--with-system-boost
+--with-sltport=no
+--without-stlport
+--with-system-python=no
+--disable-ldap
+--with-java=no
+--disable-mozilla
+--with-system-mozilla=no
+--with-tools-dir=/home/jesus/soltools
+--with-system-icu
+--with-system-expat
\ No newline at end of file
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 222d555..21d2ede 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3237,7 +3237,7 @@ crosswin32-dbaccess-mingw.diff
crosswin32-desktop-mingw.diff
crosswin32-dtrans-mingw.diff
crosswin32-embeddedobj-mingw.diff
-crosswin32-extensions-mingw.diff
+#crosswin32-extensions-mingw.diff
crosswin32-external-mingwheaders.diff
crosswin32-fpicker-mingw.diff
crosswin32-funit-char-line.diff
@@ -3269,7 +3269,7 @@ crosswin32-svtools-minimal.diff
crosswin32-svx-mingw.diff
crosswin32-sysui-mingw.diff
crosswin32-tools-mingw.diff
-crosswin32-trans-mingw.diff
+#crosswin32-trans-mingw.diff
crosswin32-unotools-mingw.diff
crosswin32-vcl-mingw.diff
diff --git a/patches/dev300/crosswin32-accessibility-nojava.diff b/patches/dev300/crosswin32-accessibility-nojava.diff
new file mode 100644
index 0000000..e5015e7
--- /dev/null
+++ b/patches/dev300/crosswin32-accessibility-nojava.diff
@@ -0,0 +1,17 @@
+--- accessibility/bridge/source/java/makefile.mk.pristine 2009-04-05 11:23:45.847495404 +0200
++++ accessibility/bridge/source/java/makefile.mk 2009-04-05 11:26:04.051493710 +0200
+@@ -43,6 +43,7 @@ VERSIONOBJ=
+
+ # --- Files --------------------------------------------------------
+
++.IF "$(SOLAR_JAVA)"!=""
+ .IF "$(GUI)"=="WNT"
+
+ SLOFILES= $(SLO)$/WindowsAccessBridgeAdapter.obj
+@@ -72,3 +73,6 @@ $(SHL1HEADER) :
+ javah -classpath $(OUT)$/class -o $(SHL1HEADER) org.openoffice.accessibility.WindowsAccessBridgeAdapter
+
+ .ENDIF # "$(GUI)"=="WNT"
++.ELSE # "$(SOLAR_JAVA)"==""
++ALLTAR:
++.ENDIF # "$(SOLAR_JAVA)"==""
diff --git a/patches/dev300/crosswin32-basegfx-no-cppunit.diff b/patches/dev300/crosswin32-basegfx-no-cppunit.diff
new file mode 100644
index 0000000..76eab43
--- /dev/null
+++ b/patches/dev300/crosswin32-basegfx-no-cppunit.diff
@@ -0,0 +1,8 @@
+--- basegfx/prj/build.lst.pristine 2009-04-06 10:18:35.000000000 +0200
++++ basegfx/prj/build.lst 2009-04-06 10:18:39.000000000 +0200
+@@ -15,4 +15,4 @@ fx basegfx\source\color nmake - all
+ fx basegfx\source\pixel nmake - all fx_pixel fx_inc NULL
+ fx basegfx\source\raster nmake - all fx_raster fx_inc NULL
+ fx basegfx\util nmake - all fx_util fx_curve fx_matrix fx_numeric fx_point fx_polygon fx_range fx_tuple fx_tools fx_vector fx_color fx_pixel fx_raster NULL
+-fx basegfx\test nmake - all fx_tests fx_util NULL
++#fx basegfx\test nmake - all fx_tests fx_util NULL
diff --git a/patches/dev300/crosswin32-config_office-cross.diff b/patches/dev300/crosswin32-config_office-cross.diff
new file mode 100644
index 0000000..a61f4ee
--- /dev/null
+++ b/patches/dev300/crosswin32-config_office-cross.diff
@@ -0,0 +1,216 @@
+--- configure.in.orig 2008-10-19 21:05:46.000000000 +0200
++++ configure.in 2008-10-19 21:27:16.000000000 +0200
+@@ -794,6 +794,11 @@ AC_ARG_ENABLE(verbose,
+ [ --enable-verbose Increase build verbosity.
+ --disable-verbose Decrease build verbosity.
+ ],,)
++AC_ARG_WITH(tools-dir,
++[ --with-tools-dir When cross compiling, specify solar tools
++ directory.
++],[TOOLS_DIR=$withval],[TOOLS_DIR='$(SOLARBINDIR)'])
++AC_SUBST(TOOLS_DIR)
+
+ BUILD_TYPE="OOo"
+
+@@ -1035,6 +1035,21 @@ AC_SUBST(OSVERSION)
+ AC_SUBST(PTHREAD_CFLAGS)
+ AC_SUBST(PTHREAD_LIBS)
+
++case "$target_os" in
++ linux-gnu*)
++ t_os=Linux
++ ;;
++ mingw32*)
++ t_os=MinGW
++ ;;
++ solaris*)
++ t_os=SunOS
++ ;;
++ *)
++ t_os=$_os
++ ;;
++esac
++
+ dnl ===================================================================
+ dnl Set the ENABLE_CRASHDUMP variable.
+ dnl ===================================================================
+@@ -1649,6 +1651,27 @@ if test "$_os" = "OSF1"; then
+ fi
+ fi
+
++AC_CHECK_TOOL([AR], [ar], [:])
++AC_CHECK_TOOL([AS], [as], [:])
++AC_CHECK_TOOL([DLLTOOL], [dlltool], [:])
++AC_CHECK_TOOL([LD], [ld], [:])
++AC_CHECK_TOOL([NM], [nm], [:])
++AC_CHECK_TOOL([RANLIB], [ranlib], [:])
++AC_CHECK_TOOL([WINDRES], [windres], [:])
++
++BUILD_OS=$_os
++TARGET_OS=$t_os
++CROSS_COMPILING=$cross_compiling
++CC_FOR_BUILD=${CC_FOR_BUILD-cc}
++CCLD_FOR_BUILD=${CCLD_FOR_BUILD-${CC_FOR_BUILD}}
++LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-}
++AC_SUBST(BUILD_OS)
++AC_SUBST(TARGET_OS)
++AC_SUBST(CROSS_COMPILING)
++AC_SUBST(CC_FOR_BUILD)
++AC_SUBST(CCLD_FOR_BUILD)
++AC_SUBST(LDFLAGS_FOR_BUILD)
++
+ dnl ===================================================================
+ dnl Check whether there's a Perl version available.
+ dnl ===================================================================
+@@ -3735,14 +3740,11 @@ if test -n "$with_system_python" -o -n "
+ AC_MSG_RESULT([external])
+ AM_PATH_PYTHON([2.2])
+
+- python_include=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('INCLUDEPY');"`
+- python_version=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('VERSION');"`
+- PYTHON_CFLAGS="-I$python_include"
++ PYTHON_CFLAGS=`python-config --cflags`
++ PYTHON_LIBS=`python-config --libs`
+
+ if test "$_os" = "Darwin"; then
+ PYTHON_LIBS="-framework Python"
+- else
+- PYTHON_LIBS="-lpython$python_version"
+ fi
+
+ dnl check if the headers really work:
+@@ -3798,7 +3800,7 @@ int main(int argc, char **argv) {
+ if(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == $v) return 0;
+ else return 1;
+ }
+- ], [DB_VERSION_MINOR=$v], [])
++ ], [DB_VERSION_MINOR=$v], [], [DB_VERSION_MINOR=$ac_cv_db_version_minor])
+ done
+ if test "$DB_VERSION_MINOR" -gt "1"; then
+ AC_MSG_RESULT([OK])
+@@ -4396,7 +4398,7 @@ int main(int argc, char **argv) {
+ else
+ return 0;
+ }
+- ], [AC_MSG_RESULT(OK)], [AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])])
++ ], [AC_MSG_RESULT(OK)], [AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])], [AC_MSG_RESULT($ac_cv_icu_version)])
+ AC_LANG_POP([C++])
+ else
+ AC_MSG_RESULT([internal])
+@@ -4519,7 +4521,7 @@ int main(int argc, char **argv) {
+ if(FC_MAJOR > 2 || (FC_MAJOR == 2 && FC_MINOR >= 2)) return 0;
+ else return 1;
+ }
+-], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, fontconfig >= 2.2.0 needed])])
++], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, fontconfig >= 2.2.0 needed])], [AC_MSG_RESULT(possibly - should use pkg-config instead of home-brew checks)])
+ fi
+
+ dnl ===================================================================
+@@ -4638,7 +4638,7 @@ AC_SUBST(SYSTEM_LPSOLVE)
+ dnl ***************************************
+ dnl testing libc version for Linux...
+ dnl ***************************************
+-if test "$_os" = "Linux"; then
++if test "$_os" = "Linux" -a "$cross_compiling" = "no"; then
+ AC_MSG_CHECKING([whether libc is >= 2.1.1])
+ exec 6>/dev/null # no output
+ AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
+--- acinclude.m4.orig 2008-10-19 21:29:43.000000000 +0200
++++ acinclude.m4 2008-10-19 21:29:51.000000000 +0200
+@@ -136,3 +136,24 @@ AC_DEFUN([PKG_CHECK_MODULES_MACHACK],
+ PKG_CHECK_MODULES($1, $3, $4, $5, $6)
+ fi
+ ])
++
++## ------------------------------------- ##
++## Checking for the existence of files. ##
++## ------------------------------------- ##
++
++# AC_CHECK_FILE_CROSS(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++# -------------------------------------------------------------
++#
++# Check for the existence of FILE; remove assertion on not cross-compiliing
++AC_DEFUN([AC_CHECK_FILE_CROSS],
++[
++AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
++AC_CACHE_CHECK([for $1], [ac_File],
++if test -r "$1"; then
++ AS_VAR_SET([ac_File], [yes])
++else
++ AS_VAR_SET([ac_File], [no])
++fi)
++AS_IF([test AS_VAR_GET([ac_File]) = yes], [$2], [$3])[]dnl
++AS_VAR_POPDEF([ac_File])dnl
++])# AC_CHECK_FILE_CROSS
+--- bootstrap.1.orig 2008-10-19 23:24:01.000000000 +0200
++++ bootstrap.1 2008-10-19 23:22:49.000000000 +0200
+@@ -1,7 +1,7 @@
+
+ # executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x
+ # Use spawn instead of fork when building dmake on cygwin.
+-if test "$GUI" = "WNT"; then
++if test "$GUI" = "WNT" -a "$CROSS_COMPILING" != "yes"; then
+ EXEEXT=".exe"
+ DMAKE_CONF="--enable-spawn"
+ else
+@@ -36,6 +36,14 @@ if test "$BUILD_DMAKE" != "NO"; then
+ $GNUMAKE distclean || exit
+ fi
+
++ # When cross compiling, use native compiler
++ if test -n "$CC_FOR_BUILD"; then
++ CC=$CC_FOR_BUILD
++ export CC
++ LDFLAGS=$LDFLAGS_FOR_BUILD
++ export LDFLAGS
++ fi
++
+ ./configure $DMAKE_CONF || exit
+
+ ## invoke the gnu make command set by configure.
+@@ -62,7 +70,7 @@ if test "$BUILD_DMAKE" != "NO"; then
+ echo "dmake copied to $SOLARENV/$OUTPATH/bin/dmake$EXEEXT"
+ fi
+
+-if test "$GUI" = "WNT" -a ! -x "$SOLARENV/$OUTPATH/bin/guw$EXEEXT"; then
++if test "$GUI" = "WNT" -a ! -x "$SOLARENV/$OUTPATH/bin/guw$EXEEXT" -a "$CROSS_COMPILING" != "yes"; then
+ echo ""
+ echo "Calling $GNUMAKE in guw"
+ cd "$SRC_ROOT/config_office/guw" || exit
+--- set_soenv.in.orig 2008-10-20 19:52:27.000000000 +0200
++++ set_soenv.in 2008-10-20 21:38:02.000000000 +0200
+@@ -1194,8 +1210,11 @@ if ($platform =~ m/cygwin|os2/)
+ # The general environment path.
+ if ($platform =~ m/linux|netbsd|odf1|irix|freebsd|aix|solaris/)
+ { $PATH = $cur_dir.
+- $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN.
+- $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
++ $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN;
++ if ("@CROSS_COMPILING@" == "yes") {
++ $PATH .= $ps.'@TOOLS_DIR@';
++ }
++ $PATH .= $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
+ $ps.'$SOLARENV'.$BIN;
+
+ if ($platform =~ m/solaris/) {
+@@ -1847,6 +1847,20 @@ ToFile( "SOLAR_JAVA", $SOLAR_JAVA
+ ToFile( "BIG_SVX", $BIG_SVX, "e" );
+ ToFile( "COM", $COM, "e" );
+ ToFile( "COMPATH", $COMPATH, "e" );
++ToFile( "BUILD_OS", "@BUILD_OS@", "e" );
++ToFile( "TARGET_OS", "@TARGET_OS@", "e" );
++ToFile( "CROSS_COMPILING", "@CROSS_COMPILING@", "e" );
++ToFile( "CC_FOR_BUILD", "@CC_FOR_BUILD@", "e" );
++ToFile( "CCLD_FOR_BUILD", "@CCLD_FOR_BUILD@", "e" );
++ToFile( "LDFLAGS_FOR_BUILD", "@LDFLAGS_FOR_BUILD@", "e" );
++ToFile( "AR", "@AR@", "e" );
++ToFile( "AS", "@AS@", "e" );
++ToFile( "DLLTOOL", "@DLLTOOL@", "e" );
++ToFile( "LD", "@LD@", "e" );
++ToFile( "NM", "@NM@", "e" );
++ToFile( "RANLIB", "@RANLIB@", "e" );
++ToFile( "WINDRES", "@WINDRES@", "e" );
++ToFile( "TOOLS_DIR", "@TOOLS_DIR@", "e" );
+ ToFile( "CPU", $CPU, "e" );
+ ToFile( "CPUNAME", $CPUNAME, "e" );
+ ToFile( "CVER", $CVER, "e" );
diff --git a/patches/dev300/crosswin32-config_office-mingw.diff b/patches/dev300/crosswin32-config_office-mingw.diff
new file mode 100644
index 0000000..f548783
--- /dev/null
+++ b/patches/dev300/crosswin32-config_office-mingw.diff
@@ -0,0 +1,72 @@
+--- configure.in.orig 2008-10-19 22:03:22.000000000 +0200
++++ configure.in 2008-10-19 22:17:08.000000000 +0200
+@@ -1059,7 +1079,7 @@
+ fi
+ AC_SUBST(ENABLE_CRASHDUMP)
+
+-if test "$_os" = "WINNT"; then
++if test "$_os" = "WINNT" -o "$t_os" = "MinGW"; then
+ BUILD_TYPE="$BUILD_TYPE TWAIN"
+ fi
+
+@@ -4265,7 +4262,7 @@ elif test "$_os" = "OS2" ; then
+ echo "Do Nothing for _os = OS2. Don't check for X11."
+ dnl OS/2 uses native graphics. Don't check for X11.
+ :
+-elif test "$_os" != "WINNT" ; then
++elif test "$_os" != "WINNT" -a "$t_os" != "MinGW" ; then
+ AC_PATH_X
+ AC_PATH_XTRA
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+@@ -4526,7 +4564,7 @@ fi
+ AC_SUBST(XLIB)
+ AC_SUBST(XAU_LIBS)
+
+-if test "$_os" != "WINNT" -a "$_os" != "OS2" -a "$_os" != "Darwin"; then
++if test "$_os" != "WINNT" -a "$t_os" != "MinGW" -a "$_os" != "OS2" -a "$_os" != "Darwin"; then
+ dnl ===================================================================
+ dnl Check for using Xaw
+ dnl ===================================================================
+@@ -5371,7 +5409,7 @@ dnl ====================================
+
+ ENABLE_GCONF=""
+ AC_MSG_CHECKING([whether to enable GConf support])
+-if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then
++if test "$_os" != "WINNT" -a "$t_os" != "MinGW" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then
+ ENABLE_GCONF="TRUE"
+ AC_MSG_RESULT([yes])
+ PKG_CHECK_MODULES( GCONF, gconf-2.0 )
+@@ -5387,7 +5425,7 @@ dnl ====================================
+ ENABLE_GNOMEVFS=""
+ GNOMEVFS_HAS_LOCKING=""
+ AC_MSG_CHECKING([whether to enable GNOME VFS support])
+-if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then
++if test "$_os" != "WINNT" -a "$t_os" != "MinGW" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then
+ ENABLE_GNOMEVFS="TRUE"
+ AC_MSG_RESULT([yes])
+ PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
+--- set_soenv.in.orig 2008-10-20 19:52:27.000000000 +0200
++++ set_soenv.in 2008-10-20 20:22:58.000000000 +0200
+@@ -593,6 +593,22 @@ elsif ( $platform =~ m/linux/ )
+ $JREEXTRALIBDIR = '$JAVA_HOME'.$ds."lib".$ds.$ARCH.$ds."xawt";
+ }
+
++ if ( "@TARGET_OS@" == "MinGW" )
++ {
++ print "Setting build=Linux -> target,host=MinGW specific values... ";
++ $COM = "GCC";
++ $CVER = "C341";
++ $OUTPATH = "wntgcci";
++ $CPUNAME = "INTEL";
++ $CPU = "I";
++ $GUI = "WNT";
++ $GUIBASE = "WIN";
++ $GVER = "NT351";
++ $OS = "WNT";
++ $DYNAMIC_CRT = "TRUE";
++ $SET_EXCEPTIONS = "TRUE";
++ $use_shl_versions = "TRUE";
++ }
+
+ $INPATH = $OUTPATH.$PROEXT;
+ }
diff --git a/patches/dev300/crosswin32-connectivity-mingw.diff b/patches/dev300/crosswin32-connectivity-mingw.diff
new file mode 100644
index 0000000..0538af2
--- /dev/null
+++ b/patches/dev300/crosswin32-connectivity-mingw.diff
@@ -0,0 +1,51 @@
+--- connectivity/source/inc/odbc/OFunctiondefs.hxx.~1.17.~ 2008-04-10 13:43:33.000000000 +0200
++++ connectivity/source/inc/odbc/OFunctiondefs.hxx 2008-10-31 15:24:26.000000000 +0100
+@@ -32,7 +32,14 @@
+ #ifndef _CONNECTIVITY_OFUNCTIONDEFS_HXX_
+ #define _CONNECTIVITY_OFUNCTIONDEFS_HXX_
+
+-#if defined(WIN) || defined(WNT)
++#if defined(__MINGW32__)
++
++#include <windows.h>
++#define SDB_ODBC_CHAR SQLCHAR
++#include <odbcinst.h>
++#include <sqlext.h>
++
++#elif defined(WIN) || defined(WNT)
+
+ #ifdef _MSC_VER
+ #pragma warning(push)
+--- connectivity/source/inc/adabas/BDriver.hxx.~1.13.~ 2008-04-10 12:43:47.000000000 +0200
++++ connectivity/source/inc/adabas/BDriver.hxx 2008-10-31 15:24:26.000000000 +0100
+@@ -31,6 +31,8 @@
+ #ifndef _CONNECTIVITY_ADABAS_BDRIVER_HXX_
+ #define _CONNECTIVITY_ADABAS_BDRIVER_HXX_
+
++#include <sal/types.h>
++
+ #include <com/sun/star/sdbc/XDriver.hpp>
+ #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
+ #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+--- connectivity/source/inc/TResultSetHelper.hxx.~1.3.~ 2008-04-10 12:39:57.000000000 +0200
++++ connectivity/source/inc/TResultSetHelper.hxx 2008-10-31 15:24:26.000000000 +0100
+@@ -33,6 +33,9 @@
+
+ #include <sal/types.h>
+
++#undef ABSOLUTE
++#undef RELATIVE
++
+ namespace connectivity
+ {
+ class SAL_NO_VTABLE IResultSetHelper
+--- connectivity/inc/connectivity/sdbcx/VDescriptor.hxx.~1.11.~ 2008-04-10 09:43:29.000000000 +0200
++++ connectivity/inc/connectivity/sdbcx/VDescriptor.hxx 2008-10-31 15:24:26.000000000 +0100
+@@ -32,6 +32,7 @@
+ #define _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+
+ #include <comphelper/propertycontainer.hxx>
++#undef OPTIONAL
+ #include <com/sun/star/beans/PropertyAttribute.hpp>
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+ #include <cppuhelper/typeprovider.hxx>
diff --git a/patches/dev300/crosswin32-cppuhelper-mingw.diff b/patches/dev300/crosswin32-cppuhelper-mingw.diff
new file mode 100644
index 0000000..80636b8
--- /dev/null
+++ b/patches/dev300/crosswin32-cppuhelper-mingw.diff
@@ -0,0 +1,64 @@
+--- cppuhelper/source/shlib.cxx.pristine 2009-04-08 13:32:45.090439917 +0200
++++ cppuhelper/source/shlib.cxx 2009-04-08 16:20:54.526067518 +0200
+@@ -100,7 +100,14 @@ static const ::std::vector< OUString > *
+ if (FileBase::getFileURLFromSystemPath(aStr, aFileUrl)
+ != FileBase::E_None)
+ {
+- OSL_ASSERT(false);
++#if OSL_DEBUG_LEVEL > 1
++ out( "*** getFileURLFromSystemPath failed for: " );
++ out( aStr );
++#endif
++#ifdef __MINGW32__
++ continue;
++#endif /* __MINGW32__ */
++ OSL_ASSERT(false);
+ }
+ s_v.push_back( aFileUrl );
+ } while( nIndex != -1 );
+@@ -172,6 +179,8 @@ static bool checkAccessPath( OUString *
+ #endif
+ }
+
++ OUString aBaseDirPlusFileColonSlashSlash
++ = OUString::createFromAscii ("file://") + aBaseDir;
+ if (0 == aAbs.indexOf( aBaseDir ) && // still part of it?
+ aBaseDir.getLength() < aAbs.getLength() &&
+ (aBaseDir[ aBaseDir.getLength() -1 ] == (sal_Unicode)'/' ||
+@@ -186,6 +195,19 @@ static bool checkAccessPath( OUString *
+ return true;
+ }
+ #if OSL_DEBUG_LEVEL > 1
++ else if (0 == aAbs.indexOf( aBaseDirPlusFileColonSlashSlash ) && // still part of it?
++ aBaseDirPlusFileColonSlashSlash.getLength() < aAbs.getLength() &&
++ (aBaseDirPlusFileColonSlashSlash[ aBaseDirPlusFileColonSlashSlash.getLength() -1 ] == (sal_Unicode)'/' ||
++ // dir boundary
++ aAbs[ aBaseDirPlusFileColonSlashSlash.getLength() ] == (sal_Unicode)'/'))
++ {
++#if OSL_DEBUG_LEVEL > 1
++ out( ": ok [adding file://].\n" );
++#endif
++ // load from absolute path
++ *pComp = aAbs;
++ return true;
++ }
+ else
+ {
+ out( "\" ...does not match given path \"" );
+--- cppuhelper/source/bootstrap.cxx.pristine 2009-04-08 15:48:48.595676127 +0200
++++ cppuhelper/source/bootstrap.cxx 2009-04-08 15:48:22.621940816 +0200
+@@ -354,12 +354,14 @@ Reference< registry::XSimpleRegistry > n
+ }
+ catch(registry::InvalidRegistryException & invalidRegistryException)
+ {
++#ifndef __MINGW32__
+ if (! optional)
+ {
+ // if a registry was explicitly given, the exception shall fly
+ if( ! bFallenBack )
+ throw;
+ }
++#endif /* __MINGW32__ */
+
+ (void) invalidRegistryException;
+ #if OSL_DEBUG_LEVEL > 1
diff --git a/patches/dev300/crosswin32-cppunit-mingw.diff b/patches/dev300/crosswin32-cppunit-mingw.diff
new file mode 100644
index 0000000..29e6957
--- /dev/null
+++ b/patches/dev300/crosswin32-cppunit-mingw.diff
@@ -0,0 +1,36 @@
+--- cppunit/cppunit-1.8.0-r1.patch.pristine 2009-04-04 15:33:44.231998652 +0200
++++ cppunit/cppunit-1.8.0-r1.patch 2009-04-04 15:34:27.616002193 +0200
+@@ -9610,7 +9610,7 @@ Nur in misc/build/cppunit-1.8.0/src/resu
+ Nur in misc/build/cppunit-1.8.0/src/result: treswrapper.cxx.dummy.
+ --- misc/cppunit-1.8.0/src/win32/makefile.mk 2008-12-10 20:46:10.024158685 +0100
+ +++ misc/build/cppunit-1.8.0/src/win32/makefile.mk 2008-12-10 19:45:23.000000000 +0100
+-@@ -1 +1,67 @@
++@@ -1 +1,68 @@
+ -dummy
+ +#*************************************************************************
+ +#
+@@ -9663,6 +9663,7 @@ Nur in misc/build/cppunit-1.8.0/src/resu
+ +#-------------------------------------------------------------------------------
+ +# This is a static lib
+ +LIB1TARGET= $(LB)$/$(TARGET).lib
+++LIB1ARCHIV= $(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
+ +LIB1OBJFILES= \
+ + $(SLOFILES)
+ +
+@@ -9682,7 +9683,7 @@ Nur in misc/build/cppunit-1.8.0/src/resu
+ Nur in misc/build/cppunit-1.8.0/src/win32: makefile.mk.dummy.
+ --- misc/cppunit-1.8.0/src/win32/winstuff.cxx 2008-12-10 20:46:10.106772548 +0100
+ +++ misc/build/cppunit-1.8.0/src/win32/winstuff.cxx 2008-12-10 20:42:44.000000000 +0100
+-@@ -1 +1,143 @@
++@@ -1 +1,142 @@
+ -dummy
+ +/*************************************************************************
+ + *
+@@ -9727,7 +9728,6 @@ Nur in misc/build/cppunit-1.8.0/src/win3
+ +#if defined _MSC_VER
+ +#pragma warning(pop)
+ +#endif
+-+#include <MAPIWin.h>
+ +
+ +void WinDebugBreak()
+ +{
diff --git a/patches/dev300/crosswin32-dbaccess-mingw.diff b/patches/dev300/crosswin32-dbaccess-mingw.diff
new file mode 100644
index 0000000..ab4939f
--- /dev/null
+++ b/patches/dev300/crosswin32-dbaccess-mingw.diff
@@ -0,0 +1,50 @@
+--- dbaccess/source/ui/dlg/makefile.mk.pristine 2008-04-10 16:59:00.000000000 +0200
++++ dbaccess/source/ui/dlg/makefile.mk 2009-02-16 15:51:44.000000000 +0100
+@@ -131,7 +131,7 @@ SLOFILES= \
+ $(SLO)$/dlgsize.obj \
+ $(SLO)$/dlgattr.obj
+
+-.IF "$(WINDOWS_VISTA_PSDK)"!="" && "$(PROF_EDITION)"==""
++.IF ("$(WINDOWS_VISTA_PSDK)"!="" && "$(PROF_EDITION)"=="") || "$(TARGET_OS)" == "MinGW"
+ DISABLE_ADO=TRUE
+ .ENDIF # "$(WINDOWS_VISTA_PSDK)"!="" && "$(PROF_EDITION)"==""
+
+--- dbaccess/source/ui/dlg/odbcconfig.cxx.~2~ 2008-11-05 10:14:38.000000000 +0100
++++ dbaccess/source/ui/dlg/odbcconfig.cxx 2008-11-04 17:22:07.000000000 +0100
+@@ -31,6 +31,15 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_dbaccess.hxx"
+
++#ifdef __MINGW32__
++#define Rectangle W32_Rectangle
++#include <windows.h>
++#define SDB_ODBC_CHAR SQLCHAR
++#include <odbcinst.h>
++#include <sqlext.h>
++#undef Yield
++#endif /* __MINGW32__ */
++
+ #ifndef _DBAUI_ODBC_CONFIG_HXX_
+ #include "odbcconfig.hxx"
+ #endif
+@@ -52,6 +61,9 @@
+ #ifndef _TOOLS_DEBUG_HXX
+ #include <tools/debug.hxx>
+ #endif
++#ifdef __MINGW32__
++#undef Rectangle
++#endif /* __MINGW32__ */
+ #ifndef _SV_SVAPP_HXX
+ #include <vcl/svapp.hxx>
+ #endif
+--- dbaccess/source/ui/dlg/ConnectionHelper.cxx.~1.19.~ 2008-05-05 17:56:49.000000000 +0200
++++ dbaccess/source/ui/dlg/ConnectionHelper.cxx 2009-02-16 21:37:10.000000000 +0100
+@@ -149,7 +149,7 @@
+ #ifndef _SFX_DOCFILT_HACK_HXX
+ #include <sfx2/docfilt.hxx>
+ #endif
+-#if !defined(WINDOWS_VISTA_PSDK) && (defined(WIN) || defined(WNT))
++#if !defined(WINDOWS_VISTA_PSDK) && !defined(__MINGW32__) && (defined(WIN) || defined(WNT))
+ #define _ADO_DATALINK_BROWSE_
+ #endif
+
diff --git a/patches/dev300/crosswin32-desktop-mingw.diff b/patches/dev300/crosswin32-desktop-mingw.diff
new file mode 100644
index 0000000..54f76c6
--- /dev/null
+++ b/patches/dev300/crosswin32-desktop-mingw.diff
@@ -0,0 +1,130 @@
+--- desktop/win32/source/setup/setup_w.cxx.~1.5.~ 2008-04-11 06:50:30.000000000 +0200
++++ desktop/win32/source/setup/setup_w.cxx 2008-11-05 15:53:43.000000000 +0100
+@@ -34,5 +34,9 @@
+ #define UNICODE 1
+ #define _UNICODE 1
+
++#ifdef __MINGW32__
++#define _ttempnam(a, b) (TCHAR*)tempnam ((char*)a, (char*)b)
++#endif
++
+ #include "setup.cpp"
+
+--- desktop/win32/source/setup/setup_a.cxx.~1.5.~ 2008-04-11 06:49:31.000000000 +0200
++++ desktop/win32/source/setup/setup_a.cxx 2008-11-05 15:52:36.000000000 +0100
+@@ -31,4 +31,8 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_desktop.hxx"
+
++#ifdef __MINGW32__
++#define _ttempnam tempnam
++#endif
++
+ #include "setup.cpp"
+--- desktop/win32/source/setup/rcheader.txt.~1.6.~ 2008-01-15 14:33:41.000000000 +0100
++++ desktop/win32/source/setup/rcheader.txt 2008-11-05 15:16:00.000000000 +0100
+@@ -7,7 +7,7 @@
+ #define CB_ADDSTRING (WM_USER+3)
+ #define IDC_STATIC (-1)
+ #endif
+-#include "resource.h"
++#include "Resource.h"
+
+ /////////////////////////////////////////////////////////////////////////////
+ //
+--- desktop/win32/source/setup/setup.cpp.~1.15.12.1.~ 2008-09-03 15:00:32.000000000 +0200
++++ desktop/win32/source/setup/setup.cpp 2008-11-05 15:52:16.000000000 +0100
+@@ -49,7 +49,7 @@
+
+ #include "setup.hxx"
+
+-#include "resource.h"
++#include "Resource.h"
+
+ //--------------------------------------------------------------------------
+
+--- desktop/win32/source/setup/makefile.mk.~1.12.~ 2008-04-11 06:48:48.000000000 +0200
++++ desktop/win32/source/setup/makefile.mk 2008-11-05 15:19:13.000000000 +0100
+@@ -92,4 +92,23 @@ APP1NOSVRES= $(RES)$/$(TARGET).res
+
+ $(RCFILES) : $(ULFDIR)$/setup.ulf makefile.mk rcfooter.txt rcheader.txt rctmpl.txt
+ $(WRAPCMD) lngconvex.exe -ulf $(ULFDIR)$/setup.ulf -rc $(RCFILES) -rct rctmpl.txt -rch rcheader.txt -rcf rcfooter.txt
++.IF "$(CROSS_COMPILING)" == "yes"
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f]["\\]\)@\\x00\1 at g' $@
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f]["\\]\)@\\x00\1 at g' $@
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f][0-9a-f]["\\]\)@\\x0\1 at g' $@
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f][0-9a-f]["\\]\)@\\x0\1 at g' $@
++ sed -i -e 's@\([ ,]\)"@\1L"@g' $@
++ sed -i -e 's at include L"@include "@' $@
++ pytt '\r\n' '\n' $@
++ pytt '^LANGUAGE 0x4d(.|\n)*' '' $@
++# sed -i -e 's@^LANGUAGE 0x211 at LANGUAGE 0x21@' $@
++# sed -i -e 's@^LANGUAGE 0x226 at LANGUAGE 0x26@' $@
++# sed -i -e 's@^LANGUAGE 0x22c at LANGUAGE 0x2c@' $@
++# sed -i -e 's@^LANGUAGE 0x22b at LANGUAGE 0x2b@' $@
++# sed -i -e 's@^LANGUAGE 0x30 at LANGUAGE 0x2d@' $@
++# sed -i -e 's@^LANGUAGE 0x73 at LANGUAGE 0x2a@' $@
++# sed -i -e 's@^LANGUAGE 0x31 at LANGUAGE 0x2e@' $@
++# sed -i -e 's@^LANGUAGE 0x33 at LANGUAGE 0x01@' $@
++# sed -i -e 's@^LANGUAGE 0x55 at LANGUAGE 0x22@' $@
++.ENDIF #"$(CROSS_COMPILING)" == "yes"
+
+--- desktop/util/verinfo.rc.~1.19.12.1.~ 2008-09-19 09:30:39.000000000 +0200
++++ desktop/util/verinfo.rc 2008-11-05 15:04:37.000000000 +0100
+@@ -149,7 +149,11 @@ VS_VERSION_INFO versioninfo
+ VS_VERSION_INFO rcdata
+ {
+ 0xF0, "sw", 0x0F, VER_YEAR, VER_MONTH, VER_DAY,
++#ifndef CROSS_COMPILING
+ VERSION, VERVARIANT, VER_COUNT
++#else
++ VERSION
++#endif
+ };
+
+
+--- desktop/util/ooverinfo.rc.~1.12.12.1.~ 2008-09-19 09:30:16.000000000 +0200
++++ desktop/util/ooverinfo.rc 2008-11-05 15:07:54.000000000 +0100
+@@ -144,7 +144,11 @@ VS_VERSION_INFO versioninfo
+ VS_VERSION_INFO rcdata
+ {
+ 0xF0, "sw", 0x0F, VER_YEAR, VER_MONTH, VER_DAY,
++#ifndef CROSS_COMPILING
+ VERSION, SUBVERSION, VERVARIANT, VER_COUNT
++#else
++ VERSION
++#endif
+ };
+
+
+--- desktop/source/pkgchk/unopkg/makefile.mk.~1.17.~ 2008-07-22 19:16:08.000000000 +0200
++++ desktop/source/pkgchk/unopkg/makefile.mk 2008-11-05 14:58:45.000000000 +0100
+@@ -55,7 +55,7 @@ APP1STDLIBS = $(SALLIB) $(UNOPKGAPPLIB)
+ APP1DEPN = $(SHL1TARGETN)
+ APP1NOSAL = TRUE
+ APP1RPATH = BRAND
+-.IF "$(OS)" == "WNT"
++.IF "$(TARGET_OS)" == "WNT"
+ APP1ICON = $(SOLARRESDIR)$/icons/so9_main_app.ico
+ APP1LINKRES = $(MISC)$/$(TARGET)1.res
+ .ENDIF
+@@ -66,7 +66,7 @@ APP2STDLIBS = $(SALLIB) $(UNOPKGAPPLIB)
+ APP2DEPN = $(SHL1TARGETN)
+ APP2NOSAL = TRUE
+ APP2RPATH = BRAND
+-.IF "$(OS)" == "WNT"
++.IF "$(TARGET_OS)" == "WNT"
+ APP2ICON = $(SOLARRESDIR)$/icons/ooo3_main_app.ico
+ APP2LINKRES = $(MISC)$/$(TARGET)2.res
+ .ENDIF
+--- desktop/source/deployment/misc/dp_misc.cxx.pristine 2009-04-06 12:16:26.807994125 +0200
++++ desktop/source/deployment/misc/dp_misc.cxx 2009-04-06 12:16:33.664089092 +0200
+@@ -55,7 +55,7 @@
+ #define UNICODE
+ #define _UNICODE
+ #define WIN32_LEAN_AND_MEAN
+-#include <Windows.h>
++#include <windows.h>
+ //#include "tools/postwin.h"
+ #endif
+
diff --git a/patches/dev300/crosswin32-dtrans-mingw.diff b/patches/dev300/crosswin32-dtrans-mingw.diff
new file mode 100644
index 0000000..e025ebf
--- /dev/null
+++ b/patches/dev300/crosswin32-dtrans-mingw.diff
@@ -0,0 +1,333 @@
+--- dtrans/test/win32/dnd/transferable.hxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/test/win32/dnd/transferable.hxx 2008-10-29 20:30:12.000000000 +0100
+@@ -35,7 +35,7 @@
+ //_________________________________________________________________________________________________________________________
+
+
+-//#include "..\ImplHelper.hxx"
++//#include "../ImplHelper.hxx"
+
+ //_________________________________________________________________________________________________________________________
+ // other includes
+@@ -66,7 +66,7 @@
+
+ #include <process.h>
+
+-#include "..\..\source\win32\ImplHelper.hxx"
++#include "../../source/win32/ImplHelper.hxx"
+
+
+ //-------------------------------------------------------------
+--- dtrans/source/win32/mtaole/MtaOleClipb.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/mtaole/MtaOleClipb.cxx 2008-10-29 20:30:09.000000000 +0100
+@@ -52,7 +52,7 @@
+ //#define UNICODE
+ #include <osl/diagnose.h>
+
+-#include "..\..\inc\MtaOleClipb.hxx"
++#include "../../inc/MtaOleClipb.hxx"
+ #include <osl/conditn.hxx>
+
+ #include <wchar.h>
+--- dtrans/source/win32/clipb/WinClipbImpl.hxx.pristine 2008-10-29 17:21:58.000000000 +0100
++++ dtrans/source/win32/clipb/WinClipbImpl.hxx 2008-10-29 17:22:16.000000000 +0100
+@@ -41,7 +41,7 @@
+ #include <com/sun/star/datatransfer/XTransferable.hpp>
+ #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
+ #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
+-#include "..\..\inc\MtaOleClipb.hxx"
++#include "../../inc/MtaOleClipb.hxx"
+
+ #if defined _MSC_VER
+ #pragma warning(push,1)
+--- dtrans/source/win32/clipb/WinClipbImpl.cxx.pristine 2008-10-29 17:22:36.000000000 +0100
++++ dtrans/source/win32/clipb/WinClipbImpl.cxx 2008-10-29 17:22:54.000000000 +0100
+@@ -38,11 +38,11 @@
+ #include "WinClipbImpl.hxx"
+
+ #include <systools/win32/comtools.hxx>
+-#include "..\..\inc\DtObjFactory.hxx"
+-#include "..\dtobj\APNDataObject.hxx"
++#include "../../inc/DtObjFactory.hxx"
++#include "../dtobj/APNDataObject.hxx"
+ #include "WinClipboard.hxx"
+ #include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp>
+-#include "..\dtobj\XNotifyingDataObject.hxx"
++#include "../dtobj/XNotifyingDataObject.hxx"
+
+ #if defined _MSC_VER
+ #pragma warning(push,1)
+--- dtrans/source/win32/ftransl/ftransl.hxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/ftransl/ftransl.hxx 2008-10-29 20:30:05.000000000 +0100
+@@ -42,7 +42,7 @@
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+ #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp>
+ #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
+-#include "..\misc\WinClip.hxx"
++#include "../misc/WinClip.hxx"
+
+ #include <vector>
+
+--- dtrans/source/win32/ftransl/ftransl.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/ftransl/ftransl.cxx 2008-10-29 20:30:05.000000000 +0100
+@@ -40,7 +40,7 @@
+ #include "ftransl.hxx"
+ #endif
+ #include <com/sun/star/datatransfer/XMimeContentType.hpp>
+-#include "..\misc\ImplHelper.hxx"
++#include "../misc/ImplHelper.hxx"
+
+ #if defined _MSC_VER
+ #pragma warning(push,1)
+--- dtrans/source/win32/misc/ImplHelper.cxx.pristine 2008-10-29 17:18:03.000000000 +0100
++++ dtrans/source/win32/misc/ImplHelper.cxx 2008-10-29 17:20:12.000000000 +0100
+@@ -49,7 +49,7 @@
+ #pragma warning(pop)
+ #endif
+ #ifdef __MINGW32__
+-#include <excpt.h>
++#include <sehandler.h>
+ #endif
+
+ //------------------------------------------------------------------------
+--- dtrans/source/win32/workbench/test_wincb.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/workbench/test_wincb.cxx 2008-10-29 20:30:06.000000000 +0100
+@@ -37,7 +37,7 @@
+ //_________________________________________________________________________________________________________________________
+
+
+-#include "..\misc\ImplHelper.hxx"
++#include "../misc/ImplHelper.hxx"
+
+ //_________________________________________________________________________________________________________________________
+ // other includes
+--- dtrans/source/win32/workbench/XTDo.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/workbench/XTDo.cxx 2008-10-29 20:28:07.000000000 +0100
+@@ -36,7 +36,7 @@
+ //------------------------------------------------------------------------
+ #include <osl/diagnose.h>
+
+-#include "..\DTransHelper.hxx"
++#include "../DTransHelper.hxx"
+
+ #ifndef _TWRAPPERDATAOBJECT_HXX_
+ #include "XTDo.hxx"
+--- dtrans/source/win32/dnd/source.hxx.pristine 2008-10-29 20:55:40.000000000 +0100
++++ dtrans/source/win32/dnd/source.hxx 2008-10-29 21:09:00.000000000 +0100
+@@ -43,6 +43,7 @@
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+ #include "../../inc/DtObjFactory.hxx"
+ #include "globals.hxx"
++#include <windows.h>
+ #include <oleidl.h>
+
+ #include <systools/win32/comtools.hxx>
+@@ -129,8 +130,10 @@ public:
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (RuntimeException);
+
+-
+-
++#ifdef __MINGW32__
++#undef STDMETHODCALLTYPE
++#define STDMETHODCALLTYPE
++#endif /* __MINGW32__ */
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+--- dtrans/source/win32/dnd/source.cxx.pristine 2008-10-29 20:59:32.000000000 +0100
++++ dtrans/source/win32/dnd/source.cxx 2008-10-29 21:08:39.000000000 +0100
+@@ -262,7 +262,7 @@ HRESULT STDMETHODCALLTYPE DragSource::Qu
+ //----------------------------------------------------
+ /**
+ */
+-ULONG STDMETHODCALLTYPE DragSource::AddRef( void)
++ULONG STDMETHODCALLTYPE DragSource::AddRef()
+ {
+ acquire();
+ return (ULONG) m_refCount;
+@@ -271,7 +271,7 @@ ULONG STDMETHODCALLTYPE DragSource::AddR
+ //----------------------------------------------------
+ /**
+ */
+-ULONG STDMETHODCALLTYPE DragSource::Release( void)
++ULONG STDMETHODCALLTYPE DragSource::Release()
+ {
+ ULONG ref= m_refCount;
+ release();
+--- dtrans/source/win32/dnd/target.hxx.pristine 2008-10-29 20:56:02.000000000 +0100
++++ dtrans/source/win32/dnd/target.hxx 2008-10-29 20:56:20.000000000 +0100
+@@ -46,6 +46,7 @@
+ #if defined _MSC_VER
+ #pragma warning(push,1)
+ #endif
++#include <windows.h>
+ #include <oleidl.h>
+ #if defined _MSC_VER
+ #pragma warning(pop)
+--- dtrans/source/win32/dtobj/TxtCnvtHlp.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/TxtCnvtHlp.cxx 2008-10-29 20:30:06.000000000 +0100
+@@ -37,7 +37,7 @@
+ #include <osl/diagnose.h>
+ #include "TxtCnvtHlp.hxx"
+ #include "DTransHelper.hxx"
+-#include "..\misc\ImplHelper.hxx"
++#include "../misc/ImplHelper.hxx"
+
+ using namespace ::com::sun::star::datatransfer;
+ using namespace ::com::sun::star::uno;
+--- dtrans/source/win32/dtobj/DOTransferable.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/DOTransferable.cxx 2008-10-29 20:30:06.000000000 +0100
+@@ -40,10 +40,10 @@
+ #ifndef _DOWRAPPERTRANSFERABLE_HXX_
+ #include "DOTransferable.hxx"
+ #endif
+-#include "..\misc\ImplHelper.hxx"
+-#include "..\misc\WinClip.hxx"
++#include "../misc/ImplHelper.hxx"
++#include "../misc/WinClip.hxx"
+ #include "DTransHelper.hxx"
+-#include "..\misc\ImplHelper.hxx"
++#include "../misc/ImplHelper.hxx"
+ #include "TxtCnvtHlp.hxx"
+ #include "MimeAttrib.hxx"
+ #include "FmtFilter.hxx"
+--- dtrans/source/win32/dtobj/FetcList.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/FetcList.cxx 2008-10-29 20:30:06.000000000 +0100
+@@ -43,8 +43,8 @@
+ #ifndef _DATAFORMATTRANSLATOR_HXX_
+ #include "DataFmtTransl.hxx"
+ #endif
+-#include "..\misc\ImplHelper.hxx"
+-#include "..\misc\WinClip.hxx"
++#include "../misc/ImplHelper.hxx"
++#include "../misc/WinClip.hxx"
+
+ #include <algorithm>
+
+--- dtrans/source/win32/dtobj/DtObjFactory.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/DtObjFactory.cxx 2008-10-29 20:30:09.000000000 +0100
+@@ -34,7 +34,7 @@
+ //------------------------------------------------------------------------
+ // includes
+ //------------------------------------------------------------------------
+-#include "..\..\inc\DtObjFactory.hxx"
++#include "../../inc/DtObjFactory.hxx"
+
+ #ifndef _TWRAPPERDATAOBJECT_HXX_
+ #include "XTDataObject.hxx"
+--- dtrans/source/win32/dtobj/Fetc.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/Fetc.cxx 2008-10-29 20:30:06.000000000 +0100
+@@ -36,7 +36,7 @@
+ //------------------------------------------------------------------------
+ #include <osl/diagnose.h>
+ #include "Fetc.hxx"
+-#include "..\misc\ImplHelper.hxx"
++#include "../misc/ImplHelper.hxx"
+
+ //------------------------------------------------------------------------
+ //
+--- dtrans/source/win32/dtobj/DataFmtTransl.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/DataFmtTransl.cxx 2008-10-29 20:30:06.000000000 +0100
+@@ -38,8 +38,8 @@
+ #include <rtl/string.hxx>
+ #include <osl/diagnose.h>
+ #include <rtl/tencinfo.h>
+-#include "..\misc\ImplHelper.hxx"
+-#include "..\misc\WinClip.hxx"
++#include "../misc/ImplHelper.hxx"
++#include "../misc/WinClip.hxx"
+ #include "MimeAttrib.hxx"
+ #include "DTransHelper.hxx"
+ #include <rtl/string.h>
+--- dtrans/source/win32/dtobj/XTDataObject.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/XTDataObject.cxx 2008-10-29 20:42:42.000000000 +0100
+@@ -39,8 +39,8 @@
+ #ifndef _TXDATAOBJECT_HXX_
+ #include "XTDataObject.hxx"
+ #endif
+-#include <com/sun/star/datatransfer/dataflavor.hpp>
+-#include "..\misc\ImplHelper.hxx"
++#include <com/sun/star/datatransfer/DataFlavor.hpp>
++#include "../misc/ImplHelper.hxx"
+ #include "DTransHelper.hxx"
+ #include "TxtCnvtHlp.hxx"
+ #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
+--- dtrans/source/win32/dtobj/XTDataObject.hxx.pristine 2008-10-29 20:41:49.000000000 +0100
++++ dtrans/source/win32/dtobj/XTDataObject.hxx 2008-10-29 20:41:28.000000000 +0100
+@@ -45,7 +45,7 @@
+ #endif
+
+ #ifndef _FETCLIST_HXX_
+-#include "FEtcList.hxx"
++#include "FetcList.hxx"
+ #endif
+
+ #if defined _MSC_VER
+--- dtrans/source/win32/dtobj/FmtFilter.cxx.pristine 2008-10-29 20:12:03.000000000 +0100
++++ dtrans/source/win32/dtobj/FmtFilter.cxx 2008-10-29 20:51:01.000000000 +0100
+@@ -38,9 +38,14 @@
+ #pragma warning(push,1)
+ #pragma warning(disable:4917)
+ #endif
+-#include <Shobjidl.h>
++#include <windows.h>
++#ifndef __MINGW32__
++#include <shobjidl.h>
++#else /* __MINGW32__ */
++#include <shlobj.h>
++#endif /* __MINGW32__ */
+ #include <shlguid.h>
+-#include <ObjIdl.h>
++#include <objidl.h>
+ #include <shellapi.h>
+ #if defined _MSC_VER
+ #pragma warning(pop)
+--- dtrans/source/win32/dtobj/XNotifyingDataObject.cxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/XNotifyingDataObject.cxx 2008-10-29 20:30:09.000000000 +0100
+@@ -32,9 +32,9 @@
+ #include "precompiled_dtrans.hxx"
+ #include <osl/diagnose.h>
+ #include "XNotifyingDataObject.hxx"
+-#include "..\clipb\WinClipbImpl.hxx"
+-#include "..\clipb\WinClipboard.hxx"
+-#include "..\..\inc\DtObjFactory.hxx"
++#include "../clipb/WinClipbImpl.hxx"
++#include "../clipb/WinClipboard.hxx"
++#include "../../inc/DtObjFactory.hxx"
+
+ #ifdef __MINGW32__
+ #define __uuidof(I) IID_##I
+--- dtrans/source/win32/dtobj/DTransHelper.hxx.pristine 2008-10-29 20:36:59.000000000 +0100
++++ dtrans/source/win32/dtobj/DTransHelper.hxx 2008-10-29 20:30:06.000000000 +0100
+@@ -43,7 +43,7 @@
+ #if defined _MSC_VER
+ #pragma warning(pop)
+ #endif
+-#include "..\misc\WinClip.hxx"
++#include "../misc/WinClip.hxx"
+
+ //------------------------------------------------------------------------
+ // defines
+--- dtrans/source/win32/dtobj/XNotifyingDataObject.hxx.pristine 2008-10-29 20:10:38.000000000 +0100
++++ dtrans/source/win32/dtobj/XNotifyingDataObject.hxx 2008-10-29 20:10:50.000000000 +0100
+@@ -43,8 +43,8 @@
+ #if defined _MSC_VER
+ #pragma warning(push,1)
+ #endif
+-#include <objidl.h>
+ #include <windows.h>
++#include <objidl.h>
+ #if defined _MSC_VER
+ #pragma warning(pop)
+ #endif
+--- dtrans/source/inc/MtaOleClipb.hxx.pristine 2008-10-29 20:11:24.000000000 +0100
++++ dtrans/source/inc/MtaOleClipb.hxx 2008-10-29 20:11:39.000000000 +0100
+@@ -37,6 +37,7 @@
+ #if defined _MSC_VER
+ #pragma warning(push,1)
+ #endif
++#include <windows.h>
+ #include <objidl.h>
+ #if defined _MSC_VER
+ #pragma warning(pop)
diff --git a/patches/dev300/crosswin32-embeddedobj-mingw.diff b/patches/dev300/crosswin32-embeddedobj-mingw.diff
new file mode 100644
index 0000000..5febe92
--- /dev/null
+++ b/patches/dev300/crosswin32-embeddedobj-mingw.diff
@@ -0,0 +1,259 @@
+--- embeddedobj/source/msole/olepersist.cxx.~1.39.~ 2008-07-22 16:39:36.000000000 +0200
++++ embeddedobj/source/msole/olepersist.cxx 2008-11-03 15:52:02.000000000 +0100
+@@ -176,7 +176,7 @@ sal_Bool KillFile_Impl( const ::rtl::OUS
+
+ return aResult;
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ ::rtl::OUString GetNewFilledTempFile_Impl( const uno::Reference< embed::XOptimizedStorage >& xParentStorage, const ::rtl::OUString& aEntryName, const uno::Reference< lang::XMultiServiceFactory >& xFactory )
+ throw( io::IOException, uno::RuntimeException )
+ {
+@@ -229,7 +229,7 @@ void LetCommonStoragePassBeUsed_Impl( co
+ xPropSet->setPropertyValue( ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ),
+ uno::makeAny( (sal_Bool)sal_True ) );
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ //------------------------------------------------------
+ void VerbExecutionController::StartControlExecution()
+ {
+@@ -818,7 +818,7 @@ uno::Reference< io::XStream > OleEmbedde
+ m_aTempURL = ::rtl::OUString();
+ }
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ // retry to create the component after recovering
+ GetRidOfComponent();
+
+@@ -889,7 +889,7 @@ void OleEmbeddedObject::SwitchOwnPersist
+ SwitchOwnPersistence( xNewParentStorage, xNewOwnStream, aNewName );
+ }
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ //----------------------------------------------
+ sal_Bool OleEmbeddedObject::SaveObject_Impl()
+ {
+@@ -1215,7 +1215,7 @@ void OleEmbeddedObject::StoreToLocation_
+
+ sal_Bool bStoreLoaded = sal_False;
+ if ( m_nObjectState == embed::EmbedStates::LOADED
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ // if the object was NOT modified after storing it can be just copied
+ // as if it was in loaded state
+ || ( m_pOleComponent && !m_pOleComponent->IsDirty() )
+@@ -1255,7 +1255,7 @@ void OleEmbeddedObject::StoreToLocation_
+ bVisReplIsStored = HasVisReplInStream();
+ bStoreLoaded = sal_True;
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ else if ( m_pOleComponent )
+ {
+ xTargetStream =
+@@ -1457,7 +1457,7 @@ void SAL_CALL OleEmbeddedObject::setPers
+ if ( lArguments[nInd].Name.equalsAscii( "ReadOnly" ) )
+ lArguments[nInd].Value >>= m_bReadOnly;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE;
+ #endif
+
+@@ -1467,7 +1467,7 @@ void SAL_CALL OleEmbeddedObject::setPers
+ if ( lObjArgs[nInd].Name.equalsAscii( "StoreVisualReplacement" ) )
+ lObjArgs[nInd].Value >>= m_bStoreVisRepl;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( nEntryConnectionMode == embed::EntryInitModes::DEFAULT_INIT )
+ {
+ if ( m_bFromClipboard )
+@@ -1864,7 +1864,7 @@ void SAL_CALL OleEmbeddedObject::storeOw
+
+ sal_Bool bStoreLoaded = sal_True;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_nObjectState != embed::EmbedStates::LOADED && m_pOleComponent && m_pOleComponent->IsDirty() )
+ {
+ bStoreLoaded = sal_False;
+@@ -2078,7 +2078,7 @@ void SAL_CALL OleEmbeddedObject::breakLi
+ uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_pOleComponent )
+ {
+ // TODO: create an object based on the link
+--- embeddedobj/source/msole/oleembed.cxx.~1.24.~ 2008-07-22 16:39:09.000000000 +0200
++++ embeddedobj/source/msole/oleembed.cxx 2008-11-03 15:52:51.000000000 +0100
+@@ -63,7 +63,7 @@
+
+ using namespace ::com::sun::star;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ //----------------------------------------------
+ void OleEmbeddedObject::SwitchComponentToRunningState_Impl()
+ {
+@@ -478,7 +478,7 @@ void SAL_CALL OleEmbeddedObject::changeS
+ if ( m_nObjectState == nNewState )
+ return;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_pOleComponent )
+ {
+ if ( m_nTargetState != -1 )
+@@ -631,7 +631,7 @@ uno::Sequence< sal_Int32 > SAL_CALL OleE
+ throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+ uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_pOleComponent )
+ {
+ if ( m_nObjectState == embed::EmbedStates::LOADED )
+@@ -705,7 +705,7 @@ void SAL_CALL OleEmbeddedObject::doVerb(
+ throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+ uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_pOleComponent )
+ {
+ sal_Int32 nOldState = m_nObjectState;
+@@ -822,7 +822,7 @@ uno::Sequence< embed::VerbDescriptor > S
+ if ( m_nObjectState == -1 )
+ throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
+ uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_pOleComponent )
+ {
+ // registry could be used in this case
+@@ -987,7 +987,7 @@ sal_Int64 SAL_CALL OleEmbeddedObject::ge
+
+ sal_Int64 nResult = 0;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_bGotStatus && m_nStatusAspect == nAspect )
+ nResult = m_nStatus;
+ else if ( m_pOleComponent )
+--- embeddedobj/source/msole/makefile.mk.~1.15.~ 2008-04-11 06:59:23.000000000 +0200
++++ embeddedobj/source/msole/makefile.mk 2008-11-01 14:30:00.000000000 +0100
+@@ -74,7 +74,7 @@ EXCEPTIONSFILES= \
+ $(SLO)$/olemisc.obj\
+ $(SLO)$/ownview.obj
+
+-.IF "$(GUI)"=="WNT"
++.IF "$(GUI)"=="WNT" && "$(CROSS_COMPILING)" == "no"
+
+ SLOFILES += \
+ $(SLO)$/graphconvert.obj\
+@@ -90,7 +90,7 @@ EXCEPTIONSFILES += \
+ $(SLO)$/xdialogcreator.obj\
+ $(SLO)$/advisesink.obj
+
+-.ENDIF
++.ENDIF # "$(GUI)"=="WNT" && "$(CROSS_COMPILING)"
+
+ SHL1OBJS= $(SLOFILES)
+
+--- embeddedobj/source/msole/olemisc.cxx.~1.28.~ 2008-07-22 16:39:22.000000000 +0200
++++ embeddedobj/source/msole/olemisc.cxx 2008-11-03 15:53:24.000000000 +0100
+@@ -112,7 +112,7 @@ OleEmbeddedObject::OleEmbeddedObject( co
+ , m_bTriedConversion( sal_False )
+ {
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ //------------------------------------------------------
+ // this constructor let object be initialized from clipboard
+ OleEmbeddedObject::OleEmbeddedObject( const uno::Reference< lang::XMultiServiceFactory >& xFactory )
+@@ -188,7 +188,7 @@ void OleEmbeddedObject::MakeEventListene
+ }
+ }
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ //----------------------------------------------
+ void OleEmbeddedObject::StateChangeNotification_Impl( sal_Bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState )
+ {
+@@ -233,7 +233,7 @@ void OleEmbeddedObject::StateChangeNotif
+ //------------------------------------------------------
+ void OleEmbeddedObject::GetRidOfComponent()
+ {
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ if ( m_pOleComponent )
+ {
+ if ( m_nObjectState != -1 && m_nObjectState != embed::EmbedStates::LOADED )
+--- embeddedobj/source/msole/oleregister.cxx.~1.6.~ 2008-04-11 07:01:19.000000000 +0200
++++ embeddedobj/source/msole/oleregister.cxx 2008-11-03 15:52:36.000000000 +0100
+@@ -65,7 +65,7 @@ void * SAL_CALL component_getFactory( co
+ OleEmbeddedObjectFactory::impl_staticCreateSelfInstance,
+ OleEmbeddedObjectFactory::impl_staticGetSupportedServiceNames() );
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ // the following service makes sence only on windows
+ else if ( aImplName.equals( MSOLEDialogObjectCreator::impl_staticGetImplementationName() ) )
+ {
+@@ -102,7 +102,7 @@ sal_Bool SAL_CALL component_writeInfo( v
+ for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ )
+ xNewKey->createKey( rServices.getConstArray()[ind] );
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ // the following service makes sence only on windows
+ xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) +
+ MSOLEDialogObjectCreator::impl_staticGetImplementationName() +
+--- embeddedobj/source/msole/platform.h.~1.7.~ 2008-04-11 07:02:49.000000000 +0200
++++ embeddedobj/source/msole/platform.h 2008-11-01 14:23:32.000000000 +0100
+@@ -42,7 +42,9 @@
+ #pragma warning(disable: 4548 4555 4917)
+ #endif
+ #include "windows.h"
+-#ifdef __MINGW32__
++#if defined (__MINGW32__) && defined (__CROSS__)
++#include <oleidl.h>
++#elif defined __MINGW32__
+ #include <atlbase.h>
+ #else
+ #if defined(_MSC_VER) && (_MSC_VER > 1310)
+--- embeddedobj/source/msole/olevisual.cxx.~1.22.~ 2008-07-22 16:39:49.000000000 +0200
++++ embeddedobj/source/msole/olevisual.cxx 2008-11-03 15:53:07.000000000 +0100
+@@ -120,7 +120,7 @@ void SAL_CALL OleEmbeddedObject::setVisu
+ throw embed::WrongStateException( ::rtl::OUString::createFromAscii( "The object is not loaded!\n" ),
+ uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ // RECOMPOSE_ON_RESIZE misc flag means that the object has to be switched to running state on resize.
+ // SetExtent() is called only for objects that require it,
+ // it should not be called for MSWord documents to workaround problem i49369
+@@ -202,7 +202,7 @@ awt::Size SAL_CALL OleEmbeddedObject::ge
+
+ awt::Size aResult;
+
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ // TODO/LATER: Support different aspects
+ if ( m_pOleComponent && !m_bHasSizeToSet && nAspect == embed::Aspects::MSOLE_CONTENT )
+ {
+@@ -365,7 +365,7 @@ embed::VisualRepresentation SAL_CALL Ole
+ {
+ return GetVisualRepresentationInNativeFormat_Impl( m_xCachedVisualRepresentation );
+ }
+-#ifdef WNT
++#if defined (WNT) && !defined (__CROSS__)
+ else if ( m_pOleComponent )
+ {
+ try
diff --git a/patches/dev300/crosswin32-external-mingwheaders.diff b/patches/dev300/crosswin32-external-mingwheaders.diff
new file mode 100644
index 0000000..f85e1f7
--- /dev/null
+++ b/patches/dev300/crosswin32-external-mingwheaders.diff
@@ -0,0 +1,71 @@
+--- external/mingwheaders/makefile.mk.pristine 2008-06-06 18:46:47.000000000 +0200
++++ external/mingwheaders/makefile.mk 2008-10-22 09:10:58.000000000 +0200
+@@ -35,17 +35,26 @@
+
+ .INCLUDE : settings.mk
+
+-.IF "$(OS)$(COM)" == "WNTGCC"
++.IF "$(OS)$(COM)" == "WNTGCC" && "$(CROSS_COMPILING)" != "yes"
++# patches fail with i686-mingw-gcc built from 4.1.1
++# How this is supposed to work, patching mingw header files
++# without patching the mingw libraries? Why not fix OO.o
++# client code to work with latest mingw?
+
+ # Cygwin and MinGW use different directories for the W32API headers
+ .IF "$(USE_MINGW)" == "cygwin"
+ MINGW_INCLUDE_DIR=$/usr$/include/mingw/include/
+ MINGW_W32API_INCLUDE_DIR=$/usr$/include/w32api/
+ MINGW_W32API_LIB_DIR=$/usr$/include/w32api/
+-.ELSE
++.ELIF "$(CROSS_COMPILING)" == "no"
+ MINGW_INCLUDE_DIR=$(COMPATH)$/include/
+ MINGW_W32API_INCLUDE_DIR=$(COMPATH)$/include/
+ MINGW_W32API_LIB_DIR=$(COMPATH)$/lib/
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++MINGW_INCLUDE_DIR=$(COMPATH)/../../include/
++MINGW_W32API_INCLUDE_DIR=$(COMPATH)/../../include/
++MINGW_W32API_LIB_DIR=$(COMPATH)/../../lib/
++PSDK_HOME=$(COMPATH)/../..
+ .ENDIF
+
+ SYS_INCLUDE_DIR=$(MINGW_INCLUDE_DIR)$/sys/
+@@ -184,29 +189,33 @@
+ $(COPY) $(FILES_TO_COPY_FROM_MINGW:^$(MINGW_INCLUDE_DIR)) $(MISC)$/mingw$/include
+ $(COPY) $(FILES_TO_COPY_FROM_W32API:^$(MINGW_W32API_INCLUDE_DIR)) $(MISC)$/mingw$/include
+ $(COPY) $(FILES_TO_COPY_FROM_SYS:^$(SYS_INCLUDE_DIR)) $(MISC)$/mingw$/include$/sys
+- $(COPY) $(FILES_TO_COPY_FROM_PSDK:^$(PSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
++ $(COPY) $(FILES_TO_COPY_FROM_PSDK:^$(PSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include || :
++.IF "$(DIRECTXSDK_HOME)" != ""
+ $(COPY) $(FILES_TO_COPY_FROM_DIRECTXSDK:^$(DIRECTXSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
++.ENDIF # "$(DIRECTXSDK_HOME)" != ""
+ $(TOUCH) $(MISC)$/mingwheader_copy
+
+ .IF "$(DISABLE_ATL)"==""
+ $(MINGWHEADER_ATL_COPY_TARGET):
+ $(MKDIRHIER) $(MISC)$/mingw$/include/atl
+ $(COPY) $(FILES_TO_COPY_FROM_ATL:^$(ATL_INCLUDE_DIR)) $(MISC)$/mingw$/include$/atl
+- $(TOUCH) $(MINGWHEADER_ATL_COPY_TARGET)
++ $(TOUCH) $(MINGWHEADER_ATL_COPY_TARGET)
+ .ENDIF
+
+ $(LB)$/libmsvcrt.a:
+ .IF "$(USE_MINGW)" == "cygwin"
+- $(WRAPCMD) nm -g --defined-only $(COMPATH)$/lib/mingw/libmsvcrt.a > $(MISC)$/msvcrt.nm
++ $(WRAPCMD) $(NM) -g --defined-only $(COMPATH)$/lib/mingw/libmsvcrt.a > $(MISC)$/msvcrt.nm
++.ELIF "$(CROSS_COMPILING)" == "no"
++ $(WRAPCMD) $(NM) -g --defined-only $(COMPATH)$/lib/libmsvcrt.a > $(MISC)$/msvcrt.nm
+ .ELSE
+- $(WRAPCMD) nm -g --defined-only $(COMPATH)$/lib/libmsvcrt.a > $(MISC)$/msvcrt.nm
+-.ENDIF
++ $(WRAPCMD) $(NM) -g --defined-only $(COMPATH)/../../lib/libmsvcrt.a > $(MISC)$/msvcrt.nm
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
+ echo EXPORTS > $(MISC)$/msvcrt.def
+ sed -ne 's/.* T _//p' $(MISC)$/msvcrt.nm | sort >> $(MISC)$/msvcrt.def
+ -sed -ne 's/.* I __imp__//p' $(MISC)$/msvcrt.nm | sort | diff - $(MISC)$/msvcrt.def | \
+ sed -ne 's/^< \(.*\)$/\1 DATA/p' > $(MISC)$/msvcrtdata.def
+ cat $(MISC)$/msvcrtdata.def >> $(MISC)$/msvcrt.def
+- dlltool --dllname msvcrt.dll --input-def=$(MISC)$/msvcrt.def --kill-at --output-lib=$(LB)$/libmsvcrt.a
++ $(DLLTOOL) --dllname msvcrt.dll --input-def=$(MISC)$/msvcrt.def --kill-at --output-lib=$(LB)$/libmsvcrt.a
+
+ clean:
+ -$(RM) $(MISC)$/mingw$/include$/*.h
diff --git a/patches/dev300/crosswin32-fpicker-mingw.diff b/patches/dev300/crosswin32-fpicker-mingw.diff
new file mode 100644
index 0000000..10cef1e
--- /dev/null
+++ b/patches/dev300/crosswin32-fpicker-mingw.diff
@@ -0,0 +1,261 @@
+--- fpicker/source/win32/folderpicker/MtaFop.hxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/folderpicker/MtaFop.hxx 2008-10-31 17:44:49.000000000 +0100
+@@ -48,7 +48,7 @@
+ #if defined _MSC_VER
+ #pragma warning(pop)
+ #endif
+-#include "..\misc\WinImplHelper.hxx"
++#include "../misc/WinImplHelper.hxx"
+
+ //----------------------------------------------------------------
+ // a simple helper class used to provide a buffer for different
+--- fpicker/source/win32/folderpicker/makefile.mk.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/folderpicker/makefile.mk 2008-10-31 17:44:49.000000000 +0100
+@@ -45,9 +45,9 @@ COMP1TYPELIST=$(TARGET)
+ # enable rtti
+ CFLAGS+=-GR
+
+-SLOFILES=$(SLO)$/fopentry.obj\
+- $(SLO)$/folderpicker.obj\
+- $(SLO)$/WinFopImpl.obj\
++SLOFILES=$(SLO)$/Fopentry.obj\
++ $(SLO)$/FolderPicker.obj\
++ $(SLO)$/WinFOPImpl.obj\
+ $(SLO)$/MtaFop.obj
+
+ # --- Targets ------------------------------------------------------
+--- fpicker/source/win32/folderpicker/Fopentry.cxx.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/folderpicker/Fopentry.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -39,7 +39,7 @@
+ #include <osl/diagnose.h>
+
+ #ifndef _FILEPICKER_HXX_
+-#include "folderpicker.hxx"
++#include "FolderPicker.hxx"
+ #endif
+
+ #ifndef _FPSERVICEINFO_HXX_
+--- fpicker/source/win32/folderpicker/workbench/Test_fops.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/folderpicker/workbench/Test_fops.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -62,7 +62,7 @@
+ #include <stdio.h>
+
+ #ifndef _FPSERVICEINFO_HXX_
+-#include "..\FOPServiceInfo.hxx"
++#include "../FOPServiceInfo.hxx"
+ #endif
+
+ #include <osl/file.hxx>
+--- fpicker/source/win32/folderpicker/FolderPicker.cxx.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/folderpicker/FolderPicker.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -37,7 +37,7 @@
+ #include <osl/diagnose.h>
+
+ #ifndef _FOLDERPICKER_HXX_
+-#include "folderpicker.hxx"
++#include "FolderPicker.hxx"
+ #endif
+ #include <com/sun/star/lang/DisposedException.hpp>
+ #include "WinFOPImpl.hxx"
+--- fpicker/source/win32/folderpicker/MtaFop.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/folderpicker/MtaFop.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -36,7 +36,7 @@
+ #include "MtaFop.hxx"
+ #include <wchar.h>
+ #include <process.h>
+-#include "..\misc\resourceprovider.hxx"
++#include "../misc/resourceprovider.hxx"
+
+ #include <systools/win32/comtools.hxx>
+
+--- fpicker/source/win32/filepicker/FilePicker.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/FilePicker.cxx 2008-10-31 18:47:21.000000000 +0100
+@@ -41,12 +41,12 @@
+ #include <osl/diagnose.h>
+
+ #ifndef _FILEPICKER_HXX_
+-#include "filepicker.hxx"
++#include "FilePicker.hxx"
+ #endif
+ #include "WinFileOpenImpl.hxx"
+
+ #include "FPServiceInfo.hxx"
+-#include "..\misc\WinImplHelper.hxx"
++#include "../misc/WinImplHelper.hxx"
+ #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+ #include "filepickereventnotification.hxx"
+
+--- fpicker/source/win32/filepicker/VistaFilePicker.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/VistaFilePicker.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -41,7 +41,7 @@
+
+ #include "VistaFilePicker.hxx"
+ #include "WinFileOpenImpl.hxx"
+-#include "..\misc\WinImplHelper.hxx"
++#include "../misc/WinImplHelper.hxx"
+ #include "shared.hxx"
+
+ #include <com/sun/star/lang/DisposedException.hpp>
+--- fpicker/source/win32/filepicker/controlaccess.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/controlaccess.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -38,7 +38,7 @@
+ #include <tchar.h>
+ #include <osl/diagnose.h>
+ #include "controlaccess.hxx"
+-#include "..\misc\WinImplHelper.hxx"
++#include "../misc/WinImplHelper.hxx"
+
+ //------------------------------------------------------------
+ // we are using a table based algorithm to dispatch control
+--- fpicker/source/win32/filepicker/makefile.mk.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/filepicker/makefile.mk 2008-10-31 17:44:49.000000000 +0100
+@@ -55,7 +55,7 @@ CDEFS+=-UWINVER -DWINVER=0x500
+ # --- Resources ----------------------------------------------------
+
+ .IF "$(GUI)" == "WNT"
+-RCFILES=fps.rc
++RCFILES=Fps.rc
+ .ENDIF
+
+ # --- Files --------------------------------------------------------
+@@ -80,9 +80,14 @@ SLOFILES=$(SLO)$/FileOpenDlg.obj\
+ $(SLO)$/customcontrolfactory.obj\
+ $(SLO)$/dialogcustomcontrols.obj\
+ $(SLO)$/asyncrequests.obj\
++#
++
++.IF "$(CROSS_COMPILING)" == "no"
++SLOFILES +=\
+ $(SLO)$/VistaFilePickerEventHandler.obj\
+ $(SLO)$/VistaFilePickerImpl.obj\
+ $(SLO)$/VistaFilePicker.obj
++.ENDIF # "$(CROSS_COMPILING)" == "no"
+
+ # --- Targets ------------------------------------------------------
+
+--- fpicker/source/win32/filepicker/WinFileOpenImpl.hxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/WinFileOpenImpl.hxx 2008-10-31 17:44:49.000000000 +0100
+@@ -47,7 +47,7 @@
+ #include "helppopupwindow.hxx"
+ #include "customcontrol.hxx"
+ #include "customcontrolfactory.hxx"
+-#include "..\misc\resourceprovider.hxx"
++#include "../misc/resourceprovider.hxx"
+
+ #include <utility>
+ #include <memory>
+--- fpicker/source/win32/filepicker/comptr.hxx.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/filepicker/comptr.hxx 2008-10-31 17:44:49.000000000 +0100
+@@ -33,7 +33,9 @@
+
+ #include <sal/types.h>
+ #include <osl/diagnose.h>
++#ifndef __MINGW32__
+ #include <shobjidl.h>
++#endif /* __MINGW32__ */
+
+ template< class T_INTERFACE ,
+ REFIID P_IID = IID_NULL ,
+--- fpicker/source/win32/filepicker/WinFileOpenImpl.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/WinFileOpenImpl.cxx 2008-10-31 18:47:42.000000000 +0100
+@@ -44,11 +44,11 @@
+ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+ #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+ #include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
+-#include <com/sun/star/ui/dialogs/ListBoxControlActions.hpp>
+-#include "..\misc\WinImplHelper.hxx"
++#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
++#include "../misc/WinImplHelper.hxx"
+
+ #ifndef _FILEPICKER_HXX_
+-#include "filepicker.hxx"
++#include "FilePicker.hxx"
+ #endif
+ #include "controlaccess.hxx"
+ #include <rtl/ustrbuf.hxx>
+--- fpicker/source/win32/filepicker/workbench/Test_fps.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/workbench/Test_fps.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -70,7 +70,7 @@
+ #include <stdio.h>
+ #include <windows.h>
+
+-#include "..\FPServiceInfo.hxx"
++#include "../FPServiceInfo.hxx"
+
+ //
+ // namesapces
+--- fpicker/source/win32/filepicker/filepickerstate.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/filepickerstate.cxx 2008-10-31 18:47:58.000000000 +0100
+@@ -39,7 +39,7 @@
+ #include "controlaccess.hxx"
+ #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+ #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+-#include <com/sun/star/ui/dialogs/ListBoxControlActions.hpp>
++#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
+ #include <com/sun/star/ui/dialogs/ControlActions.hpp>
+ #include "controlcommandrequest.hxx"
+ #include "controlcommandresult.hxx"
+@@ -49,7 +49,7 @@
+ #include "FileOpenDlg.hxx"
+
+ #include <memory>
+-#include "..\misc\WinImplHelper.hxx"
++#include "../misc/WinImplHelper.hxx"
+ //---------------------------------------------
+ //
+ //---------------------------------------------
+--- fpicker/source/win32/filepicker/getfilenamewrapper.cxx.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/filepicker/getfilenamewrapper.cxx 2008-10-31 17:44:49.000000000 +0100
+@@ -48,6 +48,10 @@
+ #pragma warning(pop)
+ #endif
+
++#ifdef __MINGW32__
++#include <ole2.h>
++#endif /* __MINGW32__ */
++
+ namespace /* private */
+ {
+
+--- fpicker/source/win32/filepicker/FPentry.cxx.pristine 2008-10-29 21:13:36.000000000 +0100
++++ fpicker/source/win32/filepicker/FPentry.cxx 2008-10-31 18:45:17.000000000 +0100
+@@ -41,8 +41,10 @@
+ #include "FPServiceInfo.hxx"
+
+ #pragma warning (disable:4917)
++#ifndef __MINGW32__
+ #include "VistaFilePicker.hxx"
+-#include "..\misc\WinImplHelper.hxx"
++#endif /* __MINGW32__ */
++#include "../misc/WinImplHelper.hxx"
+ #include <stdio.h>
+
+ //-----------------------------------------------
+@@ -66,6 +68,7 @@ static Reference< XInterface > SAL_CALL
+ const Reference< XMultiServiceFactory >& rServiceManager )
+ {
+ Reference< XInterface > xDlg;
++#ifndef __MINGW32__
+ bool bVista = IsWindowsVista();
+
+ if (bVista)
+@@ -76,6 +79,7 @@ static Reference< XInterface > SAL_CALL
+ new ::fpicker::win32::vista::VistaFilePicker( rServiceManager ) ) );
+ }
+ else
++#endif /* __MINGW32__ */
+ {
+ fprintf(stdout, "use normal system file picker ...\n");
+ xDlg.set(
+--- fpicker/source/win32/filepicker/vistatypes.h.pristine 2008-10-31 17:41:41.000000000 +0100
++++ fpicker/source/win32/filepicker/vistatypes.h 2008-10-31 17:44:49.000000000 +0100
+@@ -36,7 +36,9 @@
+ //-----------------------------------------------------------------------------
+
+ #include "comptr.hxx"
++#ifndef __MINGW32__
+ #include <shobjidl.h>
++#endif /* __MINGW32__ */
+
+ //-----------------------------------------------------------------------------
+ // namespace
diff --git a/patches/dev300/crosswin32-funit-char-line.diff b/patches/dev300/crosswin32-funit-char-line.diff
new file mode 100644
index 0000000..27daa07
--- /dev/null
+++ b/patches/dev300/crosswin32-funit-char-line.diff
@@ -0,0 +1,23 @@
+--- ./rsc/inc/vclrsc.hxx.old 2009-04-02 10:44:31.000000000 +0000
++++ ./rsc/inc/vclrsc.hxx 2009-04-06 16:41:41.000000000 +0000
+@@ -176,7 +176,7 @@ typedef sal_Int64 WinBits;
+ // from vcl/inc/fldunit.hxx
+ enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
+ FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
+- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
++ FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CHAR, FUNIT_LINE, FUNIT_CUSTOM,
+ FUNIT_PERCENT, FUNIT_100TH_MM };
+
+
+--- ./rsc/source/parser/rscibas.cxx.old 2009-04-02 10:44:31.000000000 +0000
++++ ./rsc/source/parser/rscibas.cxx 2009-04-06 16:41:41.000000000 +0000
+@@ -240,6 +240,9 @@ RscEnum * RscTypCont::InitFieldUnitsType
+ SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT );
+ SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE );
+ SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM );
++ // Amelia : adds two units ,"char" and "line"
++ SETCONST( pFieldUnits, "FUNIT_CHAR", FUNIT_CHAR );
++ SETCONST( pFieldUnits, "FUNIT_LINE", FUNIT_LINE );
+ SETCONST( pFieldUnits, "FUNIT_PERCENT", FUNIT_PERCENT );
+
+ return pFieldUnits;
diff --git a/patches/dev300/crosswin32-goodies-mingw.diff b/patches/dev300/crosswin32-goodies-mingw.diff
new file mode 100644
index 0000000..39527d0
--- /dev/null
+++ b/patches/dev300/crosswin32-goodies-mingw.diff
@@ -0,0 +1,11 @@
+--- goodies/source/inv/makefile.mk.~1.21.~ 2008-07-22 19:45:33.000000000 +0200
++++ goodies/source/inv/makefile.mk 2009-02-15 21:35:25.000000000 +0100
+@@ -114,7 +114,7 @@ $(BIN)$/applicat.rdb : makefile.mk $(SOL
+ rm -f $@
+ $(GNUCOPY) $(SOLARBINDIR)$/types.rdb $@
+ cd $(BIN) && \
+- regcomp -register -r applicat.rdb \
++ $(REGCOMP) -register -r applicat.rdb \
+ -c i18npool.uno$(DLLPOST)
+
+ # --- Def-File ---
diff --git a/patches/dev300/crosswin32-helpcontent2-mingw.diff b/patches/dev300/crosswin32-helpcontent2-mingw.diff
new file mode 100644
index 0000000..ad4b84f
--- /dev/null
+++ b/patches/dev300/crosswin32-helpcontent2-mingw.diff
@@ -0,0 +1,18 @@
+--- helpcontent2/util/target.pmk.pristine 2009-04-22 11:13:36.202219858 +0200
++++ helpcontent2/util/target.pmk 2009-04-22 11:15:17.262216225 +0200
+@@ -38,8 +38,14 @@ ALLTAR : $(LINKALLTARGETS)
+ JAVA_LIBRARY_PATH= -Djava.library.path=$(SOLARSHAREDBIN)
+ .ENDIF
+
++.IF "$(CROSS_COMPILING)" == "no"
++HELPLINKER=HelpLinker
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++HELPLINKER=$(SOLARBINDIR)/HelpLinker.exe
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ $(LINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) $(COMMONMISC)$/$$(@:b:s/_/./:e:s/.//)/$i) $(subst,LANGUAGE,$$(@:b:s/_/./:e:s/.//) $(LINKADDEDDEPS)) $(COMMONMISC)$/xhp_changed.flag $(PRJ)$/helpers$/hid.lst
+- $(WRAPCMD) HelpLinker @$(mktmp -mod $(LINKNAME) -hid $(PRJ)$/helpers/hid.lst -src $(COMMONMISC) -sty $(PRJ)$/source$/auxiliary$/embed.xsl -zipdir $(MISC)$/ziptmp$(@:b) -idxcaption $(PRJ)$/source$/auxiliary$/idxcaption.xsl -idxcontent $(PRJ)$/source$/auxiliary$/idxcontent.xsl -lang {$(subst,$(LINKNAME)_, $(@:b))} $(subst,LANGUAGE,{$(subst,$(LINKNAME)_, $(@:b))} $(LINKADDEDFILES)) $(foreach,i,$(LINKLINKFILES) $(COMMONMISC)$/{$(subst,$(LINKNAME)_, $(@:b))}/$i) -o $@)
++ $(WRAPCMD) $(HELPLINKER) @$(mktmp -mod $(LINKNAME) -hid $(PRJ)$/helpers/hid.lst -src $(COMMONMISC) -sty $(PRJ)$/source$/auxiliary$/embed.xsl -zipdir $(MISC)$/ziptmp$(@:b) -idxcaption $(PRJ)$/source$/auxiliary$/idxcaption.xsl -idxcontent $(PRJ)$/source$/auxiliary$/idxcontent.xsl -lang {$(subst,$(LINKNAME)_, $(@:b))} $(subst,LANGUAGE,{$(subst,$(LINKNAME)_, $(@:b))} $(LINKADDEDFILES)) $(foreach,i,$(LINKLINKFILES) $(COMMONMISC)$/{$(subst,$(LINKNAME)_, $(@:b))}/$i) -o $@)
+ .IF "$(SOLAR_JAVA)" == "TRUE"
+ $(JAVAI) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" com.sun.star.help.HelpIndexer -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir $(MISC)$/ziptmp$(@:b) -o $@
+ .ELSE
diff --git a/patches/dev300/crosswin32-i18npool-cross.diff b/patches/dev300/crosswin32-i18npool-cross.diff
new file mode 100644
index 0000000..dccd2d9
--- /dev/null
+++ b/patches/dev300/crosswin32-i18npool-cross.diff
@@ -0,0 +1,103 @@
+i18npool/source/textconversion/data/makefile.mk
+--- i18npool/source/textconversion/data/makefile.mk.~1.7.~ 2008-04-10 11:11:44.000000000 +0200
++++ i18npool/source/textconversion/data/makefile.mk 2008-10-28 16:48:36.000000000 +0100
+@@ -64,9 +64,16 @@ LIB1OBJFILES=$(SHL1OBJS)
+ .INCLUDE : target.mk
+
+ APP1TARGET = genconv_dict
++
++.IF "$(CROSS_COMPILING)" == "no"
++GENCONV_DICT = $(BIN)$/genconv_dict$(EXECPOST)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++GENCONV_DICT = $(OOO_TOOLS_DIR)/genconv_dict
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ $(MISC)$/%.cxx : %.dic
+- $(BIN)$/genconv_dict $* $< $@
++ $(GENCONV_DICT) $* $< $@
+
+ # ugly - is this dependency really required here?
+-$(foreach,i,$(shell @$(FIND) . -name "*.dic") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/genconv_dict$(EXECPOST)
++$(foreach,i,$(shell @$(FIND) . -name "*.dic") $(MISC)$/dict_$(i:b).cxx) : $(GENCONV_DICT)
+
+i18npool/source/localedata/data/makefile.mk
+--- i18npool/source/localedata/data/makefile.mk.~1.47.~ 2008-04-10 11:06:09.000000000 +0200
++++ i18npool/source/localedata/data/makefile.mk 2008-10-28 16:45:45.000000000 +0100
+@@ -486,7 +486,13 @@ DEPOBJFILES= \
+
+ $(MY_MISC_CXXFILES) : $(BIN)$/saxparser$(EXECPOST)
+
++.IF "$(CROSS_COMPILING)" == "no"
++SAXPARSER = $(BIN)$/saxparser$(EXECPOST)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++SAXPARSER = $(OOO_TOOLS_DIR)/saxparser
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ $(MISC)$/localedata_%.cxx : %.xml
+- $(WRAPCMD) $(BIN)$/saxparser $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb
++ $(WRAPCMD) $(SAXPARSER) $* $< $@ $(BIN)$/$(@:b).rdb $(SOLARBINDIR)$/types.rdb
+ $(RM) $(BIN)$/$(@:b).rdb
+
+i18npool/source/collator/data/makefile.mk
+--- i18npool/source/collator/data/makefile.mk.~1.7.~ 2008-04-10 10:58:10.000000000 +0200
++++ i18npool/source/collator/data/makefile.mk 2008-10-28 16:42:36.000000000 +0100
+@@ -60,9 +60,15 @@ SHL1OBJS=$(SLOFILES)
+ # --- Targets ------------------------------------------------------
+ .INCLUDE : target.mk
+
++.IF "$(CROSS_COMPILING)" == "no"
++GENCOLL_RULE = $(BIN)$/gencoll_rule$(EXECPOST)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++GENCOLL_RULE = $(OOO_TOOLS_DIR)/gencoll_rule
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ $(MISC)$/collator_%.cxx : %.txt
+- $(BIN)$/gencoll_rule $< $@ $*
++ $(GENCOLL_RULE) $< $@ $*
+
+ # ugly - is this dependency really required here?
+-$(foreach,i,$(shell @$(FIND) . -name "*.txt") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/gencoll_rule$(EXECPOST)
++$(foreach,i,$(shell @$(FIND) . -name "*.txt") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/$(GENCOLL_RULE)
+
+i18npool/source/indexentry/data/makefile.mk
+--- i18npool/source/indexentry/data/makefile.mk.~1.7.~ 2008-04-10 11:01:24.000000000 +0200
++++ i18npool/source/indexentry/data/makefile.mk 2008-10-28 16:44:07.000000000 +0100
+@@ -63,9 +63,15 @@ LIB1OBJFILES=$(SHL1OBJS)
+ # --- Targets ------------------------------------------------------
+ .INCLUDE : target.mk
+
++.IF "$(CROSS_COMPILING)" == "no"
++GENINDEX_DATA = $(BIN)$/genindex_data$(EXECPOST)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++GENINDEX_DATA = $(OOO_TOOLS_DIR)/genindex_data
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ $(MISC)$/%.cxx : %.txt
+- $(BIN)$/genindex_data $< $@ $*
++ $(GENINDEX_DATA) $< $@ $*
+
+ # ugly - is this dependency really required here?
+-$(foreach,i,$(shell @$(FIND) . -name "*.txt") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/genindex_data$(EXECPOST)
++$(foreach,i,$(shell @$(FIND) . -name "*.txt") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/$(GENINDEX_DATA)
+
+i18npool/source/breakiterator/data/makefile.mk
+--- i18npool/source/breakiterator/data/makefile.mk.~1.9.~ 2008-04-10 10:54:04.000000000 +0200
++++ i18npool/source/breakiterator/data/makefile.mk 2008-10-28 16:40:03.000000000 +0100
+@@ -80,9 +80,15 @@ DEPOBJFILES= \
+ # --- Targets ------------------------------------------------------
+ .INCLUDE : target.mk
+
++.IF "$(CROSS_COMPILING)" == "no"
++GENDICT = $(BIN)$/gendict$(EXECPOST)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++GENDICT = $(OOO_TOOLS_DIR)/gendict
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ $(MISC)$/dict_%.cxx : %.dic
+- $(BIN)$/gendict $< $@
++ $(GENDICT) $< $@
+
+ # ugly - is this dependency really required here?
+-$(foreach,i,$(shell @$(FIND) . -name "*.dic") $(MISC)$/dict_$(i:b).cxx) : $(BIN)$/gendict$(EXECPOST)
++$(foreach,i,$(shell @$(FIND) . -name "*.dic") $(MISC)$/dict_$(i:b).cxx) : $(GENDICT)
+
diff --git a/patches/dev300/crosswin32-i18npool-mingw.diff b/patches/dev300/crosswin32-i18npool-mingw.diff
new file mode 100644
index 0000000..364a3da
--- /dev/null
+++ b/patches/dev300/crosswin32-i18npool-mingw.diff
@@ -0,0 +1,16 @@
+i18npool/source/collator/collator_unicode.cxx
+--- i18npool/source/collator/collator_unicode.cxx.~1.20.~ 2008-04-10 10:57:26.000000000 +0200
++++ i18npool/source/collator/collator_unicode.cxx 2008-10-28 16:31:43.000000000 +0100
+@@ -135,9 +135,9 @@ Collator_Unicode::loadCollatorAlgorithm(
+ uppercase itself, so we don't have to bother with that.
+ */
+ icu::Locale icuLocale(
+- OUStringToOString(rLocale.Language, RTL_TEXTENCODING_ASCII_US).getStr(),
+- OUStringToOString(rLocale.Country, RTL_TEXTENCODING_ASCII_US).getStr(),
+- OUStringToOString(rAlgorithm, RTL_TEXTENCODING_ASCII_US).getStr());
++ (char const*)OUStringToOString(rLocale.Language, RTL_TEXTENCODING_ASCII_US).getStr(),
++ (char const*)OUStringToOString(rLocale.Country, RTL_TEXTENCODING_ASCII_US).getStr(),
++ (char const*)OUStringToOString(rAlgorithm, RTL_TEXTENCODING_ASCII_US).getStr());
+ // load ICU collator
+ collator = (RuleBasedCollator*) icu::Collator::createInstance(icuLocale, status);
+ if (! U_SUCCESS(status)) throw RuntimeException();
diff --git a/patches/dev300/crosswin32-icc-cross.diff b/patches/dev300/crosswin32-icc-cross.diff
new file mode 100644
index 0000000..7618ba3
--- /dev/null
+++ b/patches/dev300/crosswin32-icc-cross.diff
@@ -0,0 +1,16 @@
+--- icc/makefile.mk.orig 2009-06-25 12:18:15.000000000 +0200
++++ icc/makefile.mk 2009-06-25 12:21:09.000000000 +0200
+@@ -55,7 +55,13 @@
+ Contrib$/ICC_utils$/Vetters.cpp
+
+ CONFIGURE_ACTION= $(GNUCOPY) -r $(BACK_PATH)..$/source$/create_sRGB_profile Contrib$/CmdLine && unzip $(BACK_PATH)..$/makefiles.zip
++
++.IF "$(CROSS_COMPILING)" == "no"
++BUILD_ACTION=dmake && cd Contrib$/CmdLine$/create_sRGB_profile && .$/create_sRGB_profile
++.ELSE
++# FIXME: should use CC_FOR_BUILD to build the thing here
+ BUILD_ACTION=dmake && cd Contrib$/CmdLine$/create_sRGB_profile && .$/create_sRGB_profile
++.ENDIF
+
+ # --- Targets ------------------------------------------------------
+
diff --git a/patches/dev300/crosswin32-instsetoo_native-mingw.diff b/patches/dev300/crosswin32-instsetoo_native-mingw.diff
new file mode 100644
index 0000000..1c859ba
--- /dev/null
+++ b/patches/dev300/crosswin32-instsetoo_native-mingw.diff
@@ -0,0 +1,11 @@
+--- instsetoo_native/util/makefile.mk.pristine 2008-11-09 20:12:40.000000000 +0100
++++ instsetoo_native/util/makefile.mk 2008-11-09 20:11:53.000000000 +0100
+@@ -96,7 +96,7 @@ LOCALPYFILES= \
+ # native - "Native" software distribution for the platform
+ # portable - Portable software distribution
+
+-.IF "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
++.IF "$(BUILD_OS)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
+ ALLTAR : $(LOCALPYFILES)
+ @echo "No EPM: do no packaging at this stage"
+ .ELSE # "$(GUI)"!="WNT" && "$(EPM)"=="NO" && "$(USE_PACKAGER)"==""
diff --git a/patches/dev300/crosswin32-lingucomponent-mingw.diff b/patches/dev300/crosswin32-lingucomponent-mingw.diff
new file mode 100644
index 0000000..92bc977
--- /dev/null
+++ b/patches/dev300/crosswin32-lingucomponent-mingw.diff
@@ -0,0 +1,11 @@
+--- lingucomponent/source/lingutil/lingutil.cxx.~1.4.~ 2008-06-13 16:02:52.000000000 +0200
++++ lingucomponent/source/lingutil/lingutil.cxx 2008-11-06 14:14:09.000000000 +0100
+@@ -36,7 +36,7 @@
+ #endif
+
+ #if defined(WNT)
+-#include <Windows.h>
++#include <windows.h>
+ #endif
+
+ #if defined(WNT)
diff --git a/patches/dev300/crosswin32-o3tl-no-cppunit.diff b/patches/dev300/crosswin32-o3tl-no-cppunit.diff
new file mode 100644
index 0000000..c26eb99
--- /dev/null
+++ b/patches/dev300/crosswin32-o3tl-no-cppunit.diff
@@ -0,0 +1,8 @@
+--- o3tl/prj/build.lst.pristine 2009-04-06 09:29:17.000000000 +0200
++++ o3tl/prj/build.lst 2009-04-06 09:29:23.000000000 +0200
+@@ -2,4 +2,4 @@ ot o3tl : sal testshl2 BOOST:boost NULL
+ ot o3tl usr1 - all ot_mkout NULL
+ ot o3tl\inc get - all ot_inc NULL
+ ot o3tl\prj get - all ot_prj NULL
+-ot o3tl\qa nmake - all ot_qa NULL
++#ot o3tl\qa nmake - all ot_qa NULL
diff --git a/patches/dev300/crosswin32-postprocess-mingw.diff b/patches/dev300/crosswin32-postprocess-mingw.diff
new file mode 100644
index 0000000..e32ca8b
--- /dev/null
+++ b/patches/dev300/crosswin32-postprocess-mingw.diff
@@ -0,0 +1,26 @@
+Too bad, our rebase has other arguments, and they're not trivial to translate.
+
+rebase -C ../wntgcci.pro/misc/coffbase.txt -b 0x68000000 -e 10000 -l ../wntgcci.pro/misc/rebase_log.txt -R /home/janneke/vc/gub/target/mingw/build/openoffice-trunk/build/ooo300-m9/solver/300/wntgcci.pro/bin -N no_rebase.txt -d -v @../wntgcci.pro/misc/rebase_new.txt
+/home/janneke/vc/gub/target/tools/root/usr/bin/rebase: unknown option -- C
+usage: rebase -b BaseAddress [-Vdv] [-o Offset] [-T FileList | -] Files...
+Error: rebase failed with exit code 1!
+
+
+--- postprocess/rebase/makefile.mk.~1.10.~ 2008-04-10 10:48:57.000000000 +0200
++++ postprocess/rebase/makefile.mk 2008-11-07 17:46:19.000000000 +0100
+@@ -48,13 +48,13 @@ IMAGENAMES=$(SOLARBINDIR)$/*.dll $(SOLAR
+ ALLTAR : REBASE
+
+ REBASE .PHONY : $(BASEADDRESSES)
+-.IF "$(GUI)"=="WNT"
++.IF "$(GUI)"=="WNT" && "$(CROSS_COMPILING)" == "no"
+ .IF "$(product)"=="full"
+ $(PERL) rebase.pl -C $(BASEADDRESSES) -b $(STARTADDRESS) -d -e 10000 -l $(LOGFILE) -m $(MISC) -v -R $(SOLARBINDIR) -N $(EXCLUDELIST) $(IMAGENAMES)
+ .ELSE # "$(product)"=="full"
+ @echo Doing nothing on non product builds ...
+ .ENDIF # "$(product)"=="full"
+-.ELSE # "$(GUI)"=="WNT"
++.ELSE # "$(GUI)"!="WNT" || "$(CROSS_COMPILING)" != "no"
+ @echo Nothing to do, 'rebase' is windows only.
+ .ENDIF
+
diff --git a/patches/dev300/crosswin32-pyuno-mingw.diff b/patches/dev300/crosswin32-pyuno-mingw.diff
new file mode 100644
index 0000000..46068ce
--- /dev/null
+++ b/patches/dev300/crosswin32-pyuno-mingw.diff
@@ -0,0 +1,10 @@
+--- pyuno/source/module/makefile.mk.pristine 2008-10-29 14:25:58.000000000 +0100
++++ pyuno/source/module/makefile.mk 2008-10-29 14:25:33.000000000 +0100
+@@ -57,6 +57,7 @@ EXTRA_FRAMEWORK_FLAG=-framework Python
+ PYUNO_MODULE=$(DLLDEST)$/pyuno.so
+ PYUNORC=pyunorc
+ .ELSE
++.INCLUDEDIRS: $(PRJ)/../python
+ .INCLUDE : pyversion.mk
+ PYUNORC=pyuno.ini
+ .ENDIF
diff --git a/patches/dev300/crosswin32-sal-cross.diff b/patches/dev300/crosswin32-sal-cross.diff
new file mode 100644
index 0000000..e305986
--- /dev/null
+++ b/patches/dev300/crosswin32-sal-cross.diff
@@ -0,0 +1,16 @@
+--- sal/rtl/source/makefile.mk.orig 2008-10-21 15:08:00.000000000 +0200
++++ sal/rtl/source/makefile.mk 2008-10-21 15:09:56.000000000 +0200
+@@ -196,6 +196,12 @@ $(ALWAYSDBGFILES):
+
+ ALLTAR : $(BOOTSTRAPMK)
+
+-$(BOOTSTRAPMK) : $(APP1TARGETN)
++.IF "$(CROSS_COMPILING)" == "no"
++GEN_MAKEFILE = $(APP1TARGETN)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++GEN_MAKEFILE = $(TOOLS_DIR)/gen_makefile
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
++$(BOOTSTRAPMK) : $(GEN_MAKEFILE)
+ $< > $@
+
diff --git a/patches/dev300/crosswin32-sal-mingw-c.diff b/patches/dev300/crosswin32-sal-mingw-c.diff
new file mode 100644
index 0000000..b220991
--- /dev/null
+++ b/patches/dev300/crosswin32-sal-mingw-c.diff
@@ -0,0 +1,108 @@
+--- sal/osl/w32/conditn.c.~1.7.46.1.~ 2008-08-21 17:30:55.000000000 +0200
++++ sal/osl/w32/conditn.c 2008-10-21 20:51:52.000000000 +0200
+@@ -108,7 +108,11 @@
+ {
+ /* Only wake up if a SendMessage call to the threads message loop is detected */
+
++#ifndef __MINGW32__
+ switch( MsgWaitForMultipleObjects( 1, &(HANDLE)Condition, FALSE, timeout, QS_SENDMESSAGE ) )
++#else /* __MINGW32__ */
++ switch( MsgWaitForMultipleObjects( 1, (HANDLE)Condition, FALSE, timeout, QS_SENDMESSAGE ) )
++#endif /* __MINGW32__ */
+ {
+ case WAIT_OBJECT_0 + 1:
+ {
+--- sal/osl/w32/dllentry.c.~1.34.~ 2008-04-10 13:17:16.000000000 +0200
++++ sal/osl/w32/dllentry.c 2008-10-21 20:56:07.000000000 +0200
+@@ -216,7 +216,9 @@
+
+ //We disable floating point exceptions. This is the usual state at program startup
+ //but on Windows 98 and ME this is not always the case.
++#ifndef __MINGW32__
+ _control87(_MCW_EM, _MCW_EM);
++#endif
+ #ifdef __MINGW32__
+ atexit(do_cleanup);
+ }
+--- sal/systools/win32/uwinapi/ResolveUnicows.cpp.pristine 2008-10-01 10:05:18.000000000 +0200
++++ sal/systools/win32/uwinapi/ResolveUnicows.cpp 2009-04-04 14:43:41.198056996 +0200
+@@ -227,8 +226,8 @@ DEFINE_UNICOWS_THUNK( kernel32, DWORD, W
+ DEFINE_UNICOWS_THUNK( kernel32, BOOL, WINAPI, GetFileAttributesExW, (LPCWSTR,GET_FILEEX_INFO_LEVELS,PVOID) )
+ DEFINE_UNICOWS_THUNK( kernel32, DWORD, WINAPI, GetFileAttributesW, (LPCWSTR) )
+ DEFINE_UNICOWS_THUNK( comdlg32, short, WINAPI, GetFileTitleW, (LPCWSTR,LPWSTR,WORD) )
+-DEFINE_UNICOWS_THUNK( version, DWORD, WINAPI, GetFileVersionInfoSizeW, (LPWSTR,PDWORD) )
+-DEFINE_UNICOWS_THUNK( version, BOOL, WINAPI, GetFileVersionInfoW, (LPWSTR,DWORD,DWORD,PVOID) )
++DEFINE_UNICOWS_THUNK( version, DWORD, WINAPI, GetFileVersionInfoSizeW, (const WCHAR*,DWORD*) )
++DEFINE_UNICOWS_THUNK( version, BOOL, WINAPI, GetFileVersionInfoW, (const WCHAR*,DWORD,DWORD,PVOID) )
+ DEFINE_UNICOWS_THUNK( kernel32, DWORD, WINAPI, GetFullPathNameW, (LPCWSTR,DWORD,LPWSTR,LPWSTR*) )
+ DEFINE_UNICOWS_THUNK( gdi32, DWORD, WINAPI, GetGlyphOutlineW, (HDC,UINT,UINT,LPGLYPHMETRICS,DWORD,PVOID,const MAT2*) )
+ DEFINE_UNICOWS_THUNK( gdi32, BOOL, WINAPI, GetICMProfileW, (HDC,LPDWORD,LPWSTR) )
+@@ -273,7 +272,7 @@ DEFINE_UNICOWS_THUNK( kernel32, BOOL, WI
+ DEFINE_UNICOWS_THUNK( kernel32, BOOL, WINAPI, GetStringTypeW, (DWORD,LPCWSTR,int,LPWORD) )
+ DEFINE_UNICOWS_THUNK( kernel32, UINT, WINAPI, GetSystemDirectoryW, (LPWSTR,UINT) )
+ DEFINE_UNICOWS_THUNK( kernel32, UINT, WINAPI, GetSystemWindowsDirectoryW, (LPWSTR,UINT) )
+-DEFINE_UNICOWS_THUNK( user32, DWORD, WINAPI, GetTabbedTextExtentW, (HDC,LPCWSTR,int,int,CONST INT*) )
++DEFINE_UNICOWS_THUNK( user32, DWORD, WINAPI, GetTabbedTextExtentW, (HDC,LPCWSTR,int,int,int*) )
+ DEFINE_UNICOWS_THUNK( kernel32, UINT, WINAPI, GetTempFileNameW, (LPCWSTR,LPCWSTR,UINT,LPWSTR) )
+ DEFINE_UNICOWS_THUNK( kernel32, DWORD, WINAPI, GetTempPathW, (DWORD,LPWSTR) )
+ DEFINE_UNICOWS_THUNK( gdi32, BOOL, WINAPI, GetTextExtentExPointW, ( HDC,LPCWSTR,int,int,LPINT,LPINT,LPSIZE ) )
+@@ -452,11 +451,11 @@ DEFINE_UNICOWS_THUNK( shell32, BOOL, WIN
+ DEFINE_UNICOWS_THUNK( winspool, DWORD, WINAPI, StartDocPrinterW, (HANDLE,DWORD,PBYTE) )
+ DEFINE_UNICOWS_THUNK( gdi32, int, WINAPI, StartDocW, (HDC,const DOCINFOW*) )
+ DEFINE_UNICOWS_THUNK( user32, BOOL, WINAPI, SystemParametersInfoW, (UINT,UINT,PVOID,UINT) )
+-DEFINE_UNICOWS_THUNK( user32, LONG, WINAPI, TabbedTextOutW, (HDC,int,int,LPCWSTR,int,int,CONST INT*,int) )
++DEFINE_UNICOWS_THUNK( user32, LONG, WINAPI, TabbedTextOutW, (HDC,int,int,LPCWSTR,int,int,int*,int) )
+ DEFINE_UNICOWS_THUNK( gdi32, BOOL, WINAPI, TextOutW, (HDC,int,int,LPCWSTR,int) )
+ DEFINE_UNICOWS_THUNK( user32, int, WINAPI, TranslateAcceleratorW, (HWND,HACCEL,LPMSG) )
+ DEFINE_UNICOWS_THUNK( user32, BOOL, WINAPI, UnregisterClassW, (LPCWSTR,HINSTANCE) )
+-DEFINE_UNICOWS_THUNK( gdi32, BOOL, WINAPI, UpdateICMRegKeyW, (DWORD,LPWSTR,LPWSTR,UINT) )
++DEFINE_UNICOWS_THUNK( gdi32, BOOL, WINAPI, UpdateICMRegKeyW, (DWORD,DWORD,LPWSTR,UINT) )
+ DEFINE_UNICOWS_THUNK( kernel32, BOOL, WINAPI, UpdateResourceW, (HANDLE,LPCWSTR,LPCWSTR,WORD,PVOID,DWORD) )
+ DEFINE_UNICOWS_THUNK( version, DWORD, WINAPI, VerFindFileW, (DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT) )
+ DEFINE_UNICOWS_THUNK( version, DWORD, WINAPI, VerInstallFileW, (DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT) )
+--- onlinecheck.cxx 10 apr 2008 14:11:15 +0200 1.8
++++ sal/systools/win32/onlineupdate/onlinecheck.cxx 22 okt 2008 10:56:53 +0200
+@@ -45,8 +45,8 @@
+ #endif
+ #include <tchar.h>
+ #ifdef __MINGW32__
+-#include <excpt.h>
+-#endif
++#include <sehandler.h>
++#endif /* __MINGW32__ */
+
+ #define elementsof(a) (sizeof(a)/sizeof((a)[0]))
+
+diff -purN sal/systools/win32/uwinapi/FindFirstVolumeA.cpp sal/systools/win32/uwinapi/FindFirstVolumeA.cpp
+--- sal/systools/win32/uwinapi/FindFirstVolumeA.cpp 2009-04-06 20:23:37.935495274 +0200
++++ sal/systools/win32/uwinapi/FindFirstVolumeA.cpp 2009-04-06 20:21:51.303494448 +0200
+@@ -30,4 +30,4 @@
+
+ #include "macros.h"
+
+-DEFINE_DEFAULT_THUNK( kernel32, TRYLOAD, HANDLE, WINAPI, FindFirstVolumeA, (LPSTR lpszVolumeName, DWORD cchBufferLength) )
+\ Geen regeleindeteken (LF) aan einde van bestand
++DEFINE_DEFAULT_THUNK( kernel32, TRYLOAD, HANDLE, WINAPI, FindFirstVolumeA, (LPCSTR lpszVolumeName, DWORD cchBufferLength) )
+\ Geen regeleindeteken (LF) aan einde van bestand
+diff -purN sal/systools/win32/uwinapi/FindFirstVolumeW.cpp sal/systools/win32/uwinapi/FindFirstVolumeW.cpp
+--- sal/systools/win32/uwinapi/FindFirstVolumeW.cpp 2009-04-06 20:23:37.935495274 +0200
++++ sal/systools/win32/uwinapi/FindFirstVolumeW.cpp 2009-04-06 20:21:51.303494448 +0200
+@@ -30,4 +30,4 @@
+
+ #include "macros.h"
+
+-DEFINE_DEFAULT_THUNK( kernel32, TRYLOAD, HANDLE, WINAPI, FindFirstVolumeW, (LPWSTR lpszVolumeName, DWORD cchBufferLength) )
+\ Geen regeleindeteken (LF) aan einde van bestand
++DEFINE_DEFAULT_THUNK( kernel32, TRYLOAD, HANDLE, WINAPI, FindFirstVolumeW, (LPCWSTR lpszVolumeName, DWORD cchBufferLength) )
+\ Geen regeleindeteken (LF) aan einde van bestand
+diff -purN sal/systools/win32/uwinapi/FindNextVolumeA.cpp sal/systools/win32/uwinapi/FindNextVolumeA.cpp
+--- sal/systools/win32/uwinapi/FindNextVolumeA.cpp 2009-04-06 20:23:37.935495274 +0200
++++ sal/systools/win32/uwinapi/FindNextVolumeA.cpp 2009-04-06 20:21:51.303494448 +0200
+@@ -30,4 +30,4 @@
+
+ #include "macros.h"
+
+-DEFINE_DEFAULT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, FindNextVolumeA, (HANDLE hFindVolume, LPSTR lpszVolumeName, DWORD cchBufferLength) )
+\ Geen regeleindeteken (LF) aan einde van bestand
++DEFINE_DEFAULT_THUNK( kernel32, TRYLOAD, BOOL, WINAPI, FindNextVolumeA, (HANDLE hFindVolume, LPCSTR lpszVolumeName, DWORD cchBufferLength) )
+\ Geen regeleindeteken (LF) aan einde van bestand
diff --git a/patches/dev300/crosswin32-sal-mingw.diff b/patches/dev300/crosswin32-sal-mingw.diff
new file mode 100644
index 0000000..8fbcda5
--- /dev/null
+++ b/patches/dev300/crosswin32-sal-mingw.diff
@@ -0,0 +1,120 @@
+--- sal/osl/w32/signal.c.~1.12.~ 2008-04-10 13:22:35.000000000 +0200
++++ sal/osl/w32/signal.c 2008-10-21 20:53:05.000000000 +0200
+@@ -37,8 +37,8 @@
+ #include <osl/signal.h>
+ #ifndef __MINGW32__
+ #include <DbgHelp.h>
+-#endif
+ #include <ErrorRep.h>
++#endif /* __MINGW32__ */
+ #include <systools/win32/uwinapi.h>
+
+ typedef struct _oslSignalHandlerImpl
+--- sal/systools/win32/uwinapi/GetLongPathNameW.cpp.~1.5.~ 2008-04-10 14:18:12.000000000 +0200
++++ sal/systools/win32/uwinapi/GetLongPathNameW.cpp 2008-10-21 21:30:26.000000000 +0200
+@@ -29,6 +29,13 @@
+ ************************************************************************/
+
+ #define UNICODE
++
++#ifdef __MINGW32__
++#undef _WIN32_WINNT
++#define _WIN32_WINNT 0x0500
++#include <windows.h>
++#endif /* __MINGW32__ */
++
+ #include "macros.h"
+
+ EXTERN_C DWORD WINAPI GetLongPathNameW_NT( LPCWSTR lpShortPath, LPWSTR lpLongPath, DWORD cchBuffer )
+--- sal/systools/win32/uwinapi/GetLongPathNameA.cpp.~1.5.~ 2008-04-10 14:17:56.000000000 +0200
++++ sal/systools/win32/uwinapi/GetLongPathNameA.cpp 2008-10-21 21:29:56.000000000 +0200
+@@ -28,7 +28,13 @@
+ *
+ ************************************************************************/
+
++#ifdef __MINGW32__
++#undef _WIN32_WINNT
++#define _WIN32_WINNT 0x0500
++#include <windows.h>
++#endif /* __MINGW32__ */
++
+ #include "macros.h"
+
+ IMPLEMENT_THUNK( kernel32, WINDOWS, DWORD, WINAPI, GetLongPathNameA, ( LPCTSTR lpShortPath, LPTSTR lpLongPath, DWORD cchBuffer ) )
+-#include "GetLongPathName.cpp"
+\ Geen regeleindeteken (LF) aan einde van bestand
++#include "GetLongPathName.cpp"
+--- sal/systools/win32/uwinapi/ResolveUnicows.cpp.~1.4.~ 2008-06-06 19:02:43.000000000 +0200
++++ sal/systools/win32/uwinapi/ResolveUnicows.cpp 2008-10-21 21:53:19.000000000 +0200
+@@ -1,7 +1,6 @@
+ #ifdef __MINGW32__
+ #define _GDI32_
+ #include "macros.h"
+-#include <multimon.h>
+ extern "C" {
+ extern HMODULE hModuleUnicowsDLL;
+ }
+--- sal/systools/win32/uwinapi/makefile.mk.~1.17.~ 2008-04-10 14:26:19.000000000 +0200
++++ sal/systools/win32/uwinapi/makefile.mk 2008-10-21 23:43:31.000000000 +0200
+@@ -160,7 +160,7 @@
+ ALL: ALLTAR $(LB)$/libuwinapi.a
+
+ $(LB)$/libuwinapi.a: $(MISC)$/uwinapi.def
+- dlltool --dllname uwinapi.dll --input-def=$(MISC)$/uwinapi.def --kill-at --output-lib=$(LB)$/libuwinapi.a
++ $(DLLTOOL) --dllname uwinapi.dll --input-def=$(MISC)$/uwinapi.def --kill-at --output-lib=$(LB)$/libuwinapi.a
+ .ENDIF
+
+ .INCLUDE : target.mk
+--- sal/systools/win32/uwinapi/macros.h.pristine 2008-10-27 17:30:38.000000000 +0100
++++ sal/systools/win32/uwinapi/macros.h 2008-10-27 17:30:49.000000000 +0100
+@@ -43,7 +43,7 @@
+ # ifdef UNICODE
+ # define _UNICODE
+ # endif
+-# include <TCHAR.H>
++# include <tchar.h>
+ #endif
+
+ // Globally disable "warning C4100: unreferenced formal parameter" caused by
+--- sal/osl/w32/file.cxx.orig 2008-08-06 17:36:23.000000000 +0200
++++ sal/osl/w32/file.cxx 2008-10-21 20:53:48.000000000 +0200
+@@ -34,7 +34,7 @@
+ #define UNICODE
+ #define _UNICODE
+ #define _WIN32_WINNT 0x0500
+-#include "systools\win32\uwinapi.h"
++#include "systools/win32/uwinapi.h"
+
+ #include "path_helper.hxx"
+
+--- sal/inc/sal/mathconf.h.~1.6.~ 2008-04-10 12:47:09.000000000 +0200
++++ sal/inc/sal/mathconf.h 2008-04-10 12:47:24.000000000 +0200
+@@ -53,7 +53,7 @@
+ problems, the SAL_MATH_FPEXCEPTIONS_OFF macro can be used to explicitly
+ switch off exceptions (on Windows).
+ */
+-#if defined WNT
++#if defined (WNT) && ! defined (__MINGW32__)
+ #define SAL_MATH_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM )
+ #else /* WNT */
+ #define SAL_MATH_FPEXCEPTIONS_OFF()
+@@ -61,16 +61,16 @@
+
+
+ /* SAL_MATH_FINITE(d): test double d on INFINITY, NaN et al. */
+-#if defined( WNT)
++#if defined (WNT) && ! defined (__MINGW32__)
+ #define SAL_MATH_FINITE(d) _finite(d)
+ #elif defined OS2
+ #define SAL_MATH_FINITE(x) \
+ ((sizeof (x) == sizeof (float)) ? __isfinitef(x) \
+ : (sizeof (x) == sizeof (double)) ? __isfinite(x) \
+ : __isfinitel(x))
+-#elif defined LINUX || defined UNX
++#elif defined LINUX || defined UNX || defined __MINGW32__
+ #define SAL_MATH_FINITE(d) finite(d)
+-#else /* WNT, LINUX, UNX */
++#else /* WNT, LINUX, UNX, __MINGW32__ */
+ #error "SAL_MATH_FINITE not defined"
+ #endif /* WNT, LINUX, UNX */
+
diff --git a/patches/dev300/crosswin32-sccomp-mingw.diff b/patches/dev300/crosswin32-sccomp-mingw.diff
new file mode 100644
index 0000000..15ff5e1
--- /dev/null
+++ b/patches/dev300/crosswin32-sccomp-mingw.diff
@@ -0,0 +1,26 @@
+--- sccomp/source/solver/solver.cxx.pristine 2008-10-30 08:51:53.000000000 +0100
++++ sccomp/source/solver/solver.cxx 2008-10-30 08:51:44.000000000 +0100
+@@ -28,6 +28,13 @@
+ *
+ ************************************************************************/
+
++#ifdef __MINGW32__
++#define BOOL OOO_BOOL
++#define INT32 OOO_INT32
++#define UINT32 OOO_UINT32
++#include <tools/solar.h>
++#endif /* __MINGW32__ */
++
+ #undef LANGUAGE_NONE
+ #define WINAPI __stdcall
+ #define LoadInverseLib FALSE
+--- sccomp/source/solver/solver.hxx.pristine 2008-10-30 09:23:23.000000000 +0100
++++ sccomp/source/solver/solver.hxx 2008-10-30 09:22:41.000000000 +0100
+@@ -31,6 +31,7 @@
+ #ifndef SOLVER_HXX
+ #define SOLVER_HXX
+
++#include <sal/types.h>
+ #include <com/sun/star/sheet/XSolver.hpp>
+ #include <com/sun/star/sheet/XSolverDescription.hpp>
+ #include <com/sun/star/lang/XServiceInfo.hpp>
diff --git a/patches/dev300/crosswin32-scp2-mingw.diff b/patches/dev300/crosswin32-scp2-mingw.diff
new file mode 100644
index 0000000..99701cd
--- /dev/null
+++ b/patches/dev300/crosswin32-scp2-mingw.diff
@@ -0,0 +1,274 @@
+scp2/source/winexplorerext/file_winexplorerext.scp.pristine
+--- scp2/source/winexplorerext/file_winexplorerext.scp.pristine 2008-11-27 09:24:30.000000000 +0100
++++ scp2/source/winexplorerext/file_winexplorerext.scp 2008-11-27 09:24:08.000000000 +0100
+@@ -74,9 +74,11 @@
+ End
+ #endif
+
++#if !defined __CROSS__
+ File gid_File_Lib_Shlxtmsi
+ TXT_FILE_BODY;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+ Dir = gid_Dir_Program;
+ Name = "shlxtmsi.dll";
+ End
++#endif /* !__CROSS__ */
+\ Geen regeleindeteken (LF) aan einde van bestand
+scp2/source/canvas/directxcanvas.scp.pristine
+--- scp2/source/canvas/directxcanvas.scp.pristine 2008-06-24 14:18:48.000000000 +0200
++++ scp2/source/canvas/directxcanvas.scp 2008-11-26 19:32:06.000000000 +0100
+@@ -30,7 +30,7 @@
+
+ #include "macros.inc"
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+ # ifdef USE_DIRECTX5
+ SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Lib_DirectX5Canvas,directx5canvas.uno)
+ # endif
+scp2/source/ooo/common_brand.scp.pristine
+--- scp2/source/ooo/common_brand.scp.pristine 2008-11-26 11:18:01.000000000 +0100
++++ scp2/source/ooo/common_brand.scp 2008-11-26 19:32:06.000000000 +0100
+@@ -628,7 +628,7 @@
+ End
+ #endif
+
+-#if defined WNT && defined(_gcc3)
++#if defined WNT && defined(_gcc3) && !defined __CROSS__
+ File gid_Brand_File_Lib_Mingwm10
+ BIN_FILE_BODY;
+ Styles = (PACKED);
+scp2/source/ooo/file_library_ooo.scp.pristine
+--- scp2/source/ooo/file_library_ooo.scp.pristine 2008-11-26 11:15:27.000000000 +0100
++++ scp2/source/ooo/file_library_ooo.scp 2008-11-27 09:20:53.000000000 +0100
+@@ -29,7 +29,7 @@
+ ************************************************************************/
+ #include "macros.inc"
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+ File gid_File_Lib_Accessbridge
+ BIN_FILE_BODY;
+ Styles = (PACKED);
+@@ -41,7 +41,7 @@
+ STD_UNO_LIB_FILE( gid_File_Lib_Adabas, adabas)
+ #endif
+
+-#if defined(WNT)
++#if defined(WNT) && ! defined __CROSS__
+ STD_UNO_LIB_FILE( gid_File_Lib_Ado, ado)
+ #endif
+
+@@ -656,7 +656,7 @@
+
+ STD_UNO_LIB_FILE( gid_File_Lib_Fwm , fwm)
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+ File gid_File_Lib_Gdiplus
+ BIN_FILE_BODY;
+ Styles = (PACKED);
+@@ -834,7 +834,7 @@
+
+ #endif
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+
+ File gid_File_Lib_sn_tools
+ BIN_FILE_BODY;
+@@ -845,7 +845,7 @@
+
+ #endif
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+
+ File gid_File_Lib_relnotes
+ BIN_FILE_BODY;
+@@ -957,7 +957,7 @@ File gid_File_Lib_Mozbootstrap
+ #ifdef UNX
+ Name = STRING(CONCAT2(libmozbootstrap,UNXSUFFIX));
+ #else
+- Name = "libmozbootstrap.dll";
++ Name = "mozbootstrap.dll";
+ #endif
+ End
+
+@@ -967,7 +967,7 @@
+
+ STD_UNO_LIB_FILE(gid_File_Lib_Writerfilter,writerfilter)
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+ #if defined(_gcc3)
+
+ File gid_File_Lib_Mingwm10
+@@ -1206,7 +1206,7 @@
+
+ #endif
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+
+ File gid_File_Lib_Reg4allmsdoc
+ TXT_FILE_BODY;
+@@ -1217,7 +1217,7 @@
+
+ #endif
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+
+ File gid_File_Lib_Qslnkmsi
+ TXT_FILE_BODY;
+@@ -1228,7 +1228,7 @@
+
+ #endif
+
+-#ifdef WNT
++#if defined WNT && !defined __CROSS__
+
+ File gid_File_Lib_Sdqsmsi
+ TXT_FILE_BODY;
+@@ -1336,12 +1336,14 @@
+
+ #ifdef WNT
+
++#ifndef __CROSS__
+ File gid_File_Lib_OOoFilt
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+ Dir = gid_Dir_Program;
+ Name = "ooofilt.dll";
+ End
++#endif /* !__CROSS__ */
+
+ File gid_File_Lib_OOoFiltProxy
+ TXT_FILE_BODY;
+@@ -1350,12 +1352,14 @@
+ Name = "ooofiltproxy.dll";
+ End
+
++#ifndef __CROSS__
+ File gid_File_Lib_Instooofiltmsi
+ TXT_FILE_BODY;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+ Dir = gid_Dir_Program;
+ Name = "instooofiltmsi.dll";
+ End
++#endif /* !__CROSS__ */
+
+ #endif
+
+@@ -1754,7 +1758,7 @@
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+ Dir = gid_Dir_Program;
+- #ifdef WNT
++ #if defined WNT && ! defined __CROSS__
+ Name = "ssleay32.dll";
+ #endif
+ End
+@@ -1766,7 +1770,7 @@
+ Styles = (PACKED);
+ Dir = gid_Dir_Program;
+
+- #ifdef WNT
++ #if defined WNT && ! defined __CROSS__
+ Name = "libeay32.dll";
+ #endif
+ End
+scp2/source/ooo/windowscustomaction_ooo.scp.pristine
+--- scp2/source/ooo/windowscustomaction_ooo.scp.pristine 2008-11-26 11:14:00.000000000 +0100
++++ scp2/source/ooo/windowscustomaction_ooo.scp 2008-11-27 09:23:20.000000000 +0100
+@@ -30,6 +30,7 @@
+
+ #include "macros.inc"
+
++#ifndef __CROSS__
+ WindowsCustomAction gid_Customaction_Regallmsdocdll
+ Name = "Regallmsdocdll";
+ Typ = "65";
+@@ -38,6 +39,7 @@
+ Inbinarytable = 1;
+ Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\" And Not PATCH", "CostFinalize");
+ End
++#endif /* !__CROSS__ */
+
+ WindowsCustomAction gid_Customaction_Regactivexdll1
+ Name = "Regactivexdll1";
+@@ -75,6 +77,7 @@
+ Assignment1 = ("InstallExecuteSequence", "\&FEATURETEMPLATE=2 And \!FEATURETEMPLATE=3 And Not PATCH", "end");
+ End
+
++#ifndef __CROSS__
+ WindowsCustomAction gid_Customaction_sdqsmsidll
+ Name = "sdqsmsidll";
+ Typ = "65";
+@@ -236,6 +239,7 @@
+ Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\"", "end");
+ Assignment2 = ("AdminExecuteSequence", "", "end");
+ End
++#endif /* !__CROSS__ */
+
+ WindowsCustomAction gid_Customaction_RegCleanOld
+ Name = "RegCleanOld";
+@@ -371,6 +375,7 @@
+ Assignment10 = ("ControlCondition", "DestinationFolder", "LabelWrongProduct2", "Show", "ISWRONGPRODUCT");
+ End
+
++#ifndef __CROSS__
+ WindowsCustomAction gid_Customaction_MigrateInstallPath
+ Name = "MigrateInstallPath";
+ Typ = "321";
+@@ -417,3 +422,4 @@
+ Assignment1 = ("InstallExecuteSequence", "(Not Installed or ISPATCH) and Not REMOVE=\"ALL\"", "end");
+ End
+
++#endif /* !__CROSS__ */
+scp2/source/ooo/scpaction_ooo.scp.pristine
+--- scp2/source/ooo/scpaction_ooo.scp.pristine 2008-04-15 16:49:29.000000000 +0200
++++ scp2/source/ooo/scpaction_ooo.scp 2008-11-26 19:32:06.000000000 +0100
+@@ -102,7 +102,7 @@
+ #endif
+ End
+
+-#if defined(WNT) && defined(_gcc3)
++#if defined(WNT) && defined(_gcc3) && !defined __CROSS__
+ ScpAction SCP_COPY_MINGWM10
+ Copy = "mingwm10.dll";
+ Name = "mingwm10.dll";
+scp2/source/ooo/file_ooo.scp.pristine
+--- scp2/source/ooo/file_ooo.scp.pristine 2008-11-26 11:17:34.000000000 +0100
++++ scp2/source/ooo/file_ooo.scp 2008-11-26 19:32:06.000000000 +0100
+@@ -459,7 +459,7 @@
+ EXTRA_ALL_GOOD_HELP_LOCALIZATIONS_LANG(schart);
+ End
+
+-#if defined INCLUDE_JAVA_ACCESSBRIDGE && defined WNT
++#if defined INCLUDE_JAVA_ACCESSBRIDGE && defined WNT && !defined __CROSS__
+
+ File gid_File_Jar_Accessbridge
+ TXT_FILE_BODY;
+scp2/source/ooo/ure.scp.pristine
+--- scp2/source/ooo/ure.scp.pristine 2008-11-26 11:18:46.000000000 +0100
++++ scp2/source/ooo/ure.scp 2008-11-26 19:32:06.000000000 +0100
+@@ -895,7 +895,7 @@
+ End
+ #endif
+
+-#if (defined WNT && defined _gcc3)
++#if (defined WNT && defined _gcc3) && !defined __CROSS__
+ File gid_File_Lib_Mingwm10_Ure
+ TXT_FILE_BODY;
+ Dir = SCP2_URE_DL_DIR;
+@@ -937,7 +937,7 @@
+ #endif
+ #endif
+
+-#if defined WNT
++#if defined WNT && !defined __CROSS__
+ File gid_File_Dl_Unicows
+ TXT_FILE_BODY;
+ Dir = SCP2_URE_DL_DIR;
diff --git a/patches/dev300/crosswin32-setup_native-mingw.diff b/patches/dev300/crosswin32-setup_native-mingw.diff
new file mode 100644
index 0000000..b6606b0
--- /dev/null
+++ b/patches/dev300/crosswin32-setup_native-mingw.diff
@@ -0,0 +1,18 @@
+--- setup_native/source/win32/customactions/tools/seterror.cxx.pristine 2008-10-28 20:55:13.000000000 +0100
++++ setup_native/source/win32/customactions/tools/seterror.cxx 2008-10-28 21:12:01.000000000 +0100
+@@ -41,14 +41,14 @@
+ #include <string.h>
+ #include <malloc.h>
+ #include <stdio.h>
+-#include "strsafe.h"
+
+ #include <seterror.hxx>
+
+ //----------------------------------------------------------
+ #ifdef DEBUG
++#include "strsafe.h"
+ inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
+ {
+ TCHAR buffer[1024];
+
+
diff --git a/patches/dev300/crosswin32-shell-mingw.diff b/patches/dev300/crosswin32-shell-mingw.diff
new file mode 100644
index 0000000..2fd0536
--- /dev/null
+++ b/patches/dev300/crosswin32-shell-mingw.diff
@@ -0,0 +1,355 @@
+--- shell/source/all/ooofilereader/makefile.mk.~1.7.~ 2008-07-22 19:48:30.000000000 +0200
++++ shell/source/all/ooofilereader/makefile.mk 2008-11-03 20:35:11.000000000 +0100
+@@ -51,6 +51,10 @@ CDEFS_X64+=-D_WIN32_IE=0x501
+ CFLAGS+=-DISOLATION_AWARE_ENABLED -DXML_UNICODE -DXML_UNICODE_WCHAR_T -DUNICODE -D_UNICODE
+ .ENDIF
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Files --------------------------------------------------------
+
+
+--- shell/source/win32/sysshell/systemshell.cxx.~1.6.~ 2008-04-11 10:29:13.000000000 +0200
++++ shell/source/win32/sysshell/systemshell.cxx 2008-11-04 12:05:46.000000000 +0100
+@@ -38,10 +38,14 @@
+ #pragma warning(push, 1)
+ #pragma warning(disable:4917)
+ #endif
+-#include <Shlobj.h>
++#include <shlobj.h>
+ #if defined _MSC_VER
+ #pragma warning(pop)
+-#endif
++#endif
++
++#ifdef __MINGW32__
++#define SHARD_PATHW SHARD_PATH
++#endif /* __MINGW32__ */
+
+ namespace SystemShell
+ {
+--- shell/source/win32/shlxthandler/propsheets/makefile.mk.~1.6.~ 2008-04-11 10:22:06.000000000 +0200
++++ shell/source/win32/shlxthandler/propsheets/makefile.mk 2008-11-03 20:55:35.000000000 +0100
+@@ -59,6 +59,10 @@ SLOFILES_X64=$(SLO_X64)$/propsheets.obj\
+ $(SLO_X64)$/document_statistic.obj
+ .ENDIF # "$(BUILD_X64)"!=""
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Targets ------------------------------------------------------
+
+ .INCLUDE : set_wntx64.mk
+--- shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx.~1.9.~ 2008-04-11 10:21:31.000000000 +0200
++++ shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx 2008-11-03 21:07:07.000000000 +0100
+@@ -54,6 +54,32 @@
+ #include <tchar.h>
+ #include "internal/resource.h"
+
++#ifdef __MINGW32__
++struct LVGROUP {
++ UINT cbSize;
++ UINT mask;
++ LPWSTR pszHeader;
++ int cchHeader;
++ LPWSTR pszFooter;
++ int cchFooter;
++ int iGroupId;
++ UINT stateMask;
++ UINT state;
++ UINT uAlign;
++};
++
++// FIXME
++int const LVGA_HEADER_CENTER = 0;
++
++int const LVGF_HEADER = 0;
++int const LVGF_STATE = 0;
++int const LVGF_GROUPID = 0;
++int const LVGF_TEXT = 0;
++
++int const LVGS_NORMAL = 0;
++
++#endif /* __MINGW32__ */
++
+ //------------------------------------
+ //
+ //------------------------------------
+--- shell/source/win32/shlxthandler/makefile.mk.~1.13.26.1.~ 2008-08-27 16:44:04.000000000 +0200
++++ shell/source/win32/shlxthandler/makefile.mk 2008-11-04 11:15:21.000000000 +0100
+@@ -57,8 +57,11 @@ SLOFILES=$(SLO)$/classfactory.obj\
+ $(SLO)$/propsheets.obj\
+ $(SLO)$/shlxthdl.obj\
+ $(SLO)$/listviewbuilder.obj\
+- $(SLO)$/document_statistic.obj\
+- $(SLO)$/thumbviewer.obj
++ $(SLO)$/document_statistic.obj
++
++.IF "$(CROSS_COMPILING)" == "no"
++SLOFILES += $(SLO)$/thumbviewer.obj
++.ENDIF # "$(CROSS_COMPILING)" == "no"
+
+ SHL1TARGET=$(TARGET)
+
+@@ -78,8 +81,11 @@ SHL1STDLIBS+=\
+ $(UUIDLIB)\
+ $(SHELL32LIB)\
+ $(KERNEL32LIB)\
+- $(GDI32LIB)\
+- $(GDIPLUSLIB)
++ $(GDI32LIB)
++
++.IF "$(CROSS_COMPILING)" == "no"
++SHL1STDLIBS+=$(GDIPLUSLIB)
++.ENDIF # "$(CROSS_COMPILING)" == "no"
+
+ SHL1LIBS+=$(SLB)$/util.lib\
+ $(SLB)$/ooofilereader.lib
+@@ -139,6 +145,10 @@ DEF1NAME_X64=$(SHL1TARGET_X64)
+ DEF1EXPORTFILE_X64=exports.dxp
+ .ENDIF # "$(BUILD_X64)"!=""
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Targets ------------------------------------------------------
+
+ .INCLUDE : set_wntx64.mk
+--- shell/source/win32/shlxthandler/shlxthdl.cxx.~1.9.~ 2008-04-11 10:17:19.000000000 +0200
++++ shell/source/win32/shlxthandler/shlxthdl.cxx 2008-11-04 11:13:35.000000000 +0100
+@@ -38,6 +38,10 @@
+ #include "internal/fileextensions.hxx"
+ #include "internal/utilities.hxx"
+
++#ifdef __MINGW32__
++#define IID_IExtractImage (CLSID const&)*(CLSID const*)0
++#endif /* __MINGW32__ */
++
+ #include <tchar.h>
+ #include <string>
+ #include <shlobj.h>
+--- shell/source/win32/shlxthandler/util/registry.cxx.~1.7.~ 2008-04-11 10:25:06.000000000 +0200
++++ shell/source/win32/shlxthandler/util/registry.cxx 2008-11-03 20:36:51.000000000 +0100
+@@ -50,6 +50,10 @@
+ #pragma warning(pop)
+ #endif
+
++#ifdef __MINGW32__
++#define DELETE 0x00010000L
++#endif /* __MINGW32__ */
++
+ //---------------------------------------
+ //
+ //---------------------------------------
+--- shell/source/win32/shlxthandler/util/makefile.mk.~1.6.~ 2008-04-11 10:24:43.000000000 +0200
++++ shell/source/win32/shlxthandler/util/makefile.mk 2008-11-04 11:05:11.000000000 +0100
+@@ -61,6 +61,10 @@ SLOFILES_X64=$(SLO_X64)$/dbgmacros.obj\
+ $(SLO_X64)$/utilities.obj\
+ $(SLO_X64)$/iso8601_converter.obj
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Targets ------------------------------------------------------
+
+ .INCLUDE : set_wntx64.mk
+--- shell/source/win32/shlxthandler/classfactory.hxx.~1.5.~ 2008-04-11 10:15:21.000000000 +0200
++++ shell/source/win32/shlxthandler/classfactory.hxx 2008-11-04 11:04:23.000000000 +0100
+@@ -34,6 +34,9 @@
+ #if defined _MSC_VER
+ #pragma warning(push, 1)
+ #endif
++#ifdef __MINGW32__
++#include <oleauto.h>
++#endif
+ #include <objidl.h>
+ #if defined _MSC_VER
+ #pragma warning(pop)
+--- shell/source/win32/shlxthandler/ooofilt/makefile.mk.~1.8.~ 2008-04-11 10:18:50.000000000 +0200
++++ shell/source/win32/shlxthandler/ooofilt/makefile.mk 2008-11-04 12:03:12.000000000 +0100
+@@ -117,8 +117,16 @@ DEF1NAME_X64=$(SHL1TARGET_X64)
+ DEF1EXPORTFILE_X64=exports.dxp
+ .ENDIF # "$(BUILD_X64)"!=""
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Targets ------------------------------------------------------
+
++.IF "$(CROSS_COMPILING)" == "yes"
++all:
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ .INCLUDE : set_wntx64.mk
+ .INCLUDE : target.mk
+ .INCLUDE : tg_wntx64.mk
+\ Geen regeleindeteken (LF) aan einde van bestand
+--- shell/source/win32/shlxthandler/thumbviewer/makefile.mk.~1.5.~ 2008-04-11 10:23:22.000000000 +0200
++++ shell/source/win32/shlxthandler/thumbviewer/makefile.mk 2008-11-04 12:03:18.000000000 +0100
+@@ -58,7 +58,10 @@ SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj
+
+ # --- Targets ------------------------------------------------------
+
++.IF "$(CROSS_COMPILING)" == "yes"
++all:
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ .INCLUDE : set_wntx64.mk
+ .INCLUDE : target.mk
+ .INCLUDE : tg_wntx64.mk
+-
+--- shell/source/win32/shlxthandler/columninfo/columninfo.cxx.~1.7.~ 2008-04-11 10:17:35.000000000 +0200
++++ shell/source/win32/shlxthandler/columninfo/columninfo.cxx 2008-11-04 11:59:08.000000000 +0100
+@@ -39,6 +39,10 @@
+
+ #include <malloc.h>
+
++#ifdef __MINGW32__
++#define FMTID_SummaryInformation (GUID const&)*(GUID const*)0
++#endif /* __MINGW32__ */
++
+ //----------------------------
+ //
+ //----------------------------
+@@ -47,12 +51,14 @@ namespace /* private */
+ {
+ SHCOLUMNINFO ColumnInfoTable[] =
+ {
++#ifndef __MINGW32__
+ {{PSGUID_SUMMARYINFORMATION, PIDSI_TITLE}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Title", L"Title"},
+ {{PSGUID_SUMMARYINFORMATION, PIDSI_AUTHOR}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Author", L"Author"},
+ {{PSGUID_SUMMARYINFORMATION, PIDSI_SUBJECT}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Subject", L"Subject"},
+ {{PSGUID_SUMMARYINFORMATION, PIDSI_KEYWORDS}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Keywords", L"Keywords"},
+ {{PSGUID_SUMMARYINFORMATION, PIDSI_COMMENTS}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Comments", L"Comments"},
+ {{PSGUID_SUMMARYINFORMATION, PIDSI_PAGECOUNT},VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Pagecount", L"Pagecount"}
++#endif /* !__MINGW32__ */
+ };
+
+ size_t ColumnInfoTableSize = sizeof(ColumnInfoTable)/sizeof(ColumnInfoTable[0]);
+--- shell/source/win32/shlxthandler/columninfo/makefile.mk.~1.6.~ 2008-04-11 10:17:52.000000000 +0200
++++ shell/source/win32/shlxthandler/columninfo/makefile.mk 2008-11-03 20:37:26.000000000 +0100
+@@ -55,6 +55,10 @@ CDEFS_X64+=-D_WIN32_IE=0x501
+ SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj
+ .ENDIF # "$(BUILD_X64)"!=""
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Targets ------------------------------------------------------
+ .INCLUDE : set_wntx64.mk
+ .INCLUDE : target.mk
+--- shell/source/win32/shlxthandler/classfactory.cxx.~1.6.~ 2008-04-11 10:15:02.000000000 +0200
++++ shell/source/win32/shlxthandler/classfactory.cxx 2008-11-04 11:08:46.000000000 +0100
+@@ -39,8 +38,10 @@
+ #include <algorithm>
+ using ::std::max;
+ using ::std::min;
+-#endif
++#define IID_IExtractImage 0
++#else /* !__MINGW32__ */
+ #include "internal/thumbviewer.hxx"
++#endif /* !__MINGW32__ */
+ #include "internal/shlxthdl.hxx"
+
+ //-----------------------------
+@@ -128,10 +132,10 @@ HRESULT STDMETHODCALLTYPE CClassFactory:
+
+ else if (CLSID_COLUMN_HANDLER == m_Clsid)
+ pUnk = static_cast<IColumnProvider*>(new CColumnInfo());
+-
++#ifndef __MINGW32__
+ else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid)
+ pUnk = static_cast<IExtractImage*>(new CThumbviewer());
+-
++#endif /* !__MINGW32__ */
+ POST_CONDITION(pUnk != 0, "Could not create COM object");
+
+ if (0 == pUnk)
+--- shell/source/win32/shlxthandler/infotips/makefile.mk.~1.6.~ 2008-04-11 10:18:30.000000000 +0200
++++ shell/source/win32/shlxthandler/infotips/makefile.mk 2008-11-03 20:41:46.000000000 +0100
+@@ -54,6 +54,10 @@ CDEFS_X64+=-D_WIN32_IE=0x501
+ SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj
+ .ENDIF # "$(BUILD_X64)"!=""
+
++.IF "$(SYSTEM_EXPAT)" == "YES"
++CFLAGS+=-DSYSTEM_EXPAT
++.ENDIF
++
+ # --- Targets ------------------------------------------------------
+
+ .INCLUDE : set_wntx64.mk
+--- shell/source/win32/shlxthandler/res/makefile.mk.~1.8.~ 2008-04-11 10:23:02.000000000 +0200
++++ shell/source/win32/shlxthandler/res/makefile.mk 2008-11-04 10:53:13.000000000 +0100
+@@ -63,4 +63,22 @@ ULFDIR:=.
+
+ $(RCFILES) : $(ULFDIR)$/shlxthdl.ulf makefile.mk rcfooter.txt rcheader.txt rctmpl.txt
+ $(WRAPCMD) $(BIN)$/lngconvex.exe -ulf $(ULFDIR)$/shlxthdl.ulf -rc $(RES)$/shlxthdl.rc -rct rctmpl.txt -rch rcheader.txt -rcf rcfooter.txt
++.IF "$(CROSS_COMPILING)" == "yes"
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f]["\\]\)@\\x00\1 at g' $@
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f]["\\]\)@\\x00\1 at g' $@
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f][0-9a-f]["\\]\)@\\x0\1 at g' $@
++ sed -i -e 's@\\x\([0-9a-f][0-9a-f][0-9a-f]["\\]\)@\\x0\1 at g' $@
++ sed -i -e 's@\([ ,]\)"@\1L"@g' $@
++ sed -i -e 's at include L"@include "@' $@
++ pytt '\r\n' '\n' $@
++ pytt '^LANGUAGE 0x244(.|\n)*' '' $@
++# sed -i -e 's@^LANGUAGE 0x211 at LANGUAGE 0x21@' $@
++# sed -i -e 's@^LANGUAGE 0x226 at LANGUAGE 0x26@' $@
++# sed -i -e 's@^LANGUAGE 0x22c at LANGUAGE 0x2c@' $@
++# sed -i -e 's@^LANGUAGE 0x22b at LANGUAGE 0x2b@' $@
++# sed -i -e 's@^LANGUAGE 0x30 at LANGUAGE 0x2d@' $@
++# sed -i -e 's@^LANGUAGE 0x73 at LANGUAGE 0x2a@' $@
++# sed -i -e 's@^LANGUAGE 0x31 at LANGUAGE 0x2e@' $@
++# sed -i -e 's@^LANGUAGE 0x33 at LANGUAGE 0x01@' $@
++.ENDIF #"$(CROSS_COMPILING)" == "yes"
+
+--- shell/inc/internal/infotips.hxx.~1.5.~ 2008-04-11 09:43:15.000000000 +0200
++++ shell/inc/internal/infotips.hxx 2008-11-03 20:54:22.000000000 +0100
+@@ -31,6 +31,12 @@
+ #ifndef INFOTIPS_HXX_INCLUDED
+ #define INFOTIPS_HXX_INCLUDED
+
++#ifdef __MINGW32__
++#include <oleauto.h>
++#undef STDMETHODCALLTYPE
++#define STDMETHODCALLTYPE
++#endif /* __MINGW32__ */
++
+ #if defined _MSC_VER
+ #pragma warning(push, 1)
+ #pragma warning(disable:4917)
+--- shell/inc/internal/propsheets.hxx.~1.6.~ 2008-04-11 09:44:04.000000000 +0200
++++ shell/inc/internal/propsheets.hxx 2008-11-04 11:20:49.000000000 +0100
+@@ -43,6 +43,11 @@
+ #include <string>
+ #include <memory>
+
++#ifdef __MINGW32__
++#undef STDMETHODCALLTYPE
++#define STDMETHODCALLTYPE
++#endif /* __MINGW32__ */
++
+ class CPropertySheet : public IShellExtInit, public IShellPropSheetExt
+ {
+ public:
+--- shell/inc/internal/zipfile.hxx.~1.4.~ 2008-04-11 09:46:04.000000000 +0200
++++ shell/inc/internal/zipfile.hxx 2008-11-03 20:00:53.000000000 +0100
+@@ -35,7 +35,11 @@
+ #define _WINDOWS
+ #endif
+
++#ifdef __MINGW32__
++#include <unzip.h>
++#else /* !__MINGW32__ */
+ #include <external/zlib/unzip.h>
++#endif /* !__MINGW32__ */
+
+ #include <string>
+ #include <vector>
diff --git a/patches/dev300/crosswin32-solenv-cross.diff b/patches/dev300/crosswin32-solenv-cross.diff
new file mode 100644
index 0000000..74f586a
--- /dev/null
+++ b/patches/dev300/crosswin32-solenv-cross.diff
@@ -0,0 +1,208 @@
+--- solenv/inc/startup/startup.mk.orig 2008-10-21 09:41:14.000000000 +0200
++++ solenv/inc/startup/startup.mk 2008-10-21 09:52:19.000000000 +0200
+@@ -40,9 +40,20 @@ CALLTARGETS=$(MAKETARGETS)
+ OS_variable_needed
+ .ENDIF
+
+-# Customize macro definitions based on seting of OS.
+-# This must come before the default macro definitions which follow.
+-.INCLUDE .NOINFER : $(INCFILENAME:d)$(OS)$/macros.mk
++# Customize macro definitions based on seting of BUILD_OS, after
++# translation into a third naming scheme (1. config.guess,
++# 2. configure.in) devised in 3. set_soenv.in: $B_OS.
++.IF "$(CROSS_COMPILING)" == "no"
++B_OS = $(OS)
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++.IF "$(BUILD_OS)" == "Linux"
++B_OS = LINUX
++.ELSE # "$(BUILD_OS)" != "Linux"
++.ERROR : ; @echo Work in progress: cross compiling only on Linux
++.ENDIF
++.ENDIF # "$(CROSS_COMPILING)" != "yes"
++
++.INCLUDE .NOINFER : $(INCFILENAME:d)$(B_OS)$/macros.mk
+
+ # ----------------- Default Control Macro definitions -----------------------
+ # Select appropriate defaults for basic macros
+--- solenv/bin/build.pl.orig 2008-07-22 18:46:59.000000000 +0200
++++ solenv/bin/build.pl 2008-10-21 10:58:44.000000000 +0200
+@@ -61,7 +61,7 @@
+ my $enable_multiprocessing = 1;
+ my $cygwin = 0;
+ $cygwin++ if ($^O eq 'cygwin');
+- if ($ENV{GUI} eq 'WNT' && !$cygwin) {
++ if ($ENV{BUILD_OS} eq 'WNT' && !$cygwin) {
+ eval { require Win32::Process; import Win32::Process; };
+ $enable_multiprocessing = 0 if ($@);
+ };
+@@ -812,7 +838,7 @@ sub CorrectPath {
+ sub check_dmake {
+ #print "Checking dmake...";
+ # my $dmake_batch = CorrectPath("$tmp_dir/dmake.bat");
+- if ($QuantityToBuild && ($ENV{GUI} eq 'WNT') && ($ENV{USE_SHELL} eq '4nt')) {
++ if ($QuantityToBuild && ($ENV{BUILD_OS} eq 'WNT') && ($ENV{USE_SHELL} eq '4nt')) {
+ if (open(DMAKEVERSION, "where dmake |")) {
+ my @output = <DMAKEVERSION>;
+ close DMAKEVERSION;
+@@ -857,7 +883,7 @@ sub get_commands {
+ while ($arg = pop(@dmake_args)) {
+ $dmake .= ' '.$arg;
+ };
+-# if (($ENV{GUI} eq 'WNT') && $QuantityToBuild) {
++# if (($ENV{BUILD_OS} eq 'WNT') && $QuantityToBuild) {
+ # print_error("There is no such executable $_4nt_exe") if (!-e $_4nt_exe);
+ # $dmake_batch = generate_4nt_batch();
+ # };
+@@ -873,7 +899,7 @@ sub get_commands {
+ # ($ENV{GUI} eq 'MACOSX')) &&
+ # ($Dir eq '/')) {
+ # return 1;
+-# } elsif ( (($ENV{GUI} eq 'WNT') ||
++# } elsif ( (($ENV{BUILD_OS} eq 'WNT') ||
+ # ($ENV{GUI} eq 'WIN') ||
+ # ($ENV{GUI} eq 'OS2')) &&
+ # ($Dir =~ /\S:\/$/)) {
+@@ -933,7 +959,7 @@ sub CheckPlatform {
+ return 1 if (($ENV{GUI} eq 'WIN') && ($Platform eq 'w'));
+ return 1 if (($ENV{GUI} eq 'UNX') && ($Platform eq 'u'));
+ return 1 if (($ENV{GUI} eq 'OS2') && ($Platform eq 'p'));
+- return 1 if (($ENV{GUI} eq 'WNT') &&
++ return 1 if ((($ENV{TARGET_OS} eq 'WNT') || ($ENV{TARGET_OS} eq 'MinGW')) &&
+ (($Platform eq 'w') || ($Platform eq 'n')));
+ return 0;
+ };
+@@ -1378,7 +1409,7 @@ sub cancel_build {
+ };
+ print "\nAttention: if you build and deliver the above module(s) you may prolongue your the build issuing command \"build --from @broken_modules_names\"\n";
+ } else {
+-# if ($ENV{GUI} eq 'WNT') {
++# if ($ENV{BUILD_OS} eq 'WNT') {
+ while (children_number()) {
+ handle_dead_children(1);
+ }
+@@ -1400,7 +1431,7 @@ sub store_error {
+ my ($pid, $error_code) = @_;
+ return 0 if (!$error_code);
+ my $child_nick = $processes_hash{$pid};
+- if ($ENV{GUI} eq 'WNT') {
++ if ($ENV{BUILD_OS} eq 'WNT') {
+ if (!defined $had_error{$child_nick}) {
+ $had_error{$child_nick}++;
+ return 1;
+@@ -1429,7 +1460,7 @@ sub handle_dead_children {
+ my $try_once_more = 0;
+ do {
+ my $pid = 0;
+- if ($ENV{GUI} eq 'WNT' && !$cygwin) {
++ if ($ENV{BUILD_OS} eq 'WNT' && !$cygwin) {
+ foreach $pid (keys %processes_hash) {
+ my $exit_code = undef;
+ my $proc_obj = $windows_procs{$pid};
+@@ -1552,7 +1583,7 @@ sub start_child {
+ # html_store_job_info($dependencies_hash, $job_dir, $error_code);
+ # if ($error_code) {
+ # # give windows (4nt) one more chance
+-# if ($ENV{GUI} eq 'WNT' && !$cygwin) {
++# if ($ENV{BUILD_OS} eq 'WNT' && !$cygwin) {
+ # $error_code = do_post_job($`, $post_job, $dependencies_hash);
+ # };
+ # if ($error_code) {
+@@ -1569,7 +1600,7 @@ sub start_child {
+ my $children_running;
+ my $oldfh = select STDOUT;
+ $| = 1;
+- if ($ENV{GUI} eq 'WNT' && !$cygwin) {
++ if ($ENV{BUILD_OS} eq 'WNT' && !$cygwin) {
+ print "$job_dir\n";
+ my $process_obj = undef;
+ my $rc = Win32::Process::Create($process_obj, $dmake_bin,
+@@ -1725,7 +1756,7 @@ sub do_custom_job {
+ $error_code = run_job($job, CorrectPath($StandDir.$module), $module_job);
+ if ($error_code) {
+ # give windows (4nt) one more chance
+- if ($ENV{GUI} eq 'WNT' && !$cygwin) {
++ if ($ENV{BUILD_OS} eq 'WNT' && !$cygwin) {
+ $error_code = run_job($job, CorrectPath($StandDir.$module), $module_job);
+ };
+ };
+@@ -3180,7 +3211,7 @@ sub html_store_job_info {
+
+ sub start_server_on_port {
+ my $port = shift;
+- if ($ENV{GUI} eq 'WNT') {
++ if ($ENV{BUILD_OS} eq 'WNT') {
+ $socket_obj = new IO::Socket::INET (#LocalAddr => hostname(),
+ LocalPort => $port,
+ Proto => 'tcp',
+--- solenv/bin/deliver.pl.orig 2008-10-21 10:52:30.000000000 +0200
++++ solenv/bin/deliver.pl 2008-10-21 10:58:49.000000000 +0200
+@@ -140,7 +140,7 @@ parse_options();
+ print "$script_name -- version: $script_rev\n" if !$opt_silent;
+
+ if ( ! $opt_delete ) {
+- if ( $ENV{GUI} eq 'WNT' ) {
++ if ( $ENV{BUILD_OS} eq 'WNT' ) {
+ if ($ENV{COM} eq 'GCC') {
+ initialize_strip() ;
+ };
+@@ -411,7 +411,7 @@ sub parse_options
+ $arg =~ /^-delete$/ and $opt_delete = 1 and next;
+ $arg =~ /^-dontdeletecommon$/ and $dontdeletecommon = 1 and next;
+ $arg =~ /^-help$/ and $opt_help = 1 and $arg = '';
+- $arg =~ /^-link$/ and $ENV{GUI} ne 'WNT' and $opt_link = 1 and next;
++ $arg =~ /^-link$/ and $ENV{BUILD_OS} ne 'WNT' and $opt_link = 1 and next;
+ $arg =~ /^-deloutput$/ and $opt_deloutput = 1 and next;
+ $arg =~ /^-debug$/ and $is_debug = 1 and next;
+ $arg =~ /^-checkdlst$/ and $opt_checkdlst = 1 and next;
+@@ -711,7 +711,7 @@ sub is_unstripped {
+ # OS X file command doesn't know if a file is stripped or not
+ if (($file_type =~ /not stripped/o) || ($file_type =~ /Mach-O/o) ||
+ (($file_type =~ /PE/o) && ($ENV{GUI} eq 'WNT') &&
+- ($nm_output = `nm $file_name 2>&1`) && $nm_output &&
++ ($nm_output = `$(NM) $file_name 2>&1`) && $nm_output &&
+ !($nm_output =~ /no symbols/i) && !($nm_output =~ /not recognized/i))) {
+ return '1' if ($file_name =~ /\.bin$/o);
+ return '1' if ($file_name =~ /\.so\.*/o);
+@@ -1485,7 +1485,7 @@ sub usage
+ print STDERR " -force copy even if not newer\n";
+ print STDERR " -dontdeletecommon do not delete common files (for -delete option)\n";
+ print STDERR " -help print this message\n";
+- if ( !defined($ENV{GUI}) || $ENV{GUI} ne 'WNT' ) {
++ if ( !defined($ENV{BUILD_OS}) || $ENV{BUILD_OS} ne 'WNT' ) {
+ print STDERR " -link hard link files into the solver to save disk space\n";
+ }
+ print STDERR " -minor deliver into minor (milestone)\n";
+--- solenv/inc/unitools.mk.pristine 2008-10-21 11:31:04.000000000 +0200
++++ solenv/inc/unitools.mk 2008-10-21 13:54:42.000000000 +0200
+@@ -39,7 +39,7 @@ XSLTPROC*=xsltproc
+
+ ULFCONV*=ulfconv
+
+-MAKEDEPEND*=$(SOLARBINDIR)$/makedepend
++MAKEDEPEND*=$(TOOLS_DIR)/makedepend
+
+ SCP_CHECK_TOOL:=checkscp$E
+
+--- solenv/inc/settings.mk.pristine 2008-10-29 08:42:08.000000000 +0100
++++ solenv/inc/settings.mk 2008-10-30 10:01:59.000000000 +0100
+@@ -752,7 +752,7 @@ COMMONBIN=$(LOCAL_COMMON_OUT)$/bin
+ INC=$(PRJ)$/inc
+ INCPCH=$(PRJ)$/inc$/pch
+ INCLOCAL=..$/inc
+-INCGUI=$(PRJ)$/$(GUIBASE)$/inc
++INCGUI=$(PRJ)$/$(GUIBASE:l)$/inc
+ INCCOM=$(OUT)$/inc
+ INCCOMX=$(OUT)$/inc
+ INCUNOIDL=$(INCCOM)$/$(PRJNAME)
+@@ -1050,7 +1050,11 @@ JAVA*:=$(JAVAINTERPRETER)
+ SCPCOMP=$(PERL) $(SOLARENV)$/bin$/pre2par.pl
+ SCPLINK=$(PERL) $(SOLARENV)$/bin$/par2script.pl
+ LZIP*=lzip
++.IF "$(GUI)" == "UNX" || "$(BUILD_OS)" != "WNT"
++CPPLCC*=cpp.lcc
++.ELSE
+ CPPLCC*=cpplcc
++.ENDIF
+
+ .IF "$(DISABLE_ENHANCED_COMID)"==""
+ .INCLUDE : tg_compv.mk
diff --git a/patches/dev300/crosswin32-solenv-mingw-installer.diff b/patches/dev300/crosswin32-solenv-mingw-installer.diff
new file mode 100644
index 0000000..0b2c000
--- /dev/null
+++ b/patches/dev300/crosswin32-solenv-mingw-installer.diff
@@ -0,0 +1,58 @@
+--- solenv/bin/modules/installer/parameter.pm.pristine 2008-11-12 15:42:24.000000000 +0100
++++ solenv/bin/modules/installer/parameter.pm 2008-11-12 15:38:58.000000000 +0100
+@@ -307,8 +307,11 @@ sub setglobalvariables
+
+ if ( $installer::globals::compiler =~ /unxso[lg]i/ ) { $installer::globals::issolarisx86build = 1; }
+
+- if ($ENV{OS} eq 'LINUX')
++ if ($ENV{OS} eq 'LINUX'
++ || ($ENV{BUILD_OS} == 'Linux' && $ENV{CROSS_COMPILING} eq 'yes'))
+ {
++ $installer::globals::installertypedir = "";
++ $installer::globals::iswindowsbuild = 0;
+ $installer::globals::islinuxbuild = 1;
+ if ( $installer::globals::packageformat eq "rpm" )
+ {
+--- solenv/bin/modules/installer/servicesfile.pm.pristine 2008-11-27 13:28:48.000000000 +0100
++++ solenv/bin/modules/installer/servicesfile.pm 2008-11-27 13:28:09.000000000 +0100
+@@ -942,7 +942,7 @@ sub create_services_rdb
+
+ my $searchname;
+
+- if ($installer::globals::isunix) { $searchname = "regcomp"; }
++ if ($installer::globals::isunix && $ENV{CROSS_COMPILING} ne 'yes') { $searchname = "regcomp"; }
+ else { $searchname = "regcomp.exe"; }
+
+ $regcompfileref = get_source_path_cygwin_safe($searchname, $includepatharrayref, 1);
+--- solenv/bin/modules/installer/worker.pm.pristine 2009-04-06 18:25:00.471497381 +0200
++++ solenv/bin/modules/installer/worker.pm 2009-04-07 21:00:26.915994121 +0200
+@@ -32,7 +32,9 @@
+ package installer::worker;
+
+ use Cwd;
++use File::Basename;
+ use File::Copy;
++use File::Path;
+ use File::stat;
+ use File::Temp qw(tmpnam);
+ use installer::control;
+@@ -808,7 +810,8 @@ sub install_simple ($$$$$$)
+
+ push @lines, "$destination\n";
+ # printf "cp $sourcepath $destdir$destination\n";
+- copy ("$sourcepath", "$destdir$destination") || die "Can't copy file: $!";
++ mkpath dirname $destdir.$destination;
++ copy ("$sourcepath", "$destdir$destination") || die "Can't copy file: $!";
+ my $sourcestat = stat($sourcepath);
+ utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination");
+ chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!";
+@@ -822,7 +825,8 @@ sub install_simple ($$$$$$)
+ my $destinationfile = $onelink->{'destinationfile'};
+
+ # print "link $destinationfile -> $destdir$destination\n";
+- symlink ("$destinationfile", "$destdir$destination") || die "Can't create symlink: $!";
++ mkpath dirname $destdir.$destination;
++ symlink ("$destinationfile", "$destdir$destination") || die "Can't create symlink: $!";
+ push @lines, "$destination\n";
+ }
+
diff --git a/patches/dev300/crosswin32-solenv-mingw.diff b/patches/dev300/crosswin32-solenv-mingw.diff
new file mode 100644
index 0000000..da91e84
--- /dev/null
+++ b/patches/dev300/crosswin32-solenv-mingw.diff
@@ -0,0 +1,324 @@
+--- solenv/inc/wntgcci6.mk.pristine 2008-10-29 08:42:22.000000000 +0100
++++ solenv/inc/wntgcci6.mk 2008-10-30 14:11:42.000000000 +0100
+@@ -31,14 +31,19 @@
+
+ # mk file for wntgcci6
+
+-SOLAR_JAVA*=TRUE
++#SOLAR_JAVA*=TRUE
+ FULL_DESK=TRUE
+ JAVAFLAGSDEBUG=-g
+
+ # SOLAR JAva Unterstuetzung nur fuer wntmsci
+
++.IF "$(CROSS_COMPILING)" == "no"
+ ASM=ml
+ AFLAGS=/c /Cp /coff
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++ASM=$(NASM)
++REGCOMP:=wine $(SOLARBINDIR)/regcomp
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
+
+ # architecture dependent flags for the C and C++ compiler that can be changed by
+ # exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+@@ -50,7 +54,13 @@ CXX*=gcc
+ #CFLAGS=-c -Wall -I$(INCLUDE) $(OLE2DEF)
+ # new:
+ #CYGINC=$(INCLUDE:s/-I /-I/:+" ":s/;/ -I/:s/-I //:s/ / /)
+-CFLAGS=-fmessage-length=0 -c -nostdinc $(OLE2DEF)
++CFLAGS=-fmessage-length=0 -c $(OLE2DEF)
++.IF "$(CROSS_COMPILING)" == "no"
++CFLAGS += -nostdinc
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++CFLAGS += -D__CROSS__
++SCPDEFS += -D__MINGW32__ -D__CROSS__ -DDISABLE_ATL -DUSE_SYSTEM_STL
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
+ ###
+ CFLAGSCC=-pipe $(ARCH_FLAGS)
+ CFLAGSCXX=-pipe $(ARCH_FLAGS)
+@@ -109,18 +116,37 @@ DYNAMIC= -dynamic
+
+ LINK*=$(CXX)
+ LINKC*=$(CC)
+-
+-CYGLIB=$(LIB:s/;/ -L/)
+-LINKFLAGS=-nostdlib -Wl,--enable-stdcall-fixup,--enable-runtime-pseudo-reloc -L$(CYGLIB)
++# FIXME: better way to strip trailing semicolon from $(LIB) to avoid
++# CYGLIB content to end with -L, eating next argument
++LIB___=$(LIB)---
++LIB_NO_TRAILING_SEMI___ = $(LIB___:s/;---//)
++LIB_NO_TRAILING_SEMI = $(LIB_NO_TRAILING_SEMI___:s/---//)
++CYGLIB=$(LIB_NO_TRAILING_SEMI:s/;/ -L/)
++LINKFLAGS=-Wl,--enable-stdcall-fixup,--enable-runtime-pseudo-reloc
++.IF "$(CYGLIB)" != ""
++LINKFLAGS += -L$(CYGLIB)
++.ENDIF #"$(CYGLIB)" != ""
++.IF "$(CROSS_COMPILING)" == "no"
++LINKFLAGS += -nostdlib
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++LINKFLAGS += -L$(SOLARBINDIR) -L$(SOLARLIBDIR) -L$(COMPATH)/../../bin -L$(COMPATH)/../../lib
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
+ .IF "$(USE_MINGW)"=="cygwin"
+ MINGWLIBDIR=$(COMPATH)$/lib$/mingw
+ .ELSE
+ MINGWLIBDIR=$(COMPATH)$/lib
+ .ENDIF
+-LINKFLAGSAPPGUI=-mwindows $(MINGWLIBDIR)$/crt2.o
+-LINKFLAGSSHLGUI=--warn-once -mwindows -shared $(MINGWLIBDIR)$/dllcrt2.o
+-LINKFLAGSAPPCUI=-mconsole $(MINGWLIBDIR)$/crt2.o
+-LINKFLAGSSHLCUI=--warn-once -mconsole -shared $(MINGWLIBDIR)$/dllcrt2.o
++LINKFLAGSAPPGUI=-mwindows
++LINKFLAGSSHLGUI=--warn-once -mwindows -shared
++LINKFLAGSAPPCUI=-mconsole
++LINKFLAGSSHLCUI=--warn-once -mconsole -shared
++.IF "$(CROSS_COMPILING)" == "no"
++LINKFLAGSAPPGUI+=$(MINGWLIBDIR)$/crt2.o
++LINKFLAGSSHLGUI+=$(MINGWLIBDIR)$/dllcrt2.o
++LINKFLAGSAPPCUI+=$(MINGWLIBDIR)$/crt2.o
++LINKFLAGSSHLCUI+=$(MINGWLIBDIR)$/dllcrt2.o
++.ENDIF # "$(CROSS_COMPILING)" == "no"
++
+ LINKFLAGSTACK=
+ LINKFLAGSPROF=
+ LINKFLAGSDEBUG=-g
+@@ -144,24 +170,28 @@ STDLIBCUIMT+=-lmingwthrd
+ STDSHLGUIMT+=-lmingwthrd
+ STDSHLCUIMT+=-lmingwthrd
+ .ENDIF
+-STDLIBGUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+-STDLIBCUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+-STDSHLGUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+-STDSHLCUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
++STDLIBGUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt -lversion
++STDLIBCUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt -lversion
++STDSHLGUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt -lversion
++STDSHLCUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt -lversion
+
+ LIBSTLPORT=-lstlport_gcc
+ LIBSTLPORTST=-lstlport_gcc_static
+
+-LIBMGR=ar
++LIBMGR=$(AR)
+ LIBFLAGS=-rsu
+
+-IMPLIB=ld
++IMPLIB=$(LD)
+ IMPLIBFLAGS=
+
+ MAPSYM=tmapsym
+ MAPSYMFLAGS=
+
++.IF "$(CROSS_COMPILING)" == "no"
+ RC=rc
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++RC=$(WINDRES)
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
+ RCFLAGS=-D__MINGW32__ -DWIN32 -D_WIN32_IE=0x400 -fo$@ $(RCFILES)
+ RCLINK=
+ RCLINKFLAGS=
+@@ -170,12 +200,22 @@ RCSETVERSION=
+ DLLPOSTFIX=gi
+ PCHPOST=.gch
+
++.IF "$(CROSS_COMPILING)" == "no"
++LINK_PSDK_LIB=$(PSDK_HOME)/lib/
++PSDK_DOT_LIB=.lib
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++DISABLE_ACTIVEX=TRUE
++DISABLE_ATL=TRUE
++LINK_PSDK_LIB=-l
++PSDK_DOT_LIB=
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
++
+ ADVAPI32LIB=-ladvapi32
+ SHELL32LIB=-lshell32
+ GDI32LIB=-lgdi32
+ OLE32LIB=-lole32
+ OLEAUT32LIB=-loleaut32
+-UUIDLIB=$(PSDK_HOME)$/lib$/uuid.lib
++UUIDLIB=$(LINK_PSDK_LIB)uuid$(PSDK_DOT_LIB)
+ WINSPOOLLIB=-lwinspool
+ IMM32LIB=-limm32
+ PSPLIB=-lpsp
+@@ -189,14 +228,21 @@ USER32LIB=-luser32
+ LIBCMT=-lmsvcrt
+ COMDLG32LIB=-lcomdlg32
+ COMCTL32LIB=-lcomctl32
+-CRYPT32LIB=$(PSDK_HOME)$/lib$/crypt32.lib
+-GDIPLUSLIB=$(PSDK_HOME)$/lib$/gdiplus.lib
+-DBGHELPLIB=$(PSDK_HOME)$/lib$/dbghelp.lib
+-MSILIB=$(PSDK_HOME)$/lib$/msi.lib
+-DDRAWLIB=$(DIRECTXSDK_LIB)/ddraw.lib
+-SHLWAPILIB=$(PSDK_HOME)$/lib$/shlwapi.lib
+-URLMONLIB=$(PSDK_HOME)$/lib$/urlmon.lib
+-UNICOWSLIB=$(PSDK_HOME)$/lib$/unicows.lib
++CRYPT32LIB=$(LINK_PSDK_LIB)crypt32$(PSDK_DOT_LIB)
++GDIPLUSLIB=$(LINK_PSDK_LIB)gdiplus$(PSDK_DOT_LIB)
++DBGHELPLIB=$(LINK_PSDK_LIB)dbghelp$(PSDK_DOT_LIB)
++MSILIB=$(LINK_PSDK_LIB)msi$(PSDK_DOT_LIB)
++DDRAWLIB=$(DIRECTXSDK_LIB)/ddraw$(PSDK_DOT_LIB)
++SHLWAPILIB=$(LINK_PSDK_LIB)shlwapi$(PSDK_DOT_LIB)
++URLMONLIB=$(LINK_PSDK_LIB)urlmon$(PSDK_DOT_LIB)
++UNICOWSLIB=$(LINK_PSDK_LIB)unicows$(PSDK_DOT_LIB)
+ WININETLIB=-lwininet
+ OLDNAMESLIB=-lmoldname
+-MSIMG32LIB=$(PSDK_HOME)$/lib$/msimg32.lib
++MSIMG32LIB=$(LINK_PSDK_LIB)msimg32$(PSDK_DOT_LIB)
++
++.IF "$(CROSS_COMPILING)" == "yes"
++CURLLIB=-lcurl
++BERKELEYLIB=-ldb -lwsock32
++XSLTLIB=-lxslt -lxml2
++LIBXML2LIB=-lxml2
++.ENDIF
+--- solenv/inc/shlinfo.rc.pristine 2008-10-29 09:33:25.000000000 +0100
++++ solenv/inc/shlinfo.rc 2008-10-29 09:33:33.000000000 +0100
+@@ -29,8 +29,9 @@
+ ************************************************************************/
+
+ #define VERSION 3
+-#define SUBVERSION 1
+-#define VERVARIANT 0
++#if !defined(VERVARIANT)
++ #define VERVARIANT 0
++#endif
+
+ // .0 + VER_CONCEPT
+ // .100 + VER_ALPHA
+@@ -90,16 +91,16 @@
+ // version information
+ // -----------------------------------------------------------------------
+
+-VS_VERSION_INFO versioninfo
++VS_VERSION_INFO VERSIONINFO
+ #ifndef SUBVERSION
+- fileversion VERSION, 0, 0, VERVARIANT
+- productversion VERSION, 0, 0, VERVARIANT
++ FILEVERSION VERSION, 0, 0, VERVARIANT
++ PRODUCTVERSION VERSION, 0, 0, VERVARIANT
+ #else
+- fileversion VERSION, VERVARIANT, VER_COUNT
+- productversion VERSION, VERVARIANT, VER_COUNT
++ FILEVERSION VERSION, VERVARIANT, VER_COUNT
++ PRODUCTVERSION VERSION, VERVARIANT, VER_COUNT
+ #endif
+- fileflagsmask 0x3F
+- fileflags
++ FILEFLAGSMASK 0x3F
++ FILEFLAGS
+ #if defined(DEBUG)
+ VS_FF_DEBUG |
+ #endif
+@@ -108,36 +109,36 @@
+ #endif
+ 0
+ #ifndef WIN32
+- fileos VOS_DOS_WINDOWS16
++ FILEOS VOS_DOS_WINDOWS16
+ #else
+- fileos VOS_NT_WINDOWS32
++ FILEOS VOS_NT_WINDOWS32
+ #endif
+- filetype VFT_APP
++ FILETYPE VFT_APP
+ {
+- block "StringFileInfo"
++ BLOCK "StringFileInfo"
+ {
+ #ifdef LG_D
+- block "040704E4"
++ BLOCK "040704E4"
+ {
+ // German StringTable
+- value "CompanyName", "Sun Microsystems, Inc.\0"
+- value "FileVersion", PPS(VER_LEVEL) "\0"
+- value "OriginalFilename", PPS(ORG_NAME) "\0"
+- value "InternalName", PPS(INTERNAL_NAME) "\0"
+- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
++ VALUE "CompanyName", "Sun Microsystems, Inc.\0"
++ VALUE "FileVersion", PPS(VER_LEVEL) "\0"
++ VALUE "OriginalFilename", PPS(ORG_NAME) "\0"
++ VALUE "InternalName", PPS(INTERNAL_NAME) "\0"
++ VALUE "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ ADDITIONAL_VERINFO1
+ ADDITIONAL_VERINFO2
+ ADDITIONAL_VERINFO3
+ }
+ #else
+- block "040904E4"
++ BLOCK "040904E4"
+ {
+ // International StringTable
+- value "CompanyName", "Sun Microsystems, Inc.\0"
+- value "FileVersion", PPS(VER_LEVEL) "\0"
+- value "OriginalFilename", PPS(ORG_NAME) "\0"
+- value "InternalName", PPS(INTERNAL_NAME) "\0"
+- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
++ VALUE "CompanyName", "Sun Microsystems, Inc.\0"
++ VALUE "FileVersion", PPS(VER_LEVEL) "\0"
++ VALUE "OriginalFilename", PPS(ORG_NAME) "\0"
++ VALUE "InternalName", PPS(INTERNAL_NAME) "\0"
++ VALUE "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ ADDITIONAL_VERINFO1
+ ADDITIONAL_VERINFO2
+ ADDITIONAL_VERINFO3
+@@ -145,12 +146,12 @@
+ #endif
+ }
+
+- block "VarFileInfo"
++ BLOCK "VarFileInfo"
+ {
+ #ifdef LG_D
+- value "Translation", 0x0407, 1252
++ VALUE "Translation", 0x0407, 1252
+ #else
+- value "Translation", 0x0409, 1252
++ VALUE "Translation", 0x0409, 1252
+ #endif
+ }
+ }
+@@ -160,6 +161,6 @@
+ {
+ 0xF0, "sw", 0x0F, VER_YEAR, VER_MONTH, VER_DAY,
+ VERSION, VERVARIANT, VER_COUNT
+-};
++}
+
+ #endif // OS2
+--- solenv/inc/_tg_shl.mk.pristine 2008-10-29 09:33:25.000000000 +0100
++++ solenv/inc/_tg_shl.mk 2008-10-29 09:33:33.000000000 +0100
+@@ -275,7 +275,11 @@
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL1TARGET:b) >> $(MISC)$/$(SHL1DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)$/$(SHL1DEFAULTRES:b).rc
+ .ENDIF # "$(use_shl_versions)" != ""
++.IF "$(CROSS_COMPILING)" == "no"
+ $(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)$/$(SHL1DEFAULTRES:b).rc
++.ELSE # "$(CROSS_COMPILING)" == "yes"
++ $(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) -i $(MISC)$/$(SHL1DEFAULTRES:b).rc -o $(MISC)$/$(SHL1DEFAULTRES:b).res
++.ENDIF # "$(CROSS_COMPILING)" == "yes"
+ .ENDIF # "$(SHL1DEFAULTRES)"!=""
+ .IF "$(SHL1ALLRES)"!=""
+ .IF "$(USE_SHELL)"=="4nt"
+@@ -283,18 +287,18 @@
+ .ELSE # "$(USE_SHELL)"=="4nt"
+ $(TYPE) $(SHL1ALLRES) > $(SHL1LINKRES)
+ .IF "$(COM)"=="GCC"
+- windres $(SHL1LINKRES) $(SHL1LINKRESO)
++ $(WINDRES) $(SHL1LINKRES) $(SHL1LINKRESO)
+ .ENDIF # "$(COM)"=="GCC"
+ .ENDIF # "$(USE_SHELL)"=="4nt"
+ .ENDIF # "$(SHL1ALLRES)"!=""
+ .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ .IF "$(DEFLIB1NAME)"!="" # do not have to include objs
+- @echo dlltool --input-def $(SHL1DEF) \
++ @echo $(DLLTOOL) --input-def $(SHL1DEF) \
+ --dllname $(SHL1TARGET)$(DLLPOST) \
+ --kill-at \
+ --output-exp $(MISC)$/$(@:b)_exp.o > $(MISC)$/$(TARGET).$(@:b)_1.cmd
+ .ELSE # "$(DEFLIB1NAME)"!="" # do not have to include objs
+- @echo dlltool --input-def $(SHL1DEF) \
++ @echo $(DLLTOOL) --input-def $(SHL1DEF) \
+ --dllname $(SHL1TARGET)$(DLLPOST) \
+ --kill-at \
+ --output-exp $(MISC)$/$(@:b)_exp.o \
diff --git a/patches/dev300/crosswin32-solenv.diff b/patches/dev300/crosswin32-solenv.diff
new file mode 100644
index 0000000..ad1f87f
--- /dev/null
+++ b/patches/dev300/crosswin32-solenv.diff
@@ -0,0 +1,11 @@
+--- solenv/bin/build.pl.orig 2008-07-22 18:46:59.000000000 +0200
++++ solenv/bin/build.pl 2008-10-21 11:18:41.000000000 +0200
+@@ -419,7 +419,7 @@ sub BuildAll {
+ while ($Prj = PickPrjToBuild(\%global_deps_hash)) {
+ if (!defined $dead_parents{$Prj}) {
+ if (scalar keys %broken_build) {
+- print $echo . "Skipping project $Prj because of error(s)\n";
++ print $echo . "Skipping project $Prj: error:" . $broken_build{$Prj} . "\n";
+ RemoveFromDependencies($Prj, \%global_deps_hash);
+ $build_is_finished{$Prj}++;
+ next;
diff --git a/patches/dev300/crosswin32-soltools-cross.diff b/patches/dev300/crosswin32-soltools-cross.diff
new file mode 100644
index 0000000..1e15193
--- /dev/null
+++ b/patches/dev300/crosswin32-soltools-cross.diff
@@ -0,0 +1,13 @@
+--- soltools/util/makefile.pmk.~1.7.~~ 2008-04-10 20:11:03.000000000 +0200
++++ soltools/util/makefile.pmk 2008-10-21 16:07:21.000000000 +0200
+@@ -29,8 +29,10 @@
+ #
+ #*************************************************************************
+
++.IF "$(CROSS_COMPILING)" == "no"
+ # find 'makedepend' in own output tree
+ MAKEDEPEND=$(WRAPCMD) $(BIN)$/makedepend
+
+ # find 'adjustvisibility' in own output tree
+ ADJUSTVISIBILITY=$(WRAPCMD) $(BIN)$/adjustvisibility
++.ENDIF # "$(CROSS_COMPILING)" == "no"
diff --git a/patches/dev300/crosswin32-store-core.diff b/patches/dev300/crosswin32-store-core.diff
new file mode 100644
index 0000000..16b00c0
--- /dev/null
+++ b/patches/dev300/crosswin32-store-core.diff
@@ -0,0 +1,4118 @@
+--- ./store/inc/store/store.h.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/inc/store/store.h 2009-04-06 16:42:11.000000000 +0000
+@@ -95,7 +95,8 @@ storeError SAL_CALL store_openFile (
+ rtl_uString *pFilename,
+ storeAccessMode eAccessMode,
+ sal_uInt16 nPageSize,
+- storeFileHandle *phFile
++ storeFileHandle *phFile,
++ sal_uInt16 nFormatVersion = STORE_FORMAT_V1
+ ) SAL_THROW_EXTERN_C();
+
+
+--- ./store/inc/store/store.hxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/inc/store/store.hxx 2009-04-06 16:42:11.000000000 +0000
+@@ -281,7 +281,8 @@ public:
+ inline storeError create (
+ const rtl::OUString &rFilename,
+ storeAccessMode eAccessMode,
+- sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE
++ sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE,
++ sal_uInt16 nFormatVersion = STORE_FORMAT_V1
+ ) SAL_THROW(());
+
+ /** Open the temporary file in memory.
+--- ./store/inc/store/store.inl.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/inc/store/store.inl 2009-04-06 16:42:11.000000000 +0000
+@@ -321,14 +321,15 @@ inline sal_Bool OStoreFile::isValid (voi
+ inline storeError OStoreFile::create (
+ const rtl::OUString &rFilename,
+ storeAccessMode eAccessMode,
+- sal_uInt16 nPageSize) SAL_THROW(())
++ sal_uInt16 nPageSize,
++ sal_uInt16 nFormatVersion) SAL_THROW(())
+ {
+ if (m_hImpl)
+ {
+ store_releaseHandle (m_hImpl);
+ m_hImpl = 0;
+ }
+- return store_openFile (rFilename.pData, eAccessMode, nPageSize, &m_hImpl);
++ return store_openFile (rFilename.pData, eAccessMode, nPageSize, &m_hImpl, nFormatVersion);
+ }
+
+ inline storeError OStoreFile::createInMemory (
+--- ./store/inc/store/types.h.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/inc/store/types.h 2009-04-06 16:42:11.000000000 +0000
+@@ -38,16 +38,26 @@
+ extern "C" {
+ #endif
+
++/* format version
++ V1 original rdb format, used publicly
++ V2 internal rdb format, which might change during time and
++ should be only used internally for services.rdb, types.rdb
++ and other rdb files shipped with OOo
++*/
++
++#define STORE_FORMAT_V1 1
++#define STORE_FORMAT_V2 2
++
+ /** PageSize (recommended) default.
+ @see store_openFile()
+ */
+-#define STORE_DEFAULT_PAGESIZE ((sal_uInt16)0x0400)
+-
++#define STORE_DEFAULT_PAGESIZE ((sal_uInt16)0x200)
+
+ /** PageSize (enforced) limits.
+ @see store_openFile()
+ */
+-#define STORE_MINIMUM_PAGESIZE ((sal_uInt16)0x0200)
++#define STORE_MINIMUM_PAGESIZE_V1 ((sal_uInt16)0x200)
++#define STORE_MINIMUM_PAGESIZE_V2 ((sal_uInt16)0x80)
+ #define STORE_MAXIMUM_PAGESIZE ((sal_uInt16)0x8000)
+
+
+--- ./store/source/filelckb.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/filelckb.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -623,7 +623,11 @@ storeError OFileLockBytes::writeAt (
+ // Acquire exclusive access.
+ osl::MutexGuard aGuard (m_aMutex);
+ if (m_pImpl->isValid())
+- return m_pImpl->writeAt (nOffset, pBuffer, nBytes, rnDone);
++ {
++ storeError nErr;
++ nErr = m_pImpl->writeAt (nOffset, pBuffer, nBytes, rnDone);
++ return nErr;
++ }
+ else
+ return store_E_InvalidHandle;
+ }
+--- ./store/source/storbase.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/storbase.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -43,6 +43,7 @@
+ #include <sal/types.h>
+ #include <rtl/alloc.h>
+ #include <rtl/ref.hxx>
++#include <rtl/memory.h>
+ #include <osl/diagnose.h>
+ #include <osl/endian.h>
+ #include <osl/mutex.hxx>
+@@ -51,6 +52,12 @@
+ #include <store/lockbyte.hxx>
+ #include <storbase.hxx>
+
++#ifdef WNT
++#include <malloc.h>
++#else
++#include <alloca.h>
++#endif
++
+ using namespace store;
+
+ /*========================================================================
+@@ -222,7 +229,9 @@ storeError OStorePageObject::verify (con
+ * OStoreSuperBlock.
+ *
+ *======================================================================*/
+-#define STORE_MAGIC_SUPERBLOCK sal_uInt32(0x484D5343)
++#define STORE_MAGIC_SUPERBLOCK_V1 sal_uInt32(0x484D5343)
++#define STORE_MAGIC_SUPERBLOCK_V2 sal_uInt32(0x484D5344)
++#define STORE_VERSION 2
+
+ struct OStoreSuperBlock
+ {
+@@ -250,7 +259,7 @@ struct OStoreSuperBlock
+ /** Construction.
+ */
+ OStoreSuperBlock (void)
+- : m_aGuard (STORE_MAGIC_SUPERBLOCK),
++ : m_aGuard (STORE_MAGIC_SUPERBLOCK_V2),
+ m_nMarked (0),
+ m_aMarked (0),
+ m_nUnused (0),
+@@ -286,14 +295,21 @@ struct OStoreSuperBlock
+ (m_nMarked == rOther.m_nMarked) &&
+ (m_aMarked == rOther.m_aMarked) &&
+ (m_nUnused == rOther.m_nUnused) &&
+- (m_aUnused == rOther.m_aUnused) );
++ (m_aUnused == rOther.m_aUnused) );
+ }
+
+ /** create.
+ */
+- void create (const D& rDescr)
++ void create (const D& rDescr, sal_uInt16 nFormatVersion)
+ {
+- m_aGuard = G(STORE_MAGIC_SUPERBLOCK);
++ switch (nFormatVersion) {
++ case STORE_FORMAT_V1:
++ m_aGuard = G(STORE_MAGIC_SUPERBLOCK_V1);
++ break;
++ case STORE_FORMAT_V2:
++ m_aGuard = G(STORE_MAGIC_SUPERBLOCK_V2);
++ break;
++ }
+ m_aDescr = rDescr;
+
+ m_nMarked = 0;
+@@ -360,13 +376,14 @@ struct OStoreSuperBlock
+
+ /** verify (external representation).
+ */
+- storeError verify (void)
++ storeError verify (sal_uInt32 nVersion)
+ {
+ sal_uInt32 nMagic = m_aGuard.m_nMagic;
+ #ifdef OSL_BIGENDIAN
+ nMagic = OSL_SWAPDWORD(nMagic);
+ #endif /* OSL_BIGENDIAN */
+- if (nMagic != STORE_MAGIC_SUPERBLOCK)
++ if ((nVersion == STORE_FORMAT_V1 && nMagic != STORE_MAGIC_SUPERBLOCK_V1) ||
++ (nVersion == STORE_FORMAT_V2 && nMagic != STORE_MAGIC_SUPERBLOCK_V2))
+ return store_E_WrongFormat;
+
+ sal_uInt32 nCRC32 = 0;
+@@ -380,6 +397,26 @@ struct OStoreSuperBlock
+ else
+ return store_E_None;
+ }
++
++ /** return version of superblock, determined by magic number in guard
++ */
++ sal_uInt32 version ()
++ {
++ sal_uInt32 nVersion;
++
++ switch (m_aGuard.m_nMagic) {
++ case STORE_MAGIC_SUPERBLOCK_V1:
++ nVersion = STORE_FORMAT_V1;
++ break;
++ case STORE_MAGIC_SUPERBLOCK_V2:
++ nVersion = STORE_FORMAT_V2;
++ break;
++ default:
++ nVersion = 0;
++ }
++
++ return nVersion;
++ }
+ };
+
+ /*========================================================================
+@@ -471,6 +508,10 @@ struct OStoreSuperBlockPage
+ SuperBlock m_aSuperTwo;
+ StateBlock m_aState;
+
++ /** version
++ */
++ sal_uInt32 m_nVersion;
++
+ /** size.
+ */
+ static sal_uInt16 size (void)
+@@ -492,7 +533,7 @@ struct OStoreSuperBlockPage
+
+ /** Construction.
+ */
+- OStoreSuperBlockPage (void)
++ OStoreSuperBlockPage (sal_uInt16 nFormatVersion) : m_nVersion (nFormatVersion)
+ {}
+
+ /** swap (internal and external representation).
+@@ -518,6 +559,8 @@ struct OStoreSuperBlockPage
+ swap();
+ #endif /* OSL_BIGENDIAN */
+
++ m_nVersion = m_aSuperOne.version ();
++
+ // Done.
+ return eErrCode;
+ }
+@@ -603,7 +646,7 @@ storeError OStoreSuperBlockPage::create
+ if (eErrCode == store_E_None)
+ {
+ // Setup 1st and 2nd SuperBlock copy.
+- m_aSuperOne.create (rDescr);
++ m_aSuperOne.create (rDescr, m_nVersion);
+ m_aSuperTwo = m_aSuperOne;
+
+ // Mark as modified.
+@@ -729,11 +772,11 @@ storeError OStoreSuperBlockPage::verify
+ #endif /* OSL_BIGENDIAN */
+
+ // Verify 1st copy.
+- storeError eErrCode = m_aSuperOne.verify();
++ storeError eErrCode = m_aSuperOne.verify (m_nVersion);
+ if (eErrCode == store_E_None)
+ {
+ // Ok. Verify 2nd copy.
+- eErrCode = m_aSuperTwo.verify();
++ eErrCode = m_aSuperTwo.verify (m_nVersion);
+ if (eErrCode == store_E_None)
+ {
+ // Ok. Ensure identical copies (1st copy wins).
+@@ -764,7 +807,7 @@ storeError OStoreSuperBlockPage::verify
+ else
+ {
+ // Failure. Verify 2nd copy.
+- eErrCode = m_aSuperTwo.verify();
++ eErrCode = m_aSuperTwo.verify (m_nVersion);
+ if (eErrCode == store_E_None)
+ {
+ // Ok. Replace 1st copy with 2nd copy.
+@@ -979,7 +1022,7 @@ storeError OStorePageBIOS::verify (Super
+ if (rpSuper == 0)
+ {
+ // Allocate.
+- if ((rpSuper = new SuperPage()) == 0)
++ if ((rpSuper = new SuperPage(version ())) == 0)
+ return store_E_OutOfMemory;
+
+ // Load (w/o verification).
+@@ -1090,7 +1133,7 @@ storeError OStorePageBIOS::initialize (
+ * create (SuperBlock).
+ * Precond: initialized, writeable (store_AccessCreate).
+ */
+-storeError OStorePageBIOS::create (sal_uInt16 nPageSize)
++storeError OStorePageBIOS::create (sal_uInt16 nPageSize, sal_uInt16 nFormatVersion)
+ {
+ // Acquire exclusive access.
+ osl::MutexGuard aGuard (m_aMutex);
+@@ -1103,7 +1146,14 @@ storeError OStorePageBIOS::create (sal_u
+
+ // Check PageSize.
+ sal_uInt16 nMinSize = SuperPage::size();
+- nMinSize = std::max (nMinSize, STORE_MINIMUM_PAGESIZE);
++ switch (nFormatVersion) {
++ case STORE_FORMAT_V1:
++ nMinSize = std::max (nMinSize, STORE_MINIMUM_PAGESIZE_V1);
++ break;
++ case STORE_FORMAT_V2:
++ nMinSize = std::max (nMinSize, STORE_MINIMUM_PAGESIZE_V2);
++ break;
++ }
+
+ nPageSize = std::max (nPageSize, nMinSize);
+ nPageSize = std::min (nPageSize, STORE_MAXIMUM_PAGESIZE);
+@@ -1118,7 +1168,7 @@ storeError OStorePageBIOS::create (sal_u
+ return eErrCode;
+
+ // Check SuperBlock page allocation.
+- if ((m_pSuper == 0) && ((m_pSuper = new SuperPage()) == 0))
++ if ((m_pSuper == 0) && ((m_pSuper = new SuperPage(nFormatVersion)) == 0))
+ {
+ // Cleanup and fail.
+ releaseLock (0, SuperPage::size());
+@@ -1465,7 +1515,12 @@ storeError OStorePageBIOS::allocate (
+ if (aListHead.m_nAddr)
+ {
+ // Allocate from FreeList.
+- OStorePageData aPageHead (OStorePageData::size());
++#ifdef WNT
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) _alloca (OStorePageData::size());
++#else
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) alloca (OStorePageData::size());
++#endif
++ OStorePageData aPageHead (OStorePageData::size(), sizeof (OStorePageData), aPageHeadData);
+ aPageHead.location (aListHead.m_nAddr);
+
+ // Load PageHead.
+@@ -1478,9 +1533,9 @@ storeError OStorePageBIOS::allocate (
+
+ // Verify FreeList head.
+ OSL_PRECOND(
+- aPageHead.m_aUnused.m_nAddr != STORE_PAGE_NULL,
++ aPageHead.PageHeader ().m_aUnused.m_nAddr != STORE_PAGE_NULL,
+ "OStorePageBIOS::allocate(): page not free");
+- if (aPageHead.m_aUnused.m_nAddr == STORE_PAGE_NULL)
++ if (aPageHead.PageHeader ().m_aUnused.m_nAddr == STORE_PAGE_NULL)
+ {
+ // Recovery: Reset FreeList.
+ m_pSuper->m_aSuperTwo.unusedReset();
+@@ -1501,11 +1556,11 @@ storeError OStorePageBIOS::allocate (
+
+ // Assign location.
+ OStorePageData &rData = rPage.getData();
+- rData.location (aPageHead.m_aDescr.m_nAddr);
++ rData.location (aPageHead.PageHeader ().m_aDescr.m_nAddr);
+
+ // Pop from FreeList.
+- aListHead.m_nAddr = aPageHead.m_aUnused.m_nAddr;
+- rData.m_aUnused.m_nAddr = STORE_PAGE_NULL;
++ aListHead.m_nAddr = aPageHead.PageHeader ().m_aUnused.m_nAddr;
++ rData.PageHeader ().m_aUnused.m_nAddr = STORE_PAGE_NULL;
+
+ // Save page.
+ eErrCode = poke (rPage);
+@@ -1639,8 +1694,8 @@ storeError OStorePageBIOS::free (OStoreP
+ // Push onto FreeList.
+ OStorePageLink aListHead (m_pSuper->m_aSuperTwo.unusedHead());
+
+- rData.m_aUnused.m_nAddr = aListHead.m_nAddr;
+- aListHead.m_nAddr = rData.m_aDescr.m_nAddr;
++ rData.PageHeader ().m_aUnused.m_nAddr = aListHead.m_nAddr;
++ aListHead.m_nAddr = rData.PageHeader ().m_aDescr.m_nAddr;
+
+ // Save PageHead.
+ eErrCode = poke (rData);
+@@ -1678,14 +1733,14 @@ storeError OStorePageBIOS::load (OStoreP
+
+ // Save PageDescriptor.
+ OStorePageData &rData = rPage.getData();
+- OStorePageDescriptor aDescr (rData.m_aDescr);
++ OStorePageDescriptor aDescr (rData.PageHeader ().m_aDescr);
+
+ // Read page.
+- storeError eErrCode = read (aDescr.m_nAddr, &rData, aDescr.m_nSize);
++ storeError eErrCode = read (aDescr.m_nAddr, rData.Data (), aDescr.m_nSize);
+ if (eErrCode != store_E_None)
+ {
+ // Restore PageDescriptor.
+- rData.m_aDescr = aDescr;
++ rData.PageHeader ().m_aDescr = aDescr;
+ return eErrCode;
+ }
+
+@@ -1694,7 +1749,7 @@ storeError OStorePageBIOS::load (OStoreP
+ if (eErrCode != store_E_None)
+ {
+ // Restore PageDescriptor.
+- rData.m_aDescr = aDescr;
++ rData.PageHeader ().m_aDescr = aDescr;
+ return eErrCode;
+ }
+
+@@ -1704,8 +1759,8 @@ storeError OStorePageBIOS::load (OStoreP
+ #endif /* OSL_BIGENDIAN */
+
+ // Verify PageDescriptor.
+- if (!((aDescr == rData.m_aDescr) ||
+- (aDescr <= rData.m_aDescr) ))
++ if (!((aDescr == rData.PageHeader ().m_aDescr) ||
++ (aDescr <= rData.PageHeader ().m_aDescr) ))
+ return store_E_InvalidAccess;
+
+ // Mark page as clean.
+@@ -1898,7 +1953,12 @@ storeError OStorePageBIOS::scanNext (
+ return store_E_InvalidAccess;
+
+ // Setup PageHead.
+- OStorePageData aPageHead (OStorePageData::size());
++#ifdef WNT
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) _alloca (OStorePageData::size());
++#else
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) alloca (OStorePageData::size());
++#endif
++ OStorePageData aPageHead (OStorePageData::size(), sizeof (OStorePageData), aPageHeadData);
+
+ // Check context.
+ while (rCtx.isValid())
+@@ -1913,11 +1973,11 @@ storeError OStorePageBIOS::scanNext (
+ continue;
+
+ // Check PageHead Magic number.
+- if (aPageHead.m_aGuard.m_nMagic != rCtx.m_nMagic)
++ if (aPageHead.PageHeader ().m_aGuard.m_nMagic != rCtx.m_nMagic)
+ continue;
+
+ // Check PageHead Unused link.
+- if (aPageHead.m_aUnused.m_nAddr != STORE_PAGE_NULL)
++ if (aPageHead.PageHeader ().m_aUnused.m_nAddr != STORE_PAGE_NULL)
+ continue;
+
+ // Load page.
+@@ -1941,14 +2001,14 @@ storeError OStorePageBIOS::scanNext (
+ storeError OStorePageBIOS::peek (OStorePageData &rData)
+ {
+ // Save PageDescriptor.
+- OStorePageDescriptor aDescr (rData.m_aDescr);
++ OStorePageDescriptor aDescr (rData.PageHeader ().m_aDescr);
+
+ // Read PageHead.
+- storeError eErrCode = read (aDescr.m_nAddr, &rData, rData.size());
++ storeError eErrCode = read (aDescr.m_nAddr, rData.Data (), rData.size());
+ if (eErrCode != store_E_None)
+ {
+ // Restore PageDescriptor.
+- rData.m_aDescr = aDescr;
++ rData.PageHeader ().m_aDescr = aDescr;
+ return eErrCode;
+ }
+
+@@ -1957,7 +2017,7 @@ storeError OStorePageBIOS::peek (OStoreP
+ if (eErrCode != store_E_None)
+ {
+ // Restore PageDescriptor.
+- rData.m_aDescr = aDescr;
++ rData.PageHeader ().m_aDescr = aDescr;
+ return eErrCode;
+ }
+
+@@ -1967,8 +2027,8 @@ storeError OStorePageBIOS::peek (OStoreP
+ #endif /* OSL_BIGENDIAN */
+
+ // Verify PageDescriptor.
+- if (!((aDescr == rData.m_aDescr) ||
+- (aDescr <= rData.m_aDescr) ))
++ if (!((aDescr == rData.PageHeader ().m_aDescr) ||
++ (aDescr <= rData.PageHeader ().m_aDescr) ))
+ return store_E_InvalidAccess;
+ else
+ return store_E_None;
+@@ -1981,7 +2041,7 @@ storeError OStorePageBIOS::peek (OStoreP
+ storeError OStorePageBIOS::poke (OStorePageData &rData)
+ {
+ // Save PageDescriptor.
+- OStorePageDescriptor aDescr (rData.m_aDescr);
++ OStorePageDescriptor aDescr (rData.PageHeader ().m_aDescr);
+
+ #ifdef OSL_BIGENDIAN
+ // Swap to external representation.
+@@ -1992,7 +2052,7 @@ storeError OStorePageBIOS::poke (OStoreP
+ rData.guard ();
+
+ // Write PageHead.
+- storeError eErrCode = write (aDescr.m_nAddr, &rData, rData.size());
++ storeError eErrCode = write (aDescr.m_nAddr, rData.Data (), rData.size());
+
+ #ifdef OSL_BIGENDIAN
+ // Swap back to internal representation.
+@@ -2011,7 +2071,7 @@ storeError OStorePageBIOS::poke (OStoreP
+ {
+ // Save PageDescriptor.
+ OStorePageData &rData = rPage.getData();
+- OStorePageDescriptor aDescr (rData.m_aDescr);
++ OStorePageDescriptor aDescr (rData.PageHeader ().m_aDescr);
+
+ #ifdef OSL_BIGENDIAN
+ // Swap to external representation.
+@@ -2022,7 +2082,7 @@ storeError OStorePageBIOS::poke (OStoreP
+ rPage.guard (aDescr);
+
+ // Write page.
+- storeError eErrCode = write (aDescr.m_nAddr, &rData, aDescr.m_nSize);
++ storeError eErrCode = write (aDescr.m_nAddr, rData.Data (), aDescr.m_nSize);
+
+ #ifdef OSL_BIGENDIAN
+ // Swap back to internal representation.
+@@ -2037,3 +2097,183 @@ storeError OStorePageBIOS::poke (OStoreP
+ return eErrCode;
+ }
+
++sal_uInt32 OStorePageBIOS::version ()
++{
++ if (!m_pSuper)
++ return 0;
++
++ return m_pSuper->m_nVersion;
++}
++
++static void
++copyAndTerminate( sal_Char *pDest, const sal_Char *pSrc, sal_Int32 nBytes)
++{
++ rtl_copyMemory (pDest, pSrc, nBytes);
++ pDest[nBytes] = '\0';
++}
++
++#define STORE_MAGIC_LONGNAME sal_uInt32 (0x12345678)
++
++struct OStorePageLongNameData : public OStorePageData
++{
++ typedef OStorePageData base;
++
++ struct Representation {
++ sal_Char m_nData[1];
++ };
++ public:
++ OStorePageLongNameData(sal_uInt16 nPageSize, sal_uInt8 *pData) :
++ OStorePageData (nPageSize, sizeof (OStorePageLongNameData), pData)
++ {
++ base::PageHeader ().m_aGuard.m_nMagic = STORE_MAGIC_LONGNAME;
++ base::PageHeader ().m_aDescr.m_nUsed = sal::static_int_cast< sal_uInt16 >(
++ base::PageHeader ().m_aDescr.m_nUsed);
++ rtl_zeroMemory (&RepresentationData (), capacity());
++ }
++
++ /** capacity.
++ */
++ sal_uInt16 capacity (void)
++ {
++ return (base::PageHeader ().m_aDescr.m_nSize - (base::size()));
++ }
++
++ Representation& RepresentationData ()
++ {
++ return *(Representation *) (Data () + base::size ());
++ }
++};
++
++static sal_uInt16
++lcl_getPageSize (OStorePageBIOS &rBIOS)
++{
++ sal_uInt16 nPageSize = STORE_MAXIMUM_PAGESIZE;
++ rBIOS.getPageSize(nPageSize);
++// fprintf (stderr, "page size for extended names %d\n", nPageSize);
++ return nPageSize;
++}
++
++#define USE_OTHER_BLOCK STORE_INTERNAL_MAX_NAMESIZE
++
++storeError
++OStorePageNameBlockV1::SetName (const rtl_String *pName, OStorePageBIOS &rBIOS)
++{
++ rtl_copyMemory (&m_pRepresentation->m_pData[0],
++ pName->buffer, pName->length);
++ rtl_zeroMemory (&m_pRepresentation->m_pData[pName->length],
++ STORE_MAXIMUM_NAMESIZE - pName->length);
++ return store_E_None;
++}
++
++storeError
++OStorePageNameBlockV1::Name (rtl_String **pName, OStorePageBIOS &rBIOS)
++{
++ sal_Int32 length = rtl_str_getLength(m_pRepresentation->m_pData);
++ rtl_string_new_WithLength (pName, length + 1);
++ (*pName)->length = length;
++ rtl_copyMemory ((*pName)->buffer,
++ &m_pRepresentation->m_pData[0], length);
++ (*pName)->buffer [length] = 0;
++
++ return store_E_None;
++}
++
++storeError
++OStorePageNameBlockV2::SetName (const rtl_String *pName, OStorePageBIOS &rBIOS)
++{
++ storeError nRet;
++ sal_Char *pDest;
++
++// fprintf (stderr, "setName '%s'\n", pName->buffer);
++
++ if (!m_pRepresentation)
++ return store_E_NotExists;
++
++ m_pRepresentation->m_nNameLength = pName->length;
++
++ if (pName->length >= USE_OTHER_BLOCK)
++ {
++ sal_uInt16 nSize = lcl_getPageSize(rBIOS);
++#ifdef WNT
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) _alloca (nSize);
++#else
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) alloca (nSize);
++#endif
++ OStorePageLongNameData aNameData (nSize, aPageHeadData);
++ OStorePageObject aNamePage(aNameData);
++ if (!m_pRepresentation->m_nNameBlock)
++ {
++ if ((nRet = rBIOS.allocate (aNamePage)) != store_E_None)
++ {
++ fprintf (stderr, "failed to allocate name page %d\n", nRet);
++ return nRet;
++ }
++ m_pRepresentation->m_nNameBlock = aNameData.location();
++ }
++ else
++ {
++ aNameData.location (m_pRepresentation->m_nNameBlock);
++ if ((nRet = rBIOS.load(aNamePage)) != store_E_None)
++ {
++ fprintf (stderr, "failed to load name page %d\n", nRet);
++ return nRet;
++ }
++ }
++ copyAndTerminate (m_pRepresentation->m_pNameData, pName->buffer, USE_OTHER_BLOCK - 1);
++ copyAndTerminate (aNameData.RepresentationData ().m_nData, pName->buffer + USE_OTHER_BLOCK - 1,
++ pName->length - (USE_OTHER_BLOCK - 1));
++
++ if ((nRet = rBIOS.save (aNamePage)) != store_E_None)
++ {
++ fprintf (stderr, "failed to save name page %d\n", nRet);
++ return nRet;
++ }
++ }
++ else
++ copyAndTerminate (m_pRepresentation->m_pNameData, pName->buffer, pName->length);
++
++ return store_E_None;
++}
++
++storeError
++OStorePageNameBlockV2::Name (rtl_String **pName, OStorePageBIOS &rBIOS)
++{
++ storeError nRet;
++
++// fprintf (stderr, "get!Name (%d)...\n", m_nNameLength);
++
++ if (!m_pRepresentation)
++ return store_E_NotExists;
++
++ rtl_string_new_WithLength (pName, m_pRepresentation->m_nNameLength + 1);
++ (*pName)->length = m_pRepresentation->m_nNameLength;
++
++ if (m_pRepresentation->m_nNameLength >= USE_OTHER_BLOCK)
++ {
++ sal_uInt16 nSize = lcl_getPageSize(rBIOS);
++#ifdef WNT
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) _alloca (nSize);
++#else
++ sal_uInt8 *aPageHeadData = (sal_uInt8 *) alloca (nSize);
++#endif
++ OStorePageLongNameData aNameData (nSize, aPageHeadData);
++ OStorePageObject aNamePage(aNameData);
++ aNameData.location (m_pRepresentation->m_nNameBlock);
++
++ if ((nRet = rBIOS.load(aNamePage)) != store_E_None)
++ {
++ fprintf (stderr, "failed to load name page %d\n", nRet);
++ return nRet;
++ }
++
++ copyAndTerminate ((*pName)->buffer, m_pRepresentation->m_pNameData, USE_OTHER_BLOCK - 1);
++ copyAndTerminate ((*pName)->buffer + USE_OTHER_BLOCK - 1,
++ aNameData.RepresentationData ().m_nData, m_pRepresentation->m_nNameLength - (USE_OTHER_BLOCK - 1));
++ }
++ else
++ copyAndTerminate ((*pName)->buffer, m_pRepresentation->m_pNameData, m_pRepresentation->m_nNameLength);
++
++// fprintf (stderr, "... returns '%s'\n", (*pName)->buffer);
++
++ return store_E_None;
++}
+--- ./store/source/storbase.hxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/storbase.hxx 2009-04-06 16:42:11.000000000 +0000
+@@ -28,6 +28,8 @@
+ *
+ ************************************************************************/
+
++#include <stdio.h>
++
+ #ifndef _STORE_STORBASE_HXX_
+ #define _STORE_STORBASE_HXX_ "$Revision: 1.10 $"
+
+@@ -45,12 +47,18 @@
+ #include <cstddef>
+ #define INCLUDED_CSTDDEF
+ #endif
++#ifndef _RTL_MEMORY_H_
++#include <rtl/memory.h>
++#endif
+
+ #ifndef INCLUDED_CSTRING
+ #include <cstring>
+ #define INCLUDED_CSTRING
+ #endif
+
++// #define STORE_INTERNAL_MAX_NAMESIZE 96-4
++#define STORE_INTERNAL_MAX_NAMESIZE 32
++
+ /*========================================================================
+ *
+ * store common internals.
+@@ -350,26 +358,101 @@ struct OStorePageLink
+ }
+ };
+
++
+ /*========================================================================
+ *
+ * OStorePageNameBlock.
+ *
+ *======================================================================*/
+-struct OStorePageNameBlock
++
++class OStorePageBIOS;
++
++struct OStorePageNameBlockA
+ {
+- typedef OStorePageGuard G;
+ typedef OStorePageKey K;
++ typedef OStorePageGuard G;
+
+- /** Representation.
++ /** initialize.
+ */
+- G m_aGuard;
+- K m_aKey;
+- sal_uInt32 m_nAttrib;
+- sal_Char m_pData[STORE_MAXIMUM_NAMESIZE];
++ virtual void initialize (void) = 0;
++
++ /** Comparison.
++ */
++ sal_Bool operator== (const OStorePageNameBlockA& rOther) const
++ {
++ return (Guard () == rOther.Guard ());
++ }
+
+ /** size.
+ */
+- static sal_uInt16 size (void)
++ virtual sal_uInt16 size (void) = 0;
++
++ /** swap (internal and external representation).
++ */
++ virtual void swap (void) = 0;
++
++ /** guard (external representation).
++ */
++ virtual void guard (void) = 0;
++
++ /** verify (external representation).
++ */
++ virtual storeError verify (void) = 0;
++
++ /** namei.
++ */
++ static storeError namei (
++ const rtl_String *pPath, const rtl_String *pName, K &rKey)
++ {
++ // Check parameter.
++ if (!(pPath && pName))
++ return store_E_InvalidParameter;
++
++ // Check name length.
++ if (pName->length >= STORE_MAXIMUM_NAMESIZE)
++ return store_E_NameTooLong;
++
++ // Transform pathname into key.
++ rKey.m_nLow = G::crc32 (0, pName->buffer, pName->length);
++ rKey.m_nHigh = G::crc32 (0, pPath->buffer, pPath->length);
++
++ // Done.
++ return store_E_None;
++ }
++
++ /** Properties.
++ */
++
++ virtual G Guard () const = 0;
++
++ virtual sal_uInt32 Attrib () = 0;
++ virtual void SetAttrib (sal_uInt32 nAttrib) = 0;
++ virtual K Key () = 0;
++ virtual void SetKey (K aKey) = 0;
++
++ virtual storeError SetName (const rtl_String *pName, OStorePageBIOS &rBIOS) = 0;
++ virtual storeError Name (rtl_String **pName, OStorePageBIOS &rBIOS) = 0;
++};
++
++struct OStorePageNameBlockV1 : OStorePageNameBlockA
++{
++ typedef OStorePageGuard G;
++ typedef OStorePageKey K;
++
++ struct Representation {
++ G m_aGuard;
++ K m_aKey;
++ sal_uInt32 m_nAttrib;
++ sal_Char m_pData[STORE_MAXIMUM_NAMESIZE];
++ };
++
++private:
++ Representation* m_pRepresentation;
++
++public:
++ /** size.
++ */
++ sal_uInt16 size (void)
+ {
+ return sal_uInt16(sizeof(G) + sizeof(K) + sizeof(sal_uInt32) +
+ sizeof(sal_Char[STORE_MAXIMUM_NAMESIZE]));
+@@ -379,25 +462,25 @@ struct OStorePageNameBlock
+ */
+ void initialize (void)
+ {
+- m_aGuard = G();
+- m_aKey = K();
+- m_nAttrib = 0;
+- __store_memset (m_pData, 0, sizeof(m_pData));
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard = G();
++ m_pRepresentation->m_aKey = K();
++ m_pRepresentation->m_nAttrib = 0;
++ __store_memset (m_pRepresentation->m_pData, 0, sizeof(m_pRepresentation->m_pData));
++ }
+ }
+
++
+ /** Construction.
+ */
+- OStorePageNameBlock (void)
+- : m_nAttrib (0)
++ OStorePageNameBlockV1 (sal_uInt8 *data)
++ : m_pRepresentation ((Representation *) data)
+ {
+- __store_memset (m_pData, 0, sizeof(m_pData));
+ }
+
+- /** Comparison.
+- */
+- sal_Bool operator== (const OStorePageNameBlock& rOther) const
++ OStorePageNameBlockV1 (void)
++ : m_pRepresentation (NULL)
+ {
+- return (m_aGuard == rOther.m_aGuard);
+ }
+
+ /** swap (internal and external representation).
+@@ -405,9 +488,11 @@ struct OStorePageNameBlock
+ void swap (void)
+ {
+ #ifdef OSL_BIGENDIAN
+- m_aGuard.swap();
+- m_aKey.swap();
+- m_nAttrib = OSL_SWAPDWORD(m_nAttrib);
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard.swap();
++ m_pRepresentation->m_aKey.swap();
++ m_pRepresentation->m_nAttrib = OSL_SWAPDWORD(m_pRepresentation->m_nAttrib);
++ }
+ #endif /* OSL_BIGENDIAN */
+ }
+
+@@ -415,51 +500,215 @@ struct OStorePageNameBlock
+ */
+ void guard (void)
+ {
+- sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, &m_aKey, size() - sizeof(G));
++ if (m_pRepresentation) {
++ sal_uInt32 nCRC32 = 0;
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aKey, size() - sizeof(G));
+ #ifdef OSL_BIGENDIAN
+- nCRC32 = OSL_SWAPDWORD(nCRC32);
++ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- m_aGuard.m_nCRC32 = nCRC32;
++ m_pRepresentation->m_aGuard.m_nCRC32 = nCRC32;
++ }
+ }
+
+ /** verify (external representation).
+ */
+ storeError verify (void)
+ {
++ if (!m_pRepresentation)
++ return store_E_NotExists;
++
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, &m_aKey, size() - sizeof(G));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aKey, size() - sizeof(G));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- if (m_aGuard.m_nCRC32 != nCRC32)
++ if (m_pRepresentation->m_aGuard.m_nCRC32 != nCRC32)
+ return store_E_InvalidChecksum;
+ else
+ return store_E_None;
+ }
+
+- /** namei.
++ /** Properties.
++ */
++
++ G Guard () const
++ {
++ return m_pRepresentation->m_aGuard;
++ }
++
++ sal_uInt32 Attrib ()
++ {
++ if (m_pRepresentation)
++ return m_pRepresentation->m_nAttrib;
++ else
++ return 0;
++ }
++
++ void SetAttrib (sal_uInt32 nAttrib)
++ {
++ if (m_pRepresentation)
++ m_pRepresentation->m_nAttrib = nAttrib;
++ }
++
++ K Key ()
++ {
++ if (m_pRepresentation)
++ return m_pRepresentation->m_aKey;
++ else
++ return K (0, 0);
++ }
++
++ void SetKey (K aKey)
++ {
++ if (m_pRepresentation)
++ m_pRepresentation->m_aKey = aKey;
++ }
++
++ storeError SetName (const rtl_String *pName, OStorePageBIOS &rBIOS);
++ storeError Name (rtl_String **pName, OStorePageBIOS &rBIOS);
++};
++
++struct OStorePageNameBlockV2 : OStorePageNameBlockA
++{
++ typedef OStorePageGuard G;
++ typedef OStorePageKey K;
++
++ struct Representation {
++ G m_aGuard;
++ K m_aKey;
++ sal_uInt32 m_nAttrib;
++ sal_Char m_pNameData[STORE_INTERNAL_MAX_NAMESIZE];
++ sal_uInt32 m_nNameLength;
++ sal_uInt32 m_nNameBlock;
++ };
++
++ Representation* m_pRepresentation;
++
++ /** size.
+ */
+- static storeError namei (
+- const rtl_String *pPath, const rtl_String *pName, K &rKey)
++ sal_uInt16 size (void)
+ {
+- // Check parameter.
+- if (!(pPath && pName))
+- return store_E_InvalidParameter;
++ return sal_uInt16 (sizeof(G) + sizeof(K) + 3*sizeof(sal_uInt32) +
++ sizeof(sal_Char[STORE_INTERNAL_MAX_NAMESIZE]));
++ }
+
+- // Check name length.
+- if (!(pName->length < STORE_MAXIMUM_NAMESIZE))
+- return store_E_NameTooLong;
++ /** initialize.
++ */
++ void initialize (void)
++ {
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard = G();
++ m_pRepresentation->m_aKey = K();
++ m_pRepresentation->m_nAttrib = 0;
++ m_pRepresentation->m_nNameLength = 0;
++ m_pRepresentation->m_nNameBlock = 0;
++ __store_memset (m_pRepresentation->m_pNameData, 0, sizeof(sal_Char[STORE_INTERNAL_MAX_NAMESIZE]));
++ }
++ }
+
+- // Transform pathname into key.
+- rKey.m_nLow = G::crc32 (0, pName->buffer, pName->length);
+- rKey.m_nHigh = G::crc32 (0, pPath->buffer, pPath->length);
++ /** Construction.
++ */
++ OStorePageNameBlockV2 (sal_uInt8 *data)
++ : m_pRepresentation ((Representation *) data)
++ {
++ }
+
+- // Done.
+- return store_E_None;
++ OStorePageNameBlockV2 (void)
++ : m_pRepresentation (NULL)
++ // : m_nAttrib (0), m_nNameBlock (0), m_nNameLength (0)
++ {
++ // __store_memset (m_pNameData, 0, sizeof(m_pNameData));
++ }
++
++ /** swap (internal and external representation).
++ */
++ void swap (void)
++ {
++#ifdef OSL_BIGENDIAN
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard.swap();
++ m_pRepresentation->m_aKey.swap();
++ m_pRepresentation->m_nAttrib = OSL_SWAPDWORD(m_pRepresentation->m_nAttrib);
++ m_pRepresentation->m_nNameLength = OSL_SWAPDWORD(m_pRepresentation->m_nNameLength);
++ m_pRepresentation->m_nNameBlock = OSL_SWAPDWORD(m_pRepresentation->m_nNameBlock);
++ }
++#endif /* OSL_BIGENDIAN */
++ }
++
++ /** guard (external representation).
++ */
++ void guard (void)
++ {
++ if (m_pRepresentation) {
++ sal_uInt32 nCRC32 = 0;
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aKey, size() - sizeof(G));
++#ifdef OSL_BIGENDIAN
++ nCRC32 = OSL_SWAPDWORD(nCRC32);
++#endif /* OSL_BIGENDIAN */
++ m_pRepresentation->m_aGuard.m_nCRC32 = nCRC32;
++ }
++ }
++
++ /** verify (external representation).
++ */
++ storeError verify (void)
++ {
++ if (!m_pRepresentation)
++ return store_E_NotExists;
++
++ sal_uInt32 nCRC32 = 0;
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aKey, size() - sizeof(G));
++#ifdef OSL_BIGENDIAN
++ nCRC32 = OSL_SWAPDWORD(nCRC32);
++#endif /* OSL_BIGENDIAN */
++ if (m_pRepresentation->m_aGuard.m_nCRC32 != nCRC32)
++ return store_E_InvalidChecksum;
++ else
++ return store_E_None;
+ }
++
++ /** Properties.
++ */
++
++ G Guard () const
++ {
++ return m_pRepresentation->m_aGuard;
++ }
++
++ sal_uInt32 Attrib ()
++ {
++ if (m_pRepresentation)
++ return m_pRepresentation->m_nAttrib;
++ else
++ return 0;
++ }
++
++ void SetAttrib (sal_uInt32 nAttrib)
++ {
++ if (m_pRepresentation)
++ m_pRepresentation->m_nAttrib = nAttrib;
++ }
++
++ K Key ()
++ {
++ if (m_pRepresentation)
++ return m_pRepresentation->m_aKey;
++ else
++ return K (0, 0);
++ }
++
++ void SetKey (K aKey)
++ {
++ if (m_pRepresentation)
++ m_pRepresentation->m_aKey = aKey;
++ }
++
++ storeError SetName (const rtl_String *pName, OStorePageBIOS &rBIOS);
++ storeError Name (rtl_String **pName, OStorePageBIOS &rBIOS);
+ };
+
+ /*========================================================================
+@@ -475,10 +724,30 @@ struct OStorePageData
+
+ /** Representation.
+ */
+- G m_aGuard;
+- D m_aDescr;
+- L m_aMarked;
+- L m_aUnused;
++ struct Representation {
++ G m_aGuard;
++ D m_aDescr;
++ L m_aMarked;
++ L m_aUnused;
++ };
++
++private:
++
++ Representation* m_pPageHeader;
++
++public:
++
++ inline Representation& PageHeader () const
++ {
++ return *m_pPageHeader;
++ }
++
++ /** Representation.
++ */
++ inline sal_uInt8* Data () const
++ {
++ return (sal_uInt8*) m_pPageHeader;
++ }
+
+ /** size.
+ */
+@@ -491,24 +760,30 @@ struct OStorePageData
+ */
+ sal_uInt32 location (void) const
+ {
+- return m_aDescr.m_nAddr;
++ return PageHeader ().m_aDescr.m_nAddr;
+ }
+
+ void location (sal_uInt32 nAddr)
+ {
+- m_aDescr.m_nAddr = nAddr;
++ PageHeader ().m_aDescr.m_nAddr = nAddr;
+ }
+
+ /** Allocation.
+ */
+ static void* operator new (size_t n)
+ {
++ fprintf (stderr, "warning: OStorePageData allocated without additional space\n");
++
+ return rtl_allocateMemory (n);
+ }
+
+- static void* operator new (size_t, sal_uInt16 nPageSize)
++ static void* operator new (size_t n, sal_uInt16 nPageSize)
+ {
+- return rtl_allocateMemory (nPageSize);
++ void* mem = rtl_allocateMemory (n + nPageSize);
++
++ rtl_zeroMemory (((sal_uInt8 *)mem) + n, nPageSize);
++
++ return mem;
+ }
+
+ static void operator delete (void *p)
+@@ -523,18 +798,23 @@ struct OStorePageData
+
+ /** Construction.
+ */
+- OStorePageData (sal_uInt16 nPageSize)
++
++ OStorePageData (sal_uInt16 nPageSize, sal_uInt32 nDataOffset, sal_uInt8* pData = NULL)
+ {
+- m_aDescr.m_nSize = nPageSize;
+- m_aDescr.m_nUsed = size();
++ if (pData)
++ m_pPageHeader = (Representation *) pData;
++ else
++ m_pPageHeader = (Representation *) (((sal_uInt8*) this) + nDataOffset);
++ PageHeader ().m_aDescr.m_nSize = nPageSize;
++ PageHeader ().m_aDescr.m_nUsed = size();
+ }
+
+ OStorePageData& operator= (const OStorePageData& rOther)
+ {
+- m_aGuard = rOther.m_aGuard;
+- m_aDescr = rOther.m_aDescr;
+- m_aMarked = rOther.m_aMarked;
+- m_aUnused = rOther.m_aUnused;
++ PageHeader ().m_aGuard = rOther.PageHeader ().m_aGuard;
++ PageHeader ().m_aDescr = rOther.PageHeader ().m_aDescr;
++ PageHeader ().m_aMarked = rOther.PageHeader ().m_aMarked;
++ PageHeader ().m_aUnused = rOther.PageHeader ().m_aUnused;
+ return *this;
+ }
+
+@@ -542,10 +822,10 @@ struct OStorePageData
+ */
+ sal_Bool operator== (const OStorePageData& rOther) const
+ {
+- return ((m_aGuard == rOther.m_aGuard ) &&
+- (m_aDescr == rOther.m_aDescr ) &&
+- (m_aMarked == rOther.m_aMarked) &&
+- (m_aUnused == rOther.m_aUnused) );
++ return ((PageHeader ().m_aGuard == rOther.PageHeader ().m_aGuard ) &&
++ (PageHeader ().m_aDescr == rOther.PageHeader ().m_aDescr ) &&
++ (PageHeader ().m_aMarked == rOther.PageHeader ().m_aMarked) &&
++ (PageHeader ().m_aUnused == rOther.PageHeader ().m_aUnused) );
+ }
+
+ /** swap (internal and external representation).
+@@ -553,10 +833,10 @@ struct OStorePageData
+ void swap ()
+ {
+ #ifdef OSL_BIGENDIAN
+- m_aGuard.swap();
+- m_aDescr.swap();
+- m_aMarked.swap();
+- m_aUnused.swap();
++ PageHeader ().m_aGuard.swap();
++ PageHeader ().m_aDescr.swap();
++ PageHeader ().m_aMarked.swap();
++ PageHeader ().m_aUnused.swap();
+ #endif /* OSL_BIGENDIAN */
+ }
+
+@@ -565,12 +845,12 @@ struct OStorePageData
+ void guard ()
+ {
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, &m_aDescr, size() - sizeof(G));
++ nCRC32 = G::crc32 (nCRC32, &PageHeader ().m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &PageHeader ().m_aDescr, size() - sizeof(G));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- m_aGuard.m_nCRC32 = nCRC32;
++ PageHeader ().m_aGuard.m_nCRC32 = nCRC32;
+ }
+
+ /** verify (external representation).
+@@ -578,12 +858,12 @@ struct OStorePageData
+ storeError verify ()
+ {
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, &m_aDescr, size() - sizeof(G));
++ nCRC32 = G::crc32 (nCRC32, &PageHeader ().m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &PageHeader ().m_aDescr, size() - sizeof(G));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- if (m_aGuard.m_nCRC32 != nCRC32)
++ if (PageHeader ().m_aGuard.m_nCRC32 != nCRC32)
+ return store_E_InvalidChecksum;
+ else
+ return store_E_None;
+@@ -834,6 +1114,10 @@ public:
+ ScanContext &rCtx,
+ OStorePageObject &rPage);
+
++ /** version
++ */
++ sal_uInt32 version ();
++
+ protected:
+ /** Destruction (OReference).
+ */
+@@ -842,7 +1126,8 @@ protected:
+ /** create (SuperBlock).
+ */
+ storeError create (
+- sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE);
++ sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE,
++ sal_uInt16 nFormatVersion = STORE_FORMAT_V1);
+
+ /** Page Maintenance.
+ */
+--- ./store/source/storcach.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/storcach.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -60,7 +60,8 @@ namespace store
+ struct OStorePageCacheEntry
+ {
+ typedef OStorePageCacheEntry self;
+- typedef OStorePageData data;
++ typedef OStorePageData PD;
++ typedef sal_uInt8 data;
+ typedef OStorePageDescriptor D;
+
+ /** Representation.
+@@ -83,34 +84,33 @@ struct OStorePageCacheEntry
+
+ /** Construction.
+ */
+- OStorePageCacheEntry (const D& rDescr, const data& rData)
++ OStorePageCacheEntry (const D& rDescr, const PD& rData)
+ : m_aDescr (rDescr)
+ {
+- sal_uInt16 nSize = m_aDescr.m_nSize;
+- m_pData = new(nSize) data(nSize);
+- __store_memcpy (m_pData, &rData, nSize);
++ m_pData = (data*) rtl_allocateMemory (m_aDescr.m_nSize);
++ __store_memcpy (m_pData, rData.Data (), m_aDescr.m_nSize);
+ m_pNext = m_pPrev = this;
+ }
+
+ /** Data assignment.
+ */
+- void assign (const D& rDescr, const data& rData)
++ void assign (const D& rDescr, const PD& rData)
+ {
+ m_aDescr.m_nAddr = rDescr.m_nAddr;
+ if (!(m_aDescr.m_nSize == rDescr.m_nSize))
+ {
+- delete m_pData;
+- m_pData = new(rDescr.m_nSize) data(rDescr.m_nSize);
++ rtl_freeMemory (m_pData);
++ m_pData = (data*) rtl_allocateMemory (m_aDescr.m_nSize);
+ m_aDescr.m_nSize = rDescr.m_nSize;
+ }
+- __store_memcpy (m_pData, &rData, m_aDescr.m_nSize);
++ __store_memcpy (m_pData, rData.Data (), m_aDescr.m_nSize);
+ }
+
+ /** Destruction.
+ */
+ ~OStorePageCacheEntry (void)
+ {
+- delete m_pData;
++ rtl_freeMemory (m_pData);
+ }
+
+ /** Comparison.
+@@ -506,7 +506,7 @@ storeError OStorePageCache::load (
+ }
+
+ // Load data and Leave.
+- __store_memcpy (&rData, m_pHead->m_pData, rDescr.m_nSize);
++ __store_memcpy (rData.Data (), m_pHead->m_pData, rDescr.m_nSize);
+ STORE_METHOD_LEAVE(pMutex, store_E_None);
+ }
+ }
+@@ -516,7 +516,7 @@ storeError OStorePageCache::load (
+
+ // Load data.
+ storeError eErrCode = rBIOS.read (
+- rDescr.m_nAddr, &rData, rDescr.m_nSize);
++ rDescr.m_nAddr, rData.Data (), rDescr.m_nSize);
+ if (eErrCode != store_E_None)
+ STORE_METHOD_LEAVE(pMutex, eErrCode);
+
+@@ -576,7 +576,7 @@ storeError OStorePageCache::update (
+ m_pHead->dirty();
+
+ // Update data and leave.
+- __store_memcpy (m_pHead->m_pData, &rData, rDescr.m_nSize);
++ __store_memcpy (m_pHead->m_pData, rData.Data (), rDescr.m_nSize);
+ STORE_METHOD_LEAVE(pMutex, store_E_None);
+ }
+ }
+--- ./store/source/stordata.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/stordata.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -51,7 +51,7 @@ using namespace store;
+ * OStoreIndirectionPageData.
+ */
+ OStoreIndirectionPageData::OStoreIndirectionPageData (sal_uInt16 nPageSize)
+- : OStorePageData (nPageSize)
++ : OStorePageData (nPageSize, sizeof (self))
+ {
+ initialize();
+ }
+@@ -61,14 +61,14 @@ OStoreIndirectionPageData::OStoreIndirec
+ */
+ void OStoreIndirectionPageData::initialize (void)
+ {
+- base::m_aGuard.m_nMagic = STORE_MAGIC_INDIRECTPAGE;
+- base::m_aDescr.m_nUsed = sal::static_int_cast< sal_uInt16 >(
+- base::m_aDescr.m_nUsed + self::size());
+- self::m_aGuard.m_nMagic = 0;
++ base::PageHeader ().m_aGuard.m_nMagic = STORE_MAGIC_INDIRECTPAGE;
++ base::PageHeader ().m_aDescr.m_nUsed = sal::static_int_cast< sal_uInt16 >(
++ base::PageHeader ().m_aDescr.m_nUsed + self::size());
++ self::DataRepresentation ().m_aGuard.m_nMagic = 0;
+
+ sal_uInt16 i, n = capacityCount();
+ for (i = 0; i < n; i++)
+- m_pData[i] = STORE_PAGE_NULL;
++ DataRepresentation ().m_pData[i] = STORE_PAGE_NULL;
+ }
+
+ /*
+@@ -82,11 +82,11 @@ void OStoreIndirectionPageData::swap (
+ )
+ {
+ #ifdef OSL_BIGENDIAN
+- m_aGuard.swap();
++ DataRepresentation ().m_aGuard.swap();
+
+ sal_uInt16 i, n = capacityCount (rDescr);
+ for (i = 0; i < n; i++)
+- m_pData[i] = OSL_SWAPDWORD(m_pData[i]);
++ DataRepresentation ().m_pData[i] = OSL_SWAPDWORD(DataRepresentation ().m_pData[i]);
+ #endif /* OSL_BIGENDIAN */
+ }
+
+@@ -149,7 +149,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+
+ // Obtain data page location.
+- sal_uInt32 nAddr = m_rPage.m_pData[nSingle];
++ sal_uInt32 nAddr = m_rPage.DataRepresentation ().m_pData[nSingle];
+ if (nAddr == STORE_PAGE_NULL)
+ STORE_METHOD_LEAVE(pMutex, store_E_NotExists);
+
+@@ -181,19 +181,19 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+
+ // Check single indirect page location.
+- if (m_rPage.m_pData[nDouble] == STORE_PAGE_NULL)
++ if (m_rPage.DataRepresentation ().m_pData[nDouble] == STORE_PAGE_NULL)
+ STORE_METHOD_LEAVE(pMutex, store_E_NotExists);
+
+ // Check single indirect page buffer.
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) page(nPageSize);
+ }
+
+ // Load single indirect page.
+ OStoreIndirectionPageObject aSingle (*rpSingle);
+- aSingle.location (m_rPage.m_pData[nDouble]);
++ aSingle.location (m_rPage.DataRepresentation ().m_pData[nDouble]);
+
+ storeError eErrCode = rBIOS.load (aSingle);
+ if (eErrCode != store_E_None)
+@@ -229,19 +229,19 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+
+ // Check double indirect page location.
+- if (m_rPage.m_pData[nTriple] == STORE_PAGE_NULL)
++ if (m_rPage.DataRepresentation ().m_pData[nTriple] == STORE_PAGE_NULL)
+ STORE_METHOD_LEAVE(pMutex, store_E_NotExists);
+
+ // Check double indirect page buffer.
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) page(nPageSize);
+ }
+
+ // Load double indirect page.
+ OStoreIndirectionPageObject aDouble (*rpDouble);
+- aDouble.location (m_rPage.m_pData[nTriple]);
++ aDouble.location (m_rPage.DataRepresentation ().m_pData[nTriple]);
+
+ storeError eErrCode = rBIOS.load (aDouble);
+ if (eErrCode != store_E_None)
+@@ -272,7 +272,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, eErrCode);
+
+ // Obtain data page location.
+- rData.location (m_rPage.m_pData[nSingle]);
++ rData.location (m_rPage.DataRepresentation ().m_pData[nSingle]);
+ if (rData.location() == STORE_PAGE_NULL)
+ {
+ // Allocate data page.
+@@ -281,7 +281,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, eErrCode);
+
+ // Save data page location.
+- m_rPage.m_pData[nSingle] = rData.location();
++ m_rPage.DataRepresentation ().m_pData[nSingle] = rData.location();
+ touch();
+
+ // Save this page.
+@@ -322,13 +322,13 @@ storeError OStoreIndirectionPageObject::
+ // Check single indirect page buffer.
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) page(nPageSize);
+ }
+
+ // Obtain single indirect page location.
+ OStoreIndirectionPageObject aSingle (*rpSingle);
+- aSingle.location (m_rPage.m_pData[nDouble]);
++ aSingle.location (m_rPage.DataRepresentation ().m_pData[nDouble]);
+ if (aSingle.location() == STORE_PAGE_NULL)
+ {
+ // Initialize single indirect page buffer.
+@@ -340,7 +340,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, eErrCode);
+
+ // Save single indirect page location.
+- m_rPage.m_pData[nDouble] = aSingle.location();
++ m_rPage.DataRepresentation ().m_pData[nDouble] = aSingle.location();
+ touch();
+
+ // Save this page.
+@@ -389,13 +389,13 @@ storeError OStoreIndirectionPageObject::
+ // Check double indirect page buffer.
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) page(nPageSize);
+ }
+
+ // Obtain double indirect page location.
+ OStoreIndirectionPageObject aDouble (*rpDouble);
+- aDouble.location (m_rPage.m_pData[nTriple]);
++ aDouble.location (m_rPage.DataRepresentation ().m_pData[nTriple]);
+ if (aDouble.location() == STORE_PAGE_NULL)
+ {
+ // Initialize double indirect page buffer.
+@@ -407,7 +407,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, eErrCode);
+
+ // Save double indirect page location.
+- m_rPage.m_pData[nTriple] = aDouble.location();
++ m_rPage.DataRepresentation ().m_pData[nTriple] = aDouble.location();
+ touch();
+
+ // Save this page.
+@@ -448,7 +448,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+
+ // Save PageDescriptor.
+- D aDescr (m_rPage.m_aDescr);
++ D aDescr (m_rPage.PageHeader ().m_aDescr);
+
+ // Acquire Lock.
+ storeError eErrCode = rBIOS.acquireLock (aDescr.m_nAddr, aDescr.m_nSize);
+@@ -459,7 +459,7 @@ storeError OStoreIndirectionPageObject::
+ for (i = n; i > nSingle; i--)
+ {
+ // Obtain data page location.
+- sal_uInt32 nAddr = m_rPage.m_pData[i - 1];
++ sal_uInt32 nAddr = m_rPage.DataRepresentation ().m_pData[i - 1];
+ if (nAddr == STORE_PAGE_NULL) continue;
+
+ // Free data page.
+@@ -472,7 +472,7 @@ storeError OStoreIndirectionPageObject::
+ }
+
+ // Clear pointer to data page.
+- m_rPage.m_pData[i - 1] = STORE_PAGE_NULL;
++ m_rPage.DataRepresentation ().m_pData[i - 1] = STORE_PAGE_NULL;
+ touch();
+ }
+
+@@ -517,7 +517,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+
+ // Save PageDescriptor.
+- D aDescr (m_rPage.m_aDescr);
++ D aDescr (m_rPage.PageHeader ().m_aDescr);
+
+ // Acquire Lock.
+ storeError eErrCode = rBIOS.acquireLock (aDescr.m_nAddr, aDescr.m_nSize);
+@@ -529,13 +529,13 @@ storeError OStoreIndirectionPageObject::
+ for (i = n; i > nDouble + 1; i--)
+ {
+ // Obtain single indirect page location.
+- sal_uInt32 nAddr = m_rPage.m_pData[i - 1];
++ sal_uInt32 nAddr = m_rPage.DataRepresentation ().m_pData[i - 1];
+ if (nAddr == STORE_PAGE_NULL) continue;
+
+ // Check single indirect page buffer.
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) page(nPageSize);
+ }
+
+@@ -572,18 +572,18 @@ storeError OStoreIndirectionPageObject::
+ }
+
+ // Clear pointer to single indirect page.
+- m_rPage.m_pData[i - 1] = STORE_PAGE_NULL;
++ m_rPage.DataRepresentation ().m_pData[i - 1] = STORE_PAGE_NULL;
+ touch();
+ }
+
+ // Obtain last single indirect page location.
+- sal_uInt32 nAddr = m_rPage.m_pData[nDouble];
++ sal_uInt32 nAddr = m_rPage.DataRepresentation ().m_pData[nDouble];
+ if (nAddr != STORE_PAGE_NULL)
+ {
+ // Check single indirect page buffer.
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) page(nPageSize);
+ }
+
+@@ -623,7 +623,7 @@ storeError OStoreIndirectionPageObject::
+ }
+
+ // Clear pointer to last single indirect page.
+- m_rPage.m_pData[nDouble] = STORE_PAGE_NULL;
++ m_rPage.DataRepresentation ().m_pData[nDouble] = STORE_PAGE_NULL;
+ touch();
+ }
+ }
+@@ -672,7 +672,7 @@ storeError OStoreIndirectionPageObject::
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+
+ // Save PageDescriptor.
+- D aDescr (m_rPage.m_aDescr);
++ D aDescr (m_rPage.PageHeader ().m_aDescr);
+
+ // Acquire Lock.
+ storeError eErrCode = rBIOS.acquireLock (aDescr.m_nAddr, aDescr.m_nSize);
+@@ -684,13 +684,13 @@ storeError OStoreIndirectionPageObject::
+ for (i = n; i > nTriple + 1; i--)
+ {
+ // Obtain double indirect page location.
+- sal_uInt32 nAddr = m_rPage.m_pData[i - 1];
++ sal_uInt32 nAddr = m_rPage.DataRepresentation ().m_pData[i - 1];
+ if (nAddr == STORE_PAGE_NULL) continue;
+
+ // Check double indirect page buffer.
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) page(nPageSize);
+ }
+
+@@ -728,18 +728,18 @@ storeError OStoreIndirectionPageObject::
+ }
+
+ // Clear pointer to double indirect page.
+- m_rPage.m_pData[i - 1] = STORE_PAGE_NULL;
++ m_rPage.DataRepresentation ().m_pData[i - 1] = STORE_PAGE_NULL;
+ touch();
+ }
+
+ // Obtain last double indirect page location.
+- sal_uInt32 nAddr = m_rPage.m_pData[nTriple];
++ sal_uInt32 nAddr = m_rPage.DataRepresentation ().m_pData[nTriple];
+ if (nAddr != STORE_PAGE_NULL)
+ {
+ // Check double indirect page buffer.
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) page(nPageSize);
+ }
+
+@@ -780,7 +780,7 @@ storeError OStoreIndirectionPageObject::
+ }
+
+ // Clear pointer to last double indirect page.
+- m_rPage.m_pData[nTriple] = STORE_PAGE_NULL;
++ m_rPage.DataRepresentation ().m_pData[nTriple] = STORE_PAGE_NULL;
+ touch();
+ }
+ }
+@@ -808,13 +808,13 @@ storeError OStoreIndirectionPageObject::
+
+ /*========================================================================
+ *
+- * OStoreDirectoryDataBlock::LinkTable implementation.
++ * OStoreDirectoryDataBlockV1::LinkTable implementation.
+ *
+ *======================================================================*/
+ /*
+ * LinkTable::LinkTable.
+ */
+-OStoreDirectoryDataBlock::LinkTable::LinkTable (void)
++OStoreDirectoryDataBlockV1::LinkTable::LinkTable (void)
+ {
+ initialize();
+ }
+@@ -822,39 +822,87 @@ OStoreDirectoryDataBlock::LinkTable::Lin
+ /*
+ * LinkTable::initialize.
+ */
+-void OStoreDirectoryDataBlock::LinkTable::initialize (void)
++void OStoreDirectoryDataBlockV1::LinkTable::initialize (void)
+ {
+ sal_Int32 i;
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_DIRECT; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DIRECT_V1; i++)
+ m_pDirect[i] = STORE_PAGE_NULL;
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_SINGLE; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_SINGLE_V1; i++)
+ m_pSingle[i] = STORE_PAGE_NULL;
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_DOUBLE; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DOUBLE_V1; i++)
+ m_pDouble[i] = STORE_PAGE_NULL;
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_TRIPLE; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_TRIPLE_V1; i++)
+ m_pTriple[i] = STORE_PAGE_NULL;
+ }
+
+ /*
+ * LinkTable::swap.
+ */
+-void OStoreDirectoryDataBlock::LinkTable::swap (void)
++void OStoreDirectoryDataBlockV1::LinkTable::swap (void)
+ {
+ #ifdef OSL_BIGENDIAN
+ sal_Int32 i;
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_DIRECT; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DIRECT_V1; i++)
+ m_pDirect[i] = OSL_SWAPDWORD(m_pDirect[i]);
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_SINGLE; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_SINGLE_V1; i++)
+ m_pSingle[i] = OSL_SWAPDWORD(m_pSingle[i]);
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_DOUBLE; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DOUBLE_V1; i++)
+ m_pDouble[i] = OSL_SWAPDWORD(m_pDouble[i]);
+- for (i = 0; i < STORE_LIMIT_DATAPAGE_TRIPLE; i++)
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_TRIPLE_V1; i++)
+ m_pTriple[i] = OSL_SWAPDWORD(m_pTriple[i]);
+ #endif /* OSL_BIGENDIAN */
+ }
+
+ /*========================================================================
+ *
++ * OStoreDirectoryDataBlockV2::LinkTable implementation.
++ *
++ *======================================================================*/
++/*
++ * LinkTable::LinkTable.
++ */
++OStoreDirectoryDataBlockV2::LinkTable::LinkTable (void)
++{
++ initialize();
++}
++
++/*
++ * LinkTable::initialize.
++ */
++void OStoreDirectoryDataBlockV2::LinkTable::initialize (void)
++{
++ sal_Int32 i;
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DIRECT_V2; i++)
++ m_pDirect[i] = STORE_PAGE_NULL;
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_SINGLE_V2; i++)
++ m_pSingle[i] = STORE_PAGE_NULL;
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DOUBLE_V2; i++)
++ m_pDouble[i] = STORE_PAGE_NULL;
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_TRIPLE_V2; i++)
++ m_pTriple[i] = STORE_PAGE_NULL;
++}
++
++/*
++ * LinkTable::swap.
++ */
++void OStoreDirectoryDataBlockV2::LinkTable::swap (void)
++{
++#ifdef OSL_BIGENDIAN
++ sal_Int32 i;
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DIRECT_V2; i++)
++ m_pDirect[i] = OSL_SWAPDWORD(m_pDirect[i]);
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_SINGLE_V2; i++)
++ m_pSingle[i] = OSL_SWAPDWORD(m_pSingle[i]);
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_DOUBLE_V2; i++)
++ m_pDouble[i] = OSL_SWAPDWORD(m_pDouble[i]);
++ for (i = 0; i < STORE_LIMIT_DATAPAGE_TRIPLE_V2; i++)
++ m_pTriple[i] = OSL_SWAPDWORD(m_pTriple[i]);
++#endif /* OSL_BIGENDIAN */
++}
++
++
++/*========================================================================
++ *
+ * OStoreDirectoryPageObject implementation.
+ *
+ *======================================================================*/
+@@ -901,13 +949,13 @@ storeError OStoreDirectoryPageObject::ve
+ OStoreDirectoryPageData::ChunkScope
+ OStoreDirectoryPageObject::scope (
+ sal_uInt32 nPage,
+- page::DataBlock::LinkDescriptor &rDescr) const
++ page::DataBlockT::LinkDescriptor &rDescr) const
+ {
+ typedef OStoreIndirectionPageData indrct;
+ sal_uInt32 index0, index1, index2, index3;
+
+ // direct.
+- sal_uInt32 nCount = m_rPage.m_aDataBlock.directCount();
++ sal_uInt32 nCount = m_rPage.DataBlock ().directCount();
+ sal_uInt32 nLimit = nCount;
+ if (nPage < nLimit)
+ {
+@@ -923,8 +971,8 @@ OStoreDirectoryPageObject::scope (
+ nPage -= nLimit;
+
+ // single indirect.
+- sal_uInt32 nCapacity = indrct::capacityCount(m_rPage.m_aDescr);
+- nCount = m_rPage.m_aDataBlock.singleCount();
++ sal_uInt32 nCapacity = indrct::capacityCount(m_rPage.PageHeader ().m_aDescr);
++ nCount = m_rPage.DataBlock ().singleCount();
+ nLimit = nCount * nCapacity;
+ if (nPage < nLimit)
+ {
+@@ -951,7 +999,7 @@ OStoreDirectoryPageObject::scope (
+ nPage -= nLimit;
+
+ // double indirect.
+- nCount = m_rPage.m_aDataBlock.doubleCount();
++ nCount = m_rPage.DataBlock ().doubleCount();
+ nLimit = nCount * nCapacity * nCapacity;
+ if (nPage < nLimit)
+ {
+@@ -984,7 +1032,7 @@ OStoreDirectoryPageObject::scope (
+ nPage -= nLimit;
+
+ // triple indirect.
+- nCount = m_rPage.m_aDataBlock.tripleCount();
++ nCount = m_rPage.DataBlock ().tripleCount();
+ nLimit = nCount * nCapacity * nCapacity * nCapacity;
+ if (nPage < nLimit)
+ {
+@@ -1041,7 +1089,7 @@ storeError OStoreDirectoryPageObject::ge
+ STORE_METHOD_ENTER(pMutex);
+
+ // Determine scope and link indices.
+- page::DataBlock::LinkDescriptor aLink;
++ page::DataBlockT::LinkDescriptor aLink;
+ page::ChunkScope eScope = scope (nPage, aLink);
+
+ storeError eErrCode = store_E_None;
+@@ -1062,7 +1110,7 @@ storeError OStoreDirectoryPageObject::ge
+
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1085,7 +1133,7 @@ storeError OStoreDirectoryPageObject::ge
+
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1110,7 +1158,7 @@ storeError OStoreDirectoryPageObject::ge
+
+ if (rpTriple == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpTriple = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1161,7 +1209,7 @@ storeError OStoreDirectoryPageObject::pu
+ STORE_METHOD_ENTER(pMutex);
+
+ // Determine scope and link indices.
+- page::DataBlock::LinkDescriptor aLink;
++ page::DataBlockT::LinkDescriptor aLink;
+ page::ChunkScope eScope = scope (nPage, aLink);
+
+ storeError eErrCode = store_E_None;
+@@ -1185,7 +1233,7 @@ storeError OStoreDirectoryPageObject::pu
+ {
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1216,7 +1264,7 @@ storeError OStoreDirectoryPageObject::pu
+ {
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1249,7 +1297,7 @@ storeError OStoreDirectoryPageObject::pu
+ {
+ if (rpTriple == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpTriple = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1312,7 +1360,7 @@ storeError OStoreDirectoryPageObject::tr
+ STORE_METHOD_ENTER(pMutex);
+
+ // Determine scope and link indices.
+- page::DataBlock::LinkDescriptor aLink;
++ page::DataBlockT::LinkDescriptor aLink;
+ page::ChunkScope eScope = scope (nPage, aLink);
+
+ storeError eErrCode = store_E_None;
+@@ -1381,7 +1429,7 @@ storeError OStoreDirectoryPageObject::tr
+ // Check single indirect page buffer.
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1438,7 +1486,7 @@ storeError OStoreDirectoryPageObject::tr
+ // Check double indirect page buffer.
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1489,7 +1537,7 @@ storeError OStoreDirectoryPageObject::tr
+ // Check triple indirect page buffer.
+ if (rpTriple == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpTriple = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1560,7 +1608,7 @@ storeError OStoreDirectoryPageObject::tr
+ if (eScope == page::SCOPE_DIRECT)
+ {
+ // Truncate direct data pages.
+- sal_uInt16 i, n = m_rPage.m_aDataBlock.directCount();
++ sal_uInt16 i, n = m_rPage.DataBlock ().directCount();
+ for (i = n; i > nRemain; i--)
+ {
+ // Obtain data page location.
+@@ -1584,7 +1632,7 @@ storeError OStoreDirectoryPageObject::tr
+ if (eScope == page::SCOPE_SINGLE)
+ {
+ // Truncate single indirect pages.
+- sal_uInt16 i, n = m_rPage.m_aDataBlock.singleCount();
++ sal_uInt16 i, n = m_rPage.DataBlock ().singleCount();
+ for (i = n; i > nRemain; i--)
+ {
+ // Obtain single indirect page location.
+@@ -1594,7 +1642,7 @@ storeError OStoreDirectoryPageObject::tr
+ // Check single indirect page buffer.
+ if (rpSingle == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpSingle = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1628,7 +1676,7 @@ storeError OStoreDirectoryPageObject::tr
+ if (eScope == page::SCOPE_DOUBLE)
+ {
+ // Truncate double indirect pages.
+- sal_uInt16 i, n = m_rPage.m_aDataBlock.doubleCount();
++ sal_uInt16 i, n = m_rPage.DataBlock ().doubleCount();
+ for (i = n; i > nRemain; i--)
+ {
+ // Obtain double indirect page location.
+@@ -1638,7 +1686,7 @@ storeError OStoreDirectoryPageObject::tr
+ // Check double indirect page buffer.
+ if (rpDouble == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpDouble = new(nPageSize) indirect(nPageSize);
+ }
+
+@@ -1672,7 +1720,7 @@ storeError OStoreDirectoryPageObject::tr
+ if (eScope == page::SCOPE_TRIPLE)
+ {
+ // Truncate triple indirect pages.
+- sal_uInt16 i, n = m_rPage.m_aDataBlock.tripleCount();
++ sal_uInt16 i, n = m_rPage.DataBlock ().tripleCount();
+ for (i = n; i > nRemain; i--)
+ {
+ // Obtain triple indirect page location.
+@@ -1682,7 +1730,7 @@ storeError OStoreDirectoryPageObject::tr
+ // Check triple indirect page buffer.
+ if (rpTriple == NULL)
+ {
+- sal_uInt16 nPageSize = m_rPage.m_aDescr.m_nSize;
++ sal_uInt16 nPageSize = m_rPage.PageHeader ().m_aDescr.m_nSize;
+ rpTriple = new(nPageSize) indirect(nPageSize);
+ }
+
+--- ./store/source/stordata.hxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/stordata.hxx 2009-04-06 16:42:11.000000000 +0000
+@@ -55,10 +55,6 @@ struct OStoreDataPageData : public store
+
+ typedef OStorePageDescriptor D;
+
+- /** Representation.
+- */
+- sal_uInt8 m_pData[1];
+-
+ /** size.
+ */
+ static sal_uInt16 size (void)
+@@ -66,6 +62,11 @@ struct OStoreDataPageData : public store
+ return sal_uInt16(0);
+ }
+
++ sal_uInt8* RepresentationData ()
++ {
++ return base::Data () + base::size ();
++ }
++
+ /** capacity.
+ */
+ static sal_uInt16 capacity (const D& rDescr)
+@@ -75,7 +76,7 @@ struct OStoreDataPageData : public store
+
+ sal_uInt16 capacity (void) const
+ {
+- return self::capacity (base::m_aDescr);
++ return self::capacity (base::PageHeader ().m_aDescr);
+ }
+
+ /** usage.
+@@ -87,23 +88,23 @@ struct OStoreDataPageData : public store
+
+ sal_uInt16 usage (void) const
+ {
+- return self::usage (base::m_aDescr);
++ return self::usage (base::PageHeader ().m_aDescr);
+ }
+
+ /** initialize.
+ */
+ void initialize (void)
+ {
+- base::m_aGuard.m_nMagic = STORE_MAGIC_DATAPAGE;
+- base::m_aDescr.m_nUsed = sal::static_int_cast< sal_uInt16 >(
+- base::m_aDescr.m_nUsed + self::size());
+- rtl_zeroMemory (m_pData, capacity());
++ base::PageHeader ().m_aGuard.m_nMagic = STORE_MAGIC_DATAPAGE;
++ base::PageHeader ().m_aDescr.m_nUsed = sal::static_int_cast< sal_uInt16 >(
++ base::PageHeader ().m_aDescr.m_nUsed + self::size());
++ rtl_zeroMemory (RepresentationData (), capacity());
+ }
+
+ /** Construction.
+ */
+ OStoreDataPageData (sal_uInt16 nPageSize)
+- : base (nPageSize)
++ : base (nPageSize, sizeof (self))
+ {
+ initialize();
+ }
+@@ -152,8 +153,15 @@ struct OStoreIndirectionPageData : publi
+
+ /** Representation.
+ */
+- G m_aGuard;
+- sal_uInt32 m_pData[1];
++ struct Representation {
++ G m_aGuard;
++ sal_uInt32 m_pData[1];
++ };
++
++ inline Representation& DataRepresentation () const
++ {
++ return *(Representation *) (Data () + base::size ());
++ }
+
+ /** size.
+ */
+@@ -170,7 +178,7 @@ struct OStoreIndirectionPageData : publi
+ }
+ sal_uInt16 capacity (void) const
+ {
+- return self::capacity (base::m_aDescr);
++ return self::capacity (base::PageHeader ().m_aDescr);
+ }
+
+ /** capacityCount.
+@@ -193,7 +201,7 @@ struct OStoreIndirectionPageData : publi
+ */
+ sal_Bool operator== (const OStoreIndirectionPageData& rOther) const
+ {
+- return (base::operator==(rOther) && (m_aGuard == rOther.m_aGuard));
++ return (base::operator==(rOther) && (DataRepresentation ().m_aGuard == rOther.DataRepresentation ().m_aGuard));
+ }
+
+ /** swap (internal and external representation).
+@@ -205,12 +213,12 @@ struct OStoreIndirectionPageData : publi
+ void guard (const D& rDescr)
+ {
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, m_pData, capacity(rDescr));
++ nCRC32 = G::crc32 (nCRC32, &DataRepresentation ().m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, DataRepresentation ().m_pData, capacity(rDescr));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- m_aGuard.m_nCRC32 = nCRC32;
++ DataRepresentation ().m_aGuard.m_nCRC32 = nCRC32;
+ }
+
+ /** verify (external representation).
+@@ -218,12 +226,12 @@ struct OStoreIndirectionPageData : publi
+ storeError verify (const D& rDescr)
+ {
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, m_pData, capacity(rDescr));
++ nCRC32 = G::crc32 (nCRC32, &DataRepresentation ().m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, DataRepresentation ().m_pData, capacity(rDescr));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- if (m_aGuard.m_nCRC32 != nCRC32)
++ if (DataRepresentation ().m_aGuard.m_nCRC32 != nCRC32)
+ return store_E_InvalidChecksum;
+ else
+ return store_E_None;
+@@ -347,12 +355,17 @@ inline OStoreIndirectionPageObject::OSto
+ * OStoreDirectoryDataBlock.
+ *
+ *======================================================================*/
+-#define STORE_LIMIT_DATAPAGE_DIRECT 16
+-#define STORE_LIMIT_DATAPAGE_SINGLE 8
+-#define STORE_LIMIT_DATAPAGE_DOUBLE 1
+-#define STORE_LIMIT_DATAPAGE_TRIPLE 1
++#define STORE_LIMIT_DATAPAGE_DIRECT_V1 16
++#define STORE_LIMIT_DATAPAGE_SINGLE_V1 8
++#define STORE_LIMIT_DATAPAGE_DOUBLE_V1 1
++#define STORE_LIMIT_DATAPAGE_TRIPLE_V1 1
++
++#define STORE_LIMIT_DATAPAGE_DIRECT_V2 4
++#define STORE_LIMIT_DATAPAGE_SINGLE_V2 2
++#define STORE_LIMIT_DATAPAGE_DOUBLE_V2 1
++#define STORE_LIMIT_DATAPAGE_TRIPLE_V2 1
+
+-struct OStoreDirectoryDataBlock
++struct OStoreDirectoryDataBlockA
+ {
+ typedef OStorePageGuard G;
+
+@@ -377,16 +390,83 @@ struct OStoreDirectoryDataBlock
+ {}
+ };
+
++ /** initialize.
++ */
++ virtual void initialize (void) = 0;
++
++ /** Comparison.
++ */
++ sal_Bool operator== (const OStoreDirectoryDataBlockA& rOther) const
++ {
++ return (Guard () == rOther.Guard ());
++ }
++
++ /** size.
++ */
++ virtual sal_uInt16 size (void) = 0;
++
++ /** Properties.
++ */
++ virtual G Guard () const = 0;
++
++ virtual sal_uInt32 DataLen () = 0;
++ virtual void SetDataLen (sal_uInt32 len) = 0;
++
++// /** Comparison.
++// */
++// virtual sal_Bool operator== (const OStoreDirectoryDataBlockV2& rOther) const = 0;
++
++ /** swap (internal and external representation).
++ */
++ virtual void swap (void) = 0;
++
++ /** guard (external representation).
++ */
++ virtual void guard (void) = 0;
++
++ /** verify (external representation).
++ */
++ virtual storeError verify (void) = 0;
++
++ /** direct.
++ */
++ virtual sal_uInt16 directCount (void) const = 0;
++ virtual sal_uInt32 directLink (sal_uInt16 nIndex) const = 0;
++ virtual void directLink (sal_uInt16 nIndex, sal_uInt32 nAddr) = 0;
++
++ /** single.
++ */
++ virtual sal_uInt16 singleCount (void) const = 0;
++ virtual sal_uInt32 singleLink (sal_uInt16 nIndex) const = 0;
++ virtual void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr) = 0;
++
++ /** double.
++ */
++ virtual sal_uInt16 doubleCount (void) const = 0;
++ virtual sal_uInt32 doubleLink (sal_uInt16 nIndex) const = 0;
++ virtual void doubleLink (sal_uInt16 nIndex, sal_uInt32 nAddr) = 0;
++
++ /** triple.
++ */
++ virtual sal_uInt16 tripleCount (void) const = 0;
++ virtual sal_uInt32 tripleLink (sal_uInt16 nIndex) const = 0;
++ virtual void tripleLink (sal_uInt16 nIndex, sal_uInt32 nAddr) = 0;
++};
++
++struct OStoreDirectoryDataBlockV1 : OStoreDirectoryDataBlockA
++{
++ typedef OStorePageGuard G;
++
+ /** LinkTable.
+ */
+ struct LinkTable
+ {
+ /** Representation.
+ */
+- sal_uInt32 m_pDirect[STORE_LIMIT_DATAPAGE_DIRECT];
+- sal_uInt32 m_pSingle[STORE_LIMIT_DATAPAGE_SINGLE];
+- sal_uInt32 m_pDouble[STORE_LIMIT_DATAPAGE_DOUBLE];
+- sal_uInt32 m_pTriple[STORE_LIMIT_DATAPAGE_TRIPLE];
++ sal_uInt32 m_pDirect[STORE_LIMIT_DATAPAGE_DIRECT_V1];
++ sal_uInt32 m_pSingle[STORE_LIMIT_DATAPAGE_SINGLE_V1];
++ sal_uInt32 m_pDouble[STORE_LIMIT_DATAPAGE_DOUBLE_V1];
++ sal_uInt32 m_pTriple[STORE_LIMIT_DATAPAGE_TRIPLE_V1];
+
+ /** Construction.
+ */
+@@ -398,15 +478,235 @@ struct OStoreDirectoryDataBlock
+ void swap (void);
+ };
+
+- /** Representation.
++ struct Representation {
++ G m_aGuard;
++ LinkTable m_aTable;
++ sal_uInt32 m_nDataLen;
++ };
++
++ Representation* m_pRepresentation;
++
++ /** size.
+ */
+- G m_aGuard;
+- LinkTable m_aTable;
+- sal_uInt32 m_nDataLen;
++ sal_uInt16 size (void)
++ {
++ return sal_uInt16(sizeof(G) + sizeof(LinkTable) + sizeof(sal_uInt32));
++ }
++
++ /** initialize.
++ */
++ void initialize (void)
++ {
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard = G();
++ m_pRepresentation->m_aTable.initialize();
++ m_pRepresentation->m_nDataLen = 0;
++ }
++ }
++
++ /** Construction.
++ */
++ OStoreDirectoryDataBlockV1 (sal_uInt8 *data)
++ : m_pRepresentation ((Representation *) data)
++ {
++ initialize ();
++ }
++
++ /** Properties.
++ */
++ G Guard () const
++ {
++ return m_pRepresentation->m_aGuard;
++ }
++
++ sal_uInt32 DataLen ()
++ {
++ if (m_pRepresentation)
++ return m_pRepresentation->m_nDataLen;
++ else
++ return 0;
++ }
++
++ void SetDataLen (sal_uInt32 len)
++ {
++ if (m_pRepresentation)
++ m_pRepresentation->m_nDataLen = len;
++ }
++
++ /** Comparison.
++ */
++ sal_Bool operator== (const OStoreDirectoryDataBlockV1& rOther) const
++ {
++ if (m_pRepresentation == NULL && rOther.m_pRepresentation == NULL)
++ return sal_True;
++
++ if (m_pRepresentation == NULL || rOther.m_pRepresentation == NULL)
++ return sal_False;
++
++ return (m_pRepresentation->m_aGuard == rOther.m_pRepresentation->m_aGuard);
++ }
++
++ /** swap (internal and external representation).
++ */
++ void swap (void)
++ {
++#ifdef OSL_BIGENDIAN
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard.swap();
++ m_pRepresentation->m_aTable.swap();
++ m_pRepresentation->m_nDataLen = OSL_SWAPDWORD(m_pRepresentation->m_nDataLen);
++ }
++#endif /* OSL_BIGENDIAN */
++ }
++
++ /** guard (external representation).
++ */
++ void guard (void)
++ {
++ if (!m_pRepresentation)
++ return;
++
++ sal_uInt32 nCRC32 = 0;
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aTable, size() - sizeof(G));
++#ifdef OSL_BIGENDIAN
++ nCRC32 = OSL_SWAPDWORD(nCRC32);
++#endif /* OSL_BIGENDIAN */
++ m_pRepresentation->m_aGuard.m_nCRC32 = nCRC32;
++ }
++
++ /** verify (external representation).
++ */
++ storeError verify (void)
++ {
++ if (!m_pRepresentation)
++ return store_E_NotExists;
++
++ sal_uInt32 nCRC32 = 0;
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aTable, size() - sizeof(G));
++#ifdef OSL_BIGENDIAN
++ nCRC32 = OSL_SWAPDWORD(nCRC32);
++#endif /* OSL_BIGENDIAN */
++ if (m_pRepresentation->m_aGuard.m_nCRC32 != nCRC32)
++ return store_E_InvalidChecksum;
++ else
++ return store_E_None;
++ }
++
++ /** direct.
++ */
++ virtual sal_uInt16 directCount (void) const
++ {
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_DIRECT_V1));
++ }
++ virtual sal_uInt32 directLink (sal_uInt16 nIndex) const
++ {
++ if (m_pRepresentation && nIndex < directCount())
++ return m_pRepresentation->m_aTable.m_pDirect[nIndex];
++ else
++ return STORE_PAGE_NULL;
++ }
++ virtual void directLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ {
++ if (m_pRepresentation && nIndex < directCount())
++ m_pRepresentation->m_aTable.m_pDirect[nIndex] = nAddr;
++ }
++
++ /** single.
++ */
++ virtual sal_uInt16 singleCount (void) const
++ {
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_SINGLE_V1));
++ }
++ virtual sal_uInt32 singleLink (sal_uInt16 nIndex) const
++ {
++ if (m_pRepresentation && nIndex < singleCount())
++ return m_pRepresentation->m_aTable.m_pSingle[nIndex];
++ else
++ return STORE_PAGE_NULL;
++ }
++ virtual void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ {
++ if (m_pRepresentation && nIndex < singleCount())
++ m_pRepresentation->m_aTable.m_pSingle[nIndex] = nAddr;
++ }
++
++ /** double.
++ */
++ virtual sal_uInt16 doubleCount (void) const
++ {
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_DOUBLE_V1));
++ }
++ virtual sal_uInt32 doubleLink (sal_uInt16 nIndex) const
++ {
++ if (m_pRepresentation && nIndex < doubleCount())
++ return m_pRepresentation->m_aTable.m_pDouble[nIndex];
++ else
++ return STORE_PAGE_NULL;
++ }
++ virtual void doubleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ {
++ if (m_pRepresentation && nIndex < doubleCount())
++ m_pRepresentation->m_aTable.m_pDouble[nIndex] = nAddr;
++ }
++
++ /** triple.
++ */
++ virtual sal_uInt16 tripleCount (void) const
++ {
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_TRIPLE_V1));
++ }
++ virtual sal_uInt32 tripleLink (sal_uInt16 nIndex) const
++ {
++ if (m_pRepresentation && nIndex < tripleCount())
++ return m_pRepresentation->m_aTable.m_pTriple[nIndex];
++ else
++ return STORE_PAGE_NULL;
++ }
++ virtual void tripleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ {
++ if (m_pRepresentation && nIndex < tripleCount())
++ m_pRepresentation->m_aTable.m_pTriple[nIndex] = nAddr;
++ }
++};
++
++struct OStoreDirectoryDataBlockV2 : OStoreDirectoryDataBlockA
++{
++ typedef OStorePageGuard G;
++
++ /** LinkTable.
++ */
++ struct LinkTable
++ {
++ /** Representation.
++ */
++ sal_uInt32 m_pDirect[STORE_LIMIT_DATAPAGE_DIRECT_V2];
++ sal_uInt32 m_pSingle[STORE_LIMIT_DATAPAGE_SINGLE_V2];
++ sal_uInt32 m_pDouble[STORE_LIMIT_DATAPAGE_DOUBLE_V2];
++ sal_uInt32 m_pTriple[STORE_LIMIT_DATAPAGE_TRIPLE_V2];
++
++ /** Construction.
++ */
++ LinkTable (void);
++ void initialize (void);
++
++ /** swap (internal and external representation).
++ */
++ void swap (void);
++ };
++
++ struct Representation {
++ G m_aGuard;
++ LinkTable m_aTable;
++ sal_uInt32 m_nDataLen;
++ };
++
++ Representation* m_pRepresentation;
+
+ /** size.
+ */
+- static sal_uInt16 size (void)
++ sal_uInt16 size (void)
+ {
+ return sal_uInt16(sizeof(G) + sizeof(LinkTable) + sizeof(sal_uInt32));
+ }
+@@ -415,22 +715,53 @@ struct OStoreDirectoryDataBlock
+ */
+ void initialize (void)
+ {
+- m_aGuard = G();
+- m_aTable.initialize();
+- m_nDataLen = 0;
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard = G();
++ m_pRepresentation->m_aTable.initialize();
++ m_pRepresentation->m_nDataLen = 0;
++ }
+ }
+
+ /** Construction.
+ */
+- OStoreDirectoryDataBlock (void)
+- : m_nDataLen (0)
+- {}
++ OStoreDirectoryDataBlockV2 (sal_uInt8 *data)
++ : m_pRepresentation ((Representation *) data)
++ {
++ initialize ();
++ }
++
++ /** Properties.
++ */
++ G Guard () const
++ {
++ return m_pRepresentation->m_aGuard;
++ }
++
++ sal_uInt32 DataLen ()
++ {
++ if (m_pRepresentation)
++ return m_pRepresentation->m_nDataLen;
++ else
++ return 0;
++ }
++
++ void SetDataLen (sal_uInt32 len)
++ {
++ if (m_pRepresentation)
++ m_pRepresentation->m_nDataLen = len;
++ }
+
+ /** Comparison.
+ */
+- sal_Bool operator== (const OStoreDirectoryDataBlock& rOther) const
++ sal_Bool operator== (const OStoreDirectoryDataBlockV2& rOther) const
+ {
+- return (m_aGuard == rOther.m_aGuard);
++ if (m_pRepresentation == NULL && rOther.m_pRepresentation == NULL)
++ return sal_True;
++
++ if (m_pRepresentation == NULL || rOther.m_pRepresentation == NULL)
++ return sal_False;
++
++ return (m_pRepresentation->m_aGuard == rOther.m_pRepresentation->m_aGuard);
+ }
+
+ /** swap (internal and external representation).
+@@ -438,9 +769,11 @@ struct OStoreDirectoryDataBlock
+ void swap (void)
+ {
+ #ifdef OSL_BIGENDIAN
+- m_aGuard.swap();
+- m_aTable.swap();
+- m_nDataLen = OSL_SWAPDWORD(m_nDataLen);
++ if (m_pRepresentation) {
++ m_pRepresentation->m_aGuard.swap();
++ m_pRepresentation->m_aTable.swap();
++ m_pRepresentation->m_nDataLen = OSL_SWAPDWORD(m_pRepresentation->m_nDataLen);
++ }
+ #endif /* OSL_BIGENDIAN */
+ }
+
+@@ -448,26 +781,32 @@ struct OStoreDirectoryDataBlock
+ */
+ void guard (void)
+ {
++ if (!m_pRepresentation)
++ return;
++
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, &m_aTable, size() - sizeof(G));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aTable, size() - sizeof(G));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- m_aGuard.m_nCRC32 = nCRC32;
++ m_pRepresentation->m_aGuard.m_nCRC32 = nCRC32;
+ }
+
+ /** verify (external representation).
+ */
+ storeError verify (void)
+ {
++ if (!m_pRepresentation)
++ return store_E_NotExists;
++
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, &m_aTable, size() - sizeof(G));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, &m_pRepresentation->m_aTable, size() - sizeof(G));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- if (m_aGuard.m_nCRC32 != nCRC32)
++ if (m_pRepresentation->m_aGuard.m_nCRC32 != nCRC32)
+ return store_E_InvalidChecksum;
+ else
+ return store_E_None;
+@@ -475,78 +814,78 @@ struct OStoreDirectoryDataBlock
+
+ /** direct.
+ */
+- static sal_uInt16 directCount (void)
++ virtual sal_uInt16 directCount (void) const
+ {
+- return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_DIRECT));
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_DIRECT_V2));
+ }
+- sal_uInt32 directLink (sal_uInt16 nIndex) const
++ virtual sal_uInt32 directLink (sal_uInt16 nIndex) const
+ {
+- if (nIndex < directCount())
+- return m_aTable.m_pDirect[nIndex];
++ if (m_pRepresentation && nIndex < directCount())
++ return m_pRepresentation->m_aTable.m_pDirect[nIndex];
+ else
+ return STORE_PAGE_NULL;
+ }
+- void directLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ virtual void directLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- if (nIndex < directCount())
+- m_aTable.m_pDirect[nIndex] = nAddr;
++ if (m_pRepresentation && nIndex < directCount())
++ m_pRepresentation->m_aTable.m_pDirect[nIndex] = nAddr;
+ }
+
+ /** single.
+ */
+- static sal_uInt16 singleCount (void)
++ virtual sal_uInt16 singleCount (void) const
+ {
+- return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_SINGLE));
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_SINGLE_V2));
+ }
+- sal_uInt32 singleLink (sal_uInt16 nIndex) const
++ virtual sal_uInt32 singleLink (sal_uInt16 nIndex) const
+ {
+- if (nIndex < singleCount())
+- return m_aTable.m_pSingle[nIndex];
++ if (m_pRepresentation && nIndex < singleCount())
++ return m_pRepresentation->m_aTable.m_pSingle[nIndex];
+ else
+ return STORE_PAGE_NULL;
+ }
+- void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ virtual void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- if (nIndex < singleCount())
+- m_aTable.m_pSingle[nIndex] = nAddr;
++ if (m_pRepresentation && nIndex < singleCount())
++ m_pRepresentation->m_aTable.m_pSingle[nIndex] = nAddr;
+ }
+
+ /** double.
+ */
+- static sal_uInt16 doubleCount (void)
++ virtual sal_uInt16 doubleCount (void) const
+ {
+- return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_DOUBLE));
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_DOUBLE_V2));
+ }
+- sal_uInt32 doubleLink (sal_uInt16 nIndex) const
++ virtual sal_uInt32 doubleLink (sal_uInt16 nIndex) const
+ {
+- if (nIndex < doubleCount())
+- return m_aTable.m_pDouble[nIndex];
++ if (m_pRepresentation && nIndex < doubleCount())
++ return m_pRepresentation->m_aTable.m_pDouble[nIndex];
+ else
+ return STORE_PAGE_NULL;
+ }
+- void doubleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ virtual void doubleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- if (nIndex < doubleCount())
+- m_aTable.m_pDouble[nIndex] = nAddr;
++ if (m_pRepresentation && nIndex < doubleCount())
++ m_pRepresentation->m_aTable.m_pDouble[nIndex] = nAddr;
+ }
+
+ /** triple.
+ */
+- static sal_uInt16 tripleCount (void)
++ virtual sal_uInt16 tripleCount (void) const
+ {
+- return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_TRIPLE));
++ return ((sal_uInt16)(STORE_LIMIT_DATAPAGE_TRIPLE_V2));
+ }
+- sal_uInt32 tripleLink (sal_uInt16 nIndex) const
++ virtual sal_uInt32 tripleLink (sal_uInt16 nIndex) const
+ {
+- if (nIndex < tripleCount())
+- return m_aTable.m_pTriple[nIndex];
++ if (m_pRepresentation && nIndex < tripleCount())
++ return m_pRepresentation->m_aTable.m_pTriple[nIndex];
+ else
+ return STORE_PAGE_NULL;
+ }
+- void tripleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
++ virtual void tripleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- if (nIndex < tripleCount())
+- m_aTable.m_pTriple[nIndex] = nAddr;
++ if (m_pRepresentation && nIndex < tripleCount())
++ m_pRepresentation->m_aTable.m_pTriple[nIndex] = nAddr;
+ }
+ };
+
+@@ -562,76 +901,124 @@ struct OStoreDirectoryPageData : public
+ typedef OStorePageData base;
+ typedef OStoreDirectoryPageData self;
+
+- typedef OStorePageDescriptor D;
+- typedef OStorePageNameBlock NameBlock;
+- typedef OStoreDirectoryDataBlock DataBlock;
++ typedef OStorePageDescriptor D;
++ typedef OStorePageNameBlockA NameBlockT;
++ typedef OStoreDirectoryDataBlockA DataBlockT;
+
+ /** Representation.
+ */
+- NameBlock m_aNameBlock;
+- DataBlock m_aDataBlock;
+- sal_uInt8 m_pData[1];
++ OStorePageNameBlockA* m_pNameBlock;
++ OStoreDirectoryDataBlockA* m_pDataBlock;
++ sal_uInt8* m_pData;
+
+ /** size.
+ */
+- static sal_uInt16 size (void)
++ sal_uInt16 size () const
+ {
+- return (NameBlock::size() + DataBlock::size());
++ return m_pNameBlock->size () + m_pDataBlock->size ();
+ }
+
+ /** capacity.
+ */
+- static sal_uInt16 capacity (const D& rDescr)
++ sal_uInt16 capacity (const D& rDescr) const
+ {
+- return (rDescr.m_nSize - (base::size() + self::size()));
++ return (rDescr.m_nSize - (base::size() + size()));
+ }
+ sal_uInt16 capacity (void) const
+ {
+- return self::capacity (base::m_aDescr);
++ return capacity (base::PageHeader ().m_aDescr);
+ }
+
+ /** usage.
+ */
+- static sal_uInt16 usage (const D& rDescr)
++ sal_uInt16 usage (const D& rDescr) const
+ {
+- return (rDescr.m_nUsed - (base::size() + self::size()));
++ return (rDescr.m_nUsed - (base::size() + size()));
+ }
+ sal_uInt16 usage (void) const
+ {
+- return self::usage (base::m_aDescr);
++ return usage (base::PageHeader ().m_aDescr);
+ }
+
+ /** initialize.
+ */
+ void initialize (void)
+ {
+- base::m_aGuard.m_nMagic = STORE_MAGIC_DIRECTORYPAGE;
+- base::m_aDescr.m_nUsed = base::size() + self::size();
++ base::PageHeader ().m_aGuard.m_nMagic = STORE_MAGIC_DIRECTORYPAGE;
++ base::PageHeader ().m_aDescr.m_nUsed = base::size() + self::size();
+
+- m_aNameBlock.initialize();
+- m_aDataBlock.initialize();
++ m_pNameBlock->initialize();
++ m_pDataBlock->initialize();
+
+- rtl_zeroMemory (m_pData, capacity());
++ rtl_zeroMemory (m_pData, capacity());
+ }
+
+ /** Construction.
+ */
+- OStoreDirectoryPageData (sal_uInt16 nPageSize)
+- : base (nPageSize)
++ OStoreDirectoryPageData (sal_uInt16 nPageSize, OStorePageBIOS* pBIOS)
++ : base (nPageSize, sizeof (self))
+ {
+- base::m_aGuard.m_nMagic = STORE_MAGIC_DIRECTORYPAGE;
+- base::m_aDescr.m_nUsed = sal::static_int_cast< sal_uInt16 >(
+- base::m_aDescr.m_nUsed + self::size());
++ base::PageHeader ().m_aGuard.m_nMagic = STORE_MAGIC_DIRECTORYPAGE;
++
++ sal_uInt8* pMem = ((sal_uInt8*) this) + sizeof (self) + base::size ();
++
++ switch (pBIOS->version ()) {
++ case 1:
++ m_pNameBlock = new OStorePageNameBlockV1 (pMem);
++ m_pDataBlock = new OStoreDirectoryDataBlockV1 (pMem + m_pNameBlock->size ());
++ m_pData = pMem + m_pNameBlock->size () + m_pDataBlock->size ();
++ break;
++ case 2:
++ m_pNameBlock = new OStorePageNameBlockV2 (pMem);
++ m_pDataBlock = new OStoreDirectoryDataBlockV2 (pMem + m_pNameBlock->size ());
++ m_pData = pMem + m_pNameBlock->size () + m_pDataBlock->size ();
++ break;
++ default:
++ OSL_TRACE("wrong store BIOS/SuperPage version");
++ *((int *)NULL) = 0;
++ m_pNameBlock = NULL;
++ m_pDataBlock = NULL;
++ m_pData = NULL;
++ }
++
+ rtl_zeroMemory (m_pData, capacity());
+ }
+
++ ~OStoreDirectoryPageData ()
++ {
++ if (m_pNameBlock) {
++ delete m_pNameBlock;
++ m_pNameBlock = NULL;
++ }
++
++ if (m_pDataBlock) {
++ delete m_pDataBlock;
++ m_pDataBlock = NULL;
++ }
++ }
++
++ inline OStoreDirectoryDataBlockA& DataBlock () const
++ {
++ return *m_pDataBlock;
++ }
++
++ inline OStorePageNameBlockA& NameBlock () const
++ {
++ return *m_pNameBlock;
++ }
++
++ inline sal_uInt8* Data () const
++ {
++ return m_pData;
++ }
++
+ /** Comparsion.
+ */
+ sal_Bool operator== (const OStoreDirectoryPageData& rOther) const
+ {
+ return ((base::operator==(rOther) ) &&
+- (m_aNameBlock == rOther.m_aNameBlock) &&
+- (m_aDataBlock == rOther.m_aDataBlock) );
++ (NameBlock () == rOther.NameBlock ()) &&
++ (DataBlock () == rOther.DataBlock ()));
+ }
+
+ /** swap (internal and external representation).
+@@ -639,8 +1026,8 @@ struct OStoreDirectoryPageData : public
+ void swap ()
+ {
+ #ifdef OSL_BIGENDIAN
+- m_aNameBlock.swap();
+- m_aDataBlock.swap();
++ NameBlock ().swap();
++ DataBlock ().swap();
+ #endif /* OSL_BIGENDIAN */
+ }
+
+@@ -648,17 +1035,17 @@ struct OStoreDirectoryPageData : public
+ */
+ void guard ()
+ {
+- m_aNameBlock.guard();
+- m_aDataBlock.guard();
++ m_pNameBlock->guard();
++ m_pDataBlock->guard();
+ }
+
+ /** verify (external representation).
+ */
+ storeError verify ()
+ {
+- storeError eErrCode = m_aNameBlock.verify();
++ storeError eErrCode = m_pNameBlock->verify();
+ if (eErrCode == store_E_None)
+- eErrCode = m_aDataBlock.verify();
++ eErrCode = m_pDataBlock->verify();
+ return eErrCode;
+ }
+
+@@ -736,11 +1123,11 @@ public:
+ */
+ sal_uInt32 attrib (void) const
+ {
+- return m_rPage.m_aNameBlock.m_nAttrib;
++ return m_rPage.NameBlock ().Attrib ();
+ }
+ void attrib (sal_uInt32 nAttrib)
+ {
+- m_rPage.m_aNameBlock.m_nAttrib = nAttrib;
++ m_rPage.NameBlock ().SetAttrib (nAttrib);
+ touch();
+ }
+
+@@ -748,11 +1135,11 @@ public:
+ */
+ sal_uInt32 dataLength (void) const
+ {
+- return m_rPage.m_aDataBlock.m_nDataLen;
++ return m_rPage.DataBlock ().DataLen ();
+ }
+ void dataLength (sal_uInt32 nLength)
+ {
+- m_rPage.m_aDataBlock.m_nDataLen = nLength;
++ m_rPage.DataBlock ().SetDataLen (nLength);
+ touch();
+ }
+
+@@ -760,11 +1147,11 @@ public:
+ */
+ sal_uInt32 directLink (sal_uInt16 nIndex) const
+ {
+- return m_rPage.m_aDataBlock.directLink (nIndex);
++ return m_rPage.DataBlock ().directLink (nIndex);
+ }
+ void directLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- m_rPage.m_aDataBlock.directLink (nIndex, nAddr);
++ m_rPage.DataBlock ().directLink (nIndex, nAddr);
+ touch();
+ }
+
+@@ -772,11 +1159,11 @@ public:
+ */
+ sal_uInt32 singleLink (sal_uInt16 nIndex) const
+ {
+- return m_rPage.m_aDataBlock.singleLink (nIndex);
++ return m_rPage.DataBlock ().singleLink (nIndex);
+ }
+ void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- m_rPage.m_aDataBlock.singleLink (nIndex, nAddr);
++ m_rPage.DataBlock ().singleLink (nIndex, nAddr);
+ touch();
+ }
+
+@@ -784,11 +1171,11 @@ public:
+ */
+ sal_uInt32 doubleLink (sal_uInt16 nIndex) const
+ {
+- return m_rPage.m_aDataBlock.doubleLink (nIndex);
++ return m_rPage.DataBlock ().doubleLink (nIndex);
+ }
+ void doubleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- m_rPage.m_aDataBlock.doubleLink (nIndex, nAddr);
++ m_rPage.DataBlock ().doubleLink (nIndex, nAddr);
+ touch();
+ }
+
+@@ -796,11 +1183,11 @@ public:
+ */
+ sal_uInt32 tripleLink (sal_uInt16 nIndex) const
+ {
+- return m_rPage.m_aDataBlock.tripleLink (nIndex);
++ return m_rPage.DataBlock ().tripleLink (nIndex);
+ }
+ void tripleLink (sal_uInt16 nIndex, sal_uInt32 nAddr)
+ {
+- m_rPage.m_aDataBlock.tripleLink (nIndex, nAddr);
++ m_rPage.DataBlock ().tripleLink (nIndex, nAddr);
+ touch();
+ }
+
+@@ -808,7 +1195,7 @@ public:
+ */
+ page::ChunkScope scope (
+ sal_uInt32 nPage,
+- page::DataBlock::LinkDescriptor &rDescr) const;
++ page::DataBlockT::LinkDescriptor &rDescr) const;
+
+ /** get (external data page).
+ */
+--- ./store/source/store.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/store.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -132,7 +132,7 @@ storeError SAL_CALL store_createMemoryFi
+ return store_E_OutOfMemory;
+
+ storeError eErrCode = xManager->initializeManager (
+- &*xLockBytes, store_AccessCreate, nPageSize);
++ &*xLockBytes, store_AccessCreate, nPageSize, STORE_FORMAT_V2);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+@@ -149,7 +149,8 @@ storeError SAL_CALL store_openFile (
+ rtl_uString *pFilename,
+ storeAccessMode eAccessMode,
+ sal_uInt16 nPageSize,
+- storeFileHandle *phFile
++ storeFileHandle *phFile,
++ sal_uInt16 nFormatVersion
+ ) SAL_THROW_EXTERN_C()
+ {
+ if (phFile)
+@@ -171,7 +172,7 @@ storeError SAL_CALL store_openFile (
+ return store_E_OutOfMemory;
+
+ eErrCode = xManager->initializeManager (
+- &*xLockBytes, eAccessMode, nPageSize);
++ &*xLockBytes, eAccessMode, nPageSize, nFormatVersion);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+@@ -581,7 +582,7 @@ storeError SAL_CALL store_attrib (
+ OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8);
+ OStorePageKey aKey;
+
+- eErrCode = OStorePageNameBlock::namei (aPath.pData, aName.pData, aKey);
++ eErrCode = OStorePageNameBlockA::namei (aPath.pData, aName.pData, aKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+@@ -622,7 +623,7 @@ storeError SAL_CALL store_link (
+ pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8);
+ OStorePageKey aSrcKey;
+
+- eErrCode = OStorePageNameBlock::namei (
++ eErrCode = OStorePageNameBlockA::namei (
+ aSrcPath.pData, aSrcName.pData, aSrcKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+@@ -634,7 +635,7 @@ storeError SAL_CALL store_link (
+ pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8);
+ OStorePageKey aDstKey;
+
+- eErrCode = OStorePageNameBlock::namei (
++ eErrCode = OStorePageNameBlockA::namei (
+ aDstPath.pData, aDstName.pData, aDstKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+@@ -672,7 +673,7 @@ storeError SAL_CALL store_symlink (
+ pDstName->buffer, pDstName->length, RTL_TEXTENCODING_UTF8);
+ OStorePageKey aDstKey;
+
+- eErrCode = OStorePageNameBlock::namei (
++ eErrCode = OStorePageNameBlockA::namei (
+ aDstPath.pData, aDstName.pData, aDstKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+@@ -715,7 +716,7 @@ storeError SAL_CALL store_rename (
+ pSrcName->buffer, pSrcName->length, RTL_TEXTENCODING_UTF8);
+ OStorePageKey aSrcKey;
+
+- eErrCode = OStorePageNameBlock::namei (
++ eErrCode = OStorePageNameBlockA::namei (
+ aSrcPath.pData, aSrcName.pData, aSrcKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+@@ -753,7 +754,7 @@ storeError SAL_CALL store_remove (
+ OString aName (pName->buffer, pName->length, RTL_TEXTENCODING_UTF8);
+ OStorePageKey aKey;
+
+- eErrCode = OStorePageNameBlock::namei (aPath.pData, aName.pData, aKey);
++ eErrCode = OStorePageNameBlockA::namei (aPath.pData, aName.pData, aKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+--- ./store/source/storlckb.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/storlckb.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -88,7 +88,7 @@ static storeError __store_iget (
+ {
+ // Setup inode page key.
+ OStorePageKey aKey;
+- storeError eErrCode = OStorePageNameBlock::namei (pPath, pName, aKey);
++ storeError eErrCode = OStorePageNameBlockA::namei (pPath, pName, aKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+@@ -117,12 +117,9 @@ static storeError __store_iget (
+ return store_E_AccessViolation;
+
+ // Setup inode nameblock.
+- rNode.m_aNameBlock.m_aKey = aKey;
+- rNode.m_aNameBlock.m_nAttrib = nAttrib;
+-
+- rtl_copyMemory (
+- &rNode.m_aNameBlock.m_pData[0],
+- pName->buffer, pName->length);
++ rNode.NameBlock ().SetKey (aKey);
++ rNode.NameBlock ().SetAttrib (nAttrib);
++ rNode.NameBlock ().SetName (pName, rManager);
+
+ // Save inode page.
+ eErrCode = rManager.save (aKey, aPage);
+@@ -135,7 +132,7 @@ static storeError __store_iget (
+ {
+ // Obtain 'Destination' page key.
+ OStorePageKey aDstKey;
+- rtl_copyMemory (&aDstKey, &rNode.m_pData[0], sizeof(aDstKey));
++ rtl_copyMemory (&aDstKey, rNode.Data (), sizeof(aDstKey));
+
+ #ifdef OSL_BIGENDIAN
+ // Swap to internal representation.
+@@ -218,7 +215,7 @@ storeError OStoreDirectory::create (
+ return eErrCode;
+
+ delete m_pNode;
+- m_pNode = new(m_aDescr.m_nSize) inode(m_aDescr.m_nSize);
++ m_pNode = new(m_aDescr.m_nSize) inode(m_aDescr.m_nSize, pManager);
+ if (!m_pNode)
+ return store_E_OutOfMemory;
+
+@@ -231,21 +228,24 @@ storeError OStoreDirectory::create (
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+- sal_uInt32 nAttrib = m_pNode->m_aNameBlock.m_nAttrib;
++ sal_uInt32 nAttrib = m_pNode->NameBlock ().Attrib ();
+ if (!(nAttrib & STORE_ATTRIB_ISDIR))
+ return store_E_NotDirectory;
+
+- m_aDescr = m_pNode->m_aDescr;
++ m_aDescr = m_pNode->PageHeader ().m_aDescr;
+ eErrCode = xManager->acquirePage (m_aDescr, store_AccessReadOnly);
+ if (eErrCode == store_E_None)
+ {
+ // Evaluate iteration path from NameBlock.
+ typedef OStorePageGuard G;
+- sal_Char *pszName = m_pNode->m_aNameBlock.m_pData;
++ rtl_String *pItemName = NULL;
++ if ((eErrCode = m_pNode->NameBlock ().Name (&pItemName, *pManager)) != store_E_None)
++ return eErrCode;
+
+- m_nPath = m_pNode->m_aNameBlock.m_aKey.m_nHigh;
+- m_nPath = G::crc32 (m_nPath, pszName, rtl_str_getLength(pszName));
++ m_nPath = m_pNode->NameBlock ().Key ().m_nHigh;
++ m_nPath = G::crc32 (m_nPath, pItemName->buffer, pItemName->length);
+ m_nPath = G::crc32 (m_nPath, "/", 1);
++ rtl_string_release (pItemName);
+
+ // Accept page manager.
+ m_xManager = xManager;
+@@ -290,8 +290,13 @@ storeError OStoreDirectory::iterate (sto
+ if (eErrCode == store_E_None)
+ {
+ // Setup FindData.
+- sal_Char *p = m_pNode->m_aNameBlock.m_pData;
+- sal_Size n = rtl_str_getLength (p);
++
++ rtl_String *pItemName = NULL;
++ if ((eErrCode = m_pNode->NameBlock ().Name (&pItemName, *m_xManager)) != store_E_None)
++ return eErrCode;
++
++ sal_Char *p = pItemName->buffer;
++ sal_Size n = pItemName->length;
+ sal_Size k = rFindData.m_nLength;
+
+ n = __store_convertTextToUnicode (
+@@ -302,6 +307,7 @@ storeError OStoreDirectory::iterate (sto
+ k = (k - n) * sizeof(sal_Unicode);
+ rtl_zeroMemory (&rFindData.m_pszName[n], k);
+ }
++ rtl_string_release (pItemName);
+
+ rFindData.m_nLength = n;
+ rFindData.m_nAttrib |= aPage.attrib();
+@@ -356,7 +362,7 @@ OStoreLockBytes::~OStoreLockBytes (void)
+ osl::MutexGuard aGuard (*m_xManager);
+ if (m_pNode)
+ {
+- OStorePageDescriptor aDescr (m_pNode->m_aDescr);
++ OStorePageDescriptor aDescr (m_pNode->PageHeader ().m_aDescr);
+ m_xManager->releasePage (aDescr);
+ }
+ }
+@@ -415,7 +421,7 @@ storeError OStoreLockBytes::create (
+ return eErrCode;
+
+ delete m_pNode;
+- m_pNode = new(m_nPageSize) inode(m_nPageSize);
++ m_pNode = new(m_nPageSize) inode(m_nPageSize, pManager);
+ if (!m_pNode)
+ return store_E_OutOfMemory;
+
+@@ -428,7 +434,7 @@ storeError OStoreLockBytes::create (
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+- sal_uInt32 nAttrib = m_pNode->m_aNameBlock.m_nAttrib;
++ sal_uInt32 nAttrib = m_pNode->NameBlock ().Attrib ();
+ if (!(nAttrib & STORE_ATTRIB_ISFILE))
+ {
+ // No ISFILE in older versions (backward compatibility).
+@@ -437,7 +443,7 @@ storeError OStoreLockBytes::create (
+ }
+
+ // ...
+- OStorePageDescriptor aDescr (m_pNode->m_aDescr);
++ OStorePageDescriptor aDescr (m_pNode->PageHeader ().m_aDescr);
+ if (eMode != store_AccessReadOnly)
+ eErrCode = xManager->acquirePage (aDescr, store_AccessReadWrite);
+ else
+@@ -504,7 +510,7 @@ storeError OStoreLockBytes::readAt (
+
+ rtl_copyMemory (
+ &pData[rnDone],
+- &m_pNode->m_pData[aDescr.m_nOffset],
++ m_pNode->Data () + aDescr.m_nOffset,
+ nLength);
+
+ // Adjust counters.
+@@ -543,7 +549,7 @@ storeError OStoreLockBytes::readAt (
+ {
+ rtl_copyMemory (
+ &pData[rnDone],
+- &m_pData->m_pData[aDescr.m_nOffset],
++ &m_pData->RepresentationData ()[aDescr.m_nOffset],
+ nLength);
+ }
+
+@@ -601,7 +607,7 @@ storeError OStoreLockBytes::writeAt (
+ nLength = SAL_MIN(nLength, nBytes);
+
+ rtl_copyMemory (
+- &m_pNode->m_pData[aDescr.m_nOffset],
++ m_pNode->Data () + aDescr.m_nOffset,
+ &pData[rnDone], nLength);
+
+ // Mark inode dirty.
+@@ -641,7 +647,7 @@ storeError OStoreLockBytes::writeAt (
+ return eErrCode;
+
+ rtl_zeroMemory (
+- &m_pData->m_pData[0],
++ m_pData->RepresentationData (),
+ m_pData->capacity());
+ }
+ }
+@@ -650,7 +656,7 @@ storeError OStoreLockBytes::writeAt (
+ nLength = SAL_MIN(nLength, nBytes);
+
+ rtl_copyMemory (
+- &m_pData->m_pData[aDescr.m_nOffset],
++ m_pData->RepresentationData () + aDescr.m_nOffset,
+ &pData[rnDone], nLength);
+
+ // Save data page.
+@@ -740,7 +746,7 @@ storeError OStoreLockBytes::setSize (sal
+ // Truncate internal data page.
+ inode::ChunkDescriptor aDescr (nSize, m_pNode->capacity());
+ rtl_zeroMemory (
+- &m_pNode->m_pData[aDescr.m_nOffset],
++ m_pNode->Data () + aDescr.m_nOffset,
+ aDescr.m_nLength);
+ }
+ else
+@@ -784,7 +790,7 @@ storeError OStoreLockBytes::stat (sal_uI
+ if (!m_xManager.is())
+ return store_E_InvalidAccess;
+
+- rnSize = m_pNode->m_aDataBlock.m_nDataLen;
++ rnSize = m_pNode->DataBlock ().DataLen ();
+ return store_E_None;
+ }
+
+--- ./store/source/storpage.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/storpage.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -112,7 +112,8 @@ sal_Bool SAL_CALL OStorePageManager::isK
+ storeError OStorePageManager::initializeManager (
+ ILockBytes *pLockBytes,
+ storeAccessMode eAccessMode,
+- sal_uInt16 nPageSize)
++ sal_uInt16 nPageSize,
++ sal_uInt16 nFormatVersion)
+ {
+ // Acquire exclusive access.
+ osl::MutexGuard aGuard(*this);
+@@ -135,7 +136,7 @@ storeError OStorePageManager::initialize
+ return store_E_NotExists;
+
+ // Create.
+- eErrCode = base::create (nPageSize);
++ eErrCode = base::create (nPageSize, nFormatVersion);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+ }
+@@ -194,10 +195,10 @@ storeError OStorePageManager::free (OSto
+
+ // Check for cacheable page.
+ OStorePageData &rData = rPage.getData();
+- if (rData.m_aGuard.m_nMagic == STORE_MAGIC_BTREENODE)
++ if (rData.PageHeader ().m_aGuard.m_nMagic == STORE_MAGIC_BTREENODE)
+ {
+ // Invalidate cache entry.
+- storeError eErrCode = m_pCache->invalidate (rData.m_aDescr);
++ storeError eErrCode = m_pCache->invalidate (rData.PageHeader ().m_aDescr);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+ }
+@@ -221,10 +222,10 @@ storeError OStorePageManager::load (OSto
+
+ // Check for cacheable page.
+ OStorePageData &rData = rPage.getData();
+- if (rData.m_aGuard.m_nMagic == STORE_MAGIC_BTREENODE)
++ if (rData.PageHeader ().m_aGuard.m_nMagic == STORE_MAGIC_BTREENODE)
+ {
+ // Save PageDescriptor.
+- OStorePageDescriptor aDescr (rData.m_aDescr);
++ OStorePageDescriptor aDescr (rData.PageHeader ().m_aDescr);
+
+ // Load (cached) page.
+ storeError eErrCode = m_pCache->load (aDescr, rData, *this);
+@@ -271,10 +272,10 @@ storeError OStorePageManager::save (OSto
+
+ // Check for cacheable page.
+ OStorePageData &rData = rPage.getData();
+- if (rData.m_aGuard.m_nMagic == STORE_MAGIC_BTREENODE)
++ if (rData.PageHeader ().m_aGuard.m_nMagic == STORE_MAGIC_BTREENODE)
+ {
+ // Save PageDescriptor.
+- OStorePageDescriptor aDescr (rData.m_aDescr);
++ OStorePageDescriptor aDescr (rData.PageHeader ().m_aDescr);
+
+ #ifdef OSL_BIGENDIAN
+ // Swap to external representation.
+@@ -365,7 +366,7 @@ storeError OStorePageManager::find (cons
+ }
+
+ // Check address.
+- sal_uInt32 nAddr = rPage.m_pData[i].m_aLink.m_nAddr;
++ sal_uInt32 nAddr = rPage.DataRepresentation ().m_pData[i].m_aLink.m_nAddr;
+ if (nAddr == STORE_PAGE_NULL)
+ {
+ // Path to entry not exists (Must not happen(?)).
+@@ -405,7 +406,7 @@ storeError OStorePageManager::find (
+
+ // Pre-allocate left most entry (ugly, but we can't insert to left).
+ rPage.insert (0, entry());
+- rPage.m_pData[0].m_aKey.m_nLow = OStorePageGuard::crc32 (0, "/", 1);
++ rPage.DataRepresentation ().m_pData[0].m_aKey.m_nLow = OStorePageGuard::crc32 (0, "/", 1);
+
+ // Allocate RootNode.
+ eErrCode = base::allocate (aRoot, ALLOCATE_EOF);
+@@ -436,7 +437,7 @@ storeError OStorePageManager::find (
+ }
+
+ // Check address.
+- sal_uInt32 nAddr = rPage.m_pData[i].m_aLink.m_nAddr;
++ sal_uInt32 nAddr = rPage.DataRepresentation ().m_pData[i].m_aLink.m_nAddr;
+ if (nAddr == STORE_PAGE_NULL)
+ {
+ // Path to entry not exists (Must not happen(?)).
+@@ -499,13 +500,13 @@ storeError OStorePageManager::remove (
+ }
+
+ // Compare entry.
+- entry::CompareResult result = rEntry.compare (rPage.m_pData[i]);
++ entry::CompareResult result = rEntry.compare (rPage.DataRepresentation ().m_pData[i]);
+
+ // Iterate down until equal match.
+ while ((result == entry::COMPARE_GREATER) && (rPage.depth() > 0))
+ {
+ // Check link address.
+- sal_uInt32 nAddr = rPage.m_pData[i].m_aLink.m_nAddr;
++ sal_uInt32 nAddr = rPage.DataRepresentation ().m_pData[i].m_aLink.m_nAddr;
+ if (nAddr == STORE_PAGE_NULL)
+ {
+ // Path to entry not exists (Must not happen(?)).
+@@ -529,7 +530,7 @@ storeError OStorePageManager::remove (
+ }
+
+ // Compare entry.
+- result = rEntry.compare (rPage.m_pData[i]);
++ result = rEntry.compare (rPage.DataRepresentation ().m_pData[i]);
+ }
+
+ OSL_POSTCOND(
+@@ -581,14 +582,14 @@ storeError OStorePageManager::load (
+ }
+
+ // Check for exact match.
+- if (!(e.compare (m_pNode[0]->m_pData[i]) == entry::COMPARE_EQUAL))
++ if (!(e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]) == entry::COMPARE_EQUAL))
+ {
+ // Page not present.
+ return store_E_NotExists;
+ }
+
+ // Existing entry. Check address.
+- sal_uInt32 nAddr = m_pNode[0]->m_pData[i].m_aLink.m_nAddr;
++ sal_uInt32 nAddr = m_pNode[0]->DataRepresentation ().m_pData[i].m_aLink.m_nAddr;
+ if (nAddr == STORE_PAGE_NULL)
+ {
+ // Page not present.
+@@ -632,7 +633,7 @@ storeError OStorePageManager::save (
+ if (i < n)
+ {
+ // Compare entry.
+- entry::CompareResult result = e.compare (m_pNode[0]->m_pData[i]);
++ entry::CompareResult result = e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]);
+ OSL_POSTCOND(
+ result != entry::COMPARE_LESS,
+ "OStorePageManager::save(): find failed");
+@@ -647,7 +648,7 @@ storeError OStorePageManager::save (
+ if (result == entry::COMPARE_EQUAL)
+ {
+ // Existing entry. Check address.
+- sal_uInt32 nAddr = m_pNode[0]->m_pData[i].m_aLink.m_nAddr;
++ sal_uInt32 nAddr = m_pNode[0]->DataRepresentation ().m_pData[i].m_aLink.m_nAddr;
+ if (nAddr == STORE_PAGE_NULL)
+ {
+ // Allocate page.
+@@ -656,7 +657,7 @@ storeError OStorePageManager::save (
+ return eErrCode;
+
+ // Modify page address.
+- m_pNode[0]->m_pData[i].m_aLink.m_nAddr = rPage.location();
++ m_pNode[0]->DataRepresentation ().m_pData[i].m_aLink.m_nAddr = rPage.location();
+
+ // Save modified NodePage.
+ node aNode (*m_pNode[0]);
+@@ -720,14 +721,14 @@ storeError OStorePageManager::attrib (
+ }
+
+ // Check for exact match.
+- if (!(e.compare (m_pNode[0]->m_pData[i]) == entry::COMPARE_EQUAL))
++ if (!(e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]) == entry::COMPARE_EQUAL))
+ {
+ // Page not present.
+ return store_E_NotExists;
+ }
+
+ // Existing entry.
+- e = m_pNode[0]->m_pData[i];
++ e = m_pNode[0]->DataRepresentation ().m_pData[i];
+ if (nMask1 != nMask2)
+ {
+ // Evaluate new attributes.
+@@ -743,7 +744,7 @@ storeError OStorePageManager::attrib (
+ {
+ // Set new attributes.
+ e.m_nAttrib = nAttrib;
+- m_pNode[0]->m_pData[i] = e;
++ m_pNode[0]->DataRepresentation ().m_pData[i] = e;
+
+ // Save modified NodePage.
+ node aNode (*m_pNode[0]);
+@@ -798,14 +799,14 @@ storeError OStorePageManager::link (
+ }
+
+ // Check for exact match.
+- if (!(e.compare (m_pNode[0]->m_pData[i]) == entry::COMPARE_EQUAL))
++ if (!(e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]) == entry::COMPARE_EQUAL))
+ {
+ // Page not present.
+ return store_E_NotExists;
+ }
+
+ // Existing entry. Check address.
+- e = m_pNode[0]->m_pData[i];
++ e = m_pNode[0]->DataRepresentation ().m_pData[i];
+ if (e.m_aLink.m_nAddr == STORE_PAGE_NULL)
+ {
+ // Page not present.
+@@ -826,7 +827,7 @@ storeError OStorePageManager::link (
+ if (i < n)
+ {
+ // Compare entry.
+- entry::CompareResult result = e.compare (m_pNode[0]->m_pData[i]);
++ entry::CompareResult result = e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]);
+ OSL_POSTCOND(
+ result != entry::COMPARE_LESS,
+ "OStorePageManager::link(): find failed");
+@@ -878,7 +879,7 @@ storeError OStorePageManager::symlink (
+
+ // Setup 'Source' page key.
+ OStorePageKey aSrcKey;
+- eErrCode = OStorePageNameBlock::namei (pSrcPath, pSrcName, aSrcKey);
++ eErrCode = OStorePageNameBlockA::namei (pSrcPath, pSrcName, aSrcKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+@@ -896,7 +897,7 @@ storeError OStorePageManager::symlink (
+ if (i < n)
+ {
+ // Compare entry.
+- entry::CompareResult result = e.compare (m_pNode[0]->m_pData[i]);
++ entry::CompareResult result = e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]);
+ OSL_POSTCOND(
+ result != entry::COMPARE_LESS,
+ "OStorePageManager::symlink(): find failed");
+@@ -919,22 +920,20 @@ storeError OStorePageManager::symlink (
+ if (m_pDirect)
+ m_pDirect->initialize();
+ if (!m_pDirect)
+- m_pDirect = new(m_nPageSize) inode(m_nPageSize);
++ m_pDirect = new(m_nPageSize) inode(m_nPageSize, this);
+ if (!m_pDirect)
+ return store_E_OutOfMemory;
+
+ // Setup as 'Source' directory page.
+- m_pDirect->m_aNameBlock.m_aKey = aSrcKey;
+- rtl_copyMemory (
+- &m_pDirect->m_aNameBlock.m_pData[0],
+- pSrcName->buffer, pSrcName->length);
++ m_pDirect->NameBlock ().SetKey (aSrcKey);
++ m_pDirect->NameBlock ().SetName (pSrcName, *this);
+
+ // Store 'Destination' page key.
+ OStorePageKey aDstKey (rDstKey);
+ #ifdef OSL_BIGENDIAN
+ aDstKey.swap(); // Swap to external representation.
+ #endif /* OSL_BIGENDIAN */
+- rtl_copyMemory (&m_pDirect->m_pData[0], &aDstKey, sizeof(aDstKey));
++ rtl_copyMemory (m_pDirect->Data (), &aDstKey, sizeof(aDstKey));
+
+ // Mark 'Source' as symbolic link to 'Destination'.
+ OStoreDirectoryPageObject aPage (*m_pDirect);
+@@ -981,7 +980,7 @@ storeError OStorePageManager::rename (
+
+ // Setup 'Destination' page key.
+ OStorePageKey aDstKey;
+- eErrCode = OStorePageNameBlock::namei (pDstPath, pDstName, aDstKey);
++ eErrCode = OStorePageNameBlockA::namei (pDstPath, pDstName, aDstKey);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+@@ -1003,14 +1002,14 @@ storeError OStorePageManager::rename (
+ }
+
+ // Check for exact match.
+- if (!(e.compare (m_pNode[0]->m_pData[i]) == entry::COMPARE_EQUAL))
++ if (!(e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]) == entry::COMPARE_EQUAL))
+ {
+ // Page not present.
+ return store_E_NotExists;
+ }
+
+ // Existing 'Source' entry. Check address.
+- e = m_pNode[0]->m_pData[i];
++ e = m_pNode[0]->DataRepresentation ().m_pData[i];
+ if (e.m_aLink.m_nAddr == STORE_PAGE_NULL)
+ {
+ // Page not present.
+@@ -1022,7 +1021,7 @@ storeError OStorePageManager::rename (
+ {
+ // Check directory page buffer.
+ if (!m_pDirect)
+- m_pDirect = new(m_nPageSize) inode(m_nPageSize);
++ m_pDirect = new(m_nPageSize) inode(m_nPageSize, this);
+ if (!m_pDirect)
+ return store_E_OutOfMemory;
+
+@@ -1055,7 +1054,7 @@ storeError OStorePageManager::rename (
+ if (i < n)
+ {
+ // Compare entry.
+- entry::CompareResult result = e.compare (m_pNode[0]->m_pData[i]);
++ entry::CompareResult result = e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]);
+ OSL_POSTCOND(
+ result != entry::COMPARE_LESS,
+ "OStorePageManager::rename(): find failed");
+@@ -1086,14 +1085,8 @@ storeError OStorePageManager::rename (
+ if (!(e.m_nAttrib & STORE_ATTRIB_ISLINK))
+ {
+ // Setup 'Destination' NameBlock.
+- sal_Int32 nDstLen = pDstName->length;
+- rtl_copyMemory (
+- &m_pDirect->m_aNameBlock.m_pData[0],
+- pDstName->buffer, nDstLen);
+- rtl_zeroMemory (
+- &m_pDirect->m_aNameBlock.m_pData[nDstLen],
+- STORE_MAXIMUM_NAMESIZE - nDstLen);
+- m_pDirect->m_aNameBlock.m_aKey = e.m_aKey;
++ m_pDirect->NameBlock ().SetName (pDstName, *this);
++ m_pDirect->NameBlock ().SetKey (e.m_aKey);
+
+ // Save directory page.
+ OStoreDirectoryPageObject aPage (*m_pDirect);
+@@ -1143,14 +1136,14 @@ storeError OStorePageManager::remove (co
+ }
+
+ // Check for exact match.
+- if (!(e.compare (m_pNode[0]->m_pData[i]) == entry::COMPARE_EQUAL))
++ if (!(e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]) == entry::COMPARE_EQUAL))
+ {
+ // Page not present.
+ return store_E_NotExists;
+ }
+
+ // Existing entry. Check address.
+- e = m_pNode[0]->m_pData[i];
++ e = m_pNode[0]->DataRepresentation ().m_pData[i];
+ if (e.m_aLink.m_nAddr == STORE_PAGE_NULL)
+ {
+ // Page not present.
+@@ -1162,7 +1155,7 @@ storeError OStorePageManager::remove (co
+ {
+ // Check directory page buffer.
+ if (!m_pDirect)
+- m_pDirect = new(m_nPageSize) inode(m_nPageSize);
++ m_pDirect = new(m_nPageSize) inode(m_nPageSize, this);
+ if (!m_pDirect)
+ return store_E_OutOfMemory;
+
+@@ -1175,7 +1168,7 @@ storeError OStorePageManager::remove (co
+ return eErrCode;
+
+ // Acquire page write access.
+- OStorePageDescriptor aDescr (m_pDirect->m_aDescr);
++ OStorePageDescriptor aDescr (m_pDirect->PageHeader ().m_aDescr);
+ eErrCode = base::acquirePage (aDescr, store_AccessReadWrite);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+@@ -1202,7 +1195,7 @@ storeError OStorePageManager::remove (co
+ }
+
+ // Truncate internal data page.
+- rtl_zeroMemory (&m_pDirect->m_pData[0], m_pDirect->capacity());
++ rtl_zeroMemory (m_pDirect->Data (), m_pDirect->capacity());
+ aPage.dataLength (0);
+ }
+
+@@ -1252,7 +1245,7 @@ storeError OStorePageManager::iterate (
+ }
+
+ // Compare entry.
+- entry::CompareResult result = e.compare (m_pNode[0]->m_pData[i]);
++ entry::CompareResult result = e.compare (m_pNode[0]->DataRepresentation ().m_pData[i]);
+ OSL_POSTCOND(
+ result != entry::COMPARE_LESS,
+ "OStorePageManager::iterate(): find failed");
+@@ -1265,7 +1258,7 @@ storeError OStorePageManager::iterate (
+ }
+
+ // GreaterEqual. Found next entry.
+- e = m_pNode[0]->m_pData[i];
++ e = m_pNode[0]->DataRepresentation ().m_pData[i];
+
+ // Setup result.
+ rKey = e.m_aKey;
+@@ -1359,20 +1352,20 @@ storeError OStorePageManager::rebuild (
+ return eErrCode;
+
+ // Initialize as 'Destination' with 'Source' page size.
+- eErrCode = self::initializeManager (pDstLB, store_AccessCreate, nPageSize);
++ eErrCode = self::initializeManager (pDstLB, store_AccessCreate, nPageSize, version ());
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+ // Initialize directory and data page buffers.
+ if (!m_pDirect)
+- m_pDirect = new(m_nPageSize) inode(m_nPageSize);
++ m_pDirect = new(m_nPageSize) inode(m_nPageSize, this);
+ if (!m_pData)
+ m_pData = new(m_nPageSize) data(m_nPageSize);
+ if (!(m_pDirect && m_pData))
+ return store_E_OutOfMemory;
+
+ // Initialize 'Source' directory page.
+- inode *pDirect = new(m_nPageSize) inode(m_nPageSize);
++ inode *pDirect = new(m_nPageSize) inode(m_nPageSize, this);
+ if (!pDirect)
+ return store_E_OutOfMemory;
+
+@@ -1381,8 +1374,8 @@ storeError OStorePageManager::rebuild (
+ while ((eErrCode = aCtx.load(aSrcPage)) == store_E_None)
+ {
+ // Obtain page key and data length.
+- OStorePageKey aKey (pDirect->m_aNameBlock.m_aKey);
+- sal_uInt32 nDataLen = pDirect->m_aDataBlock.m_nDataLen;
++ OStorePageKey aKey (pDirect->NameBlock ().Key ());
++ sal_uInt32 nDataLen = pDirect->DataBlock ().DataLen ();
+
+ // Determine data page scope.
+ inode::ChunkScope eScope = pDirect->scope (nDataLen);
+@@ -1399,8 +1392,8 @@ storeError OStorePageManager::rebuild (
+ OStoreDirectoryPageObject aDstPage (*m_pDirect);
+ rtl_copyMemory (m_pDirect, pDirect, m_nPageSize);
+
+- m_pDirect->m_aDataBlock.initialize();
+- m_pDirect->m_aDataBlock.m_nDataLen = m_pDirect->capacity();
++ m_pDirect->DataBlock ().initialize();
++ m_pDirect->DataBlock ().SetDataLen (m_pDirect->capacity());
+
+ // Insert 'Destination' directory page.
+ eErrCode = save (aKey, aDstPage);
+@@ -1419,7 +1412,7 @@ storeError OStorePageManager::rebuild (
+ for (i = 0; i < n; i++)
+ {
+ // Re-initialize data page size.
+- m_pData->m_aDescr.m_nSize = m_nPageSize;
++ m_pData->PageHeader ().m_aDescr.m_nSize = m_nPageSize;
+
+ // Read 'Source' data page.
+ OStorePageBIOS &rBIOS = *(aCtx.m_xBIOS);
+@@ -1438,7 +1431,7 @@ storeError OStorePageManager::rebuild (
+ }
+
+ // Update 'Destination' directory page.
+- m_pDirect->m_aDataBlock.m_nDataLen = nDataLen;
++ m_pDirect->DataBlock ().SetDataLen (nDataLen);
+ eErrCode = base::save (aDstPage);
+ }
+ }
+@@ -1460,17 +1453,17 @@ storeError OStorePageManager::rebuild (
+ sal_uInt16 i, n = pNode->usageCount();
+ for (i = 0; i < n; i++)
+ {
+- e = pNode->m_pData[i];
++ e = pNode->DataRepresentation ().m_pData[i];
+ if (e.m_nAttrib & STORE_ATTRIB_ISLINK)
+ {
+ // Hard link.
+ aSrcPage.location (e.m_aLink.m_nAddr);
+- pDirect->m_aDescr.m_nSize = m_nPageSize;
++ pDirect->PageHeader ().m_aDescr.m_nSize = m_nPageSize;
+
+ eErrCode = aCtx.m_xBIOS->load (aSrcPage);
+ if (eErrCode == store_E_None)
+ {
+- OStorePageKey aDstKey (pDirect->m_aNameBlock.m_aKey);
++ OStorePageKey aDstKey (pDirect->NameBlock ().Key ());
+ eErrCode = link (e.m_aKey, aDstKey);
+ }
+ e.m_nAttrib &= ~STORE_ATTRIB_ISLINK;
+--- ./store/source/storpage.hxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/storpage.hxx 2009-04-06 16:42:11.000000000 +0000
+@@ -66,7 +66,8 @@ public:
+ storeError initializeManager (
+ ILockBytes *pLockBytes,
+ storeAccessMode eAccessMode,
+- sal_uInt16 nPageSize);
++ sal_uInt16 nPageSize,
++ sal_uInt16 nFormatVersion);
+
+ /** isValid.
+ * @return sal_True upon successful initialization,
+--- ./store/source/stortree.cxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/stortree.cxx 2009-04-06 16:42:11.000000000 +0000
+@@ -55,7 +55,7 @@ using namespace store;
+ * OStoreBTreeNodeData.
+ */
+ OStoreBTreeNodeData::OStoreBTreeNodeData (sal_uInt16 nPageSize)
+- : OStorePageData (nPageSize)
++ : OStorePageData (nPageSize, sizeof (self))
+ {
+ initialize();
+ }
+@@ -65,15 +65,15 @@ OStoreBTreeNodeData::OStoreBTreeNodeData
+ */
+ void OStoreBTreeNodeData::initialize (void)
+ {
+- base::m_aGuard.m_nMagic = STORE_MAGIC_BTREENODE;
+- base::m_aDescr.m_nUsed = base::size() + self::size();
+- self::m_aGuard.m_nMagic = 0;
++ base::PageHeader ().m_aGuard.m_nMagic = STORE_MAGIC_BTREENODE;
++ base::PageHeader ().m_aDescr.m_nUsed = base::size() + self::size();
++ self::PageHeader ().m_aGuard.m_nMagic = 0;
+
+ sal_uInt16 i, n = capacityCount();
+ T t;
+
+ for (i = 1; i < n; i++)
+- m_pData[i] = t;
++ DataRepresentation ().m_pData[i] = t;
+ }
+
+ /*
+@@ -87,11 +87,11 @@ void OStoreBTreeNodeData::swap (
+ )
+ {
+ #ifdef OSL_BIGENDIAN
+- m_aGuard.swap();
++ DataRepresentation ().m_aGuard.swap();
+
+ sal_uInt16 i, n = sal_uInt16(capacity(rDescr) / sizeof(T));
+ for (i = 0; i < n; i++)
+- m_pData[i].swap();
++ DataRepresentation ().m_pData[i].swap();
+ #endif /* OSL_BIGENDIAN */
+ }
+
+@@ -107,16 +107,16 @@ sal_uInt16 OStoreBTreeNodeData::find (co
+ {
+ register sal_Int32 m = ((l + r) >> 1);
+
+- if (t.m_aKey == m_pData[m].m_aKey)
++ if (t.m_aKey == DataRepresentation ().m_pData[m].m_aKey)
+ return ((sal_uInt16)(m));
+- if (t.m_aKey < m_pData[m].m_aKey)
++ if (t.m_aKey < DataRepresentation ().m_pData[m].m_aKey)
+ r = m - 1;
+ else
+ l = m + 1;
+ }
+
+ sal_uInt16 k = ((sal_uInt16)(r));
+- if ((k < capacityCount()) && (t.m_aKey < m_pData[k].m_aKey))
++ if ((k < capacityCount()) && (t.m_aKey < DataRepresentation ().m_pData[k].m_aKey))
+ return(k - 1);
+ else
+ return(k);
+@@ -132,11 +132,11 @@ void OStoreBTreeNodeData::insert (sal_uI
+ if ((n < m) && (i < m))
+ {
+ // shift right.
+- rtl_moveMemory (&m_pData[i + 1], &m_pData[i], (n - i) * sizeof(T));
++ rtl_moveMemory (&DataRepresentation ().m_pData[i + 1], &DataRepresentation ().m_pData[i], (n - i) * sizeof(T));
+
+ // insert.
+- m_pData[i] = t;
+- base::m_aDescr.m_nUsed += sal_uInt16(sizeof(T));
++ DataRepresentation ().m_pData[i] = t;
++ base::PageHeader ().m_aDescr.m_nUsed += sal_uInt16(sizeof(T));
+ }
+ }
+
+@@ -150,11 +150,11 @@ void OStoreBTreeNodeData::remove (sal_uI
+ {
+ // shift left.
+ rtl_moveMemory (
+- &m_pData[i], &m_pData[i + 1], (n - i - 1) * sizeof(T));
++ &DataRepresentation ().m_pData[i], &DataRepresentation ().m_pData[i + 1], (n - i - 1) * sizeof(T));
+
+ // truncate.
+- m_pData[n - 1] = T();
+- base::m_aDescr.m_nUsed -= sal_uInt16(sizeof(T));
++ DataRepresentation ().m_pData[n - 1] = T();
++ base::PageHeader ().m_aDescr.m_nUsed -= sal_uInt16(sizeof(T));
+ }
+ }
+
+@@ -167,7 +167,7 @@ void OStoreBTreeNodeData::merge (const s
+ {
+ sal_uInt16 n = usageCount();
+ sal_uInt16 m = rPageR.usageCount();
+- rtl_copyMemory (&m_pData[n], &rPageR.m_pData[0], m * sizeof(T));
++ rtl_copyMemory (&DataRepresentation ().m_pData[n], &rPageR.DataRepresentation ().m_pData[0], m * sizeof(T));
+ usageCount (n + m);
+ }
+ }
+@@ -178,7 +178,7 @@ void OStoreBTreeNodeData::merge (const s
+ void OStoreBTreeNodeData::split (const self& rPageL)
+ {
+ sal_uInt16 h = capacityCount() / 2;
+- rtl_copyMemory (&m_pData[0], &rPageL.m_pData[h], h * sizeof(T));
++ rtl_copyMemory (&DataRepresentation ().m_pData[0], &rPageL.DataRepresentation ().m_pData[h], h * sizeof(T));
+ truncate (h);
+ }
+
+@@ -191,7 +191,7 @@ void OStoreBTreeNodeData::truncate (sal_
+ T t;
+
+ for (sal_uInt16 i = n; i < m; i++)
+- m_pData[i] = t;
++ DataRepresentation ().m_pData[i] = t;
+ usageCount (n);
+ }
+
+@@ -255,7 +255,7 @@ storeError OStoreBTreeNodeObject::split
+ STORE_METHOD_ENTER(pMutex);
+
+ // Save PageDescriptor.
+- D aDescr (m_rPage.m_aDescr);
++ D aDescr (m_rPage.PageHeader ().m_aDescr);
+
+ // Acquire Lock.
+ storeError eErrCode = rBIOS.acquireLock (aDescr.m_nAddr, aDescr.m_nSize);
+@@ -297,7 +297,7 @@ storeError OStoreBTreeNodeObject::split
+
+ // Insert right page.
+ T entry;
+- entry.m_aKey = rPageR.m_pData[0].m_aKey;
++ entry.m_aKey = rPageR.DataRepresentation ().m_pData[0].m_aKey;
+ entry.m_aLink.m_nAddr = rPageR.location();
+
+ m_rPage.insert (nIndexL + 1, entry);
+@@ -340,7 +340,7 @@ storeError OStoreBTreeNodeObject::remove
+ STORE_METHOD_ENTER(pMutex);
+
+ // Save PageDescriptor.
+- D aDescr (m_rPage.m_aDescr);
++ D aDescr (m_rPage.PageHeader ().m_aDescr);
+
+ // Acquire Lock.
+ storeError eErrCode = rBIOS.acquireLock (aDescr.m_nAddr, aDescr.m_nSize);
+@@ -351,7 +351,7 @@ storeError OStoreBTreeNodeObject::remove
+ if (m_rPage.depth())
+ {
+ // Check link entry.
+- if (!(rEntryL.compare (m_rPage.m_pData[nIndexL]) == T::COMPARE_EQUAL))
++ if (!(rEntryL.compare (m_rPage.DataRepresentation ().m_pData[nIndexL]) == T::COMPARE_EQUAL))
+ {
+ rBIOS.releaseLock (aDescr.m_nAddr, aDescr.m_nSize);
+ STORE_METHOD_LEAVE(pMutex, store_E_InvalidAccess);
+@@ -359,7 +359,7 @@ storeError OStoreBTreeNodeObject::remove
+
+ // Load link node.
+ self aNodeL (rPageL);
+- aNodeL.location (m_rPage.m_pData[nIndexL].m_aLink.m_nAddr);
++ aNodeL.location (m_rPage.DataRepresentation ().m_pData[nIndexL].m_aLink.m_nAddr);
+
+ eErrCode = rBIOS.load (aNodeL);
+ if (eErrCode != store_E_None)
+@@ -429,21 +429,21 @@ storeError OStoreBTreeNodeObject::remove
+ #endif /* NYI */
+
+ // Relink.
+- m_rPage.m_pData[nIndexL].m_aKey = rPageL.m_pData[0].m_aKey;
++ m_rPage.DataRepresentation ().m_pData[nIndexL].m_aKey = rPageL.DataRepresentation ().m_pData[0].m_aKey;
+ touch();
+ }
+ }
+ else
+ {
+ // Check leaf entry.
+- if (!(rEntryL.compare (m_rPage.m_pData[nIndexL]) == T::COMPARE_EQUAL))
++ if (!(rEntryL.compare (m_rPage.DataRepresentation ().m_pData[nIndexL]) == T::COMPARE_EQUAL))
+ {
+ rBIOS.releaseLock (aDescr.m_nAddr, aDescr.m_nSize);
+ STORE_METHOD_LEAVE(pMutex, store_E_NotExists);
+ }
+
+ // Save leaf entry.
+- rEntryL = m_rPage.m_pData[nIndexL];
++ rEntryL = m_rPage.DataRepresentation ().m_pData[nIndexL];
+
+ // Remove leaf index.
+ m_rPage.remove (nIndexL);
+@@ -488,7 +488,7 @@ storeError OStoreBTreeRootObject::change
+ STORE_METHOD_ENTER(pMutex);
+
+ // Save PageDescriptor.
+- OStorePageDescriptor aDescr (m_rPage.m_aDescr);
++ OStorePageDescriptor aDescr (m_rPage.PageHeader ().m_aDescr);
+
+ // Acquire Lock.
+ storeError eErrCode = rBIOS.acquireLock (aDescr.m_nAddr, aDescr.m_nSize);
+@@ -507,8 +507,8 @@ storeError OStoreBTreeRootObject::change
+ STORE_METHOD_LEAVE(pMutex, eErrCode);
+ }
+
+- m_rPage.m_pData[0].m_aKey = rPageL.m_pData[0].m_aKey;
+- m_rPage.m_pData[0].m_aLink.m_nAddr = rPageL.location();
++ m_rPage.DataRepresentation ().m_pData[0].m_aKey = rPageL.DataRepresentation ().m_pData[0].m_aKey;
++ m_rPage.DataRepresentation ().m_pData[0].m_aLink.m_nAddr = rPageL.location();
+
+ m_rPage.truncate (1);
+ m_rPage.depth (m_rPage.depth() + 1);
+--- ./store/source/stortree.hxx.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/source/stortree.hxx 2009-04-06 16:42:11.000000000 +0000
+@@ -128,8 +128,15 @@ struct OStoreBTreeNodeData : public stor
+
+ /** Representation.
+ */
+- G m_aGuard;
+- T m_pData[1];
++ struct Representation {
++ G m_aGuard;
++ T m_pData[1];
++ };
++
++ inline Representation& DataRepresentation () const
++ {
++ return *(Representation *) (Data () + base::size ());
++ }
+
+ /** size.
+ */
+@@ -146,7 +153,7 @@ struct OStoreBTreeNodeData : public stor
+ }
+ sal_uInt16 capacity (void) const
+ {
+- return self::capacity (base::m_aDescr);
++ return self::capacity (base::PageHeader ().m_aDescr);
+ }
+
+ /** capacityCount (must be even).
+@@ -164,7 +171,7 @@ struct OStoreBTreeNodeData : public stor
+ }
+ sal_uInt16 usage (void) const
+ {
+- return self::usage (base::m_aDescr);
++ return self::usage (base::PageHeader ().m_aDescr);
+ }
+
+ /** usageCount.
+@@ -175,7 +182,7 @@ struct OStoreBTreeNodeData : public stor
+ }
+ void usageCount (sal_uInt16 nCount)
+ {
+- base::m_aDescr.m_nUsed = base::size() + self::size() +
++ base::PageHeader ().m_aDescr.m_nUsed = base::size() + self::size() +
+ sal_uInt16(nCount * sizeof(T));
+ }
+
+@@ -190,8 +197,8 @@ struct OStoreBTreeNodeData : public stor
+ {
+ base::operator= (rOther);
+
+- m_aGuard = rOther.m_aGuard;
+- rtl_copyMemory (m_pData, rOther.m_pData, capacity());
++ DataRepresentation ().m_aGuard = rOther.DataRepresentation ().m_aGuard;
++ rtl_copyMemory (DataRepresentation ().m_pData, rOther.DataRepresentation ().m_pData, capacity());
+ }
+ return *this;
+ }
+@@ -200,7 +207,7 @@ struct OStoreBTreeNodeData : public stor
+ */
+ sal_Bool operator== (const self& rOther) const
+ {
+- return (base::operator==(rOther) && (m_aGuard == rOther.m_aGuard));
++ return (base::operator==(rOther) && (DataRepresentation ().m_aGuard == rOther.DataRepresentation ().m_aGuard));
+ }
+
+ /** swap (external and internal representation).
+@@ -212,12 +219,12 @@ struct OStoreBTreeNodeData : public stor
+ void guard (const D& rDescr)
+ {
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, m_pData, capacity(rDescr));
++ nCRC32 = G::crc32 (nCRC32, &DataRepresentation ().m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, DataRepresentation ().m_pData, capacity(rDescr));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- m_aGuard.m_nCRC32 = nCRC32;
++ DataRepresentation ().m_aGuard.m_nCRC32 = nCRC32;
+ }
+
+ /** verify (external representation).
+@@ -225,12 +232,12 @@ struct OStoreBTreeNodeData : public stor
+ storeError verify (const D& rDescr)
+ {
+ sal_uInt32 nCRC32 = 0;
+- nCRC32 = G::crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+- nCRC32 = G::crc32 (nCRC32, m_pData, capacity(rDescr));
++ nCRC32 = G::crc32 (nCRC32, &DataRepresentation ().m_aGuard.m_nMagic, sizeof(sal_uInt32));
++ nCRC32 = G::crc32 (nCRC32, DataRepresentation ().m_pData, capacity(rDescr));
+ #ifdef OSL_BIGENDIAN
+ nCRC32 = OSL_SWAPDWORD(nCRC32);
+ #endif /* OSL_BIGENDIAN */
+- if (m_aGuard.m_nCRC32 != nCRC32)
++ if (DataRepresentation ().m_aGuard.m_nCRC32 != nCRC32)
+ return store_E_InvalidChecksum;
+ else
+ return store_E_None;
+@@ -240,11 +247,11 @@ struct OStoreBTreeNodeData : public stor
+ */
+ sal_uInt32 depth (void) const
+ {
+- return self::m_aGuard.m_nMagic;
++ return self::DataRepresentation ().m_aGuard.m_nMagic;
+ }
+ void depth (sal_uInt32 nDepth)
+ {
+- self::m_aGuard.m_nMagic = nDepth;
++ self::DataRepresentation ().m_aGuard.m_nMagic = nDepth;
+ }
+
+ /** queryMerge.
+--- ./store/workben/makefile.mk.old 2009-04-02 10:44:48.000000000 +0000
++++ ./store/workben/makefile.mk 2009-04-06 16:42:11.000000000 +0000
+@@ -62,12 +62,14 @@ CFLAGS+= -I..$/source
+ CXXFILES= \
+ t_file.cxx \
+ t_base.cxx \
+- t_store.cxx
++ t_store.cxx \
++ t_shell.cxx
+
+ OBJFILES= \
+ $(OBJ)$/t_file.obj \
+ $(OBJ)$/t_base.obj \
+- $(OBJ)$/t_store.obj
++ $(OBJ)$/t_store.obj \
++ $(OBJ)$/t_shell.obj
+
+ APP1TARGET= t_file
+ APP1OBJS= $(OBJ)$/t_file.obj
+@@ -93,6 +95,14 @@ APP3DEPN= \
+ $(SLB)$/store.lib \
+ $(L)$/isal.lib
+
++APP4TARGET= t_shell
++APP4OBJS= $(OBJ)$/t_shell.obj
++APP4STDLIBS= $(STORELIB)
++APP4STDLIBS+= $(SALLIB)
++APP4DEPN= \
++ $(SLB)$/store.lib \
++ $(L)$/isal.lib
++
+ # --- Targets ---
+
+ .INCLUDE : target.mk
diff --git a/patches/dev300/crosswin32-store-registry.diff b/patches/dev300/crosswin32-store-registry.diff
new file mode 100644
index 0000000..f5ad173
--- /dev/null
+++ b/patches/dev300/crosswin32-store-registry.diff
@@ -0,0 +1,174 @@
+--- ./registry/inc/registry/registry.h.store-registry~ 2008-07-07 21:53:26.583846279 +0200
++++ ./registry/inc/registry/registry.h 2008-07-07 22:05:39.641847088 +0200
+@@ -410,7 +410,7 @@ RegError REGISTRY_CALLTYPE reg_mergeKey(
+ @return REG_NO_ERROR if succeeds else an error code.
+ */
+ RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registryName,
+- RegHandle* phRegistry);
++ RegHandle* phRegistry, bool bInternal = false);
+
+
+ /** This function opens the root key of a registry.
+--- ./registry/source/regimpl.cxx.store-registry~ 2008-07-07 21:53:24.154848251 +0200
++++ ./registry/source/regimpl.cxx 2008-07-07 22:04:50.955847680 +0200
+@@ -483,7 +483,7 @@ ORegistry::~ORegistry()
+ //*********************************************************************
+ // initRegistry
+ //
+-RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMode)
++RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMode, bool bInternal)
+ {
+ OStoreFile rRegFile;
+ storeAccessMode sAccessMode = REG_MODE_OPEN;
+@@ -506,7 +506,10 @@ RegError ORegistry::initRegistry(const O
+ }
+ else
+ {
+- errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE);
++ if (bInternal)
++ errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE_INTERNAL, REG_RDB_FORMAT_2);
++ else
++ errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE_PUBLIC, REG_RDB_FORMAT_1);
+ }
+
+ if (errCode)
+--- ./registry/source/regimpl.hxx.store-registry~ 2008-04-11 12:50:09.000000000 +0200
++++ ./registry/source/regimpl.hxx 2008-07-07 22:04:50.957847096 +0200
+@@ -36,7 +36,11 @@
+ #include <osl/mutex.hxx>
+ #include <store/store.hxx>
+
+-#define REG_PAGESIZE 512
++#define REG_PAGESIZE_PUBLIC 512
++#define REG_PAGESIZE_INTERNAL 128
++
++#define REG_RDB_FORMAT_1 STORE_FORMAT_V1
++#define REG_RDB_FORMAT_2 STORE_FORMAT_V2
+
+ #define REG_MODE_CREATE store_AccessCreate
+ #define REG_MODE_OPEN store_AccessReadWrite
+@@ -93,7 +97,8 @@ public:
+ { return --m_refCount; }
+
+ RegError initRegistry(const OUString& name,
+- RegAccessMode accessMode);
++ RegAccessMode accessMode,
++ bool bInternal = false);
+
+ RegError closeRegistry();
+
+--- ./registry/source/registry.cxx.store-registry~ 2008-04-11 12:50:37.000000000 +0200
++++ ./registry/source/registry.cxx 2008-07-07 22:04:50.959846582 +0200
+@@ -637,12 +637,13 @@ RegError REGISTRY_CALLTYPE reg_mergeKey(
+ // reg_createRegistry
+ //
+ RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registryName,
+- RegHandle* phRegistry)
++ RegHandle* phRegistry,
++ bool bInternal)
+ {
+ RegError ret;
+
+ ORegistry* pReg = new ORegistry();
+- if ((ret = pReg->initRegistry(registryName, REG_CREATE)))
++ if ((ret = pReg->initRegistry(registryName, REG_CREATE, bInternal)))
+ {
+ *phRegistry = NULL;
+ return ret;
+--- ./registry/tools/regmerge.cxx.store-registry~ 2008-04-11 12:58:26.000000000 +0200
++++ ./registry/tools/regmerge.cxx 2008-07-07 22:04:50.962846684 +0200
+@@ -98,15 +98,16 @@ static void dumpHelp()
+ {
+ fprintf(stderr, "using: regmerge [-v|--verbose] mergefile mergeKeyName regfile_1 ... regfile_n\n");
+ fprintf(stderr, " regmerge @regcmds\nOptions:\n");
+- fprintf(stderr, " -v, --verbose : verbose output on stdout.\n");
+- fprintf(stderr, " mergefile : specifies the merged registry file. If this file doesn't exists,\n");
+- fprintf(stderr, " it is created.\n");
+- fprintf(stderr, " mergeKeyName : specifies the merge key, everything is merged under this key.\n");
+- fprintf(stderr, " If this key doesn't exists, it is created.\n");
+- fprintf(stderr, " regfile_1..n : specifies one or more registry files which are merged.\n");
++ fprintf(stderr, " -i, --internal : use internal private format.\n");
++ fprintf(stderr, " -v, --verbose : verbose output on stdout.\n");
++ fprintf(stderr, " mergefile : specifies the merged registry file. If this file doesn't exists,\n");
++ fprintf(stderr, " it is created.\n");
++ fprintf(stderr, " mergeKeyName : specifies the merge key, everything is merged under this key.\n");
++ fprintf(stderr, " If this key doesn't exists, it is created.\n");
++ fprintf(stderr, " regfile_1..n : specifies one or more registry files which are merged.\n");
+ }
+
+-static bool checkCommandFile(char* cmdfile)
++static bool checkCommandFile(char* cmdfile, bool& bInternal)
+ {
+ FILE *commandfile;
+ char option[256];
+@@ -122,13 +123,17 @@ static bool checkCommandFile(char* cmdfi
+ {
+ if (option[0]== '@')
+ {
+- bool bRet = checkCommandFile(option);
++ bool bRet = checkCommandFile(option, bInternal);
+ // ensure that the option will not be overwritten
+ if ( !bRet )
+ bVerbose = bRet;
+ } else {
+ if (option[0]== '-') {
+- if (strncmp(option, "-v", 2) == 0 ||
++ if (strncmp(option, "-i", 2) == 0 ||
++ strncmp(option, "--internal", 10) == 0)
++ {
++ bInternal = true;
++ } else if (strncmp(option, "-v", 2) == 0 ||
+ strncmp(option, "--verbose", 9) == 0)
+ {
+ bVerbose = true;
+@@ -155,23 +160,28 @@ static bool checkCommandFile(char* cmdfi
+ return bVerbose;
+ }
+
+-static bool checkCommandArgs(int argc, char **argv)
++static bool checkCommandArgs(int argc, char **argv, bool &bInternal)
+ {
+ bool bVerbose = false;
+
++ bInternal = false;
+ realargc = 0;
+
+ for (int i=0; i<argc; i++)
+ {
+ if (argv[i][0]== '@')
+ {
+- bool bRet = checkCommandFile(argv[i]);
++ bool bRet = checkCommandFile(argv[i], bInternal);
+ // ensure that the option will not be overwritten
+ if ( !bRet )
+ bVerbose = bRet;
+ } else {
+ if (argv[i][0]== '-') {
+- if (strncmp(argv[i], "-v", 2) == 0 ||
++ if (strncmp(argv[i], "-i", 2) == 0 ||
++ strncmp(argv[i], "--internal", 10) == 0)
++ {
++ bInternal = true;
++ } else if (strncmp(argv[i], "-v", 2) == 0 ||
+ strncmp(argv[i], "--verbose", 9) == 0)
+ {
+ bVerbose = true;
+@@ -209,7 +219,8 @@ int _cdecl main( int argc, char * argv[]
+ {
+ RegHandle hReg;
+ RegKeyHandle hRootKey;
+- bool bVerbose = checkCommandArgs(argc, argv);
++ bool bInternal;
++ bool bVerbose = checkCommandArgs(argc, argv, bInternal);
+
+ if (realargc < 4)
+ {
+@@ -221,7 +232,7 @@ int _cdecl main( int argc, char * argv[]
+ ::rtl::OUString regName( convertToFileUrl(realargv[1]) );
+ if (reg_openRegistry(regName.pData, &hReg, REG_READWRITE))
+ {
+- if (reg_createRegistry(regName.pData, &hReg))
++ if (reg_createRegistry(regName.pData, &hReg, bInternal))
+ {
+ if (bVerbose)
+ fprintf(stderr, "open registry \"%s\" failed\n", realargv[1]);
diff --git a/patches/dev300/crosswin32-svtools-minimal.diff b/patches/dev300/crosswin32-svtools-minimal.diff
new file mode 100644
index 0000000..cb648c1
--- /dev/null
+++ b/patches/dev300/crosswin32-svtools-minimal.diff
@@ -0,0 +1,84 @@
+--- ./svtools/prj/build.lst.orig 2009-04-22 10:45:50.410216382 +0200
++++ ./svtools/prj/build.lst 2009-04-22 10:50:17.342826747 +0200
+@@ -9,46 +9,46 @@ st svtools\win\res get - all st_wres
+ st svtools\os2\inc get - all st_oinc NULL
+ st svtools\mac\inc get - all st_minc NULL
+ st svtools\unx\inc get - all st_uinc NULL
+-st svtools\bmpmaker nmake - all st_bmp st_inc NULL
++#st svtools\bmpmaker nmake - all st_bmp st_inc NULL
+ st svtools\source\memtools nmake - all st_mem st_inc NULL
+-st svtools\source\numbers nmake - all st_num st_inc NULL
++#st svtools\source\numbers nmake - all st_num st_inc NULL
+ st svtools\source\notify nmake - all st_not st_inc NULL
+ st svtools\source\config nmake - all st_conf st_inc NULL
+-st svtools\unx\source\svdde nmake - u st_usdde st_inc NULL
+-st svtools\unx\source\svdde nmake - p st_psdde st_inc NULL
+-st svtools\mac\source\svdde nmake - m st_msdde st_inc NULL
+-st svtools\mac\source\misc nmake - m st_msc st_inc NULL
+-st svtools\source\control nmake - all st_ctl st_inc NULL
++#st svtools\unx\source\svdde nmake - u st_usdde st_inc NULL
++#st svtools\unx\source\svdde nmake - p st_psdde st_inc NULL
++#st svtools\mac\source\svdde nmake - m st_msdde st_inc NULL
++#st svtools\mac\source\misc nmake - m st_msc st_inc NULL
++#st svtools\source\control nmake - all st_ctl st_inc NULL
+ st svtools\source\filerec nmake - all st_file st_inc NULL
+-st svtools\source\filter.vcl\filter nmake - all st_vfilt st_inc NULL
+-st svtools\source\filter.vcl\wmf nmake - all st_vwmf st_inc NULL
+-st svtools\source\filter.vcl\igif nmake - all st_vigif st_inc NULL
+-st svtools\source\filter.vcl\jpeg nmake - all st_vjpeg st_inc NULL
+-st svtools\source\filter.vcl\ixbm nmake - all st_vixbm st_inc NULL
+-st svtools\source\filter.vcl\ixpm nmake - all st_vixpm st_inc NULL
+-st svtools\source\brwbox nmake - all st__brw st_bmp st_inc NULL
+-st svtools\source\urlobj nmake - all st__url st_inc NULL
+-st svtools\source\misc nmake - all st__misc st_bmp st_inc NULL
++#st svtools\source\filter.vcl\filter nmake - all st_vfilt st_inc NULL
++#st svtools\source\filter.vcl\wmf nmake - all st_vwmf st_inc NULL
++#st svtools\source\filter.vcl\igif nmake - all st_vigif st_inc NULL
++#st svtools\source\filter.vcl\jpeg nmake - all st_vjpeg st_inc NULL
++#st svtools\source\filter.vcl\ixbm nmake - all st_vixbm st_inc NULL
++#st svtools\source\filter.vcl\ixpm nmake - all st_vixpm st_inc NULL
++#st svtools\source\brwbox nmake - all st__brw st_bmp st_inc NULL
++#st svtools\source\urlobj nmake - all st__url st_inc NULL
++#st svtools\source\misc nmake - all st__misc st_bmp st_inc NULL
+ st svtools\source\misc1 nmake - all st__misc1 st_inc NULL
+-st svtools\source\contnr nmake - all st__ctr st_inc NULL
+-st svtools\source\svdde nmake - all st__dde st_inc NULL
+-st svtools\source\items nmake - all st__item st_inc NULL
++#st svtools\source\contnr nmake - all st__ctr st_inc NULL
++#st svtools\source\svdde nmake - all st__dde st_inc NULL
++#st svtools\source\items nmake - all st__item st_inc NULL
+ st svtools\source\items1 nmake - all st__item1 st_inc NULL
+-st svtools\source\undo nmake - all st_undo st_inc NULL
+-st svtools\source\plugapp nmake - all st_papp st_inc NULL
+-st svtools\source\dialogs nmake - all st_dial st_inc NULL
+-st svtools\source\edit nmake - all st_edit st_inc NULL
+-st svtools\source\uno nmake - all st_uno st_inc NULL
+-st svtools\source\svrtf nmake - all st_rtf st_inc NULL
++#st svtools\source\undo nmake - all st_undo st_inc NULL
++#st svtools\source\plugapp nmake - all st_papp st_inc NULL
++#st svtools\source\dialogs nmake - all st_dial st_inc NULL
++#st svtools\source\edit nmake - all st_edit st_inc NULL
++#st svtools\source\uno nmake - all st_uno st_inc NULL
++#st svtools\source\svrtf nmake - all st_rtf st_inc NULL
+ st svtools\source\svsql nmake - all st_sql st_inc NULL
+-st svtools\source\svhtml nmake - all st_html st_inc NULL
+-st svtools\source\syslocale nmake - all st_sysloc st_inc NULL
++#st svtools\source\svhtml nmake - all st_html st_inc NULL
++#st svtools\source\syslocale nmake - all st_sysloc st_inc NULL
+ st svtools\source\filepicker nmake - all st_filepick st_inc NULL
+-st svtools\util nmake - all st_util st__brw st__ctr st__dde st__item st__item1 st__misc st__misc1 st__url st_ctl st_dial st_edit st_file st_html st_papp st_rtf st_sql st_usdde.u st_psdde.p st_msdde.m st_msc.m st_undo st_uno st_vfilt st_vigif st_vixbm st_vixpm st_vjpeg st_vwmf st_sysloc st_filepick st_not st_conf st_mem st_num st_svtjava NULL
+-st svtools\source\fsstor nmake - all st_fsstor st_inc NULL
+-st svtools\source\hatchwindow nmake - all st_hatchwin st_inc NULL
+-st svtools\source\passwordcontainer nmake - all st_passcont st_inc NULL
+-st svtools\source\productregistration nmake - all st_prodreg st_util st_inc NULL
+-st svtools\uno nmake - all st_svtuno st_util st_inc NULL
+-st svtools\source\java nmake - all st_svtjava st_inc NULL
+-st svtools\workben\unodialog nmake - all st_workben_udlg st_util NULL
++#st svtools\util nmake - all st_util st__brw st__ctr st__dde st__item st__item1 st__misc st__misc1 st__url st_ctl st_dial st_edit st_file st_html st_papp st_rtf st_sql st_usdde.u st_psdde.p st_msdde.m st_msc.m st_undo st_uno st_vfilt st_vigif st_vixbm st_vixpm st_vjpeg st_vwmf st_sysloc st_filepick st_not st_conf st_mem st_num st_svtjava NULL
++#st svtools\source\fsstor nmake - all st_fsstor st_inc NULL
++#st svtools\source\hatchwindow nmake - all st_hatchwin st_inc NULL
++#st svtools\source\passwordcontainer nmake - all st_passcont st_inc NULL
++#st svtools\source\productregistration nmake - all st_prodreg st_util st_inc NULL
++#st svtools\uno nmake - all st_svtuno st_util st_inc NULL
++#st svtools\source\java nmake - all st_svtjava st_inc NULL
++#st svtools\workben\unodialog nmake - all st_workben_udlg st_util NULL
diff --git a/patches/dev300/crosswin32-svx-mingw.diff b/patches/dev300/crosswin32-svx-mingw.diff
new file mode 100644
index 0000000..1eb9240
--- /dev/null
+++ b/patches/dev300/crosswin32-svx-mingw.diff
@@ -0,0 +1,24 @@
+--- svx/source/dialog/winpluginlib.cpp.~1.6.~ 2008-04-11 02:19:15.000000000 +0200
++++ svx/source/dialog/winpluginlib.cpp 2008-11-04 13:43:32.000000000 +0100
+@@ -39,8 +39,8 @@
+ #if defined _MSC_VER
+ #pragma warning(pop)
+ #endif
+-#include <Winreg.h>
+-#include <Shlwapi.h>
++#include <winreg.h>
++#include <shlwapi.h>
+ #include <stdio.h>
+
+
+--- svx/source/engine3d/scene3d.cxx.pristine 2009-02-16 10:47:03.000000000 +0100
++++ svx/source/engine3d/scene3d.cxx 2009-02-16 10:45:14.000000000 +0100
+@@ -260,7 +260,7 @@ void E3dScene::SetDefaultAttributes(E3dD
+ #endif
+
+ // Fuer WIN95/NT die FP-Exceptions abschalten
+-#if defined(WNT) || defined(WIN)
++#if (defined(WNT) || defined(WIN)) && !defined (__MINGW32__)
+ #define SC_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 )
+ #define SC_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM )
+ SC_FPEXCEPTIONS_OFF();
diff --git a/patches/dev300/crosswin32-sysui-mingw.diff b/patches/dev300/crosswin32-sysui-mingw.diff
new file mode 100644
index 0000000..7fe7db1
--- /dev/null
+++ b/patches/dev300/crosswin32-sysui-mingw.diff
@@ -0,0 +1,10 @@
+--- sysui/source/win32/QuickStart/QuickStart.cpp.~1.7.~ 2006-06-20 07:01:42.000000000 +0200
++++ sysui/source/win32/QuickStart/QuickStart.cpp 2008-10-29 17:12:35.000000000 +0100
+@@ -1,7 +1,6 @@
+ // QuickStart.cpp : Defines the entry point for the application.
+ //
+
+-#include "stdafx.h"
+ #include "resource.h"
+ #include <systools/win32/uwinapi.h>
+ #include <stdio.h>
diff --git a/patches/dev300/crosswin32-tools-mingw.diff b/patches/dev300/crosswin32-tools-mingw.diff
new file mode 100644
index 0000000..bac8f7a
--- /dev/null
+++ b/patches/dev300/crosswin32-tools-mingw.diff
@@ -0,0 +1,28 @@
+--- tools/source/fsys/wntmsc.hxx.pristine 2008-10-29 23:44:36.000000000 +0100
++++ tools/source/fsys/wntmsc.hxx 2008-10-28 19:13:59.000000000 +0100
+@@ -36,8 +36,8 @@
+ #ifndef ICC
+ #include <io.h>
+ #endif
+-#include <sys\types.h>
+-#include <sys\stat.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ #include <direct.h>
+
+ #include <tools/svwin.h>
+--- tools/inc/tools/solar.h.pristine 2008-10-29 23:44:36.000000000 +0100
++++ tools/inc/tools/solar.h 2008-10-31 12:54:34.000000000 +0100
+@@ -57,6 +57,12 @@
+ /* Previous typedefs from before sal convergence are in comments */
+ /* to the right of the new types. */
+
++#ifdef __MINGW32__
++#undef BOOL
++#undef INT32
++#undef UINT32
++#endif /* __MINGW32__ */
++
+ typedef sal_Bool BOOL; /* typedef unsigned char BOOL; */
+ typedef sal_uInt8 BYTE; /* typedef unsigned char BYTE; */
+ typedef sal_uInt16 USHORT; /* typedef unsigned short USHORT; */
diff --git a/patches/dev300/crosswin32-unotools-mingw.diff b/patches/dev300/crosswin32-unotools-mingw.diff
new file mode 100644
index 0000000..eab7dda
--- /dev/null
+++ b/patches/dev300/crosswin32-unotools-mingw.diff
@@ -0,0 +1,10 @@
+--- unotools/inc/unotools/ucbhelper.hxx.~1.11.~ 2008-04-11 15:18:03.000000000 +0200
++++ unotools/inc/unotools/ucbhelper.hxx 2008-10-31 15:14:34.000000000 +0100
+@@ -35,6 +35,7 @@
+ // include ---------------------------------------------------------------
+ #include <com/sun/star/uno/Sequence.hxx>
+ #include <com/sun/star/uno/Reference.hxx>
++#undef ERROR
+ #include <com/sun/star/ucb/NameClash.hpp>
+ #include <com/sun/star/ucb/XContentProvider.hpp>
+
diff --git a/patches/dev300/crosswin32-vcl-mingw.diff b/patches/dev300/crosswin32-vcl-mingw.diff
new file mode 100644
index 0000000..3a540cc
--- /dev/null
+++ b/patches/dev300/crosswin32-vcl-mingw.diff
@@ -0,0 +1,424 @@
+--- vcl/win/source/app/saltimer.cxx.pristine 2008-10-30 13:15:44.000000000 +0100
++++ vcl/win/source/app/saltimer.cxx 2008-10-30 13:13:16.000000000 +0100
+@@ -32,7 +32,7 @@
+ #include "precompiled_vcl.hxx"
+ #include <tools/svwin.h>
+ #ifdef __MINGW32__
+-#include <excpt.h>
++#include <sehandler.h>
+ #endif
+ #include <saldata.hxx>
+ #include <saltimer.h>
+--- vcl/win/source/app/salinst.cxx.pristine 2009-02-18 16:18:51.000000000 +0100
++++ vcl/win/source/app/salinst.cxx 2009-04-04 16:28:58.940770892 +0200
+@@ -37,7 +37,7 @@
+ #include <process.h>
+ #endif
+ #ifdef __MINGW32__
+-#include <excpt.h>
++#include <sehandler.h>
+ #endif
+
+ #include <vos/mutex.hxx>
+@@ -67,9 +67,11 @@
+ #pragma warning(push, 1)
+ #endif
+
++#ifndef __MINGW32__
+ #include <GdiPlus.h>
+ #include <GdiPlusEnums.h>
+ #include <GdiPlusColor.h>
++#endif /* __MINGW32__ */
+
+ #if defined _MSC_VER
+ #pragma warning(pop)
+@@ -456,10 +458,12 @@ void InitSalData()
+ {
+ SalData* pSalData = new SalData;
+ CoInitialize(0);
+
++#ifndef __MINGW32__
+ // init GDIPlus
+ static Gdiplus::GdiplusStartupInput gdiplusStartupInput;
+ Gdiplus::GdiplusStartup(&pSalData->gdiplusToken, &gdiplusStartupInput, NULL);
++#endif /* __MINGW32__ */
+ }
+
+
+@@ -468,11 +471,13 @@ void DeInitSalData()
+ CoUninitialize();
+ SalData* pSalData = GetSalData();
+
++#ifndef __MINGW32__
+ // deinit GDIPlus
+ if(pSalData)
+ {
+ Gdiplus::GdiplusShutdown(pSalData->gdiplusToken);
+ }
++#endif /* __MINGW32__ */
+
+ delete pSalData;
+ }
+--- vcl/win/source/src/salsrc.rc.pristine 2008-10-30 13:51:23.000000000 +0100
++++ vcl/win/source/src/salsrc.rc 2008-10-30 13:53:31.000000000 +0100
+@@ -35,90 +35,90 @@
+ #include <salids.hrc>
+ #endif
+
+-SAL_RESID_POINTER_NULL CURSOR NULLPTR.CUR
++SAL_RESID_POINTER_NULL CURSOR nullptr.cur
+ #if ( WINVER < 0x0400 )
+-SAL_RESID_POINTER_HELP CURSOR HELP.CUR
++SAL_RESID_POINTER_HELP CURSOR help.cur
+ #endif
+ #ifndef WNT
+-SAL_RESID_POINTER_HSIZE CURSOR HSIZE.CUR
+-SAL_RESID_POINTER_VSIZE CURSOR VSIZE.CUR
+-SAL_RESID_POINTER_NESWSIZE CURSOR NESWSIZE.CUR
+-SAL_RESID_POINTER_NWSESIZE CURSOR NWSESIZE.CUR
++SAL_RESID_POINTER_HSIZE CURSOR hsize.cur
++SAL_RESID_POINTER_VSIZE CURSOR vsize.cur
++SAL_RESID_POINTER_NESWSIZE CURSOR neswsize.cur
++SAL_RESID_POINTER_NWSESIZE CURSOR nwsesize.cur
+ #endif
+-SAL_RESID_POINTER_CROSS CURSOR CROSS.CUR
+-SAL_RESID_POINTER_MOVE CURSOR MOVE.CUR
+-SAL_RESID_POINTER_HSPLIT CURSOR HSPLIT.CUR
+-SAL_RESID_POINTER_VSPLIT CURSOR VSPLIT.CUR
+-SAL_RESID_POINTER_HSIZEBAR CURSOR HSIZEBAR.CUR
+-SAL_RESID_POINTER_VSIZEBAR CURSOR VSIZEBAR.CUR
+-SAL_RESID_POINTER_HAND CURSOR HAND.CUR
+-SAL_RESID_POINTER_REFHAND CURSOR REFHAND.CUR
+-SAL_RESID_POINTER_PEN CURSOR PEN.CUR
+-SAL_RESID_POINTER_MAGNIFY CURSOR MAGNIFY.CUR
+-SAL_RESID_POINTER_FILL CURSOR FILL.CUR
+-SAL_RESID_POINTER_ROTATE CURSOR ROTATE.CUR
+-SAL_RESID_POINTER_HSHEAR CURSOR HSHEAR.CUR
+-SAL_RESID_POINTER_VSHEAR CURSOR VSHEAR.CUR
+-SAL_RESID_POINTER_MIRROR CURSOR MIRROR.CUR
+-SAL_RESID_POINTER_CROOK CURSOR CROOK.CUR
+-SAL_RESID_POINTER_CROP CURSOR CROP.CUR
+-SAL_RESID_POINTER_MOVEPOINT CURSOR MOVEPT.CUR
+-SAL_RESID_POINTER_MOVEBEZIERWEIGHT CURSOR MOVEBW.CUR
+-SAL_RESID_POINTER_MOVEDATA CURSOR MOVEDATA.CUR
+-SAL_RESID_POINTER_COPYDATA CURSOR COPYDATA.CUR
+-SAL_RESID_POINTER_LINKDATA CURSOR LINKDATA.CUR
+-SAL_RESID_POINTER_MOVEDATALINK CURSOR MOVEDLNK.CUR
+-SAL_RESID_POINTER_COPYDATALINK CURSOR COPYDLNK.CUR
+-SAL_RESID_POINTER_MOVEFILE CURSOR MOVEF.CUR
+-SAL_RESID_POINTER_COPYFILE CURSOR COPYF.CUR
+-SAL_RESID_POINTER_LINKFILE CURSOR LINKF.CUR
+-SAL_RESID_POINTER_MOVEFILELINK CURSOR MOVEFLNK.CUR
+-SAL_RESID_POINTER_COPYFILELINK CURSOR COPYFLNK.CUR
+-SAL_RESID_POINTER_MOVEFILES CURSOR MOVEF2.CUR
+-SAL_RESID_POINTER_COPYFILES CURSOR COPYF2.CUR
+-SAL_RESID_POINTER_NOTALLOWED CURSOR NOTALLOW.CUR
+-SAL_RESID_POINTER_DRAW_LINE CURSOR DLINE.CUR
+-SAL_RESID_POINTER_DRAW_RECT CURSOR DRECT.CUR
+-SAL_RESID_POINTER_DRAW_POLYGON CURSOR DPOLYGON.CUR
+-SAL_RESID_POINTER_DRAW_BEZIER CURSOR DBEZIER.CUR
+-SAL_RESID_POINTER_DRAW_ARC CURSOR DARC.CUR
+-SAL_RESID_POINTER_DRAW_PIE CURSOR DPIE.CUR
+-SAL_RESID_POINTER_DRAW_CIRCLECUT CURSOR DCIRCCUT.CUR
+-SAL_RESID_POINTER_DRAW_ELLIPSE CURSOR DELLIPSE.CUR
+-SAL_RESID_POINTER_DRAW_FREEHAND CURSOR DFREE.CUR
+-SAL_RESID_POINTER_DRAW_CONNECT CURSOR DCONNECT.CUR
+-SAL_RESID_POINTER_DRAW_TEXT CURSOR DTEXT.CUR
+-SAL_RESID_POINTER_DRAW_CAPTION CURSOR DCAPT.CUR
+-SAL_RESID_POINTER_CHART CURSOR CHART.CUR
+-SAL_RESID_POINTER_DETECTIVE CURSOR DETECTIV.CUR
+-SAL_RESID_POINTER_PIVOT_COL CURSOR PIVOTCOL.CUR
+-SAL_RESID_POINTER_PIVOT_ROW CURSOR PIVOTROW.CUR
+-SAL_RESID_POINTER_PIVOT_FIELD CURSOR PIVOTFLD.CUR
+-SAL_RESID_POINTER_PIVOT_DELETE CURSOR PIVOTDEL.CUR
+-SAL_RESID_POINTER_CHAIN CURSOR CHAIN.CUR
+-SAL_RESID_POINTER_CHAIN_NOTALLOWED CURSOR CHAINNOT.CUR
+-SAL_RESID_POINTER_TIMEEVENT_MOVE CURSOR TIMEMOVE.CUR
+-SAL_RESID_POINTER_TIMEEVENT_SIZE CURSOR TIMESIZE.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_N CURSOR ASN.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_S CURSOR ASS.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_W CURSOR ASW.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_E CURSOR ASE.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_NW CURSOR ASNW.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_NE CURSOR ASNE.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_SW CURSOR ASSW.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_SE CURSOR ASSE.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_NS CURSOR ASNS.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_WE CURSOR ASWE.CUR
+-SAL_RESID_POINTER_AUTOSCROLL_NSWE CURSOR ASNSWE.CUR
+-SAL_RESID_POINTER_AIRBRUSH CURSOR AIRBRUSH.CUR
+-SAL_RESID_POINTER_TEXT_VERTICAL CURSOR VTEXT.CUR
+-SAL_RESID_POINTER_TAB_SELECT_S CURSOR TBLSELS.CUR
+-SAL_RESID_POINTER_TAB_SELECT_E CURSOR TBLSELE.CUR
+-SAL_RESID_POINTER_TAB_SELECT_SE CURSOR TBLSELSE.CUR
+-SAL_RESID_POINTER_TAB_SELECT_W CURSOR TBLSELW.CUR
+-SAL_RESID_POINTER_TAB_SELECT_SW CURSOR TBLSELSW.CUR
+-SAL_RESID_POINTER_PAINTBRUSH CURSOR PNTBRSH.CUR
++SAL_RESID_POINTER_CROSS CURSOR cross.cur
++SAL_RESID_POINTER_MOVE CURSOR move.cur
++SAL_RESID_POINTER_HSPLIT CURSOR hsplit.cur
++SAL_RESID_POINTER_VSPLIT CURSOR vsplit.cur
++SAL_RESID_POINTER_HSIZEBAR CURSOR hsizebar.cur
++SAL_RESID_POINTER_VSIZEBAR CURSOR vsizebar.cur
++SAL_RESID_POINTER_HAND CURSOR hand.cur
++SAL_RESID_POINTER_REFHAND CURSOR refhand.cur
++SAL_RESID_POINTER_PEN CURSOR pen.cur
++SAL_RESID_POINTER_MAGNIFY CURSOR magnify.cur
++SAL_RESID_POINTER_FILL CURSOR fill.cur
++SAL_RESID_POINTER_ROTATE CURSOR rotate.cur
++SAL_RESID_POINTER_HSHEAR CURSOR hshear.cur
++SAL_RESID_POINTER_VSHEAR CURSOR vshear.cur
++SAL_RESID_POINTER_MIRROR CURSOR mirror.cur
++SAL_RESID_POINTER_CROOK CURSOR crook.cur
++SAL_RESID_POINTER_CROP CURSOR crop.cur
++SAL_RESID_POINTER_MOVEPOINT CURSOR movept.cur
++SAL_RESID_POINTER_MOVEBEZIERWEIGHT CURSOR movebw.cur
++SAL_RESID_POINTER_MOVEDATA CURSOR movedata.cur
++SAL_RESID_POINTER_COPYDATA CURSOR copydata.cur
++SAL_RESID_POINTER_LINKDATA CURSOR linkdata.cur
++SAL_RESID_POINTER_MOVEDATALINK CURSOR movedlnk.cur
++SAL_RESID_POINTER_COPYDATALINK CURSOR copydlnk.cur
++SAL_RESID_POINTER_MOVEFILE CURSOR movef.cur
++SAL_RESID_POINTER_COPYFILE CURSOR copyf.cur
++SAL_RESID_POINTER_LINKFILE CURSOR linkf.cur
++SAL_RESID_POINTER_MOVEFILELINK CURSOR moveflnk.cur
++SAL_RESID_POINTER_COPYFILELINK CURSOR copyflnk.cur
++SAL_RESID_POINTER_MOVEFILES CURSOR movef2.cur
++SAL_RESID_POINTER_COPYFILES CURSOR copyf2.cur
++SAL_RESID_POINTER_NOTALLOWED CURSOR notallow.cur
++SAL_RESID_POINTER_DRAW_LINE CURSOR dline.cur
++SAL_RESID_POINTER_DRAW_RECT CURSOR drect.cur
++SAL_RESID_POINTER_DRAW_POLYGON CURSOR dpolygon.cur
++SAL_RESID_POINTER_DRAW_BEZIER CURSOR dbezier.cur
++SAL_RESID_POINTER_DRAW_ARC CURSOR darc.cur
++SAL_RESID_POINTER_DRAW_PIE CURSOR dpie.cur
++SAL_RESID_POINTER_DRAW_CIRCLECUT CURSOR dcirccut.cur
++SAL_RESID_POINTER_DRAW_ELLIPSE CURSOR dellipse.cur
++SAL_RESID_POINTER_DRAW_FREEHAND CURSOR dfree.cur
++SAL_RESID_POINTER_DRAW_CONNECT CURSOR dconnect.cur
++SAL_RESID_POINTER_DRAW_TEXT CURSOR dtext.cur
++SAL_RESID_POINTER_DRAW_CAPTION CURSOR dcapt.cur
++SAL_RESID_POINTER_CHART CURSOR chart.cur
++SAL_RESID_POINTER_DETECTIVE CURSOR detectiv.cur
++SAL_RESID_POINTER_PIVOT_COL CURSOR pivotcol.cur
++SAL_RESID_POINTER_PIVOT_ROW CURSOR pivotrow.cur
++SAL_RESID_POINTER_PIVOT_FIELD CURSOR pivotfld.cur
++SAL_RESID_POINTER_PIVOT_DELETE CURSOR pivotdel.cur
++SAL_RESID_POINTER_CHAIN CURSOR chain.cur
++SAL_RESID_POINTER_CHAIN_NOTALLOWED CURSOR chainnot.cur
++SAL_RESID_POINTER_TIMEEVENT_MOVE CURSOR timemove.cur
++SAL_RESID_POINTER_TIMEEVENT_SIZE CURSOR timesize.cur
++SAL_RESID_POINTER_AUTOSCROLL_N CURSOR asn.cur
++SAL_RESID_POINTER_AUTOSCROLL_S CURSOR ass.cur
++SAL_RESID_POINTER_AUTOSCROLL_W CURSOR asw.cur
++SAL_RESID_POINTER_AUTOSCROLL_E CURSOR ase.cur
++SAL_RESID_POINTER_AUTOSCROLL_NW CURSOR asnw.cur
++SAL_RESID_POINTER_AUTOSCROLL_NE CURSOR asne.cur
++SAL_RESID_POINTER_AUTOSCROLL_SW CURSOR assw.cur
++SAL_RESID_POINTER_AUTOSCROLL_SE CURSOR asse.cur
++SAL_RESID_POINTER_AUTOSCROLL_NS CURSOR asns.cur
++SAL_RESID_POINTER_AUTOSCROLL_WE CURSOR aswe.cur
++SAL_RESID_POINTER_AUTOSCROLL_NSWE CURSOR asnswe.cur
++SAL_RESID_POINTER_AIRBRUSH CURSOR airbrush.cur
++SAL_RESID_POINTER_TEXT_VERTICAL CURSOR vtext.cur
++SAL_RESID_POINTER_TAB_SELECT_S CURSOR tblsels.cur
++SAL_RESID_POINTER_TAB_SELECT_E CURSOR tblsele.cur
++SAL_RESID_POINTER_TAB_SELECT_SE CURSOR tblselse.cur
++SAL_RESID_POINTER_TAB_SELECT_W CURSOR tblselw.cur
++SAL_RESID_POINTER_TAB_SELECT_SW CURSOR tblselsw.cur
++SAL_RESID_POINTER_PAINTBRUSH CURSOR pntbrsh.cur
+
+-SAL_RESID_BITMAP_50 BITMAP 50.BMP
++SAL_RESID_BITMAP_50 BITMAP 50.bmp
+
+-SAL_RESID_ICON_DEFAULT ICON SD.ICO
++SAL_RESID_ICON_DEFAULT ICON sd.ico
+--- vcl/win/source/gdi/salnativewidgets-luna.cxx.pristine 2008-10-30 13:50:29.000000000 +0100
++++ vcl/win/source/gdi/salnativewidgets-luna.cxx 2008-10-30 13:49:24.000000000 +0100
+@@ -31,6 +31,11 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_vcl.hxx"
+
++#ifdef __MINGW32__
++#undef WINVER
++#define WINVER 0x0501
++#endif /* __MINGW32__ */
++
+ #define _SV_SALNATIVEWIDGETS_CXX
+
+ #include "svsys.h"
+--- vcl/win/source/gdi/winlayout.cxx.pristine 2008-10-30 13:43:54.000000000 +0100
++++ vcl/win/source/gdi/winlayout.cxx 2008-10-30 13:43:46.000000000 +0100
+@@ -55,8 +55,8 @@
+ #include <vcl/svapp.hxx>
+
+ #ifdef USE_UNISCRIBE
+-#include <Usp10.h>
+-#include <ShLwApi.h>
++#include <usp10.h>
++#include <shlwapi.h>
+ #include <winver.h>
+ #endif // USE_UNISCRIBE
+
+--- vcl/win/source/gdi/salprn.cxx.pristine 2008-10-30 13:15:44.000000000 +0100
++++ vcl/win/source/gdi/salprn.cxx 2008-10-30 13:42:47.000000000 +0100
+@@ -35,8 +35,11 @@
+ #include <tools/svwin.h>
+
+ #ifdef __MINGW32__
+-#include <excpt.h>
+-#endif
++#undef WINVER
++#define WINVER 0x500
++#include <sehandler.h>
++#define DC_COLLATE 23
++#endif /* __MINGW32__ */
+
+ #ifndef _OSL_MODULE_H
+ #include <osl/module.h>
+--- vcl/win/source/gdi/salgdi2.cxx.pristine 2008-10-30 13:44:20.000000000 +0100
++++ vcl/win/source/gdi/salgdi2.cxx 2008-10-30 13:36:43.000000000 +0100
+@@ -31,8 +31,14 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_vcl.hxx"
+
++#ifdef __MINGW32__
++#undef WINVER
++#define WINVER 0x410
++#endif /* __MINGW32__ */
++
+ #include <string.h>
+ #include <stdlib.h>
++
+ #include <tools/svwin.h>
+ #include <tools/debug.hxx>
+ #include <wincomp.hxx>
+@@ -44,6 +50,7 @@
+ #include <salgdi.h>
+ #include <salframe.h>
+
++
+ bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
+ {
+ bool bRet = false;
+--- vcl/win/source/gdi/salgdi3.cxx.pristine 2008-10-30 13:44:13.000000000 +0100
++++ vcl/win/source/gdi/salgdi3.cxx 2008-10-30 13:37:53.000000000 +0100
+@@ -31,6 +31,11 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_vcl.hxx"
+
++#ifdef __MINGW32__
++#undef WINVER
++#define WINVER 0x500
++#endif /* __MINGW32__ */
++
+ #include <string.h>
+ #include <malloc.h>
+ #include <tools/svwin.h>
+--- vcl/win/source/window/salframe.cxx.pristine 2009-04-03 21:43:22.740500000 +0200
++++ vcl/win/source/window/salframe.cxx 2009-04-04 19:52:21.487998727 +0200
+@@ -52,7 +52,12 @@
+ #include <tools/svwin.h>
+ #endif
+ #ifdef __MINGW32__
+-#include <excpt.h>
++#include <sehandler.h>
++typedef struct tagRECONVERTSTRING FAR *LPRECONVERTSTRING;
++#define SCS_CAP_SETRECONVERTSTRING 0x00000004
++#define SCS_QUERYRECONVERTSTRING 0x00020000
++#define SCS_SETRECONVERTSTRING 0x00010000
++#define IMR_CONFIRMRECONVERTSTRING 0x0005
+ #endif
+ #include <rtl/string.h>
+ #include <rtl/ustring.h>
+@@ -93,8 +98,10 @@
+ #ifndef _VCL_IMPDEL_HXX
+ #include <impdel.hxx>
+ #endif
++#ifndef __MINGW32__
+ #define COMPILE_MULTIMON_STUBS
+ #include <multimon.h>
++#endif /* __MINGW32__ */
+ #include <vector>
+ #ifdef __MINGW32__
+ #include <algorithm>
+@@ -884,6 +891,7 @@ static void ImplSalCalcFullScreenSize( c
+ else
+ nCaptionY = 0;
+
++#ifndef __MINGW32__
+ try
+ {
+ Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+@@ -911,7 +919,7 @@ static void ImplSalCalcFullScreenSize( c
+ catch( Exception& )
+ {
+ }
+-
++#endif /* __MINGW32__ */
+ if( !nScreenDX || !nScreenDY )
+ {
+ nScreenDX = GetSystemMetrics( SM_CXSCREEN );
+@@ -5640,6 +5648,7 @@ static BOOL ImplHandleIMEEndComposition(
+ static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam )
+ {
+ sal_Int16 nCommand = 0;
++#ifndef __MINGW32__
+ switch( GET_APPCOMMAND_LPARAM(lParam) )
+ {
+ case APPCOMMAND_MEDIA_CHANNEL_DOWN: nCommand = MEDIA_COMMAND_CHANNEL_DOWN; break;
+@@ -5663,7 +5672,7 @@ static boolean ImplHandleAppCommand( HWN
+ default:
+ return false;
+ }
+-
++#endif /* __MINGW32__ */
+ WinSalFrame* pFrame = GetWindowPtr( hWnd );
+ Window *pWindow = pFrame ? pFrame->GetWindow() : NULL;
+
+--- vcl/util/makefile.mk.pristine 2009-04-04 19:55:53.764002766 +0200
++++ vcl/util/makefile.mk 2009-04-04 19:55:42.260224623 +0200
+@@ -229,13 +229,16 @@ SHL1STDLIBS += $(PSPLIB)
+
+ SHL1STDLIBS += $(UWINAPILIB) \
+ $(GDI32LIB) \
+- $(GDIPLUSLIB) \
+ $(MSIMG32LIB) \
+ $(WINSPOOLLIB) \
+ $(OLE32LIB) \
+ $(SHELL32LIB) \
+ $(ADVAPI32LIB)
+
++.IF "$(CROSS_COMPILING)" != "yes"
++SHL1STDLIBS += $(GDIPLUSLIB)
++.ENDIF # "$(CROSS_COMPILING)" != "yes"
++
+ .IF "$(COM)" == "GCC"
+ SHL1STDLIBS += $(IMM32LIB)
+ .ELSE
+--- vcl/win/source/gdi/salgdi_gdiplus.cxx.pristine 2009-04-04 20:44:51.940500589 +0200
++++ vcl/win/source/gdi/salgdi_gdiplus.cxx 2009-04-04 20:46:19.256479562 +0200
+@@ -39,6 +39,18 @@
+ #include <salgdi.h>
+ #include <tools/debug.hxx>
+
++#ifdef __MINGW32__
++bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double)
++{
++ return false;
++}
++
++bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon&, const basegfx::B2DVector&, basegfx::B2DLineJoin)
++{
++ return false;
++}
++#else /* !__MINGW32__ */
++
+ #ifndef min
+ #define min(a,b) (((a) < (b)) ? (a) : (b))
+ #endif
+@@ -193,3 +205,4 @@ bool WinSalGraphics::drawPolyLine(const
+ }
+
+ // -----------------------------------------------------------------------
++#endif /* !__MINGW32__ */
commit 8c3b23f0caebb764336c7ee0015f9ec34a85fd1e
Author: Jesús Corrius <jesus at softcatala.org>
Date: Mon Jun 29 10:35:25 2009 +0200
Merging Jesus' work from Friday, 26th of June 2009
diff --git a/configure.in b/configure.in
index 18f890d..c5430e1 100644
--- a/configure.in
+++ b/configure.in
@@ -612,6 +612,7 @@ VENDORNAME=OpenOffice
case $DISTRO in
ArchLinux*) VENDORNAME="ArchLinux" ;;
Ark*) VENDORNAME="Ark" ;;
+ CrossWin32*) VENDORNAME="Google Summer of Code 2009" ;;
Debian*|Ubuntu*) VENDORNAME="Debian" ;;
Dropline*) VENDORNAME="DroplineGNOME" ;;
Frugalware*) VENDORNAME="Frugalware" ;;
@@ -640,8 +641,8 @@ AC_CHECK_HEADER(security/pam_appl.h, have_pam=true, have_pam=false)
AC_CHECK_HEADER(png.h, have_png=true, have_png=false)
AC_CHECK_HEADER(zlib.h, have_zlib=true, have_zlib=false)
-if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin"; then
- if test "z$enable_pam" != "zno" && ! $have_pam && "$VENDORNAME" != "Slackware"; then
+if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" = "CrossWin32"; then
+ if test "z$enable_pam" != "zno" && ! $have_pam; then
AC_MSG_ERROR(install pam-devel)
fi
if ! $have_png; then
@@ -1437,6 +1438,7 @@ distro-configs/Common.conf
distro-configs/CommonLinux.conf
distro-configs/CommonWin32.conf
distro-configs/CommonMac.conf
+distro-configs/CrossWin32.conf
distro-configs/GoOoWin32.conf
distro-configs/DroplineGNOME.conf
distro-configs/DroplineGNOME64.conf
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 2e86725..222d555 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -34,7 +34,7 @@ Experimental: VBAUntested, ArkOnlyExperimental, \
PostgreSQL, SELinux, VOSremoval, Glib2, \
UnitBootstrap, RadioButtons, UnstableLibwpd, WWInProgress, \
KDE4Experimental, MinGW, CalcExperimental, Mono24, \
- OOXMLExportExperimental
+ OOXMLExportExperimental, CrossWin32Patches
DebianLooseSections: DebianBaseNoHelpContent
# Optional sections
Optional : DejaVuFonts, NovellOnlyExtensionFixes, Win32OnlyExtensionFixes, Linux32OnlyExtensionFixes
@@ -148,6 +148,8 @@ FSFhuMacOSX : MacOSXCommon, MacOSXOnly, NovellOnly, NovellOnlyExtensionFixes, Cu
# Plain build; just with base build fixes
PlainLinux: PlainBuildFixes
Graphite: GraphiteSupport
+# Experimental crosscompile support
+CrossWin32 : CrossWin32Patches
# -------- [ Tag [ >= <tag> etc. ], ] patch sets --------
@@ -3221,3 +3223,53 @@ oox-pptx-import-fix-text-body-properties-priority.diff, n#403402, rodo
oox-pptx-export-hyperlinks.diff, n#499124, rodo
oox-pptx-export-vertical-text.diff, n#498737, rodo
oox-pptx-export-para-linespacing.diff, n#498737, rodo
+
+[ CrossWin32Patches ]
+# Experimental patches to crosscompile OOo for Win32
+crosswin32-accessibility-nojava.diff
+crosswin32-basegfx-no-cppunit.diff
+crosswin32-config_office-cross.diff
+crosswin32-config_office-mingw.diff
+crosswin32-connectivity-mingw.diff
+crosswin32-cppuhelper-mingw.diff
+crosswin32-cppunit-mingw.diff
+crosswin32-dbaccess-mingw.diff
+crosswin32-desktop-mingw.diff
+crosswin32-dtrans-mingw.diff
+crosswin32-embeddedobj-mingw.diff
+crosswin32-extensions-mingw.diff
+crosswin32-external-mingwheaders.diff
+crosswin32-fpicker-mingw.diff
+crosswin32-funit-char-line.diff
+crosswin32-goodies-mingw.diff
+crosswin32-helpcontent2-mingw.diff
+crosswin32-i18npool-cross.diff
+crosswin32-i18npool-mingw.diff
+crosswin32-icc-cross.diff
+crosswin32-instsetoo_native-mingw.diff
+crosswin32-lingucomponent-mingw.diff
+crosswin32-o3tl-no-cppunit.diff
+crosswin32-postprocess-mingw.diff
+crosswin32-pyuno-mingw.diff
+crosswin32-sal-cross.diff
+crosswin32-sal-mingw-c.diff
+crosswin32-sal-mingw.diff
+crosswin32-sccomp-mingw.diff
+crosswin32-scp2-mingw.diff
+crosswin32-setup_native-mingw.diff
+crosswin32-shell-mingw.diff
+crosswin32-solenv-cross.diff
+crosswin32-solenv-mingw-installer.diff
+crosswin32-solenv-mingw.diff
+crosswin32-solenv.diff
+crosswin32-soltools-cross.diff
+crosswin32-store-core.diff
+crosswin32-store-registry.diff
+crosswin32-svtools-minimal.diff
+crosswin32-svx-mingw.diff
+crosswin32-sysui-mingw.diff
+crosswin32-tools-mingw.diff
+crosswin32-trans-mingw.diff
+crosswin32-unotools-mingw.diff
+crosswin32-vcl-mingw.diff
+
More information about the ooo-build-commit
mailing list