diff options
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index a0d360622d0b..47542d147853 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -746,8 +746,12 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(weld::Container* pPage, weld::DialogC m_xExamplesVS->InsertItem( i + 1, i); INetURLObject aObj(grfName); - if(aObj.GetProtocol() == INetProtocol::File) - grfName = aObj.PathToFileName(); + if (aObj.GetProtocol() == INetProtocol::File) + { + // tdf#114070 - only show the last name of the filename without its extension + aObj.removeExtension(); + grfName = aObj.GetLastName(INetURLObject::DecodeMechanism::Unambiguous); + } m_xExamplesVS->SetItemText( i + 1, grfName ); ++i; @@ -981,8 +985,12 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, weld::Button&, voi { m_xExamplesVS->InsertItem( i + 1, i); INetURLObject aObj(grfName); - if(aObj.GetProtocol() == INetProtocol::File) - grfName = aObj.PathToFileName(); + if (aObj.GetProtocol() == INetProtocol::File) + { + // tdf#114070 - only show the last name of the filename without its extension + aObj.removeExtension(); + grfName = aObj.GetLastName(INetURLObject::DecodeMechanism::Unambiguous); + } m_xExamplesVS->SetItemText( i + 1, grfName ); ++i; } |