summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-22 14:37:29 +0000
committerMichael Stahl <mstahl@redhat.com>2015-01-27 15:08:50 +0000
commit43d27e1df25ad3bee5790621d01b21c15249a32d (patch)
treefb5d64ced48b737b49711a0b6fe3645b8d54ebbe
parent2a19ea84b7498d323b8737e0df86037755181c93 (diff)
Resolves: fdo#88378 flipping by reversing co-ord system no longer works
not entirely sure when this stopped working, but our contempory code is riddled with asserts and throws for negative sizes so rework this to explicitly mirror the preview rather than try the no longer working technique Change-Id: Ie90283cad2797ab1c37848469b007dc01a2c9d75 (cherry picked from commit a8835936e9d3e19443c63b7b365174254741cf76) Reviewed-on: https://gerrit.libreoffice.org/14114 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index cd22bb59669a..e42f13a30424 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2654,25 +2654,25 @@ void BmpWindow::Paint( const Rectangle& )
aPntPos.X() += nWidth - aPntSz.Width() ;
}
- if ( bHorz )
- {
- aPntPos.Y() += aPntSz.Height();
- aPntPos.Y() --;
- aPntSz.Height() *= -1;
- }
- if ( bVert )
- {
- aPntPos.X() += aPntSz.Width();
- aPntPos.X()--;
- aPntSz.Width() *= -1;
- }
-
// #i119307# clear window background, the graphic might have transparency
DrawRect(Rectangle(aPntPos, aPntSz));
- if ( bGraphic )
+ if (bHorz || bVert)
+ {
+ BitmapEx aTmpBmp(bGraphic ? aGraphic.GetBitmapEx() : aBmp);
+ sal_uLong nMirrorFlags(BMP_MIRROR_NONE);
+ if (bHorz)
+ nMirrorFlags |= BMP_MIRROR_VERT;
+ if (bVert)
+ nMirrorFlags |= BMP_MIRROR_HORZ;
+ aTmpBmp.Mirror(nMirrorFlags);
+ DrawBitmapEx( aPntPos, aPntSz, aTmpBmp );
+ }
+ else if (bGraphic) //draw unmirrored preview graphic
+ {
aGraphic.Draw( this, aPntPos, aPntSz );
- else
+ }
+ else //draw unmirrored stock sample image
{
DrawBitmapEx( aPntPos, aPntSz, aBmp );
}