[Libreoffice-commits] .: 2 commits - sw/source vcl/source

2011-12-27 Thread Jan Holesovsky
 sw/source/ui/frmdlg/frmpage.cxx |   18 ++
 vcl/source/gdi/outdev2.cxx  |2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit e0e52ce536f6b4b69280d41d77fc6d43d23958f3
Author: Jan Holesovsky 
Date:   Tue Dec 27 22:25:36 2011 +0100

Fix drawing of the either horizontally, or vertically mirrored bitmaps.

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 3ee7254..329f5f4 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1783,7 +1783,7 @@ Bitmap OutputDevice::ImplBlend( Bitmap  aBmp,
 aTR.mnDestWidth = aOutSz.Width();
 aTR.mnDestHeight= aOutSz.Height();
 
-if( !bHMirr || !bVMirr )
+if( !bHMirr && !bVMirr )
 bFastBlend = ImplFastBitmapBlending( *pB,*pP,*pA, aTR );
 }
 
commit 640c1788efe181bbf834fb78ebb3c08820847a7e
Author: Stefan Knorr (astron) 
Date:   Mon Dec 19 12:37:59 2011 +0100

Try to draw replacement preview at original size

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 288141b..de3c4df 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 )
 {
@@ -2555,14 +2555,24 @@ void BmpWindow::Paint( const Rectangle& )
 aGrfSize = ::GetGraphicSizeTwip(aGraphic, this);
 //it should show the default bitmap also if no graphic can be found
 if(!aGrfSize.Width() && !aGrfSize.Height())
-aGrfSize =  PixelToLogic(aBmp.GetSizePixel());
+aGrfSize = PixelToLogic(aBmp.GetSizePixel());
 
 long nRelGrf = aGrfSize.Width() * 100L / aGrfSize.Height();
 long nRelWin = aPntSz.Width() * 100L / aPntSz.Height();
 if(nRelGrf < nRelWin)
 {
 const long nWidth = aPntSz.Width();
-aPntSz.Width() = aPntSz.Height() * nRelGrf /100;
+// if we use a replacement preview, try to draw at original size
+if ( !bGraphic && ( aGrfSize.Width() <= aPntSz.Width() ) && ( 
aGrfSize.Height() <= aPntSz.Height() ) )
+{
+const long nHeight = 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() ;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sw/source vcl/source

2011-11-18 Thread Ivan Timofeev
 sw/source/ui/inc/pview.hxx|1 +
 sw/source/ui/uno/unotxdoc.cxx |   16 +---
 vcl/source/gdi/print3.cxx |5 -
 3 files changed, 14 insertions(+), 8 deletions(-)

New commits:
commit ce888a74614aa83e17a34e557f416acb262419a1
Author: Ivan Timofeev 
Date:   Wed Nov 16 15:47:51 2011 +0400

fix fdo#42178: crash when printing from Page Preview

diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index e9902fb..329ba5e 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -273,6 +273,7 @@ public:
 voidShowVScrollbar(sal_Bool bShow);
 
 sal_uInt16  GetPageCount() const{ return mnPageCount; }
+sal_uInt16  GetSelectedPage() const {return aViewWin.SelectedPage();}
 
 sal_BoolHandleWheelCommands( const CommandEvent& );
 
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index c849fa7..4a1ef26 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -187,10 +187,20 @@ SwPrintUIOptions * lcl_GetPrintUIOptions(
 const SwPrintData &rPrintData = pDocShell->GetDoc()->getPrintData();
 
 // Get current page number
+sal_uInt16 nCurrentPage = 1;
 SwWrtShell* pSh = pDocShell->GetWrtShell();
-SwPaM* pShellCrsr = pSh->GetCrsr();
-sal_uInt16 nCurrentPage = pShellCrsr->GetPageNum(sal_True, 0);
-
+if (pSh)
+{
+SwPaM* pShellCrsr = pSh->GetCrsr();
+nCurrentPage = pShellCrsr->GetPageNum(sal_True, 0);
+}
+else
+{
+const SwPagePreView* pPreView = dynamic_cast< const SwPagePreView* 
>(pView);
+OSL_ENSURE(pPreView, "Unexpected type of the view shell");
+if (pPreView)
+nCurrentPage = pPreView->GetSelectedPage();
+}
 return new SwPrintUIOptions( nCurrentPage, bWebDoc, bSwSrcView, 
bHasSelection, bHasPostIts, rPrintData );
 }
 
commit 639f7b562c0e3304e3b087d86ea2a1134bc0d044
Author: Ivan Timofeev 
Date:   Fri Nov 18 15:58:27 2011 +0400

fix UI updating in the print dialog

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index c2b0e87..3d13fd8 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -869,11 +869,6 @@ PrinterController::PageSize 
PrinterController::getPageFile( int i_nUnfilteredPag
 Sequence< PropertyValue > aPageParm( getPageParametersProtected( 
i_nUnfilteredPage ) );
 const MapMode aMapMode( MAP_100TH_MM );
 
-if (mpImplData->meJobState != view::PrintableState_JOB_STARTED)
-{   // rhbz#657394: check that we are still printing...
-return PrinterController::PageSize();
-}
-
 mpImplData->mpPrinter->Push();
 mpImplData->mpPrinter->SetMapMode( aMapMode );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits