[Libreoffice-commits] .: 2 commits - sc/inc sc/source sw/source

Michael Meeks michael at kemper.freedesktop.org
Thu May 31 10:04:45 PDT 2012


 sc/inc/dociter.hxx                        |    1 
 sc/source/core/data/dociter.cxx           |    5 
 sw/source/core/view/pagepreviewlayout.cxx |  195 +++++++++++-
 sw/source/core/view/printdata.cxx         |    2 
 sw/source/core/view/vdraw.cxx             |  107 ++++++-
 sw/source/core/view/viewimp.cxx           |  148 +++++++++
 sw/source/core/view/viewpg.cxx            |   20 +
 sw/source/core/view/viewsh.cxx            |  454 +++++++++++++++++++++++++++---
 sw/source/core/view/vnew.cxx              |  115 +++++--
 sw/source/core/view/vprint.cxx            |  120 ++++++-
 10 files changed, 1039 insertions(+), 128 deletions(-)

New commits:
commit f2719a90ea29bc21f4b95b5e046c5b1d93965a2a
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 17:59:17 2012 +0100

    targetted revert of comment cleanup
    
    Change-Id: I9d7a761a0f479c30269e289796244572c0ed8d86

diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 4b85e1b..fff8fce 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -38,13 +38,15 @@
 #include <viewopt.hxx>
 #include <swregion.hxx>
 #include <comcore.hrc>
+// OD 19.02.2003 #107369# - method <SwAlignRect(..)>
 #include <frmtool.hxx>
+// OD 24.09.2003 #i19975#
 #include <svx/zoomitem.hxx>
 #include <printdata.hxx>
 
 #include <IDocumentDeviceAccess.hxx>
 
-// method to update statics for paint
+// OD 20.02.2003 #107369# - method to update statics for paint
 // Note: method defined in '/sw/source/core/layout/paintfrm.cxx'
 extern void SwCalcPixStatics( OutputDevice *pOut );
 
@@ -60,6 +62,7 @@ SwPagePreviewLayout::SwPagePreviewLayout( ViewShell& _rParentViewShell,
 {
     _Clear();
 
+    // OD 2004-03-05 #i18143#
     mbBookPreview = false;
     mbBookPreviewModeToggled = false;
 
@@ -95,6 +98,7 @@ void SwPagePreviewLayout::_Clear()
     mnSelectedPageNum = 0;
     _ClearPrevwPageData();
 
+    // OD 07.11.2003 #i22014#
     mbInPaint = false;
     mbNewLayoutDuringPaint = false;
 }
@@ -122,6 +126,12 @@ void SwPagePreviewLayout::_ClearPrevwPageData()
     maPrevwPages.clear();
 }
 
+/** calculate page preview layout sizes
+
+    OD 18.12.2002 #103492#
+
+    @author OD
+*/
 void SwPagePreviewLayout::_CalcPrevwLayoutSizes()
 {
     // calculate maximal page size; calculate also number of pages
@@ -160,6 +170,7 @@ void SwPagePreviewLayout::_CalcPrevwLayoutSizes()
 
         // document height
         // determine number of rows needed for <nPages> in preview layout
+        // OD 19.02.2003 #107369# - use method <GetRowOfPage(..)>.
         sal_uInt16 nDocRows = GetRowOfPage( mnPages );
         aDocSize.Height() = nDocRows * maMaxPageSize.Height() +
                             (nDocRows+1) * mnYFree;
@@ -170,12 +181,14 @@ void SwPagePreviewLayout::_CalcPrevwLayoutSizes()
 
 /** init page preview layout
 
+    OD 11.12.2002 #103492#
     initialize the page preview settings for a given layout.
     side effects:
     (1) If parameter <_bCalcScale> is true, mapping mode with calculated
     scaling is set at the output device and the zoom at the view options of
     the given view shell is set with the calculated scaling.
 
+    @author OD
 */
 bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
                                 const sal_uInt16 _nRows,
@@ -234,6 +247,7 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
         aMapMode.SetScaleX( aYScale );
         // set created mapping mode with calculated scaling at output device.
         mrParentViewShell.GetOut()->SetMapMode( aMapMode );
+        // OD 20.02.2003 #107369# - update statics for paint.
         ::SwCalcPixStatics( mrParentViewShell.GetOut() );
     }
 
@@ -245,6 +259,12 @@ bool SwPagePreviewLayout::Init( const sal_uInt16 _nCols,
     return true;
 }
 
+/** apply new zoom at given view shell
+
+    OD 11.12.2002 #103492# - implementation of <_ApplyNewZoomAtViewShell>
+
+    @author OD
+*/
 void SwPagePreviewLayout::_ApplyNewZoomAtViewShell( sal_uInt8 _aNewZoom )
 {
     SwViewOption aNewViewOptions = *(mrParentViewShell.GetViewOptions());
@@ -258,6 +278,12 @@ void SwPagePreviewLayout::_ApplyNewZoomAtViewShell( sal_uInt8 _aNewZoom )
     }
 }
 
+/** method to adjust page preview layout to document changes
+
+    OD 18.12.2002 #103492#
+
+    @author OD
+*/
 bool SwPagePreviewLayout::ReInit()
 {
     // check environment and parameters
@@ -278,8 +304,13 @@ bool SwPagePreviewLayout::ReInit()
 // =============================================================================
 // methods to prepare paint of page preview
 // =============================================================================
+/** prepare paint of page preview
 
-// _nProposedStartPageNum, _onStartPageNum are absolute
+    OD 12.12.2002 #103492#
+    OD 21.03.2003 #108282# - delete parameter _onStartPageVirtNum
+
+    @author OD, _nProposedStartPageNum, _onStartPageNum are absolute
+*/
 bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
                                    const Point      _aProposedStartPos,
                                    const Size&      _rPxWinSize,
@@ -337,7 +368,8 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
         // determine start page
         if ( _bStartWithPageAtFirstCol )
         {
-            // leaving left-top-corner blank is controlled by <mbBookPreview>.
+            // OD 19.02.2003 #107369# - leaving left-top-corner blank is
+            // controlled by <mbBookPreview>.
             if ( mbBookPreview &&
                  ( nProposedStartPageNum == 1 || nRowOfProposed == 1 )
                )
@@ -376,14 +408,16 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
         sal_uInt16 nRowOfProposed =
                 static_cast<sal_uInt16>(_aProposedStartPos.Y() / mnRowHeight) + 1;
         // determine start page == page at proposed start position
-        // leaving left-top-corner blank is controlled by <mbBookPreview>.
+        // OD 19.02.2003 #107369# - leaving left-top-corner blank is
+        // controlled by <mbBookPreview>.
         if ( mbBookPreview &&
              ( nRowOfProposed == 1 && nColOfProposed == 1 )
            )
             mnPaintPhyStartPageNum = 1;
         else
         {
-            // leaving left-top-corner blank is controlled by <mbBookPreview>.
+            // OD 19.02.2003 #107369# - leaving left-top-corner blank is
+            // controlled by <mbBookPreview>.
             mnPaintPhyStartPageNum = (nRowOfProposed-1) * mnCols + nColOfProposed;
             if ( mbBookPreview )
                 --mnPaintPhyStartPageNum;
@@ -414,7 +448,8 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
     _CalcDocPrevwPaintRect();
     _orDocPreviewPaintRect = maPaintedPrevwDocRect;
 
-    // shift visible preview document area to the left,if on the right is an area left blank.
+    // 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() )
     {
@@ -424,7 +459,9 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
                  _rPxWinSize, _onStartPageNum,
                  _orDocPreviewPaintRect, _bStartWithPageAtFirstCol );
     }
-    // shift visible preview document area to the left,if on the right is an area left blank.
+
+    // 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() )
@@ -454,7 +491,7 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
     // accessible pages with needed data.
     _CalcPreviewPages();
 
-    // indicate new layout, if print preview is in paint
+    // OD 07.11.2003 #i22014# - indicate new layout, if print preview is in paint
     if ( mbInPaint )
     {
         mbNewLayoutDuringPaint = true;
@@ -469,6 +506,12 @@ bool SwPagePreviewLayout::Prepare( const sal_uInt16 _nProposedStartPageNum,
     return true;
 }
 
+/** calculate additional paint offset
+
+    OD 12.12.2002 #103492#
+
+    @author OD
+*/
 void SwPagePreviewLayout::_CalcAdditionalPaintOffset()
 {
     if ( mnPrevwLayoutWidth <= maWinSize.Width() &&
@@ -496,6 +539,12 @@ void SwPagePreviewLayout::_CalcAdditionalPaintOffset()
     }
 }
 
+/** calculate painted preview document rectangle
+
+    OD 12.12.2002 #103492#
+
+    @author OD
+*/
 void SwPagePreviewLayout::_CalcDocPrevwPaintRect()
 {
     Point aTopLeftPos = maPaintPreviewDocOffset;
@@ -503,12 +552,14 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect()
 
     Size aSize;
     if ( mbDoesLayoutColsFitIntoWindow )
+        //aSize.Width() = mnPrevwLayoutWidth;
         aSize.Width() = Min( mnPrevwLayoutWidth,
                              maPreviewDocRect.GetWidth() - aTopLeftPos.X() );
     else
         aSize.Width() = Min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(),
                              maWinSize.Width() - maAdditionalPaintOffset.X() );
     if ( mbDoesLayoutRowsFitIntoWindow )
+        //aSize.Height() = mnPrevwLayoutHeight;
         aSize.Height() = Min( mnPrevwLayoutHeight,
                               maPreviewDocRect.GetHeight() - aTopLeftPos.Y() );
     else
@@ -517,6 +568,12 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect()
     maPaintedPrevwDocRect.SetSize( aSize );
 }
 
+/** calculate preview pages
+
+    OD 12.12.2002 #103492#
+
+    @author OD
+*/
 void SwPagePreviewLayout::_CalcPreviewPages()
 {
     _ClearPrevwPageData();
@@ -571,7 +628,8 @@ void SwPagePreviewLayout::_CalcPreviewPages()
         }
         if ( aCurrPaintOffset.X() < maWinSize.Width() )
         {
-            // leaving left-top-corner blank is controlled by <mbBookPreview>.
+            // OD 19.02.2003 #107369# - leaving left-top-corner blank is
+            // controlled by <mbBookPreview>.
             if ( mbBookPreview && pPage->GetPhyPageNum() == 1 && mnCols != 1 && nCurrCol == 1
                )
             {
@@ -612,6 +670,12 @@ void SwPagePreviewLayout::_CalcPreviewPages()
     }
 }
 
+/** determines preview data for a given page and a given preview offset
+
+    OD 13.12.2002 #103492#
+
+    @author OD
+*/
 bool SwPagePreviewLayout::_CalcPreviewDataForPage( const SwPageFrm& _rPage,
                                                    const Point& _rPrevwOffset,
                                                    PrevwPage* _opPrevwPage )
@@ -650,6 +714,12 @@ bool SwPagePreviewLayout::_CalcPreviewDataForPage( const SwPageFrm& _rPage,
     return true;
 }
 
+/** enable/disable book preview
+
+    OD 2004-03-04 #i18143#
+
+    @author OD
+*/
 bool SwPagePreviewLayout::SetBookPreviewMode( const bool _bEnableBookPreview,
                                               sal_uInt16& _onStartPageNum,
                                               Rectangle&  _orDocPreviewPaintRect )
@@ -687,7 +757,12 @@ bool SwPagePreviewLayout::SetBookPreviewMode( const bool _bEnableBookPreview,
 // methods to determine new data for changing the current shown part of the
 // document preview.
 // =============================================================================
+/** calculate start position for new scale
+
+    OD 12.12.2002 #103492#
 
+    @author OD
+*/
 Point SwPagePreviewLayout::GetPreviewStartPosForNewScale(
                           const Fraction& _aNewScale,
                           const Fraction& _aOldScale,
@@ -957,7 +1032,12 @@ SwTwips SwPagePreviewLayout::GetWinPagesScrollAmount(
 // =============================================================================
 // methods to paint page preview layout
 // =============================================================================
+/** paint prepared preview
 
+    OD 12.12.2002 #103492#
+
+    @author OD
+*/
 bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
 {
     // check environment and parameters
@@ -972,7 +1052,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
             return false;
     }
 
-    // #i22014# no paint if <superfluous> flag is set at layout
+    // OD 17.11.2003 #i22014# - no paint, if <superfluous> flag is set at layout
     if ( mrLayoutRootFrm.IsSuperfluous() )
     {
         return true;
@@ -980,7 +1060,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
 
     // environment and parameter ok
 
-    // #i22014#
+    // OD 07.11.2003 #i22014#
     if ( mbInPaint )
     {
         return false;
@@ -1041,8 +1121,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
                 const Color aRetouche( mrParentViewShell.Imp()->GetRetoucheColor() );
                 if( pOutputDev->GetFillColor() != aRetouche )
                     pOutputDev->SetFillColor( aRetouche );
-                pOutputDev->SetLineColor(); // no line color
-                // use aligned page rectangle
+                pOutputDev->SetLineColor(); // OD 20.02.2003 #107369# - no line color
+                // OD 20.02.2003 #107369# - use aligned page rectangle
                 {
                     SwRect aTmpPageRect( aPageRect );
                     ::SwAlignRect( aTmpPageRect, &mrParentViewShell);
@@ -1059,7 +1139,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
                                     TEXT_DRAW_CLIP );
                 pOutputDev->SetFont( aOldFont );
                 // paint shadow and border for empty page
-                // use new method to paint page border and shadow
+                // OD 19.02.2003 #107369# - use new method to paint page border and shadow
                 SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, false, true );
             }
             else
@@ -1068,7 +1148,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
                 aPxPaintRect.Intersection( aPxOutRect );
                 Rectangle aPaintRect = pOutputDev->PixelToLogic( aPxPaintRect );
                 mrParentViewShell.Paint( aPaintRect );
-                // #i80691# paint page border and shadow
+                // --> OD 2007-08-15 #i80691#
+                // paint page border and shadow
                 {
                     SwRect aPageBorderRect;
                     SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect,
@@ -1078,8 +1159,10 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
                     SwPageFrm::PaintBorderAndShadow( aPageRect, &mrParentViewShell, true, false, true );
                     mrParentViewShell.DLPostPaint2(true);
                 }
+                // <--
             }
-            // #i22014# stop painting, because new print preview layout is created during paint.
+            // OD 07.11.2003 #i22014# - stop painting, because new print
+            // preview layout is created during paint.
             if ( mbNewLayoutDuringPaint )
             {
                 break;
@@ -1093,7 +1176,8 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
         }
     }
 
-    // #i22014# no update of accessible preview, if a new print preview layout is created during paint.
+    // OD 17.11.2003 #i22014# - no update of accessible preview, if a new
+    // print preview layout is created during paint.
     if ( !mbNewLayoutDuringPaint )
     {
         // update at accessiblilty interface
@@ -1107,12 +1191,19 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
     pOutputDev->SetMapMode( aSavedMapMode );
     mrParentViewShell.aVisArea.Clear();
 
+    // OD 07.11.2003 #i22014#
     mbInPaint = false;
     mbNewLayoutDuringPaint = false;
 
     return true;
 }
 
+/** repaint pages on page preview
+
+    OD 18.12.2002 #103492#
+
+    @author OD
+*/
 void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
 {
     // check environment and parameters
@@ -1158,6 +1249,12 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
     }
 }
 
+/** paint selection mark at page
+
+    OD 17.12.2002 #103492#
+
+    @author OD
+*/
 void SwPagePreviewLayout::_PaintSelectMarkAtPage(
                                     const PrevwPage* _aSelectedPrevwPage ) const
 {
@@ -1183,20 +1280,20 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
     // calculate page rectangle in pixel coordinates
     SwRect aPageRect( _aSelectedPrevwPage->aLogicPos,
                          _aSelectedPrevwPage->aPageSize );
-    // use aligned page rectangle, as it is used for
+    // 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);
     Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
 
     // draw two rectangle
-    // adjust position of select mark rectangle
+    // OD 19.02.2003 #107369# - adjust position of select mark rectangle
     Rectangle aRect( aPxPageRect.Left(), aPxPageRect.Top(),
                        aPxPageRect.Right(), aPxPageRect.Bottom() );
     aRect = pOutputDev->PixelToLogic( aRect );
-    pOutputDev->SetFillColor(); // no fill color
+    pOutputDev->SetFillColor(); // OD 20.02.2003 #107369# - no fill color
     pOutputDev->SetLineColor( aSelPgLineColor );
     pOutputDev->DrawRect( aRect );
-    // adjust position of select mark rectangle
+    // OD 19.02.2003 #107369# - adjust position of select mark rectangle
     aRect = Rectangle( aPxPageRect.Left()+1, aPxPageRect.Top()+1,
                        aPxPageRect.Right()-1, aPxPageRect.Bottom()-1 );
     aRect = pOutputDev->PixelToLogic( aRect );
@@ -1210,8 +1307,14 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
     pOutputDev->SetMapMode( aSavedMapMode );
 }
 
-// Perform paint for current selected page in order to unmark it.
-// Set new selected page and perform paint to mark this page.
+/** paint to mark new selected page
+
+    OD 17.12.2002 #103492#
+    Perform paint for current selected page in order to unmark it.
+    Set new selected page and perform paint to mark this page.
+
+    @author OD, _nSelectedPage, mnSelectedPage are absolut
+*/
 void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
 {
     sal_uInt16 nOldSelectedPageNum = mnSelectedPageNum;
@@ -1221,7 +1324,7 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
     const PrevwPage* pOldSelectedPrevwPage = _GetPrevwPageByPageNum( nOldSelectedPageNum );
     if ( pOldSelectedPrevwPage && pOldSelectedPrevwPage->bVisible )
     {
-        // invalidate only areas of selection mark.
+        // OD 20.02.2003 #107369# - invalidate only areas of selection mark.
         SwRect aPageRect( pOldSelectedPrevwPage->aPrevwWinPos,
                               pOldSelectedPrevwPage->aPageSize );
         ::SwAlignRect( aPageRect, &mrParentViewShell);
@@ -1255,7 +1358,12 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
 // =============================================================================
 // helper methods
 // =============================================================================
+/** get preview page by physical page number
+
+    OD 17.12.2002 #103492#
 
+    @author OD
+*/
 struct EqualsPageNumPred
 {
     const sal_uInt16 mnPageNum;
@@ -1278,9 +1386,16 @@ const PrevwPage* SwPagePreviewLayout::_GetPrevwPageByPageNum( const sal_uInt16 _
         return (*aFoundPrevwPageIter);
 }
 
+/** determine row the page with the given number is in
+
+    OD 17.01.2003 #103492#
+
+    @author OD, _nPageNum is relative
+*/
 sal_uInt16 SwPagePreviewLayout::GetRowOfPage( sal_uInt16 _nPageNum ) const
 {
-    // leaving left-top-corner blank is controlled by <mbBookPreview>.
+    // OD 19.02.2003 #107369# - leaving left-top-corner blank is controlled
+    // by <mbBookPreview>.
     if ( mbBookPreview )
     {
         // Note: increase given physical page number by one, because left-top-corner
@@ -1294,9 +1409,17 @@ sal_uInt16 SwPagePreviewLayout::GetRowOfPage( sal_uInt16 _nPageNum ) const
 
     return nRow;
 }
+
+/** determine column the page with the given number is in
+
+    OD 17.01.2003 #103492#
+
+    @author OD, _nPageNum is relative
+*/
 sal_uInt16 SwPagePreviewLayout::GetColOfPage( sal_uInt16 _nPageNum ) const
 {
-    // leaving left-top-corner blank is controlled by <mbBookPreview>.
+    // OD 19.02.2003 #107369# - leaving left-top-corner blank is controlled
+    // by <mbBookPreview>.
     if ( mbBookPreview )
     {
         // Note: increase given physical page number by one, because left-top-corner
@@ -1317,6 +1440,12 @@ Size SwPagePreviewLayout::GetPrevwDocSize() const
     return maPreviewDocRect.GetSize();
 }
 
+/** get size of a preview page by its physical page number
+
+    OD 15.01.2003 #103492#
+
+    @author OD
+*/
 Size SwPagePreviewLayout::GetPrevwPageSizeByPageNum( sal_uInt16 _nPageNum ) const
 {
     const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum );
@@ -1330,6 +1459,12 @@ Size SwPagePreviewLayout::GetPrevwPageSizeByPageNum( sal_uInt16 _nPageNum ) cons
     }
 }
 
+/** get virtual page number by its physical page number
+
+    OD 21.03.2003 #108282#
+
+    @author OD
+*/
 sal_uInt16 SwPagePreviewLayout::GetVirtPageNumByPageNum( sal_uInt16 _nPageNum ) const
 {
     const PrevwPage* pPrevwPage = _GetPrevwPageByPageNum( _nPageNum );
@@ -1343,6 +1478,10 @@ sal_uInt16 SwPagePreviewLayout::GetVirtPageNumByPageNum( sal_uInt16 _nPageNum )
     }
 }
 
+/** Convert absolute to relative page numbers (see PrintEmptyPages)
+
+    @author FME
+*/
 sal_uInt16 SwPagePreviewLayout::ConvertAbsoluteToRelativePageNum( sal_uInt16 _nAbsPageNum ) const
 {
     if ( mbBookPreview || mbPrintEmptyPages || !_nAbsPageNum )
@@ -1365,6 +1504,10 @@ sal_uInt16 SwPagePreviewLayout::ConvertAbsoluteToRelativePageNum( sal_uInt16 _nA
     return nRet;
 }
 
+/** Convert relative to absolute page numbers (see PrintEmptyPages)
+
+    @author FME
+*/
 sal_uInt16 SwPagePreviewLayout::ConvertRelativeToAbsolutePageNum( sal_uInt16 _nRelPageNum ) const
 {
     if ( mbBookPreview || mbPrintEmptyPages || !_nRelPageNum )
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 870ecbe..4e6d37f 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -86,7 +86,7 @@ void SwRenderData::DeletePostItData()
 {
     if (HasPostItData())
     {
-        // So that the printer remains at the real DOC
+        // printer needs to remain at the real document
         m_pPostItShell->GetDoc()->setPrinter( 0, false, false );
         m_pPostItShell.reset();
         m_pPostItFields.reset();
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index b388c85..8139e2a 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -37,6 +37,8 @@
 #include <fmtanchr.hxx>
 #include <frmfmt.hxx>
 
+/// OD 29.08.2002 #102450#
+/// include <svx/svdoutl.hxx>
 #include <svx/svdoutl.hxx>
 
 #include "fesh.hxx"
@@ -54,13 +56,51 @@
 #include <IDocumentDrawModelAccess.hxx>
 
 
+/*************************************************************************
+|*
+|*  SwSaveHdl
+|*
+|*  Ersterstellung      MA 14. Feb. 95
+|*  Letzte Aenderung    MA 02. Jun. 98
+|*
+|*************************************************************************/
+//SwSaveHdl::SwSaveHdl( SwViewImp *pI ) :
+//  pImp( pI ),
+//  bXorVis( FALSE )
+//{
+    //if ( pImp->HasDrawView() )
+    //{
+    //  bXorVis = pImp->GetDrawView()->IsShownXorVisible( pImp->GetShell()->GetOut());
+    //  if ( bXorVis )
+    //      pImp->GetDrawView()->HideShownXor( pImp->GetShell()->GetOut() );
+    //}
+//}
+
+
+//SwSaveHdl::~SwSaveHdl()
+//{
+    //if ( bXorVis )
+    //  pImp->GetDrawView()->ShowShownXor( pImp->GetShell()->GetOut() );
+//}
+
+
+/*************************************************************************
+|*
+|*  SwViewImp::StartAction(), EndAction()
+|*
+|*  Ersterstellung      MA 14. Feb. 95
+|*  Letzte Aenderung    MA 14. Sep. 98
+|*
+|*************************************************************************/
 void SwViewImp::StartAction()
 {
     if ( HasDrawView() )
     {
         SET_CURR_SHELL( GetShell() );
         if ( pSh->ISA(SwFEShell) )
-            ((SwFEShell*)pSh)->HideChainMarker();
+            ((SwFEShell*)pSh)->HideChainMarker();   //Kann sich geaendert haben
+        //bResetXorVisibility = GetDrawView()->IsShownXorVisible( GetShell()->GetOut());
+        //GetDrawView()->HideShownXor( GetShell()->GetOut() );
     }
 }
 
@@ -69,20 +109,34 @@ void SwViewImp::EndAction()
     if ( HasDrawView() )
     {
         SET_CURR_SHELL( GetShell() );
+        //if ( bResetXorVisibility )
+        //  GetDrawView()->ShowShownXor( GetShell()->GetOut() );
         if ( pSh->ISA(SwFEShell) )
-            ((SwFEShell*)pSh)->SetChainMarker();   // May have changed
+            ((SwFEShell*)pSh)->SetChainMarker();    //Kann sich geaendert haben
     }
 }
 
+/*************************************************************************
+|*
+|*  SwViewImp::LockPaint(), UnlockPaint()
+|*
+|*  Ersterstellung      MA 11. Jun. 96
+|*  Letzte Aenderung    MA 11. Jun. 96
+|*
+|*************************************************************************/
 void SwViewImp::LockPaint()
 {
     if ( HasDrawView() )
     {
+        //HMHbShowHdlPaint = GetDrawView()->IsMarkHdlShown();
+        //HMHif ( bShowHdlPaint )
+        //HMH   GetDrawView()->HideMarkHdl();
         bResetHdlHiddenPaint = !GetDrawView()->areMarkHandlesHidden();
         GetDrawView()->hideMarkHandles();
     }
     else
     {
+        //HMHbShowHdlPaint = FALSE;
         bResetHdlHiddenPaint = sal_False;
     }
 }
@@ -91,8 +145,25 @@ void SwViewImp::UnlockPaint()
 {
     if ( bResetHdlHiddenPaint )
         GetDrawView()->showMarkHandles();
+    //HMHif ( bShowHdlPaint )
+    //HMH   GetDrawView()->ShowMarkHdl();
 }
 
+/*************************************************************************
+|*
+|*  SwViewImp::PaintLayer(), PaintDispatcher()
+|*
+|*  Ersterstellung      MA 20. Dec. 94
+|*  Letzte Aenderung    AMA 04. Jun. 98
+|*
+|*************************************************************************/
+// OD 29.08.2002 #102450#
+// add 3rd paramter <const Color* pPageBackgrdColor> for setting this
+// color as the background color at the outliner of the draw view.
+// OD 09.12.2002 #103045# - add 4th parameter for the horizontal text direction
+// of the page in order to set the default horizontal text direction at the
+// outliner of the draw view for painting layers <hell> and <heaven>.
+// OD 25.06.2003 #108784# - correct type of 1st parameter
 void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
                             SwPrintData const*const pPrintData,
                             const SwRect& ,
@@ -112,11 +183,14 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
             pOutDev->SetDrawMode( nOldDrawMode | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL |
                                 DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
         }
+
+        // OD 29.08.2002 #102450#
         // For correct handling of accessibility, high contrast, the page background
         // color is set as the background color at the outliner of the draw view.
         // Only necessary for the layers hell and heaven
         Color aOldOutlinerBackgrdColor;
-        // set default horizontal text direction on painting <hell> or <heaven>.
+        // OD 09.12.2002 #103045# - set default horizontal text direction on
+        // painting <hell> or <heaven>.
         EEHorizontalTextDirection aOldEEHoriTextDir = EE_HTEXTDIR_L2R;
         const IDocumentDrawModelAccess* pIDDMA = GetShell()->getIDocumentDrawModelAccess();
         if ( (_nLayerID == pIDDMA->GetHellId()) ||
@@ -148,8 +222,9 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
         GetPageView()->DrawLayer( _nLayerID, pOutDev, pRedirector );
         pOutDev->Pop();
 
+        // OD 29.08.2002 #102450#
         // reset background color of the outliner
-        // reset default horizontal text direction
+        // OD 09.12.2002 #103045# - reset default horizontal text direction
         if ( (_nLayerID == pIDDMA->GetHellId()) ||
              (_nLayerID == pIDDMA->GetHeavenId()) )
         {
@@ -161,6 +236,14 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
     }
 }
 
+/*************************************************************************
+|*
+|*  SwViewImp::IsDragPossible()
+|*
+|*  Ersterstellung      MA 19. Jan. 93
+|*  Letzte Aenderung    MA 16. Jan. 95
+|*
+|*************************************************************************/
 #define WIEDUWILLST 400
 
 sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
@@ -192,6 +275,15 @@ sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
     return aRect.IsInside( rPoint );
 }
 
+/*************************************************************************
+|*
+|*  SwViewImp::NotifySizeChg()
+|*
+|*  Ersterstellung      MA 23. Jun. 93
+|*  Letzte Aenderung    MA 05. Oct. 98
+|*
+|*************************************************************************/
+
 void SwViewImp::NotifySizeChg( const Size &rNewSz )
 {
     if ( !HasDrawView() )
@@ -200,6 +292,7 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
     if ( GetPageView() )
         GetPageView()->GetPage()->SetSize( rNewSz );
 
+    //Begrenzung des Arbeitsbereiches.
     const Rectangle aRect( Point( DOCUMENTBORDER, DOCUMENTBORDER ), rNewSz );
     const Rectangle &rOldWork = GetDrawView()->GetWorkArea();
     sal_Bool bCheckDrawObjs = sal_False;
@@ -220,6 +313,8 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
         SdrObject *pObj = pPage->GetObj( nObj );
         if( !pObj->ISA(SwVirtFlyDrawObj) )
         {
+            //Teilfix(26793): Objekte, die in Rahmen verankert sind, brauchen
+            //nicht angepasst werden.
             const SwContact *pCont = (SwContact*)GetUserCall(pObj);
             //JP - 16.3.00 Bug 73920: this function might be called by the
             //              InsertDocument, when a PageDesc-Attribute is
@@ -236,7 +331,7 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
                 continue;
             }
 
-            // no move for drawing objects in header/footer
+            // OD 19.06.2003 #108784# - no move for drawing objects in header/footer
             if ( pAnchor->FindFooterOrHeader() )
             {
                 continue;
@@ -253,7 +348,7 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz )
                 if ( aSz.Width() || aSz.Height() )
                     pObj->Move( aSz );
 
-                //Note anchor: Large objects can not disappear from the top.
+                //Notanker: Grosse Objekte nicht nach oben verschwinden lassen.
                 aSz.Width() = aSz.Height() = 0;
                 if ( aBound.Bottom() < aRect.Top() )
                     aSz.Width() = (aBound.Bottom() - aRect.Top()) - MINFLY;
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 337d3f1..264e4ea 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -44,6 +44,7 @@
 #include <svx/svdpage.hxx>
 #include <accmap.hxx>
 
+// OD 12.12.2002 #103492#
 #include <pagepreviewlayout.hxx>
 
 #include <comcore.hrc>
@@ -53,10 +54,18 @@
 #include <IDocumentDeviceAccess.hxx>
 #include <IDocumentSettingAccess.hxx>
 
+/*************************************************************************
+|*
+|*  SwViewImp::Init()
+|*
+|*  Ersterstellung      MA 25. Jul. 94
+|*  Letzte Aenderung    MA 03. Nov. 95
+|*
+|*************************************************************************/
 void SwViewImp::Init( const SwViewOption *pNewOpt )
 {
     OSL_ENSURE( pDrawView, "SwViewImp::Init without DrawView" );
-    //Now create the page view if it does not exist.
+    //Jetzt die PageView erzeugen wenn sie noch nicht existiert.
     SwRootFrm *pRoot = pSh->GetLayout();    //swmod 071108//swmod 071225
     if ( !pSdrPageView )
     {
@@ -68,7 +77,8 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
             pRoot->GetDrawPage()->SetSize( pRoot->Frm().SSize() );
 
         pSdrPageView = pDrawView->ShowSdrPage( pRoot->GetDrawPage());
-        // notify drawing page view about invisible layers.
+        // OD 26.06.2003 #108784# - notify drawing page view about invisible
+        // layers.
         pIDDMA->NotifyInvisibleLayers( *pSdrPageView );
     }
     pDrawView->SetDragStripes( pNewOpt->IsCrossHair() );
@@ -96,6 +106,15 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
     pDrawView->SetMarkHdlSizePixel(9);
 }
 
+/*************************************************************************
+|*
+|*  SwViewImp::SwViewImp()  CTor fuer die Core-Internas
+|*
+|*  Ersterstellung      MA 25. Jul. 94
+|*  Letzte Aenderung    MA 06. Sep. 96
+|*
+|*************************************************************************/
+
 SwViewImp::SwViewImp( ViewShell *pParent ) :
     pSh( pParent ),
     pDrawView( 0 ),
@@ -107,19 +126,33 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
     pAccMap( 0 ),
     pSdrObjCached(NULL),
     nRestoreActions( 0 ),
+    // OD 12.12.2002 #103492#
     mpPgPrevwLayout( 0 )
 {
+    //bResetXorVisibility =
+    //HMHbShowHdlPaint =
     bResetHdlHiddenPaint =
     bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
     bFirstPageInvalid = sal_True;
 }
 
+/******************************************************************************
+|*
+|*  SwViewImp::~SwViewImp()
+|*
+|*  Ersterstellung      MA 25. Jul. 94
+|*  Letzte Aenderung    MA 16. Dec. 94
+|*
+******************************************************************************/
+
 SwViewImp::~SwViewImp()
 {
     delete pAccMap;
 
+    // OD 12.12.2002 #103492#
     delete mpPgPrevwLayout;
 
+    //JP 29.03.96: nach ShowSdrPage muss auch HideSdrPage gemacht werden!!!
     if( pDrawView )
          pDrawView->HideSdrPage();
 
@@ -131,11 +164,29 @@ SwViewImp::~SwViewImp()
     OSL_ENSURE( !pIdleAct,"Be idle for the rest of your life." );
 }
 
+/******************************************************************************
+|*
+|*  SwViewImp::DelRegions()
+|*
+|*  Ersterstellung      MA 14. Apr. 94
+|*  Letzte Aenderung    MA 14. Apr. 94
+|*
+******************************************************************************/
+
 void SwViewImp::DelRegion()
 {
     DELETEZ(pRegion);
 }
 
+/******************************************************************************
+|*
+|*  SwViewImp::AddPaintRect()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 27. Jul. 94
+|*
+******************************************************************************/
+
 sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
 {
     if ( rRect.IsOver( pSh->VisArea() ) )
@@ -148,12 +199,30 @@ sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
     return sal_False;
 }
 
+/******************************************************************************
+|*
+|*  ViewImp::CheckWaitCrsr()
+|*
+|*  Ersterstellung      MA 10. Aug. 94
+|*  Letzte Aenderung    MA 10. Aug. 94
+|*
+******************************************************************************/
+
 void SwViewImp::CheckWaitCrsr()
 {
     if ( pLayAct )
         pLayAct->CheckWaitCrsr();
 }
 
+/******************************************************************************
+|*
+|*  ViewImp::IsCalcLayoutProgress()
+|*
+|*  Ersterstellung      MA 12. Aug. 94
+|*  Letzte Aenderung    MA 12. Aug. 94
+|*
+******************************************************************************/
+
 sal_Bool SwViewImp::IsCalcLayoutProgress() const
 {
     if ( pLayAct )
@@ -161,6 +230,15 @@ sal_Bool SwViewImp::IsCalcLayoutProgress() const
     return sal_False;
 }
 
+/******************************************************************************
+|*
+|*  ViewImp::IsUpdateExpFlds()
+|*
+|*  Ersterstellung      MA 28. Mar. 96
+|*  Letzte Aenderung    MA 28. Mar. 96
+|*
+******************************************************************************/
+
 sal_Bool SwViewImp::IsUpdateExpFlds()
 {
     if ( pLayAct && pLayAct->IsCalcLayout() )
@@ -171,12 +249,24 @@ sal_Bool SwViewImp::IsUpdateExpFlds()
      return sal_False;
 }
 
+
+/******************************************************************************
+|*
+|*  SwViewImp::SetFirstVisPage(), ImplGetFirstVisPage();
+|*
+|*  Ersterstellung      MA 21. Sep. 93
+|*  Letzte Aenderung    MA 08. Mar. 94
+|*
+******************************************************************************/
+
 void SwViewImp::SetFirstVisPage()
 {
     if ( pSh->bDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() )
     {
-        //We are in an "Action", and the VisArea is behind the first visible page due
-        //to delete operations. To prevent expensive formatting, return the last page
+        //Wir stecken in einer Action und die VisArea sitzt wegen
+        //Loeschoperationen hinter der erste sichtbaren Seite.
+        //Damit nicht zu heftig Formatiert wird, liefern wir die letzte Seite
+        //zurueck.
         pFirstVisPage = (SwPageFrm*)pSh->GetLayout()->Lower();
         while ( pFirstVisPage && pFirstVisPage->GetNext() )
             pFirstVisPage = (SwPageFrm*)pFirstVisPage->GetNext();
@@ -206,6 +296,15 @@ void SwViewImp::SetFirstVisPage()
     bFirstPageInvalid = sal_False;
 }
 
+/******************************************************************************
+|*
+|*  SwViewImp::MakeDrawView();
+|*
+|*  Ersterstellung      AMA 01. Nov. 95
+|*  Letzte Aenderung    AMA 01. Nov. 95
+|*
+******************************************************************************/
+
 void SwViewImp::MakeDrawView()
 {
     IDocumentDrawModelAccess* pIDDMA = GetShell()->getIDocumentDrawModelAccess();
@@ -230,6 +329,7 @@ void SwViewImp::MakeDrawView()
 
             if(!pOutDevForDrawView)
             {
+                // pOutDevForDrawView = (OutputDevice*)GetShell()->getIDocumentDeviceAccess()->getPrinter( false );
                 pOutDevForDrawView = GetShell()->GetOut();
             }
 
@@ -240,7 +340,8 @@ void SwViewImp::MakeDrawView()
         const SwViewOption* pSwViewOption = GetShell()->GetViewOptions();
         Init(pSwViewOption);
 
-        // #i68597# If document is read-only, we will not profit from overlay, so switch it off.
+        // #i68597# If document is read-only, we will not profit from overlay,
+        // so switch it off.
         if(pDrawView && pDrawView->IsBufferedOverlayAllowed())
         {
             if(pSwViewOption->IsReadonly())
@@ -251,6 +352,15 @@ void SwViewImp::MakeDrawView()
     }
 }
 
+/******************************************************************************
+|*
+|*  SwViewImp::GetRetoucheColor()
+|*
+|*  Ersterstellung      MA 24. Jun. 98
+|*  Letzte Aenderung    MA 24. Jun. 98
+|*
+******************************************************************************/
+
 Color SwViewImp::GetRetoucheColor() const
 {
     Color aRet( COL_TRANSPARENT );
@@ -269,6 +379,12 @@ Color SwViewImp::GetRetoucheColor() const
     return aRet;
 }
 
+/** create page preview layout
+
+    OD 12.12.2002 #103492#
+
+    @author OD
+*/
 void SwViewImp::InitPagePreviewLayout()
 {
     OSL_ENSURE( pSh->GetLayout(), "no layout - page preview layout can not be created.");
@@ -371,7 +487,12 @@ void SwViewImp::InvalidateAccessibleRelationSet( const SwFlyFrm *pMaster,
     } while ( pTmp != pVSh );
 }
 
-// #i27138# invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
+ /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
+
+    OD 2005-12-01 #i27138#
+
+    @author OD
+*/
 void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
                                                        const SwTxtFrm* _pToTxtFrm )
 {
@@ -402,7 +523,12 @@ void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxt
     } while ( pTmp != pVSh );
 }
 
-//#i27301# invalidate text selection for paragraphs
+/** invalidate text selection for paragraphs
+
+    OD 2005-12-12 #i27301#
+
+    @author OD
+*/
 void SwViewImp::_InvalidateAccessibleParaTextSelection()
 {
     ViewShell* pVSh = GetShell();
@@ -418,7 +544,12 @@ void SwViewImp::_InvalidateAccessibleParaTextSelection()
     } while ( pTmp != pVSh );
 }
 
-//#i88069# invalidate attributes for paragraphs
+/** invalidate attributes for paragraphs
+
+    OD 2009-01-06 #i88069#
+
+    @author OD
+*/
 void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
 {
     ViewShell* pVSh = GetShell();
@@ -434,6 +565,7 @@ void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
     } while ( pTmp != pVSh );
 }
 
+// OD 15.01.2003 #103492# - method signature change due to new page preview functionality
 void SwViewImp::UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages,
                                          const Fraction&  _rScale,
                                          const SwPageFrm* _pSelectedPageFrm,
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index f7969d1..2dc676c 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -60,6 +60,7 @@ using namespace ::com::sun::star;
 SwPageFrm const*
 lcl_getPage(SwRootFrm const& rLayout, sal_Int32 const nPage); // vprint.cxx
 
+// OD 12.12.2002 #103492#
 SwPagePreviewLayout* ViewShell::PagePreviewLayout()
 {
     return Imp()->PagePreviewLayout();
@@ -70,7 +71,10 @@ void ViewShell::ShowPreViewSelection( sal_uInt16 nSelPage )
     Imp()->InvalidateAccessiblePreViewSelection( nSelPage );
 }
 
-//#i6467# adjust view options for page preview
+/** adjust view options for page preview
+
+    OD 09.01.2003 #i6467#
+*/
 void ViewShell::AdjustOptionsForPagePreview(SwPrintData const& rPrintOptions)
 {
     if ( !IsPreView() )
@@ -84,7 +88,9 @@ void ViewShell::AdjustOptionsForPagePreview(SwPrintData const& rPrintOptions)
     return;
 }
 
-//#i14016# - consider empty pages on calculation of the scaling for a page to be printed.
+// print brochure
+// OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling
+// for a page to be printed.
 void ViewShell::PrintProspect(
     OutputDevice *pOutDev,
     const SwPrintData &rPrintData,
@@ -103,10 +109,12 @@ void ViewShell::PrintProspect(
 
     std::pair< sal_Int32, sal_Int32 > rPagesToPrint =
             rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ];
+// const USHORT nPageMax = static_cast< USHORT >(rPagesToPrint.first > rPagesToPrint.second ?
+//            rPagesToPrint.first : rPagesToPrint.second);
     OSL_ENSURE( rPagesToPrint.first  == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" );
     OSL_ENSURE( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" );
 
-    // create a new shell for the Printer
+    // eine neue Shell fuer den Printer erzeugen
     ViewShell aShell( *this, 0, pPrinter );
 
     SET_CURR_SHELL( &aShell );
@@ -131,7 +139,8 @@ void ViewShell::PrintProspect(
         pNxtPage = lcl_getPage(*aShell.GetLayout(), rPagesToPrint.second);
     }
 
-    //#i14016# - consider empty pages on calculation of page size, used for calculation of scaling.
+    // OD 05.05.2003 #i14016# - consider empty pages on calculation
+    // of page size, used for calculation of scaling.
     Size aSttPageSize;
     if ( pStPage )
     {
@@ -179,6 +188,7 @@ void ViewShell::PrintProspect(
         nMaxRowSz = Max( aNxtPageSize.Height(), aSttPageSize.Height() );
     }
 
+    // den MapMode einstellen
     aMapMode.SetOrigin( Point() );
     {
         Fraction aScX( aPrtSize.Width(), nMaxColSz );
@@ -187,6 +197,8 @@ void ViewShell::PrintProspect(
             aScY = aScX;
 
         {
+            // fuer Drawing, damit diese ihre Objecte vernuenftig Painten
+            // koennen, auf "glatte" Prozentwerte setzen
             aScY *= Fraction( 1000, 1 );
             long nTmp = (long)aScY;
             if( 1 < nTmp )
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 04717dd..a7dccd7 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -37,6 +37,9 @@
 #include <svx/srchdlg.hxx>
 #include <svx/svdobj.hxx>
 #include <sfx2/viewsh.hxx>
+#ifndef _SHL_HXX
+//#include <tools/shl.hxx>
+#endif
 #include <swwait.hxx>
 #include <swmodule.hxx>
 #include <fesh.hxx>
@@ -68,9 +71,12 @@
 #include <accessibilityoptions.hxx>
 #include <statstr.hrc>
 #include <comcore.hrc>
+// OD 14.01.2003 #103492#
 #include <pagepreviewlayout.hxx>
+// --> OD 2004-05-24 #i28701#
 #include <sortedobjs.hxx>
 #include <anchoredobject.hxx>
+// <--
 
 #include "../../ui/inc/view.hxx"
 #include <PostItMgr.hxx>
@@ -78,6 +84,7 @@
 
 #include <vcl/svapp.hxx>
 
+// #i74769#
 #include <svx/sdrpaintwindow.hxx>
 
 sal_Bool ViewShell::bLstAct = sal_False;
@@ -196,9 +203,17 @@ void ViewShell::DLPostPaint2(bool bPaintFormLayer)
 
 //////////////////////////////////////////////////////////////////////////////
 
+/******************************************************************************
+|*
+|*  ViewShell::ImplEndAction()
+|*
+|*  Letzte Aenderung    MA 04. Sep. 96
+|*
+******************************************************************************/
+
 void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
 {
-    //There is nothing to do here for the printer
+    //Fuer den Drucker gibt es hier nichts zu tun.
     if ( !GetWin() || IsPreView() )
     {
         bPaintWorks = sal_True;
@@ -207,6 +222,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
     }
 
     bInEndAction = sal_True;
+    //Laeuft hiermit das EndAction der Letzten Shell im Ring?
 
     ViewShell::bLstAct = sal_True;
     ViewShell *pSh = (ViewShell*)this->GetNext();
@@ -245,8 +261,9 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
     if ( bIsShellForCheckViewLayout )
         GetLayout()->CheckViewLayout( GetViewOptions(), &aVisArea );
 
-    //If we do not generate Paints, we wait for the paint by the system.
-    //Then, the clipping is set correctly, for example: move a DrawObject.
+    //Wenn wir selbst keine Paints erzeugen, so warten wir auf das Paint
+    //vom System. Dann ist das Clipping korrekt gesetzt; Beispiel: verschieben
+    //eines DrawObjektes.
     if ( Imp()->GetRegion()     ||
          aInvalidRect.HasArea() ||
          bExtraData )
@@ -269,6 +286,12 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
 
             SwRegionRects *pRegion = Imp()->GetRegion();
 
+            //JP 27.11.97: wer die Selection hided, muss sie aber auch
+            //              wieder Showen. Sonst gibt es Paintfehler!
+            //  z.B.: addional Mode, Seite vertikal hab zu sehen, in der
+            // Mitte eine Selektion und mit einem anderen Cursor an linken
+            // rechten Rand springen. Ohne ShowCrsr verschwindet die
+            // Selektion
             sal_Bool bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
             if( bShowCrsr )
                 ((SwCrsrShell*)this)->HideCrsrs();
@@ -279,7 +302,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
 
                 Imp()->pRegion = NULL;
 
-                // First Invert then Compress, never the other way round!
+                //Erst Invert dann Compress, niemals andersherum!
                 pRegion->Invert();
 
                 pRegion->Compress();
@@ -293,6 +316,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
                     sal_Bool bPaint = sal_True;
                     if ( IsEndActionByVirDev() )
                     {
+                        //virtuelles device erzeugen und einstellen.
                         if ( !pVout )
                             pVout = new VirtualDevice( *GetOut() );
                         MapMode aMapMode( GetOut()->GetMapMode() );
@@ -322,9 +346,11 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
                         {
                             bPaint = sal_False;
 
+                            // --> OD 2007-07-26 #i79947#
                             // #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
                             const Region aRepaintRegion(aRect.SVRect());
                             DLPrePaint2(aRepaintRegion);
+                            // <--
 
                             OutputDevice  *pOld = GetOut();
                             pVout->SetLineColor( pOld->GetLineColor() );
@@ -420,6 +446,10 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
     Imp()->EndAction();
 
 
+    //Damit sich die automatischen Scrollbars auch richtig anordnen k?nnen
+    //muessen wir die Aktion hier kuenstlich beenden (EndAction loesst ein
+    //Notify aus, und das muss Start-/EndAction rufen um die  Scrollbars
+    //klarzubekommen.
     --nStartAction;
     UISizeNotify();
     ++nStartAction;
@@ -428,16 +458,35 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
         Imp()->FireAccessibleEvents();
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::ImplStartAction()
+|*
+|*  Ersterstellung      MA 25. Jul. 94
+|*  Letzte Aenderung    MA 25. Jul. 94
+|*
+******************************************************************************/
+
 void ViewShell::ImplStartAction()
 {
     bPaintWorks = sal_False;
     Imp()->StartAction();
 }
 
+
+/******************************************************************************
+|*
+|*  ViewShell::ImplLockPaint(), ImplUnlockPaint()
+|*
+|*  Ersterstellung      MA 11. Jun. 96
+|*  Letzte Aenderung    MA 11. Jun. 96
+|*
+******************************************************************************/
+
 void ViewShell::ImplLockPaint()
 {
     if ( GetWin() && GetWin()->IsVisible() )
-        GetWin()->EnablePaint( sal_False );
+        GetWin()->EnablePaint( sal_False ); //Auch die Controls abklemmen.
     Imp()->LockPaint();
 }
 
@@ -449,7 +498,7 @@ void ViewShell::ImplUnlockPaint( sal_Bool bVirDev )
     {
         if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() )
         {
-            //prevent refresh with virtual device to flicker.
+            //Refresh mit virtuellem Device um das Flackern zu verhindern.
             VirtualDevice *pVout = new VirtualDevice( *pOut );
             pVout->SetMapMode( pOut->GetMapMode() );
             Size aSize( VisArea().SSize() );
@@ -497,6 +546,15 @@ void ViewShell::ImplUnlockPaint( sal_Bool bVirDev )
         Imp()->UnlockPaint();
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::AddPaintRect()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 09. Feb. 97
+|*
+******************************************************************************/
+
 sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
 {
     sal_Bool bRet = sal_False;
@@ -506,6 +564,7 @@ sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
         if( pSh->Imp() )
         {
         if ( pSh->IsPreView() && pSh->GetWin() )
+//          pSh->GetWin()->Invalidate();
             ::RepaintPagePreview( pSh, rRect );
         else
                 bRet |= pSh->Imp()->AddPaintRect( rRect );//swmod 080111
@@ -515,6 +574,15 @@ sal_Bool ViewShell::AddPaintRect( const SwRect & rRect )
     return bRet;
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::InvalidateWindows()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 09. Feb. 97
+|*
+******************************************************************************/
+
 void ViewShell::InvalidateWindows( const SwRect &rRect )
 {
     if ( !Imp()->IsCalcLayoutProgress() )
@@ -525,6 +593,7 @@ void ViewShell::InvalidateWindows( const SwRect &rRect )
             if ( pSh->GetWin() )
             {
                 if ( pSh->IsPreView() )
+//                  pSh->GetWin()->Invalidate();
                     ::RepaintPagePreview( pSh, rRect );
                 else if ( pSh->VisArea().IsOver( rRect ) )
                     pSh->GetWin()->Invalidate( rRect.SVRect() );
@@ -535,6 +604,15 @@ void ViewShell::InvalidateWindows( const SwRect &rRect )
     }
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::MakeVisible()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    AMA 10. Okt. 95
+|*
+******************************************************************************/
+
 void ViewShell::MakeVisible( const SwRect &rRect )
 {
     if ( !VisArea().IsInside( rRect ) || IsScrollMDI( this, rRect ) || GetCareWin(*this) )
@@ -556,6 +634,7 @@ void ViewShell::MakeVisible( const SwRect &rRect )
 #if OSL_DEBUG_LEVEL > 0
             else
             {
+                //MA: 04. Nov. 94, braucht doch keiner oder??
                 OSL_ENSURE( !this, "MakeVisible fuer Drucker wird doch gebraucht?" );
             }
 
@@ -564,6 +643,15 @@ void ViewShell::MakeVisible( const SwRect &rRect )
     }
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::CareChildWindow()
+|*
+|*  Ersterstellung      AMA 10. Okt. 95
+|*  Letzte Aenderung    AMA 10. Okt. 95
+|*
+******************************************************************************/
+
 Window* ViewShell::CareChildWin(ViewShell& rVSh)
 {
     if(rVSh.pSfxViewShell)
@@ -578,15 +666,33 @@ Window* ViewShell::CareChildWin(ViewShell& rVSh)
     return NULL;
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::GetPagePos()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 04. Aug. 93
+|*
+******************************************************************************/
+
 Point ViewShell::GetPagePos( sal_uInt16 nPageNum ) const
 {
     return GetLayout()->GetPagePos( nPageNum );
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::GetNumPages()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 20. Apr. 94
+|*
+******************************************************************************/
+
 sal_uInt16 ViewShell::GetNumPages()
 {
-    //It can happen that there still no Layout exists due to the
-    //method being called from the Root ctor.
+    //Es kann sein, das noch kein Layout existiert weil die Methode vom
+    //Root-Ctor gerufen wird.
     return GetLayout() ? GetLayout()->GetPageNum() : 0;
 }
 
@@ -595,6 +701,18 @@ sal_Bool ViewShell::IsDummyPage( sal_uInt16 nPageNum ) const
     return GetLayout() ? GetLayout()->IsDummyPage( nPageNum ) : 0;
 }
 
+/*************************************************************************
+|*
+|*                  ViewShell::UpdateFlds()
+|*
+|*    Ersterstellung    BP 04.05.92
+|*    Beschreibung      erzwingt ein Update fuer jedes Feld
+|*
+|*  UpdateFlds benachrichtigt alle Felder mit pNewHt.
+|*  Wenn pNewHt == 0 ist (default), wird der Feldtyp verschickt.
+|*
+*************************************************************************/
+
 void ViewShell::UpdateFlds(sal_Bool bCloseDB)
 {
     SET_CURR_SHELL( this );
@@ -640,16 +758,26 @@ sal_Bool ViewShell::HasCharts() const
     return bRet;
 }
 
+/*************************************************************************
+|*
+|*    ViewShell::LayoutIdle()
+|*
+|*    Ersterstellung    MA 26. May. 92
+|*    Letzte Aenderung  OG 19. Mar. 96
+|*
+*************************************************************************/
+
 void ViewShell::LayoutIdle()
 {
 #ifdef TCOVER
+    //fuer TCV-Version: Ende der Startphase des Programmes
     TCovCall::Idle();
 #endif
     if( !pOpt->IsIdle() || !GetWin() ||
         ( Imp()->HasDrawView() && Imp()->GetDrawView()->IsDragObj() ) )
         return;
 
-
+    //Kein Idle wenn gerade gedruckt wird.
     ViewShell *pSh = this;
     do
     {   if ( !pSh->GetWin() )
@@ -661,6 +789,7 @@ void ViewShell::LayoutIdle()
     SET_CURR_SHELL( this );
 
 #ifdef DBG_UTIL
+    // Wenn Test5 gedrueckt ist, wird der IdleFormatierer abgeknipst.
     if( pOpt->IsTest5() )
         return;
 #endif
@@ -668,8 +797,12 @@ void ViewShell::LayoutIdle()
     {
         DBG_PROFSTART( LayoutIdle );
 
+        //Cache vorbereiten und restaurieren, damit er nicht versaut wird.
         SwSaveSetLRUOfst aSave( *SwTxtFrm::GetTxtCache(),
                              SwTxtFrm::GetTxtCache()->GetCurMax() - 50 );
+        // #125243# there are lots of stacktraces indicating that Imp() returns NULL
+        // this ViewShell seems to be invalid - but it's not clear why
+        // this return is only a workaround!
         OSL_ENSURE(Imp(), "ViewShell already deleted?");
         if(!Imp())
             return;
@@ -789,6 +922,8 @@ void ViewShell::SetUseVirDev( bool bNewVirtual )
     }
 }
 
+// OD 2004-02-16 #106629# - control, if paragraph and table spacing is added
+// at bottom of table cells
 void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells )
 {
     IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -801,7 +936,7 @@ void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells
     }
 }
 
-// #i11859# - control, if former formatting of text lines with
+// OD 06.01.2004 #i11859# - control, if former formatting of text lines with
 // proportional line spacing is used or not.
 void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
 {
@@ -815,7 +950,7 @@ void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing )
     }
 }
 
-// #i11860# - control, if former object positioning is used or not.
+// OD 2004-03-12 #i11860# - control, if former object positioning is used or not.
 void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
 {
     IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -827,7 +962,7 @@ void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos )
     }
 }
 
-// #i28701#
+// OD 2004-05-05 #i28701#
 void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
 {
     IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -839,6 +974,7 @@ void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos )
     }
 }
 
+// --> FME #108724#
 void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
 {
     IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -850,8 +986,9 @@ void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping )
         lcl_InvalidateAllCntnt( *this, nInv );
     }
 }
+// <--
 
-// #i45491#
+// -> PB 2007-06-11 #i45491#
 void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak )
 {
     IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
@@ -864,10 +1001,25 @@ void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWit
     }
 }
 
+// <--
+
+/******************************************************************************
+|*
+|*  ViewShell::Reformat
+|*
+|*  Ersterstellung      BP ???
+|*  Letzte Aenderung    MA 13. Feb. 98
+|*
+******************************************************************************/
+
 void ViewShell::Reformat()
 {
     SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
 
+    // Wir gehen auf Nummer sicher:
+    // Wir muessen die alten Fontinformationen wegschmeissen,
+    // wenn die Druckeraufloesung oder der Zoomfaktor sich aendert.
+    // Init() und Reformat() sind die sichersten Stellen.
 #ifdef FNTMET
     aFntMetList.Flush();
 #else
@@ -891,14 +1043,26 @@ void ViewShell::Reformat()
      Reformat();
  }
 
+/******************************************************************************
+|*
+|*  ViewShell::CalcLayout()
+|*                  Vollstaendige Formatierung von Layout und Inhalt.
+|*
+|*  Ersterstellung      MA 31. Jan. 94
+|*  Letzte Aenderung    MA 08. Oct. 96
+|*
+******************************************************************************/
+
 void ViewShell::CalcLayout()
 {
     SET_CURR_SHELL( this );
     SwWait aWait( *GetDoc()->GetDocShell(), sal_True );
 
+    //Cache vorbereiten und restaurieren, damit er nicht versaut wird.
     SwSaveSetLRUOfst aSaveLRU( *SwTxtFrm::GetTxtCache(),
                                   SwTxtFrm::GetTxtCache()->GetCurMax() - 50 );
 
+    //Progress einschalten wenn noch keiner Lauft.
     const sal_Bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0;
     if ( bEndProgress )
     {
@@ -916,8 +1080,8 @@ void ViewShell::CalcLayout()
     aAction.Action();
     GetDoc()->UnlockExpFlds();
 
-    // The SetNewFldLst() on Doc was stopped and has to be rescheduled
-    // (see flowfrm.cxx, txtfld.cxx)
+    //Das SetNewFldLst() am Doc wurde unterbunden und muss nachgeholt
+    //werden (siehe flowfrm.cxx, txtfld.cxx)
     if ( aAction.IsExpFlds() )
     {
         aAction.Reset();
@@ -938,6 +1102,15 @@ void ViewShell::CalcLayout()
         ::EndProgress( GetDoc()->GetDocShell() );
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SetFirstVisPageInvalid()
+|*
+|*  Ersterstellung      MA 19. May. 94
+|*  Letzte Aenderung    MA 19. May. 94
+|*
+******************************************************************************/
+
 void ViewShell::SetFirstVisPageInvalid()
 {
     ViewShell *pSh = this;
@@ -950,6 +1123,15 @@ void ViewShell::SetFirstVisPageInvalid()
     } while ( pSh != this );
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SizeChgNotify()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 17. Sep. 96
+|*
+******************************************************************************/
+
 void ViewShell::SizeChgNotify()
 {
     if ( !pWin )
@@ -978,6 +1160,15 @@ void ViewShell::SizeChgNotify()
     }
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::VisPortChgd()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 22. Jul. 96
+|*
+******************************************************************************/
+
 void ViewShell::VisPortChgd( const SwRect &rRect)
 {
     OSL_ENSURE( GetWin(), "VisPortChgd ohne Window." );
@@ -988,10 +1179,13 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
 #if OSL_DEBUG_LEVEL > 1
     if ( bInEndAction )
     {
+        //Da Rescheduled doch schon wieder irgendwo einer?
         OSL_ENSURE( !this, "Scroll waehrend einer EndAction." );
     }
 #endif
 
+    //Ersteinmal die alte sichtbare Seite holen, dann braucht nacher nicht
+    //lange gesucht werden.
     const SwFrm *pOldPage = Imp()->GetFirstVisPage();
 
     const SwRect aPrevArea( VisArea() );
@@ -999,9 +1193,9 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
     aVisArea = rRect;
     SetFirstVisPageInvalid();
 
-    // When there is still a PaintRegion and the VisArea has changed,
-    // Then the PaintRegion becomes obsolete. The PaintRegion can have been
-    // produced by RootFrm::Paint.
+    //Wenn noch eine PaintRegion herumsteht und sich die VisArea geaendert hat,
+    //so ist die PaintRegion spaetestens jetzt obsolete. Die PaintRegion kann
+    //vom RootFrm::Paint erzeugt worden sein.
     if ( !bInEndAction &&
          Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
         Imp()->DelRegion();
@@ -1016,12 +1210,16 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
         GetWin()->Invalidate();
     else
     {
+        // Betrag ausrechnen, um den gescrolled werden muss.
         const long nXDiff = aPrevArea.Left() - VisArea().Left();
         const long nYDiff = aPrevArea.Top()  - VisArea().Top();
 
         if( !nXDiff && !GetViewOptions()->getBrowseMode() &&
             (!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
         {
+            //Falls moeglich die Wiese nicht mit Scrollen.
+            //Also linke und rechte Kante des Scrollbereiches auf die
+            //Seiten begrenzen.
             const SwPageFrm *pPage = (SwPageFrm*)GetLayout()->Lower();  //swmod 071108//swmod 071225
             if ( pPage->Frm().Top() > pOldPage->Frm().Top() )
                 pPage = (SwPageFrm*)pOldPage;
@@ -1042,6 +1240,8 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
                     aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
                 }
 
+                    // OD 12.02.2003 #i9719#, #105645# - consider new border
+                    // and shadow width
                 if ( aPageRect.IsOver( aBoth ) )
                 {
                     SwTwips nPageLeft = 0;
@@ -1058,6 +1258,9 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
                         nMinLeft = nPageLeft;
                     if( nPageRight > nMaxRight )
                         nMaxRight = nPageRight;
+                    //Zus. auf die Zeichenobjekte abgleichen.
+                    //Einen Ofst beruecksichtigen, weil die Objekte u.U.
+                    //selektiert sind und die Henkel dann hinausstehen.
                     if ( pPage->GetSortedObjs() )
                     {
                         const long nOfst = GetOut()->PixelToLogic(
@@ -1070,6 +1273,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
                             if (pObj->IsFormatPossible())
                             {
                                 const Rectangle &rBound = pObj->GetObjRect().SVRect();
+                            // OD 03.03.2003 #107927# - use correct datatype
                                 const SwTwips nL = Max( 0L, rBound.Left() - nOfst );
                                 if ( nL < nMinLeft )
                                     nMinLeft = nL;
@@ -1095,7 +1299,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
             else
                 GetWin()->Invalidate( aRect );
         }
-        else if ( !nLockPaint )
+        else if ( !nLockPaint ) //Wird im UnLock erledigt
         {
             if( VisArea().IsOver( aPrevArea ) )
             {
@@ -1122,13 +1326,14 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
     }
     GetWin()->Update();
 
-    // #i88070#
+    // --> OD 2010-02-11 #i88070#
     if ( pPostItMgr )
     {
         pPostItMgr->Rescale();
         pPostItMgr->CalcRects();
         pPostItMgr->LayoutPostIts();
     }
+    // <--
 
     if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
         pPostItMgr->CorrectPositions();
@@ -1138,6 +1343,15 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
 
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SmoothScroll()
+|*
+|*  Ersterstellung      MA 04. Jul. 96
+|*  Letzte Aenderung    MA 25. Mar. 97
+|*
+******************************************************************************/
+
 sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
 {
     const sal_uLong nColCnt = pOut->GetColorCount();
@@ -1161,7 +1375,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
     // #i75172# isolated static conditions
     const bool bOnlyYScroll(!lXDiff && Abs(lYDiff) != 0 && Abs(lYDiff) < lMax);
     const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel(WINDOW_GETCLIPREGION_NOCHILDREN|WINDOW_GETCLIPREGION_NULL).IsNull());
-// #i98766# - disable smooth scrolling for Mac port builds
+// --> OD 2009-08-12 #i98766# - disable smooth scrolling for Mac port builds
 #ifdef QUARTZ
     const bool bSmoothScrollAllowed(false);
     (void) bOnlyYScroll;
@@ -1169,7 +1383,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
 #else
     const bool bSmoothScrollAllowed(bOnlyYScroll && bEnableSmooth && GetViewOptions()->IsSmoothScroll() &&  bAllowedWithChildWindows);
 #endif
-
+// <-
     const bool bIAmCursorShell(ISA(SwCrsrShell));
     (void) bIAmCursorShell;
 
@@ -1185,6 +1399,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
 
         const SwRect aOldVis( VisArea() );
 
+        //Virtuelles Device erzeugen und einstellen.
         const Size aPixSz = GetWin()->PixelToLogic(Size(1,1));
         VirtualDevice *pVout = new VirtualDevice( *GetWin() );
         pVout->SetLineColor( GetWin()->GetLineColor() );
@@ -1198,6 +1413,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
         {
             nLockPaint++;
 
+            //Ersteinmal alles neue in das VirDev Painten.
             SwRect aRect( VisArea() );
             aRect.Height( aSize.Height() );
             if ( pRect )
@@ -1254,6 +1470,13 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
             pOut = pOld;
             aVisArea = aOldVis;
 
+            //Jetzt Stueckchenweise schieben und die neuen Pixel aus dem
+            //VirDev  kopieren.
+
+            // ??????????????????????
+            // or is it better to get the scrollfactor from the User
+            // as option?
+            // ??????????????????????
             long lMaDelta = aPixSz.Height();
             if ( Abs(lYDiff) > ( aVisArea.Height() / 3 ) )
                 lMaDelta *= 6;
@@ -1375,10 +1598,23 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe
     return sal_False;
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::PaintDesktop()
+|*
+|*  Ersterstellung      MA 16. Dec. 93
+|*  Letzte Aenderung    MA 30. Nov. 95
+|*
+******************************************************************************/
 void ViewShell::PaintDesktop( const SwRect &rRect )
 {
     if ( !GetWin() && !GetOut()->GetConnectMetaFile() )
-        return;
+        return;                     //Fuer den Drucker tun wir hier nix
+
+    //Sonderfaelle abfangen, damit es nicht gar so ueberraschend aussieht.
+    //Kann z.B. waehrend des Idle'ns zwischenzeitlich auftreten.
+    //Die Rechtecke neben den Seiten muessen wir leider auf jedenfall Painten,
+    //den diese werden spaeter beim VisPortChgd ausgespart.
     sal_Bool bBorderOnly = sal_False;
     const SwRootFrm *pRoot = GetLayout();//swmod 080305
     if ( rRect.Top() > pRoot->Frm().Bottom() )
@@ -1394,7 +1630,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
 
     SwRegionRects aRegion( rRect );
 
-    //#i6193: remove sidebar area to avoid flickering
+    //mod #i6193: remove sidebar area to avoid flickering
     const SwPostItMgr* pPostItMgr = GetPostItMgr();
     const SwTwips nSidebarWidth = pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ?
                                   pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() :
@@ -1426,9 +1662,9 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
     {
         const SwFrm *pPage = Imp()->GetFirstVisPage();
         const SwTwips nBottom = rRect.Bottom();
-
+        //const SwTwips nRight  = rRect.Right();
         while ( pPage && aRegion.Count() &&
-                (pPage->Frm().Top() <= nBottom) )
+                (pPage->Frm().Top() <= nBottom) ) // PAGES01 && (pPage->Frm().Left() <= nRight))
         {
             SwRect aPageRect( pPage->Frm() );
             if ( bBookMode )
@@ -1452,8 +1688,11 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
         _PaintDesktop( aRegion );
 }
 
+
+// PaintDesktop gesplittet, dieser Teil wird auch von PreViewPage benutzt
 void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
 {
+    // OD 2004-04-23 #116347#
     GetOut()->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
     GetOut()->SetLineColor();
 
@@ -1502,6 +1741,15 @@ void ViewShell::_PaintDesktop( const SwRegionRects &rRegion )
     GetOut()->Pop();
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::CheckInvalidForPaint()
+|*
+|*  Ersterstellung      MA 19. May. 94
+|*  Letzte Aenderung    MA 09. Jun. 94
+|*
+******************************************************************************/
+
 sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
 {
     if ( !GetWin() )
@@ -1542,6 +1790,8 @@ sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
         SwRegionRects *pRegion = Imp()->GetRegion();
         if ( pRegion && aAction.IsBrowseActionStop() )
         {
+            //Nur dann interessant, wenn sich im sichtbaren Bereich etwas
+            //veraendert hat.
             sal_Bool bStop = sal_True;
             for ( sal_uInt16 i = 0; i < pRegion->Count(); ++i )
             {
@@ -1558,7 +1808,7 @@ sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
 
         if ( pRegion )
         {
-            //First Invert, then Compress, never the other way round!
+            //Erst Invert dann Compress, niemals andersherum!
             pRegion->Invert();
             pRegion->Compress();
             bRet = sal_False;
@@ -1604,6 +1854,15 @@ sal_Bool ViewShell::CheckInvalidForPaint( const SwRect &rRect )
     return bRet;
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::Paint()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 17. Sep. 96
+|*
+******************************************************************************/
+
 void ViewShell::Paint(const Rectangle &rRect)
 {
     if ( nLockPaint )
@@ -1670,23 +1929,35 @@ void ViewShell::Paint(const Rectangle &rRect)
             }
             else
             {
+                //SwSaveHdl *pSaveHdl = 0;
+                //if ( Imp()->HasDrawView() )
+                //  pSaveHdl = new SwSaveHdl( Imp() );
+
+                //Wenn eine der sichtbaren Seiten noch irgendetwas zum Repaint
+                //angemeldet hat, so muessen Repaints ausgeloest werden.
                 if ( !CheckInvalidForPaint( aRect ) )
                 {
-                    // #i101192# start Pre/PostPaint encapsulation to avoid screen blinking
+                    // --> OD 2009-08-12 #i101192#
+                    // start Pre/PostPaint encapsulation to avoid screen blinking
                     const Region aRepaintRegion(aRect.SVRect());
                     DLPrePaint2(aRepaintRegion);
 
+                    // <--
                     PaintDesktop( aRect );
 
+                    //Falls sinnvoll gleich das alte InvalidRect verarbeiten bzw.
+                    //vernichten.
                     if ( aRect.IsInside( aInvalidRect ) )
                         ResetInvalidRect();
                     ViewShell::bLstAct = sal_True;
                     GetLayout()->Paint( aRect );
                     ViewShell::bLstAct = sal_False;
-                    // #i101192# end Pre/PostPaint encapsulation
+                    // --> OD 2009-08-12 #i101192#
+                    // end Pre/PostPaint encapsulation
                     DLPostPaint2(true);
-
+                    // <--
                 }
+                //delete pSaveHdl;
             }
             SwRootFrm::SetNoVirDev( sal_False );
             bPaintInProgress = sal_False;
@@ -1716,6 +1987,7 @@ void ViewShell::Paint(const Rectangle &rRect)
             const Region aDLRegion(rRect);
             DLPrePaint2(aDLRegion);
 
+            // OD 2004-04-23 #116347#
             pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
             pOut->SetFillColor( Imp()->GetRetoucheColor() );
             pOut->SetLineColor();
@@ -1728,6 +2000,15 @@ void ViewShell::Paint(const Rectangle &rRect)
     }
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SetBrowseBorder()
+|*
+|*  Ersterstellung      AMA 20. Aug. 96
+|*  Letzte Aenderung    AMA 20. Aug. 96
+|*
+******************************************************************************/
+
 void ViewShell::SetBrowseBorder( const Size& rNew )
 {
     if( rNew != aBrowseBorder )
@@ -1757,6 +2038,15 @@ sal_Int32 ViewShell::GetBrowseWidth() const
         return aVisArea.Width() - 2 * GetOut()->PixelToLogic(aBrowseBorder).Width();
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::CheckBrowseView()
+|*
+|*  Ersterstellung      MA 04. Mar. 96
+|*  Letzte Aenderung    MA 04. Jul. 96
+|*
+******************************************************************************/
+
 void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
 {
     if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() )
@@ -1815,6 +2105,16 @@ void ViewShell::CheckBrowseView( sal_Bool bBrowseChgd )
     UnlockPaint();
 }
 
+/*************************************************************************
+|*
+|*    ViewShell::GetLayout()
+|*    ViewShell::GetNodes()
+|*
+|*    Ersterstellung    OK 26. May. 92
+|*    Letzte Aenderung  MA 16. Sep. 93
+|*
+*************************************************************************/
+
 SwRootFrm *ViewShell::GetLayout() const
 {
     return pLayout.get();   //swmod 080116
@@ -1863,6 +2163,15 @@ SfxItemPool& ViewShell::GetAttrPool()
     return GetDoc()->GetAttrPool();
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::ApplyViewOptions(), ImplApplyViewOptions()
+|*
+|*  Ersterstellung      ??
+|*  Letzte Aenderung    MA 03. Mar. 98
+|*
+******************************************************************************/
+
 void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
 {
 
@@ -2002,7 +2311,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
 
     sal_Bool bOnlineSpellChgd = pOpt->IsOnlineSpell() != rOpt.IsOnlineSpell();
 
-    *pOpt = rOpt;
+    *pOpt = rOpt;   // Erst jetzt werden die Options uebernommen.
     pOpt->SetUIOptions(rOpt);
 
     pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode(pDoc->GetDocShell()));
@@ -2040,6 +2349,15 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
 
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SetUIOptions()
+|*
+|*  Ersterstellung      OS 29.07.96
+|*  Letzte Aenderung    OS 29.07.96
+|*
+******************************************************************************/
+
 void ViewShell::SetUIOptions( const SwViewOption &rOpt )
 {
     pOpt->SetUIOptions(rOpt);
@@ -2051,10 +2369,24 @@ void ViewShell::SetUIOptions( const SwViewOption &rOpt )
     pOpt->SetSymbolFont(rOpt.GetSymbolFont());
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SetReadonly()
+|*
+|*  Ersterstellung      OS 05.09.96
+|*  Letzte Aenderung    MA 12. Feb. 97
+|*
+******************************************************************************/
+
 void ViewShell::SetReadonlyOption(sal_Bool bSet)
 {
+    //JP 01.02.99: bei ReadOnly Flag richtig abfragen und ggfs. neu
+    //              formatieren; Bug 61335
+
+    // Schalten wir gerade von Readonly auf Bearbeiten um?
     if( bSet != pOpt->IsReadonly() )
     {
+        // damit die Flags richtig erfragt werden koennen.
         pOpt->SetReadonly( sal_False );
 
         sal_Bool bReformat = pOpt->IsFldName();
@@ -2075,7 +2407,9 @@ void ViewShell::SetReadonlyOption(sal_Bool bSet)
             Imp()->InvalidateAccessibleEditableState( sal_False );
     }
 }
+/* -----------------28.08.2003 15:45-----------------
 
+ --------------------------------------------------*/
 void  ViewShell::SetPDFExportOption(sal_Bool bSet)
 {
     if( bSet != pOpt->IsPDFExport() )
@@ -2085,7 +2419,9 @@ void  ViewShell::SetPDFExportOption(sal_Bool bSet)
         pOpt->SetPDFExport(bSet);
     }
 }
+/* -----------------------------2002/07/31 17:06------------------------------
 
+ ---------------------------------------------------------------------------*/
 void  ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
 {
     if( bSet != pOpt->IsSelectionInReadonly() )
@@ -2094,11 +2430,30 @@ void  ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
     }
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::SetPrtFormatOption()
+|*
+|*  Ersterstellung      AMA 10. Sep. 97
+|*  Letzte Aenderung    AMA 10. Sep. 97
+|*
+******************************************************************************/
+
 void ViewShell::SetPrtFormatOption( sal_Bool bSet )
 {
     pOpt->SetPrtFormat( bSet );
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::UISizeNotify()
+|*
+|*  Ersterstellung      MA 14. Jan. 97
+|*  Letzte Aenderung    MA 14. Jan. 97
+|*
+******************************************************************************/
+
+
 void ViewShell::UISizeNotify()
 {
     if ( bDocSizeChgd )
@@ -2151,8 +2506,10 @@ ViewShell::CreateAccessiblePreview()
     OSL_ENSURE( pLayout, "no layout, no access" );
     OSL_ENSURE( GetWin(), "no window, no access" );
 
+    // OD 15.01.2003 #103492# - add condition <IsPreView()>
     if ( IsPreView() && GetLayout()&& GetWin() )
     {
+        // OD 14.01.2003 #103492# - adjustment for new method signature
         return Imp()->GetAccessibleMap().GetDocumentPreview(
                     PagePreviewLayout()->maPrevwPages,
                     GetWin()->GetMapMode().GetScaleX(),
@@ -2168,7 +2525,12 @@ void ViewShell::InvalidateAccessibleFocus()
         Imp()->GetAccessibleMap().InvalidateFocus();
 }
 
-// #i27138# invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
+/** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
+
+    OD 2005-12-01 #i27138#
+
+    @author OD
+*/
 void ViewShell::InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
                                                       const SwTxtFrm* _pToTxtFrm )
 {
@@ -2178,7 +2540,12 @@ void ViewShell::InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtF
     }
 }
 
-// #i27301# invalidate text selection for paragraphs
+/** invalidate text selection for paragraphs
+
+    OD 2005-12-12 #i27301#
+
+    @author OD
+*/
 void ViewShell::InvalidateAccessibleParaTextSelection()
 {
     if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
@@ -2187,7 +2554,12 @@ void ViewShell::InvalidateAccessibleParaTextSelection()
     }
 }
 
-// #i88069# invalidate attributes for paragraphs
+/** invalidate attributes for paragraphs
+
+    OD 2009-01-06 #i88069#
+
+    @author OD
+*/
 void ViewShell::InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
 {
     if ( GetLayout() && GetLayout()->IsAnyShellAccessible() )
@@ -2205,6 +2577,9 @@ SwAccessibleMap* ViewShell::GetAccessibleMap()
 
     return 0;
 }
+/* -----------------------------06.05.2002 13:23------------------------------
+
+ ---------------------------------------------------------------------------*/
 void ViewShell::ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions)
 {
     if(pOpt->IsPagePreview() && !rAccessibilityOptions.GetIsForPagePreviews())
@@ -2260,16 +2635,17 @@ const Size ViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) c
     return aSize;
 }
 
-// #i12836# enhanced pdf export
+// --> FME 2004-06-15 #i12836# enhanced pdf export
 sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const
 {
     OSL_ENSURE( GetLayout(), "GetPageNumAndSetOffsetForPDF assumes presence of layout" );
 
     sal_Int32 nRet = -1;
 
-    // #i40059# Position out of bounds
+    // --> FME 2005-01-07 #i40059# Position out of bounds:
     SwRect aRect( rRect );
     aRect.Pos().X() = Max( aRect.Left(), GetLayout()->Frm().Left() );
+    // <--
 
     const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aRect.Center() );
     if ( pPage )
@@ -2289,7 +2665,9 @@ sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwR
 
     return nRet;
 }
+// <--
 
+// --> PB 2007-05-30 #146850#
 const BitmapEx& ViewShell::GetReplacementBitmap( bool bIsErrorState )
 {
     BitmapEx** ppRet;
@@ -2317,6 +2695,7 @@ void ViewShell::DeleteReplacementBitmaps()
     DELETEZ( pErrorBmp );
     DELETEZ( pReplaceBmp );
 }
+// <--
 
 SwPostItMgr* ViewShell::GetPostItMgr()
 {
@@ -2352,7 +2731,7 @@ IDocumentUndoRedo      & ViewShell::GetIDocumentUndoRedo()
 IDocumentUndoRedo const& ViewShell::GetIDocumentUndoRedo() const
 { return pDoc->GetIDocumentUndoRedo(); }
 
-// #i83479#
+// --> OD 2007-11-14 #i83479#
 const IDocumentListItems* ViewShell::getIDocumentListItemsAccess() const
 {
     return pDoc;
@@ -2361,5 +2740,6 @@ const IDocumentOutlineNodes* ViewShell::getIDocumentOutlineNodesAccess() const
 {
     return pDoc;
 }
+// <--
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 1234c4d..226dbc0 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -37,31 +37,50 @@
 #include <rootfrm.hxx>
 #include <viewimp.hxx>
 #include <viewopt.hxx>
-#include <txtfrm.hxx>
+#include <txtfrm.hxx>       // Zugriff auf TxtCache
 #include <notxtfrm.hxx>
 #include <fntcache.hxx>
 #include <docufld.hxx>
 #include <ptqueue.hxx>
-#include <dview.hxx>
+#include <dview.hxx>        // SdrView
 #include <ndgrf.hxx>
 #include <ndindex.hxx>
 #include <accessibilityoptions.hxx>
 #include <switerator.hxx>
+
+
+/*************************************************************************
+|*
+|*  ViewShell::Init()
+|*
+|*  Letzte Aenderung    MA 14. Jun. 96
+|*
+|*************************************************************************/
+
 void ViewShell::Init( const SwViewOption *pNewOpt )
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "ViewShell::Init" );
 
     bDocSizeChgd = sal_False;
 
-    pFntCache->Flush( );
+    // Wir gehen auf Nummer sicher:
+    // Wir muessen die alten Fontinformationen wegschmeissen,
+    // wenn die Druckeraufloesung oder der Zoomfaktor sich aendert.
+    // Init() und Reformat() sind die sichersten Stellen.
+     pFntCache->Flush( );
+
+    // ViewOptions werden dynamisch angelegt
 
     if( !pOpt )
     {
         pOpt = new SwViewOption;
 
+        // Ein ApplyViewOptions braucht nicht gerufen zu werden
         if( pNewOpt )
         {
             *pOpt = *pNewOpt;
+            // Der Zoomfaktor muss eingestellt werden, weil in der CTOR-
+            // phase aus Performancegruenden kein ApplyViewOptions gerufen wird.
             if( GetWin() && 100 != pOpt->GetZoom() )
             {
                 MapMode aMode( pWin->GetMapMode() );
@@ -75,27 +94,36 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
 
     SwDocShell* pDShell = pDoc->GetDocShell();
     pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode( pDShell ) );
+    // JP 02.02.99: Bug 61335 - Readonly-Flag an den ViewOptions setzen,
+    //              bevor das Layout angelegt wird. Ansonsten muesste man
+    //              nochmals durchformatieren!!
 
     if( pDShell && pDShell->IsReadOnly() )
         pOpt->SetReadonly( sal_True );
 
     RTL_LOGFILE_CONTEXT_TRACE( aLog, "View::Init - before InitPrt" );
 
-    // #i82967#
+    // --> FME 2007-11-06 #i82967#
     OutputDevice* pPDFOut = 0;
 
     if ( pOut && pOut->GetPDFWriter() )
         pPDFOut = pOut;
-    // #i41075# Only setup the printer if we need one:
+    // <--
+
+    // --> FME 2005-01-21 #i41075#
+    // Only setup the printer if we need one:
     const bool bBrowseMode = pOpt->getBrowseMode();
     if( pPDFOut )
         InitPrt( pPDFOut );
-    // #i44963# Good occasion to check if page sizes in page descriptions
-    // are still set to (LONG_MAX, LONG_MAX) (html import)
+    // <--
+
+    // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in
+    // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
     if ( !bBrowseMode )
     {
         pDoc->CheckDefaultPageFmt();
     }
+    // <--
 
     RTL_LOGFILE_CONTEXT_TRACE( aLog, "View::Init - after InitPrt" );
 
@@ -126,7 +154,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
     }
     SizeChgNotify();    //swmod 071108
 
-    // #i31958#
+    // --> #i31958#
     // XForms mode: initialize XForms mode, based on design mode (draw view)
     //   MakeDrawView() requires layout
     if( GetDoc()->isXForms() )
@@ -135,8 +163,17 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
             MakeDrawView();
         pOpt->SetFormView( ! GetDrawView()->IsDesignMode() );
     }
+    // <-- #i31958#
 }
 
+/*************************************************************************
+|*
+|*  ViewShell::ViewShell()  CTor fuer die erste Shell.
+|*
+|*  Letzte Aenderung    MA 29. Aug. 95
+|*
+|*************************************************************************/
+
 ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
                         const SwViewOption *pNewOpt, OutputDevice *pOutput,
                         long nFlags )
@@ -154,17 +191,17 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
     bShowHeaderSeparator( false ),
     bShowFooterSeparator( false ),
     bHeaderFooterEdit( false ),
-    mpTargetPaintWindow(0),
-    mpBufferedOut(0),
+    mpTargetPaintWindow(0), // #i74769#
+    mpBufferedOut(0), // #i74769#
     pDoc( &rDocument ),
     nStartAction( 0 ),
     nLockPaint( 0 ),
-    mpPrePostOutDev(0),
+    mpPrePostOutDev(0), // #i72754#
     maPrePostMapMode()
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "ViewShell::SwViewShell" );
 
-    // #i26791# in order to suppress event handling in
+    // OD 2004-06-01 #i26791# - in order to suppress event handling in
     // <SwDrawContact::Changed> during contruction of <ViewShell> instance
     mbInConstructor = true;
 
@@ -173,16 +210,19 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
     bPaintWorks = bEnableSmooth = sal_True;
     bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
 
-    // #i38810# Do not reset modified state of document, if it's already been modified.
+    // --> OD 2005-02-11 #i38810# - Do not reset modified state of document,
+    // if it's already been modified.
     const bool bIsDocModified( pDoc->IsModified() );
     pDoc->acquire();
     pOutput = pOut;
-    Init( pNewOpt );
+    Init( pNewOpt );    //verstellt ggf. das Outdev (InitPrt())
     pOut = pOutput;
 
-    // initialize print preview layout after layout is created in <ViewShell::Init(..)> - called above.
+    // OD 28.03.2003 #108470# - initialize print preview layout after layout
+    // is created in <ViewShell::Init(..)> - called above.
     if ( bPreView )
     {
+        // OD 12.12.2002 #103492# - init page preview layout
         pImp->InitPagePreviewLayout();
     }
 
@@ -191,22 +231,33 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
     ((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
         SetHiddenFlag( !pOpt->IsShowHiddenField() );
 
-    // #i38810#
+    //In Init wird ein Standard-FrmFmt angelegt.
+    // --> OD 2005-02-11 #i38810#
     if (   !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified()
         && !bIsDocModified )
+    // <--
     {
         pDoc->ResetModified();
     }
 
+    //Format-Cache erweitern.
     if ( SwTxtFrm::GetTxtCache()->GetCurMax() < 2550 )
         SwTxtFrm::GetTxtCache()->IncreaseMax( 100 );
     if( pOpt->IsGridVisible() || getIDocumentDrawModelAccess()->GetDrawModel() )
         Imp()->MakeDrawView();
 
-    // #i26791#
+    // OD 2004-06-01 #i26791#
     mbInConstructor = false;
 }
 
+/*************************************************************************
+|*
+|*  ViewShell::ViewShell()  CTor fuer weitere Shells auf ein Dokument.
+|*
+|*  Letzte Aenderung    MA 29. Aug. 95
+|*
+|*************************************************************************/
+
 ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
                         OutputDevice *pOutput, long nFlags ) :
     Ring( &rShell ),
@@ -223,17 +274,17 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
     bShowHeaderSeparator( false ),
     bShowFooterSeparator( false ),
     bHeaderFooterEdit( false ),
-    mpTargetPaintWindow(0),
-    mpBufferedOut(0),
+    mpTargetPaintWindow(0), // #i74769#
+    mpBufferedOut(0), // #i74769#
     pDoc( rShell.GetDoc() ),
     nStartAction( 0 ),
     nLockPaint( 0 ),
-    mpPrePostOutDev(0),
+    mpPrePostOutDev(0), // #i72754#
     maPrePostMapMode()
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "ViewShell::SwViewShell" );
 
-    // #i26791# in order to suppress event handling in
+    // OD 2004-06-01 #i26791# - in order to suppress event handling in
     // <SwDrawContact::Changed> during contruction of <ViewShell> instance
     mbInConstructor = true;
 
@@ -241,6 +292,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
     bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
     bEndActionByVirDev = sal_False;
     bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
+    // OD 12.12.2002 #103492#
     if( nFlags & VSHELLFLAG_SHARELAYOUT ) //swmod 080125
         pLayout = rShell.pLayout;//swmod 080125
 
@@ -250,7 +302,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
     sal_Bool bModified = pDoc->IsModified();
 
     pOutput = pOut;
-    Init( rShell.GetViewOptions() );
+    Init( rShell.GetViewOptions() );    //verstellt ggf. das Outdev (InitPrt())
     pOut = pOutput;
 
     // OD 12.12.2002 #103492#
@@ -260,28 +312,39 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
     ((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
             SetHiddenFlag( !pOpt->IsShowHiddenField() );
 
+    // in Init wird ein Standard-FrmFmt angelegt
     if( !bModified && !pDoc->GetIDocumentUndoRedo().IsUndoNoResetModified() )
     {
         pDoc->ResetModified();
     }
 
+    //Format-Cache erweitern.
     if ( SwTxtFrm::GetTxtCache()->GetCurMax() < 2550 )
         SwTxtFrm::GetTxtCache()->IncreaseMax( 100 );
     if( pOpt->IsGridVisible() || getIDocumentDrawModelAccess()->GetDrawModel() )
         Imp()->MakeDrawView();
 
-    // #i26791#
+    // OD 2004-06-01 #i26791#
     mbInConstructor = false;
 
 }
 
+/******************************************************************************
+|*
+|*  ViewShell::~ViewShell()
+|*
+|*  Ersterstellung      MA ??
+|*  Letzte Aenderung    MA 10. May. 95
+|*
+******************************************************************************/
+
 ViewShell::~ViewShell()
 {
     {
         SET_CURR_SHELL( this );
         bPaintWorks = sal_False;
 
-        // #i9684#Stopping the animated graphics is not
+        // FME 2004-06-21 #i9684# Stopping the animated graphics is not
         // necessary during printing or pdf export, because the animation
         // has not been started in this case.
         if( pDoc && GetWin() )
@@ -312,7 +375,7 @@ ViewShell::~ViewShell()
             GetDoc()->StopNumRuleAnimations( pOut );
         }
 
-        delete pImp;
+        delete pImp; //Erst loeschen, damit die LayoutViews vernichtet werden.
         pImp = 0;   // Set to zero, because ~SwFrm relies on it.
 
         if ( pDoc )
@@ -325,9 +388,11 @@ ViewShell::~ViewShell()
 
         delete pOpt;
 
+        //Format-Cache zurueckschrauben.
         if ( SwTxtFrm::GetTxtCache()->GetCurMax() > 250 )
             SwTxtFrm::GetTxtCache()->DecreaseMax( 100 );
 
+        //Ggf. aus der PaintQueue entfernen lassen
         SwPaintQueue::Remove( this );
 
         OSL_ENSURE( !nStartAction, "EndAction() pending." );
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
old mode 100644
new mode 100755
index edf1374..bb37a1c
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -71,19 +71,21 @@
 #include <viewopt.hxx>
 #include <printdata.hxx>    // SwPrintData
 #include <pagedesc.hxx>
-#include <poolfmt.hxx>
-#include <mdiexp.hxx>
-#include <statstr.hrc>
+#include <poolfmt.hxx>      // fuer RES_POOLPAGE_JAKET
+#include <mdiexp.hxx>       // Ansteuern der Statusleiste
+#include <statstr.hrc>      //      -- " --
 #include <ptqueue.hxx>
 #include <tabfrm.hxx>
-#include <txtfrm.hxx>           // MinPrtLine
-#include <viscrs.hxx>          // SwShellCrsr
+#include <txtfrm.hxx>       // MinPrtLine
+#include <viscrs.hxx>       // SwShellCrsr
 #include <fmtpdsc.hxx>      // SwFmtPageDesc
 #include <globals.hrc>
 
 
 using namespace ::com::sun::star;
 
+//--------------------------------------------------------------------
+//Klasse zum Puffern von Paints
 class SwQueuedPaint
 {
 public:
@@ -189,6 +191,13 @@ void SwPaintQueue::Remove( ViewShell *pSh )
     }
 }
 
+/******************************************************************************
+ *  Methode     :   void SetSwVisArea( ViewShell *pSh, Point aPrtOffset, ...
+ *  Beschreibung:
+ *  Erstellt    :   OK 04.11.94 16:27
+ *  Aenderung   :
+ ******************************************************************************/
+
 void SetSwVisArea( ViewShell *pSh, const SwRect &rRect, sal_Bool /*bPDFExport*/ )
 {
     OSL_ENSURE( !pSh->GetWin(), "Drucken mit Window?" );
@@ -236,6 +245,13 @@ void ViewShell::InitPrt( OutputDevice *pOutDev )
         pOut = pOutDev;    //Oder was sonst?
 }
 
+/******************************************************************************
+ *  Methode     :   void ViewShell::ChgAllPageOrientation
+ *  Erstellt    :   MA 08. Aug. 95
+ *  Aenderung   :
+ ******************************************************************************/
+
+
 void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
 {
     OSL_ENSURE( nStartAction, "missing an Action" );
@@ -259,6 +275,10 @@ void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
             aNew.SetLandscape( bNewOri );
             SwFrmFmt& rFmt = aNew.GetMaster();
             SwFmtFrmSize aSz( rFmt.GetFrmSize() );
+            // Groesse anpassen.
+            // PORTRAIT  -> Hoeher als Breit
+            // LANDSCAPE -> Breiter als Hoch
+            // Hoehe ist die VarSize, Breite ist die FixSize (per Def.)
             if( bNewOri ? aSz.GetHeight() > aSz.GetWidth()
                         : aSz.GetHeight() < aSz.GetWidth() )
             {
@@ -272,6 +292,13 @@ void ViewShell::ChgAllPageOrientation( sal_uInt16 eOri )
     }
 }
 
+/******************************************************************************
+ *  Methode     :   void ViewShell::ChgAllPageOrientation
+ *  Erstellt    :   MA 08. Aug. 95
+ *  Aenderung   :
+ ******************************************************************************/
+
+
 void ViewShell::ChgAllPageSize( Size &rSz )
 {
     OSL_ENSURE( nStartAction, "missing an Action" );
@@ -312,6 +339,7 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
     SET_CURR_SHELL( this );
 
     SwRootFrm* pMyLayout = GetLayout();
+    // ULONG nStatMax = pLayout->GetPageNum();
 
     const SwFrm *pPage = pMyLayout->Lower();
     SwLayAction aAction( pMyLayout, Imp() );
@@ -330,9 +358,9 @@ void ViewShell::CalcPagesForPrint( sal_uInt16 nMax )
 
         aAction.Action();
 
-        aVisArea = aOldVis;
+        aVisArea = aOldVis;             //Zuruecksetzen wg. der Paints!
         Imp()->SetFirstVisPageInvalid();
-
+//       SwPaintQueue::Repaint();
     }
 
     pMyLayout->EndAllAction();
@@ -344,10 +372,15 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
 {
     OSL_ENSURE( this->IsA( TYPE(SwFEShell) ),"ViewShell::Prt for FEShell only");
     SwFEShell* pFESh = (SwFEShell*)this;
+    // Wir bauen uns ein neues Dokument
+//    SwDoc *pPrtDoc = new SwDoc;
+//    pPrtDoc->acquire();
+//    pPrtDoc->SetRefForDocShell( (SvEmbeddedObjectRef*)&(long&)rDocShellRef );
     pPrtDoc->LockExpFlds();
 
-    // Make a copy of it since it gets destroyed with the temporary document
-    // used for PDF export
+    // Der Drucker wird uebernommen
+    //! Make a copy of it since it gets destroyed with the temporary document
+    //! used for PDF export
     if (pPrt)
         pPrtDoc->setPrinter( new SfxPrinter(*pPrt), true, true );
 
@@ -357,15 +390,18 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
         if( 0 != ( pCpyItem = rPool.GetPoolDefaultItem( nWh ) ) )
             pPrtDoc->GetAttrPool().SetPoolDefaultItem( *pCpyItem );
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list