summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-03-03 10:51:13 +0000
committerOliver Bolte <obo@openoffice.org>2009-03-03 10:51:13 +0000
commitcf5d1c4c8d563ce13ab42eaa123f94e5c7512cdd (patch)
treeb4cb6f7566afa6046784b131d6667fe4b8a3fe7b
parent950bab725bb94be77bcd8434ee35c99f6c024828 (diff)
CWS-TOOLING: integrate CWS cmis01
2009-02-03 20:05:24 +0100 tkr r267341 : #i95301# fixed crash due wrong array length + resolve merge conflicts 2009-01-12 08:35:39 +0100 tkr r266134 : #158978# support unescaped whitespaces in webdav 2009-01-12 08:33:10 +0100 tkr r266133 : #i95307# build error after rebasing fixed 2009-01-07 09:47:09 +0100 tkr r265948 : #159046# Add new path to the wntmsci12 search path 2009-01-05 15:34:19 +0100 tkr r265873 : CWS-TOOLING: rebase CWS cmis01 to trunk@265758 (milestone: DEV300:m38) 2008-12-23 09:38:53 +0100 tkr r265774 : #158537# new property 2008-12-23 09:36:25 +0100 tkr r265773 : #158537# new property 2008-10-29 13:08:30 +0100 mav r262791 : #i94273# let the interaction handler be used for authentication 2008-10-24 15:56:26 +0200 tkr r262649 : #i95310# NTLM support 2008-10-22 18:14:02 +0200 mav r262611 : #i94273# fix the http scenario 2008-10-22 12:41:12 +0200 tkr r262596 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:38:47 +0200 tkr r262595 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:38:31 +0200 tkr r262594 : #i95310# NTLM support repaired (new neon version) 2008-10-22 12:29:43 +0200 tkr r262593 : #i95307# Add blacklist support 2008-10-22 12:29:24 +0200 tkr r262592 : #i95307# Add blacklist support 2008-10-22 12:29:07 +0200 tkr r262591 : #i95307# Add blacklist support 2008-10-22 12:28:44 +0200 tkr r262590 : #i95307# Add blacklist support 2008-10-22 12:25:01 +0200 tkr r262589 : #i95307# Add blacklist support 2008-10-22 12:24:28 +0200 tkr r262588 : #i95307# Add blacklist support 2008-10-22 12:22:36 +0200 tkr r262587 : #i95307# Add blacklist support 2008-10-21 12:46:34 +0200 mav r262568 : #i94273# allow to specify the suggested on IO SaveAs directory and filename 2008-10-21 12:44:49 +0200 mav r262566 : #i94273# allow to specify the suggested on IO SaveAs directory and filename
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx12
-rw-r--r--fpicker/source/office/OfficeFilePicker.hxx2
-rw-r--r--fpicker/source/office/asyncfilepicker.cxx9
-rw-r--r--fpicker/source/office/asyncfilepicker.hxx13
-rw-r--r--fpicker/source/office/iodlg.cxx13
-rw-r--r--fpicker/source/office/iodlg.hxx4
-rw-r--r--fpicker/source/office/iodlgimp.hxx5
-rw-r--r--sfx2/inc/sfx2/filedlghelper.hxx10
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc6
-rw-r--r--sfx2/sdi/sfx.sdi31
-rw-r--r--sfx2/source/appl/appopen.cxx30
-rw-r--r--sfx2/source/appl/appuno.cxx28
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx53
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx3
-rw-r--r--sfx2/source/doc/guisaveas.cxx235
-rw-r--r--sfx2/source/doc/objstor.cxx4
-rw-r--r--ucb/source/ucp/webdav/NeonHeadRequest.cxx6
-rw-r--r--ucb/source/ucp/webdav/NeonPropFindRequest.cxx2
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx6
-rw-r--r--ucb/source/ucp/webdav/webdavcontentcaps.cxx1
20 files changed, 353 insertions, 120 deletions
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index c4992b7b12..916b7bccf8 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -504,6 +504,7 @@ SvtFileDialog* SvtFilePicker::implCreateDialog( Window* _pParent )
{
String sStandardDir = String( m_aStandardDir );
dialog->SetStandardDir( sStandardDir );
+ dialog->SetBlackList( m_aBlackList );
}
return dialog;
@@ -1094,6 +1095,10 @@ void SAL_CALL SvtFilePicker::initialize( const Sequence< Any >& _rArguments )
m_aStandardDir = sStandardDir;
}
}
+ else if ( namedValue.Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BlackList" ) ) ) )
+ {
+ namedValue.Value >>= m_aBlackList;
+ }
}
}
}
@@ -1117,6 +1122,13 @@ sal_Bool SvtFilePicker::implHandleInitializationArgument( const ::rtl::OUString&
return sal_True;
}
+ if ( _rName.equalsAscii( "BlackList" ) )
+ {
+ OSL_VERIFY( _rValue >>= m_aBlackList );
+ return sal_True;
+ }
+
+
return OCommonPicker::implHandleInitializationArgument( _rName, _rValue );
}
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index 0eb9e03437..7244602edb 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -61,6 +61,7 @@ typedef ::std::list < ElementEntry_Impl > ElementList;
typedef ::com::sun::star::beans::StringPair UnoFilterEntry;
typedef ::com::sun::star::uno::Sequence< UnoFilterEntry > UnoFilterList; // can be transported more effectively
+typedef ::com::sun::star::uno::Sequence< ::rtl::OUString > OUStringList; // can be transported more effectively
// class SvtFilePicker ---------------------------------------------------
@@ -91,6 +92,7 @@ private:
::rtl::OUString m_aOldHideDirectory;
::rtl::OUString m_aStandardDir;
+ OUStringList m_aBlackList;
::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >
m_xListener;
diff --git a/fpicker/source/office/asyncfilepicker.cxx b/fpicker/source/office/asyncfilepicker.cxx
index 33f3c23f6e..467f7d99ac 100644
--- a/fpicker/source/office/asyncfilepicker.cxx
+++ b/fpicker/source/office/asyncfilepicker.cxx
@@ -95,7 +95,12 @@ namespace svt
}
//--------------------------------------------------------------------
- void AsyncPickerAction::execute( const String& _rURL, const String& _rFilter, sal_Int32 _nMinTimeout, sal_Int32 _nMaxTimeout )
+ void AsyncPickerAction::execute(
+ const String& _rURL,
+ const String& _rFilter,
+ sal_Int32 _nMinTimeout,
+ sal_Int32 _nMaxTimeout,
+ const OUStringList& rBlackList )
{
DBG_TESTSOLARMUTEX();
// if this asserts, we'd need to have an own mutex per instance
@@ -129,7 +134,7 @@ namespace svt
break;
case eOpenURL:
- eResult = m_pView->Initialize( _rURL, _rFilter, pActionDescriptor.get() );
+ eResult = m_pView->Initialize( _rURL, _rFilter, pActionDescriptor.get(), rBlackList );
break;
case eExecuteFilter:
diff --git a/fpicker/source/office/asyncfilepicker.hxx b/fpicker/source/office/asyncfilepicker.hxx
index a8917f5d28..79f7cf2697 100644
--- a/fpicker/source/office/asyncfilepicker.hxx
+++ b/fpicker/source/office/asyncfilepicker.hxx
@@ -37,13 +37,19 @@
#include <tools/link.hxx>
#include <tools/string.hxx>
#include <rtl/ref.hxx>
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Sequence.h>
class SvtFileView;
class SvtFileDialog;
+
+typedef ::com::sun::star::uno::Sequence< ::rtl::OUString > OUStringList;
+
//........................................................................
namespace svt
{
//........................................................................
+
//====================================================================
//= AsyncPickerAction
@@ -82,7 +88,12 @@ namespace svt
If smaller than or equal to <arg>_nMinTimeout</arg>, it will be corrected to
<arg>_nMinTimeout</arg> + 30000.
*/
- void execute( const String& _rURL, const String& _rFilter, sal_Int32 _nMinTimeout, sal_Int32 _nMaxTimeout );
+ void execute(
+ const String& _rURL,
+ const String& _rFilter,
+ sal_Int32 _nMinTimeout,
+ sal_Int32 _nMaxTimeout,
+ const OUStringList& rBlackList = OUStringList() );
/// cancels the running action
void cancel();
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 7f16b47135..00e714106e 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -2319,7 +2319,7 @@ void SvtFileDialog::executeAsync( ::svt::AsyncPickerAction::Action _eAction,
m_aConfiguration.getNodeValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Timeout/Max" ) ) ) >>= nMaxTimeout;
m_bInExecuteAsync = true;
- m_pCurrentAsyncAction->execute( _rURL, _rFilter, bReallyAsync ? nMinTimeout : -1, nMaxTimeout );
+ m_pCurrentAsyncAction->execute( _rURL, _rFilter, bReallyAsync ? nMinTimeout : -1, nMaxTimeout, GetBlackList() );
m_bInExecuteAsync = false;
}
@@ -2356,6 +2356,17 @@ void SvtFileDialog::SetStandardDir( const String& rStdDir )
_pImp->SetStandardDir( aObj.GetMainURL( INetURLObject::NO_DECODE ) );
}
+void SvtFileDialog::SetBlackList( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList )
+{
+ _pImp->SetBlackList( rBlackList );
+}
+
+//*****************************************************************************
+
+const ::com::sun::star::uno::Sequence< ::rtl::OUString >& SvtFileDialog::GetBlackList() const
+{
+ return _pImp->GetBlackList();
+}
//*****************************************************************************
const String& SvtFileDialog::GetStandardDir() const
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 197cf77bcc..c680e394d0 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -215,7 +215,9 @@ public:
void FileSelect();
void FilterSelect();
-
+
+ void SetBlackList( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList );
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetBlackList() const;
void SetStandardDir( const String& rStdDir );
const String& GetStandardDir() const;
SvStringsDtor* GetPathList() const; // bei MultiSelektion
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 0479e5df6d..d28cb57154 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -199,6 +199,8 @@ private:
const SvtFileDialogFilter_Impl* _pCurFilter;
String m_sCurrentFilterDisplayName; // may differ from _pCurFilter->GetName in case it is a cached entry
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > _aBlackList;
public:
SvtFileDialogFilterList_Impl* _pFilter;
@@ -260,6 +262,9 @@ public:
SvtExpFileDlg_Impl( WinBits nBits );
~SvtExpFileDlg_Impl();
+
+ inline void SetBlackList( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList ) { _aBlackList = rBlackList; }
+ inline const ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetBlackList() const { return _aBlackList; }
void SetStandardDir( const String& _rDir );
inline const String& GetStandardDir() const { return _aStdDir; }
inline void DisableFilterBoxAutoWidth() { _pLbFilter->EnableDDAutoWidth( FALSE ); }
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index 7dc51488ae..cccf27acf5 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -179,7 +179,8 @@ public:
sal_Int16 nDialog,
SfxFilterFlags nMust,
SfxFilterFlags nDont,
- const String& rStandardDir);
+ const String& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList);
FileDialogHelper( sal_Int64 nFlags,
const String& rFactory,
@@ -198,7 +199,8 @@ public:
sal_Int16 nDialog,
SfxFilterFlags nMust,
SfxFilterFlags nDont,
- const String& rStandardDir );
+ const String& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList);
FileDialogHelper( sal_Int64 nFlags );
@@ -211,6 +213,7 @@ public:
const ::rtl::OUString& aFilterUIName,
const ::rtl::OUString& aExtName,
const ::rtl::OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList,
Window* _pPreferredParent = NULL );
@@ -330,7 +333,8 @@ ErrCode FileOpenDialog_Impl( sal_Int64 nFlags,
SfxItemSet *& rpSet,
const String* pPath = NULL,
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG,
- const String& rStandardDir = String::CreateFromAscii( "" ));
+ const String& rStandardDir = String::CreateFromAscii( "" ),
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >());
//#endif
}
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 395cfe041c..729e277f51 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -296,7 +296,8 @@
#define SID_GRAFIC_DIALOG (SID_SFX_START + 305)
#define SID_PATH (SID_SFX_START + 308)
#define SID_SAVEDOCS (SID_SFX_START + 309)
-#define SID_STANDARD_DIR (SID_SFX_START + 310)
+#define SID_STANDARD_DIR (SID_SFX_START + 450)
+#define SID_BLACK_LIST (SID_SFX_START + 451)
// browse-ids
#define SID_BROWSE_FORWARD (SID_SFX_START + 1300)
@@ -569,7 +570,8 @@
#define SID_OPTIONS_PAGEURL (SID_SFX_START + 1713)
#define SID_MORE_DICTIONARIES (SID_SFX_START + 1714)
#define SID_ACTIVATE_STYLE_APPLY (SID_SFX_START + 1715)
-#define SID_SFX_free_START (SID_SFX_START + 1716)
+#define SID_DEFAULTFILENAME (SID_SFX_START + 1716)
+#define SID_SFX_free_START (SID_SFX_START + 1717)
#define SID_SFX_free_END (SID_SFX_START + 3999)
#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index bc74b1be39..b8597d853d 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -1646,7 +1646,34 @@ SfxStringItem DefaultFilePath SID_DEFAULTFILEPATH
RecordPerSet;
Synchron;
- Readonly = FALSE,
+ Readonly = TRUE,
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem DefaultFileName SID_DEFAULTFILENAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ Readonly = TRUE,
/* config: */
AccelConfig = FALSE,
@@ -4697,7 +4724,7 @@ SfxStringItem OldPALK SID_OLD_PALK
//--------------------------------------------------------------------------
SfxObjectItem Open SID_OPENDOC
-(SfxStringItem URL SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem OpenFlags SID_OPTIONS,SfxStringItem Password SID_PASSWORD,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS,SfxInt16Item Version SID_VERSION,SfxStringItem Referer SID_REFERER)
+(SfxStringItem URL SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem OpenFlags SID_OPTIONS,SfxStringItem Password SID_PASSWORD,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS,SfxInt16Item Version SID_VERSION,SfxStringItem Referer SID_REFERER,SfxStringItem SuggestedSaveAsDir SID_DEFAULTFILEPATH,SfxStringItem SuggestedSaveAsName SID_DEFAULTFILENAME)
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 23fc4b84b6..1351b21dc2 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -53,8 +53,11 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/uno/Sequence.h>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <rtl/ustring.hxx>
+
#include <comphelper/storagehelper.hxx>
#include <comphelper/synchronousdispatch.hxx>
@@ -93,6 +96,7 @@
#include <sfx2/new.hxx>
#include <sfx2/objitem.hxx>
#include <sfx2/objsh.hxx>
+#include <svtools/slstitm.hxx>
#include "objshimp.hxx"
#include "openflag.hxx"
#include <sfx2/passwd.hxx>
@@ -535,6 +539,13 @@ SfxObjectShellLock SfxApplication::NewDoc_Impl( const String& rFact, const SfxIt
{
if ( pSet )
{
+ // TODO/LATER: Should the other arguments be transfered as well?
+ SFX_ITEMSET_ARG( pSet, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, FALSE);
+ if ( pDefaultPathItem )
+ xDoc->GetMedium()->GetItemSet()->Put( *pDefaultPathItem );
+ SFX_ITEMSET_ARG( pSet, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, FALSE);
+ if ( pDefaultNameItem )
+ xDoc->GetMedium()->GetItemSet()->Put( *pDefaultNameItem );
SFX_ITEMSET_ARG( pSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE );
if ( pTitleItem )
xDoc->GetMedium()->GetItemSet()->Put( *pTitleItem );
@@ -573,12 +584,22 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
else
aFactName = SvtModuleOptions().GetDefaultModuleName();
+
SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() );
String aFact = String::CreateFromAscii("private:factory/");
aFact += aFactName;
aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) );
aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) );
aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_default" ) ) );
+
+ // TODO/LATER: Should the other arguments be transfered as well?
+ SFX_REQUEST_ARG( rReq, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, FALSE);
+ if ( pDefaultPathItem )
+ aReq.AppendItem( *pDefaultPathItem );
+ SFX_REQUEST_ARG( rReq, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, FALSE);
+ if ( pDefaultNameItem )
+ aReq.AppendItem( *pDefaultNameItem );
+
SFX_APP()->ExecuteSlot( aReq );
const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() );
if ( pItem )
@@ -877,8 +898,15 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( pStandardDirItem )
sStandardDir = pStandardDirItem->GetValue();
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aBlackList;
+
+ SFX_REQUEST_ARG( rReq, pBlackListItem, SfxStringListItem, SID_BLACK_LIST, FALSE );
+ if ( pBlackListItem )
+ pBlackListItem->GetStringList( aBlackList );
+
+
ULONG nErr = sfx2::FileOpenDialog_Impl(
- WB_OPEN | SFXWB_MULTISELECTION | SFXWB_SHOWVERSIONS, String(), pURLList, aFilter, pSet, &aPath, nDialog, sStandardDir );
+ WB_OPEN | SFXWB_MULTISELECTION | SFXWB_SHOWVERSIONS, String(), pURLList, aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList );
if ( nErr == ERRCODE_ABORT )
{
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index d56b707e55..47f875466e 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -63,6 +63,7 @@
#include <svtools/ownlist.hxx>
#include <svtools/lckbitem.hxx>
#include <svtools/stritem.hxx>
+#include <svtools/slstitm.hxx>
#include <svtools/intitem.hxx>
#include <svtools/eitem.hxx>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
@@ -193,6 +194,7 @@ static const String sNoAutoSave = String::CreateFromAscii( "NoAutoSave" );
static const String sFolderName = String::CreateFromAscii( "FolderName" );
static const String sUseSystemDialog = String::CreateFromAscii( "UseSystemDialog" );
static const String sStandardDir = String::CreateFromAscii( "StandardDir" );
+static const String sBlackList = String::CreateFromAscii( "BlackList" );
void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot )
{
@@ -683,10 +685,22 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
- DBG_ASSERT( bOK, "invalid type or value for FileName" );
+ DBG_ASSERT( bOK, "invalid type or value for StanadardDir" );
if (bOK)
rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) );
}
+ else if ( aName == sBlackList )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > xVal;
+ sal_Bool bOK = (rProp.Value >>= xVal);
+ DBG_ASSERT( bOK, "invalid type or value for BlackList" );
+ if (bOK)
+ {
+ SfxStringListItem stringList(SID_BLACK_LIST);
+ stringList.SetStringList( xVal );
+ rSet.Put( stringList );
+ }
+ }
else if ( aName == sFileName )
{
::rtl::OUString sVal;
@@ -974,6 +988,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
nAdditional++;
if ( rSet.GetItemState( SID_STANDARD_DIR ) == SFX_ITEM_SET )
nAdditional++;
+ if ( rSet.GetItemState( SID_BLACK_LIST ) == SFX_ITEM_SET )
+ nAdditional++;
if ( rSet.GetItemState( SID_CONTENT ) == SFX_ITEM_SET )
nAdditional++;
if ( rSet.GetItemState( SID_INPUTSTREAM ) == SFX_ITEM_SET )
@@ -1157,6 +1173,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
continue;
if ( nId == SID_STANDARD_DIR )
continue;
+ if ( nId == SID_BLACK_LIST )
+ continue;
if ( nId == SID_CONTENTTYPE )
continue;
if ( nId == SID_WIN_POSSIZE )
@@ -1454,6 +1472,14 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
pValue[nActProp].Name = sStandardDir;
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
+ if ( rSet.GetItemState( SID_BLACK_LIST, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nActProp].Name = sBlackList;
+
+ com::sun::star::uno::Sequence< rtl::OUString > aList;
+ ((SfxStringListItem*)pItem)->GetStringList( aList );
+ pValue[nActProp++].Value <<= aList ;
+ }
if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
pValue[nActProp].Name = sFrameName;
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index f2eaff0cd9..f8d7cc4958 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -88,6 +88,7 @@
#include <svtools/pickerhelper.hxx>
#include <svtools/docpasswdrequest.hxx>
#include <ucbhelper/content.hxx>
+#include <ucbhelper/commandenvironment.hxx>
#include <comphelper/storagehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <sfx2/app.hxx>
@@ -904,7 +905,15 @@ sal_Bool lcl_isSystemFilePicker( const uno::Reference< XFilePicker >& _rxFP )
// ----------- FileDialogHelper_Impl ---------------------------
// ------------------------------------------------------------------------
-FileDialogHelper_Impl::FileDialogHelper_Impl( FileDialogHelper* _pAntiImpl, sal_Int16 nDialogType, sal_Int64 nFlags, sal_Int16 nDialog, Window* _pPreferredParentWindow, const String& sStandardDir )
+FileDialogHelper_Impl::FileDialogHelper_Impl(
+ FileDialogHelper* _pAntiImpl,
+ sal_Int16 nDialogType,
+ sal_Int64 nFlags,
+ sal_Int16 nDialog,
+ Window* _pPreferredParentWindow,
+ const String& sStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList
+ )
:m_nDialogType ( nDialogType )
,meContext ( FileDialogHelper::UNKNOWN_CONTEXT )
{
@@ -1065,7 +1074,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( FileDialogHelper* _pAntiImpl, sal_
//Sequence < Any > aInitArguments( mbSystemPicker || !mpPreferredParentWindow ? 1 : 3 );
- Sequence < Any > aInitArguments( !mpPreferredParentWindow ? 2 : 3 );
+ Sequence < Any > aInitArguments( !mpPreferredParentWindow ? 3 : 4 );
// This is a hack. We currently know that the internal file picker implementation
// supports the extended arguments as specified below.
@@ -1089,8 +1098,15 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( FileDialogHelper* _pAntiImpl, sal_
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StandardDir" ) ),
makeAny( sStandardDirTemp )
);
+
+ aInitArguments[2] <<= NamedValue(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BlackList" ) ),
+ makeAny( rBlackList )
+ );
+
+
if ( mpPreferredParentWindow )
- aInitArguments[2] <<= NamedValue(
+ aInitArguments[3] <<= NamedValue(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) ),
makeAny( VCLUnoHelper::GetInterface( mpPreferredParentWindow ) )
);
@@ -2298,9 +2314,10 @@ FileDialogHelper::FileDialogHelper(
sal_Int16 nDialog,
SfxFilterFlags nMust,
SfxFilterFlags nDont,
- const String& rStandardDir)
+ const String& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList)
{
- mpImp = new FileDialogHelper_Impl( this, getDialogType( nFlags ), nFlags, nDialog, NULL , rStandardDir );
+ mpImp = new FileDialogHelper_Impl( this, getDialogType( nFlags ), nFlags, nDialog, NULL , rStandardDir, rBlackList );
mxImp = mpImp;
// create the list of filters
@@ -2353,9 +2370,10 @@ FileDialogHelper::FileDialogHelper(
sal_Int16 nDialog,
SfxFilterFlags nMust,
SfxFilterFlags nDont,
- const String& rStandardDir )
+ const String& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList)
{
- mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, NULL, rStandardDir );
+ mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, NULL, rStandardDir, rBlackList );
mxImp = mpImp;
// create the list of filters
@@ -2379,9 +2397,10 @@ FileDialogHelper::FileDialogHelper(
const ::rtl::OUString& aFilterUIName,
const ::rtl::OUString& aExtName,
const ::rtl::OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList,
Window* _pPreferredParent )
{
- mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, _pPreferredParent,rStandardDir );
+ mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, _pPreferredParent,rStandardDir, rBlackList );
mxImp = mpImp;
// the wildcard here is expected in form "*.extension"
@@ -2571,10 +2590,21 @@ ErrCode FileDialogHelper::GetGraphic( Graphic& rGraphic ) const
// ------------------------------------------------------------------------
static int impl_isFolder( const OUString& rPath )
{
+ uno::Reference< task::XInteractionHandler > xHandler;
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ xHandler.set( xFactory->createInstance( DEFINE_CONST_OUSTRING( "com.sun.star.task.InteractionHandler" ) ),
+ uno::UNO_QUERY_THROW );
+ }
+ catch ( Exception const & )
+ {
+ }
+
try
{
::ucbhelper::Content aContent(
- rPath, uno::Reference< ucb::XCommandEnvironment >() );
+ rPath, new ::ucbhelper::CommandEnvironment( xHandler, uno::Reference< ucb::XProgressHandler >() ) );
if ( aContent.isFolder() )
return 1;
@@ -2733,10 +2763,11 @@ ErrCode FileOpenDialog_Impl( sal_Int64 nFlags,
SfxItemSet *& rpSet,
const String* pPath,
sal_Int16 nDialog,
- const String& rStandardDir )
+ const String& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList )
{
ErrCode nRet;
- FileDialogHelper aDialog( nFlags, rFact, nDialog, 0, 0, rStandardDir );
+ FileDialogHelper aDialog( nFlags, rFact, nDialog, 0, 0, rStandardDir, rBlackList );
String aPath;
if ( pPath )
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 40ab236831..09ddcfa868 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -195,7 +195,8 @@ namespace sfx2
sal_Int64 nFlags,
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG,
Window* _pPreferredParentWindow = NULL,
- const String& sStandardDir = String::CreateFromAscii( "" )
+ const String& sStandardDir = String::CreateFromAscii( "" ),
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList = ::com::sun::star::uno::Sequence< ::rtl::OUString >()
);
virtual ~FileDialogHelper_Impl();
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index cccb595bc1..f1f45ca46c 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/frame/XStorable2.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
@@ -227,13 +228,21 @@ public:
sal_Bool OutputFileDialog( sal_Int8 nStoreMode,
const ::comphelper::SequenceAsHashMap& aPreselectedFilterPropsHM,
sal_Bool bSetStandardName,
- ::rtl::OUString& aUserSelectedName,
+ ::rtl::OUString& aSuggestedName,
sal_Bool bPreselectPassword,
- const ::rtl::OUString& rPath,
+ const ::rtl::OUString& aSuggestedDir,
sal_Int16 nDialog,
- const ::rtl::OUString& rStandardDir);
+ const ::rtl::OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList
+ );
sal_Bool ShowDocumentInfoDialog();
+
+ ::rtl::OUString GetReccomendedDir( const ::rtl::OUString& aSuggestedDir,
+ const sfx2::FileDialogHelper::Context& aCtxt );
+ ::rtl::OUString GetReccomendedName( const ::rtl::OUString& aSuggestedName,
+ const ::rtl::OUString& aTypeName );
+
};
//-------------------------------------------------------------------------
@@ -719,11 +728,12 @@ sal_Bool ModelData_Impl::CheckFilterOptionsDialogExistence()
sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
const ::comphelper::SequenceAsHashMap& aPreselectedFilterPropsHM,
sal_Bool bSetStandardName,
- ::rtl::OUString& aUserSelectedName,
+ ::rtl::OUString& aSuggestedName,
sal_Bool bPreselectPassword,
- const ::rtl::OUString& rPath,
+ const ::rtl::OUString& aSuggestedDir,
sal_Int16 nDialog,
- const ::rtl::OUString& rStandardDir )
+ const ::rtl::OUString& rStandardDir,
+ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList)
{
sal_Bool bUseFilterOptions = sal_False;
@@ -785,13 +795,13 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
::rtl::OUString::createFromAscii( "UIName" ),
::rtl::OUString() );
- pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ), rStandardDir );
+ pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ), rStandardDir, rBlackList );
pFileDlg->SetCurrentFilter( aFilterUIName );
}
else
{
// This is the normal dialog
- pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir );
+ pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList );
}
if( aDocServiceName.equalsAscii( "com.sun.star.drawing.DrawingDocument" ) )
@@ -819,103 +829,52 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
else
{
// This is the normal dialog
- pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir );
+ pFileDlg = new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList );
pFileDlg->CreateMatcher( aDocServiceName );
}
- // the last used name might be provided by aUserSelectedName from the old selection
- ::rtl::OUString aLastName = aUserSelectedName;
+ ::rtl::OUString aAdjustToType;
- if ( ( aLastName.getLength() || GetStorable()->hasLocation() )
- && !GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "RepairPackage" ),
- sal_False ) )
+ // bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
+ if ( bSetStandardName || GetStorable()->hasLocation() )
{
- // --> PB 2004-11-05 #i36524# - aLastName must be an URL, not only a filename
- if ( !aLastName.getLength() )
- aLastName = GetStorable()->getLocation();
- // <--
-
- if ( !aLastName.getLength() )
- {
- aLastName = GetDocProps().getUnpackedValueOrDefault(
- ::rtl::OUString::createFromAscii( "Title" ),
- ::rtl::OUString() );
- INetURLObject aObj( INetURLObject::GetAbsURL( SvtPathOptions().GetWorkPath(), aLastName ) );
- aLastName = aObj.GetMainURL( INetURLObject::NO_DECODE );
- }
-
uno::Sequence< beans::PropertyValue > aOldFilterProps;
- sal_Int32 nOldFiltFlags = 0;
::rtl::OUString aOldFilterName = GetDocProps().getUnpackedValueOrDefault(
- aFilterNameString,
- ::rtl::OUString() );
+ aFilterNameString,
+ ::rtl::OUString() );
if ( aOldFilterName.getLength() )
m_pOwner->GetFilterConfiguration()->getByName( aOldFilterName ) >>= aOldFilterProps;
::comphelper::SequenceAsHashMap aOldFiltPropsHM( aOldFilterProps );
- nOldFiltFlags = aOldFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ),
- (sal_Int32)0 );
+ sal_Int32 nOldFiltFlags = aOldFiltPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Flags" ), (sal_Int32)0 );
- // bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
if ( bSetStandardName || ( nOldFiltFlags & nMust ) != nMust || nOldFiltFlags & nDont )
{
- ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
- ::rtl::OUString::createFromAscii( "UIName" ),
- ::rtl::OUString() );
- ::rtl::OUString aTypeName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
+ // the suggested type will be changed, the extension should be adjusted
+ aAdjustToType = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
::rtl::OUString::createFromAscii( "Type" ),
::rtl::OUString() );
- if( aLastName.getLength() )
- {
- INetURLObject aObj( aLastName );
- if ( aTypeName.getLength() )
- {
- uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >(
- m_pOwner->GetServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" ) ),
- uno::UNO_QUERY );
- if ( xTypeDetection.is() )
- {
- uno::Sequence< beans::PropertyValue > aTypeNameProps;
- if ( ( xTypeDetection->getByName( aTypeName ) >>= aTypeNameProps ) && aTypeNameProps.getLength() )
- {
- ::comphelper::SequenceAsHashMap aTypeNamePropsHM( aTypeNameProps );
- uno::Sequence< ::rtl::OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault(
- ::rtl::OUString::createFromAscii( "Extension" ),
- ::uno::Sequence< ::rtl::OUString >() );
- if ( aExtensions.getLength() )
- aObj.SetExtension( aExtensions[0] );
- }
- }
- }
-
- pFileDlg->SetDisplayDirectory( aObj.GetMainURL( INetURLObject::NO_DECODE ) );
- }
-
+ ::rtl::OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
+ ::rtl::OUString::createFromAscii( "UIName" ),
+ ::rtl::OUString() );
pFileDlg->SetCurrentFilter( aFilterUIName );
}
else
{
- if( aLastName.getLength() )
- pFileDlg->SetDisplayDirectory( aLastName );
-
pFileDlg->SetCurrentFilter( aOldFiltPropsHM.getUnpackedValueOrDefault(
::rtl::OUString::createFromAscii( "UIName" ),
::rtl::OUString() ) );
}
}
- else
- {
- // pb: set graphic path if context == SD_EXPORT or SI_EXPORT else work path
- String sDirectory = eCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT
- ? SvtPathOptions().GetGraphicPath() : SvtPathOptions().GetWorkPath();
- pFileDlg->SetDisplayDirectory( sDirectory );
- }
- if ( rPath.getLength() )
- pFileDlg->SetDisplayDirectory( rPath );
+ ::rtl::OUString aReccomendedDir = GetReccomendedDir( aSuggestedDir, eCtxt );
+ if ( aReccomendedDir.getLength() )
+ pFileDlg->SetDisplayDirectory( aReccomendedDir );
+ ::rtl::OUString aReccomendedName = GetReccomendedName( aSuggestedName, aAdjustToType );
+ if ( aReccomendedName.getLength() )
+ pFileDlg->SetFileName( aReccomendedName );
uno::Reference < view::XSelectionSupplier > xSel( GetModel()->getCurrentController(), uno::UNO_QUERY );
if ( xSel.is() && xSel->getSelection().hasValue() )
@@ -962,7 +921,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
// get the path from the dialog
INetURLObject aURL( pFileDlg->GetPath() );
// the path should be provided outside since it might be used for further calls to the dialog
- aUserSelectedName = aURL.GetMainURL( INetURLObject::NO_DECODE );
+ aSuggestedName = aURL.GetMainURL( INetURLObject::NO_DECODE );
// old filter options should be cleared in case different filter is used
@@ -1089,6 +1048,95 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
return bDialogUsed;
}
+//-------------------------------------------------------------------------
+::rtl::OUString ModelData_Impl::GetReccomendedDir( const ::rtl::OUString& aSuggestedDir, const sfx2::FileDialogHelper::Context& aCtxt )
+{
+ ::rtl::OUString aReccomendedDir;
+
+ if ( ( aSuggestedDir.getLength() || GetStorable()->hasLocation() )
+ && !GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "RepairPackage" ),
+ sal_False ) )
+ {
+ INetURLObject aLocation;
+ if ( aSuggestedDir.getLength() )
+ aLocation = INetURLObject( aSuggestedDir );
+ else
+ {
+ ::rtl::OUString aOldURL = GetStorable()->getLocation();
+ if ( aOldURL.getLength() )
+ {
+ INetURLObject aTmp( aOldURL );
+ if ( aTmp.removeSegment() )
+ aLocation = aTmp;
+ }
+
+ if ( aLocation.HasError() )
+ aLocation = INetURLObject( SvtPathOptions().GetWorkPath() );
+ }
+
+ aLocation.setFinalSlash();
+ if ( !aLocation.HasError() )
+ aReccomendedDir = aLocation.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ else
+ {
+ // pb: set graphic path if context == SD_EXPORT or SI_EXPORT else work path
+ aReccomendedDir = ( aCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT )
+ ? SvtPathOptions().GetGraphicPath() : SvtPathOptions().GetWorkPath();
+ }
+
+ return aReccomendedDir;
+}
+
+//-------------------------------------------------------------------------
+::rtl::OUString ModelData_Impl::GetReccomendedName( const ::rtl::OUString& aSuggestedName, const ::rtl::OUString& aTypeName )
+{
+ // the last used name might be provided by aSuggestedName from the old selection, or from the MediaDescriptor
+ ::rtl::OUString aReccomendedName;
+
+ if ( aSuggestedName.getLength() )
+ aReccomendedName = aSuggestedName;
+ else
+ {
+ aReccomendedName = INetURLObject( GetStorable()->getLocation() ).GetName();
+ if ( !aReccomendedName.getLength() )
+ {
+ try {
+ uno::Reference< frame::XTitle > xTitle( GetModel(), uno::UNO_QUERY_THROW );
+ aReccomendedName = xTitle->getTitle();
+ } catch( uno::Exception& ) {}
+ }
+
+ if ( aReccomendedName.getLength() && aTypeName.getLength() )
+ {
+ // adjust the extension to the type
+ uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >(
+ m_pOwner->GetServiceFactory()->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.document.TypeDetection" ) ),
+ uno::UNO_QUERY );
+ if ( xTypeDetection.is() )
+ {
+ INetURLObject aObj( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "file:///c:/" ) ) + aReccomendedName );
+
+ uno::Sequence< beans::PropertyValue > aTypeNameProps;
+ if ( ( xTypeDetection->getByName( aTypeName ) >>= aTypeNameProps ) && aTypeNameProps.getLength() )
+ {
+ ::comphelper::SequenceAsHashMap aTypeNamePropsHM( aTypeNameProps );
+ uno::Sequence< ::rtl::OUString > aExtensions = aTypeNamePropsHM.getUnpackedValueOrDefault(
+ ::rtl::OUString::createFromAscii( "Extensions" ),
+ ::uno::Sequence< ::rtl::OUString >() );
+ if ( aExtensions.getLength() )
+ aObj.SetExtension( aExtensions[0] );
+ }
+
+ aReccomendedName = aObj.GetName();
+ }
+ }
+ }
+
+ return aReccomendedName;
+}
+
+
//=========================================================================
// class SfxStoringHelper
//=========================================================================
@@ -1175,7 +1223,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
const ::rtl::OUString& aSlotName,
uno::Sequence< beans::PropertyValue >& aArgsSequence,
sal_Bool bPreselectPassword,
- ::rtl::OUString aUserSelectedName )
+ ::rtl::OUString aSuggestedName )
{
ModelData_Impl aModelData( *this, xModel, aArgsSequence );
@@ -1297,7 +1345,6 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
if ( aFileNameIter == aModelData.GetMediaDescr().end() )
{
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG;
- ::rtl::OUString aPath;
::comphelper::SequenceAsHashMap::const_iterator aDlgIter =
aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "UseSystemDialog" ) );
if ( aDlgIter != aModelData.GetMediaDescr().end() )
@@ -1310,10 +1357,18 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
nDialog = SFX2_IMPL_DIALOG_OOO;
}
- ::comphelper::SequenceAsHashMap::const_iterator aPathIter =
- aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "FolderName" ) );
- if ( aPathIter != aModelData.GetMediaDescr().end() )
- aPathIter->second >>= aPath;
+ // The Dispatch supports parameter FolderName that overwrites SuggestedSaveAsDir
+ ::rtl::OUString aSuggestedDir = aModelData.GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FolderName" ) ), ::rtl::OUString() );
+ if ( !aSuggestedDir.getLength() )
+ {
+ aSuggestedDir = aModelData.GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsDir" ) ), ::rtl::OUString() );
+ if ( !aSuggestedDir.getLength() )
+ aSuggestedDir = aModelData.GetDocProps().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsDir" ) ), ::rtl::OUString() );
+ }
+
+ aSuggestedName = aModelData.GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsName" ) ), ::rtl::OUString() );
+ if ( !aSuggestedName.getLength() )
+ aSuggestedName = aModelData.GetDocProps().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsName" ) ), ::rtl::OUString() );
::rtl::OUString sStandardDir;
::comphelper::SequenceAsHashMap::const_iterator aStdDirIter =
@@ -1321,13 +1376,20 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
if ( aStdDirIter != aModelData.GetMediaDescr().end() )
aStdDirIter->second >>= sStandardDir;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aBlackList;
+
+ ::comphelper::SequenceAsHashMap::const_iterator aBlackListIter =
+ aModelData.GetMediaDescr().find( ::rtl::OUString::createFromAscii( "BlackList" ) );
+ if ( aBlackListIter != aModelData.GetMediaDescr().end() )
+ aBlackListIter->second >>= aBlackList;
+
sal_Bool bExit = sal_False;
while ( !bExit )
{
- bUseFilterOptions = aModelData.OutputFileDialog( nStoreMode, aFilterProps, bSetStandardName, aUserSelectedName, bPreselectPassword, aPath, nDialog, sStandardDir );
+ bUseFilterOptions = aModelData.OutputFileDialog( nStoreMode, aFilterProps, bSetStandardName, aSuggestedName, bPreselectPassword, aSuggestedDir, nDialog, sStandardDir, aBlackList );
// in case the dialog is opend a second time the folder should be the same as before, not what was handed over by parameters
- aPath = ::rtl::OUString();
+ aSuggestedDir = ::rtl::OUString();
if ( nStoreMode == SAVEAS_REQUESTED )
{
// in case of saving check filter for possible alien warning
@@ -1657,4 +1719,3 @@ Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >&
return pWin;
}
-
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 5ec9580185..37259eb6d8 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2678,6 +2678,8 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
SfxItemSet *pSet = GetMedium()->GetItemSet();
pSet->ClearItem( SID_INTERACTIONHANDLER );
pSet->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL );
+ pSet->ClearItem( SID_STANDARD_DIR );
+ pSet->ClearItem( SID_PATH );
if ( !bSaveTo )
{
@@ -2694,6 +2696,8 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
//pSet->ClearItem( SID_USE_FILTEROPTIONS );
pSet->ClearItem( SID_EDITDOC );
pSet->ClearItem( SID_OVERWRITE );
+ pSet->ClearItem( SID_DEFAULTFILEPATH );
+ pSet->ClearItem( SID_DEFAULTFILENAME );
SFX_ITEMSET_GET( (*aParams), pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
if ( pFilterItem )
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index edca2f09ba..36208be7b0 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: NeonHeadRequest.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.11 $
*
* This file is part of OpenOffice.org.
*
@@ -66,7 +66,7 @@ void process_headers(ne_request *req,
while ( it != end )
{
- if ( (*it).equalsIgnoreAsciiCase(aHeaderName) )
+ if ( (*it) == aHeaderName )
break;
++it;
@@ -126,7 +126,7 @@ extern "C" void NHR_ResponseHeaderCatcher( void * userdata,
while ( it != end )
{
- if ( (*it).equalsIgnoreAsciiCase(aHeaderName) )
+ if ( (*it) == aHeaderName )
break;
++it;
diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
index 7cc65b443e..de876d0389 100644
--- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
@@ -104,7 +104,7 @@ extern "C" int NPFR_propfind_iter( void* userdata,
{
aValue = aValue.toAsciiLowerCase();
if ( aValue.compareTo(
- RTL_CONSTASCII_STRINGPARAM( "<collection" ) ) == 0 )
+ RTL_CONSTASCII_STRINGPARAM( "<dav:collection" ) ) == 0 )
{
thePropertyValue.Value
<<= OUString::createFromAscii( "collection" );
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index be2ab6e4fd..542f39f81a 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -767,8 +767,10 @@ void NeonSession::Init()
// Note: Calling ne_set_[server|proxy]_auth more than once per
// m_pHttpSession instance sometimes(?) crashes Neon! ( last
// checked: 0.22.0)
- ne_set_server_auth( m_pHttpSession, NeonSession_NeonAuth, this );
- ne_set_proxy_auth ( m_pHttpSession, NeonSession_NeonAuth, this );
+ //ne_set_server_auth( m_pHttpSession, NeonSession_NeonAuth, this );
+ ne_add_server_auth( m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this );
+ //ne_set_proxy_auth ( m_pHttpSession, NeonSession_NeonAuth, this );
+ ne_add_proxy_auth ( m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this );
}
}
diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx
index b4a265eefe..16800fb29c 100644
--- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx
+++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx
@@ -335,7 +335,6 @@ uno::Sequence< beans::Property > Content::getProperties(
// we used a depth of DAVZERO for PROPFIND.
aPropSet.insert( (*props.begin()).properties.begin(),
(*props.begin()).properties.end() );
-
}
catch ( DAVException const & )
{