diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-07-26 12:43:29 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-07-26 12:44:08 +0200 |
commit | f277d2a8caee4b15a518a26a3d1c064a9a3a1a62 (patch) | |
tree | 0202669f301203bc5ae34244f2dbe9a9298b6105 | |
parent | 324fff97a1713625e2def0f973462fb0a11290fb (diff) |
Don't dupplicate logic so that one can fix possible bugs only once
Change-Id: I58744a93d3edb3002e9a71c22e0d492cb9277e73
-rw-r--r-- | framework/source/helper/titlebarupdate.cxx | 34 |
1 files 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&) |