diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/access/accmap.cxx | 62 | ||||
-rw-r--r-- | sw/source/core/inc/prevwpage.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/inc/viewimp.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/view/pagepreviewlayout.cxx | 306 | ||||
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/inc/pview.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/pview.cxx | 132 |
8 files changed, 269 insertions, 269 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index abbf52daa987..0c03d97b8c6b 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -549,27 +549,27 @@ class SwAccPreviewData input/output parameter - reference to the logic page rectangle, which has to be adjusted. - @param _rPrevwPgSwRect + @param _rPreviewPgSwRect input parameter - constant reference to the corresponding preview page rectangle; needed to determine the visible part of the logic page rectangle. - @param _rPrevwWinSize + @param _rPreviewWinSize input paramter - constant reference to the preview window size in TWIP; needed to determine the visible part of the logic page rectangle */ void AdjustLogicPgRectToVisibleArea( SwRect& _iorLogicPgSwRect, - const SwRect& _rPrevwPgSwRect, - const Size& _rPrevwWinSize ); + const SwRect& _rPreviewPgSwRect, + const Size& _rPreviewWinSize ); public: SwAccPreviewData(); ~SwAccPreviewData(); void Update( const SwAccessibleMap& rAccMap, - const std::vector<PrevwPage*>& _rPrevwPages, + const std::vector<PreviewPage*>& _rPreviewPages, const Fraction& _rScale, const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ); + const Size& _rPreviewWinSize ); void InvalidateSelection( const SwPageFrm* _pSelectedPageFrm ); @@ -599,10 +599,10 @@ SwAccPreviewData::~SwAccPreviewData() } void SwAccPreviewData::Update( const SwAccessibleMap& rAccMap, - const std::vector<PrevwPage*>& _rPrevwPages, + const std::vector<PreviewPage*>& _rPreviewPages, const Fraction& _rScale, const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ) + const Size& _rPreviewWinSize ) { // store preview scaling, maximal preview page size and selected page maScale = _rScale; @@ -616,15 +616,15 @@ void SwAccPreviewData::Update( const SwAccessibleMap& rAccMap, // loop on preview pages to calculate <maPreviewRects>, <maLogicRects> and // <maVisArea> - for ( std::vector<PrevwPage*>::const_iterator aPageIter = _rPrevwPages.begin(); - aPageIter != _rPrevwPages.end(); + for ( std::vector<PreviewPage*>::const_iterator aPageIter = _rPreviewPages.begin(); + aPageIter != _rPreviewPages.end(); ++aPageIter ) { aPage = (*aPageIter)->pPage; // add preview page rectangle to <maPreviewRects> - Rectangle aPrevwPgRect( (*aPageIter)->aPrevwWinPos, (*aPageIter)->aPageSize ); - maPreviewRects.push_back( aPrevwPgRect ); + Rectangle aPreviewPgRect( (*aPageIter)->aPreviewWinPos, (*aPageIter)->aPageSize ); + maPreviewRects.push_back( aPreviewPgRect ); // add logic page rectangle to <maLogicRects> SwRect aLogicPgSwRect( aPage.GetBox( rAccMap ) ); @@ -636,8 +636,8 @@ void SwAccPreviewData::Update( const SwAccessibleMap& rAccMap, if ( !(*aPageIter)->pPage->IsEmptyPage() ) { AdjustLogicPgRectToVisibleArea( aLogicPgSwRect, - SwRect( aPrevwPgRect ), - _rPrevwWinSize ); + SwRect( aPreviewPgRect ), + _rPreviewWinSize ); } if ( maVisArea.IsEmpty() ) maVisArea = aLogicPgSwRect; @@ -700,30 +700,30 @@ void SwAccPreviewData::DisposePage(const SwPageFrm *pPageFrm ) // adjust logic page retangle to its visible part void SwAccPreviewData::AdjustLogicPgRectToVisibleArea( SwRect& _iorLogicPgSwRect, - const SwRect& _rPrevwPgSwRect, - const Size& _rPrevwWinSize ) + const SwRect& _rPreviewPgSwRect, + const Size& _rPreviewWinSize ) { // determine preview window rectangle - const SwRect aPrevwWinSwRect( Point( 0, 0 ), _rPrevwWinSize ); + const SwRect aPreviewWinSwRect( Point( 0, 0 ), _rPreviewWinSize ); // calculate visible preview page rectangle - SwRect aVisPrevwPgSwRect( _rPrevwPgSwRect ); - aVisPrevwPgSwRect.Intersection( aPrevwWinSwRect ); + SwRect aVisPreviewPgSwRect( _rPreviewPgSwRect ); + aVisPreviewPgSwRect.Intersection( aPreviewWinSwRect ); // adjust logic page rectangle SwTwips nTmpDiff; // left - nTmpDiff = aVisPrevwPgSwRect.Left() - _rPrevwPgSwRect.Left(); + nTmpDiff = aVisPreviewPgSwRect.Left() - _rPreviewPgSwRect.Left(); if ( nTmpDiff > 0 ) _iorLogicPgSwRect.Left( _iorLogicPgSwRect.Left() + nTmpDiff ); // top - nTmpDiff = aVisPrevwPgSwRect.Top() - _rPrevwPgSwRect.Top(); + nTmpDiff = aVisPreviewPgSwRect.Top() - _rPreviewPgSwRect.Top(); if ( nTmpDiff > 0 ) _iorLogicPgSwRect.Top( _iorLogicPgSwRect.Top() + nTmpDiff ); // right - nTmpDiff = _rPrevwPgSwRect.Right() - aVisPrevwPgSwRect.Right(); + nTmpDiff = _rPreviewPgSwRect.Right() - aVisPreviewPgSwRect.Right(); if ( nTmpDiff > 0 ) _iorLogicPgSwRect.Right( _iorLogicPgSwRect.Right() - nTmpDiff ); // bottom - nTmpDiff = _rPrevwPgSwRect.Bottom() - aVisPrevwPgSwRect.Bottom(); + nTmpDiff = _rPreviewPgSwRect.Bottom() - aVisPreviewPgSwRect.Bottom(); if ( nTmpDiff > 0 ) _iorLogicPgSwRect.Bottom( _iorLogicPgSwRect.Bottom() - nTmpDiff ); } @@ -1299,15 +1299,15 @@ uno::Reference< XAccessible > SwAccessibleMap::GetDocumentView( ) } uno::Reference<XAccessible> SwAccessibleMap::GetDocumentPreview( - const std::vector<PrevwPage*>& _rPrevwPages, + const std::vector<PreviewPage*>& _rPreviewPages, const Fraction& _rScale, const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ) + const Size& _rPreviewWinSize ) { // create & update preview data object if( mpPreview == NULL ) mpPreview = new SwAccPreviewData(); - mpPreview->Update( *this, _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize ); + mpPreview->Update( *this, _rPreviewPages, _rScale, _pSelectedPageFrm, _rPreviewWinSize ); uno::Reference<XAccessible> xAcc = _GetDocumentView( true ); return xAcc; @@ -2178,15 +2178,15 @@ sal_Int32 SwAccessibleMap::GetChildIndex( const SwFrm& rParentFrm, return nIndex; } -void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages, +void SwAccessibleMap::UpdatePreview( const std::vector<PreviewPage*>& _rPreviewPages, const Fraction& _rScale, const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ) + const Size& _rPreviewWinSize ) { OSL_ENSURE( GetShell()->IsPreView(), "no preview?" ); OSL_ENSURE( mpPreview != NULL, "no preview data?" ); - mpPreview->Update( *this, _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize ); + mpPreview->Update( *this, _rPreviewPages, _rScale, _pSelectedPageFrm, _rPreviewWinSize ); // propagate change of VisArea through the document's // accessibility tree; this will also send appropriate scroll @@ -2524,14 +2524,14 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint, _orMapMode = aMapMode; } -Size SwAccessibleMap::GetPreViewPageSize( sal_uInt16 _nPrevwPageNum ) const +Size SwAccessibleMap::GetPreViewPageSize( sal_uInt16 _nPreviewPageNum ) const { OSL_ENSURE( mpVSh->IsPreView(), "no page preview accessible." ); OSL_ENSURE( mpVSh->IsPreView() && ( mpPreview != NULL ), "missing accessible preview data at page preview" ); if ( mpVSh->IsPreView() && ( mpPreview != NULL ) ) { - return mpVSh->PagePreviewLayout()->GetPrevwPageSizeByPageNum( _nPrevwPageNum ); + return mpVSh->PagePreviewLayout()->GetPreviewPageSizeByPageNum( _nPreviewPageNum ); } else { diff --git a/sw/source/core/inc/prevwpage.hxx b/sw/source/core/inc/prevwpage.hxx index 87c4006a65f1..4863cb7fbcb8 100644 --- a/sw/source/core/inc/prevwpage.hxx +++ b/sw/source/core/inc/prevwpage.hxx @@ -27,23 +27,23 @@ class SwPageFrm; /** data structure for a preview page in the current preview layout */ -struct PrevwPage +struct PreviewPage { const SwPageFrm* pPage; bool bVisible; Size aPageSize; - Point aPrevwWinPos; + Point aPreviewWinPos; Point aLogicPos; Point aMapOffset; - inline PrevwPage(); + inline PreviewPage(); }; -inline PrevwPage::PrevwPage() +inline PreviewPage::PreviewPage() : pPage( 0 ), bVisible( false ), aPageSize( Size(0,0) ), - aPrevwWinPos( Point(0,0) ), + aPreviewWinPos( Point(0,0) ), aLogicPos( Point(0,0) ), aMapOffset( Point(0,0) ) {}; diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index bff6effe6609..87c39cc93ae4 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -47,7 +47,7 @@ class SdrObject; class Fraction; class SwPrintData; class SwPagePreviewLayout; -struct PrevwPage; +struct PreviewPage; class SwTxtFrm; // --> OD #i76669# namespace sdr { namespace contact { @@ -96,7 +96,7 @@ class SwViewImp sal_uInt16 nRestoreActions ; //Die Anzahl der zu restaurierenden Actions (UNO) SwRect aSmoothRect; - SwPagePreviewLayout* mpPgPrevwLayout; + SwPagePreviewLayout* mpPgPreviewLayout; /** Returns if printer shall be stopped. @@ -232,7 +232,7 @@ public: inline SwPagePreviewLayout* PagePreviewLayout() { - return mpPgPrevwLayout; + return mpPgPreviewLayout; } // Is this view accessible? @@ -276,10 +276,10 @@ public: // update data for accessible preview // change method signature due to new page preview functionality - void UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages, + void UpdateAccessiblePreview( const std::vector<PreviewPage*>& _rPreviewPages, const Fraction& _rScale, const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ); + const Size& _rPreviewWinSize ); void InvalidateAccessiblePreViewSelection( sal_uInt16 nSelPage ); diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index e614499f0107..ec3fb79349be 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -69,7 +69,7 @@ void SwPagePreviewLayout::_Clear() maWinSize.Height() = 0; mnCols = mnRows = 0; - _ClearPrevwLayoutSizes(); + _ClearPreviewLayoutSizes(); mbDoesLayoutRowsFitIntoWindow = false; mbDoesLayoutColsFitIntoWindow = false; @@ -83,19 +83,19 @@ void SwPagePreviewLayout::_Clear() maPaintPreviewDocOffset.Y() = 0; maAdditionalPaintOffset.X() = 0; maAdditionalPaintOffset.Y() = 0; - maPaintedPrevwDocRect.Left() = 0; - maPaintedPrevwDocRect.Top() = 0; - maPaintedPrevwDocRect.Right() = 0; - maPaintedPrevwDocRect.Bottom() = 0; + maPaintedPreviewDocRect.Left() = 0; + maPaintedPreviewDocRect.Top() = 0; + maPaintedPreviewDocRect.Right() = 0; + maPaintedPreviewDocRect.Bottom() = 0; mnSelectedPageNum = 0; - _ClearPrevwPageData(); + _ClearPreviewPageData(); // OD 07.11.2003 #i22014# mbInPaint = false; mbNewLayoutDuringPaint = false; } -void SwPagePreviewLayout::_ClearPrevwLayoutSizes() +void SwPagePreviewLayout::_ClearPreviewLayoutSizes() { mnPages = 0; @@ -104,25 +104,25 @@ void SwPagePreviewLayout::_ClearPrevwLayoutSizes() maPreviewDocRect.Left() = maPreviewDocRect.Top() = 0; maPreviewDocRect.Right() = maPreviewDocRect.Bottom() = 0; mnColWidth = mnRowHeight = 0; - mnPrevwLayoutWidth = mnPrevwLayoutHeight = 0; + mnPreviewLayoutWidth = mnPreviewLayoutHeight = 0; } -void SwPagePreviewLayout::_ClearPrevwPageData() +void SwPagePreviewLayout::_ClearPreviewPageData() { - for ( std::vector<PrevwPage*>::iterator aPageDelIter = maPrevwPages.begin(); - aPageDelIter != maPrevwPages.end(); + for ( std::vector<PreviewPage*>::iterator aPageDelIter = maPreviewPages.begin(); + aPageDelIter != maPreviewPages.end(); ++aPageDelIter ) { delete (*aPageDelIter); } - maPrevwPages.clear(); + maPreviewPages.clear(); } /** calculate page preview layout sizes OD 18.12.2002 #103492# */ -void SwPagePreviewLayout::_CalcPrevwLayoutSizes() +void SwPagePreviewLayout::_CalcPreviewLayoutSizes() { // calculate maximal page size; calculate also number of pages @@ -149,14 +149,14 @@ void SwPagePreviewLayout::_CalcPrevwLayoutSizes() mnRowHeight = maMaxPageSize.Height() + mnYFree; // calculate and set preview layout width and height - mnPrevwLayoutWidth = mnCols * mnColWidth + mnXFree; - mnPrevwLayoutHeight = mnRows * mnRowHeight + mnYFree; + mnPreviewLayoutWidth = mnCols * mnColWidth + mnXFree; + mnPreviewLayoutHeight = mnRows * mnRowHeight + mnYFree; // calculate document rectangle in preview layout { Size aDocSize; // document width - aDocSize.Width() = mnPrevwLayoutWidth; + aDocSize.Width() = mnPreviewLayoutWidth; // document height // determine number of rows needed for <nPages> in preview layout @@ -208,7 +208,7 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols, mnCols = _nCols; mnRows = _nRows; - _CalcPrevwLayoutSizes(); + _CalcPreviewLayoutSizes(); // validate layout information mbLayoutInfoValid = true; @@ -218,8 +218,8 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols, // calculate scaling MapMode aMapMode( MAP_TWIP ); Size aWinSize = mrParentViewShell.GetOut()->PixelToLogic( _rPxWinSize, aMapMode ); - Fraction aXScale( aWinSize.Width(), mnPrevwLayoutWidth ); - Fraction aYScale( aWinSize.Height(), mnPrevwLayoutHeight ); + Fraction aXScale( aWinSize.Width(), mnPreviewLayoutWidth ); + Fraction aYScale( aWinSize.Height(), mnPreviewLayoutHeight ); if( aXScale < aYScale ) aYScale = aXScale; { @@ -277,8 +277,8 @@ bool SwPagePreviewLayout::ReInit() return false; } - _ClearPrevwLayoutSizes(); - _CalcPrevwLayoutSizes(); + _ClearPreviewLayoutSizes(); + _CalcPreviewLayoutSizes(); return true; } @@ -426,17 +426,17 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum, _CalcAdditionalPaintOffset(); // determine rectangle to be painted from document preview - _CalcDocPrevwPaintRect(); - _orDocPreviewPaintRect = maPaintedPrevwDocRect; + _CalcDocPreviewPaintRect(); + _orDocPreviewPaintRect = maPaintedPreviewDocRect; // OD 20.01.2003 #103492# - shift visible preview document area to the left, // if on the right is an area left blank. if ( !mbDoesLayoutColsFitIntoWindow && - maPaintedPrevwDocRect.GetWidth() < maWinSize.Width() ) + maPaintedPreviewDocRect.GetWidth() < maWinSize.Width() ) { - maPaintedPrevwDocRect.Move( - -(maWinSize.Width() - maPaintedPrevwDocRect.GetWidth()), 0 ); - Prepare( 0, maPaintedPrevwDocRect.TopLeft(), + maPaintedPreviewDocRect.Move( + -(maWinSize.Width() - maPaintedPreviewDocRect.GetWidth()), 0 ); + Prepare( 0, maPaintedPreviewDocRect.TopLeft(), _rPxWinSize, _onStartPageNum, _orDocPreviewPaintRect, _bStartWithPageAtFirstCol ); } @@ -444,25 +444,25 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum, // OD 20.01.2003 #103492# - shift visible preview document area to the top, // if on the botton is an area left blank. if ( mbBookPreviewModeToggled && - maPaintedPrevwDocRect.Bottom() == maPreviewDocRect.Bottom() && - maPaintedPrevwDocRect.GetHeight() < maWinSize.Height() ) + maPaintedPreviewDocRect.Bottom() == maPreviewDocRect.Bottom() && + maPaintedPreviewDocRect.GetHeight() < maWinSize.Height() ) { if ( mbDoesLayoutRowsFitIntoWindow ) { - if ( maPaintedPrevwDocRect.GetHeight() < mnPrevwLayoutHeight) + if ( maPaintedPreviewDocRect.GetHeight() < mnPreviewLayoutHeight) { - maPaintedPrevwDocRect.Move( - 0, -(mnPrevwLayoutHeight - maPaintedPrevwDocRect.GetHeight()) ); - Prepare( 0, maPaintedPrevwDocRect.TopLeft(), + maPaintedPreviewDocRect.Move( + 0, -(mnPreviewLayoutHeight - maPaintedPreviewDocRect.GetHeight()) ); + Prepare( 0, maPaintedPreviewDocRect.TopLeft(), _rPxWinSize, _onStartPageNum, _orDocPreviewPaintRect, _bStartWithPageAtFirstCol ); } } else { - maPaintedPrevwDocRect.Move( - 0, -(maWinSize.Height() - maPaintedPrevwDocRect.GetHeight()) ); - Prepare( 0, maPaintedPrevwDocRect.TopLeft(), + maPaintedPreviewDocRect.Move( + 0, -(maWinSize.Height() - maPaintedPreviewDocRect.GetHeight()) ); + Prepare( 0, maPaintedPreviewDocRect.TopLeft(), _rPxWinSize, _onStartPageNum, _orDocPreviewPaintRect, _bStartWithPageAtFirstCol ); } @@ -493,11 +493,11 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum, */ void SwPagePreviewLayout::_CalcAdditionalPaintOffset() { - if ( mnPrevwLayoutWidth <= maWinSize.Width() && + if ( mnPreviewLayoutWidth <= maWinSize.Width() && maPaintStartPageOffset.X() <= 0 ) { mbDoesLayoutColsFitIntoWindow = true; - maAdditionalPaintOffset.X() = (maWinSize.Width() - mnPrevwLayoutWidth) / 2; + maAdditionalPaintOffset.X() = (maWinSize.Width() - mnPreviewLayoutWidth) / 2; } else { @@ -505,11 +505,11 @@ void SwPagePreviewLayout::_CalcAdditionalPaintOffset() maAdditionalPaintOffset.X() = 0; } - if ( mnPrevwLayoutHeight <= maWinSize.Height() && + if ( mnPreviewLayoutHeight <= maWinSize.Height() && maPaintStartPageOffset.Y() <= 0 ) { mbDoesLayoutRowsFitIntoWindow = true; - maAdditionalPaintOffset.Y() = (maWinSize.Height() - mnPrevwLayoutHeight) / 2; + maAdditionalPaintOffset.Y() = (maWinSize.Height() - mnPreviewLayoutHeight) / 2; } else { @@ -522,25 +522,25 @@ void SwPagePreviewLayout::_CalcAdditionalPaintOffset() OD 12.12.2002 #103492# */ -void SwPagePreviewLayout::_CalcDocPrevwPaintRect() +void SwPagePreviewLayout::_CalcDocPreviewPaintRect() { Point aTopLeftPos = maPaintPreviewDocOffset; - maPaintedPrevwDocRect.SetPos( aTopLeftPos ); + maPaintedPreviewDocRect.SetPos( aTopLeftPos ); Size aSize; if ( mbDoesLayoutColsFitIntoWindow ) - aSize.Width() = std::min( mnPrevwLayoutWidth, + aSize.Width() = std::min( mnPreviewLayoutWidth, maPreviewDocRect.GetWidth() - aTopLeftPos.X() ); else aSize.Width() = std::min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(), maWinSize.Width() - maAdditionalPaintOffset.X() ); if ( mbDoesLayoutRowsFitIntoWindow ) - aSize.Height() = std::min( mnPrevwLayoutHeight, + aSize.Height() = std::min( mnPreviewLayoutHeight, maPreviewDocRect.GetHeight() - aTopLeftPos.Y() ); else aSize.Height() = std::min( maPreviewDocRect.GetHeight() - aTopLeftPos.Y(), maWinSize.Height() - maAdditionalPaintOffset.Y() ); - maPaintedPrevwDocRect.SetSize( aSize ); + maPaintedPreviewDocRect.SetSize( aSize ); } /** calculate preview pages @@ -549,7 +549,7 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect() */ void SwPagePreviewLayout::_CalcPreviewPages() { - _ClearPrevwPageData(); + _ClearPreviewPageData(); if ( mbNoPageVisible ) return; @@ -597,12 +597,12 @@ void SwPagePreviewLayout::_CalcPreviewPages() if ( nCurrCol < mnPaintStartCol ) { // calculate data of unvisible page needed for accessibility - PrevwPage* pPrevwPage = new PrevwPage; + PreviewPage* pPreviewPage = new PreviewPage; Point aCurrAccOffset = aCurrPaintOffset - Point( (mnPaintStartCol-nCurrCol) * mnColWidth, 0 ); - _CalcPreviewDataForPage( *(pPage), aCurrAccOffset, pPrevwPage ); - pPrevwPage->bVisible = false; - maPrevwPages.push_back( pPrevwPage ); + _CalcPreviewDataForPage( *(pPage), aCurrAccOffset, pPreviewPage ); + pPreviewPage->bVisible = false; + maPreviewPages.push_back( pPreviewPage ); // continue with next page and next column pPage = static_cast<const SwPageFrm*>(pPage->GetNext()); ++nCurrCol; @@ -626,18 +626,18 @@ void SwPagePreviewLayout::_CalcPreviewPages() } // calculate data of visible page - PrevwPage* pPrevwPage = new PrevwPage; - _CalcPreviewDataForPage( *(pPage), aCurrPaintOffset, pPrevwPage ); - pPrevwPage->bVisible = true; - maPrevwPages.push_back( pPrevwPage ); + PreviewPage* pPreviewPage = new PreviewPage; + _CalcPreviewDataForPage( *(pPage), aCurrPaintOffset, pPreviewPage ); + pPreviewPage->bVisible = true; + maPreviewPages.push_back( pPreviewPage ); } else { // calculate data of unvisible page needed for accessibility - PrevwPage* pPrevwPage = new PrevwPage; - _CalcPreviewDataForPage( *(pPage), aCurrPaintOffset, pPrevwPage ); - pPrevwPage->bVisible = false; - maPrevwPages.push_back( pPrevwPage ); + PreviewPage* pPreviewPage = new PreviewPage; + _CalcPreviewDataForPage( *(pPage), aCurrPaintOffset, pPreviewPage ); + pPreviewPage->bVisible = false; + maPreviewPages.push_back( pPreviewPage ); } // prepare data for next loop @@ -663,38 +663,38 @@ void SwPagePreviewLayout::_CalcPreviewPages() OD 13.12.2002 #103492# */ bool SwPagePreviewLayout::_CalcPreviewDataForPage( const SwPageFrm& _rPage, - const Point& _rPrevwOffset, - PrevwPage* _opPrevwPage ) + const Point& _rPreviewOffset, + PreviewPage* _opPreviewPage ) { // page frame - _opPrevwPage->pPage = &_rPage; + _opPreviewPage->pPage = &_rPage; // size of page frame if ( _rPage.IsEmptyPage() ) { if ( _rPage.GetPhyPageNum() % 2 == 0 ) - _opPrevwPage->aPageSize = _rPage.GetPrev()->Frm().SSize(); + _opPreviewPage->aPageSize = _rPage.GetPrev()->Frm().SSize(); else - _opPrevwPage->aPageSize = _rPage.GetNext()->Frm().SSize(); + _opPreviewPage->aPageSize = _rPage.GetNext()->Frm().SSize(); } else - _opPrevwPage->aPageSize = _rPage.Frm().SSize(); + _opPreviewPage->aPageSize = _rPage.Frm().SSize(); // position of page in preview window - Point aPrevwWinOffset( _rPrevwOffset ); - if ( _opPrevwPage->aPageSize.Width() < maMaxPageSize.Width() ) - aPrevwWinOffset.X() += ( maMaxPageSize.Width() - _opPrevwPage->aPageSize.Width() ) / 2; - if ( _opPrevwPage->aPageSize.Height() < maMaxPageSize.Height() ) - aPrevwWinOffset.Y() += ( maMaxPageSize.Height() - _opPrevwPage->aPageSize.Height() ) / 2; - _opPrevwPage->aPrevwWinPos = aPrevwWinOffset; + Point aPreviewWinOffset( _rPreviewOffset ); + if ( _opPreviewPage->aPageSize.Width() < maMaxPageSize.Width() ) + aPreviewWinOffset.X() += ( maMaxPageSize.Width() - _opPreviewPage->aPageSize.Width() ) / 2; + if ( _opPreviewPage->aPageSize.Height() < maMaxPageSize.Height() ) + aPreviewWinOffset.Y() += ( maMaxPageSize.Height() - _opPreviewPage->aPageSize.Height() ) / 2; + _opPreviewPage->aPreviewWinPos = aPreviewWinOffset; // logic position of page and mapping offset for paint if ( _rPage.IsEmptyPage() ) { - _opPrevwPage->aLogicPos = _opPrevwPage->aPrevwWinPos; - _opPrevwPage->aMapOffset = Point( 0, 0 ); + _opPreviewPage->aLogicPos = _opPreviewPage->aPreviewWinPos; + _opPreviewPage->aMapOffset = Point( 0, 0 ); } else { - _opPrevwPage->aLogicPos = _rPage.Frm().Pos(); - _opPrevwPage->aMapOffset = _opPrevwPage->aPrevwWinPos - _opPrevwPage->aLogicPos; + _opPreviewPage->aLogicPos = _rPage.Frm().Pos(); + _opPreviewPage->aMapOffset = _opPreviewPage->aPreviewWinPos - _opPreviewPage->aLogicPos; } return true; @@ -749,16 +749,16 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale( const Fraction& _aOldScale, const Size& _aNewWinSize ) const { - Point aNewPaintStartPos = maPaintedPrevwDocRect.TopLeft(); + Point aNewPaintStartPos = maPaintedPreviewDocRect.TopLeft(); if ( _aNewScale < _aOldScale ) { // increase paint width by moving start point to left. - if ( mnPrevwLayoutWidth < _aNewWinSize.Width() ) + if ( mnPreviewLayoutWidth < _aNewWinSize.Width() ) aNewPaintStartPos.X() = 0; - else if ( maPaintedPrevwDocRect.GetWidth() < _aNewWinSize.Width() ) + else if ( maPaintedPreviewDocRect.GetWidth() < _aNewWinSize.Width() ) { aNewPaintStartPos.X() -= - (_aNewWinSize.Width() - maPaintedPrevwDocRect.GetWidth()) / 2; + (_aNewWinSize.Width() - maPaintedPreviewDocRect.GetWidth()) / 2; if ( aNewPaintStartPos.X() < 0) aNewPaintStartPos.X() = 0; } @@ -766,15 +766,15 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale( if ( !mbDoesLayoutRowsFitIntoWindow ) { // increase paint height by moving start point to top. - if ( mnPrevwLayoutHeight < _aNewWinSize.Height() ) + if ( mnPreviewLayoutHeight < _aNewWinSize.Height() ) { aNewPaintStartPos.Y() = ( (mnPaintStartRow - 1) * mnRowHeight ); } - else if ( maPaintedPrevwDocRect.GetHeight() < _aNewWinSize.Height() ) + else if ( maPaintedPreviewDocRect.GetHeight() < _aNewWinSize.Height() ) { aNewPaintStartPos.Y() -= - (_aNewWinSize.Height() - maPaintedPrevwDocRect.GetHeight()) / 2; + (_aNewWinSize.Height() - maPaintedPreviewDocRect.GetHeight()) / 2; if ( aNewPaintStartPos.Y() < 0) aNewPaintStartPos.Y() = 0; } @@ -783,18 +783,18 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale( else { // decrease paint width by moving start point to right - if ( maPaintedPrevwDocRect.GetWidth() > _aNewWinSize.Width() ) + if ( maPaintedPreviewDocRect.GetWidth() > _aNewWinSize.Width() ) aNewPaintStartPos.X() += - (maPaintedPrevwDocRect.GetWidth() - _aNewWinSize.Width()) / 2; + (maPaintedPreviewDocRect.GetWidth() - _aNewWinSize.Width()) / 2; // decrease paint height by moving start point to bottom - if ( maPaintedPrevwDocRect.GetHeight() > _aNewWinSize.Height() ) + if ( maPaintedPreviewDocRect.GetHeight() > _aNewWinSize.Height() ) { aNewPaintStartPos.Y() += - (maPaintedPrevwDocRect.GetHeight() - _aNewWinSize.Height()) / 2; + (maPaintedPreviewDocRect.GetHeight() - _aNewWinSize.Height()) / 2; // check, if new y-position is outside document preview if ( aNewPaintStartPos.Y() > maPreviewDocRect.Bottom() ) aNewPaintStartPos.Y() = - std::max( 0L, maPreviewDocRect.Bottom() - mnPrevwLayoutHeight ); + std::max( 0L, maPreviewDocRect.Bottom() - mnPreviewLayoutHeight ); } } @@ -807,8 +807,8 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale( */ bool SwPagePreviewLayout::IsPageVisible( const sal_uInt16 _nPageNum ) const { - const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum ); - return pPrevwPage && pPrevwPage->bVisible; + const PreviewPage* pPreviewPage = _GetPreviewPageByPageNum( _nPageNum ); + return pPreviewPage && pPreviewPage->bVisible; } /** calculate data to bring new selected page into view. @@ -908,23 +908,23 @@ bool SwPagePreviewLayout::CalcStartValuesForSelectedPageMove( } /** checks, if given position is inside a shown document page */ -struct PrevwPosInsidePagePred +struct PreviewPosInsidePagePred { - const Point mnPrevwPos; - PrevwPosInsidePagePred( const Point _nPrevwPos ) : mnPrevwPos( _nPrevwPos ) {}; - bool operator() ( const PrevwPage* _pPrevwPage ) + const Point mnPreviewPos; + PreviewPosInsidePagePred( const Point _nPreviewPos ) : mnPreviewPos( _nPreviewPos ) {}; + bool operator() ( const PreviewPage* _pPreviewPage ) { - if ( _pPrevwPage->bVisible ) + if ( _pPreviewPage->bVisible ) { - Rectangle aPrevwPageRect( _pPrevwPage->aPrevwWinPos, _pPrevwPage->aPageSize ); - return aPrevwPageRect.IsInside( mnPrevwPos ) ? true : false; + Rectangle aPreviewPageRect( _pPreviewPage->aPreviewWinPos, _pPreviewPage->aPageSize ); + return aPreviewPageRect.IsInside( mnPreviewPos ) ? true : false; } else return false; } }; -bool SwPagePreviewLayout::IsPrevwPosInDocPrevwPage( const Point _aPrevwPos, +bool SwPagePreviewLayout::IsPreviewPosInDocPreviewPage( const Point _aPreviewPos, Point& _orDocPos, bool& _obPosInEmptyPage, sal_uInt16& _onPageNum ) const @@ -937,17 +937,17 @@ bool SwPagePreviewLayout::IsPrevwPosInDocPrevwPage( const Point _aPrevwPos, _obPosInEmptyPage = false; _onPageNum = 0; - std::vector<PrevwPage*>::const_iterator aFoundPrevwPageIter = - std::find_if( maPrevwPages.begin(), maPrevwPages.end(), - PrevwPosInsidePagePred( _aPrevwPos ) ); + std::vector<PreviewPage*>::const_iterator aFoundPreviewPageIter = + std::find_if( maPreviewPages.begin(), maPreviewPages.end(), + PreviewPosInsidePagePred( _aPreviewPos ) ); - if ( aFoundPrevwPageIter == maPrevwPages.end() ) + if ( aFoundPreviewPageIter == maPreviewPages.end() ) // given preview position outside a document page. bIsPosInsideDoc = false; else { - _onPageNum = (*aFoundPrevwPageIter)->pPage->GetPhyPageNum(); - if ( (*aFoundPrevwPageIter)->pPage->IsEmptyPage() ) + _onPageNum = (*aFoundPreviewPageIter)->pPage->GetPhyPageNum(); + if ( (*aFoundPreviewPageIter)->pPage->IsEmptyPage() ) { // given preview position inside an empty page bIsPosInsideDoc = false; @@ -957,9 +957,9 @@ bool SwPagePreviewLayout::IsPrevwPosInDocPrevwPage( const Point _aPrevwPos, { // given preview position inside a normal page bIsPosInsideDoc = true; - _orDocPos = _aPrevwPos - - (*aFoundPrevwPageIter)->aPrevwWinPos + - (*aFoundPrevwPageIter)->aLogicPos; + _orDocPos = _aPreviewPos - + (*aFoundPreviewPageIter)->aPreviewWinPos + + (*aFoundPreviewPageIter)->aLogicPos; } } @@ -973,28 +973,28 @@ SwTwips SwPagePreviewLayout::GetWinPagesScrollAmount( SwTwips nScrollAmount; if ( mbDoesLayoutRowsFitIntoWindow ) { - nScrollAmount = (mnPrevwLayoutHeight - mnYFree) * _nWinPagesToScroll; + nScrollAmount = (mnPreviewLayoutHeight - mnYFree) * _nWinPagesToScroll; } else - nScrollAmount = _nWinPagesToScroll * maPaintedPrevwDocRect.GetHeight(); + nScrollAmount = _nWinPagesToScroll * maPaintedPreviewDocRect.GetHeight(); // check, if preview layout size values are valid. // If not, the checks for an adjustment of the scroll amount aren't useful. if ( mbLayoutSizesValid ) { - if ( (maPaintedPrevwDocRect.Top() + nScrollAmount) <= 0 ) - nScrollAmount = -maPaintedPrevwDocRect.Top(); + if ( (maPaintedPreviewDocRect.Top() + nScrollAmount) <= 0 ) + nScrollAmount = -maPaintedPreviewDocRect.Top(); // correct scroll amount if ( nScrollAmount > 0 && - maPaintedPrevwDocRect.Bottom() == maPreviewDocRect.Bottom() + maPaintedPreviewDocRect.Bottom() == maPreviewDocRect.Bottom() ) { nScrollAmount = 0; } else { - while ( (maPaintedPrevwDocRect.Top() + nScrollAmount + mnYFree) >= maPreviewDocRect.GetHeight() ) + while ( (maPaintedPreviewDocRect.Top() + nScrollAmount + mnYFree) >= maPreviewDocRect.GetHeight() ) { nScrollAmount -= mnRowHeight; } @@ -1042,25 +1042,25 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const OutputDevice* pOutputDev = mrParentViewShell.GetOut(); // prepare paint - if ( maPrevwPages.size() > 0 ) + if ( maPreviewPages.size() > 0 ) { mrParentViewShell.Imp()->bFirstPageInvalid = sal_False; mrParentViewShell.Imp()->pFirstVisPage = - const_cast<SwPageFrm*>(maPrevwPages[0]->pPage); + const_cast<SwPageFrm*>(maPreviewPages[0]->pPage); } // paint preview background { SwRegionRects aPreviewBackgrdRegion( _aOutRect ); // calculate preview background rectangles - for ( std::vector<PrevwPage*>::const_iterator aPageIter = maPrevwPages.begin(); - aPageIter != maPrevwPages.end(); + for ( std::vector<PreviewPage*>::const_iterator aPageIter = maPreviewPages.begin(); + aPageIter != maPreviewPages.end(); ++aPageIter ) { if ( (*aPageIter)->bVisible ) { aPreviewBackgrdRegion -= - SwRect( (*aPageIter)->aPrevwWinPos, (*aPageIter)->aPageSize ); + SwRect( (*aPageIter)->aPreviewWinPos, (*aPageIter)->aPageSize ); } } // paint preview background rectangles @@ -1075,8 +1075,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const const Font& rEmptyPgFont = SwPageFrm::GetEmptyPageFont(); - for ( std::vector<PrevwPage*>::const_iterator aPageIter = maPrevwPages.begin(); - aPageIter != maPrevwPages.end(); + for ( std::vector<PreviewPage*>::const_iterator aPageIter = maPreviewPages.begin(); + aPageIter != maPreviewPages.end(); ++aPageIter ) { if ( !(*aPageIter)->bVisible ) @@ -1154,7 +1154,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const { // update at accessiblilty interface mrParentViewShell.Imp()->UpdateAccessiblePreview( - maPrevwPages, + maPreviewPages, aMapMode.GetScaleX(), mrLayoutRootFrm.GetPageByPageNum( mnSelectedPageNum ), maWinSize ); @@ -1191,16 +1191,16 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const // environment and parameter ok // prepare paint - if ( maPrevwPages.size() > 0 ) + if ( maPreviewPages.size() > 0 ) { mrParentViewShell.Imp()->bFirstPageInvalid = sal_False; mrParentViewShell.Imp()->pFirstVisPage = - const_cast<SwPageFrm*>(maPrevwPages[0]->pPage); + const_cast<SwPageFrm*>(maPreviewPages[0]->pPage); } // invalidate visible pages, which overlap the invalid core rectangle - for ( std::vector<PrevwPage*>::const_iterator aPageIter = maPrevwPages.begin(); - aPageIter != maPrevwPages.end(); + for ( std::vector<PreviewPage*>::const_iterator aPageIter = maPreviewPages.begin(); + aPageIter != maPreviewPages.end(); ++aPageIter ) { if ( !(*aPageIter)->bVisible ) @@ -1210,11 +1210,11 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const if ( _aInvalidCoreRect.IsOver( aPageRect ) ) { aPageRect.Intersection( _aInvalidCoreRect ); - Rectangle aInvalidPrevwRect = aPageRect; - aInvalidPrevwRect.SetPos( aInvalidPrevwRect.TopLeft() - + Rectangle aInvalidPreviewRect = aPageRect; + aInvalidPreviewRect.SetPos( aInvalidPreviewRect.TopLeft() - (*aPageIter)->aLogicPos + - (*aPageIter)->aPrevwWinPos ); - mrParentViewShell.GetWin()->Invalidate( aInvalidPrevwRect ); + (*aPageIter)->aPreviewWinPos ); + mrParentViewShell.GetWin()->Invalidate( aInvalidPreviewRect ); } } } @@ -1224,7 +1224,7 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const OD 17.12.2002 #103492# */ void SwPagePreviewLayout::_PaintSelectMarkAtPage( - const PrevwPage* _aSelectedPrevwPage ) const + const PreviewPage* _aSelectedPreviewPage ) const { OutputDevice* pOutputDev = mrParentViewShell.GetOut(); MapMode aMapMode( pOutputDev->GetMapMode() ); @@ -1242,12 +1242,12 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage( aSelPgLineColor = rSettings.GetHighlightTextColor(); // set needed mapping mode at output device - aMapMode.SetOrigin( _aSelectedPrevwPage->aMapOffset ); + aMapMode.SetOrigin( _aSelectedPreviewPage->aMapOffset ); pOutputDev->SetMapMode( aMapMode ); // calculate page rectangle in pixel coordinates - SwRect aPageRect( _aSelectedPrevwPage->aLogicPos, - _aSelectedPrevwPage->aPageSize ); + SwRect aPageRect( _aSelectedPreviewPage->aLogicPos, + _aSelectedPreviewPage->aPageSize ); // OD 19.02.2003 #107369# - use aligned page rectangle, as it is used for // page border and shadow paint - see <SwPageFrm::PaintBorderAndShadow(..)> ::SwAlignRect( aPageRect, &mrParentViewShell); @@ -1289,12 +1289,12 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage ) mnSelectedPageNum = _nSelectedPage; // re-paint for current selected page in order to umark it. - const PrevwPage* pOldSelectedPrevwPage = _GetPrevwPageByPageNum( nOldSelectedPageNum ); - if ( pOldSelectedPrevwPage && pOldSelectedPrevwPage->bVisible ) + const PreviewPage* pOldSelectedPreviewPage = _GetPreviewPageByPageNum( nOldSelectedPageNum ); + if ( pOldSelectedPreviewPage && pOldSelectedPreviewPage->bVisible ) { // OD 20.02.2003 #107369# - invalidate only areas of selection mark. - SwRect aPageRect( pOldSelectedPrevwPage->aPrevwWinPos, - pOldSelectedPrevwPage->aPageSize ); + SwRect aPageRect( pOldSelectedPreviewPage->aPreviewWinPos, + pOldSelectedPreviewPage->aPageSize ); ::SwAlignRect( aPageRect, &mrParentViewShell); OutputDevice* pOutputDev = mrParentViewShell.GetOut(); Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() ); @@ -1317,9 +1317,9 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage ) } // re-paint for new selected page in order to mark it. - const PrevwPage* pNewSelectedPrevwPage = _GetPrevwPageByPageNum( _nSelectedPage ); - if ( pNewSelectedPrevwPage && pNewSelectedPrevwPage->bVisible ) - _PaintSelectMarkAtPage( pNewSelectedPrevwPage ); + const PreviewPage* pNewSelectedPreviewPage = _GetPreviewPageByPageNum( _nSelectedPage ); + if ( pNewSelectedPreviewPage && pNewSelectedPreviewPage->bVisible ) + _PaintSelectMarkAtPage( pNewSelectedPreviewPage ); } // helper methods @@ -1332,22 +1332,22 @@ struct EqualsPageNumPred { const sal_uInt16 mnPageNum; EqualsPageNumPred( const sal_uInt16 _nPageNum ) : mnPageNum( _nPageNum ) {}; - bool operator() ( const PrevwPage* _pPrevwPage ) + bool operator() ( const PreviewPage* _pPreviewPage ) { - return _pPrevwPage->pPage->GetPhyPageNum() == mnPageNum; + return _pPreviewPage->pPage->GetPhyPageNum() == mnPageNum; } }; -const PrevwPage* SwPagePreviewLayout::_GetPrevwPageByPageNum( const sal_uInt16 _nPageNum ) const +const PreviewPage* SwPagePreviewLayout::_GetPreviewPageByPageNum( const sal_uInt16 _nPageNum ) const { - std::vector<PrevwPage*>::const_iterator aFoundPrevwPageIter = - std::find_if( maPrevwPages.begin(), maPrevwPages.end(), + std::vector<PreviewPage*>::const_iterator aFoundPreviewPageIter = + std::find_if( maPreviewPages.begin(), maPreviewPages.end(), EqualsPageNumPred( _nPageNum ) ); - if ( aFoundPrevwPageIter == maPrevwPages.end() ) + if ( aFoundPreviewPageIter == maPreviewPages.end() ) return 0; else - return (*aFoundPrevwPageIter); + return (*aFoundPreviewPageIter); } /** determine row the page with the given number is in @@ -1398,7 +1398,7 @@ sal_uInt16 SwPagePreviewLayout::GetColOfPage( sal_uInt16 _nPageNum ) const return nCol; } -Size SwPagePreviewLayout::GetPrevwDocSize() const +Size SwPagePreviewLayout::GetPreviewDocSize() const { OSL_ENSURE( PreviewLayoutValid(), "PagePreviewLayout not valid" ); return maPreviewDocRect.GetSize(); @@ -1408,12 +1408,12 @@ Size SwPagePreviewLayout::GetPrevwDocSize() const OD 15.01.2003 #103492# */ -Size SwPagePreviewLayout::GetPrevwPageSizeByPageNum( sal_uInt16 _nPageNum ) const +Size SwPagePreviewLayout::GetPreviewPageSizeByPageNum( sal_uInt16 _nPageNum ) const { - const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum ); - if ( pPrevwPage ) + const PreviewPage* pPreviewPage = _GetPreviewPageByPageNum( _nPageNum ); + if ( pPreviewPage ) { - return pPrevwPage->aPageSize; + return pPreviewPage->aPageSize; } else { @@ -1427,10 +1427,10 @@ Size SwPagePreviewLayout::GetPrevwPageSizeByPageNum( sal_uInt16 _nPageNum ) cons */ sal_uInt16 SwPagePreviewLayout::GetVirtPageNumByPageNum( sal_uInt16 _nPageNum ) const { - const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum ); - if ( pPrevwPage ) + const PreviewPage* pPreviewPage = _GetPreviewPageByPageNum( _nPageNum ); + if ( pPreviewPage ) { - return pPrevwPage->pPage->GetVirtPageNum(); + return pPreviewPage->pPage->GetVirtPageNum(); } else { diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 8dcf216c1aca..20e6be354c44 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -100,7 +100,7 @@ SwViewImp::SwViewImp( ViewShell *pParent ) : pSdrObjCached(NULL), nRestoreActions( 0 ), // OD 12.12.2002 #103492# - mpPgPrevwLayout( 0 ) + mpPgPreviewLayout( 0 ) { bResetHdlHiddenPaint = bSmoothUpdate = bStopSmooth = bStopPrt = sal_False; @@ -112,7 +112,7 @@ SwViewImp::~SwViewImp() delete pAccMap; // OD 12.12.2002 #103492# - delete mpPgPrevwLayout; + delete mpPgPreviewLayout; //JP 29.03.96: after ShowSdrPage HideSdrPage must also be executed!!! if( pDrawView ) @@ -271,7 +271,7 @@ void SwViewImp::InitPagePreviewLayout() { OSL_ENSURE( pSh->GetLayout(), "no layout - page preview layout can not be created."); if ( pSh->GetLayout() ) - mpPgPrevwLayout = new SwPagePreviewLayout( *pSh, *(pSh->GetLayout()) ); + mpPgPreviewLayout = new SwPagePreviewLayout( *pSh, *(pSh->GetLayout()) ); } void SwViewImp::UpdateAccessible() @@ -433,14 +433,14 @@ void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm ) } // OD 15.01.2003 #103492# - method signature change due to new page preview functionality -void SwViewImp::UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages, +void SwViewImp::UpdateAccessiblePreview( const std::vector<PreviewPage*>& _rPreviewPages, const Fraction& _rScale, const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ) + const Size& _rPreviewWinSize ) { if( IsAccessible() ) - GetAccessibleMap().UpdatePreview( _rPrevwPages, _rScale, - _pSelectedPageFrm, _rPrevwWinSize ); + GetAccessibleMap().UpdatePreview( _rPreviewPages, _rScale, + _pSelectedPageFrm, _rPreviewWinSize ); } void SwViewImp::InvalidateAccessiblePreViewSelection( sal_uInt16 nSelPage ) diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index dc0661ed1cf6..b21fffe48cbf 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2163,7 +2163,7 @@ ViewShell::CreateAccessiblePreview() if ( IsPreView() && GetLayout()&& GetWin() ) { return Imp()->GetAccessibleMap().GetDocumentPreview( - PagePreviewLayout()->maPrevwPages, + PagePreviewLayout()->maPreviewPages, GetWin()->GetMapMode().GetScaleX(), GetLayout()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ), PagePreviewLayout()->maWinSize ); //swmod 080305 diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx index ca3145fc7504..12bc22cc56e8 100644 --- a/sw/source/ui/inc/pview.hxx +++ b/sw/source/ui/inc/pview.hxx @@ -52,7 +52,7 @@ class SwPagePreViewWin : public Window SwPagePreView& mrView; bool mbCalcScaleForPreviewLayout; Rectangle maPaintedPreviewDocRect; - SwPagePreviewLayout* mpPgPrevwLayout; + SwPagePreviewLayout* mpPgPreviewLayout; void SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol ); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 9d3b0f3463b7..2d9c3cc11b3f 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -200,10 +200,10 @@ void SwPagePreViewWin::Paint( const Rectangle& rRect ) maPxWinSize = GetOutputSizePixel(); Rectangle aRect( LogicToPixel( rRect )); - mpPgPrevwLayout->Prepare( 1, Point(0,0), maPxWinSize, + mpPgPreviewLayout->Prepare( 1, Point(0,0), maPxWinSize, mnSttPage, maPaintedPreviewDocRect ); SetSelectedPage( 1 ); - mpPgPrevwLayout->Paint( PixelToLogic( aRect ) ); + mpPgPreviewLayout->Paint( PixelToLogic( aRect ) ); SetPagePreview(mnRow, mnCol); } else @@ -212,7 +212,7 @@ void SwPagePreViewWin::Paint( const Rectangle& rRect ) aMM.SetScaleX( maScale ); aMM.SetScaleY( maScale ); SetMapMode( aMM ); - mpPgPrevwLayout->Paint( rRect ); + mpPgPreviewLayout->Paint( rRect ); } } @@ -230,8 +230,8 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol ) if( mnSttPage > nLastSttPg ) mnSttPage = nLastSttPg; - mpPgPrevwLayout->Init( mnCol, mnRow, maPxWinSize, true ); - mpPgPrevwLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize, + mpPgPreviewLayout->Init( mnCol, mnRow, maPxWinSize, true ); + mpPgPreviewLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize, mnSttPage, maPaintedPreviewDocRect ); SetSelectedPage( mnSttPage ); SetPagePreview(mnRow, mnCol); @@ -275,35 +275,35 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) { case MV_PAGE_UP: { - const sal_uInt16 nRelSttPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( mnSttPage ); + const sal_uInt16 nRelSttPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( mnSttPage ); const sal_uInt16 nNewAbsSttPage = nRelSttPage - nPages > 0 ? - mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage - nPages ) : + mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage - nPages ) : nDefSttPg; nNewSttPage = nNewAbsSttPage; - const sal_uInt16 nRelSelPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() ); + const sal_uInt16 nRelSelPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() ); const sal_uInt16 nNewRelSelPage = nRelSelPage - nPages > 0 ? nRelSelPage - nPages : 1; - SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewRelSelPage ) ); + SetSelectedPage( mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nNewRelSelPage ) ); break; } case MV_PAGE_DOWN: { - const sal_uInt16 nRelSttPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( mnSttPage ); - const sal_uInt16 nNewAbsSttPage = mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage + nPages ); + const sal_uInt16 nRelSttPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( mnSttPage ); + const sal_uInt16 nNewAbsSttPage = mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nRelSttPage + nPages ); nNewSttPage = nNewAbsSttPage < nPageCount ? nNewAbsSttPage : nPageCount; - const sal_uInt16 nRelSelPage = mpPgPrevwLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() ); - const sal_uInt16 nNewAbsSelPage = mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nRelSelPage + nPages ); + const sal_uInt16 nRelSelPage = mpPgPreviewLayout->ConvertAbsoluteToRelativePageNum( SelectedPage() ); + const sal_uInt16 nNewAbsSelPage = mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nRelSelPage + nPages ); SetSelectedPage( nNewAbsSelPage < nPageCount ? nNewAbsSelPage : nPageCount ); break; } case MV_DOC_STT: nNewSttPage = nDefSttPg; - SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) ); + SetSelectedPage( mpPgPreviewLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) ); break; case MV_DOC_END: // correct calculation of new start page. @@ -314,14 +314,14 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) // <nNewSttPage> and <SelectedPage()> are already set. // not start at first column, only if the // complete preview layout columns doesn't fit into window. - if ( !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() ) + if ( !mpPgPreviewLayout->DoesPreviewLayoutColsFitIntoWindow() ) bPaintPageAtFirstCol = false; break; case MV_SCROLL: // check, if paint page at first column // has to be avoided - if ( !mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() || - !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() ) + if ( !mpPgPreviewLayout->DoesPreviewLayoutRowsFitIntoWindow() || + !mpPgPreviewLayout->DoesPreviewLayoutColsFitIntoWindow() ) bPaintPageAtFirstCol = false; break; case MV_NEWWINSIZE: @@ -329,7 +329,7 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) break; case MV_CALC: // re-init page preview layout. - mpPgPrevwLayout->ReInit(); + mpPgPreviewLayout->ReInit(); // correct calculation of new start page. if( nNewSttPage > nPageCount ) @@ -340,7 +340,7 @@ int SwPagePreViewWin::MovePage( int eMoveMode ) SetSelectedPage( nNewSttPage ? nNewSttPage : 1 ); } - mpPgPrevwLayout->Prepare( nNewSttPage, Point(0,0), maPxWinSize, + mpPgPreviewLayout->Prepare( nNewSttPage, Point(0,0), maPxWinSize, nNewSttPage, maPaintedPreviewDocRect, bPaintPageAtFirstCol ); if( nNewSttPage == mnSttPage && @@ -376,10 +376,10 @@ void SwPagePreViewWin::SetWinSize( const Size& rNewSize ) if ( mbCalcScaleForPreviewLayout ) { - mpPgPrevwLayout->Init( mnCol, mnRow, maPxWinSize, true ); + mpPgPreviewLayout->Init( mnCol, mnRow, maPxWinSize, true ); maScale = GetMapMode().GetScaleX(); } - mpPgPrevwLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize, + mpPgPreviewLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize, mnSttPage, maPaintedPreviewDocRect ); if ( mbCalcScaleForPreviewLayout ) { @@ -395,16 +395,16 @@ OUString SwPagePreViewWin::GetStatusStr( sal_uInt16 nPageCnt ) const // show physical and virtual page number of // selected page, if it's visible. sal_uInt16 nPageNum; - if ( mpPgPrevwLayout->IsPageVisible( mpPgPrevwLayout->SelectedPage() ) ) + if ( mpPgPreviewLayout->IsPageVisible( mpPgPreviewLayout->SelectedPage() ) ) { - nPageNum = mpPgPrevwLayout->SelectedPage(); + nPageNum = mpPgPreviewLayout->SelectedPage(); } else { nPageNum = mnSttPage > 1 ? mnSttPage : 1; } OUStringBuffer aStatusStr; - sal_uInt16 nVirtPageNum = mpPgPrevwLayout->GetVirtPageNumByPageNum( nPageNum ); + sal_uInt16 nVirtPageNum = mpPgPreviewLayout->GetVirtPageNumByPageNum( nPageNum ); if( nVirtPageNum && nVirtPageNum != nPageNum ) { aStatusStr.append( OUString::number(nVirtPageNum) + " " ); @@ -477,12 +477,12 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt ) // consider single-click to set selected page if( MOUSE_LEFT == ( rMEvt.GetModifier() + rMEvt.GetButtons() ) ) { - Point aPrevwPos( PixelToLogic( rMEvt.GetPosPixel() ) ); + Point aPreviewPos( PixelToLogic( rMEvt.GetPosPixel() ) ); Point aDocPos; bool bPosInEmptyPage; sal_uInt16 nNewSelectedPage; bool bIsDocPos = - mpPgPrevwLayout->IsPrevwPosInDocPrevwPage( aPrevwPos, + mpPgPreviewLayout->IsPreviewPosInDocPreviewPage( aPreviewPos, aDocPos, bPosInEmptyPage, nNewSelectedPage ); if ( bIsDocPos && rMEvt.GetClicks() == 2 ) { @@ -499,10 +499,10 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt ) else if ( bIsDocPos || bPosInEmptyPage ) { // show clicked page as the selected one - mpPgPrevwLayout->MarkNewSelectedPage( nNewSelectedPage ); + mpPgPreviewLayout->MarkNewSelectedPage( nNewSelectedPage ); GetViewShell()->ShowPreViewSelection( nNewSelectedPage ); // adjust position at vertical scrollbar. - if ( mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() ) + if ( mpPgPreviewLayout->DoesPreviewLayoutRowsFitIntoWindow() ) { mrView.SetVScrollbarThumbPos( nNewSelectedPage ); } @@ -540,7 +540,7 @@ void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol ) */ sal_uInt16 SwPagePreViewWin::SelectedPage() const { - return mpPgPrevwLayout->SelectedPage(); + return mpPgPreviewLayout->SelectedPage(); } /** set selected page number in document preview @@ -549,7 +549,7 @@ sal_uInt16 SwPagePreViewWin::SelectedPage() const */ void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum ) { - mpPgPrevwLayout->SetSelectedPage( _nSelectedPageNum ); + mpPgPreviewLayout->SetSelectedPage( _nSelectedPageNum ); } /** method to enable/disable book preview @@ -558,7 +558,7 @@ void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum ) */ bool SwPagePreViewWin::SetBookPreviewMode( const bool _bBookPreview ) { - return mpPgPrevwLayout->SetBookPreviewMode( _bBookPreview, + return mpPgPreviewLayout->SetBookPreviewMode( _bBookPreview, mnSttPage, maPaintedPreviewDocRect ); } @@ -598,12 +598,12 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt ) void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, SfxRequest* _pReq ) { - SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); + SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); // check, if top/bottom of preview is *not* already visible. - if( pPagePrevwLay->GetWinPagesScrollAmount( _bPgUp ? -1 : 1 ) != 0 ) + if( pPagePreviewLay->GetWinPagesScrollAmount( _bPgUp ? -1 : 1 ) != 0 ) { - if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() && - pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() ) + if ( pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() && + pPagePreviewLay->DoesPreviewLayoutColsFitIntoWindow() ) { const int eMvMode = _bPgUp ? SwPagePreViewWin::MV_PAGE_UP : @@ -618,9 +618,9 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol(); if( _bPgUp ) { - if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() ) + if ( pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() ) { - nScrollAmount = pPagePrevwLay->GetWinPagesScrollAmount( -1 ); + nScrollAmount = pPagePreviewLay->GetWinPagesScrollAmount( -1 ); if ( (aViewWin.SelectedPage() - nVisPages) > 0 ) nNewSelectedPageNum = aViewWin.SelectedPage() - nVisPages; else @@ -632,9 +632,9 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, } else { - if ( pPagePrevwLay->DoesPreviewLayoutRowsFitIntoWindow() ) + if ( pPagePreviewLay->DoesPreviewLayoutRowsFitIntoWindow() ) { - nScrollAmount = pPagePrevwLay->GetWinPagesScrollAmount( 1 ); + nScrollAmount = pPagePreviewLay->GetWinPagesScrollAmount( 1 ); if ( (aViewWin.SelectedPage() + nVisPages) <= mnPageCount ) nNewSelectedPageNum = aViewWin.SelectedPage() + nVisPages; else @@ -642,7 +642,7 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, } else nScrollAmount = std::min( aViewWin.GetOutputSize().Height(), - ( pPagePrevwLay->GetPrevwDocSize().Height() - + ( pPagePreviewLay->GetPreviewDocSize().Height() - aViewWin.GetPaintedPreviewDocRect().Bottom() ) ); } aViewWin.Scroll( 0, nScrollAmount ); @@ -807,7 +807,7 @@ void SwPagePreView::Execute( SfxRequest &rReq ) case FN_LINE_UP: case FN_LINE_DOWN: { - SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); + SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); sal_uInt16 nNewSelectedPage; sal_uInt16 nNewStartPage; Point aNewStartPos; @@ -820,13 +820,13 @@ void SwPagePreView::Execute( SfxRequest &rReq ) case FN_LINE_UP: nVertMove = -1; break; case FN_LINE_DOWN: nVertMove = 1; break; } - pPagePrevwLay->CalcStartValuesForSelectedPageMove( nHoriMove, nVertMove, + pPagePreviewLay->CalcStartValuesForSelectedPageMove( nHoriMove, nVertMove, nNewSelectedPage, nNewStartPage, aNewStartPos ); if ( aViewWin.SelectedPage() != nNewSelectedPage ) { - if ( pPagePrevwLay->IsPageVisible( nNewSelectedPage ) ) + if ( pPagePreviewLay->IsPageVisible( nNewSelectedPage ) ) { - pPagePrevwLay->MarkNewSelectedPage( nNewSelectedPage ); + pPagePreviewLay->MarkNewSelectedPage( nNewSelectedPage ); // adjust position at vertical scrollbar. SetVScrollbarThumbPos( nNewSelectedPage ); bRefresh = false; @@ -940,7 +940,7 @@ void SwPagePreView::GetState( SfxItemSet& rSet ) sal_uInt8 nRow = 1; sal_uInt16 nWhich = aIter.FirstWhich(); OSL_ENSURE(nWhich, "empty set"); - SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); + SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); while(nWhich) { @@ -952,25 +952,25 @@ void SwPagePreView::GetState( SfxItemSet& rSet ) break; case FN_START_OF_DOCUMENT: { - if ( pPagePrevwLay->IsPageVisible( 1 ) ) + if ( pPagePreviewLay->IsPageVisible( 1 ) ) rSet.DisableItem(nWhich); break; } case FN_END_OF_DOCUMENT: { - if ( pPagePrevwLay->IsPageVisible( mnPageCount ) ) + if ( pPagePreviewLay->IsPageVisible( mnPageCount ) ) rSet.DisableItem(nWhich); break; } case FN_PAGEUP: { - if( pPagePrevwLay->GetWinPagesScrollAmount( -1 ) == 0 ) + if( pPagePreviewLay->GetWinPagesScrollAmount( -1 ) == 0 ) rSet.DisableItem(nWhich); break; } case FN_PAGEDOWN: { - if( pPagePrevwLay->GetWinPagesScrollAmount( 1 ) == 0 ) + if( pPagePreviewLay->GetWinPagesScrollAmount( 1 ) == 0 ) rSet.DisableItem(nWhich); break; } @@ -1467,10 +1467,10 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) { // consider case that page <nThmbPos> // is already visible - SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); - if ( pPagePrevwLay->IsPageVisible( nThmbPos ) ) + SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); + if ( pPagePreviewLay->IsPageVisible( nThmbPos ) ) { - pPagePrevwLay->MarkNewSelectedPage( nThmbPos ); + pPagePreviewLay->MarkNewSelectedPage( nThmbPos ); // invalidation of window is unnecessary bInvalidateWin = false; } @@ -1478,7 +1478,7 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) { // consider whether layout columns // fit or not. - if ( !pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() ) + if ( !pPagePreviewLay->DoesPreviewLayoutColsFitIntoWindow() ) { aViewWin.SetSttPage( nThmbPos ); aViewWin.SetSelectedPage( nThmbPos ); @@ -1498,7 +1498,7 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar ) nPageDiff < 0 ? --nWinPagesToScroll : ++nWinPagesToScroll; } aViewWin.SetSelectedPage( nThmbPos ); - aViewWin.Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) ); + aViewWin.Scroll( 0, pPagePreviewLay->GetWinPagesScrollAmount( nWinPagesToScroll ) ); } } // update accessibility @@ -1581,8 +1581,8 @@ void SwPagePreView::ScrollViewSzChg() pVScrollbar->SetVisibleSize( nVisPages ); // set selected page as scroll bar position, // if it is visible. - SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); - if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) ) + SwPagePreviewLayout* pPagePreviewLay = GetViewShell()->PagePreviewLayout(); + if ( pPagePreviewLay->IsPageVisible( aViewWin.SelectedPage() ) ) { pVScrollbar->SetThumbPos( aViewWin.SelectedPage() ); } @@ -1606,7 +1606,7 @@ void SwPagePreView::ScrollViewSzChg() { const Rectangle& rDocRect = aViewWin.GetPaintedPreviewDocRect(); const Size& rPreviewSize = - GetViewShell()->PagePreviewLayout()->GetPrevwDocSize(); + GetViewShell()->PagePreviewLayout()->GetPreviewDocSize(); pVScrollbar->SetRangeMax(rPreviewSize.Height()) ; long nVisHeight = rDocRect.GetHeight(); pVScrollbar->SetVisibleSize( nVisHeight ); @@ -1628,7 +1628,7 @@ void SwPagePreView::ScrollViewSzChg() { const Rectangle& rDocRect = aViewWin.GetPaintedPreviewDocRect(); const Size& rPreviewSize = - GetViewShell()->PagePreviewLayout()->GetPrevwDocSize(); + GetViewShell()->PagePreviewLayout()->GetPreviewDocSize(); long nVisWidth = 0; long nThumb = 0; Range aRange(0,0); @@ -1737,16 +1737,16 @@ void SwPagePreViewWin::SetViewShell( ViewShell* pShell ) mpViewShell = pShell; if ( mpViewShell && mpViewShell->IsPreView() ) { - mpPgPrevwLayout = mpViewShell->PagePreviewLayout(); + mpPgPreviewLayout = mpViewShell->PagePreviewLayout(); } } void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect ) { // #i24183# - if ( mpPgPrevwLayout->PreviewLayoutValid() ) + if ( mpPgPreviewLayout->PreviewLayoutValid() ) { - mpPgPrevwLayout->Repaint( Rectangle( rRect.Pos(), rRect.SSize() ) ); + mpPgPreviewLayout->Repaint( Rectangle( rRect.Pos(), rRect.SSize() ) ); } } @@ -1762,8 +1762,8 @@ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, { mnRow = 1; mnCol = 1; - mpPgPrevwLayout->Init( mnCol, mnRow, maPxWinSize, true ); - mpPgPrevwLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize, + mpPgPreviewLayout->Init( mnCol, mnRow, maPxWinSize, true ); + mpPgPreviewLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize, mnSttPage, maPaintedPreviewDocRect ); SetSelectedPage( mnSttPage ); SetPagePreview(mnRow, mnCol); @@ -1781,13 +1781,13 @@ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, // calculate new start position for preview paint Size aNewWinSize = PixelToLogic( maPxWinSize ); Point aNewPaintStartPos = - mpPgPrevwLayout->GetPreviewStartPosForNewScale( aNewScale, maScale, aNewWinSize ); + mpPgPreviewLayout->GetPreviewStartPosForNewScale( aNewScale, maScale, aNewWinSize ); // remember new scaling and prepare preview paint // Note: paint of preview will be performed by a corresponding invalidate // due to property changes. maScale = aNewScale; - mpPgPrevwLayout->Prepare( 0, aNewPaintStartPos, maPxWinSize, + mpPgPreviewLayout->Prepare( 0, aNewPaintStartPos, maPxWinSize, mnSttPage, maPaintedPreviewDocRect ); } @@ -1801,7 +1801,7 @@ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, void SwPagePreViewWin::Scroll(long nXMove, long nYMove, sal_uInt16 /*nFlags*/) { maPaintedPreviewDocRect.Move(nXMove, nYMove); - mpPgPrevwLayout->Prepare( 0, maPaintedPreviewDocRect.TopLeft(), + mpPgPreviewLayout->Prepare( 0, maPaintedPreviewDocRect.TopLeft(), maPxWinSize, mnSttPage, maPaintedPreviewDocRect ); |