ooo-build r14693 - in trunk: . patches/dev300
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14693 - in trunk: . patches/dev300
- Date: Tue, 2 Dec 2008 19:19:32 +0000 (UTC)
Author: kyoshida
Date: Tue Dec 2 19:19:32 2008
New Revision: 14693
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14693&view=rev
Log:
2008-12-02 Kohei Yoshida <kyoshida novell com>
* patches/dev300/sfx2-always-allow-save-document.diff: removed.
* patches/dev300/always-allow-save-document-sc.diff:
* patches/dev300/always-allow-save-document-sfx2.diff: previously just
a single patch but now split for each module. The "always save"
functionality is now enabled on a per-application basis, and only in
Calc (for now). (n#450789)
* patches/dev300/apply: reflect patch split & name change.
Added:
trunk/patches/dev300/always-allow-save-document-sc.diff
trunk/patches/dev300/always-allow-save-document-sfx2.diff
- copied, changed from r14686, /trunk/patches/dev300/sfx2-always-allow-save-document.diff
Removed:
trunk/patches/dev300/sfx2-always-allow-save-document.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Added: trunk/patches/dev300/always-allow-save-document-sc.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/always-allow-save-document-sc.diff Tue Dec 2 19:19:32 2008
@@ -0,0 +1,60 @@
+diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
+index 18c858b..0dbbfe3 100644
+--- sc/inc/unonames.hxx
++++ sc/inc/unonames.hxx
+@@ -482,6 +482,7 @@
+ #define SC_UNO_ISEXECUTELINKENABLED "IsExecuteLinkEnabled"
+ #define SC_UNO_ISCHANGEREADONLYENABLED "IsChangeReadOnlyEnabled"
+ #define SC_UNO_REFERENCEDEVICE "ReferenceDevice"
++#define SC_UNO_ALWAYS_ALLOW_SAVE "AlwaysAllowSave"
+
+ // document properties from FormModel
+ #define SC_UNO_APPLYFMDES "ApplyFormDesignMode"
+diff --git sc/source/ui/docshell/docsh6.cxx sc/source/ui/docshell/docsh6.cxx
+index d4f4b61..b41b4a1 100644
+--- sc/source/ui/docshell/docsh6.cxx
++++ sc/source/ui/docshell/docsh6.cxx
+@@ -436,6 +436,16 @@ void ScDocShell::UpdateLinks()
+ }
+ }
+
++bool ScDocShell::GetApplicationFlag(SfxApplicationFlagType eFlagType)
++{
++ switch (eFlagType)
++ {
++ case SFX_APPFLAG_ALWAYS_ALLOW_SAVE:
++ return true;
++ }
++ return false;
++}
++
+ BOOL ScDocShell::ReloadTabLinks()
+ {
+ SvxLinkManager* pLinkManager = aDocument.GetLinkManager();
+diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx
+index fcf3f7f..a53d4dc 100644
+--- sc/source/ui/inc/docsh.hxx
++++ sc/source/ui/inc/docsh.hxx
+@@ -311,6 +311,9 @@ public:
+ void CancelAutoDBRange(); // called when dialog is cancelled
+
+ void UpdateLinks(); // Link-Eintraege aktuallisieren
++
++ virtual bool GetApplicationFlag(SfxApplicationFlagType eFlagType);
++
+ BOOL ReloadTabLinks(); // Links ausfuehren (Inhalt aktualisieren)
+
+ void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
+diff --git sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx
+index d1bee0d..9c9b897 100644
+--- sc/source/ui/unoobj/docuno.cxx
++++ sc/source/ui/unoobj/docuno.cxx
+@@ -1587,6 +1587,8 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
+ pXDev->SetOutputDevice( pDoc->GetRefDevice() );
+ aRet <<= uno::Reference< awt::XDevice >( pXDev );
+ }
++ else if (aString.EqualsAscii(SC_UNO_ALWAYS_ALLOW_SAVE))
++ ScUnoHelpFunctions::SetBoolInAny(aRet, pDocShell->GetApplicationFlag(SFX_APPFLAG_ALWAYS_ALLOW_SAVE));
+ else if ( aString.EqualsAscii( "BuildId" ) )
+ {
+ aRet <<= maBuildId;
Copied: trunk/patches/dev300/always-allow-save-document-sfx2.diff (from r14686, /trunk/patches/dev300/sfx2-always-allow-save-document.diff)
==============================================================================
--- /trunk/patches/dev300/sfx2-always-allow-save-document.diff (original)
+++ trunk/patches/dev300/always-allow-save-document-sfx2.diff Tue Dec 2 19:19:32 2008
@@ -1,44 +1,95 @@
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sfx2.vpj sfx2.clean/source/doc/guisaveas.cxx sfx2/source/doc/guisaveas.cxx
---- sfx2.clean/source/doc/guisaveas.cxx 2008-04-10 10:27:24.000000000 -0400
-+++ sfx2/source/doc/guisaveas.cxx 2008-04-10 10:39:17.000000000 -0400
-@@ -678,10 +678,6 @@ sal_Int8 ModelData_Impl::CheckStateForSa
- if ( GetMediaDescr().size() != aAcceptedArgs.size() )
- GetMediaDescr() = aAcceptedArgs;
-
-- // the document must be modified
-- if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
-- return STATUS_NO_ACTION;
--
+diff --git sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/objsh.hxx
+index 84ef6a5..f7c76ed 100644
+--- sfx2/inc/sfx2/objsh.hxx
++++ sfx2/inc/sfx2/objsh.hxx
+@@ -203,6 +203,10 @@ enum SfxTitleQuery
+ SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL
+ };
+
++enum SfxApplicationFlagType
++{
++ SFX_APPFLAG_ALWAYS_ALLOW_SAVE
++};
+
+ class SfxToolBoxConfig;
+ struct TransferableObjectDescriptor;
+@@ -349,6 +353,7 @@ public:
+ virtual sal_Bool SwitchPersistance(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+ virtual void UpdateLinks();
++ virtual bool GetApplicationFlag(SfxApplicationFlagType eFlagType);
+
+ sal_Bool SaveChildren(BOOL bObjectsOnly=FALSE);
+ sal_Bool SaveAsChildren( SfxMedium &rMedium );
+diff --git sfx2/source/doc/guisaveas.cxx sfx2/source/doc/guisaveas.cxx
+index 049f9b7..38f0b8d 100644
+--- sfx2/source/doc/guisaveas.cxx
++++ sfx2/source/doc/guisaveas.cxx
+@@ -597,6 +597,7 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
+ ::rtl::OUString aAuthorString = ::rtl::OUString::createFromAscii( "Author" );
+ ::rtl::OUString aInteractionHandlerString = ::rtl::OUString::createFromAscii( "InteractionHandler" );
+ ::rtl::OUString aStatusIndicatorString = ::rtl::OUString::createFromAscii( "StatusIndicator" );
++ ::rtl::OUString aAlwaysSaveString = ::rtl::OUString::createFromAscii("AlwaysAllowSave");
+
+ if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() )
+ {
+@@ -620,6 +621,27 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
+ if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
+ return STATUS_NO_ACTION;
+
++ // the document must be modified unless the always-save flag is set.
++ sal_Bool bAlwaysAllowSave = sal_False;
++ uno::Reference<beans::XPropertySet> xPropSet(m_xModel, uno::UNO_QUERY);
++ if (xPropSet.is())
++ {
++ try
++ {
++ uno::Any any = xPropSet->getPropertyValue( aAlwaysSaveString );
++ any >>= bAlwaysAllowSave;
++ }
++ catch (const beans::UnknownPropertyException&)
++ {
++ // do nothing...
++ }
++ }
++ if (!bAlwaysAllowSave)
++ {
++ if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
++ return STATUS_NO_ACTION;
++ }
++
// if the document is readonly or a new one a SaveAs operation must be used
if ( !GetStorable()->hasLocation() || GetStorable()->isReadonly() )
return STATUS_SAVEAS;
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sfx2.vpj sfx2.clean/source/doc/objserv.cxx sfx2/source/doc/objserv.cxx
---- sfx2.clean/source/doc/objserv.cxx 2008-04-10 10:27:24.000000000 -0400
-+++ sfx2/source/doc/objserv.cxx 2008-04-10 10:37:02.000000000 -0400
-@@ -1052,17 +1052,15 @@ void SfxObjectShell::GetState_Impl(SfxIt
- rSet.DisableItem( nWhich );
- break;
+diff --git sfx2/source/doc/objserv.cxx sfx2/source/doc/objserv.cxx
+index cad7a9c..8f8773e 100644
+--- sfx2/source/doc/objserv.cxx
++++ sfx2/source/doc/objserv.cxx
+@@ -975,8 +975,9 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
}
-- case SID_SAVEDOC:
-- {
+ case SID_SAVEDOC:
+ {
- BOOL bMediumRO = IsReadOnlyMedium();
-- if ( !bMediumRO && GetMedium() && IsModified() )
-- rSet.Put(SfxStringItem(
-- nWhich, String(SfxResId(STR_SAVEDOC))));
-- else
-- rSet.DisableItem(nWhich);
-- }
-- break;
--
-+ case SID_SAVEDOC:
-+ {
-+ BOOL bMediumRO = IsReadOnlyMedium();
-+ if ( !bMediumRO && GetMedium() )
-+ rSet.Put(SfxStringItem( nWhich, String(SfxResId(STR_SAVEDOC))));
-+ else
-+ rSet.DisableItem(nWhich);
-+ }
-+ break;
- case SID_DOCINFO:
- if ( 0 != ( pImp->eFlags & SFXOBJECTSHELL_NODOCINFO ) )
- rSet.DisableItem( nWhich );
+- if ( !bMediumRO && GetMedium() && IsModified() )
++ bool bAllowSave = (GetApplicationFlag(SFX_APPFLAG_ALWAYS_ALLOW_SAVE) || IsModified());
++ bool bMediumRO = IsReadOnlyMedium();
++ if ( !bMediumRO && GetMedium() && bAllowSave )
+ rSet.Put(SfxStringItem(
+ nWhich, String(SfxResId(STR_SAVEDOC))));
+ else
+diff --git sfx2/source/doc/objstor.cxx sfx2/source/doc/objstor.cxx
+index 70eac6f..3081012 100644
+--- sfx2/source/doc/objstor.cxx
++++ sfx2/source/doc/objstor.cxx
+@@ -3618,6 +3618,11 @@ void SfxObjectShell::UpdateLinks()
+ {
+ }
+
++bool SfxObjectShell::GetApplicationFlag(SfxApplicationFlagType eFlagType)
++{
++ return false;
++}
++
+ sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler )
+ {
+ if ( !HasBasic() )
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Tue Dec 2 19:19:32 2008
@@ -872,7 +872,8 @@
desktop-cmdhelp-stdout.diff, kohei
# always enable file save even when the document is not modified.
-sfx2-always-allow-save-document.diff, n#347423, i#5226, kohei
+always-allow-save-document-sfx2.diff, n#347423, n#450789, i#5226, kohei
+always-allow-save-document-sc.diff, n#347423, n#450789, i#5226, kohei
# Adjust scroll speed while extending selection beyoud visible sheet area.
scroll-accel-sc.diff, n#375909, i#71362, kohei
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]