summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-02-11 19:57:49 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-02-11 19:57:49 -0600
commit305d2830e7e672c8bfc8affb0a4e304ab4c7e754 (patch)
tree564d706376c64b4ddd4138b725d59fe599c71820
parent67c7d15e4027c6fde7f5a1fbd11c581a244ab583 (diff)
merge non-conflicting changes in fpicker
-rw-r--r--fpicker/inc/pch/precompiled_fpicker.cxx2
-rw-r--r--fpicker/inc/pch/precompiled_fpicker.hxx2
-rw-r--r--fpicker/prj/build.lst5
-rw-r--r--fpicker/prj/d.lst1
-rw-r--r--fpicker/source/aqua/AquaFilePickerDelegate.hxx3
-rw-r--r--fpicker/source/aqua/CFStringUtilities.cxx3
-rw-r--r--fpicker/source/aqua/CFStringUtilities.hxx3
-rw-r--r--fpicker/source/aqua/ControlHelper.cxx17
-rw-r--r--fpicker/source/aqua/ControlHelper.hxx3
-rw-r--r--fpicker/source/aqua/FPServiceInfo.hxx3
-rw-r--r--fpicker/source/aqua/FPentry.cxx23
-rw-r--r--fpicker/source/aqua/FilterHelper.cxx18
-rw-r--r--fpicker/source/aqua/FilterHelper.hxx27
-rw-r--r--fpicker/source/aqua/NSString_OOoAdditions.hxx4
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.hxx1
-rw-r--r--fpicker/source/aqua/SalAquaConstants.h4
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.cxx67
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.hxx7
-rw-r--r--fpicker/source/aqua/SalAquaFolderPicker.cxx29
-rw-r--r--fpicker/source/aqua/SalAquaFolderPicker.hxx11
-rw-r--r--fpicker/source/aqua/SalAquaPicker.cxx20
-rw-r--r--fpicker/source/aqua/SalAquaPicker.hxx9
-rw-r--r--fpicker/source/aqua/resourceprovider.cxx15
-rw-r--r--fpicker/source/aqua/resourceprovider.hxx3
-rw-r--r--fpicker/source/generic/fpicker.cxx35
-rw-r--r--fpicker/source/odma/ODMAFilePicker.cxx550
-rw-r--r--fpicker/source/odma/ODMAFilePicker.hxx216
-rw-r--r--fpicker/source/odma/ODMAFolderPicker.cxx185
-rw-r--r--fpicker/source/odma/ODMAFolderPicker.hxx103
-rw-r--r--fpicker/source/odma/fps_odma.cxx81
-rw-r--r--fpicker/source/odma/makefile.mk72
-rw-r--r--fpicker/source/office/OfficeControlAccess.cxx7
-rw-r--r--fpicker/source/office/OfficeControlAccess.hxx2
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx63
-rw-r--r--fpicker/source/office/OfficeFilePicker.hxx4
-rw-r--r--fpicker/source/office/OfficeFolderPicker.cxx6
-rw-r--r--fpicker/source/office/OfficeFolderPicker.hxx3
-rw-r--r--fpicker/source/office/asyncfilepicker.cxx2
-rw-r--r--fpicker/source/office/asyncfilepicker.hxx2
-rw-r--r--fpicker/source/office/commonpicker.cxx32
-rw-r--r--fpicker/source/office/commonpicker.hxx2
-rw-r--r--fpicker/source/office/fpinteraction.cxx2
-rw-r--r--fpicker/source/office/fpinteraction.hxx2
-rw-r--r--fpicker/source/office/fps_office.cxx5
-rw-r--r--fpicker/source/office/fpsmartcontent.cxx4
-rw-r--r--fpicker/source/office/fpsmartcontent.hxx3
-rw-r--r--fpicker/source/office/iodlg.cxx48
-rw-r--r--fpicker/source/office/iodlg.hxx7
-rw-r--r--fpicker/source/office/iodlg.src14
-rw-r--r--fpicker/source/office/iodlgimp.cxx11
-rw-r--r--fpicker/source/office/iodlgimp.hxx2
-rw-r--r--fpicker/source/office/pickercallbacks.hxx2
-rw-r--r--fpicker/source/unx/gnome/FPServiceInfo.hxx3
-rw-r--r--fpicker/source/unx/gnome/FPentry.cxx16
-rw-r--r--fpicker/source/unx/gnome/SalGtkFilePicker.cxx154
-rw-r--r--fpicker/source/unx/gnome/SalGtkFilePicker.hxx15
-rw-r--r--fpicker/source/unx/gnome/SalGtkFolderPicker.cxx32
-rw-r--r--fpicker/source/unx/gnome/SalGtkFolderPicker.hxx14
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.cxx11
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.hxx3
-rw-r--r--fpicker/source/unx/gnome/eventnotification.hxx5
-rw-r--r--fpicker/source/unx/gnome/resourceprovider.cxx12
-rw-r--r--fpicker/source/unx/gnome/resourceprovider.hxx8
-rw-r--r--fpicker/source/unx/kde/kdecommandthread.cxx179
-rw-r--r--fpicker/source/unx/kde/kdecommandthread.hxx97
-rw-r--r--fpicker/source/unx/kde/kdefilepicker.cxx734
-rw-r--r--fpicker/source/unx/kde/kdefilepicker.hxx127
-rw-r--r--fpicker/source/unx/kde/kdefpmain.cxx94
-rw-r--r--fpicker/source/unx/kde/makefile.mk75
-rw-r--r--fpicker/source/unx/kde4/FPServiceInfo.hxx3
-rw-r--r--fpicker/source/unx/kde4/KDE4FPEntry.cxx5
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx54
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.hxx7
-rw-r--r--fpicker/source/unx/kde_unx/UnxCommandThread.cxx314
-rw-r--r--fpicker/source/unx/kde_unx/UnxCommandThread.hxx135
-rw-r--r--fpicker/source/unx/kde_unx/UnxFPentry.cxx127
-rw-r--r--fpicker/source/unx/kde_unx/UnxFilePicker.cxx931
-rw-r--r--fpicker/source/unx/kde_unx/UnxFilePicker.hxx177
-rw-r--r--fpicker/source/unx/kde_unx/UnxNotifyThread.cxx115
-rw-r--r--fpicker/source/unx/kde_unx/UnxNotifyThread.hxx89
-rw-r--r--fpicker/source/unx/kde_unx/fps-kde-ucd.txt6
-rw-r--r--fpicker/source/unx/kde_unx/fps_kde.xml51
-rw-r--r--fpicker/source/unx/kde_unx/makefile.mk84
-rw-r--r--fpicker/source/win32/filepicker/FPServiceInfo.hxx3
-rw-r--r--fpicker/source/win32/filepicker/FPentry.cxx5
-rw-r--r--fpicker/source/win32/filepicker/FileOpenDlg.cxx21
-rw-r--r--fpicker/source/win32/filepicker/FileOpenDlg.hxx15
-rw-r--r--fpicker/source/win32/filepicker/FilePicker.cxx23
-rw-r--r--fpicker/source/win32/filepicker/FilePicker.hxx3
-rw-r--r--fpicker/source/win32/filepicker/FilterContainer.cxx2
-rw-r--r--fpicker/source/win32/filepicker/FilterContainer.hxx3
-rw-r--r--fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx3
-rw-r--r--fpicker/source/win32/filepicker/PreviewCtrl.cxx4
-rw-r--r--fpicker/source/win32/filepicker/PreviewCtrl.hxx5
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.cxx19
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.hxx3
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx15
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx3
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx3
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx37
-rw-r--r--fpicker/source/win32/filepicker/WinFileOpenImpl.cxx21
-rw-r--r--fpicker/source/win32/filepicker/WinFileOpenImpl.hxx5
-rw-r--r--fpicker/source/win32/filepicker/afxres.h3
-rw-r--r--fpicker/source/win32/filepicker/asynceventnotifier.cxx9
-rw-r--r--fpicker/source/win32/filepicker/asynceventnotifier.hxx3
-rw-r--r--fpicker/source/win32/filepicker/asyncrequests.cxx7
-rw-r--r--fpicker/source/win32/filepicker/asyncrequests.hxx3
-rw-r--r--fpicker/source/win32/filepicker/comptr.hxx3
-rw-r--r--fpicker/source/win32/filepicker/controlaccess.cxx20
-rw-r--r--fpicker/source/win32/filepicker/controlaccess.hxx3
-rw-r--r--fpicker/source/win32/filepicker/controlcommand.cxx3
-rw-r--r--fpicker/source/win32/filepicker/controlcommand.hxx3
-rw-r--r--fpicker/source/win32/filepicker/controlcommandrequest.hxx3
-rw-r--r--fpicker/source/win32/filepicker/controlcommandresult.hxx3
-rw-r--r--fpicker/source/win32/filepicker/customcontrol.cxx2
-rw-r--r--fpicker/source/win32/filepicker/customcontrol.hxx3
-rw-r--r--fpicker/source/win32/filepicker/customcontrolcontainer.cxx3
-rw-r--r--fpicker/source/win32/filepicker/customcontrolcontainer.hxx3
-rw-r--r--fpicker/source/win32/filepicker/customcontrolfactory.cxx3
-rw-r--r--fpicker/source/win32/filepicker/customcontrolfactory.hxx3
-rw-r--r--fpicker/source/win32/filepicker/dialogcustomcontrols.cxx3
-rw-r--r--fpicker/source/win32/filepicker/dialogcustomcontrols.hxx3
-rw-r--r--fpicker/source/win32/filepicker/dibpreview.cxx7
-rw-r--r--fpicker/source/win32/filepicker/dibpreview.hxx3
-rw-r--r--fpicker/source/win32/filepicker/eventnotification.hxx5
-rw-r--r--fpicker/source/win32/filepicker/filepickereventnotification.cxx3
-rw-r--r--fpicker/source/win32/filepicker/filepickereventnotification.hxx3
-rw-r--r--fpicker/source/win32/filepicker/filepickerstate.cxx3
-rw-r--r--fpicker/source/win32/filepicker/filepickerstate.hxx3
-rw-r--r--fpicker/source/win32/filepicker/getfilenamewrapper.cxx2
-rw-r--r--fpicker/source/win32/filepicker/getfilenamewrapper.hxx3
-rw-r--r--fpicker/source/win32/filepicker/helppopupwindow.cxx3
-rw-r--r--fpicker/source/win32/filepicker/helppopupwindow.hxx3
-rw-r--r--fpicker/source/win32/filepicker/platform_vista.h27
-rw-r--r--fpicker/source/win32/filepicker/platform_xp.h2
-rw-r--r--fpicker/source/win32/filepicker/previewadapter.cxx5
-rw-r--r--fpicker/source/win32/filepicker/previewadapter.hxx3
-rw-r--r--fpicker/source/win32/filepicker/previewbase.cxx9
-rw-r--r--fpicker/source/win32/filepicker/previewbase.hxx3
-rw-r--r--fpicker/source/win32/filepicker/propmap.hxx3
-rw-r--r--fpicker/source/win32/filepicker/resource.h3
-rw-r--r--fpicker/source/win32/filepicker/shared.hxx10
-rw-r--r--fpicker/source/win32/filepicker/vistatypes.h3
-rw-r--r--fpicker/source/win32/filepicker/workbench/Test_fps.cxx22
-rw-r--r--fpicker/source/win32/folderpicker/FOPServiceInfo.hxx3
-rw-r--r--fpicker/source/win32/folderpicker/FolderPicker.cxx8
-rw-r--r--fpicker/source/win32/folderpicker/FolderPicker.hxx7
-rw-r--r--fpicker/source/win32/folderpicker/FopEvtDisp.hxx3
-rw-r--r--fpicker/source/win32/folderpicker/Fopentry.cxx7
-rw-r--r--fpicker/source/win32/folderpicker/MtaFop.cxx3
-rw-r--r--fpicker/source/win32/folderpicker/MtaFop.hxx3
-rw-r--r--fpicker/source/win32/folderpicker/WinFOPImpl.cxx11
-rw-r--r--fpicker/source/win32/folderpicker/WinFOPImpl.hxx3
-rw-r--r--fpicker/source/win32/folderpicker/workbench/Test_fops.cxx13
-rw-r--r--fpicker/source/win32/misc/AutoBuffer.cxx3
-rw-r--r--fpicker/source/win32/misc/AutoBuffer.hxx3
-rw-r--r--fpicker/source/win32/misc/WinImplHelper.cxx22
-rw-r--r--fpicker/source/win32/misc/WinImplHelper.hxx3
-rw-r--r--fpicker/source/win32/misc/resourceprovider.cxx11
-rw-r--r--fpicker/source/win32/misc/resourceprovider.hxx7
-rw-r--r--fpicker/test/svdem.cxx4
161 files changed, 5320 insertions, 623 deletions
diff --git a/fpicker/inc/pch/precompiled_fpicker.cxx b/fpicker/inc/pch/precompiled_fpicker.cxx
index 8e4c0da71b..01ecffffe7 100644
--- a/fpicker/inc/pch/precompiled_fpicker.cxx
+++ b/fpicker/inc/pch/precompiled_fpicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,3 +28,4 @@
#include "precompiled_fpicker.hxx"
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/inc/pch/precompiled_fpicker.hxx b/fpicker/inc/pch/precompiled_fpicker.hxx
index 940b61295f..98d92fffdf 100644
--- a/fpicker/inc/pch/precompiled_fpicker.hxx
+++ b/fpicker/inc/pch/precompiled_fpicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,3 +32,4 @@
#include <tools/debug.hxx>
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/prj/build.lst b/fpicker/prj/build.lst
index 52d99ec075..017fae447b 100644
--- a/fpicker/prj/build.lst
+++ b/fpicker/prj/build.lst
@@ -2,10 +2,13 @@ fp fpicker : LIBXSLT:libxslt l10n rdbmaker svtools NULL
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\kde4 nmake - u fp_kde4_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
fp fpicker\source\aqua nmake - u fp_macosx_filepicker NULL
fp fpicker\source\win32\filepicker nmake - w fp_win32_filepicker fp_inc NULL
fp fpicker\source\win32\folderpicker nmake - w fp_win32_folderpicker fp_inc NULL
fp fpicker\source\win32\misc nmake - w fp_win32_misc fp_win32_filepicker.w fp_win32_folderpicker.w fp_inc NULL
-fp fpicker\util nmake - all fp_util fp_win32_filepicker.w fp_win32_misc.w fp_win32_folderpicker.w NULL
+fp fpicker\util nmake - all fp_util fp_gnome_filepicker.u fp_unx_common.u fp_unx_kde_filepicker.u fp_win32_filepicker.w fp_win32_misc.w fp_win32_folderpicker.w NULL
diff --git a/fpicker/prj/d.lst b/fpicker/prj/d.lst
index 4fff0467fc..f16a913f3c 100644
--- a/fpicker/prj/d.lst
+++ b/fpicker/prj/d.lst
@@ -4,6 +4,7 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid
..\%__SRC%\bin\f*.res %_DEST%\bin%_EXT%\
..\%__SRC%\bin\f*.dll %_DEST%\bin%_EXT%\
+..\%__SRC%\bin\kdefilepicker %_DEST%\bin%_EXT%\kdefilepicker
..\%__SRC%\lib\f*.so %_DEST%\lib%_EXT%\
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.hxx b/fpicker/source/aqua/AquaFilePickerDelegate.hxx
index e718f04685..b7bea762af 100644
--- a/fpicker/source/aqua/AquaFilePickerDelegate.hxx
+++ b/fpicker/source/aqua/AquaFilePickerDelegate.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@ class FilterHelper;
@end
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/CFStringUtilities.cxx b/fpicker/source/aqua/CFStringUtilities.cxx
index 482ab7876b..06fa7fc949 100644
--- a/fpicker/source/aqua/CFStringUtilities.cxx
+++ b/fpicker/source/aqua/CFStringUtilities.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,5 @@ rtl::OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info)
return sResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/CFStringUtilities.hxx b/fpicker/source/aqua/CFStringUtilities.hxx
index 357e0412de..09f3dadcd2 100644
--- a/fpicker/source/aqua/CFStringUtilities.hxx
+++ b/fpicker/source/aqua/CFStringUtilities.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -159,3 +160,5 @@ inline void DBG_PRINT_EXIT(const char * classname, const char * methodname, cons
}
#endif //_CFSTRINGUTILITIES_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/ControlHelper.cxx b/fpicker/source/aqua/ControlHelper.cxx
index 290967508d..67725c19ec 100644
--- a/fpicker/source/aqua/ControlHelper.cxx
+++ b/fpicker/source/aqua/ControlHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ControlActions.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "CFStringUtilities.hxx"
#include "resourceprovider.hxx"
@@ -168,7 +169,7 @@ void ControlHelper::enableControl( const sal_Int16 nControlId, const sal_Bool bE
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "controlId", nControlId, "enable", bEnable);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
OSL_TRACE(" preview checkbox cannot be changed");
@@ -196,7 +197,7 @@ OUString ControlHelper::getLabel( sal_Int16 nControlId )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "controlId", nControlId);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
NSControl* pControl = getControl( nControlId );
@@ -225,7 +226,7 @@ void ControlHelper::setLabel( sal_Int16 nControlId, const NSString* aLabel )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "controlId", nControlId, "label", aLabel);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
NSAutoreleasePool *pool = [NSAutoreleasePool new];
@@ -257,7 +258,7 @@ void ControlHelper::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, co
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "controlId", nControlId, "controlAction", nControlAction);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (nControlId == ExtendedFilePickerElementIds::CHECKBOX_PREVIEW) {
OSL_TRACE(" value for preview is unchangeable");
@@ -290,7 +291,7 @@ uno::Any ControlHelper::getValue( sal_Int16 nControlId, sal_Int16 nControlAction
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "controlId", nControlId, "controlAction", nControlAction);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Any aRetval;
NSControl* pControl = getControl( nControlId );
@@ -804,7 +805,7 @@ void ControlHelper::layoutControls()
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (nil == m_pUserPane) {
OSL_TRACE("no user pane to layout");
@@ -1017,3 +1018,5 @@ void ControlHelper::updateFilterUI()
DBG_PRINT_EXIT(CLASS_NAME, __func__);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx
index 739f311253..b2037471a5 100644
--- a/fpicker/source/aqua/ControlHelper.hxx
+++ b/fpicker/source/aqua/ControlHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -193,3 +194,5 @@ private:
};
#endif //_CONTROLHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/FPServiceInfo.hxx b/fpicker/source/aqua/FPServiceInfo.hxx
index 2fe849d647..57de03afa7 100644
--- a/fpicker/source/aqua/FPServiceInfo.hxx
+++ b/fpicker/source/aqua/FPServiceInfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@
#define FOLDER_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.SalAquaFolderPicker/UNO/SERVICES/com.sun.star.ui.dialogs.AquaFolderPicker"
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/FPentry.cxx b/fpicker/source/aqua/FPentry.cxx
index 1df58ce346..9e08ef84fa 100644
--- a/fpicker/source/aqua/FPentry.cxx
+++ b/fpicker/source/aqua/FPentry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,27 +26,14 @@
*
************************************************************************/
-//----------------------------------------------
-// includes of other projects
-//----------------------------------------------
-
#include <cppuhelper/factory.hxx>
#include <com/sun/star/container/XSet.hpp>
-// #ifndef _OSL_DIAGNOSE_H_
-// #include <osl/diagnose.h>
-// #endif
#include "SalAquaFilePicker.hxx"
#include "SalAquaFolderPicker.hxx"
-// #ifndef _SV_SVAPP_HXX
-// #include <vcl/svapp.hxx>
-// #endif
#include "FPServiceInfo.hxx"
-//-----------------------------------------------
-// namespace directives
-//-----------------------------------------------
using namespace ::rtl;
using namespace ::com::sun::star::uno;
@@ -56,9 +44,6 @@ using namespace ::cppu;
using ::com::sun::star::ui::dialogs::XFilePicker;
using ::com::sun::star::ui::dialogs::XFolderPicker;
-//------------------------------------------------
-//
-//------------------------------------------------
static Reference< XInterface > SAL_CALL createFileInstance(
const Reference< XMultiServiceFactory >& rServiceManager )
@@ -111,7 +96,7 @@ void* SAL_CALL component_getFactory(
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] =
- OUString::createFromAscii(FILE_PICKER_SERVICE_NAME);
+ OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_SERVICE_NAME));
xFactory = createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -123,7 +108,7 @@ void* SAL_CALL component_getFactory(
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] =
- OUString::createFromAscii(FOLDER_PICKER_SERVICE_NAME);
+ OUString(RTL_CONSTASCII_USTRINGPARAM(FOLDER_PICKER_SERVICE_NAME));
xFactory = createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -143,3 +128,5 @@ void* SAL_CALL component_getFactory(
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx
index 4b3116849a..c67d1e8565 100644
--- a/fpicker/source/aqua/FilterHelper.cxx
+++ b/fpicker/source/aqua/FilterHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,9 @@
#include <functional>
#include <algorithm>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-// #ifndef _OSL_DIAGNOSE_H_
-// #include <osl/diagnose.h>
-// #endif
#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
#include "NSURL_OOoAdditions.hxx"
@@ -272,7 +270,7 @@ void FilterHelper::SetCurFilter( const rtl::OUString& rFilter )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "filter", rFilter);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if(m_aCurrentFilter.equals(rFilter) == false)
{
@@ -319,7 +317,7 @@ void FilterHelper::appendFilter(const ::rtl::OUString& aTitle, const ::rtl::OUSt
throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ) {
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "title", aTitle, "filter", aFilterString);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if( FilterNameExists( aTitle ) ) {
throw com::sun::star::lang::IllegalArgumentException();
@@ -361,7 +359,7 @@ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "title", OUStringToOString(sGroupTitle, RTL_TEXTENCODING_UTF8).getStr());
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
//add a separator if this is not the first group to be added
sal_Bool bPrependSeparator = m_pFilterList != NULL;
@@ -374,7 +372,7 @@ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::
// append the filter
if (bPrependSeparator) {
- rtl::OUString dash = rtl::OUString::createFromAscii("-");
+ rtl::OUString dash(RTL_CONSTASCII_USTRINGPARAM("-"));
OUStringList emptyList;
m_pFilterList->push_back(FilterEntry(dash, emptyList));
}
@@ -421,7 +419,7 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
{
rtl::OUString aName = [sFilename OUString];
- rtl::OUString allMatcher = rtl::OUString::createFromAscii(".*");
+ rtl::OUString allMatcher(RTL_CONSTASCII_USTRINGPARAM(".*"));
for(OUStringList::iterator iter = suffixList.begin(); iter != suffixList.end(); iter++) {
if (aName.matchIgnoreAsciiCase(*iter, aName.getLength() - (*iter).getLength()) || ((*iter).equals(allMatcher))) {
return sal_True;
@@ -543,3 +541,5 @@ OUStringList FilterHelper::getCurrentFilterSuffixList() {
return retVal;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/FilterHelper.hxx b/fpicker/source/aqua/FilterHelper.hxx
index d72235842d..e4e6cb7bc1 100644
--- a/fpicker/source/aqua/FilterHelper.hxx
+++ b/fpicker/source/aqua/FilterHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,36 +29,12 @@
#ifndef _FILTERHELPER_HXX_
#define _FILTERHELPER_HXX_
-// #ifndef _COM_SUN_STAR_UNO_TYPE_HXX_
-// #include <com/sun/star/uno/Type.hxx>
-// #endif
-
-// #ifndef INCLUDED_CPPU_UNOTYPE_HXX
-// #include <cppu/unotype.hxx>
-// #endif
-
-// #ifndef _TYPELIB_TYPECLASS_H_
-// #include "typelib/typeclass.h"
-// #endif
-
-// #ifndef _TYPELIB_TYPEDESCRIPTION_H_
-// #include "typelib/typedescription.h"
-// #endif
-
#include <com/sun/star/beans/StringPair.hpp>
#include <com/sun/star/uno/Sequence.hxx>
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HXX_
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HXX_
#include <com/sun/star/uno/RuntimeException.hpp>
-#endif
-
-// #ifndef _RTL_USTRING_H_
-// #include <rtl/ustring.hxx>
-// #endif
#include <list>
#include <vector>
@@ -158,3 +135,5 @@ private:
};
#endif //_FILTERHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/NSString_OOoAdditions.hxx b/fpicker/source/aqua/NSString_OOoAdditions.hxx
index 5c7a9b33ee..a3f141bbe1 100644
--- a/fpicker/source/aqua/NSString_OOoAdditions.hxx
+++ b/fpicker/source/aqua/NSString_OOoAdditions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,6 @@
#import <Cocoa/Cocoa.h>
#include <postmac.h>
#include <rtl/ustring.hxx>
-// #include <sal/types.h>
//for Cocoa types
@interface NSString (OOoAdditions)
@@ -42,3 +42,5 @@
@end
#endif // _NSSTRING_OOOADDITIONS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.hxx b/fpicker/source/aqua/NSURL_OOoAdditions.hxx
index a5fd8f9551..a2b7f46f34 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.hxx
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
diff --git a/fpicker/source/aqua/SalAquaConstants.h b/fpicker/source/aqua/SalAquaConstants.h
index 7129757c99..30db99b9af 100644
--- a/fpicker/source/aqua/SalAquaConstants.h
+++ b/fpicker/source/aqua/SalAquaConstants.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,7 +29,7 @@
#ifndef _SALAQUACONSTANTS_H_
#define _SALAQUACONSTANTS_H_
-#define kAppFourCharCode 'OOo2'
+#define kAppFourCharCode 'LibO'
#define kControlPropertyTracking 'Trck'
#define kControlPropertyLastPartCode 'LsPc'
#define kControlPropertySubType 'SuTy'
@@ -61,3 +62,4 @@
#endif //_SALAQUACONSTANTS_H_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/SalAquaFilePicker.cxx b/fpicker/source/aqua/SalAquaFilePicker.cxx
index f48275cbe6..ea798295c7 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.cxx
+++ b/fpicker/source/aqua/SalAquaFilePicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,17 +41,13 @@
#include <com/sun/star/ui/dialogs/ControlActions.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <FPServiceInfo.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#ifndef _TOOLS_URLOBJ_HXX
#include <tools/urlobj.hxx>
-#endif
#include "resourceprovider.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.hxx>
-#endif
#include <osl/file.hxx>
#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
@@ -97,9 +94,9 @@ namespace
uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(3);
- aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" );
- aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
- aRet[2] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFilePicker" );
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFilePicker" ));
+ aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.AquaFilePicker" ));
return aRet;
}
}
@@ -146,7 +143,7 @@ void SAL_CALL SalAquaFilePicker::addFilePickerListener( const uno::Reference<XFi
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xListener = xListener;
DBG_PRINT_EXIT(CLASS_NAME, __func__);
@@ -157,7 +154,7 @@ void SAL_CALL SalAquaFilePicker::removeFilePickerListener( const uno::Reference<
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xListener.clear();
DBG_PRINT_EXIT(CLASS_NAME, __func__);
@@ -171,7 +168,7 @@ void SAL_CALL SalAquaFilePicker::setTitle( const rtl::OUString& aTitle ) throw(
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "title", aTitle);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
implsetTitle(aTitle);
DBG_PRINT_EXIT(CLASS_NAME, __func__);
@@ -181,7 +178,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Int16 retVal = 0;
@@ -190,7 +187,6 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException )
// if m_pDialog is nil after initialization, something must have gone wrong before
// or there was no initialization (see issue http://www.openoffice.org/issues/show_bug.cgi?id=100214)
if (m_pDialog == nil) {
- //throw uno::RuntimeException(rtl::OUString::createFromAscii("The dialog was not properly initialized!"), static_cast< XFilePicker* >( this ));
m_nDialogType = NAVIGATIONSERVICES_OPEN;
}
@@ -209,7 +205,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException )
rtl::OUString ouName = [windowTitle OUString];
//a window title will typically be something like "Untitled1 - OpenOffice.org Writer"
//but we only want the "Untitled1" part of it
- sal_Int32 indexOfDash = ouName.indexOf(rtl::OUString::createFromAscii(" - "));
+ sal_Int32 indexOfDash = ouName.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")));
if (indexOfDash > -1) {
m_sSaveFileName = ouName.copy(0,indexOfDash);
if (m_sSaveFileName.getLength() > 0) {
@@ -247,7 +243,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException )
break;
default:
- throw uno::RuntimeException(rtl::OUString::createFromAscii("The dialog returned with an unknown result!"), static_cast< XFilePicker* >( this ));
+ throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The dialog returned with an unknown result!")), static_cast< XFilePicker* >( this ));
break;
}
@@ -266,7 +262,7 @@ void SAL_CALL SalAquaFilePicker::setMultiSelectionMode( sal_Bool bMode ) throw(
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "multiSelectable?", bMode);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (m_nDialogType == NAVIGATIONSERVICES_OPEN) {
[(NSOpenPanel*)m_pDialog setAllowsMultipleSelection:YES];
@@ -281,7 +277,7 @@ throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "name", aName);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_sSaveFileName = aName;
@@ -293,7 +289,7 @@ throw( lang::IllegalArgumentException, uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "directory", rDirectory);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
implsetDisplayDirectory(rDirectory);
@@ -314,7 +310,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getFiles() throw( uno::
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// OSL_TRACE("starting work");
/*
@@ -375,7 +371,7 @@ throw( lang::IllegalArgumentException, uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ensureFilterHelper();
m_pFilterHelper->appendFilter( aTitle, aFilter );
@@ -391,7 +387,7 @@ throw( lang::IllegalArgumentException, uno::RuntimeException )
OSL_TRACE( "Setting current filter to %s",
OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ensureFilterHelper();
m_pFilterHelper->setCurrentFilter(aTitle);
@@ -405,7 +401,7 @@ throw( lang::IllegalArgumentException, uno::RuntimeException )
rtl::OUString SAL_CALL SalAquaFilePicker::getCurrentFilter() throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ensureFilterHelper();
@@ -422,7 +418,7 @@ void SAL_CALL SalAquaFilePicker::appendFilterGroup( const rtl::OUString& sGroupT
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
ensureFilterHelper();
m_pFilterHelper->appendFilterGroup(sGroupTitle, aFilters);
@@ -440,7 +436,7 @@ throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_pControlHelper->setValue(nControlId, nControlAction, rValue);
@@ -477,7 +473,7 @@ throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
NSString* sLabel = [NSString stringWithOUString:aLabel];
m_pControlHelper->setLabel( nControlId, sLabel ) ;
@@ -504,19 +500,19 @@ throw( uno::Exception, uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "arguments size", aArguments.getLength());
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// parameter checking
uno::Any aAny;
if( 0 == aArguments.getLength() )
- throw lang::IllegalArgumentException(rtl::OUString::createFromAscii( "no arguments" ),
+ throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )),
static_cast<XFilePicker*>( this ), 1 );
aAny = aArguments[0];
if( ( aAny.getValueType() != ::getCppuType( ( sal_Int16* )0 ) ) &&
(aAny.getValueType() != ::getCppuType( ( sal_Int8* )0 ) ) )
- throw lang::IllegalArgumentException(rtl::OUString::createFromAscii( "invalid argument type" ),
+ throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )),
static_cast<XFilePicker*>( this ), 1 );
sal_Int16 templateId = -1;
@@ -569,7 +565,7 @@ throw( uno::Exception, uno::RuntimeException )
OSL_TRACE( "Template: FILESAVE_AUTOEXTENSION" );
break;
default:
- throw lang::IllegalArgumentException(rtl::OUString::createFromAscii( "Unknown template" ),
+ throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )),
static_cast< XFilePicker* >( this ),
1 );
}
@@ -590,7 +586,7 @@ void SAL_CALL SalAquaFilePicker::cancel() throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (m_pDialog != nil) {
[m_pDialog cancel:nil];
@@ -608,7 +604,7 @@ void SAL_CALL SalAquaFilePicker::disposing( const lang::EventObject& aEvent ) th
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Reference<XFilePickerListener> xFilePickerListener( aEvent.Source, ::com::sun::star::uno::UNO_QUERY );
@@ -628,7 +624,7 @@ throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- rtl::OUString retVal = rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
+ rtl::OUString retVal(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME ));
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
@@ -726,7 +722,7 @@ case ExtendedFilePickerElementIds::LISTBOX_##elem##_LABEL: \
void SalAquaFilePicker::ensureFilterHelper() {
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (NULL == m_pFilterHelper) {
m_pFilterHelper = new FilterHelper;
@@ -765,7 +761,7 @@ void SalAquaFilePicker::updateSaveFileNameExtension() {
// we need to set this here again because initial setting does
//[m_pDialog setExtensionHidden:YES];
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (m_pControlHelper->isAutoExtensionEnabled() == false) {
OSL_TRACE("allowing other file types");
@@ -797,7 +793,7 @@ void SalAquaFilePicker::filterControlChanged() {
return;
}
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
updateSaveFileNameExtension();
@@ -810,3 +806,4 @@ void SalAquaFilePicker::filterControlChanged() {
DBG_PRINT_EXIT(CLASS_NAME, __func__);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/SalAquaFilePicker.hxx b/fpicker/source/aqua/SalAquaFilePicker.hxx
index 2721147535..26b1ffeaa0 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.hxx
+++ b/fpicker/source/aqua/SalAquaFilePicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,16 +43,12 @@
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/beans/StringPair.hpp>
-#ifndef _SALAQUAPICKER_HXX_
#include "SalAquaPicker.hxx"
-#endif
#include <memory>
#include <list>
-#ifndef _RTL_USTRING_H_
#include <rtl/ustring.hxx>
-#endif
#include "FilterHelper.hxx"
#include "AquaFilePickerDelegate.hxx"
@@ -250,3 +247,5 @@ public:
};
#endif // _SALAQUAFILEPICKER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/SalAquaFolderPicker.cxx b/fpicker/source/aqua/SalAquaFolderPicker.cxx
index a71effa052..bad373aec8 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.cxx
+++ b/fpicker/source/aqua/SalAquaFolderPicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <FPServiceInfo.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "SalAquaFolderPicker.hxx"
@@ -49,9 +50,7 @@
#include "resourceprovider.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.hxx>
-#endif
#include <osl/file.hxx>
#include "CFStringUtilities.hxx"
@@ -81,8 +80,8 @@ namespace
uno::Sequence<rtl::OUString> SAL_CALL FolderPicker_getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(2);
- aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" );
- aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFolderPicker" );
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFolderPicker" ));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.AquaFolderPicker" ));
return aRet;
}
}
@@ -108,7 +107,7 @@ void SAL_CALL SalAquaFolderPicker::setTitle( const rtl::OUString& aTitle ) throw
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "title", aTitle);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
implsetTitle(aTitle);
@@ -119,7 +118,7 @@ sal_Int16 SAL_CALL SalAquaFolderPicker::execute() throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Int16 retVal = 0;
@@ -138,7 +137,7 @@ sal_Int16 SAL_CALL SalAquaFolderPicker::execute() throw( uno::RuntimeException )
break;
default:
- throw uno::RuntimeException(rtl::OUString::createFromAscii("The dialog returned with an unknown result!"), static_cast< XFolderPicker* >( this ));
+ throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The dialog returned with an unknown result!")), static_cast< XFolderPicker* >( this ));
break;
}
@@ -155,7 +154,7 @@ void SAL_CALL SalAquaFolderPicker::setDisplayDirectory( const rtl::OUString& aDi
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "directory", aDirectory);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
implsetDisplayDirectory(aDirectory);
@@ -166,7 +165,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getDisplayDirectory() throw( uno::Ru
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
OUString aDirectory = implgetDisplayDirectory();
@@ -179,7 +178,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getDirectory() throw( uno::RuntimeEx
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
NSArray *files = nil;
if (m_nDialogType == NAVIGATIONSERVICES_DIRECTORY) {
@@ -190,7 +189,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getDirectory() throw( uno::RuntimeEx
OSL_TRACE("# of items: %d", nFiles);
if (nFiles < 1) {
- throw uno::RuntimeException(rtl::OUString::createFromAscii("no directory selected"), static_cast< XFolderPicker* >( this ));
+ throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("no directory selected")), static_cast< XFolderPicker* >( this ));
}
rtl::OUString aDirectory;
@@ -227,7 +226,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getImplementationName()
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- rtl::OUString retVal = rtl::OUString::createFromAscii( FOLDER_PICKER_IMPL_NAME );
+ rtl::OUString retVal(RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_IMPL_NAME ));
DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
@@ -270,7 +269,7 @@ void SAL_CALL SalAquaFolderPicker::cancel() throw( uno::RuntimeException )
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
[m_pDialog cancel:nil];
@@ -287,3 +286,5 @@ void SAL_CALL SalAquaFolderPicker::disposing( const lang::EventObject& )
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
DBG_PRINT_EXIT(CLASS_NAME, __func__);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/SalAquaFolderPicker.hxx b/fpicker/source/aqua/SalAquaFolderPicker.hxx
index 38540ff8c5..8922f77d7b 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.hxx
+++ b/fpicker/source/aqua/SalAquaFolderPicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,26 +33,18 @@
// includes of other projects
//_______________________________________________________________________________________________________________________
-#ifndef _CPPUHELPER_COMPBASE4_HXX_
#include <cppuhelper/implbase4.hxx>
-#endif
#include <com/sun/star/util/XCancellable.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
-#ifndef _SALAQUAPICKER_HXX_
#include "SalAquaPicker.hxx"
-#endif
#include <memory>
-#ifndef _RTL_USTRING_H_
#include <rtl/ustring.hxx>
-#endif
#include <list>
@@ -136,3 +129,5 @@ private:
};
#endif // _SALAQUAFOLDERPICKER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx
index 4dc0cdc9b6..c970b35740 100644
--- a/fpicker/source/aqua/SalAquaPicker.cxx
+++ b/fpicker/source/aqua/SalAquaPicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,19 +36,15 @@
#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <FPServiceInfo.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#ifndef _SALAQUAPICKER_HXX_
#include "SalAquaPicker.hxx"
-#endif
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
-#ifndef _NSURL_OOOADDITIONS_HXX_
#include "NSURL_OOoAdditions.hxx"
-#endif
#include "SalAquaFilePicker.hxx"
@@ -79,7 +76,7 @@ SalAquaPicker::~SalAquaPicker()
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
NSAutoreleasePool *pool = [NSAutoreleasePool new];
@@ -98,7 +95,7 @@ void SAL_CALL SalAquaPicker::implInitialize()
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (m_pDialog != nil) {
return;
@@ -162,7 +159,7 @@ int SalAquaPicker::run()
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
NSAutoreleasePool *pool = [NSAutoreleasePool new];
@@ -222,7 +219,7 @@ int SalAquaPicker::runandwaitforresult()
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
int status = this->run();
@@ -235,7 +232,7 @@ void SAL_CALL SalAquaPicker::implsetDisplayDirectory( const rtl::OUString& aDire
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "directory", aDirectory);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (aDirectory != m_sDisplayDirectory) {
m_sDisplayDirectory = aDirectory;
@@ -256,7 +253,7 @@ void SAL_CALL SalAquaPicker::implsetTitle( const rtl::OUString& aTitle ) throw(
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__, "title", aTitle);
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if (m_pDialog != nil) {
[m_pDialog setTitle:[NSString stringWithOUString:aTitle]];
@@ -265,3 +262,4 @@ void SAL_CALL SalAquaPicker::implsetTitle( const rtl::OUString& aTitle ) throw(
DBG_PRINT_EXIT(CLASS_NAME, __func__);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/SalAquaPicker.hxx b/fpicker/source/aqua/SalAquaPicker.hxx
index fc01ab780e..e39709abb6 100644
--- a/fpicker/source/aqua/SalAquaPicker.hxx
+++ b/fpicker/source/aqua/SalAquaPicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,17 +35,11 @@
#include <osl/mutex.hxx>
-#ifndef _RTL_USTRING_HXX
#include <rtl/ustring.hxx>
-#endif
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HXX_
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HXX_
#include <com/sun/star/uno/RuntimeException.hpp>
-#endif
#include "ControlHelper.hxx"
#include <premac.h>
@@ -104,3 +99,5 @@ protected:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/resourceprovider.cxx b/fpicker/source/aqua/resourceprovider.cxx
index 04b9d1ef14..8681492be3 100644
--- a/fpicker/source/aqua/resourceprovider.cxx
+++ b/fpicker/source/aqua/resourceprovider.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,19 +32,15 @@
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <tools/resmgr.hxx>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#ifndef _SVTOOLS_SVTOOLS_HRC_
#include <svtools/svtools.hrc>
-#endif
-#ifndef _SVTOOLS_FILEDLG2_HRC_
#include <svtools/filedlg2.hrc>
-#endif
#include "NSString_OOoAdditions.hxx"
#include "resourceprovider.hxx"
@@ -98,8 +95,8 @@ _Entry OtherCtrlIdToResIdTable[] = {
};
-const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry );
-const sal_Int32 OTHER_SIZE_TABLE = sizeof( OtherCtrlIdToResIdTable ) / sizeof( _Entry );
+const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable );
+const sal_Int32 OTHER_SIZE_TABLE = SAL_N_ELEMENTS( OtherCtrlIdToResIdTable );
//------------------------------------------------------------
//
@@ -174,7 +171,7 @@ public:
String aResString;
OUString aResOUString;
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ const SolarMutexGuard aGuard;
try
{
@@ -238,3 +235,5 @@ NSString* CResourceProvider::getResString( sal_Int32 aId )
return result;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/resourceprovider.hxx b/fpicker/source/aqua/resourceprovider.hxx
index a7d555e86e..fb0007ba12 100644
--- a/fpicker/source/aqua/resourceprovider.hxx
+++ b/fpicker/source/aqua/resourceprovider.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx
index 8654b13210..6636a6c195 100644
--- a/fpicker/source/generic/fpicker.cxx
+++ b/fpicker/source/generic/fpicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,16 +31,19 @@
#include "sal/types.h"
#include "rtl/ustring.hxx"
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
#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 "svl/pickerhistoryaccess.hxx"
-#ifndef _SV_APP_HXX
#include "vcl/svapp.hxx"
-#endif
namespace css = com::sun::star;
@@ -52,6 +56,7 @@ using rtl::OUString;
*/
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"));
@@ -61,8 +66,14 @@ static OUString FilePicker_getSystemPickerServiceName()
return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDE4FilePicker"));
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 (
@@ -123,14 +134,20 @@ static Sequence< OUString > FilePicker_getSupportedServiceNames()
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 (
@@ -224,3 +241,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/odma/ODMAFilePicker.cxx b/fpicker/source/odma/ODMAFilePicker.cxx
new file mode 100644
index 0000000000..685da9f377
--- /dev/null
+++ b/fpicker/source/odma/ODMAFilePicker.cxx
@@ -0,0 +1,550 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_fpicker.hxx"
+
+#include "ODMAFilePicker.hxx"
+
+#include <tools/debug.hxx>
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/StringPair.hpp>
+#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <comphelper/sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <ucbhelper/content.hxx>
+#include <unotools/ucbhelper.hxx>
+
+#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(RTL_CONSTASCII_USTRINGPARAM( "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);
+}
+
+inline bool is_current_process_window(HWND hwnd)
+{
+ DWORD pid;
+ GetWindowThreadProcessId(hwnd, &pid);
+ return (pid == GetCurrentProcessId());
+}
+
+HWND choose_parent_window()
+{
+ HWND hwnd_parent = GetForegroundWindow();
+ if (!is_current_process_window(hwnd_parent))
+ hwnd_parent = GetDesktopWindow();
+ return hwnd_parent;
+}
+
+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) choose_parent_window( ), 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(RTL_CONSTASCII_USTRINGPARAM( "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(RTL_CONSTASCII_USTRINGPARAM( "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(RTL_CONSTASCII_USTRINGPARAM( "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(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFilePicker" ));
+ return seqServiceNames ;
+}
+
+rtl::OUString ODMAFilePicker::impl_getStaticImplementationName( )
+{
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "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 ) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/odma/ODMAFilePicker.hxx b/fpicker/source/odma/ODMAFilePicker.hxx
new file mode 100644
index 0000000000..bb389d8cb8
--- /dev/null
+++ b/fpicker/source/odma/ODMAFilePicker.hxx
@@ -0,0 +1,216 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_ODMA_FILEPICKER_HXX
+#define INCLUDED_ODMA_FILEPICKER_HXX
+
+#include <cppuhelper/compbase9.hxx>
+
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
+#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
+#include <com/sun/star/util/XCancellable.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+
+// 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
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/odma/ODMAFolderPicker.cxx b/fpicker/source/odma/ODMAFolderPicker.cxx
new file mode 100644
index 0000000000..5c9536ac32
--- /dev/null
+++ b/fpicker/source/odma/ODMAFolderPicker.cxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_fpicker.hxx"
+
+#include "ODMAFolderPicker.hxx"
+
+#define _SVSTDARR_STRINGSDTOR
+#include "svl/svstdarr.hxx"
+
+#include <com/sun/star/container/XContentEnumerationAccess.hpp>
+#include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#include <cppuhelper/factory.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <unotools/pathoptions.hxx>
+
+#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(RTL_CONSTASCII_USTRINGPARAM( "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( 1 );
+ ::rtl::OUString* pArray = seqServiceNames.getArray();
+ pArray[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.ODMAFolderPicker" ));
+ return seqServiceNames ;
+}
+
+::rtl::OUString ODMAFolderPicker::impl_getStaticImplementationName( )
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "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 ) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/odma/ODMAFolderPicker.hxx b/fpicker/source/odma/ODMAFolderPicker.hxx
new file mode 100644
index 0000000000..880d5a5345
--- /dev/null
+++ b/fpicker/source/odma/ODMAFolderPicker.hxx
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_ODMA_FOLDERPICKER_HXX
+#define INCLUDED_ODMA_FOLDERPICKER_HXX
+
+#include <cppuhelper/compbase2.hxx>
+
+#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+// 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
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/odma/fps_odma.cxx b/fpicker/source/odma/fps_odma.cxx
new file mode 100644
index 0000000000..6d7642ca06
--- /dev/null
+++ b/fpicker/source/odma/fps_odma.cxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_fpicker.hxx"
+
+#include "sal/types.h"
+
+#include "cppuhelper/implementationentry.hxx"
+
+#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"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/odma/makefile.mk b/fpicker/source/odma/makefile.mk
new file mode 100644
index 0000000000..3cc62d6f94
--- /dev/null
+++ b/fpicker/source/odma/makefile.mk
@@ -0,0 +1,72 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2010 Novell, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+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
diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx
index a7f9aeebf8..c15224a3a4 100644
--- a/fpicker/source/office/OfficeControlAccess.cxx
+++ b/fpicker/source/office/OfficeControlAccess.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
+#include <sal/macros.h>
#include "OfficeControlAccess.hxx"
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -116,7 +118,7 @@ namespace svt
};
// ................................................................
- static const sal_Int32 s_nControlCount = sizeof( aDescriptions ) / sizeof( aDescriptions[0] );
+ static const sal_Int32 s_nControlCount = SAL_N_ELEMENTS( aDescriptions );
static ControlDescIterator s_pControls = aDescriptions;
static ControlDescIterator s_pControlsEnd = aDescriptions + s_nControlCount;
@@ -166,7 +168,7 @@ namespace svt
};
// ................................................................
- static const int s_nPropertyCount = sizeof( aProperties ) / sizeof( aProperties[0] );
+ static const int s_nPropertyCount = SAL_N_ELEMENTS( aProperties );
static ControlPropertyIterator s_pProperties = aProperties;
static ControlPropertyIterator s_pPropertiesEnd = aProperties + s_nPropertyCount;
@@ -787,3 +789,4 @@ namespace svt
} // namespace svt
//.........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx
index 1252aac0fc..5341d9529d 100644
--- a/fpicker/source/office/OfficeControlAccess.hxx
+++ b/fpicker/source/office/OfficeControlAccess.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123,3 +124,4 @@ namespace svt
#endif // SVTOOLS_CONTROLACCESS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index 980a197703..0114762b25 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,10 +59,8 @@
#include <unotools/pathoptions.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include "vos/mutex.hxx"
-#ifndef _SV_APP_HXX
+#include "osl/mutex.hxx"
#include "vcl/svapp.hxx"
-#endif
// define ----------------------------------------------------------------
@@ -561,7 +560,7 @@ void SAL_CALL SvtFilePicker::setMultiSelectionMode( sal_Bool bMode ) throw( Runt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_bMultiSelection = bMode;
}
@@ -569,7 +568,7 @@ void SAL_CALL SvtFilePicker::setDefaultName( const rtl::OUString& aName ) throw(
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_aDefaultName = aName;
}
@@ -578,7 +577,7 @@ void SAL_CALL SvtFilePicker::setDisplayDirectory( const rtl::OUString& aDirector
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_aDisplayDirectory = aDirectory;
}
@@ -586,7 +585,7 @@ rtl::OUString SAL_CALL SvtFilePicker::getDisplayDirectory() throw( RuntimeExcept
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( getDialog() )
{
rtl::OUString aPath = getDialog()->GetPath();
@@ -614,7 +613,7 @@ Sequence< rtl::OUString > SAL_CALL SvtFilePicker::getFiles() throw( RuntimeExcep
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( ! getDialog() )
{
Sequence< rtl::OUString > aEmpty;
@@ -660,7 +659,7 @@ void SAL_CALL SvtFilePicker::setValue( sal_Int16 nElementID,
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( getDialog() )
{
::svt::OControlAccess aAccess( getDialog(), getDialog()->GetView() );
@@ -704,7 +703,7 @@ Any SAL_CALL SvtFilePicker::getValue( sal_Int16 nElementID, sal_Int16 nControlAc
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Any aAny;
// execute() called?
@@ -740,7 +739,7 @@ void SAL_CALL SvtFilePicker::setLabel( sal_Int16 nLabelID, const rtl::OUString&
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( getDialog() )
{
::svt::OControlAccess aAccess( getDialog(), getDialog()->GetView() );
@@ -780,7 +779,7 @@ rtl::OUString SAL_CALL SvtFilePicker::getLabel( sal_Int16 nLabelID )
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
rtl::OUString aLabel;
if ( getDialog() )
@@ -813,7 +812,7 @@ void SAL_CALL SvtFilePicker::enableControl( sal_Int16 nElementID, sal_Bool bEnab
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( getDialog() )
{
::svt::OControlAccess aAccess( getDialog(), getDialog()->GetView() );
@@ -855,7 +854,7 @@ void SAL_CALL SvtFilePicker::addFilePickerListener( const Reference< XFilePicker
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xListener = xListener;
}
@@ -864,7 +863,7 @@ void SAL_CALL SvtFilePicker::removeFilePickerListener( const Reference< XFilePic
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xListener.clear();
}
@@ -877,7 +876,7 @@ Sequence< sal_Int16 > SAL_CALL SvtFilePicker::getSupportedImageFormats()
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Sequence< sal_Int16 > aFormats( 1 );
aFormats[0] = FilePreviewImageFormats::BITMAP;
@@ -890,7 +889,7 @@ sal_Int32 SAL_CALL SvtFilePicker::getTargetColorDepth() throw ( RuntimeException
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Int32 nDepth = 0;
if ( getDialog() )
@@ -904,7 +903,7 @@ sal_Int32 SAL_CALL SvtFilePicker::getAvailableWidth() throw ( RuntimeException )
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Int32 nWidth = 0;
if ( getDialog() )
@@ -918,7 +917,7 @@ sal_Int32 SAL_CALL SvtFilePicker::getAvailableHeight() throw ( RuntimeException
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Int32 nHeigth = 0;
if ( getDialog() )
@@ -933,7 +932,7 @@ void SAL_CALL SvtFilePicker::setImage( sal_Int16 aImageFormat, const Any& rImage
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( getDialog() )
getDialog()->setImage( aImageFormat, rImage );
}
@@ -944,7 +943,7 @@ sal_Bool SAL_CALL SvtFilePicker::setShowState( sal_Bool bShowState )
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if ( getDialog() )
@@ -958,7 +957,7 @@ sal_Bool SAL_CALL SvtFilePicker::getShowState() throw ( RuntimeException )
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Bool bRet = sal_False;
if ( getDialog() )
@@ -977,7 +976,7 @@ void SAL_CALL SvtFilePicker::appendFilterGroup( const ::rtl::OUString& sGroupTit
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// check the names
if ( FilterNameExists( aFilters ) )
@@ -1005,7 +1004,7 @@ void SAL_CALL SvtFilePicker::appendFilter( const rtl::OUString& aTitle,
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
// check the name
if ( FilterNameExists( aTitle ) )
// TODO: a more precise exception message
@@ -1024,7 +1023,7 @@ void SAL_CALL SvtFilePicker::setCurrentFilter( const rtl::OUString& aTitle )
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( ! FilterNameExists( aTitle ) )
throw IllegalArgumentException();
@@ -1040,7 +1039,7 @@ rtl::OUString SAL_CALL SvtFilePicker::getCurrentFilter()
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
rtl::OUString aFilter = getDialog() ? rtl::OUString( getDialog()->GetCurFilter() ) :
rtl::OUString( m_aCurrentFilter );
return aFilter;
@@ -1108,19 +1107,19 @@ void SAL_CALL SvtFilePicker::initialize( const Sequence< Any >& _rArguments )
//-------------------------------------------------------------------------
sal_Bool SvtFilePicker::implHandleInitializationArgument( const ::rtl::OUString& _rName, const Any& _rValue ) SAL_THROW( ( Exception, RuntimeException ) )
{
- if ( _rName.equalsAscii( "TemplateDescription" ) )
+ if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "TemplateDescription" ) ) )
{
m_nServiceType = TemplateDescription::FILEOPEN_SIMPLE;
OSL_VERIFY( _rValue >>= m_nServiceType );
return sal_True;
}
- if ( _rName.equalsAscii( "StandardDir" ) )
+ if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StandardDir" ) ) )
{
OSL_VERIFY( _rValue >>= m_aStandardDir );
return sal_True;
}
- if ( _rName.equalsAscii( "BlackList" ) )
+ if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BlackList" ) ) )
{
OSL_VERIFY( _rValue >>= m_aBlackList );
return sal_True;
@@ -1167,14 +1166,14 @@ Sequence< rtl::OUString > SvtFilePicker::impl_getStaticSupportedServiceNames()
{
Sequence< rtl::OUString > seqServiceNames( 1 );
rtl::OUString* pArray = seqServiceNames.getArray();
- pArray[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.OfficeFilePicker" );
+ pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.OfficeFilePicker" ));
return seqServiceNames ;
}
/* Helper for XServiceInfo */
rtl::OUString SvtFilePicker::impl_getStaticImplementationName()
{
- return rtl::OUString::createFromAscii( "com.sun.star.svtools.OfficeFilePicker" );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svtools.OfficeFilePicker" ));
}
/* Helper for registry */
@@ -1184,3 +1183,5 @@ Reference< XInterface > SAL_CALL SvtFilePicker::impl_createInstance(
Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
return Reference< XInterface >( *new SvtFilePicker( xServiceManager ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index eed723f02a..53b53cd897 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
-#ifndef _COM_SUN_STAR_UNO_XCOMPONENT_CONTEXT_HPP_
#include <com/sun/star/uno/XComponentContext.hpp>
-#endif
#include <tools/wintypes.hxx>
@@ -228,3 +227,4 @@ private:
#endif // INCLUDED_SVT_FILEPICKER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx
index e6011bb3ab..f158a89092 100644
--- a/fpicker/source/office/OfficeFolderPicker.cxx
+++ b/fpicker/source/office/OfficeFolderPicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -245,14 +246,14 @@ Sequence< ::rtl::OUString > SAL_CALL SvtFolderPicker::getSupportedServiceNames()
Sequence< ::rtl::OUString > SvtFolderPicker::impl_getStaticSupportedServiceNames()
{
Sequence< ::rtl::OUString > seqServiceNames(1);
- seqServiceNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.OfficeFolderPicker" );
+ seqServiceNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.OfficeFolderPicker" ));
return seqServiceNames ;
}
/* Helper for XServiceInfo */
::rtl::OUString SvtFolderPicker::impl_getStaticImplementationName()
{
- return ::rtl::OUString::createFromAscii( "com.sun.star.svtools.OfficeFolderPicker" );
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svtools.OfficeFolderPicker" ));
}
/* Helper for registry */
@@ -263,3 +264,4 @@ Reference< XInterface > SAL_CALL SvtFolderPicker::impl_createInstance( const Ref
return Reference< XInterface >( *new SvtFolderPicker( xServiceManager ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/OfficeFolderPicker.hxx b/fpicker/source/office/OfficeFolderPicker.hxx
index 3fd8ecd6af..c60c998722 100644
--- a/fpicker/source/office/OfficeFolderPicker.hxx
+++ b/fpicker/source/office/OfficeFolderPicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -120,3 +121,5 @@ protected:
};
#endif // INCLUDED_SVT_FOLDERPICKER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/asyncfilepicker.cxx b/fpicker/source/office/asyncfilepicker.cxx
index 86e12d4d5f..26888c76e3 100644
--- a/fpicker/source/office/asyncfilepicker.cxx
+++ b/fpicker/source/office/asyncfilepicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -218,3 +219,4 @@ namespace svt
} // namespace svt
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/asyncfilepicker.hxx b/fpicker/source/office/asyncfilepicker.hxx
index bb415111eb..81a403ac27 100644
--- a/fpicker/source/office/asyncfilepicker.hxx
+++ b/fpicker/source/office/asyncfilepicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116,3 +117,4 @@ namespace svt
#endif // SVTOOLS_SOURCE_FILEPICKER_ASYNCFILEPICKER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index 491babacb7..ea67a5e52f 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <vcl/svapp.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/weakeventlistener.hxx>
#include <comphelper/types.hxx>
@@ -66,13 +67,13 @@ namespace svt
{
// the two properties we have
registerProperty(
- ::rtl::OUString::createFromAscii( "HelpURL" ), PROPERTY_ID_HELPURL,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HelpURL" )), PROPERTY_ID_HELPURL,
PropertyAttribute::TRANSIENT,
&m_sHelpURL, ::getCppuType( &m_sHelpURL )
);
registerProperty(
- ::rtl::OUString::createFromAscii( "Window" ), PROPERTY_ID_WINDOW,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Window" )), PROPERTY_ID_WINDOW,
PropertyAttribute::TRANSIENT | PropertyAttribute::READONLY,
&m_xWindow, ::getCppuType( &m_xWindow )
);
@@ -120,7 +121,7 @@ namespace svt
//---------------------------------------------------------------------
void SAL_CALL OCommonPicker::disposing()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
stopWindowListening();
@@ -151,7 +152,7 @@ namespace svt
//---------------------------------------------------------------------
void SAL_CALL OCommonPicker::disposing( const EventObject& _rSource ) throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
sal_Bool bDialogDying = _rSource.Source == m_xWindow;
sal_Bool bParentDying = _rSource.Source == m_xDialogParent;
@@ -209,7 +210,7 @@ namespace svt
//---------------------------------------------------------------------
sal_Bool OCommonPicker::createPicker()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( !m_pDlg )
{
@@ -262,7 +263,7 @@ namespace svt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( createPicker() )
{
::svt::OControlAccess aAccess( m_pDlg, m_pDlg->GetView() );
@@ -275,7 +276,7 @@ namespace svt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( createPicker() )
{
::svt::OControlAccess aAccess( m_pDlg, m_pDlg->GetView() );
@@ -292,7 +293,7 @@ namespace svt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( createPicker() )
{
::svt::OControlAccess aAccess( m_pDlg, m_pDlg->GetView() );
@@ -307,7 +308,7 @@ namespace svt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( createPicker() )
{
::svt::OControlAccess aAccess( m_pDlg, m_pDlg->GetView() );
@@ -322,7 +323,7 @@ namespace svt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( createPicker() )
{
::svt::OControlAccess aAccess( m_pDlg, m_pDlg->GetView() );
@@ -337,7 +338,7 @@ namespace svt
{
checkAlive();
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( createPicker() )
{
::svt::OControlAccess aAccess( m_pDlg, m_pDlg->GetView() );
@@ -352,14 +353,14 @@ namespace svt
//---------------------------------------------------------------------
void SAL_CALL OCommonPicker::setTitle( const rtl::OUString& _rTitle ) throw( RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_aTitle = _rTitle;
}
//---------------------------------------------------------------------
sal_Int16 OCommonPicker::execute() throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
prepareDialog();
@@ -489,7 +490,7 @@ namespace svt
sal_Bool OCommonPicker::implHandleInitializationArgument( const ::rtl::OUString& _rName, const Any& _rValue ) SAL_THROW( ( Exception, RuntimeException ) )
{
sal_Bool bKnown = sal_True;
- if ( _rName.equalsAscii( "ParentWindow" ) )
+ if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) )
{
m_xDialogParent.clear();
OSL_VERIFY( _rValue >>= m_xDialogParent );
@@ -504,3 +505,4 @@ namespace svt
} // namespace svt
//.........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/commonpicker.hxx b/fpicker/source/office/commonpicker.hxx
index dfe4c4058d..062496460b 100644
--- a/fpicker/source/office/commonpicker.hxx
+++ b/fpicker/source/office/commonpicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -207,3 +208,4 @@ namespace svt
#endif // SVTOOLS_COMMONPICKER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/fpinteraction.cxx b/fpicker/source/office/fpinteraction.cxx
index 1f99c1ebad..3975524c25 100644
--- a/fpicker/source/office/fpinteraction.cxx
+++ b/fpicker/source/office/fpinteraction.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -167,3 +168,4 @@ namespace svt
} // namespace svt
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/fpinteraction.hxx b/fpicker/source/office/fpinteraction.hxx
index 025c8e62c8..d078210c55 100644
--- a/fpicker/source/office/fpinteraction.hxx
+++ b/fpicker/source/office/fpinteraction.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,4 @@ namespace svt
#endif // SVTOOLS_FILEPICKER_INTERACTION_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/fps_office.cxx b/fpicker/source/office/fps_office.cxx
index fd1743fa21..58bee9ce5b 100644
--- a/fpicker/source/office/fps_office.cxx
+++ b/fpicker/source/office/fps_office.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include "precompiled_fpicker.hxx"
#include "sal/types.h"
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
#include "cppuhelper/implementationentry.hxx"
-#endif
#include "OfficeFilePicker.hxx"
#include "OfficeFolderPicker.hxx"
@@ -71,3 +70,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index 20a7e9b2c9..5b8bb254e9 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -225,7 +226,7 @@ namespace svt
try
{
::rtl::OUString sTitle;
- m_pContent->getPropertyValue( ::rtl::OUString::createFromAscii( "Title" ) ) >>= sTitle;
+ m_pContent->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Title" )) ) >>= sTitle;
_rTitle = sTitle;
// from here on, we definately know that the content is valid
@@ -306,3 +307,4 @@ namespace svt
} // namespace svt
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/fpsmartcontent.hxx b/fpicker/source/office/fpsmartcontent.hxx
index 4ecf9b247b..fc83eec98b 100644
--- a/fpicker/source/office/fpsmartcontent.hxx
+++ b/fpicker/source/office/fpsmartcontent.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -210,3 +211,5 @@ namespace svt
//........................................................................
#endif // SVTOOLS_SOURCE_FILEPICKER_FPSMARTCONTENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 67388582b7..b11e8dacd8 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1,10 +1,11 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +30,7 @@
#include "precompiled_fpicker.hxx"
// includes --------------------------------------------------------------
-
+#include <sal/macros.h>
#include "iodlg.hxx"
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
@@ -56,24 +57,16 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <unotools/localfilehelper.hxx>
-#ifndef _SVTOOLS_HRC
#include "svtools/svtools.hrc"
-#endif
-#ifndef _SVT_HELPID_HRC
#include "svtools/helpid.hrc"
-#endif
-#ifndef _SVTOOLS_IODLGIMPL_HRC
#include "iodlg.hrc"
-#endif
#include "rtl/instance.hxx"
#include "asyncfilepicker.hxx"
#include "iodlgimp.hxx"
#include "svtools/inettbc.hxx"
#include "unotools/syslocale.hxx"
#include "svtools/QueryFolderName.hxx"
-#ifndef _RTL_USTRING_HXX
#include <rtl/ustring.hxx>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/XContentProviderManager.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -89,9 +82,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <osl/file.h>
#include <vcl/waitobj.hxx>
@@ -530,7 +521,7 @@ SvtFileDialog::~SvtFileDialog()
SvtViewOptions aDlgOpt( E_DIALOG, _pImp->_aIniKey );
aDlgOpt.SetWindowState( String( GetWindowState(), osl_getThreadTextEncoding() ) );
String sUserData = _pFileView->GetConfigString();
- aDlgOpt.SetUserItem( ::rtl::OUString::createFromAscii( "UserData" ),
+ aDlgOpt.SetUserItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserData" )),
makeAny( ::rtl::OUString( sUserData ) ) );
}
@@ -557,8 +548,7 @@ void SvtFileDialog::Init_Impl
WinBits nStyle
)
{
- sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- m_aImages = ImageList( SvtResId( bIsHighContrast ? RID_FILEPICKER_IMAGES_HC : RID_FILEPICKER_IMAGES ) );
+ m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) );
_pImp->_nStyle = nStyle;
_pImp->_a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
@@ -2072,7 +2062,7 @@ short SvtFileDialog::PrepareExecute()
{
rtl::OUString aEnvValue;
if ( getEnvironmentValue( "WorkDirMustContainRemovableMedia", aEnvValue ) &&
- aEnvValue.equalsAscii( "1" ) )
+ aEnvValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "1" ) ) )
{
try
{
@@ -2081,8 +2071,8 @@ short SvtFileDialog::PrepareExecute()
INetURLObject::NO_DECODE ) ),
Reference< XCommandEnvironment >() );
Sequence< rtl::OUString > aProps(2);
- aProps[0] = rtl::OUString::createFromAscii( "IsVolume" );
- aProps[1] = rtl::OUString::createFromAscii( "IsRemoveable" );
+ aProps[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsVolume" ));
+ aProps[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsRemoveable" ));
Reference< XResultSet > xResultSet
= aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_ONLY );
@@ -2512,7 +2502,7 @@ void SvtFileDialog::InitSize()
{
SetWindowState( ByteString( String( aDlgOpt.GetWindowState() ), osl_getThreadTextEncoding() ) );
- Any aUserData = aDlgOpt.GetUserItem( ::rtl::OUString::createFromAscii( "UserData" ) );
+ Any aUserData = aDlgOpt.GetUserItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserData" ) ));
::rtl::OUString sCfgStr;
if ( aUserData >>= sCfgStr )
_pFileView->SetConfigString( String( sCfgStr ) );
@@ -2580,7 +2570,7 @@ void SvtFileDialog::implArrangeControls()
// loop through all these controls and adjust the z-order
Window* pPreviousWin = NULL;
Control** pCurrent = pControls;
- for ( sal_Int32 i = 0; i < sal_Int32(sizeof( pControls ) / sizeof( pControls[ 0 ] )); ++i, ++pCurrent )
+ for ( sal_Int32 i = 0; i < sal_Int32(SAL_N_ELEMENTS( pControls )); ++i, ++pCurrent )
{
if ( !*pCurrent )
// this control is not available in the current operation mode -> skip
@@ -2681,11 +2671,7 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter )
//-----------------------------------------------------------------------------
void SvtFileDialog::implUpdateImages( )
{
- // determine high contrast mode
- {
- sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
- m_aImages = ImageList( SvtResId( bIsHighContrast ? RID_FILEPICKER_IMAGES_HC : RID_FILEPICKER_IMAGES ) );
- }
+ m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) );
// set the appropriate images on the buttons
if ( _pImp->_pBtnUp )
@@ -2760,7 +2746,7 @@ void SvtFileDialog::Resize()
_pPbPlay, _pImp->_pCbPassword, _pImp->_pCbAutoExtension, _pImp->_pCbOptions, _pCbSelection
};
Control** ppMoveControls = aMoveControlsVert;
- Control** ppMoveControlsEnd = ppMoveControls + sizeof( aMoveControlsVert ) / sizeof( aMoveControlsVert[0] );
+ Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsVert );
for ( ; ppMoveControls != ppMoveControlsEnd; ++ppMoveControls )
lcl_MoveControl( *ppMoveControls, 0, nDeltaY );
}
@@ -2772,7 +2758,7 @@ void SvtFileDialog::Resize()
_pImp->_pBtnFileOpen, _pImp->_pBtnCancel, _pImp->_pBtnHelp
};
Control** ppMoveControls = aMoveControlsBoth;
- Control** ppMoveControlsEnd = ppMoveControls + sizeof( aMoveControlsBoth ) / sizeof( aMoveControlsBoth[0] );
+ Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsBoth );
for ( ; ppMoveControls != ppMoveControlsEnd; ++ppMoveControls )
lcl_MoveControl( *ppMoveControls, nDeltaX, nDeltaY );
}
@@ -2784,7 +2770,7 @@ void SvtFileDialog::Resize()
_pImp->_pBtnUp, _pImp->_pBtnNewFolder, _pImp->_pBtnStandard
};
Control** ppMoveControls = aMoveControlsHor;
- Control** ppMoveControlsEnd = ppMoveControls + sizeof( aMoveControlsHor ) / sizeof( aMoveControlsHor[0] );
+ Control** ppMoveControlsEnd = ppMoveControls + SAL_N_ELEMENTS( aMoveControlsHor );
for ( ; ppMoveControls != ppMoveControlsEnd; ++ppMoveControls )
lcl_MoveControl( *ppMoveControls, nDeltaX, 0 );
}
@@ -2797,7 +2783,7 @@ void SvtFileDialog::Resize()
_pImp->_pEdFileName, _pImp->_pLbFileVersion, _pImp->_pLbTemplates, _pImp->_pLbImageTemplates,
_pImp->GetFilterListControl(), _pImp->_pFtCurrentPath,
};
- sal_Int32 nSizeControls = sizeof( aSizeControls ) / sizeof( aSizeControls[0] );
+ sal_Int32 nSizeControls = SAL_N_ELEMENTS( aSizeControls );
Control** ppSizeControls = aSizeControls;
for ( sal_Int32 j=0; j<nSizeControls; ++j, ++ppSizeControls )
{
@@ -3273,7 +3259,6 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine )
Point aNewControlPos;
Size* pNewDlgSize = NULL;
BOOL bNewRow = bNewLine;
- FASTBOOL bFirstNewRow = FALSE;
if ( nType == WINDOW_WINDOW )
{
@@ -3306,7 +3291,6 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine )
{
// Create a new row if there was no usercontrol before.
bNewRow = TRUE;
- bFirstNewRow = TRUE;
}
// Check if a new row has to be created.
@@ -3480,3 +3464,5 @@ IMPL_LINK( QueryFolderNameDialog, NameHdl, Edit *, EMPTYARG )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 0753072215..0bc19f0196 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,8 @@
#ifndef _IODLGIMPL_HXX
#define _IODLGIMPL_HXX
-#ifndef _VCL_DIALOG_HXX
#include <vcl/dialog.hxx>
-#endif
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
#include <vcl/combobox.hxx>
@@ -473,3 +470,5 @@ class SvtFilePicker;
#endif // #ifndef _IODLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
index f8d82758ad..ddc3184a6a 100644
--- a/fpicker/source/office/iodlg.src
+++ b/fpicker/source/office/iodlg.src
@@ -4,7 +4,7 @@
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* This file is part of OpenOffice.org.
*
@@ -53,13 +53,6 @@ ImageList RID_FILEPICKER_IMAGES
FILEPICKER_IL_IDLIST
};
-ImageList RID_FILEPICKER_IMAGES_HC
-{
- Prefix = "fph";
- MASKCOLOR
- FILEPICKER_IL_IDLIST
-};
-
// dialogs *******************************************************************
ModalDialog DLG_SVT_EXPLORERFILE
@@ -329,5 +322,10 @@ String STR_SVT_NOREMOVABLEDEVICE
Text [ en-US ] = "No removable storage device detected.\nMake sure it is plugged in properly and try again." ;
};
+String STR_SVT_ALLFORMATS
+{
+ Text [ en-US ] = "All Formats" ;
+};
+
//******************************************************************** EOF
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index af1e3ca4da..6ae0307f9f 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -225,8 +226,7 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu )
::svtools::VolumeInfo aVolInfo( sal_True /* volume */, sal_False /* remote */,
sal_False /* removable */, sal_False /* floppy */,
sal_False /* compact disk */ );
- sal_Bool bIsHighContrast = pBox->GetSettings().GetStyleSettings().GetHighContrastMode();
- Image aVolumeImage( SvFileInformationManager::GetFolderImage( aVolInfo, bIsHighContrast ) );
+ Image aVolumeImage( SvFileInformationManager::GetFolderImage( aVolInfo ) );
while ( nCount >= 1 )
{
@@ -241,8 +241,7 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu )
aTitle = aObject.getName();
Image aImage = ( nCount > 1 ) // if nCount == 1 means workplace, which detects the wrong image
- ? SvFileInformationManager::GetImage( aObject, bIsHighContrast )
- : aVolumeImage;
+ ? SvFileInformationManager::GetImage( aObject ) : aVolumeImage;
_pMenu->InsertItem( nItemId++, aTitle, aImage );
_pURLs->Insert( pParentURL, _pURLs->Count() );
@@ -313,8 +312,6 @@ void SvtTravelButton_Impl::FillURLMenu( PopupMenu* _pMenu )
_pMenu->Clear();
- sal_Bool bIsHighContrast = GetDialogParent()->GetView()->GetSettings().GetStyleSettings().GetHighContrastMode();
-
USHORT nItemId = 1;
String sDisplayName;
@@ -505,3 +502,5 @@ void SvtExpFileDlg_Impl::CreateFilterListControl( Window* _pParent, const ResId&
_pLbFilter->SetDropDownLineCount( 10 );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index f85eacbe1f..87a6276b11 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -337,3 +338,4 @@ inline void SvtExpFileDlg_Impl::SetCurFilter( SvtFileDialogFilter_Impl* pFilter
#endif // #ifndef _IODLGIMP_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/pickercallbacks.hxx b/fpicker/source/office/pickercallbacks.hxx
index 2d66b84638..f5c0430b76 100644
--- a/fpicker/source/office/pickercallbacks.hxx
+++ b/fpicker/source/office/pickercallbacks.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,3 +61,4 @@ namespace svt
#endif // SVTOOLS_PICKER_CALLBACKS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/FPServiceInfo.hxx b/fpicker/source/unx/gnome/FPServiceInfo.hxx
index c76e7532d4..f8d7b7e1e0 100644
--- a/fpicker/source/unx/gnome/FPServiceInfo.hxx
+++ b/fpicker/source/unx/gnome/FPServiceInfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@
#define FOLDER_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.SalGtkFolderPicker/UNO/SERVICES/com.sun.star.ui.dialogs.GtkFolderPicker"
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/FPentry.cxx b/fpicker/source/unx/gnome/FPentry.cxx
index 459d943abf..2f63a948e2 100644
--- a/fpicker/source/unx/gnome/FPentry.cxx
+++ b/fpicker/source/unx/gnome/FPentry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
//----------------------------------------------
// includes of other projects
//----------------------------------------------
#include <cppuhelper/factory.hxx>
-#include <com/sun/star/container/XSet.hpp>
#include <osl/diagnose.h>
#include "SalGtkFilePicker.hxx"
#include "SalGtkFolderPicker.hxx"
-#include <vcl/svapp.hxx>
#include "FPServiceInfo.hxx"
#include <glib-object.h>
@@ -50,11 +55,9 @@ extern const guint gtk_minor_version;
using namespace ::rtl;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry;
using namespace ::cppu;
-using ::com::sun::star::ui::dialogs::XFilePicker;
using ::com::sun::star::ui::dialogs::XFilePicker2;
using ::com::sun::star::ui::dialogs::XFolderPicker;
@@ -120,7 +123,7 @@ void* SAL_CALL component_getFactory(
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] =
- OUString::createFromAscii(FILE_PICKER_SERVICE_NAME);
+ OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_SERVICE_NAME));
xFactory = createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -132,7 +135,7 @@ void* SAL_CALL component_getFactory(
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] =
- OUString::createFromAscii(FOLDER_PICKER_SERVICE_NAME);
+ OUString(RTL_CONSTASCII_USTRINGPARAM(FOLDER_PICKER_SERVICE_NAME));
xFactory = createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -153,3 +156,4 @@ void* SAL_CALL component_getFactory(
} // extern "C"
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index 64a015e11a..940bbf2068 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,34 +29,34 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include <cppuhelper/interfacecontainer.h>
#include <osl/diagnose.h>
#include <osl/process.h>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/ControlActions.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <FPServiceInfo.hxx>
-#include <vos/mutex.hxx>
-#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
#include <SalGtkFilePicker.hxx>
-#include <tools/urlobj.hxx>
+#include <tools/string.hxx>
-#include <iostream>
#include <algorithm>
+#include <set>
+#include <string.h>
#include "resourceprovider.hxx"
-#ifndef _SV_RC_H
-#include <tools/rc.hxx>
-#endif
//------------------------------------------------------------------------
// namespace directives
@@ -83,9 +84,9 @@ namespace
uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(3);
- aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" );
- aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
- aRet[2] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFilePicker" );
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFilePicker" ));
+ aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.GtkFilePicker" ));
return aRet;
}
}
@@ -148,6 +149,7 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact
mbPreviewState( sal_False ),
mHID_Preview( 0 ),
m_pPreview( NULL ),
+ m_pPseudoFilter( NULL ),
m_PreviewImageWidth( 256 ),
m_PreviewImageHeight( 256 )
{
@@ -394,57 +396,11 @@ void SAL_CALL SalGtkFilePicker::directoryChanged( FilePickerEvent aEvent )
}
void SAL_CALL SalGtkFilePicker::controlStateChanged( FilePickerEvent aEvent )
-{
+{
OSL_TRACE("control state changed");
if (m_xListener.is()) m_xListener->controlStateChanged( aEvent );
}
-//-----------------------------------------------------------------------------------------
-// If there are more then one listener the return value of the last one wins
-//-----------------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SalGtkFilePicker::helpRequested( FilePickerEvent aEvent ) const
-{
- rtl::OUString aHelpText;
-
- ::cppu::OInterfaceContainerHelper* pICHelper =
- rBHelper.getContainer( getCppuType( ( uno::Reference<XFilePickerListener> * )0 ) );
-
- if( pICHelper )
- {
- ::cppu::OInterfaceIteratorHelper iter( *pICHelper );
-
- while( iter.hasMoreElements() )
- {
- try
- {
- /*
- if there are multiple listeners responding
- to this notification the next response
- overwrittes the one before if it is not empty
- */
-
- rtl::OUString aTempString;
-
- uno::Reference<XFilePickerListener> xFPListener( iter.next(), uno::UNO_QUERY );
- if( xFPListener.is() )
- {
- aTempString = xFPListener->helpRequested( aEvent );
- if( aTempString.getLength() )
- aHelpText = aTempString;
- }
-
- }
- catch( uno::RuntimeException& )
- {
- OSL_ENSURE( false, "RuntimeException during event dispatching" );
- }
- }
- }
-
- return aHelpText;
-}
-
//=====================================================================
struct FilterEntry
@@ -657,7 +613,7 @@ void SalGtkFilePicker::ensureFilterList( const ::rtl::OUString& _rInitialCurrent
m_pFilterList = new FilterList;
// set the first filter to the current filter
- if( ( !m_aCurrentFilter ) || ( !m_aCurrentFilter.getLength() ) )
+ if ( !m_aCurrentFilter.getLength() )
m_aCurrentFilter = _rInitialCurrentFilter;
}
}
@@ -680,7 +636,6 @@ void SAL_CALL SalGtkFilePicker::appendFilter( const rtl::OUString& aTitle, const
// append the filter
m_pFilterList->insert( m_pFilterList->end(), FilterEntry( aTitle, aFilter ) );
- // implAddFilter( aTitle, aFilter );
}
//-----------------------------------------------------------------------------------------
@@ -747,7 +702,10 @@ void SalGtkFilePicker::UpdateFilterfromUI()
}
else if( GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog)))
{
- updateCurrentFilterFromName(gtk_file_filter_get_name( filter ));
+ if (m_pPseudoFilter != filter)
+ updateCurrentFilterFromName(gtk_file_filter_get_name( filter ));
+ else
+ updateCurrentFilterFromName(OUStringToOString( m_aInitialFilter, RTL_TEXTENCODING_UTF8 ).getStr());
}
}
@@ -898,7 +856,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
if( sExtension.getLength() >= 3 ) // 3 = typical/minimum extension length
{
- static const OUString aStarDot = OUString::createFromAscii( "*." );
+ static const OUString aStarDot(RTL_CONSTASCII_USTRINGPARAM( "*." ));
::rtl::OUString aNewFilter;
::rtl::OUString aOldFilter = getCurrentFilter();
@@ -908,7 +866,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
++aListIter
)
{
- if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 )
+ if( aListIter->getFilter().equalsIgnoreAsciiCase( aStarDot+sExtension ) )
{
if( !aNewFilter.getLength() )
aNewFilter = aListIter->getTitle();
@@ -924,9 +882,14 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
}
}
- const gchar* filtername =
- gtk_file_filter_get_name( gtk_file_chooser_get_filter( GTK_FILE_CHOOSER( m_pDialog ) ) );
- sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
+ GtkFileFilter *filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(m_pDialog));
+ if (m_pPseudoFilter != filter)
+ {
+ const gchar* filtername = gtk_file_filter_get_name( filter );
+ sFilterName = OUString( filtername, strlen( filtername ), RTL_TEXTENCODING_UTF8 );
+ }
+ else
+ sFilterName = m_aInitialFilter;
}
OSL_TRACE( "2: current filter is %s\n",
@@ -960,10 +923,10 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
}
while( nTokenIndex >= 0 );
- if( !bExtensionTypedIn && ( !sToken.equalsAscii( "*" ) ) )
+ if( !bExtensionTypedIn && ( !sToken.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*")) ) )
{
//if the filename does not already have the auto extension, stick it on
- OUString sExtension = OUString::createFromAscii( "." ) + sToken;
+ OUString sExtension = OUString(RTL_CONSTASCII_USTRINGPARAM( "." )) + sToken;
OUString &rBase = aSelectedFiles[nIndex];
sal_Int32 nExtensionIdx = rBase.getLength() - sExtension.getLength();
OSL_TRACE( "idx are %d %d\n", rBase.lastIndexOf( sExtension ), nExtensionIdx );
@@ -1014,7 +977,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException )
int btn = GTK_RESPONSE_NO;
uno::Reference< awt::XExtendedToolkit > xToolkit(
- m_xServiceMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY);
+ m_xServiceMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ), uno::UNO_QUERY);
RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit);
uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog);
@@ -1491,7 +1454,7 @@ void SalGtkFilePicker::implChangeType( GtkTreeSelection *selection )
{
gchar *title;
gtk_tree_model_get (model, &iter, 2, &title, -1);
- aLabel += rtl::OUString::createFromAscii( ": " );
+ aLabel += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ": " ));
aLabel += rtl::OUString( title, strlen(title), RTL_TEXTENCODING_UTF8 );
g_free (title);
}
@@ -1622,11 +1585,11 @@ sal_Bool SAL_CALL SalGtkFilePicker::getShowState() throw( uno::RuntimeException
void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArguments )
throw( uno::Exception, uno::RuntimeException )
{
- // parameter checking
+ // parameter checking
uno::Any aAny;
if( 0 == aArguments.getLength() )
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "no arguments" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )),
static_cast<XFilePicker2*>( this ), 1 );
aAny = aArguments[0];
@@ -1634,7 +1597,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu
if( ( aAny.getValueType() != ::getCppuType( ( sal_Int16* )0 ) ) &&
(aAny.getValueType() != ::getCppuType( ( sal_Int8* )0 ) ) )
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "invalid argument type" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )),
static_cast<XFilePicker2*>( this ), 1 );
sal_Int16 templateId = -1;
@@ -1722,7 +1685,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu
break;
default:
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "Unknown template" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )),
static_cast< XFilePicker2* >( this ),
1 );
}
@@ -1801,7 +1764,7 @@ void SAL_CALL SalGtkFilePicker::cancel() throw( uno::RuntimeException )
rtl::OUString SAL_CALL SalGtkFilePicker::getImplementationName()
throw( uno::RuntimeException )
{
- return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME ));
}
// -------------------------------------------------
@@ -1891,7 +1854,7 @@ case_insensitive_filter (const GtkFileFilterInfo *filter_info, gpointer data)
}
}
-int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
+GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType )
{
GdkThreadLock aLock;
@@ -1901,7 +1864,7 @@ int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rT
OString aFilterName = rtl::OUStringToOString( aShrunkName, RTL_TEXTENCODING_UTF8 );
gtk_file_filter_set_name( filter, aFilterName );
- static const OUString aStarDot = OUString::createFromAscii( "*." );
+ static const OUString aStarDot(RTL_CONSTASCII_USTRINGPARAM( "*." ));
OUString aTokens;
bool bAllGlob = !rType.compareToAscii( "*.*" ) || !rType.compareToAscii( "*" );
@@ -1919,7 +1882,7 @@ int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rT
if (aToken.getLength())
{
if (aTokens.getLength())
- aTokens += OUString::createFromAscii(",");
+ aTokens += OUString(RTL_CONSTASCII_USTRINGPARAM(","));
aTokens = aTokens += aToken;
gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_URI,
case_insensitive_filter,
@@ -1942,7 +1905,6 @@ int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rT
gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( m_pDialog ), filter );
- int nAdded = 0;
if (!bAllGlob)
{
GtkTreeIter iter;
@@ -1953,21 +1915,18 @@ int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rT
2, aFilterName.getStr(),
3, OUStringToOString(rType, RTL_TEXTENCODING_UTF8).getStr(),
-1);
- nAdded = 1;
}
- return nAdded;
+ return filter;
}
-int SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Sequence< StringPair >& _rFilters )
+void SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Sequence< StringPair >& _rFilters )
{
// Gtk+ has no filter group concept I think so ...
// implAddFilter( _rFilter, String() );
- int nAdded = 0;
const StringPair* pSubFilters = _rFilters.getConstArray();
const StringPair* pSubFiltersEnd = pSubFilters + _rFilters.getLength();
for( ; pSubFilters != pSubFiltersEnd; ++pSubFilters )
- nAdded += implAddFilter( pSubFilters->First, pSubFilters->Second );
- return nAdded;
+ implAddFilter( pSubFilters->First, pSubFilters->Second );
}
void SalGtkFilePicker::SetFilters()
@@ -1979,41 +1938,38 @@ void SalGtkFilePicker::SetFilters()
int nAdded = 0;
if( m_pFilterList && !m_pFilterList->empty() )
{
- for ( FilterList::iterator aListIter = m_pFilterList->begin();
+ for ( FilterList::iterator aListIter = m_pFilterList->begin();
aListIter != m_pFilterList->end();
++aListIter
)
{
if( aListIter->hasSubFilters() )
- { // it's a filter group
+ { // it's a filter group
UnoFilterList aSubFilters;
aListIter->getSubFilters( aSubFilters );
- nAdded += implAddFilterGroup( aListIter->getTitle(), aSubFilters );
+ implAddFilterGroup( aListIter->getTitle(), aSubFilters );
}
else
{
// it's a single filter
- nAdded += implAddFilter( aListIter->getTitle(), aListIter->getFilter() );
+ implAddFilter( aListIter->getTitle(), aListIter->getFilter() );
}
}
}
- if (nAdded)
+ if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(m_pFilterStore), NULL)) //If m_pFilterStore is not empty
gtk_widget_show( m_pFilterExpander );
else
gtk_widget_hide( m_pFilterExpander );
// set the default filter
- if( m_aCurrentFilter && (m_aCurrentFilter.getLength() > 0) )
- {
- OSL_TRACE( "Setting current filter to %s\n",
- OUStringToOString( m_aCurrentFilter, RTL_TEXTENCODING_UTF8 ).getStr() );
-
+ if (sPseudoFilter.getLength())
+ SetCurFilter( sPseudoFilter );
+ else if(m_aCurrentFilter.getLength())
SetCurFilter( m_aCurrentFilter );
- }
OSL_TRACE( "end setting filters\n");
}
@@ -2037,4 +1993,4 @@ SalGtkFilePicker::~SalGtkFilePicker()
gtk_widget_destroy( m_pVBox );
}
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.hxx b/fpicker/source/unx/gnome/SalGtkFilePicker.hxx
index 85e934db58..d280585000 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.hxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,15 +42,11 @@
#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
#include <com/sun/star/beans/StringPair.hpp>
-#ifndef _SALGTKPICKER_HXX_
#include "SalGtkPicker.hxx"
-#endif
#include <memory>
-#ifndef _RTL_USTRING_H_
#include <rtl/ustring.hxx>
-#endif
#include <list>
@@ -246,7 +243,6 @@ class SalGtkFilePicker :
void SAL_CALL fileSelectionChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent );
void SAL_CALL directoryChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent );
- rtl::OUString SAL_CALL helpRequested( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ) const;
void SAL_CALL controlStateChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent );
private:
@@ -314,11 +310,13 @@ class SalGtkFilePicker :
gulong mnHID_SelectionChange;
::rtl::OUString m_aCurrentFilter;
+ ::rtl::OUString m_aInitialFilter;
bool bVersionWidthUnset;
sal_Bool mbPreviewState;
gulong mHID_Preview;
GtkWidget* m_pPreview;
+ GtkFileFilter* m_pPseudoFilter;
sal_Int32 m_PreviewImageWidth;
sal_Int32 m_PreviewImageHeight;
@@ -329,8 +327,8 @@ class SalGtkFilePicker :
void UpdateFilterfromUI();
void implChangeType( GtkTreeSelection *selection );
- int implAddFilter( const OUString& rFilter, const OUString& rType);
- int implAddFilterGroup( const OUString& rFilter,
+ GtkFileFilter * implAddFilter( const OUString& rFilter, const OUString& rType );
+ void implAddFilterGroup( const OUString& rFilter,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair>& _rFilters );
void updateCurrentFilterFromName(const gchar* filtername);
void unselect_type();
@@ -352,5 +350,6 @@ class SalGtkFilePicker :
virtual ~SalGtkFilePicker();
};
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
#endif // _SALGTKFILEPICKER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx
index 63f2659cc4..c42021c0a2 100644
--- a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,31 +29,28 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
-#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include <cppuhelper/interfacecontainer.h>
#include <osl/diagnose.h>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <FPServiceInfo.hxx>
-#include <vos/mutex.hxx>
-#include <vcl/svapp.hxx>
+#include <osl/mutex.hxx>
#include "SalGtkFolderPicker.hxx"
-
-#include <tools/urlobj.hxx>
-
-#include <iostream>
#include "resourceprovider.hxx"
-#ifndef _SV_RC_H
-#include <tools/rc.hxx>
-#endif
+
+#include <string.h>
//------------------------------------------------------------------------
// namespace directives
@@ -74,8 +72,8 @@ namespace
uno::Sequence<rtl::OUString> SAL_CALL FolderPicker_getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(2);
- aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" );
- aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFolderPicker" );
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFolderPicker" ));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.GtkFolderPicker" ));
return aRet;
}
}
@@ -177,7 +175,7 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException )
sal_Int16 retVal = 0;
uno::Reference< awt::XExtendedToolkit > xToolkit(
- m_xServiceMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY);
+ m_xServiceMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ), uno::UNO_QUERY);
RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit);
uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog);
@@ -216,7 +214,7 @@ void SAL_CALL SalGtkFolderPicker::cancel() throw( uno::RuntimeException )
rtl::OUString SAL_CALL SalGtkFolderPicker::getImplementationName()
throw( uno::RuntimeException )
{
- return rtl::OUString::createFromAscii( FOLDER_PICKER_IMPL_NAME );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_IMPL_NAME ));
}
// -------------------------------------------------
@@ -244,3 +242,5 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFolderPicker::getSupportedServiceNam
{
return FolderPicker_getSupportedServiceNames();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/SalGtkFolderPicker.hxx b/fpicker/source/unx/gnome/SalGtkFolderPicker.hxx
index e2804e2ff1..170447bf7a 100644
--- a/fpicker/source/unx/gnome/SalGtkFolderPicker.hxx
+++ b/fpicker/source/unx/gnome/SalGtkFolderPicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,19 +33,13 @@
// includes of other projects
//_______________________________________________________________________________________________________________________
-#ifndef _CPPUHELPER_COMPBASE3_HXX_
#include <cppuhelper/implbase3.hxx>
-#endif
-#ifndef _SALGTKPICKER_HXX_
#include "SalGtkPicker.hxx"
-#endif
#include <memory>
-#ifndef _RTL_USTRING_H_
#include <rtl/ustring.hxx>
-#endif
#include <list>
@@ -125,11 +120,8 @@ class SalGtkFolderPicker :
private:
// to instanciate own services
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr;
-
-#if 0
- public:
- virtual ~SalGtkFolderPicker();
-#endif
};
#endif // _SALGTKFOLDERPICKER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx
index 29bb3989fe..0ef94cf15a 100644
--- a/fpicker/source/unx/gnome/SalGtkPicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
+#ifdef AIX
+#define _LINUX_SOURCE_COMPAT
+#include <sys/timer.h>
+#undef _LINUX_SOURCE_COMPAT
+#endif
+
//------------------------------------------------------------------------
// includes
//------------------------------------------------------------------------
@@ -45,7 +52,7 @@
#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <FPServiceInfo.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include "SalGtkPicker.hxx"
#include <tools/urlobj.hxx>
@@ -292,3 +299,5 @@ void SAL_CALL SalGtkPicker::implsetTitle( const rtl::OUString& aTitle ) throw( u
GdkThreadLock aLock;
gtk_window_set_title( GTK_WINDOW( m_pDialog ), aWindowTitle.getStr() );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/SalGtkPicker.hxx b/fpicker/source/unx/gnome/SalGtkPicker.hxx
index 2bab164725..889790dae7 100644
--- a/fpicker/source/unx/gnome/SalGtkPicker.hxx
+++ b/fpicker/source/unx/gnome/SalGtkPicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/eventnotification.hxx b/fpicker/source/unx/gnome/eventnotification.hxx
index e09917bd24..f0cefd6794 100644
--- a/fpicker/source/unx/gnome/eventnotification.hxx
+++ b/fpicker/source/unx/gnome/eventnotification.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef _EVENTNOTIFICATION_HXX_
#define _EVENTNOTIFICATION_HXX_
-#ifndef _COM_SUN_STAR_UNO_XINTEFACE_HPP_
#include <com/sun/star/uno/XInterface.hpp>
-#endif
#include <com/sun/star/uno/Reference.hxx>
//-----------------------------------
@@ -51,3 +50,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/resourceprovider.cxx b/fpicker/source/unx/gnome/resourceprovider.cxx
index 35d718c0df..0f86159530 100644
--- a/fpicker/source/unx/gnome/resourceprovider.cxx
+++ b/fpicker/source/unx/gnome/resourceprovider.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
#include "resourceprovider.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <tools/resmgr.hxx>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
@@ -82,7 +83,8 @@ _Entry CtrlIdToResIdTable[] = {
{ CHECKBOX_SELECTION, STR_SVT_FILEPICKER_SELECTION },
{ FOLDERPICKER_TITLE, STR_SVT_FOLDERPICKER_DEFAULT_TITLE },
{ FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION },
- { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE }
+ { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE },
+ { FILE_PICKER_ALLFORMATS, STR_SVT_ALLFORMATS }
};
_Entry OtherCtrlIdToResIdTable[] = {
@@ -92,8 +94,8 @@ _Entry OtherCtrlIdToResIdTable[] = {
};
-const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry );
-const sal_Int32 OTHER_SIZE_TABLE = sizeof( OtherCtrlIdToResIdTable ) / sizeof( _Entry );
+const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable );
+const sal_Int32 OTHER_SIZE_TABLE = SAL_N_ELEMENTS( OtherCtrlIdToResIdTable );
//------------------------------------------------------------
//
@@ -223,3 +225,5 @@ OUString CResourceProvider::getResString( sal_Int32 aId )
{
return m_pImpl->getResString( aId ).replace('~', '_');
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/gnome/resourceprovider.hxx b/fpicker/source/unx/gnome/resourceprovider.hxx
index 8f424b0e55..7315bb2676 100644
--- a/fpicker/source/unx/gnome/resourceprovider.hxx
+++ b/fpicker/source/unx/gnome/resourceprovider.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,9 +36,7 @@
#include <sal/types.h>
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring>
-#endif
+#include <rtl/ustring.hxx>
#define FOLDERPICKER_TITLE 500
#define FOLDER_PICKER_DEF_DESCRIPTION 501
@@ -45,6 +44,7 @@
#define FILE_PICKER_TITLE_SAVE 503
#define FILE_PICKER_FILE_TYPE 504
#define FILE_PICKER_OVERWRITE 505
+#define FILE_PICKER_ALLFORMATS 506
//------------------------------------------------------------------------
// deklarations
@@ -65,3 +65,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde/kdecommandthread.cxx b/fpicker/source/unx/kde/kdecommandthread.cxx
new file mode 100644
index 0000000000..499c3ad54a
--- /dev/null
+++ b/fpicker/source/unx/kde/kdecommandthread.cxx
@@ -0,0 +1,179 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <cstddef>
+
+#include <kdecommandthread.hxx>
+
+#include <qstringlist.h>
+
+#include <kapplication.h>
+
+#include <iostream>
+
+//////////////////////////////////////////////////////////////////////////
+// CommandEvent
+//////////////////////////////////////////////////////////////////////////
+
+KDECommandEvent::KDECommandEvent( const QString &qCommand, QStringList *pStringList )
+ : QCustomEvent( TypeId, pStringList ),
+ m_eCommand( Unknown )
+{
+ struct {
+ const char *pName;
+ CommandEventType eType;
+ } *pIdx, pMapping[] =
+ {
+ { "appendControl", AppendControl },
+ { "enableControl", EnableControl },
+ { "getValue", GetValue },
+ { "setValue", SetValue },
+ { "appendFilter", AppendFilter },
+ { "appendFilterGroup", AppendFilterGroup },
+ { "getCurrentFilter", GetCurrentFilter },
+ { "setCurrentFilter", SetCurrentFilter },
+ { "getDirectory", GetDirectory },
+ { "setDirectory", SetDirectory },
+ { "getFiles", GetFiles },
+ { "setTitle", SetTitle },
+ { "setType", SetType },
+ { "setDefaultName", SetDefaultName },
+ { "setMultiSelection", SetMultiSelection },
+ { "exec", Exec },
+ { 0, Unknown }
+ };
+
+ for ( pIdx = pMapping; pIdx->pName && qCommand != pIdx->pName; ++pIdx )
+ ;
+
+ m_eCommand = pIdx->eType;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// CommandThread
+//////////////////////////////////////////////////////////////////////////
+
+KDECommandThread::KDECommandThread( QWidget *pObject )
+ : m_pObject( pObject )
+{
+}
+
+KDECommandThread::~KDECommandThread()
+{
+}
+
+void KDECommandThread::run()
+{
+ QTextIStream qStream( stdin );
+ qStream.setEncoding( QTextStream::UnicodeUTF8 );
+
+ QString qLine;
+ bool bQuit = false;
+ while ( !bQuit && !qStream.atEnd() )
+ {
+ qLine = qStream.readLine();
+ handleCommand( qLine, bQuit );
+ }
+}
+
+void KDECommandThread::handleCommand( const QString &rString, bool &bQuit )
+{
+ QMutexLocker qMutexLocker( &m_aMutex );
+
+#if OSL_DEBUG_LEVEL > 0
+ ::std::cerr << "kdefilepicker received: " << rString.latin1() << ::std::endl;
+#endif
+
+ bQuit = false;
+ QStringList *pTokens = tokenize( rString );
+
+ if ( !pTokens )
+ return;
+ if ( pTokens->empty() )
+ {
+ delete pTokens, pTokens = NULL;
+ return;
+ }
+
+ QString qCommand = pTokens->front();
+ pTokens->pop_front();
+
+ if ( qCommand == "exit" )
+ {
+ bQuit = true;
+ kapp->exit();
+ kapp->wakeUpGuiThread();
+ }
+ else
+ kapp->postEvent( m_pObject, new KDECommandEvent( qCommand, pTokens ) );
+}
+
+QStringList* KDECommandThread::tokenize( const QString &rString )
+{
+ // Commands look like:
+ // command arg1 arg2 arg3 ...
+ // Args may be enclosed in '"', if they contain spaces.
+
+ QStringList *pList = new QStringList();
+
+ QString qBuffer;
+ qBuffer.reserve( 1024 );
+
+ const QChar *pUnicode = rString.unicode();
+ const QChar *pEnd = pUnicode + rString.length();
+ bool bQuoted = false;
+
+ for ( ; pUnicode != pEnd; ++pUnicode )
+ {
+ if ( *pUnicode == '\\' )
+ {
+ ++pUnicode;
+ if ( pUnicode != pEnd )
+ {
+ if ( *pUnicode == 'n' )
+ qBuffer.append( '\n' );
+ else
+ qBuffer.append( *pUnicode );
+ }
+ }
+ else if ( *pUnicode == '"' )
+ bQuoted = !bQuoted;
+ else if ( *pUnicode == ' ' && !bQuoted )
+ {
+ pList->push_back( qBuffer );
+ qBuffer.setLength( 0 );
+ }
+ else
+ qBuffer.append( *pUnicode );
+ }
+ pList->push_back( qBuffer );
+
+ return pList;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde/kdecommandthread.hxx b/fpicker/source/unx/kde/kdecommandthread.hxx
new file mode 100644
index 0000000000..7486bf9192
--- /dev/null
+++ b/fpicker/source/unx/kde/kdecommandthread.hxx
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _KDECOMMANDTHREAD_HXX_
+#define _KDECOMMANDTHREAD_HXX_
+
+#include <qevent.h>
+#include <qmutex.h>
+#include <qthread.h>
+
+class KDECommandEvent : public QCustomEvent
+{
+public:
+ enum CommandEventType {
+ Unknown = 0,
+
+ AppendControl,
+ EnableControl,
+ GetValue,
+ SetValue,
+
+ AppendFilter,
+ AppendFilterGroup,
+ UpdateFilters,
+ GetCurrentFilter,
+ SetCurrentFilter,
+
+ GetDirectory,
+ SetDirectory,
+
+ GetFiles,
+
+ SetTitle,
+ SetType,
+ SetDefaultName,
+ SetMultiSelection,
+
+ Exec
+ };
+ static const QEvent::Type TypeId = (QEvent::Type) ( (int) QEvent::User + 42 /*random magic value*/ );
+
+protected:
+ CommandEventType m_eCommand;
+
+public:
+ KDECommandEvent( const QString &qCommand, QStringList *pStringList );
+
+ CommandEventType command() const { return m_eCommand; }
+ QStringList* stringList() { return static_cast< QStringList* >( data() ); }
+};
+
+class KDECommandThread : public QThread
+{
+protected:
+ QObject *m_pObject;
+
+ QMutex m_aMutex;
+
+public:
+ KDECommandThread( QWidget *pObject );
+ virtual ~KDECommandThread();
+
+ virtual void run();
+
+protected:
+ void handleCommand( const QString &rString, bool &bQuit );
+ QStringList* tokenize( const QString &rString );
+};
+
+#endif // _KDECOMMANDTHREAD_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde/kdefilepicker.cxx b/fpicker/source/unx/kde/kdefilepicker.cxx
new file mode 100644
index 0000000000..0af35dcd6f
--- /dev/null
+++ b/fpicker/source/unx/kde/kdefilepicker.cxx
@@ -0,0 +1,734 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <cstddef>
+
+#include <kdecommandthread.hxx>
+#include <kdefilepicker.hxx>
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgrid.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qobjectlist.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qvbox.h>
+
+#ifdef QT_NO_EMIT
+#define emit
+#endif
+
+#include <kdeversion.h>
+#include <kdiroperator.h>
+#include <kfiledialog.h>
+#include <kfilefiltercombo.h>
+#include <kio/netaccess.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <ktempfile.h>
+
+#include <algorithm>
+#include <iostream>
+
+//////////////////////////////////////////////////////////////////////////
+// KDEFileDialog
+//////////////////////////////////////////////////////////////////////////
+
+KDEFileDialog::KDEFileDialog( const QString &startDir, const QString &filter,
+ QWidget *parent, const char *name )
+ : KFileDialog( startDir, filter, parent, name, true, m_pCustomWidget = new QVBox() ),
+ m_pCombosAndButtons( new QHBox( m_pCustomWidget ) ),
+ m_pLabels( new QVBox( m_pCombosAndButtons ) ),
+ m_pComboBoxes( new QVBox( m_pCombosAndButtons ) ),
+ m_pPushButtons( new QVBox( m_pCombosAndButtons ) ),
+ m_pCheckBoxes( new QGrid( 2, m_pCustomWidget ) ),
+ m_bIsSave( false ),
+ m_bIsExecuting( false ),
+ m_bCanNotifySelection( true )
+{
+ connect( this, SIGNAL( fileHighlighted( const QString & ) ),
+ this, SLOT( fileHighlightedCommand( const QString & ) ) );
+
+ connect( this, SIGNAL( selectionChanged() ),
+ this, SLOT( selectionChangedCommand() ) );
+
+ m_pCustomWidget->setSpacing( KDialog::spacingHint() );
+ m_pCombosAndButtons->setSpacing( KDialog::spacingHint() );
+
+ updateCustomWidgetLayout();
+}
+
+KDEFileDialog::~KDEFileDialog()
+{
+}
+
+void KDEFileDialog::resizeEvent( QResizeEvent *pEvent )
+{
+ KFileDialog::resizeEvent( pEvent );
+
+ updateCustomWidgetLayout();
+}
+
+void KDEFileDialog::showEvent( QShowEvent *pEvent )
+{
+ KFileDialog::showEvent( pEvent );
+
+ updateCustomWidgetLayout();
+}
+
+void KDEFileDialog::updateCustomWidgetLayout()
+{
+ QPoint qReferencePoint = filterWidget->mapTo( this, QPoint( 0, 0 ) );
+ QPoint qCustomPoint = m_pCustomWidget->mapTo( this, QPoint( 0, 0 ) );
+
+ int nLeft = qReferencePoint.x() - qCustomPoint.x();
+ int nRight = m_pCustomWidget->width() - filterWidget->width() - nLeft;
+
+ nLeft -= KDialog::spacingHint();
+ nRight -= KDialog::spacingHint();
+ m_pLabels->setFixedWidth( ( nLeft > 0 )? nLeft: 80 );
+ // FIXME The following call sets the width of m_pPushButtons all right,
+ // but it also increases the width of m_pComboBoxes rapidly. Can we do
+ // anything about it?
+ m_pPushButtons->setFixedWidth( ( nRight > 0 )? nRight: 100 );
+}
+
+void KDEFileDialog::customEvent( QCustomEvent *pEvent )
+{
+ if ( pEvent && pEvent->type() == KDECommandEvent::TypeId )
+ {
+ KDECommandEvent *pCommandEvent = static_cast< KDECommandEvent* >( pEvent );
+ QStringList *pStringList = pCommandEvent->stringList();
+
+ int nListSize = -1;
+ if ( pStringList )
+ nListSize = pStringList->size();
+
+ switch ( pCommandEvent->command() )
+ {
+ case KDECommandEvent::AppendControl:
+ if ( nListSize >= 3 )
+ {
+ appendControl( (*pStringList)[0], (*pStringList)[1], (*pStringList)[2] );
+ }
+ break;
+ case KDECommandEvent::EnableControl:
+ if ( nListSize >= 2 )
+ {
+ enableControl( (*pStringList)[0], (*pStringList)[1] );
+ }
+ break;
+ case KDECommandEvent::GetValue:
+ if ( nListSize >= 2 )
+ {
+ getValue( (*pStringList)[0], (*pStringList)[1] );
+ }
+ break;
+ case KDECommandEvent::SetValue:
+ if ( nListSize >= 2 )
+ {
+ QStringList qStringList = (*pStringList);
+ qStringList.pop_front();
+ qStringList.pop_front();
+
+ setValue( (*pStringList)[0], (*pStringList)[1], qStringList );
+ }
+ break;
+ case KDECommandEvent::AppendFilter:
+ if ( nListSize >= 2 )
+ {
+ appendFilter( (*pStringList)[0], (*pStringList)[1] );
+
+ // update the filters widget
+ setFilter( filters() );
+ }
+ break;
+ case KDECommandEvent::AppendFilterGroup:
+ if ( nListSize >= 1 )
+ {
+ QStringList::const_iterator it = pStringList->begin();
+ ++it; // We ignore the filter group name
+
+ while ( it != pStringList->end() )
+ {
+ QString qTitle = *it;
+ ++it;
+ if ( it != pStringList->end() )
+ {
+ appendFilter( qTitle, (*it) );
+ ++it;
+ }
+ }
+
+ // update the filters widget
+ setFilter( filters() );
+ }
+ break;
+ case KDECommandEvent::GetCurrentFilter:
+ {
+ QString qCurrentFilter = filterWidget->currentText();
+ sendCommand( "currentFilter " + escapeString( qCurrentFilter ) );
+ }
+ break;
+ case KDECommandEvent::SetCurrentFilter:
+ if ( nListSize >= 1 )
+ {
+ static_cast< KDEFileFilterComboHack* >( filterWidget )->setCurrentFilter( pStringList->front() );
+ }
+ break;
+ case KDECommandEvent::GetDirectory:
+ {
+ QString qDirectory = baseURL().url();
+ if ( qDirectory.startsWith( "file:/" ) && qDirectory.mid( 6, 1 ) != "/" )
+ qDirectory.replace( "file:/", "file:///" );
+ sendCommand( "currentDirectory " + escapeString( qDirectory ) );
+ }
+ break;
+ case KDECommandEvent::SetDirectory:
+ if ( nListSize >= 1 )
+ {
+ setURL( pStringList->front() );
+ }
+ break;
+ case KDECommandEvent::GetFiles:
+ {
+ QString qString;
+ qString.reserve( 1024 );
+
+ qString.append( "files" );
+
+ if ( result() == QDialog::Accepted )
+ {
+ KURL::List qList( selectedURLs() );
+ for ( KURL::List::const_iterator it = qList.begin(); it != qList.end(); ++it )
+ appendURL( qString, (*it) );
+ }
+ else
+ {
+ // we have to return the selected files anyway
+ const KFileItemList *pItems = ops->selectedItems();
+ for ( KFileItemListIterator it( *pItems ); it.current(); ++it )
+ appendURL( qString, (*it)->url() );
+ }
+
+ sendCommand( qString );
+ setCanNotifySelection( true );
+ }
+ break;
+ case KDECommandEvent::SetTitle:
+ if ( nListSize >= 1 )
+ {
+ setCaption( pStringList->front() );
+ }
+ break;
+ case KDECommandEvent::SetType:
+ if ( nListSize >= 1 )
+ {
+ QString qType( pStringList->front() );
+ if ( qType == "open" )
+ {
+ setIsSave( false );
+ setCaption( i18n( "Open" ) );
+ }
+ else if ( qType == "save" )
+ {
+ setIsSave( true );
+ setCaption( i18n( "Save As" ) );
+ }
+ }
+ break;
+ case KDECommandEvent::SetDefaultName:
+ if ( nListSize >= 1 )
+ {
+ setKeepLocation( true );
+ setSelection( pStringList->front() );
+ }
+ break;
+ case KDECommandEvent::SetMultiSelection:
+ if ( nListSize >= 1 )
+ {
+ if ( pStringList->front() == "true" )
+ setMode( KFile::Files );
+ else
+ setMode( KFile::File );
+ }
+ break;
+ case KDECommandEvent::Exec:
+ {
+ filterWidget->setEditable( false );
+ setIsExecuting( true );
+ bool bCanExit = false;
+ do {
+ setCanNotifySelection( true );
+ exec();
+
+ KURL qLocalSelectedURL = mostLocalURL( selectedURL() );
+ QString qProtocol( qLocalSelectedURL.protocol() );
+
+ if ( isSave() && result() == QDialog::Accepted )
+ {
+ if ( qProtocol == "file" )
+ {
+ QString qFileName( addExtension( qLocalSelectedURL.path() ) );
+ bCanExit =
+ !QFile::exists( qFileName ) ||
+ ( KMessageBox::warningYesNo( 0,
+ i18n( "A file named \"%1\" already exists. "
+ "Are you sure you want to overwrite it?" ).arg( qFileName ),
+ i18n( "Overwrite File?" ),
+ i18n( "Overwrite" ), KStdGuiItem::cancel() ) == KMessageBox::Yes );
+ }
+ else if ( !isSupportedProtocol( qProtocol ) )
+ {
+ KMessageBox::sorry( 0,
+ i18n( "Saving using protocol \"%1\" is not supported." ).arg( qProtocol ) );
+ bCanExit = false;
+ }
+ else
+ bCanExit = true;
+ }
+ else if ( !isSave() && result() == QDialog::Accepted && !isSupportedProtocol( qProtocol ) )
+ {
+ KMessageBox::information( 0,
+ i18n( "Protocol \"%1\" is supported only partially. "
+ "Local copy of the file will be created." ).arg( qProtocol ) );
+ bCanExit = true;
+ }
+ else
+ bCanExit = true;
+ } while ( !bCanExit );
+ setIsExecuting( false );
+
+ if ( result() == QDialog::Accepted )
+ sendCommand( "accept" );
+ else
+ sendCommand( "reject" );
+ }
+ break;
+ default:
+ break;
+ }
+
+ // FIXME Some cleanup of pEvent? delete something, etc.?
+ }
+}
+
+void KDEFileDialog::appendControl( const QString &rId, const QString &rType, const QString &rTitle )
+{
+ QString qLabel( rTitle );
+ qLabel.replace( '~', '&' );
+
+ if ( rType == "checkbox" )
+ {
+ QCheckBox *pCheckBox = new QCheckBox( qLabel, m_pCheckBoxes, rId.utf8() );
+
+ pCheckBox->setEnabled( true );
+ pCheckBox->setChecked( false );
+ }
+ else if ( rType == "listbox" )
+ {
+ QLabel *pComboLabel = new QLabel( qLabel, m_pLabels );
+ QComboBox *pComboBox = new QComboBox( m_pComboBoxes, rId.utf8() );
+
+ pComboLabel->setBuddy( pComboBox );
+ pComboBox->setEnabled( true );
+ }
+ else if ( rType == "pushbutton" )
+ {
+ QPushButton *pPushButton = new QPushButton( qLabel, m_pPushButtons, rId.utf8() );
+ pPushButton->setEnabled( true );
+ }
+}
+
+QWidget* KDEFileDialog::findControl( const QString &rId ) const
+{
+ QObjectList *pList = m_pCustomWidget->queryList();
+ QCString qName( rId.utf8() );
+ QObjectList::const_iterator it = pList->begin();
+
+ for ( ; it != pList->end() && qName != (*it)->name(); ++it )
+ ;
+
+ QWidget *pWidget = NULL;
+ if ( it != pList->end() )
+ pWidget = static_cast< QWidget* >( *it );
+
+ delete pList;
+
+ return pWidget;
+}
+
+void KDEFileDialog::enableControl( const QString &rId, const QString &rValue )
+{
+ QWidget *pWidget = findControl( rId );
+
+ if ( pWidget )
+ pWidget->setEnabled( rValue.lower() == "true" );
+}
+
+void KDEFileDialog::getValue( const QString &rId, const QString &rAction )
+{
+ QWidget *pWidget = findControl( rId );
+ QString qString;
+ qString.reserve( 1024 );
+ qString.append( "value" );
+
+ if ( pWidget )
+ {
+ QCString qClassName = pWidget->className();
+ if ( qClassName == "QCheckBox" )
+ {
+ QCheckBox *pCheckBox = static_cast< QCheckBox* >( pWidget );
+
+ if ( pCheckBox->isChecked() )
+ qString.append( " bool true" );
+ else
+ qString.append( " bool false" );
+ }
+ else if ( qClassName == "QComboBox" )
+ {
+ QComboBox *pComboBox = static_cast< QComboBox* >( pWidget );
+ if ( rAction == "getItems" )
+ {
+ qString.append( " stringList" );
+ for ( int nIdx = 0; nIdx < pComboBox->count(); ++nIdx )
+ {
+ qString.append( ' ' );
+ appendEscaped( qString, pComboBox->text( nIdx ) );
+ }
+ }
+ else if ( rAction == "getSelectedItem" )
+ {
+ qString.append( " string " );
+ appendEscaped( qString, pComboBox->currentText() );
+ }
+ else if ( rAction == "getSelectedItemIndex" )
+ {
+ qString.append( " int " );
+ qString.append( QString().setNum( pComboBox->currentItem() ) );
+ }
+ // TODO getHelpURL
+ }
+ // TODO push button
+ }
+
+ sendCommand( qString );
+}
+
+void KDEFileDialog::setValue( const QString &rId, const QString &rAction, const QStringList &rValue )
+{
+ QWidget *pWidget = findControl( rId );
+
+ if ( pWidget )
+ {
+ QCString qClassName = pWidget->className();
+ if ( qClassName == "QCheckBox" )
+ {
+ QCheckBox *pCheckBox = static_cast< QCheckBox* >( pWidget );
+
+ bool bValue = ( !rValue.isEmpty() ) && ( rValue.front().lower() == "true" );
+ pCheckBox->setChecked( bValue );
+ }
+ else if ( qClassName == "QComboBox" )
+ {
+ QComboBox *pComboBox = static_cast< QComboBox* >( pWidget );
+ if ( rAction == "addItem" )
+ {
+ if ( !rValue.isEmpty() )
+ pComboBox->insertItem( rValue.front() );
+ }
+ else if ( rAction == "addItems" )
+ {
+ pComboBox->insertStringList( rValue );
+ }
+ else if ( rAction == "deleteItem" )
+ {
+ if ( !rValue.isEmpty() )
+ pComboBox->removeItem( rValue.front().toInt() );
+ }
+ else if ( rAction == "deleteItems" )
+ {
+ pComboBox->clear();
+ }
+ else if ( rAction == "setSelectedItem" )
+ {
+ if ( !rValue.isEmpty() )
+ pComboBox->setCurrentItem( rValue.front().toInt() );
+ }
+ // FIXME setHelpURL is ignored
+ }
+ // TODO push button
+ }
+}
+
+void KDEFileDialog::appendFilter( const QString &rTitle, const QString &rFilter )
+{
+ // Filters are separated by ';'
+ QString qFilter( rFilter );
+ qFilter.replace( QChar( ';' ), QChar( ' ' ) ).replace( "*.*", "*" );
+
+ // Workaround for too wide <All formats> (*.bmp;...) entry
+ QString qTitle( rTitle );
+ qTitle.replace( QRegExp( "^<([^>]*)> \\(.*" ), "<\\1>" );
+
+ m_aFilters.push_back( qMakePair( qTitle, qFilter ) );
+}
+
+QString KDEFileDialog::filters() const
+{
+ QString qString, qTmp;
+ bool bFirstFilter = true;
+
+ for ( FilterList::const_iterator it = m_aFilters.begin(); it != m_aFilters.end(); ++it )
+ {
+ if ( bFirstFilter )
+ bFirstFilter = false;
+ else
+ qString.append( '\n' );
+
+ qString.append( (*it).second );
+ qString.append( '|' );
+
+ qTmp = (*it).first;
+ qString.append( qTmp.replace( '/', "\\/" ) );
+ }
+
+ return qString;
+}
+
+QString KDEFileDialog::addExtension( const QString &rFileName ) const
+{
+ if ( !isSave() )
+ return rFileName;
+
+ QString qExtension;
+
+ QWidget *pExtensionWidget = findControl( "100" ); // CHECKBOX_AUTOEXTENSION
+ QCheckBox *pExtensionCB = pExtensionWidget? static_cast< QCheckBox* >( pExtensionWidget->qt_cast( "QCheckBox" ) ): NULL;
+ if ( pExtensionCB && pExtensionCB->isChecked() )
+ {
+ // FIXME: qFilter can be a MIME; we ignore it now...
+ QStringList qFilterList = QStringList::split( " ", currentFilter() );
+ for ( QStringList::const_iterator it = qFilterList.begin();
+ qExtension.isEmpty() && it != qFilterList.end();
+ ++it )
+ {
+ int nUnwanted = (*it).findRev( '*' );
+ if ( nUnwanted < 0 )
+ nUnwanted = (*it).findRev( '?' );
+ else
+ nUnwanted = ::std::max( nUnwanted, (*it).find( '?', nUnwanted ) );
+
+ int nIdx = (*it).find( '.', ::std::max( nUnwanted, 0 ) );
+ if ( nIdx >= 0 )
+ qExtension = (*it).mid( nIdx ).lower();
+ }
+ }
+
+ if ( qExtension.isEmpty() || qExtension == "." || rFileName.endsWith( qExtension ) )
+ return rFileName;
+ else
+ return rFileName + qExtension;
+}
+
+bool KDEFileDialog::isSupportedProtocol( const QString &rProtocol ) const
+{
+ // TODO Get this information directly from OOo
+ const char * pOOoProtocols[] = { "", "smb", "ftp", "http", "file", "mailto",
+ "vnd.sun.star.webdav", "news", "private", "vnd.sun.star.help",
+ "https", "slot", "macro", "javascript", "imap", "pop3", "data",
+ "cid", "out", "vnd.sun.star.wfs", "vnd.sun.star.hier", "vim",
+ ".uno", ".component", "vnd.sun.star.pkg", "ldap", "db",
+ "vnd.sun.star.cmd", "vnd.sun.star.script", "vnd.sun.star.odma",
+ "telnet",
+ NULL };
+
+ for ( const char **pIndex = pOOoProtocols; *pIndex != NULL; ++pIndex )
+ {
+ if ( rProtocol == *pIndex )
+ return true;
+ }
+
+ // TODO gnome-vfs bits here
+
+ return false;
+}
+
+KURL KDEFileDialog::mostLocalURL( const KURL &rURL ) const
+{
+#if KDE_IS_VERSION(3,5,0)
+ KURL qMostLocalURL( KIO::NetAccess::mostLocalURL( rURL, const_cast<KDEFileDialog*>( this ) ) );
+ if ( qMostLocalURL.isLocalFile() )
+ return qMostLocalURL;
+ else
+ {
+ // Terrible hack to get even non-existing media:// files right
+ qMostLocalURL.cd( ".." );
+ KURL qMostLocalPath( KIO::NetAccess::mostLocalURL( qMostLocalURL, const_cast<KDEFileDialog*>( this ) ) );
+ if ( qMostLocalPath.isLocalFile() )
+ {
+ qMostLocalPath.addPath( rURL.fileName() );
+ return qMostLocalPath;
+ }
+ }
+#endif
+
+ return rURL;
+}
+
+QString KDEFileDialog::localCopy( const QString &rFileName ) const
+{
+ // 106 == MIB enum for UTF-8
+ KURL qLocalURL = mostLocalURL( KURL( rFileName, 106 ) );
+ if ( qLocalURL.isLocalFile() )
+ return qLocalURL.url();
+
+ int nExtensionPos = rFileName.findRev( '/' );
+ if ( nExtensionPos >= 0 )
+ nExtensionPos = rFileName.find( '.', nExtensionPos );
+ else
+ nExtensionPos = rFileName.find( '.' );
+
+ KTempFile qTempFile( QString::null, ( nExtensionPos < 0 )? QString(): rFileName.mid( nExtensionPos ) );
+ KURL qDestURL;
+ qDestURL.setPath( qTempFile.name() );
+
+ if ( !KIO::NetAccess::file_copy( rFileName, qDestURL, 0600, true, false, NULL ) )
+ {
+ KMessageBox::error( 0, KIO::NetAccess::lastErrorString() );
+ return QString::null;
+ }
+
+ return qDestURL.url();
+}
+
+void KDEFileDialog::fileHighlightedCommand( const QString & )
+{
+ if ( canNotifySelection() )
+ {
+ sendCommand( "fileSelectionChanged" );
+ setCanNotifySelection( false );
+ }
+}
+
+void KDEFileDialog::selectionChangedCommand()
+{
+ if ( canNotifySelection() )
+ {
+ sendCommand( "fileSelectionChanged" );
+ setCanNotifySelection( false );
+ }
+}
+
+void KDEFileDialog::sendCommand( const QString &rCommand )
+{
+#if OSL_DEBUG_LEVEL > 0
+ ::std::cerr << "kdefilepicker sent: " << rCommand.latin1() << ::std::endl;
+#endif
+
+ //m_aOutputStream << rCommand << endl;
+ ::std::cout << rCommand.utf8() << ::std::endl;
+}
+
+void KDEFileDialog::appendURL( QString &rBuffer, const KURL &rURL )
+{
+ // From Martin Kretzschmar:
+ // file:///path/to/test%E0.odt is not a valid URL from OOo's point of
+ // view. (?Most modern parts of?) OOo assume(s) that the URL contains only
+ // ASCII characters (which test%E0.odt does) and is UTF-8 after unescaping
+ // (which file:///path/test%E0.odt is not).
+ // Cf. the comment in sal/inc/osl/file.h.
+ // 106 == MIB enum for UTF-8
+ QString qUrlStr = addExtension( rURL.url( 0, 106 ) );
+
+ if ( !isExecuting() && !isSupportedProtocol( rURL.protocol() ) )
+ qUrlStr = localCopy( qUrlStr );
+
+ if ( qUrlStr.startsWith( "file:/" ) && qUrlStr.mid( 6, 1 ) != "/" )
+ qUrlStr.replace( "file:/", "file:///" );
+
+ rBuffer.append( " " );
+ if ( !qUrlStr.isEmpty() )
+ appendEscaped( rBuffer, qUrlStr );
+}
+
+void KDEFileDialog::appendEscaped( QString &rBuffer, const QString &rString )
+{
+ const QChar *pUnicode = rString.unicode();
+ const QChar *pEnd = pUnicode + rString.length();
+
+ rBuffer.append( '"' );
+ for ( ; pUnicode != pEnd; ++pUnicode )
+ {
+ if ( *pUnicode == '\\' )
+ rBuffer.append( "\\\\" );
+ else if ( *pUnicode == '"' )
+ rBuffer.append( "\\\"" );
+ else if ( *pUnicode == '\n' )
+ rBuffer.append( "\\\n" );
+ else
+ rBuffer.append( *pUnicode );
+ }
+ rBuffer.append( '"' );
+}
+
+QString KDEFileDialog::escapeString( const QString &rString )
+{
+ QString qString;
+ qString.reserve( 2*rString.length() + 2 ); // every char escaped + quotes
+
+ appendEscaped( qString, rString );
+
+ return qString;
+}
+
+
+void KDEFileFilterComboHack::setCurrentFilter( const QString& filter )
+{
+ setCurrentText( filter );
+ filterChanged();
+
+ // Workaround for 'Filter name (*.blah)' vs. 'Filter name'
+ if ( currentText() != text( currentItem() ) )
+ {
+ int nItem = 0;
+ for ( ; nItem < count() && !text( nItem ).startsWith( filter ); ++nItem );
+
+ if ( nItem < count() )
+ setCurrentItem( nItem );
+ else
+ setCurrentItem( 0 );
+
+ filterChanged();
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde/kdefilepicker.hxx b/fpicker/source/unx/kde/kdefilepicker.hxx
new file mode 100644
index 0000000000..4d545ebc76
--- /dev/null
+++ b/fpicker/source/unx/kde/kdefilepicker.hxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _KDEFILEPICKER_HXX_
+#define _KDEFILEPICKER_HXX_
+
+#include <cstddef>
+
+#include <kfiledialog.h>
+#include <kfilefiltercombo.h>
+
+class QGrid;
+class QHBox;
+class QVBox;
+
+class KDEFileDialog : public KFileDialog
+{
+ Q_OBJECT
+
+protected:
+ typedef QPair< QString, QString > FilterEntry;
+ typedef QValueList< FilterEntry > FilterList;
+
+ QVBox *m_pCustomWidget;
+ QHBox *m_pCombosAndButtons;
+
+ QVBox *m_pLabels;
+ QVBox *m_pComboBoxes;
+ QVBox *m_pPushButtons;
+
+ QGrid *m_pCheckBoxes;
+
+ FilterList m_aFilters;
+
+ /** Are we a "Save As" dialog?
+ *
+ * We cannot use KFileDialog::setOperationMode() here, because then
+ * it automatically adds an "Automatically select filename extension"
+ * check box, and completely destroys the dialog's layout
+ * (custom list boxes are under this check box, which looks ugly).
+ */
+ bool m_bIsSave;
+ bool m_bIsExecuting;
+
+ bool m_bCanNotifySelection;
+
+public:
+ KDEFileDialog( const QString &startDir, const QString &filter,
+ QWidget *parent, const char *name );
+ virtual ~KDEFileDialog();
+
+protected:
+ virtual void resizeEvent( QResizeEvent *pEvent );
+ virtual void showEvent( QShowEvent *pEvent );
+ void updateCustomWidgetLayout();
+
+ virtual void customEvent( QCustomEvent *pEvent );
+
+protected:
+ void appendControl( const QString &rId, const QString &rType, const QString &rTitle );
+ QWidget* findControl( const QString &rId ) const;
+ void enableControl( const QString &rId, const QString &rValue );
+ void getValue( const QString &rId, const QString &rAction );
+ void setValue( const QString &rId, const QString &rAction, const QStringList &rValue );
+
+ void appendFilter( const QString &rTitle, const QString &rFilter );
+ QString filters() const;
+ QString addExtension( const QString &rFileName ) const;
+
+ void setIsSave( bool bIsSave ) { m_bIsSave = bIsSave; }
+ bool isSave( void ) const { return m_bIsSave; }
+
+ void setIsExecuting( bool bIsExecuting ) { m_bIsExecuting = bIsExecuting; }
+ bool isExecuting( void ) const { return m_bIsExecuting; }
+
+ bool isSupportedProtocol( const QString &rProtocol ) const;
+ KURL mostLocalURL( const KURL &rURL ) const;
+ QString localCopy( const QString &rFileName ) const;
+
+ void setCanNotifySelection( bool bCanNotifySelection ) { m_bCanNotifySelection = bCanNotifySelection; }
+ bool canNotifySelection( void ) const { return m_bCanNotifySelection; }
+
+protected slots:
+ void fileHighlightedCommand( const QString & );
+ void selectionChangedCommand();
+
+protected:
+ void sendCommand( const QString &rCommand );
+ void appendURL( QString &rBuffer, const KURL &rURL );
+ void appendEscaped( QString &rBuffer, const QString &rString );
+ QString escapeString( const QString &rString );
+};
+
+class KDEFileFilterComboHack : public KFileFilterCombo
+{
+public:
+ void setCurrentFilter( const QString& filter );
+};
+
+#endif // _KDEFILEPICKER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde/kdefpmain.cxx b/fpicker/source/unx/kde/kdefpmain.cxx
new file mode 100644
index 0000000000..2300fe61a2
--- /dev/null
+++ b/fpicker/source/unx/kde/kdefpmain.cxx
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <cstddef>
+
+#include <kdemodalityfilter.hxx>
+#include <kdefilepicker.hxx>
+#include <kdecommandthread.hxx>
+
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+
+#include <iostream>
+#include <stdlib.h>
+
+//////////////////////////////////////////////////////////////////////////
+// Main
+//////////////////////////////////////////////////////////////////////////
+
+static KCmdLineOptions sOptions[] =
+{
+ { "winid <argument>", I18N_NOOP("Window ID to which is the fpicker modal"), "0" },
+ KCmdLineLastOption
+};
+
+int main( int argc, char* argv[] )
+{
+ // we fake the name of the application to have "OpenOffice.org" in the
+ // title
+ KAboutData qAboutData( "kdefilepicker", I18N_NOOP( "OpenOffice.org" ),
+ "0.1", I18N_NOOP( "kdefilepicker is an implementation of the KDE file dialog for OpenOffice.org." ),
+ KAboutData::License_LGPL,
+ "(c) 2004, Jan Holesovsky" );
+ qAboutData.addAuthor( "Jan Holesovsky", I18N_NOOP("Original author and current maintainer"), "kendy@openoffice.org" );
+
+ // Let the user see that this does something...
+ ::std::cerr << "kdefilepicker, an implementation of KDE file dialog for OOo." << ::std::endl
+ << "Type 'exit' and press Enter to finish." << ::std::endl;
+
+ KCmdLineArgs::addCmdLineOptions( sOptions );
+ KCmdLineArgs::init( argc, argv, &qAboutData );
+
+ KLocale::setMainCatalogue( "kdialog" );
+
+ KApplication kApplication;
+
+ // Setup the modality
+ KCmdLineArgs *pArgs = KCmdLineArgs::parsedArgs();
+ long nWinId = atol( pArgs->getOption( "winid" ) );
+ pArgs->clear();
+
+ KDEModalityFilter qModalityFilter( nWinId );
+
+ KDEFileDialog aFileDialog( NULL, QString(), NULL, "kdefiledialog" );
+
+ KDECommandThread qCommandThread( &aFileDialog );
+ qCommandThread.start();
+
+ kApplication.exec();
+
+ qCommandThread.wait();
+
+ ::std::cout << "exited" << ::std::endl;
+
+ return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde/makefile.mk b/fpicker/source/unx/kde/makefile.mk
new file mode 100644
index 0000000000..e7fbd2bf2b
--- /dev/null
+++ b/fpicker/source/unx/kde/makefile.mk
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2010 Novell, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=fpicker
+TARGET=kdefilepicker
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
+#COMP1TYPELIST=$(TARGET)
+#COMPRDB=$(SOLARBINDIR)$/types.rdb
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# ------------------------------------------------------------------
+
+.IF "$(GUIBASE)" != "unx" || "$(ENABLE_KDE)" != "TRUE"
+
+dummy:
+ @echo "Nothing to build. GUIBASE == $(GUIBASE), ENABLE_KDE is not set"
+
+.ELSE # we build for KDE
+
+CFLAGS+= $(KDE_CFLAGS)
+
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/kdecommandthread.obj \
+ $(SLO)$/kdefilepicker.obj \
+ $(SLO)$/kdefilepicker.moc.obj \
+ $(SLO)$/kdefpmain.obj \
+ $(SLO)$/kdemodalityfilter.obj
+
+APP1TARGET=$(TARGET)
+APP1OBJS=$(SLOFILES)
+APP1RPATH=BRAND
+APP1LINKFLAGS=$(KDE_LIBS) -lkio -lX11
+APP1STDLIBS=$(SALLIB)
+
+.ENDIF # "$(GUIBASE)" != "unx" || "$(ENABLE_KDE)" != "TRUE"
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+$(MISC)$/kdefilepicker.moc.cxx : kdefilepicker.hxx
+ $(MOC) $< -o $@
diff --git a/fpicker/source/unx/kde4/FPServiceInfo.hxx b/fpicker/source/unx/kde4/FPServiceInfo.hxx
index 67ca61ccf8..2f265f812c 100644
--- a/fpicker/source/unx/kde4/FPServiceInfo.hxx
+++ b/fpicker/source/unx/kde4/FPServiceInfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,3 +39,5 @@
// Format: -> "/ImplName/UNO/SERVICES/ServiceName"
// <Implementation-Name></UNO/SERVICES/><Service-Name>
#define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.KDE4FilePickerImpl/UNO/SERVICES/com.sun.star.ui.dialogs.KDE4FilePicker"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
index c8425e5ce3..49bd760a00 100644
--- a/fpicker/source/unx/kde4/KDE4FPEntry.cxx
+++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@ extern "C"
if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
{
Sequence< OUString > aSNS( 1 );
- aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME );
+ aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME ));
Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -79,3 +80,5 @@ extern "C"
return pRet;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
index 744e19f3ab..29d2428f2e 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@
#include <svtools/svtools.hrc>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/sysdata.hxx>
@@ -62,6 +63,7 @@
#include <kapplication.h>
#include <kfilefiltercombo.h>
+#include <qclipboard.h>
#include <QWidget>
#include <QCheckBox>
#include <QGridLayout>
@@ -97,9 +99,9 @@ namespace
uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(3);
- aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
- aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
- aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDE4FilePicker");
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker"));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker"));
+ aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.KDE4FilePicker"));
return aRet;
}
}
@@ -152,14 +154,14 @@ KDE4FilePicker::~KDE4FilePicker()
void SAL_CALL KDE4FilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xListener = xListener;
}
void SAL_CALL KDE4FilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
m_xListener.clear();
}
@@ -300,10 +302,7 @@ void SAL_CALL KDE4FilePicker::appendFilter( const ::rtl::OUString &title, const
if (!_filter.isNull())
_filter.append("\n");
- //add to hash map for reverse lookup in getCurrentFilter
- _filters.insert(f, t);
-
- // '/' meed to be escaped to else they are assumed to be mime types by kfiledialog
+ // '/' need to be escaped else they are assumed to be mime types by kfiledialog
//see the docs
t.replace("/", "\\/");
@@ -324,7 +323,11 @@ void SAL_CALL KDE4FilePicker::setCurrentFilter( const rtl::OUString &title )
rtl::OUString SAL_CALL KDE4FilePicker::getCurrentFilter()
throw( uno::RuntimeException )
{
- QString filter = _filters[_dialog->currentFilter()];
+ // _dialog->currentFilter() wouldn't quite work, because it returns only e.g. "*.doc",
+ // without the description, and there may be several filters with the same pattern
+ QString filter = _dialog->filterWidget()->currentText();
+ filter = filter.mid( filter.indexOf( '|' ) + 1 ); // convert from the pattern|description format if needed
+ filter.replace( "\\/", "/" );
//default if not found
if (filter.isNull())
@@ -363,6 +366,9 @@ void SAL_CALL KDE4FilePicker::setValue( sal_Int16 controlId, sal_Int16, const un
switch (controlId)
{
case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ // we actually rely on KFileDialog and ignore CHECKBOX_AUTOEXTENSION completely,
+ // otherwise the checkbox would be duplicated
+ break;
case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
@@ -399,6 +405,10 @@ uno::Any SAL_CALL KDE4FilePicker::getValue( sal_Int16 controlId, sal_Int16 )
switch (controlId)
{
case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ // we ignore this one and rely on KFileDialog to provide the function,
+ // always return true, here meaning "it's been taken care of"
+ res = uno::Any( true );
+ break;
case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
@@ -445,7 +455,7 @@ void SAL_CALL KDE4FilePicker::setLabel( sal_Int16 controlId, const ::rtl::OUStri
{
switch (controlId)
{
- case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION: // ignored
case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
@@ -480,7 +490,7 @@ rtl::OUString SAL_CALL KDE4FilePicker::getLabel(sal_Int16 controlId)
{
switch (controlId)
{
- case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION:
+ case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION: // ignored
case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD:
case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS:
case ExtendedFilePickerElementIds::CHECKBOX_READONLY:
@@ -573,7 +583,11 @@ void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
}
widget = new QCheckBox(label, _extraControls);
-
+ // the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
+ // code, but the checkbox is hidden and ignored
+ if( controlId == ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION )
+ widget->hide();
+
break;
}
case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY:
@@ -598,14 +612,13 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
throw( uno::Exception, uno::RuntimeException )
{
_filter.clear();
- _filters.clear();
// parameter checking
uno::Any arg;
if (args.getLength() == 0)
{
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "no arguments" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )),
static_cast< XFilePicker* >( this ), 1 );
}
@@ -615,7 +628,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
( arg.getValueType() != ::getCppuType((sal_Int8*)0)))
{
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "invalid argument type" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )),
static_cast< XFilePicker* >( this ), 1 );
}
@@ -662,6 +675,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
case FILESAVE_AUTOEXTENSION_TEMPLATE:
operationMode = KFileDialog::Saving;
+ addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
addCustomControl( ExtendedFilePickerElementIds::LISTBOX_TEMPLATE );
break;
@@ -687,7 +701,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
default:
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "Unknown template" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )),
static_cast< XFilePicker* >( this ),
1 );
}
@@ -716,7 +730,7 @@ void SAL_CALL KDE4FilePicker::disposing( const lang::EventObject &rEvent )
rtl::OUString SAL_CALL KDE4FilePicker::getImplementationName()
throw( uno::RuntimeException )
{
- return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME ));
}
sal_Bool SAL_CALL KDE4FilePicker::supportsService( const rtl::OUString& ServiceName )
@@ -738,3 +752,5 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getSupportedServiceNam
{
return FilePicker_getSupportedServiceNames();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.hxx b/fpicker/source/unx/kde4/KDE4FilePicker.hxx
index 3a59634b84..e1b8a15e1b 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.hxx
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,6 @@
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
-//#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
#include <com/sun/star/util/XCancellable.hpp>
#include <osl/conditn.hxx>
@@ -79,9 +79,6 @@ protected:
//running filter string to add to dialog
QString _filter;
- //filter for reverse lookup of filter text
- QHash<QString, QString> _filters;
-
//mapping of SAL control ID's to created custom controls
QHash<sal_Int16, QWidget*> _customWidgets;
@@ -169,3 +166,5 @@ private:
void addCustomControl(sal_Int16 controlId);
};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxCommandThread.cxx b/fpicker/source/unx/kde_unx/UnxCommandThread.cxx
new file mode 100644
index 0000000000..3b113346eb
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxCommandThread.cxx
@@ -0,0 +1,314 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <UnxCommandThread.hxx>
+#include <UnxNotifyThread.hxx>
+
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+
+#include <unistd.h>
+#include <string.h>
+#include <iostream>
+
+using namespace ::com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////
+// UnxFilePickerCommandThread
+//////////////////////////////////////////////////////////////////////////
+
+UnxFilePickerCommandThread::UnxFilePickerCommandThread( UnxFilePickerNotifyThread *pNotifyThread, int nReadFD )
+ : m_pNotifyThread( pNotifyThread ),
+ m_nReadFD( nReadFD )
+{
+}
+
+UnxFilePickerCommandThread::~UnxFilePickerCommandThread()
+{
+}
+
+sal_Bool SAL_CALL UnxFilePickerCommandThread::result()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_aResult;
+}
+
+::rtl::OUString SAL_CALL UnxFilePickerCommandThread::getCurrentFilter()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_aGetCurrentFilter;
+}
+
+::rtl::OUString SAL_CALL UnxFilePickerCommandThread::getDirectory()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_aGetDirectory;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePickerCommandThread::getFiles()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ sal_Int32 nSize = m_aGetFiles.size();
+ uno::Sequence< ::rtl::OUString > aFiles( ( nSize > 1 )? nSize + 1: nSize );
+
+ if ( nSize == 1 )
+ aFiles[0] = m_aGetFiles.front();
+ else if ( nSize > 1 )
+ {
+ // First entry in the sequence must be the dirname, the others are the
+ // filenames, so we have to rearrange the list...
+
+ ::rtl::OUString aFront = m_aGetFiles.front();
+ sal_Int32 nLastSlash = aFront.lastIndexOf( '/' );
+
+ aFiles[0] = ( nLastSlash >= 0 )? aFront.copy( 0, nLastSlash ): ::rtl::OUString();
+ ++nLastSlash;
+
+ sal_Int32 nIdx = 1;
+ for ( ::std::list< ::rtl::OUString >::const_iterator it = m_aGetFiles.begin();
+ it != m_aGetFiles.end(); ++it, ++nIdx )
+ {
+ sal_Int32 nLength = (*it).getLength() - nLastSlash;
+ aFiles[nIdx] = ( nLength >= 0 )? (*it).copy( nLastSlash, nLength ): ::rtl::OUString();
+ }
+ }
+
+ return aFiles;
+}
+
+uno::Any SAL_CALL UnxFilePickerCommandThread::getValue()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_aGetValue;
+}
+
+void SAL_CALL UnxFilePickerCommandThread::run()
+{
+ if ( m_nReadFD < 0 )
+ return;
+
+ sal_Int32 nBufferSize = 1024; // 1 is for testing, 1024 for real use
+ sal_Char *pBuffer = new sal_Char[nBufferSize];
+ sal_Char *pBufferEnd = pBuffer + nBufferSize;
+
+ sal_Char *pWhereToRead = pBuffer;
+ sal_Char *pEntryBegin = pBuffer;
+ sal_Int32 nBytesRead = 0;
+ sal_Bool bShouldExit = sal_False;
+ while ( !bShouldExit && ( nBytesRead = read( m_nReadFD, pWhereToRead, pBufferEnd - pWhereToRead ) ) > 0 )
+ {
+ sal_Bool bFoundNL = sal_False;
+ sal_Char *pWhereToReadEnd = pWhereToRead + nBytesRead;
+ sal_Char *pEntryEnd = pWhereToRead;
+ do {
+ for ( ; pEntryEnd < pWhereToReadEnd && *pEntryEnd != '\n'; ++pEntryEnd )
+ ;
+
+ if ( pEntryEnd < pWhereToReadEnd )
+ {
+ bFoundNL = sal_True;
+ *pEntryEnd = 0;
+
+ if ( strcmp( pEntryBegin, "exited" ) == 0 )
+ bShouldExit = sal_True;
+ else
+ handleCommand( ::rtl::OUString( pEntryBegin, pEntryEnd - pEntryBegin, RTL_TEXTENCODING_UTF8 )/*, bQuit*/ );
+
+ pEntryBegin = pEntryEnd + 1;
+ }
+ } while ( pEntryEnd < pWhereToReadEnd );
+
+ if ( bFoundNL )
+ {
+ if ( pEntryBegin < pBufferEnd )
+ memmove( pBuffer, pEntryBegin, pWhereToReadEnd - pEntryBegin );
+ }
+ else
+ {
+ // enlarge the buffer size
+ nBufferSize *= 2;
+ sal_Char *pNewBuffer = new sal_Char[nBufferSize];
+ if ( pEntryBegin < pBufferEnd )
+ memmove( pNewBuffer, pEntryBegin, pWhereToReadEnd - pEntryBegin );
+
+ delete[] pBuffer;
+ pBuffer = pNewBuffer;
+ pBufferEnd = pBuffer + nBufferSize;
+ }
+
+ pWhereToRead = pBuffer + ( pWhereToReadEnd - pEntryBegin );
+ pEntryBegin = pBuffer;
+ }
+}
+
+void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString &rCommand )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+#if OSL_DEBUG_LEVEL > 0
+ ::std::cerr << "UnxFilePicker received: \"" <<
+ OUStringToOString( rCommand, RTL_TEXTENCODING_ASCII_US ).getStr() << "\"" << ::std::endl;
+#endif
+
+ ::std::list< ::rtl::OUString > aList = tokenize( rCommand );
+
+ if ( aList.size() == 0 )
+ return;
+
+ ::rtl::OUString aCommandName = aList.front();
+ aList.pop_front();
+
+ if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "accept" ) ) )
+ {
+ m_aResult = sal_True;
+ m_aExecCondition.set();
+ }
+ else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "reject" ) ) )
+ {
+ m_aResult = sal_False;
+ m_aExecCondition.set();
+ }
+ else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "fileSelectionChanged" ) ) )
+ {
+ if ( m_pNotifyThread )
+ m_pNotifyThread->fileSelectionChanged();
+ }
+ else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "files" ) ) )
+ {
+ m_aGetFiles = aList;
+ m_aGetFilesCondition.set();
+ }
+ else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "value" ) ) )
+ {
+ ::rtl::OUString aType;
+ if ( !aList.empty() )
+ {
+ aType = aList.front();
+ aList.pop_front();
+ }
+
+ if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "bool" ) ) )
+ {
+ sal_Bool bValue = !aList.empty() && aList.front().equalsIgnoreAsciiCaseAscii( "true" );
+
+ m_aGetValue <<= bValue;
+ m_aGetValueCondition.set();
+ }
+ else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "int" ) ) )
+ {
+ sal_Int32 nValue = 0;
+ if ( !aList.empty() )
+ nValue = aList.front().toInt32();
+
+ m_aGetValue <<= nValue;
+ m_aGetValueCondition.set();
+ }
+ else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "string" ) ) )
+ {
+ ::rtl::OUString aValue;
+ if ( !aList.empty() )
+ aValue = aList.front();
+
+ m_aGetValue <<= aValue;
+ m_aGetValueCondition.set();
+ }
+ else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "stringList" ) ) )
+ {
+ uno::Sequence< ::rtl::OUString > aSequence( aList.size() );
+ sal_Int32 nIdx = 0;
+ for ( ::std::list< ::rtl::OUString >::const_iterator it = aList.begin(); it != aList.end(); ++it, ++nIdx )
+ aSequence[nIdx] = (*it);
+
+ m_aGetValue <<= aSequence;
+ m_aGetValueCondition.set();
+ }
+ else
+ {
+ m_aGetValue = uno::Any();
+ m_aGetValueCondition.set();
+ }
+ }
+ else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "currentFilter" ) ) )
+ {
+ m_aGetCurrentFilter = aList.empty()? ::rtl::OUString(): aList.front();
+ m_aGetCurrentFilterCondition.set();
+ }
+ else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "currentDirectory" ) ) )
+ {
+ m_aGetDirectory = aList.empty()? ::rtl::OUString(): aList.front();
+ m_aGetDirectoryCondition.set();
+ }
+ else
+ {
+#if OSL_DEBUG_LEVEL > 0
+ ::std::cerr << "Unrecognized command: "
+ << OUStringToOString( aCommandName, RTL_TEXTENCODING_ASCII_US ).getStr() << "\"" << ::std::endl;
+#endif
+ }
+}
+
+::std::list< ::rtl::OUString > SAL_CALL UnxFilePickerCommandThread::tokenize( const ::rtl::OUString &rCommand )
+{
+ ::std::list< ::rtl::OUString > aList;
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ const sal_Unicode *pUnicode = rCommand.getStr();
+ const sal_Unicode *pEnd = pUnicode + rCommand.getLength();
+ sal_Bool bQuoted = sal_False;
+
+ for ( ; pUnicode != pEnd; ++pUnicode )
+ {
+ if ( *pUnicode == '\\' )
+ {
+ ++pUnicode;
+ if ( pUnicode != pEnd )
+ {
+ if ( *pUnicode == 'n' )
+ aBuffer.appendAscii( "\n", 1 );
+ else
+ aBuffer.append( *pUnicode );
+ }
+ }
+ else if ( *pUnicode == '"' )
+ bQuoted = !bQuoted;
+ else if ( *pUnicode == ' ' && !bQuoted )
+ aList.push_back( aBuffer.makeStringAndClear() );
+ else
+ aBuffer.append( *pUnicode );
+ }
+ aList.push_back( aBuffer.makeStringAndClear() );
+
+ return aList;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxCommandThread.hxx b/fpicker/source/unx/kde_unx/UnxCommandThread.hxx
new file mode 100644
index 0000000000..b8c6aaaaf9
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxCommandThread.hxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UNXCOMMANDTHREAD_HXX_
+#define _UNXCOMMANDTHREAD_HXX_
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+#include <osl/thread.hxx>
+#include <rtl/ustring.hxx>
+
+#include <vcl/svapp.hxx>
+
+#include <list>
+
+class UnxFilePickerNotifyThread;
+
+/** Synchronization for the 'thread-less' version of the fpicker.
+
+ Something like osl::Condition, but calls Application::Yield() while in
+ wait().
+*/
+class YieldingCondition
+{
+ ::osl::Mutex m_aMutex;
+ bool m_bValue;
+
+ bool get()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_bValue;
+ }
+
+public:
+ YieldingCondition() { reset(); }
+
+ void reset()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_bValue = false;
+ }
+
+ void set()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_bValue = true;
+ }
+
+ void wait()
+ {
+ while ( !get() )
+ Application::Yield();
+ }
+};
+
+class UnxFilePickerCommandThread : public ::osl::Thread
+{
+protected:
+ UnxFilePickerNotifyThread *m_pNotifyThread;
+ int m_nReadFD;
+
+ ::osl::Mutex m_aMutex;
+
+ YieldingCondition m_aExecCondition;
+ sal_Bool m_aResult;
+
+ ::osl::Condition m_aGetCurrentFilterCondition;
+ ::rtl::OUString m_aGetCurrentFilter;
+
+ ::osl::Condition m_aGetDirectoryCondition;
+ ::rtl::OUString m_aGetDirectory;
+
+ ::osl::Condition m_aGetFilesCondition;
+ ::std::list< ::rtl::OUString > m_aGetFiles;
+
+ ::osl::Condition m_aGetValueCondition;
+ ::com::sun::star::uno::Any m_aGetValue;
+
+public:
+ UnxFilePickerCommandThread( UnxFilePickerNotifyThread *pNotifyThread, int nReadFD );
+ ~UnxFilePickerCommandThread();
+
+ YieldingCondition& SAL_CALL execCondition() { return m_aExecCondition; }
+ sal_Bool SAL_CALL result();
+
+ ::osl::Condition& SAL_CALL getCurrentFilterCondition() { return m_aGetCurrentFilterCondition; }
+ ::rtl::OUString SAL_CALL getCurrentFilter();
+
+ ::osl::Condition& SAL_CALL getDirectoryCondition() { return m_aGetDirectoryCondition; }
+ ::rtl::OUString SAL_CALL getDirectory();
+
+ ::osl::Condition& SAL_CALL getFilesCondition() { return m_aGetFilesCondition; }
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles();
+
+ ::osl::Condition& SAL_CALL getValueCondition() { return m_aGetValueCondition; }
+ ::com::sun::star::uno::Any SAL_CALL getValue();
+
+protected:
+ virtual void SAL_CALL run();
+
+ virtual void SAL_CALL handleCommand( const ::rtl::OUString &rCommand/*, sal_Bool &rQuit*/ );
+ ::std::list< ::rtl::OUString > SAL_CALL tokenize( const ::rtl::OUString &rCommand );
+};
+
+#endif // _UNXCOMMANDTHREAD_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxFPentry.cxx b/fpicker/source/unx/kde_unx/UnxFPentry.cxx
new file mode 100644
index 0000000000..98c94d6009
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxFPentry.cxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/container/XSet.hpp>
+
+#include <cppuhelper/factory.hxx>
+#include <osl/diagnose.h>
+
+#include "UnxFilePicker.hxx"
+#include "FPServiceInfo.hxx"
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::registry;
+using namespace ::cppu;
+using ::com::sun::star::ui::dialogs::XFilePicker;
+
+//////////////////////////////////////////////////////////////////////////
+//
+//////////////////////////////////////////////////////////////////////////
+
+static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
+{
+ return Reference< XInterface >(
+ static_cast< XFilePicker* >( new UnxFilePicker( rServiceManager ) ) );
+}
+
+//////////////////////////////////////////////////////////////////////////
+// the three uno functions that will be exported
+//////////////////////////////////////////////////////////////////////////
+
+extern "C"
+{
+
+//////////////////////////////////////////////////////////////////////////
+// component_getImplementationEnvironment
+//////////////////////////////////////////////////////////////////////////
+
+void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+//////////////////////////////////////////////////////////////////////////
+
+sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
+{
+ sal_Bool bRetVal = sal_True;
+
+ if ( pRegistryKey )
+ {
+ try
+ {
+ Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
+ pXNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_REGKEY_NAME ) ));
+ }
+ catch( InvalidRegistryException& )
+ {
+ OSL_ENSURE( sal_False, "InvalidRegistryException caught" );
+ bRetVal = sal_False;
+ }
+ }
+
+ return bRetVal;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+//////////////////////////////////////////////////////////////////////////
+
+void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ )
+{
+ void* pRet = 0;
+
+ if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
+ {
+ Sequence< OUString > aSNS( 1 );
+ aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME ));
+
+ Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
+ reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
+ OUString::createFromAscii( pImplName ),
+ createInstance,
+ aSNS ) );
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+ }
+
+ return pRet;
+}
+
+} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxFilePicker.cxx b/fpicker/source/unx/kde_unx/UnxFilePicker.cxx
new file mode 100644
index 0000000000..8c7cd91a9e
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxFilePicker.cxx
@@ -0,0 +1,931 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/ui/dialogs/ControlActions.hpp>
+
+#include <FPServiceInfo.hxx>
+
+#include <cppuhelper/interfacecontainer.h>
+#include <osl/diagnose.h>
+#include <rtl/ustring.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <tools/resmgr.hxx>
+
+#include <svtools/svtools.hrc>
+#include <UnxFilePicker.hxx>
+#include <UnxCommandThread.hxx>
+#include <UnxNotifyThread.hxx>
+
+#include <vcl/svapp.hxx>
+#include <vcl/sysdata.hxx>
+#include <vcl/syswin.hxx>
+#include <vcl/window.hxx>
+
+#include <sys/wait.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+#include <iostream>
+
+using namespace ::com::sun::star;
+
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+
+//////////////////////////////////////////////////////////////////////////
+// helper functions
+//////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ // controling event notifications
+ const bool STARTUP_SUSPENDED = true;
+ const bool STARTUP_ALIVE = false;
+
+ uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
+ {
+ uno::Sequence<rtl::OUString> aRet(3);
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker"));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker"));
+ aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.KDEFilePicker"));
+ return aRet;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////
+// UnxFilePicker
+//////////////////////////////////////////////////////////////////////////
+
+UnxFilePicker::UnxFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
+ : cppu::WeakComponentImplHelper8<
+ XFilterManager,
+ XFilterGroupManager,
+ XFilePickerControlAccess,
+ XFilePickerNotifier,
+// TODO XFilePreview,
+ lang::XInitialization,
+ util::XCancellable,
+ lang::XEventListener,
+ lang::XServiceInfo>( m_rbHelperMtx ),
+ m_xServiceMgr( xServiceMgr ),
+ m_nFilePickerPid( -1 ),
+ m_nFilePickerWrite( -1 ),
+ m_nFilePickerRead( -1 ),
+ m_pNotifyThread( NULL ),
+ m_pCommandThread( NULL ),
+ m_pResMgr( CREATEVERSIONRESMGR( fps_office ) )
+{
+}
+
+UnxFilePicker::~UnxFilePicker()
+{
+ if ( m_nFilePickerPid > 0 )
+ {
+ sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "exit" )) );
+ waitpid( m_nFilePickerPid, NULL, 0 );
+ }
+
+ if ( m_pCommandThread )
+ {
+ m_pCommandThread->join();
+
+ delete m_pCommandThread, m_pCommandThread = NULL;
+ }
+
+ if ( m_pNotifyThread )
+ {
+ m_pNotifyThread->exit();
+
+ m_pNotifyThread->join();
+
+ delete m_pNotifyThread, m_pNotifyThread = NULL;
+ }
+
+ if ( m_nFilePickerWrite >= 0 )
+ close( m_nFilePickerWrite );
+
+ if ( m_nFilePickerRead >= 0 )
+ close( m_nFilePickerRead );
+
+ delete m_pResMgr, m_pResMgr = NULL;
+}
+
+void SAL_CALL UnxFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
+ throw( uno::RuntimeException )
+{
+ OSL_ASSERT( m_pNotifyThread );
+ osl::MutexGuard aGuard( m_aMutex );
+
+ m_pNotifyThread->addFilePickerListener( xListener );
+}
+
+void SAL_CALL UnxFilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
+ throw( uno::RuntimeException )
+{
+ OSL_ASSERT( m_pNotifyThread );
+ osl::MutexGuard aGuard( m_aMutex );
+
+ m_pNotifyThread->removeFilePickerListener( xListener );
+}
+
+void SAL_CALL UnxFilePicker::setTitle( const rtl::OUString &rTitle )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "setTitle " );
+ appendEscaped( aBuffer, rTitle );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+sal_Int16 SAL_CALL UnxFilePicker::execute()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+
+ // this is _not_ an osl::Condition, see i#93366
+ m_pCommandThread->execCondition().reset();
+
+ sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "exec" ) ));
+
+ m_pCommandThread->execCondition().wait();
+
+ return m_pCommandThread->result();
+}
+
+void SAL_CALL UnxFilePicker::setMultiSelectionMode( sal_Bool bMode )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUString aString = bMode?
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "setMultiSelection true" )):
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "setMultiSelection false" ));
+
+ sendCommand( aString );
+}
+
+void SAL_CALL UnxFilePicker::setDefaultName( const ::rtl::OUString &rName )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "setDefaultName " );
+ appendEscaped( aBuffer, rName );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+void SAL_CALL UnxFilePicker::setDisplayDirectory( const rtl::OUString &rDirectory )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "setDirectory " );
+ appendEscaped( aBuffer, rDirectory );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+rtl::OUString SAL_CALL UnxFilePicker::getDisplayDirectory()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "getDirectory" )),
+ m_pCommandThread->getDirectoryCondition() );
+
+ return m_pCommandThread->getDirectory();
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getFiles()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "getFiles" )),
+ m_pCommandThread->getFilesCondition() );
+
+ return m_pCommandThread->getFiles();
+}
+
+void SAL_CALL UnxFilePicker::appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "appendFilter " );
+ appendEscaped( aBuffer, rTitle );
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, rFilter );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+void SAL_CALL UnxFilePicker::setCurrentFilter( const rtl::OUString &rTitle )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "setCurrentFilter " );
+ appendEscaped( aBuffer, rTitle );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+rtl::OUString SAL_CALL UnxFilePicker::getCurrentFilter()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "getCurrentFilter" )),
+ m_pCommandThread->getCurrentFilterCondition() );
+
+ return m_pCommandThread->getCurrentFilter();
+}
+
+void SAL_CALL UnxFilePicker::appendFilterGroup( const rtl::OUString &rGroupTitle, const uno::Sequence<beans::StringPair> &rFilters )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "appendFilterGroup " );
+ appendEscaped( aBuffer, rGroupTitle );
+
+ for ( sal_Int32 i = 0; i < rFilters.getLength(); ++i )
+ {
+ beans::StringPair aPair = rFilters[i];
+
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, aPair.First );
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, aPair.Second );
+ }
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any &rValue )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUString aType;
+ ::rtl::OUString aAction;
+ sal_Int32 nTitleId;
+
+ if ( controlIdInfo( nControlId, aType, nTitleId ) && controlActionInfo( nControlAction, aAction ) )
+ {
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "setValue " );
+ aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
+ aBuffer.appendAscii( " ", 1 );
+ aBuffer.append( aAction );
+
+ if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "checkbox" ) ) )
+ {
+ sal_Bool bControlValue;
+ if ( ( rValue >>= bControlValue ) && bControlValue )
+ aBuffer.appendAscii( " true" );
+ else
+ aBuffer.appendAscii( " false" );
+ }
+ else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "listbox" ) ) )
+ {
+ switch ( nControlAction )
+ {
+ case ControlActions::ADD_ITEM:
+ case ControlActions::SET_HELP_URL:
+ {
+ ::rtl::OUString aString;
+ if ( rValue >>= aString )
+ {
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, aString );
+ }
+ }
+ break;
+
+ case ControlActions::ADD_ITEMS:
+ {
+ uno::Sequence< ::rtl::OUString > aSequence;
+ if ( rValue >>= aSequence )
+ {
+ for ( sal_Int32 nIdx = 0; nIdx < aSequence.getLength(); ++nIdx )
+ {
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, aSequence[nIdx] );
+ }
+
+ }
+ }
+ break;
+
+ case ControlActions::DELETE_ITEM:
+ case ControlActions::SET_SELECT_ITEM:
+ {
+ sal_Int32 nInt;
+ if ( rValue >>= nInt )
+ {
+ aBuffer.appendAscii( " ", 1 );
+ aBuffer.append( nInt );
+ }
+ }
+ break;
+
+ default:
+ // nothing
+ break;
+ }
+ }
+ // TODO else if push button...
+
+ sendCommand( aBuffer.makeStringAndClear() );
+ }
+}
+
+uno::Any SAL_CALL UnxFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nControlAction )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUString aAction;
+
+ if ( controlActionInfo( nControlAction, aAction ) )
+ {
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "getValue " );
+ aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
+ aBuffer.appendAscii( " ", 1 );
+ aBuffer.append( aAction );
+
+ sendCommand( aBuffer.makeStringAndClear(),
+ m_pCommandThread->getValueCondition() );
+
+ return m_pCommandThread->getValue();
+ }
+
+ return uno::Any();
+}
+
+void SAL_CALL UnxFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bEnable )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "enableControl " );
+ aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
+ aBuffer.appendAscii( bEnable? " true": " false" );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+void SAL_CALL UnxFilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "setLabel " );
+ aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, rLabel );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+}
+
+rtl::OUString SAL_CALL UnxFilePicker::getLabel(sal_Int16 /*nControlId*/)
+ throw ( uno::RuntimeException )
+{
+ // FIXME getLabel() is not yet implemented
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // TODO return m_pImpl->getLabel(nControlId);
+ return ::rtl::OUString();
+}
+
+/* TODO
+uno::Sequence<sal_Int16> SAL_CALL UnxFilePicker::getSupportedImageFormats()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_pImpl->getSupportedImageFormats();
+}
+
+sal_Int32 SAL_CALL UnxFilePicker::getTargetColorDepth()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_pImpl->getTargetColorDepth();
+}
+
+sal_Int32 SAL_CALL UnxFilePicker::getAvailableWidth()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_pImpl->getAvailableWidth();
+}
+
+sal_Int32 SAL_CALL UnxFilePicker::getAvailableHeight()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_pImpl->getAvailableHeight();
+}
+
+void SAL_CALL UnxFilePicker::setImage( sal_Int16 aImageFormat, const uno::Any &rImage )
+ throw( lang::IllegalArgumentException, uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_pImpl->setImage( aImageFormat, aImage );
+}
+
+sal_Bool SAL_CALL UnxFilePicker::setShowState( sal_Bool bShowState )
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_pImpl->setShowState( bShowState );
+}
+
+sal_Bool SAL_CALL UnxFilePicker::getShowState()
+ throw( uno::RuntimeException )
+{
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ return m_pImpl->getShowState();
+}
+*/
+
+void SAL_CALL UnxFilePicker::initialize( const uno::Sequence<uno::Any> &rArguments )
+ throw( uno::Exception, uno::RuntimeException )
+{
+ initFilePicker();
+
+ // parameter checking
+ uno::Any aAny;
+ if ( 0 == rArguments.getLength( ) )
+ throw lang::IllegalArgumentException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )),
+ static_cast< XFilePicker* >( this ), 1 );
+
+ aAny = rArguments[0];
+
+ if ( ( aAny.getValueType() != ::getCppuType( (sal_Int16*)0 ) ) && ( aAny.getValueType() != ::getCppuType( (sal_Int8*)0 ) ) )
+ throw lang::IllegalArgumentException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )),
+ static_cast< XFilePicker* >( this ), 1 );
+
+ sal_Int16 templateId = -1;
+ aAny >>= templateId;
+
+ ::rtl::OUString aTypeOpen(RTL_CONSTASCII_USTRINGPARAM( "setType \"open\"" ));
+ ::rtl::OUString aTypeSaveAs(RTL_CONSTASCII_USTRINGPARAM( "setType \"save\"" ));
+
+ switch ( templateId )
+ {
+ case FILEOPEN_SIMPLE:
+ sendCommand( aTypeOpen );
+ break;
+
+ case FILESAVE_SIMPLE:
+ sendCommand( aTypeSaveAs );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_PASSWORD:
+ sendCommand( aTypeSaveAs );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
+ sendCommand( aTypeSaveAs );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_SELECTION:
+ sendCommand( aTypeSaveAs );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_SELECTION );
+ break;
+
+ case FILESAVE_AUTOEXTENSION_TEMPLATE:
+ sendCommand( aTypeSaveAs );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::LISTBOX_TEMPLATE );
+ break;
+
+ case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
+ sendCommand( aTypeOpen );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_LINK );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE );
+ break;
+
+ case FILEOPEN_PLAY:
+ sendCommand( aTypeOpen );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::PUSHBUTTON_PLAY );
+ break;
+
+ case FILEOPEN_READONLY_VERSION:
+ sendCommand( aTypeOpen );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_READONLY );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::LISTBOX_VERSION );
+ break;
+
+ case FILEOPEN_LINK_PREVIEW:
+ sendCommand( aTypeOpen );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_LINK );
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW );
+ break;
+
+ case FILESAVE_AUTOEXTENSION:
+ sendCommand( aTypeSaveAs );
+
+ sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ break;
+
+ default:
+ throw lang::IllegalArgumentException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )),
+ static_cast< XFilePicker* >( this ),
+ 1 );
+ }
+}
+
+void SAL_CALL UnxFilePicker::cancel()
+ throw ( uno::RuntimeException )
+{
+ // FIXME cancel() is not implemented
+ checkFilePicker();
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ // TODO m_pImpl->cancel();
+}
+
+void SAL_CALL UnxFilePicker::disposing( const lang::EventObject &rEvent )
+ throw( uno::RuntimeException )
+{
+ uno::Reference<XFilePickerListener> xFilePickerListener( rEvent.Source, uno::UNO_QUERY );
+
+ if ( xFilePickerListener.is() )
+ removeFilePickerListener( xFilePickerListener );
+}
+
+rtl::OUString SAL_CALL UnxFilePicker::getImplementationName()
+ throw( uno::RuntimeException )
+{
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME ));
+}
+
+sal_Bool SAL_CALL UnxFilePicker::supportsService( const rtl::OUString& ServiceName )
+ throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
+
+ for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
+ {
+ if ( SupportedServicesNames[n].compareTo( ServiceName ) == 0 )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+{
+ return FilePicker_getSupportedServiceNames();
+}
+
+void UnxFilePicker::initFilePicker()
+{
+ int aFiledesStdin[2], aFiledesStdout[2];
+ if ( pipe( aFiledesStdin ) < 0 || pipe( aFiledesStdout ) < 0 )
+ return;
+
+ m_nFilePickerPid = fork();
+ if ( m_nFilePickerPid < 0 )
+ return;
+
+ if ( m_nFilePickerPid == 0 )
+ {
+ // Child...
+ close( aFiledesStdin[1] ); // write end of the pipe
+ dup2( aFiledesStdin[0], 0 );
+ close( aFiledesStdin[0] );
+
+ close( aFiledesStdout[0] ); // read end of the pipe
+ dup2( aFiledesStdout[1], 1 );
+ close( aFiledesStdout[1] );
+
+#if OSL_DEBUG_LEVEL == 0
+ int nRedirect = open( "/dev/null", O_WRONLY );
+ if( nRedirect != -1 )
+ {
+ dup2( nRedirect, 2 );
+ }
+#endif
+
+ // The executable name
+ const char *pFname = "kdefilepicker";
+
+ // ID of the main window
+ const int nIdLen = 20;
+ char pWinId[nIdLen] = "0";
+
+ // TODO pass here the real parent (not possible for system dialogs
+ // yet), and default to GetDefDialogParent() only when the real parent
+ // is NULL
+ Window *pParentWin = Application::GetDefDialogParent();
+ if ( pParentWin )
+ {
+ const SystemEnvData* pSysData = ((SystemWindow *)pParentWin)->GetSystemData();
+ if ( pSysData )
+ {
+ snprintf( pWinId, nIdLen, "%ld", pSysData->aWindow ); // unx only
+ pWinId[nIdLen-1] = 0;
+ }
+ }
+
+ // Execute the fpicker implementation
+ execlp( pFname, pFname, "--winid", pWinId, NULL );
+
+ // Error, finish the child
+ exit( -1 );
+ }
+
+ // Parent continues
+ close( aFiledesStdin[0] );
+ m_nFilePickerWrite = aFiledesStdin[1];
+
+ close( aFiledesStdout[1] );
+ m_nFilePickerRead = aFiledesStdout[0];
+
+ // Create the notify thread
+ if ( !m_pNotifyThread )
+ m_pNotifyThread = new UnxFilePickerNotifyThread( this );
+
+ // Create the command thread
+ if ( !m_pCommandThread )
+ m_pCommandThread = new UnxFilePickerCommandThread( m_pNotifyThread, m_nFilePickerRead );
+
+ // Start the threads
+ m_pNotifyThread->create();
+ m_pCommandThread->create();
+
+ return;
+}
+
+void UnxFilePicker::checkFilePicker() throw( ::com::sun::star::uno::RuntimeException )
+{
+ if ( m_nFilePickerPid > 0 )
+ {
+ // TODO check if external file picker is runnning
+ }
+ else
+ {
+ throw uno::RuntimeException(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "the external file picker does not run" )),
+ *this );
+ }
+}
+
+void UnxFilePicker::sendCommand( const ::rtl::OUString &rCommand )
+{
+ if ( m_nFilePickerWrite < 0 )
+ return;
+
+ ::rtl::OString aUtfString = OUStringToOString( rCommand + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "\n" )), RTL_TEXTENCODING_UTF8 );
+
+#if OSL_DEBUG_LEVEL > 0
+ ::std::cerr << "UnxFilePicker sent: \"" << aUtfString.getStr() << "\"" << ::std::endl;
+#endif
+
+ write( m_nFilePickerWrite, aUtfString.getStr(), aUtfString.getLength() );
+}
+
+void UnxFilePicker::sendCommand( const ::rtl::OUString &rCommand, ::osl::Condition &rCondition )
+{
+ rCondition.reset();
+
+ sendCommand( rCommand );
+
+ rCondition.wait();
+}
+
+void UnxFilePicker::appendEscaped( ::rtl::OUStringBuffer &rBuffer, const ::rtl::OUString &rString )
+{
+ const sal_Unicode *pUnicode = rString.getStr();
+ const sal_Unicode *pEnd = pUnicode + rString.getLength();
+
+ rBuffer.appendAscii( "\"" , 1 );
+
+ for ( ; pUnicode != pEnd; ++pUnicode )
+ {
+ if ( *pUnicode == '\\' )
+ rBuffer.appendAscii( "\\\\", 2 );
+ else if ( *pUnicode == '"' )
+ rBuffer.appendAscii( "\\\"", 2 );
+ else if ( *pUnicode == '\n' )
+ rBuffer.appendAscii( "\\n", 2 );
+ else
+ rBuffer.append( *pUnicode );
+ }
+
+ rBuffer.appendAscii( "\"", 1 );
+}
+
+sal_Bool UnxFilePicker::controlIdInfo( sal_Int16 nControlId, ::rtl::OUString &rType, sal_Int32 &rTitleId )
+{
+ typedef struct {
+ sal_Int16 nId;
+ const ::rtl::OUString *pType;
+ sal_Int32 nTitle;
+ } ElementToName;
+
+ const ::rtl::OUString aCheckBox( RTL_CONSTASCII_USTRINGPARAM( "checkbox" ) );
+ const ::rtl::OUString aControl( RTL_CONSTASCII_USTRINGPARAM( "control" ) );
+ const ::rtl::OUString aEdit( RTL_CONSTASCII_USTRINGPARAM( "edit" ) );
+ const ::rtl::OUString aLabel( RTL_CONSTASCII_USTRINGPARAM( "label" ) );
+ const ::rtl::OUString aListBox( RTL_CONSTASCII_USTRINGPARAM( "listbox" ) );
+ const ::rtl::OUString aPushButton( RTL_CONSTASCII_USTRINGPARAM( "pushbutton" ) );
+
+ const ElementToName *pPtr;
+ const ElementToName pArray[] =
+ {
+ { CommonFilePickerElementIds::PUSHBUTTON_OK, &aPushButton, 0/*FIXME?*/ },
+ { CommonFilePickerElementIds::PUSHBUTTON_CANCEL, &aPushButton, 0/*FIXME?*/ },
+ { CommonFilePickerElementIds::LISTBOX_FILTER, &aListBox, 0/*FIXME?*/ },
+ { CommonFilePickerElementIds::CONTROL_FILEVIEW, &aControl, 0/*FIXME?*/ },
+ { CommonFilePickerElementIds::EDIT_FILEURL, &aEdit, 0/*FIXME?*/ },
+ { CommonFilePickerElementIds::LISTBOX_FILTER_LABEL, &aLabel, 0/*FIXME?*/ },
+ { CommonFilePickerElementIds::EDIT_FILEURL_LABEL, &aLabel, 0/*FIXME?*/ },
+
+ { ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, &aCheckBox, STR_SVT_FILEPICKER_AUTO_EXTENSION },
+ { ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, &aCheckBox, STR_SVT_FILEPICKER_PASSWORD },
+ { ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS, &aCheckBox, STR_SVT_FILEPICKER_FILTER_OPTIONS },
+ { ExtendedFilePickerElementIds::CHECKBOX_READONLY, &aCheckBox, STR_SVT_FILEPICKER_READONLY },
+ { ExtendedFilePickerElementIds::CHECKBOX_LINK, &aCheckBox, STR_SVT_FILEPICKER_INSERT_AS_LINK },
+ { ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, &aCheckBox, STR_SVT_FILEPICKER_SHOW_PREVIEW },
+ { ExtendedFilePickerElementIds::PUSHBUTTON_PLAY, &aPushButton, STR_SVT_FILEPICKER_PLAY },
+ { ExtendedFilePickerElementIds::LISTBOX_VERSION, &aListBox, STR_SVT_FILEPICKER_VERSION },
+ { ExtendedFilePickerElementIds::LISTBOX_TEMPLATE, &aListBox, STR_SVT_FILEPICKER_TEMPLATES },
+ { ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE, &aListBox, STR_SVT_FILEPICKER_IMAGE_TEMPLATE },
+ { ExtendedFilePickerElementIds::CHECKBOX_SELECTION, &aCheckBox, STR_SVT_FILEPICKER_SELECTION },
+ { 0, 0, 0 }
+ };
+
+ for ( pPtr = pArray; pPtr->nId && ( pPtr->nId != nControlId ); ++pPtr )
+ ;
+
+ if ( pPtr->nId == nControlId )
+ {
+ rType = *(pPtr->pType);
+ rTitleId = pPtr->nTitle;
+
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+sal_Bool UnxFilePicker::controlActionInfo( sal_Int16 nControlAction, ::rtl::OUString &rType )
+{
+ typedef struct {
+ sal_Int16 nId;
+ const ::rtl::OUString pType;
+ } ElementToName;
+
+ const ElementToName *pPtr;
+ const ElementToName pArray[] =
+ {
+ { ControlActions::ADD_ITEM, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "addItem" ) ) },
+ { ControlActions::ADD_ITEMS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "addItems" ) ) },
+ { ControlActions::DELETE_ITEM, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "deleteItem" ) ) },
+ { ControlActions::DELETE_ITEMS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "deleteItems" ) ) },
+ { ControlActions::SET_SELECT_ITEM, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setSelectedItem" ) ) },
+ { ControlActions::GET_ITEMS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getItems" ) ) },
+ { ControlActions::GET_SELECTED_ITEM, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getSelectedItem" ) ) },
+ { ControlActions::GET_SELECTED_ITEM_INDEX, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getSelectedItemIndex" ) ) },
+ { ControlActions::SET_HELP_URL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setHelpURL" ) ) },
+ { ControlActions::GET_HELP_URL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getHelpURL" ) ) },
+ { 0, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "noAction" ) ) }
+ };
+
+ for ( pPtr = pArray; pPtr->nId && ( pPtr->nId != nControlAction ); ++pPtr )
+ ;
+
+ rType = pPtr->pType;
+
+ return sal_True;
+}
+
+void UnxFilePicker::sendAppendControlCommand( sal_Int16 nControlId )
+{
+ ::rtl::OUString aType;
+ sal_Int32 nTitleId;
+
+ if ( controlIdInfo( nControlId, aType, nTitleId ) )
+ {
+ ::rtl::OUStringBuffer aBuffer( 1024 );
+
+ aBuffer.appendAscii( "appendControl " );
+ aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, aType );
+ aBuffer.appendAscii( " ", 1 );
+ appendEscaped( aBuffer, m_pResMgr? String( ResId( nTitleId, *m_pResMgr ) ): String() );
+
+ sendCommand( aBuffer.makeStringAndClear() );
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxFilePicker.hxx b/fpicker/source/unx/kde_unx/UnxFilePicker.hxx
new file mode 100644
index 0000000000..d48af8567d
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxFilePicker.hxx
@@ -0,0 +1,177 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UNXFILEPICKER_HXX_
+#define _UNXFILEPICKER_HXX_
+
+#include <cppuhelper/compbase8.hxx>
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/ustrbuf.hxx>
+
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
+#include <com/sun/star/util/XCancellable.hpp>
+
+#include <list>
+
+class UnxFilePickerCommandThread;
+class UnxFilePickerNotifyThread;
+class ResMgr;
+
+class UnxFilePickerDummy
+{
+protected:
+ osl::Mutex m_aMutex;
+ osl::Mutex m_rbHelperMtx;
+};
+
+class UnxFilePicker :
+ public UnxFilePickerDummy,
+ public cppu::WeakComponentImplHelper8<
+ ::com::sun::star::ui::dialogs::XFilterManager,
+ ::com::sun::star::ui::dialogs::XFilterGroupManager,
+ ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
+ ::com::sun::star::ui::dialogs::XFilePickerNotifier,
+// TODO ::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 >
+{
+protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; // to instanciate own services
+
+ pid_t m_nFilePickerPid;
+ int m_nFilePickerWrite; // (kde|...)filepicker gets it as stdin
+ int m_nFilePickerRead; // (kde|...)filepicker gets it as stdout
+
+ UnxFilePickerNotifyThread *m_pNotifyThread;
+ UnxFilePickerCommandThread *m_pCommandThread;
+
+ ResMgr *m_pResMgr;
+
+public:
+ UnxFilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
+ virtual ~UnxFilePicker();
+
+ // XFilePickerNotifier
+
+ 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 );
+
+ // 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 );
+
+ // XFilePicker functions
+
+ virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDefaultName( const ::rtl::OUString &rName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString &rDirectory ) throw( ::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 );
+
+ // XFilterManager functions
+
+ virtual void SAL_CALL appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString &rTitle ) 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 &rGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > &rFilters ) 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 &rValue ) 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 enableControl( sal_Int16 nControlId, sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlId ) throw (::com::sun::star::uno::RuntimeException);
+
+ /* TODO XFilePreview
+
+ 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 &rImage ) 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
+
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &rArguments ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+
+ // XCancellable
+
+ virtual void SAL_CALL cancel( ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XEventListener
+
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject &rEvent ) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString &rServiceName ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
+
+private:
+ // prevent copy and assignment
+ UnxFilePicker( const UnxFilePicker& );
+ UnxFilePicker& operator=( const UnxFilePicker& );
+
+protected:
+ void initFilePicker();
+ void checkFilePicker() throw( ::com::sun::star::uno::RuntimeException );
+
+ // Async sendCommand
+ void sendCommand( const ::rtl::OUString &rCommand );
+ // Synchronized sendCommand
+ void sendCommand( const ::rtl::OUString &rCommand, ::osl::Condition &rCondition );
+ void appendEscaped( ::rtl::OUStringBuffer &rBuffer, const ::rtl::OUString &rString );
+
+private:
+ sal_Bool controlIdInfo( sal_Int16 nControlId, ::rtl::OUString &rType, sal_Int32 &rTitleId );
+ sal_Bool controlActionInfo( sal_Int16 nControlId, ::rtl::OUString &rType );
+ void sendAppendControlCommand( sal_Int16 nControlId );
+};
+
+#endif // _UNXFILEPICKER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx b/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx
new file mode 100644
index 0000000000..a97fdfc24f
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <UnxNotifyThread.hxx>
+#include <UnxFilePicker.hxx>
+
+using namespace ::com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////
+// UnxFilePickerNotifyThread
+//////////////////////////////////////////////////////////////////////////
+
+UnxFilePickerNotifyThread::UnxFilePickerNotifyThread( UnxFilePicker *pUnxFilePicker )
+ : m_pUnxFilePicker( pUnxFilePicker ),
+ m_bExit( sal_False ),
+ m_eNotifyType( Nothing ),
+ m_nControlId( 0 )
+{
+}
+
+void SAL_CALL UnxFilePickerNotifyThread::addFilePickerListener( const uno::Reference< ui::dialogs::XFilePickerListener >& xListener )
+ throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_xListener = xListener;
+}
+
+void SAL_CALL UnxFilePickerNotifyThread::removeFilePickerListener( const uno::Reference< ui::dialogs::XFilePickerListener >& /*xListener*/ )
+ throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_xListener.clear();
+}
+
+void SAL_CALL UnxFilePickerNotifyThread::exit()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_bExit = sal_True;
+
+ m_aExitCondition.reset();
+ m_aNotifyCondition.set();
+
+ m_aExitCondition.wait();
+}
+
+void SAL_CALL UnxFilePickerNotifyThread::fileSelectionChanged()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ m_eNotifyType = FileSelectionChanged;
+ m_nControlId = 0;
+
+ m_aNotifyCondition.set();
+}
+
+void SAL_CALL UnxFilePickerNotifyThread::run()
+{
+ do {
+ m_aNotifyCondition.reset();
+ m_aNotifyCondition.wait();
+
+ if ( m_xListener.is() && m_pUnxFilePicker )
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ui::dialogs::FilePickerEvent aEvent( *m_pUnxFilePicker, m_nControlId );
+
+ switch ( m_eNotifyType )
+ {
+ case FileSelectionChanged:
+ m_xListener->fileSelectionChanged( aEvent );
+ break;
+
+ // TODO More to come...
+
+ default:
+ // nothing
+ break;
+ }
+ }
+ } while ( !m_bExit );
+
+ m_aExitCondition.set();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/UnxNotifyThread.hxx b/fpicker/source/unx/kde_unx/UnxNotifyThread.hxx
new file mode 100644
index 0000000000..b60d7b4758
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/UnxNotifyThread.hxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2010 Novell, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UNXNOTIFYTHREAD_HXX_
+#define _UNXNOTIFYTHREAD_HXX_
+
+#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+#include <osl/thread.hxx>
+
+class UnxFilePicker;
+
+class UnxFilePickerNotifyThread : public ::osl::Thread
+{
+protected:
+ enum NotifyType
+ {
+ Nothing = 0,
+ FileSelectionChanged
+ // TODO More to come...
+ };
+
+ UnxFilePicker *m_pUnxFilePicker;
+
+ ::osl::Mutex m_aMutex;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
+
+ sal_Bool m_bExit;
+ ::osl::Condition m_aExitCondition;
+
+ NotifyType m_eNotifyType;
+ ::osl::Condition m_aNotifyCondition;
+ sal_Int16 m_nControlId;
+
+public:
+ UnxFilePickerNotifyThread( UnxFilePicker *pUnxFilePicker );
+
+ 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 );
+
+ void SAL_CALL exit();
+
+ void SAL_CALL fileSelectionChanged();
+ /* TODO
+ void SAL_CALL directoryChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent );
+ rtl::OUString SAL_CALL helpRequested( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ) const;
+ void SAL_CALL controlStateChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent );
+ void SAL_CALL dialogSizeChanged( );
+ */
+
+protected:
+ virtual void SAL_CALL run();
+};
+
+#endif // _UNXNOTIFYTHREAD_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde_unx/fps-kde-ucd.txt b/fpicker/source/unx/kde_unx/fps-kde-ucd.txt
new file mode 100644
index 0000000000..28aa49d97b
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/fps-kde-ucd.txt
@@ -0,0 +1,6 @@
+[ComponentDescriptor]
+ImplementationName=com.sun.star.ui.dialogs.UnxFilePicker
+ComponentName=fps_kde.uno.so
+LoaderName=com.sun.star.loader.SharedLibrary
+[SupportedServices]
+com.sun.star.ui.dialogs.KDEFilePicker
diff --git a/fpicker/source/unx/kde_unx/fps_kde.xml b/fpicker/source/unx/kde_unx/fps_kde.xml
new file mode 100644
index 0000000000..99683bfeca
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/fps_kde.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name>fps_kde</module-name>
+ <component-description>
+ <author> Jan Holesovsky </author>
+ <name> com.sun.star.comp.ui.dialogs.FilePicker </name>
+ <description>
+ The KDE implementation of the FilePicker service.
+ </description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language> c++ </language>
+ <status value="beta"/>
+ <supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service>
+ <service-dependency>...</service-dependency>
+ <type> com.sun.star.ui.dialogs.XExecutableDialog </type>
+ <type> com.sun.star.ui.dialogs.XFilePicker </type>
+ <type> com.sun.star.ui.dialogs.XFilterManager </type>
+ <type> com.sun.star.ui.dialogs.XFilterGroupManager </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerListener </type>
+ <type> com.sun.star.ui.dialogs.ExecutableDialogException </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerNotifier </type>
+ <type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type>
+ <type> com.sun.star.ui.dialogs.XFilePreview </type>
+ <type> com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type>
+ <type> com.sun.star.ui.dialogs.ExecutableDialogResults </type>
+ <type> com.sun.star.ui.dialogs.FilePickerEvent </type>
+ <type> com.sun.star.ui.dialogs.CommonFilePickerElementIds </type>
+ <type> com.sun.star.ui.dialogs.ListboxControlActions </type>
+ <type> com.sun.star.ui.dialogs.TemplateDescription </type>
+ <type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type>
+ <type> com.sun.star.util.XCancellable </type>
+ <type> com.sun.star.lang.XComponent </type>
+ <type> com.sun.star.lang.XMultiServiceFactory </type>
+ <type> com.sun.star.lang.XSingleServiceFactory </type>
+ <type> com.sun.star.lang.XServiceInfo </type>
+ <type> com.sun.star.lang.XTypeProvider </type>
+ <type> com.sun.star.lang.IllegalArgumentException </type>
+ <type> com.sun.star.uno.TypeClass </type>
+ <type> com.sun.star.uno.XWeak </type>
+ <type> com.sun.star.uno.XAggregation </type>
+ <type> com.sun.star.registry.XRegistryKey </type>
+ <type> com.sun.star.container.XSet </type>
+ </component-description>
+ <project-build-dependency> cppuhelper </project-build-dependency>
+ <project-build-dependency> cppu </project-build-dependency>
+ <project-build-dependency> sal </project-build-dependency>
+ <runtime-module-dependency> cppuhelper </runtime-module-dependency>
+ <runtime-module-dependency> cppu2 </runtime-module-dependency>
+ <runtime-module-dependency> sal2 </runtime-module-dependency>
+</module-description>
diff --git a/fpicker/source/unx/kde_unx/makefile.mk b/fpicker/source/unx/kde_unx/makefile.mk
new file mode 100644
index 0000000000..781fa514c1
--- /dev/null
+++ b/fpicker/source/unx/kde_unx/makefile.mk
@@ -0,0 +1,84 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=fpicker
+TARGET=fps_kde.uno
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+DLLPRE=
+
+# ------------------------------------------------------------------
+
+# Currently just KDE is supported...
+.IF "$(GUIBASE)" != "unx" || "$(ENABLE_KDE)" != "TRUE"
+
+dummy:
+ @echo "Nothing to build. GUIBASE == $(GUIBASE), ENABLE_KDE is not set"
+
+.ELSE # we build for KDE
+
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/UnxCommandThread.obj \
+ $(SLO)$/UnxFilePicker.obj \
+ $(SLO)$/UnxNotifyThread.obj \
+ $(SLO)$/UnxFPentry.obj
+
+APP1TARGET= $(TARGET)
+APP1OBJS= $(OBJFILES)
+APP1LIBS= $(LB)$/svx.lib
+APP1STDLIBS=$(TOOLSLIB) \
+ $(VOSLIB) \
+ $(SO2LIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(SALLIB) \
+ $(SFXLIB) \
+ $(SOTLIB) \
+ $(VCLLIB)
+
+SHL1OBJS=$(SLOFILES)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEF1VERSIONMAP=$(SOLARENV)/src/component.map
+
+.ENDIF # "$(GUIBASE)" != "unx" || "$(ENABLE_KDE)" != "TRUE"
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/fpicker/source/win32/filepicker/FPServiceInfo.hxx b/fpicker/source/win32/filepicker/FPServiceInfo.hxx
index 3661771122..528add7e5a 100644
--- a/fpicker/source/win32/filepicker/FPServiceInfo.hxx
+++ b/fpicker/source/win32/filepicker/FPServiceInfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,3 +76,5 @@
#define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.Win32FilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.SystemFilePicker"
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx
index 0289b40d0e..e804a43aa5 100644
--- a/fpicker/source/win32/filepicker/FPentry.cxx
+++ b/fpicker/source/win32/filepicker/FPentry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -112,7 +113,7 @@ void* SAL_CALL component_getFactory(
if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
{
Sequence< OUString > aSNS( 1 );
- aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME );
+ aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME ));
Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
@@ -130,3 +131,5 @@ void* SAL_CALL component_getFactory(
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.cxx b/fpicker/source/win32/filepicker/FileOpenDlg.cxx
index 46b738f28d..ffd9fa3324 100644
--- a/fpicker/source/win32/filepicker/FileOpenDlg.cxx
+++ b/fpicker/source/win32/filepicker/FileOpenDlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,6 +26,8 @@
*
************************************************************************/
+#define _WIN32_WINNT 0x0500
+
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
@@ -557,8 +560,8 @@ void SAL_CALL CFileOpenDialog::handleInitDialog(HWND hwndDlg, HWND hwndChild)
//
//------------------------------------------------------------------------
-unsigned int CALLBACK CFileOpenDialog::ofnHookProc(
- HWND hChildDlg, unsigned int uiMsg, WPARAM wParam, LPARAM lParam)
+UINT_PTR CALLBACK CFileOpenDialog::ofnHookProc(
+ HWND hChildDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
HWND hwndDlg = GetParent(hChildDlg);
CFileOpenDialog* pImpl = NULL;
@@ -574,10 +577,10 @@ unsigned int CALLBACK CFileOpenDialog::ofnHookProc(
// subclass the base dialog for WM_NCDESTROY processing
pImpl->m_pfnBaseDlgProc =
reinterpret_cast<WNDPROC>(
- SetWindowLong(
- hwndDlg,
- GWL_WNDPROC,
- reinterpret_cast<LONG>(CFileOpenDialog::BaseDlgProc)));
+ SetWindowLongPtr(
+ hwndDlg,
+ GWLP_WNDPROC,
+ reinterpret_cast<LONG_PTR>(CFileOpenDialog::BaseDlgProc)));
// connect the instance handle to the window
SetProp(hwndDlg, CURRENT_INSTANCE, pImpl);
pImpl->handleInitDialog(hwndDlg, hChildDlg);
@@ -618,8 +621,8 @@ LRESULT CALLBACK CFileOpenDialog::BaseDlgProc(
pImpl = reinterpret_cast<CFileOpenDialog*>(
RemoveProp(hWnd,CURRENT_INSTANCE));
- SetWindowLong(hWnd, GWL_WNDPROC,
- reinterpret_cast<LONG>(pImpl->m_pfnBaseDlgProc));
+ SetWindowLongPtr(hWnd, GWLP_WNDPROC,
+ reinterpret_cast<LONG_PTR>(pImpl->m_pfnBaseDlgProc));
}
else
{
@@ -693,3 +696,5 @@ void SAL_CALL CFileOpenDialog::centerPositionToParent() const
NULL, x, y, 0, 0,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.hxx b/fpicker/source/win32/filepicker/FileOpenDlg.hxx
index 29083d46d4..4ad6776151 100644
--- a/fpicker/source/win32/filepicker/FileOpenDlg.hxx
+++ b/fpicker/source/win32/filepicker/FileOpenDlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <sal/types.h>
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring>
-#endif
+#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include "platform_xp.h"
@@ -213,10 +212,10 @@ public:
// the method returns:
// 0 - when the dialog was canceled by the user
// 1 - when the dialog was closed with ok
- // -1 - when an error occured
+ // -1 - when an error occurred
sal_Int16 SAL_CALL doModal();
- // returns the last dialog error that occured
+ // returns the last dialog error that occurred
sal_uInt32 SAL_CALL getLastDialogError() const;
// retrievs the currently selected file
@@ -304,9 +303,9 @@ private:
WNDPROC m_pfnBaseDlgProc;
// callback function
- static unsigned int CALLBACK ofnHookProc(
+ static UINT_PTR CALLBACK ofnHookProc(
HWND hChildDlg, // handle to child dialog box
- unsigned int uiMsg, // message identifier
+ UINT uiMsg, // message identifier
WPARAM wParam, // message parameter
LPARAM lParam // message parameter
);
@@ -325,3 +324,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx
index 67b2124e67..04b5e7388e 100644
--- a/fpicker/source/win32/filepicker/FilePicker.cxx
+++ b/fpicker/source/win32/filepicker/FilePicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <cppuhelper/interfacecontainer.h>
#include <osl/diagnose.h>
-#ifndef _FILEPICKER_HXX_
#include "filepicker.hxx"
-#endif
#include "WinFileOpenImpl.hxx"
#include "FPServiceInfo.hxx"
@@ -77,8 +76,8 @@ namespace
uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
{
uno::Sequence<rtl::OUString> aRet(2);
- aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
- aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
+ aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker"));
+ aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker"));
return aRet;
}
}
@@ -124,7 +123,7 @@ void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePicke
{
if ( rBHelper.bDisposed )
throw lang::DisposedException(
- rtl::OUString::createFromAscii( "object is already disposed" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "object is already disposed" )),
static_cast< XFilePicker2* >( this ) );
if ( !rBHelper.bInDispose && !rBHelper.bDisposed )
@@ -140,7 +139,7 @@ void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePi
{
if ( rBHelper.bDisposed )
throw lang::DisposedException(
- rtl::OUString::createFromAscii( "object is already disposed" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "object is already disposed" )),
static_cast< XFilePicker2* >( this ) );
rBHelper.aLC.removeInterface( getCppuType( &xListener ), xListener );
@@ -463,7 +462,7 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException)
OSL_ENSURE(sal_False, "Could not start event notifier thread!");
throw uno::RuntimeException(
- rtl::OUString::createFromAscii("Error executing dialog"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Error executing dialog")),
static_cast<XFilePicker2*>(this));
}
@@ -631,7 +630,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
uno::Any aAny;
if ( 0 == aArguments.getLength( ) )
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "no arguments" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )),
static_cast<XFilePicker2*>(this), 1);
aAny = aArguments[0];
@@ -639,7 +638,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
if ( (aAny.getValueType() != ::getCppuType((sal_Int16*)0)) &&
(aAny.getValueType() != ::getCppuType((sal_Int8*)0)) )
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii("invalid argument type"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid argument type")),
static_cast<XFilePicker2*>(this), 1);
sal_Int16 templateId = -1;
@@ -729,7 +728,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
default:
throw lang::IllegalArgumentException(
- rtl::OUString::createFromAscii( "Unknown template" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )),
static_cast< XFilePicker2* >( this ),
1 );
}
@@ -769,7 +768,7 @@ void SAL_CALL CFilePicker::cancel()
rtl::OUString SAL_CALL CFilePicker::getImplementationName()
throw(uno::RuntimeException)
{
- return rtl::OUString::createFromAscii(FILE_PICKER_IMPL_NAME);
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_IMPL_NAME));
}
// -------------------------------------------------
@@ -797,3 +796,5 @@ uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getSupportedServiceNames()
{
return FilePicker_getSupportedServiceNames();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FilePicker.hxx b/fpicker/source/win32/filepicker/FilePicker.hxx
index fc629208ca..6d17d3a478 100644
--- a/fpicker/source/win32/filepicker/FilePicker.hxx
+++ b/fpicker/source/win32/filepicker/FilePicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -253,3 +254,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx
index 7404db33df..2c609c4f94 100644
--- a/fpicker/source/win32/filepicker/FilterContainer.cxx
+++ b/fpicker/source/win32/filepicker/FilterContainer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -335,3 +336,4 @@ rtl::OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer )
return winFilterBuff;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/FilterContainer.hxx b/fpicker/source/win32/filepicker/FilterContainer.hxx
index d875b7735c..44e0e15a13 100644
--- a/fpicker/source/win32/filepicker/FilterContainer.hxx
+++ b/fpicker/source/win32/filepicker/FilterContainer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -113,3 +114,5 @@ private:
rtl::OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx b/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx
index 97239428ff..9eb8ee7794 100644
--- a/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx
+++ b/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,3 +74,5 @@ class IVistaFilePickerInternalNotify
#undef css
#endif FPICKER_WIN32_VISTA_FILEPICKER_INTERNALNOTIFY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.cxx b/fpicker/source/win32/filepicker/PreviewCtrl.cxx
index 63758d1cfe..59ce99693f 100644
--- a/fpicker/source/win32/filepicker/PreviewCtrl.cxx
+++ b/fpicker/source/win32/filepicker/PreviewCtrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -418,7 +419,7 @@ sal_Bool SAL_CALL CFilePreview::show( sal_Bool bShow )
// if the preview is shown and enabled
// preview of the given file will be shown
// returns true on success or false if an error
-// occured (the file in not there or not accessible etc.)
+// occurred (the file in not there or not accessible etc.)
//---------------------------------------------------
sal_Bool SAL_CALL CFilePreview::update( const rtl::OUString& aFileName )
@@ -613,3 +614,4 @@ LRESULT CALLBACK CFilePreview::WndProc(
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.hxx b/fpicker/source/win32/filepicker/PreviewCtrl.hxx
index 604269f3b4..818a78b711 100644
--- a/fpicker/source/win32/filepicker/PreviewCtrl.hxx
+++ b/fpicker/source/win32/filepicker/PreviewCtrl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -151,7 +152,7 @@ public:
// if the preview is shown and enabled
// preview of the given file will be shown
// returns true on success or false if an error
- // occured (the file in not there or not accessible etc.)
+ // occurred (the file in not there or not accessible etc.)
virtual sal_Bool SAL_CALL update( const rtl::OUString& aFileName );
protected:
@@ -197,3 +198,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index b6cff99fde..ce38abf435 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,8 +92,8 @@ namespace
css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker_getSupportedServiceNames()
{
css::uno::Sequence< ::rtl::OUString > aRet(2);
- aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
- aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
+ aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker"));
+ aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker"));
return aRet;
}
}
@@ -551,17 +552,9 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An
throw(css::uno::Exception ,
css::uno::RuntimeException)
{
- /*
- // called twice ?
- if (m_pDlg)
- throw css::uno::Exception(
- ::rtl::OUString::createFromAscii( "XInitialization::initialize() called twice." ),
- static_cast< css::ui::dialogs::XFilePicker* >( this ));
- */
-
if (lArguments.getLength() < 1)
throw css::lang::IllegalArgumentException(
- ::rtl::OUString::createFromAscii( "XInitialization::initialize() called without arguments." ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "XInitialization::initialize() called without arguments." )),
static_cast< css::ui::dialogs::XFilePicker2* >( this ),
1);
@@ -691,7 +684,7 @@ void SAL_CALL VistaFilePicker::cancel()
::rtl::OUString SAL_CALL VistaFilePicker::getImplementationName()
throw(css::uno::RuntimeException)
{
- return ::rtl::OUString::createFromAscii("com.sun.star.comp.fpicker.VistaFileDialog");
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.fpicker.VistaFileDialog"));
}
// -------------------------------------------------
@@ -723,3 +716,5 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSupportedServ
} // namespace vista
} // namespace win32
} // namespace fpicker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
index 9de046dad4..09380c1905 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -313,3 +314,5 @@ public:
#undef css
#endif // FPICKER_WIN32_VISTA_FILEPICKER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
index 5be3abd798..14cefe36f7 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_fpicker.hxx"
-//------------------------------------------------------------------------
-// includes
-//------------------------------------------------------------------------
-
#include "VistaFilePickerEventHandler.hxx"
#include "asyncrequests.hxx"
@@ -44,8 +41,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
-//#include <tools/urlobj.hxx>
-//#include <unotools/ucbhelper.hxx>
#include <osl/file.hxx>
@@ -169,7 +164,7 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*
//-----------------------------------------------------------------------------------------
void lcl_updateVersionListDirectly(IFileDialog* pDialog)
{
- static const ::rtl::OUString SERVICENAME_REVISIONPERSISTENCE = ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentRevisionListPersistence");
+ static const ::rtl::OUString SERVICENAME_REVISIONPERSISTENCE(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence"));
static const ::sal_Int16 CONTROL_VERSIONLIST = css::ui::dialogs::ExtendedFilePickerElementIds::LISTBOX_VERSION;
TFileDialog iDialog (pDialog);
@@ -410,8 +405,8 @@ void VistaFilePickerEventHandler::stopListening()
}
}
-static const ::rtl::OUString PROP_CONTROL_ID = ::rtl::OUString::createFromAscii("control_id");
-static const ::rtl::OUString PROP_PICKER_LISTENER = ::rtl::OUString::createFromAscii("picker_listener");
+static const ::rtl::OUString PROP_CONTROL_ID(RTL_CONSTASCII_USTRINGPARAM("control_id"));
+static const ::rtl::OUString PROP_PICKER_LISTENER(RTL_CONSTASCII_USTRINGPARAM("picker_listener"));
//-----------------------------------------------------------------------------------------
class AsyncPickerEvents : public RequestHandler
@@ -505,3 +500,5 @@ void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType,
} // namespace vista
} // namespace win32
} // namespace fpicker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx
index de79949092..de9983d0cf 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -223,3 +224,5 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex
#undef css
#endif // FPICKER_WIN32_VISTA_FILEPICKER_EVENTHANDLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 85ed7795b9..9f006d6925 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1210,3 +1211,5 @@ void VistaFilePickerImpl::onAutoExtensionChanged (bool bChecked)
} // namespace vista
} // namespace win32
} // namespace fpicker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
index 5fe5ac8445..823141d3b8 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -92,24 +93,24 @@ static const ::sal_Int32 FEATURE_PLAY = 256;
static const ::sal_Int32 FEATURE_READONLY = 512;
static const ::sal_Int32 FEATURE_VERSION = 1024;
-static const ::rtl::OUString PROP_PICKER_LISTENER = ::rtl::OUString::createFromAscii("picker_listener" ); // [XFilePickerListenert]
-static const ::rtl::OUString PROP_DIALOG_SHOW_RESULT = ::rtl::OUString::createFromAscii("dialog_show_result" ); // [sal_Bool] true=OK, false=CANCEL
-static const ::rtl::OUString PROP_SELECTED_FILES = ::rtl::OUString::createFromAscii("selected_files" ); // [seq< OUString >] contains all user selected files (can be empty!)
-static const ::rtl::OUString PROP_MULTISELECTION_MODE = ::rtl::OUString::createFromAscii("multiselection_mode"); // [sal_Bool] true=ON, false=OFF
-static const ::rtl::OUString PROP_TITLE = ::rtl::OUString::createFromAscii("title" ); // [OUString]
-static const ::rtl::OUString PROP_FILENAME = ::rtl::OUString::createFromAscii("filename" ); // [OUString]
-static const ::rtl::OUString PROP_DIRECTORY = ::rtl::OUString::createFromAscii("directory" ); // [OUString]
-static const ::rtl::OUString PROP_FEATURES = ::rtl::OUString::createFromAscii("features" ); // [sal_Int32]
-static const ::rtl::OUString PROP_TEMPLATE_DESCR = ::rtl::OUString::createFromAscii("templatedescription"); // [sal_Int32]
-static const ::rtl::OUString PROP_FILTER_TITLE = ::rtl::OUString::createFromAscii("filter_title" ); // [OUString]
-static const ::rtl::OUString PROP_FILTER_VALUE = ::rtl::OUString::createFromAscii("filter_value" ); // [OUString]
-static const ::rtl::OUString PROP_FORCE = ::rtl::OUString::createFromAscii("force" ); // [sal_Bool]
+static const ::rtl::OUString PROP_PICKER_LISTENER(RTL_CONSTASCII_USTRINGPARAM("picker_listener" ) ); // [XFilePickerListenert]
+static const ::rtl::OUString PROP_DIALOG_SHOW_RESULT(RTL_CONSTASCII_USTRINGPARAM("dialog_show_result" )); // [sal_Bool] true=OK, false=CANCEL
+static const ::rtl::OUString PROP_SELECTED_FILES(RTL_CONSTASCII_USTRINGPARAM("selected_files" )); // [seq< OUString >] contains all user selected files (can be empty!)
+static const ::rtl::OUString PROP_MULTISELECTION_MODE(RTL_CONSTASCII_USTRINGPARAM("multiselection_mode")); // [sal_Bool] true=ON, false=OFF
+static const ::rtl::OUString PROP_TITLE(RTL_CONSTASCII_USTRINGPARAM("title" )); // [OUString]
+static const ::rtl::OUString PROP_FILENAME(RTL_CONSTASCII_USTRINGPARAM("filename" ) ); // [OUString]
+static const ::rtl::OUString PROP_DIRECTORY(RTL_CONSTASCII_USTRINGPARAM("directory" )); // [OUString]
+static const ::rtl::OUString PROP_FEATURES(RTL_CONSTASCII_USTRINGPARAM("features" )); // [sal_Int32]
+static const ::rtl::OUString PROP_TEMPLATE_DESCR(RTL_CONSTASCII_USTRINGPARAM("templatedescription")); // [sal_Int32]
+static const ::rtl::OUString PROP_FILTER_TITLE(RTL_CONSTASCII_USTRINGPARAM("filter_title" )); // [OUString]
+static const ::rtl::OUString PROP_FILTER_VALUE(RTL_CONSTASCII_USTRINGPARAM("filter_value" )); // [OUString]
+static const ::rtl::OUString PROP_FORCE(RTL_CONSTASCII_USTRINGPARAM("force" )); // [sal_Bool]
-static const ::rtl::OUString PROP_CONTROL_ID = ::rtl::OUString::createFromAscii("control_id" ); // [sal_Int16]
-static const ::rtl::OUString PROP_CONTROL_ACTION = ::rtl::OUString::createFromAscii("control_action" ); // [sal_Int16]
-static const ::rtl::OUString PROP_CONTROL_VALUE = ::rtl::OUString::createFromAscii("control_value" ); // [Any]
-static const ::rtl::OUString PROP_CONTROL_LABEL = ::rtl::OUString::createFromAscii("control_label" ); // [OUString]
-static const ::rtl::OUString PROP_CONTROL_ENABLE = ::rtl::OUString::createFromAscii("control_enable" ); // [sal_Bool] true=ON, false=OFF
+static const ::rtl::OUString PROP_CONTROL_ID(RTL_CONSTASCII_USTRINGPARAM("control_id" )); // [sal_Int16]
+static const ::rtl::OUString PROP_CONTROL_ACTION(RTL_CONSTASCII_USTRINGPARAM("control_action" )); // [sal_Int16]
+static const ::rtl::OUString PROP_CONTROL_VALUE(RTL_CONSTASCII_USTRINGPARAM("control_value" )); // [Any]
+static const ::rtl::OUString PROP_CONTROL_LABEL(RTL_CONSTASCII_USTRINGPARAM("control_label" )); // [OUString]
+static const ::rtl::OUString PROP_CONTROL_ENABLE(RTL_CONSTASCII_USTRINGPARAM("control_enable" )); // [sal_Bool] true=ON, false=OFF
//-----------------------------------------------------------------------------
/** native implementation of the file picker on Vista and upcoming windows versions.
@@ -351,3 +352,5 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex
#undef css
#endif // FPICKER_WIN32_VISTA_FILEPICKERIMPL_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
index 71e441904a..8e31612595 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,9 +45,7 @@
#include <com/sun/star/ui/dialogs/ListBoxControlActions.hpp>
#include "..\misc\WinImplHelper.hxx"
-#ifndef _FILEPICKER_HXX_
#include "filepicker.hxx"
-#endif
#include "controlaccess.hxx"
#include <rtl/ustrbuf.hxx>
#include <rtl/string.hxx>
@@ -135,7 +134,7 @@ void CWinFileOpenImpl::setDisplayDirectory(const rtl::OUString& aDirectory)
if ( ::osl::FileBase::E_None !=
::osl::FileBase::getSystemPathFromFileURL(aDirectory,aSysDirectory))
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("Invalid directory"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid directory")),
static_cast<XFilePicker2*>(m_FilePicker), 1);
// we ensure that there is a trailing '/' at the end of
@@ -206,7 +205,7 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException)
rc = ::com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
else
throw uno::RuntimeException(
- rtl::OUString::createFromAscii("Error executing dialog"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Error executing dialog")),
static_cast<XFilePicker2*>(m_FilePicker));
return rc;
@@ -225,7 +224,7 @@ void SAL_CALL CWinFileOpenImpl::appendFilter(const rtl::OUString& aTitle, const
if (!bRet)
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("filter already exists"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("filter already exists")),
static_cast<XFilePicker2*>(m_FilePicker), 1);
// #95345# see MSDN OPENFILENAME
@@ -250,7 +249,7 @@ void SAL_CALL CWinFileOpenImpl::setCurrentFilter(const rtl::OUString& aTitle)
if (filterPos < 0)
throw IllegalArgumentException(
- rtl::OUString::createFromAscii("filter doesn't exist"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("filter doesn't exist")),
static_cast<XFilePicker2*>(m_FilePicker), 1);
// filter index of the base class starts with 1
@@ -534,8 +533,8 @@ LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc(
case WM_NCDESTROY:
// restore the old window proc
- SetWindowLong(hWnd, GWL_WNDPROC,
- reinterpret_cast<LONG>(pImpl->m_pfnOldDlgProc));
+ SetWindowLongPtr(hWnd, GWLP_WNDPROC,
+ reinterpret_cast<LONG_PTR>(pImpl->m_pfnOldDlgProc));
lResult = CallWindowProc(
reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc),
@@ -886,8 +885,8 @@ void SAL_CALL CWinFileOpenImpl::onInitDialog(HWND hwndDlg)
// subclass the dialog window
m_pfnOldDlgProc =
reinterpret_cast<WNDPROC>(
- SetWindowLong( hwndDlg, GWL_WNDPROC,
- reinterpret_cast<LONG>(SubClassFunc)));
+ SetWindowLongPtr( hwndDlg, GWLP_WNDPROC,
+ reinterpret_cast<LONG_PTR>(SubClassFunc)));
}
//-----------------------------------------------------------------------------------------
@@ -994,3 +993,5 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName()
m_bInitialSelChanged = sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx
index 6239b52dc7..379a2dd496 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
// includes
//------------------------------------------------------------------------
-#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXTENDEDFILEPICKER_HPP_
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
-#endif
#include <com/sun/star/ui/dialogs/FilePickerEvent.hpp>
#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
#include "FilterContainer.hxx"
@@ -232,3 +231,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/afxres.h b/fpicker/source/win32/filepicker/afxres.h
index 0961c334dd..61f5ab91ce 100644
--- a/fpicker/source/win32/filepicker/afxres.h
+++ b/fpicker/source/win32/filepicker/afxres.h
@@ -1,2 +1,5 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <windows.h>
#include <dlgs.h>
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx
index a6a4bf4b11..3f1f6eb30a 100644
--- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx
+++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -93,12 +94,12 @@ void SAL_CALL CAsyncEventNotifier::addListener(const uno::Type&
{
if ( m_rBroadcastHelper.bDisposed )
throw lang::DisposedException(
- ::rtl::OUString::createFromAscii( "FilePicker is already disposed" ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilePicker is already disposed" )),
uno::Reference< uno::XInterface >() );
if ( m_rBroadcastHelper.bInDispose )
throw lang::DisposedException(
- ::rtl::OUString::createFromAscii( "FilePicker will be disposed now." ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilePicker will be disposed now." )),
uno::Reference< uno::XInterface >() );
m_rBroadcastHelper.aLC.addInterface( aType, xListener );
@@ -113,7 +114,7 @@ void SAL_CALL CAsyncEventNotifier::removeListener(const uno::Type&
{
if ( m_rBroadcastHelper.bDisposed )
throw lang::DisposedException(
- ::rtl::OUString::createFromAscii( "FilePicker is already disposed." ),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilePicker is already disposed." )),
uno::Reference< uno::XInterface >() );
m_rBroadcastHelper.aLC.removeInterface( aType, xListener );
@@ -325,3 +326,5 @@ unsigned int WINAPI CAsyncEventNotifier::ThreadProc(LPVOID pParam)
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.hxx b/fpicker/source/win32/filepicker/asynceventnotifier.hxx
index 53861a7751..fa50a03e82 100644
--- a/fpicker/source/win32/filepicker/asynceventnotifier.hxx
+++ b/fpicker/source/win32/filepicker/asynceventnotifier.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107,3 +108,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx
index 8c4e170271..ed197cd9b4 100644
--- a/fpicker/source/win32/filepicker/asyncrequests.cxx
+++ b/fpicker/source/win32/filepicker/asyncrequests.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,7 @@
#include "asyncrequests.hxx"
#include <vcl/svapp.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
//-----------------------------------------------------------------------------
// namespace
@@ -66,7 +67,7 @@ void Request::wait(::sal_Int32 nMilliSeconds)
void Request::waitProcessMessages()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
while (!m_aJoiner.check())
Application::Yield();
}
@@ -226,3 +227,5 @@ void SAL_CALL AsyncRequests::run()
} // namespace vista
} // namespace win32
} // namespace fpicker
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/asyncrequests.hxx b/fpicker/source/win32/filepicker/asyncrequests.hxx
index 123fec7732..6075a247d0 100644
--- a/fpicker/source/win32/filepicker/asyncrequests.hxx
+++ b/fpicker/source/win32/filepicker/asyncrequests.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -225,3 +226,5 @@ class AsyncRequests : private ::cppu::BaseMutex
#undef css
#endif // FPICKER_WIN32_VISTA_ASYNCREQUESTS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/comptr.hxx b/fpicker/source/win32/filepicker/comptr.hxx
index 3ae33e995e..ee4b1b5538 100644
--- a/fpicker/source/win32/filepicker/comptr.hxx
+++ b/fpicker/source/win32/filepicker/comptr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -220,3 +221,5 @@ class ComPtr
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/controlaccess.cxx b/fpicker/source/win32/filepicker/controlaccess.cxx
index df595fbf51..b21fa64e55 100644
--- a/fpicker/source/win32/filepicker/controlaccess.cxx
+++ b/fpicker/source/win32/filepicker/controlaccess.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
//------------------------------------------------------------------------
#include <tchar.h>
+#include <sal/macros.h>
#include <osl/diagnose.h>
#include "controlaccess.hxx"
#include "..\misc\WinImplHelper.hxx"
@@ -62,14 +64,14 @@ namespace // private
CheckboxSetState
};
const size_t SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE =
- sizeof( CheckboxSetValueFunctionTable ) / sizeof( CTRL_SETVALUE_FUNCTION_T );
+ SAL_N_ELEMENTS( CheckboxSetValueFunctionTable );
CTRL_GETVALUE_FUNCTION_T CheckboxGetValueFunctionTable[] =
{
CheckboxGetState
};
const size_t SIZE_CHECKBOX_GETVALUE_FUNCTION_TABLE =
- sizeof( CheckboxGetValueFunctionTable ) / sizeof( CTRL_GETVALUE_FUNCTION_T );
+ SAL_N_ELEMENTS( CheckboxGetValueFunctionTable );
CTRL_SETVALUE_FUNCTION_T ListboxSetValueFunctionTable[] =
{
@@ -81,7 +83,7 @@ namespace // private
ListboxSetSelectedItem
};
const size_t SIZE_LISTBOX_SETVALUE_FUNCTION_TABLE =
- sizeof( ListboxSetValueFunctionTable ) / sizeof( CTRL_SETVALUE_FUNCTION_T );
+ SAL_N_ELEMENTS( ListboxSetValueFunctionTable );
CTRL_GETVALUE_FUNCTION_T ListboxGetValueFunctionTable[] =
{
@@ -96,7 +98,7 @@ namespace // private
ListboxGetSelectedItemIndex
};
const size_t SIZE_LISTBOX_GETVALUE_ACTION_TABLE =
- sizeof( ListboxGetValueFunctionTable ) / sizeof( CTRL_GETVALUE_FUNCTION_T );
+ SAL_N_ELEMENTS( ListboxGetValueFunctionTable );
struct _ENTRY
{
@@ -183,8 +185,7 @@ namespace // private
stc2, // LISTBOX_FILTER_LABEL
stc3 // LISTBOX_FILE_NAME_LABEL
};
- const int SIZE_WINDOWS_FILEOPEN_CTRL_IDS =
- sizeof(WindowsFileOpenCtrlIds)/sizeof(WindowsFileOpenCtrlIds[0]);
+ const int SIZE_WINDOWS_FILEOPEN_CTRL_IDS = SAL_N_ELEMENTS(WindowsFileOpenCtrlIds);
}; // end namespace
@@ -225,9 +226,10 @@ CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass
CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl )
{
CTRL_CLASS aCtrlClass = UNKNOWN;
- TCHAR aClassName[256];
+ const size_t nClassNameSize = 256;
+ TCHAR aClassName[nClassNameSize];
- int nRet = GetClassName(hwndCtrl,aClassName,(sizeof(aClassName)/sizeof(TCHAR)));
+ int nRet = GetClassName(hwndCtrl,aClassName,nClassNameSize);
if (nRet)
{
if (0 == _tcsicmp(aClassName,TEXT("button")))
@@ -259,3 +261,5 @@ int SAL_CALL CommonFilePickerCtrlIdToWinFileOpenCtrlId( sal_Int16 aControlId )
return WindowsFileOpenCtrlIds[aControlId];
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/controlaccess.hxx b/fpicker/source/win32/filepicker/controlaccess.hxx
index 1bfa5a1bd5..5731297eb4 100644
--- a/fpicker/source/win32/filepicker/controlaccess.hxx
+++ b/fpicker/source/win32/filepicker/controlaccess.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,3 +79,5 @@ CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass
int SAL_CALL CommonFilePickerCtrlIdToWinFileOpenCtrlId( sal_Int16 aControlId );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/controlcommand.cxx b/fpicker/source/win32/filepicker/controlcommand.cxx
index e34bc8beae..77385fe5fa 100644
--- a/fpicker/source/win32/filepicker/controlcommand.cxx
+++ b/fpicker/source/win32/filepicker/controlcommand.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -280,3 +281,5 @@ void SAL_CALL CEnableControlCommand::exec( CFilePickerState* aFilePickerState )
aFilePickerState->enableControl( getControlId( ), m_bEnable );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/controlcommand.hxx b/fpicker/source/win32/filepicker/controlcommand.hxx
index cf806283ab..362aa78f81 100644
--- a/fpicker/source/win32/filepicker/controlcommand.hxx
+++ b/fpicker/source/win32/filepicker/controlcommand.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,3 +142,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/controlcommandrequest.hxx b/fpicker/source/win32/filepicker/controlcommandrequest.hxx
index db96e70ce8..6f7a94704c 100644
--- a/fpicker/source/win32/filepicker/controlcommandrequest.hxx
+++ b/fpicker/source/win32/filepicker/controlcommandrequest.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/controlcommandresult.hxx b/fpicker/source/win32/filepicker/controlcommandresult.hxx
index 84fb9215e8..ed601218ad 100644
--- a/fpicker/source/win32/filepicker/controlcommandresult.hxx
+++ b/fpicker/source/win32/filepicker/controlcommandresult.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -106,3 +107,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/customcontrol.cxx b/fpicker/source/win32/filepicker/customcontrol.cxx
index 9a817af71e..7a5e20793c 100644
--- a/fpicker/source/win32/filepicker/customcontrol.cxx
+++ b/fpicker/source/win32/filepicker/customcontrol.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,3 +66,4 @@ void SAL_CALL CCustomControl::RemoveAllControls()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/customcontrol.hxx b/fpicker/source/win32/filepicker/customcontrol.hxx
index d74a41323d..6d961147e6 100644
--- a/fpicker/source/win32/filepicker/customcontrol.hxx
+++ b/fpicker/source/win32/filepicker/customcontrol.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,3 +59,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
index e91c74300d..00bcbddb14 100644
--- a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
+++ b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,3 +142,5 @@ void SAL_CALL CCustomControlContainer::RemoveAllControls()
m_ControlContainer.clear();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.hxx b/fpicker/source/win32/filepicker/customcontrolcontainer.hxx
index 0fad562022..6dcc9d486d 100644
--- a/fpicker/source/win32/filepicker/customcontrolcontainer.hxx
+++ b/fpicker/source/win32/filepicker/customcontrolcontainer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,3 +59,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/customcontrolfactory.cxx b/fpicker/source/win32/filepicker/customcontrolfactory.cxx
index 4ff1bb915b..5332fe4087 100644
--- a/fpicker/source/win32/filepicker/customcontrolfactory.cxx
+++ b/fpicker/source/win32/filepicker/customcontrolfactory.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -84,3 +85,5 @@ CCustomControl* CCustomControlFactory::CreateCustomControlContainer()
{
return new CCustomControlContainer();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/customcontrolfactory.hxx b/fpicker/source/win32/filepicker/customcontrolfactory.hxx
index 30e2eb27b3..de5961e6fc 100644
--- a/fpicker/source/win32/filepicker/customcontrolfactory.hxx
+++ b/fpicker/source/win32/filepicker/customcontrolfactory.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx
index 569f53fb3b..afe673c77a 100644
--- a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx
+++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -193,3 +194,5 @@ void SAL_CALL CCheckboxCustomControl::Align()
{
AlignToBuddy(GetDlgItem(m_ParentHandle,cmb1));
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx
index 1bdef8c21e..d3b62867c9 100644
--- a/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx
+++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx
index 7be071f628..ede628d2b6 100644
--- a/fpicker/source/win32/filepicker/dibpreview.cxx
+++ b/fpicker/source/win32/filepicker/dibpreview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,13 +37,9 @@
#include "dibpreview.hxx"
#include <osl/diagnose.h>
-#ifndef _COM_SUN_STAR_UI_DIALOG_FILEPREVIEWIMAGEFORMATS_HPP_
#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
-#endif
-#ifndef _USTRING_HXX_
#include <rtl/ustring.hxx>
-#endif
#include <stdexcept>
#include <string>
@@ -470,3 +467,5 @@ void SAL_CALL CDIBPreview::UnregisterDibPreviewWindowClass()
s_ClassAtom = 0;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/dibpreview.hxx b/fpicker/source/win32/filepicker/dibpreview.hxx
index 6f079ebfac..0cf568b66e 100644
--- a/fpicker/source/win32/filepicker/dibpreview.hxx
+++ b/fpicker/source/win32/filepicker/dibpreview.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/eventnotification.hxx b/fpicker/source/win32/filepicker/eventnotification.hxx
index e09917bd24..f0cefd6794 100644
--- a/fpicker/source/win32/filepicker/eventnotification.hxx
+++ b/fpicker/source/win32/filepicker/eventnotification.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef _EVENTNOTIFICATION_HXX_
#define _EVENTNOTIFICATION_HXX_
-#ifndef _COM_SUN_STAR_UNO_XINTEFACE_HPP_
#include <com/sun/star/uno/XInterface.hpp>
-#endif
#include <com/sun/star/uno/Reference.hxx>
//-----------------------------------
@@ -51,3 +50,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/filepickereventnotification.cxx b/fpicker/source/win32/filepicker/filepickereventnotification.cxx
index 1243d0fb4b..e79bc9b2f9 100644
--- a/fpicker/source/win32/filepicker/filepickereventnotification.cxx
+++ b/fpicker/source/win32/filepicker/filepickereventnotification.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -82,3 +83,5 @@ void SAL_CALL CFilePickerParamEventNotification::notifyEventListener( Reference<
if (xFilePickerListener.is())
(xFilePickerListener.get()->*m_EventListenerMethod)(m_FilePickerEvent);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/filepickereventnotification.hxx b/fpicker/source/win32/filepicker/filepickereventnotification.hxx
index e4bdcd02ec..d2230455c0 100644
--- a/fpicker/source/win32/filepicker/filepickereventnotification.hxx
+++ b/fpicker/source/win32/filepicker/filepickereventnotification.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/filepickerstate.cxx b/fpicker/source/win32/filepicker/filepickerstate.cxx
index ea8da8419f..1ec72dcec0 100644
--- a/fpicker/source/win32/filepicker/filepickerstate.cxx
+++ b/fpicker/source/win32/filepicker/filepickerstate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -715,3 +716,5 @@ HWND SAL_CALL CExecuteFilePickerState::GetHwndDlgItem( sal_Int16 aControlId, sal
return hwndCtrl;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/filepickerstate.hxx b/fpicker/source/win32/filepicker/filepickerstate.hxx
index d3722fa479..956082e4ac 100644
--- a/fpicker/source/win32/filepicker/filepickerstate.hxx
+++ b/fpicker/source/win32/filepicker/filepickerstate.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -160,3 +161,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx
index 189b9bc403..70977b6272 100644
--- a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx
+++ b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -294,3 +295,4 @@ int CGetFileNameWrapper::commDlgExtendedError( )
return m_ExtendedDialogError;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.hxx b/fpicker/source/win32/filepicker/getfilenamewrapper.hxx
index b370348310..9e7b4cfe8e 100644
--- a/fpicker/source/win32/filepicker/getfilenamewrapper.hxx
+++ b/fpicker/source/win32/filepicker/getfilenamewrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,3 +65,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/helppopupwindow.cxx b/fpicker/source/win32/filepicker/helppopupwindow.cxx
index 02a99c76d6..42c1ec1327 100644
--- a/fpicker/source/win32/filepicker/helppopupwindow.cxx
+++ b/fpicker/source/win32/filepicker/helppopupwindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -613,3 +614,5 @@ void SAL_CALL CHelpPopupWindow::UnregisterWindowClass( )
s_ClassAtom = 0;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/helppopupwindow.hxx b/fpicker/source/win32/filepicker/helppopupwindow.hxx
index aeb3e89261..ddb74e1f30 100644
--- a/fpicker/source/win32/filepicker/helppopupwindow.hxx
+++ b/fpicker/source/win32/filepicker/helppopupwindow.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -141,3 +142,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/platform_vista.h b/fpicker/source/win32/filepicker/platform_vista.h
index 3cb073e466..84479c2c9e 100644
--- a/fpicker/source/win32/filepicker/platform_vista.h
+++ b/fpicker/source/win32/filepicker/platform_vista.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,31 +48,6 @@
#pragma warning(pop)
#endif
-// ATL/WTL
-//#include <atlbase.h>
-//#include <atlstr.h>
-//#include <atlapp.h>
-//extern CAppModule _Module;
-//#include <atlcom.h>
-//#include <atlwin.h>
-//#include <atlframe.h>
-//#include <atlcrack.h>
-//#include <atlctrls.h>
-//#include <atlctrlx.h>
-//#include <atldlgs.h>
-//#include <atlmisc.h>
-
-/*
-// STL
-#include <vector>
-
-// Global functions
-LPCTSTR PrepFilterString ( CString& sFilters );
-bool PathFromShellItem ( IShellItem* pItem, CString& sPath );
-bool BuildFilterSpecList ( _U_STRINGorID szFilterList,
- std::vector<CString>& vecsFilterParts,
- std::vector<COMDLG_FILTERSPEC>& vecFilters );
-*/
#if defined _M_IX86
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
@@ -85,3 +61,4 @@ bool BuildFilterSpecList ( _U_STRINGorID szFilterList,
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/platform_xp.h b/fpicker/source/win32/filepicker/platform_xp.h
index 5d59ba6f7c..d6d8e650cb 100644
--- a/fpicker/source/win32/filepicker/platform_xp.h
+++ b/fpicker/source/win32/filepicker/platform_xp.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,3 +54,4 @@
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/previewadapter.cxx b/fpicker/source/win32/filepicker/previewadapter.cxx
index 6746a01d0d..b0f7effb8b 100644
--- a/fpicker/source/win32/filepicker/previewadapter.cxx
+++ b/fpicker/source/win32/filepicker/previewadapter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <tchar.h>
#include "previewadapter.hxx"
-#ifndef _COM_SUN_STAR_UI_DIALOG_FILEPREVIEWIMAGEFORMATS_HPP_
#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
-#endif
#include "dibpreview.hxx"
#include "../misc/WinImplHelper.hxx"
@@ -711,3 +710,5 @@ void SAL_CALL CPreviewAdapter::notifyParentWindowPosChanged()
{
m_pImpl->notifyParentWindowPosChanged();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/previewadapter.hxx b/fpicker/source/win32/filepicker/previewadapter.hxx
index e850ccd299..e10b2e5d31 100644
--- a/fpicker/source/win32/filepicker/previewadapter.hxx
+++ b/fpicker/source/win32/filepicker/previewadapter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -105,3 +106,5 @@ private:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/previewbase.cxx b/fpicker/source/win32/filepicker/previewbase.cxx
index 75892a83cc..54fe996316 100644
--- a/fpicker/source/win32/filepicker/previewbase.cxx
+++ b/fpicker/source/win32/filepicker/previewbase.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_fpicker.hxx"
#include "previewbase.hxx"
-#ifndef _COM_SUN_STAR_UI_DIALOG_FILEPREVIEWIMAGEFORMATS_HPP_
#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
-#endif
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -91,11 +90,11 @@ void SAL_CALL PreviewBase::setImage( sal_Int16 aImageFormat, const ::com::sun::s
{
if (aImageFormat != ::com::sun::star::ui::dialogs::FilePreviewImageFormats::BITMAP)
throw IllegalArgumentException(
- OUString::createFromAscii("unsupported image format"), 0, 1);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("unsupported image format")), 0, 1);
if (aImage.hasValue() && (aImage.getValueType() != getCppuType((Sequence<sal_Int8>*)0)))
throw IllegalArgumentException(
- OUString::createFromAscii("invalid image data"), 0, 2);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("invalid image data")), 0, 2);
// save the new image data and force a redraw
m_ImageData = aImage;
@@ -148,3 +147,5 @@ HWND SAL_CALL PreviewBase::getWindowHandle() const
{
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/previewbase.hxx b/fpicker/source/win32/filepicker/previewbase.hxx
index c91dae6c98..b05e3fb3bf 100644
--- a/fpicker/source/win32/filepicker/previewbase.hxx
+++ b/fpicker/source/win32/filepicker/previewbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,3 +87,5 @@ protected:
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/propmap.hxx b/fpicker/source/win32/filepicker/propmap.hxx
index 6bbeae9641..2eed6fce13 100644
--- a/fpicker/source/win32/filepicker/propmap.hxx
+++ b/fpicker/source/win32/filepicker/propmap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -99,3 +100,5 @@ class TPropMap
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/resource.h b/fpicker/source/win32/filepicker/resource.h
index 4a76c17963..3a3f56b5c7 100644
--- a/fpicker/source/win32/filepicker/resource.h
+++ b/fpicker/source/win32/filepicker/resource.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Fps.rc
@@ -19,3 +20,5 @@
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/shared.hxx b/fpicker/source/win32/filepicker/shared.hxx
index 74bed5dbbb..34e27b615c 100644
--- a/fpicker/source/win32/filepicker/shared.hxx
+++ b/fpicker/source/win32/filepicker/shared.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,10 @@
#include <rtl/ustring.hxx>
-const ::rtl::OUString BACKSLASH = ::rtl::OUString::createFromAscii( "\\" );
-const ::rtl::OUString FILTER_SEPARATOR = ::rtl::OUString::createFromAscii( "------------------------------------------" );
-const ::rtl::OUString ALL_FILES_WILDCARD = ::rtl::OUString::createFromAscii( "*.*" );
+const ::rtl::OUString BACKSLASH(RTL_CONSTASCII_USTRINGPARAM( "\\" ));
+const ::rtl::OUString FILTER_SEPARATOR(RTL_CONSTASCII_USTRINGPARAM( "------------------------------------------" ));
+const ::rtl::OUString ALL_FILES_WILDCARD(RTL_CONSTASCII_USTRINGPARAM( "*.*" ));
const ::sal_Bool ALLOW_DUPLICATES = sal_True;
-#endif \ No newline at end of file
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/vistatypes.h b/fpicker/source/win32/filepicker/vistatypes.h
index 1567cbf5f7..9237dbada2 100644
--- a/fpicker/source/win32/filepicker/vistatypes.h
+++ b/fpicker/source/win32/filepicker/vistatypes.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,5 @@ typedef ComPtr< IFileDialogCustomize, IID_IFileDialogCustomize
#undef css
#endif // FPICKER_WIN32_VISTA_TYPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
index 46be0c2d9a..15050061da 100644
--- a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
+++ b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,16 +43,14 @@
#include <cppuhelper/servicefactory.hxx>
#ifndef _RTL_USTRING_
-#include <rtl/ustring>
+#include <rtl/ustring.hxx>
#endif
#include <sal/types.h>
#include <osl/diagnose.h>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#ifndef _COM_SUN_STAR_UI_DIALOGS_FILEDIALOGRESULTS_HPP_
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#endif
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
@@ -99,7 +98,7 @@ void TestFilterManager( Reference< XFilePicker > xFilePicker );
Reference< XMultiServiceFactory > g_xFactory;
-const OUString BMP_EXTENSION = OUString::createFromAscii( "bmp" );
+const OUString BMP_EXTENSION(RTL_CONSTASCII_USTRINGPARAM( "bmp" ));
//-------------------------------------------------------------------------------------------------------------------------
// a test client
@@ -197,9 +196,8 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star::
}
}
}
- catch( IllegalArgumentException& ex )
+ catch( IllegalArgumentException& )
{
- ex = ex;
}
}
@@ -271,7 +269,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
- // Print a message if an error occured.
+ // Print a message if an error occurred.
if ( g_xFactory.is() == sal_False )
{
OSL_ENSURE(sal_False, "Can't create RegistryServiceFactory");
@@ -295,7 +293,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
Reference< XFilePicker > xFilePicker = Reference< XFilePicker >(
g_xFactory->createInstanceWithArguments(
- OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ), arguments ), UNO_QUERY );
+ OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME )), arguments ), UNO_QUERY );
// install a FilePicker notifier
Reference< XFilePickerListener > xFPListener(
@@ -305,9 +303,9 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
if ( xFPNotifier.is( ) )
xFPNotifier->addFilePickerListener( xFPListener );
- xFilePicker->setTitle( OUString::createFromAscii("FileOpen Simple..."));
+ xFilePicker->setTitle( OUString(RTL_CONSTASCII_USTRINGPARAM("FileOpen Simple...")));
xFilePicker->setMultiSelectionMode( sal_True );
- xFilePicker->setDefaultName( OUString::createFromAscii("d:\\test2.sxw"));
+ xFilePicker->setDefaultName( OUString(RTL_CONSTASCII_USTRINGPARAM("d:\\test2.sxw")));
OUString aDirURL;
OUString aSysPath = OStringToOUString( "d:\\ueaeoe", osl_getThreadTextEncoding( ) );
@@ -370,7 +368,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
// Cast factory to XComponent
Reference< XComponent > xComponent( g_xFactory, UNO_QUERY );
- // Print a message if an error occured.
+ // Print a message if an error occurred.
if ( xComponent.is() == sal_False )
{
OSL_ENSURE(sal_False, "Error shuting down");
@@ -385,3 +383,5 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/FOPServiceInfo.hxx b/fpicker/source/win32/folderpicker/FOPServiceInfo.hxx
index 203fc51931..0079e0331f 100644
--- a/fpicker/source/win32/folderpicker/FOPServiceInfo.hxx
+++ b/fpicker/source/win32/folderpicker/FOPServiceInfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@
#define FOLDER_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.Win32FolderPicker/UNO/SERVICES/com.sun.star.ui.dialogs.SystemFolderPicker"
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx
index 06e8a06810..cae36a0f70 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.cxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
//------------------------------------------------------------------------
#include <osl/diagnose.h>
-#ifndef _FOLDERPICKER_HXX_
#include "folderpicker.hxx"
-#endif
#include <com/sun/star/lang/DisposedException.hpp>
#include "WinFOPImpl.hxx"
@@ -72,7 +71,7 @@ namespace
Sequence< OUString > SAL_CALL FolderPicker_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFolderPicker");
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFolderPicker"));
return aRet;
}
}
@@ -167,7 +166,7 @@ sal_Int16 SAL_CALL CFolderPicker::execute( )
OUString SAL_CALL CFolderPicker::getImplementationName( )
throw( RuntimeException )
{
- return OUString::createFromAscii( FOLDERPICKER_IMPL_NAME );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( FOLDERPICKER_IMPL_NAME ));
}
// -------------------------------------------------
@@ -217,3 +216,4 @@ void SAL_CALL CFolderPicker::disposing()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.hxx b/fpicker/source/win32/folderpicker/FolderPicker.hxx
index c98c9ca4fa..3276af77d2 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.hxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,16 +37,12 @@
#include <osl/mutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
#include <com/sun/star/util/XCancellable.hpp>
#include <memory>
-#ifndef _FPIMPLBASE_HXX_
#include "WinFOPImpl.hxx"
-#endif
//----------------------------------------------------------
// class declaration
@@ -127,3 +124,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/FopEvtDisp.hxx b/fpicker/source/win32/folderpicker/FopEvtDisp.hxx
index 627da82b8d..edccfc7921 100644
--- a/fpicker/source/win32/folderpicker/FopEvtDisp.hxx
+++ b/fpicker/source/win32/folderpicker/FopEvtDisp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,3 +44,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/Fopentry.cxx b/fpicker/source/win32/folderpicker/Fopentry.cxx
index 9c9574f13f..9204cce0c5 100644
--- a/fpicker/source/win32/folderpicker/Fopentry.cxx
+++ b/fpicker/source/win32/folderpicker/Fopentry.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,13 +36,9 @@
#include <com/sun/star/container/XSet.hpp>
#include <osl/diagnose.h>
-#ifndef _FILEPICKER_HXX_
#include "folderpicker.hxx"
-#endif
-#ifndef _FPSERVICEINFO_HXX_
#include "FOPServiceInfo.hxx"
-#endif
#include "WinFOPImpl.hxx"
//-----------------------------------------------------------------------
@@ -117,3 +114,5 @@ void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* p
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx b/fpicker/source/win32/folderpicker/MtaFop.cxx
index 699403093b..db9662c428 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.cxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -837,3 +838,5 @@ void SAL_CALL CMtaFolderPicker::UnregisterStaRequestWindowClass( )
s_ClassAtom = 0;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/MtaFop.hxx b/fpicker/source/win32/folderpicker/MtaFop.hxx
index 815d4500c3..df7fd4dc50 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.hxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -189,3 +190,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/WinFOPImpl.cxx b/fpicker/source/win32/folderpicker/WinFOPImpl.cxx
index ab70810f40..ea8f35dcd5 100644
--- a/fpicker/source/win32/folderpicker/WinFOPImpl.cxx
+++ b/fpicker/source/win32/folderpicker/WinFOPImpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,15 +33,11 @@
// includes
//------------------------------------------------------------------------
-#ifndef _WINDIRBROWSEIMPL_HXX_
#include "WinFOPImpl.hxx"
-#endif
#include <osl/diagnose.h>
#include <com/sun/star/lang/EventObject.hpp>
-#ifndef _COM_SUN_STAR_UI_FILEDIALOGRESULTS_HPP_
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#endif
#include "FopEvtDisp.hxx"
#include <osl/file.hxx>
#include "FolderPicker.hxx"
@@ -61,7 +58,7 @@ using osl::FileBase;
//
//------------------------------------------------------------------------
-const OUString BACKSLASH = OUString::createFromAscii( "\\" );
+const OUString BACKSLASH(RTL_CONSTASCII_USTRINGPARAM( "\\" ));
//------------------------------------------------------------------------
// ctor
@@ -97,7 +94,7 @@ void SAL_CALL CWinFolderPickerImpl::setDisplayDirectory( const OUString& aDirect
if ( ::osl::FileBase::E_None != rc )
throw IllegalArgumentException(
- OUString::createFromAscii( "directory is not a valid file url" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "directory is not a valid file url" )),
static_cast< XFolderPicker* >( m_pFolderPicker ),
1 );
@@ -166,3 +163,5 @@ void CWinFolderPickerImpl::onSelChanged( const OUString& aNewPath )
{
setStatusText( aNewPath );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/WinFOPImpl.hxx b/fpicker/source/win32/folderpicker/WinFOPImpl.hxx
index b6082be55d..0dcf37b1ab 100644
--- a/fpicker/source/win32/folderpicker/WinFOPImpl.hxx
+++ b/fpicker/source/win32/folderpicker/WinFOPImpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,3 +82,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx b/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx
index 677eb4f696..9a8e6a5b37 100644
--- a/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx
+++ b/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,20 +48,14 @@
#include <sal/types.h>
#include <osl/diagnose.h>
-#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UI_FILEDIALOGRESULTS_HPP_
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#endif
#include <cppuhelper/implbase1.hxx>
#include <stdio.h>
-#ifndef _FPSERVICEINFO_HXX_
#include "..\FOPServiceInfo.hxx"
-#endif
#include <osl/file.hxx>
@@ -133,7 +128,7 @@ int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ )
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
- // Print a message if an error occured.
+ // Print a message if an error occurred.
if ( g_xFactory.is() == sal_False )
{
OSL_ENSURE(sal_False, "Can't create RegistryServiceFactory");
@@ -184,7 +179,7 @@ int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ )
// Cast factory to XComponent
Reference< XComponent > xComponent( g_xFactory, UNO_QUERY );
- // Print a message if an error occured.
+ // Print a message if an error occurred.
if ( xComponent.is() == sal_False )
{
OSL_ENSURE(sal_False, "Error shuting down");
@@ -201,3 +196,5 @@ int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ )
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/misc/AutoBuffer.cxx b/fpicker/source/win32/misc/AutoBuffer.cxx
index b043c09dd2..1199260447 100644
--- a/fpicker/source/win32/misc/AutoBuffer.cxx
+++ b/fpicker/source/win32/misc/AutoBuffer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -167,3 +168,5 @@ void SAL_CALL CAutoUnicodeBuffer::init( )
empty( );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/misc/AutoBuffer.hxx b/fpicker/source/win32/misc/AutoBuffer.hxx
index 568122146c..5af6e4c39f 100644
--- a/fpicker/source/win32/misc/AutoBuffer.hxx
+++ b/fpicker/source/win32/misc/AutoBuffer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx
index 5682479b29..cdcd45d523 100644
--- a/fpicker/source/win32/misc/WinImplHelper.cxx
+++ b/fpicker/source/win32/misc/WinImplHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,9 +54,9 @@ using ::com::sun::star::uno::Sequence;
//
//------------------------------------------------------------
-const rtl::OUString TILDE = OUString::createFromAscii( "~" );
+const rtl::OUString TILDE(RTL_CONSTASCII_USTRINGPARAM( "~" ));
const sal_Unicode TILDE_SIGN = L'~';
-const rtl::OUString AMPERSAND = OUString::createFromAscii( "&" );
+const rtl::OUString AMPERSAND(RTL_CONSTASCII_USTRINGPARAM( "&" ));
const sal_Unicode AMPERSAND_SIGN = L'&';
//------------------------------------------------------------
@@ -247,7 +248,7 @@ void SAL_CALL ListboxAddItem( HWND hwnd, const Any& aItem, const Reference< XInt
if ( !aItem.hasValue( ) ||
aItem.getValueType( ) != getCppuType((OUString*)0) )
throw IllegalArgumentException(
- OUString::createFromAscii( "invalid value type or any has no value" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )),
rXInterface,
aArgPos );
@@ -269,7 +270,7 @@ void SAL_CALL ListboxAddItems( HWND hwnd, const Any& aItemList, const Reference<
if ( !aItemList.hasValue( ) ||
aItemList.getValueType( ) != getCppuType((Sequence<OUString>*)0) )
throw IllegalArgumentException(
- OUString::createFromAscii( "invalid value type or any has no value" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )),
rXInterface,
aArgPos );
@@ -297,7 +298,7 @@ void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Referenc
(aPosition.getValueType( ) != getCppuType((sal_Int16*)0)) &&
(aPosition.getValueType( ) != getCppuType((sal_Int8*)0)) ) )
throw IllegalArgumentException(
- OUString::createFromAscii( "invalid value type or any has no value" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )),
rXInterface,
aArgPos );
@@ -310,7 +311,7 @@ void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Referenc
// index was not correct
if ( CB_ERR == lRet )
throw IllegalArgumentException(
- OUString::createFromAscii( "inavlid item position" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid item position" )),
rXInterface,
aArgPos );
}
@@ -349,7 +350,7 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref
(aPosition.getValueType( ) != getCppuType((sal_Int16*)0)) &&
(aPosition.getValueType( ) != getCppuType((sal_Int8*)0)) ) )
throw IllegalArgumentException(
- OUString::createFromAscii( "invalid value type or any has no value" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )),
rXInterface,
aArgPos );
@@ -358,7 +359,7 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref
if ( nPos < -1 )
throw IllegalArgumentException(
- OUString::createFromAscii("invalid index"),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("invalid index")),
rXInterface,
aArgPos );
@@ -366,7 +367,7 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref
if ( (CB_ERR == lRet) && (-1 != nPos) )
throw IllegalArgumentException(
- OUString::createFromAscii("invalid index"),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("invalid index")),
rXInterface,
aArgPos );
}
@@ -459,7 +460,7 @@ void SAL_CALL CheckboxSetState(
if ( !aState.hasValue( ) ||
aState.getValueType( ) != getCppuType((sal_Bool*)0) )
throw IllegalArgumentException(
- OUString::createFromAscii( "invalid value type or any has no value" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )),
rXInterface,
aArgPos );
@@ -608,3 +609,4 @@ OUString WindowsToSOfficeLabel( const rtl::OUString& aWinLabel )
return aSOLabel;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/misc/WinImplHelper.hxx b/fpicker/source/win32/misc/WinImplHelper.hxx
index 1d92d73011..c6e6c93904 100644
--- a/fpicker/source/win32/misc/WinImplHelper.hxx
+++ b/fpicker/source/win32/misc/WinImplHelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ rtl::OUString SOfficeToWindowsLabel( const rtl::OUString& aSOLabel );
rtl::OUString WindowsToSOfficeLabel( const rtl::OUString& aWinLabel );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx
index 4e4d88c879..9e46dc010f 100644
--- a/fpicker/source/win32/misc/resourceprovider.cxx
+++ b/fpicker/source/win32/misc/resourceprovider.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,12 +35,10 @@
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
#include "resourceprovider.hxx"
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#ifndef _TOOLS_SIMPLERESMGR_HXX
#include <tools/simplerm.hxx>
-#endif
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
@@ -86,7 +85,7 @@ _Entry CtrlIdToResIdTable[] = {
{ FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION }
};
-const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry );
+const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable );
//------------------------------------------------------------
//
@@ -122,7 +121,7 @@ public:
CResourceProvider_Impl( )
{
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ const SolarMutexGuard aGuard;
com::sun::star::lang::Locale aLoc( Application::GetSettings().GetUILocale() );
m_ResMgr = new SimpleResMgr( CREATEVERSIONRESMGR_NAME( fps_office ), aLoc );
@@ -192,3 +191,5 @@ OUString CResourceProvider::getResString( sal_Int16 aId )
{
return m_pImpl->getResString( aId );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/win32/misc/resourceprovider.hxx b/fpicker/source/win32/misc/resourceprovider.hxx
index 9e65b5e467..967c87d3dc 100644
--- a/fpicker/source/win32/misc/resourceprovider.hxx
+++ b/fpicker/source/win32/misc/resourceprovider.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,9 +36,7 @@
#include <sal/types.h>
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring>
-#endif
+#include <rtl/ustring.hxx>
//------------------------------------------------------------------------
// deklarations
@@ -58,3 +57,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/test/svdem.cxx b/fpicker/test/svdem.cxx
index 77eda31856..daf57136fc 100644
--- a/fpicker/test/svdem.cxx
+++ b/fpicker/test/svdem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,9 +48,7 @@
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#ifndef _COM_SUN_STAR_UI_DIALOGS_FILEDIALOGRESULTS_HPP_
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#endif
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
@@ -215,3 +214,4 @@ printf("Test\n");
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */