From 7c006c81f4d7eb4c1dd371585ca09bfc3549a0d7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 13:39:49 +0200 Subject: dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the print preview and back, to SFX In particular, the following changes have been applied - the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames - the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view factories for such named views - SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view is exchanged with another view. In this case, it preserves the view's view data at the model - Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from the print preview, has been removed completely. What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY. This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the view names would be speaking then, instead of the current "view" names. --- sfx2/inc/viewfac.hxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sfx2/inc/viewfac.hxx') diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx index 6f9ae1d3cb37..0e6498b1f8a5 100644 --- a/sfx2/inc/viewfac.hxx +++ b/sfx2/inc/viewfac.hxx @@ -47,6 +47,8 @@ class SFX2_DLLPUBLIC SfxViewFactory public: SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const ResId& aDescrResId ); + SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ); ~SfxViewFactory(); SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh); @@ -56,14 +58,22 @@ public: { return String( aDescription ); } USHORT GetOrdinal() const { return nOrd; } - /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID - String GetViewName() const; + /// returns a legacy view name. This is "view" with an appended ordinal/ID. + String GetLegacyViewName() const; + + /** returns a API-compatible view name. + + For details on which view names are specified, see the XModel2.getAvailableViewControllerNames + documentation. + */ + String GetAPIViewName() const; private: SfxViewCtor fnCreate; SfxViewInit fnInit; USHORT nOrd; ResId aDescription; + const String m_sViewName; }; #endif -- cgit