summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-11-22 22:17:18 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-11-22 22:17:18 +0100
commit70259f71b73997f8cf16a73ae1677ffa985717d0 (patch)
treea6d845a126d0c427e2ee93e38862df19baa4f56a
parent4acaac1b07aaa9173b74e68ebc849b7f49ec3e05 (diff)
[CWS autorecovery] removed the unused "Save Window State with Document" option
This happened in further preparation for issue #i65597#, where the current phase aims at changing the SFX-Document-Loader to be completely UNO-based, by introducing a UNO-ViewFactory in SFX.
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs11
-rw-r--r--sfx2/inc/sfx2/objsh.hxx2
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc4
-rw-r--r--sfx2/source/appl/appcfg.cxx15
-rw-r--r--sfx2/source/doc/objcont.cxx187
-rw-r--r--sfx2/source/view/topfrm.cxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx2
7 files changed, 68 insertions, 159 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 246b1bcdb974..bca79f4e30ba 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2223,17 +2223,6 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
</info>
<value>true</value>
</prop>
- <prop oor:name="DocumentWindows" oor:type="xs:boolean">
- <!-- OldPath: General/Restore -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - General Save - [Section] Restore editing view - Open windows-->
- <info>
- <author>MBA</author>
- <desc>Specifies whether all currently open windows of a document should be saved. If true the view properties for all open document views of that document are saved.</desc>
- <label>Open windows</label>
- </info>
- <value>false</value>
- </prop>
<prop oor:name="PrettyPrinting" oor:type="xs:boolean">
<!-- UIHints: Tools Options - General Save - optimize XML file size-->
<!--the UI setting is inverse to this setting-->
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index c6b2b163f5f6..0ebfd74c55a9 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -788,7 +788,7 @@ public:
SAL_DLLPRIVATE sal_uInt16& GetAktViewNo() { return nViewNo; }
SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* );
SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 );
- SAL_DLLPRIVATE SfxViewFrame* LoadWindows_Impl( SfxTopFrame& rPrefered );
+ SAL_DLLPRIVATE bool LoadView_Impl( SfxTopFrame& rPrefered );
SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl();
// configuration items
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index c15c09a09384..615bb8494bb8 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -873,7 +873,7 @@
#define SID_HELP_PI (SID_SFX_START + 962)
#define SID_BASIC_ENABLED (SID_SFX_START + 964)
#define SID_EXPORT_DIALOG (SID_SFX_START + 965)
-#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
+#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
#define SID_BASICBREAK (SID_SFX_START +1521)
@@ -1015,7 +1015,7 @@
#define SID_ATTR_AUTOSAVEMINUTE (SID_OPTIONS_START + 5)
#define SID_ATTR_WORKINGSET (SID_OPTIONS_START + 13)
#define SID_ATTR_UNDO_COUNT (SID_OPTIONS_START + 16)
-#define SID_ATTR_SAVEDOCWINS (SID_OPTIONS_START + 17)
+ // unused
#define SID_ATTR_SAVEDOCVIEW (SID_OPTIONS_START + 18)
// GeneralTabPage
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index af31659ec24c..f19bd0972c21 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -272,14 +272,6 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet )
bRet = FALSE;
}
break;
- case SID_ATTR_SAVEDOCWINS :
- {
- bRet = TRUE;
- if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCWINS))
- if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCWINS ), aSaveOptions.IsSaveDocWins())))
- bRet = FALSE;
- }
- break;
case SID_ATTR_SAVEDOCVIEW :
{
bRet = TRUE;
@@ -631,13 +623,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
}
- // offene Fenster speichern
- if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCWINS), TRUE, &pItem))
- {
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
- aSaveOptions.SetSaveDocWins(((const SfxBoolItem *)pItem)->GetValue());
- }
-
// Fenster-Einstellung speichern
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), TRUE, &pItem))
{
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index a946cc690318..a7561b7dec37 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -89,12 +89,11 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using ::com::sun::star::document::XViewDataSupplier;
+using ::com::sun::star::container::XIndexAccess;
//====================================================================
-#define SFX_WINDOWS_STREAM "SfxWindows"
-#define SFX_PREVIEW_STREAM "SfxPreview"
-
//====================================================================
static
@@ -194,165 +193,101 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig
//====================================================================
-SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame& rPreferedFrame )
+bool SfxObjectShell::LoadView_Impl( SfxTopFrame& rPreferedFrame )
{
-
if ( pImp->bLoadingWindows )
- return NULL;
+ return false;
DBG_ASSERT( GetMedium(), "A Medium should exist here!");
- if( !GetMedium() )
- return 0;
+ if ( !GetMedium() )
+ return false;
// get correct mode
SFX_APP();
SfxViewFrame* pPreferedViewFrame = rPreferedFrame.GetCurrentViewFrame();
- SvtSaveOptions aOpt;
- BOOL bLoadDocWins = aOpt.IsSaveDocWins() && !pPreferedViewFrame;
-
- // try to get viewdata information for XML format
- REFERENCE < XVIEWDATASUPPLIER > xViewDataSupplier( GetModel(), ::com::sun::star::uno::UNO_QUERY );
- REFERENCE < XINDEXACCESS > xViewData;
+ // obtain view data
+ Reference< XViewDataSupplier > xViewDataSupplier( GetModel(), UNO_QUERY );
+ Reference< XIndexAccess > xViewData;
if ( xViewDataSupplier.is() )
- {
xViewData = xViewDataSupplier->getViewData();
- if ( !xViewData.is() )
- return NULL;
- }
- else
- return NULL;
- SfxViewFrame *pActiveFrame = 0;
- String aWinData;
- SfxItemSet *pSet = GetMedium()->GetItemSet();
+ if ( !xViewData.is() || ( xViewData->getCount() == 0 ) )
+ return false;
+
+ SfxItemSet* pSet = GetMedium()->GetItemSet();
pImp->bLoadingWindows = TRUE;
- BOOL bLoaded = FALSE;
- sal_Int32 nView = 0;
// get saved information for all views
- SfxTopFrame* pCurrentTargetFrame = &rPreferedFrame;
- while ( TRUE )
+ // get viewdata and look for the stored ViewId
+ USHORT nViewId = 0;
+ SEQUENCE < PROPERTYVALUE > aUserData;
+ if ( xViewData->getByIndex( 0 ) >>= aUserData )
{
- USHORT nViewId = 0;
- String aUserData; // used in the binary format
- SEQUENCE < PROPERTYVALUE > aSeq; // used in the XML format
-
- // XML format
- // active view is the first view in the container
- FASTBOOL bActive = ( nView == 0 );
-
- if ( nView == xViewData->getCount() )
- // finished
- break;
-
- // get viewdata and look for the stored ViewId
- ::com::sun::star::uno::Any aAny = xViewData->getByIndex( nView++ );
- if ( aAny >>= aSeq )
+ ::comphelper::NamedValueCollection aNamedUserData( aUserData );
+ ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() );
+ if ( sViewId.getLength() )
{
- ::comphelper::NamedValueCollection aNamedUserData( aSeq );
- ::rtl::OUString sViewId = aNamedUserData.getOrDefault( "ViewId", ::rtl::OUString() );
- if ( sViewId.getLength() )
- {
- sViewId = sViewId.copy( 4 ); // format is like in "view3"
- nViewId = USHORT( sViewId.toInt32() );
- }
+ sViewId = sViewId.copy( 4 ); // format is like in "view3"
+ nViewId = USHORT( sViewId.toInt32() );
}
+ }
- // load only active view, but current item is not the active one ?
- // in XML format the active view is the first one
- if ( !bLoadDocWins && !bActive )
- break;
-
- pSet->ClearItem( SID_USER_DATA );
- SfxViewFrame *pFrame = 0;
- if ( pPreferedViewFrame )
+ pSet->ClearItem( SID_USER_DATA );
+ SfxViewFrame* pTargetFrame = pPreferedViewFrame;
+ if ( pTargetFrame )
+ {
+ // use the frame from the arguments, but don't set a window size
+ if ( pTargetFrame->GetViewShell() || !pTargetFrame->GetObjectShell() )
{
- // use the frame from the arguments, but don't set a window size
- pFrame = pPreferedViewFrame;
- if ( pFrame->GetViewShell() || !pFrame->GetObjectShell() )
- {
- pSet->ClearItem( SID_VIEW_POS_SIZE );
- pSet->ClearItem( SID_WIN_POSSIZE );
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
+ pSet->ClearItem( SID_VIEW_POS_SIZE );
+ pSet->ClearItem( SID_WIN_POSSIZE );
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
- // avoid flickering controllers
- SfxBindings &rBind = pFrame->GetBindings();
- rBind.ENTERREGISTRATIONS();
+ // avoid flickering controllers
+ SfxBindings &rBind = pTargetFrame->GetBindings();
+ rBind.ENTERREGISTRATIONS();
- // set document into frame
- pCurrentTargetFrame->InsertDocument_Impl( *this );
+ // set document into frame
+ rPreferedFrame.InsertDocument_Impl( *this );
- // restart controller updating
- rBind.LEAVEREGISTRATIONS();
- }
- else
- {
- // create new view
- pFrame->CreateView_Impl( nViewId );
- }
+ // restart controller updating
+ rBind.LEAVEREGISTRATIONS();
}
else
{
- if ( bLoadDocWins )
- {
- // open in the background
- pSet->Put( SfxUInt16Item( SID_VIEW_ZOOM_MODE, 0 ) );
- pSet->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle() ) );
- }
-
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
-
- if ( pCurrentTargetFrame )
- {
- // Frame "ubergeben, allerdings ist der noch leer
- pCurrentTargetFrame->InsertDocument_Impl( *this );
- pFrame = pCurrentTargetFrame->GetCurrentViewFrame();
- }
- else
- {
- pFrame = SfxTopFrame::Create( this, nViewId, FALSE, pSet )->GetCurrentViewFrame();
- }
-
- // only temporary data, don't hold it in the itemset
- pSet->ClearItem( SID_VIEW_POS_SIZE );
- pSet->ClearItem( SID_WIN_POSSIZE );
- pSet->ClearItem( SID_VIEW_ZOOM_MODE );
- }
-
- bLoaded = TRUE;
-
- // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE
- // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet
- if ( pFrame && pFrame->GetViewShell() )
- {
- if ( aUserData.Len() )
- pFrame->GetViewShell()->ReadUserData( aUserData, !bLoadDocWins );
- else if ( aSeq.getLength() )
- pFrame->GetViewShell()->ReadUserDataSequence( aSeq, !bLoadDocWins );
+ // create new view
+ pTargetFrame->CreateView_Impl( nViewId );
}
+ }
+ else
+ {
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
- // perhaps there are more windows to load
- pCurrentTargetFrame = NULL;
-
- if ( bActive )
- pActiveFrame = pFrame;
+ // Frame "ubergeben, allerdings ist der noch leer
+ rPreferedFrame.InsertDocument_Impl( *this );
+ pTargetFrame = rPreferedFrame.GetCurrentViewFrame();
- if( pPreferedViewFrame || !bLoadDocWins )
- // load only active window
- break;
+ // only temporary data, don't hold it in the itemset
+ pSet->ClearItem( SID_VIEW_POS_SIZE );
+ pSet->ClearItem( SID_WIN_POSSIZE );
+ pSet->ClearItem( SID_VIEW_ZOOM_MODE );
}
- if ( pActiveFrame )
+ // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE
+ // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet
+ if ( pTargetFrame && pTargetFrame->GetViewShell() && aUserData.getLength() )
{
- if ( !pPreferedViewFrame )
- // activate frame
- pActiveFrame->MakeActive_Impl( TRUE );
+ pTargetFrame->GetViewShell()->ReadUserDataSequence( aUserData, TRUE );
}
+ if ( pTargetFrame && !pPreferedViewFrame )
+ // activate frame
+ pTargetFrame->MakeActive_Impl( TRUE );
+
pImp->bLoadingWindows = FALSE;
- return pPreferedViewFrame && bLoaded ? pPreferedViewFrame : pActiveFrame;
+ return true;
}
//====================================================================
diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx
index 5957abb67b27..b43ccae4aa2b 100644
--- a/sfx2/source/view/topfrm.cxx
+++ b/sfx2/source/view/topfrm.cxx
@@ -789,7 +789,7 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc )
// Position und Groesse testen
// Wenn diese schon gesetzt sind, soll offensichtlich nicht noch
- // LoadWindows_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame()
+ // LoadView_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame()
// an einer Task aufgerufen hat! )
const SfxItemSet* pSet = GetItemSet_Impl();
if ( !pSet )
@@ -816,10 +816,10 @@ sal_Bool SfxTopFrame::InsertDocument_Impl( SfxObjectShell& rDoc )
// Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation
// aus den Dokument geladen werden, z.B. weil InsertDocument_Impl seinerseits
- // aus LoadWindows_Impl aufgerufen wurde!
+ // aus LoadView_Impl aufgerufen wurde!
if ( !pJumpItem && !pPluginMode && !pAreaItem && !pViewIdItem && !pModeItem )
{
- if ( rDoc.LoadWindows_Impl( *this ) )
+ if ( rDoc.LoadView_Impl( *this ) )
{
if ( GetCurrentDocument() != &rDoc )
// something went wrong during insertion
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index abdec58b8ef7..2427b54a8c9a 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2224,7 +2224,7 @@ SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId )
/* [Beschreibung]
Erzeugt eine SfxViewShell f"ur diesen SfxViewFrame. Wird auch aus
- <SfxObjectShell::LoadWindows_Impl()>
+ <SfxObjectShell::LoadView_Impl()>
gerufen.
*/