1 diff --git sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/objsh.hxx
2 index f365bbf..c65280b 100644
3 --- sfx2/inc/sfx2/objsh.hxx
4 +++ sfx2/inc/sfx2/objsh.hxx
5 @@ -203,6 +203,10 @@ enum SfxTitleQuery
6 SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL
9 +enum SfxApplicationFlagType
11 + SFX_APPFLAG_ALWAYS_ALLOW_SAVE
14 class SfxToolBoxConfig;
15 struct TransferableObjectDescriptor;
16 @@ -350,6 +354,7 @@ public:
17 virtual sal_Bool SwitchPersistance(
18 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
19 virtual void UpdateLinks();
20 + virtual bool GetApplicationFlag(SfxApplicationFlagType eFlagType);
22 sal_Bool SaveChildren(BOOL bObjectsOnly=FALSE);
23 sal_Bool SaveAsChildren( SfxMedium &rMedium );
24 diff --git sfx2/source/doc/guisaveas.cxx sfx2/source/doc/guisaveas.cxx
25 index 049f9b7..da8f008 100644
26 --- sfx2/source/doc/guisaveas.cxx
27 +++ sfx2/source/doc/guisaveas.cxx
28 @@ -597,6 +597,7 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
29 ::rtl::OUString aAuthorString = ::rtl::OUString::createFromAscii( "Author" );
30 ::rtl::OUString aInteractionHandlerString = ::rtl::OUString::createFromAscii( "InteractionHandler" );
31 ::rtl::OUString aStatusIndicatorString = ::rtl::OUString::createFromAscii( "StatusIndicator" );
32 + ::rtl::OUString aAlwaysSaveString = ::rtl::OUString::createFromAscii("AlwaysAllowSave");
34 if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() )
36 @@ -616,9 +617,26 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
37 if ( GetMediaDescr().size() != aAcceptedArgs.size() )
38 GetMediaDescr() = aAcceptedArgs;
40 - // the document must be modified
41 - if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
42 - return STATUS_NO_ACTION;
43 + // the document must be modified unless the always-save flag is set.
44 + sal_Bool bAlwaysAllowSave = sal_False;
45 + uno::Reference<beans::XPropertySet> xPropSet(m_xModel, uno::UNO_QUERY);
50 + uno::Any any = xPropSet->getPropertyValue( aAlwaysSaveString );
51 + any >>= bAlwaysAllowSave;
53 + catch (const beans::UnknownPropertyException&)
58 + if (!bAlwaysAllowSave)
60 + if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
61 + return STATUS_NO_ACTION;
64 // if the document is readonly or a new one a SaveAs operation must be used
65 if ( !GetStorable()->hasLocation() || GetStorable()->isReadonly() )
66 diff --git sfx2/source/doc/objserv.cxx sfx2/source/doc/objserv.cxx
67 index 1d114cb..204dd55 100644
68 --- sfx2/source/doc/objserv.cxx
69 +++ sfx2/source/doc/objserv.cxx
70 @@ -988,8 +988,9 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
74 - BOOL bMediumRO = IsReadOnlyMedium();
75 - if ( !bMediumRO && GetMedium() && IsModified() )
76 + bool bAllowSave = (GetApplicationFlag(SFX_APPFLAG_ALWAYS_ALLOW_SAVE) || IsModified());
77 + bool bMediumRO = IsReadOnlyMedium();
78 + if ( !bMediumRO && GetMedium() && bAllowSave )
79 rSet.Put(SfxStringItem(
80 nWhich, String(SfxResId(STR_SAVEDOC))));
82 diff --git sfx2/source/doc/objstor.cxx sfx2/source/doc/objstor.cxx
83 index e82361c..a060ddc 100644
84 --- sfx2/source/doc/objstor.cxx
85 +++ sfx2/source/doc/objstor.cxx
86 @@ -3825,6 +3825,11 @@ void SfxObjectShell::UpdateLinks()
90 +bool SfxObjectShell::GetApplicationFlag(SfxApplicationFlagType eFlagType)
95 sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler )