diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-09 18:47:24 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-09 18:47:50 +0100 |
commit | 0c4639fa83d6b586e099ab373ee2f7b588588c65 (patch) | |
tree | 1329a54bd23692bd858a4cc022b21af284dc834f /sfx2 | |
parent | afcfe477034024639013f2360cf6b254b4460c05 (diff) |
Set PAPER_SCREEN_4_3 values back and use it as it was
It breaks things.
Change-Id: Ia28391aed27051e5f6a7e0996f30b23c46eb8269
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/recentdocsviewitem.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 2d1e08308297..c35c16b31ee1 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -39,12 +39,23 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR // attempt to make it appear as if it is on a piece of paper INetURLObject aUrl(rURL); - PaperInfo aInfo( - RecentDocsView::typeMatchesExtension(TYPE_IMPRESS, aUrl.getExtension()) - ? PAPER_SCREEN_4_3 - : PaperInfo::getSystemDefaultPaper()); - double ratio = double(nThumbnailSize) / double(std::max(aInfo.getWidth(), aInfo.getHeight())); - Size aThumbnailSize(aInfo.getWidth() * ratio, aInfo.getHeight() * ratio); + 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()) { |