Hi,
I was the person who removed the dog preview from Writer's Picture
dialogue. In it's place there is now a nice alpine landscape (that I
nabbed from the Writer icon, but whatever). Sadly, it's stretched
larger than its original size which leads to pixelation. This is a
condition I wanted to remedy before closing fdo#43976.
So, I wrote a patch, everything looks fine, but the preview image
can't be mirrored any more (or is maybe drawn mirrored somewhere it
can't be seen). Attaching this patch might be a bit embarrassing, but
I hope people here recognise that I am not really a programmer. Hints
very much appreciated.
Regards,
Astron.
(I know I could probably unify nWidth and nHeight to a const Size...
but I wanted to leave that for later...)
From 3c4321fc9477904f92eb2be70397deac0aee67d8 Mon Sep 17 00:00:00 2001
From: "Stefan Knorr (astron)" <heinzlesspam@gmail.com>
Date: Mon, 19 Dec 2011 12:37:59 +0100
Subject: [PATCH] FRMDLG: Try to draw replacement preview at original size
---
sw/source/ui/frmdlg/frmpage.cxx | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 288141b..0d6bf7c 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -224,7 +224,7 @@ static FrmMap aHFlyHtmlMap[] =
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE,
LB_FLY_REL_PG_FRAME}
};
-// own vertical alignment map for to frame anchored objects
+// own vertical alignment map for objects anchored to frame
#define VERT_FRAME_REL (LB_FLY_VERT_FRAME|LB_FLY_VERT_PRTAREA)
static FrmMap aVFrameMap[] =
@@ -1941,7 +1941,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
}
/*--------------------------------------------------------------------
- Description: horizonal Pos
+ Description: horizontal Pos
--------------------------------------------------------------------*/
IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB )
{
@@ -2562,7 +2562,15 @@ void BmpWindow::Paint( const Rectangle& )
if(nRelGrf < nRelWin)
{
const long nWidth = aPntSz.Width();
- aPntSz.Width() = aPntSz.Height() * nRelGrf /100;
+ const long nHeight = aPntSz.Height();
+ // if we use a replacement preview, try to draw at original size
+ if ( !bGraphic && ( aGrfSize.Width() <= aPntSz.Width() ) && ( aGrfSize.Height() <=
aPntSz.Height() ) ) {
+ aPntSz.Width() = aGrfSize.Width();
+ aPntSz.Height() = aGrfSize.Height();
+ aPntPos.Y() += (nHeight - aPntSz.Height())/2 ;
+ }
+
+ else aPntSz.Width() = aPntSz.Height() * nRelGrf /100;
if(!bLeftAlign)
aPntPos.X() += nWidth - aPntSz.Width() ;
}
--
1.7.5.4
Context
- [Libreoffice] [Broken patch] Frame dialogue, try to draw the preview at its original size · Stefan Knorr (Astron)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.