[Libreoffice-commits] .: 2 commits - sw/source vcl/source
Ivan Timofeev
ivantimofeev at kemper.freedesktop.org
Fri Nov 18 04:27:16 PST 2011
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 <timofeev.i.s at gmail.com>
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:
void ShowVScrollbar(sal_Bool bShow);
sal_uInt16 GetPageCount() const { return mnPageCount; }
+ sal_uInt16 GetSelectedPage() const {return aViewWin.SelectedPage();}
sal_Bool HandleWheelCommands( 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 <timofeev.i.s at gmail.com>
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 );
More information about the Libreoffice-commits
mailing list