sfx2: Drop 'aTitleMap_Impl' with unused and duplicate entries

The map is only used for the SFX_TITLE_PICKLIST
and SFX_TITLE_HISTORY cases.
That means that the first entry is irrelevant/unused
and for the other two, the same values are assigned.

Simplify that by dropping `aTitleMap_Impl` altogether
and just assigning the relevant values directly.

Change-Id: Ia3039c6337b4f8c8a3d93c67dc9c68ba981ad041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211037
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2026-09-16 22:27:48 +02:00
parent e6c451d7ef
commit 4eacf45ece
+2 -13
View File
@@ -153,15 +153,6 @@ public:
}
sal_uInt16 const aTitleMap_Impl[3][2] =
{
// local remote
/* SFX_TITLE_CAPTION */ { SFX_TITLE_FILENAME, SFX_TITLE_TITLE },
/* SFX_TITLE_PICKLIST */ { 32, SFX_TITLE_FULLNAME },
/* SFX_TITLE_HISTORY */ { 32, SFX_TITLE_FULLNAME }
};
bool SfxObjectShell::IsAbortingImport() const
{
return pImpl->bIsAbortingImport;
@@ -810,12 +801,10 @@ OUString SfxObjectShell::GetTitle( sal_uInt16 nMaxLength ) const
const INetURLObject aURL( IsDocShared() ? GetSharedFileURL() : GetMedium()->GetName() );
if (nMaxLength == SFX_TITLE_PICKLIST || nMaxLength == SFX_TITLE_HISTORY)
{
sal_uInt16 nRemote;
if (aURL.GetProtocol() == INetProtocol::File)
nRemote = 0;
nMaxLength = 32;
else
nRemote = 1;
nMaxLength = aTitleMap_Impl[nMaxLength-SFX_TITLE_CAPTION][nRemote];
nMaxLength = SFX_TITLE_FULLNAME;
}
// Local file?