summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-06-16 16:15:54 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-06-16 16:15:54 +0000
commita245ebc7519f4ccd3a5bc2f2c841fa379c6f947c (patch)
treede5165219c59ea5b42cc448b6aa06c56a8282fcd /sfx2
parent23337b9a2d42b6ce33cd5d3a09e7c09e2a0effdc (diff)
CWS-TOOLING: integrate CWS fwk103
2009-05-26 12:44:25 +0200 mst r272292 : #i100727# - svtools/inc/svtools/parhtml.hxx, svtools/source/svhtml/parhtml.cxx: + fix warning: rename method to prevent overloading 2009-05-19 13:42:31 +0200 mav r272075 : #i101356# add comment 2009-05-19 10:56:24 +0200 mav r272062 : #i101356# register the singleton correctly 2009-05-19 10:25:42 +0200 mav r272060 : #i101356# register the singleton correctly 2009-05-18 12:48:48 +0200 mav r272013 : #i91306# fix the typo 2009-05-14 08:50:06 +0200 mav r271871 : #i101356# reduce the amount of macros 2009-05-13 13:26:08 +0200 mav r271858 : #i101356# reduce the amount of macros 2009-05-13 11:29:16 +0200 mav r271849 : #i101356# reduce the amount of macros 2009-05-12 12:09:42 +0200 mav r271815 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 12:03:20 +0200 mav r271814 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:58:48 +0200 mav r271813 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:53:05 +0200 mav r271812 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:48:36 +0200 mav r271810 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:43:45 +0200 mav r271809 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:39:38 +0200 mav r271808 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:37:38 +0200 mav r271806 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:33:58 +0200 mav r271805 : #i101356# allow to generate a small log if a document can not be stored 2009-05-12 11:30:01 +0200 mav r271804 : #i101356# allow to generate a small log if a document can not be stored 2009-05-06 17:43:38 +0200 mst r271607 : #i100727# - svtools/source/svhtml/parhtml.cxx: + adapt code to renaming of HTML constants (sb107) 2009-05-05 11:14:18 +0200 mav r271507 : #i101222# avoid warning 2009-05-05 10:27:23 +0200 mav r271505 : #i101426# send the modified() notification only when the document can be modified 2009-05-05 10:25:07 +0200 mav r271504 : #i101426# send the modified() notification only when the document is modified 2009-05-05 08:42:48 +0200 mav r271497 : CWS-TOOLING: rebase CWS fwk103 to trunk@271427 (milestone: DEV300:m47) 2009-04-30 13:32:11 +0200 mav r271412 : #i100518# check the template folders quietly 2009-04-29 20:04:25 +0200 mst r271393 : - sw/source/filter/html/swhtml.cxx: + fix wrong initialization order in constructor 2009-04-28 12:28:46 +0200 mav r271319 : #i99142# set the error correctly 2009-04-28 08:44:48 +0200 mav r271305 : #i99050# clear hidden flag if necessary 2009-04-28 08:40:10 +0200 mav r271304 : #i99050# avoid crash 2009-04-22 07:40:11 +0200 mav r271056 : #i101093# lets not affect the performance 2009-04-15 09:30:47 +0200 cd r270820 : #i99771# Fix warnings for gcc 4.4 2009-04-15 09:19:52 +0200 cd r270819 : #i99771# Fix warnings for gcc 4.4 2009-04-15 08:42:34 +0200 cd r270817 : #i99771# Fix warnings for gcc 4.4 2009-04-14 14:31:01 +0200 mav r270768 : #i99493# fix typo 2009-04-01 12:45:43 +0200 mst r270317 : fix #i100727# - svtools/inc/svtools/svparser.hxx, svtools/source/svrtf/svparser.cxx, sfx2/inc/sfx2/docfile.hxx, sfx2/source/doc/{objmisc.cxx,docfile.cxx}: + move SvKeyValue stuff from sfx2 to svtools - svtools/inc/svtools/parhtml.hxx, svtools/source/svhtml/parhtml.cxx, sfx2/inc/sfx2/sfxhtml.hxx, sfx2/source/bastyp/sfxhtml.cxx: + move ParseMetaOptions() and GetEncodingByMIME() from SfxHTMLParser (sfx2) to HTMLParser (svtools) + make HTMLParser::ParseMetaOptions() a virtual function + HTMLParser::ParseMetaOptions() calls GetExtendedCompatibilityTextEncoding() + new template method HTMLParser::AddMetaUserDefined() - svtools/source/svhtml/makefile.mk: + enable exceptions for parhtml.cxx - dbaccess/source/ui/misc/HtmlReader.cxx, sc/source/filter/html/htmlpars.cxx: + remove encoding related code duplication - sw/source/filter/html/{swhtml{.hxx,.cxx},htmlfld.cxx}: + new SwHTMLParser::AddMetaUserDefined() for import of DOCINFO field subtypes INFO[1-4] + do not use DocumentInfo for import of DOCINFO field subtypes INFO[1-4] 2009-03-31 17:01:35 +0200 mav r270288 : #i91214# fix typo 2009-03-31 15:19:41 +0200 mav r270285 : #i100123# allow to turn OOo locking mechanics off 2009-03-31 15:00:36 +0200 mav r270284 : #i100123# allow to turn OOo locking mechanics off 2009-03-31 12:19:13 +0200 mav r270270 : #i100123# taking the lock file over throws no exception 2009-03-30 13:57:21 +0200 mav r270227 : #i100351# fix the typo 2009-03-30 13:47:26 +0200 mav r270225 : #i99885# let OK be default button 2009-03-29 19:38:55 +0200 mav r270190 : CWS-TOOLING: rebase CWS fwk103 to trunk@270033 (milestone: DEV300:m45) 2009-03-16 16:39:48 +0100 mav r269558 : #i93558# convert the attributes as well 2009-03-13 15:35:55 +0100 mav r269488 : #i93558# improve manifest.xml parsing 2009-03-13 08:47:00 +0100 mav r269454 : #i96205# allow to remove password on SaveAs 2009-03-12 13:36:07 +0100 mav r269398 : #i91306# show special error in case of shared document 2009-03-12 13:33:35 +0100 mav r269397 : #i91306# introduce the new error-message 2009-03-12 11:40:42 +0100 mst r269378 : fix #i90877# - svtools/source/uno/unoevent.cxx: + use proper operator delete[] 2009-02-26 15:23:10 +0100 mav r268526 : #i91214# do not use ATL 2009-02-26 14:19:06 +0100 mav r268516 : #i98909# integrate the patch 2009-02-10 17:29:52 +0100 cd r267568 : #i98649# Make sure that we catch the NoSuchElementException when a module is not installed.
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/docfile.hxx90
-rw-r--r--sfx2/inc/sfx2/objsh.hxx5
-rw-r--r--sfx2/inc/sfx2/sfxhtml.hxx22
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx222
-rw-r--r--sfx2/source/control/dispatch.cxx18
-rw-r--r--sfx2/source/doc/docfile.cxx300
-rw-r--r--sfx2/source/doc/doctemplates.cxx11
-rw-r--r--sfx2/source/doc/objmisc.cxx103
-rw-r--r--sfx2/source/doc/objserv.cxx17
-rw-r--r--sfx2/source/doc/objstor.cxx108
-rw-r--r--sfx2/source/doc/plugin.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx77
-rw-r--r--sfx2/source/inc/objshimp.hxx3
13 files changed, 454 insertions, 524 deletions
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 75900531a70f..9e82e6f011e5 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -1,4 +1,4 @@
- /*************************************************************************
+/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -206,7 +206,9 @@ public:
{ return ERRCODE_TOERROR(GetErrorCode()); }
sal_uInt32 GetLastStorageCreationState();
- void SetError( sal_uInt32 nError ) { eError = nError; }
+ void SetError( sal_uInt32 nError, const ::rtl::OUString& aLogMessage );
+
+ void AddLog( const ::rtl::OUString& aMessage );
void CloseInStream();
sal_Bool CloseOutStream();
@@ -360,89 +362,5 @@ SV_DECL_COMPAT_WEAK( SfxMedium )
DECLARE_LIST( SfxMediumList, SfxMedium* )
#endif
-/*========================================================================
- *
- * SvKeyValue.
- *
- *======================================================================*/
-
-#ifndef COPYCTOR_API
-#define COPYCTOR_API(C) C (const C&); C& operator= (const C&)
-#endif
-SV_DECL_REF(SvKeyValueIterator)
-
-class SvKeyValue
-{
- /** Representation.
- */
- String m_aKey;
- String m_aValue;
-
-public:
- /** Construction.
- */
- SvKeyValue (void)
- {}
-
- SvKeyValue (const String &rKey, const String &rValue)
- : m_aKey (rKey), m_aValue (rValue)
- {}
-
- SvKeyValue (const SvKeyValue &rOther)
- : m_aKey (rOther.m_aKey), m_aValue (rOther.m_aValue)
- {}
-
- /** Assignment.
- */
- SvKeyValue& operator= (SvKeyValue &rOther)
- {
- m_aKey = rOther.m_aKey;
- m_aValue = rOther.m_aValue;
- return *this;
- }
-
- /** Operation.
- */
- const String& GetKey (void) const { return m_aKey; }
- const String& GetValue (void) const { return m_aValue; }
-
- void SetKey (const String &rKey ) { m_aKey = rKey; }
- void SetValue (const String &rValue) { m_aValue = rValue; }
-};
-
-/*========================================================================
- *
- * SvKeyValueIterator.
- *
- *======================================================================*/
-class SvKeyValueList_Impl;
-class SFX2_DLLPUBLIC SvKeyValueIterator : public SvRefBase
-{
- /** Representation.
- */
- SvKeyValueList_Impl* m_pList;
- USHORT m_nPos;
-
- /** Not implemented.
- */
- COPYCTOR_API(SvKeyValueIterator);
-
-public:
- /** Construction/Destruction.
- */
- SvKeyValueIterator (void);
- virtual ~SvKeyValueIterator (void);
-
- /** Operation.
- */
- virtual BOOL GetFirst (SvKeyValue &rKeyVal);
- virtual BOOL GetNext (SvKeyValue &rKeyVal);
- virtual void Append (const SvKeyValue &rKeyVal);
-};
-
-SV_IMPL_REF(SvKeyValueIterator);
-
-
-
#endif
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 3f2d710cfe51..53b074aa8829 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -325,7 +325,10 @@ public:
void ResetError();
sal_uInt32 GetError() const;
sal_uInt32 GetErrorCode() const;
- void SetError(sal_uInt32 rErr);
+ void SetError( sal_uInt32 rErr, const ::rtl::OUString& aLogMessage );
+
+ void AddLog( const ::rtl::OUString& aMessage );
+ void StoreLog();
sal_Bool DoInitNew( SfxMedium* pMedium=0 );
sal_Bool DoLoad( SfxMedium* pMedium );
diff --git a/sfx2/inc/sfx2/sfxhtml.hxx b/sfx2/inc/sfx2/sfxhtml.hxx
index 41689cd72729..899edd2cd201 100644
--- a/sfx2/inc/sfx2/sfxhtml.hxx
+++ b/sfx2/inc/sfx2/sfxhtml.hxx
@@ -38,16 +38,10 @@
#include <svtools/parhtml.hxx>
#include <svtools/macitem.hxx>
-namespace com { namespace sun { namespace star {
- namespace document {
- class XDocumentProperties;
- }
-} } }
class ImageMap;
class SfxMedium;
class SfxObjectShell;
-class SvKeyValueIterator;
class SFX2_DLLPUBLIC SfxHTMLParser : public HTMLParser
{
@@ -67,7 +61,7 @@ protected:
SfxHTMLParser( SvStream& rStream, BOOL bNewDoc=TRUE, SfxMedium *pMedium=0 );
- ~SfxHTMLParser();
+ virtual ~SfxHTMLParser();
public:
// Lesen der Optionen einer Image-Map
@@ -85,24 +79,14 @@ public:
USHORT nEventMouseOver = 0,
USHORT nEventMouseOut = 0);
- /// parse meta options into XDocumentProperties
- static BOOL ParseMetaOptions( const ::com::sun::star::uno::Reference<
- ::com::sun::star::document::XDocumentProperties>&,
- SvKeyValueIterator*,
- const HTMLOptions*,
- rtl_TextEncoding& rEnc );
-
// <TD SDVAL="..." SDNUM="...">
static double GetTableDataOptionsValNum( sal_uInt32& nNumForm,
LanguageType& eNumLang, const String& aValStr,
const String& aNumStr, SvNumberFormatter& rFormatter );
static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader );
-protected:
- BOOL ParseMetaOptions( const ::com::sun::star::uno::Reference<
- ::com::sun::star::document::XDocumentProperties>&,
- SvKeyValueIterator* );
+protected:
// Start eines File-Downloads. Dieser erfolgt synchron oder asynchron.
// Im synchronen Fall befindet sich der Parser nach dem Aufruf im
@@ -141,8 +125,6 @@ protected:
ScriptType GetScriptType( SvKeyValueIterator* ) const;
const String& GetScriptTypeString( SvKeyValueIterator* ) const;
- static rtl_TextEncoding GetEncodingByMIME( const String& rMime );
-
BOOL SetEncodingByHTTPHeader( SvKeyValueIterator *pHTTPHeader );
};
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 4e69228de644..13a75eb05693 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -37,7 +37,6 @@
#include <sfx2/docfile.hxx>
#include "openflag.hxx"
-#include <comphelper/string.hxx>
#include <svtools/htmlkywd.hxx>
#include <svtools/htmltokn.h>
#include <svtools/imap.hxx>
@@ -50,15 +49,13 @@
#include <svtools/svstdarr.hxx>
#endif
#include <svtools/zforlist.hxx>
-#include <svtools/inettype.hxx>
#include <rtl/tencinfo.h>
#include <tools/tenccvt.hxx>
#include <sfx2/sfxhtml.hxx>
-#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
+
using namespace ::com::sun::star;
@@ -67,20 +64,6 @@ sal_Char __FAR_DATA sHTML_MIME_text[] = "text/";
sal_Char __FAR_DATA sHTML_MIME_application[] = "application/";
sal_Char __FAR_DATA sHTML_MIME_experimental[] = "x-";
-#define HTML_META_NONE 0
-#define HTML_META_AUTHOR 1
-#define HTML_META_DESCRIPTION 2
-#define HTML_META_KEYWORDS 3
-#define HTML_META_REFRESH 4
-#define HTML_META_CLASSIFICATION 5
-#define HTML_META_CREATED 6
-#define HTML_META_CHANGEDBY 7
-#define HTML_META_CHANGED 8
-#define HTML_META_GENERATOR 9
-#define HTML_META_SDFOOTNOTE 10
-#define HTML_META_SDENDNOTE 11
-#define HTML_META_CONTENT_TYPE 12
-
// <INPUT TYPE=xxx>
#ifdef __MINGW32__ // for runtime pseudo reloc
static HTMLOptionEnum aAreaShapeOptEnums[] =
@@ -97,28 +80,6 @@ static HTMLOptionEnum __READONLY_DATA aAreaShapeOptEnums[] =
{ 0, 0 }
};
-// <META NAME=xxx>
-#ifdef __MINGW32__ // for runtime pseudo reloc
-static HTMLOptionEnum aHTMLMetaNameTable[] =
-#else
-static HTMLOptionEnum __READONLY_DATA aHTMLMetaNameTable[] =
-#endif
-{
- { OOO_STRING_SVTOOLS_HTML_META_author, HTML_META_AUTHOR },
- { OOO_STRING_SVTOOLS_HTML_META_changed, HTML_META_CHANGED },
- { OOO_STRING_SVTOOLS_HTML_META_changedby, HTML_META_CHANGEDBY },
- { OOO_STRING_SVTOOLS_HTML_META_classification,HTML_META_CLASSIFICATION},
- { OOO_STRING_SVTOOLS_HTML_META_content_type, HTML_META_CONTENT_TYPE },
- { OOO_STRING_SVTOOLS_HTML_META_created, HTML_META_CREATED },
- { OOO_STRING_SVTOOLS_HTML_META_description, HTML_META_DESCRIPTION },
- { OOO_STRING_SVTOOLS_HTML_META_keywords, HTML_META_KEYWORDS },
- { OOO_STRING_SVTOOLS_HTML_META_generator, HTML_META_GENERATOR },
- { OOO_STRING_SVTOOLS_HTML_META_refresh, HTML_META_REFRESH },
- { OOO_STRING_SVTOOLS_HTML_META_sdendnote, HTML_META_SDENDNOTE },
- { OOO_STRING_SVTOOLS_HTML_META_sdfootnote, HTML_META_SDFOOTNOTE },
- { 0, 0 }
-};
-
SfxHTMLParser::SfxHTMLParser( SvStream& rStream, BOOL bIsNewDoc,
SfxMedium *pMed ) :
HTMLParser( rStream, bIsNewDoc ),
@@ -288,169 +249,6 @@ IMAPOBJ_SETEVENT:
return bNewArea;
}
-BOOL SfxHTMLParser::ParseMetaOptions(
- const uno::Reference<document::XDocumentProperties> & i_xDocProps,
- SvKeyValueIterator *pHTTPHeader,
- const HTMLOptions *pOptions,
- rtl_TextEncoding& rEnc )
-{
- String aName, aContent;
- USHORT nAction = HTML_META_NONE;
- BOOL bHTTPEquiv = FALSE, bChanged = FALSE;
-
- for( USHORT i = pOptions->Count(); i; )
- {
- const HTMLOption *pOption = (*pOptions)[ --i ];
- switch( pOption->GetToken() )
- {
- case HTML_O_NAME:
- aName = pOption->GetString();
- if( HTML_META_NONE==nAction )
- pOption->GetEnum( nAction, aHTMLMetaNameTable );
- break;
- case HTML_O_HTTPEQUIV:
- aName = pOption->GetString();
- pOption->GetEnum( nAction, aHTMLMetaNameTable );
- bHTTPEquiv = TRUE;
- break;
- case HTML_O_CONTENT:
- aContent = pOption->GetString();
- break;
- }
- }
-
- if( bHTTPEquiv || HTML_META_DESCRIPTION!=nAction )
- {
- // wenn's keine Description ist CRs und LFs aus dem CONTENT entfernen
- aContent.EraseAllChars( _CR );
- aContent.EraseAllChars( _LF );
- }
- else
- {
- // fuer die Beschreibung die Zeilen-Umbrueche entsprechen wandeln
- aContent.ConvertLineEnd();
- }
-
-
- if( bHTTPEquiv && pHTTPHeader )
- {
- // #57232#: Netscape scheint ein abschliessendes " einfach zu
- // ignorieren, also tun wir das auch.
- if( aContent.Len() && '"' == aContent.GetChar( aContent.Len()-1 ) )
- aContent.Erase( aContent.Len() - 1 );
- SvKeyValue aKeyValue( aName, aContent );
- pHTTPHeader->Append( aKeyValue );
- }
-
- switch( nAction )
- {
- case HTML_META_AUTHOR:
- if (i_xDocProps.is()) {
- i_xDocProps->setAuthor( aContent );
- bChanged = TRUE;
- }
- break;
- case HTML_META_DESCRIPTION:
- if (i_xDocProps.is()) {
- i_xDocProps->setDescription( aContent );
- bChanged = TRUE;
- }
- break;
- case HTML_META_KEYWORDS:
- if (i_xDocProps.is()) {
- i_xDocProps->setKeywords(
- ::comphelper::string::convertCommaSeparated(aContent));
- bChanged = TRUE;
- }
- break;
- case HTML_META_CLASSIFICATION:
- if (i_xDocProps.is()) {
- i_xDocProps->setSubject( aContent );
- bChanged = TRUE;
- }
- break;
-
- case HTML_META_CHANGEDBY:
- if (i_xDocProps.is()) {
- i_xDocProps->setModifiedBy( aContent );
- bChanged = TRUE;
- }
- break;
-
- case HTML_META_CREATED:
- case HTML_META_CHANGED:
- if( i_xDocProps.is() && aContent.Len() && aContent.GetTokenCount()==2 )
- {
- Date aDate( (ULONG)aContent.GetToken(0).ToInt32() );
- Time aTime( (ULONG)aContent.GetToken(1).ToInt32() );
- DateTime aDateTime( aDate, aTime );
- ::util::DateTime uDT(aDateTime.Get100Sec(),
- aDateTime.GetSec(), aDateTime.GetMin(),
- aDateTime.GetHour(), aDateTime.GetDay(),
- aDateTime.GetMonth(), aDateTime.GetYear());
- if( HTML_META_CREATED==nAction )
- i_xDocProps->setCreationDate( uDT );
- else
- i_xDocProps->setModificationDate( uDT );
- bChanged = TRUE;
- }
- break;
-
- case HTML_META_REFRESH:
- DBG_ASSERT( !bHTTPEquiv || pHTTPHeader,
- "Reload-URL aufgrund unterlsassener MUSS-Aenderung verlorengegangen" );
- break;
-
- case HTML_META_CONTENT_TYPE:
- if( aContent.Len() )
- rEnc = GetEncodingByMIME( aContent );
- bChanged = TRUE;
- break;
-
- case HTML_META_NONE:
- if( !bHTTPEquiv )
- {
- if (i_xDocProps.is()) {
- uno::Reference<beans::XPropertyContainer> xUDProps
- = i_xDocProps->getUserDefinedProperties();
- try {
- xUDProps->addProperty(aName,
- beans::PropertyAttribute::REMOVEABLE,
- uno::makeAny(::rtl::OUString(aContent)));
- bChanged = TRUE;
- } catch (uno::Exception &) {
- // ignore
- }
- }
- }
- break;
- }
-
- return bChanged;
-}
-
-BOOL SfxHTMLParser::ParseMetaOptions(
- const uno::Reference<document::XDocumentProperties> & i_xDocProps,
- SvKeyValueIterator *pHeader )
-{
- USHORT nContentOption = HTML_O_CONTENT;
- rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
-
- BOOL bRet = ParseMetaOptions( i_xDocProps, pHeader,
- GetOptions(&nContentOption),
- eEnc );
-
- // If the encoding is set by a META tag, it may only overwrite the
- // current encoding if both, the current and the new encoding, are 1-BYTE
- // encodings. Everything else cannot lead to reasonable results.
- if( RTL_TEXTENCODING_DONTKNOW != eEnc &&
- rtl_isOctetTextEncoding( eEnc ) &&
- rtl_isOctetTextEncoding( GetSrcEncoding() ) )
- SetSrcEncoding( eEnc );
-
- return bRet;
-}
-
void SfxHTMLParser::StartFileDownload( const String& rURL, int nToken,
SfxObjectShell *pSh )
@@ -559,24 +357,6 @@ IMPL_STATIC_LINK( SfxHTMLParser, FileDownloadDone, void*, EMPTYARG )
return 0;
}
-rtl_TextEncoding SfxHTMLParser::GetEncodingByMIME( const String& rMime )
-{
- ByteString sType;
- ByteString sSubType;
- INetContentTypeParameterList aParameters;
- ByteString sMime( rMime, RTL_TEXTENCODING_ASCII_US );
- if (INetContentTypes::parse(sMime, sType, sSubType, &aParameters))
- {
- const INetContentTypeParameter * pCharset
- = aParameters.find("charset");
- if (pCharset != 0)
- {
- ByteString sValue( pCharset->m_sValue, RTL_TEXTENCODING_ASCII_US );
- return GetExtendedCompatibilityTextEncoding(rtl_getTextEncodingFromMimeCharset( sValue.GetBuffer() ) );
- }
- }
- return RTL_TEXTENCODING_DONTKNOW;
-}
rtl_TextEncoding SfxHTMLParser::GetEncodingByHttpHeader( SvKeyValueIterator *pHTTPHeader )
{
rtl_TextEncoding eRet = RTL_TEXTENCODING_DONTKNOW;
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 1c893d7f32f2..f57ca40e8519 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -270,8 +270,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
}
}
- SfxBindings *pBindings = GetBindings();
-
// Alles holen, was gebraucht wird, da der Slot den Execute evtl. nicht
// "uberlebt, falls es ein 'Pseudoslot' f"ur Macros oder Verben ist
sal_Bool bAutoUpdate = rSlot.IsMode(SFX_SLOT_AUTOUPDATE);
@@ -308,9 +306,17 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
// falls 'this' noch lebt
if ( bThisDispatcherAlive )
pImp->pInCallAliveFlag = pOldInCallAliveFlag;
- else if ( pOldInCallAliveFlag )
- // auch verschachtelte Stack-Frames sch"utzen
- *pOldInCallAliveFlag = sal_False;
+ else
+ {
+ if ( pOldInCallAliveFlag )
+ {
+ // auch verschachtelte Stack-Frames sch"utzen
+ *pOldInCallAliveFlag = sal_False;
+ }
+
+ // do nothing after this object is dead
+ return rReq.IsDone();
+ }
}
// TabPage-ID und Executing-SID zurueck setzen
@@ -325,6 +331,8 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
if ( rReq.IsDone() )
{
+ SfxBindings *pBindings = GetBindings();
+
// bei AutoUpdate sofort updaten; "Pseudoslots" d"urfen nicht
// Autoupdate sein!
if ( bAutoUpdate && pBindings )
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c530c59851ec..79197b6e5f52 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/ucb/NameClashException.hpp>
+#include <com/sun/star/logging/XSimpleLogRing.hpp>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#ifndef _COM_SUN_STAR_SECURITY_DOCUMENTSIGNATURESINFORMATION_HPP_
@@ -82,6 +83,7 @@
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
#include <unotools/streamhelper.hxx>
#include <unotools/localedatawrapper.hxx>
#ifndef _MSGBOX_HXX //autogen
@@ -93,6 +95,7 @@
#include <svtools/sfxecode.hxx>
#include <svtools/itemset.hxx>
#include <svtools/intitem.hxx>
+#include <svtools/svparser.hxx> // SvKeyValue
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase1.hxx>
@@ -149,12 +152,73 @@ using namespace ::com::sun::star::io;
#define MAX_REDIRECT 5
+
+//==========================================================
namespace {
- static const sal_Int8 LOCK_UI_NOLOCK = 0;
- static const sal_Int8 LOCK_UI_SUCCEEDED = 1;
- static const sal_Int8 LOCK_UI_TRY = 2;
+
+static const sal_Int8 LOCK_UI_NOLOCK = 0;
+static const sal_Int8 LOCK_UI_SUCCEEDED = 1;
+static const sal_Int8 LOCK_UI_TRY = 2;
+
+//----------------------------------------------------------------
+sal_Bool IsSystemFileLockingUsed()
+{
+ // check whether system file locking has been used, the default value is false
+ sal_Bool bUseSystemLock = sal_False;
+ try
+ {
+
+ uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig(
+ ::comphelper::getProcessServiceFactory(),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ),
+ ::comphelper::ConfigurationHelper::E_STANDARD );
+ if ( !xCommonConfig.is() )
+ throw uno::RuntimeException();
+
+ ::comphelper::ConfigurationHelper::readRelativeKey(
+ xCommonConfig,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentSystemFileLocking" ) ) ) >>= bUseSystemLock;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+
+ return bUseSystemLock;
+}
+
+//----------------------------------------------------------------
+sal_Bool IsOOoLockFileUsed()
+{
+ // check whether system file locking has been used, the default value is false
+ sal_Bool bOOoLockFileUsed = sal_False;
+ try
+ {
+
+ uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig(
+ ::comphelper::getProcessServiceFactory(),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ),
+ ::comphelper::ConfigurationHelper::E_STANDARD );
+ if ( !xCommonConfig.is() )
+ throw uno::RuntimeException();
+
+ ::comphelper::ConfigurationHelper::readRelativeKey(
+ xCommonConfig,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentOOoLockFile" ) ) ) >>= bOOoLockFileUsed;
+ }
+ catch( const uno::Exception& )
+ {
+ }
+
+ return bOOoLockFileUsed;
}
+} // anonymous namespace
+//==========================================================
+
+
+//----------------------------------------------------------------
class SfxMediumHandler_Impl : public ::cppu::WeakImplHelper1< com::sun::star::task::XInteractionHandler >
{
com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > m_xInter;
@@ -170,10 +234,12 @@ public:
~SfxMediumHandler_Impl();
};
+//----------------------------------------------------------------
SfxMediumHandler_Impl::~SfxMediumHandler_Impl()
{
}
+//----------------------------------------------------------------
void SAL_CALL SfxMediumHandler_Impl::handle( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest >& xRequest )
throw( com::sun::star::uno::RuntimeException )
{
@@ -192,6 +258,7 @@ void SAL_CALL SfxMediumHandler_Impl::handle( const com::sun::star::uno::Referenc
m_xInter->handle( xRequest );
}
+//----------------------------------------------------------------
class SfxPoolCancelManager_Impl : public SfxCancelManager ,
public SfxCancellable ,
public SfxListener ,
@@ -208,6 +275,7 @@ public:
virtual void Cancel();
};
+//----------------------------------------------------------------
SV_DECL_IMPL_REF( SfxPoolCancelManager_Impl )
@@ -327,6 +395,8 @@ public:
util::DateTime m_aDateTime;
+ uno::Reference< logging::XSimpleLogRing > m_xLogRing;
+
SfxPoolCancelManager_Impl* GetCancelManager();
SfxMedium_Impl( SfxMedium* pAntiImplP );
@@ -341,7 +411,7 @@ void SfxMedium::DataAvailable_Impl()
void SfxMedium::Cancel_Impl()
{
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
SfxPoolCancelManager_Impl* SfxMedium_Impl::GetCancelManager()
@@ -449,6 +519,33 @@ sal_uInt32 SfxMedium::GetLastStorageCreationState()
}
//------------------------------------------------------------------
+void SfxMedium::AddLog( const ::rtl::OUString& aMessage )
+{
+ if ( !pImp->m_xLogRing.is() )
+ {
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ if ( aContext.is() )
+ pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ if ( pImp->m_xLogRing.is() )
+ pImp->m_xLogRing->logString( aMessage );
+}
+
+//------------------------------------------------------------------
+void SfxMedium::SetError( sal_uInt32 nError, const ::rtl::OUString& aLogMessage )
+{
+ eError = nError;
+ if ( eError != ERRCODE_NONE && aLogMessage.getLength() )
+ AddLog( aLogMessage );
+}
+
+//------------------------------------------------------------------
sal_uInt32 SfxMedium::GetErrorCode() const
{
sal_uInt32 lError=eError;
@@ -479,28 +576,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
|| pImp->m_aDateTime.Month != aInitDate.Month
|| pImp->m_aDateTime.Year != aInitDate.Year )
{
- // check whether system file locking has been used, the default value is false
- sal_Bool bUseSystemLock = sal_False;
- try
- {
-
- uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig(
- ::comphelper::getProcessServiceFactory(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- if ( !xCommonConfig.is() )
- throw uno::RuntimeException();
-
- ::comphelper::ConfigurationHelper::readRelativeKey(
- xCommonConfig,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentSystemFileLocking" ) ) ) >>= bUseSystemLock;
- }
- catch( const uno::Exception& )
- {
- }
-
- if ( !bUseSystemLock )
+ if ( !IsSystemFileLockingUsed() )
{
uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler();
@@ -520,7 +596,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
{
- SetError( ERRCODE_ABORT );
+ SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
catch ( uno::Exception& )
@@ -946,7 +1022,7 @@ void SfxMedium::StorageBackup_Impl()
{
DoInternalBackup_Impl( aOriginalContent );
if( !pImp->m_aBackupURL.getLength() )
- SetError( ERRCODE_SFX_CANTCREATEBACKUP );
+ SetError( ERRCODE_SFX_CANTCREATEBACKUP, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
@@ -1021,7 +1097,7 @@ void SfxMedium::SetPasswordToStorage_Impl()
{
OSL_ENSURE( sal_False, "It must be possible to set a common password for the storage" );
// TODO/LATER: set the error code in case of problem
- // SetError( ERRCODE_IO_GENERAL );
+ // SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
}
@@ -1090,7 +1166,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri
::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
{
- SetError( ERRCODE_ABORT );
+ SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
else if ( uno::Reference< task::XInteractionDisapprove >( xSelected.get(), uno::UNO_QUERY ).is() )
{
@@ -1129,7 +1205,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri
GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
}
else
- SetError( ERRCODE_IO_ACCESSDENIED );
+ SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
@@ -1184,24 +1260,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
sal_Int8 bUIStatus = LOCK_UI_NOLOCK;
// check whether system file locking has been used, the default value is false
- sal_Bool bUseSystemLock = sal_False;
- try
- {
- uno::Reference< uno::XInterface > xCommonConfig = ::comphelper::ConfigurationHelper::openConfig(
- ::comphelper::getProcessServiceFactory(),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common" ) ),
- ::comphelper::ConfigurationHelper::E_STANDARD );
- if ( !xCommonConfig.is() )
- throw uno::RuntimeException();
-
- ::comphelper::ConfigurationHelper::readRelativeKey(
- xCommonConfig,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseDocumentSystemFileLocking" ) ) ) >>= bUseSystemLock;
- }
- catch( const uno::Exception& )
- {
- }
+ sal_Bool bUseSystemLock = IsSystemFileLockingUsed();
// TODO/LATER: This implementation does not allow to detect the system lock on saving here, actually this is no big problem
// if system lock is used the writeable stream should be available
@@ -1220,35 +1279,55 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
}
catch ( ucb::InteractiveIOException& e )
{
- if ( e.Code == IOErrorCode_INVALID_PARAMETER )
+ // exception means that the lock file can not be successfuly accessed
+ // in this case it should be ignored if system file locking is anyway active
+ if ( bUseSystemLock || !IsOOoLockFileUsed() )
{
- // it looks like the lock file name is not accepted by the content
- if ( !bUseSystemLock )
- {
- // system file locking is not active, ask user whether he wants to open the document without any locking
- uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler();
+ bResult = sal_True;
+ // take the ownership over the lock file
+ aLockFile.OverwriteOwnLockFile();
+ }
+ else if ( e.Code == IOErrorCode_INVALID_PARAMETER )
+ {
+ // system file locking is not active, ask user whether he wants to open the document without any locking
+ uno::Reference< task::XInteractionHandler > xHandler = GetInteractionHandler();
- if ( xHandler.is() )
- {
- ::rtl::Reference< ::ucbhelper::InteractionRequest > xIgnoreRequestImpl
- = new ::ucbhelper::InteractionRequest( uno::makeAny( document::LockFileIgnoreRequest() ) );
+ if ( xHandler.is() )
+ {
+ ::rtl::Reference< ::ucbhelper::InteractionRequest > xIgnoreRequestImpl
+ = new ::ucbhelper::InteractionRequest( uno::makeAny( document::LockFileIgnoreRequest() ) );
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( 2 );
- aContinuations[0] = new ::ucbhelper::InteractionAbort( xIgnoreRequestImpl.get() );
- aContinuations[1] = new ::ucbhelper::InteractionApprove( xIgnoreRequestImpl.get() );
- xIgnoreRequestImpl->setContinuations( aContinuations );
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > aContinuations( 2 );
+ aContinuations[0] = new ::ucbhelper::InteractionAbort( xIgnoreRequestImpl.get() );
+ aContinuations[1] = new ::ucbhelper::InteractionApprove( xIgnoreRequestImpl.get() );
+ xIgnoreRequestImpl->setContinuations( aContinuations );
- xHandler->handle( xIgnoreRequestImpl.get() );
+ xHandler->handle( xIgnoreRequestImpl.get() );
- ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection();
- bResult = ( uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is() );
- }
+ ::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection();
+ bResult = ( uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is() );
}
- else
- bResult = sal_True;
}
- else
- throw;
+ }
+ catch ( uno::Exception& )
+ {
+ // exception means that the lock file can not be successfuly accessed
+ // in this case it should be ignored if system file locking is anyway active
+ if ( bUseSystemLock || !IsOOoLockFileUsed() )
+ {
+ bResult = sal_True;
+ // take the ownership over the lock file
+ aLockFile.OverwriteOwnLockFile();
+ }
+ }
+
+ // in case OOo locking is turned off the lock file is still written if possible
+ // but it is ignored while deciding whether the document should be opened for editing or not
+ if ( !bResult && !IsOOoLockFileUsed() )
+ {
+ bResult = sal_True;
+ // take the ownership over the lock file
+ aLockFile.OverwriteOwnLockFile();
}
}
@@ -1316,7 +1395,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
SFX_ITEMSET_ARG( pSet, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, FALSE );
if ( !bLoading || (pReadOnlyItem && !pReadOnlyItem->GetValue()) )
- SetError( ERRCODE_IO_ACCESSDENIED );
+ SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
else
GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
}
@@ -1816,13 +1895,13 @@ sal_Bool SfxMedium::StorageCommit_Impl()
}
if ( !GetError() )
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
catch ( uno::Exception& )
{
//TODO/LATER: improve error handling
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
}
@@ -2102,7 +2181,7 @@ void SfxMedium::Transfer_Impl()
else
{
DBG_ERROR( "Illegal Output stream parameter!\n" );
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
// free the reference
@@ -2147,7 +2226,7 @@ void SfxMedium::Transfer_Impl()
{
//TODO/MBA: error handling
//if ( !GetError() )
- // SetError( xStor->GetError() );
+ // SetError( xStor->GetError(, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )) );
}
return;
}
@@ -2192,7 +2271,7 @@ void SfxMedium::Transfer_Impl()
SetStorage_Impl( xStor );
}
else if ( !GetError() )
- SetError( xStor->GetError() );
+ SetError( xStor->GetError(, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )) );
return;
}*/
}
@@ -2573,7 +2652,7 @@ void SfxMedium::GetMedium_Impl()
//TODO/MBA: ErrorHandling - how to transport error from MediaDescriptor
if ( !GetError() && !pImp->xStream.is() && !pImp->xInputStream.is() )
- SetError( ERRCODE_IO_ACCESSDENIED );
+ SetError( ERRCODE_IO_ACCESSDENIED, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
if ( !GetError() )
{
@@ -3696,17 +3775,17 @@ void SfxMedium::TryToSwitchToRepairedTemp()
catch ( uno::Exception& )
{
//TODO/MBA: error handling
- //SetError( aNewStorage->GetError() );
+ //SetError( aNewStorage->GetError(, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) )) );
}
}
else
- SetError( ERRCODE_IO_CANTWRITE );
+ SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
if (pImp->pTempFile != pTmpFile)
delete pTmpFile;
}
else
- SetError( ERRCODE_IO_CANTREAD );
+ SetError( ERRCODE_IO_CANTREAD, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
@@ -3756,7 +3835,7 @@ void SfxMedium::CreateTempFile()
aName = pImp->pTempFile->GetFileName();
if ( !aName.Len() )
{
- SetError( ERRCODE_IO_CANTWRITE );
+ SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return;
}
@@ -3800,7 +3879,7 @@ void SfxMedium::CreateTempFileNoCopy()
aName = pImp->pTempFile->GetFileName();
if ( !aName.Len() )
{
- SetError( ERRCODE_IO_CANTWRITE );
+ SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return;
}
@@ -4005,61 +4084,6 @@ sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OU
return bResult;
}
-SV_DECL_PTRARR_DEL(SvKeyValueList_Impl, SvKeyValue*, 0, 4)
-SV_IMPL_PTRARR(SvKeyValueList_Impl, SvKeyValue*);
-
-/*
- * SvKeyValueIterator.
- */
-SvKeyValueIterator::SvKeyValueIterator (void)
- : m_pList (new SvKeyValueList_Impl),
- m_nPos (0)
-{
-}
-
-/*
- * ~SvKeyValueIterator.
- */
-SvKeyValueIterator::~SvKeyValueIterator (void)
-{
- delete m_pList;
-}
-
-/*
- * GetFirst.
- */
-BOOL SvKeyValueIterator::GetFirst (SvKeyValue &rKeyVal)
-{
- m_nPos = m_pList->Count();
- return GetNext (rKeyVal);
-}
-
-/*
- * GetNext.
- */
-BOOL SvKeyValueIterator::GetNext (SvKeyValue &rKeyVal)
-{
- if (m_nPos > 0)
- {
- rKeyVal = *m_pList->GetObject(--m_nPos);
- return TRUE;
- }
- else
- {
- // Nothing to do.
- return FALSE;
- }
-}
-
-/*
- * Append.
- */
-void SvKeyValueIterator::Append (const SvKeyValue &rKeyVal)
-{
- SvKeyValue *pKeyVal = new SvKeyValue (rKeyVal);
- m_pList->C40_INSERT(SvKeyValue, pKeyVal, m_pList->Count());
-}
-
BOOL SfxMedium::HasStorage_Impl() const
{
return pImp->xStorage.is();
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 7940e0e3e79a..731c04c1086d 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1220,10 +1220,14 @@ void SfxDocTplService_Impl::doUpdate()
// the last directory in the list must be writable
sal_Bool bWriteableDirectory = sal_True;
+
+ // the target folder might not exist, for this reason no interaction handler should be used
+ uno::Reference< XCommandEnvironment > aQuietEnv;
+
while ( nCountDir )
{
nCountDir--;
- if ( Content::create( pDirs[ nCountDir ], maCmdEnv, aDirContent ) )
+ if ( Content::create( pDirs[ nCountDir ], aQuietEnv, aDirContent ) )
{
createFromContent( aGroupList, aDirContent, sal_False, bWriteableDirectory );
}
@@ -2535,7 +2539,10 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList,
try
{
- aContent = Content( rOwnURL, maCmdEnv );
+ // this method is only used during checking of the available template-folders
+ // that should happen quietly
+ uno::Reference< XCommandEnvironment > aQuietEnv;
+ aContent = Content( rOwnURL, aQuietEnv );
ResultSetInclude eInclude = INCLUDE_DOCUMENTS_ONLY;
xResultSet = aContent.createCursor( aProps, eInclude );
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 7bb988f6d80e..8e1c618f65cd 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -38,6 +38,7 @@
#include <svtools/eitem.hxx>
#include <svtools/stritem.hxx>
#include <svtools/intitem.hxx>
+#include <svtools/svparser.hxx> // SvKeyValue
#include <vos/mutex.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -64,6 +65,7 @@
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/script/provider/XScript.hpp>
@@ -113,6 +115,7 @@ using namespace ::com::sun::star::container;
#include <svtools/inettype.hxx>
#include <svtools/sharecontrolfile.hxx>
#include <osl/file.hxx>
+#include <rtl/bootstrap.hxx>
#include <vcl/svapp.hxx>
#include <framework/interaction.hxx>
#include <comphelper/storagehelper.hxx>
@@ -256,10 +259,15 @@ void SfxObjectShell::FlushDocInfo()
//-------------------------------------------------------------------------
-void SfxObjectShell::SetError(sal_uInt32 lErr)
+void SfxObjectShell::SetError( sal_uInt32 lErr, const ::rtl::OUString& aLogMessage )
{
if(pImp->lErr==ERRCODE_NONE)
+ {
pImp->lErr=lErr;
+
+ if( lErr != ERRCODE_NONE && aLogMessage.getLength() )
+ AddLog( aLogMessage );
+ }
}
//-------------------------------------------------------------------------
@@ -285,6 +293,9 @@ sal_uInt32 SfxObjectShell::GetErrorCode() const
void SfxObjectShell::ResetError()
{
+ if( pImp->lErr != ERRCODE_NONE )
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Resetting Error." ) ) );
+
pImp->lErr=0;
SfxMedium * pMed = GetMedium();
if( pMed )
@@ -669,7 +680,7 @@ void SfxObjectShell::DisconnectFromShared()
SfxMedium* pTmpMedium = pMedium;
ForgetMedium();
if( !DoSaveCompleted( pTmpMedium ) )
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
else
{
// the medium should not dispose the storage, DoSaveCompleted() has let it to do so
@@ -1444,7 +1455,7 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
ForgetMedium();
if( !DoSaveCompleted( pTmpMedium ) )
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
else
{
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
@@ -2330,3 +2341,89 @@ void SfxObjectShell_Impl::showBrokenSignatureWarning( const uno::Reference< task
const_cast< SfxObjectShell_Impl* >( this )->bSignatureErrorIsShown = sal_True;
}
}
+
+void SfxObjectShell::AddLog( const ::rtl::OUString& aMessage )
+{
+ if ( !pImp->m_xLogRing.is() )
+ {
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ if ( aContext.is() )
+ pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ if ( pImp->m_xLogRing.is() )
+ pImp->m_xLogRing->logString( aMessage );
+}
+
+namespace {
+
+void WriteStringInStream( const uno::Reference< io::XOutputStream >& xOutStream, const ::rtl::OUString& aString )
+{
+ if ( xOutStream.is() )
+ {
+ ::rtl::OString aStrLog = ::rtl::OUStringToOString( aString, RTL_TEXTENCODING_UTF8 );
+ uno::Sequence< sal_Int8 > aLogData( (const sal_Int8*)aStrLog.getStr(), aStrLog.getLength() );
+ xOutStream->writeBytes( aLogData );
+
+ aLogData.realloc( 1 );
+ aLogData[0] = '\n';
+ xOutStream->writeBytes( aLogData );
+ }
+}
+
+}
+
+void SfxObjectShell::StoreLog()
+{
+ if ( !pImp->m_xLogRing.is() )
+ {
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ if ( aContext.is() )
+ pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
+ }
+ catch( uno::Exception& )
+ {}
+ }
+
+ if ( pImp->m_xLogRing.is() )
+ {
+ ::rtl::OUString aFileURL =
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ) );
+ ::rtl::Bootstrap::expandMacros( aFileURL );
+
+ ::rtl::OUString aBuildID =
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ) );
+ ::rtl::Bootstrap::expandMacros( aBuildID );
+
+ if ( aFileURL.getLength() )
+ {
+ aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/temp/document_io_logring.txt" ) );
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW );
+ uno::Reference< ucb::XSimpleFileAccess > xSimpleFileAccess( xFactory->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< io::XStream > xStream( xSimpleFileAccess->openFileReadWrite( aFileURL ), uno::UNO_SET_THROW );
+ uno::Reference< io::XOutputStream > xOutStream( xStream->getOutputStream(), uno::UNO_SET_THROW );
+ uno::Reference< io::XTruncate > xTruncate( xOutStream, uno::UNO_QUERY_THROW );
+ xTruncate->truncate();
+
+ if ( aBuildID.getLength() )
+ WriteStringInStream( xOutStream, aBuildID );
+
+ uno::Sequence< ::rtl::OUString > aLogSeq = pImp->m_xLogRing->getCollectedLog();
+ for ( sal_Int32 nInd = 0; nInd < aLogSeq.getLength(); nInd++ )
+ WriteStringInStream( xOutStream, aLogSeq[nInd] );
+ }
+ catch( uno::Exception& )
+ {}
+ }
+ }
+}
+
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a9d992a9afda..3571c4226ff7 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -639,11 +639,20 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
SfxStoringHelper aHelper( xEmptyFactory );
if ( QueryHiddenInformation( bIsPDFExport ? WhenCreatingPDF : WhenSaving, NULL ) == RET_YES )
+ {
bDialogUsed = aHelper.GUIStoreModel( GetModel(),
- ::rtl::OUString::createFromAscii( pSlot->GetUnoName() ),
- aDispatchArgs,
- bPreselectPassword,
- GetSharedFileURL() );
+ ::rtl::OUString::createFromAscii( pSlot->GetUnoName() ),
+ aDispatchArgs,
+ bPreselectPassword,
+ GetSharedFileURL() );
+ }
+ else
+ {
+ // the user has decided not to store the document
+ throw task::ErrorCodeIOException( ::rtl::OUString(),
+ uno::Reference< uno::XInterface >(),
+ ERRCODE_IO_ABORT );
+ }
// the scripting signature might be preserved
// pImp->nScriptingSignatureState = SIGNATURESTATE_NOSIGNATURES;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 4eb5c6f417fd..76e6bb59e189 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -282,7 +282,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
catch( uno::Exception& )
{
// TODO/LATER: handle the error depending on exception
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
return bResult;
@@ -314,7 +314,7 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
aTempURL = ::rtl::OUString();
// TODO/LATER: may need error code setting based on exception
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
@@ -356,7 +356,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
}
catch( uno::Exception& )
{
- const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL );
+ const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
::rtl::OUString aVersion;
@@ -412,7 +412,7 @@ sal_Bool SfxObjectShell::GeneralInit_Impl( const uno::Reference< embed::XStorage
{
if ( bTypeMustBeSetAlready )
{
- SetError( ERRCODE_IO_BROKENPACKAGE );
+ SetError( ERRCODE_IO_BROKENPACKAGE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return sal_False;
}
@@ -632,7 +632,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
{
sal_uInt32 nError = HandleFilter( pMedium, this );
if ( nError != ERRCODE_NONE )
- SetError( nError );
+ SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
EnableSetModified( sal_False );
@@ -666,12 +666,12 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
if ( bWarnMediaTypeFallback || !xStorage->getElementNames().getLength() )
- SetError( ERRCODE_IO_BROKENPACKAGE );
+ SetError( ERRCODE_IO_BROKENPACKAGE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
catch( uno::Exception& )
{
// TODO/LATER: may need error code setting based on exception
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
// Load
@@ -691,11 +691,11 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
SetReadOnlyUI();
}
else
- SetError( ERRCODE_ABORT );
+ SetError( ERRCODE_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
else
- SetError( pMed->GetLastStorageCreationState() );
+ SetError( pMed->GetLastStorageCreationState(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
else if ( GetError() == ERRCODE_NONE && InitNew(0) )
{
@@ -1049,7 +1049,7 @@ sal_Bool SfxObjectShell::DoSave()
}
catch( uno::Exception& )
{
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
DBG_ASSERT( bOk, "The root storage must allow to set common password!\n" );
@@ -1089,7 +1089,7 @@ sal_Bool SfxObjectShell::DoSave()
}
catch( uno::Exception& )
{
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
bOk = sal_False;
}
}
@@ -1140,6 +1140,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
{
RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mv76033) SfxObjectShell::SaveTo_Impl" );
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Begin" ) ) );
+
ModifyBlocker_Impl aMod(this);
const SfxFilter *pFilter = rMedium.GetFilter();
@@ -1161,7 +1163,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// protected libraries exceed the size we can handler
if ( bOwnTarget && !QuerySaveSizeExceededModules_Impl( rMedium.GetInteractionHandler() ) )
{
- SetError( ERRCODE_IO_ABORT );
+ SetError( ERRCODE_IO_ABORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return sal_False;
}
@@ -1178,6 +1180,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
|| pImp->nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED
|| pImp->nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_INVALID ) )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "MacroSignaturePreserving" ) ) );
+
// the checking of the library modified state iterates over the libraries, should be done only when required
bTryToPreservScriptSignature = !pImp->pBasicManager->isAnyContainerModified();
if ( bTryToPreservScriptSignature )
@@ -1221,13 +1225,14 @@ sal_Bool SfxObjectShell::SaveTo_Impl
&& SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) )
{
bStoreToSameLocation = sal_True;
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
rMedium.CheckFileDate( pMedium->GetInitFileDate() );
if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
// export to the same location is vorbidden
- SetError( ERRCODE_IO_CANTWRITE );
+ SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
else
{
@@ -1236,10 +1241,11 @@ sal_Bool SfxObjectShell::SaveTo_Impl
const sal_Bool bDoBackup = SvtSaveOptions().IsBackup();
if ( bDoBackup )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "DoBackup" ) ) );
rMedium.DoBackup_Impl();
if ( rMedium.GetError() )
{
- SetError( rMedium.GetErrorCode() );
+ SetError( rMedium.GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
rMedium.ResetError();
}
}
@@ -1262,6 +1268,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// commit the wrapper stream ( the stream will connect the URL only on commit, after that it will hold it )
// if the last step is failed the stream should stay to be transacted and should be commited on any flush
// so we can forget the stream in any way and the next storage commit will flush it
+
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Own to Own" ) ) );
+
bNeedsDisconnectionOnFail = DisconnectStorage_Impl(
*pMedium, rMedium );
if ( bNeedsDisconnectionOnFail
@@ -1282,6 +1291,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// the source and the target formats are alien
// just disconnect the stream from the source format
// so that the target medium can use it
+
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Alien to Alien" ) ) );
+
pMedium->CloseAndRelease();
rMedium.CloseAndRelease();
rMedium.CreateTempFileNoCopy();
@@ -1292,6 +1304,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// the source format is an alien one but the target
// format is an own one so just disconnect the source
// medium
+
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Alien to Own" ) ) );
+
pMedium->CloseAndRelease();
rMedium.CloseAndRelease();
rMedium.GetOutputStorage();
@@ -1301,6 +1316,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// the source format is an own one but the target is
// an alien format, just connect the source to temporary
// storage
+
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save: Own to Alien" ) ) );
+
bNeedsDisconnectionOnFail = DisconnectStorage_Impl(
*pMedium, rMedium );
if ( bNeedsDisconnectionOnFail
@@ -1320,6 +1338,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
// the alien filters still might write directly to the file, that is of course a bug,
// but for now the framework has to be ready for it
// TODO/LATER: let the medium be prepared for alien formats as well
+
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "SaveAs/Export" ) ) );
+
rMedium.CloseAndRelease();
if ( bStorageBasedTarget )
{
@@ -1331,6 +1352,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if( rMedium.GetErrorCode() || pMedium->GetErrorCode() || GetErrorCode() )
return sal_False;
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Locking" ) ) );
+
rMedium.LockOrigFileOnDemand( sal_False, sal_False );
if ( bStorageBasedTarget )
@@ -1384,12 +1407,14 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if( bOwnTarget && !( pFilter->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing in own format." ) ) );
uno::Reference< embed::XStorage > xMedStorage = rMedium.GetStorage();
if ( !xMedStorage.is() )
{
// no saving without storage, unlock UI and return
Lock_Impl( this, sal_False );
pImp->bForbidReload = bOldStat;
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed, still no error set." ) ) );
return sal_False;
}
@@ -1406,7 +1431,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
catch( uno::Exception& )
{
DBG_ERROR( "Setting of common encryption key failed!" );
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
else
@@ -1425,15 +1450,18 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( xMedStorage == GetStorage() )
{
OSL_ENSURE( !pVersionItem, "This scenario is impossible currently!\n" );
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Should be impossible." ) ) );
// usual save procedure
bOk = Save();
}
else
{
// save to target
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save as own format." ) ) );
bOk = SaveAsOwnFormat( rMedium );
if ( bOk && pVersionItem )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "pVersionItem != NULL" ) ) );
aTmpVersionURL = CreateTempCopyOfStorage_Impl( xMedStorage );
bOk = ( aTmpVersionURL.getLength() > 0 );
}
@@ -1444,7 +1472,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( bOk && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
{
// store the thumbnail representation image
- // TODO: handle the case when document is encrypted and/or signed
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Thumbnail creation." ) ) );
if ( !GenerateAndStoreThumbnail( bPasswdProvided,
sal_False,
pFilter->IsOwnTemplateFormat(),
@@ -1459,6 +1487,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
{
if ( pImp->bIsSaving || pImp->bPreserveVersions )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Preserve versions." ) ) );
try
{
Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList();
@@ -1488,6 +1517,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
}
catch( uno::Exception& )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Preserve versions has failed." ) ) );
DBG_ERROR( "Couldn't copy versions!\n" );
bOk = sal_False;
// TODO/LATER: a specific error could be set
@@ -1540,6 +1570,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
}
else
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing in alien format." ) ) );
// it's a "SaveAs" in an alien format
if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
bOk = ExportTo( rMedium );
@@ -1617,6 +1648,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( bOk )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Medium commit." ) ) );
+
// transfer data to its destinated location
// the medium commits the storage or the stream it is based on
RegisterTransfer( rMedium );
@@ -1624,6 +1657,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( bOk && bScriptSignatureIsCopied )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Script signature check." ) ) );
+
// if the script signature was copied it should be checked now
// usually it should be ok, so no additional actions will be done
// but if for any reasong ( f.e. binshell change ) it is broken it should be removed here
@@ -1671,6 +1706,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
if ( bOk )
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing is successful." ) ) );
+
// if the target medium is an alien format and the "old" medium was an own format and the "old" medium
// has a name, the object storage must be exchanged, because now we need a new temporary storage
// as object storage
@@ -1689,12 +1726,17 @@ sal_Bool SfxObjectShell::SaveTo_Impl
OSL_ENSURE( pMedium->GetName().Len(), "Fallback is used, the medium without name should not dispose the storage!\n" );
// copy storage of old medium to new temporary storage and take this over
if( !ConnectTmpStorage_Impl( pMedium->GetStorage(), pMedium ) )
+ {
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Process after storing has failed." ) ) );
bOk = sal_False;
+ }
}
}
}
else
{
+ AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing has failed." ) ) );
+
// in case the document storage was connected to backup temporarely it must be disconnected now
if ( bNeedsDisconnectionOnFail )
ConnectTmpStorage_Impl( pImp->m_xDocStorage, NULL );
@@ -1848,7 +1890,7 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl(
if ( !bResult )
{
// TODO/LATER: may need error code setting based on exception
- SetError( ERRCODE_IO_GENERAL );
+ SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
@@ -1904,7 +1946,7 @@ sal_Bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium )
{
// hier kommen nur Root-Storages rein, die via Temp-File gespeichert werden
rMedium.CreateTempFileNoCopy();
- SetError(rMedium.GetErrorCode());
+ SetError(rMedium.GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
if ( GetError() )
return sal_False;
@@ -1914,7 +1956,7 @@ sal_Bool SfxObjectShell::DoSaveAs( SfxMedium& rMedium )
sal_Bool bRet = SaveTo_Impl( rMedium, NULL );
if ( !bRet )
- SetError(rMedium.GetErrorCode());
+ SetError(rMedium.GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return bRet;
}
@@ -2478,7 +2520,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
// pMediumTmp->CreateTempFileNoCopy();
if ( pMediumTmp->GetErrorCode() != ERRCODE_NONE )
{
- SetError( pMediumTmp->GetError() );
+ SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
delete pMediumTmp;
return sal_False;
}
@@ -2487,7 +2529,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
pMediumTmp->TransferVersionList_Impl( *pRetrMedium );
/*
if ( pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) )
- SetError( GetMedium()->Unpack_Impl( pRetrMedium->GetPhysicalName() ) );
+ SetError( GetMedium()->Unpack_Impl( pRetrMedium->GetPhysicalName() ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
*/
// an interaction handler here can aquire only in case of GUI Saving
@@ -2508,7 +2550,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
pMediumTmp->GetItemSet()->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL );
}
- SetError(pMediumTmp->GetErrorCode());
+ SetError(pMediumTmp->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
//REMOVE if ( !IsHandsOff() )
//REMOVE pMediumTmp->Close();
@@ -2520,7 +2562,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
else
{
// transfer error code from medium to objectshell
- SetError( pMediumTmp->GetError() );
+ SetError( pMediumTmp->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
// reconnect to object storage
//REMOVE if ( IsHandsOff() )
@@ -2550,7 +2592,7 @@ sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet )
{
if ( IsReadOnly() )
{
- SetError( ERRCODE_SFX_DOCUMENTREADONLY );
+ SetError( ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return sal_False;
}
@@ -2596,7 +2638,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
{
if( aURL.HasError() )
{
- SetError( ERRCODE_IO_INVALIDPARAMETER );
+ SetError( ERRCODE_IO_INVALIDPARAMETER, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return sal_False;
}
@@ -2618,7 +2660,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
if ( pDoc )
{
// dann Fehlermeldeung: "schon offen"
- SetError(ERRCODE_SFX_ALREADYOPEN);
+ SetError(ERRCODE_SFX_ALREADYOPEN, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
return sal_False;
}
}
@@ -2634,7 +2676,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
|| !pFilter->CanExport()
|| (!bSaveTo && !pFilter->CanImport()) )
{
- SetError( ERRCODE_IO_INVALIDPARAMETER );
+ SetError( ERRCODE_IO_INVALIDPARAMETER, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
return sal_False;
}
@@ -2656,7 +2698,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
if ( aURL == aActName && aURL != INetURLObject( OUString::createFromAscii( "private:stream" ) )
&& IsReadOnly() )
{
- SetError(ERRCODE_SFX_DOCUMENTREADONLY);
+ SetError(ERRCODE_SFX_DOCUMENTREADONLY, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ));
return sal_False;
}
@@ -2793,7 +2835,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
if ( pNewFile->GetErrorCode() != ERRCODE_NONE )
{
// creating temporary file failed ( f.e. floppy disk not inserted! )
- SetError( pNewFile->GetError() );
+ SetError( pNewFile->GetError(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
delete pNewFile;
return sal_False;
}
@@ -2813,7 +2855,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
if ( GetMedium()->GetFilter() && ( GetMedium()->GetFilter()->GetFilterFlags() & SFX_FILTER_PACKED ) )
{
SfxMedium *pMed = bCopyTo ? pMedium : pNewFile;
- pNewFile->SetError( GetMedium()->Unpack_Impl( pMed->GetPhysicalName() ) );
+ pNewFile->SetError( GetMedium()->Unpack_Impl( pMed->GetPhysicalName() ) , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
*/
// Save the document ( first as temporary file, then transfer to the target URL by committing the medium )
@@ -2823,7 +2865,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
bOk = sal_True;
// transfer a possible error from the medium to the document
- SetError( pNewFile->GetErrorCode() );
+ SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
// notify the document that saving was done successfully
//REMOVE if ( bCopyTo )
@@ -2854,7 +2896,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
// and the DoSaveCompleted call should not be able to fail in general
DBG_ASSERT( !bCopyTo, "Error while reconnecting to medium, can't be handled!");
- SetError( pNewFile->GetErrorCode() );
+ SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
if ( !bCopyTo )
{
@@ -2888,7 +2930,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
}
else
{
- SetError( pNewFile->GetErrorCode() );
+ SetError( pNewFile->GetErrorCode(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
//REMOVE // reconnect to the old storage
//REMOVE if ( IsHandsOff() )
diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx
index 4f08b197aa4a..0ab29e39b829 100644
--- a/sfx2/source/doc/plugin.cxx
+++ b/sfx2/source/doc/plugin.cxx
@@ -168,7 +168,7 @@ throw( uno::RuntimeException )
// we must destroy the plugin before the parent is destroyed
xWindow->addEventListener( this );
xFrame->setComponent( xWindow, uno::Reference < frame::XController >() );
- return TRUE;
+ return mxPlugin.is() ? TRUE : FALSE;
}
return FALSE;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 7fce5942f8af..43ce1593bbaf 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1485,6 +1485,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
if ( m_pData->m_pObjectShell.Is() )
{
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeSelf" ) ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
for ( sal_Int32 nInd = 0; nInd < aSeqArgs.getLength(); nInd++ )
@@ -1495,6 +1496,9 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
&& !aSeqArgs[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) ) )
&& !aSeqArgs[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StatusIndicator" ) ) ) )
{
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ) ) );
+ m_pData->m_pObjectShell->StoreLog();
+
::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Unexpected MediaDescriptor parameter: " ) );
aMessage += aSeqArgs[nInd].Name;
throw lang::IllegalArgumentException( aMessage, uno::Reference< uno::XInterface >(), 1 );
@@ -1539,12 +1543,17 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
if ( bRet )
{
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "successful saving." ) ) );
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, m_pData->m_pObjectShell ) );
}
else
{
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) );
+ m_pData->m_pObjectShell->StoreLog();
+
+ // write the contents of the logger to the file
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, m_pData->m_pObjectShell ) );
throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), nErrCode );
@@ -1579,6 +1588,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString&
if ( m_pData->m_pObjectShell.Is() )
{
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeAsURL" ) ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
impl_store( rURL, rArgs, sal_False );
@@ -1604,6 +1614,7 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString&
if ( m_pData->m_pObjectShell.Is() )
{
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "storeToURL" ) ) );
SfxSaveGuard aSaveGuard(this, m_pData, sal_False);
impl_store( rURL, rArgs, sal_True );
}
@@ -2468,6 +2479,10 @@ void SfxBaseModel::changing()
if ( impl_isDisposed() )
return;
+ // the notification should not be sent if the document can not be modified
+ if ( !m_pData->m_pObjectShell.Is() || !m_pData->m_pObjectShell->IsEnableSetModified() )
+ return;
+
::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) );
if( pIC )
@@ -2589,19 +2604,48 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
aArgHash.erase( aFilterString );
aArgHash.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
- try
+ // if the password is changed SaveAs should be done
+ // no password for encrypted document is also a change here
+ sal_Bool bPassChanged = sal_False;
+
+ ::comphelper::SequenceAsHashMap::iterator aNewPassIter
+ = aArgHash.find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) ) );
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
+ if ( pPasswordItem && aNewPassIter != aArgHash.end() )
{
- storeSelf( aArgHash.getAsConstPropertyValueList() );
- bSaved = sal_True;
+ ::rtl::OUString aNewPass;
+ aNewPassIter->second >>= aNewPass;
+ bPassChanged = !aNewPass.equals( pPasswordItem->GetValue() );
+ }
+ else if ( pPasswordItem || aNewPassIter != aArgHash.end() )
+ bPassChanged = sal_True;
+
+ if ( !bPassChanged )
+ {
+ try
+ {
+ storeSelf( aArgHash.getAsConstPropertyValueList() );
+ bSaved = sal_True;
+ }
+ catch( const lang::IllegalArgumentException& )
+ {
+ // some additional arguments do not allow to use saving, SaveAs should be done
+ // but only for normal documents, the shared documents would be overwritten in this case
+ // that would mean an information loss
+ // TODO/LATER: need a new interaction for this case
+ if ( m_pData->m_pObjectShell->IsDocShared() )
+ {
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Can't store shared document!" ) ) );
+ m_pData->m_pObjectShell->StoreLog();
+
+ throw;
+ }
+ }
}
- catch( const lang::IllegalArgumentException& )
+ else if ( m_pData->m_pObjectShell->IsDocShared() )
{
- // some additional arguments do not allow to use saving, SaveAs should be done
- // but only for normal documents, the shared documents would be overwritten in this case
- // that would mean an information loss
- // TODO/LATER: need a new interaction for this case
- if ( m_pData->m_pObjectShell->IsDocShared() )
- throw;
+ // if the password is changed a special error should be used in case of shared document
+ throw task::ErrorCodeIOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cant change password for shared document." ) ), uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
}
}
}
@@ -2623,9 +2667,14 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
SFX_ITEMSET_ARG( aParams, pCopyStreamItem, SfxBoolItem, SID_COPY_STREAM_IF_POSSIBLE, sal_False );
if ( pCopyStreamItem && pCopyStreamItem->GetValue() && !bSaveTo )
+ {
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Misuse of CopyStreamIfPossible!" ) ) );
+ m_pData->m_pObjectShell->StoreLog();
+
throw frame::IllegalArgumentIOException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!") ),
uno::Reference< uno::XInterface >() );
+ }
// since saving a document modifies its DocumentInfo, the current
// DocumentInfo must be saved on "SaveTo", so it can be restored
@@ -2679,7 +2728,10 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetErrorCode();
if ( !bRet && !nErrCode )
+ {
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing has failed, no error is set!" ) ) );
nErrCode = ERRCODE_IO_CANTWRITE;
+ }
m_pData->m_pObjectShell->ResetError();
if ( bRet )
@@ -2708,6 +2760,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
}
}
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing succeeded!" ) ) );
if ( !bSaveTo )
{
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
@@ -2720,6 +2773,10 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
}
else
{
+ // let the logring be stored to the related file
+ m_pData->m_pObjectShell->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Storing failed!" ) ) );
+ m_pData->m_pObjectShell->StoreLog();
+
SFX_APP()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED,
m_pData->m_pObjectShell ) );
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index 88afb10dfcc9..fc0440535a47 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -33,6 +33,7 @@
//#include <hash_map>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/logging/XSimpleLogRing.hpp>
#include <tools/datetime.hxx>
#include <svtools/securityoptions.hxx>
@@ -168,6 +169,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
::rtl::OUString m_aSharedFileURL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing;
+
SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
virtual ~SfxObjectShell_Impl();