summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/inc/app.hxx3
-rw-r--r--desktop/source/app/app.cxx18
-rw-r--r--desktop/source/app/langselect.cxx23
-rw-r--r--desktop/source/app/langselect.hxx19
-rw-r--r--sfx2/source/view/userinputinterception.cxx14
-rw-r--r--ucb/source/core/cmdenv.cxx2
6 files changed, 68 insertions, 11 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 486d280311d9..8867a940a6ad 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -75,7 +75,8 @@ class Desktop : public Application
BE_USERINSTALL_FAILED,
BE_LANGUAGE_MISSING,
BE_USERINSTALL_NOTENOUGHDISKSPACE,
- BE_USERINSTALL_NOWRITEACCESS
+ BE_USERINSTALL_NOWRITEACCESS,
+ BE_OFFICECONFIG_BROKEN
};
enum BootstrapStatus
{
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index bba615e0ebbc..731ffe85d83b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -492,7 +492,12 @@ void Desktop::Init()
{
// prepare language
if ( !LanguageSelection::prepareLanguage() )
- SetBootstrapError( BE_LANGUAGE_MISSING );
+ {
+ if ( LanguageSelection::getStatus() == LanguageSelection::LS_STATUS_CANNOT_DETERMINE_LANGUAGE )
+ SetBootstrapError( BE_LANGUAGE_MISSING );
+ else
+ SetBootstrapError( BE_OFFICECONFIG_BROKEN );
+ }
}
if ( GetBootstrapError() == BE_OK )
@@ -873,6 +878,17 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
FatalError( aMessage);
}
+ else if ( aBootstrapError == BE_OFFICECONFIG_BROKEN )
+ {
+ OUString aMessage;
+ OUStringBuffer aDiagnosticMessage( 100 );
+ OUString aErrorMsg;
+ aErrorMsg = GetMsgString( STR_CONFIG_ERR_ACCESS_GENERAL,
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "A general error occurred while accessing your central configuration." )) );
+ aDiagnosticMessage.append( aErrorMsg );
+ aMessage = MakeStartupErrorMessage( aDiagnosticMessage.makeStringAndClear() );
+ FatalError(aMessage);
+ }
else if ( aBootstrapError == BE_USERINSTALL_FAILED )
{
OUString aMessage;
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 5e2145b03729..9df8d82a37ff 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -64,10 +64,12 @@ namespace desktop {
static char const SOFFICE_BOOTSTRAP[] = "Bootstrap";
static char const SOFFICE_STARTLANG[] = "STARTLANG";
+
sal_Bool LanguageSelection::bFoundLanguage = sal_False;
OUString LanguageSelection::aFoundLanguage;
-const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US");
+LanguageSelection::LanguageSelectionStatus LanguageSelection::m_eStatus = LS_STATUS_OK;
+const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US");
static sal_Bool existsURL( OUString const& sURL )
{
@@ -122,6 +124,7 @@ Locale LanguageSelection::IsoStringToLocale(const OUString& str)
bool LanguageSelection::prepareLanguage()
{
+ m_eStatus = LS_STATUS_OK;
OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
Reference< XLocalizable > theConfigProvider;
@@ -131,7 +134,9 @@ bool LanguageSelection::prepareLanguage()
}
catch(const Exception&)
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
}
+
if(!theConfigProvider.is())
return false;
@@ -149,6 +154,7 @@ bool LanguageSelection::prepareLanguage()
}
catch(const Exception&)
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
}
// #i32939# use system locale to set document default locale
@@ -162,6 +168,7 @@ bool LanguageSelection::prepareLanguage()
}
catch (Exception&)
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
}
// get the selected UI language as string
@@ -350,8 +357,10 @@ OUString LanguageSelection::getLanguageString()
aFoundLanguage = usFallbackLanguage;
return aFoundLanguage;
}
+
// fallback didn't work use first installed language
aUserLanguage = getFirstInstalledLanguage();
+
bFoundLanguage = sal_True;
aFoundLanguage = aUserLanguage;
return aFoundLanguage;
@@ -455,7 +464,7 @@ sal_Bool LanguageSelection::isInstalledLanguage(OUString& usLocale, sal_Bool bEx
// requested locale starts with the installed locale
// (i.e. installed locale has index 0 in requested locale)
bInstalled = sal_True;
- usLocale = seqLanguages[i];
+ usLocale = seqLanguages[i];
break;
}
}
@@ -484,10 +493,12 @@ OUString LanguageSelection::getUserLanguage()
}
catch ( NoSuchElementException const & )
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
catch ( WrappedTargetException const & )
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
}
@@ -506,10 +517,12 @@ OUString LanguageSelection::getSystemLanguage()
}
catch ( NoSuchElementException const & )
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
catch ( WrappedTargetException const & )
{
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
}
@@ -533,9 +546,13 @@ void LanguageSelection::resetUserLanguage()
{
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_ENSURE(sal_False, aMsg.getStr());
+ m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
}
-
}
+LanguageSelection::LanguageSelectionStatus LanguageSelection::getStatus()
+{
+ return m_eStatus;
+}
} // namespace desktop
diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx
index 60308164690f..bdf3cd6364de 100644
--- a/desktop/source/app/langselect.hxx
+++ b/desktop/source/app/langselect.hxx
@@ -40,10 +40,24 @@ namespace desktop
class LanguageSelection
{
+public:
+ enum LanguageSelectionStatus
+ {
+ LS_STATUS_OK,
+ LS_STATUS_CANNOT_DETERMINE_LANGUAGE,
+ LS_STATUS_CONFIGURATIONACCESS_BROKEN
+ };
+
+ static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str);
+ static rtl::OUString getLanguageString();
+ static bool prepareLanguage();
+ static LanguageSelectionStatus getStatus();
+
private:
static const rtl::OUString usFallbackLanguage;
static rtl::OUString aFoundLanguage;
static sal_Bool bFoundLanguage;
+ static LanguageSelectionStatus m_eStatus;
static com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate=sal_False);
@@ -55,11 +69,6 @@ private:
static rtl::OUString getSystemLanguage();
static void resetUserLanguage();
static void setDefaultLanguage(const rtl::OUString&);
-
-public:
- static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str);
- static rtl::OUString getLanguageString();
- static bool prepareLanguage();
};
} //namespace desktop
diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx
index e716e604b649..ad910a944e0f 100644
--- a/sfx2/source/view/userinputinterception.cxx
+++ b/sfx2/source/view/userinputinterception.cxx
@@ -216,6 +216,13 @@ namespace sfx2
if ( e.Context == xHandler )
aIterator.remove();
}
+ catch( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ }
}
}
break;
@@ -247,6 +254,13 @@ namespace sfx2
if ( e.Context == xHandler )
aIterator.remove();
}
+ catch( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ }
}
}
break;
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
index 0f425e814400..5c0136fab063 100644
--- a/ucb/source/core/cmdenv.cxx
+++ b/ucb/source/core/cmdenv.cxx
@@ -183,7 +183,7 @@ UcbCommandEnvironment::createServiceFactory(
const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
{
return uno::Reference< lang::XSingleServiceFactory >(
- cppu::createOneInstanceFactory(
+ cppu::createSingleFactory(
rxServiceMgr,
UcbCommandEnvironment::getImplementationName_Static(),
UcbCommandEnvironment_CreateInstance,