summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-09-18 12:31:43 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-09-18 12:31:43 +0000
commit5cbd5d5decd9361ad942b839fd75316f14ee76cf (patch)
treed803203172041b808d37e50e49d34d788a1774f2 /sfx2
parent1b64e03aedfd2e40e01ccc35dde249310a9737a3 (diff)
CWS-TOOLING: integrate CWS calc32stopper1
2009-09-15 15:43:23 +0200 dr r276180 : newpic 2009-09-15 15:41:13 +0200 dr r276179 : newpic 2009-09-15 14:58:14 +0200 dr r276178 : #i104905# fixed note handling while importing from external data 2009-09-15 13:47:43 +0200 dr r276173 : #i104905# fixed note handling while importing from database 2009-09-15 11:56:00 +0200 dr r276164 : #i104155# prevent crash loading docx 2009-09-15 10:40:43 +0200 dr r276154 : #i104990# 2009-09-15 10:27:31 +0200 dr r276152 : #i104990# enable saving BIFF8 with password/encryption 2009-09-15 10:26:40 +0200 dr r276151 : #i104990# enable saving BIFF8 with password/encryption 2009-09-14 19:13:11 +0200 dr r276145 : #i105007# missing cleanup for deleted headers 2009-09-14 19:06:57 +0200 dr r276144 : #i105007# missing cleanup for deleted headers 2009-09-14 18:53:39 +0200 dr r276143 : #i104915# prevent crashes and misbehaviour when dealing with note cells: enter matrix, enter mult.op 2009-09-14 13:57:00 +0200 dr r276109 : #160184# make drilldown working in exported pivottables, ported to DEV300 2009-09-11 15:16:08 +0200 nn r276068 : #i104987# MoveBlock: pass bCut parameter 2009-09-11 15:15:22 +0200 nn r276067 : #i104986# CopyToClip: correct order of parameters 2009-09-11 09:45:59 +0200 dr r276053 : correct milestone
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/docfilt.hxx16
-rw-r--r--sfx2/inc/sfx2/filedlghelper.hxx8
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx66
-rw-r--r--sfx2/source/doc/docfilt.cxx16
4 files changed, 62 insertions, 44 deletions
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index 751a9f6257..4eee23f75f 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -75,6 +75,20 @@
#include <sfx2/sfxdefs.hxx>
//========================================================================
+
+namespace sfx2 {
+
+/** Returns true if the passed string is the name of a Microsoft Office file
+ format filter supporting export of password protected documents.
+
+ This function is just a hack for #i105076# is fixed and needs to be removed
+ then.
+ */
+SFX2_DLLPUBLIC bool CheckMSPasswordCapabilityForExport( const String& rFilterName );
+
+} // namespace sfx2
+
+//========================================================================
class SfxFilterContainer;
class SotStorage;
class SFX2_DLLPUBLIC SfxFilter
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index 1de58c4e5b..d50cf4b93c 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -230,16 +230,16 @@ public:
void SetTitle( const String& rNewTitle );
String GetPath() const;
- /** @deprected: Don't use this method to retrieve the selected files
+ /** @deprected: Don't use this method to retrieve the selected files
There are file picker which can provide multiple selected file which belong
to different folders. As this method always provides the root folder for all selected
files this cannot work.
*/
::com::sun::star::uno::Sequence< ::rtl::OUString > GetMPath() const;
-
+
/** Provides the selected files with full path information */
::com::sun::star::uno::Sequence< ::rtl::OUString > GetSelectedFiles() const;
-
+
void AddFilter( const String& rFilterName, const String& rExtension );
void SetCurrentFilter( const String& rFilter );
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index a5aac16f9e..4bf2a95cc4 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -467,6 +467,31 @@ sal_Bool FileDialogHelper_Impl::isInOpenMode() const
// ------------------------------------------------------------------------
+namespace {
+
+bool lclCheckODFPasswordCapability( const SfxFilter* pFilter )
+{
+ return pFilter && pFilter->IsOwnFormat() && pFilter->UsesStorage() && (pFilter->GetVersion() >= SOFFICE_FILEFORMAT_60);
+}
+
+bool lclCheckMSPasswordCapability( const SfxFilter* pFilter )
+{
+ // TODO #i105076# this should be in the filter configuration!!!
+ return pFilter && CheckMSPasswordCapabilityForExport( pFilter->GetFilterName() );
+}
+
+bool lclCheckPasswordCapability( const SfxFilter* pFilter )
+{
+ return
+ lclCheckODFPasswordCapability( pFilter ) ||
+ // TODO #i105076# this should be in the filter configuration!!!
+ lclCheckMSPasswordCapability( pFilter );
+}
+
+}
+
+// ------------------------------------------------------------------------
+
void FileDialogHelper_Impl::updateFilterOptionsBox()
{
if ( !m_bHaveFilterOptions )
@@ -550,40 +575,6 @@ void FileDialogHelper_Impl::updateSelectionBox()
}
// ------------------------------------------------------------------------
-
-namespace {
-
-bool lclCheckMSPasswordCapability( const String rFilterName )
-{
- return rFilterName.EqualsAscii("MS Word 97");
-}
-
-} // namespace
-
-// ------------------------------------------------------------------------
-struct CheckPasswordCapability
-{
- sal_Bool operator() ( const SfxFilter* _pFilter )
- {
- if (!_pFilter)
- return false;
-
-#if 0 // to be enabled in the future
- if (_pFilter->GetFilterName().EqualsAscii("MS Excel 97"))
- // For now, we eanble password protection for Excel 97 as a
- // special case. If we start having more filters supporting
- // export encryption with password, we should probably switch to
- // using a filter flag instead.
- return true;
-#endif
-
- return ( _pFilter->IsOwnFormat() && _pFilter->UsesStorage()
- && ( SOFFICE_FILEFORMAT_60 <= _pFilter->GetVersion() ) )
- || lclCheckMSPasswordCapability( _pFilter->GetFilterName() );
- }
-};
-
-// ------------------------------------------------------------------------
void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
{
if ( ! mbHasPassword )
@@ -593,7 +584,7 @@ void FileDialogHelper_Impl::enablePasswordBox( sal_Bool bInit )
mbIsPwdEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD,
- CheckPasswordCapability()( getCurentSfxFilter() )
+ lclCheckPasswordCapability( getCurentSfxFilter() )
);
if( bInit )
@@ -1665,9 +1656,8 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
if( xInteractionHandler.is() )
{
- // TODO: find out a way to set the 1-15 char limits on MS Excel 97 filter.
-
- bool bMSType = lclCheckMSPasswordCapability( rFilter );
+ // TODO: need a save way to distinguish MS filters from other filters
+ bool bMSType = CheckMSPasswordCapabilityForExport( rFilter );
::comphelper::DocPasswordRequestType eType = bMSType ?
::comphelper::DocPasswordRequestType_MS :
::comphelper::DocPasswordRequestType_STANDARD;
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index 6ca20b3622..d8b6d23b8d 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,6 +52,20 @@
using namespace ::com::sun::star;
+namespace sfx2 {
+
+// TODO #i105076# this should be in the filter configuration!!!
+bool CheckMSPasswordCapabilityForExport( const String& rFilterName )
+{
+ return
+ rFilterName.EqualsAscii( "MS Word 97" ) ||
+ rFilterName.EqualsAscii( "MS Word 97 Vorlage" ) ||
+ rFilterName.EqualsAscii( "MS Excel 97" ) ||
+ rFilterName.EqualsAscii( "MS Excel 97 Vorlage/Template" );
+}
+
+} // namespace sfx2
+
// STATIC DATA -----------------------------------------------------------
DBG_NAME(SfxFilter)