ooo-build r12589 - in trunk: . patches/cairo patches/dev300



Author: strba
Date: Mon May 19 12:48:11 2008
New Revision: 12589
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12589&view=rev

Log:
wrap the odma code by right platform specific defines + reenable internal cairo + disable temporarily glib2 bundling

Added:
   trunk/patches/cairo/cairo-cairo-1-4-10-diff.diff
   trunk/patches/cairo/cairo-canvas-cairo.diff
   trunk/patches/cairo/cairo-makefile-mk.diff
   trunk/patches/cairo/cairo-prj-build-lst.diff
   trunk/patches/cairo/cairo-prj-d-lst.diff
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/patches/cairo/cairo-config_office-configure-in.diff
   trunk/patches/dev300/apply
   trunk/patches/dev300/novell-win32-odma.diff

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon May 19 12:48:11 2008
@@ -709,14 +709,9 @@
 	SYSTEM_CAIRO=TRUE
    fi
    CAIRO_ENABLED=TRUE
-   if test "z$BUILD_WIN32" = "zyes"; then
-      # Use the latest version
-      CAIRO_VER=1.4.10
-   else
-      # Not really, as Linux builds always use system cairo now
-      CAIRO_VER=1.4.10 
-   fi
-   CAIRO_CONFIGURE_FLAG="--enable-cairo=yes --with-system-xrender-headers"
+   # Use the latest version
+   CAIRO_VER=1.4.10
+   CAIRO_CONFIGURE_FLAG="--enable-cairo=yes"
    cairo_enabled=yes
 else
    CAIRO_ENABLED=

Added: trunk/patches/cairo/cairo-cairo-1-4-10-diff.diff
==============================================================================
--- (empty file)
+++ trunk/patches/cairo/cairo-cairo-1-4-10-diff.diff	Mon May 19 12:48:11 2008
@@ -0,0 +1,315 @@
+--- /dev/null
++++ cairo/cairo-1.4.10.diff
+@@ -0,0 +1,311 @@
++--- misc/build/cairo-1.4.10/makefile.mk
+++++ misc/build/cairo-1.4.10/makefile.mk
++@@ -1,1 +1,9 @@
++-dummy
+++PRJ=..$/..$/..$/..
+++
+++TARGET=source
+++
+++.INCLUDE :  settings.mk
+++
+++all:
+++	cd pixman$/src; $(MAKECMD) subdmake=true $(MFLAGS) $(CALLMACROS)
+++	cd src; $(MAKECMD) subdmake=true $(MFLAGS) $(CALLMACROS)
++dummy line to avoid confusing diff-mode
++--- misc/build/cairo-1.4.10/config.h
+++++ misc/build/cairo-1.4.10/config.h
++@@ -1,1 +1,146 @@
++-dummy
+++/* define if glitz backend can be tested against agl */
+++/* #undef CAIRO_CAN_TEST_GLITZ_AGL_SURFACE */
+++
+++/* define if glitz backend can be tested against egl */
+++/* #undef CAIRO_CAN_TEST_GLITZ_EGL_SURFACE */
+++
+++/* define if glitz backend can be tested against glx */
+++/* #undef CAIRO_CAN_TEST_GLITZ_GLX_SURFACE */
+++
+++/* define if glitz backend can be tested against wgl */
+++/* #undef CAIRO_CAN_TEST_GLITZ_WGL_SURFACE */
+++
+++/* Define to 1 if the PDF backend can be tested (need poppler and other
+++   dependencies for pdf2png) */
+++/* #undef CAIRO_CAN_TEST_PDF_SURFACE */
+++
+++/* Define to 1 if the SVG backend can be tested */
+++/* #undef CAIRO_CAN_TEST_SVG_SURFACE */
+++
+++/* define in the extra test surface have been built into cairo for the test
+++   suite */
+++/* #undef CAIRO_HAS_TEST_SURFACES */
+++
+++/* Define to 1 to disable certain code paths that rely heavily on double
+++   precision floating-point calculation */
+++/* #undef DISABLE_SOME_FLOATING_POINT */
+++
+++/* Define to 1 if your system stores words within floats with the most
+++   significant word first */
+++/* #undef FLOAT_WORDS_BIGENDIAN */
+++
+++/* Define to 1 if you have the <dlfcn.h> header file. */
+++/* #undef HAVE_DLFCN_H */
+++
+++/* Define to 1 if you have the `FcFini' function. */
+++/* #undef HAVE_FCFINI */
+++
+++/* FT_Bitmap_Size structure includes y_ppem field */
+++/* #undef HAVE_FT_BITMAP_SIZE_Y_PPEM */
+++
+++/* Define to 1 if you have the `FT_GlyphSlot_Embolden' function. */
+++/* #undef HAVE_FT_GLYPHSLOT_EMBOLDEN */
+++
+++/* Define to 1 if you have the `FT_Load_Sfnt_Table' function. */
+++/* #undef HAVE_FT_LOAD_SFNT_TABLE */
+++
+++/* Whether you have gcov */
+++/* #undef HAVE_GCOV */
+++
+++/* Define to 1 if you have the <inttypes.h> header file. */
+++/* #undef HAVE_INTTYPES_H */
+++
+++/* Define to 1 if you have the <memory.h> header file. */
+++#define HAVE_MEMORY_H 1
+++
+++/* Define to 1 if you have the <pthread.h> header file. */
+++/* #undef HAVE_PTHREAD_H */
+++
+++/* Define to 1 if you have Linux compatible sched_getaffinity */
+++/* #undef HAVE_SCHED_GETAFFINITY */
+++
+++/* Define to 1 if you have the <sched.h> header file. */
+++/* #undef HAVE_SCHED_H */
+++
+++/* Define to 1 if you have the <signal.h> header file. */
+++#define HAVE_SIGNAL_H 1
+++
+++/* Define to 1 if you have the <stdint.h> header file. */
+++/* #undef HAVE_STDINT_H */
+++
+++/* Needed without <stdint.h> */
+++#define INT32_MIN (-2147483647 - 1)
+++#define INT32_MAX 2147483647
+++
+++/* Define to 1 if you have the <stdlib.h> header file. */
+++#define HAVE_STDLIB_H 1
+++
+++/* Define to 1 if you have the <strings.h> header file. */
+++/* #undef HAVE_STRINGS_H */
+++
+++/* Define to 1 if you have the <string.h> header file. */
+++#define HAVE_STRING_H 1
+++
+++/* Define to 1 if you have the <sys/int_types.h> header file. */
+++/* #undef HAVE_SYS_INT_TYPES_H */
+++
+++/* Define to 1 if you have the <sys/stat.h> header file. */
+++#define HAVE_SYS_STAT_H 1
+++
+++/* Define to 1 if you have the <sys/types.h> header file. */
+++#define HAVE_SYS_TYPES_H 1
+++
+++/* Define to 1 if the system has the type `uint128_t'. */
+++/* #undef HAVE_UINT128_T */
+++
+++/* Define to 1 if the system has the type `uint64_t'. */
+++#define HAVE_UINT64_T 1
+++
+++/* Define to 1 if you have the <unistd.h> header file. */
+++#define HAVE_UNISTD_H 1
+++
+++/* Define to 1 if you have the `vasnprintf' function. */
+++/* #undef HAVE_VASNPRINTF */
+++
+++/* Define to 1 if you have the <windows.h> header file. */
+++#define HAVE_WINDOWS_H 1
+++
+++/* Name of package */
+++#define PACKAGE "cairo"
+++
+++/* Define to the address where bug reports for this package should be sent. */
+++#define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=cairo";
+++
+++/* Define to the full name of this package. */
+++#define PACKAGE_NAME "cairo"
+++
+++/* Define to the full name and version of this package. */
+++#define PACKAGE_STRING "cairo 1.4.10"
+++
+++/* Define to the one symbol short name of this package. */
+++#define PACKAGE_TARNAME "cairo"
+++
+++/* Define to the version of this package. */
+++#define PACKAGE_VERSION "1.4.10"
+++
+++/* Define to 1 if you have the ANSI C header files. */
+++#define STDC_HEADERS 1
+++
+++/* use MMX compiler intrinsics */
+++#define USE_MMX 1
+++
+++/* Version number of package */
+++#define VERSION "1.4.10"
+++
+++/* Define to 1 if your processor stores words with the most significant byte
+++   first (like Motorola and SPARC, unlike Intel and VAX). */
+++/* #undef WORDS_BIGENDIAN */
+++
+++/* Define to 1 if the X Window System is missing or not being used. */
+++#define X_DISPLAY_MISSING 1
+++
+++/* Define to `__inline__' or `__inline' if that's what the C compiler
+++   calls it, or to nothing if 'inline' is not supported under any name.  */
+++#ifndef __cplusplus
+++#define inline
+++#endif
++dummy line to avoid confusing diff-mode
++--- misc/build/cairo-1.4.10/src/cairo-features.h
+++++ misc/build/cairo-1.4.10/src/cairo-features.h
++@@ -1,1 +1,26 @@
++-dummy
+++/* Generated by configure.  Do not edit */
+++#ifndef CAIRO_FEATURES_H
+++#define CAIRO_FEATURES_H
+++
+++#ifdef  __cplusplus
+++# define CAIRO_BEGIN_DECLS  extern "C" {
+++# define CAIRO_END_DECLS    }
+++#else
+++# define CAIRO_BEGIN_DECLS
+++# define CAIRO_END_DECLS
+++#endif
+++
+++#ifndef cairo_public
+++# define cairo_public
+++#endif
+++
+++#define CAIRO_VERSION_MAJOR 1
+++#define CAIRO_VERSION_MINOR 4
+++#define CAIRO_VERSION_MICRO 10
+++
+++#define CAIRO_VERSION_STRING "1.4.10"
+++
+++#define CAIRO_HAS_WIN32_FONT 1
+++#define CAIRO_HAS_WIN32_SURFACE 1
+++
+++#endif
++dummy line to avoid confusing diff-mode
++--- misc/build/cairo-1.4.10/pixman/src/makefile.mk
+++++ misc/build/cairo-1.4.10/pixman/src/makefile.mk
++@@ -1,1 +1,38 @@
++-dummy
+++PRJ=..$/..$/..$/..$/..$/..
+++
+++PRJNAME=cairo
+++TARGET=pixman
+++ENABLE_EXCEPTIONS=TRUE
+++LIBTARGET=NO
+++
+++.INCLUDE :  settings.mk
+++
+++CFLAGS+=-I..$/..
+++CDEFS+=-DHAVE_CONFIG_H
+++
+++SLOFILES = \
+++	$(SLO)$/pixregion.obj \
+++	$(SLO)$/fbpict.obj \
+++	$(SLO)$/icblt.obj \
+++	$(SLO)$/icbltone.obj \
+++	$(SLO)$/iccolor.obj \
+++	$(SLO)$/icformat.obj \
+++	$(SLO)$/icimage.obj \
+++	$(SLO)$/icpixels.obj \
+++	$(SLO)$/icrect.obj \
+++	$(SLO)$/icstipple.obj \
+++	$(SLO)$/ictrap.obj \
+++	$(SLO)$/ictransform.obj \
+++	$(SLO)$/ictri.obj \
+++	$(SLO)$/icutil.obj \
+++	$(SLO)$/fbedge.obj \
+++	$(SLO)$/fbtrap.obj \
+++	$(SLO)$/fbcompose.obj \
+++	$(SLO)$/renderedge.obj \
+++	$(SLO)$/fbmmx.obj
+++
+++LIB1ARCHIV=$(LB)$/lib$(TARGET).a
+++LIB1TARGET=$(SLB)$/$(TARGET).lib
+++LIB1OBJFILES= $(SLOFILES)
+++
+++.INCLUDE :  target.mk
++dummy line to avoid confusing diff-mode
++--- misc/build/cairo-1.4.10/src/makefile.mk
+++++ misc/build/cairo-1.4.10/src/makefile.mk
++@@ -1,1 +1,68 @@
++-dummy
+++PRJ=..$/..$/..$/..$/..
+++
+++PRJNAME=cairo
+++TARGET=cairo
+++ENABLE_EXCEPTIONS=TRUE
+++LIBTARGET=NO
+++
+++.INCLUDE :	settings.mk
+++
+++CFLAGS+=-I.. -I..$/pixman$/src
+++CDEFS+=-DHAVE_CONFIG_H
+++
+++# In the same order as in libcairo_la_SOURCES in Makefile.am
+++# for clarity.
+++SLOFILES = \
+++	$(SLO)$/cairo.obj \
+++	$(SLO)$/cairo-arc.obj \
+++	$(SLO)$/cairo-array.obj \
+++	$(SLO)$/cairo-base85-stream.obj \
+++	$(SLO)$/cairo-bentley-ottmann.obj \
+++	$(SLO)$/cairo-cache.obj \
+++	$(SLO)$/cairo-clip.obj \
+++	$(SLO)$/cairo-color.obj \
+++	$(SLO)$/cairo-debug.obj \
+++	$(SLO)$/cairo-fixed.obj \
+++	$(SLO)$/cairo-font-face.obj \
+++	$(SLO)$/cairo-font-options.obj \
+++	$(SLO)$/cairo-freelist.obj \
+++	$(SLO)$/cairo-gstate.obj \
+++	$(SLO)$/cairo-hash.obj \
+++	$(SLO)$/cairo-hull.obj \
+++	$(SLO)$/cairo-image-surface.obj \
+++	$(SLO)$/cairo-lzw.obj \
+++	$(SLO)$/cairo-matrix.obj \
+++	$(SLO)$/cairo-mutex.obj \
+++	$(SLO)$/cairo-operator.obj \
+++	$(SLO)$/cairo-path.obj \
+++	$(SLO)$/cairo-path-bounds.obj \
+++	$(SLO)$/cairo-path-fill.obj \
+++	$(SLO)$/cairo-path-fixed.obj \
+++	$(SLO)$/cairo-path-stroke.obj \
+++	$(SLO)$/cairo-pen.obj \
+++	$(SLO)$/cairo-polygon.obj \
+++	$(SLO)$/cairo-rectangle.obj \
+++	$(SLO)$/cairo-region.obj \
+++	$(SLO)$/cairo-scaled-font.obj \
+++	$(SLO)$/cairo-skiplist.obj \
+++	$(SLO)$/cairo-slope.obj \
+++	$(SLO)$/cairo-spline.obj \
+++	$(SLO)$/cairo-stroke-style.obj \
+++	$(SLO)$/cairo-surface.obj \
+++	$(SLO)$/cairo-surface-fallback.obj \
+++	$(SLO)$/cairo-traps.obj \
+++	$(SLO)$/cairo-pattern.obj \
+++	$(SLO)$/cairo-unicode.obj \
+++	$(SLO)$/cairo-output-stream.obj \
+++	$(SLO)$/cairo-wideint.obj \
+++	$(SLO)$/cairo-meta-surface.obj \
+++	$(SLO)$/cairo-paginated-surface.obj \
+++	$(SLO)$/cairo-analysis-surface.obj \
+++	$(SLO)$/cairo-win32-font.obj \
+++	$(SLO)$/cairo-win32-surface.obj
+++
+++LIB1ARCHIV=$(LB)$/lib$(TARGET).a
+++LIB1TARGET=$(SLB)$/$(TARGET).lib
+++LIB1OBJFILES= $(SLOFILES)
+++
+++.INCLUDE :  target.mk
++dummy line to avoid confusing diff-mode

Added: trunk/patches/cairo/cairo-canvas-cairo.diff
==============================================================================
--- (empty file)
+++ trunk/patches/cairo/cairo-canvas-cairo.diff	Mon May 19 12:48:11 2008
@@ -0,0 +1,19 @@
+--- canvas/prj/build.lst	2006-11-02 13:13:45.000000000 +0100
++++ canvas/prj/build.lst	2006-11-02 13:14:17.000000000 +0100
+@@ -1,4 +1,4 @@
+-cv	canvas	:	javaunohelper comphelper cppuhelper offuh unoil tools goodies vcl AGG:agg basegfx NULL
++cv	canvas	:	javaunohelper comphelper cppuhelper offuh unoil tools goodies vcl AGG:agg basegfx CAIRO:cairo NULL
+ cv	canvas											 usr1	-	all	cv_mkout NULL
+ cv	canvas\inc										 nmake	-	all	cv_inc NULL
+ cv	canvas\source\tools								 nmake	-	all cv_tools cv_inc NULL
+--- canvas/source/cairo/makefile.mk	2008-04-11 10:59:46.000000000 +0200
++++ canvas/source/cairo/makefile.mk	2008-05-19 14:12:29.000000000 +0200
+@@ -82,7 +82,7 @@
+ .IF "$(SYSTEM_CAIRO)" == "YES"
+ SHL1STDLIBS+= $(CAIRO_LIBS)
+ .ELSE
+-SHL1STDLIBS+= -lcairo -lpixman-1
++SHL1STDLIBS+= -lcairo -lfontconfig $(FREETYPELIB)
+ .ENDIF
+ 
+ .IF "$(GUIBASE)"=="aqua"

Modified: trunk/patches/cairo/cairo-config_office-configure-in.diff
==============================================================================
--- trunk/patches/cairo/cairo-config_office-configure-in.diff	(original)
+++ trunk/patches/cairo/cairo-config_office-configure-in.diff	Mon May 19 12:48:11 2008
@@ -1,80 +1,82 @@
---- config_office/configure.in
-+++ config_office/configure.in
-@@ -216,6 +216,10 @@
- [  --enable-cairo          Determines whether to use Cairo canvas backend on
-                           platforms where Cairo is available.
- ],,enable_cairo=no)
-+AC_ARG_WITH(system-cairo,
-+[  --without-system-cairo  Try to build using an internal cairo on platforms
-+                          that support it.
-+],,)
- AC_ARG_ENABLE(opengl,
- [  --enable-opengl         Determines whether to use OpenGL (for 3D transitions)
-                           This is built as an UNO extension and not depl
-@@ -823,6 +827,7 @@
- 		;;
- 	cygwin*) # Windows
- 		test_cups=no
-+		build_cairo=yes
- 		_os=WINNT
- 		;;
- 	darwin*) # Mac OS X
-@@ -5079,19 +5084,18 @@
+--- config_office/configure.in	2008-05-19 11:59:40.000000000 +0200
++++ config_office/configure.in	2008-05-19 12:19:01.000000000 +0200
+@@ -5327,33 +5327,21 @@
  AC_SUBST(GTK_LIBS)
  
  dnl ===================================================================
 -dnl Check whether the Cairo libraries are available.
-+dnl Check whether to enable the cairo canvas backend.
++dnl dnl Check whether to enable the cairo canvas backend.
  dnl ===================================================================
  
+-dnl === Linux has no "internal cairo" (prebuilt or in OOo source). Default to system cairo on Linux. ===
+-if test -z "$with_system_cairo" -a "$_os" = "Linux"; then
+-   with_system_cairo="yes"
+-fi
+-
  ENABLE_CAIRO=""
+-SYSTEM_CAIRO=""
  
  if test  "$build_cairo" = "yes"; then
  
--    AC_MSG_CHECKING([whether to enable the Cairo canvas backend])
-+    AC_MSG_CHECKING([whether to enable the cairo canvas backend])
+     AC_MSG_CHECKING([whether to enable the cairo canvas backend])
      if test "x$enable_cairo" != "xno" ; then
 -        ENABLE_CAIRO="TRUE"
--	     SYSTEM_CAIRO=YES
--	     AC_MSG_RESULT([yes])
--	     PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
-+      AC_MSG_RESULT([yes])
-+      ENABLE_CAIRO="TRUE"
-+      if test "$_os" != "WINNT"; then
-         if test "$with_system_xrender_headers" = "yes"; then
-             AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
-             AC_TRY_RUN([
-@@ -5106,11 +5110,33 @@
- }
-             ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, X headers too old.])])
-         fi
-+      fi
-     else
- 	     AC_MSG_RESULT([no])
-     fi
- fi
+-	AC_MSG_RESULT([yes])
+-        AC_MSG_CHECKING([which cairo to use])
+-        if test -n "$with_system_cairo" -o -n "$with_system_libs" && \
+-           test "$with_system_cairo" != "no"; then
+-           AC_MSG_RESULT([external])
+-           SYSTEM_CAIRO=YES
+-	   
+-           PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
+-           if test "$with_system_xrender_headers" = "yes"; then
+-              AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
+-              AC_TRY_RUN([
++       AC_MSG_RESULT([yes])
++       ENABLE_CAIRO="TRUE"
++       if test "$_os" != "WINNT"; then
++	if test "$with_system_xrender_headers" = "yes"; then
++             AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
++             AC_TRY_RUN([
+ #include <X11/extensions/Xrender.h>
  
+ int main(int argc, char **argv) {
+@@ -5364,13 +5352,32 @@
+ #endif
+ }
+                ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, X headers too old.])])
+-           fi
+-        else
+-           BUILD_TYPE="$BUILD_TYPE CAIRO"
+-           AC_MSG_RESULT([internal])
+-        fi
++          fi
++	fi
++     else
++ 	     AC_MSG_RESULT([no])
++     fi
++fi
++
 +dnl ===================================================================
 +dnl Check for system cairo
 +dnl ===================================================================
 +
++dnl === Linux has no "internal cairo" (prebuilt or in OOo source). Default to system cairo on Linux. ===
++if test -z "$with_system_cairo" -a "$_os" = "Linux"; then
++   with_system_cairo="yes"
++fi
++
 +if test "$ENABLE_CAIRO" = "TRUE"; then
 +    AC_MSG_CHECKING([which cairo to use])
-+    if test "$_os" = "WINNT"; then
++    if test "$with_system_cairo" != "yes" && test "$_os" = "Linux"; then
 +        BUILD_TYPE="$BUILD_TYPE CAIRO"
 +        AC_MSG_RESULT([internal])
 +        SYSTEM_CAIRO=NO
-+    elif test "$with_system_cairo" = "no" && test "$_os" = "Linux"; then
-+        BUILD_TYPE="$BUILD_TYPE CAIRO"
-+        AC_MSG_RESULT([internal])
-+        SYSTEM_CAIRO=NO
-+    else
+     else
+-	   AC_MSG_RESULT([no])
 +        AC_MSG_RESULT([external])
 +        SYSTEM_CAIRO=YES
 +        PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
-+    fi
-+fi
-+
- AC_SUBST(ENABLE_CAIRO)
- AC_SUBST(SYSTEM_CAIRO)
- AC_SUBST(CAIRO_CFLAGS)
+     fi
+ fi
+ 

Added: trunk/patches/cairo/cairo-makefile-mk.diff
==============================================================================
--- (empty file)
+++ trunk/patches/cairo/cairo-makefile-mk.diff	Mon May 19 12:48:11 2008
@@ -0,0 +1,155 @@
+--- /dev/null	2007-05-04 12:54:50.000000000 +0200
++++ cairo/makefile.mk	2007-10-24 11:06:03.000000000 +0200
+@@ -0,0 +1,152 @@
++#*************************************************************************
++#
++#   The Contents of this file are made available subject to the terms of
++#   either of the following licenses
++#
++#          - GNU Lesser General Public License Version 2.1
++#          - Sun Industry Standards Source License Version 1.1
++#
++#   Sun Microsystems Inc., October, 2000
++#
++#   GNU Lesser General Public License Version 2.1
++#   =============================================
++#   Copyright 2000 by Sun Microsystems, Inc.
++#   901 San Antonio Road, Palo Alto, CA 94303, USA
++#
++#   This library is free software; you can redistribute it and/or
++#   modify it under the terms of the GNU Lesser General Public
++#   License version 2.1, as published by the Free Software Foundation.
++#
++#   This library is distributed in the hope that it will be useful,
++#   but WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#   Lesser General Public License for more details.
++#
++#   You should have received a copy of the GNU Lesser General Public
++#   License along with this library; if not, write to the Free Software
++#   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++#   MA  02111-1307  USA
++#
++#
++#   Sun Industry Standards Source License Version 1.1
++#   =================================================
++#   The contents of this file are subject to the Sun Industry Standards
++#   Source License Version 1.1 (the "License"); You may not use this file
++#   except in compliance with the License. You may obtain a copy of the
++#   License at http://www.openoffice.org/license.html.
++#
++#   Software provided under this License is provided on an "AS IS" basis,
++#   WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++#   WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++#   MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++#   See the License for the specific provisions governing your rights and
++#   obligations concerning the Software.
++#
++#   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
++#
++#   Copyright: 2000 by Sun Microsystems, Inc.
++#
++#   All Rights Reserved.
++#
++#   Contributor(s): _______________________________________
++#
++#
++#
++#*************************************************************************
++
++PRJ=.
++
++PRJNAME=cairo
++TARGET=cairo
++
++# --- Settings -----------------------------------------------------
++
++.INCLUDE :	settings.mk
++
++# --- Files --------------------------------------------------------
++
++.IF "$(ENABLE_CAIRO)"=="TRUE"
++
++.IF "$(SYSTEM_CAIRO)" == "YES"
++all:
++        @echo "An already available installation of cairo should exist on your system."
++	@echo "Therefore the version provided here does not need to be built in addition."
++.ENDIF
++
++TARFILE_NAME=cairo-1.4.10
++PATCH_FILE_NAME=$(TARFILE_NAME).diff
++
++.IF "$(OS)"=="WNT"
++.IF "$(COM)"=="GCC"
++CONFIGURE_DIR=
++CONFIGURE_ACTION=.$/configure
++CONFIGURE_FLAGS=--enable-static --disable-shared --with-pic --disable-gtk-doc \
++	--enable-win32 --enable-win32-font \
++	--disable-xcb --disable-quartz --disable-xlib --disable-xlib-xrender --disable-freetype \
++	--disable-os2 --disable-beos --disable-png --disable-glitz --disable-directfb \
++	--disable-ps --disable-pdf --disable-svg --disable-atsui
++BUILD_ACTION=$(GNUMAKE)
++BUILD_FLAGS+= -j$(EXTMAXPROCESS)
++BUILD_DIR=$(CONFIGURE_DIR)
++.ELSE
++BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
++BUILD_DIR=.
++.ENDIF
++.ELSE
++.IF "$(OS)$(COM)"=="LINUXGCC"
++CONFIGURE_DIR=
++CONFIGURE_ACTION=.$/configure
++CONFIGURE_FLAGS=--enable-static --disable-shared --with-pic --disable-gtk-doc \
++	--enable-xlib --enable-xlib-xrender --enable-freetype \
++	--disable-xcb --disable-quartz --disable-win32 --disable-win32-font \
++	--disable-os2 --disable-beos --disable-png --disable-glitz --disable-directfb \
++	--disable-ps --disable-pdf --disable-svg --disable-atsui
++BUILD_ACTION=$(GNUMAKE)
++BUILD_FLAGS+= -j$(EXTMAXPROCESS)
++BUILD_DIR=$(CONFIGURE_DIR)
++.ENDIF
++.ENDIF
++ADDITIONAL_FILES= \
++	config.h \
++	makefile.mk \
++	src$/cairo-features.h \
++	src$/makefile.mk \
++	pixman$/src$/makefile.mk \
++
++
++.IF "$(OS)"=="WNT"
++OUT2INC= \
++	src$/cairo.h \
++	src$/cairo-features.h \
++	src$/cairo-deprecated.h \
++	src$/cairo-win32.h
++.IF "$(COM)"=="GCC"
++OUT2LIB= \
++	.libs$/src$/libcairo.a
++.ENDIF
++.ENDIF
++.IF "$(OS)"=="LINUX"
++OUT2INC= \
++	src$/cairo.h \
++	src$/cairo-features.h \
++	src$/cairo-deprecated.h \
++	src$/cairo-xlib.h \
++	src$/cairo-xlib-xrender.h
++OUT2LIB= \
++	src$/.libs$/libcairo.a
++.ENDIF
++
++
++# --- Targets ------------------------------------------------------
++
++
++.INCLUDE :	set_ext.mk
++.INCLUDE :	target.mk
++.INCLUDE :	tg_ext.mk
++
++.ELSE  
++
++dummy:
++	@echo "Nothing to build for your platform"
++
++.ENDIF

Added: trunk/patches/cairo/cairo-prj-build-lst.diff
==============================================================================
--- (empty file)
+++ trunk/patches/cairo/cairo-prj-build-lst.diff	Mon May 19 12:48:11 2008
@@ -0,0 +1,6 @@
+--- /dev/null	2007-05-04 12:54:50.000000000 +0200
++++ cairo/prj/build.lst	2007-10-24 10:56:23.000000000 +0200
+@@ -0,0 +1,3 @@
++ca	cairo		:	solenv FREETYPE:freetype NULL
++ca	cairo			usr1	-	all	ca_mkout NULL
++ca	cairo			nmake	-	all	ca_cairo NULL

Added: trunk/patches/cairo/cairo-prj-d-lst.diff
==============================================================================
--- (empty file)
+++ trunk/patches/cairo/cairo-prj-d-lst.diff	Mon May 19 12:48:11 2008
@@ -0,0 +1,7 @@
+--- /dev/null	2007-05-04 12:54:50.000000000 +0200
++++ cairo/prj/d.lst	2007-10-24 11:07:14.000000000 +0200
+@@ -0,0 +1,4 @@
++mkdir: %_DEST%\inc%_EXT%\cairo
++..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\cairo\*.h
++..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib
++..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon May 19 12:48:11 2008
@@ -15,7 +15,7 @@
 	 GStreamer, CWSBackports, WPG, Cleanups, WMF, GnomeVFS, \
 	 Layout, VBABits, VBAObjects, CalcErrors, Store, CJK, GCJ, Lwp, \
 	 OOXML, SVGImport, AutoCorrectCapsLock, UnitTesting, \
-     CalcDataPilotDrillDown, PopupRemoval, LinkWarningDlg, RadioButtons
+     CalcDataPilotDrillDown, PopupRemoval, LinkWarningDlg, RadioButtons, InternalCairo
 
 LinuxCommon : Common, LayoutDialogs, Defaults, TangoIcons, FontConfigTemporaryHacks, \
 	      FedoraFixes, LinuxOnly, SystemBits, \
@@ -2246,9 +2246,9 @@
 
 
 [ Glib2 ]
-external-package-glib2.diff
-scp2-package-glib2.diff
-setup_native-package-glib2.diff
+#external-package-glib2.diff
+#scp2-package-glib2.diff
+#setup_native-package-glib2.diff
 
 [ Fixes ]
 fix-ppt-linespacing-import-export.diff, n#355302, rodo
@@ -2290,6 +2290,15 @@
 buildfix-no-UPD-in-library-names-linuxonly.diff, jholesov
 
 
+[ InternalCairo ]
+cairo-cairo-1-4-10-diff.diff
+cairo-makefile-mk.diff
+cairo-prj-build-lst.diff
+cairo-prj-d-lst.diff
+cairo-config_office-configure-in.diff
+cairo-canvas-cairo.diff
+
+
 [ UnstableLibwpd ]
 libwpd-testing.diff
 libwpg-testing.diff

Modified: trunk/patches/dev300/novell-win32-odma.diff
==============================================================================
--- trunk/patches/dev300/novell-win32-odma.diff	(original)
+++ trunk/patches/dev300/novell-win32-odma.diff	Mon May 19 12:48:11 2008
@@ -1,2566 +1,2572 @@
---- ucb/prj/build.lst	18 Oct 2005 08:45:24 -0000	1.20
-+++ ucb/prj/build.lst	13 Mar 2006 10:55:34 -0000
-@@ -14,2 +14,3 @@ uc	ucb\source\ucp\package		nmake	-	all	u
- uc	ucb\source\ucp\tdoc			nmake	-	all	uc_tdoc uc_inc NULL
- uc	ucb\source\ucp\expand		nmake	-	all	uc_expand uc_inc NULL
-+uc	ucb\source\ucp\odma			nmake	-	w	uc_odma uc_inc NULL
-dummy line to avoid confusing diff-mode
---- ucb/prj/d.lst	18 Oct 2005 08:45:24 -0000	1.20
-+++ ucb/prj/d.lst	13 Mar 2006 10:55:34 -0000
-@@ -23,6 +23,11 @@
- ..\%__SRC%\lib\ucp*.uno.dylib %_DEST%\lib%_EXT%\ucp*.uno.dylib
- ..\%__SRC%\misc\ucp*.map %_DEST%\bin%_EXT%\ucp*.map
- ..\%__SRC%\misc\ucp*.sym %_DEST%\bin%_EXT%\ucp*.sym
-+
-+..\%__SRC%\slb\odma_lib.lib %_DEST%\lib%_EXT%\odma_lib.lib
-+..\source\ucp\odma\odma.h %_DEST%\inc%_EXT%\odma.h
-+..\source\ucp\odma\odma_lib.hxx %_DEST%\inc%_EXT%\odma_lib.hxx
-+
- ..\source\ucp\file\ucpfile.xml %_DEST%\xml%_EXT%\ucpfile.xml
- ..\source\ucp\ftp\ucpftp.xml %_DEST%\xml%_EXT%\ucpftp.xml
- ..\source\ucp\hierarchy\ucphier.xml %_DEST%\xml%_EXT%\ucphier.xml
-Index: ucb/source/ucp/odma/makefile.mk
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/makefile.mk,v
-retrieving revision 1.4
-diff -p -u -r1.4 makefile.mk
---- ucb/source/ucp/odma/makefile.mk	9 Sep 2005 15:49:57 -0000	1.4
-+++ ucb/source/ucp/odma/makefile.mk	6 Nov 2006 00:12:08 -0000
-@@ -63,7 +63,7 @@ LIB2TARGET=NO
- 
- # --- General -----------------------------------------------------
- 
--SLOFILES=\
-+SLO1FILES=\
- 	$(SLO)$/odma_lib.obj    		\
- 	$(SLO)$/odma_services.obj    	\
- 	$(SLO)$/odma_provider.obj    	\
-@@ -76,7 +75,7 @@ SLOFILES=\
- 	$(SLO)$/odma_contentcaps.obj
- 
- LIB1TARGET=$(SLB)$/_$(TARGET).lib
--LIB1OBJFILES=$(SLOFILES)
-+LIB1OBJFILES=$(SLO1FILES)
- 
- # --- Shared-Library ---------------------------------------------------
- 
-@@ -122,6 +121,13 @@ APP2STDLIBS+=$(LIBCIMT)
- 
- DEF2DES=UCB ODMA URL converter
- 
-+# --- odma_lib library -----------------------------------------------
-+
-+SLO3FILES=$(SLO)$/odma_lib.obj
-+
-+LIB3TARGET=$(SLB)$/odma_lib.lib
-+LIB3OBJFILES=$(SLO3FILES)
-+
- # --- Targets ----------------------------------------------------------
- 
- .INCLUDE: target.mk
-Index: ucb/source/ucp/odma/odma_content.cxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_content.cxx,v
-retrieving revision 1.5
-diff -p -u -r1.5 odma_content.cxx
---- ucb/source/ucp/odma/odma_content.cxx	17 Sep 2006 13:57:15 -0000	1.5
-+++ ucb/source/ucp/odma/odma_content.cxx	6 Nov 2006 00:12:08 -0000
-@@ -544,6 +475,12 @@ uno::Any SAL_CALL Content::execute(
-     }
- 	else if( ! aCommand.Name.compareToAscii( "transfer" ) )
- 	{
-+		// So far I have determined that this command is called when
-+		// doing "Save As" to copy an already written backup copy of
-+		// the document in the file system into the DMS.
-+
-+		// Maybe also in other situations.
-+
- 		ucb::TransferInfo aTransferInfo;
- 		if( ! ( aCommand.Argument >>= aTransferInfo ) )
- 		{
-@@ -559,84 +560,21 @@
- 		::rtl::Reference<ContentProperties> aProp = m_aProps;
- 		if(aProp->m_bIsFolder)
- 		{
--			aProp = getContentProvider()->getContentPropertyWithTitle(aTransferInfo.NewTitle);
-+			aProp = getContentProvider()->getContentPropertyWithDocumentId(aTransferInfo.NewTitle);
- 			if(!aProp.is())
- 				aProp = getContentProvider()->getContentPropertyWithSavedAsName(aTransferInfo.NewTitle);
- 			sal_Bool bError = !aProp.is();
--			if(bError)
--			{
--				sal_Char* pExtension = NULL;
--				::rtl::OString sExt;
--				sal_Int32 nPos = aTransferInfo.NewTitle.lastIndexOf('.');
--				if(nPos != -1)
--				{
--					sExt = ::rtl::OUStringToOString(aTransferInfo.NewTitle.copy(nPos+1),RTL_TEXTENCODING_ASCII_US);
--					if(sExt.equalsIgnoreAsciiCase("txt"))
--						pExtension = ODM_FORMAT_TEXT;
--					else if(sExt.equalsIgnoreAsciiCase("rtf"))
--						pExtension = ODM_FORMAT_RTF;
--					else if(sExt.equalsIgnoreAsciiCase("ps"))
--						pExtension = ODM_FORMAT_PS;
--					else  
--						pExtension = const_cast<sal_Char*>(sExt.getStr());
--				}
--				else
--					pExtension = ODM_FORMAT_TEXT;
- 
--				sal_Char* lpszNewDocId = new sal_Char[ODM_DOCID_MAX];
--				void *pData = NULL;
--				DWORD dwFlags = ODM_SILENT;
--				ODMSTATUS odm = NODMSaveAsEx(ContentProvider::getHandle(),
--											 NULL, // means it is saved the first time
--											 lpszNewDocId,
--											 pExtension,
--											 NULL, // no callback function here
--											 pData,
--											 &dwFlags);
--
--				// check if we have to call the DMS dialog
--				if(odm == ODM_E_USERINT) 
--				{ 
--					dwFlags = 0;
--					odm = NODMSaveAsEx(ContentProvider::getHandle(),
--											 NULL, // means it is saved the first time
--											 lpszNewDocId,
--											 pExtension,
--											 NULL, // no callback function here
--											 pData,
--											 &dwFlags);
--				}
--				bError = odm != ODM_SUCCESS;
--				if(!bError)
--				{
--					aProp = new ContentProperties();
--					aProp->m_sDocumentId	= ::rtl::OString(lpszNewDocId);
--					aProp->m_sContentType	= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODMA_CONTENT_TYPE));
--					aProp->m_sSavedAsName	= aTransferInfo.NewTitle;
--					getContentProvider()->append(aProp);
--
--					// now set the title
--					WORD nDocInfo = ODM_NAME;
--					::rtl::OUString sFileName = aTransferInfo.NewTitle;
--					sal_Int32 nIndex = aTransferInfo.NewTitle.lastIndexOf( sal_Unicode('.') );
--					if(nIndex != -1)
--						sFileName = aTransferInfo.NewTitle.copy(0,nIndex);
--
--					::rtl::OString sDocInfoValue = ::rtl::OUStringToOString(sFileName,RTL_TEXTENCODING_ASCII_US);
--					odm = NODMSetDocInfo(	ContentProvider::getHandle(),
--											lpszNewDocId,
--											nDocInfo,
--											const_cast<sal_Char*>(sDocInfoValue.getStr())
--											);
--
--				}
--				else if ( odm == ODM_E_CANCEL)
--                    NODMActivate(ContentProvider::getHandle(),
--                                 ODM_DELETE,
--                                 lpszNewDocId);
-+			// There used to be code below that called ODMSaveAsEx,
-+			// but that was very broken. We have already called
-+			// ODMSaveAsEx in the ODMA file picker when selecting the
-+			// name for a new document, or the document already exists
-+			// in the DMS and we don't need any ODMSaveAsEx. The ODMA
-+			// file picker tells odma::ContentProvider about the new
-+			// document's DOCID, so the
-+			// getContentPropertyWithDocumentId() call above should
-+			// succeed.
- 
--				delete lpszNewDocId;
--			}
- 			if(bError)
- 				ucbhelper::cancelCommandExecution(
- 						uno::makeAny( lang::IllegalArgumentException(
-@@ -648,11 +648,22 @@
- 		rtl::OUString sFileURL = ContentProvider::openDoc(aProp);
- 
- 		sal_Int32 nLastIndex = sFileURL.lastIndexOf( sal_Unicode('/') );
-+		// Create a new Content object for the "shadow" file
-+		// corresponding to the opened document from the DMS.
- 		::ucbhelper::Content aContent(sFileURL.copy(0,nLastIndex),NULL);
- 		//	aTransferInfo.NameClash = ucb::NameClash::OVERWRITE;
- 		aTransferInfo.NewTitle = sFileURL.copy( 1 + nLastIndex );
-+		// Copy our saved backup copy to the "shadow" file.
- 		aContent.executeCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("transfer")),uno::makeAny(aTransferInfo));
-+		// Tell the DMS that the "shadow" file is done and can be
-+		// imported.
- 		getContentProvider()->saveDocument(aProp->m_sDocumentId);
-+    }
-+	else if ( aCommand.Name.equalsAsciiL(
-+		    RTL_CONSTASCII_STRINGPARAM( "getCasePreservingURL" ) ) )
-+	{
-+	    rtl::OUString CasePreservingURL = openDoc();
-+	    aRet <<= CasePreservingURL;
- 	}
- 	else
- 	{
-Index: ucb/source/ucp/odma/odma_content.hxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_content.hxx,v
-retrieving revision 1.4
-diff -p -u -r1.4 odma_content.hxx
---- ucb/source/ucp/odma/odma_content.hxx	9 Sep 2005 15:50:31 -0000	1.4
-+++ ucb/source/ucp/odma/odma_content.hxx	6 Nov 2006 00:12:08 -0000
-@@ -70,7 +67,7 @@ namespace odma
- 
- // UNO service name for the content.
- #define ODMA_CONTENT_SERVICE_NAME \
--							"com.sun.star.ucb.OdmaContent"
-+							"com.sun.star.ucb.ODMAContent"
- 
- //=========================================================================
- class ContentProvider;
-Index: ucb/source/ucp/odma/odma_contentprops.hxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_contentprops.hxx,v
-retrieving revision 1.4
-diff -p -u -r1.4 odma_contentprops.hxx
---- ucb/source/ucp/odma/odma_contentprops.hxx	9 Sep 2005 15:51:07 -0000	1.4
-+++ ucb/source/ucp/odma/odma_contentprops.hxx	6 Nov 2006 00:12:08 -0000
-@@ -80,6 +80,7 @@ namespace odma
- 		{}
- 
- 		inline ::rtl::OUString getTitle()		const { return m_sTitle;		}
-+		inline ::rtl::OUString getDocumentId()	const { return ::rtl::OStringToOUString( m_sDocumentId, RTL_TEXTENCODING_ASCII_US ); }
- 		inline ::rtl::OUString getSavedAsName() const { return m_sSavedAsName;	}
- 	};
- 	typedef ::std::binary_function< ::rtl::Reference<ContentProperties>, ::rtl::OUString,bool> TContentPropertiesFunctorBase;
-Index: ucb/source/ucp/odma/odma_datasupplier.cxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_datasupplier.cxx,v
-retrieving revision 1.5
-diff -p -u -r1.5 odma_datasupplier.cxx
---- ucb/source/ucp/odma/odma_datasupplier.cxx	17 Sep 2006 13:57:42 -0000	1.5
-+++ ucb/source/ucp/odma/odma_datasupplier.cxx	6 Nov 2006 00:12:08 -0000
-@@ -63,7 +63,6 @@
- #include "odma_content.hxx"
- #include "odma_contentprops.hxx"
- #include "odma_provider.hxx"
--#include "odma_lib.hxx"
- 
- using namespace com::sun::star::beans;
- using namespace com::sun::star::lang;
-@@ -308,7 +306,7 @@ sal_Bool DataSupplier::getResult( sal_uI
- 	ODMSTATUS odm = NODMGetDMS(ODMA_ODMA_REGNAME, lpszDMSList);
- 	lpszDMSList[strlen(lpszDMSList)+1] = '\0';
- 
--	::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME");
-+	::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME");
- 	
- 	DWORD dwFlags = ODM_SPECIFIC;
- 	odm = NODMQueryExecute(ContentProvider::getHandle(), sQuery,dwFlags, lpszDMSList, pQueryId );
-Index: ucb/source/ucp/odma/odma_lib.cxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_lib.cxx,v
-retrieving revision 1.5
-diff -p -u -r1.5 odma_lib.cxx
---- ucb/source/ucp/odma/odma_lib.cxx	17 Sep 2006 13:58:10 -0000	1.5
-+++ ucb/source/ucp/odma/odma_lib.cxx	6 Nov 2006 00:12:08 -0000
-@@ -44,6 +44,8 @@
- //#endif
- #include <osl/module.h>
- #include <rtl/ustring.hxx>
-+#include <tools/prewin.h>
-+#include <tools/postwin.h>
- #include "odma_lib.hxx"
- 
- 
-@@ -84,17 +86,18 @@ namespace odma
- 
- 	sal_Bool LoadFunctions(oslModule _pODMA);
- 
--	sal_Bool LoadLibrary()
-+	sal_Bool DMSsAvailable()
- 	{
- 		static sal_Bool bLoaded = sal_False;
--		static oslModule pODMA = NULL;
-+		static sal_Bool bBeenHere = sal_False;
-+		oslModule pODMA = NULL;
- 		
--		if (bLoaded) 
--			return sal_True;
-+		if (bBeenHere) 
-+			return bLoaded;
-+
- 		::rtl::OUString sPath;
- 	#ifdef WIN
- 		sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA.DLL"));
--		
- 	#endif
- 	#ifdef WNT
- 		sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL"));
-@@ -103,11 +106,21 @@ namespace odma
- 		sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodma.so"));
- 	#endif
- 
-+		bBeenHere = sal_True;
-+
- 		pODMA = osl_loadModule( sPath.pData,SAL_LOADMODULE_NOW );
- 		if( !pODMA)
- 			return sal_False;
- 
--		return bLoaded = LoadFunctions(pODMA);
-+		if (!LoadFunctions(pODMA))
-+			return sal_False;
-+
-+		bLoaded = (NODMGetDMSCount() > 0);
-+
-+		if (getenv ("NO_ODMA"))
-+			bLoaded = sal_False;
-+
-+		return bLoaded;
- 	}
- 	// -------------------------------------------------------------------------
- 
-Index: ucb/source/ucp/odma/odma_lib.hxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_lib.hxx,v
-retrieving revision 1.4
-diff -p -u -r1.4 odma_lib.hxx
---- ucb/source/ucp/odma/odma_lib.hxx	9 Sep 2005 15:52:48 -0000	1.4
-+++ ucb/source/ucp/odma/odma_lib.hxx	6 Nov 2006 00:12:08 -0000
-@@ -35,19 +35,7 @@
- #ifndef ODMA_LIB_HXX
- #define ODMA_LIB_HXX
- 
--typedef void	            *LPVOID;
--typedef char				*LPSTR, 
--							*PSTR;
--typedef const char			*LPCSTR;
--typedef unsigned long       DWORD;
--typedef unsigned short      WORD;
--typedef unsigned short      *LPWORD;
--typedef DWORD		        *LPDWORD;
--
--#define WINAPI				__stdcall
--#define FAR
--
--#include "odma.h"
-+#include <odma.h>
- 
- namespace odma
- {
-@@ -215,37 +203,37 @@ namespace odma
- 
- 	// now we define some macros
- 
--	#define NODMRegisterApp(a,b,c,d,e)			(*(pODMRegisterApp))(a,b,c,d,e)
--	#define NODMUnRegisterApp(a)				(*(pODMUnRegisterApp))(a)
--	#define NODMSelectDoc(a,b,c)				(*(pODMSelectDoc))(a,b,c)
--	#define NODMOpenDoc(a,b,c,d)				(*(pODMOpenDoc))(a,b,c,d)
--	#define NODMSaveDoc(a,b,c)					(*(pODMSaveDoc))(a,b,c)
--	#define NODMCloseDoc(a,b,c,d,e,f)			(*(pODMCloseDoc))(a,b,c,d,e,f)
--	#define NODMNewDoc(a,b,c,d,e)				(*(pODMNewDoc))(a,b,c,d,e)
--	#define NODMSaveAs(a,b,c,d,e,f)				(*(pODMSaveAs))(a,b,c,d,e,f)
--	#define NODMActivate(a,b,c)					(*(pODMActivate))(a,b,c)
--	#define NODMGetDocInfo(a,b,c,d,e)			(*(pODMGetDocInfo))(a,b,c,d,e)
--	#define NODMSetDocInfo(a,b,c,d)				(*(pODMSetDocInfo))(a,b,c,d)
--	#define NODMGetDMSInfo(a,b,c,d)				(*(pODMGetDMSInfo))(a,b,c,d)
--	#define NODMGetDMSCount()					(*(pODMGetDMSCount))()
--	#define NODMGetDMSList(a,b)					(*(pODMGetDMSList))(a,b)
--	#define NODMGetDMS(a,b)						(*(pODMGetDMS))(a,b)
--	#define NODMSetDMS(a,b)						(*(pODMSetDMS))(a,b)
--	#define NODMQueryExecute(a,b,c,d,e)			(*(pODMQueryExecute))(a,b,c,d,e)
--	#define NODMQueryGetResults(a,b,c,d,e,f)	(*(pODMQueryGetResults))(a,b,c,d,e,f)
--	#define NODMQueryClose(a,b)					(*(pODMQueryClose))(a,b)
--	#define NODMCloseDocEx(a,b,c,d,e,f,g)		(*(pODMCloseDocEx))(a,b,c,d,e,f,g)
--	#define NODMSaveAsEx(a,b,c,d,e,f,g)			(*(pODMSaveAsEx))(a,b,c,d,e,f,g)
--	#define NODMSaveDocEx(a,b,c,d)				(*(pODMSaveDocEx))(a,b,c,d)
--	#define NODMSelectDocEx(a,b,c,d,e,f)		(*(pODMSelectDocEx))(a,b,c,d,e,f)
--	#define NODMQueryCapability(a,b,c,d,e)		(*(pODMQueryCapability))(a,b,c,d,e)
--	#define NODMSetDocEvent(a,b,c,d,e,f,g)		(*(pODMSetDocEvent))(a,b,c,d,e,f,g)
--	#define NODMGetAlternateContent(a,b,c,d,e)	(*(pODMGetAlternateContent))(a,b,c,d,e)
--	#define NODMSetAlternateContent(a,b,c,d,e)	(*(pODMSetAlternateContent))(a,b,c,d,e)
--	#define NODMGetDocRelation(a,b,c,d,e,f)		(*(pODMGetDocRelation))(a,b,c,d,e,f)
--	#define NODMSetDocRelation(a,b,c,d,e,f)		(*(pODMSetDocRelation))(a,b,c,d,e,f)
-+	#define NODMRegisterApp(a,b,c,d,e)			(*(::odma::pODMRegisterApp))(a,b,c,d,e)
-+	#define NODMUnRegisterApp(a)				(*(::odma::pODMUnRegisterApp))(a)
-+	#define NODMSelectDoc(a,b,c)				(*(::odma::pODMSelectDoc))(a,b,c)
-+	#define NODMOpenDoc(a,b,c,d)				(*(::odma::pODMOpenDoc))(a,b,c,d)
-+	#define NODMSaveDoc(a,b,c)					(*(::odma::pODMSaveDoc))(a,b,c)
-+	#define NODMCloseDoc(a,b,c,d,e,f)			(*(::odma::pODMCloseDoc))(a,b,c,d,e,f)
-+	#define NODMNewDoc(a,b,c,d,e)				(*(::odma::pODMNewDoc))(a,b,c,d,e)
-+	#define NODMSaveAs(a,b,c,d,e,f)				(*(::odma::pODMSaveAs))(a,b,c,d,e,f)
-+	#define NODMActivate(a,b,c)					(*(::odma::pODMActivate))(a,b,c)
-+	#define NODMGetDocInfo(a,b,c,d,e)			(*(::odma::pODMGetDocInfo))(a,b,c,d,e)
-+	#define NODMSetDocInfo(a,b,c,d)				(*(::odma::pODMSetDocInfo))(a,b,c,d)
-+	#define NODMGetDMSInfo(a,b,c,d)				(*(::odma::pODMGetDMSInfo))(a,b,c,d)
-+	#define NODMGetDMSCount()					(*(::odma::pODMGetDMSCount))()
-+	#define NODMGetDMSList(a,b)					(*(::odma::pODMGetDMSList))(a,b)
-+	#define NODMGetDMS(a,b)						(*(::odma::pODMGetDMS))(a,b)
-+	#define NODMSetDMS(a,b)						(*(::odma::pODMSetDMS))(a,b)
-+	#define NODMQueryExecute(a,b,c,d,e)			(*(::odma::pODMQueryExecute))(a,b,c,d,e)
-+	#define NODMQueryGetResults(a,b,c,d,e,f)	(*(::odma::pODMQueryGetResults))(a,b,c,d,e,f)
-+	#define NODMQueryClose(a,b)					(*(::odma::pODMQueryClose))(a,b)
-+	#define NODMCloseDocEx(a,b,c,d,e,f,g)		(*(::odma::pODMCloseDocEx))(a,b,c,d,e,f,g)
-+	#define NODMSaveAsEx(a,b,c,d,e,f,g)			(*(::odma::pODMSaveAsEx))(a,b,c,d,e,f,g)
-+	#define NODMSaveDocEx(a,b,c,d)				(*(::odma::pODMSaveDocEx))(a,b,c,d)
-+	#define NODMSelectDocEx(a,b,c,d,e,f)		(*(::odma::pODMSelectDocEx))(a,b,c,d,e,f)
-+	#define NODMQueryCapability(a,b,c,d,e)		(*(::odma::pODMQueryCapability))(a,b,c,d,e)
-+	#define NODMSetDocEvent(a,b,c,d,e,f,g)		(*(::odma::pODMSetDocEvent))(a,b,c,d,e,f,g)
-+	#define NODMGetAlternateContent(a,b,c,d,e)	(*(::odma::pODMGetAlternateContent))(a,b,c,d,e)
-+	#define NODMSetAlternateContent(a,b,c,d,e)	(*(::odma::pODMSetAlternateContent))(a,b,c,d,e)
-+	#define NODMGetDocRelation(a,b,c,d,e,f)		(*(::odma::pODMGetDocRelation))(a,b,c,d,e,f)
-+	#define NODMSetDocRelation(a,b,c,d,e,f)		(*(::odma::pODMSetDocRelation))(a,b,c,d,e,f)
- 
--	sal_Bool LoadLibrary();
-+	sal_Bool DMSsAvailable();
- 
- 	extern TODMRegisterApp			pODMRegisterApp;
- 	extern TODMUnRegisterApp		pODMUnRegisterApp;
-Index: ucb/source/ucp/odma/odma_provider.cxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_provider.cxx,v
-retrieving revision 1.5
-diff -p -u -r1.5 odma_provider.cxx
---- ucb/source/ucp/odma/odma_provider.cxx	17 Sep 2006 13:58:37 -0000	1.5
-+++ ucb/source/ucp/odma/odma_provider.cxx	6 Nov 2006 00:12:08 -0000
-@@ -459,7 +434,7 @@ void ContentProvider::append(const ::vos
- 		lpszDMSList[strlen(lpszDMSList)+1] = '\0';
- 
- 		::rtl::OString sTitleText(::rtl::OUStringToOString(_sDocumentName,RTL_TEXTENCODING_ASCII_US));
--		::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME WHERE ODM_TITLETEXT = '");
-+		::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME WHERE ODM_TITLETEXT = '");
- 		sQuery += sTitleText;
- 		sQuery += "'";
- 		
-@@ -551,6 +521,12 @@ void ContentProvider::append(const ::vos
- 	return getContentProperty(_sTitle,aFunc);
- }
- // -----------------------------------------------------------------------------
-+::rtl::Reference<ContentProperties> ContentProvider::getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const
-+{
-+	ContentPropertiesMemberFunctor aFunc(::std::mem_fun(&ContentProperties::getDocumentId));
-+	return getContentProperty(_sDocumentId,aFunc);
-+}
-+// -----------------------------------------------------------------------------
- ::rtl::OUString ContentProvider::openDoc(const ::rtl::Reference<ContentProperties>& _rProp)  throw (uno::Exception)
- {
- 	OSL_ENSURE(_rProp.is(),"No valid content properties!");
-Index: ucb/source/ucp/odma/odma_provider.hxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_provider.hxx,v
-retrieving revision 1.4
-diff -p -u -r1.4 odma_provider.hxx
---- ucb/source/ucp/odma/odma_provider.hxx	9 Sep 2005 15:53:43 -0000	1.4
-+++ ucb/source/ucp/odma/odma_provider.hxx	6 Nov 2006 00:12:09 -0000
-@@ -40,6 +40,8 @@
- #define ODMA_PROVIDER_HXX
- 
- #include <ucbhelper/providerhelper.hxx>
-+#include <tools/prewin.h>
-+#include <tools/postwin.h>
- #include "odma_lib.hxx"
- 
- #include "rtl/ref.hxx"
-@@ -60,7 +62,7 @@ namespace odma {
- // UNO service name for the provider. This name will be used by the UCB to
- // create instances of the provider.
- #define ODMA_CONTENT_PROVIDER_SERVICE_NAME \
--				"com.sun.star.ucb.OdmaContentProvider"
-+				"com.sun.star.ucb.ODMAContentProvider"
- //	#define ODMA_CONTENT_PROVIDER_SERVICE_NAME_LENGTH	34
- 
- // URL scheme. This is the scheme the provider will be able to create
-@@ -150,14 +152,21 @@ public:
- 	*/
- 	::rtl::Reference<ContentProperties> queryContentProperty(const ::rtl::OUString& _sDocumentName);
- 
--	/** getContentProperty returns the ContentProperties for the first content with that title
-+	/** getContentPropertyWithTitle returns the ContentProperties for the first content with that title
- 		@param	_sTitle	the title of the document
- 
- 		@return	the content properties
- 	*/
- 	::rtl::Reference<ContentProperties> getContentPropertyWithTitle(const ::rtl::OUString& _sTitle) const;
- 
--	/** getContentProperty returns the ContentProperties for the first content with that SavedAsName
-+	/** getContentPropertyWithDocumentId returns the ContentProperties for the first content with that title
-+		@param	_sTitle	the title of the document
-+
-+		@return	the content properties
-+	*/
-+	::rtl::Reference<ContentProperties> getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const;
-+
-+	/** getContentPropertyWithSavedAsName returns the ContentProperties for the first content with that SavedAsName
- 		@param	_sSaveAsName	the SavedAsName of the document
- 
- 		@return	the content properties
-Index: ucb/source/ucp/odma/odma_services.cxx
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_services.cxx,v
-retrieving revision 1.5
-diff -p -u -r1.5 odma_services.cxx
---- ucb/source/ucp/odma/odma_services.cxx	17 Sep 2006 13:59:05 -0000	1.5
-+++ ucb/source/ucp/odma/odma_services.cxx	6 Nov 2006 00:12:09 -0000
-@@ -52,21 +52,19 @@
- #include <com/sun/star/registry/XRegistryKey.hpp>
- #include "odma_contentprops.hxx"
- #include "odma_provider.hxx"
--#include "odma_lib.hxx"
- 
--using namespace rtl;
- using namespace com::sun::star::uno;
- using namespace com::sun::star::lang;
- using namespace com::sun::star::registry;
- 
- //=========================================================================
- static sal_Bool writeInfo( void * pRegistryKey,
--						   const OUString & rImplementationName,
--   						   Sequence< OUString > const & rServiceNames )
-+						   const rtl::OUString & rImplementationName,
-+   						   Sequence< rtl::OUString > const & rServiceNames )
- {
--	OUString aKeyName( OUString::createFromAscii( "/" ) );
-+	rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
- 	aKeyName += rImplementationName;
--	aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
-+	aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
- 
- 	Reference< XRegistryKey > xKey;
- 	try
-@@ -141,10 +137,8 @@ extern "C" void * SAL_CALL component_get
- 	if ( ::odma::ContentProvider::getImplementationName_Static().
- 				compareToAscii( pImplName ) == 0 )
- 	{
--		if(::odma::LoadLibrary())
-+		if(::odma::DMSsAvailable())
- 			xFactory = ::odma::ContentProvider::createServiceFactory( xSMgr );
--		else
--			OSL_ASSERT(!"Could not load library!");
- 	}
- 
- 	//////////////////////////////////////////////////////////////////////
-Index: ucb/source/ucp/odma/ucpodma.xml
-===================================================================
-RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/ucpodma.xml,v
-retrieving revision 1.3
-diff -p -u -r1.3 ucpodma.xml
---- ucb/source/ucp/odma/ucpodma.xml	25 Aug 2003 13:02:22 -0000	1.3
-+++ ucb/source/ucp/odma/ucpodma.xml	6 Nov 2006 00:12:09 -0000
-@@ -11,7 +11,7 @@
-             Ocke Janssen
-         </author>
-         <name>
--            com.sun.star.comp.ucb.OdmaContentProvider
-+            com.sun.star.comp.ucb.ODMAContentProvider
-         </name>
-         <description>
- 	    This component implements a Content Provider for the Universal
-dummy line to avoid confusing diff-mode
---- officecfg/registry/data/org/openoffice/ucb/Configuration.xcu	8 Sep 2005 15:07:17 -0000	1.9
-+++ officecfg/registry/data/org/openoffice/ucb/Configuration.xcu	13 Mar 2006 11:05:44 -0000
-@@ -151,4 +151,15 @@
-               </prop>
-             </node>
-+            <node oor:name="Provider42" oor:op="replace">
-+              <prop oor:name="ServiceName">
-+                <value>com.sun.star.ucb.ODMAContentProvider</value>
-+              </prop>
-+              <prop oor:name="URLTemplate">
-+                <value>vnd.sun.star.odma</value>
-+              </prop>
-+              <prop oor:name="Arguments">
-+                <value/>
-+              </prop>
-+            </node>
-           </node>
-         </node>
-dummy line to avoid confusing diff-mode
---- scp2/source/ooo/file_library_ooo.scp	17 Feb 2006 16:52:02 -0000	1.184.2.2
-+++ scp2/source/ooo/file_library_ooo.scp	13 Mar 2006 11:07:23 -0000
-@@ -850,6 +850,10 @@
- #endif
- #endif
- 
-+#ifdef WNT
-+SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fps_ODMA, fps_odma.uno )
-+#endif
-+
- SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fps_Office, fps_office.uno )
- SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fpicker, fpicker.uno )
- 
-@@ -2069,4 +2071,6 @@
- SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpexpand1, ucpexpand1.uno)
- 
-+SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpodma1, ucpodma1)
-+
- #ifndef SYSTEM_HUNSPELL
- 
-dummy line to avoid confusing diff-mode
---- desktop/source/app/cmdlineargs.cxx	8 Sep 2005 17:05:40 -0000	1.28
-+++ desktop/source/app/cmdlineargs.cxx	13 Mar 2006 12:00:25 -0000
-@@ -275,4 +282,13 @@
- 					else
- 					{
-+						if( bOpenEvent || bViewEvent || bForceNewEvent || bForceOpenEvent )
-+						{
-+							if( ::rtl::OUString(aArgStr).matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("::ODMA")) )
-+							{
-+								::rtl::OUString sArg = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.odma:/"));
-+								sArg += aArgStr;
-+								aArgStr = sArg;
-+							}	
-+						}
- 						// handle this argument as a filename
- 						if ( bOpenEvent )
-dummy line to avoid confusing diff-mode
---- fpicker/prj/build.lst
-+++ fpicker/prj/build.lst
-@@ -2,6 +2,7 @@
- fp	fpicker\inc							nmake	-	all	fp_inc NULL
- fp	fpicker\source\generic				nmake	-	all	fp_generic fp_inc NULL
- fp	fpicker\source\office				nmake	-	all	fp_office fp_inc NULL
-+fp	fpicker\source\odma				nmake	-	w	fp_odma NULL
- fp	fpicker\source\unx\gnome			nmake	-	u	fp_gnome_filepicker fp_inc NULL
- fp	fpicker\source\unx\kde_unx			nmake	-	u	fp_unx_common fp_inc NULL
- fp	fpicker\source\unx\kde				nmake	-	u	fp_unx_kde_filepicker fp_inc NULL
-dummy line to avoid confusing diff-mode
---- fpicker/source/generic/makefile.mk
-+++ fpicker/source/generic/makefile.mk
-@@ -54,6 +54,7 @@
- SHL1IMPLIB=	i$(TARGET)
- SHL1OBJS=	$(SLOFILES)
- SHL1STDLIBS=\
-+	$(ODMA_LIB_LIB) \
- 	$(VCLLIB) \
- 	$(SVLLIB) \
-         $(SVTOOLLIB) \
-dummy line to avoid confusing diff-mode
---- fpicker/source/generic/fpicker.cxx
-+++ fpicker/source/generic/fpicker.cxx
-@@ -52,6 +52,13 @@
- #include "cppuhelper/implementationentry.hxx"
- #endif
- #include "com/sun/star/lang/XMultiComponentFactory.hpp"
-+
-+#ifdef WNT
-+#include <tools/prewin.h>
-+#include <tools/postwin.h>
-+#include <odma_lib.hxx>
-+#endif
-+
- #include "svtools/miscopt.hxx"
- #include "svtools/pickerhistoryaccess.hxx"
- 
-@@ -75,15 +75,22 @@
-  */
- static OUString FilePicker_getSystemPickerServiceName()
- {
-+#ifdef UNX
- 	OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
- 	if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("gnome"))
- 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFilePicker"));
- 	else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
- 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFilePicker"));
-     else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
-         return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFilePicker"));
--    else
--        return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFilePicker"));
-+#endif
-+#ifdef WNT
-+	if (SvtMiscOptions().TryODMADialog() && ::odma::DMSsAvailable()) {
-+		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.ODMAFilePicker"));
-+	}
-+	return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.Win32FilePicker"));
-+#endif
-+	return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFilePicker"));
- }
- 
- static Reference< css::uno::XInterface > FilePicker_createInstance (
-@@ -144,14 +144,20 @@
- static OUString FolderPicker_getSystemPickerServiceName()
- {
- 	OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
-+#ifdef UNX
- 	if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("gnome"))
- 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFolderPicker"));
- 	else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
- 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFolderPicker"));
-     else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
-         return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFolderPicker"));
--	else
--		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFolderPicker"));
-+#endif
-+#ifdef WNT
-+	if (SvtMiscOptions().TryODMADialog() && ::odma::DMSsAvailable()) {
-+		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.ODMAFolderPicker"));
-+	}
-+#endif
-+	return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFolderPicker"));
- }
- 
- static Reference< css::uno::XInterface > FolderPicker_createInstance (
-diff -ruN fpicker/source/odma/ODMAFilePicker.cxx fpicker/source/odma/ODMAFilePicker.cxx
---- fpicker/source/odma/ODMAFilePicker.cxx	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/ODMAFilePicker.cxx	2006-11-03 13:31:25.014750000 +0000
-@@ -0,0 +1,565 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision: 12010 $
-+ *
-+ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_fpicker.hxx"
-+
-+#include "ODMAFilePicker.hxx"
-+
-+#ifndef _TOOLS_DEBUG_HXX
-+#include <tools/debug.hxx>
-+#endif
-+
-+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
-+#include <com/sun/star/beans/PropertyValue.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_BEANS_STRINGPAIR_HPP_
-+#include <com/sun/star/beans/StringPair.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_UI_DIALOGS_FILEPREVIEWIMAGEFORMATS_HPP_
-+#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UI_DIALOGS_EXECUTABLEDIALOGRESULTS_HPP_
-+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UI_DIALOGS_TEMPLATEDESCRIPTION_HPP_
-+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_
-+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_UNO_ANY_HXX_
-+#include <com/sun/star/uno/Any.hxx>
-+#endif
-+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-+#include <com/sun/star/uno/Sequence.hxx>
-+#endif
-+
-+#ifndef _COMPHELPER_SEQUENCE_HXX_
-+#include <comphelper/sequence.hxx>
-+#endif
-+#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
-+#include <cppuhelper/typeprovider.hxx>
-+#endif
-+#ifndef _UCBHELPER_CONTENT_HXX
-+#include <ucbhelper/content.hxx>
-+#endif
-+#ifndef _UNOTOOLS_UCBHELPER_HXX
-+#include <unotools/ucbhelper.hxx>
-+#endif
-+
-+#ifndef ODMA_LIB_HXX
-+#include <tools/prewin.h>
-+#include <tools/postwin.h>
-+#include <odma_lib.hxx>
-+#endif
-+
-+// using ----------------------------------------------------------------
-+
-+using namespace ::com::sun::star::beans;
-+using namespace ::com::sun::star::lang;
-+using namespace ::com::sun::star::ui::dialogs;
-+using namespace ::com::sun::star::ucb;
-+using namespace ::com::sun::star::uno;
-+using namespace ::com::sun::star::util;
-+using namespace ::utl;
-+
-+//------------------------------------------------------------------------------------
-+// class ODMAFilePicker
-+//------------------------------------------------------------------------------------
-+ODMAFilePicker::ODMAFilePicker( const Reference < XMultiServiceFactory >& xFactory ) :
-+	cppu::WeakComponentImplHelper9<
-+	  XFilterManager, 
-+	  XFilterGroupManager,
-+	  XFilePickerControlAccess,
-+	  XFilePickerNotifier,
-+	  XFilePreview,
-+	  XInitialization,
-+	  XCancellable,
-+	  XEventListener,
-+	  XServiceInfo>( m_rbHelperMtx ),
-+	m_bMultiSelectionMode( sal_False ),
-+	m_aDefaultName( ),
-+	m_aFiles( ),
-+	m_nDialogKind( OPEN )
-+{
-+	m_bUseDMS = ::odma::DMSsAvailable();
-+	m_xSystemFilePicker = xFactory->createInstance(
-+		::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.Win32FilePicker" ) );
-+}
-+
-+// XExecutableDialog functions
-+
-+void SAL_CALL ODMAFilePicker::setTitle( const ::rtl::OUString& aTitle )
-+	throw (RuntimeException)
-+{
-+	Reference< XExecutableDialog > xExecutableDialog( m_xSystemFilePicker, UNO_QUERY );
-+	xExecutableDialog->setTitle( aTitle);
-+}
-+
-+sal_Int16 SAL_CALL ODMAFilePicker::execute( )
-+	throw (RuntimeException)
-+{
-+	ODMSTATUS status;
-+	ODMHANDLE handle;
-+	WORD count = 0;
-+	DWORD flags;
-+
-+	status = NODMRegisterApp( &handle, ODM_API_VERSION, "sodma", (DWORD) GetActiveWindow( ), NULL );
-+	if (status == ODM_SUCCESS)
-+	{
-+		if (m_nDialogKind == OPEN)
-+		{
-+			const int MAXDOCS = 10;
-+			char docids[ODM_DOCID_MAX*MAXDOCS+1];
-+			WORD docidslen = sizeof( docids );
-+
-+			flags = 0;
-+			if (m_bMultiSelectionMode)
-+				count = MAXDOCS;
-+			else
-+				count = 1;
-+			status = NODMSelectDocEx( handle, docids, &docidslen, &count, &flags, NULL );
-+			if (status == ODM_SUCCESS)
-+			{
-+				// GroupWise doesn't set docidslen or count, so
-+				// calculate number of document IDs manually 
-+				char *p = docids;
-+				count = 0;
-+				while (*p) {
-+					count++;
-+					p += strlen( p ) + 1;
-+				}
-+			}
-+			else if (status == ODM_E_NOSUPPORT)
-+			{
-+				status = NODMSelectDoc( handle, docids, &flags );
-+				if (status == ODM_SUCCESS)
-+					count = 1;
-+			}
-+			NODMUnRegisterApp( handle );
-+			if (status == ODM_SUCCESS)
-+			{
-+				rtl::OUString *strings = new rtl::OUString[count];
-+				int i;
-+				char *p = docids;
-+				
-+				for (i = 0; i < count; i++) {
-+					// Insane API... the first element is a full URI, the rest
-+					// are just the "basenames" in the same "directory".
-+					if (i == 0)
-+						strings[0] = rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) + rtl::OUString::createFromAscii( p );
-+					else
-+						strings[i] = rtl::OUString::createFromAscii( p );
-+					p += strlen( p );
-+				}
-+
-+				m_aFiles = Sequence< rtl::OUString >( strings, count );
-+				delete[] strings;
-+				return ExecutableDialogResults::OK;
-+			}
-+		}
-+		else /* m_nDialogKind == SAVE */
-+		{
-+			char newdocid[ODM_DOCID_MAX+1];
-+			
-+			if (m_aDefaultName.getLength() == 0 ||
-+				!m_aDefaultName.matchIgnoreAsciiCaseAsciiL( "::ODMA\\", 7, 0 ))
-+			{
-+				char tempdocid[ODM_DOCID_MAX+1];
-+
-+				status = NODMNewDoc( handle, tempdocid, ODM_SILENT, NULL, NULL );
-+				if (status == ODM_SUCCESS)
-+					status = NODMSaveAs( handle, tempdocid, newdocid, NULL, NULL, NULL );
-+			}
-+			else
-+			{
-+				rtl::OString sDefaultName = rtl::OUStringToOString( m_aDefaultName, RTL_TEXTENCODING_ASCII_US );
-+				status = NODMSaveAs( handle,
-+									 const_cast<sal_Char*>( sDefaultName.getStr() ),
-+									 newdocid, NULL, NULL, NULL );
-+			}
-+
-+			NODMUnRegisterApp( handle );
-+			if (status == ODM_SUCCESS)
-+			{
-+				rtl::OUString s( rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) +
-+								 rtl::OUString::createFromAscii( newdocid ) );
-+				// Create a Content for the odma URL so that
-+				// odma::ContentProvider will learn about the DOCID we
-+				// just created.
-+				ucbhelper::Content content( s, Reference< XCommandEnvironment >() );
-+				m_aFiles = Sequence< rtl::OUString >( &s, 1 );
-+				return ExecutableDialogResults::OK;
-+			}
-+		}
-+	}
-+	if (status == ODM_E_APPSELECT)
-+	{
-+		m_bUseDMS = sal_False;
-+
-+		Reference< XExecutableDialog > xExecutableDialog( m_xSystemFilePicker, UNO_QUERY );
-+		return xExecutableDialog->execute();
-+	}
-+
-+	// Fallback
-+	return ExecutableDialogResults::CANCEL;
-+}
-+
-+// XFilePicker functions
-+
-+void SAL_CALL ODMAFilePicker::setMultiSelectionMode( sal_Bool bMode )
-+	throw( RuntimeException )
-+{
-+	m_bMultiSelectionMode = bMode;
-+
-+	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePicker->setMultiSelectionMode( bMode );
-+}
-+
-+void SAL_CALL ODMAFilePicker::setDefaultName( const rtl::OUString& aName )
-+	throw( RuntimeException )
-+{
-+	// When editing a document from DMS, and doing Save As, this is
-+	// called twice, first with the complete DOCID, the second time
-+	// with the "extension" removed. Of course, this is bogus, as
-+	// DOCIDs should be treated as opaque strings, they don't have
-+	// "extensions".
-+
-+	// In the GroupWise case a DOCID is like
-+	// ::ODMA\GRPWISE\FOO1.BAR.FOO-Bla_bla:12345.12 where the final
-+	// dot separates the version number, not an "extension".
-+	//
-+	// So ignore the second call.
-+	//
-+	// The second call without "extension" is done if the
-+	// XFilePickerControlAccess is set to have auto-extension turned
-+	// on. (See sfx2/source/dialog/filedlghelper.cxx:
-+	// FileDialogHelper_Impl::implInitializeFileName().) Thus we could
-+	// alternatively make sure that a getValue call to get
-+	// ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION returns
-+	// false. But that might be hard as we don't know in advance
-+	// whether the user will click the "use application dialog"
-+	// button. If so, we indeed do use auto-extensions.
-+	//
-+	// Yes, this is ugly, relying on knowing details on how this
-+	// function will be called.
-+
-+	if ( m_aDefaultName.getLength() == 0 )
-+		m_aDefaultName = aName;
-+
-+	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePicker->setDefaultName( aName );
-+}
-+
-+void SAL_CALL ODMAFilePicker::setDisplayDirectory( const rtl::OUString& aDirectory )
-+    throw( IllegalArgumentException, RuntimeException )
-+{
-+	m_aDisplayDirectory = aDirectory;
-+
-+	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePicker->setDisplayDirectory( aDirectory );
-+}
-+
-+rtl::OUString SAL_CALL ODMAFilePicker::getDisplayDirectory( )
-+	throw( RuntimeException )
-+{
-+	if (m_bUseDMS)
-+		return m_aDisplayDirectory;
-+
-+	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePicker->getDisplayDirectory();
-+}
-+
-+Sequence< rtl::OUString > SAL_CALL ODMAFilePicker::getFiles( )
-+	throw( RuntimeException )
-+{
-+	if (m_bUseDMS)
-+		return m_aFiles;
-+
-+	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePicker->getFiles();
-+}
-+
-+// XFilePickerControlAccess functions
-+
-+void SAL_CALL ODMAFilePicker::setValue( sal_Int16 nElementID,
-+										sal_Int16 nControlAction,
-+										const Any& rValue )
-+    throw( RuntimeException )
-+{
-+	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePickerControlAccess->setValue( nElementID, nControlAction, rValue );
-+}
-+
-+Any SAL_CALL ODMAFilePicker::getValue( sal_Int16 nElementID, sal_Int16 nControlAction )
-+    throw( RuntimeException )
-+{
-+	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePickerControlAccess->getValue( nElementID, nControlAction );
-+}
-+
-+void SAL_CALL ODMAFilePicker::setLabel( sal_Int16 nLabelID, const rtl::OUString& rValue )
-+    throw ( RuntimeException )
-+{
-+	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePickerControlAccess->setLabel( nLabelID, rValue );
-+}
-+
-+rtl::OUString SAL_CALL ODMAFilePicker::getLabel( sal_Int16 nLabelID )
-+    throw ( RuntimeException )
-+{
-+	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePickerControlAccess->getLabel( nLabelID );
-+}
-+
-+void SAL_CALL ODMAFilePicker::enableControl( sal_Int16 nElementID, sal_Bool bEnable )
-+    throw( RuntimeException )
-+{
-+	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePickerControlAccess->enableControl( nElementID, bEnable );
-+}
-+
-+// XFilePickerNotifier functions
-+
-+void SAL_CALL ODMAFilePicker::addFilePickerListener( const Reference< XFilePickerListener >& xListener )
-+	throw ( RuntimeException )
-+{
-+	Reference< XFilePickerNotifier > xFilePickerNotifier( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePickerNotifier->addFilePickerListener( xListener );
-+}
-+
-+void SAL_CALL ODMAFilePicker::removeFilePickerListener( const Reference< XFilePickerListener >& xListener )
-+	throw ( RuntimeException )
-+{
-+	Reference< XFilePickerNotifier > xFilePickerNotifier( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePickerNotifier->removeFilePickerListener( xListener );
-+}
-+
-+// XFilePreview functions
-+
-+Sequence< sal_Int16 > SAL_CALL ODMAFilePicker::getSupportedImageFormats( )
-+    throw ( RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePreview->getSupportedImageFormats();
-+}
-+
-+sal_Int32 SAL_CALL ODMAFilePicker::getTargetColorDepth( )
-+	throw ( RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePreview->getTargetColorDepth();
-+}
-+
-+sal_Int32 SAL_CALL ODMAFilePicker::getAvailableWidth( )
-+	throw ( RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePreview->getAvailableWidth();
-+}
-+
-+sal_Int32 SAL_CALL ODMAFilePicker::getAvailableHeight( )
-+	throw ( RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePreview->getAvailableHeight();
-+}
-+
-+void SAL_CALL ODMAFilePicker::setImage( sal_Int16 aImageFormat, const Any& rImage )
-+    throw ( IllegalArgumentException, RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	xFilePreview->setImage( aImageFormat, rImage);
-+}
-+
-+sal_Bool SAL_CALL ODMAFilePicker::setShowState( sal_Bool bShowState )
-+    throw ( RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePreview->setShowState( bShowState);
-+}
-+
-+sal_Bool SAL_CALL ODMAFilePicker::getShowState( )
-+	throw ( RuntimeException )
-+{
-+	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilePreview->getShowState();
-+}
-+
-+// XFilterGroupManager functions
-+
-+void SAL_CALL ODMAFilePicker::appendFilterGroup( const ::rtl::OUString& sGroupTitle,
-+												 const Sequence< StringPair >& aFilters )
-+	throw ( IllegalArgumentException, RuntimeException )
-+{
-+	Reference< XFilterGroupManager > xFilterGroupManager( m_xSystemFilePicker, UNO_QUERY );
-+	xFilterGroupManager->appendFilterGroup( sGroupTitle, aFilters );
-+}
-+
-+// XFilterManager functions
-+
-+void SAL_CALL ODMAFilePicker::appendFilter( const rtl::OUString& aTitle,
-+                                            const rtl::OUString& aFilter )
-+    throw( IllegalArgumentException, RuntimeException )
-+{
-+	Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
-+	xFilterManager->appendFilter( aTitle, aFilter );
-+}
-+
-+void SAL_CALL ODMAFilePicker::setCurrentFilter( const rtl::OUString& aTitle )
-+    throw( IllegalArgumentException, RuntimeException )
-+{
-+	Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
-+	xFilterManager->setCurrentFilter( aTitle );
-+}
-+
-+rtl::OUString SAL_CALL ODMAFilePicker::getCurrentFilter( )
-+    throw( RuntimeException )
-+{
-+	Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
-+	return xFilterManager->getCurrentFilter();
-+}
-+
-+// XInitialization functions
-+
-+void SAL_CALL ODMAFilePicker::initialize( const Sequence< Any >& aArguments )
-+	throw ( Exception, RuntimeException )
-+{
-+	if (aArguments.getLength( ) > 0)
-+	{
-+		Any aAny = aArguments[0];
-+
-+		if ( (aAny.getValueType() == ::getCppuType((sal_Int16*)0)) ||
-+			 (aAny.getValueType() == ::getCppuType((sal_Int8*)0)) )
-+		{
-+			sal_Int16 nTemplateId = -1;
-+			aAny >>= nTemplateId;
-+
-+			switch (nTemplateId) {
-+			case TemplateDescription::FILEOPEN_SIMPLE:
-+			case TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
-+			case TemplateDescription::FILEOPEN_PLAY:
-+			case TemplateDescription::FILEOPEN_READONLY_VERSION:
-+			case TemplateDescription::FILEOPEN_LINK_PREVIEW:
-+				m_nDialogKind = OPEN;
-+				break;
-+			default:
-+				m_nDialogKind = SAVE;
-+			}
-+		}
-+	}
-+
-+	Reference< XInitialization > xInitialization( m_xSystemFilePicker, UNO_QUERY );
-+	xInitialization->initialize( aArguments );
-+}
-+
-+// XCancellable functions
-+
-+void SAL_CALL ODMAFilePicker::cancel( )
-+	throw( ::com::sun::star::uno::RuntimeException )
-+{
-+	Reference< XCancellable > xCancellable( m_xSystemFilePicker, UNO_QUERY );
-+	xCancellable->cancel();
-+}
-+
-+// XEventListener functions
-+
-+void SAL_CALL ODMAFilePicker::disposing( const ::com::sun::star::lang::EventObject& aEvent )
-+	throw( RuntimeException )
-+{
-+	Reference< XEventListener > xEventListener( m_xSystemFilePicker, UNO_QUERY );
-+	xEventListener->disposing( aEvent );
-+}
-+
-+// XServiceInfo functions
-+
-+rtl::OUString SAL_CALL ODMAFilePicker::getImplementationName( )
-+	throw( RuntimeException )
-+{
-+	return impl_getStaticImplementationName();
-+}
-+
-+sal_Bool SAL_CALL ODMAFilePicker::supportsService( const rtl::OUString& sServiceName )
-+	throw( RuntimeException )
-+{
-+    Sequence< rtl::OUString > seqServiceNames = getSupportedServiceNames();
-+    const rtl::OUString* pArray = seqServiceNames.getConstArray();
-+    for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
-+	{
-+        if ( sServiceName == pArray[i] )
-+		{
-+            return sal_True ;
-+		}
-+	}
-+    return sal_False ;
-+}
-+
-+Sequence< rtl::OUString > SAL_CALL ODMAFilePicker::getSupportedServiceNames( )
-+	throw( RuntimeException )
-+{
-+	return impl_getStaticSupportedServiceNames();
-+}
-+
-+Sequence< rtl::OUString > ODMAFilePicker::impl_getStaticSupportedServiceNames( )
-+{
-+    Sequence< rtl::OUString > seqServiceNames( 2 );
-+    rtl::OUString* pArray = seqServiceNames.getArray();
-+    pArray[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFilePicker" );
-+
-+	// Super-ugly, but check the function sal_Bool
-+	// lcl_isSystemFilePicker( const Reference< XFilePicker >& ) in
-+	// sfx2/source/dialog/filedlghelper.cxx 
-+
-+    // Lovely undocumented coupling right across abstraction layers,
-+    // isn't it?  If we don't claim to implement this "service" (which
-+    // is not defined in any IDL file, btw), we get hangs.
-+
-+    pArray[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
-+    return seqServiceNames ;
-+}
-+
-+rtl::OUString ODMAFilePicker::impl_getStaticImplementationName( )
-+{
-+    return rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFilePicker" );
-+}
-+
-+Reference< XInterface > SAL_CALL ODMAFilePicker::impl_createInstance(
-+	const Reference< XComponentContext >& rxContext)
-+	throw( Exception )
-+{
-+	Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
-+	return Reference< XInterface >( *new ODMAFilePicker( xServiceManager ) );
-+}
-diff -ruN fpicker/source/odma/ODMAFilePicker.hxx fpicker/source/odma/ODMAFilePicker.hxx
---- fpicker/source/odma/ODMAFilePicker.hxx	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/ODMAFilePicker.hxx	2006-11-02 01:39:33.483549300 +0000
-@@ -0,0 +1,242 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision: 12010 $
-+ *
-+ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#ifndef INCLUDED_ODMA_FILEPICKER_HXX
-+#define INCLUDED_ODMA_FILEPICKER_HXX
-+
-+#ifndef _CPPUHELPER_COMPBASE9_HXX_
-+#include <cppuhelper/compbase9.hxx>
-+#endif
-+
-+#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_
-+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERNOTIFIER_HPP_
-+#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILEPREVIEW_HPP_
-+#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILTERMANAGER_HPP_
-+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERGROUPMANAGER_HPP_
-+#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERLISTENER_HPP_
-+#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_
-+#include <com/sun/star/util/XCancellable.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
-+#include <com/sun/star/lang/XServiceInfo.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UNO_XCOMPONENT_CONTEXT_HPP_
-+#include <com/sun/star/uno/XComponentContext.hpp>
-+#endif
-+
-+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
-+#include <com/sun/star/lang/XInitialization.hpp>
-+#endif
-+
-+// class ODMAFilePicker ---------------------------------------------------
-+
-+class ODMAFilePicker :
-+	public cppu::WeakComponentImplHelper9<
-+	  ::com::sun::star::ui::dialogs::XFilterManager,
-+	  ::com::sun::star::ui::dialogs::XFilterGroupManager,
-+	  ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
-+	  ::com::sun::star::ui::dialogs::XFilePickerNotifier,
-+	  ::com::sun::star::ui::dialogs::XFilePreview,
-+	  ::com::sun::star::lang::XInitialization,
-+      ::com::sun::star::util::XCancellable,
-+	  ::com::sun::star::lang::XEventListener,
-+	  ::com::sun::star::lang::XServiceInfo >		
-+{
-+private:
-+	sal_Bool m_bUseDMS;
-+	sal_Bool m_bMultiSelectionMode;
-+	rtl::OUString m_aDefaultName;
-+	rtl::OUString m_aDisplayDirectory;
-+	::com::sun::star::uno::Sequence< rtl::OUString > m_aFiles;
-+	enum { OPEN, SAVE } m_nDialogKind;
-+
-+	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xSystemFilePicker;
-+
-+protected:
-+	::osl::Mutex m_rbHelperMtx;
-+
-+public:
-+
-+	ODMAFilePicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
-+
-+	// XFilterManager functions
-+
-+	virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle,
-+										const ::rtl::OUString& aFilter )
-+		throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
-+
-+	virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle )
-+		throw( ::com::sun::star::lang::IllegalArgumentException,
-+			   ::com::sun::star::uno::RuntimeException );
-+
-+	virtual ::rtl::OUString SAL_CALL getCurrentFilter( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	// XFilterGroupManager functions
-+
-+	virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle,
-+											 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters )
-+		throw (::com::sun::star::lang::IllegalArgumentException,
-+			   ::com::sun::star::uno::RuntimeException );
-+
-+	// XFilePickerControlAccess functions
-+
-+	virtual void SAL_CALL setValue( sal_Int16 nControlID,
-+									sal_Int16 nControlAction,
-+									const ::com::sun::star::uno::Any& aValue )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 nControlID,
-+											 sal_Int16 nControlAction )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual void SAL_CALL setLabel( sal_Int16 nControlID,
-+									const ::rtl::OUString& aValue )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlID )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+	virtual void SAL_CALL enableControl( sal_Int16 nControlID,
-+										 sal_Bool bEnable )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	// XFilePicker functions
-+
-+	virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
-+		throw( ::com::sun::star::lang::IllegalArgumentException,
-+			   ::com::sun::star::uno::RuntimeException );
-+
-+	virtual ::rtl::OUString SAL_CALL getDisplayDirectory( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	// XExecutableDialog functions
-+
-+	virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle )
-+		throw (::com::sun::star::uno::RuntimeException);
-+
-+	virtual sal_Int16 SAL_CALL execute(  )
-+		throw (::com::sun::star::uno::RuntimeException);
-+
-+	// XFilePickerNotifier functions
-+
-+    virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+	// XFilePreview functions
-+
-+    virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Int32 SAL_CALL getTargetColorDepth( )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Int32 SAL_CALL getAvailableWidth( )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Int32 SAL_CALL getAvailableHeight( )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual void SAL_CALL setImage( sal_Int16 aImageFormat,
-+									const ::com::sun::star::uno::Any& aImage )
-+		throw ( ::com::sun::star::lang::IllegalArgumentException,
-+				::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Bool SAL_CALL getShowState( )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+	// XInitialization functions
-+
-+    virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
-+		throw ( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
-+
-+	// XCancellable functions
-+
-+	virtual void SAL_CALL cancel( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	// XEventListener functions
-+
-+	using cppu::WeakComponentImplHelperBase::disposing;
-+	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) 
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	// XServiceInfo functions
-+
-+    virtual ::rtl::OUString SAL_CALL getImplementationName( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	/* Helper for XServiceInfo */
-+	static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames( );
-+	static ::rtl::OUString impl_getStaticImplementationName( );
-+
-+    /* Helper for registry */
-+	static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance ( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
-+		throw( ::com::sun::star::uno::Exception );
-+};
-+
-+#endif // INCLUDED_ODMA_FILEPICKER_HXX
-diff -ruN fpicker/source/odma/ODMAFolderPicker.cxx fpicker/source/odma/ODMAFolderPicker.cxx
---- fpicker/source/odma/ODMAFolderPicker.cxx	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/ODMAFolderPicker.cxx	2006-10-30 01:09:51.281250000 +0000
-@@ -0,0 +1,203 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision: 12010 $
-+ *
-+ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_fpicker.hxx"
-+
-+#include "ODMAFolderPicker.hxx"
-+
-+#define _SVSTDARR_STRINGSDTOR
-+#include "svtools/svstdarr.hxx"
-+
-+#ifndef  _COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HPP_
-+#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_CONTAINER_XSET_HPP_
-+#include <com/sun/star/container/XSet.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_UNO_ANY_HXX_
-+#include <com/sun/star/uno/Any.hxx>
-+#endif
-+#ifndef  _CPPUHELPER_FACTORY_HXX_
-+#include <cppuhelper/factory.hxx>
-+#endif
-+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
-+#include <com/sun/star/beans/XPropertySet.hpp>
-+#endif
-+
-+#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
-+#include <svtools/pathoptions.hxx>
-+#endif
-+
-+#ifndef ODMA_LIB_HXX
-+#include <tools/prewin.h>
-+#include <odma_lib.hxx>
-+#include <tools/postwin.h>
-+#endif
-+
-+// using ----------------------------------------------------------------
-+
-+using namespace ::com::sun::star::beans;
-+using namespace ::com::sun::star::container;
-+using namespace ::com::sun::star::lang;
-+using namespace ::com::sun::star::uno;
-+
-+//------------------------------------------------------------------------------------
-+// class ODMAFolderPicker
-+//------------------------------------------------------------------------------------
-+
-+//------------------------------------------------------------------------------------
-+ODMAFolderPicker::ODMAFolderPicker( const Reference < XMultiServiceFactory >& xFactory ) :
-+	cppu::WeakComponentImplHelper2<
-+	  XFolderPicker,
-+	  XServiceInfo>( m_rbHelperMtx ),
-+	m_bUseDMS( sal_False )
-+{
-+	m_xInterface = xFactory->createInstance(
-+		::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" ) );
-+}
-+
-+// XExecutableDialog functions
-+
-+void SAL_CALL ODMAFolderPicker::setTitle( const ::rtl::OUString& _rTitle ) throw (RuntimeException)
-+{
-+	if (m_bUseDMS)
-+		return;
-+
-+	Reference< XExecutableDialog > xExecutableDialog( m_xInterface, UNO_QUERY );
-+	xExecutableDialog->setTitle( _rTitle);
-+}
-+
-+sal_Int16 SAL_CALL ODMAFolderPicker::execute( )
-+	throw (RuntimeException)
-+{
-+	if (m_bUseDMS)
-+		throw new RuntimeException( );
-+
-+	Reference< XExecutableDialog > xExecutableDialog( m_xInterface, UNO_QUERY );
-+	return xExecutableDialog->execute();
-+}
-+
-+// XFolderPicker functions
-+
-+void SAL_CALL ODMAFolderPicker::setDisplayDirectory( const ::rtl::OUString& aDirectory )
-+    throw( IllegalArgumentException, RuntimeException )
-+{
-+	if (m_bUseDMS)
-+		return;
-+
-+	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
-+	xFolderPicker->setDisplayDirectory( aDirectory );
-+}
-+
-+::rtl::OUString SAL_CALL ODMAFolderPicker::getDisplayDirectory( )
-+	throw( RuntimeException )
-+{
-+	if (m_bUseDMS)
-+		return rtl::OUString();
-+
-+	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
-+	return xFolderPicker->getDisplayDirectory();
-+}
-+
-+::rtl::OUString SAL_CALL ODMAFolderPicker::getDirectory( )
-+	throw( RuntimeException )
-+{
-+	if (m_bUseDMS)
-+		return rtl::OUString();
-+
-+	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
-+	return xFolderPicker->getDirectory();
-+}
-+
-+void SAL_CALL ODMAFolderPicker::setDescription( const ::rtl::OUString& aDescription )
-+    throw( RuntimeException )
-+{
-+	if (m_bUseDMS)
-+		return;
-+
-+	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
-+	xFolderPicker->setDescription( aDescription );
-+}
-+
-+// XServiceInfo
-+
-+::rtl::OUString SAL_CALL ODMAFolderPicker::getImplementationName( )
-+	throw( RuntimeException )
-+{
-+	return impl_getStaticImplementationName();
-+}
-+
-+sal_Bool SAL_CALL ODMAFolderPicker::supportsService( const ::rtl::OUString& sServiceName )
-+	throw( RuntimeException )
-+{
-+    Sequence< ::rtl::OUString > seqServiceNames = getSupportedServiceNames();
-+    const ::rtl::OUString* pArray = seqServiceNames.getConstArray();
-+    for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
-+	{
-+        if ( sServiceName == pArray[i] )
-+		{
-+            return sal_True ;
-+		}
-+	}
-+    return sal_False ;
-+}
-+
-+Sequence< ::rtl::OUString > SAL_CALL ODMAFolderPicker::getSupportedServiceNames()
-+	throw( RuntimeException )
-+{
-+	return impl_getStaticSupportedServiceNames();
-+}
-+
-+Sequence< ::rtl::OUString > ODMAFolderPicker::impl_getStaticSupportedServiceNames( )
-+{
-+    Sequence< ::rtl::OUString > seqServiceNames( 2 );
-+    ::rtl::OUString* pArray = seqServiceNames.getArray();
-+    pArray[0] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FolderPicker" );
-+    pArray[1] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFolderPicker" );
-+    return seqServiceNames ;
-+}
-+
-+::rtl::OUString ODMAFolderPicker::impl_getStaticImplementationName( )
-+{
-+    return ::rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFolderPicker" );
-+}
-+
-+Reference< XInterface > SAL_CALL ODMAFolderPicker::impl_createInstance( const Reference< XComponentContext >& rxContext )
-+    throw( Exception )
-+{
-+	Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
-+	return Reference< XInterface >( *new ODMAFolderPicker( xServiceManager ) );
-+}
-diff -ruN fpicker/source/odma/ODMAFolderPicker.hxx fpicker/source/odma/ODMAFolderPicker.hxx
---- fpicker/source/odma/ODMAFolderPicker.hxx	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/ODMAFolderPicker.hxx	2006-10-26 22:36:34.718125000 +0000
-@@ -0,0 +1,118 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision: 12010 $
-+ *
-+ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#ifndef INCLUDED_ODMA_FOLDERPICKER_HXX
-+#define INCLUDED_ODMA_FOLDERPICKER_HXX
-+
-+#ifndef _CPPUHELPER_COMPBASE2_HXX_
-+#include <cppuhelper/compbase2.hxx>
-+#endif
-+
-+#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HPP_
-+#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
-+#include <com/sun/star/lang/XServiceInfo.hpp>
-+#endif
-+#ifndef  _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
-+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
-+#include <com/sun/star/lang/DisposedException.hpp>
-+#endif
-+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
-+#include <com/sun/star/uno/XComponentContext.hpp>
-+#endif
-+
-+// class ODMAFolderPicker ---------------------------------------------------
-+
-+class ODMAFolderPicker :
-+	public cppu::WeakComponentImplHelper2<
-+	  ::com::sun::star::ui::dialogs::XFolderPicker,	
-+	  ::com::sun::star::lang::XServiceInfo >
-+{
-+private:
-+	sal_Bool m_bUseDMS;
-+
-+protected:
-+	::osl::Mutex m_rbHelperMtx;
-+
-+	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xInterface;
-+
-+public:
-+	ODMAFolderPicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
-+
-+	// XFolderPicker functions
-+
-+	virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
-+		throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
-+
-+	virtual ::rtl::OUString SAL_CALL getDisplayDirectory( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual ::rtl::OUString SAL_CALL getDirectory( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual void SAL_CALL setDescription( const ::rtl::OUString& aDescription )
-+		throw ( ::com::sun::star::uno::RuntimeException );
-+
-+	// XExecutableDialog functions
-+
-+	virtual void SAL_CALL setTitle( const ::rtl::OUString& _rTitle )
-+		throw (::com::sun::star::uno::RuntimeException);
-+
-+	virtual sal_Int16 SAL_CALL execute(  )
-+		throw (::com::sun::star::uno::RuntimeException);
-+
-+	// XServiceInfo functions
-+
-+    virtual ::rtl::OUString SAL_CALL getImplementationName( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+    virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
-+		throw( ::com::sun::star::uno::RuntimeException );
-+
-+	/* Helper for XServiceInfo */
-+	static com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames( );
-+	static ::rtl::OUString impl_getStaticImplementationName( );
-+
-+	/* Helper for registry */
-+	static ::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL impl_createInstance ( const ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext )
-+		throw( com::sun::star::uno::Exception );
-+};
-+
-+#endif // INCLUDED_ODMA_FOLDERPICKER_HXX
-diff -ruN fpicker/source/odma/exports.map fpicker/source/odma/exports.map
---- fpicker/source/odma/exports.map	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/exports.map	2006-10-25 20:34:28.536983200 +0000
-@@ -0,0 +1,8 @@
-+UDK_3_0_0 {
-+    global:
-+		component_getImplementationEnvironment;
-+		component_writeInfo;
-+		component_getFactory;
-+	local:
-+		*;
-+};
-diff -ruN fpicker/source/odma/fps_odma.cxx fpicker/source/odma/fps_odma.cxx
---- fpicker/source/odma/fps_odma.cxx	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/fps_odma.cxx	2006-10-25 01:19:43.329875000 +0000
-@@ -0,0 +1,90 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision: 12010 $
-+ *
-+ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_fpicker.hxx"
-+
-+#ifndef _SAL_TYPES_H_
-+#include "sal/types.h"
-+#endif
-+
-+#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-+#include "cppuhelper/implementationentry.hxx"
-+#endif
-+
-+#include "ODMAFilePicker.hxx"
-+#include "ODMAFolderPicker.hxx"
-+
-+static cppu::ImplementationEntry g_entries[] =
-+{
-+	{
-+		ODMAFilePicker::impl_createInstance,
-+		ODMAFilePicker::impl_getStaticImplementationName,
-+		ODMAFilePicker::impl_getStaticSupportedServiceNames,
-+		cppu::createSingleComponentFactory, 0, 0
-+	},
-+	{
-+		ODMAFolderPicker::impl_createInstance,
-+		ODMAFolderPicker::impl_getStaticImplementationName,
-+		ODMAFolderPicker::impl_getStaticSupportedServiceNames,
-+		cppu::createSingleComponentFactory, 0, 0
-+	},
-+	{ 0, 0, 0, 0, 0, 0 }
-+};
-+
-+extern "C"
-+{
-+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
-+	const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */)
-+{
-+	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-+}
-+
-+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
-+	void * pServiceManager, void * pRegistryKey)
-+{
-+	return cppu::component_writeInfoHelper (
-+		pServiceManager, pRegistryKey, g_entries);
-+}
-+
-+SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
-+	const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
-+{
-+	return cppu::component_getFactoryHelper (
-+		pImplementationName, pServiceManager, pRegistryKey, g_entries);
-+}
-+
-+} // extern "C"
-diff -ruN fpicker/source/odma/makefile.mk fpicker/source/odma/makefile.mk
---- fpicker/source/odma/makefile.mk	1970-01-01 00:00:00.000000000 +0000
-+++ fpicker/source/odma/makefile.mk	2006-10-30 14:40:05.281250000 +0000
-@@ -0,0 +1,79 @@
-+#*************************************************************************
-+#
-+#   OpenOffice.org - a multi-platform office productivity suite
-+#
-+#   $RCSfile$
-+#
-+#   $Revision: 12010 $
-+#
-+#   last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
-+#
-+#   The Contents of this file are made available subject to
-+#   the terms of GNU Lesser General Public License Version 2.1.
-+#
-+#
-+#     GNU Lesser General Public License Version 2.1
-+#     =============================================
-+#     Copyright 2005 by Sun Microsystems, Inc.
-+#     901 San Antonio Road, Palo Alto, CA 94303, USA
-+#
-+#     This library is free software; you can redistribute it and/or
-+#     modify it under the terms of the GNU Lesser General Public
-+#     License version 2.1, as published by the Free Software Foundation.
-+#
-+#     This library is distributed in the hope that it will be useful,
-+#     but WITHOUT ANY WARRANTY; without even the implied warranty of
-+#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+#     Lesser General Public License for more details.
-+#
-+#     You should have received a copy of the GNU Lesser General Public
-+#     License along with this library; if not, write to the Free Software
-+#     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+#     MA  02111-1307  USA
-+#
-+#*************************************************************************
-+
-+PRJ=..$/..
-+
-+PRJNAME=fpicker
-+TARGET=fps_odma
-+LIBTARGET=NO
-+ENABLE_EXCEPTIONS=TRUE
-+GEN_HID=TRUE
-+
-+# --- Settings -----------------------------------------------------
-+
-+.INCLUDE :  settings.mk
-+DLLPRE=
-+
-+# --- Files --------------------------------------------------------
-+
-+SLOFILES=\
-+	$(SLO)$/ODMAFilePicker.obj \
-+	$(SLO)$/ODMAFolderPicker.obj \
-+	$(SLO)$/fps_odma.obj
-+
-+SHL1TARGET=	$(TARGET).uno
-+SHL1IMPLIB=	i$(TARGET)
-+SHL1OBJS=	$(SLOFILES)
-+SHL1STDLIBS=\
-+	$(ODMA_LIB_LIB) \
-+	$(SVTOOLLIB) \
-+	$(TKLIB) \
-+	$(VCLLIB) \
-+	$(SVLLIB) \
-+	$(UNOTOOLSLIB) \
-+	$(TOOLSLIB) \
-+	$(UCBHELPERLIB) \
-+	$(COMPHELPERLIB) \
-+	$(CPPUHELPERLIB) \
-+	$(CPPULIB) \
-+	$(SALLIB)
-+
-+SHL1VERSIONMAP=exports.map
-+SHL1DEF=	$(MISC)$/$(SHL1TARGET).def
-+DEF1NAME=	$(SHL1TARGET)
-+
-+# --- Targets ------------------------------------------------------
-+
-+.INCLUDE :	target.mk
-dummy line to avoid confusing diff-mode
---- solenv/inc/libs.mk
-+++ solenv/inc/libs.mk
-@@ -35,6 +35,9 @@
- LIBSMKREV!:="$$Revision: 1.130 $$"
- 
- .IF "$(GUI)"=="UNX" || "$(COM)"=="GCC"
-+
-+# No ODMA on UNX
-+ODMA_LIB_LIB= 
- 
- #
- #externe libs in plattform.mk
-@@ -279,6 +279,7 @@
- UNOPKGLIB=-lunopkg
- 
- .ELSE				# "$(GUI)"=="UNX"
-+ODMA_LIB_LIB=odma_lib.lib
- AWTLIB*=jawt.lib
- AVMEDIALIB=iavmedia.lib
- ICUINLIB=icuin.lib
-dummy line to avoid confusing diff-mode
---- svtools/inc/svtools/miscopt.hxx
-+++ svtools/inc/svtools/miscopt.hxx
-@@ -136,6 +136,10 @@
-         void        SetUseSystemFileDialog( sal_Bool bSet );
-         sal_Bool    IsUseSystemFileDialogReadOnly() const;
- 
-+        sal_Bool    TryODMADialog() const;
-+        void        SetTryODMADialog( sal_Bool bSet );
-+        sal_Bool    IsTryUseODMADialogReadOnly() const;
-+
-         sal_Bool    IsPluginsEnabled() const;
-         void        SetPluginsEnabled( sal_Bool bEnable );
-         sal_Bool    IsPluginsEnabledReadOnly() const;
-dummy line to avoid confusing diff-mode
---- svtools/source/config/miscopt.cxx
-+++ svtools/source/config/miscopt.cxx
-@@ -110,8 +110,10 @@
- #define PROPERTYHANDLE_SYMBOLSTYLE			4
- #define PROPERTYNAME_USESYSTEMPRINTDIALOG	ASCII_STR("UseSystemPrintDialog")
- #define PROPERTYHANDLE_USESYSTEMPRINTDIALOG	5
-+#define PROPERTYNAME_TRYODMADIALOG	ASCII_STR("TryODMADialog")
-+#define PROPERTYHANDLE_TRYODMADIALOG	6
- 
--#define PROPERTYCOUNT						6
-+#define PROPERTYCOUNT						7
- 
- #define VCL_TOOLBOX_STYLE_FLAT				((USHORT)0x0004) // from <vcl/toolbox.hxx>
- 
-@@ -131,6 +131,8 @@
-     LinkList    aList;
-     sal_Bool    m_bUseSystemFileDialog;
-     sal_Bool    m_bIsUseSystemFileDialogRO;
-+    sal_Bool    m_bTryODMADialog;
-+    sal_Bool    m_bIsTryODMADialogRO;
-     sal_Bool    m_bPluginsEnabled;
-     sal_Bool    m_bIsPluginsEnabledRO;
-     sal_Int16   m_nSymbolsSize;
-@@ -207,6 +207,15 @@
-         inline sal_Bool IsUseSystemFileDialogReadOnly() const
-         { return m_bIsUseSystemFileDialogRO; }
- 
-+        inline sal_Bool TryODMADialog() const
-+        { return m_bTryODMADialog; }
-+
-+        inline void SetTryODMADialog( sal_Bool bSet )
-+        {  m_bTryODMADialog = bSet; SetModified(); }
-+
-+        inline sal_Bool IsTryUseODMADialogReadOnly() const
-+        { return m_bIsTryODMADialogRO; }
-+
-         inline sal_Bool IsPluginsEnabled() const
-         { return m_bPluginsEnabled; }
- 
-@@ -319,6 +319,8 @@
- 
-     , m_bUseSystemFileDialog( sal_False )
-     , m_bIsUseSystemFileDialogRO( sal_False )
-+    , m_bTryODMADialog( sal_False )
-+    , m_bIsTryODMADialogRO( sal_False )
-     , m_bPluginsEnabled( sal_False )
-     , m_bIsPluginsEnabledRO( sal_False )
-     , m_nSymbolsSize( 0 )
-@@ -388,6 +388,16 @@
-                 break;
-             }
- 
-+            case PROPERTYHANDLE_TRYODMADIALOG :
-+            {
-+                if( !(seqValues[nProperty] >>= m_bTryODMADialog) )
-+                {
-+                    DBG_ERROR("Wrong type of \"Misc\\TryODMADialog\"!" );
-+                }
-+                m_bIsTryODMADialogRO = seqRO[nProperty];
-+                break;
-+            }
-+
-             case PROPERTYHANDLE_SYMBOLSTYLE :
-             {
-                 ::rtl::OUString aSymbolsStyle;
-@@ -489,6 +489,13 @@
-                                                             }
-                                                         }
-                                                     break;
-+            case PROPERTYHANDLE_TRYODMADIALOG       :   {
-+                                                            if( !(seqValues[nProperty] >>= m_bTryODMADialog) )
-+                                                            {
-+                                                                DBG_ERROR("Wrong type of \"Misc\\TryODMADialog\"!" );
-+                                                            }
-+                                                        }
-+                                                    break;
-             case PROPERTYHANDLE_SYMBOLSTYLE         :   {
-                                                             ::rtl::OUString aSymbolsStyle;
-                                                             if( seqValues[nProperty] >>= aSymbolsStyle )
-@@ -638,6 +638,13 @@
-                 break;
-             }
- 
-+            case PROPERTYHANDLE_TRYODMADIALOG :
-+            {
-+                if ( !m_bIsTryODMADialogRO )
-+                    seqValues[nProperty] <<= m_bTryODMADialog;
-+                break;
-+            }
-+
-             case PROPERTYHANDLE_SYMBOLSTYLE :
-             {
-                 if ( !m_bIsSymbolsStyleRO )
-@@ -668,7 +668,8 @@
-         PROPERTYNAME_TOOLBOXSTYLE,
-         PROPERTYNAME_USESYSTEMFILEDIALOG,
-         PROPERTYNAME_SYMBOLSTYLE,
--        PROPERTYNAME_USESYSTEMPRINTDIALOG
-+        PROPERTYNAME_USESYSTEMPRINTDIALOG,
-+        PROPERTYNAME_TRYODMADIALOG
- 	};
- 
- 	// Initialize return sequence with these list ...
-@@ -737,6 +737,21 @@
-     return m_pDataContainer->IsUseSystemFileDialogReadOnly();
- }
- 
-+sal_Bool SvtMiscOptions::TryODMADialog() const
-+{
-+    return m_pDataContainer->TryODMADialog();
-+}
-+
-+void SvtMiscOptions::SetTryODMADialog( sal_Bool bEnable )
-+{
-+    m_pDataContainer->SetTryODMADialog( bEnable );
-+}
-+
-+sal_Bool SvtMiscOptions::IsTryUseODMADialogReadOnly() const
-+{
-+    return m_pDataContainer->IsTryUseODMADialogReadOnly();
-+}
-+
- sal_Bool SvtMiscOptions::IsPluginsEnabled() const
- {
-     return m_pDataContainer->IsPluginsEnabled();
-dummy line to avoid confusing diff-mode
---- officecfg/registry/schema/org/openoffice/Office/Common.xcs
-+++ officecfg/registry/schema/org/openoffice/Office/Common.xcs
-@@ -5510,6 +5510,13 @@
- 				</info>
- 				<value>false</value>
- 			</prop>
-+			<prop oor:name="TryODMADialog" oor:type="xs:boolean">
-+				<info>
-+					<author>tml</author>
-+					<desc>Determines whether to show the document creation and selection of the machine's default ODMA (Open Document Management Architecture) DMS (Document Management System). If true, and the machine has a DMS available, the DMS's dialog will be displayed. That dialog then gives the opportunity to use the application's dialog instead, which means the normal system file and folder pickers will be displayed. Relevant only on Windows.</desc>
-+				</info>
-+				<value>false</value>
-+			</prop>
- 			<prop oor:name="SymbolSet" oor:type="xs:short">
- 				<!-- UIHints: Tools  Options General View -->
- 				<info>
-dummy line to avoid confusing diff-mode
---- svx/source/dialog/optgdlg.src
-+++ svx/source/dialog/optgdlg.src
-@@ -136,43 +136,50 @@
- 		Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
- 		Text [ en-US ] = "~Use %PRODUCTNAME dialogs";
- 	};
-+	CheckBox CB_ODMADLG
-+	{
-+        Pos = MAP_APPFONT( COL1, ROW8 );
-+		Size = MAP_APPFONT( WHOLE_WIDTH - COL4, RSC_CD_CHECKBOX_HEIGHT );
-+		Text [ en-US ] = "Show ODMA DMS dialogs first";
-+		Text [ en-GB ] = "Show ODMA DMS dialogues first";
-+	};
-     FixedLine FL_DOCSTATUS
-     {
--        Pos = MAP_APPFONT( COL0, ROW8 );
-+        Pos = MAP_APPFONT( COL0, ROW9 );
- 		Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
-     	Text [ en-US ] = "Document status";
- 	};
-     CheckBox CB_DOCSTATUS
- 	{
--        Pos = MAP_APPFONT( COL1, ROW9 );
-+        Pos = MAP_APPFONT( COL1, ROW10 );
- 		Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
-     	Text [ en-US ] = "~Printing sets \"document modified\" status";
- 	};
- 	FixedLine FL_TWOFIGURE
- 	{
--		Pos = MAP_APPFONT( COL0, ROW10 );
-+		Pos = MAP_APPFONT( COL0, ROW11 );
- 		Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
- 		Text [ en-US ] = "Year (two digits)" ;
- 	};
- 	FixedText FT_INTERPRET
- 	{
--		Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
-+		Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
- 		Size = MAP_APPFONT( DIFF( COL1, COL3), RSC_CD_FIXEDTEXT_HEIGHT );
- 		Text [ en-US ] = "Interpret as years between";
- 	};
- 	NumericField NF_YEARVALUE
- 	{
- 		Border = TRUE ;
--		Pos = MAP_APPFONT( COL4, ROW11 );
-+		Pos = MAP_APPFONT( COL4, ROW12 );
- 		Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
- 		Minimum = 1583 ;
- 		Maximum = 9857 ;
- 		Spin = TRUE ;
- 		Repeat = TRUE ;
- 	};
- 	FixedText FT_TOYEAR
- 	{
--		Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
-+		Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
- 		Size = MAP_APPFONT( WHOLE_WIDTH - COL6, RSC_CD_FIXEDTEXT_HEIGHT );
- 		Text [ en-US ] = "and " ;
- 	};
-dummy line to avoid confusing diff-mode
---- svx/source/dialog/optgdlg.hrc
-+++ svx/source/dialog/optgdlg.hrc
-@@ -64,6 +64,7 @@
- #define ROW9					(ROW8+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
- #define ROW10					(ROW9+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
- #define ROW11					(ROW10+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
-+#define ROW12					(ROW11+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
- 
- #define DIFF(v1,v2)						(v2-v1)
- #define OFFS_TEXTBOX_FIXEDTEXT(base)	(base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
-@@ -200,6 +200,7 @@
- #define FT_HELPAGENT_TIME_UNIT      59
- #define FL_DOCSTATUS                60
- #define CB_DOCSTATUS                61
-+#define CB_ODMADLG                  62
- #endif // #ifndef _SVX_OPTGDLG_HRC
- 
- // ******************************************************************* EOF
-dummy line to avoid confusing diff-mode
---- svx/source/dialog/optgdlg.hxx
-+++ svx/source/dialog/optgdlg.hxx
-@@ -74,6 +74,7 @@
-     FixedLine           aFileDlgFL;
-     ReadOnlyImage       aFileDlgROImage;
- 	CheckBox            aFileDlgCB;
-+	CheckBox            aODMADlgCB;
- 
-     FixedLine           aPrintDlgFL;
- 	CheckBox            aPrintDlgCB;
-@@ -89,6 +89,9 @@
- 	DECL_LINK( TwoFigureConfigHdl, NumericField* );
- 	DECL_LINK( HelpCheckHdl_Impl, CheckBox* );
- 	DECL_LINK( HelpAgentResetHdl_Impl, PushButton* );
-+#ifdef WNT
-+	DECL_LINK( OnFileDlgToggled, CheckBox* );
-+#endif
- protected:
- 	virtual int         DeactivatePage( SfxItemSet* pSet = NULL );
- 
-dummy line to avoid confusing diff-mode
---- svx/source/dialog/optgdlg.cxx
-+++ svx/source/dialog/optgdlg.cxx
-@@ -291,6 +291,7 @@
- 	aFileDlgFL			( this, SVX_RES( FL_FILEDLG ) ),
-     aFileDlgROImage     ( this, SVX_RES( FI_FILEDLG_RO ) ),
- 	aFileDlgCB			( this, SVX_RES( CB_FILEDLG ) ),
-+	aODMADlgCB			( this, SVX_RES( CB_ODMADLG ) ),
- 	aPrintDlgFL			( this, SVX_RES( FL_PRINTDLG ) ),
- 	aPrintDlgCB			( this, SVX_RES( CB_PRINTDLG ) ),
- 	aDocStatusFL		( this, SVX_RES( FL_DOCSTATUS ) ),
-@@ -313,6 +313,31 @@
-     aPrintDlgFL.Hide();
-     aPrintDlgCB.Hide();
-     #endif
-+
-+#ifdef WNT
-+	aFileDlgCB.SetToggleHdl( LINK( this, OfaMiscTabPage, OnFileDlgToggled ) );
-+#else
-+	{
-+		aODMADlgCB.Hide();
-+		// rearrange the following controls
-+		Point aNewPos = aDocStatusFL.GetPosPixel();
-+		long nDelta = aNewPos.Y() - aFileDlgFL.GetPosPixel().Y();
-+
-+		Window* pWins[] =
-+		{
-+		    &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
-+		    &aInterpretFT, &aYearValueField, &aToYearFT
-+		};
-+		Window** pCurrent = pWins;
-+		const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
-+		for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
-+		{
-+		    aNewPos = (*pCurrent)->GetPosPixel();
-+		    aNewPos.Y() -= nDelta;
-+		    (*pCurrent)->SetPosPixel( aNewPos );
-+		}
-+	}
-+#endif
- 
-     if ( !aFileDlgCB.IsVisible() )
-     {
-@@ -409,6 +409,14 @@
-         aHelpFormatLB.SetEntryData( i, pData );
-     }
- }
-+
-+#ifdef WNT
-+IMPL_LINK( OfaMiscTabPage, OnFileDlgToggled, CheckBox*, EMPTYARG ) 
-+{
-+	aODMADlgCB.Enable( !aFileDlgCB.IsChecked() );
-+	return 0;
-+}
-+#endif
- 
- // -----------------------------------------------------------------------
- 
-@@ -429,6 +429,13 @@
-         bModified = TRUE;
-     }
- 
-+    if ( aODMADlgCB.IsChecked() != aODMADlgCB.GetSavedValue() )
-+    {
-+        SvtMiscOptions aMiscOpt;
-+        aMiscOpt.SetTryODMADialog( aODMADlgCB.IsChecked() );
-+        bModified = TRUE;
-+    }
-+
- 	if ( aDocStatusCB.IsChecked() != aDocStatusCB.GetSavedValue() )
-     {
-         SvtPrintWarningOptions aPrintOptions;
-@@ -476,6 +476,9 @@
-     aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
-     aPrintDlgCB.SaveValue();
- 
-+    aODMADlgCB.Check( aMiscOpt.TryODMADialog() );
-+    aODMADlgCB.SaveValue();
-+
-     SvtPrintWarningOptions aPrintOptions;
-     aDocStatusCB.Check(aPrintOptions.IsModifyDocumentOnPrintingAllowed());
-     aDocStatusCB.SaveValue();
-dummy line to avoid confusing diff-mode
---- solenv/bin/modules/installer/windows/component.pm
-+++ solenv/bin/modules/installer/windows/component.pm
-@@ -103,6 +103,11 @@
- 	{
- 		return $installer::globals::templatefolder;
- 	}
-+
-+	if ( $destdir =~ /\bPREDEFINED_OSWINSHELLNEWDIR\b/ )
-+	{
-+		return "WindowsShellNewFolder";
-+	}
- 
- 	my $destination = $onefile->{'destination'};
- 	
-dummy line to avoid confusing diff-mode
---- solenv/bin/modules/installer/windows/directory.pm
-+++ solenv/bin/modules/installer/windows/directory.pm
-@@ -174,6 +174,12 @@
- 
- 	my $oneline = "TARGETDIR\t\tSourceDir\n";
- 	push(@{$directorytableref}, $oneline);
-+	
-+	$oneline = "WindowsFolder\tTARGETDIR\tWindows\n";
-+	push(@{$directorytableref}, $oneline);
-+
-+	$oneline = "WindowsShellNewFolder\tWindowsFolder\tShellNew\n";
-+	push(@{$directorytableref}, $oneline);
- 	
- 	my $sourcediraddon = "";
- 	if (($installer::globals::addchildprojects) ||
-dummy line to avoid confusing diff-mode
---- scp2/source/ooo/directory_ooo.scp
-+++ scp2/source/ooo/directory_ooo.scp
-@@ -166,6 +166,11 @@
-     ParentID = gid_Dir_Program;
-     DosName = "shellnew";
- End
-+
-+Directory gid_Dir_ShellnewToo
-+    ParentID = gid_Dir_Program;
-+    DosName = "shellnew2";
-+End
- 
- #endif
- 
---- scp2/source/ooo/file_ooo.scp
-+++ scp2/source/ooo/file_ooo.scp
-@@ -2025,24 +2025,56 @@
- 
- STD_SHELLNEW_FILE(gid_File_Shellnew_Ods_Soffice, soffice.ods)
- 
-+File gid_File_Shellnew2_Ods_Soffice
-+    TXT_FILE_BODY;
-+    Styles = (PACKED,WORKSTATION, OVERWRITE);
-+    Dir = PREDEFINED_OSWINSHELLNEWDIR;
-+    NetDir = gid_Dir_ShellnewToo;
-+    Name = "soffice.ods";
-+End
-+
- #endif
- 
- #ifdef WNT
- 
- STD_SHELLNEW_FILE(gid_File_Shellnew_Odg_Soffice, soffice.odg)
- 
-+File gid_File_Shellnew2_Odg_Soffice
-+    TXT_FILE_BODY;
-+    Styles = (PACKED,WORKSTATION, OVERWRITE);
-+    Dir = PREDEFINED_OSWINSHELLNEWDIR;
-+    NetDir = gid_Dir_ShellnewToo;
-+    Name = "soffice.odg";
-+End
-+
- #endif
- 
- #ifdef WNT
- 
- STD_SHELLNEW_FILE(gid_File_Shellnew_Odp_Soffice, soffice.odp)
- 
-+File gid_File_Shellnew2_Odp_Soffice
-+    TXT_FILE_BODY;
-+    Styles = (PACKED,WORKSTATION, OVERWRITE);
-+    Dir = PREDEFINED_OSWINSHELLNEWDIR;
-+    NetDir = gid_Dir_ShellnewToo;
-+    Name = "soffice.odp";
-+End
-+
- #endif
- 
- #ifdef WNT
- 
- STD_SHELLNEW_FILE(gid_File_Shellnew_Odt_Soffice, soffice.odt)
- 
-+File gid_File_Shellnew2_Odt_Soffice
-+    TXT_FILE_BODY;
-+    Styles = (PACKED,WORKSTATION, OVERWRITE);
-+    Dir = PREDEFINED_OSWINSHELLNEWDIR;
-+    NetDir = gid_Dir_ShellnewToo;
-+    Name = "soffice.odt";
-+End
-+
- #endif
- 
- File gid_File_Txt_License
-dummy line to avoid confusing diff-mode
---- framework/prj/build.lst
-+++ framework/prj/build.lst
-@@ -1,4 +1,4 @@
--fr	framework	:	svtools NULL
-+fr	framework	:	svtools ucb NULL
- fr	framework								usr1	-	all	fr_mkout NULL
- fr  framework\inc			        	    nmake   -   all fr_inc NULL
- fr  framework\source\constant               nmake   -   all fr_constant fr_inc NULL
-dummy line to avoid confusing diff-mode
---- framework/source/uielement/recentfilesmenucontroller.cxx
-+++ framework/source/uielement/recentfilesmenucontroller.cxx
-@@ -105,6 +105,9 @@
- #include <svtools/historyoptions.hxx>
- #include <cppuhelper/implbase1.hxx>
- #include <osl/file.hxx>
-+#include <tools/prewin.h>
-+#include <tools/postwin.h>
-+#include <odma_lib.hxx>
- //#include <tools/solar.hrc>
- 
- //_________________________________________________________________________________________________________________
-@@ -248,6 +248,39 @@
- 					else
- 						aMenuTitle = aSystemPath;
- 				}
-+				else if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_ODMA && ::odma::DMSsAvailable ())
-+				{
-+					String aShortTitle = m_aRecentFilesItems.at( i ).aTitle;
-+
-+					// This is against all rules for using
-+					// proper abstraction layers and whatnot.
-+					// But figuring out how to do it "right"
-+					// would have taken the whole week. 
-+					// So just call the odma_lib functions... 
-+					// (odma_lib is a thin layer on
-+					// top of the ODMA32 DLL)
-+
-+					static ODMHANDLE handle = NULL;
-+					static sal_Bool beenhere = sal_False;
-+					ODMSTATUS status;
-+
-+					if ( ! beenhere )
-+					{
-+					    status = NODMRegisterApp( &handle, ODM_API_VERSION, "sodma", NULL, NULL );
-+					    beenhere = sal_True;
-+					}
-+
-+					if ( handle != NULL )
-+					{
-+					    rtl::OUString s = aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_MS_1252 );
-+					    s = s.copy( strlen ( "vnd.sun.star.odma:/" ) );
-+					    char title[47];
-+					    status = NODMGetDocInfo( handle, rtl::OUStringToOString( s, RTL_TEXTENCODING_MS_1252 ).pData->buffer, ODM_NAME, title, sizeof ( title ) );
-+					    aShortTitle = String::CreateFromAscii( title );
-+					}
-+					aMenuTitle += aShortTitle;
-+					aTipHelpText = aURLString;
-+				}
- 				else
- 				{
- 					// Use INetURLObject to abbreviate all other URLs
-dummy line to avoid confusing diff-mode
---- framework/util/makefile.mk
-+++ framework/util/makefile.mk
-@@ -329,6 +329,7 @@
-                 $(SLO)$/langselectionmenucontroller.obj
- 
- SHL4STDLIBS=	\
-+		 $(ODMA_LIB_LIB)    \
- 				$(FWILIB)                           \
- 				$(FWELIB)							\
- 				$(SVTOOLLIB)						\
+--- ucb/prj/build.lst	18 Oct 2005 08:45:24 -0000	1.20
++++ ucb/prj/build.lst	13 Mar 2006 10:55:34 -0000
+@@ -14,2 +14,3 @@ uc	ucb\source\ucp\package		nmake	-	all	u
+ uc	ucb\source\ucp\tdoc			nmake	-	all	uc_tdoc uc_inc NULL
+ uc	ucb\source\ucp\expand		nmake	-	all	uc_expand uc_inc NULL
++uc	ucb\source\ucp\odma			nmake	-	w	uc_odma uc_inc NULL
+dummy line to avoid confusing diff-mode
+--- ucb/prj/d.lst	18 Oct 2005 08:45:24 -0000	1.20
++++ ucb/prj/d.lst	13 Mar 2006 10:55:34 -0000
+@@ -23,6 +23,11 @@
+ ..\%__SRC%\lib\ucp*.uno.dylib %_DEST%\lib%_EXT%\ucp*.uno.dylib
+ ..\%__SRC%\misc\ucp*.map %_DEST%\bin%_EXT%\ucp*.map
+ ..\%__SRC%\misc\ucp*.sym %_DEST%\bin%_EXT%\ucp*.sym
++
++..\%__SRC%\slb\odma_lib.lib %_DEST%\lib%_EXT%\odma_lib.lib
++..\source\ucp\odma\odma.h %_DEST%\inc%_EXT%\odma.h
++..\source\ucp\odma\odma_lib.hxx %_DEST%\inc%_EXT%\odma_lib.hxx
++
+ ..\source\ucp\file\ucpfile.xml %_DEST%\xml%_EXT%\ucpfile.xml
+ ..\source\ucp\ftp\ucpftp.xml %_DEST%\xml%_EXT%\ucpftp.xml
+ ..\source\ucp\hierarchy\ucphier.xml %_DEST%\xml%_EXT%\ucphier.xml
+Index: ucb/source/ucp/odma/makefile.mk
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/makefile.mk,v
+retrieving revision 1.4
+diff -p -u -r1.4 makefile.mk
+--- ucb/source/ucp/odma/makefile.mk	9 Sep 2005 15:49:57 -0000	1.4
++++ ucb/source/ucp/odma/makefile.mk	6 Nov 2006 00:12:08 -0000
+@@ -63,7 +63,7 @@ LIB2TARGET=NO
+ 
+ # --- General -----------------------------------------------------
+ 
+-SLOFILES=\
++SLO1FILES=\
+ 	$(SLO)$/odma_lib.obj    		\
+ 	$(SLO)$/odma_services.obj    	\
+ 	$(SLO)$/odma_provider.obj    	\
+@@ -76,7 +75,7 @@ SLOFILES=\
+ 	$(SLO)$/odma_contentcaps.obj
+ 
+ LIB1TARGET=$(SLB)$/_$(TARGET).lib
+-LIB1OBJFILES=$(SLOFILES)
++LIB1OBJFILES=$(SLO1FILES)
+ 
+ # --- Shared-Library ---------------------------------------------------
+ 
+@@ -122,6 +121,13 @@ APP2STDLIBS+=$(LIBCIMT)
+ 
+ DEF2DES=UCB ODMA URL converter
+ 
++# --- odma_lib library -----------------------------------------------
++
++SLO3FILES=$(SLO)$/odma_lib.obj
++
++LIB3TARGET=$(SLB)$/odma_lib.lib
++LIB3OBJFILES=$(SLO3FILES)
++
+ # --- Targets ----------------------------------------------------------
+ 
+ .INCLUDE: target.mk
+Index: ucb/source/ucp/odma/odma_content.cxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_content.cxx,v
+retrieving revision 1.5
+diff -p -u -r1.5 odma_content.cxx
+--- ucb/source/ucp/odma/odma_content.cxx	17 Sep 2006 13:57:15 -0000	1.5
++++ ucb/source/ucp/odma/odma_content.cxx	6 Nov 2006 00:12:08 -0000
+@@ -544,6 +475,12 @@ uno::Any SAL_CALL Content::execute(
+     }
+ 	else if( ! aCommand.Name.compareToAscii( "transfer" ) )
+ 	{
++		// So far I have determined that this command is called when
++		// doing "Save As" to copy an already written backup copy of
++		// the document in the file system into the DMS.
++
++		// Maybe also in other situations.
++
+ 		ucb::TransferInfo aTransferInfo;
+ 		if( ! ( aCommand.Argument >>= aTransferInfo ) )
+ 		{
+@@ -559,84 +560,21 @@
+ 		::rtl::Reference<ContentProperties> aProp = m_aProps;
+ 		if(aProp->m_bIsFolder)
+ 		{
+-			aProp = getContentProvider()->getContentPropertyWithTitle(aTransferInfo.NewTitle);
++			aProp = getContentProvider()->getContentPropertyWithDocumentId(aTransferInfo.NewTitle);
+ 			if(!aProp.is())
+ 				aProp = getContentProvider()->getContentPropertyWithSavedAsName(aTransferInfo.NewTitle);
+ 			sal_Bool bError = !aProp.is();
+-			if(bError)
+-			{
+-				sal_Char* pExtension = NULL;
+-				::rtl::OString sExt;
+-				sal_Int32 nPos = aTransferInfo.NewTitle.lastIndexOf('.');
+-				if(nPos != -1)
+-				{
+-					sExt = ::rtl::OUStringToOString(aTransferInfo.NewTitle.copy(nPos+1),RTL_TEXTENCODING_ASCII_US);
+-					if(sExt.equalsIgnoreAsciiCase("txt"))
+-						pExtension = ODM_FORMAT_TEXT;
+-					else if(sExt.equalsIgnoreAsciiCase("rtf"))
+-						pExtension = ODM_FORMAT_RTF;
+-					else if(sExt.equalsIgnoreAsciiCase("ps"))
+-						pExtension = ODM_FORMAT_PS;
+-					else  
+-						pExtension = const_cast<sal_Char*>(sExt.getStr());
+-				}
+-				else
+-					pExtension = ODM_FORMAT_TEXT;
+ 
+-				sal_Char* lpszNewDocId = new sal_Char[ODM_DOCID_MAX];
+-				void *pData = NULL;
+-				DWORD dwFlags = ODM_SILENT;
+-				ODMSTATUS odm = NODMSaveAsEx(ContentProvider::getHandle(),
+-											 NULL, // means it is saved the first time
+-											 lpszNewDocId,
+-											 pExtension,
+-											 NULL, // no callback function here
+-											 pData,
+-											 &dwFlags);
+-
+-				// check if we have to call the DMS dialog
+-				if(odm == ODM_E_USERINT) 
+-				{ 
+-					dwFlags = 0;
+-					odm = NODMSaveAsEx(ContentProvider::getHandle(),
+-											 NULL, // means it is saved the first time
+-											 lpszNewDocId,
+-											 pExtension,
+-											 NULL, // no callback function here
+-											 pData,
+-											 &dwFlags);
+-				}
+-				bError = odm != ODM_SUCCESS;
+-				if(!bError)
+-				{
+-					aProp = new ContentProperties();
+-					aProp->m_sDocumentId	= ::rtl::OString(lpszNewDocId);
+-					aProp->m_sContentType	= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODMA_CONTENT_TYPE));
+-					aProp->m_sSavedAsName	= aTransferInfo.NewTitle;
+-					getContentProvider()->append(aProp);
+-
+-					// now set the title
+-					WORD nDocInfo = ODM_NAME;
+-					::rtl::OUString sFileName = aTransferInfo.NewTitle;
+-					sal_Int32 nIndex = aTransferInfo.NewTitle.lastIndexOf( sal_Unicode('.') );
+-					if(nIndex != -1)
+-						sFileName = aTransferInfo.NewTitle.copy(0,nIndex);
+-
+-					::rtl::OString sDocInfoValue = ::rtl::OUStringToOString(sFileName,RTL_TEXTENCODING_ASCII_US);
+-					odm = NODMSetDocInfo(	ContentProvider::getHandle(),
+-											lpszNewDocId,
+-											nDocInfo,
+-											const_cast<sal_Char*>(sDocInfoValue.getStr())
+-											);
+-
+-				}
+-				else if ( odm == ODM_E_CANCEL)
+-                    NODMActivate(ContentProvider::getHandle(),
+-                                 ODM_DELETE,
+-                                 lpszNewDocId);
++			// There used to be code below that called ODMSaveAsEx,
++			// but that was very broken. We have already called
++			// ODMSaveAsEx in the ODMA file picker when selecting the
++			// name for a new document, or the document already exists
++			// in the DMS and we don't need any ODMSaveAsEx. The ODMA
++			// file picker tells odma::ContentProvider about the new
++			// document's DOCID, so the
++			// getContentPropertyWithDocumentId() call above should
++			// succeed.
+ 
+-				delete lpszNewDocId;
+-			}
+ 			if(bError)
+ 				ucbhelper::cancelCommandExecution(
+ 						uno::makeAny( lang::IllegalArgumentException(
+@@ -648,11 +648,22 @@
+ 		rtl::OUString sFileURL = ContentProvider::openDoc(aProp);
+ 
+ 		sal_Int32 nLastIndex = sFileURL.lastIndexOf( sal_Unicode('/') );
++		// Create a new Content object for the "shadow" file
++		// corresponding to the opened document from the DMS.
+ 		::ucbhelper::Content aContent(sFileURL.copy(0,nLastIndex),NULL);
+ 		//	aTransferInfo.NameClash = ucb::NameClash::OVERWRITE;
+ 		aTransferInfo.NewTitle = sFileURL.copy( 1 + nLastIndex );
++		// Copy our saved backup copy to the "shadow" file.
+ 		aContent.executeCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("transfer")),uno::makeAny(aTransferInfo));
++		// Tell the DMS that the "shadow" file is done and can be
++		// imported.
+ 		getContentProvider()->saveDocument(aProp->m_sDocumentId);
++    }
++	else if ( aCommand.Name.equalsAsciiL(
++		    RTL_CONSTASCII_STRINGPARAM( "getCasePreservingURL" ) ) )
++	{
++	    rtl::OUString CasePreservingURL = openDoc();
++	    aRet <<= CasePreservingURL;
+ 	}
+ 	else
+ 	{
+Index: ucb/source/ucp/odma/odma_content.hxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_content.hxx,v
+retrieving revision 1.4
+diff -p -u -r1.4 odma_content.hxx
+--- ucb/source/ucp/odma/odma_content.hxx	9 Sep 2005 15:50:31 -0000	1.4
++++ ucb/source/ucp/odma/odma_content.hxx	6 Nov 2006 00:12:08 -0000
+@@ -70,7 +67,7 @@ namespace odma
+ 
+ // UNO service name for the content.
+ #define ODMA_CONTENT_SERVICE_NAME \
+-							"com.sun.star.ucb.OdmaContent"
++							"com.sun.star.ucb.ODMAContent"
+ 
+ //=========================================================================
+ class ContentProvider;
+Index: ucb/source/ucp/odma/odma_contentprops.hxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_contentprops.hxx,v
+retrieving revision 1.4
+diff -p -u -r1.4 odma_contentprops.hxx
+--- ucb/source/ucp/odma/odma_contentprops.hxx	9 Sep 2005 15:51:07 -0000	1.4
++++ ucb/source/ucp/odma/odma_contentprops.hxx	6 Nov 2006 00:12:08 -0000
+@@ -80,6 +80,7 @@ namespace odma
+ 		{}
+ 
+ 		inline ::rtl::OUString getTitle()		const { return m_sTitle;		}
++		inline ::rtl::OUString getDocumentId()	const { return ::rtl::OStringToOUString( m_sDocumentId, RTL_TEXTENCODING_ASCII_US ); }
+ 		inline ::rtl::OUString getSavedAsName() const { return m_sSavedAsName;	}
+ 	};
+ 	typedef ::std::binary_function< ::rtl::Reference<ContentProperties>, ::rtl::OUString,bool> TContentPropertiesFunctorBase;
+Index: ucb/source/ucp/odma/odma_datasupplier.cxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_datasupplier.cxx,v
+retrieving revision 1.5
+diff -p -u -r1.5 odma_datasupplier.cxx
+--- ucb/source/ucp/odma/odma_datasupplier.cxx	17 Sep 2006 13:57:42 -0000	1.5
++++ ucb/source/ucp/odma/odma_datasupplier.cxx	6 Nov 2006 00:12:08 -0000
+@@ -63,7 +63,6 @@
+ #include "odma_content.hxx"
+ #include "odma_contentprops.hxx"
+ #include "odma_provider.hxx"
+-#include "odma_lib.hxx"
+ 
+ using namespace com::sun::star::beans;
+ using namespace com::sun::star::lang;
+@@ -308,7 +306,7 @@ sal_Bool DataSupplier::getResult( sal_uI
+ 	ODMSTATUS odm = NODMGetDMS(ODMA_ODMA_REGNAME, lpszDMSList);
+ 	lpszDMSList[strlen(lpszDMSList)+1] = '\0';
+ 
+-	::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME");
++	::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME");
+ 	
+ 	DWORD dwFlags = ODM_SPECIFIC;
+ 	odm = NODMQueryExecute(ContentProvider::getHandle(), sQuery,dwFlags, lpszDMSList, pQueryId );
+Index: ucb/source/ucp/odma/odma_lib.cxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_lib.cxx,v
+retrieving revision 1.5
+diff -p -u -r1.5 odma_lib.cxx
+--- ucb/source/ucp/odma/odma_lib.cxx	17 Sep 2006 13:58:10 -0000	1.5
++++ ucb/source/ucp/odma/odma_lib.cxx	6 Nov 2006 00:12:08 -0000
+@@ -44,6 +44,8 @@
+ //#endif
+ #include <osl/module.h>
+ #include <rtl/ustring.hxx>
++#include <tools/prewin.h>
++#include <tools/postwin.h>
+ #include "odma_lib.hxx"
+ 
+ 
+@@ -84,17 +86,18 @@ namespace odma
+ 
+ 	sal_Bool LoadFunctions(oslModule _pODMA);
+ 
+-	sal_Bool LoadLibrary()
++	sal_Bool DMSsAvailable()
+ 	{
+ 		static sal_Bool bLoaded = sal_False;
+-		static oslModule pODMA = NULL;
++		static sal_Bool bBeenHere = sal_False;
++		oslModule pODMA = NULL;
+ 		
+-		if (bLoaded) 
+-			return sal_True;
++		if (bBeenHere) 
++			return bLoaded;
++
+ 		::rtl::OUString sPath;
+ 	#ifdef WIN
+ 		sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA.DLL"));
+-		
+ 	#endif
+ 	#ifdef WNT
+ 		sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL"));
+@@ -103,11 +106,21 @@ namespace odma
+ 		sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodma.so"));
+ 	#endif
+ 
++		bBeenHere = sal_True;
++
+ 		pODMA = osl_loadModule( sPath.pData,SAL_LOADMODULE_NOW );
+ 		if( !pODMA)
+ 			return sal_False;
+ 
+-		return bLoaded = LoadFunctions(pODMA);
++		if (!LoadFunctions(pODMA))
++			return sal_False;
++
++		bLoaded = (NODMGetDMSCount() > 0);
++
++		if (getenv ("NO_ODMA"))
++			bLoaded = sal_False;
++
++		return bLoaded;
+ 	}
+ 	// -------------------------------------------------------------------------
+ 
+Index: ucb/source/ucp/odma/odma_lib.hxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_lib.hxx,v
+retrieving revision 1.4
+diff -p -u -r1.4 odma_lib.hxx
+--- ucb/source/ucp/odma/odma_lib.hxx	9 Sep 2005 15:52:48 -0000	1.4
++++ ucb/source/ucp/odma/odma_lib.hxx	6 Nov 2006 00:12:08 -0000
+@@ -35,19 +35,7 @@
+ #ifndef ODMA_LIB_HXX
+ #define ODMA_LIB_HXX
+ 
+-typedef void	            *LPVOID;
+-typedef char				*LPSTR, 
+-							*PSTR;
+-typedef const char			*LPCSTR;
+-typedef unsigned long       DWORD;
+-typedef unsigned short      WORD;
+-typedef unsigned short      *LPWORD;
+-typedef DWORD		        *LPDWORD;
+-
+-#define WINAPI				__stdcall
+-#define FAR
+-
+-#include "odma.h"
++#include <odma.h>
+ 
+ namespace odma
+ {
+@@ -215,37 +203,37 @@ namespace odma
+ 
+ 	// now we define some macros
+ 
+-	#define NODMRegisterApp(a,b,c,d,e)			(*(pODMRegisterApp))(a,b,c,d,e)
+-	#define NODMUnRegisterApp(a)				(*(pODMUnRegisterApp))(a)
+-	#define NODMSelectDoc(a,b,c)				(*(pODMSelectDoc))(a,b,c)
+-	#define NODMOpenDoc(a,b,c,d)				(*(pODMOpenDoc))(a,b,c,d)
+-	#define NODMSaveDoc(a,b,c)					(*(pODMSaveDoc))(a,b,c)
+-	#define NODMCloseDoc(a,b,c,d,e,f)			(*(pODMCloseDoc))(a,b,c,d,e,f)
+-	#define NODMNewDoc(a,b,c,d,e)				(*(pODMNewDoc))(a,b,c,d,e)
+-	#define NODMSaveAs(a,b,c,d,e,f)				(*(pODMSaveAs))(a,b,c,d,e,f)
+-	#define NODMActivate(a,b,c)					(*(pODMActivate))(a,b,c)
+-	#define NODMGetDocInfo(a,b,c,d,e)			(*(pODMGetDocInfo))(a,b,c,d,e)
+-	#define NODMSetDocInfo(a,b,c,d)				(*(pODMSetDocInfo))(a,b,c,d)
+-	#define NODMGetDMSInfo(a,b,c,d)				(*(pODMGetDMSInfo))(a,b,c,d)
+-	#define NODMGetDMSCount()					(*(pODMGetDMSCount))()
+-	#define NODMGetDMSList(a,b)					(*(pODMGetDMSList))(a,b)
+-	#define NODMGetDMS(a,b)						(*(pODMGetDMS))(a,b)
+-	#define NODMSetDMS(a,b)						(*(pODMSetDMS))(a,b)
+-	#define NODMQueryExecute(a,b,c,d,e)			(*(pODMQueryExecute))(a,b,c,d,e)
+-	#define NODMQueryGetResults(a,b,c,d,e,f)	(*(pODMQueryGetResults))(a,b,c,d,e,f)
+-	#define NODMQueryClose(a,b)					(*(pODMQueryClose))(a,b)
+-	#define NODMCloseDocEx(a,b,c,d,e,f,g)		(*(pODMCloseDocEx))(a,b,c,d,e,f,g)
+-	#define NODMSaveAsEx(a,b,c,d,e,f,g)			(*(pODMSaveAsEx))(a,b,c,d,e,f,g)
+-	#define NODMSaveDocEx(a,b,c,d)				(*(pODMSaveDocEx))(a,b,c,d)
+-	#define NODMSelectDocEx(a,b,c,d,e,f)		(*(pODMSelectDocEx))(a,b,c,d,e,f)
+-	#define NODMQueryCapability(a,b,c,d,e)		(*(pODMQueryCapability))(a,b,c,d,e)
+-	#define NODMSetDocEvent(a,b,c,d,e,f,g)		(*(pODMSetDocEvent))(a,b,c,d,e,f,g)
+-	#define NODMGetAlternateContent(a,b,c,d,e)	(*(pODMGetAlternateContent))(a,b,c,d,e)
+-	#define NODMSetAlternateContent(a,b,c,d,e)	(*(pODMSetAlternateContent))(a,b,c,d,e)
+-	#define NODMGetDocRelation(a,b,c,d,e,f)		(*(pODMGetDocRelation))(a,b,c,d,e,f)
+-	#define NODMSetDocRelation(a,b,c,d,e,f)		(*(pODMSetDocRelation))(a,b,c,d,e,f)
++	#define NODMRegisterApp(a,b,c,d,e)			(*(::odma::pODMRegisterApp))(a,b,c,d,e)
++	#define NODMUnRegisterApp(a)				(*(::odma::pODMUnRegisterApp))(a)
++	#define NODMSelectDoc(a,b,c)				(*(::odma::pODMSelectDoc))(a,b,c)
++	#define NODMOpenDoc(a,b,c,d)				(*(::odma::pODMOpenDoc))(a,b,c,d)
++	#define NODMSaveDoc(a,b,c)					(*(::odma::pODMSaveDoc))(a,b,c)
++	#define NODMCloseDoc(a,b,c,d,e,f)			(*(::odma::pODMCloseDoc))(a,b,c,d,e,f)
++	#define NODMNewDoc(a,b,c,d,e)				(*(::odma::pODMNewDoc))(a,b,c,d,e)
++	#define NODMSaveAs(a,b,c,d,e,f)				(*(::odma::pODMSaveAs))(a,b,c,d,e,f)
++	#define NODMActivate(a,b,c)					(*(::odma::pODMActivate))(a,b,c)
++	#define NODMGetDocInfo(a,b,c,d,e)			(*(::odma::pODMGetDocInfo))(a,b,c,d,e)
++	#define NODMSetDocInfo(a,b,c,d)				(*(::odma::pODMSetDocInfo))(a,b,c,d)
++	#define NODMGetDMSInfo(a,b,c,d)				(*(::odma::pODMGetDMSInfo))(a,b,c,d)
++	#define NODMGetDMSCount()					(*(::odma::pODMGetDMSCount))()
++	#define NODMGetDMSList(a,b)					(*(::odma::pODMGetDMSList))(a,b)
++	#define NODMGetDMS(a,b)						(*(::odma::pODMGetDMS))(a,b)
++	#define NODMSetDMS(a,b)						(*(::odma::pODMSetDMS))(a,b)
++	#define NODMQueryExecute(a,b,c,d,e)			(*(::odma::pODMQueryExecute))(a,b,c,d,e)
++	#define NODMQueryGetResults(a,b,c,d,e,f)	(*(::odma::pODMQueryGetResults))(a,b,c,d,e,f)
++	#define NODMQueryClose(a,b)					(*(::odma::pODMQueryClose))(a,b)
++	#define NODMCloseDocEx(a,b,c,d,e,f,g)		(*(::odma::pODMCloseDocEx))(a,b,c,d,e,f,g)
++	#define NODMSaveAsEx(a,b,c,d,e,f,g)			(*(::odma::pODMSaveAsEx))(a,b,c,d,e,f,g)
++	#define NODMSaveDocEx(a,b,c,d)				(*(::odma::pODMSaveDocEx))(a,b,c,d)
++	#define NODMSelectDocEx(a,b,c,d,e,f)		(*(::odma::pODMSelectDocEx))(a,b,c,d,e,f)
++	#define NODMQueryCapability(a,b,c,d,e)		(*(::odma::pODMQueryCapability))(a,b,c,d,e)
++	#define NODMSetDocEvent(a,b,c,d,e,f,g)		(*(::odma::pODMSetDocEvent))(a,b,c,d,e,f,g)
++	#define NODMGetAlternateContent(a,b,c,d,e)	(*(::odma::pODMGetAlternateContent))(a,b,c,d,e)
++	#define NODMSetAlternateContent(a,b,c,d,e)	(*(::odma::pODMSetAlternateContent))(a,b,c,d,e)
++	#define NODMGetDocRelation(a,b,c,d,e,f)		(*(::odma::pODMGetDocRelation))(a,b,c,d,e,f)
++	#define NODMSetDocRelation(a,b,c,d,e,f)		(*(::odma::pODMSetDocRelation))(a,b,c,d,e,f)
+ 
+-	sal_Bool LoadLibrary();
++	sal_Bool DMSsAvailable();
+ 
+ 	extern TODMRegisterApp			pODMRegisterApp;
+ 	extern TODMUnRegisterApp		pODMUnRegisterApp;
+Index: ucb/source/ucp/odma/odma_provider.cxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_provider.cxx,v
+retrieving revision 1.5
+diff -p -u -r1.5 odma_provider.cxx
+--- ucb/source/ucp/odma/odma_provider.cxx	17 Sep 2006 13:58:37 -0000	1.5
++++ ucb/source/ucp/odma/odma_provider.cxx	6 Nov 2006 00:12:08 -0000
+@@ -459,7 +434,7 @@ void ContentProvider::append(const ::vos
+ 		lpszDMSList[strlen(lpszDMSList)+1] = '\0';
+ 
+ 		::rtl::OString sTitleText(::rtl::OUStringToOString(_sDocumentName,RTL_TEXTENCODING_ASCII_US));
+-		::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME WHERE ODM_TITLETEXT = '");
++		::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME WHERE ODM_TITLETEXT = '");
+ 		sQuery += sTitleText;
+ 		sQuery += "'";
+ 		
+@@ -551,6 +521,12 @@ void ContentProvider::append(const ::vos
+ 	return getContentProperty(_sTitle,aFunc);
+ }
+ // -----------------------------------------------------------------------------
++::rtl::Reference<ContentProperties> ContentProvider::getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const
++{
++	ContentPropertiesMemberFunctor aFunc(::std::mem_fun(&ContentProperties::getDocumentId));
++	return getContentProperty(_sDocumentId,aFunc);
++}
++// -----------------------------------------------------------------------------
+ ::rtl::OUString ContentProvider::openDoc(const ::rtl::Reference<ContentProperties>& _rProp)  throw (uno::Exception)
+ {
+ 	OSL_ENSURE(_rProp.is(),"No valid content properties!");
+Index: ucb/source/ucp/odma/odma_provider.hxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_provider.hxx,v
+retrieving revision 1.4
+diff -p -u -r1.4 odma_provider.hxx
+--- ucb/source/ucp/odma/odma_provider.hxx	9 Sep 2005 15:53:43 -0000	1.4
++++ ucb/source/ucp/odma/odma_provider.hxx	6 Nov 2006 00:12:09 -0000
+@@ -40,6 +40,8 @@
+ #define ODMA_PROVIDER_HXX
+ 
+ #include <ucbhelper/providerhelper.hxx>
++#include <tools/prewin.h>
++#include <tools/postwin.h>
+ #include "odma_lib.hxx"
+ 
+ #include "rtl/ref.hxx"
+@@ -60,7 +62,7 @@ namespace odma {
+ // UNO service name for the provider. This name will be used by the UCB to
+ // create instances of the provider.
+ #define ODMA_CONTENT_PROVIDER_SERVICE_NAME \
+-				"com.sun.star.ucb.OdmaContentProvider"
++				"com.sun.star.ucb.ODMAContentProvider"
+ //	#define ODMA_CONTENT_PROVIDER_SERVICE_NAME_LENGTH	34
+ 
+ // URL scheme. This is the scheme the provider will be able to create
+@@ -150,14 +152,21 @@ public:
+ 	*/
+ 	::rtl::Reference<ContentProperties> queryContentProperty(const ::rtl::OUString& _sDocumentName);
+ 
+-	/** getContentProperty returns the ContentProperties for the first content with that title
++	/** getContentPropertyWithTitle returns the ContentProperties for the first content with that title
+ 		@param	_sTitle	the title of the document
+ 
+ 		@return	the content properties
+ 	*/
+ 	::rtl::Reference<ContentProperties> getContentPropertyWithTitle(const ::rtl::OUString& _sTitle) const;
+ 
+-	/** getContentProperty returns the ContentProperties for the first content with that SavedAsName
++	/** getContentPropertyWithDocumentId returns the ContentProperties for the first content with that title
++		@param	_sTitle	the title of the document
++
++		@return	the content properties
++	*/
++	::rtl::Reference<ContentProperties> getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const;
++
++	/** getContentPropertyWithSavedAsName returns the ContentProperties for the first content with that SavedAsName
+ 		@param	_sSaveAsName	the SavedAsName of the document
+ 
+ 		@return	the content properties
+Index: ucb/source/ucp/odma/odma_services.cxx
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/odma_services.cxx,v
+retrieving revision 1.5
+diff -p -u -r1.5 odma_services.cxx
+--- ucb/source/ucp/odma/odma_services.cxx	17 Sep 2006 13:59:05 -0000	1.5
++++ ucb/source/ucp/odma/odma_services.cxx	6 Nov 2006 00:12:09 -0000
+@@ -52,21 +52,19 @@
+ #include <com/sun/star/registry/XRegistryKey.hpp>
+ #include "odma_contentprops.hxx"
+ #include "odma_provider.hxx"
+-#include "odma_lib.hxx"
+ 
+-using namespace rtl;
+ using namespace com::sun::star::uno;
+ using namespace com::sun::star::lang;
+ using namespace com::sun::star::registry;
+ 
+ //=========================================================================
+ static sal_Bool writeInfo( void * pRegistryKey,
+-						   const OUString & rImplementationName,
+-   						   Sequence< OUString > const & rServiceNames )
++						   const rtl::OUString & rImplementationName,
++   						   Sequence< rtl::OUString > const & rServiceNames )
+ {
+-	OUString aKeyName( OUString::createFromAscii( "/" ) );
++	rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
+ 	aKeyName += rImplementationName;
+-	aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
++	aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
+ 
+ 	Reference< XRegistryKey > xKey;
+ 	try
+@@ -141,10 +137,8 @@ extern "C" void * SAL_CALL component_get
+ 	if ( ::odma::ContentProvider::getImplementationName_Static().
+ 				compareToAscii( pImplName ) == 0 )
+ 	{
+-		if(::odma::LoadLibrary())
++		if(::odma::DMSsAvailable())
+ 			xFactory = ::odma::ContentProvider::createServiceFactory( xSMgr );
+-		else
+-			OSL_ASSERT(!"Could not load library!");
+ 	}
+ 
+ 	//////////////////////////////////////////////////////////////////////
+Index: ucb/source/ucp/odma/ucpodma.xml
+===================================================================
+RCS file: /cvs/ucb/ucb/ucb/source/ucp/odma/ucpodma.xml,v
+retrieving revision 1.3
+diff -p -u -r1.3 ucpodma.xml
+--- ucb/source/ucp/odma/ucpodma.xml	25 Aug 2003 13:02:22 -0000	1.3
++++ ucb/source/ucp/odma/ucpodma.xml	6 Nov 2006 00:12:09 -0000
+@@ -11,7 +11,7 @@
+             Ocke Janssen
+         </author>
+         <name>
+-            com.sun.star.comp.ucb.OdmaContentProvider
++            com.sun.star.comp.ucb.ODMAContentProvider
+         </name>
+         <description>
+ 	    This component implements a Content Provider for the Universal
+dummy line to avoid confusing diff-mode
+--- officecfg/registry/data/org/openoffice/ucb/Configuration.xcu	8 Sep 2005 15:07:17 -0000	1.9
++++ officecfg/registry/data/org/openoffice/ucb/Configuration.xcu	13 Mar 2006 11:05:44 -0000
+@@ -151,4 +151,15 @@
+               </prop>
+             </node>
++            <node oor:name="Provider42" oor:op="replace">
++              <prop oor:name="ServiceName">
++                <value>com.sun.star.ucb.ODMAContentProvider</value>
++              </prop>
++              <prop oor:name="URLTemplate">
++                <value>vnd.sun.star.odma</value>
++              </prop>
++              <prop oor:name="Arguments">
++                <value/>
++              </prop>
++            </node>
+           </node>
+         </node>
+dummy line to avoid confusing diff-mode
+--- scp2/source/ooo/file_library_ooo.scp	17 Feb 2006 16:52:02 -0000	1.184.2.2
++++ scp2/source/ooo/file_library_ooo.scp	13 Mar 2006 11:07:23 -0000
+@@ -850,6 +850,10 @@
+ #endif
+ #endif
+ 
++#ifdef WNT
++SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fps_ODMA, fps_odma.uno )
++#endif
++
+ SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fps_Office, fps_office.uno )
+ SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fpicker, fpicker.uno )
+ 
+@@ -2069,4 +2071,8 @@
+ SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpexpand1, ucpexpand1.uno)
+ 
++#ifdef WNT
++SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpodma1, ucpodma1)
++#endif
++
+ #ifndef SYSTEM_HUNSPELL
+ 
+dummy line to avoid confusing diff-mode
+--- desktop/source/app/cmdlineargs.cxx	8 Sep 2005 17:05:40 -0000	1.28
++++ desktop/source/app/cmdlineargs.cxx	13 Mar 2006 12:00:25 -0000
+@@ -275,4 +282,13 @@
+ 					else
+ 					{
++						if( bOpenEvent || bViewEvent || bForceNewEvent || bForceOpenEvent )
++						{
++							if( ::rtl::OUString(aArgStr).matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("::ODMA")) )
++							{
++								::rtl::OUString sArg = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.odma:/"));
++								sArg += aArgStr;
++								aArgStr = sArg;
++							}	
++						}
+ 						// handle this argument as a filename
+ 						if ( bOpenEvent )
+dummy line to avoid confusing diff-mode
+--- fpicker/prj/build.lst
++++ fpicker/prj/build.lst
+@@ -2,6 +2,7 @@
+ fp	fpicker\inc							nmake	-	all	fp_inc NULL
+ fp	fpicker\source\generic				nmake	-	all	fp_generic fp_inc NULL
+ fp	fpicker\source\office				nmake	-	all	fp_office fp_inc NULL
++fp	fpicker\source\odma				nmake	-	w	fp_odma NULL
+ fp	fpicker\source\unx\gnome			nmake	-	u	fp_gnome_filepicker fp_inc NULL
+ fp	fpicker\source\unx\kde_unx			nmake	-	u	fp_unx_common fp_inc NULL
+ fp	fpicker\source\unx\kde				nmake	-	u	fp_unx_kde_filepicker fp_inc NULL
+dummy line to avoid confusing diff-mode
+--- fpicker/source/generic/makefile.mk
++++ fpicker/source/generic/makefile.mk
+@@ -54,6 +54,7 @@
+ SHL1IMPLIB=	i$(TARGET)
+ SHL1OBJS=	$(SLOFILES)
+ SHL1STDLIBS=\
++	$(ODMA_LIB_LIB) \
+ 	$(VCLLIB) \
+ 	$(SVLLIB) \
+         $(SVTOOLLIB) \
+dummy line to avoid confusing diff-mode
+--- fpicker/source/generic/fpicker.cxx
++++ fpicker/source/generic/fpicker.cxx
+@@ -52,6 +52,13 @@
+ #include "cppuhelper/implementationentry.hxx"
+ #endif
+ #include "com/sun/star/lang/XMultiComponentFactory.hpp"
++
++#ifdef WNT
++#include <tools/prewin.h>
++#include <tools/postwin.h>
++#include <odma_lib.hxx>
++#endif
++
+ #include "svtools/miscopt.hxx"
+ #include "svtools/pickerhistoryaccess.hxx"
+ 
+@@ -75,15 +75,22 @@
+  */
+ static OUString FilePicker_getSystemPickerServiceName()
+ {
++#ifdef UNX
+ 	OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
+ 	if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("gnome"))
+ 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFilePicker"));
+ 	else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
+ 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFilePicker"));
+     else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
+         return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFilePicker"));
+-    else
+-        return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFilePicker"));
++#endif
++#ifdef WNT
++	if (SvtMiscOptions().TryODMADialog() && ::odma::DMSsAvailable()) {
++		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.ODMAFilePicker"));
++	}
++	return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.Win32FilePicker"));
++#endif
++	return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFilePicker"));
+ }
+ 
+ static Reference< css::uno::XInterface > FilePicker_createInstance (
+@@ -144,14 +144,20 @@
+ static OUString FolderPicker_getSystemPickerServiceName()
+ {
+ 	OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
++#ifdef UNX
+ 	if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("gnome"))
+ 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFolderPicker"));
+ 	else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
+ 		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFolderPicker"));
+     else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
+         return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFolderPicker"));
+-	else
+-		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFolderPicker"));
++#endif
++#ifdef WNT
++	if (SvtMiscOptions().TryODMADialog() && ::odma::DMSsAvailable()) {
++		return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.ODMAFolderPicker"));
++	}
++#endif
++	return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFolderPicker"));
+ }
+ 
+ static Reference< css::uno::XInterface > FolderPicker_createInstance (
+diff -ruN fpicker/source/odma/ODMAFilePicker.cxx fpicker/source/odma/ODMAFilePicker.cxx
+--- fpicker/source/odma/ODMAFilePicker.cxx	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/ODMAFilePicker.cxx	2006-11-03 13:31:25.014750000 +0000
+@@ -0,0 +1,565 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision: 12010 $
++ *
++ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_fpicker.hxx"
++
++#include "ODMAFilePicker.hxx"
++
++#ifndef _TOOLS_DEBUG_HXX
++#include <tools/debug.hxx>
++#endif
++
++#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
++#include <com/sun/star/beans/PropertyValue.hpp>
++#endif
++#ifndef _COM_SUN_STAR_BEANS_STRINGPAIR_HPP_
++#include <com/sun/star/beans/StringPair.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_UI_DIALOGS_FILEPREVIEWIMAGEFORMATS_HPP_
++#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UI_DIALOGS_EXECUTABLEDIALOGRESULTS_HPP_
++#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UI_DIALOGS_TEMPLATEDESCRIPTION_HPP_
++#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_
++#include <com/sun/star/ucb/XCommandEnvironment.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_UNO_ANY_HXX_
++#include <com/sun/star/uno/Any.hxx>
++#endif
++#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
++#include <com/sun/star/uno/Sequence.hxx>
++#endif
++
++#ifndef _COMPHELPER_SEQUENCE_HXX_
++#include <comphelper/sequence.hxx>
++#endif
++#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
++#include <cppuhelper/typeprovider.hxx>
++#endif
++#ifndef _UCBHELPER_CONTENT_HXX
++#include <ucbhelper/content.hxx>
++#endif
++#ifndef _UNOTOOLS_UCBHELPER_HXX
++#include <unotools/ucbhelper.hxx>
++#endif
++
++#ifndef ODMA_LIB_HXX
++#include <tools/prewin.h>
++#include <tools/postwin.h>
++#include <odma_lib.hxx>
++#endif
++
++// using ----------------------------------------------------------------
++
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::ui::dialogs;
++using namespace ::com::sun::star::ucb;
++using namespace ::com::sun::star::uno;
++using namespace ::com::sun::star::util;
++using namespace ::utl;
++
++//------------------------------------------------------------------------------------
++// class ODMAFilePicker
++//------------------------------------------------------------------------------------
++ODMAFilePicker::ODMAFilePicker( const Reference < XMultiServiceFactory >& xFactory ) :
++	cppu::WeakComponentImplHelper9<
++	  XFilterManager, 
++	  XFilterGroupManager,
++	  XFilePickerControlAccess,
++	  XFilePickerNotifier,
++	  XFilePreview,
++	  XInitialization,
++	  XCancellable,
++	  XEventListener,
++	  XServiceInfo>( m_rbHelperMtx ),
++	m_bMultiSelectionMode( sal_False ),
++	m_aDefaultName( ),
++	m_aFiles( ),
++	m_nDialogKind( OPEN )
++{
++	m_bUseDMS = ::odma::DMSsAvailable();
++	m_xSystemFilePicker = xFactory->createInstance(
++		::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.Win32FilePicker" ) );
++}
++
++// XExecutableDialog functions
++
++void SAL_CALL ODMAFilePicker::setTitle( const ::rtl::OUString& aTitle )
++	throw (RuntimeException)
++{
++	Reference< XExecutableDialog > xExecutableDialog( m_xSystemFilePicker, UNO_QUERY );
++	xExecutableDialog->setTitle( aTitle);
++}
++
++sal_Int16 SAL_CALL ODMAFilePicker::execute( )
++	throw (RuntimeException)
++{
++	ODMSTATUS status;
++	ODMHANDLE handle;
++	WORD count = 0;
++	DWORD flags;
++
++	status = NODMRegisterApp( &handle, ODM_API_VERSION, "sodma", (DWORD) GetActiveWindow( ), NULL );
++	if (status == ODM_SUCCESS)
++	{
++		if (m_nDialogKind == OPEN)
++		{
++			const int MAXDOCS = 10;
++			char docids[ODM_DOCID_MAX*MAXDOCS+1];
++			WORD docidslen = sizeof( docids );
++
++			flags = 0;
++			if (m_bMultiSelectionMode)
++				count = MAXDOCS;
++			else
++				count = 1;
++			status = NODMSelectDocEx( handle, docids, &docidslen, &count, &flags, NULL );
++			if (status == ODM_SUCCESS)
++			{
++				// GroupWise doesn't set docidslen or count, so
++				// calculate number of document IDs manually 
++				char *p = docids;
++				count = 0;
++				while (*p) {
++					count++;
++					p += strlen( p ) + 1;
++				}
++			}
++			else if (status == ODM_E_NOSUPPORT)
++			{
++				status = NODMSelectDoc( handle, docids, &flags );
++				if (status == ODM_SUCCESS)
++					count = 1;
++			}
++			NODMUnRegisterApp( handle );
++			if (status == ODM_SUCCESS)
++			{
++				rtl::OUString *strings = new rtl::OUString[count];
++				int i;
++				char *p = docids;
++				
++				for (i = 0; i < count; i++) {
++					// Insane API... the first element is a full URI, the rest
++					// are just the "basenames" in the same "directory".
++					if (i == 0)
++						strings[0] = rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) + rtl::OUString::createFromAscii( p );
++					else
++						strings[i] = rtl::OUString::createFromAscii( p );
++					p += strlen( p );
++				}
++
++				m_aFiles = Sequence< rtl::OUString >( strings, count );
++				delete[] strings;
++				return ExecutableDialogResults::OK;
++			}
++		}
++		else /* m_nDialogKind == SAVE */
++		{
++			char newdocid[ODM_DOCID_MAX+1];
++			
++			if (m_aDefaultName.getLength() == 0 ||
++				!m_aDefaultName.matchIgnoreAsciiCaseAsciiL( "::ODMA\\", 7, 0 ))
++			{
++				char tempdocid[ODM_DOCID_MAX+1];
++
++				status = NODMNewDoc( handle, tempdocid, ODM_SILENT, NULL, NULL );
++				if (status == ODM_SUCCESS)
++					status = NODMSaveAs( handle, tempdocid, newdocid, NULL, NULL, NULL );
++			}
++			else
++			{
++				rtl::OString sDefaultName = rtl::OUStringToOString( m_aDefaultName, RTL_TEXTENCODING_ASCII_US );
++				status = NODMSaveAs( handle,
++									 const_cast<sal_Char*>( sDefaultName.getStr() ),
++									 newdocid, NULL, NULL, NULL );
++			}
++
++			NODMUnRegisterApp( handle );
++			if (status == ODM_SUCCESS)
++			{
++				rtl::OUString s( rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) +
++								 rtl::OUString::createFromAscii( newdocid ) );
++				// Create a Content for the odma URL so that
++				// odma::ContentProvider will learn about the DOCID we
++				// just created.
++				ucbhelper::Content content( s, Reference< XCommandEnvironment >() );
++				m_aFiles = Sequence< rtl::OUString >( &s, 1 );
++				return ExecutableDialogResults::OK;
++			}
++		}
++	}
++	if (status == ODM_E_APPSELECT)
++	{
++		m_bUseDMS = sal_False;
++
++		Reference< XExecutableDialog > xExecutableDialog( m_xSystemFilePicker, UNO_QUERY );
++		return xExecutableDialog->execute();
++	}
++
++	// Fallback
++	return ExecutableDialogResults::CANCEL;
++}
++
++// XFilePicker functions
++
++void SAL_CALL ODMAFilePicker::setMultiSelectionMode( sal_Bool bMode )
++	throw( RuntimeException )
++{
++	m_bMultiSelectionMode = bMode;
++
++	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
++	xFilePicker->setMultiSelectionMode( bMode );
++}
++
++void SAL_CALL ODMAFilePicker::setDefaultName( const rtl::OUString& aName )
++	throw( RuntimeException )
++{
++	// When editing a document from DMS, and doing Save As, this is
++	// called twice, first with the complete DOCID, the second time
++	// with the "extension" removed. Of course, this is bogus, as
++	// DOCIDs should be treated as opaque strings, they don't have
++	// "extensions".
++
++	// In the GroupWise case a DOCID is like
++	// ::ODMA\GRPWISE\FOO1.BAR.FOO-Bla_bla:12345.12 where the final
++	// dot separates the version number, not an "extension".
++	//
++	// So ignore the second call.
++	//
++	// The second call without "extension" is done if the
++	// XFilePickerControlAccess is set to have auto-extension turned
++	// on. (See sfx2/source/dialog/filedlghelper.cxx:
++	// FileDialogHelper_Impl::implInitializeFileName().) Thus we could
++	// alternatively make sure that a getValue call to get
++	// ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION returns
++	// false. But that might be hard as we don't know in advance
++	// whether the user will click the "use application dialog"
++	// button. If so, we indeed do use auto-extensions.
++	//
++	// Yes, this is ugly, relying on knowing details on how this
++	// function will be called.
++
++	if ( m_aDefaultName.getLength() == 0 )
++		m_aDefaultName = aName;
++
++	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
++	xFilePicker->setDefaultName( aName );
++}
++
++void SAL_CALL ODMAFilePicker::setDisplayDirectory( const rtl::OUString& aDirectory )
++    throw( IllegalArgumentException, RuntimeException )
++{
++	m_aDisplayDirectory = aDirectory;
++
++	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
++	xFilePicker->setDisplayDirectory( aDirectory );
++}
++
++rtl::OUString SAL_CALL ODMAFilePicker::getDisplayDirectory( )
++	throw( RuntimeException )
++{
++	if (m_bUseDMS)
++		return m_aDisplayDirectory;
++
++	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePicker->getDisplayDirectory();
++}
++
++Sequence< rtl::OUString > SAL_CALL ODMAFilePicker::getFiles( )
++	throw( RuntimeException )
++{
++	if (m_bUseDMS)
++		return m_aFiles;
++
++	Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePicker->getFiles();
++}
++
++// XFilePickerControlAccess functions
++
++void SAL_CALL ODMAFilePicker::setValue( sal_Int16 nElementID,
++										sal_Int16 nControlAction,
++										const Any& rValue )
++    throw( RuntimeException )
++{
++	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
++	xFilePickerControlAccess->setValue( nElementID, nControlAction, rValue );
++}
++
++Any SAL_CALL ODMAFilePicker::getValue( sal_Int16 nElementID, sal_Int16 nControlAction )
++    throw( RuntimeException )
++{
++	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePickerControlAccess->getValue( nElementID, nControlAction );
++}
++
++void SAL_CALL ODMAFilePicker::setLabel( sal_Int16 nLabelID, const rtl::OUString& rValue )
++    throw ( RuntimeException )
++{
++	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
++	xFilePickerControlAccess->setLabel( nLabelID, rValue );
++}
++
++rtl::OUString SAL_CALL ODMAFilePicker::getLabel( sal_Int16 nLabelID )
++    throw ( RuntimeException )
++{
++	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePickerControlAccess->getLabel( nLabelID );
++}
++
++void SAL_CALL ODMAFilePicker::enableControl( sal_Int16 nElementID, sal_Bool bEnable )
++    throw( RuntimeException )
++{
++	Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
++	xFilePickerControlAccess->enableControl( nElementID, bEnable );
++}
++
++// XFilePickerNotifier functions
++
++void SAL_CALL ODMAFilePicker::addFilePickerListener( const Reference< XFilePickerListener >& xListener )
++	throw ( RuntimeException )
++{
++	Reference< XFilePickerNotifier > xFilePickerNotifier( m_xSystemFilePicker, UNO_QUERY );
++	xFilePickerNotifier->addFilePickerListener( xListener );
++}
++
++void SAL_CALL ODMAFilePicker::removeFilePickerListener( const Reference< XFilePickerListener >& xListener )
++	throw ( RuntimeException )
++{
++	Reference< XFilePickerNotifier > xFilePickerNotifier( m_xSystemFilePicker, UNO_QUERY );
++	xFilePickerNotifier->removeFilePickerListener( xListener );
++}
++
++// XFilePreview functions
++
++Sequence< sal_Int16 > SAL_CALL ODMAFilePicker::getSupportedImageFormats( )
++    throw ( RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePreview->getSupportedImageFormats();
++}
++
++sal_Int32 SAL_CALL ODMAFilePicker::getTargetColorDepth( )
++	throw ( RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePreview->getTargetColorDepth();
++}
++
++sal_Int32 SAL_CALL ODMAFilePicker::getAvailableWidth( )
++	throw ( RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePreview->getAvailableWidth();
++}
++
++sal_Int32 SAL_CALL ODMAFilePicker::getAvailableHeight( )
++	throw ( RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePreview->getAvailableHeight();
++}
++
++void SAL_CALL ODMAFilePicker::setImage( sal_Int16 aImageFormat, const Any& rImage )
++    throw ( IllegalArgumentException, RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	xFilePreview->setImage( aImageFormat, rImage);
++}
++
++sal_Bool SAL_CALL ODMAFilePicker::setShowState( sal_Bool bShowState )
++    throw ( RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePreview->setShowState( bShowState);
++}
++
++sal_Bool SAL_CALL ODMAFilePicker::getShowState( )
++	throw ( RuntimeException )
++{
++	Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
++	return xFilePreview->getShowState();
++}
++
++// XFilterGroupManager functions
++
++void SAL_CALL ODMAFilePicker::appendFilterGroup( const ::rtl::OUString& sGroupTitle,
++												 const Sequence< StringPair >& aFilters )
++	throw ( IllegalArgumentException, RuntimeException )
++{
++	Reference< XFilterGroupManager > xFilterGroupManager( m_xSystemFilePicker, UNO_QUERY );
++	xFilterGroupManager->appendFilterGroup( sGroupTitle, aFilters );
++}
++
++// XFilterManager functions
++
++void SAL_CALL ODMAFilePicker::appendFilter( const rtl::OUString& aTitle,
++                                            const rtl::OUString& aFilter )
++    throw( IllegalArgumentException, RuntimeException )
++{
++	Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
++	xFilterManager->appendFilter( aTitle, aFilter );
++}
++
++void SAL_CALL ODMAFilePicker::setCurrentFilter( const rtl::OUString& aTitle )
++    throw( IllegalArgumentException, RuntimeException )
++{
++	Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
++	xFilterManager->setCurrentFilter( aTitle );
++}
++
++rtl::OUString SAL_CALL ODMAFilePicker::getCurrentFilter( )
++    throw( RuntimeException )
++{
++	Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
++	return xFilterManager->getCurrentFilter();
++}
++
++// XInitialization functions
++
++void SAL_CALL ODMAFilePicker::initialize( const Sequence< Any >& aArguments )
++	throw ( Exception, RuntimeException )
++{
++	if (aArguments.getLength( ) > 0)
++	{
++		Any aAny = aArguments[0];
++
++		if ( (aAny.getValueType() == ::getCppuType((sal_Int16*)0)) ||
++			 (aAny.getValueType() == ::getCppuType((sal_Int8*)0)) )
++		{
++			sal_Int16 nTemplateId = -1;
++			aAny >>= nTemplateId;
++
++			switch (nTemplateId) {
++			case TemplateDescription::FILEOPEN_SIMPLE:
++			case TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
++			case TemplateDescription::FILEOPEN_PLAY:
++			case TemplateDescription::FILEOPEN_READONLY_VERSION:
++			case TemplateDescription::FILEOPEN_LINK_PREVIEW:
++				m_nDialogKind = OPEN;
++				break;
++			default:
++				m_nDialogKind = SAVE;
++			}
++		}
++	}
++
++	Reference< XInitialization > xInitialization( m_xSystemFilePicker, UNO_QUERY );
++	xInitialization->initialize( aArguments );
++}
++
++// XCancellable functions
++
++void SAL_CALL ODMAFilePicker::cancel( )
++	throw( ::com::sun::star::uno::RuntimeException )
++{
++	Reference< XCancellable > xCancellable( m_xSystemFilePicker, UNO_QUERY );
++	xCancellable->cancel();
++}
++
++// XEventListener functions
++
++void SAL_CALL ODMAFilePicker::disposing( const ::com::sun::star::lang::EventObject& aEvent )
++	throw( RuntimeException )
++{
++	Reference< XEventListener > xEventListener( m_xSystemFilePicker, UNO_QUERY );
++	xEventListener->disposing( aEvent );
++}
++
++// XServiceInfo functions
++
++rtl::OUString SAL_CALL ODMAFilePicker::getImplementationName( )
++	throw( RuntimeException )
++{
++	return impl_getStaticImplementationName();
++}
++
++sal_Bool SAL_CALL ODMAFilePicker::supportsService( const rtl::OUString& sServiceName )
++	throw( RuntimeException )
++{
++    Sequence< rtl::OUString > seqServiceNames = getSupportedServiceNames();
++    const rtl::OUString* pArray = seqServiceNames.getConstArray();
++    for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
++	{
++        if ( sServiceName == pArray[i] )
++		{
++            return sal_True ;
++		}
++	}
++    return sal_False ;
++}
++
++Sequence< rtl::OUString > SAL_CALL ODMAFilePicker::getSupportedServiceNames( )
++	throw( RuntimeException )
++{
++	return impl_getStaticSupportedServiceNames();
++}
++
++Sequence< rtl::OUString > ODMAFilePicker::impl_getStaticSupportedServiceNames( )
++{
++    Sequence< rtl::OUString > seqServiceNames( 2 );
++    rtl::OUString* pArray = seqServiceNames.getArray();
++    pArray[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFilePicker" );
++
++	// Super-ugly, but check the function sal_Bool
++	// lcl_isSystemFilePicker( const Reference< XFilePicker >& ) in
++	// sfx2/source/dialog/filedlghelper.cxx 
++
++    // Lovely undocumented coupling right across abstraction layers,
++    // isn't it?  If we don't claim to implement this "service" (which
++    // is not defined in any IDL file, btw), we get hangs.
++
++    pArray[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
++    return seqServiceNames ;
++}
++
++rtl::OUString ODMAFilePicker::impl_getStaticImplementationName( )
++{
++    return rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFilePicker" );
++}
++
++Reference< XInterface > SAL_CALL ODMAFilePicker::impl_createInstance(
++	const Reference< XComponentContext >& rxContext)
++	throw( Exception )
++{
++	Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
++	return Reference< XInterface >( *new ODMAFilePicker( xServiceManager ) );
++}
+diff -ruN fpicker/source/odma/ODMAFilePicker.hxx fpicker/source/odma/ODMAFilePicker.hxx
+--- fpicker/source/odma/ODMAFilePicker.hxx	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/ODMAFilePicker.hxx	2006-11-02 01:39:33.483549300 +0000
+@@ -0,0 +1,242 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision: 12010 $
++ *
++ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++#ifndef INCLUDED_ODMA_FILEPICKER_HXX
++#define INCLUDED_ODMA_FILEPICKER_HXX
++
++#ifndef _CPPUHELPER_COMPBASE9_HXX_
++#include <cppuhelper/compbase9.hxx>
++#endif
++
++#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_
++#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERNOTIFIER_HPP_
++#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILEPREVIEW_HPP_
++#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFILTERMANAGER_HPP_
++#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERGROUPMANAGER_HPP_
++#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERLISTENER_HPP_
++#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_
++#include <com/sun/star/util/XCancellable.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UNO_XCOMPONENT_CONTEXT_HPP_
++#include <com/sun/star/uno/XComponentContext.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
++#include <com/sun/star/lang/XInitialization.hpp>
++#endif
++
++// class ODMAFilePicker ---------------------------------------------------
++
++class ODMAFilePicker :
++	public cppu::WeakComponentImplHelper9<
++	  ::com::sun::star::ui::dialogs::XFilterManager,
++	  ::com::sun::star::ui::dialogs::XFilterGroupManager,
++	  ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
++	  ::com::sun::star::ui::dialogs::XFilePickerNotifier,
++	  ::com::sun::star::ui::dialogs::XFilePreview,
++	  ::com::sun::star::lang::XInitialization,
++      ::com::sun::star::util::XCancellable,
++	  ::com::sun::star::lang::XEventListener,
++	  ::com::sun::star::lang::XServiceInfo >		
++{
++private:
++	sal_Bool m_bUseDMS;
++	sal_Bool m_bMultiSelectionMode;
++	rtl::OUString m_aDefaultName;
++	rtl::OUString m_aDisplayDirectory;
++	::com::sun::star::uno::Sequence< rtl::OUString > m_aFiles;
++	enum { OPEN, SAVE } m_nDialogKind;
++
++	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xSystemFilePicker;
++
++protected:
++	::osl::Mutex m_rbHelperMtx;
++
++public:
++
++	ODMAFilePicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
++
++	// XFilterManager functions
++
++	virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle,
++										const ::rtl::OUString& aFilter )
++		throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
++
++	virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle )
++		throw( ::com::sun::star::lang::IllegalArgumentException,
++			   ::com::sun::star::uno::RuntimeException );
++
++	virtual ::rtl::OUString SAL_CALL getCurrentFilter( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	// XFilterGroupManager functions
++
++	virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle,
++											 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters )
++		throw (::com::sun::star::lang::IllegalArgumentException,
++			   ::com::sun::star::uno::RuntimeException );
++
++	// XFilePickerControlAccess functions
++
++	virtual void SAL_CALL setValue( sal_Int16 nControlID,
++									sal_Int16 nControlAction,
++									const ::com::sun::star::uno::Any& aValue )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 nControlID,
++											 sal_Int16 nControlAction )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual void SAL_CALL setLabel( sal_Int16 nControlID,
++									const ::rtl::OUString& aValue )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlID )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++	virtual void SAL_CALL enableControl( sal_Int16 nControlID,
++										 sal_Bool bEnable )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	// XFilePicker functions
++
++	virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
++		throw( ::com::sun::star::lang::IllegalArgumentException,
++			   ::com::sun::star::uno::RuntimeException );
++
++	virtual ::rtl::OUString SAL_CALL getDisplayDirectory( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	// XExecutableDialog functions
++
++	virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle )
++		throw (::com::sun::star::uno::RuntimeException);
++
++	virtual sal_Int16 SAL_CALL execute(  )
++		throw (::com::sun::star::uno::RuntimeException);
++
++	// XFilePickerNotifier functions
++
++    virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++	// XFilePreview functions
++
++    virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Int32 SAL_CALL getTargetColorDepth( )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Int32 SAL_CALL getAvailableWidth( )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Int32 SAL_CALL getAvailableHeight( )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual void SAL_CALL setImage( sal_Int16 aImageFormat,
++									const ::com::sun::star::uno::Any& aImage )
++		throw ( ::com::sun::star::lang::IllegalArgumentException,
++				::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Bool SAL_CALL getShowState( )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++	// XInitialization functions
++
++    virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
++		throw ( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
++
++	// XCancellable functions
++
++	virtual void SAL_CALL cancel( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	// XEventListener functions
++
++	using cppu::WeakComponentImplHelperBase::disposing;
++	virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) 
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	// XServiceInfo functions
++
++    virtual ::rtl::OUString SAL_CALL getImplementationName( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	/* Helper for XServiceInfo */
++	static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames( );
++	static ::rtl::OUString impl_getStaticImplementationName( );
++
++    /* Helper for registry */
++	static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance ( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
++		throw( ::com::sun::star::uno::Exception );
++};
++
++#endif // INCLUDED_ODMA_FILEPICKER_HXX
+diff -ruN fpicker/source/odma/ODMAFolderPicker.cxx fpicker/source/odma/ODMAFolderPicker.cxx
+--- fpicker/source/odma/ODMAFolderPicker.cxx	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/ODMAFolderPicker.cxx	2006-10-30 01:09:51.281250000 +0000
+@@ -0,0 +1,203 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision: 12010 $
++ *
++ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_fpicker.hxx"
++
++#include "ODMAFolderPicker.hxx"
++
++#define _SVSTDARR_STRINGSDTOR
++#include "svtools/svstdarr.hxx"
++
++#ifndef  _COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HPP_
++#include <com/sun/star/container/XContentEnumerationAccess.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_CONTAINER_XSET_HPP_
++#include <com/sun/star/container/XSet.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_UNO_ANY_HXX_
++#include <com/sun/star/uno/Any.hxx>
++#endif
++#ifndef  _CPPUHELPER_FACTORY_HXX_
++#include <cppuhelper/factory.hxx>
++#endif
++#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
++#include <com/sun/star/beans/XPropertySet.hpp>
++#endif
++
++#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
++#include <svtools/pathoptions.hxx>
++#endif
++
++#ifndef ODMA_LIB_HXX
++#include <tools/prewin.h>
++#include <odma_lib.hxx>
++#include <tools/postwin.h>
++#endif
++
++// using ----------------------------------------------------------------
++
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::container;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::uno;
++
++//------------------------------------------------------------------------------------
++// class ODMAFolderPicker
++//------------------------------------------------------------------------------------
++
++//------------------------------------------------------------------------------------
++ODMAFolderPicker::ODMAFolderPicker( const Reference < XMultiServiceFactory >& xFactory ) :
++	cppu::WeakComponentImplHelper2<
++	  XFolderPicker,
++	  XServiceInfo>( m_rbHelperMtx ),
++	m_bUseDMS( sal_False )
++{
++	m_xInterface = xFactory->createInstance(
++		::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" ) );
++}
++
++// XExecutableDialog functions
++
++void SAL_CALL ODMAFolderPicker::setTitle( const ::rtl::OUString& _rTitle ) throw (RuntimeException)
++{
++	if (m_bUseDMS)
++		return;
++
++	Reference< XExecutableDialog > xExecutableDialog( m_xInterface, UNO_QUERY );
++	xExecutableDialog->setTitle( _rTitle);
++}
++
++sal_Int16 SAL_CALL ODMAFolderPicker::execute( )
++	throw (RuntimeException)
++{
++	if (m_bUseDMS)
++		throw new RuntimeException( );
++
++	Reference< XExecutableDialog > xExecutableDialog( m_xInterface, UNO_QUERY );
++	return xExecutableDialog->execute();
++}
++
++// XFolderPicker functions
++
++void SAL_CALL ODMAFolderPicker::setDisplayDirectory( const ::rtl::OUString& aDirectory )
++    throw( IllegalArgumentException, RuntimeException )
++{
++	if (m_bUseDMS)
++		return;
++
++	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
++	xFolderPicker->setDisplayDirectory( aDirectory );
++}
++
++::rtl::OUString SAL_CALL ODMAFolderPicker::getDisplayDirectory( )
++	throw( RuntimeException )
++{
++	if (m_bUseDMS)
++		return rtl::OUString();
++
++	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
++	return xFolderPicker->getDisplayDirectory();
++}
++
++::rtl::OUString SAL_CALL ODMAFolderPicker::getDirectory( )
++	throw( RuntimeException )
++{
++	if (m_bUseDMS)
++		return rtl::OUString();
++
++	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
++	return xFolderPicker->getDirectory();
++}
++
++void SAL_CALL ODMAFolderPicker::setDescription( const ::rtl::OUString& aDescription )
++    throw( RuntimeException )
++{
++	if (m_bUseDMS)
++		return;
++
++	Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
++	xFolderPicker->setDescription( aDescription );
++}
++
++// XServiceInfo
++
++::rtl::OUString SAL_CALL ODMAFolderPicker::getImplementationName( )
++	throw( RuntimeException )
++{
++	return impl_getStaticImplementationName();
++}
++
++sal_Bool SAL_CALL ODMAFolderPicker::supportsService( const ::rtl::OUString& sServiceName )
++	throw( RuntimeException )
++{
++    Sequence< ::rtl::OUString > seqServiceNames = getSupportedServiceNames();
++    const ::rtl::OUString* pArray = seqServiceNames.getConstArray();
++    for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
++	{
++        if ( sServiceName == pArray[i] )
++		{
++            return sal_True ;
++		}
++	}
++    return sal_False ;
++}
++
++Sequence< ::rtl::OUString > SAL_CALL ODMAFolderPicker::getSupportedServiceNames()
++	throw( RuntimeException )
++{
++	return impl_getStaticSupportedServiceNames();
++}
++
++Sequence< ::rtl::OUString > ODMAFolderPicker::impl_getStaticSupportedServiceNames( )
++{
++    Sequence< ::rtl::OUString > seqServiceNames( 2 );
++    ::rtl::OUString* pArray = seqServiceNames.getArray();
++    pArray[0] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FolderPicker" );
++    pArray[1] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFolderPicker" );
++    return seqServiceNames ;
++}
++
++::rtl::OUString ODMAFolderPicker::impl_getStaticImplementationName( )
++{
++    return ::rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFolderPicker" );
++}
++
++Reference< XInterface > SAL_CALL ODMAFolderPicker::impl_createInstance( const Reference< XComponentContext >& rxContext )
++    throw( Exception )
++{
++	Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
++	return Reference< XInterface >( *new ODMAFolderPicker( xServiceManager ) );
++}
+diff -ruN fpicker/source/odma/ODMAFolderPicker.hxx fpicker/source/odma/ODMAFolderPicker.hxx
+--- fpicker/source/odma/ODMAFolderPicker.hxx	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/ODMAFolderPicker.hxx	2006-10-26 22:36:34.718125000 +0000
+@@ -0,0 +1,118 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision: 12010 $
++ *
++ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++#ifndef INCLUDED_ODMA_FOLDERPICKER_HXX
++#define INCLUDED_ODMA_FOLDERPICKER_HXX
++
++#ifndef _CPPUHELPER_COMPBASE2_HXX_
++#include <cppuhelper/compbase2.hxx>
++#endif
++
++#ifndef  _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HPP_
++#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#endif
++#ifndef  _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
++#include <com/sun/star/lang/XSingleServiceFactory.hpp>
++#endif
++#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
++#include <com/sun/star/lang/DisposedException.hpp>
++#endif
++#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
++#include <com/sun/star/uno/XComponentContext.hpp>
++#endif
++
++// class ODMAFolderPicker ---------------------------------------------------
++
++class ODMAFolderPicker :
++	public cppu::WeakComponentImplHelper2<
++	  ::com::sun::star::ui::dialogs::XFolderPicker,	
++	  ::com::sun::star::lang::XServiceInfo >
++{
++private:
++	sal_Bool m_bUseDMS;
++
++protected:
++	::osl::Mutex m_rbHelperMtx;
++
++	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xInterface;
++
++public:
++	ODMAFolderPicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
++
++	// XFolderPicker functions
++
++	virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
++		throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
++
++	virtual ::rtl::OUString SAL_CALL getDisplayDirectory( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual ::rtl::OUString SAL_CALL getDirectory( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual void SAL_CALL setDescription( const ::rtl::OUString& aDescription )
++		throw ( ::com::sun::star::uno::RuntimeException );
++
++	// XExecutableDialog functions
++
++	virtual void SAL_CALL setTitle( const ::rtl::OUString& _rTitle )
++		throw (::com::sun::star::uno::RuntimeException);
++
++	virtual sal_Int16 SAL_CALL execute(  )
++		throw (::com::sun::star::uno::RuntimeException);
++
++	// XServiceInfo functions
++
++    virtual ::rtl::OUString SAL_CALL getImplementationName( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++    virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
++		throw( ::com::sun::star::uno::RuntimeException );
++
++	/* Helper for XServiceInfo */
++	static com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames( );
++	static ::rtl::OUString impl_getStaticImplementationName( );
++
++	/* Helper for registry */
++	static ::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL impl_createInstance ( const ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext )
++		throw( com::sun::star::uno::Exception );
++};
++
++#endif // INCLUDED_ODMA_FOLDERPICKER_HXX
+diff -ruN fpicker/source/odma/exports.map fpicker/source/odma/exports.map
+--- fpicker/source/odma/exports.map	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/exports.map	2006-10-25 20:34:28.536983200 +0000
+@@ -0,0 +1,8 @@
++UDK_3_0_0 {
++    global:
++		component_getImplementationEnvironment;
++		component_writeInfo;
++		component_getFactory;
++	local:
++		*;
++};
+diff -ruN fpicker/source/odma/fps_odma.cxx fpicker/source/odma/fps_odma.cxx
+--- fpicker/source/odma/fps_odma.cxx	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/fps_odma.cxx	2006-10-25 01:19:43.329875000 +0000
+@@ -0,0 +1,90 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision: 12010 $
++ *
++ *  last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_fpicker.hxx"
++
++#ifndef _SAL_TYPES_H_
++#include "sal/types.h"
++#endif
++
++#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
++#include "cppuhelper/implementationentry.hxx"
++#endif
++
++#include "ODMAFilePicker.hxx"
++#include "ODMAFolderPicker.hxx"
++
++static cppu::ImplementationEntry g_entries[] =
++{
++	{
++		ODMAFilePicker::impl_createInstance,
++		ODMAFilePicker::impl_getStaticImplementationName,
++		ODMAFilePicker::impl_getStaticSupportedServiceNames,
++		cppu::createSingleComponentFactory, 0, 0
++	},
++	{
++		ODMAFolderPicker::impl_createInstance,
++		ODMAFolderPicker::impl_getStaticImplementationName,
++		ODMAFolderPicker::impl_getStaticSupportedServiceNames,
++		cppu::createSingleComponentFactory, 0, 0
++	},
++	{ 0, 0, 0, 0, 0, 0 }
++};
++
++extern "C"
++{
++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
++	const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */)
++{
++	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
++}
++
++SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
++	void * pServiceManager, void * pRegistryKey)
++{
++	return cppu::component_writeInfoHelper (
++		pServiceManager, pRegistryKey, g_entries);
++}
++
++SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
++	const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
++{
++	return cppu::component_getFactoryHelper (
++		pImplementationName, pServiceManager, pRegistryKey, g_entries);
++}
++
++} // extern "C"
+diff -ruN fpicker/source/odma/makefile.mk fpicker/source/odma/makefile.mk
+--- fpicker/source/odma/makefile.mk	1970-01-01 00:00:00.000000000 +0000
++++ fpicker/source/odma/makefile.mk	2006-10-30 14:40:05.281250000 +0000
+@@ -0,0 +1,79 @@
++#*************************************************************************
++#
++#   OpenOffice.org - a multi-platform office productivity suite
++#
++#   $RCSfile$
++#
++#   $Revision: 12010 $
++#
++#   last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
++#
++#   The Contents of this file are made available subject to
++#   the terms of GNU Lesser General Public License Version 2.1.
++#
++#
++#     GNU Lesser General Public License Version 2.1
++#     =============================================
++#     Copyright 2005 by Sun Microsystems, Inc.
++#     901 San Antonio Road, Palo Alto, CA 94303, USA
++#
++#     This library is free software; you can redistribute it and/or
++#     modify it under the terms of the GNU Lesser General Public
++#     License version 2.1, as published by the Free Software Foundation.
++#
++#     This library is distributed in the hope that it will be useful,
++#     but WITHOUT ANY WARRANTY; without even the implied warranty of
++#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#     Lesser General Public License for more details.
++#
++#     You should have received a copy of the GNU Lesser General Public
++#     License along with this library; if not, write to the Free Software
++#     Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++#     MA  02111-1307  USA
++#
++#*************************************************************************
++
++PRJ=..$/..
++
++PRJNAME=fpicker
++TARGET=fps_odma
++LIBTARGET=NO
++ENABLE_EXCEPTIONS=TRUE
++GEN_HID=TRUE
++
++# --- Settings -----------------------------------------------------
++
++.INCLUDE :  settings.mk
++DLLPRE=
++
++# --- Files --------------------------------------------------------
++
++SLOFILES=\
++	$(SLO)$/ODMAFilePicker.obj \
++	$(SLO)$/ODMAFolderPicker.obj \
++	$(SLO)$/fps_odma.obj
++
++SHL1TARGET=	$(TARGET).uno
++SHL1IMPLIB=	i$(TARGET)
++SHL1OBJS=	$(SLOFILES)
++SHL1STDLIBS=\
++	$(ODMA_LIB_LIB) \
++	$(SVTOOLLIB) \
++	$(TKLIB) \
++	$(VCLLIB) \
++	$(SVLLIB) \
++	$(UNOTOOLSLIB) \
++	$(TOOLSLIB) \
++	$(UCBHELPERLIB) \
++	$(COMPHELPERLIB) \
++	$(CPPUHELPERLIB) \
++	$(CPPULIB) \
++	$(SALLIB)
++
++SHL1VERSIONMAP=exports.map
++SHL1DEF=	$(MISC)$/$(SHL1TARGET).def
++DEF1NAME=	$(SHL1TARGET)
++
++# --- Targets ------------------------------------------------------
++
++.INCLUDE :	target.mk
+dummy line to avoid confusing diff-mode
+--- solenv/inc/libs.mk
++++ solenv/inc/libs.mk
+@@ -35,6 +35,9 @@
+ LIBSMKREV!:="$$Revision: 1.130 $$"
+ 
+ .IF "$(GUI)"=="UNX" || "$(COM)"=="GCC"
++
++# No ODMA on UNX
++ODMA_LIB_LIB= 
+ 
+ #
+ #externe libs in plattform.mk
+@@ -279,6 +279,7 @@
+ UNOPKGLIB=-lunopkg
+ 
+ .ELSE				# "$(GUI)"=="UNX"
++ODMA_LIB_LIB=odma_lib.lib
+ AWTLIB*=jawt.lib
+ AVMEDIALIB=iavmedia.lib
+ ICUINLIB=icuin.lib
+dummy line to avoid confusing diff-mode
+--- svtools/inc/svtools/miscopt.hxx
++++ svtools/inc/svtools/miscopt.hxx
+@@ -136,6 +136,10 @@
+         void        SetUseSystemFileDialog( sal_Bool bSet );
+         sal_Bool    IsUseSystemFileDialogReadOnly() const;
+ 
++        sal_Bool    TryODMADialog() const;
++        void        SetTryODMADialog( sal_Bool bSet );
++        sal_Bool    IsTryUseODMADialogReadOnly() const;
++
+         sal_Bool    IsPluginsEnabled() const;
+         void        SetPluginsEnabled( sal_Bool bEnable );
+         sal_Bool    IsPluginsEnabledReadOnly() const;
+dummy line to avoid confusing diff-mode
+--- svtools/source/config/miscopt.cxx
++++ svtools/source/config/miscopt.cxx
+@@ -110,8 +110,10 @@
+ #define PROPERTYHANDLE_SYMBOLSTYLE			4
+ #define PROPERTYNAME_USESYSTEMPRINTDIALOG	ASCII_STR("UseSystemPrintDialog")
+ #define PROPERTYHANDLE_USESYSTEMPRINTDIALOG	5
++#define PROPERTYNAME_TRYODMADIALOG	ASCII_STR("TryODMADialog")
++#define PROPERTYHANDLE_TRYODMADIALOG	6
+ 
+-#define PROPERTYCOUNT						6
++#define PROPERTYCOUNT						7
+ 
+ #define VCL_TOOLBOX_STYLE_FLAT				((USHORT)0x0004) // from <vcl/toolbox.hxx>
+ 
+@@ -131,6 +131,8 @@
+     LinkList    aList;
+     sal_Bool    m_bUseSystemFileDialog;
+     sal_Bool    m_bIsUseSystemFileDialogRO;
++    sal_Bool    m_bTryODMADialog;
++    sal_Bool    m_bIsTryODMADialogRO;
+     sal_Bool    m_bPluginsEnabled;
+     sal_Bool    m_bIsPluginsEnabledRO;
+     sal_Int16   m_nSymbolsSize;
+@@ -207,6 +207,15 @@
+         inline sal_Bool IsUseSystemFileDialogReadOnly() const
+         { return m_bIsUseSystemFileDialogRO; }
+ 
++        inline sal_Bool TryODMADialog() const
++        { return m_bTryODMADialog; }
++
++        inline void SetTryODMADialog( sal_Bool bSet )
++        {  m_bTryODMADialog = bSet; SetModified(); }
++
++        inline sal_Bool IsTryUseODMADialogReadOnly() const
++        { return m_bIsTryODMADialogRO; }
++
+         inline sal_Bool IsPluginsEnabled() const
+         { return m_bPluginsEnabled; }
+ 
+@@ -319,6 +319,8 @@
+ 
+     , m_bUseSystemFileDialog( sal_False )
+     , m_bIsUseSystemFileDialogRO( sal_False )
++    , m_bTryODMADialog( sal_False )
++    , m_bIsTryODMADialogRO( sal_False )
+     , m_bPluginsEnabled( sal_False )
+     , m_bIsPluginsEnabledRO( sal_False )
+     , m_nSymbolsSize( 0 )
+@@ -388,6 +388,16 @@
+                 break;
+             }
+ 
++            case PROPERTYHANDLE_TRYODMADIALOG :
++            {
++                if( !(seqValues[nProperty] >>= m_bTryODMADialog) )
++                {
++                    DBG_ERROR("Wrong type of \"Misc\\TryODMADialog\"!" );
++                }
++                m_bIsTryODMADialogRO = seqRO[nProperty];
++                break;
++            }
++
+             case PROPERTYHANDLE_SYMBOLSTYLE :
+             {
+                 ::rtl::OUString aSymbolsStyle;
+@@ -489,6 +489,13 @@
+                                                             }
+                                                         }
+                                                     break;
++            case PROPERTYHANDLE_TRYODMADIALOG       :   {
++                                                            if( !(seqValues[nProperty] >>= m_bTryODMADialog) )
++                                                            {
++                                                                DBG_ERROR("Wrong type of \"Misc\\TryODMADialog\"!" );
++                                                            }
++                                                        }
++                                                    break;
+             case PROPERTYHANDLE_SYMBOLSTYLE         :   {
+                                                             ::rtl::OUString aSymbolsStyle;
+                                                             if( seqValues[nProperty] >>= aSymbolsStyle )
+@@ -638,6 +638,13 @@
+                 break;
+             }
+ 
++            case PROPERTYHANDLE_TRYODMADIALOG :
++            {
++                if ( !m_bIsTryODMADialogRO )
++                    seqValues[nProperty] <<= m_bTryODMADialog;
++                break;
++            }
++
+             case PROPERTYHANDLE_SYMBOLSTYLE :
+             {
+                 if ( !m_bIsSymbolsStyleRO )
+@@ -668,7 +668,8 @@
+         PROPERTYNAME_TOOLBOXSTYLE,
+         PROPERTYNAME_USESYSTEMFILEDIALOG,
+         PROPERTYNAME_SYMBOLSTYLE,
+-        PROPERTYNAME_USESYSTEMPRINTDIALOG
++        PROPERTYNAME_USESYSTEMPRINTDIALOG,
++        PROPERTYNAME_TRYODMADIALOG
+ 	};
+ 
+ 	// Initialize return sequence with these list ...
+@@ -737,6 +737,21 @@
+     return m_pDataContainer->IsUseSystemFileDialogReadOnly();
+ }
+ 
++sal_Bool SvtMiscOptions::TryODMADialog() const
++{
++    return m_pDataContainer->TryODMADialog();
++}
++
++void SvtMiscOptions::SetTryODMADialog( sal_Bool bEnable )
++{
++    m_pDataContainer->SetTryODMADialog( bEnable );
++}
++
++sal_Bool SvtMiscOptions::IsTryUseODMADialogReadOnly() const
++{
++    return m_pDataContainer->IsTryUseODMADialogReadOnly();
++}
++
+ sal_Bool SvtMiscOptions::IsPluginsEnabled() const
+ {
+     return m_pDataContainer->IsPluginsEnabled();
+dummy line to avoid confusing diff-mode
+--- officecfg/registry/schema/org/openoffice/Office/Common.xcs
++++ officecfg/registry/schema/org/openoffice/Office/Common.xcs
+@@ -5510,6 +5510,13 @@
+ 				</info>
+ 				<value>false</value>
+ 			</prop>
++			<prop oor:name="TryODMADialog" oor:type="xs:boolean">
++				<info>
++					<author>tml</author>
++					<desc>Determines whether to show the document creation and selection of the machine's default ODMA (Open Document Management Architecture) DMS (Document Management System). If true, and the machine has a DMS available, the DMS's dialog will be displayed. That dialog then gives the opportunity to use the application's dialog instead, which means the normal system file and folder pickers will be displayed. Relevant only on Windows.</desc>
++				</info>
++				<value>false</value>
++			</prop>
+ 			<prop oor:name="SymbolSet" oor:type="xs:short">
+ 				<!-- UIHints: Tools  Options General View -->
+ 				<info>
+dummy line to avoid confusing diff-mode
+--- svx/source/dialog/optgdlg.src
++++ svx/source/dialog/optgdlg.src
+@@ -136,43 +136,50 @@
+ 		Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
+ 		Text [ en-US ] = "~Use %PRODUCTNAME dialogs";
+ 	};
++	CheckBox CB_ODMADLG
++	{
++        Pos = MAP_APPFONT( COL1, ROW8 );
++		Size = MAP_APPFONT( WHOLE_WIDTH - COL4, RSC_CD_CHECKBOX_HEIGHT );
++		Text [ en-US ] = "Show ODMA DMS dialogs first";
++		Text [ en-GB ] = "Show ODMA DMS dialogues first";
++	};
+     FixedLine FL_DOCSTATUS
+     {
+-        Pos = MAP_APPFONT( COL0, ROW8 );
++        Pos = MAP_APPFONT( COL0, ROW9 );
+ 		Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
+     	Text [ en-US ] = "Document status";
+ 	};
+     CheckBox CB_DOCSTATUS
+ 	{
+-        Pos = MAP_APPFONT( COL1, ROW9 );
++        Pos = MAP_APPFONT( COL1, ROW10 );
+ 		Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
+     	Text [ en-US ] = "~Printing sets \"document modified\" status";
+ 	};
+ 	FixedLine FL_TWOFIGURE
+ 	{
+-		Pos = MAP_APPFONT( COL0, ROW10 );
++		Pos = MAP_APPFONT( COL0, ROW11 );
+ 		Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
+ 		Text [ en-US ] = "Year (two digits)" ;
+ 	};
+ 	FixedText FT_INTERPRET
+ 	{
+-		Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
++		Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
+ 		Size = MAP_APPFONT( DIFF( COL1, COL3), RSC_CD_FIXEDTEXT_HEIGHT );
+ 		Text [ en-US ] = "Interpret as years between";
+ 	};
+ 	NumericField NF_YEARVALUE
+ 	{
+ 		Border = TRUE ;
+-		Pos = MAP_APPFONT( COL4, ROW11 );
++		Pos = MAP_APPFONT( COL4, ROW12 );
+ 		Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
+ 		Minimum = 1583 ;
+ 		Maximum = 9857 ;
+ 		Spin = TRUE ;
+ 		Repeat = TRUE ;
+ 	};
+ 	FixedText FT_TOYEAR
+ 	{
+-		Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
++		Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
+ 		Size = MAP_APPFONT( WHOLE_WIDTH - COL6, RSC_CD_FIXEDTEXT_HEIGHT );
+ 		Text [ en-US ] = "and " ;
+ 	};
+dummy line to avoid confusing diff-mode
+--- svx/source/dialog/optgdlg.hrc
++++ svx/source/dialog/optgdlg.hrc
+@@ -64,6 +64,7 @@
+ #define ROW9					(ROW8+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
+ #define ROW10					(ROW9+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
+ #define ROW11					(ROW10+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
++#define ROW12					(ROW11+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
+ 
+ #define DIFF(v1,v2)						(v2-v1)
+ #define OFFS_TEXTBOX_FIXEDTEXT(base)	(base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
+@@ -200,6 +200,7 @@
+ #define FT_HELPAGENT_TIME_UNIT      59
+ #define FL_DOCSTATUS                60
+ #define CB_DOCSTATUS                61
++#define CB_ODMADLG                  62
+ #endif // #ifndef _SVX_OPTGDLG_HRC
+ 
+ // ******************************************************************* EOF
+dummy line to avoid confusing diff-mode
+--- svx/source/dialog/optgdlg.hxx
++++ svx/source/dialog/optgdlg.hxx
+@@ -74,6 +74,7 @@
+     FixedLine           aFileDlgFL;
+     ReadOnlyImage       aFileDlgROImage;
+ 	CheckBox            aFileDlgCB;
++	CheckBox            aODMADlgCB;
+ 
+     FixedLine           aPrintDlgFL;
+ 	CheckBox            aPrintDlgCB;
+@@ -89,6 +89,9 @@
+ 	DECL_LINK( TwoFigureConfigHdl, NumericField* );
+ 	DECL_LINK( HelpCheckHdl_Impl, CheckBox* );
+ 	DECL_LINK( HelpAgentResetHdl_Impl, PushButton* );
++#ifdef WNT
++	DECL_LINK( OnFileDlgToggled, CheckBox* );
++#endif
+ protected:
+ 	virtual int         DeactivatePage( SfxItemSet* pSet = NULL );
+ 
+dummy line to avoid confusing diff-mode
+--- svx/source/dialog/optgdlg.cxx
++++ svx/source/dialog/optgdlg.cxx
+@@ -291,6 +291,7 @@
+ 	aFileDlgFL			( this, SVX_RES( FL_FILEDLG ) ),
+     aFileDlgROImage     ( this, SVX_RES( FI_FILEDLG_RO ) ),
+ 	aFileDlgCB			( this, SVX_RES( CB_FILEDLG ) ),
++	aODMADlgCB			( this, SVX_RES( CB_ODMADLG ) ),
+ 	aPrintDlgFL			( this, SVX_RES( FL_PRINTDLG ) ),
+ 	aPrintDlgCB			( this, SVX_RES( CB_PRINTDLG ) ),
+ 	aDocStatusFL		( this, SVX_RES( FL_DOCSTATUS ) ),
+@@ -313,6 +313,31 @@
+     aPrintDlgFL.Hide();
+     aPrintDlgCB.Hide();
+     #endif
++
++#ifdef WNT
++	aFileDlgCB.SetToggleHdl( LINK( this, OfaMiscTabPage, OnFileDlgToggled ) );
++#else
++	{
++		aODMADlgCB.Hide();
++		// rearrange the following controls
++		Point aNewPos = aDocStatusFL.GetPosPixel();
++		long nDelta = aNewPos.Y() - aFileDlgFL.GetPosPixel().Y();
++
++		Window* pWins[] =
++		{
++		    &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
++		    &aInterpretFT, &aYearValueField, &aToYearFT
++		};
++		Window** pCurrent = pWins;
++		const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
++		for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
++		{
++		    aNewPos = (*pCurrent)->GetPosPixel();
++		    aNewPos.Y() -= nDelta;
++		    (*pCurrent)->SetPosPixel( aNewPos );
++		}
++	}
++#endif
+ 
+     if ( !aFileDlgCB.IsVisible() )
+     {
+@@ -409,6 +409,14 @@
+         aHelpFormatLB.SetEntryData( i, pData );
+     }
+ }
++
++#ifdef WNT
++IMPL_LINK( OfaMiscTabPage, OnFileDlgToggled, CheckBox*, EMPTYARG ) 
++{
++	aODMADlgCB.Enable( !aFileDlgCB.IsChecked() );
++	return 0;
++}
++#endif
+ 
+ // -----------------------------------------------------------------------
+ 
+@@ -429,6 +429,13 @@
+         bModified = TRUE;
+     }
+ 
++    if ( aODMADlgCB.IsChecked() != aODMADlgCB.GetSavedValue() )
++    {
++        SvtMiscOptions aMiscOpt;
++        aMiscOpt.SetTryODMADialog( aODMADlgCB.IsChecked() );
++        bModified = TRUE;
++    }
++
+ 	if ( aDocStatusCB.IsChecked() != aDocStatusCB.GetSavedValue() )
+     {
+         SvtPrintWarningOptions aPrintOptions;
+@@ -476,6 +476,9 @@
+     aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
+     aPrintDlgCB.SaveValue();
+ 
++    aODMADlgCB.Check( aMiscOpt.TryODMADialog() );
++    aODMADlgCB.SaveValue();
++
+     SvtPrintWarningOptions aPrintOptions;
+     aDocStatusCB.Check(aPrintOptions.IsModifyDocumentOnPrintingAllowed());
+     aDocStatusCB.SaveValue();
+dummy line to avoid confusing diff-mode
+--- solenv/bin/modules/installer/windows/component.pm
++++ solenv/bin/modules/installer/windows/component.pm
+@@ -103,6 +103,11 @@
+ 	{
+ 		return $installer::globals::templatefolder;
+ 	}
++
++	if ( $destdir =~ /\bPREDEFINED_OSWINSHELLNEWDIR\b/ )
++	{
++		return "WindowsShellNewFolder";
++	}
+ 
+ 	my $destination = $onefile->{'destination'};
+ 	
+dummy line to avoid confusing diff-mode
+--- solenv/bin/modules/installer/windows/directory.pm
++++ solenv/bin/modules/installer/windows/directory.pm
+@@ -174,6 +174,12 @@
+ 
+ 	my $oneline = "TARGETDIR\t\tSourceDir\n";
+ 	push(@{$directorytableref}, $oneline);
++	
++	$oneline = "WindowsFolder\tTARGETDIR\tWindows\n";
++	push(@{$directorytableref}, $oneline);
++
++	$oneline = "WindowsShellNewFolder\tWindowsFolder\tShellNew\n";
++	push(@{$directorytableref}, $oneline);
+ 	
+ 	my $sourcediraddon = "";
+ 	if (($installer::globals::addchildprojects) ||
+dummy line to avoid confusing diff-mode
+--- scp2/source/ooo/directory_ooo.scp
++++ scp2/source/ooo/directory_ooo.scp
+@@ -166,6 +166,11 @@
+     ParentID = gid_Dir_Program;
+     DosName = "shellnew";
+ End
++
++Directory gid_Dir_ShellnewToo
++    ParentID = gid_Dir_Program;
++    DosName = "shellnew2";
++End
+ 
+ #endif
+ 
+--- scp2/source/ooo/file_ooo.scp
++++ scp2/source/ooo/file_ooo.scp
+@@ -2025,24 +2025,56 @@
+ 
+ STD_SHELLNEW_FILE(gid_File_Shellnew_Ods_Soffice, soffice.ods)
+ 
++File gid_File_Shellnew2_Ods_Soffice
++    TXT_FILE_BODY;
++    Styles = (PACKED,WORKSTATION, OVERWRITE);
++    Dir = PREDEFINED_OSWINSHELLNEWDIR;
++    NetDir = gid_Dir_ShellnewToo;
++    Name = "soffice.ods";
++End
++
+ #endif
+ 
+ #ifdef WNT
+ 
+ STD_SHELLNEW_FILE(gid_File_Shellnew_Odg_Soffice, soffice.odg)
+ 
++File gid_File_Shellnew2_Odg_Soffice
++    TXT_FILE_BODY;
++    Styles = (PACKED,WORKSTATION, OVERWRITE);
++    Dir = PREDEFINED_OSWINSHELLNEWDIR;
++    NetDir = gid_Dir_ShellnewToo;
++    Name = "soffice.odg";
++End
++
+ #endif
+ 
+ #ifdef WNT
+ 
+ STD_SHELLNEW_FILE(gid_File_Shellnew_Odp_Soffice, soffice.odp)
+ 
++File gid_File_Shellnew2_Odp_Soffice
++    TXT_FILE_BODY;
++    Styles = (PACKED,WORKSTATION, OVERWRITE);
++    Dir = PREDEFINED_OSWINSHELLNEWDIR;
++    NetDir = gid_Dir_ShellnewToo;
++    Name = "soffice.odp";
++End
++
+ #endif
+ 
+ #ifdef WNT
+ 
+ STD_SHELLNEW_FILE(gid_File_Shellnew_Odt_Soffice, soffice.odt)
+ 
++File gid_File_Shellnew2_Odt_Soffice
++    TXT_FILE_BODY;
++    Styles = (PACKED,WORKSTATION, OVERWRITE);
++    Dir = PREDEFINED_OSWINSHELLNEWDIR;
++    NetDir = gid_Dir_ShellnewToo;
++    Name = "soffice.odt";
++End
++
+ #endif
+ 
+ File gid_File_Txt_License
+dummy line to avoid confusing diff-mode
+--- framework/prj/build.lst
++++ framework/prj/build.lst
+@@ -1,4 +1,4 @@
+-fr	framework	:	svtools NULL
++fr	framework	:	svtools ucb NULL
+ fr	framework								usr1	-	all	fr_mkout NULL
+ fr  framework\inc			        	    nmake   -   all fr_inc NULL
+ fr  framework\source\constant               nmake   -   all fr_constant fr_inc NULL
+dummy line to avoid confusing diff-mode
+--- framework/source/uielement/recentfilesmenucontroller.cxx
++++ framework/source/uielement/recentfilesmenucontroller.cxx
+@@ -105,6 +105,11 @@
+ #include <svtools/historyoptions.hxx>
+ #include <cppuhelper/implbase1.hxx>
+ #include <osl/file.hxx>
++#ifdef WNT
++#include <tools/prewin.h>
++#include <tools/postwin.h>
++#include <odma_lib.hxx>
++#endif
+ //#include <tools/solar.hrc>
+ 
+ //_________________________________________________________________________________________________________________
+@@ -248,6 +248,41 @@
+ 					else
+ 						aMenuTitle = aSystemPath;
+ 				}
++#ifdef WNT
++				else if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_ODMA && ::odma::DMSsAvailable ())
++				{
++					String aShortTitle = m_aRecentFilesItems.at( i ).aTitle;
++
++					// This is against all rules for using
++					// proper abstraction layers and whatnot.
++					// But figuring out how to do it "right"
++					// would have taken the whole week. 
++					// So just call the odma_lib functions... 
++					// (odma_lib is a thin layer on
++					// top of the ODMA32 DLL)
++
++					static ODMHANDLE handle = NULL;
++					static sal_Bool beenhere = sal_False;
++					ODMSTATUS status;
++
++					if ( ! beenhere )
++					{
++					    status = NODMRegisterApp( &handle, ODM_API_VERSION, "sodma", NULL, NULL );
++					    beenhere = sal_True;
++					}
++
++					if ( handle != NULL )
++					{
++					    rtl::OUString s = aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_MS_1252 );
++					    s = s.copy( strlen ( "vnd.sun.star.odma:/" ) );
++					    char title[47];
++					    status = NODMGetDocInfo( handle, rtl::OUStringToOString( s, RTL_TEXTENCODING_MS_1252 ).pData->buffer, ODM_NAME, title, sizeof ( title ) );
++					    aShortTitle = String::CreateFromAscii( title );
++					}
++					aMenuTitle += aShortTitle;
++					aTipHelpText = aURLString;
++				}
++#endif
+ 				else
+ 				{
+ 					// Use INetURLObject to abbreviate all other URLs
+dummy line to avoid confusing diff-mode
+--- framework/util/makefile.mk
++++ framework/util/makefile.mk
+@@ -329,6 +329,7 @@
+                 $(SLO)$/langselectionmenucontroller.obj
+ 
+ SHL4STDLIBS=	\
++		 $(ODMA_LIB_LIB)    \
+ 				$(FWILIB)                           \
+ 				$(FWELIB)							\
+ 				$(SVTOOLLIB)						\



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]