update dev300-m58
[ooovba.git] / applied_patches / 0478-novell-win32-odma.diff
blob6a5c25b2d21ff517d25599f70604643bbd1246b4
1 --- ucb/prj/build.lst.old 2009-04-06 16:42:15.000000000 +0000
2 +++ ucb/prj/build.lst 2009-04-06 16:42:16.000000000 +0000
3 @@ -14,3 +14,4 @@ uc ucb\source\ucp\webdav nmake - all uc
4 uc ucb\source\ucp\package nmake - all uc_package uc_inc NULL
5 uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL
6 uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL
7 +uc ucb\source\ucp\odma nmake - w uc_odma uc_inc NULL
8 --- ucb/prj/d.lst.old 2009-04-02 11:01:40.000000000 +0000
9 +++ ucb/prj/d.lst 2009-04-06 16:42:16.000000000 +0000
10 @@ -23,6 +23,11 @@
11 ..\%__SRC%\lib\ucp*.uno.dylib %_DEST%\lib%_EXT%\ucp*.uno.dylib
12 ..\%__SRC%\misc\ucp*.map %_DEST%\bin%_EXT%\ucp*.map
13 ..\%__SRC%\misc\ucp*.sym %_DEST%\bin%_EXT%\ucp*.sym
15 +..\%__SRC%\slb\odma_lib.lib %_DEST%\lib%_EXT%\odma_lib.lib
16 +..\source\ucp\odma\odma.h %_DEST%\inc%_EXT%\odma.h
17 +..\source\ucp\odma\odma_lib.hxx %_DEST%\inc%_EXT%\odma_lib.hxx
19 ..\source\ucp\file\ucpfile.xml %_DEST%\xml%_EXT%\ucpfile.xml
20 ..\source\ucp\ftp\ucpftp.xml %_DEST%\xml%_EXT%\ucpftp.xml
21 ..\source\ucp\hierarchy\ucphier.xml %_DEST%\xml%_EXT%\ucphier.xml
22 --- ucb/source/ucp/odma/makefile.mk.old 2009-04-02 11:01:38.000000000 +0000
23 +++ ucb/source/ucp/odma/makefile.mk 2009-04-06 16:42:16.000000000 +0000
24 @@ -51,7 +51,7 @@ LIBTARGET=NO
26 # --- General -----------------------------------------------------
28 -SLOFILES=\
29 +SLO1FILES=\
30 $(SLO)$/odma_lib.obj \
31 $(SLO)$/odma_services.obj \
32 $(SLO)$/odma_provider.obj \
33 @@ -62,7 +62,7 @@ SLOFILES=\
34 $(SLO)$/odma_contentcaps.obj
36 LIB1TARGET=$(SLB)$/_$(TARGET).lib
37 -LIB1OBJFILES=$(SLOFILES)
38 +LIB1OBJFILES=$(SLO1FILES)
40 # --- Shared-Library ---------------------------------------------------
42 @@ -95,6 +95,13 @@ APP2STDLIBS=$(SALLIB) \
44 DEF2DES=UCB ODMA URL converter
46 +# --- odma_lib library -----------------------------------------------
48 +SLO3FILES=$(SLO)$/odma_lib.obj
50 +LIB3TARGET=$(SLB)$/odma_lib.lib
51 +LIB3OBJFILES=$(SLO3FILES)
53 # --- Targets ----------------------------------------------------------
55 .INCLUDE: target.mk
56 --- ucb/source/ucp/odma/odma_content.cxx.old 2009-04-02 11:01:38.000000000 +0000
57 +++ ucb/source/ucp/odma/odma_content.cxx 2009-04-06 16:42:16.000000000 +0000
58 @@ -474,6 +474,12 @@ uno::Any SAL_CALL Content::execute(
60 else if( ! aCommand.Name.compareToAscii( "transfer" ) )
62 + // So far I have determined that this command is called when
63 + // doing "Save As" to copy an already written backup copy of
64 + // the document in the file system into the DMS.
66 + // Maybe also in other situations.
68 ucb::TransferInfo aTransferInfo;
69 if( ! ( aCommand.Argument >>= aTransferInfo ) )
71 @@ -489,84 +495,21 @@ uno::Any SAL_CALL Content::execute(
72 ::rtl::Reference<ContentProperties> aProp = m_aProps;
73 if(aProp->m_bIsFolder)
75 - aProp = getContentProvider()->getContentPropertyWithTitle(aTransferInfo.NewTitle);
76 + aProp = getContentProvider()->getContentPropertyWithDocumentId(aTransferInfo.NewTitle);
77 if(!aProp.is())
78 aProp = getContentProvider()->getContentPropertyWithSavedAsName(aTransferInfo.NewTitle);
79 sal_Bool bError = !aProp.is();
80 - if(bError)
81 - {
82 - sal_Char* pExtension = NULL;
83 - ::rtl::OString sExt;
84 - sal_Int32 nPos = aTransferInfo.NewTitle.lastIndexOf('.');
85 - if(nPos != -1)
86 - {
87 - sExt = ::rtl::OUStringToOString(aTransferInfo.NewTitle.copy(nPos+1),RTL_TEXTENCODING_ASCII_US);
88 - if(sExt.equalsIgnoreAsciiCase("txt"))
89 - pExtension = ODM_FORMAT_TEXT;
90 - else if(sExt.equalsIgnoreAsciiCase("rtf"))
91 - pExtension = ODM_FORMAT_RTF;
92 - else if(sExt.equalsIgnoreAsciiCase("ps"))
93 - pExtension = ODM_FORMAT_PS;
94 - else
95 - pExtension = const_cast<sal_Char*>(sExt.getStr());
96 - }
97 - else
98 - pExtension = ODM_FORMAT_TEXT;
100 - sal_Char* lpszNewDocId = new sal_Char[ODM_DOCID_MAX];
101 - void *pData = NULL;
102 - DWORD dwFlags = ODM_SILENT;
103 - ODMSTATUS odm = NODMSaveAsEx(ContentProvider::getHandle(),
104 - NULL, // means it is saved the first time
105 - lpszNewDocId,
106 - pExtension,
107 - NULL, // no callback function here
108 - pData,
109 - &dwFlags);
111 - // check if we have to call the DMS dialog
112 - if(odm == ODM_E_USERINT)
113 - {
114 - dwFlags = 0;
115 - odm = NODMSaveAsEx(ContentProvider::getHandle(),
116 - NULL, // means it is saved the first time
117 - lpszNewDocId,
118 - pExtension,
119 - NULL, // no callback function here
120 - pData,
121 - &dwFlags);
123 - bError = odm != ODM_SUCCESS;
124 - if(!bError)
126 - aProp = new ContentProperties();
127 - aProp->m_sDocumentId = ::rtl::OString(lpszNewDocId);
128 - aProp->m_sContentType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODMA_CONTENT_TYPE));
129 - aProp->m_sSavedAsName = aTransferInfo.NewTitle;
130 - getContentProvider()->append(aProp);
132 - // now set the title
133 - WORD nDocInfo = ODM_NAME;
134 - ::rtl::OUString sFileName = aTransferInfo.NewTitle;
135 - sal_Int32 nIndex = aTransferInfo.NewTitle.lastIndexOf( sal_Unicode('.') );
136 - if(nIndex != -1)
137 - sFileName = aTransferInfo.NewTitle.copy(0,nIndex);
138 + // There used to be code below that called ODMSaveAsEx,
139 + // but that was very broken. We have already called
140 + // ODMSaveAsEx in the ODMA file picker when selecting the
141 + // name for a new document, or the document already exists
142 + // in the DMS and we don't need any ODMSaveAsEx. The ODMA
143 + // file picker tells odma::ContentProvider about the new
144 + // document's DOCID, so the
145 + // getContentPropertyWithDocumentId() call above should
146 + // succeed.
148 - ::rtl::OString sDocInfoValue = ::rtl::OUStringToOString(sFileName,RTL_TEXTENCODING_ASCII_US);
149 - odm = NODMSetDocInfo( ContentProvider::getHandle(),
150 - lpszNewDocId,
151 - nDocInfo,
152 - const_cast<sal_Char*>(sDocInfoValue.getStr())
153 - );
156 - else if ( odm == ODM_E_CANCEL)
157 - NODMActivate(ContentProvider::getHandle(),
158 - ODM_DELETE,
159 - lpszNewDocId);
161 - delete lpszNewDocId;
163 if(bError)
164 ucbhelper::cancelCommandExecution(
165 uno::makeAny( lang::IllegalArgumentException(
166 @@ -578,11 +521,22 @@ uno::Any SAL_CALL Content::execute(
167 rtl::OUString sFileURL = ContentProvider::openDoc(aProp);
169 sal_Int32 nLastIndex = sFileURL.lastIndexOf( sal_Unicode('/') );
170 + // Create a new Content object for the "shadow" file
171 + // corresponding to the opened document from the DMS.
172 ::ucbhelper::Content aContent(sFileURL.copy(0,nLastIndex),NULL);
173 // aTransferInfo.NameClash = ucb::NameClash::OVERWRITE;
174 aTransferInfo.NewTitle = sFileURL.copy( 1 + nLastIndex );
175 + // Copy our saved backup copy to the "shadow" file.
176 aContent.executeCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("transfer")),uno::makeAny(aTransferInfo));
177 + // Tell the DMS that the "shadow" file is done and can be
178 + // imported.
179 getContentProvider()->saveDocument(aProp->m_sDocumentId);
181 + else if ( aCommand.Name.equalsAsciiL(
182 + RTL_CONSTASCII_STRINGPARAM( "getCasePreservingURL" ) ) )
184 + rtl::OUString CasePreservingURL = openDoc();
185 + aRet <<= CasePreservingURL;
187 else
189 --- ucb/source/ucp/odma/odma_content.hxx.old 2009-04-02 11:01:38.000000000 +0000
190 +++ ucb/source/ucp/odma/odma_content.hxx 2009-04-06 16:42:16.000000000 +0000
191 @@ -62,7 +62,7 @@ namespace odma
193 // UNO service name for the content.
194 #define ODMA_CONTENT_SERVICE_NAME \
195 - "com.sun.star.ucb.OdmaContent"
196 + "com.sun.star.ucb.ODMAContent"
198 //=========================================================================
199 class ContentProvider;
200 --- ucb/source/ucp/odma/odma_contentprops.hxx.old 2009-04-02 11:01:38.000000000 +0000
201 +++ ucb/source/ucp/odma/odma_contentprops.hxx 2009-04-06 16:42:16.000000000 +0000
202 @@ -67,6 +67,7 @@ namespace odma
205 inline ::rtl::OUString getTitle() const { return m_sTitle; }
206 + inline ::rtl::OUString getDocumentId() const { return ::rtl::OStringToOUString( m_sDocumentId, RTL_TEXTENCODING_ASCII_US ); }
207 inline ::rtl::OUString getSavedAsName() const { return m_sSavedAsName; }
209 typedef ::std::binary_function< ::rtl::Reference<ContentProperties>, ::rtl::OUString,bool> TContentPropertiesFunctorBase;
210 --- ucb/source/ucp/odma/odma_datasupplier.cxx.old 2009-04-02 11:01:38.000000000 +0000
211 +++ ucb/source/ucp/odma/odma_datasupplier.cxx 2009-04-06 16:42:16.000000000 +0000
212 @@ -44,7 +44,6 @@
213 #include "odma_content.hxx"
214 #include "odma_contentprops.hxx"
215 #include "odma_provider.hxx"
216 -#include "odma_lib.hxx"
218 using namespace com::sun::star::beans;
219 using namespace com::sun::star::lang;
220 @@ -287,7 +286,7 @@ sal_Bool DataSupplier::getResult( sal_uI
221 ODMSTATUS odm = NODMGetDMS(ODMA_ODMA_REGNAME, lpszDMSList);
222 lpszDMSList[strlen(lpszDMSList)+1] = '\0';
224 - ::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME");
225 + ::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME");
227 DWORD dwFlags = ODM_SPECIFIC;
228 odm = NODMQueryExecute(ContentProvider::getHandle(), sQuery,dwFlags, lpszDMSList, pQueryId );
229 --- ucb/source/ucp/odma/odma_lib.cxx.old 2009-04-02 11:01:38.000000000 +0000
230 +++ ucb/source/ucp/odma/odma_lib.cxx 2009-04-06 16:42:16.000000000 +0000
231 @@ -35,6 +35,8 @@
232 //#endif
233 #include <osl/module.h>
234 #include <rtl/ustring.hxx>
235 +#include <tools/prewin.h>
236 +#include <tools/postwin.h>
237 #include "odma_lib.hxx"
240 @@ -73,17 +75,18 @@ namespace odma
242 sal_Bool LoadFunctions(oslModule _pODMA);
244 - sal_Bool LoadLibrary()
245 + sal_Bool DMSsAvailable()
247 static sal_Bool bLoaded = sal_False;
248 - static oslModule pODMA = NULL;
249 + static sal_Bool bBeenHere = sal_False;
250 + oslModule pODMA = NULL;
252 - if (bLoaded)
253 - return sal_True;
254 + if (bBeenHere)
255 + return bLoaded;
257 ::rtl::OUString sPath;
258 #ifdef WIN
259 sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA.DLL"));
261 #endif
262 #ifdef WNT
263 sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL"));
264 @@ -92,11 +95,21 @@ namespace odma
265 sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodma.so"));
266 #endif
268 + bBeenHere = sal_True;
270 pODMA = osl_loadModule( sPath.pData,SAL_LOADMODULE_NOW );
271 if( !pODMA)
272 return sal_False;
274 - return bLoaded = LoadFunctions(pODMA);
275 + if (!LoadFunctions(pODMA))
276 + return sal_False;
278 + bLoaded = (NODMGetDMSCount() > 0);
280 + if (getenv ("NO_ODMA"))
281 + bLoaded = sal_False;
283 + return bLoaded;
285 // -------------------------------------------------------------------------
287 --- ucb/source/ucp/odma/odma_lib.hxx.old 2009-04-02 11:01:38.000000000 +0000
288 +++ ucb/source/ucp/odma/odma_lib.hxx 2009-04-06 16:42:16.000000000 +0000
289 @@ -30,19 +30,7 @@
290 #ifndef ODMA_LIB_HXX
291 #define ODMA_LIB_HXX
293 -typedef void *LPVOID;
294 -typedef char *LPSTR,
295 - *PSTR;
296 -typedef const char *LPCSTR;
297 -typedef unsigned long DWORD;
298 -typedef unsigned short WORD;
299 -typedef unsigned short *LPWORD;
300 -typedef DWORD *LPDWORD;
302 -#define WINAPI __stdcall
303 -#define FAR
305 -#include "odma.h"
306 +#include <odma.h>
308 namespace odma
310 @@ -208,37 +196,37 @@ namespace odma
312 // now we define some macros
314 - #define NODMRegisterApp(a,b,c,d,e) (*(pODMRegisterApp))(a,b,c,d,e)
315 - #define NODMUnRegisterApp(a) (*(pODMUnRegisterApp))(a)
316 - #define NODMSelectDoc(a,b,c) (*(pODMSelectDoc))(a,b,c)
317 - #define NODMOpenDoc(a,b,c,d) (*(pODMOpenDoc))(a,b,c,d)
318 - #define NODMSaveDoc(a,b,c) (*(pODMSaveDoc))(a,b,c)
319 - #define NODMCloseDoc(a,b,c,d,e,f) (*(pODMCloseDoc))(a,b,c,d,e,f)
320 - #define NODMNewDoc(a,b,c,d,e) (*(pODMNewDoc))(a,b,c,d,e)
321 - #define NODMSaveAs(a,b,c,d,e,f) (*(pODMSaveAs))(a,b,c,d,e,f)
322 - #define NODMActivate(a,b,c) (*(pODMActivate))(a,b,c)
323 - #define NODMGetDocInfo(a,b,c,d,e) (*(pODMGetDocInfo))(a,b,c,d,e)
324 - #define NODMSetDocInfo(a,b,c,d) (*(pODMSetDocInfo))(a,b,c,d)
325 - #define NODMGetDMSInfo(a,b,c,d) (*(pODMGetDMSInfo))(a,b,c,d)
326 - #define NODMGetDMSCount() (*(pODMGetDMSCount))()
327 - #define NODMGetDMSList(a,b) (*(pODMGetDMSList))(a,b)
328 - #define NODMGetDMS(a,b) (*(pODMGetDMS))(a,b)
329 - #define NODMSetDMS(a,b) (*(pODMSetDMS))(a,b)
330 - #define NODMQueryExecute(a,b,c,d,e) (*(pODMQueryExecute))(a,b,c,d,e)
331 - #define NODMQueryGetResults(a,b,c,d,e,f) (*(pODMQueryGetResults))(a,b,c,d,e,f)
332 - #define NODMQueryClose(a,b) (*(pODMQueryClose))(a,b)
333 - #define NODMCloseDocEx(a,b,c,d,e,f,g) (*(pODMCloseDocEx))(a,b,c,d,e,f,g)
334 - #define NODMSaveAsEx(a,b,c,d,e,f,g) (*(pODMSaveAsEx))(a,b,c,d,e,f,g)
335 - #define NODMSaveDocEx(a,b,c,d) (*(pODMSaveDocEx))(a,b,c,d)
336 - #define NODMSelectDocEx(a,b,c,d,e,f) (*(pODMSelectDocEx))(a,b,c,d,e,f)
337 - #define NODMQueryCapability(a,b,c,d,e) (*(pODMQueryCapability))(a,b,c,d,e)
338 - #define NODMSetDocEvent(a,b,c,d,e,f,g) (*(pODMSetDocEvent))(a,b,c,d,e,f,g)
339 - #define NODMGetAlternateContent(a,b,c,d,e) (*(pODMGetAlternateContent))(a,b,c,d,e)
340 - #define NODMSetAlternateContent(a,b,c,d,e) (*(pODMSetAlternateContent))(a,b,c,d,e)
341 - #define NODMGetDocRelation(a,b,c,d,e,f) (*(pODMGetDocRelation))(a,b,c,d,e,f)
342 - #define NODMSetDocRelation(a,b,c,d,e,f) (*(pODMSetDocRelation))(a,b,c,d,e,f)
343 + #define NODMRegisterApp(a,b,c,d,e) (*(::odma::pODMRegisterApp))(a,b,c,d,e)
344 + #define NODMUnRegisterApp(a) (*(::odma::pODMUnRegisterApp))(a)
345 + #define NODMSelectDoc(a,b,c) (*(::odma::pODMSelectDoc))(a,b,c)
346 + #define NODMOpenDoc(a,b,c,d) (*(::odma::pODMOpenDoc))(a,b,c,d)
347 + #define NODMSaveDoc(a,b,c) (*(::odma::pODMSaveDoc))(a,b,c)
348 + #define NODMCloseDoc(a,b,c,d,e,f) (*(::odma::pODMCloseDoc))(a,b,c,d,e,f)
349 + #define NODMNewDoc(a,b,c,d,e) (*(::odma::pODMNewDoc))(a,b,c,d,e)
350 + #define NODMSaveAs(a,b,c,d,e,f) (*(::odma::pODMSaveAs))(a,b,c,d,e,f)
351 + #define NODMActivate(a,b,c) (*(::odma::pODMActivate))(a,b,c)
352 + #define NODMGetDocInfo(a,b,c,d,e) (*(::odma::pODMGetDocInfo))(a,b,c,d,e)
353 + #define NODMSetDocInfo(a,b,c,d) (*(::odma::pODMSetDocInfo))(a,b,c,d)
354 + #define NODMGetDMSInfo(a,b,c,d) (*(::odma::pODMGetDMSInfo))(a,b,c,d)
355 + #define NODMGetDMSCount() (*(::odma::pODMGetDMSCount))()
356 + #define NODMGetDMSList(a,b) (*(::odma::pODMGetDMSList))(a,b)
357 + #define NODMGetDMS(a,b) (*(::odma::pODMGetDMS))(a,b)
358 + #define NODMSetDMS(a,b) (*(::odma::pODMSetDMS))(a,b)
359 + #define NODMQueryExecute(a,b,c,d,e) (*(::odma::pODMQueryExecute))(a,b,c,d,e)
360 + #define NODMQueryGetResults(a,b,c,d,e,f) (*(::odma::pODMQueryGetResults))(a,b,c,d,e,f)
361 + #define NODMQueryClose(a,b) (*(::odma::pODMQueryClose))(a,b)
362 + #define NODMCloseDocEx(a,b,c,d,e,f,g) (*(::odma::pODMCloseDocEx))(a,b,c,d,e,f,g)
363 + #define NODMSaveAsEx(a,b,c,d,e,f,g) (*(::odma::pODMSaveAsEx))(a,b,c,d,e,f,g)
364 + #define NODMSaveDocEx(a,b,c,d) (*(::odma::pODMSaveDocEx))(a,b,c,d)
365 + #define NODMSelectDocEx(a,b,c,d,e,f) (*(::odma::pODMSelectDocEx))(a,b,c,d,e,f)
366 + #define NODMQueryCapability(a,b,c,d,e) (*(::odma::pODMQueryCapability))(a,b,c,d,e)
367 + #define NODMSetDocEvent(a,b,c,d,e,f,g) (*(::odma::pODMSetDocEvent))(a,b,c,d,e,f,g)
368 + #define NODMGetAlternateContent(a,b,c,d,e) (*(::odma::pODMGetAlternateContent))(a,b,c,d,e)
369 + #define NODMSetAlternateContent(a,b,c,d,e) (*(::odma::pODMSetAlternateContent))(a,b,c,d,e)
370 + #define NODMGetDocRelation(a,b,c,d,e,f) (*(::odma::pODMGetDocRelation))(a,b,c,d,e,f)
371 + #define NODMSetDocRelation(a,b,c,d,e,f) (*(::odma::pODMSetDocRelation))(a,b,c,d,e,f)
373 - sal_Bool LoadLibrary();
374 + sal_Bool DMSsAvailable();
376 extern TODMRegisterApp pODMRegisterApp;
377 extern TODMUnRegisterApp pODMUnRegisterApp;
378 --- ucb/source/ucp/odma/odma_provider.cxx.old 2009-04-02 11:01:38.000000000 +0000
379 +++ ucb/source/ucp/odma/odma_provider.cxx 2009-04-06 16:42:16.000000000 +0000
380 @@ -437,7 +437,7 @@ void ContentProvider::append(const ::rtl
381 lpszDMSList[strlen(lpszDMSList)+1] = '\0';
383 ::rtl::OString sTitleText(::rtl::OUStringToOString(_sDocumentName,RTL_TEXTENCODING_ASCII_US));
384 - ::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME WHERE ODM_TITLETEXT = '");
385 + ::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME WHERE ODM_TITLETEXT = '");
386 sQuery += sTitleText;
387 sQuery += "'";
389 @@ -525,6 +525,12 @@ void ContentProvider::append(const ::rtl
390 return getContentProperty(_sTitle,aFunc);
392 // -----------------------------------------------------------------------------
393 +::rtl::Reference<ContentProperties> ContentProvider::getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const
395 + ContentPropertiesMemberFunctor aFunc(::std::mem_fun(&ContentProperties::getDocumentId));
396 + return getContentProperty(_sDocumentId,aFunc);
398 +// -----------------------------------------------------------------------------
399 ::rtl::OUString ContentProvider::openDoc(const ::rtl::Reference<ContentProperties>& _rProp) throw (uno::Exception)
401 OSL_ENSURE(_rProp.is(),"No valid content properties!");
402 --- ucb/source/ucp/odma/odma_provider.hxx.old 2009-04-02 11:01:38.000000000 +0000
403 +++ ucb/source/ucp/odma/odma_provider.hxx 2009-04-06 16:42:16.000000000 +0000
404 @@ -32,6 +32,8 @@
405 #define ODMA_PROVIDER_HXX
407 #include <ucbhelper/providerhelper.hxx>
408 +#include <tools/prewin.h>
409 +#include <tools/postwin.h>
410 #include "odma_lib.hxx"
412 #include "rtl/ref.hxx"
413 @@ -46,7 +48,7 @@ namespace odma {
414 // UNO service name for the provider. This name will be used by the UCB to
415 // create instances of the provider.
416 #define ODMA_CONTENT_PROVIDER_SERVICE_NAME \
417 - "com.sun.star.ucb.OdmaContentProvider"
418 + "com.sun.star.ucb.ODMAContentProvider"
419 // #define ODMA_CONTENT_PROVIDER_SERVICE_NAME_LENGTH 34
421 // URL scheme. This is the scheme the provider will be able to create
422 @@ -136,14 +138,21 @@ public:
424 ::rtl::Reference<ContentProperties> queryContentProperty(const ::rtl::OUString& _sDocumentName);
426 - /** getContentProperty returns the ContentProperties for the first content with that title
427 + /** getContentPropertyWithTitle returns the ContentProperties for the first content with that title
428 @param _sTitle the title of the document
430 @return the content properties
432 ::rtl::Reference<ContentProperties> getContentPropertyWithTitle(const ::rtl::OUString& _sTitle) const;
434 - /** getContentProperty returns the ContentProperties for the first content with that SavedAsName
435 + /** getContentPropertyWithDocumentId returns the ContentProperties for the first content with that title
436 + @param _sTitle the title of the document
438 + @return the content properties
439 + */
440 + ::rtl::Reference<ContentProperties> getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const;
442 + /** getContentPropertyWithSavedAsName returns the ContentProperties for the first content with that SavedAsName
443 @param _sSaveAsName the SavedAsName of the document
445 @return the content properties
446 --- ucb/source/ucp/odma/odma_services.cxx.old 2009-04-02 11:01:38.000000000 +0000
447 +++ ucb/source/ucp/odma/odma_services.cxx 2009-04-06 16:42:16.000000000 +0000
448 @@ -35,21 +35,19 @@
449 #include <com/sun/star/registry/XRegistryKey.hpp>
450 #include "odma_contentprops.hxx"
451 #include "odma_provider.hxx"
452 -#include "odma_lib.hxx"
454 -using namespace rtl;
455 using namespace com::sun::star::uno;
456 using namespace com::sun::star::lang;
457 using namespace com::sun::star::registry;
459 //=========================================================================
460 static sal_Bool writeInfo( void * pRegistryKey,
461 - const OUString & rImplementationName,
462 - Sequence< OUString > const & rServiceNames )
463 + const rtl::OUString & rImplementationName,
464 + Sequence< rtl::OUString > const & rServiceNames )
466 - OUString aKeyName( OUString::createFromAscii( "/" ) );
467 + rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
468 aKeyName += rImplementationName;
469 - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
470 + aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
472 Reference< XRegistryKey > xKey;
474 @@ -122,10 +120,8 @@ extern "C" void * SAL_CALL component_get
475 if ( ::odma::ContentProvider::getImplementationName_Static().
476 compareToAscii( pImplName ) == 0 )
478 - if(::odma::LoadLibrary())
479 + if(::odma::DMSsAvailable())
480 xFactory = ::odma::ContentProvider::createServiceFactory( xSMgr );
481 - else
482 - OSL_ASSERT(!"Could not load library!");
485 //////////////////////////////////////////////////////////////////////
486 --- ucb/source/ucp/odma/ucpodma.xml.old 2009-04-02 11:01:38.000000000 +0000
487 +++ ucb/source/ucp/odma/ucpodma.xml 2009-04-06 16:42:16.000000000 +0000
488 @@ -11,7 +11,7 @@
489 Ocke Janssen
490 </author>
491 <name>
492 - com.sun.star.comp.ucb.OdmaContentProvider
493 + com.sun.star.comp.ucb.ODMAContentProvider
494 </name>
495 <description>
496 This component implements a Content Provider for the Universal
497 --- officecfg/registry/data/org/openoffice/ucb/Configuration.xcu.old 2009-04-06 16:41:46.000000000 +0000
498 +++ officecfg/registry/data/org/openoffice/ucb/Configuration.xcu 2009-04-06 16:42:16.000000000 +0000
499 @@ -200,6 +200,17 @@
500 <value/>
501 </prop>
502 </node>
503 + <node oor:name="Provider42" oor:op="replace">
504 + <prop oor:name="ServiceName">
505 + <value>com.sun.star.ucb.ODMAContentProvider</value>
506 + </prop>
507 + <prop oor:name="URLTemplate">
508 + <value>vnd.sun.star.odma</value>
509 + </prop>
510 + <prop oor:name="Arguments">
511 + <value/>
512 + </prop>
513 + </node>
514 <!-- We want the Provider to be the final fallback provider -->
515 <node oor:name="Provider999" oor:op="replace" install:module="gio">
516 <prop oor:name="ServiceName">
517 --- scp2/source/ooo/file_library_ooo.scp
518 +++ scp2/source/ooo/file_library_ooo.scp
519 @@ -661,6 +661,10 @@ End
520 #endif
521 #endif
523 +#ifdef WNT
524 +SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fps_ODMA, fps_odma.uno )
525 +#endif
527 SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fps_Office, fps_office.uno )
528 SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Fpicker, fpicker.uno )
530 @@ -1548,6 +1552,10 @@ SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_
532 SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpexpand1, ucpexpand1.uno)
534 +#ifdef WNT
535 +SPECIAL_UNO_COMPONENT_LIB_FILE(gid_File_Ucpodma1, ucpodma1)
536 +#endif
538 File gid_File_Lib_Lnth
539 TXT_FILE_BODY;
540 Styles = (PACKED,UNO_COMPONENT,PATCH);
541 --- desktop/source/app/cmdlineargs.cxx.old 2009-04-06 16:41:47.000000000 +0000
542 +++ desktop/source/app/cmdlineargs.cxx 2009-04-06 16:42:16.000000000 +0000
543 @@ -297,6 +297,15 @@ void CommandLineArgs::ParseCommandLine_I
545 else
547 + if( bOpenEvent || bViewEvent || bForceNewEvent || bForceOpenEvent )
549 + if( ::rtl::OUString(aArgStr).matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("::ODMA")) )
551 + ::rtl::OUString sArg = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.odma:/"));
552 + sArg += aArgStr;
553 + aArgStr = sArg;
554 + }
556 // handle this argument as a filename
557 if ( bOpenEvent )
558 AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArgStr );
559 --- fpicker/prj/build.lst.old 2009-04-06 16:41:56.000000000 +0000
560 +++ fpicker/prj/build.lst 2009-04-06 16:42:16.000000000 +0000
561 @@ -2,6 +2,7 @@ fp fpicker : rdbmaker svtools NULL
562 fp fpicker\inc nmake - all fp_inc NULL
563 fp fpicker\source\generic nmake - all fp_generic fp_inc NULL
564 fp fpicker\source\office nmake - all fp_office fp_inc NULL
565 +fp fpicker\source\odma nmake - w fp_odma NULL
566 fp fpicker\source\unx\gnome nmake - u fp_gnome_filepicker fp_inc NULL
567 fp fpicker\source\unx\kde_unx nmake - u fp_unx_common fp_inc NULL
568 fp fpicker\source\unx\kde nmake - u fp_unx_kde_filepicker fp_inc NULL
569 --- fpicker/source/generic/makefile.mk.old 2009-04-02 10:52:25.000000000 +0000
570 +++ fpicker/source/generic/makefile.mk 2009-04-06 16:42:16.000000000 +0000
571 @@ -50,6 +50,7 @@ SHL1TARGET= $(TARGET)
572 SHL1IMPLIB= i$(TARGET)
573 SHL1OBJS= $(SLOFILES)
574 SHL1STDLIBS=\
575 + $(ODMA_LIB_LIB) \
576 $(VCLLIB) \
577 $(SVLLIB) \
578 $(SVTOOLLIB) \
579 --- fpicker/source/generic/fpicker.cxx.old 2009-04-02 10:52:25.000000000 +0000
580 +++ fpicker/source/generic/fpicker.cxx 2009-04-06 16:42:16.000000000 +0000
581 @@ -37,6 +37,13 @@
582 #include "cppuhelper/implementationentry.hxx"
583 #endif
584 #include "com/sun/star/lang/XMultiComponentFactory.hpp"
586 +#ifdef WNT
587 +#include <tools/prewin.h>
588 +#include <tools/postwin.h>
589 +#include <odma_lib.hxx>
590 +#endif
592 #include "svtools/miscopt.hxx"
593 #include "svtools/pickerhistoryaccess.hxx"
595 @@ -55,6 +62,7 @@ using rtl::OUString;
597 static OUString FilePicker_getSystemPickerServiceName()
599 +#ifdef UNX
600 OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
601 if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("gnome"))
602 return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFilePicker"));
603 @@ -62,8 +70,14 @@ static OUString FilePicker_getSystemPick
604 return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFilePicker"));
605 else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
606 return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFilePicker"));
607 - else
608 - return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFilePicker"));
609 +#endif
610 +#ifdef WNT
611 + if (SvtMiscOptions().TryODMADialog() && ::odma::DMSsAvailable()) {
612 + return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.ODMAFilePicker"));
614 + return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.Win32FilePicker"));
615 +#endif
616 + return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFilePicker"));
619 static Reference< css::uno::XInterface > FilePicker_createInstance (
620 @@ -124,14 +138,20 @@ static Sequence< OUString > FilePicker_g
621 static OUString FolderPicker_getSystemPickerServiceName()
623 OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
624 +#ifdef UNX
625 if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("gnome"))
626 return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.GtkFolderPicker"));
627 else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("kde"))
628 return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.KDEFolderPicker"));
629 else if (aDesktopEnvironment.equalsIgnoreAsciiCaseAscii ("macosx"))
630 return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.AquaFolderPicker"));
631 - else
632 - return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFolderPicker"));
633 +#endif
634 +#ifdef WNT
635 + if (SvtMiscOptions().TryODMADialog() && ::odma::DMSsAvailable()) {
636 + return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.ODMAFolderPicker"));
638 +#endif
639 + return OUString (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.ui.dialogs.SystemFolderPicker"));
642 static Reference< css::uno::XInterface > FolderPicker_createInstance (
643 --- fpicker/source/odma/ODMAFilePicker.cxx.old 1970-01-01 00:00:00.000000000 +0000
644 +++ fpicker/source/odma/ODMAFilePicker.cxx 2009-04-06 16:42:16.000000000 +0000
645 @@ -0,0 +1,565 @@
646 +/*************************************************************************
648 + * OpenOffice.org - a multi-platform office productivity suite
650 + * $RCSfile$
652 + * $Revision: 12010 $
654 + * last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
656 + * The Contents of this file are made available subject to
657 + * the terms of GNU Lesser General Public License Version 2.1.
660 + * GNU Lesser General Public License Version 2.1
661 + * =============================================
662 + * Copyright 2005 by Sun Microsystems, Inc.
663 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
665 + * This library is free software; you can redistribute it and/or
666 + * modify it under the terms of the GNU Lesser General Public
667 + * License version 2.1, as published by the Free Software Foundation.
669 + * This library is distributed in the hope that it will be useful,
670 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
671 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
672 + * Lesser General Public License for more details.
674 + * You should have received a copy of the GNU Lesser General Public
675 + * License along with this library; if not, write to the Free Software
676 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
677 + * MA 02111-1307 USA
679 + ************************************************************************/
681 +// MARKER(update_precomp.py): autogen include statement, do not remove
682 +#include "precompiled_fpicker.hxx"
684 +#include "ODMAFilePicker.hxx"
686 +#ifndef _TOOLS_DEBUG_HXX
687 +#include <tools/debug.hxx>
688 +#endif
690 +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
691 +#include <com/sun/star/beans/PropertyValue.hpp>
692 +#endif
693 +#ifndef _COM_SUN_STAR_BEANS_STRINGPAIR_HPP_
694 +#include <com/sun/star/beans/StringPair.hpp>
695 +#endif
696 +#ifndef _COM_SUN_STAR_UI_DIALOGS_FILEPREVIEWIMAGEFORMATS_HPP_
697 +#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp>
698 +#endif
699 +#ifndef _COM_SUN_STAR_UI_DIALOGS_EXECUTABLEDIALOGRESULTS_HPP_
700 +#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
701 +#endif
702 +#ifndef _COM_SUN_STAR_UI_DIALOGS_TEMPLATEDESCRIPTION_HPP_
703 +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
704 +#endif
705 +#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_
706 +#include <com/sun/star/ucb/XCommandEnvironment.hpp>
707 +#endif
708 +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
709 +#include <com/sun/star/uno/Any.hxx>
710 +#endif
711 +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
712 +#include <com/sun/star/uno/Sequence.hxx>
713 +#endif
715 +#ifndef _COMPHELPER_SEQUENCE_HXX_
716 +#include <comphelper/sequence.hxx>
717 +#endif
718 +#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
719 +#include <cppuhelper/typeprovider.hxx>
720 +#endif
721 +#ifndef _UCBHELPER_CONTENT_HXX
722 +#include <ucbhelper/content.hxx>
723 +#endif
724 +#ifndef _UNOTOOLS_UCBHELPER_HXX
725 +#include <unotools/ucbhelper.hxx>
726 +#endif
728 +#ifndef ODMA_LIB_HXX
729 +#include <tools/prewin.h>
730 +#include <tools/postwin.h>
731 +#include <odma_lib.hxx>
732 +#endif
734 +// using ----------------------------------------------------------------
736 +using namespace ::com::sun::star::beans;
737 +using namespace ::com::sun::star::lang;
738 +using namespace ::com::sun::star::ui::dialogs;
739 +using namespace ::com::sun::star::ucb;
740 +using namespace ::com::sun::star::uno;
741 +using namespace ::com::sun::star::util;
742 +using namespace ::utl;
744 +//------------------------------------------------------------------------------------
745 +// class ODMAFilePicker
746 +//------------------------------------------------------------------------------------
747 +ODMAFilePicker::ODMAFilePicker( const Reference < XMultiServiceFactory >& xFactory ) :
748 + cppu::WeakComponentImplHelper9<
749 + XFilterManager,
750 + XFilterGroupManager,
751 + XFilePickerControlAccess,
752 + XFilePickerNotifier,
753 + XFilePreview,
754 + XInitialization,
755 + XCancellable,
756 + XEventListener,
757 + XServiceInfo>( m_rbHelperMtx ),
758 + m_bMultiSelectionMode( sal_False ),
759 + m_aDefaultName( ),
760 + m_aFiles( ),
761 + m_nDialogKind( OPEN )
763 + m_bUseDMS = ::odma::DMSsAvailable();
764 + m_xSystemFilePicker = xFactory->createInstance(
765 + ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.Win32FilePicker" ) );
768 +// XExecutableDialog functions
770 +void SAL_CALL ODMAFilePicker::setTitle( const ::rtl::OUString& aTitle )
771 + throw (RuntimeException)
773 + Reference< XExecutableDialog > xExecutableDialog( m_xSystemFilePicker, UNO_QUERY );
774 + xExecutableDialog->setTitle( aTitle);
777 +sal_Int16 SAL_CALL ODMAFilePicker::execute( )
778 + throw (RuntimeException)
780 + ODMSTATUS status;
781 + ODMHANDLE handle;
782 + WORD count = 0;
783 + DWORD flags;
785 + status = NODMRegisterApp( &handle, ODM_API_VERSION, "sodma", (DWORD) GetActiveWindow( ), NULL );
786 + if (status == ODM_SUCCESS)
788 + if (m_nDialogKind == OPEN)
790 + const int MAXDOCS = 10;
791 + char docids[ODM_DOCID_MAX*MAXDOCS+1];
792 + WORD docidslen = sizeof( docids );
794 + flags = 0;
795 + if (m_bMultiSelectionMode)
796 + count = MAXDOCS;
797 + else
798 + count = 1;
799 + status = NODMSelectDocEx( handle, docids, &docidslen, &count, &flags, NULL );
800 + if (status == ODM_SUCCESS)
802 + // GroupWise doesn't set docidslen or count, so
803 + // calculate number of document IDs manually
804 + char *p = docids;
805 + count = 0;
806 + while (*p) {
807 + count++;
808 + p += strlen( p ) + 1;
811 + else if (status == ODM_E_NOSUPPORT)
813 + status = NODMSelectDoc( handle, docids, &flags );
814 + if (status == ODM_SUCCESS)
815 + count = 1;
817 + NODMUnRegisterApp( handle );
818 + if (status == ODM_SUCCESS)
820 + rtl::OUString *strings = new rtl::OUString[count];
821 + int i;
822 + char *p = docids;
824 + for (i = 0; i < count; i++) {
825 + // Insane API... the first element is a full URI, the rest
826 + // are just the "basenames" in the same "directory".
827 + if (i == 0)
828 + strings[0] = rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) + rtl::OUString::createFromAscii( p );
829 + else
830 + strings[i] = rtl::OUString::createFromAscii( p );
831 + p += strlen( p );
834 + m_aFiles = Sequence< rtl::OUString >( strings, count );
835 + delete[] strings;
836 + return ExecutableDialogResults::OK;
839 + else /* m_nDialogKind == SAVE */
841 + char newdocid[ODM_DOCID_MAX+1];
843 + if (m_aDefaultName.getLength() == 0 ||
844 + !m_aDefaultName.matchIgnoreAsciiCaseAsciiL( "::ODMA\\", 7, 0 ))
846 + char tempdocid[ODM_DOCID_MAX+1];
848 + status = NODMNewDoc( handle, tempdocid, ODM_SILENT, NULL, NULL );
849 + if (status == ODM_SUCCESS)
850 + status = NODMSaveAs( handle, tempdocid, newdocid, NULL, NULL, NULL );
852 + else
854 + rtl::OString sDefaultName = rtl::OUStringToOString( m_aDefaultName, RTL_TEXTENCODING_ASCII_US );
855 + status = NODMSaveAs( handle,
856 + const_cast<sal_Char*>( sDefaultName.getStr() ),
857 + newdocid, NULL, NULL, NULL );
860 + NODMUnRegisterApp( handle );
861 + if (status == ODM_SUCCESS)
863 + rtl::OUString s( rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) +
864 + rtl::OUString::createFromAscii( newdocid ) );
865 + // Create a Content for the odma URL so that
866 + // odma::ContentProvider will learn about the DOCID we
867 + // just created.
868 + ucbhelper::Content content( s, Reference< XCommandEnvironment >() );
869 + m_aFiles = Sequence< rtl::OUString >( &s, 1 );
870 + return ExecutableDialogResults::OK;
874 + if (status == ODM_E_APPSELECT)
876 + m_bUseDMS = sal_False;
878 + Reference< XExecutableDialog > xExecutableDialog( m_xSystemFilePicker, UNO_QUERY );
879 + return xExecutableDialog->execute();
882 + // Fallback
883 + return ExecutableDialogResults::CANCEL;
886 +// XFilePicker functions
888 +void SAL_CALL ODMAFilePicker::setMultiSelectionMode( sal_Bool bMode )
889 + throw( RuntimeException )
891 + m_bMultiSelectionMode = bMode;
893 + Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
894 + xFilePicker->setMultiSelectionMode( bMode );
897 +void SAL_CALL ODMAFilePicker::setDefaultName( const rtl::OUString& aName )
898 + throw( RuntimeException )
900 + // When editing a document from DMS, and doing Save As, this is
901 + // called twice, first with the complete DOCID, the second time
902 + // with the "extension" removed. Of course, this is bogus, as
903 + // DOCIDs should be treated as opaque strings, they don't have
904 + // "extensions".
906 + // In the GroupWise case a DOCID is like
907 + // ::ODMA\GRPWISE\FOO1.BAR.FOO-Bla_bla:12345.12 where the final
908 + // dot separates the version number, not an "extension".
909 + //
910 + // So ignore the second call.
911 + //
912 + // The second call without "extension" is done if the
913 + // XFilePickerControlAccess is set to have auto-extension turned
914 + // on. (See sfx2/source/dialog/filedlghelper.cxx:
915 + // FileDialogHelper_Impl::implInitializeFileName().) Thus we could
916 + // alternatively make sure that a getValue call to get
917 + // ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION returns
918 + // false. But that might be hard as we don't know in advance
919 + // whether the user will click the "use application dialog"
920 + // button. If so, we indeed do use auto-extensions.
921 + //
922 + // Yes, this is ugly, relying on knowing details on how this
923 + // function will be called.
925 + if ( m_aDefaultName.getLength() == 0 )
926 + m_aDefaultName = aName;
928 + Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
929 + xFilePicker->setDefaultName( aName );
932 +void SAL_CALL ODMAFilePicker::setDisplayDirectory( const rtl::OUString& aDirectory )
933 + throw( IllegalArgumentException, RuntimeException )
935 + m_aDisplayDirectory = aDirectory;
937 + Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
938 + xFilePicker->setDisplayDirectory( aDirectory );
941 +rtl::OUString SAL_CALL ODMAFilePicker::getDisplayDirectory( )
942 + throw( RuntimeException )
944 + if (m_bUseDMS)
945 + return m_aDisplayDirectory;
947 + Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
948 + return xFilePicker->getDisplayDirectory();
951 +Sequence< rtl::OUString > SAL_CALL ODMAFilePicker::getFiles( )
952 + throw( RuntimeException )
954 + if (m_bUseDMS)
955 + return m_aFiles;
957 + Reference< XFilePicker > xFilePicker( m_xSystemFilePicker, UNO_QUERY );
958 + return xFilePicker->getFiles();
961 +// XFilePickerControlAccess functions
963 +void SAL_CALL ODMAFilePicker::setValue( sal_Int16 nElementID,
964 + sal_Int16 nControlAction,
965 + const Any& rValue )
966 + throw( RuntimeException )
968 + Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
969 + xFilePickerControlAccess->setValue( nElementID, nControlAction, rValue );
972 +Any SAL_CALL ODMAFilePicker::getValue( sal_Int16 nElementID, sal_Int16 nControlAction )
973 + throw( RuntimeException )
975 + Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
976 + return xFilePickerControlAccess->getValue( nElementID, nControlAction );
979 +void SAL_CALL ODMAFilePicker::setLabel( sal_Int16 nLabelID, const rtl::OUString& rValue )
980 + throw ( RuntimeException )
982 + Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
983 + xFilePickerControlAccess->setLabel( nLabelID, rValue );
986 +rtl::OUString SAL_CALL ODMAFilePicker::getLabel( sal_Int16 nLabelID )
987 + throw ( RuntimeException )
989 + Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
990 + return xFilePickerControlAccess->getLabel( nLabelID );
993 +void SAL_CALL ODMAFilePicker::enableControl( sal_Int16 nElementID, sal_Bool bEnable )
994 + throw( RuntimeException )
996 + Reference< XFilePickerControlAccess > xFilePickerControlAccess( m_xSystemFilePicker, UNO_QUERY );
997 + xFilePickerControlAccess->enableControl( nElementID, bEnable );
1000 +// XFilePickerNotifier functions
1002 +void SAL_CALL ODMAFilePicker::addFilePickerListener( const Reference< XFilePickerListener >& xListener )
1003 + throw ( RuntimeException )
1005 + Reference< XFilePickerNotifier > xFilePickerNotifier( m_xSystemFilePicker, UNO_QUERY );
1006 + xFilePickerNotifier->addFilePickerListener( xListener );
1009 +void SAL_CALL ODMAFilePicker::removeFilePickerListener( const Reference< XFilePickerListener >& xListener )
1010 + throw ( RuntimeException )
1012 + Reference< XFilePickerNotifier > xFilePickerNotifier( m_xSystemFilePicker, UNO_QUERY );
1013 + xFilePickerNotifier->removeFilePickerListener( xListener );
1016 +// XFilePreview functions
1018 +Sequence< sal_Int16 > SAL_CALL ODMAFilePicker::getSupportedImageFormats( )
1019 + throw ( RuntimeException )
1021 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1022 + return xFilePreview->getSupportedImageFormats();
1025 +sal_Int32 SAL_CALL ODMAFilePicker::getTargetColorDepth( )
1026 + throw ( RuntimeException )
1028 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1029 + return xFilePreview->getTargetColorDepth();
1032 +sal_Int32 SAL_CALL ODMAFilePicker::getAvailableWidth( )
1033 + throw ( RuntimeException )
1035 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1036 + return xFilePreview->getAvailableWidth();
1039 +sal_Int32 SAL_CALL ODMAFilePicker::getAvailableHeight( )
1040 + throw ( RuntimeException )
1042 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1043 + return xFilePreview->getAvailableHeight();
1046 +void SAL_CALL ODMAFilePicker::setImage( sal_Int16 aImageFormat, const Any& rImage )
1047 + throw ( IllegalArgumentException, RuntimeException )
1049 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1050 + xFilePreview->setImage( aImageFormat, rImage);
1053 +sal_Bool SAL_CALL ODMAFilePicker::setShowState( sal_Bool bShowState )
1054 + throw ( RuntimeException )
1056 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1057 + return xFilePreview->setShowState( bShowState);
1060 +sal_Bool SAL_CALL ODMAFilePicker::getShowState( )
1061 + throw ( RuntimeException )
1063 + Reference< XFilePreview > xFilePreview( m_xSystemFilePicker, UNO_QUERY );
1064 + return xFilePreview->getShowState();
1067 +// XFilterGroupManager functions
1069 +void SAL_CALL ODMAFilePicker::appendFilterGroup( const ::rtl::OUString& sGroupTitle,
1070 + const Sequence< StringPair >& aFilters )
1071 + throw ( IllegalArgumentException, RuntimeException )
1073 + Reference< XFilterGroupManager > xFilterGroupManager( m_xSystemFilePicker, UNO_QUERY );
1074 + xFilterGroupManager->appendFilterGroup( sGroupTitle, aFilters );
1077 +// XFilterManager functions
1079 +void SAL_CALL ODMAFilePicker::appendFilter( const rtl::OUString& aTitle,
1080 + const rtl::OUString& aFilter )
1081 + throw( IllegalArgumentException, RuntimeException )
1083 + Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
1084 + xFilterManager->appendFilter( aTitle, aFilter );
1087 +void SAL_CALL ODMAFilePicker::setCurrentFilter( const rtl::OUString& aTitle )
1088 + throw( IllegalArgumentException, RuntimeException )
1090 + Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
1091 + xFilterManager->setCurrentFilter( aTitle );
1094 +rtl::OUString SAL_CALL ODMAFilePicker::getCurrentFilter( )
1095 + throw( RuntimeException )
1097 + Reference< XFilterManager > xFilterManager( m_xSystemFilePicker, UNO_QUERY );
1098 + return xFilterManager->getCurrentFilter();
1101 +// XInitialization functions
1103 +void SAL_CALL ODMAFilePicker::initialize( const Sequence< Any >& aArguments )
1104 + throw ( Exception, RuntimeException )
1106 + if (aArguments.getLength( ) > 0)
1108 + Any aAny = aArguments[0];
1110 + if ( (aAny.getValueType() == ::getCppuType((sal_Int16*)0)) ||
1111 + (aAny.getValueType() == ::getCppuType((sal_Int8*)0)) )
1113 + sal_Int16 nTemplateId = -1;
1114 + aAny >>= nTemplateId;
1116 + switch (nTemplateId) {
1117 + case TemplateDescription::FILEOPEN_SIMPLE:
1118 + case TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
1119 + case TemplateDescription::FILEOPEN_PLAY:
1120 + case TemplateDescription::FILEOPEN_READONLY_VERSION:
1121 + case TemplateDescription::FILEOPEN_LINK_PREVIEW:
1122 + m_nDialogKind = OPEN;
1123 + break;
1124 + default:
1125 + m_nDialogKind = SAVE;
1130 + Reference< XInitialization > xInitialization( m_xSystemFilePicker, UNO_QUERY );
1131 + xInitialization->initialize( aArguments );
1134 +// XCancellable functions
1136 +void SAL_CALL ODMAFilePicker::cancel( )
1137 + throw( ::com::sun::star::uno::RuntimeException )
1139 + Reference< XCancellable > xCancellable( m_xSystemFilePicker, UNO_QUERY );
1140 + xCancellable->cancel();
1143 +// XEventListener functions
1145 +void SAL_CALL ODMAFilePicker::disposing( const ::com::sun::star::lang::EventObject& aEvent )
1146 + throw( RuntimeException )
1148 + Reference< XEventListener > xEventListener( m_xSystemFilePicker, UNO_QUERY );
1149 + xEventListener->disposing( aEvent );
1152 +// XServiceInfo functions
1154 +rtl::OUString SAL_CALL ODMAFilePicker::getImplementationName( )
1155 + throw( RuntimeException )
1157 + return impl_getStaticImplementationName();
1160 +sal_Bool SAL_CALL ODMAFilePicker::supportsService( const rtl::OUString& sServiceName )
1161 + throw( RuntimeException )
1163 + Sequence< rtl::OUString > seqServiceNames = getSupportedServiceNames();
1164 + const rtl::OUString* pArray = seqServiceNames.getConstArray();
1165 + for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
1167 + if ( sServiceName == pArray[i] )
1169 + return sal_True ;
1172 + return sal_False ;
1175 +Sequence< rtl::OUString > SAL_CALL ODMAFilePicker::getSupportedServiceNames( )
1176 + throw( RuntimeException )
1178 + return impl_getStaticSupportedServiceNames();
1181 +Sequence< rtl::OUString > ODMAFilePicker::impl_getStaticSupportedServiceNames( )
1183 + Sequence< rtl::OUString > seqServiceNames( 2 );
1184 + rtl::OUString* pArray = seqServiceNames.getArray();
1185 + pArray[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFilePicker" );
1187 + // Super-ugly, but check the function sal_Bool
1188 + // lcl_isSystemFilePicker( const Reference< XFilePicker >& ) in
1189 + // sfx2/source/dialog/filedlghelper.cxx
1191 + // Lovely undocumented coupling right across abstraction layers,
1192 + // isn't it? If we don't claim to implement this "service" (which
1193 + // is not defined in any IDL file, btw), we get hangs.
1195 + pArray[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" );
1196 + return seqServiceNames ;
1199 +rtl::OUString ODMAFilePicker::impl_getStaticImplementationName( )
1201 + return rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFilePicker" );
1204 +Reference< XInterface > SAL_CALL ODMAFilePicker::impl_createInstance(
1205 + const Reference< XComponentContext >& rxContext)
1206 + throw( Exception )
1208 + Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
1209 + return Reference< XInterface >( *new ODMAFilePicker( xServiceManager ) );
1211 --- fpicker/source/odma/ODMAFilePicker.hxx.old 1970-01-01 00:00:00.000000000 +0000
1212 +++ fpicker/source/odma/ODMAFilePicker.hxx 2009-04-06 16:42:16.000000000 +0000
1213 @@ -0,0 +1,242 @@
1214 +/*************************************************************************
1216 + * OpenOffice.org - a multi-platform office productivity suite
1218 + * $RCSfile$
1220 + * $Revision: 12010 $
1222 + * last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
1224 + * The Contents of this file are made available subject to
1225 + * the terms of GNU Lesser General Public License Version 2.1.
1228 + * GNU Lesser General Public License Version 2.1
1229 + * =============================================
1230 + * Copyright 2005 by Sun Microsystems, Inc.
1231 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1233 + * This library is free software; you can redistribute it and/or
1234 + * modify it under the terms of the GNU Lesser General Public
1235 + * License version 2.1, as published by the Free Software Foundation.
1237 + * This library is distributed in the hope that it will be useful,
1238 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1239 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1240 + * Lesser General Public License for more details.
1242 + * You should have received a copy of the GNU Lesser General Public
1243 + * License along with this library; if not, write to the Free Software
1244 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1245 + * MA 02111-1307 USA
1247 + ************************************************************************/
1248 +#ifndef INCLUDED_ODMA_FILEPICKER_HXX
1249 +#define INCLUDED_ODMA_FILEPICKER_HXX
1251 +#ifndef _CPPUHELPER_COMPBASE9_HXX_
1252 +#include <cppuhelper/compbase9.hxx>
1253 +#endif
1255 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_
1256 +#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
1257 +#endif
1258 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERNOTIFIER_HPP_
1259 +#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
1260 +#endif
1261 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPREVIEW_HPP_
1262 +#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
1263 +#endif
1264 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERMANAGER_HPP_
1265 +#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
1266 +#endif
1267 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERGROUPMANAGER_HPP_
1268 +#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
1269 +#endif
1270 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERLISTENER_HPP_
1271 +#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp>
1272 +#endif
1273 +#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_
1274 +#include <com/sun/star/util/XCancellable.hpp>
1275 +#endif
1276 +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
1277 +#include <com/sun/star/lang/XServiceInfo.hpp>
1278 +#endif
1279 +#ifndef _COM_SUN_STAR_UNO_XCOMPONENT_CONTEXT_HPP_
1280 +#include <com/sun/star/uno/XComponentContext.hpp>
1281 +#endif
1283 +#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
1284 +#include <com/sun/star/lang/XInitialization.hpp>
1285 +#endif
1287 +// class ODMAFilePicker ---------------------------------------------------
1289 +class ODMAFilePicker :
1290 + public cppu::WeakComponentImplHelper9<
1291 + ::com::sun::star::ui::dialogs::XFilterManager,
1292 + ::com::sun::star::ui::dialogs::XFilterGroupManager,
1293 + ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
1294 + ::com::sun::star::ui::dialogs::XFilePickerNotifier,
1295 + ::com::sun::star::ui::dialogs::XFilePreview,
1296 + ::com::sun::star::lang::XInitialization,
1297 + ::com::sun::star::util::XCancellable,
1298 + ::com::sun::star::lang::XEventListener,
1299 + ::com::sun::star::lang::XServiceInfo >
1301 +private:
1302 + sal_Bool m_bUseDMS;
1303 + sal_Bool m_bMultiSelectionMode;
1304 + rtl::OUString m_aDefaultName;
1305 + rtl::OUString m_aDisplayDirectory;
1306 + ::com::sun::star::uno::Sequence< rtl::OUString > m_aFiles;
1307 + enum { OPEN, SAVE } m_nDialogKind;
1309 + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xSystemFilePicker;
1311 +protected:
1312 + ::osl::Mutex m_rbHelperMtx;
1314 +public:
1316 + ODMAFilePicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
1318 + // XFilterManager functions
1320 + virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle,
1321 + const ::rtl::OUString& aFilter )
1322 + throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
1324 + virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle )
1325 + throw( ::com::sun::star::lang::IllegalArgumentException,
1326 + ::com::sun::star::uno::RuntimeException );
1328 + virtual ::rtl::OUString SAL_CALL getCurrentFilter( )
1329 + throw( ::com::sun::star::uno::RuntimeException );
1331 + // XFilterGroupManager functions
1333 + virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle,
1334 + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters )
1335 + throw (::com::sun::star::lang::IllegalArgumentException,
1336 + ::com::sun::star::uno::RuntimeException );
1338 + // XFilePickerControlAccess functions
1340 + virtual void SAL_CALL setValue( sal_Int16 nControlID,
1341 + sal_Int16 nControlAction,
1342 + const ::com::sun::star::uno::Any& aValue )
1343 + throw( ::com::sun::star::uno::RuntimeException );
1345 + virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 nControlID,
1346 + sal_Int16 nControlAction )
1347 + throw( ::com::sun::star::uno::RuntimeException );
1349 + virtual void SAL_CALL setLabel( sal_Int16 nControlID,
1350 + const ::rtl::OUString& aValue )
1351 + throw ( ::com::sun::star::uno::RuntimeException );
1353 + virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlID )
1354 + throw ( ::com::sun::star::uno::RuntimeException );
1356 + virtual void SAL_CALL enableControl( sal_Int16 nControlID,
1357 + sal_Bool bEnable )
1358 + throw( ::com::sun::star::uno::RuntimeException );
1360 + // XFilePicker functions
1362 + virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode )
1363 + throw( ::com::sun::star::uno::RuntimeException );
1365 + virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName )
1366 + throw( ::com::sun::star::uno::RuntimeException );
1368 + virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
1369 + throw( ::com::sun::star::lang::IllegalArgumentException,
1370 + ::com::sun::star::uno::RuntimeException );
1372 + virtual ::rtl::OUString SAL_CALL getDisplayDirectory( )
1373 + throw( ::com::sun::star::uno::RuntimeException );
1375 + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( )
1376 + throw( ::com::sun::star::uno::RuntimeException );
1378 + // XExecutableDialog functions
1380 + virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle )
1381 + throw (::com::sun::star::uno::RuntimeException);
1383 + virtual sal_Int16 SAL_CALL execute( )
1384 + throw (::com::sun::star::uno::RuntimeException);
1386 + // XFilePickerNotifier functions
1388 + virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener )
1389 + throw ( ::com::sun::star::uno::RuntimeException );
1391 + virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener )
1392 + throw ( ::com::sun::star::uno::RuntimeException );
1394 + // XFilePreview functions
1396 + virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( )
1397 + throw ( ::com::sun::star::uno::RuntimeException );
1399 + virtual sal_Int32 SAL_CALL getTargetColorDepth( )
1400 + throw ( ::com::sun::star::uno::RuntimeException );
1402 + virtual sal_Int32 SAL_CALL getAvailableWidth( )
1403 + throw ( ::com::sun::star::uno::RuntimeException );
1405 + virtual sal_Int32 SAL_CALL getAvailableHeight( )
1406 + throw ( ::com::sun::star::uno::RuntimeException );
1408 + virtual void SAL_CALL setImage( sal_Int16 aImageFormat,
1409 + const ::com::sun::star::uno::Any& aImage )
1410 + throw ( ::com::sun::star::lang::IllegalArgumentException,
1411 + ::com::sun::star::uno::RuntimeException );
1413 + virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState )
1414 + throw ( ::com::sun::star::uno::RuntimeException );
1416 + virtual sal_Bool SAL_CALL getShowState( )
1417 + throw ( ::com::sun::star::uno::RuntimeException );
1419 + // XInitialization functions
1421 + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
1422 + throw ( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
1424 + // XCancellable functions
1426 + virtual void SAL_CALL cancel( )
1427 + throw( ::com::sun::star::uno::RuntimeException );
1429 + // XEventListener functions
1431 + using cppu::WeakComponentImplHelperBase::disposing;
1432 + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent )
1433 + throw( ::com::sun::star::uno::RuntimeException );
1435 + // XServiceInfo functions
1437 + virtual ::rtl::OUString SAL_CALL getImplementationName( )
1438 + throw( ::com::sun::star::uno::RuntimeException );
1440 + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
1441 + throw( ::com::sun::star::uno::RuntimeException );
1443 + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
1444 + throw( ::com::sun::star::uno::RuntimeException );
1446 + /* Helper for XServiceInfo */
1447 + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames( );
1448 + static ::rtl::OUString impl_getStaticImplementationName( );
1450 + /* Helper for registry */
1451 + 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 )
1452 + throw( ::com::sun::star::uno::Exception );
1455 +#endif // INCLUDED_ODMA_FILEPICKER_HXX
1456 --- fpicker/source/odma/ODMAFolderPicker.cxx.old 1970-01-01 00:00:00.000000000 +0000
1457 +++ fpicker/source/odma/ODMAFolderPicker.cxx 2009-04-06 16:42:16.000000000 +0000
1458 @@ -0,0 +1,202 @@
1459 +/*************************************************************************
1461 + * OpenOffice.org - a multi-platform office productivity suite
1463 + * $RCSfile$
1465 + * $Revision: 12010 $
1467 + * last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
1469 + * The Contents of this file are made available subject to
1470 + * the terms of GNU Lesser General Public License Version 2.1.
1473 + * GNU Lesser General Public License Version 2.1
1474 + * =============================================
1475 + * Copyright 2005 by Sun Microsystems, Inc.
1476 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1478 + * This library is free software; you can redistribute it and/or
1479 + * modify it under the terms of the GNU Lesser General Public
1480 + * License version 2.1, as published by the Free Software Foundation.
1482 + * This library is distributed in the hope that it will be useful,
1483 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1484 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1485 + * Lesser General Public License for more details.
1487 + * You should have received a copy of the GNU Lesser General Public
1488 + * License along with this library; if not, write to the Free Software
1489 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1490 + * MA 02111-1307 USA
1492 + ************************************************************************/
1494 +// MARKER(update_precomp.py): autogen include statement, do not remove
1495 +#include "precompiled_fpicker.hxx"
1497 +#include "ODMAFolderPicker.hxx"
1499 +#define _SVSTDARR_STRINGSDTOR
1500 +#include "svtools/svstdarr.hxx"
1502 +#ifndef _COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HPP_
1503 +#include <com/sun/star/container/XContentEnumerationAccess.hpp>
1504 +#endif
1505 +#ifndef _COM_SUN_STAR_CONTAINER_XSET_HPP_
1506 +#include <com/sun/star/container/XSet.hpp>
1507 +#endif
1508 +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
1509 +#include <com/sun/star/uno/Any.hxx>
1510 +#endif
1511 +#ifndef _CPPUHELPER_FACTORY_HXX_
1512 +#include <cppuhelper/factory.hxx>
1513 +#endif
1514 +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
1515 +#include <com/sun/star/beans/XPropertySet.hpp>
1516 +#endif
1518 +#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
1519 +#include <svtools/pathoptions.hxx>
1520 +#endif
1522 +#ifndef ODMA_LIB_HXX
1523 +#include <tools/prewin.h>
1524 +#include <odma_lib.hxx>
1525 +#include <tools/postwin.h>
1526 +#endif
1528 +// using ----------------------------------------------------------------
1530 +using namespace ::com::sun::star::beans;
1531 +using namespace ::com::sun::star::container;
1532 +using namespace ::com::sun::star::lang;
1533 +using namespace ::com::sun::star::uno;
1535 +//------------------------------------------------------------------------------------
1536 +// class ODMAFolderPicker
1537 +//------------------------------------------------------------------------------------
1539 +//------------------------------------------------------------------------------------
1540 +ODMAFolderPicker::ODMAFolderPicker( const Reference < XMultiServiceFactory >& xFactory ) :
1541 + cppu::WeakComponentImplHelper2<
1542 + XFolderPicker,
1543 + XServiceInfo>( m_rbHelperMtx ),
1544 + m_bUseDMS( sal_False )
1546 + m_xInterface = xFactory->createInstance(
1547 + ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" ) );
1550 +// XExecutableDialog functions
1552 +void SAL_CALL ODMAFolderPicker::setTitle( const ::rtl::OUString& _rTitle ) throw (RuntimeException)
1554 + if (m_bUseDMS)
1555 + return;
1557 + Reference< XExecutableDialog > xExecutableDialog( m_xInterface, UNO_QUERY );
1558 + xExecutableDialog->setTitle( _rTitle);
1561 +sal_Int16 SAL_CALL ODMAFolderPicker::execute( )
1562 + throw (RuntimeException)
1564 + if (m_bUseDMS)
1565 + throw new RuntimeException( );
1567 + Reference< XExecutableDialog > xExecutableDialog( m_xInterface, UNO_QUERY );
1568 + return xExecutableDialog->execute();
1571 +// XFolderPicker functions
1573 +void SAL_CALL ODMAFolderPicker::setDisplayDirectory( const ::rtl::OUString& aDirectory )
1574 + throw( IllegalArgumentException, RuntimeException )
1576 + if (m_bUseDMS)
1577 + return;
1579 + Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
1580 + xFolderPicker->setDisplayDirectory( aDirectory );
1583 +::rtl::OUString SAL_CALL ODMAFolderPicker::getDisplayDirectory( )
1584 + throw( RuntimeException )
1586 + if (m_bUseDMS)
1587 + return rtl::OUString();
1589 + Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
1590 + return xFolderPicker->getDisplayDirectory();
1593 +::rtl::OUString SAL_CALL ODMAFolderPicker::getDirectory( )
1594 + throw( RuntimeException )
1596 + if (m_bUseDMS)
1597 + return rtl::OUString();
1599 + Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
1600 + return xFolderPicker->getDirectory();
1603 +void SAL_CALL ODMAFolderPicker::setDescription( const ::rtl::OUString& aDescription )
1604 + throw( RuntimeException )
1606 + if (m_bUseDMS)
1607 + return;
1609 + Reference< XFolderPicker > xFolderPicker( m_xInterface, UNO_QUERY );
1610 + xFolderPicker->setDescription( aDescription );
1613 +// XServiceInfo
1615 +::rtl::OUString SAL_CALL ODMAFolderPicker::getImplementationName( )
1616 + throw( RuntimeException )
1618 + return impl_getStaticImplementationName();
1621 +sal_Bool SAL_CALL ODMAFolderPicker::supportsService( const ::rtl::OUString& sServiceName )
1622 + throw( RuntimeException )
1624 + Sequence< ::rtl::OUString > seqServiceNames = getSupportedServiceNames();
1625 + const ::rtl::OUString* pArray = seqServiceNames.getConstArray();
1626 + for ( sal_Int32 i = 0; i < seqServiceNames.getLength(); i++ )
1628 + if ( sServiceName == pArray[i] )
1630 + return sal_True ;
1633 + return sal_False ;
1636 +Sequence< ::rtl::OUString > SAL_CALL ODMAFolderPicker::getSupportedServiceNames()
1637 + throw( RuntimeException )
1639 + return impl_getStaticSupportedServiceNames();
1642 +Sequence< ::rtl::OUString > ODMAFolderPicker::impl_getStaticSupportedServiceNames( )
1644 + Sequence< ::rtl::OUString > seqServiceNames( 1 );
1645 + ::rtl::OUString* pArray = seqServiceNames.getArray();
1646 + pArray[0] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFolderPicker" );
1647 + return seqServiceNames ;
1650 +::rtl::OUString ODMAFolderPicker::impl_getStaticImplementationName( )
1652 + return ::rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFolderPicker" );
1655 +Reference< XInterface > SAL_CALL ODMAFolderPicker::impl_createInstance( const Reference< XComponentContext >& rxContext )
1656 + throw( Exception )
1658 + Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW);
1659 + return Reference< XInterface >( *new ODMAFolderPicker( xServiceManager ) );
1661 --- fpicker/source/odma/ODMAFolderPicker.hxx.old 1970-01-01 00:00:00.000000000 +0000
1662 +++ fpicker/source/odma/ODMAFolderPicker.hxx 2009-04-06 16:42:16.000000000 +0000
1663 @@ -0,0 +1,118 @@
1664 +/*************************************************************************
1666 + * OpenOffice.org - a multi-platform office productivity suite
1668 + * $RCSfile$
1670 + * $Revision: 12010 $
1672 + * last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
1674 + * The Contents of this file are made available subject to
1675 + * the terms of GNU Lesser General Public License Version 2.1.
1678 + * GNU Lesser General Public License Version 2.1
1679 + * =============================================
1680 + * Copyright 2005 by Sun Microsystems, Inc.
1681 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1683 + * This library is free software; you can redistribute it and/or
1684 + * modify it under the terms of the GNU Lesser General Public
1685 + * License version 2.1, as published by the Free Software Foundation.
1687 + * This library is distributed in the hope that it will be useful,
1688 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1689 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1690 + * Lesser General Public License for more details.
1692 + * You should have received a copy of the GNU Lesser General Public
1693 + * License along with this library; if not, write to the Free Software
1694 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1695 + * MA 02111-1307 USA
1697 + ************************************************************************/
1698 +#ifndef INCLUDED_ODMA_FOLDERPICKER_HXX
1699 +#define INCLUDED_ODMA_FOLDERPICKER_HXX
1701 +#ifndef _CPPUHELPER_COMPBASE2_HXX_
1702 +#include <cppuhelper/compbase2.hxx>
1703 +#endif
1705 +#ifndef _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HPP_
1706 +#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
1707 +#endif
1708 +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
1709 +#include <com/sun/star/lang/XServiceInfo.hpp>
1710 +#endif
1711 +#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
1712 +#include <com/sun/star/lang/XSingleServiceFactory.hpp>
1713 +#endif
1714 +#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
1715 +#include <com/sun/star/lang/DisposedException.hpp>
1716 +#endif
1717 +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
1718 +#include <com/sun/star/uno/XComponentContext.hpp>
1719 +#endif
1721 +// class ODMAFolderPicker ---------------------------------------------------
1723 +class ODMAFolderPicker :
1724 + public cppu::WeakComponentImplHelper2<
1725 + ::com::sun::star::ui::dialogs::XFolderPicker,
1726 + ::com::sun::star::lang::XServiceInfo >
1728 +private:
1729 + sal_Bool m_bUseDMS;
1731 +protected:
1732 + ::osl::Mutex m_rbHelperMtx;
1734 + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xInterface;
1736 +public:
1737 + ODMAFolderPicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
1739 + // XFolderPicker functions
1741 + virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory )
1742 + throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
1744 + virtual ::rtl::OUString SAL_CALL getDisplayDirectory( )
1745 + throw( ::com::sun::star::uno::RuntimeException );
1747 + virtual ::rtl::OUString SAL_CALL getDirectory( )
1748 + throw( ::com::sun::star::uno::RuntimeException );
1750 + virtual void SAL_CALL setDescription( const ::rtl::OUString& aDescription )
1751 + throw ( ::com::sun::star::uno::RuntimeException );
1753 + // XExecutableDialog functions
1755 + virtual void SAL_CALL setTitle( const ::rtl::OUString& _rTitle )
1756 + throw (::com::sun::star::uno::RuntimeException);
1758 + virtual sal_Int16 SAL_CALL execute( )
1759 + throw (::com::sun::star::uno::RuntimeException);
1761 + // XServiceInfo functions
1763 + virtual ::rtl::OUString SAL_CALL getImplementationName( )
1764 + throw( ::com::sun::star::uno::RuntimeException );
1766 + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName )
1767 + throw( ::com::sun::star::uno::RuntimeException );
1769 + virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
1770 + throw( ::com::sun::star::uno::RuntimeException );
1772 + /* Helper for XServiceInfo */
1773 + static com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames( );
1774 + static ::rtl::OUString impl_getStaticImplementationName( );
1776 + /* Helper for registry */
1777 + 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 )
1778 + throw( com::sun::star::uno::Exception );
1781 +#endif // INCLUDED_ODMA_FOLDERPICKER_HXX
1782 --- fpicker/source/odma/exports.map.old 1970-01-01 00:00:00.000000000 +0000
1783 +++ fpicker/source/odma/exports.map 2009-04-06 16:42:16.000000000 +0000
1784 @@ -0,0 +1,8 @@
1785 +UDK_3_0_0 {
1786 + global:
1787 + component_getImplementationEnvironment;
1788 + component_writeInfo;
1789 + component_getFactory;
1790 + local:
1791 + *;
1793 --- fpicker/source/odma/fps_odma.cxx.old 1970-01-01 00:00:00.000000000 +0000
1794 +++ fpicker/source/odma/fps_odma.cxx 2009-04-06 16:42:16.000000000 +0000
1795 @@ -0,0 +1,90 @@
1796 +/*************************************************************************
1798 + * OpenOffice.org - a multi-platform office productivity suite
1800 + * $RCSfile$
1802 + * $Revision: 12010 $
1804 + * last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
1806 + * The Contents of this file are made available subject to
1807 + * the terms of GNU Lesser General Public License Version 2.1.
1810 + * GNU Lesser General Public License Version 2.1
1811 + * =============================================
1812 + * Copyright 2005 by Sun Microsystems, Inc.
1813 + * 901 San Antonio Road, Palo Alto, CA 94303, USA
1815 + * This library is free software; you can redistribute it and/or
1816 + * modify it under the terms of the GNU Lesser General Public
1817 + * License version 2.1, as published by the Free Software Foundation.
1819 + * This library is distributed in the hope that it will be useful,
1820 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1821 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1822 + * Lesser General Public License for more details.
1824 + * You should have received a copy of the GNU Lesser General Public
1825 + * License along with this library; if not, write to the Free Software
1826 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1827 + * MA 02111-1307 USA
1829 + ************************************************************************/
1832 +// MARKER(update_precomp.py): autogen include statement, do not remove
1833 +#include "precompiled_fpicker.hxx"
1835 +#ifndef _SAL_TYPES_H_
1836 +#include "sal/types.h"
1837 +#endif
1839 +#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
1840 +#include "cppuhelper/implementationentry.hxx"
1841 +#endif
1843 +#include "ODMAFilePicker.hxx"
1844 +#include "ODMAFolderPicker.hxx"
1846 +static cppu::ImplementationEntry g_entries[] =
1849 + ODMAFilePicker::impl_createInstance,
1850 + ODMAFilePicker::impl_getStaticImplementationName,
1851 + ODMAFilePicker::impl_getStaticSupportedServiceNames,
1852 + cppu::createSingleComponentFactory, 0, 0
1853 + },
1855 + ODMAFolderPicker::impl_createInstance,
1856 + ODMAFolderPicker::impl_getStaticImplementationName,
1857 + ODMAFolderPicker::impl_getStaticSupportedServiceNames,
1858 + cppu::createSingleComponentFactory, 0, 0
1859 + },
1860 + { 0, 0, 0, 0, 0, 0 }
1863 +extern "C"
1865 +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
1866 + const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */)
1868 + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
1871 +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo (
1872 + void * pServiceManager, void * pRegistryKey)
1874 + return cppu::component_writeInfoHelper (
1875 + pServiceManager, pRegistryKey, g_entries);
1878 +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
1879 + const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
1881 + return cppu::component_getFactoryHelper (
1882 + pImplementationName, pServiceManager, pRegistryKey, g_entries);
1885 +} // extern "C"
1886 --- fpicker/source/odma/makefile.mk.old 1970-01-01 00:00:00.000000000 +0000
1887 +++ fpicker/source/odma/makefile.mk 2009-04-06 16:42:16.000000000 +0000
1888 @@ -0,0 +1,79 @@
1889 +#*************************************************************************
1891 +# OpenOffice.org - a multi-platform office productivity suite
1893 +# $RCSfile$
1895 +# $Revision: 12010 $
1897 +# last change: $Author: tml $ $Date: 2008-03-26 02:30:23 +0200 (on, 26 mar 2008) $
1899 +# The Contents of this file are made available subject to
1900 +# the terms of GNU Lesser General Public License Version 2.1.
1903 +# GNU Lesser General Public License Version 2.1
1904 +# =============================================
1905 +# Copyright 2005 by Sun Microsystems, Inc.
1906 +# 901 San Antonio Road, Palo Alto, CA 94303, USA
1908 +# This library is free software; you can redistribute it and/or
1909 +# modify it under the terms of the GNU Lesser General Public
1910 +# License version 2.1, as published by the Free Software Foundation.
1912 +# This library is distributed in the hope that it will be useful,
1913 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1914 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1915 +# Lesser General Public License for more details.
1917 +# You should have received a copy of the GNU Lesser General Public
1918 +# License along with this library; if not, write to the Free Software
1919 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1920 +# MA 02111-1307 USA
1922 +#*************************************************************************
1924 +PRJ=..$/..
1926 +PRJNAME=fpicker
1927 +TARGET=fps_odma
1928 +LIBTARGET=NO
1929 +ENABLE_EXCEPTIONS=TRUE
1930 +GEN_HID=TRUE
1932 +# --- Settings -----------------------------------------------------
1934 +.INCLUDE : settings.mk
1935 +DLLPRE=
1937 +# --- Files --------------------------------------------------------
1939 +SLOFILES=\
1940 + $(SLO)$/ODMAFilePicker.obj \
1941 + $(SLO)$/ODMAFolderPicker.obj \
1942 + $(SLO)$/fps_odma.obj
1944 +SHL1TARGET= $(TARGET).uno
1945 +SHL1IMPLIB= i$(TARGET)
1946 +SHL1OBJS= $(SLOFILES)
1947 +SHL1STDLIBS=\
1948 + $(ODMA_LIB_LIB) \
1949 + $(SVTOOLLIB) \
1950 + $(TKLIB) \
1951 + $(VCLLIB) \
1952 + $(SVLLIB) \
1953 + $(UNOTOOLSLIB) \
1954 + $(TOOLSLIB) \
1955 + $(UCBHELPERLIB) \
1956 + $(COMPHELPERLIB) \
1957 + $(CPPUHELPERLIB) \
1958 + $(CPPULIB) \
1959 + $(SALLIB)
1961 +SHL1VERSIONMAP=exports.map
1962 +SHL1DEF= $(MISC)$/$(SHL1TARGET).def
1963 +DEF1NAME= $(SHL1TARGET)
1965 +# --- Targets ------------------------------------------------------
1967 +.INCLUDE : target.mk
1968 --- solenv/inc/libs.mk.old 2009-04-06 16:42:01.000000000 +0000
1969 +++ solenv/inc/libs.mk 2009-04-06 16:42:16.000000000 +0000
1970 @@ -32,6 +32,9 @@ LIBSMKREV!:="$$Revision: 1.134.2.3 $$"
1972 .IF ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
1974 +# No ODMA on UNX
1975 +ODMA_LIB_LIB=
1978 #externe libs in plattform.mk
1980 @@ -357,6 +360,7 @@ UNOPKGAPPLIB=-lunopkgapp
1982 .ELSE # ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
1984 +ODMA_LIB_LIB=odma_lib.lib
1985 AWTLIB*=jawt.lib
1986 AVMEDIALIB=iavmedia.lib
1987 ICUINLIB=icuin.lib
1988 --- svtools/inc/svtools/miscopt.hxx.old 2009-04-02 11:06:22.000000000 +0000
1989 +++ svtools/inc/svtools/miscopt.hxx 2009-04-06 16:42:16.000000000 +0000
1990 @@ -113,6 +113,10 @@ class SVT_DLLPUBLIC SvtMiscOptions: publ
1991 void SetUseSystemFileDialog( sal_Bool bSet );
1992 sal_Bool IsUseSystemFileDialogReadOnly() const;
1994 + sal_Bool TryODMADialog() const;
1995 + void SetTryODMADialog( sal_Bool bSet );
1996 + sal_Bool IsTryUseODMADialogReadOnly() const;
1998 sal_Bool IsPluginsEnabled() const;
1999 void SetPluginsEnabled( sal_Bool bEnable );
2000 sal_Bool IsPluginsEnabledReadOnly() const;
2001 --- svtools/source/config/miscopt.cxx.old 2009-04-02 11:06:16.000000000 +0000
2002 +++ svtools/source/config/miscopt.cxx 2009-04-06 16:42:16.000000000 +0000
2003 @@ -85,8 +85,10 @@ using namespace ::com::sun::star;
2004 #define PROPERTYHANDLE_SYMBOLSTYLE 4
2005 #define PROPERTYNAME_USESYSTEMPRINTDIALOG ASCII_STR("UseSystemPrintDialog")
2006 #define PROPERTYHANDLE_USESYSTEMPRINTDIALOG 5
2007 +#define PROPERTYNAME_TRYODMADIALOG ASCII_STR("TryODMADialog")
2008 +#define PROPERTYHANDLE_TRYODMADIALOG 6
2010 -#define PROPERTYCOUNT 6
2011 +#define PROPERTYCOUNT 7
2013 #define VCL_TOOLBOX_STYLE_FLAT ((USHORT)0x0004) // from <vcl/toolbox.hxx>
2015 @@ -106,6 +108,8 @@ class SvtMiscOptions_Impl : public Confi
2016 LinkList aList;
2017 sal_Bool m_bUseSystemFileDialog;
2018 sal_Bool m_bIsUseSystemFileDialogRO;
2019 + sal_Bool m_bTryODMADialog;
2020 + sal_Bool m_bIsTryODMADialogRO;
2021 sal_Bool m_bPluginsEnabled;
2022 sal_Bool m_bIsPluginsEnabledRO;
2023 sal_Int16 m_nSymbolsSize;
2024 @@ -183,6 +187,15 @@ class SvtMiscOptions_Impl : public Confi
2025 inline sal_Bool IsUseSystemFileDialogReadOnly() const
2026 { return m_bIsUseSystemFileDialogRO; }
2028 + inline sal_Bool TryODMADialog() const
2029 + { return m_bTryODMADialog; }
2031 + inline void SetTryODMADialog( sal_Bool bSet )
2032 + { m_bTryODMADialog = bSet; SetModified(); }
2034 + inline sal_Bool IsTryUseODMADialogReadOnly() const
2035 + { return m_bIsTryODMADialogRO; }
2037 inline sal_Bool IsPluginsEnabled() const
2038 { return m_bPluginsEnabled; }
2040 @@ -305,6 +318,8 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl
2042 , m_bUseSystemFileDialog( sal_False )
2043 , m_bIsUseSystemFileDialogRO( sal_False )
2044 + , m_bTryODMADialog( sal_False )
2045 + , m_bIsTryODMADialogRO( sal_False )
2046 , m_bPluginsEnabled( sal_False )
2047 , m_bIsPluginsEnabledRO( sal_False )
2048 , m_nSymbolsSize( 0 )
2049 @@ -386,6 +401,16 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl
2050 break;
2053 + case PROPERTYHANDLE_TRYODMADIALOG :
2055 + if( !(seqValues[nProperty] >>= m_bTryODMADialog) )
2057 + DBG_ERROR("Wrong type of \"Misc\\TryODMADialog\"!" );
2059 + m_bIsTryODMADialogRO = seqRO[nProperty];
2060 + break;
2063 case PROPERTYHANDLE_SYMBOLSTYLE :
2065 ::rtl::OUString aSymbolsStyle;
2066 @@ -489,6 +514,13 @@ void SvtMiscOptions_Impl::Load( const Se
2069 break;
2070 + case PROPERTYHANDLE_TRYODMADIALOG : {
2071 + if( !(seqValues[nProperty] >>= m_bTryODMADialog) )
2073 + DBG_ERROR("Wrong type of \"Misc\\TryODMADialog\"!" );
2076 + break;
2077 case PROPERTYHANDLE_SYMBOLSTYLE : {
2078 ::rtl::OUString aSymbolsStyle;
2079 if( seqValues[nProperty] >>= aSymbolsStyle )
2080 @@ -635,6 +667,13 @@ void SvtMiscOptions_Impl::Commit()
2081 break;
2084 + case PROPERTYHANDLE_TRYODMADIALOG :
2086 + if ( !m_bIsTryODMADialogRO )
2087 + seqValues[nProperty] <<= m_bTryODMADialog;
2088 + break;
2091 case PROPERTYHANDLE_SYMBOLSTYLE :
2093 if ( !m_bIsSymbolsStyleRO )
2094 @@ -667,7 +706,8 @@ Sequence< OUString > SvtMiscOptions_Impl
2095 PROPERTYNAME_TOOLBOXSTYLE,
2096 PROPERTYNAME_USESYSTEMFILEDIALOG,
2097 PROPERTYNAME_SYMBOLSTYLE,
2098 - PROPERTYNAME_USESYSTEMPRINTDIALOG
2099 + PROPERTYNAME_USESYSTEMPRINTDIALOG,
2100 + PROPERTYNAME_TRYODMADIALOG
2103 // Initialize return sequence with these list ...
2104 @@ -735,6 +775,21 @@ sal_Bool SvtMiscOptions::IsUseSystemFile
2105 return m_pDataContainer->IsUseSystemFileDialogReadOnly();
2108 +sal_Bool SvtMiscOptions::TryODMADialog() const
2110 + return m_pDataContainer->TryODMADialog();
2113 +void SvtMiscOptions::SetTryODMADialog( sal_Bool bEnable )
2115 + m_pDataContainer->SetTryODMADialog( bEnable );
2118 +sal_Bool SvtMiscOptions::IsTryUseODMADialogReadOnly() const
2120 + return m_pDataContainer->IsTryUseODMADialogReadOnly();
2123 sal_Bool SvtMiscOptions::IsPluginsEnabled() const
2125 return m_pDataContainer->IsPluginsEnabled();
2126 --- officecfg/registry/schema/org/openoffice/Office/Common.xcs.old 2009-04-06 16:42:14.000000000 +0000
2127 +++ officecfg/registry/schema/org/openoffice/Office/Common.xcs 2009-04-06 16:42:16.000000000 +0000
2128 @@ -5638,6 +5638,13 @@ Dymamic border coloring means that when
2129 </info>
2130 <value>false</value>
2131 </prop>
2132 + <prop oor:name="TryODMADialog" oor:type="xs:boolean">
2133 + <info>
2134 + <author>tml</author>
2135 + <desc>Determines whether to show the document creation and selection of the machine's default ODMA (Open Document Management Architecture) DMS (Document Management System). If true, and the machine has a DMS available, the DMS's dialog will be displayed. That dialog then gives the opportunity to use the application's dialog instead, which means the normal system file and folder pickers will be displayed. Relevant only on Windows.</desc>
2136 + </info>
2137 + <value>false</value>
2138 + </prop>
2139 <prop oor:name="SymbolSet" oor:type="xs:short">
2140 <!-- UIHints: Tools Options General View -->
2141 <info>
2142 --- svx/source/cui/optgdlg.src
2143 +++ svx/source/cui/optgdlg.src
2144 @@ -115,34 +115,41 @@ TabPage OFA_TP_MISC
2145 Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
2146 Text [ en-US ] = "~Use %PRODUCTNAME dialogs";
2148 + CheckBox CB_ODMADLG
2150 + Pos = MAP_APPFONT( COL1, ROW8 );
2151 + Size = MAP_APPFONT( WHOLE_WIDTH - COL4, RSC_CD_CHECKBOX_HEIGHT );
2152 + Text [ en-US ] = "Show ODMA DMS dialogs first";
2153 + Text [ en-GB ] = "Show ODMA DMS dialogues first";
2154 + };
2155 FixedLine FL_DOCSTATUS
2157 - Pos = MAP_APPFONT( COL0, ROW8 );
2158 + Pos = MAP_APPFONT( COL0, ROW9 );
2159 Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
2160 Text [ en-US ] = "Document status";
2162 CheckBox CB_DOCSTATUS
2164 - Pos = MAP_APPFONT( COL1, ROW9 );
2165 + Pos = MAP_APPFONT( COL1, ROW10 );
2166 Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
2167 Text [ en-US ] = "~Printing sets \"document modified\" status";
2169 FixedLine FL_TWOFIGURE
2171 - Pos = MAP_APPFONT( COL0, ROW10 );
2172 + Pos = MAP_APPFONT( COL0, ROW11 );
2173 Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
2174 Text [ en-US ] = "Year (two digits)" ;
2176 FixedText FT_INTERPRET
2178 - Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
2179 + Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
2180 Size = MAP_APPFONT( DIFF( COL1, COL3), RSC_CD_FIXEDTEXT_HEIGHT );
2181 Text [ en-US ] = "Interpret as years between";
2183 NumericField NF_YEARVALUE
2185 Border = TRUE ;
2186 - Pos = MAP_APPFONT( COL4, ROW11 );
2187 + Pos = MAP_APPFONT( COL4, ROW12 );
2188 Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
2189 Minimum = 1583 ;
2190 Maximum = 9857 ;
2191 @@ -151,7 +158,7 @@ TabPage OFA_TP_MISC
2193 FixedText FT_TOYEAR
2195 - Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW11) );
2196 + Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
2197 Size = MAP_APPFONT( WHOLE_WIDTH - COL6, RSC_CD_FIXEDTEXT_HEIGHT );
2198 Text [ en-US ] = "and " ;
2200 --- svx/source/cui/optgdlg.hrc
2201 +++ svx/source/cui/optgdlg.hrc
2202 @@ -56,9 +56,10 @@
2203 #define ROW6 (ROW5+RSC_CD_DROPDOWN_HEIGHT+ROWSPACE)
2204 #define ROW7 (ROW6+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
2205 #define ROW8 (ROW7+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
2206 -#define ROW9 (ROW8+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
2207 -#define ROW10 (ROW9+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
2208 -#define ROW11 (ROW10+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
2209 +#define ROW9 (ROW8+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
2210 +#define ROW10 (ROW9+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
2211 +#define ROW11 (ROW10+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
2212 +#define ROW12 (ROW11+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
2214 #define DIFF(v1,v2) (v2-v1)
2215 #define OFFS_TEXTBOX_FIXEDTEXT(base) (base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
2216 @@ -190,6 +191,7 @@
2217 #define FT_HELPAGENT_TIME_UNIT 59
2218 #define FL_DOCSTATUS 60
2219 #define CB_DOCSTATUS 61
2220 +#define CB_ODMADLG 62
2221 #endif // #ifndef _SVX_OPTGDLG_HRC
2223 // ******************************************************************* EOF
2224 --- svx/source/cui/optgdlg.hxx
2225 +++ svx/source/cui/optgdlg.hxx
2226 @@ -59,6 +59,7 @@ private:
2227 FixedLine aFileDlgFL;
2228 ReadOnlyImage aFileDlgROImage;
2229 CheckBox aFileDlgCB;
2230 + CheckBox aODMADlgCB;
2232 FixedLine aPrintDlgFL;
2233 CheckBox aPrintDlgCB;
2234 @@ -77,6 +78,9 @@ private:
2235 DECL_LINK( TwoFigureConfigHdl, NumericField* );
2236 DECL_LINK( HelpCheckHdl_Impl, CheckBox* );
2237 DECL_LINK( HelpAgentResetHdl_Impl, PushButton* );
2238 +#ifdef WNT
2239 + DECL_LINK( OnFileDlgToggled, CheckBox* );
2240 +#endif
2241 protected:
2242 virtual int DeactivatePage( SfxItemSet* pSet = NULL );
2244 --- svx/source/cui/optgdlg.cxx
2245 +++ svx/source/cui/optgdlg.cxx
2246 @@ -198,6 +198,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* p
2247 aFileDlgFL ( this, SVX_RES( FL_FILEDLG ) ),
2248 aFileDlgROImage ( this, SVX_RES( FI_FILEDLG_RO ) ),
2249 aFileDlgCB ( this, SVX_RES( CB_FILEDLG ) ),
2250 + aODMADlgCB ( this, SVX_RES( CB_ODMADLG ) ),
2251 aPrintDlgFL ( this, SVX_RES( FL_PRINTDLG ) ),
2252 aPrintDlgCB ( this, SVX_RES( CB_PRINTDLG ) ),
2253 aDocStatusFL ( this, SVX_RES( FL_DOCSTATUS ) ),
2254 @@ -228,6 +229,31 @@ OfaMiscTabPage::OfaMiscTabPage(Window* p
2255 aPrintDlgCB.Hide();
2256 #endif
2258 +#ifdef WNT
2259 + aFileDlgCB.SetToggleHdl( LINK( this, OfaMiscTabPage, OnFileDlgToggled ) );
2260 +#else
2262 + aODMADlgCB.Hide();
2263 + // rearrange the following controls
2264 + Point aNewPos = aDocStatusFL.GetPosPixel();
2265 + long nDelta = aNewPos.Y() - aODMADlgCB.GetPosPixel().Y();
2267 + Window* pWins[] =
2269 + &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
2270 + &aInterpretFT, &aYearValueField, &aToYearFT
2271 + };
2272 + Window** pCurrent = pWins;
2273 + const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
2274 + for ( sal_Int32 i = 0; i < nCount; ++i, ++pCurrent )
2276 + aNewPos = (*pCurrent)->GetPosPixel();
2277 + aNewPos.Y() -= nDelta;
2278 + (*pCurrent)->SetPosPixel( aNewPos );
2281 +#endif
2283 if ( !aFileDlgCB.IsVisible() )
2285 // rearrange the following controls
2286 @@ -317,6 +343,14 @@ OfaMiscTabPage::OfaMiscTabPage(Window* p
2290 +#ifdef WNT
2291 +IMPL_LINK( OfaMiscTabPage, OnFileDlgToggled, CheckBox*, EMPTYARG )
2293 + aODMADlgCB.Enable( !aFileDlgCB.IsChecked() );
2294 + return 0;
2296 +#endif
2298 // -----------------------------------------------------------------------
2300 OfaMiscTabPage::~OfaMiscTabPage()
2301 @@ -371,6 +405,13 @@ BOOL OfaMiscTabPage::FillItemSet( SfxIte
2302 bModified = TRUE;
2305 + if ( aODMADlgCB.IsChecked() != aODMADlgCB.GetSavedValue() )
2307 + SvtMiscOptions aMiscOpt;
2308 + aMiscOpt.SetTryODMADialog( aODMADlgCB.IsChecked() );
2309 + bModified = TRUE;
2312 if ( aDocStatusCB.IsChecked() != aDocStatusCB.GetSavedValue() )
2314 SvtPrintWarningOptions aPrintOptions;
2315 @@ -420,6 +461,9 @@ void OfaMiscTabPage::Reset( const SfxIte
2316 aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
2317 aPrintDlgCB.SaveValue();
2319 + aODMADlgCB.Check( aMiscOpt.TryODMADialog() );
2320 + aODMADlgCB.SaveValue();
2322 SvtPrintWarningOptions aPrintOptions;
2323 aDocStatusCB.Check(aPrintOptions.IsModifyDocumentOnPrintingAllowed());
2324 aDocStatusCB.SaveValue();
2325 --- solenv/bin/modules/installer/windows/component.pm.old 2009-04-02 10:53:07.000000000 +0000
2326 +++ solenv/bin/modules/installer/windows/component.pm 2009-04-06 16:42:16.000000000 +0000
2327 @@ -132,6 +132,11 @@ sub get_file_component_directory
2328 return $installer::globals::templatefolder;
2331 + if ( $destdir =~ /\bPREDEFINED_OSWINSHELLNEWDIR\b/ )
2333 + return "WindowsShellNewFolder";
2336 my $destination = $onefile->{'destination'};
2338 installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
2339 --- solenv/bin/modules/installer/windows/directory.pm.old 2009-04-02 10:53:07.000000000 +0000
2340 +++ solenv/bin/modules/installer/windows/directory.pm 2009-04-06 16:42:16.000000000 +0000
2341 @@ -273,6 +273,12 @@ sub add_root_directories
2342 my $oneline = "TARGETDIR\t\tSourceDir\n";
2343 push(@{$directorytableref}, $oneline);
2345 + $oneline = "WindowsFolder\tTARGETDIR\tWindows\n";
2346 + push(@{$directorytableref}, $oneline);
2348 + $oneline = "WindowsShellNewFolder\tWindowsFolder\tShellNew\n";
2349 + push(@{$directorytableref}, $oneline);
2351 my $sourcediraddon = "";
2352 if (($installer::globals::addchildprojects) ||
2353 ($installer::globals::patch) ||
2354 --- scp2/source/ooo/directory_ooo.scp.old 2009-04-06 16:41:55.000000000 +0000
2355 +++ scp2/source/ooo/directory_ooo.scp 2009-04-06 16:42:16.000000000 +0000
2356 @@ -166,6 +166,11 @@ Directory gid_Dir_Shellnew
2357 DosName = "shellnew";
2360 +Directory gid_Dir_ShellnewToo
2361 + ParentID = gid_Dir_Program;
2362 + DosName = "shellnew2";
2363 +End
2365 #endif
2367 Directory gid_Dir_User
2368 --- scp2/source/ooo/file_ooo.scp.old 2009-04-02 10:51:54.000000000 +0000
2369 +++ scp2/source/ooo/file_ooo.scp 2009-04-06 16:42:16.000000000 +0000
2370 @@ -2294,24 +2294,56 @@ End
2372 STD_SHELLNEW_FILE(gid_File_Shellnew_Ods_Soffice, soffice.ods)
2374 +File gid_File_Shellnew2_Ods_Soffice
2375 + TXT_FILE_BODY;
2376 + Styles = (PACKED,WORKSTATION, OVERWRITE);
2377 + Dir = PREDEFINED_OSWINSHELLNEWDIR;
2378 + NetDir = gid_Dir_ShellnewToo;
2379 + Name = "soffice.ods";
2380 +End
2382 #endif
2384 #ifdef WNT
2386 STD_SHELLNEW_FILE(gid_File_Shellnew_Odg_Soffice, soffice.odg)
2388 +File gid_File_Shellnew2_Odg_Soffice
2389 + TXT_FILE_BODY;
2390 + Styles = (PACKED,WORKSTATION, OVERWRITE);
2391 + Dir = PREDEFINED_OSWINSHELLNEWDIR;
2392 + NetDir = gid_Dir_ShellnewToo;
2393 + Name = "soffice.odg";
2394 +End
2396 #endif
2398 #ifdef WNT
2400 STD_SHELLNEW_FILE(gid_File_Shellnew_Odp_Soffice, soffice.odp)
2402 +File gid_File_Shellnew2_Odp_Soffice
2403 + TXT_FILE_BODY;
2404 + Styles = (PACKED,WORKSTATION, OVERWRITE);
2405 + Dir = PREDEFINED_OSWINSHELLNEWDIR;
2406 + NetDir = gid_Dir_ShellnewToo;
2407 + Name = "soffice.odp";
2408 +End
2410 #endif
2412 #ifdef WNT
2414 STD_SHELLNEW_FILE(gid_File_Shellnew_Odt_Soffice, soffice.odt)
2416 +File gid_File_Shellnew2_Odt_Soffice
2417 + TXT_FILE_BODY;
2418 + Styles = (PACKED,WORKSTATION, OVERWRITE);
2419 + Dir = PREDEFINED_OSWINSHELLNEWDIR;
2420 + NetDir = gid_Dir_ShellnewToo;
2421 + Name = "soffice.odt";
2422 +End
2424 #endif
2426 #ifdef UNX
2427 --- framework/prj/build.lst
2428 +++ framework/prj/build.lst
2429 @@ -1,4 +1,4 @@
2430 -fr framework : l10n svtools NULL
2431 +fr framework : l10n svtools ucb NULL
2432 fr framework usr1 - all fr_mkout NULL
2433 fr framework\inc nmake - all fr_inc NULL
2434 fr framework\source\constant nmake - all fr_constant fr_inc NULL
2435 --- framework/source/uielement/recentfilesmenucontroller.cxx.old 2009-04-02 10:56:25.000000000 +0000
2436 +++ framework/source/uielement/recentfilesmenucontroller.cxx 2009-04-06 16:42:16.000000000 +0000
2437 @@ -66,6 +66,11 @@
2438 #include <svtools/historyoptions.hxx>
2439 #include <cppuhelper/implbase1.hxx>
2440 #include <osl/file.hxx>
2441 +#ifdef WNT
2442 +#include <tools/prewin.h>
2443 +#include <tools/postwin.h>
2444 +#include <odma_lib.hxx>
2445 +#endif
2446 //#include <tools/solar.hrc>
2447 #include <dispatch/uieventloghelper.hxx>
2449 @@ -213,6 +218,41 @@ void RecentFilesMenuController::fillPopu
2450 else
2451 aMenuTitle = aSystemPath;
2453 +#ifdef WNT
2454 + else if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_ODMA && ::odma::DMSsAvailable ())
2456 + String aShortTitle = m_aRecentFilesItems.at( i ).aTitle;
2458 + // This is against all rules for using
2459 + // proper abstraction layers and whatnot.
2460 + // But figuring out how to do it "right"
2461 + // would have taken the whole week.
2462 + // So just call the odma_lib functions...
2463 + // (odma_lib is a thin layer on
2464 + // top of the ODMA32 DLL)
2466 + static ODMHANDLE handle = NULL;
2467 + static sal_Bool beenhere = sal_False;
2468 + ODMSTATUS status;
2470 + if ( ! beenhere )
2472 + status = NODMRegisterApp( &handle, ODM_API_VERSION, "sodma", NULL, NULL );
2473 + beenhere = sal_True;
2476 + if ( handle != NULL )
2478 + rtl::OUString s = aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_MS_1252 );
2479 + s = s.copy( strlen ( "vnd.sun.star.odma:/" ) );
2480 + char title[47];
2481 + status = NODMGetDocInfo( handle, rtl::OUStringToOString( s, RTL_TEXTENCODING_MS_1252 ).pData->buffer, ODM_NAME, title, sizeof ( title ) );
2482 + aShortTitle = String::CreateFromAscii( title );
2484 + aMenuTitle += aShortTitle;
2485 + aTipHelpText = aURLString;
2487 +#endif
2488 else
2490 // Use INetURLObject to abbreviate all other URLs
2491 --- framework/util/makefile.mk.old 2009-04-02 10:56:31.000000000 +0000
2492 +++ framework/util/makefile.mk 2009-04-06 16:42:16.000000000 +0000
2493 @@ -335,6 +335,7 @@ SHL4OBJS= \
2494 $(SLO)$/startmoduledispatcher.obj
2496 SHL4STDLIBS= \
2497 + $(ODMA_LIB_LIB) \
2498 $(FWILIB) \
2499 $(FWELIB) \
2500 $(SVTOOLLIB) \