summaryrefslogtreecommitdiff
path: root/desktop/source/app
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-10-07 20:49:54 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-10-07 20:49:54 +0100
commit18393b39eac086e03e638c0a7ba7d1adf22c7f26 (patch)
tree661f30f7a3a3d04ae3d1ebf422269edc06369612 /desktop/source/app
parenta7c9c2f07cfca4bb3ca44bc51d66953b709f460c (diff)
warn if people havn't source the environment after linkoo
Diffstat (limited to 'desktop/source/app')
-rw-r--r--desktop/source/app/app.cxx26
1 files changed, 19 insertions, 7 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 1430ba1ba3..fe33006431 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1490,6 +1490,24 @@ void Desktop::AppEvent( const ApplicationEvent& rAppEvent )
HandleAppEvent( rAppEvent );
}
+namespace {
+ void SetDocumentExtendedStyle( const Reference< ::com::sun::star::awt::XWindow > &xContainerWindow )
+ {
+ // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
+ // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+ // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
+ if (!pContainerWindow) {
+ fprintf (stderr, "Error: It very much looks as if you have used 'linkoo' (or bin/ooinstall -l)\n"
+ "but have then forgotten to source 'ooenv' into your shell before running !\n"
+ "to save a crash, we will exit now with an error - please '. ./ooenv' first.\n");
+ exit (1);
+ }
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
+ }
+}
+
void Desktop::Main()
{
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Main" );
@@ -1770,13 +1788,7 @@ void Desktop::Main()
xContainerWindow = xBackingFrame->getContainerWindow();
if (xContainerWindow.is())
{
- // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
- // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
- // otherwise documents loaded into this frame will later on miss functionality depending on the style.
- Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
- OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
- pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
-
+ SetDocumentExtendedStyle(xContainerWindow);
SetSplashScreenProgress(75);
Sequence< Any > lArgs(1);
lArgs[0] <<= xContainerWindow;