[Libreoffice-commits] core.git: i18nutil/source sfx2/source
Zolnai Tamás
tamas.zolnai at collabora.com
Thu Jan 9 09:49:48 PST 2014
i18nutil/source/utility/paper.cxx | 2 +-
sfx2/source/control/recentdocsviewitem.cxx | 23 +++++++++++++++++------
2 files changed, 18 insertions(+), 7 deletions(-)
New commits:
commit 0c4639fa83d6b586e099ab373ee2f7b588588c65
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Thu Jan 9 18:47:24 2014 +0100
Set PAPER_SCREEN_4_3 values back and use it as it was
It breaks things.
Change-Id: Ia28391aed27051e5f6a7e0996f30b23c46eb8269
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index e3f99f2..2447bfc 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 2d1e083..c35c16b 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())
{
More information about the Libreoffice-commits
mailing list