summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-01-09 18:47:24 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-01-09 18:47:50 +0100
commit0c4639fa83d6b586e099ab373ee2f7b588588c65 (patch)
tree1329a54bd23692bd858a4cc022b21af284dc834f
parentafcfe477034024639013f2360cf6b254b4460c05 (diff)
Set PAPER_SCREEN_4_3 values back and use it as it was
It breaks things. Change-Id: Ia28391aed27051e5f6a7e0996f30b23c46eb8269
-rw-r--r--i18nutil/source/utility/paper.cxx2
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx23
2 files changed, 18 insertions, 7 deletions
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index e3f99f2cf9fc..2447bfc7813b 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -82,7 +82,7 @@ static const PageDesc aDinTab[] =
{ MM2MM100( 114 ), MM2MM100( 229 ), "EnvC65", NULL },
{ MM2MM100( 110 ), MM2MM100( 220 ), "EnvDL", "DL" },
{ MM2MM100( 180), MM2MM100( 270 ), NULL, NULL }, //Dia
- { MM2MM100( 280), MM2MM100( 210 ), NULL, NULL }, //Screen 4:3
+ { MM2MM100( 210), MM2MM100( 280 ), NULL, NULL }, //Screen 4:3
{ IN2MM100( 17 ), IN2MM100( 22 ), "AnsiC", "CSheet" },
{ IN2MM100( 22 ), IN2MM100( 34 ), "AnsiD", "DSheet" },
{ IN2MM100( 34 ), IN2MM100( 44 ), "AnsiE", "ESheet" },
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())
{