LCOV - code coverage report
Current view: top level - libreoffice/vcl/source/app - svdata.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 35 212 16.5 %
Date: 2012-12-27 Functions: 5 18 27.8 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <string.h>
      21             : #include <boost/ptr_container/ptr_vector.hpp>
      22             : 
      23             : #include <comphelper/processfactory.hxx>
      24             : #include <comphelper/string.hxx>
      25             : #include <osl/mutex.hxx>
      26             : #include <rtl/process.h>
      27             : #include <tools/debug.hxx>
      28             : #include <tools/resary.hxx>
      29             : #include <unotools/fontcfg.hxx>
      30             : #include <cppuhelper/implbase1.hxx>
      31             : #include <comphelper/string.hxx>
      32             : #include <uno/current_context.hxx>
      33             : 
      34             : #include "vcl/configsettings.hxx"
      35             : #include "vcl/svapp.hxx"
      36             : #include "vcl/wrkwin.hxx"
      37             : #include "vcl/msgbox.hxx"
      38             : #include "vcl/button.hxx" // for Button::GetStandardText
      39             : #include "vcl/dockwin.hxx"  // for DockingManager
      40             : #include "salinst.hxx"
      41             : #include "salframe.hxx"
      42             : #include "svdata.hxx"
      43             : #include "window.h"
      44             : #include "salimestatus.hxx"
      45             : #include "salsys.hxx"
      46             : #include "svids.hrc"
      47             : 
      48             : #include "com/sun/star/lang/XMultiServiceFactory.hpp"
      49             : #include "com/sun/star/awt/XExtendedToolkit.hpp"
      50             : #include "com/sun/star/java/JavaNotConfiguredException.hpp"
      51             : #include "com/sun/star/java/JavaVMCreationFailureException.hpp"
      52             : #include "com/sun/star/java/MissingJavaRuntimeException.hpp"
      53             : #include "com/sun/star/java/JavaDisabledException.hpp"
      54             : 
      55             : #include <stdio.h>
      56             : 
      57             : using namespace com::sun::star::uno;
      58             : using namespace com::sun::star::lang;
      59             : using namespace com::sun::star::awt;
      60             : using ::rtl::OUString;
      61             : 
      62             : // =======================================================================
      63             : 
      64             : namespace
      65             : {
      66             :     struct private_aImplSVData :
      67             :         public rtl::Static<ImplSVData, private_aImplSVData> {};
      68             : }
      69             : 
      70             : // static SV-Data
      71             : ImplSVData* pImplSVData = NULL;
      72             : 
      73         852 : SalSystem* ImplGetSalSystem()
      74             : {
      75         852 :     ImplSVData* pSVData = ImplGetSVData();
      76         852 :     if( ! pSVData->mpSalSystem )
      77           3 :         pSVData->mpSalSystem = pSVData->mpDefInst->CreateSalSystem();
      78         852 :     return pSVData->mpSalSystem;
      79             : }
      80             : 
      81             : 
      82           0 : static rtl::OUString ReplaceJavaErrorMessages( const rtl::OUString& rString )
      83             : {
      84             :     return rString.replaceAll("%OK", Button::GetStandardText(BUTTON_OK)).
      85             :             replaceAll("%IGNORE", Button::GetStandardText(BUTTON_IGNORE)).
      86           0 :             replaceAll("%CANCEL", Button::GetStandardText(BUTTON_CANCEL));
      87             : }
      88             : 
      89             : // =======================================================================
      90             : 
      91          32 : void ImplInitSVData()
      92             : {
      93          32 :     pImplSVData = &private_aImplSVData::get();
      94             : 
      95             :     // init global instance data
      96          32 :     memset( pImplSVData, 0, sizeof( ImplSVData ) );
      97          32 :     pImplSVData->maHelpData.mbAutoHelpId = sal_True;
      98          32 :     pImplSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
      99             : 
     100             :     // mark default layout border as unitialized
     101          32 :     pImplSVData->maAppData.mnDefaultLayoutBorder = -1;
     102          32 : }
     103             : 
     104             : // -----------------------------------------------------------------------
     105             : 
     106           0 : void ImplDeInitSVData()
     107             : {
     108           0 :     ImplSVData* pSVData = ImplGetSVData();
     109             : 
     110             :     // delete global instance data
     111           0 :     if( pSVData->mpSettingsConfigItem )
     112           0 :         delete pSVData->mpSettingsConfigItem;
     113             : 
     114           0 :     if( pSVData->mpDockingManager )
     115           0 :         delete pSVData->mpDockingManager;
     116             : 
     117           0 :     if( pSVData->maGDIData.mpDefaultFontConfiguration )
     118           0 :         delete pSVData->maGDIData.mpDefaultFontConfiguration;
     119           0 :     if( pSVData->maGDIData.mpFontSubstConfiguration )
     120           0 :         delete pSVData->maGDIData.mpFontSubstConfiguration;
     121             : 
     122           0 :     if( pSVData->maCtrlData.mpFieldUnitStrings )
     123           0 :         delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
     124           0 :     if( pSVData->maCtrlData.mpCleanUnitStrings )
     125           0 :         delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL;
     126           0 :     if( pSVData->mpPaperNames )
     127           0 :         delete pSVData->mpPaperNames, pSVData->mpPaperNames = NULL;
     128           0 : }
     129             : 
     130             : // -----------------------------------------------------------------------
     131             : 
     132           0 : void ImplDestroySVData()
     133             : {
     134           0 :     pImplSVData = NULL;
     135           0 : }
     136             : 
     137             : // -----------------------------------------------------------------------
     138             : 
     139        9126 : Window* ImplGetDefaultWindow()
     140             : {
     141        9126 :     ImplSVData* pSVData = ImplGetSVData();
     142        9126 :     if ( pSVData->maWinData.mpAppWin )
     143           0 :         return pSVData->maWinData.mpAppWin;
     144             : 
     145             :     // First test if we already have a default window.
     146             :     // Don't only place a single if..else inside solar mutex lockframe
     147             :     // because then we might have to wait for the solar mutex what is not neccessary
     148             :     // if we already have a default window.
     149             : 
     150        9126 :     if ( !pSVData->mpDefaultWin )
     151             :     {
     152          23 :         Application::GetSolarMutex().acquire();
     153             : 
     154             :         // Test again because the thread who released the solar mutex could have called
     155             :         // the same method
     156             : 
     157          23 :         if ( !pSVData->mpDefaultWin && !pSVData->mbDeInit )
     158             :         {
     159             :             DBG_WARNING( "ImplGetDefaultWindow(): No AppWindow" );
     160          23 :             pSVData->mpDefaultWin = new WorkWindow( 0, WB_DEFAULTWIN );
     161          23 :             pSVData->mpDefaultWin->SetText( OUString( "VCL ImplGetDefaultWindow"  ) );
     162             :         }
     163          23 :         Application::GetSolarMutex().release();
     164             :     }
     165             : 
     166        9126 :     return pSVData->mpDefaultWin;
     167             : }
     168             : 
     169             : // -----------------------------------------------------------------------
     170             : 
     171             : #define VCL_CREATERESMGR_NAME( Name )   #Name
     172             : 
     173         552 : ResMgr* ImplGetResMgr()
     174             : {
     175         552 :     ImplSVData* pSVData = ImplGetSVData();
     176         552 :     if ( !pSVData->mpResMgr )
     177             :     {
     178           8 :         ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
     179           8 :         pSVData->mpResMgr = ResMgr::SearchCreateResMgr( VCL_CREATERESMGR_NAME( vcl ), aLocale );
     180             : 
     181             :         static bool bMessageOnce = false;
     182           8 :         if( !pSVData->mpResMgr && ! bMessageOnce )
     183             :         {
     184           0 :             bMessageOnce = true;
     185             :             const char* pMsg =
     186             :                 "Missing vcl resource. This indicates that files vital to localization are missing. "
     187           0 :                 "You might have a corrupt installation.";
     188           0 :             fprintf( stderr, "%s\n", pMsg );
     189           0 :             ErrorBox aBox( NULL, WB_OK | WB_DEF_OK, rtl::OUString( pMsg, strlen( pMsg ), RTL_TEXTENCODING_ASCII_US ) );
     190           0 :             aBox.Execute();
     191           8 :         }
     192             :     }
     193         552 :     return pSVData->mpResMgr;
     194             : }
     195             : 
     196           0 : ResId VclResId( sal_Int32 nId )
     197             : {
     198           0 :     ResMgr* pMgr = ImplGetResMgr();
     199           0 :     if( ! pMgr )
     200           0 :         throw std::bad_alloc();
     201             : 
     202           0 :     return ResId( nId, *pMgr );
     203             : }
     204             : 
     205           0 : FieldUnitStringList* ImplGetFieldUnits()
     206             : {
     207           0 :     ImplSVData* pSVData = ImplGetSVData();
     208           0 :     if( ! pSVData->maCtrlData.mpFieldUnitStrings )
     209             :     {
     210           0 :         ResMgr* pResMgr = ImplGetResMgr();
     211           0 :         if( pResMgr )
     212             :         {
     213           0 :             ResStringArray aUnits( ResId (SV_FUNIT_STRINGS, *pResMgr) );
     214           0 :             sal_uInt32 nUnits = aUnits.Count();
     215           0 :             pSVData->maCtrlData.mpFieldUnitStrings = new FieldUnitStringList();
     216           0 :             pSVData->maCtrlData.mpFieldUnitStrings->reserve( nUnits );
     217           0 :             for( sal_uInt32 i = 0; i < nUnits; i++ )
     218             :             {
     219           0 :                 std::pair< String, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
     220           0 :                 pSVData->maCtrlData.mpFieldUnitStrings->push_back( aElement );
     221           0 :             }
     222             :         }
     223             :     }
     224           0 :     return pSVData->maCtrlData.mpFieldUnitStrings;
     225             : }
     226             : 
     227           0 : FieldUnitStringList* ImplGetCleanedFieldUnits()
     228             : {
     229           0 :     ImplSVData* pSVData = ImplGetSVData();
     230           0 :     if( ! pSVData->maCtrlData.mpCleanUnitStrings )
     231             :     {
     232           0 :         FieldUnitStringList* pUnits = ImplGetFieldUnits();
     233           0 :         if( pUnits )
     234             :         {
     235           0 :             size_t nUnits = pUnits->size();
     236           0 :             pSVData->maCtrlData.mpCleanUnitStrings = new FieldUnitStringList();
     237           0 :             pSVData->maCtrlData.mpCleanUnitStrings->reserve( nUnits );
     238           0 :             for( size_t i = 0; i < nUnits; ++i )
     239             :             {
     240           0 :                 rtl::OUString aUnit( (*pUnits)[i].first );
     241           0 :                 aUnit = comphelper::string::remove(aUnit, ' ');
     242           0 :                 aUnit = aUnit.toAsciiLowerCase();
     243           0 :                 std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
     244           0 :                 pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement );
     245           0 :             }
     246             :         }
     247             :     }
     248           0 :     return pSVData->maCtrlData.mpCleanUnitStrings;
     249             : }
     250             : 
     251       83002 : DockingManager* ImplGetDockingManager()
     252             : {
     253       83002 :     ImplSVData* pSVData = ImplGetSVData();
     254       83002 :     if ( !pSVData->mpDockingManager )
     255           9 :         pSVData->mpDockingManager = new DockingManager();
     256             : 
     257       83002 :     return pSVData->mpDockingManager;
     258             : }
     259             : 
     260           0 : class AccessBridgeCurrentContext: public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext >
     261             : {
     262             : public:
     263           0 :     AccessBridgeCurrentContext(
     264             :         const com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > &context ) :
     265           0 :         m_prevContext( context ) {}
     266             : 
     267             :     // XCurrentContext
     268             :     virtual com::sun::star::uno::Any SAL_CALL getValueByName( const rtl::OUString& Name )
     269             :         throw (com::sun::star::uno::RuntimeException);
     270             : private:
     271             :     com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > m_prevContext;
     272             : };
     273             : 
     274           0 : com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::OUString & Name )
     275             :     throw (com::sun::star::uno::RuntimeException)
     276             : {
     277           0 :     com::sun::star::uno::Any ret;
     278           0 :     if ( Name == "java-vm.interaction-handler" )
     279             :     {
     280             :         // Currently, for accessbility no interaction handler shall be offered.
     281             :         // There may be introduced later on a handler using native toolkits
     282             :         // jbu->obr: Instantiate here your interaction handler
     283             :     }
     284           0 :     else if( m_prevContext.is() )
     285             :     {
     286           0 :         ret = m_prevContext->getValueByName( Name );
     287             :     }
     288           0 :     return ret;
     289             : }
     290             : 
     291             : 
     292           0 : bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled)
     293             : {
     294           0 :     rCancelled = false;
     295             : 
     296           0 :     bool bErrorMessage = true;
     297             : 
     298             :     // Note:
     299             :     // if bAllowCancel is sal_True we were called from application startup
     300             :     //  where we will disable any Java errorboxes and show our own accessibility dialog if Java throws an exception
     301             :     // if bAllowCancel is sal_False we were called from Tools->Options
     302             :     //  where we will see Java errorboxes, se we do not show our dialogs in addition to Java's
     303             : 
     304             :     try
     305             :     {
     306           0 :         bool bSuccess = true;
     307             : 
     308             :         // No error messages when env var is set ..
     309           0 :         static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
     310           0 :         if( pEnv && *pEnv )
     311             :         {
     312           0 :             bErrorMessage = false;
     313             :         }
     314             : 
     315           0 :         ImplSVData* pSVData = ImplGetSVData();
     316           0 :         if( ! pSVData->mxAccessBridge.is() )
     317             :         {
     318           0 :             css::uno::Reference< XMultiServiceFactory > xFactory(comphelper::getProcessServiceFactory());
     319             : 
     320           0 :             if( xFactory.is() )
     321             :             {
     322             :                 css::uno::Reference< XExtendedToolkit > xToolkit =
     323           0 :                     css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
     324             : 
     325           0 :                 Sequence< Any > arguments(1);
     326           0 :                 arguments[0] = makeAny(xToolkit);
     327             : 
     328             :                 // Disable default java error messages on startup, because they were probably unreadable
     329             :                 // for a disabled user. Use native message boxes which are accessible without java support.
     330             :                 // No need to do this when activated by Tools-Options dialog ..
     331           0 :                 if( bAllowCancel )
     332             :                 {
     333             :                     // customize the java-not-available-interaction-handler entry within the
     334             :                     // current context when called at startup.
     335             :                     com::sun::star::uno::ContextLayer layer(
     336           0 :                         new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) );
     337             : 
     338           0 :                     pSVData->mxAccessBridge = xFactory->createInstanceWithArguments(
     339             :                             OUString("com.sun.star.accessibility.AccessBridge"),
     340             :                             arguments
     341           0 :                         );
     342             :                 }
     343             :                 else
     344             :                 {
     345           0 :                     pSVData->mxAccessBridge = xFactory->createInstanceWithArguments(
     346             :                             OUString("com.sun.star.accessibility.AccessBridge"),
     347             :                             arguments
     348           0 :                         );
     349             :                 }
     350             : 
     351           0 :                 if( !pSVData->mxAccessBridge.is() )
     352           0 :                     bSuccess = false;
     353           0 :             }
     354             :         }
     355             : 
     356           0 :         return bSuccess;
     357             :     }
     358           0 :     catch (const ::com::sun::star::java::JavaNotConfiguredException&)
     359             :     {
     360           0 :         ResMgr *pResMgr = ImplGetResMgr();
     361           0 :         if( bErrorMessage && bAllowCancel && pResMgr )
     362             :         {
     363           0 :             rtl::OUString aTitle(ResId(SV_ACCESSERROR_JAVA_NOT_CONFIGURED, *pResMgr).toString());
     364           0 :             rtl::OUStringBuffer aMessage((ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr)).toString());
     365             : 
     366           0 :             aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString());
     367             : 
     368           0 :             int ret = ImplGetSalSystem()->ShowNativeMessageBox(
     369             :                 aTitle,
     370             :                 ReplaceJavaErrorMessages(aMessage.makeStringAndClear()),
     371             :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
     372           0 :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true);
     373             : 
     374             :             // Do not change the setting in case the user chooses to cancel
     375           0 :             if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
     376           0 :                 rCancelled = true;
     377             :         }
     378             : 
     379           0 :         return false;
     380             :     }
     381           0 :     catch (const ::com::sun::star::java::JavaVMCreationFailureException&)
     382             :     {
     383           0 :         ResMgr *pResMgr = ImplGetResMgr();
     384           0 :         if( bErrorMessage && bAllowCancel && pResMgr )
     385             :         {
     386           0 :             rtl::OUString aTitle(ResId(SV_ACCESSERROR_FAULTY_JAVA, *pResMgr).toString());
     387           0 :             rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString());
     388             : 
     389           0 :             aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString());
     390             : 
     391           0 :             int ret = ImplGetSalSystem()->ShowNativeMessageBox(
     392             :                 aTitle,
     393             :                 ReplaceJavaErrorMessages(aMessage.makeStringAndClear()),
     394             :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
     395           0 :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true);
     396             : 
     397             :             // Do not change the setting in case the user chooses to cancel
     398           0 :             if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
     399           0 :                 rCancelled = true;
     400             :         }
     401             : 
     402           0 :         return false;
     403             :     }
     404           0 :     catch (const ::com::sun::star::java::MissingJavaRuntimeException&)
     405             :     {
     406           0 :         ResMgr *pResMgr = ImplGetResMgr();
     407           0 :         if( bErrorMessage && bAllowCancel && pResMgr )
     408             :         {
     409           0 :             rtl::OUString aTitle(ResId(SV_ACCESSERROR_MISSING_JAVA, *pResMgr).toString());
     410           0 :             rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString());
     411             : 
     412           0 :             aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString());
     413             : 
     414           0 :             int ret = ImplGetSalSystem()->ShowNativeMessageBox(
     415             :                 aTitle,
     416             :                 ReplaceJavaErrorMessages(aMessage.makeStringAndClear()),
     417             :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
     418           0 :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true);
     419             : 
     420             :             // Do not change the setting in case the user chooses to cancel
     421           0 :             if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
     422           0 :                 rCancelled = true;
     423             :         }
     424             : 
     425           0 :         return false;
     426             :     }
     427           0 :     catch (const ::com::sun::star::java::JavaDisabledException&)
     428             :     {
     429           0 :         ResMgr *pResMgr = ImplGetResMgr();
     430           0 :         if( bErrorMessage && bAllowCancel && pResMgr )
     431             :         {
     432           0 :             rtl::OUString aTitle(ResId(SV_ACCESSERROR_JAVA_DISABLED, *pResMgr).toString());
     433           0 :             rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString());
     434             : 
     435           0 :             aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString());
     436             : 
     437           0 :             int ret = ImplGetSalSystem()->ShowNativeMessageBox(
     438             :                 aTitle,
     439             :                 ReplaceJavaErrorMessages(aMessage.makeStringAndClear()),
     440             :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
     441           0 :                 SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true);
     442             : 
     443             :             // Do not change the setting in case the user chooses to cancel
     444           0 :             if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
     445           0 :                 rCancelled = true;
     446             :         }
     447             : 
     448           0 :         return false;
     449             :     }
     450           0 :     catch (const ::com::sun::star::uno::RuntimeException& e)
     451             :     {
     452           0 :         ResMgr *pResMgr = ImplGetResMgr();
     453           0 :         if( bErrorMessage && pResMgr )
     454             :         {
     455           0 :             rtl::OUString aTitle;
     456           0 :             rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, *pResMgr).toString());
     457             : 
     458           0 :             if( 0 == e.Message.compareTo(::rtl::OUString("ClassNotFound"), 13) )
     459             :             {
     460           0 :                 aTitle = ResId(SV_ACCESSERROR_MISSING_BRIDGE, *pResMgr).toString();
     461             :             }
     462           0 :             else if( 0 == e.Message.compareTo(::rtl::OUString("NoSuchMethod"), 12) )
     463             :             {
     464           0 :                 aTitle = ResId(SV_ACCESSERROR_WRONG_VERSION, *pResMgr).toString();
     465             :             }
     466             : 
     467           0 :             if (!aTitle.isEmpty())
     468             :             {
     469           0 :                 if( bAllowCancel )
     470             :                 {
     471             :                     // Something went wrong initializing the Java AccessBridge (on Windows) during the
     472             :                     // startup. Since the office will be probably unusable for a disabled user, we offer
     473             :                     // to terminate directly.
     474           0 :                     aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString());
     475             : 
     476           0 :                     int ret = ImplGetSalSystem()->ShowNativeMessageBox(
     477             :                         aTitle,
     478             :                         ReplaceJavaErrorMessages(aMessage.makeStringAndClear()),
     479             :                         SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
     480           0 :                         SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true);
     481             : 
     482             :                     // Do not change the setting in case the user chooses to cancel
     483           0 :                     if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
     484           0 :                         rCancelled = sal_True;
     485             :                 }
     486             :                 else
     487             :                 {
     488             :                     // The user tried to activate accessibility support using Tools-Options dialog,
     489             :                     // so we don't offer to terminate here !
     490           0 :                     ImplGetSalSystem()->ShowNativeMessageBox(
     491             :                         aTitle,
     492             :                         ReplaceJavaErrorMessages(aMessage.makeStringAndClear()),
     493             :                         SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK,
     494           0 :                         SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, true);
     495             :                 }
     496           0 :             }
     497             :         }
     498             : 
     499           0 :         return false;
     500             :     }
     501           0 :     catch (...)
     502             :     {
     503           0 :         return false;
     504             :     }
     505             : }
     506             : 
     507             : // -----------------------------------------------------------------------
     508             : 
     509           0 : Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos )
     510             : {
     511           0 :     ImplSVData* pSVData = ImplGetSVData();
     512           0 :     Window*     pFrameWindow = pSVData->maWinData.mpFirstFrame;
     513           0 :     while ( pFrameWindow )
     514             :     {
     515           0 :         if ( pFrameWindow->ImplGetFrame() == pFrame )
     516             :         {
     517           0 :             Window* pWindow = pFrameWindow->ImplFindWindow( rSalFramePos );
     518           0 :             if ( !pWindow )
     519           0 :                 pWindow = pFrameWindow->ImplGetWindow();
     520           0 :             rSalFramePos = pWindow->ImplFrameToOutput( rSalFramePos );
     521           0 :             return pWindow;
     522             :         }
     523           0 :         pFrameWindow = pFrameWindow->ImplGetFrameData()->mpNextFrame;
     524             :     }
     525             : 
     526           0 :     return NULL;
     527             : }
     528             : 
     529           0 : void LocaleConfigurationListener::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 nHint )
     530             : {
     531           0 :     AllSettings::LocaleSettingsChanged( nHint );
     532           0 : }
     533             : 
     534             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10