summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/viewshel.cxx
diff options
context:
space:
mode:
authorPascal Junck <pjunck@openoffice.org>2004-10-28 12:36:16 +0000
committerPascal Junck <pjunck@openoffice.org>2004-10-28 12:36:16 +0000
commit3dd8c0954ee1060155f93a8f34a486d32f7b0090 (patch)
tree5790c0dac4ce2b6aa642f74eb3afa4f522e3bd34 /sd/source/ui/view/viewshel.cxx
parent49837c395c5773b04fe550a704f2e49368e30df3 (diff)
INTEGRATION: CWS impress20ea (1.33.14); FILE MERGED
2004/10/14 13:22:54 af 1.33.14.3: RESYNC: (1.33-1.36); FILE MERGED 2004/10/12 09:34:41 af 1.33.14.2: #i34881# Added support for mbIsInitialized flag. Moved update of controller here from PaneManager. 2004/09/03 14:26:55 af 1.33.14.1: #i31710# Do not re-use object bars. This feature does not yet work properly.
Diffstat (limited to 'sd/source/ui/view/viewshel.cxx')
-rw-r--r--sd/source/ui/view/viewshel.cxx36
1 files changed, 30 insertions, 6 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 875f49e4dbeb..d732d92851e7 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewshel.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: hr $ $Date: 2004-10-12 13:14:18 $
+ * last change: $Author: pjunck $ $Date: 2004-10-28 13:36:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -422,10 +422,18 @@ void ViewShell::Construct(void)
GetObjectBarManager().EnableObjectBarSwitching();
}
+
+
+
void ViewShell::Init (void)
{
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=NULL);
+
+ if (mpImpl->mbIsMainViewShell)
+ GetViewShellBase().UpdateController();
+
+ mpImpl->mbIsInitialized = true;
}
@@ -435,6 +443,8 @@ void ViewShell::Exit (void)
{
Deactivate (TRUE);
+ SetIsMainViewShell (false);
+
// Enable object bar switching so that Clear() deactivates every object
// bar cleanly.
GetObjectBarManager().EnableObjectBarSwitching();
@@ -840,7 +850,7 @@ void ViewShell::SetupRulers (void)
{
long nHRulerOfs = 0;
- if ( !mpVerticalRuler.get() != NULL )
+ if ( mpVerticalRuler.get() == NULL )
{
mpVerticalRuler.reset(CreateVRuler(GetActiveWindow()));
if ( mpVerticalRuler.get() != NULL )
@@ -850,7 +860,7 @@ void ViewShell::SetupRulers (void)
mpVerticalRuler->Show();
}
}
- if ( !mpHorizontalRuler.get() != NULL )
+ if ( mpHorizontalRuler.get() == NULL )
{
mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow(), TRUE));
if ( mpHorizontalRuler.get() != NULL )
@@ -1720,7 +1730,7 @@ SfxShell* ViewShellObjectBarFactory::CreateShell (
SfxShell* pShell = NULL;
ShellCache::iterator aI (maShellCache.find(nId));
- if (aI == maShellCache.end())
+ if (aI == maShellCache.end() || aI->second!=NULL)
{
::sd::View* pView = mrViewShell.GetView();
switch (nId)
@@ -1785,7 +1795,21 @@ SfxShell* ViewShellObjectBarFactory::CreateShell (
void ViewShellObjectBarFactory::ReleaseShell (SfxShell* pShell)
{
- // Do nothing because the shells are stored in a cache.
+ // The cache is not yet working properly (we had to set a new view at an
+ // object bar that where re-used for that view) so the shell of released
+ // object bars are destroyed.
+ for (ShellCache::iterator aI(maShellCache.begin());
+ aI!=maShellCache.end();
+ aI++)
+ {
+ if (aI->second == pShell)
+ {
+ delete pShell;
+ aI->second = NULL;
+ maShellCache.erase (aI);
+ break;
+ }
+ }
}
} // end of anonymous namespace