summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-01-09 18:57:38 +0100
committerJan Holesovsky <kendy@collabora.com>2014-01-09 18:07:49 +0000
commit9a436cece5a74d052e6a17f62f070ad151c7629b (patch)
tree25ccf3e3628176339cc95574920850b6762c0ed5 /sfx2
parenta55ec81ad75b280edea8aa30f2a31a14489d2036 (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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index 2531da197a7e..c35c16b31ee1 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -38,9 +38,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())
{