Kaydet (Commit) cd689036 authored tarafından Matthew J. Francis's avatar Matthew J. Francis Kaydeden (comit) Stephan Bergmann

fdo#83891 Show document names including " - " during autorecovery

Change-Id: I9c8076ec51858967ddde0dbbf109f30025975d57
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst e9d3907c
......@@ -410,6 +410,19 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a
aNew.DisplayName = lInfo.getUnpackedValueOrDefault(STATEPROP_TITLE , OUString());
aNew.Module = lInfo.getUnpackedValueOrDefault(STATEPROP_MODULE , OUString());
if (aNew.OrgURL.isEmpty()) {
// If there is no file URL, the window title is used for the display name.
// Remove any unwanted elements such as " - LibreOffice Writer".
sal_Int32 i = aNew.DisplayName.indexOf(" - ");
if (i > 0)
aNew.DisplayName = aNew.DisplayName.copy(0, i);
} else {
// If there is a file URL, parse out the filename part as the display name.
INetURLObject aOrgURL(aNew.OrgURL);
aNew.DisplayName = aOrgURL.getName(INetURLObject::LAST_SEGMENT, true,
INetURLObject::DECODE_WITH_CHARSET);
}
// search for already existing items and update her nState value ...
TURLList::iterator pIt;
for ( pIt = m_lURLs.begin();
......@@ -449,11 +462,6 @@ void SAL_CALL RecoveryCore::statusChanged(const css::frame::FeatureStateEvent& a
map the doc state to an UI state. */
aNew.RecoveryState = E_NOT_RECOVERED_YET;
// patch DisplayName! Because the document title contain more than the file name ...
sal_Int32 i = aNew.DisplayName.indexOf(" - ");
if (i > 0)
aNew.DisplayName = aNew.DisplayName.copy(0, i);
m_lURLs.push_back(aNew);
if (m_pListener)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment