Don't dupplicate logic so that one can fix possible bugs only once
Change-Id: I58744a93d3edb3002e9a71c22e0d492cb9277e73
This commit is contained in:
@@ -154,33 +154,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
|
|||||||
|
|
||||||
OUString aModuleId = xModuleManager->identify(xFrame);
|
OUString aModuleId = xModuleManager->identify(xFrame);
|
||||||
OUString sDesktopName;
|
OUString sDesktopName;
|
||||||
#if defined(UNX) && !defined(MACOSX)
|
#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")) ||
|
|
||||||
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 ( aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument")) ||
|
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.GlobalDocument")) ||
|
||||||
aModuleId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.WebDocument")) ||
|
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");
|
sDesktopName = OUString("Base");
|
||||||
else
|
else
|
||||||
sDesktopName = OUString("Startcenter");
|
sDesktopName = OUString("Startcenter");
|
||||||
|
#if defined(WNT)
|
||||||
// We use a hardcoded product name matching the registry keys so applications can be associated with file types
|
// We use a hardcoded product name matching the registry keys so applications can be associated with file types
|
||||||
sApplicationID = "TheDocumentFoundation.LibreOffice.";
|
sApplicationID = "TheDocumentFoundation.LibreOffice.";
|
||||||
sApplicationID += sDesktopName;
|
sApplicationID += sDesktopName;
|
||||||
|
#else
|
||||||
|
sApplicationID = utl::ConfigManager::getProductName().toAsciiLowerCase();
|
||||||
|
sApplicationID += OUString(sal_Unicode('-'));
|
||||||
|
sApplicationID += sDesktopName.toAsciiLowerCase();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
catch(const css::uno::Exception&)
|
catch(const css::uno::Exception&)
|
||||||
|
Reference in New Issue
Block a user