Kaydet (Commit) 5c2ab70c authored tarafından Matúš Kukan's avatar Matúš Kukan

cp#1000077: Set 'modified' document property more consistently.

Update document info at one place, so that it works for other formats
like .doc, .docx, ... too.

Change-Id: If71799b491d2210f0d3bdbdb05f91f26c986a260
üst b630d26a
...@@ -88,9 +88,6 @@ FltError ExportBiff5::Write() ...@@ -88,9 +88,6 @@ FltError ExportBiff5::Write()
if( pDocShell && xRootStrg.Is() ) if( pDocShell && xRootStrg.Is() )
{ {
// #i88642# update doc info (revision etc)
pDocShell->UpdateDocInfoForSave();
using namespace ::com::sun::star; using namespace ::com::sun::star;
uno::Reference<document::XDocumentPropertiesSupplier> xDPS( uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW); pDocShell->GetModel(), uno::UNO_QUERY_THROW);
......
...@@ -788,8 +788,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) ...@@ -788,8 +788,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
if ( pObjSh && xStorage.is() ) if ( pObjSh && xStorage.is() )
{ {
pObjSh->UpdateDocInfoForSave(); // update information
uno::Reference<frame::XModel> xModel(pObjSh->GetModel()); uno::Reference<frame::XModel> xModel(pObjSh->GetModel());
uno::Reference<task::XStatusIndicator> xStatusIndicator(GetStatusIndicator()); uno::Reference<task::XStatusIndicator> xStatusIndicator(GetStatusIndicator());
sal_Int32 nProgressRange(1000000); sal_Int32 nProgressRange(1000000);
......
...@@ -506,12 +506,7 @@ bool DrawDocShell::Save() ...@@ -506,12 +506,7 @@ bool DrawDocShell::Save()
bool bRet = SfxObjectShell::Save(); bool bRet = SfxObjectShell::Save();
if( bRet ) if( bRet )
{
// Call UpdateDocInfoForSave() before export
UpdateDocInfoForSave();
bRet = SdXMLFilter( *GetMedium(), *this, true, SDXMLMODE_Normal, SotStorage::GetVersion( GetMedium()->GetStorage() ) ).Export(); bRet = SdXMLFilter( *GetMedium(), *this, true, SDXMLMODE_Normal, SotStorage::GetVersion( GetMedium()->GetStorage() ) ).Export();
}
return bRet; return bRet;
} }
...@@ -545,11 +540,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium ) ...@@ -545,11 +540,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium )
bool bRet = SfxObjectShell::SaveAs( rMedium ); bool bRet = SfxObjectShell::SaveAs( rMedium );
if( bRet ) if( bRet )
{
// Call UpdateDocInfoForSave() before export
UpdateDocInfoForSave();
bRet = SdXMLFilter( rMedium, *this, true, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export(); bRet = SdXMLFilter( rMedium, *this, true, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export();
}
if( GetError() == ERRCODE_NONE ) if( GetError() == ERRCODE_NONE )
SetError( nVBWarning, OSL_LOG_PREFIX ); SetError( nVBWarning, OSL_LOG_PREFIX );
...@@ -587,13 +578,11 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium ) ...@@ -587,13 +578,11 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
aTypeName.indexOf( "impress8" ) >= 0 ) aTypeName.indexOf( "impress8" ) >= 0 )
{ {
pFilter = new SdXMLFilter( rMedium, *this, true ); pFilter = new SdXMLFilter( rMedium, *this, true );
UpdateDocInfoForSave();
} }
else if( aTypeName.indexOf( "StarOffice_XML_Impress" ) >= 0 || else if( aTypeName.indexOf( "StarOffice_XML_Impress" ) >= 0 ||
aTypeName.indexOf( "StarOffice_XML_Draw" ) >= 0 ) aTypeName.indexOf( "StarOffice_XML_Draw" ) >= 0 )
{ {
pFilter = new SdXMLFilter( rMedium, *this, true, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 ); pFilter = new SdXMLFilter( rMedium, *this, true, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 );
UpdateDocInfoForSave();
} }
else else
{ {
......
...@@ -1119,6 +1119,8 @@ bool SfxObjectShell::SaveTo_Impl ...@@ -1119,6 +1119,8 @@ bool SfxObjectShell::SaveTo_Impl
{ {
SAL_INFO( "sfx.doc", "saving \"" << rMedium.GetName() << "\"" ); SAL_INFO( "sfx.doc", "saving \"" << rMedium.GetName() << "\"" );
UpdateDocInfoForSave();
AddLog( OUString( OSL_LOG_PREFIX "Begin" ) ); AddLog( OUString( OSL_LOG_PREFIX "Begin" ) );
ModifyBlocker_Impl aMod(this); ModifyBlocker_Impl aMod(this);
......
...@@ -598,7 +598,6 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium ) ...@@ -598,7 +598,6 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
} }
} }
#endif #endif
UpdateDocInfoForSave();
} }
// #i76360# Update document statistics // #i76360# Update document statistics
......
...@@ -193,10 +193,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) ...@@ -193,10 +193,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
// Update doc stat, so that correct values are exported and // Update doc stat, so that correct values are exported and
// the progress works correctly. // the progress works correctly.
pDoc->UpdateDocStat(); pDoc->UpdateDocStat();
SfxObjectShell* pObjSh = pDoc->GetDocShell();
if( pObjSh )
pObjSh->UpdateDocInfoForSave(); // update information
} }
if( bShowProgress ) if( bShowProgress )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment