Kaydet (Commit) 60c7ed80 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

fdo#72947 Startcenter: display more userfriendly file urls in tooltips

Use INetURLObject to get a readable url (it displayes special characters
too). It is a side effect that 'file:///' prefix disappear
which seems a good thing.
Plus some cleanup: remove second INetURLObject.

Change-Id: I4aab5e2546ae70e5a3d85b12e26e021bfa244999
üst adf932c6
...@@ -23,6 +23,9 @@ public: ...@@ -23,6 +23,9 @@ public:
virtual OUString getHelpText() const; virtual OUString getHelpText() const;
OUString maURL; OUString maURL;
private:
OUString m_sHelpText;
}; };
#endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX #endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
......
...@@ -21,6 +21,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR ...@@ -21,6 +21,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
{ {
OUString aTitle(rTitle); OUString aTitle(rTitle);
INetURLObject aURLObj(rURL); INetURLObject aURLObj(rURL);
m_sHelpText = aURLObj.GetURLPath();
RecentDocsView& rRecentView = dynamic_cast<RecentDocsView&>(rView); RecentDocsView& rRecentView = dynamic_cast<RecentDocsView&>(rView);
long nThumbnailSize = rRecentView.GetThumbnailSize(); long nThumbnailSize = rRecentView.GetThumbnailSize();
...@@ -38,10 +39,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR ...@@ -38,10 +39,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
Size aExtSize(aExt.GetSizePixel()); Size aExtSize(aExt.GetSizePixel());
// attempt to make it appear as if it is on a piece of paper // attempt to make it appear as if it is on a piece of paper
INetURLObject aUrl(rURL);
long nPaperHeight; long nPaperHeight;
long nPaperWidth; long nPaperWidth;
if( RecentDocsView::typeMatchesExtension(TYPE_IMPRESS, aUrl.getExtension()) ) if( RecentDocsView::typeMatchesExtension(TYPE_IMPRESS, aURLObj.getExtension()) )
{ {
// Swap width and height (PAPER_SCREEN_4_3 definition make it needed) // Swap width and height (PAPER_SCREEN_4_3 definition make it needed)
PaperInfo aInfo(PAPER_SCREEN_4_3); PaperInfo aInfo(PAPER_SCREEN_4_3);
...@@ -86,7 +86,7 @@ void RecentDocsViewItem::setEditTitle (bool edit, bool bChangeFocus) ...@@ -86,7 +86,7 @@ void RecentDocsViewItem::setEditTitle (bool edit, bool bChangeFocus)
OUString RecentDocsViewItem::getHelpText() const OUString RecentDocsViewItem::getHelpText() const
{ {
return maURL; return m_sHelpText;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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