From f277d2a8caee4b15a518a26a3d1c064a9a3a1a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Fri, 26 Jul 2013 12:43:29 +0200 Subject: [PATCH] Don't dupplicate logic so that one can fix possible bugs only once Change-Id: I58744a93d3edb3002e9a71c22e0d492cb9277e73 --- framework/source/helper/titlebarupdate.cxx | 34 ++++------------------ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index a3e929a0fbe4..cac2298c810b 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -154,33 +154,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr OUString aModuleId = xModuleManager->identify(xFrame); OUString sDesktopName; -#if defined(UNX) && !defined(MACOSX) - if ( aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.GlobalDocument")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.WebDocument")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.xforms.XMLFormDocument")) ) - sDesktopName = OUString("writer"); - else if ( aModuleId == "com.sun.star.sheet.SpreadsheetDocument" ) - sDesktopName = OUString("calc"); - else if ( aModuleId == "com.sun.star.presentation.PresentationDocument" ) - sDesktopName = OUString("impress"); - else if ( aModuleId == "com.sun.star.drawing.DrawingDocument" ) - sDesktopName = OUString("draw"); - else if ( aModuleId == "com.sun.star.formula.FormulaProperties" ) - sDesktopName = OUString("math"); - else if ( aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sdb.DatabaseDocument")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sdb.RelationDesign")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sdb.QueryDesign")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sdb.TableDesign")) || - aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.sdb.DataSourceBrowser")) ) - sDesktopName = OUString("base"); - else - sDesktopName = OUString("startcenter"); - sApplicationID = utl::ConfigManager::getProductName().toAsciiLowerCase(); - sApplicationID += OUString(sal_Unicode('-')); - sApplicationID += sDesktopName; -#elif defined(WNT) +#if !defined(MACOSX) if ( aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")) || aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.GlobalDocument")) || aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.WebDocument")) || @@ -203,10 +177,14 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr sDesktopName = OUString("Base"); else sDesktopName = OUString("Startcenter"); - +#if defined(WNT) // We use a hardcoded product name matching the registry keys so applications can be associated with file types sApplicationID = "TheDocumentFoundation.LibreOffice."; sApplicationID += sDesktopName; +#else + sApplicationID = utl::ConfigManager::getProductName().toAsciiLowerCase(); + sApplicationID += OUString(sal_Unicode('-')); + sApplicationID += sDesktopName.toAsciiLowerCase(); #endif } catch(const css::uno::Exception&)