summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-01-10 03:31:46 +0100
committerJan Holesovsky <kendy@collabora.com>2014-01-10 14:03:35 +0000
commit943dd8bfd8695f11773b90fbfebd4179eee9f492 (patch)
tree9c47f6d07c3fd1603c95b6977a408fb0b49b03e1
parent1f349d3240115651346da04daeb3459b31782301 (diff)
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 (cherry picked from commit 31dfeee42e9b08ed7031b6c50d0c674122d5245c) Reviewed-on: https://gerrit.libreoffice.org/7366 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--include/sfx2/recentdocsviewitem.hxx3
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx6
2 files changed, 6 insertions, 3 deletions
diff --git a/include/sfx2/recentdocsviewitem.hxx b/include/sfx2/recentdocsviewitem.hxx
index be94b78c5a45..410e74bea254 100644
--- a/include/sfx2/recentdocsviewitem.hxx
+++ b/include/sfx2/recentdocsviewitem.hxx
@@ -23,6 +23,9 @@ public:
virtual OUString getHelpText() const;
OUString maURL;
+
+private:
+ OUString m_sHelpText;
};
#endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index c35c16b31ee1..d7416750a0d4 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -21,6 +21,7 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
{
OUString aTitle(rTitle);
INetURLObject aURLObj(rURL);
+ m_sHelpText = aURLObj.GetURLPath();
RecentDocsView& rRecentView = dynamic_cast<RecentDocsView&>(rView);
long nThumbnailSize = rRecentView.GetThumbnailSize();
@@ -38,10 +39,9 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
Size aExtSize(aExt.GetSizePixel());
// attempt to make it appear as if it is on a piece of paper
- INetURLObject aUrl(rURL);
long nPaperHeight;
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)
PaperInfo aInfo(PAPER_SCREEN_4_3);
@@ -86,7 +86,7 @@ void RecentDocsViewItem::setEditTitle (bool edit, bool bChangeFocus)
OUString RecentDocsViewItem::getHelpText() const
{
- return maURL;
+ return m_sHelpText;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */