summaryrefslogtreecommitdiff
path: root/sw/source/ui/uiview/pview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/uiview/pview.cxx')
-rw-r--r--sw/source/ui/uiview/pview.cxx424
1 files changed, 77 insertions, 347 deletions
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 7abdbbb85d7b..790cfb62c123 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,16 +82,14 @@
#define SwPagePreView
#include <sfx2/msg.hxx>
#include <swslots.hxx>
-// OD 12.12.2002 #103492#
#include <pagepreviewlayout.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
using namespace ::com::sun::star;
-
SFX_IMPL_NAMED_VIEWFACTORY(SwPagePreView, "PrintPreview")
{
SFX_VIEW_REGISTRATION(SwDocShell);
@@ -107,17 +106,13 @@ SFX_IMPL_INTERFACE(SwPagePreView, SfxViewShell, SW_RES(RID_PVIEW_TOOLBOX))
SW_RES(RID_PVIEW_TOOLBOX));
}
-
TYPEINIT1(SwPagePreView,SfxViewShell)
#define SWVIEWFLAGS ( SFX_VIEW_CAN_PRINT|SFX_VIEW_HAS_PRINTOPTIONS )
#define MIN_PREVIEW_ZOOM 25
#define MAX_PREVIEW_ZOOM 600
-/* */
-/* -----------------26.11.2002 10:41-----------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, sal_Bool bZoomIn)
{
static sal_uInt16 aZoomArr[] =
@@ -139,24 +134,18 @@ sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, sal_Bool bZoomIn)
}
return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM;
};
-/* -----------------02.12.2002 09:11-----------------
- *
- * --------------------------------------------------*/
+
void lcl_InvalidateZoomSlots(SfxBindings& rBindings)
{
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 const aInval[] =
{
SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN, SID_ATTR_ZOOMSLIDER, FN_PREVIEW_ZOOM, FN_STAT_ZOOM,
0
};
rBindings.Invalidate( aInval );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
// erstmal der Zoom-Dialog
-
class SwPreViewZoomDlg : public SvxStandardDialog
{
FixedText aRowLbl;
@@ -175,11 +164,6 @@ public:
~SwPreViewZoomDlg();
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) :
SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_ZOOM) ),
aRowLbl(this,SW_RES(FT_ROW)),
@@ -196,13 +180,7 @@ SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) :
aColEdit.SetValue( rParent.GetCol() );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
SwPreViewZoomDlg::~SwPreViewZoomDlg() {}
-
-
void SwPreViewZoomDlg::Apply()
{
((SwPagePreViewWin*)GetParent())->CalcWish(
@@ -210,13 +188,7 @@ void SwPreViewZoomDlg::Apply()
sal_uInt8(aColEdit.GetValue()) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
// alles fuers SwPagePreViewWin
-
-
SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
: Window( pParent, WinBits( WB_CLIPCHILDREN) ),
mpViewShell( 0 ),
@@ -224,7 +196,7 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
mbCalcScaleForPreviewLayout( true ),
maPaintedPreviewDocRect( Rectangle(0,0,0,0) )
{
- SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW ); //#106611#
+ SetOutDevViewType( OUTDEV_VIEWTYPE_PRINTPREVIEW );
SetHelpId(HID_PAGEPREVIEW);
SetFillColor( GetBackground().GetColor() );
SetLineColor( GetBackground().GetColor());
@@ -233,26 +205,15 @@ SwPagePreViewWin::SwPagePreViewWin( Window *pParent, SwPagePreView& rPView )
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(sal_False);
mnRow = pUsrPref->GetPagePrevRow(); // 1 Zeile
mnCol = pUsrPref->GetPagePrevCol(); // 1 Spalte
- // OD 24.03.2003 #108282# - member <mnVirtPage> no longer exists.
mnSttPage = USHRT_MAX;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwPagePreViewWin::~SwPagePreViewWin()
{
if( mpViewShell )
delete mpViewShell;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::Paint( const Rectangle& rRect )
{
if( !mpViewShell || !mpViewShell->GetLayout() )
@@ -281,16 +242,12 @@ void SwPagePreViewWin::Paint( const Rectangle& rRect )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol )
{
if( !mpViewShell || !mpViewShell->GetLayout() )
return;
sal_uInt16 nOldCol = mnCol;
- // OD 02.12.2002 #103492# - update <mnRow> and <mnCol>.
mnRow = nNewRow;
mnCol = nNewCol;
sal_uInt16 nPages = mnRow * mnCol,
@@ -312,8 +269,8 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol )
mrView.ScrollDocSzChg();
// Sortierung muss eingehalten werden!!
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
SID_ATTR_ZOOM, SID_ZOOM_OUT, SID_ZOOM_IN,
FN_PREVIEW_ZOOM,
@@ -326,23 +283,20 @@ void SwPagePreViewWin::CalcWish( sal_uInt8 nNewRow, sal_uInt8 nNewCol )
rBindings.Invalidate( aInval );
rBindings.Update( FN_SHOW_TWO_PAGES );
rBindings.Update( FN_SHOW_MULTIPLE_PAGES );
- // OD 18.12.2002 #103492# - adjust scrollbars
+ // adjust scrollbars
mrView.ScrollViewSzChg();
}
+
/*--------------------------------------------------------------------
Beschreibung:, mnSttPage is Absolute
--------------------------------------------------------------------*/
-
-
int SwPagePreViewWin::MovePage( int eMoveMode )
{
// soviele Seiten hoch
sal_uInt16 nPages = mnRow * mnCol;
sal_uInt16 nNewSttPage = mnSttPage;
- // OD 04.12.2002 #103492#
sal_uInt16 nPageCount = mrView.GetPageCount();
sal_uInt16 nDefSttPg = GetDefSttPage();
- // OD 06.12.2002 #103492#
bool bPaintPageAtFirstCol = true;
switch( eMoveMode )
@@ -380,37 +334,36 @@ int SwPagePreViewWin::MovePage( int eMoveMode )
SetSelectedPage( mpPgPrevwLayout->ConvertRelativeToAbsolutePageNum( nNewSttPage ? nNewSttPage : 1 ) );
break;
case MV_DOC_END:
- // OD 03.12.2002 #103492# - correct calculation of new start page.
+ // correct calculation of new start page.
nNewSttPage = nPageCount;
SetSelectedPage( nPageCount );
break;
- // OD 12.12.2002 #103492# - add new move mode
case MV_SELPAGE:
// <nNewSttPage> and <SelectedPage()> are already set.
- // OD 20.02.2003 #107369# - not start at first column, only if the
+ // not start at first column, only if the
// complete preview layout columns doesn't fit into window.
if ( !mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() )
bPaintPageAtFirstCol = false;
break;
case MV_SCROLL:
- // OD 17.01.2003 #103492# - check, if paint page at first column
+ // check, if paint page at first column
// has to be avoided
if ( !mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() ||
!mpPgPrevwLayout->DoesPreviewLayoutColsFitIntoWindow() )
bPaintPageAtFirstCol = false;
break;
case MV_NEWWINSIZE:
- // OD 18.12.2002 #103492# - nothing special to do.
+ // nothing special to do.
break;
case MV_CALC:
- // OD 18.12.2002 #103492# - re-init page preview layout.
+ // re-init page preview layout.
mpPgPrevwLayout->ReInit();
- // OD 03.12.2002 #103492# - correct calculation of new start page.
+ // correct calculation of new start page.
if( nNewSttPage > nPageCount )
nNewSttPage = nPageCount;
- // OD 18.12.2002 #103492# - correct selected page number
+ // correct selected page number
if( SelectedPage() > nPageCount )
SetSelectedPage( nNewSttPage ? nNewSttPage : 1 );
}
@@ -425,8 +378,8 @@ int SwPagePreViewWin::MovePage( int eMoveMode )
SetPagePreview(mnRow, mnCol);
mnSttPage = nNewSttPage;
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, 0
@@ -438,11 +391,6 @@ int SwPagePreViewWin::MovePage( int eMoveMode )
return sal_True;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::SetWinSize( const Size& rNewSize )
{
// die Size wollen wir aber immer in Pixel-Einheiten haben
@@ -470,15 +418,9 @@ void SwPagePreViewWin::SetWinSize( const Size& rNewSize )
maScale = GetMapMode().GetScaleX();
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::GetStatusStr( String& rStr, sal_uInt16 nPageCnt ) const
{
- // OD 24.03.2003 #108282# - show physical and virtual page number of
+ // show physical and virtual page number of
// selected page, if it's visible.
sal_uInt16 nPageNum;
if ( mpPgPrevwLayout->IsPageVisible( mpPgPrevwLayout->SelectedPage() ) )
@@ -500,11 +442,6 @@ void SwPagePreViewWin::GetStatusStr( String& rStr, sal_uInt16 nPageCnt ) const
rStr += String::CreateFromInt32( nPageCnt );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt )
{
const KeyCode& rKeyCode = rKEvt.GetKeyCode();
@@ -530,10 +467,6 @@ void SwPagePreViewWin::KeyInput( const KeyEvent &rKEvt )
Window::KeyInput( rKEvt );
}
-/******************************************************************************
- * Beschreibung:
- ******************************************************************************/
-
void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
{
sal_Bool bCallBase = sal_True;
@@ -561,7 +494,6 @@ void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
}
break;
default:
- // OD 17.12.2002 #103492# - delete assertion
;
}
@@ -571,7 +503,7 @@ void SwPagePreViewWin::Command( const CommandEvent& rCEvt )
void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
{
- // OD 17.12.2002 #103492# - consider single-click to set selected page
+ // consider single-click to set selected page
if( MOUSE_LEFT == ( rMEvt.GetModifier() + rMEvt.GetButtons() ) )
{
Point aPrevwPos( PixelToLogic( rMEvt.GetPosPixel() ) );
@@ -596,18 +528,17 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
SFX_CALLMODE_ASYNCHRON );
}
else if ( bIsDocPos || bPosInEmptyPage )
- // OD 2004-03-04 #i20684# - add missing parenthesis
{
// show clicked page as the selected one
mpPgPrevwLayout->MarkNewSelectedPage( nNewSelectedPage );
GetViewShell()->ShowPreViewSelection( nNewSelectedPage );
- // OD 19.02.2003 #107369# - adjust position at vertical scrollbar.
+ // adjust position at vertical scrollbar.
if ( mpPgPrevwLayout->DoesPreviewLayoutRowsFitIntoWindow() )
{
mrView.SetVScrollbarThumbPos( nNewSelectedPage );
}
- // OD 24.03.2003 #108282# - invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_STAT_PAGE, 0
};
@@ -620,8 +551,6 @@ void SwPagePreViewWin::MouseButtonDown( const MouseEvent& rMEvt )
/******************************************************************************
* Beschreibung: Userprefs bzw Viewoptions setzen
******************************************************************************/
-
-
void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol )
{
SwMasterUsrPref *pOpt = (SwMasterUsrPref *)SW_MOD()->GetUsrPref(sal_False);
@@ -639,8 +568,6 @@ void SwPagePreViewWin::SetPagePreview( sal_uInt8 nRow, sal_uInt8 nCol )
/** get selected page in document preview
- OD 13.12.2002 #103492#
-
@author OD
*/
sal_uInt16 SwPagePreViewWin::SelectedPage() const
@@ -650,8 +577,6 @@ sal_uInt16 SwPagePreViewWin::SelectedPage() const
/** set selected page number in document preview
- OD 13.12.2002 #103492#
-
@author OD
*/
void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum )
@@ -661,8 +586,6 @@ void SwPagePreViewWin::SetSelectedPage( sal_uInt16 _nSelectedPageNum )
/** method to enable/disable book preview
- OD 2004-03-05 #i18143#
-
@author OD
*/
bool SwPagePreViewWin::SetBookPreviewMode( const bool _bBookPreview )
@@ -685,7 +608,7 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt )
// den Settings abgefragt werden.
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
mrView.InvalidateBorder(); //Scrollbarbreiten
- //#106746# zoom has to be disabled if Accessibility support is switched on
+ // zoom has to be disabled if Accessibility support is switched on
lcl_InvalidateZoomSlots(mrView.GetViewFrame()->GetBindings());
break;
@@ -702,8 +625,6 @@ void SwPagePreViewWin::DataChanged( const DataChangedEvent& rDCEvt )
/** help method to execute SfxRequest FN_PAGEUP and FN_PAGEDOWN
- OD 04.03.2003 #107369#
-
@author OD
*/
void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
@@ -762,8 +683,8 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
aViewWin.SetSelectedPage( nNewSelectedPageNum );
}
ScrollViewSzChg();
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, 0
@@ -778,9 +699,6 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp,
_pReq->Done();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
// dann mal alles fuer die SwPagePreView
void SwPagePreView::Execute( SfxRequest &rReq )
{
@@ -829,7 +747,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
// book preview mode changed. Thus, adjust scrollbars and
// invalidate corresponding states.
ScrollViewSzChg();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, FN_SHOW_BOOKVIEW, 0
@@ -870,7 +788,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
if(pFact)
{
pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aCoreSet);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
}
pDlg->SetLimits( MINZOOM, MAXZOOM );
@@ -941,7 +859,7 @@ void SwPagePreView::Execute( SfxRequest &rReq )
if ( pPagePrevwLay->IsPageVisible( nNewSelectedPage ) )
{
pPagePrevwLay->MarkNewSelectedPage( nNewSelectedPage );
- // OD 19.02.2003 #107369# - adjust position at vertical scrollbar.
+ // adjust position at vertical scrollbar.
SetVScrollbarThumbPos( nNewSelectedPage );
bRefresh = false;
}
@@ -953,8 +871,8 @@ void SwPagePreView::Execute( SfxRequest &rReq )
bRefresh = 0 != nRet;
}
GetViewShell()->ShowPreViewSelection( nNewSelectedPage );
- // OD 24.03.2003 #108282# - invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_STAT_PAGE, 0
};
@@ -1040,7 +958,7 @@ MOVEPAGE:
}
break;
default:
- ASSERT(!this, falscher Dispatcher);
+ OSL_ENSURE(!this, "wrong dispatcher");
return;
}
@@ -1048,20 +966,14 @@ MOVEPAGE:
aViewWin.Invalidate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::GetState( SfxItemSet& rSet )
{
SfxWhichIter aIter(rSet);
sal_uInt8 nRow = 1;
sal_uInt16 nWhich = aIter.FirstWhich();
- ASSERT(nWhich, leeres Set);
+ OSL_ENSURE(nWhich, "empty set");
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
- //#106746# zoom has to be disabled if Accessibility support is switched on
- // MT 2010/01, see #110498#
+ // zoom has to be disabled if Accessibility support is switched on
sal_Bool bZoomEnabled = sal_True; // !Application::GetSettings().GetMiscSettings().GetEnableATToolSupport();
while(nWhich)
@@ -1207,11 +1119,6 @@ void SwPagePreView::GetState( SfxItemSet& rSet )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::StateUndo(SfxItemSet& rSet)
{
SfxWhichIter aIter(rSet);
@@ -1224,11 +1131,6 @@ void SwPagePreView::StateUndo(SfxItemSet& rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::Init(const SwViewOption * pPrefs)
{
if ( GetViewShell()->HasDrawView() )
@@ -1275,7 +1177,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
GetViewShell()->ApplyViewOptions( aOpt );
GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions());
- // OD 09.01.2003 #i6467# - adjust view shell option to the same as for print
+ // adjust view shell option to the same as for print
SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false);
GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions );
@@ -1290,12 +1192,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
pScrollFill->Show(pPrefs->IsViewVScrollBar() && pPrefs->IsViewHScrollBar());
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SfxViewShell( pViewFrame, SWVIEWFLAGS ),
aViewWin( &pViewFrame->GetWindow(), *this ),
@@ -1307,7 +1203,6 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
pScrollFill(new ScrollBarBox( &pViewFrame->GetWindow(),
pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )),
mnPageCount( 0 ),
- // OD 09.01.2003 #106334#
mbResetFormDesignMode( false ),
mbFormDesignModeToReset( false )
{
@@ -1346,14 +1241,14 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
{
// setze die akt. Seite als die erste
sal_uInt16 nPhysPg, nVirtPg;
- ((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, /*sal_False*/sal_True, sal_False );
+ ((SwCrsrShell*)pVS)->GetPageNum( nPhysPg, nVirtPg, sal_True, sal_False );
if( 1 != aViewWin.GetCol() && 1 == nPhysPg )
--nPhysPg;
aViewWin.SetSttPage( nPhysPg );
}
}
- // OD 09.01.2003 #106334# - for form shell remember design mode of draw view
+ // for form shell remember design mode of draw view
// of previous view shell
if ( pVS && pVS->HasDrawView() )
{
@@ -1373,13 +1268,7 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
Init();
}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
- SwPagePreView::~SwPagePreView()
+SwPagePreView::~SwPagePreView()
{
SetWindow( 0 );
@@ -1389,39 +1278,19 @@ SwPagePreView::SwPagePreView(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
delete pPageUpBtn;
delete pPageDownBtn;
-/* SfxObjectShell* pDocSh = GetDocShell();
- for( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocSh );
- pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) )
- if( pFrame != GetViewFrame() )
- {
- // es gibt noch eine weitere Sicht auf unser Dokument, also
- // aktiviere dieses
- pFrame->GetFrame().Appear();
- break;
- }
-*/}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
+}
SwDocShell* SwPagePreView::GetDocShell()
{
return PTR_CAST(SwDocShell, GetViewFrame()->GetObjectShell());
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
int SwPagePreView::_CreateScrollbar( sal_Bool bHori )
{
Window *pMDI = &GetViewFrame()->GetWindow();
SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
- ASSERT( !*ppScrollbar, "vorher abpruefen!" )
+ OSL_ENSURE( !*ppScrollbar, "vorher abpruefen!" );
if( !bHori )
{
@@ -1451,33 +1320,18 @@ int SwPagePreView::_CreateScrollbar( sal_Bool bHori )
return 1;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
/*
* Button-Handler
*/
IMPL_LINK_INLINE_START( SwPagePreView, BtnPage, Button *, pButton )
{
- // OD 04.03.2003 #107369# - use new helper method to perform page up
+ // use new helper method to perform page up
// respectively page down.
_ExecPgUpAndPgDown( pButton == pPageUpBtn );
return 0;
}
IMPL_LINK_INLINE_END( SwPagePreView, BtnPage, Button *, pButton )
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
{
Rectangle aPixVisArea( aViewWin.LogicToPixel( aVisArea ) );
@@ -1497,7 +1351,7 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
{
ScrollViewSzChg();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT,
FN_PAGEUP, FN_PAGEDOWN, 0
@@ -1509,21 +1363,11 @@ int SwPagePreView::ChgPage( int eMvMode, int bUpdateScrollbar )
return bChg;
}
-
-/* */
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
// ab hier alles aus der SwView uebernommen
-
-
void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
{
-// const long nAdd = bInner ? 0 : ScrollBar::GetWindowOverlapPixel();
const StyleSettings &rSet = aViewWin.GetSettings().GetStyleSettings();
- const long nTmp = rSet.GetScrollBarSize();// - nAdd;
+ const long nTmp = rSet.GetScrollBarSize();
if ( pVScrollbar->IsVisible( sal_False ))
rToFill.Right() = nTmp;
if ( pHScrollbar->IsVisible( sal_False ) )
@@ -1531,11 +1375,6 @@ void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*
SetBorderPixel( rToFill );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize )
{
SvBorder aBorder;
@@ -1552,11 +1391,6 @@ void SwPagePreView::InnerResizePixel( const Point &rOfst, const Size &rSize )
//VisArea niemals einstellen!
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize )
{
SvBorder aBorder;
@@ -1580,11 +1414,6 @@ void SwPagePreView::OuterResizePixel( const Point &rOfst, const Size &rSize )
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar )
{
const Point aTopLeft(AlignToPixel(rRect.TopLeft()));
@@ -1609,7 +1438,7 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba
if(aLR.Right() < 0) aLR.Right() = 0;
if(aLR.Bottom() < 0) aLR.Bottom() = 0;
if(aLR == aVisArea ||
- // JP 29.10.97: Bug 45173 - Leeres Rechteck nicht beachten
+ // Leeres Rechteck nicht beachten
( 0 == aLR.Bottom() - aLR.Top() && 0 == aLR.Right() - aLR.Left() ) )
return;
@@ -1628,17 +1457,11 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba
// setze am View-Win die aktuelle Size
aVisArea = aLR;
aViewWin.SetWinSize( aLR.GetSize() );
- // OD 18.12.2002 #103492# - use new mode
ChgPage( SwPagePreViewWin::MV_NEWWINSIZE, bUpdateScrollbar );
aViewWin.Invalidate();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
{
if(!GetViewShell())
@@ -1657,7 +1480,6 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
Point aPos = pScrollbar->GetParent()->OutputToScreenPixel(
pScrollbar->GetPosPixel());
aPos.Y() = pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y();
- Size aSize = pScrollbar->GetSizePixel();
Rectangle aRect;
aRect.Left() = aPos.X() -8;
aRect.Right() = aRect.Left();
@@ -1673,17 +1495,12 @@ IMPL_LINK( SwPagePreView, ScrollHdl, SwScrollbar *, pScrollbar )
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
{
if(!GetViewShell())
return 0;
- // OD 04.03.2003 #107369# - boolean to avoid unnecessary invalidation of the window.
+ // boolean to avoid unnecessary invalidation of the window.
bool bInvalidateWin = true;
if( !pScrollbar->IsHoriScroll() ) // scroll vertically
@@ -1694,33 +1511,33 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
{
// wieviele Seiten scrollen ??
sal_uInt16 nThmbPos = (sal_uInt16)pScrollbar->GetThumbPos();
- // OD 05.12.2002 #103492# - adjust to new preview functionality
+ // adjust to new preview functionality
if( nThmbPos != aViewWin.SelectedPage() )
{
- // OD 17.01.2003 #103492# - consider case that page <nThmbPos>
+ // consider case that page <nThmbPos>
// is already visible
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
if ( pPagePrevwLay->IsPageVisible( nThmbPos ) )
{
pPagePrevwLay->MarkNewSelectedPage( nThmbPos );
- // OD 04.03.2003 #107369# - invalidation of window is unnecessary
+ // invalidation of window is unnecessary
bInvalidateWin = false;
}
else
{
- // OD 17.01.2003 #103492# - consider whether layout columns
+ // consider whether layout columns
// fit or not.
if ( !pPagePrevwLay->DoesPreviewLayoutColsFitIntoWindow() )
{
aViewWin.SetSttPage( nThmbPos );
aViewWin.SetSelectedPage( nThmbPos );
ChgPage( SwPagePreViewWin::MV_SCROLL, sal_False );
- // OD 20.01.2003 #103492# - update scrollbars
+ // update scrollbars
ScrollViewSzChg();
}
else
{
- // OD 04.03.2003 #107369# - correct scroll amount
+ // correct scroll amount
const sal_Int16 nPageDiff = nThmbPos - aViewWin.SelectedPage();
const sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
sal_Int16 nWinPagesToScroll = nPageDiff / nVisPages;
@@ -1733,12 +1550,12 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
aViewWin.Scroll( 0, pPagePrevwLay->GetWinPagesScrollAmount( nWinPagesToScroll ) );
}
}
- // OD 17.01.2003 #103492# - update accessibility
+ // update accessibility
GetViewShell()->ShowPreViewSelection( nThmbPos );
}
else
{
- // OD 04.03.2003 #107369# - invalidation of window is unnecessary
+ // invalidation of window is unnecessary
bInvalidateWin = false;
}
}
@@ -1753,36 +1570,27 @@ IMPL_LINK( SwPagePreView, EndScrollHdl, SwScrollbar *, pScrollbar )
long nThmbPos = pScrollbar->GetThumbPos();
aViewWin.Scroll(nThmbPos - aViewWin.GetPaintedPreviewDocRect().Left(), 0);
}
- // OD 24.03.2003 #108282# - additional invalidate page status.
- static sal_uInt16 __READONLY_DATA aInval[] =
+ // additional invalidate page status.
+ static sal_uInt16 aInval[] =
{
FN_START_OF_DOCUMENT, FN_END_OF_DOCUMENT, FN_PAGEUP, FN_PAGEDOWN,
FN_STAT_PAGE, 0
};
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( aInval );
- // OD 04.03.2003 #107369# - control invalidation of window
+ // control invalidation of window
if ( bInvalidateWin )
{
aViewWin.Invalidate();
}
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
Point SwPagePreView::AlignToPixel(const Point &rPt) const
{
return aViewWin.PixelToLogic( aViewWin.LogicToPixel( rPt ) );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::DocSzChgd( const Size &rSz )
{
if( aDocSz == rSz )
@@ -1790,7 +1598,7 @@ void SwPagePreView::DocSzChgd( const Size &rSz )
aDocSz = rSz;
- // --> OD 2009-08-20 #i96726#
+ // #i96726#
// Due to the multiple page layout it is needed to trigger recalculation
// of the page preview layout, even if the count of pages is not changing.
mnPageCount = GetViewShell()->GetNumPages();
@@ -1802,14 +1610,8 @@ void SwPagePreView::DocSzChgd( const Size &rSz )
aViewWin.Invalidate();
}
- // <--
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::ScrollViewSzChg()
{
if(!GetViewShell())
@@ -1819,10 +1621,10 @@ void SwPagePreView::ScrollViewSzChg()
if(GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow())
{
//vertical scrolling by row
- // OD 04.12.2002 #103492# - adjust to new preview functionality
+ // adjust to new preview functionality
sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol();
pVScrollbar->SetVisibleSize( nVisPages );
- // OD 19.02.2003 #107369# - set selected page as scroll bar position,
+ // set selected page as scroll bar position,
// if it is visible.
SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout();
if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) )
@@ -1839,7 +1641,7 @@ void SwPagePreView::ScrollViewSzChg()
Range aScrollbarRange( 1, mnPageCount );
// increase range by one, because left-top-corner is left blank.
++aScrollbarRange.Max();
- // OD 17.01.2003 #103492# - increase range in order to access all pages
+ // increase range in order to access all pages
aScrollbarRange.Max() += ( nVisPages - 1 );
pVScrollbar->SetRange( aScrollbarRange );
}
@@ -1879,35 +1681,17 @@ void SwPagePreView::ScrollViewSzChg()
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
void SwPagePreView::ScrollDocSzChg()
{
ScrollViewSzChg();
}
-
-/* */
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
// alles zum Thema Drucken
-
SfxPrinter* SwPagePreView::GetPrinter( sal_Bool bCreate )
{
return aViewWin.GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, bool )
{
ViewShell &rSh = *GetViewShell();
@@ -1942,16 +1726,16 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
rESh.SetModified();
rESh.EndAllAction();
- static sal_uInt16 __READONLY_DATA aInval[] =
+ static sal_uInt16 aInval[] =
{
SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE,
SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0
};
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
{
const sal_uInt16* pPtr = aInval + 1;
do {
- ASSERT( *(pPtr - 1) < *pPtr, "falsche Sortierung!" );
+ OSL_ENSURE( *(pPtr - 1) < *pPtr, "wrong sorting!" );
} while( *++pPtr );
}
#endif
@@ -1962,58 +1746,18 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
return 0;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions )
{
return ::CreatePrintOptionsPage( pParent, rOptions, !bNormalPrint );
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-// OD 18.12.2002 #103492# - no longer needed ??
Size SwPagePreView::GetOptimalSizePixel() const
{
- ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" )
+ OSL_FAIL( "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" );
return Size( -1, -1 );
-/*
- //JP 09.06.99: was wird hier errechnet ?????
-// ALT:
-// SfxApplicationWindow* pWin = SFX_APPWINDOW ;
-// Rectangle aRect = pWin->GetClientAreaPixel();
-
- Window& rWin = GetViewFrame()->GetWindow();
- Rectangle aRect( Point(0, 0), rWin.GetOutputSizePixel() );
- Size aMaxSize( aRect.GetWidth(), aRect.GetHeight() );
- Size aInSize = rWin.GetOutputSizePixel();
- Size aOutSize = rWin.GetSizePixel();
- sal_uInt16 nXBorder = sal_uInt16(aOutSize.Width() - aInSize.Width());
- sal_uInt16 nYBorder = sal_uInt16(aOutSize.Height() - aInSize.Height());
- aMaxSize.Width() -= nXBorder;
- //'auf Verdacht' etwas vom Border abziehen (Menue)
- nYBorder -= (nYBorder - nXBorder) / 2;
- aMaxSize.Height() -= nYBorder;
- //mit der max. moeglichen Outputsize guenstigstes Verhaeltnis ausrechnen
- aViewWin.GetOptimalSize(aMaxSize);
- // Border wieder dazuzaehlen
- aMaxSize.Height() += nYBorder;
- aMaxSize.Width() += nXBorder;
- return aMaxSize;
-*/
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-// OD 12.12.2002 #103492#
void SwPagePreViewWin::SetViewShell( ViewShell* pShell )
{
mpViewShell = pShell;
@@ -2025,7 +1769,7 @@ void SwPagePreViewWin::SetViewShell( ViewShell* pShell )
void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect )
{
- // OD 2004-03-04 #i24183#
+ // #i24183#
if ( mpPgPrevwLayout->PreviewLayoutValid() )
{
mpPgPrevwLayout->Repaint( Rectangle( rRect.Pos(), rRect.SSize() ) );
@@ -2034,13 +1778,12 @@ void SwPagePreViewWin::RepaintCoreRect( const SwRect& rRect )
/** method to adjust preview to a new zoom factor
- OD 02.12.2002 #103492#
- OD 24.09.2003 #i19975# - also consider zoom type - adding parameter <_eZoomType>
+ #i19975# also consider zoom type - adding parameter <_eZoomType>
*/
void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
const SvxZoomType _eZoomType )
{
- // OD 24.09.2003 #i19975# - consider zoom type
+ // #i19975# consider zoom type
if ( _eZoomType == SVX_ZOOM_WHOLEPAGE )
{
mnRow = 1;
@@ -2075,11 +1818,12 @@ void SwPagePreViewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor,
}
}
-/* -----------------04.12.2002 10:46-----------------
+
+/**
* pixel scrolling - horizontally always or vertically
* when less than the desired number of rows fits into
* the view
- * --------------------------------------------------*/
+ */
void SwPagePreViewWin::Scroll(long nXMove, long nYMove, sal_uInt16 /*nFlags*/)
{
maPaintedPreviewDocRect.Move(nXMove, nYMove);
@@ -2120,50 +1864,37 @@ sal_Bool SwPagePreView::HandleWheelCommands( const CommandEvent& rCEvt )
return bOk;
}
-
uno::Reference< ::com::sun::star::accessibility::XAccessible >
SwPagePreViewWin::CreateAccessible()
{
- vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
- // happend already!!!
+ SolarMutexGuard aGuard; // this should have happend already!!!
- DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" );
+ OSL_ENSURE( GetViewShell() != NULL, "We need a view shell" );
return GetViewShell()->CreateAccessiblePreview();
}
-/* -----------------------------06.05.2002 13:18------------------------------
-
- ---------------------------------------------------------------------------*/
void SwPagePreView::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
{
GetViewShell()->ApplyAccessiblityOptions(rAccessibilityOptions);
}
-/* -----------------------------2002/06/26 14:30------------------------------
- ---------------------------------------------------------------------------*/
void SwPagePreView::ShowHScrollbar(sal_Bool bShow)
{
pHScrollbar->Show(bShow);
InvalidateBorder();
}
-/* -----------------------------2002/06/26 14:30------------------------------
-
- ---------------------------------------------------------------------------*/
void SwPagePreView::ShowVScrollbar(sal_Bool bShow)
{
pVScrollbar->Show(bShow);
InvalidateBorder();
}
-/* -----------------25.11.2002 16:36-----------------
- *
- * --------------------------------------------------*/
void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
{
ViewShell& rSh = *GetViewShell();
SwViewOption aOpt(*rSh.GetViewOptions());
- // OD 16.12.2002 #103492# - perform action only on changes of zoom or zoom type.
+ // perform action only on changes of zoom or zoom type.
if ( aOpt.GetZoom() != nFactor ||
aOpt.GetZoomType() != eType )
{
@@ -2171,8 +1902,7 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
aOpt.SetZoomType(eType);
rSh.ApplyViewOptions( aOpt );
lcl_InvalidateZoomSlots(GetViewFrame()->GetBindings());
- // OD 02.12.2002 #103492#
- // OD 24.09.2003 #i19975# - also consider zoom type
+ // #i19975# also consider zoom type
aViewWin.AdjustPreviewToNewZoom( nFactor, eType );
ScrollViewSzChg();
}
@@ -2180,8 +1910,6 @@ void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor)
/** adjust position of vertical scrollbar
- OD 19.02.2003 #107369
-
@author OD
*/
void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos )
@@ -2191,3 +1919,5 @@ void SwPagePreView::SetVScrollbarThumbPos( const sal_uInt16 _nNewThumbPos )
pVScrollbar->SetThumbPos( _nNewThumbPos );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */