diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-09 18:57:38 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-01-13 12:25:23 +0000 |
commit | 41189d834e5d2b7c22eb91f2641c8c716e75c101 (patch) | |
tree | 826a0706796971b7723783b870ef637e76811171 /sfx2 | |
parent | feca4e6c739a218b536d0b75c7f8d21aafa07933 (diff) |
Startcenter: use PAPER_SCREEN_4_3 as default paper for presentations
Remove static to able to construct items with different
paper info.
(cherry picked from commit 5ab1fb926e984780380665ae185646b603292a6e)
Change-Id: Ifba44675f6126ebfccf26f53f226214bed92352c
Reviewed-on: https://gerrit.libreoffice.org/7339
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 9a436cece5a74d052e6a17f62f070ad151c7629b)
Reviewed-on: https://gerrit.libreoffice.org/7358
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Zolnai Tamás <zolnaitamas2000@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 883b1fa77996..6d6b3855adb9 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -44,9 +44,24 @@ 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 - static PaperInfo aInfo(PaperInfo::getSystemDefaultPaper()); - double ratio = double(nThumbnailSize) / double(std::max(aInfo.getWidth(), aInfo.getHeight())); - Size aThumbnailSize(aInfo.getWidth() * ratio, aInfo.getHeight() * ratio); + INetURLObject aUrl(rURL); + long nPaperHeight; + long nPaperWidth; + if( RecentDocsView::typeMatchesExtension(TYPE_IMPRESS, aUrl.getExtension()) ) + { + // Swap width and height (PAPER_SCREEN_4_3 definition make it needed) + PaperInfo aInfo(PAPER_SCREEN_4_3); + nPaperHeight = aInfo.getWidth(); + nPaperWidth = aInfo.getHeight(); + } + else + { + PaperInfo aInfo(PaperInfo::getSystemDefaultPaper()); + nPaperHeight = aInfo.getHeight(); + nPaperWidth = aInfo.getWidth(); + } + double ratio = double(nThumbnailSize) / double(std::max(nPaperHeight, nPaperWidth)); + Size aThumbnailSize(nPaperWidth * ratio, nPaperHeight * ratio); if (aExtSize.Width() > aThumbnailSize.Width() || aExtSize.Height() > aThumbnailSize.Height()) { |